1 2009-06-15 Eric Blake <ebb9@byu.net>
3 Avoid compiler warning.
4 * m4/macro.c (process_macro): Use correct type for isdigit.
6 2009-06-13 Eric Blake <ebb9@byu.net>
8 Avoid snprintf link failures.
9 * ltdl/m4/gnulib-cache.m4: Import snprintf-posix module.
10 Reported by Ralf Wildenhues.
12 2009-06-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14 Avoid pointer arithmetic on `void *'.
15 * modules/m4.c (dump_symbol_CB): Cast obstack_base return value
16 to `char *' before using it.
18 2009-05-04 Eric Blake <ebb9@byu.net>
20 Silence verbose testsuite runs.
21 * tests/testsuite.at (m4_version_prereq): Bump to recent
22 autoconf.git version where stdout-nolog was added.
23 * tests/builtins.at (esyscmd, syscmd): Use new stdout-nolog.
24 * tests/freeze.at (AT_TEST_FREEZE): Likewise.
25 * tests/others.at (stderr closed): Likewise.
26 * HACKING: Mention new requirement.
27 * bootstrap: Likewise.
28 Reported by Ralf Wildenhues.
30 2009-04-21 Eric Blake <ebb9@byu.net>
32 Be more explicit about default quoting characters.
33 * doc/m4.texinfo (Quoted strings): Call out characters by name.
35 Suggested by Mehul Sanghvi.
37 2009-04-16 Eric Blake <ebb9@byu.net>
39 Use gnulib rename module.
40 * ltdl/m4/gnulib-cache.m4: Import rename module. At the moment,
41 we don't tickle either of the platform bugs that it fixes, but it
42 is better to be safe than sorry.
44 Require newer automake features.
45 * configure.ac (AM_INIT_AUTOMAKE): Add dist-xz, color-tests,
46 parallel-tests, and silent-rules. Drop dist-lzma.
47 * HACKING: Update minimum requirements.
48 * gnulib: Update to latest version.
50 Mention release of 1.4.13.
51 * NEWS: Update to match release on branch-1.4.
52 * doc/m4.texinfo (History): Update release history.
53 (copying): Finish conversion to GFDL 1.3, started 2008-11-04.
55 2009-03-23 Eric Blake <ebb9@byu.net>
57 Exploit git submodule by adding appropriate symlinks.
58 * bootstrap: No longer copy files from gnulib.
59 * COPYING: Change to symlink pointing into gnulib.
61 * build-aux/compile: Likewise.
62 * build-aux/config.guess: Likewise.
63 * build-aux/config.sub: Likewise.
64 * build-aux/depcomp: Likewise.
65 * build-aux/install-sh: Likewise.
66 * build-aux/mdate-sh: Likewise.
67 * build-aux/missing: Likewise.
68 * build-aux/texinfo.tex: Likewise.
69 * .cvsignore: Reflect these changes.
70 * .gitignore: Likewise.
71 * build-aux/.cvsignore: New file.
72 * build-aux/.gitignore: Likewise.
74 Make gnulib a git submodule.
75 * .gitmodules: New file.
76 * gnulib: Record which version of gnulib has been tested.
77 * bootstrap: Aid in submodule usage.
78 * cfg.mk (gnulib_dir): Alter default location of gnulib.
79 * HACKING: Mention how to use submodule.
81 2009-03-21 Eric Blake <ebb9@byu.net>
83 Use memcmp2 to simplify lexicographic comparisons.
84 * ltdl/m4/gnulib-cache.m4: Import memcmp2.
85 * modules/m4.c (dumpdef_cmp_CB): Use it.
87 2009-03-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
89 Fix m4.1 build race, exposed by parallelism through GNUmakefile.
90 * Makefile.am (SUBDIRS): Add doc.
91 (Documentation rules): Move ...
92 * doc/Makefile.am: ... to this new file.
93 * configure.ac (AC_CONFIG_FILES): Generate doc/Makefile.
95 2009-03-13 Eric Blake <ebb9@byu.net>
97 Try to tolerate spaces in directory names in testsuite.
98 * tests/null.m4: Provide shell quoting, in case __program__
101 Fix awk script portability.
102 * checks/get-them: In gsub, properly escape {.
103 Reported by Gary V. Vaughan.
105 Make bootstrap easier on Solaris.
106 * bootstrap: Add GNULIB_SRCDIR. Useful when a wrapper script
107 gnulib-tool exists earlier on the path to work around /bin/sh
108 failure in parsing $GNULIB_SRCDIR/gnulib-tool.
110 2009-03-13 Eric Blake <ebb9@byu.net>
112 Allow configuration choice in syscmd shell.
113 * ltdl/m4/m4-syscmd.m4: New file.
114 * configure.ac (M4_SYSCMD): Use it to provide
116 (AC_CHECK_HEADERS_ONCE): No longer need to worry about
118 * modules/m4.c (syscmd): Use it to avoid hard-coding the shell
120 * modules/gnu.c (esyscmd): Likewise.
121 * doc/m4.texinfo (Syscmd, Esyscmd): Document this.
122 * README: Document new configure option.
125 Use gnulib pipe module instead of popen(3).
126 * ltdl/m4/gnulib-cache.m4: Import pipe and wait-process modules.
127 * modules/gnu.c (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS):
129 (esyscmd): Rewrite with pipe module.
130 Resolves a failure on AIX, reported by Gary V. Vaughan.
132 Use gnulib execute module instead of system(3).
133 * ltdl/m4/gnulib-cache.m4: Import execute module.
134 * m4/utility.c (m4_info_name): New function.
135 * m4/m4module.h (m4_info_name): New prototype.
136 * modules/m4.c (syscmd): Rewrite with execute module.
137 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS, m4_sysval): Move
139 * modules/gnu.c (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS)
141 Resolves a failure on AIX, reported by Gary V. Vaughan.
143 2009-03-05 Eric Blake <ebb9@byu.net>
145 Improve web-manual maintainer rule.
146 * maint.mk (web-manual): Factor package-specific detail...
147 * cfg.mk (manual_title): ...to new variable.
149 2009-02-23 Eric Blake <ebb9@byu.net>
151 Speed up translit when from argument is short.
152 * modules/m4.c (translit): Use memchr2 when possible.
153 * tests/builtins.at (translit): Add tests.
154 * NEWS: Document this.
156 2009-02-18 Eric Blake <ebb9@byu.net>
158 Prefer buffer over byte operations.
159 * modules/format.c (format): Use memchr for speed.
160 * modules/gnu.c (substitute): Likewise.
161 * m4/macro.c (locate_dollar): Inline into only caller...
162 (process_macro): ...and rearrange for readability.
163 * m4/input.c (consume_buffer): Allow C++ compilation.
164 * doc/m4.texinfo (Changesyntax): Enhance test.
166 Speed up esyscmd with buffer reads.
167 * modules/gnu.c (esyscmd): Read blocks directly into obstack,
168 rather than repeatedly reading bytes. Detect read errors.
170 Avoid risk of stack overflow.
171 * m4/output.c (insert_file): Avoid stack allocation of large
174 Synchronize THANKS with branch.
175 * THANKS: Import more names.
177 Improve handling of $ in syntax table.
178 * m4/m4module.h (m4_is_syntax_single_dollar): New function.
179 (M4_SYNTAX_DOLLAR, M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): Change to
180 be context rather than basic syntax categories.
181 (M4_SYNTAX_MASKS): Adjust macro.
182 * m4/m4private.h (struct m4_syntax_table): Add dollar and
183 is_single_dollar members.
184 (m4_is_syntax_single_dollar): Add fast alternative.
185 * m4/syntax.c (m4_syntax_create, reset_syntax_set): Adjust to
186 account for change to context categories.
187 (m4_set_syntax): Manage is_single_dollar.
188 (m4_is_syntax_single_dollar): New function.
189 * m4/macro.c (locate_dollar): New helper function.
190 (process_macro): Use it to speed up macro expansion.
191 * m4/input.c (m4__next_token): Adjust client.
192 * doc/m4.texinfo (Changesyntax): Document this.
194 2009-02-17 Eric Blake <ebb9@byu.net>
196 Sync changecom documentation with branch.
197 * doc/m4.texinfo (Changecom): Tweak wording.
198 * NEWS: Import changes from the branch.
200 Stage 29b: Process quotes and comments by buffer, not bytes.
201 Search for quote and comment delimiters by buffer when possible.
203 Speed impact: noticeable improvement, from fewer function calls.
204 * ltdl/m4/gnulib-cache.m4: Import memchr2 module.
205 * m4/input.c (m4__next_token): Add buffer reads to quote and
207 * NEWS: Document this.
209 2009-02-16 Eric Blake <ebb9@byu.net>
211 Stage 29a: Process dnl and macro names by buffer, not bytes.
212 Enhance input engine to provide lookahead buffer, rather than
213 forcing clients to call next_char for every byte. Utilize this
214 for the simplest clients.
216 Speed impact: noticeable improvement, from fewer function calls.
217 * ltdl/m4/gnulib-cache.m4: Import freadptr and freadseek modules.
218 * m4/input.c (struct input_funcs): Add virtual functions
219 buffer_func and consume_func.
220 (file_buffer, file_consume, string_buffer, string_consume)
221 (composite_buffer, composite_consume, eof_buffer): Implement
223 (file_funcs, string_funcs, composite_funcs, eof_funcs): Update
225 (buffer_retry): New sentinel.
226 (next_buffer, consume_buffer): New functions.
227 (m4_skip_line, match_input, consume_syntax): Use them for faster
229 Suggested by Bruno Haible.
231 Unify single and multi-character delimiter handling.
232 * m4/input.c (MATCH): Add a parameter.
233 (m4__next_token): Simplify logic and reduce redundancy.
234 (m4__next_token_is_open): Adjust caller.
235 * m4/syntax.c (m4_set_comment, m4_set_quotes): Handle delimiters
236 of differing lengths.
237 (m4_set_syntax): Recognize restoration of single delimiters.
239 Revamp changesyntax vs. changequote interactions.
240 * m4/m4module.h (M4_SYNTAX_VALUE): Delete unused macro.
241 (M4_SYNTAX_SUSPECT): New macro.
242 * m4/m4private.h (struct m4_syntax_table): Add suspect field.
243 * m4/syntax.c (check_is_single_quotes, check_is_single_comments)
244 (check_is_macro_escaped): Delete, by inlining body...
245 (m4_set_syntax): ...into here. Improves handling between
246 changesyntax and changequote/changecom.
247 (add_syntax_set, subtract_syntax_set, set_syntax_set): Simplify,
248 and let suspect field track needed cleanup.
249 (m4_set_quotes, m4_set_comment): Adjust meaning of
250 is_single_quotes and is_single_comment flags to always be true if
251 only one delimiter exists, regardless of its length. Ensure that
252 the syntax categories M4_SYNTAX_LQUOTE and M4_SYNTAX_BCOMM are
253 only used on 1-byte delimiters.
254 (add_syntax_attribute, remove_syntax_attribute): Change signature
255 to allow the use of fewer casts. Adjust the suspect field when
257 (m4_reset_syntax, set_quote_age): Adjust callers.
258 * m4/input.c (m4__next_token, m4__next_token_is_open): Simplify
260 * doc/m4.texinfo (Changesyntax): Update documentation and tests.
262 Improve changesyntax documentation.
263 * doc/m4.texinfo (Changesyntax): Merge two tables into one
266 Fix regression in multicharacter quotes, from 2008-01-26.
267 * m4/input.c (m4__next_token): Fix typo.
268 * tests/builtins.at (changequote): Enhance test.
270 2009-02-13 Eric Blake <ebb9@byu.net>
272 Speed up parsing when detecting input file change.
273 * m4/input.c (next_char): Clear input_change flag. Bug introduced
276 2009-02-12 Eric Blake <ebb9@byu.net>
278 Avoid quadratic code when walking definition stack.
279 * examples/stack_sep.m4: Use linear, not quadratic
281 * doc/m4.texinfo (Improved copy): Fix documentation, based on
282 recent autoconf bug fix.
283 * tests/others.at (recursion): Enhance test.
285 2009-02-11 Eric Blake <ebb9@byu.net>
287 Stage 28c: Warn on embedded NUL in remaining cases.
288 Ensure all remaining warnings can handle embedded NUL.
290 Speed impact: none noticed.
291 * m4/m4module.h (m4_debug_decode, m4_parse_truth_arg): Add
293 * m4/macro.c (m4_macro_call): Improve diagnostic.
294 * modules/m4.c (defn): Likewise.
295 * m4/debug.c (m4_debug_decode): Handle embedded NUL.
296 * m4/utility.c (m4_parse_truth_arg): Likewise.
297 * modules/format.c (arg_int, arg_long, arg_double): Likewise.
298 (arg_string): New function.
299 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Update callers.
300 * src/main.c (main): Likewise.
301 * src/freeze.c (reload_frozen_state): Likewise.
302 * modules/gnu.c (debugmode, syncoutput): Likewise.
303 * tests/options.at (--regexp-syntax): Adjust test.
304 * tests/freeze.at (reloading nul): Likewise.
305 * tests/null.m4: Likewise.
306 * tests/null.out: Likewise.
307 * tests/null.err: Likewise.
309 Stage 28b: Warn on embedded NUL in file arguments.
310 Quote warning messages related to file and other NUL-terminated
313 Speed impact: none noticed.
314 * m4/path.c (m4_path_search): Quote file names in message.
315 * modules/m4.c (syscmd, include, m4_make_temp): Handle embedded
317 * modules/gnu.c (debugfile, esyscmd): Likewise.
318 * tests/others.at (nul character): Adjust test.
319 * tests/builtins.at (mkdtemp, mkstemp): Likewise.
320 * tests/null.m4: Likewise.
321 * tests/null.out: Likewise.
322 * tests/null.err: Likewise.
324 Stage 28a: Warn on embedded NUL in numeric arguments.
325 Quote warning messages related to numeric parsing in order to
328 Speed impact: none noticed.
329 * m4/m4module.h (m4_numeric_arg): Adjust prototype.
330 * m4/utility.c (m4_numeric_arg): Add parameter.
331 * modules/gnu.c (debuglen): Adjust callers.
332 * modules/m4.c (incr, decr, divert, undivert, m4exit, substr)
334 * modules/evalparse.c (m4_evaluate): Likewise.
335 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
336 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
338 * doc/m4.texinfo (Changesyntax): Fix typo.
339 * tests/others.at (nul character): Adjust test.
340 * tests/null.m4: Likewise.
341 * tests/null.out: Likewise.
342 * tests/null.err: Likewise.
344 2009-02-11 Eric Blake <ebb9@byu.net>
346 Avoid regression in popdef(undef).
347 * doc/m4.texinfo (Trace): Enhance test, to cover regression
348 recently fixed on the branch.
350 2009-02-09 Eric Blake <ebb9@byu.net>
352 Enhance index to support starting offset.
353 * modules/m4.c (index): Add optional third argument.
354 * NEWS: Document this.
355 * doc/m4.texinfo (Index macro): Likewise.
356 (Macro Arguments): Adjust tests.
358 2009-01-24 Eric Blake <ebb9@byu.net>
360 Add URLs to --help output.
361 * src/main.c (usage): Use enhanced version-etc features.
363 2009-01-07 Eric Blake <ebb9@byu.net>
365 Enhance substr to support replacement text.
366 * doc/m4.texinfo (Substr): Document new semantics.
367 * modules/m4.c (substr): Support optional fourth argument.
368 * NEWS: Document this.
370 Enhance substr to support negative values.
371 * doc/m4.texinfo (Substr): Document new semantics, and how to
373 * modules/m4.c (substr): Support negative values.
374 * NEWS: Document this.
376 2009-01-05 Eric Blake <ebb9@byu.net>
379 * HACKING: Remove mention of xdelta.
380 * Makefile.am (EXTRA_DIST, MAINTAINERCLEANFILES): Let gnulib take
381 care of distributing gendocs.sh.
382 * maint.mk (web-manual): Use new feature of gendocs.
383 * ltdl/m4/gnulib-cache.m4: Regenerate.
385 2008-12-24 Eric Blake <ebb9@byu.net>
387 Relax eval as allowed by POSIX 2008.
388 * modules/evalparse.c (m4_evaluate): Warn, not error, on invalid
389 operator. Quote expression in warning.
390 * modules/mpeval.c (includes): Add quotearg.h.
391 * doc/m4.texinfo (Eval, Improved forloop): Update tests.
392 * NEWS: Update to reflect 1.6 support for `?:'.
394 2008-12-23 Eric Blake <ebb9@byu.net>
396 Add debugmode(o) to control dumpdef output location.
397 * m4/m4module.h (M4_DEBUG_TRACE_OUTPUT_DUMPDEF): New enumerator.
398 (M4_DEBUG_TRACE_VERBOSE): Update.
399 * m4/debug.c (m4_debug_decode): Support new debug option.
400 * src/freeze.c (produce_debugmode_state): Likewise.
401 * modules/m4.c (dumpdef): When set, force dumpdef to stderr rather
403 * src/main.c (usage): Document it.
404 * doc/m4.texinfo (Debugmode, Dumpdef, Debugging options)
405 (Debugfile): Likewise.
407 Based on an autoconf bug report by Paolo Bonzini.
409 Make --debugfile argument optional.
410 * src/main.c (long_options): Make the argument optional, to allow
411 setting debug file back to stderr.
412 (main): Make --debugfile order-dependent.
413 (usage): Document this.
414 * doc/m4.texinfo (Debugging options): Likewise.
416 * tests/options.at (--debugfile): Enhance test.
417 (--safer): Adjust to new semantics.
419 2008-12-22 Eric Blake <ebb9@byu.net>
422 * doc/m4.texinfo (Operation modes, Preprocessor features)
423 (Limits control, Frozen state, Debugging options)
424 (Dynamic loading features): Use lower case names in @var.
425 (Improved copy): Use @code, not @var, as appropriate.
427 2008-12-18 Eric Blake <ebb9@byu.net>
429 Deal with M4 1.4.x limitation on builtin tokens.
430 * doc/m4.texinfo (Composition): Mention limitation on curry.
431 (Improved copy): New node.
433 * examples/stack.m4: Likewise.
434 * examples/stack_sep.m4: New file.
435 * Makefile.am (dist_pkgdata_DATA): Distribute it.
437 2008-12-15 Eric Blake <ebb9@byu.net>
439 Double size of temp file cache.
440 * m4/output.c (tmp_file, tmp_file_owner): Split...
441 (tmp_file1, tmp_file2, tmp_file1_owner, tmp_file2_owner): ...into
443 (tmp_file2_recent): New variable.
444 (m4_tmpopen, m4_tmpclose, m4_tmpremove, m4_tmprename)
445 (m4_output_exit): Adjust callers.
447 Use fewer seeks on cached files.
448 * m4/output.c (m4_tmpfile): Use write, not append mode.
449 (m4_tmpopen): Add parameter to decide when to skip seeks.
450 (m4_tmprename, m4_make_diversion, insert_diversion_helper)
451 (m4_freeze_diversions): Adjust callers.
453 Cache most recently spilled diversion.
454 * m4/output.c (tmp_file, tmp_file_owner): New variables, for
455 1-deep cache of spilled diversions.
456 (m4_tmpfile): Open in append mode, since we might revisit
457 diversion without closing it now.
458 (m4_tmpopen): Check cache first.
459 (m4_tmpclose): Update cache, rather than closing. Add parameter.
460 (m4_tmpremove): Close cache before removing.
461 (m4_tmprename): Deal with open files when renaming.
462 (m4_output_exit): Close cache before exiting.
463 (make_room_for, m4_make_diversion, insert_diversion_helper):
465 * ltdl/m4/m4-rename.m4 (M4_RENAME): New file.
466 * configure.ac (M4_RENAME): Invoke it.
468 Correctly track size of in-memory diversions.
469 * m4/output.c (insert_diversion_helper): Correctly track total
470 in-memory diversion size after undivert.
472 Avoid quadratic behavior for some cases of divert/undivert.
473 * m4/output.c (struct m4_diversion): Improve comments.
474 (m4_tmpname, m4_make_diversion): Strengthen preconditions.
475 (m4_tmprename): New function.
476 (m4_output_init, m4_output_exit): Move after internal functions.
477 (make_room_for): Don't bother copying uninitialized bytes.
478 (insert_diversion_helper): Transfer metadata, rather than copying
479 contents, when undiverting into a previously unused diversion.
480 * tests/builtins.at (divert): Add a check to the test.
481 * doc/m4.texinfo (Undivert): Enhance test.
482 * NEWS: Document the speedup.
484 2008-12-02 Eric Blake <ebb9@byu.net>
486 Stage 27: Allow embedded NUL in text processing macros.
487 Pass NUL through regular expressions, format, and translit, and
488 diagnose it in eval and changeresyntax. Improve warning
489 capabilities of format.
491 Speed impact: none noticed.
492 * modules/m4.c (m4_expand_ranges): Don't append extra bytes.
493 (translit): Manage NUL bytes.
494 * modules/format.c (format): Likewise.
495 * modules/gnu.c (substitute, regexp_substitute): Likewise.
496 (m4_resyntax_encode_safe): Add parameter.
497 (regexp, patsubst, renamesyms): Update callers.
498 (regexp_compile): Adjust error message.
499 * modules/evalparse.c (m4_evaluate): Use consistent message.
500 (end_text): New variable.
501 (eval_init_lex): Add parameter.
502 (eval_lex): Detect embedded NUL.
503 * src/freeze.c (reload_frozen_state): Likewise.
504 * doc/m4.texinfo (Format): Update to cover new behavior.
505 (Eval): Mention that result is unquoted.
506 * tests/freeze.at (reloading nul): Enhance test.
507 * tests/null.m4: Likewise.
508 * tests/null.err: Update expected output.
509 * tests/null.out: Likewise.
510 * tests/options.at (--regexp-syntax): Likewise.
512 2008-11-28 Eric Blake <ebb9@byu.net>
514 Resync NEWS with branches.
515 * NEWS: Mention 1.4.12, update state of 1.6.
517 2008-11-26 Eric Blake <ebb9@byu.net>
519 Keep COPYING in repository.
520 * Makefile.am (MAINTAINERCLEANFILES): Don't remove COPYING.
521 * .cvsignore: Don't ignore it.
522 * .gitignore: Likewise.
523 * COPYING: Store in repository, per automake 1.10.2
526 2008-11-26 Eric Blake <ebb9@byu.net>
528 Document optimized forloop.
529 * doc/m4.texinfo (Improved forloop): Mention alternate style that
530 avoids define overhead.
531 * examples/forloop3.m4: New file.
532 * Makefile.am (dist_pkgdata_DATA): Distribute it.
534 Document copy composite using stack_foreach and curry.
535 * doc/m4.texinfo (Stacks): New node, to document pushdef stack
537 (Ifelse): Move define_blind...
538 (Composition): ...to this new node. Document currying, then use
539 it to implement copy and rename.
540 * examples/curry.m4: New file.
541 * examples/stack.m4: Likewise.
542 * Makefile.am (dist_pkgdata_DATA): Distribute them.
544 2008-11-04 Eric Blake <ebb9@byu.net>
547 * ltdl/m4/gnulib-cache.m4: Replace fdl module with fdl-1.3.
548 * Makefile.am (doc_m4_TEXINFOS, MAINTAINERCLEANFILES): Reflect
550 * doc/m4.texinfo (GNU Free Documentation License): Likewise.
552 2008-10-22 Eric Blake <ebb9@byu.net>
554 Give nicer error if user modifies testsuite but lacks autoconf.
555 * Makefile.am (AUTOM4TE): Use missing in the definition.
557 2008-10-09 Eric Blake <ebb9@byu.net>
559 Allow user to choose which sed to use in testsuite.
560 * tests/atlocal.in (SED): Inherit from configure results.
561 * tests/builtins.at (__m4_@&t@version__, divert, esyscmd)
562 (mkstemp, syscmd): Use $SED.
563 * tests/generate.awk (new_test): Likewise.
564 * tests/options.at (deprecated options, unknown option)
565 (--debugmode, --help and --version): Likewise.
566 * tests/testsuite.at (AT_CHECK_M4): Likewise.
567 * tests/others.at (directory, stderr closed, stdin seekable)
568 (stdout closed): Likewise.
569 (nul character): Likewise. Also, skip test if sed can't handle
572 Clean up testsuite invocation.
573 * tests/atlocal.in: Fix copyright notice.
574 * Makefile.am (TESTS_ENVIRONMENT): Delete; it wasn't being used.
575 (check-local, installcheck-local): Adjust clients. Add missing
578 2008-09-25 Eric Blake <ebb9@byu.net>
580 Tweak error message on command line failure.
581 * m4/m4private.h (includes): Use "quotearg.h".
582 * src/main.c (process_file, main): Use nicer quotes for file name
584 * m4/input.c (file_clean, m4_push_file): Likewise.
585 * m4/module.c (m4__module_open): Likewise.
586 * src/freeze.c (produce_frozen_state, reload_frozen_state):
588 * modules/gnu.c (debugfile): Likewise.
589 * modules/m4.c (undivert, include): Likewise.
590 * tests/others.at (directory, stdin closed): Update tests.
591 * tests/options.at (file names, --debugmode): Likewise.
592 * doc/m4.texinfo (Debugmode): Likewise.
594 Unify error handling for reading directories.
595 * m4/path.c (m4_path_search): Factor open attempts...
596 (m4_fopen): ...into new function, to reject directories.
597 * tests/others.at (directory): Enhance test.
598 * doc/m4.texinfo (Include): Document that directories cannot be
601 Avoid bugs on platforms that mishandle trailing /.
602 * ltdl/m4/gnulib-cache.m4: Import fopen module.
603 * tests/others.at (directory): New test.
605 2008-09-16 Eric Blake <ebb9@byu.net>
607 Fix bootstrap for Solaris /bin/sh.
608 * bootstrap: Avoid shell quoting pitfall.
610 2008-09-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
612 Typos in source code comments.
613 * modules/m4.c: Fix typos in comments.
614 * m4/input.c: Likewise.
615 * src/main.c: Likewise.
617 2008-08-29 Eric Blake <ebb9@byu.net>
619 Fix manual date information.
620 * doc/m4.texinfo: UPDATED refers to the day the manual was built,
621 not the release date of M4.
622 Based on a bison patch by Akim Demaille.
624 2008-08-27 Eric Blake <ebb9@byu.net>
627 * doc/m4.texinfo (Invoking m4): Fix example, since order of -d
631 2008-08-23 Eric Blake <ebb9@byu.net>
633 Allow debugmode control over whether defn(undef) warns.
634 * ltdl/m4/gnulib-cache.m4: Import verify module.
635 * m4/m4module.h (M4_DEBUG_TRACE_DEREF, M4_DEBUG_TRACE_INITIAL):
637 (M4_DEBUG_TRACE_VERBOSE, M4_DEBUG_TRACE_DEFAULT): Adjust.
638 * m4/m4.c (m4_create): Start with debugmode = d.
639 * src/main.c (usage): Mention this.
640 (main): Let -E impact debug mode.
641 * m4/utility.c (m4_symbol_value_lookup): Squelch undefined warning
643 * modules/gnu.c (builtin, inder): Likewise.
644 * m4/debug.c (m4_debug_decode): Parse new mode.
645 * src/freeze.c (produce_debugmode_state): Accomodate new mode.
646 * doc/m4.texinfo (Debugging options): Mention change in the
648 (Debugmode): Mention new flag d.
649 (Operation modes): Mention interaction with -E.
650 (Undefine, Defn, Pushdef, Indir, Builtin, Dumpdef): Document and
652 * tests/options.at (--debugmode): Update tests.
653 * tests/freeze.at (reloading debugmode): Likewise.
654 * NEWS: Document this.
655 Reported by Ralf Wildenhues; without this patch, M4 1.6+ would be
656 incompatible with Autoconf 2.62.
658 2008-08-22 Eric Blake <ebb9@byu.net>
660 Improve --debugmode behavior.
661 * m4/m4module.h (m4_debug_decode): Simplify interface.
662 * m4/debug.c (m4_debug_decode): Remove parameter, and handle
663 setting the new value.
664 * modules/gnu.c (debugmode): Adjust caller.
665 * src/freeze.c (reload_frozen_state): Likewise.
666 * src/main.c (main): Likewise.
667 (usage): Fix default for --debug.
668 * doc/m4.texinfo (Debugging options): Add an example.
670 2008-08-21 Eric Blake <ebb9@byu.net>
672 Avoid regression in defn(undef).
673 * doc/m4.texinfo (Trace): Enhance test, to cover regression
674 recently fixed on the branch.
676 2008-08-18 Eric Blake <ebb9@byu.net>
678 Remove deprecated -N option; fixes a regression from 2006-09-14.
679 * src/main.c (DIVERSIONS_OPTION): Delete.
680 (long_options, OPTSTRING, main): Remove -N/--diversions option.
681 * doc/m4.texinfo (Limits control): Remove it from the manual.
682 * NEWS: Mention that it is gone.
683 * tests/options.at (deprecated options): Update test.
685 Improve 'git diff' of manual source.
686 * .gitattributes (*.texi*): Add diff attribute.
687 * bootstrap: Tell git how to use it.
688 Inspired by Jim Meyering's similar patch for coreutils.
690 2008-08-07 Bruno Haible <bruno@clisp.org> (tiny change)
692 Run m4 tests prior to gnulib unit tests.
693 * Makefile.am (SUBDIRS): Swap order of directories.
695 2008-08-03 Eric Blake <ebb9@byu.net>
697 Stage 26: Allow embedded NUL in macro definitions.
698 Clean up final few locations that did not track macro definitions
699 by length, to allow embedded NUL. Make m4_arg_len callers aware
700 of issue of flattening builtins when determining length.
702 Speed impact: none noticed.
703 * m4/m4module.h (m4_arg_len): Add parameter.
704 (M4ARGLEN): Provide default for the parameter.
705 * m4/m4private.h (includes): Share xmemdup0.h among all libm4
707 * m4/macro.c (m4_arg_len): Fail if builtins are not flattened.
708 * m4/syntax.c (includes): Rely on m4private.h for xmemdup0.
709 * m4/symtab.c (includes): Likewise.
710 (m4_symbol_value_copy): Use xmemdup0.
711 * m4/module.c (install_macro_table): Likewise.
712 * src/freeze.c (reload_frozen_state): Likewise.
713 * tests/freeze.at (reloading nul): Enhance test.
714 * tests/null.m4: Likewise.
715 * tests/null.err: Update expected output.
716 * tests/null.out: Likewise.
718 Fix regression in commenting unbalanced quotes, from 2008-02-16.
719 * m4/m4private.h (m4__token_type): Add M4_TOKEN_COMMENT.
720 * m4/input.c (m4__next_token, m4_print_token): Supply new token
722 * m4/macro.c (expand_token): Penalize comments, as they can
723 contain unbalanced quotes; latent bug since 2007-12-07, exposed by
724 passing $@ references built from comments.
725 (expand_argument): Adjust caller.
726 * tests/others.at (Comments): Enhance test to catch it.
727 * NEWS: Mention the fix.
729 2008-07-30 Eric Blake <ebb9@byu.net>
731 Fix regression in trace output, introduced 2008-05-08.
732 * m4/input.c (m4__push_symbol): When cloning chains, break pointer
733 back to original chain; latent bug from 2008-02-02 that did not
734 cause misbehavior until trace output read unfinished chain.
735 * tests/builtins.at (debug): Add test for this.
737 2008-07-28 Eric Blake <ebb9@byu.net>
739 Optimize iteration examples.
740 * examples/forloop2.m4: Avoid excess indir, by passing current
741 counter value as parameter.
742 * examples/foreachq3.m4: Avoid unneeded ifelse, by injecting an
744 * doc/m4.texinfo (Improved forloop, Improved foreach): Update the
745 documentation to match.
747 2008-07-26 Eric Blake <ebb9@byu.net>
749 Give example for O(n) foreach on m4 1.4.x.
750 * examples/foreachq4.m4: New file.
751 * Makefile.am (dist_pkgdata_DATA): Distribute it.
752 * tests/others.at (recursion): Test it.
753 * doc/m4.texinfo (Improved foreach): Document linear foreach with
754 m4 1.4.5 and greater.
756 2008-07-19 Eric Blake <ebb9@byu.net>
758 Resynchronize docs from branch.
759 * doc/m4.texinfo (Undefine, Pushdef): Mention warning on undefined
760 name, particularly since the old documentation didn't match code.
761 (Standard Modules): Add caveat about using __m4_version__.
763 2008-07-11 Eric Blake <ebb9@byu.net>
765 Bump required automake to 1.10a; regression introduced 2008-01-22.
766 * configure.ac (AM_INIT_AUTOMAKE): Undo requirement downgrade to
767 1.10.1, since we also rely on pkglibexecdir.
768 * HACKING: Fix minimum requirement.
769 * bootstrap: Likewise.
771 Reported by Joel E. Denny.
773 Avoid bogus whitespace in @ovar, @dvar.
774 * doc/m4.texinfo (ovar, dvar): Add @c.
775 Based on patch by Ralf Wildenhues to Autoconf manual.
777 2008-06-23 Eric Blake <ebb9@byu.net>
779 Adjust to new gnulib-tool layout.
780 * ltdl/m4/gnulib-cache.m4: Reformat.
782 Fix bootstrap comment.
783 * bootstrap: DOWNLOAD_PO was previously removed.
785 2008-06-19 Eric Blake <ebb9@byu.net>
787 Revert speed regression from 2008-06-16.
788 * m4/output.c (m4_shipout_int): Avoid obstack_printf in hot path.
789 * modules/m4.c (numb_obstack): Likewise.
790 * m4/input.c (MATCH): Use fewer conditionals, and factor
792 (match_input): ...here for smaller code size.
793 * m4/syntax.c (m4_reset_syntax, m4_set_quotes, m4_set_comment):
794 Supply trailing NUL to delimiters, to meet contract of faster
797 2008-06-18 Eric Blake <ebb9@byu.net>
800 * m4/m4module.h: Use consistent spacing for pointer parameters.
801 * m4/m4private.h: Likewise.
803 Stage 25b: Handle embedded NUL in changesyntax and friends.
804 Track quote and comment delimiters by length, to allow embedded
805 NUL. Improve changesyntax to support assigning syntax to NUL.
807 Speed impact: none noticed.
808 * m4/m4module.h (m4_set_quotes, m4_set_comment, m4_set_syntax):
810 (m4_reset_syntax): New prototype.
811 * m4/syntax.c (add_syntax_set, subtract_syntax_set)
812 (set_syntax_set, m4_set_quotes, m4_set_comment): Add parameter, to
814 (m4_set_syntax): Likewise. Also, split code to reset the table...
815 (m4_reset_syntax): ...into a new function.
816 (m4_syntax_create): Adjust callers.
817 * m4/input.c (match_input, MATCH): Add parameter.
818 (m4__next_token, m4__next_token_is_open): Adjust callers.
819 * modules/m4.h (m4_expand_ranges_func): Add parameter.
820 * modules/m4.c (dumpdef): Handle NUL in dumped quotes.
821 (changequote, changecom, translit, m4_expand_ranges): Track
823 * modules/gnu.c (changesyntax): Handle embedded NUL.
824 * src/freeze.c (reload_frozen_state): Adjust callers.
825 * tests/freeze.at (reloading nul): Enhance test.
826 * tests/null.m4: Likewise.
827 * tests/null.out: Update expected output.
828 * tests/null.err: Likewise.
830 2008-06-16 Eric Blake <ebb9@byu.net>
832 Stage 25a: Use obstack_printf for easier output.
833 Convert macro tracing and other locations to use obstack_printf
834 rather than hand-rolled equivalents. Ensure that embedded NUL in
835 trace output does not truncate the trace string.
837 Speed impact: noticeable penalty, from obstack_printf overhead.
838 * ltdl/m4/gnulib-cache.m4: Import obstack-printf-posix module.
839 * m4/macro.c (trace_format): Delete; use obstack_printf instead.
840 (trace_header, trace_pre, trace_post): All callers updated.
841 * m4/output.c (m4_shipout_int, m4_tmpname): Use obstack_printf.
842 (m4_divert_text): Speed up syncline output.
843 * modules/m4.c (dumpdef): Handle embedded NUL.
844 (numb_obstack): Speed up eval output.
845 (maketemp): Use obstack_printf.
846 * modules/format.c (format): Likewise.
848 Add missing const qualifications.
849 * m4/resyntax.c (m4_resyntax_map): Declare array elements as
851 * modules/gnu.c (m4_builtin_table, m4_macro_table): Likewise.
852 * modules/import.c (m4_builtin_table): Likewise.
853 * modules/load.c (m4_builtin_table, m4_macro_table): Likewise.
854 * modules/m4.c (m4_builtin_table): Likewise.
855 * modules/modtest.c (m4_builtin_table, m4_macro_table): Likewise.
856 * modules/mpeval.c (m4_builtin_table, m4_macro_table): Likewise.
857 * modules/perl.c (m4_builtin_table, m4_macro_table): Likewise.
858 * modules/shadow.c (m4_builtin_table, m4_macro_table): Likewise.
859 * modules/stdlib.c (m4_builtin_table): Likewise.
860 * modules/time.c (m4_builtin_table): Likewise.
861 * modules/traditional.c (m4_macro_table): Likewise.
863 2008-06-10 Eric Blake <ebb9@byu.net>
865 Avoid corrupted frozen file if NUL appears on block boundary.
866 * m4/output.c (insert_file): Separate consecutive quotearg blocks
867 with \<newline>, in case last byte of first block was NUL.
869 2008-06-03 Eric Blake <ebb9@byu.net>
871 Fix printf type mismatches.
872 * m4/m4module.h (m4_bad_argc): Alter parameter type.
873 * m4/m4private.h (struct m4_call_info): Alter call_id type.
874 * m4/macro.c (expand_macro, m4__adjust_refcount): Use correct
876 * m4/utility.c (m4_bad_argc): Likewise.
878 Borrow bootstrap ideas from gnulib.
879 * bootstrap (options, DOWNLOAD_PO): Remove --download-po; the
880 advertized subset of languages didn't work. Use --skip-po
881 instead, for consistency with gnulib bootstrap.
882 (func_get_translations): Use rsync, not wget.
883 (func_update_po): Use a reference directory, to avoid changing
884 timestamps on unchanged .po files.
885 * TODO: Update accordingly.
887 Fix fallout from previous patch.
888 * doc/m4.texinfo (Builtin): Adjust expected output.
890 2008-06-02 Eric Blake <ebb9@byu.net>
892 Stage 24c: Improve display of macro names with embedded NUL.
893 Quote instances of problematic characters in macro names when
894 presented to user. Track location via call_info rather than
895 munging context for every expansion.
897 Speed impact: slight penalty, due to more bookkeeping.
898 * m4/m4module.h (m4_push_string_init): Add parameters.
899 * m4/m4private.h (struct m4_macro_args): Remove argv0 and
900 argv0_len, now redundant with info.
901 (m4__push_wrapup_init): Add parameter.
902 * m4/input.c (m4_push_string_init, m4__push_wrapup_init): Track
903 location from caller, rather than context.
904 (composite_peek, composite_read, match_input): Adjust callers.
905 * m4/utility.c (m4_symbol_value_lookup): Quote macro name.
906 (m4_verror_at_line): Allow NUL in macro name.
907 * m4/macro.c (trace_flush, m4_trace_prepare, trace_pre): Allow NUL
909 (expand_macro): No longer munge context location.
910 (collect_arguments, m4_arg_text, m4_arg_empty, m4_arg_len)
911 (m4_make_argv_ref, m4_push_arg, m4_wrap_args): Adjust callers.
912 * modules/gnu.c (builtin, indir): Likewise.
913 * tests/null.m4: Enhance test.
914 * tests/null.err: Adjust expected output.
915 * tests/null.out: Likewise.
917 Stage 24b: Allow embedded NUL in macro names.
918 Use length rather than NUL-termination when tracking macro names.
919 All APIs dealing with symbol table changed.
921 Speed impact: slight penalty, due to more bookkeeping.
922 * m4/m4module.h (m4_symtab_apply_func, m4_symbol_lookup)
923 (m4_symbol_pushdef, m4_symbol_define, m4_symbol_popdef)
924 (m4_symbol_rename, m4_symbol_delete): Add length parameter.
925 (m4_string): New type.
926 * ltdl/m4/gnulib-cache.m4: Import xmemdup0 module.
927 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): Account for
929 * m4/symtab.c (m4_symtab_delete, m4_symtab_apply, symtab_fetch)
930 (m4__symtab_remove_module_references, symbol_destroy_CB)
931 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_define)
932 (m4_symbol_popdef, m4_symbol_rename, m4_set_symbol_name_traced)
933 (m4_symbol_delete): Likewise.
934 * modules/m4.h (struct m4_dump_symbol_data): Adjust type to allow
936 * m4/macro.c (expand_token): Adjust all callers.
937 * m4/module.c (install_builtin_table, install_macro_table):
939 * m4/utility.c (m4_symbol_value_lookup): Likewise.
940 * modules/gnu.c (indir, renamesyms, m4symbols): Likewise.
941 * modules/m4.c (define, undefine, pushdef, popdef)
942 (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols, dumpdef)
943 (traceon, traceoff): Likewise.
944 * src/main.c (main): Likewise.
945 * src/freeze.c (dump_symbol_CB, reload_frozen_state): Likewise.
946 * tests/freeze.at (reloading nul): Augment test.
947 * tests/null.out: Adjust expected output.
949 Stage 24a: Use full call context in error reporting.
950 Replace const char *macro_name with const m4_call_info *call, so
951 that the next patch can pass the length of macro_name with
952 embedded NUL. Simplifies handling of global state.
954 Speed impact: none noticed.
955 * m4/m4module.h (m4_error, m4_warn): Change parameter type.
956 (m4_error_at_line, m4_warn_at_line): Delete.
957 (m4_debug_set_output, m4_skip_line, m4_bad_argc, m4_numeric_arg)
958 (m4_parse_truth_arg, m4_symbol_value_lookup): Adjust all clients.
959 * m4/m4private.h (m4__next_token): Likewise.
960 * m4/utility.c (m4_verror_at_line): Alter parameter, and use
961 caller's location if caller is provided.
962 (m4_error, m4_warn): Change parameter type.
963 (m4_error_at_line, m4_warn_at_line): Delete.
964 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg)
965 (m4_symbol_value_lookup): Adjust all callers.
966 * m4/debug.c (set_debug_file, m4_debug_set_output): Likewise.
967 * m4/input.c (m4_skip_line, m4__next_token): Likewise.
968 * m4/macro.c (expand_argument, collect_arguments, m4_macro_call)
969 (process_macro): Likewise.
970 * modules/m4.h (m4_make_temp_func): Likewise.
971 * modules/evalparse.c (m4_evaluate): Likewise.
972 * modules/format.c (arg_int, arg_long, arg_double, format):
974 * modules/gnu.c (builtin, changeresyntax, changesyntax, debugfile)
975 (debuglen, debugmode, esyscmd, indir, mkdtemp, patsubst, regexp)
976 (renamesyms, syncoutput, regexp_compile, substitute)
977 (regexp_substitute, m4_resyntax_encode_safe): Likewise.
978 * modules/m4.c (define, undefine, pushdef, popdef, ifdef, ifelse)
979 (m4_dump_symbols, defn, syscmd, incr, decr, divert, undivert, dnl)
980 (include, maketemp, mkstemp, m4exit, traceon, traceoff, substr):
982 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
983 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
985 * tests/options.at (--syncoutput): Add test for invalid
986 command-line argument. Split xfailed portion...
987 (--syncoutput and diversions): ...into new test.
988 (unknown option): New test.
989 * tests/freeze.at (reloading unknown builtin): Update expected
992 Adjust to recent gnulib change.
993 * configure.ac (AB_INIT): Delete, now that gnulib does this.
995 2008-05-28 Eric Blake <ebb9@byu.net>
997 Improve frozen debugmode behavior.
998 * m4/debug.c (m4_debug_decode): Make empty debugmode additive.
999 * src/main.c (main): Interleave -d with files.
1000 * tests/options.at (--debugmode): Update test.
1001 * tests/freeze.at (reloading debugmode): New test.
1002 * doc/m4.texinfo (Debugging options, Debugmode): Document the
1006 2008-05-27 Eric Blake <ebb9@byu.net>
1008 Fix some testsuite failures on Solaris 8.
1009 * tests/builtins.at (esyscmd, syscmd): Skip tests if system(2) is
1011 * tests/others.at (stderr closed): Likewise. Also support Solaris
1013 (stdin closed): Skip test if closed stdin gets reopened.
1014 (stdout closed): Support Solaris wording for EBADF.
1015 * tests/testsuite.at (AT_CHECK_M4): Likewise.
1017 Fix configure message nesting, broken since 2001-09-20.
1018 * ltdl/m4/gmp.m4 (M4_LIB_GMP): Don't cache result; the test is
1019 not expensive, and AC_MSG_WARN doesn't work in AC_CACHE_CHECK.
1021 Support 'make dist' with BSD make.
1022 * Makefile.am (TESTSUITE_AT, MAINTAINERCLEANFILES): Qualify uses
1023 of the generated file tests/generated.at.
1024 (EXTRA_DIST, $(TESTSUITE)): Likewise for tests/package.m4.
1025 * tests/others.at (stdout closed): Accomodate OpenBSD /bin/sh.
1027 2008-05-24 Eric Blake <ebb9@byu.net>
1029 Test NUL in frozen files.
1030 * tests/testsuite.at (AT_CHECK_M4): Add parameter.
1031 * tests/freeze.at (reloading nul): New test.
1032 (AT_TEST_FREEZE): Inhibit -d when reloading frozen file.
1033 (reloading unknown builtin): Likewise.
1035 2008-05-23 Eric Blake <ebb9@byu.net>
1037 Improve handling of frozen file errors.
1038 * src/freeze.c (produce_frozen_state): Detect write failures.
1039 (reload_frozen_state): Use close_stream.
1040 * tests/freeze.at (freezing failure): New test.
1042 Reported by Jean-Charles Longuet.
1044 2008-05-19 Eric Blake <ebb9@byu.net>
1046 In frozen file, split consecutive strings with newline.
1047 * src/freeze.c (dump_symbol_CB): Add newline to 'T', 'F'.
1048 (produce_frozen_state): Likewise for 'Q', 'C'.
1049 (reload_frozen_state): Parse the new layout.
1050 [GET_DIRECTIVE]: Fix format 1 regression from 2008-05-13.
1051 * tests/freeze.at (loading format 2): Rewrite to new format.
1052 (reloading unknown builtin): Likewise.
1053 (loading format 1): Make sure backslash-newline is not
1055 * doc/m4.texinfo (Frozen file format 2): Document the format.
1056 * NEWS: Document this change.
1058 Fix xgettext options.
1059 * po/Makevars (XGETTEXT_OPTIONS): The " must be passed to
1062 Fix spelling of René Seindal's name in --version output.
1063 * ltdl/m4/gnulib-cache.m4: Import propername module.
1064 * src/main.c (AUTHORS): Rewrite in terms of proper_name.
1065 * po/Makevars (XGETTEXT_OPTIONS): Detect new functions.
1066 * HACKING: Mention new prerequisite of gperf.
1068 2008-05-18 Eric Blake <ebb9@byu.net>
1070 Allow freezing the trace status of macros.
1071 * src/freeze.c (produce_symbol_dump): Let undefined traced macros
1073 (dump_symbol_CB): Also freeze trace state.
1074 * tests/freeze.at (reloading traced macros): New test.
1075 * doc/m4.texinfo (Using frozen files): Update documentation to
1077 (Frozen file format 1): Improve synchronization with branch.
1078 (Frozen file format 2): Reorder directives, and add `d', `t'.
1079 * NEWS: Document this change.
1081 2008-05-15 Eric Blake <ebb9@byu.net>
1083 Fix frozen file regression in pushdef stacks from 2001-09-01.
1084 * src/freeze.c (dump_symbol_CB): Push all values on the stack, not
1085 just the current definition.
1086 (reverse_symbol_value_stack): New helper method.
1087 * tests/freeze.at (AT_TEST_FREEZE): New helper macro.
1088 (reloading pushdef stack): New test.
1089 (reloading unknown builtin): Enhance test.
1091 2008-05-13 Eric Blake <ebb9@byu.net>
1093 Fix frozen file regression in diversions from 2007-01-21.
1094 * m4/output.c (insert_diversion_helper): Add parameter.
1095 (m4_insert_file): Move contents...
1096 (insert_file): ...to this new helper, with added parameter.
1097 (m4_insert_diversion, m4_undivert_all, m4_freeze_diversions):
1099 * src/freeze.c (produce_mem_dump): Simplify.
1100 * tests/freeze.at (large diversion): Test for this.
1102 Improve error message when frozen file is invalid.
1103 * src/freeze.c (decode_char): Add parameter. Allow \<newline>
1105 (reload_frozen_state): Track current line.
1106 * tests/freeze.at (loading format 1, loading format 2): Update to
1109 2008-05-10 Eric Blake <ebb9@byu.net>
1111 Detect integer overflow when loading frozen file.
1112 * src/freeze.c (reload_frozen_state) [GET_NUMBER]: Rewrite to fail
1113 immediately on overflow.
1114 * tests/freeze.at (loading format 2): Test this.
1115 Reported by Jim Meyering.
1117 2008-05-08 Eric Blake <ebb9@byu.net>
1119 Stage 23: allow tracing of indirect macro calls.
1120 Track all trace information as part of the argv struct, rather
1121 than temporarily resetting global state. Teach indir to trace
1122 macros that it invokes.
1123 Memory impact: slight penalty, due to larger argv struct.
1124 Speed impact: none noticed.
1125 * m4/m4module.h (m4_input_block): Remove.
1126 (m4_call_info): New opaque type.
1127 (m4_trace_prepare, m4_arg_info): New prototypes.
1128 (m4_macro_call, m4_push_string_finish, m4_input_print): Change
1130 * m4/m4private.h (struct m4_macro_args): Add info field.
1131 (struct m4_call_info): New structure.
1132 (m4_arg_info): New accessor.
1133 * m4/input.c (m4_input_block): Make typedef local.
1134 (m4_push_string_init): Initialize length.
1135 (m4_push_string_finish, m4_input_print): Change signature, so that
1136 printing can be done before finalization.
1137 (struct input_funcs): Add parameter to print_func.
1138 (file_print, string_print, composite_print): Adjust accordingly.
1139 * m4/macro.c (trace_header, trace_flush, trace_pre, trace_post):
1140 Change signatures for stacked trace messages, and for using call
1142 (trace_prepre): Export and rename...
1143 (m4_trace_prepare): ...to this, for use by indir. Alter signature
1144 to use call context.
1145 (collect_arguments): Alter signature, to manage new field.
1146 (expand_macro): Change call context management. Move tracing...
1147 (m4_macro_call): ...here. Remove redundant parameter.
1148 (m4_arg_argc): New function.
1149 (m4_make_argv_ref): Replace unused skip parameter with new trace
1150 parameter; manage new field.
1151 * modules/gnu.c (builtin, indir): Adjust callers.
1152 * src/main.c (usage): Update debugmode flag summary.
1153 * tests/null.m4: Enhance test.
1154 * tests/null.err: Update expected output.
1155 * tests/macros.at (Tracing Hanoi Towers): Likewise.
1156 * doc/m4.texinfo (Trace): Mention more about trace formatting.
1157 (Debugmode): Enhance description of 'c' and 'x'. Enhance test to
1158 cover line numbering details in traces.
1159 (Debuglen): Enhance test to cover indir tracing.
1160 * NEWS: Mention these changes.
1161 Reported by Akim Demaille in the autoconf TODO file in 2000.
1163 2008-05-07 Eric Blake <ebb9@byu.net>
1165 Test for traceon regression just fixed in branch-1.6.
1166 * doc/m4.texinfo (Trace): Enhance test.
1167 * NEWS: Port news item from branch.
1169 2008-05-05 Eric Blake <ebb9@byu.net>
1171 Stage 22: allow builtin token concatenation outside $@.
1172 Adjust the input and argument parsing engines to append builtins
1173 alongside text. Make define warn when builtins must be
1175 Memory impact: slight penalty, with fewer builtins flattened.
1176 Speed impact: slight penalty, from more bookkeeping.
1177 * m4/m4module.h (m4_is_arg_composite): New prototype.
1178 (m4_symbol_value_copy): Change return type.
1179 (m4_arg_text): Add parameter.
1180 (M4ARG): Adjust callers.
1181 * m4/m4private.h: Adjust comments.
1182 * m4/symtab.c (m4_symbol_value_copy): Detect when builtins are
1184 * m4/input.c (init_builtin_token): Add parameter, and allow
1185 concatenating builtins.
1186 (m4__next_token): Adjust caller.
1187 * m4/macro.c (m4_is_arg_composite): New function.
1188 (expand_argument): Allow builtin concatenation.
1189 (m4_arg_text): Add parameter.
1190 (m4__arg_adjust_refcount, m4__arg_print): Adjust callers.
1191 (m4_arg_equal): Fix comparison of builtin tokens.
1192 * modules/m4.c (define, pushdef): Warn when flattening builtins.
1193 * doc/m4.texinfo (Define): Remove dead comment.
1194 (Defn): Update to reflect code changes.
1195 * tests/builtins.at (defn): Remove xfail.
1196 * NEWS: Document this change.
1198 2008-05-03 Eric Blake <ebb9@byu.net>
1200 Document define_blind.
1201 * doc/m4.texinfo (Ifelse): Add a new composite macro.
1203 Suggested by Mike R.
1205 2008-05-01 Eric Blake <ebb9@byu.net>
1207 Avoid -Wshadow compiler warnings.
1208 * m4/output.c (threshold_diversion_CB): s/div/diversion/.
1209 * m4/macro.c (make_argv_ref, arg_symbol, m4_arg_symbol)
1210 (m4_is_arg_text, m4_is_arg_func, m4_arg_text, m4_arg_empty)
1211 (m4_arg_len, m4_arg_func, m4__arg_print, m4_make_argv_ref)
1212 (m4_push_arg, m4__push_arg_quote): s/index/arg/.
1213 * modules/format.c (format): Likewise.
1214 * modules/m4.c (ifelse): Likewise.
1216 Improve debugmode testing, based on recent branch-1.6 regressions.
1217 * doc/m4.texinfo (Debugmode): Enhance tests.
1218 * tests/generate.awk: Run tests from stdin, not input.m4. Support
1219 stderr munging when using -I examples.
1221 Fix regression in define from 2008-02-22.
1222 * m4/m4module.h (m4_symbol_value_copy): Add parameter.
1223 * m4/symtab.c (m4_symbol_value_copy): Support copying $@
1225 * m4/macro.c (expand_argument): Update callers.
1226 * modules/m4.c (define, pushdef): Likewise.
1227 * tests/builtins.at (define): Enhance test to catch this.
1229 2008-04-21 Eric Blake <ebb9@byu.net>
1231 Simplify previous patch.
1232 * tests/m4.in: Compress assignment.
1233 Suggested by Gary V. Vaughan.
1235 Fix --disable-shared testsuite regression from previous patch.
1236 * tests/m4.in: Export M4MODPATH, so that recursive m4 invocations
1239 Fix spelling of attribution to Christopher Strachey.
1240 * doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
1242 Reported by Fernando Carrijo.
1244 2008-04-17 Eric Blake <ebb9@byu.net>
1246 Fix testsuite bug when SIGPIPE is ignored.
1247 * tests/builtins.at (divert): Consume all of m4's output, to avoid
1248 spurious write failure.
1249 * src/main.c (main): In batch mode, restore default handling of
1251 * doc/m4.texinfo (Operation modes): Document SIGPIPE behavior.
1253 Reported by Bob Proulx, via his autobuilder.
1255 2008-04-15 Eric Blake <ebb9@byu.net>
1257 Fix 'make installcheck' after './configure --prefix-progname'.
1258 * tests/testsuite.at (AT_CHECK_M4): Allow overriding the m4
1260 (HELP_OTHER, PREPARE_TESTS): Document and use $M4.
1261 * tests/builtins.at (patsubst): Avoid space-tab.
1262 (divert, mkdtemp, mkstemp): Adjust tests to use $M4.
1263 * tests/options.at (--debugfile): Likewise.
1264 * tests/others.at (stdin seekable): Likewise.
1265 (fstab): Avoid space-tab.
1266 * Makefile.am (installcheck-local): Accomodate transformed name.
1267 (DISTCHECK_CONFIGURE_FLAGS): Ensure no regressions, by using gm4
1268 during 'make distcheck'.
1269 * cfg.mk: New file, borrowed from branch.
1271 Update prerequisite tools to match recent releases.
1272 * configure.ac (AC_PREREQ): Rely on released autoconf.
1273 (LT_PREREQ): Rely on released libtool.
1274 * tests/testsuite.at (m4_version_prereq): Update dependence.
1275 * bootstrap: Mention prerequisites.
1277 Work around OS/2 limitation of printf(1).
1278 * tests/null.m4: Use m4, not printf, to generate NUL byte.
1279 * tests/null.out: Check for esyscmd failure.
1280 Reported by Elbert Pol.
1282 2008-04-14 Eric Blake <ebb9@byu.net>
1284 Stage 21b: $@ concatenates builtins, m4wrap takes builtins.
1285 Improve arg_print to handle builtin tokens when printing to a
1286 known chain, rather than always flattening builtins. This allows
1287 m4wrap and $@ back-references to handle embedded builtin tokens.
1288 Memory impact: none.
1289 Speed impact: slight penalty, from more bookkeeping.
1290 * m4/m4module.h (m4_push_builtin): Add parameter.
1291 (m4_builtin_print, m4_push_wrapup_init, m4_push_wrapup_finish)
1292 (m4_arg_print, m4_symbol_value_print): Rename and reduce scope...
1293 * m4/m4private.h (m4__builtin_print, m4__push_wrapup_init)
1294 (m4__push_wrapup_finish, m4__arg_print, m4__symbol_value_print):
1295 ...to these, in some cases adding a parameter.
1296 (m4__append_builtin): New prototype.
1297 * m4/builtin.c (m4_builtin_print): Alter signature to print
1298 builtin to a growing symbol chain.
1299 * m4/symtab.c (m4__symbol_value_print): Alter signature.
1300 (m4_symbol_print, dump_symbol_CB): Adjust callers.
1301 * m4/input.c (builtin_peek, builtin_read, builtin_unget)
1302 (builtin_print, builtin_funcs): Delete, handled via composite
1304 (struct m4_input_block): Delete u.builtin member.
1305 (init_builtin_token): Only use composite block.
1306 (m4__append_builtin): New function.
1307 (m4_push_builtin, m4__push_wrapup_init): Alter signature.
1308 (m4__push_symbol): Allow builtin tokens.
1309 (m4__push_wrapup_finish): Rename.
1310 (composite_print, m4_print_token): Adjust callers.
1311 * m4/macro.c (m4_wrap_args, collect_arguments): Allow builtin
1313 (m4__arg_print): Alter signature.
1314 (trace_prepre, trace_pre, m4_arg_text, m4_arg_equal): Adjust
1316 * modules/m4.c (m4wrap): Allow builtin tokens.
1317 (defn, errprint): Adjust callers.
1318 * modules/gnu.c (builtin): Likewise.
1319 * doc/m4.texinfo (M4wrap): New test.
1320 (Debuglen): Adjust expected output.
1322 Stage 21a: Optimize checks for end of input.
1323 Create a new polymorphic input block type, which always fails with
1324 CHAR_EOF, so that remaining input routines no longer have to check
1325 for NULL input block.
1326 Memory impact: none.
1327 Speed impact: noticeable improvement, from fewer conditionals.
1328 * m4/input.c (eof_funcs, input_eof): New objects.
1329 (eof_peek, eof_read, eof_unget): New functions.
1330 (file_clean, m4_push_string_init, pop_input, m4_push_wrapup_init)
1331 (m4_pop_wrapup, next_char, peek_char, unget_input, m4_input_init)
1332 (m4_input_exit): Use placeholder to guarantee non-NULL isp and
1334 (next_char): Rename retry to allow_unget, and change sense for
1335 easier manipulation. All callers changed.
1337 Improve OS/2 detection.
1338 * modules/gnu.c (m4_macro_table): Ensure all possible identifiers
1339 are defined, not just the first. The testsuite ensures that
1340 exactly one gets defined.
1341 * m4/system_.h [__EMX__]: OS/2 is not Unix-compatible, no matter
1342 what other pre-defined macros it has.
1344 Reported by Elbert Pol.
1346 Ensure __m4_version__ is unquoted.
1347 * tests/builtins.at (__m4_@&t@version__): Augment test.
1349 Avoid GNU make failure on tarball.
1350 * Makefile.am (EXTRA_DIST): Distribute cfg.mk and maint.mk.
1352 2008-04-10 Eric Blake <ebb9@byu.net>
1354 Allow back-referenced macro names; fixes 2008-03-13 regression.
1355 * m4/m4module.h (m4_symbol_value_lookup): Change prototype.
1356 * m4/utility.c (m4_symbol_value_lookup): Change signature.
1357 * modules/m4.c (undefine, popdef, ifdef, m4_dump_symbols, defn):
1359 * tests/others.at (ifndef): New test.
1361 Be namespace clean for M4 version; fixes 2008-04-08 regression.
1362 * configure.ac (version): Rename...
1363 (M4_VERSION): ...to this, since using 'version' broke po.m4.
1365 2008-04-09 Eric Blake <ebb9@byu.net>
1367 Mention 1.4.11 release.
1368 * doc/m4.texinfo (History, Defn, Ifdef, Ifelse, M4wrap)
1369 (Extensions, Improved foreach): Distinguish 1.4.11 and 1.6.
1370 (Format): Add test of C99 hex-float parsing.
1371 * NEWS: Mention 1.4.11 release.
1372 * tests/builtins.at (divert): Add additional test.
1374 2008-04-08 Eric Blake <ebb9@byu.net>
1376 Overhaul inter-version releases to work with git.
1377 * configure.ac (version): New variable, which has nicer version
1378 contents when using git 1.5.5+, hardcoded to 1.9a otherwise.
1379 (TIMESTAMP): Delete, since CVS id expansion died with transition
1381 (AM_INIT_AUTOMAKE): Use version to decide gnu vs. gnits.
1382 * build-aux/mkstamp: Delete, no longer used.
1383 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Kill, to speed up
1384 rebuilds when timestamps don't matter.
1385 (MKSTAMP): Delete, no longer used.
1386 (EXTRA_DIST): No longer worry about mkstamp.
1387 (.version): New rule and distributed file.
1388 (doc/m4.1, tests/package.m4): Depend on .version, not
1389 configure.ac, for timestamp.
1390 * ltdl/m4/gnulib-cache.m4: Import git-version-gen module.
1391 * modules/gnu.c (__m4_version__): TIMESTAMP no longer exists.
1392 * src/main.c (main): Likewise.
1394 2008-03-28 Eric Blake <ebb9@byu.net>
1396 Use GNUmakefile module.
1397 * ltdl/m4/gnulib-cache.m4: Import gnumakefile module.
1398 * Makefile.am: Split off maintainer rules...
1399 * maint.mk: ...into this new file.
1401 2008-03-18 Eric Blake <ebb9@byu.net>
1403 Stage 20b: make m4wrap obey POSIX fifo ordering.
1404 Improve input engine to support location changes within symbol
1405 chains, then convert m4wrap to always build symbol chain.
1406 Memory impact: none.
1407 Speed impact: slight penalty, from more m4wrap bookkeeping.
1408 * m4/m4module.h (m4_wrap_args): Add prototype.
1409 * m4/m4private.h (enum m4__symbol_chain_type): Add M4__CHAIN_LOC.
1410 (struct m4__symbol_chain): Add struct u_l.
1411 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Use
1413 (composite_peek, composite_read, composite_clean): Handle location
1415 * m4/macro.c (m4_wrap_args): New function.
1416 * modules/m4.c (m4wrap): Use it.
1417 * doc/m4.texinfo (M4wrap): Sync with branch and POSIX.
1418 (Extensions): Document extension of multiple arguments.
1419 (Location, Improved m4wrap): Adjust example to match FIFO order.
1420 * tests/builtins.at (wrap): Likewise.
1421 * NEWS: Document this change.
1423 2008-03-17 Eric Blake <ebb9@byu.net>
1425 Stage 20a: reduce unget's in input engine.
1426 Now that out-of-range input placeholders like CHAR_BUILTIN are
1427 consumed outside of next_char, next_token should always consume
1428 rather than peek at the first character. Fewer peeks results in
1429 less ungetc overhead.
1430 Memory impact: none.
1431 Speed impact: noticeable improvement, from fewer function calls.
1432 * m4/input.c (struct input_funcs): Alter read_func prototype.
1433 (next_char, file_read, buildin_read, string_read, composite_read):
1434 Add allow_argv parameter.
1435 (init_builtin_token, init_argv_symbol): Require all prior input to
1437 (m4_skip_line, match_input, consume_syntax): Adjust callers.
1438 (m4__next_token): Consume first byte without peek.
1440 Update for fresh bootstrap.
1441 * ltdl/m4/gnulib-cache.m4: Updated copyright from upstream.
1443 2008-03-15 Eric Blake <ebb9@byu.net>
1445 Document join, in order to fix bug in m4wrap example.
1446 * examples/join.m4: New file.
1447 * examples/wraplifo2.m4: Likewise.
1448 * Makefile.am (EXTRA_DIST): Add new files.
1449 * doc/m4.texinfo (Improved m4wrap): New node.
1450 (Defn, Location): Enhance tests.
1451 (Shift): Document the composite macro join.
1452 (Incompatibilities): Move documentation of LIFO vs. FIFO...
1453 (M4wrap): ...here, to match improved example.
1455 2008-03-13 Eric Blake <ebb9@byu.net>
1457 Stage 19c: allow builtin tokens in more macros.
1458 Allow builtin tokens inside symbol chains, although for now, they
1459 are not allowed inside comments or quotes. Enable builtin token
1460 handling in more macros, if only to consistently diagnose invalid
1462 Memory impact: none.
1463 Speed impact: slight impact, due to more bookkeeping.
1464 * m4/m4module.h (m4_symbol_value_lookup, m4_builtin_print): New
1466 * m4/m4private.h (enum m4__symbol_chain_type): Add
1468 (struct m4__symbol_chain): Add builtin member.
1469 * m4/utility.c (m4_symbol_value_lookup): New method.
1470 * m4/builtin.c (m4_builtin_print): New function.
1471 * m4/symtab.c (m4_symbol_value_print): Use it.
1472 * m4/input.c (builtin_print): Likewise.
1473 (m4__push_symbol): Allow pushing builtin tokens.
1474 (composite_peek, composite_read, composite_unget, composite_clean)
1475 (composite_print): Handle builtin tokens.
1476 (init_builtin_token): Allow builtin tokens from composite input.
1477 (m4__next_token): Flatten builtins inside comment or string.
1478 * m4/macro.c (expand_argument): Strengthen assertion.
1479 (collect_arguments, m4_arg_equal, m4_arg_print, m4_push_args):
1480 Handle builtin tokens.
1481 (arg_symbol): Add parameter, and allow NULL level.
1482 (m4_arg_symbol, m4__push_arg_quote): Adjust callers.
1483 (m4_arg_text): Ensure all builtins have been flattened.
1484 * modules/m4.c (defn, dumpdef, popdef, traceoff, traceon)
1485 (undefine, m4_dump_symbols): Warn on invalid macro names.
1486 (ifdef, ifelse, shift): Handle builtin tokens.
1487 * modules/gnu.c (m4symbols): Likewise.
1488 * doc/m4.texinfo (Defn, Ifdef, Ifelse): Document and test the new
1490 (Debuglen): Likewise, and remove xfail.
1491 * NEWS: Mention the change.
1493 Stage 19b: invert sense of bit for handling builtin tokens.
1494 Pass builtin tokens by default, rather than as the exception, so
1495 that the logic can consistently refer to flattening arguments.
1496 Memory impact: none.
1498 * m4/m4module.h (M4BUILTIN_ENTRY): New convenience macro.
1499 (M4_BUILTIN_GROKS_MACRO): Rename...
1500 (M4_BUILTIN_FLATTEN_ARGS): ...and invert sense.
1501 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): Likewise...
1502 (m4_symbol_value_flatten_args, m4_symbol_flatten_args): ...to
1504 * m4/m4private.h (VALUE_MACRO_ARGS_BIT)
1505 (m4_symbol_value_groks_macro): Likewise...
1506 (VALUE_FLATTEN_ARGS_BIT, m4_symbol_value_flatten_args): ...to
1508 * m4/symtab.c (m4_symbol_value_groks_macro): Likewise...
1509 (m4_symbol_value_flatten_args): ...to this.
1510 * m4/macro.c (collect_arguments): Accomodate changed sense.
1511 * m4/module.c (m4__module_open): Require arguments if flattening
1513 * m4/input.c (m4_push_string_finish): For now, flatten all
1514 builtins pushed as back-references.
1515 * modules/gnu.c (m4_builtin_table, builtin): Adjust all clients.
1516 * modules/import.c (m4_builtin_table): Likewise.
1517 * modules/load.c (m4_builtin_table): Likewise.
1518 * modules/modtest.c (m4_builtin_table): Likewise.
1519 * modules/mpeval.c (m4_builtin_table): Likewise.
1520 * modules/perl.c (m4_builtin_table): Likewise.
1521 * modules/shadow.c (m4_builtin_table): Likewise.
1522 * modules/stdlib.c (m4_builtin_table): Likewise.
1523 * modules/time.c (m4_builtin_table): Likewise.
1524 * modules/m4.c (m4_builtin_table): Likewise.
1525 (mkstemp): Undo #undef hack from 2006-10-23, now that macro names
1526 are stringized without preprocessor expansion.
1527 * doc/m4.texinfo (Defn): Update comments to match reality.
1528 (Debuglen): Update test now that user macros pass builtin tokens.
1530 Stage 19a: sort and cache builtins loaded by a module.
1531 Rather than repeatedly using dlsym to browse the builtin table,
1532 copy off the table at module load time. Then, the input engine
1533 merely refers to the copy instead of duplicating information.
1534 Memory impact: slight penalty, due to more memory per module, but
1535 offset by less memory in input engine.
1536 Speed impact: slight improvement, due to faster builtin lookups.
1537 * m4/m4module.h (m4_set_symbol_value_builtin): Delete. Use
1538 m4_builtin_find_by_* instead.
1539 (m4_builtin_find_by_func): Change return type.
1540 * m4/m4private.h (m4__builtin): New struct.
1541 (m4_module): Add sorted list of loaded builtins.
1542 (struct m4_symbol_value): Change type of builtin value.
1543 (m4__set_symbol_value_builtin): New prototype and fast accessor.
1544 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1546 * m4/symtab.c (m4_set_symbol_value_builtin): Rename...
1547 (m4__set_symbol_value_builtin): ...and populate additional fields,
1549 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1551 * m4/module.c (install_builtin_table): Use cached table.
1552 (compare_builtin_CB): New helper function.
1553 (m4__module_open): Populate table.
1554 (module_remove): Free table.
1555 * m4/builtin.c (compare_builtin_name_CB): New helper function.
1556 (m4_builtin_find_by_name): Rewrite to use sorted table.
1557 (m4_builtin_find_by_func): Change return type.
1558 * m4/input.c (struct m4_input_block): Simplify u_b, since most
1559 fields can be determined from builtin.
1560 (builtin_peek, builtin_read, builtin_unget, init_builtin_token)
1561 (m4__next_token): Alter parsing so that only init_builtin_token
1563 (builtin_print, m4_push_builtin): Adjust all users.
1564 * tests/macros.at (Arity, defn, and freeze): Fix typo.
1566 Consistently cast malloc results, for C++ compilation.
1567 * m4/builtin.c (m4_builtin_find_by_name): Add cast.
1568 * m4/hash.c (m4_hash_new, m4_get_hash_iterator_next, node_new)
1569 (m4_hash_resize, maybe_grow): Likewise.
1570 * m4/m4.c (m4_create): Likewise.
1571 * m4/macro.c (expand_macro): Likewise.
1572 * m4/output.c (m4_tmpname): Likewise.
1573 * m4/path.c (search_path_add): Likewise.
1574 * m4/symtab.c (m4_symtab_create, m4_symbol_value_create)
1575 (symtab_fetch): Likewise.
1576 * m4/syntax.c (m4_syntax_create): Likewise.
1577 * modules/gnu.c (regexp_compile): Likewise.
1578 * src/main.c (main): Likewise.
1579 * src/freeze.c (reload_frozen_state): Likewise.
1581 2008-03-06 Eric Blake <ebb9@byu.net>
1583 Fix nested builtin(`shift',$@) regression from 2008-02-23.
1584 * m4/macro.c (make_argv_ref): Don't output expansion text when
1585 making wrapper for builtin or indir.
1586 * tests/builtins.at (builtin): New test.
1587 * NEWS: Document the fix.
1588 Reported by Andreas Schwab.
1590 2008-03-04 Eric Blake <ebb9@byu.net>
1592 The gnulib module free was deprecated.
1593 * ltdl/m4/gnulib-cache.m4: Remove free module.
1595 2008-02-29 Eric Blake <ebb9@byu.net>
1597 Import news from 1.4.10b.
1598 * NEWS: Update from branch.
1600 2008-02-23 Eric Blake <ebb9@byu.net>
1602 Stage 18: try harder to reuse argv in recursion.
1603 When pushing arguments that contain an existing $@ ref, reuse the
1604 ref rather than creating another layer of wrappers.
1605 Memory impact: noticeable improvement, due to better $@ reuse.
1606 Speed impact: noticeable improvement, due to O(n^2) to O(n)
1607 reduction in unboxed recursion.
1608 * m4/macro.c (make_argv_ref): Avoid wrapping $@ when possible.
1609 (m4_push_args): Let make_argv_ref take care of pending data.
1610 * doc/m4.texinfo (Improved foreach): Tweak wording to match new
1611 performance capability.
1612 * tests/others.at (recursion): Add tests to avoid performance
1615 2008-02-22 Eric Blake <ebb9@byu.net>
1618 * NEWS: Document change to __gnu__ on 2008-02-11.
1620 Stage 17: pass argv through quoted strings.
1621 Allow the concatenation of $@ references with other text input
1622 inside quoted contexts, which requires distinguishing between a
1623 wrapper around many arguments vs. a reference serving as part of a
1624 single argument. Also optimize based on whether argv contains
1625 builtin tokens that might need flattening to the empty string.
1626 Memory impact: noticeable improvement, due to O(n^2) to O(n)
1627 reduction from total reuse of $@ references.
1628 Speed impact: noticeable improvement, due to O(n^2) to O(n)
1629 reduction in boxed recursion.
1630 * m4/m4module.h (m4_arg_equal, m4_arg_len): Add parameter.
1631 (M4ARGLEN): Adjust definition.
1632 * m4/m4private.h (struct m4__symbol_chain): Add has_func member.
1633 (struct m4_symbol_value): Add wrapper and has_func members.
1634 (struct m4_macro_args): Add flatten and has_func members.
1635 * m4/input.c (append_quote_token): Return argv refs inside quoted
1637 (init_argv_symbol): Populate new fields.
1638 * m4/macro.c (expand_argument, collect_arguments, make_argv_ref)
1639 (m4_make_argv_ref): Likewise.
1640 (arg_symbol, arg_mark, m4_is_arg_text, m4_is_arg_func): Use new
1642 (m4_arg_equal, m4_arg_len): Handle quoted argv references, and add
1644 * modules/m4.c (ifelse): Adjust caller.
1646 2008-02-22 Gary V. Vaughan <gary@gnu.org>
1648 Fix regression in argument collection, from 2008-01-21.
1649 * m4/input.c (m4__next_token): When DEBUG_INPUT is defined,
1650 undo argument collection optimisation for strings, so that
1651 m4_print_token doesn't abort when it otherwise receives an
1652 unprintable M4_SYMBOL_VOID type token.
1654 2008-02-20 Eric Blake <ebb9@byu.net>
1656 Stage 16: cache quotes and improve m4_arg_print.
1657 Cache rather than always copying quotes when pushing $@ refs; in
1658 particular, reconstruct single-byte quotes on the fly. Allow NUL
1659 through m4wrap. Improve sharing of code that prints arguments.
1660 Memory impact: slight improvement, due to cached quotes.
1661 Speed impact: slight improvement, due to less copying.
1662 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print)
1663 (m4_arg_print): Adjust prototypes.
1664 (m4_dump_args): Delete.
1665 (m4_push_wrapup): Split...
1666 (m4_push_wrapup_init, m4_push_wrapup_finish): ...into these
1668 * m4/m4private.h (struct m4_syntax_table): Add cached_quote
1670 (m4__quote_cache, m4__quote_uncache): New prototypes.
1671 * m4/syntax.c (m4_syntax_create): Initialize the cache.
1672 (m4__quote_cache): New function.
1673 (m4_set_syntax): Update caller.
1674 * m4/symtab.c (m4_symbol_value_print): Add parameter.
1675 (m4_symbol_print, dump_symbol_CB): Adjust all callers.
1676 * m4/utility.c (m4_dump_args): Delete; callers should use
1677 m4_arg_print instead.
1678 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Split
1679 implementation, and allow embedded NUL.
1680 (m4_print_token, pop_input, composite_print, composite_peek):
1681 (composite_read, append_quote_token): Adjust all callers.
1682 * m4/macro.c (trace_prepre, m4_arg_text, make_argv_ref):
1684 (m4_arg_print): Add parameters.
1685 (trace_pre): Rewrite in terms of m4_arg_print.
1686 * modules/m4.c (errprint): Likewise.
1687 (m4wrap): Rewrite to allow embedded NUL.
1688 (dumpdef): Adjust caller.
1689 * doc/m4.texinfo (Debuglen): Enhance debuglen test.
1690 * tests/null.m4: Test for NUL in m4wrap.
1691 * tests/null.out: Update expected output.
1693 Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
1694 * m4/utility.c (m4_verror_at_line): Properly terminate the string.
1695 Reported by Ralf Wildenhues.
1697 * doc/m4.texinfo (Debuglen, Changesyntax): Fix typos.
1699 2008-02-19 Eric Blake <ebb9@byu.net>
1701 Clean up example on filtering defined symbols.
1702 * doc/m4.texinfo (Foreach, Improved foreach): Document another
1703 shortcoming in foreach.m4, and improve filter example by using
1706 * src/main.c (usage): Fix typo.
1708 2008-02-18 Eric Blake <ebb9@byu.net>
1710 Avoid some magic numbers.
1711 * m4/m4private.h (CHAR_EOF, CHAR_BUILTIN, CHAR_QUOTE, CHAR_ARGV)
1712 (CHAR_RETRY): Define in terms of UCHAR_MAX.
1713 * m4/syntax.c (m4_syntax_create, set_syntax_set)
1714 (reset_syntax_set, check_is_single_quotes)
1715 (check_is_single_comments, check_is_macro_escaped)
1716 (m4_set_quotes, m4_set_comment): Likewise.
1717 * modules/gnu.c (regexp_compile): Likewise.
1718 * modules/m4.c (translit): Likewise.
1719 * src/freeze.c (produce_syntax_dump): Likewise.
1720 Reported by Ralf Wildenhues.
1722 2008-02-16 Eric Blake <ebb9@byu.net>
1724 Add regression test for multi-character quote recursion.
1725 * examples/foreach2.m4: Use $0 rather than spelling out name.
1726 * examples/foreachq2.m4: Likewise.
1727 * examples/forloop2.m4: Likewise.
1728 * examples/hanoi.m4: Likewise.
1729 * examples/trace.m4: Likewise.
1730 * doc/m4.texinfo (Improved forloop): Document advantage of $0.
1731 (Improved foreach): Adjust dump from file.
1733 Stage 15: return argv refs back to collect_arguments.
1734 Collect an entire $@ reference at once rather than one argument at
1735 a time, outside of quotes (but inside quotes, $@ is still
1736 flattened for now). The skip_last field allows concatenation of
1737 $@ with other text when collecting arguments.
1738 Memory impact: noticeable improvement, due to better reuse of $@.
1739 Speed impact: noticeable improvement, due to less parsing.
1740 * m4/m4private.h (CHAR_ARGV): New input engine sentinel.
1741 (enum m4__token_type): Add M4_TOKEN_ARGV.
1742 (struct m4__symbol_chain): Add skip_last member to argv link.
1743 (m4__next_token): Add parameter.
1744 * m4/input.c (peek_char, file_peek, builtin_peek, string_peek)
1745 (composite_peek, m4__next_token): Add new parameter.
1746 (composite_read, append_quote_token): Support argv in quotes.
1747 (init_argv_symbol): New function.
1748 (m4__push_symbol, match_input, consume_syntax)
1749 (m4__next_token_is_open, m4_print_token): Adjust callers.
1750 * m4/macro.c (m4_macro_expand_input, m4__arg_adjust_refcount)
1751 (arg_mark, m4_arg_text, make_argv_ref): Likewise.
1752 (expand_argument, collect_arguments): Handle new token.
1753 (arg_symbol): Drill through $@ reference.
1754 * m4/syntax.c (set_quote_age): Detect disabled comments.
1755 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Fix debug code.
1757 2008-02-15 Eric Blake <ebb9@byu.net>
1759 * modules/gnu.c (regexp_compile): Use a fastmap for regex speed.
1761 2008-02-13 Eric Blake <ebb9@byu.net>
1763 Fix texinfo grammar.
1764 * doc/m4.texinfo (Eval, Incompatibilities): Use @. after capital.
1765 (History): Use @: after abbreviations.
1766 (M4exit): Use correct Latin abbreviation.
1767 (Dumpdef, Debugmode, Frozen file format 2): Use correct spacing
1770 2008-02-11 Eric Blake <ebb9@byu.net>
1772 Allow builtin text macros to specify number of arguments.
1773 * m4/m4module.h (struct m4_macro): Add argument limits to builtin
1775 * m4/module.c (install_macro_table): Allow text macros to warn on
1777 * modules/gnu.c (m4_macro_table): Update all clients.
1778 * modules/load.c (m4_macro_table): Likewise.
1779 * modules/mpeval.c (m4_macro_table): Likewise.
1780 * modules/perl.c (m4_macro_table): Likewise.
1781 * modules/shadow.c (m4_macro_table): Likewise.
1782 * modules/traditional.c (m4_macro_table): Likewise.
1783 * modules/modtest.c (m4_macro_table): Likewise. Also add text
1784 macros, for testing this.
1785 * doc/m4.texinfo (Standard Modules): Update text, and enhance
1787 * tests/modules.at (modules: text): New test.
1789 Fix regression in command line -D option, from 2006-08-25.
1790 * m4/m4private.h (m4_symbol_value_create): Delete fast accessor.
1791 * m4/m4module.h: Fix typo.
1792 * m4/symtab.c (m4_symbol_value_create): Prime the maximum number
1794 * tests/macros.at (Command line define): Enhance test.
1795 * tests/others.at (nul character): Enhance test.
1796 * tests/null.m4: Likewise.
1797 * tests/null.out: Likewise.
1799 Use gnulib's git-merge-changelog driver when available.
1800 * .gitattributes: Add merge attributes for ChangeLog.
1801 * bootstrap: Install driver, if not already present.
1803 2008-02-06 Eric Blake <ebb9@byu.net>
1805 Fix security hole introduced 2007-11-23.
1806 * m4/utility.c (m4_verror_at_line): Properly escape macro names.
1807 * src/main.c (main): Manage quoteargs defaults.
1808 * doc/m4.texinfo (Indir): Document and test this.
1810 Using raw strtod is not portable.
1811 * ltdl/m4/gnulib-cache.m4: Import the strtod module.
1813 2008-02-02 Eric Blake <ebb9@byu.net>
1815 Consistently use size_t for number of arguments.
1816 * m4/m4module.h (m4_builtin_func): Alter prototype.
1817 (struct m4_builtin): Adjust type of min_args, max_args.
1818 (M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
1819 (m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
1820 (m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
1821 (m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
1822 (m4_arg_print, m4_push_arg): Adjust all clients.
1823 * m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
1824 (m4_macro_args): Adjust type of various fields.
1825 (m4__push_arg_quote): Adjust all clients.
1826 * m4/input.c (m4_pop_wrapup): Likewise.
1827 * m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
1828 (arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
1829 (m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
1830 (m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
1831 (m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
1832 * m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
1833 * modules/evalparse.c (m4_evaluate): Likewise.
1834 * modules/gnu.c (changesyntax): Likewise.
1835 * modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
1836 (undivert, traceon, traceoff): Likewise.
1837 * modules/m4.h (m4_dump_symbols_func): Likewise.
1838 * modules/perl.c (perleval): Likewise.
1840 Stage 14b: allow pushing argv references.
1841 Push a $@ reference to the input engine in one go, rather than
1842 pushing each element. For now, argument collection still gets one
1843 argument of a $@ at a time; but the penalties of this patch make
1844 it easier to manage $@ efficiently in future patches.
1845 Memory impact: noticeable penalty, due to larger struct and O(n)
1846 to O(n^2) on unboxed recursion.
1847 Speed impact: noticeable penalty, due to more bookkeeping.
1848 * m4/m4private.h (struct m4__symbol_chain): Add comma and quotes
1850 (struct m4_macro_args): Add level field.
1851 (m4__arg_adjust_refcount, m4__push_arg_quote): New prototypes.
1852 * m4/input.c (m4__push_symbol, composite_peek, composite_read)
1853 (composite_unget, composite_clean, composite_print): Support $@
1855 * m4/macro.c (collect_arguments): Populate new field.
1856 (expand_macro): Move argv cleanup...
1857 (m4__arg_adjust_refcount): ...to this new function.
1858 (m4_arg_symbol, m4_make_argv_ref, m4_push_arg): Factor...
1859 (arg_symbol, make_argv_ref, m4__push_arg_quote): ...to these new
1860 helper functions, to add parameters.
1861 (m4_push_args): Adjust caller.
1862 * m4/symtab.c (m4_symbol_value_print): Likewise.
1864 Stage 14a: allow printing argv references.
1865 Refactor symbol-value printing code for better sharing, and to
1866 allow printing a contiguous text representation of a $@ ref.
1867 Memory impact: none.
1869 * m4/m4module.h (m4_arg_print): New prototype.
1870 (m4_symbol_value_print): Alter prototype.
1871 * m4/input.c (struct input_funcs): Add parameter to peek_func.
1872 (file_peek, builtin_peek, string_peek): Ignore new parameter.
1873 (composite_peek): Ignore new parameter, for now.
1874 (composite_clean, pop_input): Rework to minimize indirection, and
1875 to avoid infinite recursion in next patch.
1876 * m4/macro.c (trace_prepre, trace_pre): Adjust callers.
1877 (m4_arg_print): New function.
1878 * m4/symtab.c (m4_symbol_value_print): Update signature.
1879 (m4_symbol_print): Update caller.
1880 * m4/output.c (m4_shipout_string_trunc): Update comments.
1881 * m4/syntax.c (set_quote_age): Require comma as argument separator
1882 when dealing with $@ as a unit.
1883 * tests/builtins.at (ifelse): Augment test.
1884 * doc/m4.texinfo (Changesyntax): Document changesyntax deficiency.
1886 2008-01-31 Eric Blake <ebb9@byu.net>
1888 Kill hack for M4 1.4.4.
1889 * configure.ac (AM_GNU_GETTEXT_INTL_SUBDIR): Delete, now that
1890 we require new enough autoconf which in turn requires M4 1.4.5.
1892 2008-01-31 Gary V. Vaughan <gary@gnu.org>
1893 and Eric Blake <ebb9@byu.net>
1895 Depend on new libtool to use non-recursive build.
1896 * configure.ac (LT_PREREQ): Bump to alpha release version.
1897 (LTDL_INIT): Choose nonrecursive mode. Perform sanity check that
1898 installed libtool has correct symbols.
1899 * Makefile.am (SUBDIRS): Drop ltdl, now that it is built from the
1901 (AM_CPPFLAGS): Drop directories covered by libtool.
1902 (AM_LDFLAGS): Drop -no-undefined, covered by libtool.
1903 (include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
1904 macros, used by libtool.
1905 (lib_LTLIBRARIES): Also used by libtool.
1906 (ltdl/libltdlc.la): Delete, now that libtool does this.
1907 * bootstrap: Mention new requirements.
1908 (LIBTOOLIZE): Provide default program, and run libtoolize prior to
1910 (autoreconf): Also neutralize libtoolize, since it is run early.
1911 * HACKING: Mention updated prerequisites.
1913 2008-01-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1915 Fix build failure if installed libltdl is used.
1916 * Makefile.am (m4_libm4_la_DEPENDENCIES): Use $(LTDLDEPS).
1918 2008-01-28 Eric Blake <ebb9@byu.net>
1920 Depend on newer autoconf, for testsuite -C dir.
1921 * Makefile.am (CD_TESTDIR): Delete, no longer required.
1922 (check-local, installcheck-local, clean-local-tests): Use new -C
1923 option from autotest.
1924 * configure.ac (AC_PREREQ): Bump to 2.61a.347.
1925 * bootstrap: Mention new dependency.
1926 * HACKING: Likewise.
1928 2008-01-27 Eric Blake <ebb9@byu.net>
1930 Stage 13: push composite text tokens.
1931 Support pushing composite tokens, allowing back-references to be
1932 reused through multiple macro expansions. Add hueristic that
1933 avoids creating new reference when pushing existing references.
1934 Memory impact: noticeable improvement due to better reference
1935 reuse, except for O(n) to O(n^2) copying in boxed recursion.
1936 Speed impact: slight penalty, due to more bookkeeping.
1937 * m4/m4private.h (m4__push_symbol): Adjust prototype.
1938 * m4/input.c (m4__push_symbol): Add parameter, and support
1940 (append_quote_token): Add parameter, and support inlining of short
1942 (m4__next_token): Adjust caller.
1943 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
1945 2008-01-26 Eric Blake <ebb9@byu.net>
1947 Stage 12c: add macro for m4_arg_len.
1948 Make a common action easier to type.
1949 Memory impact: none.
1951 * m4/m4module.h (M4ARGLEN): New macro.
1952 * m4/macro.c (process_macro): Adjust all callers.
1953 * m4/utility.c (m4_dump_args): Likewise.
1954 * modules/m4.c (divert, maketemp, mkstemp, m4wrap, len, index)
1956 * modules/gnu.c (builtin, indir, mkdtemp, patsubst, regexp)
1957 (renamesyms): Likewise.
1958 * modules/stdlib.c (setenv): Likewise.
1960 Stage 12b: add m4_string_pair.
1961 Make passing quote delimiters around more efficient.
1962 Memory impact: none.
1963 Speed impact: slight penalty, due to more bookkeeping.
1964 * m4/m4module.h (m4_string_pair): New type.
1965 (m4_get_syntax_quotes, m4_get_syntax_comments): New prototypes.
1966 (m4_symbol_value_print, m4_symbol_print, m4_shipout_string_trunc):
1968 * m4/m4private.h (struct m4_string): Delete.
1969 (struct m4_syntax_table): Combine quote and comment members.
1970 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
1971 (m4_get_syntax_ecomm): Adjust accessors.
1972 (m4_get_syntax_quotes, m4_get_syntax_comments): New fast
1974 * m4/symtab.c (m4_symbol_value_print, m4_symbol_print):
1976 * m4/input.c (string_print, composite_print, m4_input_print):
1977 All callers updated.
1978 * m4/syntax.c (m4_syntax_delete, m4_set_syntax)
1979 (check_is_single_quotes, m4_set_quotes, set_quote_age)
1980 (m4_get_syntax_lquote, m4_get_syntax_rquote)
1981 (m4_get_syntax_quotes, check_is_single_comments, m4_set_comment)
1982 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
1983 (m4_get_syntax_comments): Likewise.
1984 * m4/macro.c (trace_prepre, trace_pre, m4_push_args): Likewise.
1985 * m4/output.c (m4_shipout_string, m4_shipout_string_trunc):
1987 * modules/m4.c (dumpdef, m4_make_temp): Likewise.
1988 * src/freeze.c (produce_frozen_state): Likewise.
1989 * tests/freeze.at (reloading unknown builtin): Update test.
1991 Stage 12a: make m4_symbol_chain a union.
1992 Shrink size of symbol chains by using a union.
1993 Memory impact: slight improvement, due to smaller struct.
1994 Speed impact: slight improvement, due to less bookkeeping.
1995 * m4/m4private.h (enum m4__symbol_chain_type): New enum.
1996 (struct m4_symbol_chain): Rename...
1997 (struct m4__symbol_chain): ...to this, since it is internal.
1998 * m4/symtab.c (m4_symbol_value_copy, m4_symbol_value_print): All
2000 * m4/input.c (struct m4_input_block, m4__push_symbol)
2001 (composite_peek, composite_read, composite_unget)
2002 (composite_clean, composite_print, m4__make_text_link)
2003 (append_quote_token): Likewise.
2004 * m4/macro.c (expand_macro, arg_mark, m4_arg_symbol, m4_arg_text)
2005 (m4_arg_equal, m4_arg_len, m4_make_argv_ref, m4_push_arg)
2006 (m4_push_args): Likewise.
2008 2008-01-23 Eric Blake <ebb9@byu.net>
2010 Adjust to recent libtool interface change.
2011 * configure.ac (LT_PREREQ): Require bleeding-edge libtool.
2012 (LT_WITH_LTDL): Delete, now that it is obsolete.
2013 (LTDL_INIT): Use new libtool macro.
2015 2008-01-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2016 and Eric Blake <ebb9@byu.net>
2018 Rely on newer automake.
2019 * configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1, and add lzma
2021 * bootstrap: Update automake requirement.
2022 (func_version): Fix --version output, broken since 2007-08-06.
2023 * HACKING: Likewise. Add lzma requirement.
2024 * Makefile.am (clean-local-src): Not needed any more with newest
2026 (clean-local): Adjust.
2027 * TODO: Remove completed item.
2029 2008-01-22 Eric Blake <ebb9@byu.net>
2032 * doc/m4.texinfo (Renamesyms): Avoid underfull hbox, and improve
2035 2008-01-21 Eric Blake <ebb9@byu.net>
2037 Stage 11: full circle for single argument references.
2038 Pass quoted strings through to argument collection in a single
2039 action, so that an argument can be reused throughout macro
2040 recursion if it remains unchanged.
2041 Memory impact: noticeable improvement, due to more reuse in
2042 argument collection stacks; O(n^2) to O(n) on boxed recursion.
2043 Speed impact: noticeable improvement, due to less copying.
2044 * m4/m4module.h (m4_arg_text): Add parameter.
2046 * m4/m4private.h (CHAR_QUOTE): New input engine sentinel.
2047 (m4__make_text_link): New prototype.
2048 (struct m4_symbol_chain): Add quote_age member.
2049 (struct m4_symbol_value): Add end member to chained symbol.
2050 (struct m4_macro_args): Add wrapper member.
2051 * m4/symtab.c (m4_symbol_value_print): Print composite tokens.
2052 (m4_symbol_value_copy, m4_symbol_value_delete): Recognize
2054 * m4/input.c (make_text_link): Rename...
2055 (m4__make_text_link): ...to this, and export.
2056 (m4_push_string_finish): Adjust caller.
2057 (make_text_link, m4__push_symbol): Update new field.
2058 (file_read, builtin_read, string_read, composite_read, next_char):
2060 (m4_skip_line, match_input, consume_syntax): Adjust callers.
2061 (append_quote_token): New function.
2062 (m4__next_token): Pass quoted strings onto argument collection.
2063 (m4_print_token) [DEBUG_INPUT]: Update.
2064 * m4/macro.c (expand_argument): Collect composite arguments.
2065 (collect_arguments): Update new field.
2066 (expand_macro): Reduce ref-count of back-references after use.
2067 (arg_mark, m4_arg_symbol, m4_make_argv_ref): Adjust to new member
2069 (m4_is_arg_text): Also recognize composite symbols as text.
2070 (m4_arg_text, m4_arg_len): Merge composite symbols as needed.
2071 (m4_arg_equal): Compare composite symbols.
2072 (m4_push_arg, m4_push_args): Handle composite symbols.
2073 (m4_arg_symbol): Relax assertion.
2074 (process_macro): Use single-argument references.
2075 * m4/output.c (m4_shipout_string_trunc): Update comment.
2076 * tests/macros.at (Rescanning macros): Augment test.
2078 2008-01-16 Eric Blake <ebb9@byu.net>
2080 Stage 10: avoid extra copying of strings and comments.
2081 When collecting tokens that are immune to further expansion, avoid
2082 copying data from one obstack to another by outputting it into the
2083 destination obstack to begin with. Also reduce copying done in
2085 Memory impact: slight improvement, due to better obstack usage.
2086 Speed impact: noticeable improvement, due less data copying.
2087 * ltdl/m4/gnulib-cache.m4: Import intprops and vasnprintf-posix
2089 * m4/m4private.h (m4__token_type): Adjust prototype.
2090 * m4/input.c (m4__next_token): Support new parameter.
2091 * m4/macro.c (m4_macro_expand_input, expand_token)
2092 (expand_argument, collect_arguments): Adjust callers.
2093 * modules/m4.c (ntoa): Tighten buffer size.
2094 * m4/output.c (m4_tmpname): Guarantee no buffer overflow.
2095 * modules/format.c (arg_int, arg_long, arg_double): New helper
2096 functions, to detect overflow or unparsed characters.
2097 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Adjust to check for
2098 missing or excess arguments.
2099 (format): Likewise, and also output directly into obstack if there
2101 * doc/m4.texinfo (History): Update for new year.
2102 (Format): Test for new warnings.
2104 2008-01-15 Eric Blake <ebb9@byu.net>
2106 * TODO: Update with some newer URLs.
2108 Verify linear `index'.
2109 * tests/builtins.at (index): New test.
2110 (translit): Make test take longer, to make quadratic algorithms
2113 2007-12-20 Eric Blake <ebb9@byu.net>
2115 Stage 9: share rather than copy single-arg refs.
2116 Use hooks of previous patch to create back-references to arguments
2117 in the input engine, and inline short text rather than always
2118 creating a FIFO link. Also start testing embedded NUL behavior.
2119 Until the argument collection engine also shares references, the
2120 memory usage increases.
2121 Memory impact: noticeable penalty, due to longer life of argv
2122 changing O(n) to O(n^2) on boxed recursion.
2123 Speed impact: slight improvement, due less data copying.
2124 * ltdl/m4/gnulib-cache.m4: Import memmem and quote modules.
2125 * m4/m4module.h (m4_arg_scratch): New prototype.
2126 * m4/m4private.h (m4__push_symbol): Add parameter.
2127 (m4_arg_scratch): Add fast accessor.
2128 (struct m4): Add expansion_level member, taken...
2129 * m4/macro.c (expansion_level): ...from here. Adjust all users.
2130 (expand_argument): Minor cleanup.
2131 (expand_macro): Track scratch space per macro call.
2132 (m4_arg_scratch): New function.
2133 (m4_make_argv_ref): Call new function.
2134 (m4_push_arg): Push reference to $0.
2135 (m4_push_args): Rework separator usage, since separators will
2137 (process_macro): Allow embedded NUL.
2138 * m4/input.c (INPUT_INLINE_THRESHOLD): New define.
2139 (m4__push_symbol): Add parameter. Inline short strings, and save
2140 references through rescanning.
2141 * m4/symtab.c (m4_set_symbol_value_text): Weaken assertion.
2142 * modules/m4.c (errprint, index): Handle NUL transparently.
2143 (dumpdef, translit): Use scratch space, rather than expansion
2145 * modules/gnu.c (renamesyms, m4symbols): Likewise.
2146 * tests/others.at (nul character): New test.
2147 (iso8859): Quote absolute file name, remove XFAIL.
2148 * tests/iso8859.m4: Avoid raw NUL in output.
2149 * tests/null.m4: New file.
2150 * tests/null.out: Likewise.
2151 * tests/null.err: Likewise.
2152 * Makefile.am (OTHER_FILES): Distribute new files.
2153 * .gitattributes: Treat new files as text.
2155 2007-12-17 Eric Blake <ebb9@byu.net>
2157 Stage 8: extend life of references into argv.
2158 Add hooks to lengthen the lifetime of arguments reused in a macro
2159 expansion, rather than always discarding arguments at the end of
2160 expand_macro. Rework the expand_macro obstacks to handle longer
2161 lifetimes. For now, the hooks remain unused.
2162 Memory impact: slight penalty, due to larger structs.
2163 Speed impact: slight penalty, due to more bookkeeping.
2164 * m4/system_.h (obstack_regrow): Delete.
2165 * m4/m4private.h (struct m4_symbol_chain): Add level field.
2166 (m4__push_symbol): Adjust prototype.
2167 (m4__adjust_refcount): New prototype.
2168 (DEBUG_MACRO) [DEBUG]: New debug control.
2169 (struct m4__macro_arg_stacks): New structure.
2170 (struct m4): Add arg_stacks, stacks_count fields.
2171 * m4/m4module.h (m4_make_argv_ref): Add parameter.
2172 * m4/macro.c (argc_stack, argv_stack): Delete, replaced by
2173 context->arg_stacks.
2174 (m4_macro_expand_input) [DEBUG_MACRO]: Add debug hooks,
2175 conditional on M4_DEBUG_MACRO envvar.
2176 (collect_arguments): Adjust signature.
2177 (expand_macro): Rework obstack handling.
2178 (m4__adjust_refcount, arg_mark): New functions.
2179 (m4_make_argv_ref): Populate new field.
2180 (m4_push_arg, m4_push_args): Track inuse.
2181 (process_macro): One less cast.
2182 * m4/m4.c (m4_delete): Clean up arg_stacks.
2183 * m4/input.c (make_text_link): Use new field.
2184 (m4__push_symbol, file_clean): Update signature.
2185 (composite_read): Bump refcount when done with reference.
2186 (composite_clean): New function.
2187 (pop_input): Adjust caller.
2188 * m4/debug.c (m4_debug_message): Make assertion match comment.
2189 * modules/gnu.c (builtin, indir): Adjust callers.
2190 * tests/builtins.at (ifelse): New test.
2191 (exp): Move and rename...
2192 * tests/others.at (countdown): ...to this.
2193 * doc/m4.texinfo (Improved foreach): Fix tracing usage in
2196 2007-12-13 Eric Blake <ebb9@byu.net>
2199 * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
2204 2007-12-13 Paolo Bonzini <bonzini@gnu.org> (tiny change)
2206 * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
2208 Reported by Giovanni Toffetti.
2210 2007-12-11 Eric Blake <ebb9@byu.net>
2212 Stage 7: use chained input support in input parser.
2213 Allow the LIFO input engine to rescan a macro expansion composed
2214 of smaller chunks of FIFO data, rather than the old approach of a
2215 monolithic string. For now, all chunks are still copied.
2216 Memory impact: slight penalty, due to FIFO chain overhead.
2217 Speed impact: slight penalty, due to extra bookkeeping.
2218 * m4/m4private.h (m4__push_symbol): New prototype.
2219 (struct m4_symbol_chain): Add const-safety.
2220 * m4/symtab.c (m4_symbol_value_print): Simplify.
2221 (dump_symbol_CB): Update caller.
2222 * m4/input.c (struct m4_input_block): Alter u_c member, first
2223 introduced 2006-10-25, but unused until now.
2224 (composite_peek, composite_read, composite_unget)
2225 (composite_print, init_builtin_token): Rewrite accordingly.
2226 (m4_push_wrapup): No longer need trailing NUL.
2227 (m4__push_symbol, make_text_link): New functions.
2228 (m4_push_string_finish): Use them.
2229 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
2230 (expand_macro): Simplify logic of nesting_limit.
2231 * src/main.c (main): Likewise.
2232 * doc/m4.texinfo (Dumpdef): Augment test.
2234 2007-12-08 Eric Blake <ebb9@byu.net>
2236 Stage 6: convert builtins to push arg at a time.
2237 Add new methods to factor all builtins whose expansion includes an
2238 argument, making back-reference creation easier in future patches.
2239 Factor out length-limited printing to obstacks, and use -1 rather
2240 than 0 for unlimited length.
2241 Memory impact: none.
2242 Speed impact: slight improvement, due to better code sharing.
2243 * m4/m4module.h (m4_shipout_text): Rename...
2244 (m4_divert_text): ...to this, to avoid confusion with m4_shipout_*
2245 that does not worry about sync lines.
2246 (m4_shipout_string_trunc): New prototype.
2247 * m4/output.c (m4_shipout_text): Rename...
2248 (m4_divert_text): ...to this.
2249 (m4_shipout_string): Move guts...
2250 (m4_shipout_string_trunc): ...to this new function.
2251 * m4/macro.c (m4_push_arg, m4_push_args): New functions.
2252 (expand_token, process_macro): Update callers.
2253 * m4/input.c (string_print): Likewise.
2254 * modules/m4.c (ifdef, ifelse, shift, substr, translit, divert):
2256 * modules/gnu.c (patsubst): Likewise.
2257 (debuglen): Use SIZE_MAX for unlimited debug length.
2258 * src/main.c (main): Likewise.
2259 * m4/m4.c (m4_create): Default max_debug_length to SIZE_MAX, not
2262 2007-12-07 Eric Blake <ebb9@byu.net>
2264 Minor security fix: Quote output of mkstemp.
2265 * modules/m4.c (m4_make_temp): Produce quoted output.
2266 * doc/m4.texinfo (Mkstemp, Mkdtemp): Update the documentation and
2269 Stage 5: add notion of quote age.
2270 Cache the quoting rules that were in effect when a string was
2271 parsed, to avoid reparsing that string if no changequote or other
2272 quote age change took place in the meantime. A quote_age of 0 is
2273 always safe, but does not benefit from caching.
2274 Memory impact: slight improvement, due to smaller struct in input
2276 Speed impact: slight penalty, due to more bookkeeping.
2277 * m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
2278 (m4_set_symbol_value_text): Adjust prototype.
2279 (m4_has_syntax): Factor out the unsigned char cast.
2280 * m4/m4private.h (struct m4_syntax_table): Add syntax_age and
2282 (m4__quote_age, m4__safe_quotes): New accessor macros, no need for
2283 functions at this point.
2284 (struct m4_symbol_value, struct m4_macro_args): Add quote_age
2286 (m4_set_symbol_value_text): Adjust fast accessor.
2287 (m4_get_symbol_value_quote_age): New fast accessor.
2288 * m4/symtab.c (m4_set_symbol_value_text): Add parameter.
2289 (m4_get_symbol_value_quote_age): New function.
2290 (m4_symbol_value_copy): Adjust callers.
2291 * m4/macro.c (expand_token): Add parameter, and track quote age.
2292 (expand_argument, collect_arguments): Track quote age.
2293 (m4_macro_expand_input, process_macro, m4_make_argv_ref)
2294 (m4_macro_expand_input): Update callers.
2295 (m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
2296 * m4/input.c: Comment cleanups.
2297 (struct m4_input_block): Reduce size.
2298 (m4__next_token): Report quote age.
2299 (m4_push_builtin, init_builtin_token): Update callers.
2300 * m4/utility.c (skip_space): Adjust callers.
2301 * m4/module.c (install_macro_table): Likewise.
2302 * m4/syntax.c (m4_set_syntax): Initialize and update quote age.
2303 (m4_set_quotes, m4_set_comment): Detect no-op changes, and update
2305 (set_quote_age): New helper function.
2306 (check_is_single_quotes, check_is_single_comments): Adjust
2308 * src/freeze.c (reload_frozen_state): Likewise.
2309 * src/main.c (main): Likewise.
2310 * modules/m4.c (define, pushdef): No need to set macro text.
2311 * tests/builtins.at (changequote, defn): New tests.
2312 * examples/wrapfifo.m4: New file.
2313 * examples/wraplifo.m4: New file.
2314 * Makefile.am (dist_pkgdata_DATA): Distribute new examples.
2316 2007-12-04 Eric Blake <ebb9@byu.net>
2318 Fix builds with OpenBSD make.
2319 * Makefile.am (HELP2MAN): New macro.
2320 (dist_man_MANS, doc/m4.1): Fix rules for building m4.1 into
2322 * README: Update copyright.
2323 * HACKING: Mention help2man and makeinfo dependencies.
2325 2007-11-29 Eric Blake <ebb9@byu.net>
2327 Stage 4: route indir, builtin through ref; make argv opaque.
2328 Finish making struct opaque to all but the input engine, by
2329 reworking obstack usage in expand_macro to better support creation
2330 of a $@ reference. Canonicalize the empty argument, to allow
2331 pointer comparison optimizations.
2332 Memory impact: slight penalty, due to larger struct.
2333 Speed impact: slight improvement, due to fewer function calls.
2334 * m4/system_.h (obstack_regrow): Fix precedence.
2335 * m4/m4module.h (m4_arg_equal, m4_arg_empty, m4_make_argv_ref):
2337 (struct m4_macro_args): Move...
2338 * m4/m4private.h (struct m4_macro_args): ...here, making it opaque
2339 to modules. Add has_ref member.
2340 (bool_bitfield): New helper typedef.
2341 (struct m4_symbol_chain): Add flatten and len members.
2342 * m4/macro.c (empty_symbol): New placeholder, for optimizing
2343 comparison with empty string.
2344 (m4_macro_expand_input): Initialize it.
2345 (collect_arguments): Alter signature, and populate new fields.
2346 (trace_pre, trace_post): Remove redundant parameter.
2347 (expand_macro): Alter handling of obstacks.
2348 (m4_arg_symbol): Account for wrapped argv.
2349 (m4_arg_equal, m4_arg_empty, m4_make_argv_ref): New methods.
2350 (m4_arg_text, m4_arg_len, m4_arg_func): Use new methods.
2351 * modules/m4.c (ifelse, syscmd): Likewise.
2352 * modules/evalparse.c (m4_evaluate): Likewise.
2353 (undefine, popdef, m4_dump_symbols): Optimize.
2354 * modules/gnu.c (builtin, indir, esyscmd, debugfile): Use new
2356 (changesyntax, regexp): Optimize.
2357 * m4/output.c (diversion_storage): Use typedef.
2359 Stage 3b: cache length, rather than computing it, in modules.
2360 Use cached token length in builtins and output engine.
2361 Memory impact: none.
2362 Speed impact: noticeable improvement, due to fewer function calls.
2363 * m4/hash.c (m4_hash_remove): Avoid double free on remove
2365 * m4/output.c (m4_shipout_string): Change semantics of len param.
2366 (m4_shipout_int): Use cached length.
2367 * m4/input.c (m4_push_string_finish): Likewise.
2368 * modules/m4.h (m4_make_temp_func): Add parameter.
2369 * m4/macro.c (expand_token, m4_arg_len): Use cached length.
2370 (collect_arguments, expand_macro): Alter signature.
2371 (trace_format): Don't use out-of-scope buffer.
2372 (process_macro): All callers changed.
2373 * m4/utility.c (m4_dump_args): Likewise.
2374 * m4/symtab.c (m4_symbol_value_print): Likewise.
2375 * modules/gnu.c (__file__, __program__, builtin, indir)
2376 (m4symbols, mkdtemp, regexp_compile, regexp_substitute,
2377 renamesyms, patsubst, regexp, regexp_compile): Likewise.
2378 * modules/load.c (m4modules): Likewise.
2379 * modules/m4.c (defn, m4wrap, maketemp, m4_make_temp)
2380 (numb_obstack, ifdef, ifelse, divert, len, substr): Likewise.
2381 * modules/perl.c (perleval): Likewise.
2382 * modules/stdlib.c (getcwd, getenv, getlogin, getpwnam, getpwuid)
2383 (hostname, uname, setenv): Likewise.
2384 * modules/mpeval.c (numb_obstack): Likewise.
2385 * src/freeze.c (dump_symbol_CB): Likewise.
2386 * doc/m4.texinfo (Renamesyms, Dumpdef, Changesyntax): Adjust test.
2387 * tests/builtins.at (mkstemp): Likewise.
2388 * tests/others.at (iso8859): XFAIL this test, now that
2389 length-based handling allows NUL through part but not all of M4.
2391 2007-11-28 Eric Blake <ebb9@byu.net>
2393 Stage 3a: cache length, rather than computing it, in libm4.
2394 Cache the length of a token in the input engine and symbol table,
2395 to avoid repeating lots of strlen calls. Additionally, by using
2396 obstack length rather than strlen, the input engine can now
2397 support embedded NUL.
2398 Memory impact: slight penalty, due to larger struct.
2399 Speed impact: slight improvement, due to fewer function calls.
2400 * m4/m4module.h (struct m4_macro_args): Cache length.
2401 (m4_get_symbol_len, m4_get_symbol_value_len): New accessors.
2402 (m4_set_symbol_value_text): Change signature.
2403 * m4/m4private.h (struct m4_symbol_value): Store string length.
2404 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2405 (m4_set_symbol_value_placeholder): Update accordingly.
2406 (m4_set_symbol_value_text): Change signature.
2407 (m4_get_symbol_value_len): New accessor.
2408 * m4/input.c (struct m4_input_block, string_peek, string_read)
2409 (string_unget, string_print, m4_push_string_finish)
2410 (m4_push_wrapup): Track length of string input.
2411 (m4__next_token): Adjust all users of symbol text to track length,
2413 * m4/macro.c (expand_argument, collect_arguments): Likewise.
2414 * m4/module.c (install_macro_table): Likewise.
2415 * modules/gnu.c (builtin, indir): Likewise.
2416 * modules/m4.c (define, pushdef): Likewise.
2417 * src/main.c (main): Likewise.
2418 * src/freeze.c (reload_frozen_state): Likewise.
2419 * m4/symtab.c (m4_symbol_value_copy): Likewise.
2420 (m4_get_symbol_value_len): New function.
2421 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2422 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
2423 Adjust implementation.
2425 2007-11-27 Eric Blake <ebb9@byu.net>
2427 Stage 2: use accessors, not direct reference, into argv.
2428 Outside of macro.c, use accessor methods rather than direct access
2429 into the argv struct.
2430 Memory impact: none.
2431 Speed impact: slight penalty, due to increased function calls.
2432 * m4/m4private.h (m4_arg_argc): New fast accessor.
2433 * m4/m4module.h (m4_arg_argc, m4_arg_symbol, m4_is_arg_text)
2434 (m4_is_arg_func, m4_arg_text, m4_arg_len, m4_arg_func): New
2436 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2437 (m4_macro_call): Make argc unsigned.
2438 (M4ARG): Use new accessors.
2439 * modules/m4.c (define, pushdef): Likewise.
2440 (undefine, popdef, ifelse, m4_dump_symbols, defn, undivert)
2441 (traceon, traceoff): Make argc unsigned.
2442 * modules/m4.h (m4_dump_symbols_func): Likewise.
2443 * modules/evalparse.c (m4_evaluate): Likewise.
2444 * modules/gnu.c (builtin, indir): Use new accessors.
2445 (changesyntax): Make argc unsigned.
2446 * modules/perl.c (perleval): Likewise.
2447 * m4/utility.c (m4_dump_args): Use new accessors.
2448 * m4/macro.c (trace_pre): Likewise.
2449 (m4_arg_symbol, m4_arg_argc, m4_is_arg_text, m4_is_arg_func)
2450 (m4_arg_text, m4_arg_len, m4_arg_func): New functions.
2451 (expand_macro, trace_pre, trace_post, m4_macro_call): Update argc
2454 2007-11-24 Eric Blake <ebb9@byu.net>
2456 Stage 1: convert m4_symbol_value** into new object.
2457 Pass a variable-size wrapper structure instead of an array to
2458 builtins, so that subsequent optimizations in the structure need
2459 not impact every builtin client.
2460 Memory impact: slight penalty, since struct is larger than array.
2461 Speed impact: slight penalty, due to increased bookkeeping.
2462 * ltdl/m4/gnulib-cache.m4: Import flexmember module.
2463 * m4/m4module.h (m4_macro_args): New type, will be opaque to
2465 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2466 (m4_macro_call): Alter signature to use m4_macro_args object.
2467 (M4ARG): Redefine to access new struct.
2468 * m4/m4private.h (M4_SYMBOL_COMP): New enumerator.
2469 (struct m4_symbol_chain): New type.
2470 (struct m4_symbol_value): Add chain alternative.
2471 * m4/macro.c (collect_arguments): Build new struct.
2472 (expand_macro, m4_macro_call, process_macro, trace_pre)
2473 (trace_post): Adjust implementation to use it.
2474 * m4/utility.c (m4_dump_args): Likewise.
2475 * modules/gnu.c (builtin, indir): Likewise.
2476 * modules/format.c (format): Likewise.
2477 * modules/m4.h (m4_dump_symbols_func): Likewise.
2478 * modules/m4.c (m4_dump_symbols, define, pushdef, defn, ifelse)
2479 (shift, include, errprint, m4wrap): Likewise.
2480 * modules/evalparse.c (m4_evaluate): Likewise.
2482 Pass only macro name to utility functions.
2483 * m4/m4module.h (m4_bad_argc, m4_numeric_arg): Adjust signature.
2484 * m4/utility.c (m4_bad_argc, m4_numeric_arg): Adjust
2486 * m4/macro.c (m4_macro_call): Adjust callers.
2487 * modules/gnu.c (builtin, debuglen): Likewise.
2488 * modules/m4.c (ifelse, incr, decr, divert, undivert, m4exit)
2490 * modules/evalparse.c (m4_evaluate): Likewise.
2491 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
2492 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
2495 2007-11-23 Eric Blake <ebb9@byu.net>
2497 Add macro name to debugfile messages.
2498 * m4/m4module.h (m4_debug_set_output): Add parameter.
2499 * m4/debug.c (m4_debug_set_output, set_debug_file): Pass macro
2501 * modules/gnu.c (debugfile): Adjust caller.
2502 * modules/m4.c (m4exit): Likewise.
2503 * src/main.c (main): Likewise.
2505 Factor out handling of macro name in error messages.
2506 * m4/m4module.h (m4_error, m4_error_at_line, m4_warn)
2507 (m4_warn_at_line): Add new parameter.
2508 * m4/utility.c (m4_verror_at_line): New helper method.
2509 (m4_error, m4_error_at_line, m4_warn, m4_warn_at_line): Add new
2511 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg): All callers
2513 * m4/debug.c: Likewise.
2514 * m4/input.c: Likewise.
2515 * m4/macro.c: Likewise.
2516 * m4/module.c: Likewise.
2517 * m4/output.c: Likewise.
2518 * m4/path.c: Likewise.
2519 * modules/evalparse.c: Likewise.
2520 * modules/format.c: Likewise.
2521 * modules/gnu.c: Likewise.
2522 * modules/load.c: Likewise.
2523 * modules/m4.c: Likewise.
2524 * modules/mpeval.c: Likewise.
2525 * src/freeze.c: Likewise.
2526 * src/main.c: Likewise.
2528 2007-11-14 Eric Blake <ebb9@byu.net>
2530 Handle some defn corner cases differently.
2531 * doc/m4.texinfo (Defn): Update documentation; although this still
2532 doesn't match the branch, since it may be changed before 2.0.
2533 * m4/macro.c (expand_argument): Consistently ignore builtins in
2534 concatenation contexts.
2535 * m4/m4private.h (m4__symbol_type): Fix C89 compliance bug.
2537 2007-11-13 Eric Blake <ebb9@byu.net>
2539 Note: Patches titled Stage 0 through N form a series of patches
2540 which decreases the algorithmic complexity of tail recursion in
2541 macro expansions from O(n^2) to O(n) in both time and memory, then
2542 performs cleanups, such as handling of embedded NUL, made easier
2543 by the code refactoring.
2545 Stage 0: Fix memory leak in tail recursion.
2546 Free expansion text in the input engine as soon as it is parsed,
2547 rather than when the recursive expansion completes.
2548 Memory impact: noticeable improvement, due to reduction from
2549 O(n^2) to O(n) on recursion.
2550 Speed impact: minor improvement, due to better memory usage.
2551 * m4/input.c (pop_input): Add flag parameter and return type.
2552 (next_char): Adjust caller.
2553 (m4_push_string_init): Let go of memory earlier.
2555 2007-11-07 Eric Blake <ebb9@byu.net>
2557 * tests/macros.at (Rescanning macros): Test more corner cases.
2559 2007-11-06 Eric Blake <ebb9@byu.net>
2561 * build-aux/mkstamp: Rename from ltdl/config/mkstamp.
2563 * Makefile.am (tests/package.m4): Work around bash bug.
2564 Reported by Ralf Wildenhues.
2566 2007-11-05 Eric Blake <ebb9@byu.net>
2568 For consistency with other GNU projects, use build-aux directory.
2569 * configure.ac (AC_CONFIG_AUX_DIR): Change ltdl/config to
2571 * bootstrap (config_aux_dir): Likewise.
2572 * Makefile.am (config_aux_dir): Likewise.
2573 * ltdl/m4/gnulib-cache.m4: Use --aux-dir option.
2575 2007-11-02 Eric Blake <ebb9@byu.net>
2577 Update some documentation about version control.
2578 * NEWS: M4 is now stored in git.
2579 * HACKING: Likewise.
2581 * bootstrap: Likewise.
2582 * commit: Delete, now that CVS commits are no longer necessary.
2583 * ltdl/config/mailnotify: No longer necessary; git's patch
2584 generation and mail capability is more powerful.
2586 Update to recent gnulib changes.
2587 * ltdl/m4/gnulib-cache.m4: Replace fprintf-posix, vasprintf-posix,
2588 xprintf, and xvasprintf with xprintf-posix and xvasprintf-posix.
2590 2007-11-01 Eric Blake <ebb9@byu.net>
2592 Improve error message when early end of file occurs.
2593 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
2594 (M4wrap): Adjust to new messages.
2595 (Improved capitalize): Enhance test.
2596 * m4/m4private.h (m4__next_token): Adjust prototype.
2597 * m4/input.c (m4__next_token): Add new parameter, and improve
2599 * m4/macro.c (m4_macro_expand_input, collect_arguments): Adjust
2601 (expand_argument): Likewise, and add parameter.
2603 2007-10-31 Eric Blake <ebb9@byu.net>
2605 Test more corner cases.
2606 * tests/macros.at (Rescanning macros): Beef up test.
2607 * doc/m4.texinfo (Changecom): Beef up test.
2608 (Improved foreach): Document alternate foreachq style.
2609 * examples/foreachq3.m4: New file.
2610 * examples/loop.m4: New file.
2611 * Makefile.am (dist_pkgdata_DATA): Distribute them.
2613 2007-10-28 Eric Blake <ebb9@byu.net>
2615 More test coverage for autoconf usage patterns.
2616 * doc/m4.texinfo (Shift): Document cond macro, and add new test.
2617 * tests/macros.at (Rescanning macros): New test.
2618 * tests/builtins.at (include): Augment test.
2620 2007-10-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2622 * Makefile.am: Adjust getopt handling to latest gnulib layout.
2624 2007-10-27 Eric Blake <ebb9@byu.net>
2626 Document one use of changequote(`(',`)').
2627 * doc/m4.texinfo (Changequote): Add new test, based on recent
2628 autoconf addition of m4_expand.
2630 2007-10-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2632 * Makefile.am (dist_pkgdata_DATA): Add examples/capitalize2.m4.
2634 2007-10-22 Eric Blake <ebb9@byu.net>
2636 Never let printf failures go undetected.
2637 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2639 * m4/system_.h: Include xprintf.h.
2640 * m4/debug.c (m4_debug_message_prefix, m4_debug_message): Wrap all
2641 use of printf, xprintf.
2642 * m4/input.c [DEBUG_INPUT]: Likewise.
2643 * m4/module.c [DEBUG_MODULES]: Likewise.
2644 * m4/output.c (m4_shipout_text, m4_shipout_int)
2645 (m4_freeze_diversions): Likewise.
2646 * m4/path.c [DEBUG_INCL]: Likewise.
2647 * m4/symtab.c [DEBUG_SYM]: Likewise.
2648 * m4/syntax.c [DEBUG_SYNTAX]: Likewise.
2649 * modules/modtest.c (export_test): Likewise.
2650 * src/freeze.c (produce_resyntax_dump, produce_syntax_dump)
2651 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
2653 * src/main.c (usage): Likewise.
2654 * po/POTFILES.in: Adjust to new file.
2655 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
2657 2007-10-18 Eric Blake <ebb9@byu.net>
2659 Fix 'm4 -F file -t undefined'.
2660 * src/freeze.c (produce_symbol_dump): Skip trace placeholders.
2661 * src/freeze.c (dump_symbol_CB): Also skip void symbols.
2662 * tests/freeze.at (reloading unknown builtin): Test for this bug.
2663 * m4/m4module.h (m4_symtab_apply): Add parameter.
2664 * m4/symtab.c (m4_symtab_apply): Ignore trace placeholders when
2666 (m4_symtab_delete, symtab_dump): Adjust callers.
2667 * modules/m4.c (m4_dump_symbols): Likewise.
2669 2007-10-09 Eric Blake <ebb9@byu.net>
2671 Fix regexp regression of 2007-09-29.
2672 * modules/gnu.c (substitute): Allow NULL buf when no
2673 subexpressions were present.
2674 (regexp): Handle \ escapes even with empty regex.
2675 * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
2677 Cache regex compilation for another autoconf speedup.
2678 * modules/gnu.c (gnu_buf): Replace...
2679 (REGEX_CACHE_SIZE, regex_cache): ...with new declarations.
2680 (m4_pattern_buffer): Add fields.
2681 (m4_regexp_compile): Rename...
2682 (regexp_compile): ...to this, and drop no_sub parameter.
2684 (M4FINISH_HANDLER): Clean up entire cache.
2685 (m4_regexp_search): Rename...
2686 (regex_search): ...to this, adjust to new struct contents, and add
2688 (m4_regexp_substitute): Rename...
2689 (regexp_substitute): ...to this.
2690 (substitute, patsubst, regexp, renamesyms): Adjust callers.
2692 2007-10-02 Eric Blake <ebb9@byu.net>
2694 Document quoting pitfalls in capitalize.
2695 * doc/m4.texinfo (Patsubst): Use the examples directory. Also
2697 (Improved capitalize): New node.
2698 * examples/capitalize.m4: Update to match manual.
2699 * examples/capitalize2.m4: New file.
2701 2007-10-01 Eric Blake <ebb9@byu.net>
2703 Another Autoconf usage pattern optimization.
2704 * modules/m4.c (m4_index): Optimize search for one byte.
2705 * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
2708 2007-09-29 Eric Blake <ebb9@byu.net>
2710 Optimize for Autoconf usage pattern.
2711 * modules/gnu.c (regexp, patsubst): Handle empty regex faster.
2713 * tests/testsuite.at (AT_CHECK_M4): Slight optimization.
2715 2007-09-24 Eric Blake <ebb9@byu.net>
2717 Create .gitignore alongside .cvsignore.
2718 * bootstrap (version control): Update to reflect git usage.
2720 2007-09-13 Eric Blake <ebb9@byu.net>
2722 * AUTHORS: Fix typo.
2724 2007-09-12 Gary V. Vaughan <gary@gnu.org>
2726 Be consistent about using 'module' for m4_module types and
2727 'handle' for lt_dlhandle types:
2729 * m4/m4private.h (m4_symbol_value): Rename handle element to
2730 method. Changed all references.
2731 (VALUE_MODULE, SYMBOL_MODULE): Renamed from VALUE_HANDLE and
2732 SYMBOL_HANDLE respectively. Changed all references.
2733 * m4/m4module.h (M4INIT_HANDLER, M4FINISH_HANDLER): Ditto.
2734 * m4/builtin.c (m4_builtin_find_by_name)
2735 (m4_builtin_find_by_func): Use module as the parameter name for
2736 pointers of type 'm4_module'.
2737 * m4/module.c (module_remove, m4_get_module_name)
2738 (install_builtin_table, install_macro_table)
2739 (m4_module_make_resident, m4__module_next, m4_module_refcount):
2741 * src/freeze.c (produce_module_dump): Ditto.
2742 * m4/input.c (m4_input_block): Rename handle element to method.
2743 Changed all references.
2744 * m4/symtab.c (m4__symtab_remove_module_references): Ditto.
2745 * modules/load.c: Use module as the variable name for pointers
2746 of type 'm4_module'.
2747 * modules/m4.c: Ditto.
2748 * modules/perl.c: Ditto.
2749 * modules/shadow.c: Ditto.
2751 2007-09-07 Eric Blake <ebb9@byu.net>
2753 Add refcount builtin.
2754 * modules/load.c (refcount): New builtin.
2755 (m4modules): Use correct type.
2756 * doc/m4.texinfo (Refcount): New section.
2757 * m4/m4private.h (struct m4_module): Add refcount member.
2758 (m4_module_refcount) [NDEBUG]: Add faster accessor macro.
2759 * m4/module.c (m4_module_load): Add symbols to table on first
2760 load by m4, regardless of other libltdl loads of same module.
2761 (m4_module_refcount): Use new struct member, rather than relying
2762 on libltdl count which might be inflated by unrelated loads.
2763 (m4__module_interface): Optimize.
2764 (m4__module_next, m4__module_find): Avoid assertions that could
2765 trigger with unrelated libltdl loads.
2766 (m4__module_open): Track m4 load count.
2767 (m4__module_exit): Only unload what m4 loaded.
2768 (module_remove): Track m4 unloads.
2769 * NEWS: Document new builtin.
2771 More conversion to m4_module*.
2772 * src/freeze.c (produce_module_dump, dump_symbol_CB)
2773 (reload_frozen_state): Use correct type.
2774 * m4/input.c (struct m4_input_block): Likewise.
2775 * m4/symtab.c (dump_symbol_CB): Likewise.
2777 * AUTHORS: Simplify, to match libtool and autoconf layout.
2778 * THANKS: Sync with branch.
2780 2007-09-06 Eric Blake <ebb9@byu.net>
2782 Wrap lt_dlhandle in struct m4_module.
2783 * m4/m4module.h (includes): No longer require clients to know
2785 (m4_module): New opaque declaration.
2786 (m4_export): Delete unused type.
2787 (M4INIT_HANDLER, M4FINISH_HANDLER, m4_module_init_func)
2788 (m4_module_finish_func, m4_module_load, m4_get_module_name)
2789 (m4_builtin_find_by_name, m4_builtin_find_by_func): Use new
2791 (m4_module_makeresident, m4_module_refcount): New declarations.
2792 * m4/m4private.h (includes): Move <ltdl.h> here.
2793 (m4_module): New declaration. Simple for now, but intended for
2795 (m4__module_open, m4__module_next, m4__module_find)
2796 (m4__symtab_remove_module_references): Use new wrapper.
2797 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
2799 * m4/module.c (m4_get_module_name, m4_module_import)
2800 (m4_module_load): Likewise.
2801 (install_builtin_table, install_macro_table): Likewise. Also,
2802 change return type since these always returned NULL and no one
2804 (m4_module_makeresident, m4_module_refcount): New functions.
2805 (m4_module_unload, m4__module_next, m4__module_find): Use new
2807 (m4__module_open): Populate new wrapper, and associate it with the
2809 (m4__module_exit): Use new wrapper.
2810 (module_remove): Likewise. Reclaim storage on last use.
2811 (module_close): Delete, and inline into module_remove.
2812 * m4/symtab.c (m4__symtab_remove_module_references): Use new
2814 * modules/load.c (load_init): Use new API.
2815 * modules/m4.c (m4_export_table): Kill unused declaration.
2816 (m4_init): Use new API.
2817 * modules/shadow.c (shadow_init): Use new API.
2818 * src/main.c (main): Adjust callers.
2819 * src/freeze.c (reload_frozen_state): Likewise.
2820 * tests/modules.at (unload load module): New test.
2822 2007-09-03 Gary V. Vaughan <gary@gnu.org>
2824 * bootstrap (ltdl/m4/.cvsignore): Add xstrtol module macros.
2825 * src/m4/.cvsignore: Add xstrtol module sources.
2827 2007-09-03 Gary V. Vaughan <gary@gnu.org>
2829 Work around a bug in darwin's awk:
2831 * bootstrap (func_get_translations): Use $AWK instead of raw
2832 `awk' so that the user can use an alternative implementation
2833 if the first awk in PATH doesn't behave as expected.
2834 (func_get_translations): The first awk script mangles the last
2835 entry passed to it for at least the awk implementation shipped
2836 with Darwin 8.10.1. Capture $3 into a variable too to work-
2837 around that problem.
2839 2007-08-29 Gary V. Vaughan <gary@gnu.org>
2841 As gnulib xstrtol is only used by main, and unconditionally pulls
2842 in a copy of getopt, undo bootstrap change from 2007-08-11 below,
2843 and copy the xstrtol code into src/ so that main() can use it
2844 without pushing the extra code into libm4:
2846 * bootstrap (src_modules): Add getopt and xstrtol modules.
2847 * Makefile.am (src_m4_SOURCES): Add xstrtol sources.
2848 * po/POTFILES.in: Move gnu/xstrtol-error.c to src/xstrtol-error.c.
2850 2007-08-11 Eric Blake <ebb9@byu.net>
2852 Another upstream xstrtol change.
2853 * po/POTFILES.in: Track changes in files containing messages.
2854 * bootstrap (src_modules): getopt is now pulled into libgnu.a, no
2855 need to grab it separately.
2856 * src/main.c (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
2858 (size_opt): Adjust to latest xstrtol interface.
2860 2007-08-10 Eric Blake <ebb9@byu.net>
2862 Documentation improvements.
2863 * doc/m4.texinfo (Defn): Resync with branch.
2864 (Compatibility, Extensions): Sync with branch.
2866 2007-08-07 Eric Blake <ebb9@byu.net>
2868 Adjust to gnulib xstrtol changes.
2869 * src/main.c (size_opt): Adjust signature, so that error strings
2870 are easier to translate.
2871 (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): New macros
2872 for tracking long options.
2873 (main): Track which long option was used.
2874 * tests/options.at (--debuglen, --nesting-limit): Adjust to change
2876 (deprecated options): Test that --arglength spelling shows up in
2879 2007-08-06 Eric Blake <ebb9@byu.net>
2881 Normalize all GPL license notices.
2882 * m4/COPYING.LIB: Delete - libm4 is not distributed under LGPLv2
2884 * Makefile.am: Update license wording.
2885 * bootstrap: Likewise.
2887 * configure.ac: Likewise.
2888 * ltdl/config/mailnotify: Likewise.
2889 * ltdl/config/mkstamp: Likewise.
2890 * ltdl/m4/debug.m4: Likewise.
2891 * ltdl/m4/gmp.m4: Likewise.
2892 * ltdl/m4/m4-error.m4: Likewise.
2893 * ltdl/m4/m4-getopt.m4: Likewise.
2894 * ltdl/m4/m4-gettext.m4: Likewise.
2895 * ltdl/m4/m4-obstack.m4: Likewise.
2896 * ltdl/m4/m4-regex.m4: Likewise.
2897 * ltdl/m4/stackovf.m4: Likewise.
2898 * m4/builtin.c: Likewise.
2899 * m4/debug.c: Likewise.
2900 * m4/hash.c: Likewise.
2901 * m4/hash.h: Likewise.
2902 * m4/input.c: Likewise.
2903 * m4/m4.c: Likewise.
2904 * m4/m4module.h: Likewise.
2905 * m4/m4private.h: Likewise.
2906 * m4/macro.c: Likewise.
2907 * m4/module.c: Likewise.
2908 * m4/output.c: Likewise.
2909 * m4/path.c: Likewise.
2910 * m4/resyntax.c: Likewise.
2911 * m4/symtab.c: Likewise.
2912 * m4/syntax.c: Likewise.
2913 * m4/system_.h: Likewise.
2914 * m4/utility.c: Likewise.
2915 * modules/evalparse.c: Likewise.
2916 * modules/format.c: Likewise.
2917 * modules/gnu.c: Likewise.
2918 * modules/import.c: Likewise.
2919 * modules/load.c: Likewise.
2920 * modules/m4.c: Likewise.
2921 * modules/m4.h: Likewise.
2922 * modules/modtest.c: Likewise.
2923 * modules/mpeval.c: Likewise.
2924 * modules/perl.c: Likewise.
2925 * modules/shadow.c: Likewise.
2926 * modules/stdlib.c: Likewise.
2927 * modules/time.c: Likewise.
2928 * modules/traditional.c: Likewise.
2929 * po/Makevars: Likewise.
2930 * src/freeze.c: Likewise.
2931 * src/m4.h: Likewise.
2932 * src/main.c: Likewise.
2933 * src/stackovf.c: Likewise.
2934 * tests/builtins.at: Likewise.
2935 * tests/freeze.at: Likewise.
2936 * tests/generate.awk: Likewise.
2937 * tests/m4.in: Likewise.
2938 * tests/macros.at: Likewise.
2939 * tests/modules.at: Likewise.
2940 * tests/options.at: Likewise.
2941 * tests/others.at: Likewise.
2942 * tests/stackovf.test: Likewise.
2943 * tests/testsuite.at: Likewise.
2945 2007-07-22 Eric Blake <ebb9@byu.net>
2947 Fix diversions on NetBSD, when fopen(name,"a+") seeks to end.
2948 * m4/output.c (m4_tmpopen): Explicitly seek to beginning.
2949 * tests/builtins.at (divert): Enhance test to cover this.
2951 Reported by Thomas Klausner.
2953 2007-07-20 Eric Blake <ebb9@byu.net>
2955 Fix 'make distcheck' issues.
2956 * bootstrap: Add more files that might be more up-to-date in
2958 * Makefile.am (EXTRA_DIST): No longer distribute removed diff.
2959 * config/m4/gnulib-cache.m4: Update to latest gnulib.
2961 2007-07-16 Eric Blake <ebb9@byu.net>
2963 * po/POTFILES.in: Track recent translation additions from gnulib
2966 2007-07-14 Eric Blake <ebb9@byu.net>
2968 Reflect upstream license .texi changes.
2969 * doc/m4.texinfo (Copying): Rename node...
2970 (GNU General Public License): ...to this.
2971 (GNU Free Documentation License): Adjust node location.
2972 * local/doc/gpl-3.0.texi.diff: Remove file.
2974 2007-07-10 Eric Blake <ebb9@byu.net>
2976 Upgrade to GPLv3, and document 1.4.10.
2977 * bootstrap: Adjust to GPLv3.
2978 (func_update): Port from branch.
2979 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
2980 --local-dir=local --import gpl-3.0'.
2981 * doc/m4.texinfo (History): Mention 1.4.11.
2982 (Copying This Package): New appendix.
2983 * NEWS: Document 1.4.10.
2984 * local/doc/gpl-3.0.texi.diff: New file.
2985 * Makefile.am: Update license.
2986 (doc_m4_TEXINFOS, EXTRA_DIST): Distribute additions.
2987 * commit: Update license.
2988 * configure.ac: Likewise.
2989 * ltdl/config/mailnotify: Likewise.
2990 * ltdl/config/mkstamp: Likewise.
2991 * ltdl/m4/debug.m4: Likewise.
2992 * ltdl/m4/gmp.m4: Likewise.
2993 * ltdl/m4/m4-error.m4: Likewise.
2994 * ltdl/m4/m4-getopt.m4: Likewise.
2995 * ltdl/m4/m4-gettext.m4: Likewise.
2996 * ltdl/m4/m4-obstack.m4: Likewise.
2997 * ltdl/m4/m4-regex.m4: Likewise.
2998 * ltdl/m4/stackovf.m4: Likewise.
2999 * m4/builtin.c: Likewise.
3000 * m4/debug.c: Likewise.
3001 * m4/hash.c: Likewise.
3002 * m4/hash.h: Likewise.
3003 * m4/input.c: Likewise.
3004 * m4/m4.c: Likewise.
3005 * m4/m4module.h: Likewise.
3006 * m4/m4private.h: Likewise.
3007 * m4/macro.c: Likewise.
3008 * m4/module.c: Likewise.
3009 * m4/output.c: Likewise.
3010 * m4/path.c: Likewise.
3011 * m4/resyntax.c: Likewise.
3012 * m4/symtab.c: Likewise.
3013 * m4/syntax.c: Likewise.
3014 * m4/system_.h: Likewise.
3015 * m4/utility.c: Likewise.
3016 * modules/evalparse.c: Likewise.
3017 * modules/format.c: Likewise.
3018 * modules/gnu.c: Likewise.
3019 * modules/import.c: Likewise.
3020 * modules/load.c: Likewise.
3021 * modules/m4.c: Likewise.
3022 * modules/m4.h: Likewise.
3023 * modules/modtest.c: Likewise.
3024 * modules/mpeval.c: Likewise.
3025 * modules/perl.c: Likewise.
3026 * modules/shadow.c: Likewise.
3027 * modules/stdlib.c: Likewise.
3028 * modules/time.c: Likewise.
3029 * modules/traditional.c: Likewise.
3030 * po/Makevars: Likewise.
3031 * src/freeze.c: Likewise.
3032 * src/m4.h: Likewise.
3033 * src/main.c: Likewise.
3034 * src/stackovf.c: Likewise.
3035 * tests/builtins.at: Likewise.
3036 * tests/freeze.at: Likewise.
3037 * tests/generate.awk: Likewise.
3038 * tests/m4.in: Likewise.
3039 * tests/macros.at: Likewise.
3040 * tests/modules.at: Likewise.
3041 * tests/options.at: Likewise.
3042 * tests/others.at: Likewise.
3043 * tests/stackovf.test: Likewise.
3044 * tests/testsuite.at: Likewise.
3046 2007-07-09 Eric Blake <ebb9@byu.net>
3048 * modules/format.c (format): Avoid undefined behavior with %c.
3050 2007-07-01 Gary V. Vaughan <gary@gnu.org>
3052 The translation project has moved.
3053 * bootstrap (func_get_translations): Use the new translation
3057 2007-06-26 Karl Berry <karl@freefriends.org> (tiny change)
3059 Match Free Software Directory categories.
3060 * doc/m4.texinfo (dircategory): Update.
3062 2007-05-31 Eric Blake <ebb9@byu.net>
3064 Add extension to divert builtin.
3065 * modules/m4.c (builtin_divert): Immediately divert second
3067 * m4/output.c (m4_output_text): Allow 0 length. Fixes regression
3069 (m4_shipout_text): Short-circuit on zero length.
3070 * tests/freeze.at (loading format 2): Expand test to catch
3071 regression. Also check out-of-range version.
3072 * tests/builtins.at (divert): Expand test to check corner cases
3074 * doc/m4.texinfo (Divert): Document the extension.
3076 Reported by Daniel Richard G.
3078 2007-05-30 Eric Blake <ebb9@byu.net>
3080 Port format improvements from branch.
3081 * doc/m4.texinfo (History): Mention upcoming 1.4.10 release.
3082 (Format): Enhance section.
3083 * modules/format.c (format): Accept %'hhd, and issue warnings on
3084 unrecognized specifiers.
3085 * modules/gnu.c (builtin_format): Adjust how format is called.
3087 2007-05-28 Eric Blake <ebb9@byu.net>
3089 * tests/options.at (--syncoutput): Add xfailed test.
3091 Fix sync line interaction with multiline comments.
3092 * doc/m4.texinfo (Preprocessor features): Improve documentation.
3093 (Syncoutput): Improve testsuite.
3094 (Incompatibilities): Add testcase, and document bug.
3095 * src/freeze.c (reload_frozen_state): Don't interfere with
3096 synclines when reloading state.
3097 * m4/input.c (m4__next_token): Report line where multiline tokens
3099 * m4/m4private.h (m4__token_type): Add parameter.
3100 * m4/m4module.h (m4_output_text): Export.
3101 (m4_shipout_text): Add parameter.
3102 * src/macro.c (m4_macro_expand_input, expand_token)
3103 (expand_argument): Adjust callers so that line is passed from
3105 * m4/output.c (output_text): Rename...
3106 (m4_output_text): ...to this, and export.
3107 (m4_insert_file, insert_diversion_helper): Update callers.
3108 (m4_shipout_text): Take new parameter for start line of token.
3109 Output at most one syncline per token.
3110 Reported by Sergey Poznyakoff.
3112 Fix large diversion corner cases.
3113 * tests/freeze.at (large diversion): New test.
3114 * m4/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
3115 (make_room_for): Use NULL, not 0, for pointers.
3116 (m4_freeze_diversions): Allow freezing large diversions.
3117 (insert_diversion_helper): Avoid using rewind.
3119 Also run gnulib unit tests during make check.
3120 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
3121 --tests-base=tests/gnu --with-tests'.
3122 * configure.ac (AC_CONFIG_FILES): Build tests/gnu testdir.
3123 * Makefile.am (SUBDIRS): Run gnulib tests before ours.
3125 2007-05-25 Eric Blake <ebb9@byu.net>
3127 * m4/system_.h: Include <stdint.h>, for intmax_t.
3129 Reported by Daniel Richard G.
3131 2007-05-24 Eric Blake <ebb9@byu.net>
3133 Provide consistent shift semantics regardless of hardware.
3134 * modules/m4.c (numb_lshift, numb_rshift, numb_urshift): Mask
3136 (number, unumber): Always use [u]intmax_t.
3137 Reported by Gary V. Vaughan.
3139 Support POSIX flush semantics on all platforms.
3140 * modules/m4.c (m4_sysval_flush): Rely on gnulib.
3141 * ltdl/m4/gnulib-cache.m4: Fix typo in previous commit.
3143 Work around cygwin and mingw fseeko bugs.
3144 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3146 * modules/m4.c (m4_sysval_flush): Prefer fseeko over fseek.
3148 2007-04-25 Eric Blake <ebb9@byu.net>
3150 Test that regression in 1.4.9's eval doesn't recur.
3151 * doc/m4.texinfo (Eval): Check negative division.
3154 2007-04-12 Eric Blake <ebb9@byu.net>
3156 Allow for running test in sticky or setgid directory.
3157 * tests/builtins.at (mkdtemp): Adjust test.
3159 Don't test for broken sed too soon.
3160 * tests/others.at (stdin seekable): Rearrange subtests.
3162 Work around 'stdin seekable' shortcoming on glibc.
3163 * ltdl/m4/gnulib-cache.m4: Use closein instead of closeout.
3164 * tests/others.at (stdin closed): Adjust to new output.
3165 * src/main.c (process_file): No need to return anything.
3166 (main): Use close_stdin instead of close_stdout.
3167 Reported by Ralf Wildenhues.
3169 Enable autobuild usage.
3170 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3172 * configure.ac (AB_INIT): Output autobuild information.
3174 2007-04-11 Eric Blake <ebb9@byu.net>
3176 Address testsuite shortcoming in 'stdout full' on glibc.
3177 * tests/others.at (stdout full): Adjust expected output when more
3178 than 1k text is printed to /dev/full.
3179 Reported by Ralf Wildenhues.
3181 2007-04-10 Eric Blake <ebb9@byu.net>
3183 * tests/macros.at (Arity and defn): Fix quoting.
3185 2007-04-09 Eric Blake <ebb9@byu.net>
3187 Address failure of 'seekable stdin' on Mac OS X.
3188 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3191 2007-04-07 Eric Blake <ebb9@byu.net>
3193 Include <config.h> first in all C files, and not in headers.
3194 Fixes regression for --disable-assert builds from 2007-04-02.
3195 * src/m4.h (includes): Don't include config.h here.
3196 * m4/m4private.h (includes): Likewise.
3197 * m4/builtin.c: Include config.h before anything else.
3198 * m4/debug.c: Likewise.
3199 * m4/hash.c: Likewise.
3200 * m4/input.c: Likewise.
3201 * m4/m4.c: Likewise.
3202 * m4/macro.c: Likewise.
3203 * m4/module.c: Likewise.
3204 * m4/symtab.c: Likewise.
3205 * m4/syntax.c: Likewise.
3206 * m4/utility.c: Likewise.
3207 * src/freeze.c: Likewise.
3208 * src/stackovf.c: Likewise.
3210 2007-04-03 Eric Blake <ebb9@byu.net>
3212 * modules/m4.c (numb_ratio, numb_divide, numb_modulo): Avoid
3213 SIGFPE on x86 architectures.
3214 Reported by Ralf Wildenhues.
3216 2007-04-02 Eric Blake <ebb9@byu.net>
3218 Fix warnings from last commit.
3219 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3220 fprintf-posix sprintf-posix'.
3221 * m4/macro.c (expand_macro, trace_format): Use correct specifier
3223 (process_macro): Avoid negative array index.
3224 * src/freeze.c (produce_resyntax_dump, produce_module_dump)
3225 (dump_symbol_CB, produce_frozen_state): Use correct specifier for
3228 2007-04-02 Gary V. Vaughan <gary@gnu.org>
3230 Get rid of the last 'differs in signedness' compiler warnings:
3232 * m4/macro.c (process_macro): m4_get_symbol_value_text() returns
3233 a regular 'char *', so variables to store the return address,
3234 and iterate through it should be regular 'char *' too.
3235 * m4/input.c (m4_input_block): The start and current members of
3236 the string part of this union store regular 'char *' types, so
3237 they should be regular 'char *' types too.
3239 2007-04-02 Gary V. Vaughan <gary@gnu.org>
3241 M4 was designed to have a small number of header files defining
3242 the interfaces to several source files each. Keeping this in
3243 mind allows us to tidy things up considerably. Having done this,
3244 it becomes clear that some of the installed headers reference
3245 other headers which are not installed (but that's another patch):
3247 * m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from
3249 * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
3250 ...to here, so client modules can benefit too.
3251 (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
3252 lowest level to save doing it multiple times elsewhere.
3253 * m4/debug.c (stdio.h): Removed. The portable <gnu/stdio--.h>
3254 is already included via m4private.h.
3255 * modules/time.c (stdio.h): Ditto.
3256 * modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>.
3257 * modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h>
3258 and <gnu/unistd--.h>,
3259 * m4/m4private.h (m4module.h): Use angle brackets for an installed
3261 * m4/hash.h (system.h): Ditto.
3262 * modules/gnu.c (progname.h): Removed.
3263 * src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h.
3264 * m4/m4private.h (assert.h, errno.h): Already included via
3266 * m4/input.c (ctype.h): Ditto.
3267 * m4/module.c (ltdl.h): Ditto.
3268 * m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h)
3270 * m4/path.c (config.h, stdlib.h): Ditto.
3271 * m4/utility.c (config.h): Ditto.
3272 * modules/evalparse.c (assert.h, ctype.h): Ditto.
3273 * modules/gnu.c (assert.h, ctype.h, errno.h): Ditto.
3274 * modules/import.c (assert.h): Ditto.
3275 * modules/m4.c (assert.h, errno.h): Ditto.
3276 * modules/modtest.c (assert.h): Ditto.
3277 * modules/stdlib.c (sys/types.h): DittAo.
3278 * src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h):
3280 * src/stackovf.c (assert.h): Ditto.
3281 * modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster
3282 private interfaces when NDEBUG is defined.
3283 * modules/import.c (m4/m4module.h, m4private.h): Ditto.
3284 * modules/load.c (m4/m4module.h, m4private.h): Ditto.
3285 * modules/m4.c (m4/m4module.h, m4private.h): Ditto.
3286 * modules/modtest.c (m4/m4module.h, m4private.h): Ditto.
3287 * modules/mpeval.c (m4/m4module.h, m4private.h): Ditto.
3288 * modules/perl.c (m4/m4module.h, m4private.h): Ditto.
3289 * modules/shadow.c (m4/m4module.h, m4private.h): Ditto.
3290 * modules/time.c (m4/m4module.h, m4private.h): Ditto.
3291 * modules/traditional.c (m4/m4module.h, m4private.h): Ditto.
3292 * src/m4.h (locale.h): Moved from here...
3293 * src/main.h: ...to here.
3294 (m4private.h): Already included via m4.h.
3295 * src/stackovf.c (m4private.h): Ditto.
3297 2007-03-28 Gary V. Vaughan <gary@gnu.org>
3299 * Makefile.am (stamp-vcl): Removed.
3300 (CONFIG_STATUS_DEPENDENCIES): Depend directly on ChangeLog.
3302 2007-03-28 Eric Blake <ebb9@byu.net>
3304 * src/main.c (usage): Improve note to TRANSLATORS.
3305 * m4/system_.h (EXIT_FAILURE): Reflect gnulib changes.
3307 * tests/builtins.at (__m4_version__): Fix bug when TIMESTAMP is
3310 2007-03-24 Eric Blake <ebb9@byu.net>
3312 * m4/output.c (m4_output_init): Update to latest gnulib.
3313 * bootstrap (ltdl/m4/.cvsignore): No longer track generated
3315 * NEWS: Reflect release of 1.4.9.
3318 2007-03-07 Eric Blake <ebb9@byu.net>
3322 Exercise gnulib's new POSIX *printf modules.
3323 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3325 * modules/format.c (format): Support %a and %A.
3326 * doc/m4.texinfo (Format): Test this addition.
3327 * NEWS: Document this addition.
3329 2007-03-03 Eric Blake <ebb9@byu.net>
3331 * m4/input.c (m4__next_token): Fix synclines when in batch mode.
3332 * doc/m4.texinfo (M4exit): Synch another section.
3333 (Syncoutput): Make similar to other sections.
3335 2007-03-01 Eric Blake <ebb9@byu.net>
3337 * doc/m4.texinfo: Improve the indices.
3338 (Concept index): Rearrange to be last.
3339 (Sysval): Merge from branch.
3341 * doc/m4.texinfo (Syscmd, Esyscmd): Merge more doc sections.
3343 2007-02-28 Eric Blake <ebb9@byu.net>
3345 POSIX XCU ERN 137 was approved.
3346 * modules/mpeval.c (numb_extension): Delete.
3347 * modules/m4.c (numb_extension): Likewise.
3348 * modules/evalparse.c (comma_term, condition_term): Always
3349 implement ?: and , operators.
3350 * m4/symtab.c: Update comment to match reality.
3351 * src/freeze.c (produce_frozen_state, reload_frozen_state): Avoid
3352 dereferencing context directly when accessor exists.
3353 * src/main.c (usage): Prefer GNU_M4 over EMACS.
3354 (struct macro_definition): Rename...
3355 (struct deferred): ...to match usage. All uses changed.
3356 * doc/m4.texinfo (Eval): Document this change.
3357 (Operation modes, Changeresyntax): Fix wording to prefer GNU_M4
3359 (Preprocessor features, Changesyntax): Fix inaccuracies.
3360 * NEWS: Import branch NEWS items for 1.4.x series. Document
3363 POSIX XCU ERN 118 was approved.
3364 * modules/m4.c (define): Kill posixly_correct distinction in
3365 define behavior, since POSIX says GNU behavior complies.
3366 * tests/builtins.at (define): Restore original semantics.
3367 * doc/m4.texinfo (Pushdef): Document portability issues with
3369 (Incompatibilities): Clean up wording of what POSIX requires.
3370 * NEWS: Document this.
3372 2007-02-26 Eric Blake <ebb9@byu.net>
3374 Re-enable clean bootstrap on cygwin.
3375 * Makefile.am (AM_LDFLAGS): For now, export all symbols from
3376 modules, since otherwise we run afoul of current libtool
3377 limitations on cygwin and mingw.
3379 2007-02-25 M. Levinson <levinsm@users.sourceforge.net> (tiny change)
3381 * src/freeze.c (reload_frozen_state): Avoid dereferencing freed
3382 memory. Fixes regression introduced 2007-01-20.
3384 2007-02-25 Eric Blake <ebb9@byu.net>
3386 * tests/freeze.at (loading format 2): Augment test to catch
3387 regression introduced on 2007-01-20.
3389 Reported by M. Levinson.
3391 * m4/system_.h (includes, EXIT_SUCCESS, EXIT_FAILURE): Adjust to
3394 2007-02-05 Eric Blake <ebb9@byu.net>
3396 * tests/options.at (--fatal-warnings): New test.
3397 * tests/others.at (stdin seekable): Exit on error.
3398 * m4/m4private.h (M4_OPT_WARN_EXIT_BIT): New bit.
3399 (m4_get_warnings_exit_opt): Access it.
3400 * m4/m4module.h (m4_context_opt_bit_table): Access it.
3401 * m4/utility.c (m4_error, m4_error_at_line): Only force an exit
3403 (m4_warn, m4_warn_at_line): Change exit status on -E, and force
3405 * src/m4.c (usage): Document new -E behavior.
3406 (main): Make -E an additive option.
3407 * doc/m4.texinfo (Operation modes): Document the change.
3408 Reported by Ralf Wildenhues.
3410 * tests/others.at (stdin seekable): Fix bug in test.
3411 * ltdl/m4/gnulib-cache.m4: Gnulib module strstr no longer exists.
3413 * m4/input.c (struct m4_input_block): Remove unused field traced.
3415 2007-02-03 Eric Blake <ebb9@byu.net>
3416 and Bruno Haible <bruno@clisp.org> (tiny change)
3418 * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
3420 Reported by Bruno Haible.
3422 2007-01-31 Eric Blake <ebb9@byu.net>
3424 * m4/resyntax.c (m4_regexp_syntax_encode): Detect allocation
3427 2007-01-26 Eric Blake <ebb9@byu.net>
3429 * m4/symtab.c (includes): Adjust to latest gnulib.
3430 * modules/m4.c (includes): Likewise.
3432 2007-01-23 Eric Blake <ebb9@byu.net>
3434 * m4/m4module.h (M4_SYNTAX_ASSIGN): Delete this unused
3435 extension to make enough room.
3436 (M4_SYNTAX_IGNORE): Change value to zero, since the (commented)
3437 code in input.c special cases this category.
3438 (M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): New values in preparation
3439 for define(eleventh,${11}) extension.
3440 * m4/syntax.c: Update comments accordingly.
3441 (m4_syntax_create, m4_syntax_code): Handle { and }.
3442 * m4/input.c (m4__next_token): Likewise.
3443 * src/freeze.c (produce_frozen_state): Support new categories.
3444 (reload_frozen_state): When loading version 1, disable syntax
3445 features not present in 1.4.x.
3446 * tests/freeze.at: Sort and rename existing tests.
3447 (loading format 1): Ensure we don't break v1 frozen files that
3449 (loading format 2, reloading changecom, reloading changesyntax):
3451 * doc/m4.texinfo (Changesyntax, Frozen file format 1): Document
3452 the new syntax categories.
3453 (Arguments): Update the FIXME comment.
3454 (M4wrap): Merge examples from branch, before worrying about fixing
3455 m4wrap to obey POSIX.
3456 (Using frozen files): Start merging from branch.
3459 2007-01-20 Eric Blake <ebb9@byu.net>
3461 * src/freeze.c (produce_char_dump): Delete. Replace with...
3462 (produce_mem_dump): ...this new function, to encode more strings.
3463 Also make the coding easier to read and slightly more compact.
3464 (produce_syntax_dump): Only dump non-default syntax codes.
3465 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
3466 Encode non-ASCII characters in user-supplied strings.
3467 (GET_STRING): Accept escape sequences in version 2.
3468 * NEWS: Document this change.
3471 2007-01-16 Eric Blake <ebb9@byu.net>
3473 Port patch from branch for stack overflow detection on BSD/OS.
3474 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Check for stack_t.ss_sp.
3475 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
3476 ! HAVE_STACK_T_SS_SP]: Use this check.
3477 Reported by Chris McGuire.
3479 2007-01-15 Eric Blake <ebb9@byu.net>
3481 * tests/builtins.at (__m4_version__): New test.
3482 * modules/traditional.c (m4_macro_table): Provide windows and os2
3483 macros, as appropriate. Add __traditional__ macro.
3484 * modules/mpeval.c (m4_macro_table): Name the macro __mpeval__,
3485 not __gmp__, to match module name.
3486 * modules/load.c (m4_macro_table): Name the macro __load__, not
3487 __modules__, to match module name.
3488 * doc/m4.texinfo (History, Shell commands, Platform macros): Merge
3490 (Standard Modules): Improve wording.
3491 (Incompatibilities): Move platform macros into their own node.
3492 (Load, Unload): Use actual examples.
3493 * NEWS: Document this change.
3496 2007-01-13 Eric Blake <ebb9@byu.net>
3498 * doc/m4.texinfo (Mpeval): Add tests.
3499 * tests/testsuite.at (AT_CHECK_GMP): New filter, factored from...
3500 * tests/builtins.at (gmp): ...here. Rename test to...
3502 * tests/generate.awk (new_test): Filter out mpeval tests when gmp
3504 * m4/m4module.h (m4_get_no_gnu_extensions_opt): Merge
3505 no_gnu_extensions with posixly_correct_opt, since they were set in
3507 * m4/m4private.h (struct m4): Remove no_gnu_extensions.
3508 * src/main.c (main): Update caller.
3509 * src/freeze.c (reload_frozen_state): Likewise.
3510 * modules/m4.c (m4wrap): Likewise.
3512 2007-01-12 Eric Blake <ebb9@byu.net>
3514 * m4/syntax.c (m4_set_comment): XCU ERN 131 was approved by
3515 POSIX, so update the comment.
3516 * doc/m4.texinfo (Inhibiting Invocation): XCU ERN 130 was
3517 approved by POSIX, so we can always have blind macros, even when
3519 (Ifelse): Mention the term `blind builtin'.
3521 2007-01-08 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3523 * doc/m4.texinfo: Fix a couple of typos.
3525 2007-01-08 Eric Blake <ebb9@byu.net>
3527 * ltdl/m4/gnulib-cache.m4: Update for new year.
3528 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Cover all error cases.
3529 Reported by Ralf Wildenhues.
3531 2007-01-06 Eric Blake <ebb9@byu.net>
3533 * m4/m4private.h (to_uchar): Move...
3534 * m4/m4module.h: here, so modules can use it.
3535 * src/main.c (usage, long_options): Support --posix as a synonym
3537 * modules/m4.c (numb_invert): Detect unsupported x**-y.
3538 (numb_incr, numb_urshift, numb_extension): New macros.
3539 (numb_obstack): Port patch from branch to support radix 1 output.
3540 * modules/mpeval.c (numb_obstack): Use \ for ratios.
3541 (numb_incr, numb_urshift, numb_extension): New macros.
3542 (mpq2mpz): Warn rather than error.
3543 * modules/evalparse.c (URSHIFT, NEGATIVE_EXPONENT): New
3545 (eval_error): Rearrange, so that all ignorable errors are less
3547 (eval_text, last_text): Obey C++ type safety rules.
3548 (numb_pow): Change return type.
3549 (exp_term): Adjust caller.
3550 (m4_evaluate): Fail on bad exponent.
3551 (logical_or_term, logical_and_term): Ignore failed ** in short
3553 (eval_lex): Fix typos when detecting <<= and >>=. Use \ instead
3554 of : for ratio. Support >>>, ,, and ?:. Port patch from branch
3555 to parse radix 1 numbers.
3556 (condition_term, comma_term): New parse functions.
3557 (shift_term): Support >>>.
3558 (m4_evaluate): Port patch from branch to output radix 1 numbers.
3559 Warn instead of error for most parse problems.
3560 * doc/m4.texinfo (Limits control, Eval): Document these changes.
3561 * NEWS: Document new operators and new command line option.
3563 2007-01-04 Eric Blake <ebb9@byu.net>
3565 * configure.ac (AC_SYS_LARGEFILE): Guarantee large file support.
3567 2007-01-03 Eric Blake <ebb9@byu.net>
3569 * doc/m4.texinfo (Format, Incr): More merges.
3570 (Eval): Ensure C precedence rules are met.
3571 * modules/evalparse.c (BADOP, INVALID_OPERATOR): New enumerators.
3572 (not_term, logical_not_term): Delete; these are same precedence
3573 as other unary operators.
3574 (equality_term): New; these are lower precedence than relational
3576 (eval_lex, simple_term, m4_evaluate): Recognize forbidden C
3577 operators for better error messages.
3578 (logical_or_term, logical_and_term): Short-circuit out the error
3579 of division by zero.
3580 (unary_term): Allow consecutive unary operators.
3581 * modules/m4.c (int2numb, numb2int): Delete; these potentially
3583 (numb_not, numb_eor, numb_ior, numb_and): Update callers.
3584 * modules/mpeval.c (reduce1, reduce2): Protect macros better.
3585 * NEWS: Document this change.
3587 2006-12-27 Eric Blake <ebb9@byu.net>
3589 * doc/m4.texinfo (Substr, Patsubst): Merge more sections from the
3591 * modules/m4.c (substr): Merge from branch.
3593 2006-12-26 Eric Blake <ebb9@byu.net>
3595 * doc/m4.texinfo (Changesyntax): Check for regressions with
3596 changesyntax(W=...).
3598 2006-12-22 Eric Blake <ebb9@byu.net>
3600 * m4/m4module.h (m4_set_syntax): Change signature.
3601 * modules/gnu.c (m4_resyntax_encode_safe): Reduce error to
3603 (changesyntax): Likewise, and update caller.
3604 * m4/m4private.h (m4_syntax_table): Add orig member.
3605 * m4/syntax.c (m4_set_quotes, m4_set_comment): Merge from branch.
3606 Don't set is_single_quotes and is_single_comments when the begin
3607 character is shadowed by another syntax type.
3608 (m4_syntax_create): Populate default syntax table.
3609 (add_syntax_attribute): Don't lose quote assignment.
3610 (remove_syntax_attribute): Only allow removing rquote or ecomm.
3611 (add_syntax_set, subtract_syntax_set, set_syntax_set)
3612 (reset_syntax_set): New helper routines.
3613 (m4_set_syntax): Alter semantics - NUL key reverts entire syntax
3614 to default, and empty chars reverts that key to default.
3615 (check_is_single_quotes, check_is_single_comments): New helper
3617 * modules/m4.c (changecom): Merge from branch.
3618 * m4/input.c (m4__next_token): Rearrange token recognition order
3619 to macro, quote, comment, in order to match traditional
3621 * src/freeze.c (reload_frozen_state): Update caller.
3622 * doc/m4.texinfo (Changequote, Changecom): Merge from branch, with
3624 (Changeresyntax): Revise to match style of surrounding sections
3625 and add more examples.
3626 (Changesyntax): Likewise, and update to new semantics.
3627 * NEWS: Document this change.
3629 * doc/m4.texinfo (Operation modes): Avoid underfull hbox.
3630 (M4wrap, Eval, Errprint): Fix typos.
3631 (Divnum): Not necessary to redivert in example.
3633 2006-12-21 Eric Blake <ebb9@byu.net>
3635 * doc/m4.texinfo (Len, Index macro, Regexp): More section merging
3638 2006-12-19 Eric Blake <ebb9@byu.net>
3640 * modules/m4.h (m4_sysval_flush_func): Adjust prototype.
3641 * modules/m4.c (m4_sysval_flush): Add parameter, so that m4exit
3642 can track write errors without all other callers warning multiple
3644 (sysval_flush_helper): New function.
3645 (dumpdef, syscmd, errprint, m4exit): Adjust callers.
3646 * modules/gnu.c (esyscmd): Likewise.
3647 * tests/others.at (stdout closed, stdout full): Error message
3650 2006-12-16 Eric Blake <ebb9@byu.net>
3652 * src/main.c: Fix missing include.
3654 * src/main.c (main): Check for errors when closing stdin.
3655 * modules/m4.c (m4exit): Missed part of previous patch: flush
3656 stdin before a successful exit.
3657 Reported by Ralf Wildenhues.
3659 2006-12-14 Eric Blake <ebb9@byu.net>
3661 * modules/m4.c (m4_sysval_flush): Flush stdin before exiting, as
3663 * tests/others.at (stdin seekable): New test.
3665 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3667 * doc/m4.texinfo: Fix some typos.
3669 2006-12-04 Eric Blake <ebb9@byu.net>
3671 * doc/m4.texinfo (Undivert, Divnum, Cleardivert): Merge more doc
3673 (Modules): Make style consistent.
3675 2006-11-16 Eric Blake <ebb9@byu.net>
3677 * bootstrap: Relax m4 requirement, thanks to...
3678 * configure.ac (Gettext support): ...this workaround to the 1.4.4
3679 bug. Undoes restriction added on 2006-11-09.
3681 * tests/builtins.at (esyscmd, syscmd): Redo, since spilled
3682 diversions are now closed when not active.
3683 (divert): Remove check now in the manual.
3684 * tests/others.at (stderr closed): Likewise.
3685 (stdout closed): Add a check.
3686 * doc/m4.texinfo (Include, Search Path, Diversions, Divert): Sync
3687 more docs with branch.
3689 2006-11-14 Eric Blake <ebb9@byu.net>
3691 Remerge sparse diversion handling from branch.
3692 * ltdl/m4/gnulib-cache.m4: Replace avltree-list with
3694 * m4/output.c (diversion_table): Change type to gl_oset_t.
3695 (m4_output_init, m4_output_exit, cleanup_tmpfile, make_room_for)
3696 (m4_make_diversion, insert_diversion_helper, m4_insert_diversion)
3697 (m4_undivert_all, m4_freeze_diversions): Adjust all callers.
3698 (div0, diversion_storage): New variables.
3699 (diversions, equal_diversion_CB): Deleted.
3700 (threshold_diversion_CB): New callback.
3701 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
3703 (m4_tmpfile): Move cloexec action here.
3705 * m4/resyntax.c (m4_regexp_syntax_encode): Avoid bug with signed
3708 2006-11-13 Eric Blake <ebb9@byu.net>
3710 Add several new command line options.
3711 * src/main.c (usage): Update.
3712 (OPTSTRING, long_options): Add --pushdef, --popdef, --gnu,
3713 --traceon, --traceoff, --syncoutput, --warnings, --unload-module.
3714 Make --regexp-syntax argument optional.
3715 (main): Support new options. Fix regression in interactive
3716 behavior from Nov 8.
3717 * m4/m4private.h (M4_OPT_SYNCOUTPUT_BIT): Rename from
3718 M4_OPT_SYNC_OUTPUT_BIT.
3719 * m4/m4module.h (m4_context_opt_bit_table): Rename sync_output to
3720 syncoutput, to match option.
3721 (m4_parse_truth_arg): New prototype.
3722 * m4/utility.c (m4_parse_truth_arg): Implement it.
3723 * m4/output.c (m4_shipout_text): Adjust sync_output caller.
3724 * modules/gnu.c (syncoutput): Adjust sync_output caller, and use
3726 * doc/m4.texinfo (Operation modes, Dynamic loading features)
3727 (Preprocessor features, Limits control, Debugging options)
3728 (Command line files): Update documentation.
3729 * tests/builtins.at (mkstemp): Simplify.
3730 * tests/macros.at (Command line pushdef): New test.
3731 (Command line define): Improve.
3732 * tests/options.at (--traceon and --traceoff, --syncoutput): New
3734 (POSIXLY_CORRECT): Likewise.
3735 (deprecated options): Augment.
3736 (--regexp-syntax): Update, now that -r takes optional arg.
3737 * NEWS: Reformat. Document new options.
3739 2006-11-11 Eric Blake <ebb9@byu.net>
3741 One step closer to allowing C++ compilation - don't blindly
3742 convert between char* and unsigned char*.
3743 * m4/m4module.h (m4_set_syntax): Change signature.
3744 * m4/m4private.h (m4_string): Use signed char.
3745 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
3746 (m4_get_syntax_ecomm): No longer a need to cast.
3747 * m4/syntax.c (m4_set_syntax, m4_syntax_create, m4_set_quotes):
3748 Reflect this change.
3749 * m4/macro.c (expand_argument): Simplify.
3750 (expand_token): Use proper type.
3751 * src/freeze.c (reload_frozen_state): Likewise.
3752 * m4/input.c (MATCH, match_input): Likewise.
3753 * modules/m4.c (translit): Likewise.
3754 * modules/gnu.c (substitute): Simplify.
3756 * m4/macro.c (trace_format): Use canonical type name.
3757 * m4/output.c (m4_freeze_diversions): Likewise.
3758 * src/freeze.c (produce_module_dump, dump_symbol_CB)
3759 (produce_frozen_state): Likewise.
3760 * m4/m4private.h (to_uchar): Grab from branch.
3761 * m4/input.c (string_peek, string_read): Use it.
3762 * m4/utility.c (skip_space): Likewise.
3763 * src/main.c (main): Likewise.
3764 * doc/m4.texinfo (Translit): Remerge from branch.
3765 * tests/builtins.at (translit): Test 8-bit range.
3766 * modules/m4.c (m4_expand_ranges): Merge from branch.
3768 2006-11-09 Eric Blake <ebb9@byu.net>
3770 * bootstrap: Validate that installed M4 is powerful enough.
3771 Reported by Gary V. Vaughan, analyzed by Stepan Kasal.
3773 2006-11-08 Eric Blake <ebb9@byu.net>
3775 Merge deferred handling of -D option from branch.
3776 * doc/m4.texinfo (Debugging options, Preprocessor features)
3777 (Dynamic loading features, Operation modes, Invoking m4):
3778 Document this change.
3779 * src/main.c (OPTSTRING): Specify in-order processing.
3780 (process_file): New function.
3781 (main): Use it to interleave files and deferred options.
3782 * tests/macros.at (Command line define): New test.
3783 * tests/generate.awk: Allow '@comment file' as first example
3785 * tests/options.at (option grouping): Update to reflect actual
3787 (file names): New test.
3789 2006-11-07 Eric Blake <ebb9@byu.net>
3791 * m4/output.c (cleanup_tmpfile, m4_insert_diversion_helper): Check
3794 * tests/builtins.at (m4exit): New test; failed on cygwin before
3796 * m4/output.c (cleanup_tmpfile): Close files before removing
3798 (make_room_for, m4_output_exit): Ensure that atexit handler
3799 invoked from m4_error sees consistent state.
3801 * doc/m4.texinfo (Errprint): Merge another doc node.
3802 * tests/builtins.at (dumpdef, errprint): New tests.
3803 * modules/m4.c (errprint): Merge from branch: flush before
3806 2006-11-02 Eric Blake <ebb9@byu.net>
3808 * bootstrap: Update bootstrap requirement wording.
3809 Reported by Bruno Haible.
3811 2006-10-31 Eric Blake <ebb9@byu.net>
3813 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3815 * doc/m4.texinfo (Translit): Merge from branch.
3816 * modules/m4.c (divert, substr): Ignore excess arguments.
3817 (index, translit): Merge from branch.
3818 * tests/builtins.at (translit): Add a test.
3820 2006-10-30 Eric Blake <ebb9@byu.net>
3822 * m4/m4private.h (m4_get_symbol_value_module): Delete accidental
3824 * m4/symtab.c (m4_get_symbol_value_module): Likewise.
3826 * modules/m4.c (m4_make_temp): Make safe across libtool.
3827 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Avoid warnings.
3828 * configure.ac (--with-modules): Accomodate changed module
3829 location when doing './configure --enable-debug'.
3831 2006-10-28 Eric Blake <ebb9@byu.net>
3833 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3836 2006-10-27 Eric Blake <ebb9@byu.net>
3838 * bootstrap (gnulib): No longer a need to patch after gnulib-tool
3840 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
3841 0.16, since 0.15 is incompatible with our automake requirement.
3843 * m4/macro.c (expand_argument): Fix missing initialization.
3844 * m4/m4private.h (struct m4_symbol_value): Store entire
3845 m4_builtin, not just the func.
3846 (m4_get_symbol_value_func): Update.
3847 (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
3849 * m4/m4module.h (m4_get_symbol_value_builtin)
3850 (m4_get_symbol_builtin): New prototypes.
3851 (m4_set_symbol_value_func): Delete, replace with...
3852 (m4_set_symbol_value_builtin): New function.
3853 (m4_builtin_find_by_name): Change signature.
3854 * m4/symtab.c (m4_symbol_value_print): Simplify.
3855 (m4_get_symbol_value_func): Update.
3856 (m4_get_symbol_value_builtin): New function.
3857 (m4_set_symbol_value_func): Delete, replace with...
3858 (m4_set_symbol_value_builtin): New function.
3859 (dump_symbol_CB) [DEBUG_SYM]: Simplify.
3860 * m4/builtin.c (m4_builtin_find_by_name): Change signature.
3861 * m4/input.c (struct m4_input_block): Remove unused trace member.
3862 (m4_push_builtin, builtin_print, init_builtin_token): Update
3864 * m4/module.c (install_builtin_table): Likewise.
3865 * src/freeze.c (reload_frozen_state): Likewise.
3866 * modules/gnu.c (builtin): Make it possible to retrieve a builtin
3867 token, even after the builtin has been undefined.
3868 * doc/m4.texinfo (Builtin): Document new capability.
3871 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3873 * modules/m4.c (m4_make_temp): Use it.
3874 * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
3876 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3878 * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
3881 2006-10-26 Eric Blake <ebb9@byu.net>
3883 Silence -O2 -Wall -Wwrite-strings warnings.
3884 * m4/m4private.h (m4_symbol_value): Const-ify text.
3885 * m4/m4module.h (m4_get_symbol_value_text)
3886 (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
3887 (m4_set_symbol_value_placeholder): Likewise.
3888 * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
3890 * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
3891 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
3892 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
3894 * modules/format.c (format): Likewise.
3895 * src/main.c (main): Likewise.
3896 * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
3897 * modules/shadow.c (shadow, test): Likewise.
3898 * m4/output.c (m4_make_diversion): Don't hold on to empty
3900 (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
3901 (m4_freeze_diversions): Likewise. Don't use uninitialized
3904 Convert diversions to list instead of sparse array, part 2.
3905 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3907 * m4/output.c (m4_diversion): Add next pointer and divnum members.
3908 (diversion_table): Convert to a list instead of a sparse array.
3909 (free_list): Maintain free list of reclaimed diversions.
3910 (equal_diversion_CB, cmp_diversion_CB): New functions.
3911 (m4_output_init): Set up list.
3912 (m4_output_exit): Tear down list.
3913 (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
3915 (m4_make_diversion): Change creation of new diversions.
3916 (m4_insert_diversion_helper): New function, to avoid list
3918 * tests/builtins.at (divert): The test now passes.
3919 * NEWS: Document this improvement.
3921 Convert diversions to list instead of sparse array, part 1.
3922 * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
3924 * m4/output.c (diversion, total_buffer_size, output_unused):
3925 Track size in size_t. All users changed.
3926 (struct diversion): Reduce size now, to compensate for part 2.
3927 (m4_make_diversion, make_room_for): Avoid malloc overflow.
3928 (m4_output_exit): Fix typo in assert.
3929 (m4_output_init, make_room_for, m4_make_diversion)
3930 (m4_insert_diversion, m4_freeze_diversions): Adjust users of
3931 struct m4_diversion to disambiguate the new union.
3932 * tests/builtins.at (divert): Detect this failure.
3934 2006-10-25 Eric Blake <ebb9@byu.net>
3936 * m4/m4module.h (m4_push_builtin): Add parameter.
3937 * modules/m4.c (defn): Update caller.
3938 * m4/input.c (file_read_init, string_read_init): No longer
3940 (input_funcs): Change signature of read_func, all callers
3942 (composite_peek, composite_read, composite_unget),
3943 (composite_print, composite_funcs): New input type. Not yet
3944 fully utilized, but one step closer to fixing defn.
3945 (m4_input_block): Make every input block track current file and
3946 line. Rename some members. Remove unused out_line. Add support
3947 for composite input block.
3948 (input_change): New flag.
3949 (file_peek, file_read, file_clean, file_unget, file_print):
3951 (m4_push_file, m4_push_builtin, m4_push_string_init)
3952 (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
3953 (m4_skip_line, pop_input): Track input block changes.
3954 (m4_pop_wrapup): Avoid overflow.
3955 (init_builtin_token): Handle composite input.
3956 (next_char): Handle input block changes.
3957 * doc/m4.texinfo (Location): Remerge from branch.
3959 * src/m4.h (includes): Need <locale.h> after all; fixes
3960 regression from yesterday.
3962 * m4/system_.h (obstack_regrow): New macro. Hopefully glibc will
3964 * m4/macro.c (expand_macro): Avoid referencing invalid memory.
3965 Handle nesting the argc obstack.
3966 (expand_token): Avoid unnecessary malloc.
3967 (collect_arguments): Copy name before invalidating it.
3968 (argc_stack, argv_stack): New variables.
3969 (m4_macro_expand_input): Initialize argc and argv stacks once per
3970 file, instead of once per macro.
3972 2006-10-24 Eric Blake <ebb9@byu.net>
3974 * src/m4.h (includes): Add gettext.h, for N_. Assume setlocale.
3976 2006-10-23 Eric Blake <ebb9@byu.net>
3978 * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
3979 from branch regarding stripped leading whitespace.
3981 * modules/m4.c (includes): Use safe headers even when configured
3982 with --enable-assert.
3983 (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
3984 #defined as mkstemp_safer.
3986 2006-10-21 Eric Blake <ebb9@byu.net>
3988 * modules/m4.c (m4_make_temp): Change signature.
3989 (maketemp, mkstemp): Update callers.
3990 * modules/m4.h (m4_make_temp_func): New export.
3991 * modules/gnu.c (mkdtemp): New macro.
3992 * doc/m4.texinfo (Operation modes): Document interaction with
3994 (Mkdtemp): New node.
3995 * tests/builtins.at (mkdtemp): New test.
3996 (mkstemp): Check for umask effect.
3997 * NEWS: Document new builtin.
3999 * tests/generate.awk (normalize): Update recognition of trailing
4001 * doc/m4.texinfo: Minor formatting fixes from branch.
4002 (Foreach, Improved foreach): Merge from branch.
4003 * examples/foreach.m4: Merge from branch.
4004 * examples/foreachq.m4: New file from branch.
4005 * examples/foreach2.m4: Likewise.
4006 * examples/foreachq2.m4: Likewise.
4008 * doc/m4.texinfo (titlepage): Add myself as author.
4009 * src/main.c (AUTHORS): Likewise.
4011 2006-10-19 Eric Blake <ebb9@byu.net>
4013 * modules/m4.c (m4_make_temp, mkstemp): New functions.
4014 (maketemp): Add POSIX behavior and a warning.
4015 * tests/others.at (maketemp): Move this test...
4016 * tests/builtins.at (mkstemp): ...to here, and beef up.
4017 * tests/options.at (--safer): Update to new warning message.
4018 * doc/m4.texinfo (Mkstemp): Sync from branch.
4019 (Extensions): Update maketemp behavior.
4020 * NEWS: Document that maketemp now always warns.
4022 * tests/generate.awk: For ease of doc-writing, simplify selection
4023 of '-Ipath/to/examples' to '@comment examples'.
4024 * examples/forloop.m4: Simplify.
4025 * examples/forloop2.m4: New file.
4026 * examples/quote.m4: New file.
4027 * doc/m4.texinfo (Improved forloop): New node.
4028 (Manual): Clarify use of examples directory.
4029 (Shift, Forloop): Resync from branch.
4030 (Include, Location): Update to new usage of examples directory.
4032 * m4/system_.h (includes): Pick up <unistd.h> before checking for
4034 (gettext_noop): Don't define here, let gettext.h do it instead.
4035 * po/POTFILES.in: Update entries to reflect gnulib imports.
4037 2006-10-16 Eric Blake <ebb9@byu.net>
4039 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
4041 * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
4042 pkglibexecdir support.
4043 * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
4044 worry about pathconf.h, now that gnulib does it for us.
4045 (pkgmodincludedir): Simplify.
4046 (pkglibexecdir): Delete, now that automake does this.
4047 * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
4048 * src/main.c (usage): Likewise.
4049 * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
4051 * doc/m4.texinfo: Port some changes from the branch.
4052 (Invoking m4): Promote to a chapter, instead of a section of
4054 (Operation modes, Dynamic loading features, Preprocessor features)
4055 (Limits control Frozen state, Debugging options)
4056 (Command line files): Subdivide into new sections.
4057 (Cleardivert): Rename from cleardiv.
4059 2006-10-14 Eric Blake <ebb9@byu.net>
4061 * tests/others.at (stdin closed): Update to match previous patch.
4063 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
4065 Reported by Ralf Wildenhues.
4067 * modules/m4.c (undivert): Merge from branch.
4068 * doc/m4.texinfo (Improved fatal_error): Fix typo.
4069 (Improved exch): New node, copied from branch.
4070 (Improved cleardivert): Update from branch.
4073 2006-10-13 Eric Blake <ebb9@byu.net>
4075 * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
4077 * modules/gnu.c (builtin, indir): Transparently handle builtin
4079 * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
4080 * m4/input.c (m4_pop_wrapup): Display debug message when switching
4082 (m4_input_init): No need to use empty file any more.
4083 (file_print): Display correct file name.
4084 * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
4085 dereference a NULL file name.
4086 * m4/m4module.h (m4_pop_wrapup): New parameter.
4087 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
4089 * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
4090 * m4/symtab.c (m4_symbol_value_groks_macro): New method.
4091 * src/main.c (main): Adjust caller.
4092 * tests/options.at (--debugmode): Test more output from -dV.
4094 2006-10-12 Eric Blake <ebb9@byu.net>
4096 * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
4098 * m4/m4private.h (m4__next_token_is_open): New prototype.
4099 * m4/m4module.h (m4_push_single): Delete; push_string is an
4100 adequate interface, and removing support for this simplifies the
4102 (m4_push_wrapup): New parameter.
4103 (m4_is_syntax): Delete; m4_has_syntax is sufficient.
4104 (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
4105 start-quote and start-comment exclusive from other syntax
4107 * m4/syntax.c: Likewise.
4108 * m4/input.c (input_funcs): Make polymorphic without requiring
4109 clients to know whether they are located at isp. All users
4111 (file_names): New variable.
4112 (m4_input_init): Initialize it.
4113 (m4_push_file): Use it.
4114 (m4_input_exit): Free it after use.
4115 (m4__next_token): Simplify slightly.
4116 (m4__peek_token): Rename and simplify...
4117 (m4__next_token_is_open): ... to this. In particular, this
4118 allows us to avoid a double ungetc, which POSIX doesn't
4120 (struct m4_input_block, m4_push_single, single_peek, single_read):
4121 Remove support for single characters, as the input engine now
4122 guarantees we don't need it.
4123 (file_unget, string_unget, m4_input_print, unget_input):
4124 Strengthen assertions.
4125 (file_init_funcs, file_read_init): New for file reading.
4126 (string_init_funcs, string_read_init): New for wrapped text.
4127 (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
4128 Support wrapped text with locations.
4129 (m4_skip_line): Support dnl across include file boundary.
4130 (peek_char): Don't pop input when peeking.
4131 (file_peek): Peek can be called at the end of the file.
4132 (string_read): Don't read beyond string bounds.
4133 * m4/macro.c (expand_token, collect_arguments): Update callers.
4134 (expand_macro): Report errors at location of open parenthesis.
4135 (expand_token, expand_argument, process_macro): Avoid negative
4136 array dereferences with m4_has_syntax.
4137 * m4/utility.c (skip_space): Likewise.
4138 * modules/m4.c (m4wrap): Update caller.
4139 * tests/builtins.at (__file__, __line__, dnl): New tests.
4140 * tests/options.at (--debugmode): Normalize the output.
4141 * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
4142 Remerge recent changes from branch.
4143 (Improved fatal_error): New node from branch.
4145 2006-10-11 Eric Blake <ebb9@byu.net>
4147 * src/main.c (usage, long_options): Add --debugmode as an alias
4148 for --debug, to match macro name.
4149 * tests/options.at (--debugmode): Rename from --debug, and test
4151 (--discard-comments): Augment test.
4152 * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
4155 2006-10-10 Eric Blake <ebb9@byu.net>
4157 Trace improvements: debugmode(c) was always printing the last two
4158 lines paired, combine them; and show non-text expansions.
4159 * m4/macro.c (trace_prepre): Update to show what the macro will
4161 (trace_pre): No need to special-case on debugmode(c).
4162 (trace_post): Likewise. Also, show non-text expansions.
4163 (expand_macro): Update caller. Collecting arguments can change
4164 debug mode, so cache values beforehand.
4165 (trace_format): Remove support for unused %l%S%r, and fix support
4166 for %z to match gcc's attribute((printf)).
4167 (trace_header): Update caller.
4168 * m4/input.c (struct m4_input_block): Rename from input_block.
4169 (struct input_funcs): Add print_func member.
4170 (file_print, builtin_unget, builtin_print, string_print)
4171 (m4_input_print): New functions.
4172 (m4_push_string_finish): Change return type.
4173 (m4_push_file): Fix missing use of close parameter.
4174 * m4/debug.c (m4_debug_decode): Don't clear pending traces.
4175 * m4/m4module.h (m4_input_print): New prototype.
4176 * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
4177 to match behavior change.
4178 * tests/options.at (--debug): Likewise.
4179 * tests/macros.at (Propagation of traceon)
4180 (Propagation of --trace): Likewise.
4181 * tests/others.at (stderr closed, stdout closed, stdin closed):
4183 * doc/m4.texinfo (Forloop): Simplify.
4184 (Trace): Update to changed behavior.
4185 (Debugmode): Document this change.
4186 * src/main.c (usage): Likewise.
4189 2006-10-09 Eric Blake <ebb9@byu.net>
4191 * m4/path.c (m4_include_env_init): Don't alter result of getenv.
4192 Reported by Ralf Wildenhues.
4194 * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
4196 2006-10-07 Eric Blake <ebb9@byu.net>
4198 * m4/m4module.h (m4_set_exit_failure): New prototype.
4199 * m4/utility.c (m4_set_exit_failure): New function.
4200 * modules/m4.c (m4exit): Use it to avoid yet another global
4201 variable export in libm4.
4203 2006-10-06 Eric Blake <ebb9@byu.net>
4205 * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
4207 * tests/others.at (stdout closed): Fix final check.
4209 Replace uses of tmpfile with clean-temp, since tmpfile is
4210 incompatible with closeout.
4211 * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
4213 * tests/others.at (stderr closed): Likewise.
4214 * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
4215 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4217 * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
4218 (m4_tmpfile, cleanup_tmpfile): New functions.
4219 (make_room_for, m4_insert_diversion): Use clean-temp module.
4220 * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
4222 * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
4224 * m4/utility.c (m4_numeric_arg): Merge from branch.
4225 * modules/gnu.c (debuglen): New builtin.
4226 * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
4227 Rename --arglength to --debuglen.
4228 * tests/options.at (--arglength): Rename to --debuglen.
4229 (deprecated options): Augment test.
4230 * doc/m4.texinfo (Invoking m4): Document the name change.
4231 (Debugmode): Rename from Debug Levels.
4232 (Debugfile): Rename from Debug Output.
4233 (Debuglen): New node.
4234 * NEWS: Document these changes.
4236 * modules/m4.c (m4exit): Fix typo. Ensure desired exit status in
4237 case closing a module exits.
4239 * modules/m4.c (m4exit): Merge from branch.
4240 * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
4242 2006-10-05 Eric Blake <ebb9@byu.net>
4244 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4246 * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
4247 * src/main.c (main): Close stdout on exit.
4248 * m4/debug.c (set_debug_file): Check for write failure.
4249 * m4/m4.c (m4_delete): Don't mask write failure.
4250 * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
4251 macros before calling AT_CHECK.
4252 (M4_ONE_MEG_DEFN): New helper macro.
4253 * tests/others.at (stdout full): New test.
4254 (stderr closed, stdin closed, stdout closed): Augment.
4255 * tests/builtins.at (syscmd): New test.
4258 2006-10-04 Eric Blake <ebb9@byu.net>
4260 * tests/builtins.at: Alphabetize tests.
4261 * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
4262 * tests/generate.awk (new_test): Fix underquoting.
4263 * tests/others.at (maketemp): Rename from misc.
4264 (stdin closed, stdout closed, stderr closed): New tests.
4266 2006-10-03 Eric Blake <ebb9@byu.net>
4268 Avoid all global variables in modules, so that --disable-static
4270 * examples/incl.m4: New file, from branch.
4271 * Makefile.am (dist_pkgdata_DATA): Distribute it.
4272 * doc/m4.texinfo (Location): Merge this section from branch.
4273 (Include): Update the test.
4274 * tests/generate.awk (new_test): Allow for VPATH build
4275 pre-processing of expected __program__ output.
4276 * m4/m4module.h (m4_current_diversion, m4_output_current_line):
4277 Avoid global variables.
4278 (m4_context_field_table): Add current_diversion, output_line.
4279 (m4_output_init, m4_make_diversion): Add parameter.
4280 (m4_get_program_name, m4_set_program_name): New accessors.
4281 * m4/m4private.h (m4_get_current_diversion),
4282 (m4_set_current_diversion, m4_get_output_line)
4283 (m4_set_output_line): New accessors.
4284 * m4/utility.c (m4_get_program_name, m4_set_program_name): New
4286 * modules/m4.c (divnum, divert): Adjust callers.
4287 * modules/gnu.c (__program__): Likewise.
4288 * m4/output.c (m4_output_init, m4_make_diversion)
4289 (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
4290 (m4_insert_diversion): Likewise.
4291 * m4/input.c (file_clean, m4_push_file): Likewise.
4292 * src/freeze.c (reload_frozen_state): Likewise.
4293 * src/main.c (main, usage): Likewise.
4295 Partially plug memory leak when unloading gnu module.
4296 * tests/modules.at (unload gnu module): New test.
4297 * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
4298 (m4_regexp_compile): Move static storage to module visibility.
4299 * tests/options.at (--debug): Adjust to new output.
4301 2006-09-29 Eric Blake <ebb9@byu.net>
4303 Even when not the first option, --help can't have side effects.
4304 * tests/options.at (--debugfile): Detect bugs in this area.
4305 * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
4307 * src/main.c (main): Fix it by deferring debugfile change. Also,
4308 defer closing streams until after module tracing is done.
4309 * modules/gnu.c (debugfile): Make message consistent with command
4311 * doc/m4.texinfo (Invoking m4): Touch up the documentation.
4312 * NEWS: Document this fix.
4314 * modules/m4.c (dnl): Include macro name in warning message.
4315 * m4/input.c (m4_skip_line): Add parameter.
4316 * m4/m4module.h (m4_skip_line): Likewise.
4317 * src/main.c (usage): Update wording.
4318 * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
4319 issue of blind macros vs. POSIX is resolved.
4320 (Dnl): Merge another node from branch.
4322 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4324 * m4/system_.h (N_): Define.
4325 * src/main.c (main): Validate numeric arguments.
4326 (size_opt): New function, idea borrowed from coreutils.
4327 * m4/macro.c (expand_macro): -L0 implies no limit.
4328 * doc/m4.texinfo (Invoking m4): Document this change.
4330 * tests/options.at: (--arglength, --nesting-limit)
4331 (--regexp-syntax): New tests of argument validation.
4333 2006-09-28 Eric Blake <ebb9@byu.net>
4335 * tests/options.at: Alphabetize the tests.
4337 2006-09-27 Eric Blake <ebb9@byu.net>
4339 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
4340 another parameter to print module info.
4341 * m4/macro.c (trace_pre): Adjust caller.
4342 * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
4343 * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
4344 * NEWS: Document this.
4346 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4348 * m4/symtab.c (symbol_value_print): Rename to...
4349 (m4_symbol_value_print): ...this, and...
4350 (m4_symbol_print): Update to allow -L length truncation. Now
4351 truncation also affects dumpdef output and builtin names.
4352 * m4/m4private.h (nesting_limit, max_debug_argument_length):
4354 * m4/m4module.h (m4_symbol_print): Add parameter.
4355 (m4_symbol_value_print): New function.
4356 * modules/m4.c (dumpdef): Allow length truncation.
4357 * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
4359 * doc/m4.texinfo (Invoking m4): Document -l better.
4360 (Dumpdef, Debug Levels): Document the effect of -l.
4361 * NEWS: Document this change.
4363 * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
4364 (m4_expand_ranges): Ensure we aren't picking up partial object on
4366 * modules/stdlib.c (setenv): Allow extra arguments.
4367 * modules/time.c (ctime): Avoid side effect in call to
4369 * modules/gnu.c (m4_regexp_substitute): Likewise.
4370 (renamesyms): Avoid extra obstack_init.
4371 * src/freeze.c (reload_frozen_state): Remove debug comment.
4372 (produce_frozen_state): Simplify fprintf to puts where possible.
4373 * modules/modtest.c (modtest_init, modtest_finish): Likewise.
4374 * modules/import.c (import, symbol_fail, modules_fail): Likewise.
4375 * m4/macro.c (trace_flush): Likewise.
4376 * m4/debug.c (m4_debug_message_prefix): Likewise.
4377 * m4/path.c (include_dump): Likewise.
4378 * m4/module.c (module_remove): Likewise.
4379 (install_builtin_table): Simplify malloc and string
4382 2006-09-26 Eric Blake <ebb9@byu.net>
4384 * m4/m4module.h (m4_symbol_print): New prototype.
4385 (M4_DEBUG_TRACE_STACK): New enumerator.
4386 (m4_is_debug_bit): Allow use without requiring m4private.h.
4387 * m4/symtab.c (symbol_value_print, m4_symbol_print): New
4389 * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
4391 (dumpdef): Allow printing pushdef'd stacks.
4392 * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
4393 * src/main.c (usage): Document it.
4394 * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
4397 * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
4399 * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
4400 of lines during make.
4401 (AM_CPPFLAGS): Remove unneeded include path.
4402 (src_m4_CPPFLAGS): Remove redundant include path.
4403 * m4/system_.h Make preprocessor indentation consistent.
4404 (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
4406 (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
4408 (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
4409 (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
4410 (bool, true, false): Don't undefine here; stdbool takes care of
4412 * src/m4.h (includes): Assume config.h, and several standard
4414 (__CYGWIN__, WIN32): Don't define here; let system.h do it.
4415 * m4/m4private.h: Assume config.h.
4416 * m4/output.c: Likewise.
4417 * m4/path.c: Likewise.
4418 * m4/resyntax.c: Likewise.
4419 * m4/utility.c: Likewise.
4420 * modules/gnu.c: Likewise.
4421 * modules/import.c: Likewise.
4422 * modules/load.c: Likewise.
4423 * modules/m4.c: Likewise.
4424 * modules/modtest.c: Likewise.
4425 * modules/mpeval.c: Likewise.
4426 * modules/perl.c: Likewise.
4427 * modules/shadow.c: Likewise.
4428 * modules/stdlib.c: Likewise.
4429 * modules/time.c: Likewise.
4430 * modules/traditional.c: Likewise.
4432 2006-09-21 Eric Blake <ebb9@byu.net>
4434 * doc/m4.texinfo (Invoking m4): Add clarification on option
4435 processing behavior.
4436 * tests/options.at (option grouping): Test this.
4438 Reported by Mikhail Teterin.
4440 * bootstrap: Add --force option, based on idea from coreutils.
4441 * README: Document that ./bootstrap and autoreconf are for
4442 developers, and not lightly done in tarballs.
4444 2006-09-20 Eric Blake <ebb9@byu.net>
4446 * src/main.c (usage, OPTSTRING, main): Rename -e to -i. Make
4447 warnings consistent.
4448 (long_options, HASHSIZE_OPTION): Warn on -H.
4449 * doc/m4.texinfo (Invoking m4): Document this.
4450 * tests/options.at (deprecated options): Update.
4452 Change the default of interactive sessions to match sh.
4453 * src/main.c (usage): Document this.
4454 (enum interactive_choice): New enum.
4455 (main): Use it to defer decision of interactive until after
4456 argument processing.
4457 * doc/m4.texinfo (Invoking m4): Document this.
4458 * NEWS: Likewise, plus add missing mention of -b.
4459 Reported by Stepan Kasal.
4461 2006-09-19 Eric Blake <ebb9@byu.net>
4463 * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
4464 well as --error-output; the goal is to add -o/--output in some
4465 future version with semantics like gcc or autom4te.
4466 * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
4467 (Extensions): Reflect this update.
4468 (Renamesyms): Add another test.
4469 (Defn): Xfail for now, so that `make check' is happy.
4470 * NEWS: Document this change.
4471 * tests/generate.awk: Mark dynamic loading tests as such. Allow
4473 * tests/macros.at (Renamesyms collisions): New test, exposing
4474 renamesyms' coredump.
4475 * tests/options.at (--debugfile, --safer): Update to match
4478 * m4/debug.c (set_debug_file): Fix regression in -o when stdout
4479 and stderr are same file, introduced 2003-07-23.
4480 * tests/options.at (--debugfile): New test, to catch the bug.
4481 (deprecated options): Test --error-output.
4482 * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
4483 Deprecate --error-output, and replace it with --debugfile.
4484 * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
4485 Document this change.
4488 2006-09-18 Eric Blake <ebb9@byu.net>
4490 * modules/load.c (modules): Rename to...
4491 (m4modules): ...this, since it is an English word with 0
4493 * modules/gnu.c (symbols, m4symbols): Likewise.
4494 * doc/m4.texinfo (Listing Modules): Rename to...
4495 (M4modules): ...this.
4496 (Symbols): Rename to...
4497 (M4symbols): ...this.
4498 (Load, Foreach, Trace, Answers): Update to new spellings.
4499 * NEWS: Document this.
4501 * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
4502 such that without arguments, the global trace flag is changed
4503 rather than walking the table of all currently-defined macros.
4504 (set_trace_CB): No longer needed.
4505 * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
4506 (m4_set_symbol_traced): Delete.
4507 (m4_symtab_create): Nuke the nuke parameter.
4508 * m4/m4private.h (m4_get_symbol_value): Delete.
4509 * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
4510 (m4_set_symbol_name_traced): Free undefined entries that are no
4512 (symbol_destroy_CB): Update caller.
4513 * m4/m4.c (m4_create): Update caller.
4514 * src/main.c (main): Likewise.
4515 (usage): Fix typo in last commit.
4516 * doc/m4.texinfo: Minor cleanups throughout.
4517 (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
4518 more nodes from branch.
4519 (Trace): Document new semantics, and how to simulate the old.
4520 * tests/builtins.at (multiquotes): Adjust to new semantics.
4521 * NEWS: Update somewhat.
4523 2006-09-14 Eric Blake <ebb9@byu.net>
4525 Add --safer option, per debian bug 5898.
4526 * src/main.c (usage): Document new option.
4527 (SAFER_OPTION): New enumerator.
4528 (main): Set the option bit.
4529 * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
4531 * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
4532 (m4_get_safer_opt): New accessor.
4533 * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
4534 * modules/m4.c (syscmd, maketemp): Likewise.
4535 * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
4536 (Sysval, Maketemp): Add tests of this.
4537 * tests/options.at (--safer): Likewise.
4539 2006-09-13 Eric Blake <ebb9@byu.net>
4541 * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
4543 Reported by Ralf Wildenhues.
4546 * Makefile.am (check_LTLIBRARIES): Build test libraries in the
4547 tests directory, so we can be sure an installed build is not
4548 picking up uninstalled non-test libraries.
4549 (check-local, installcheck-local): Depend on test libraries.
4550 * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
4551 after file name. Fix quoting. Remove skipping the test, now
4552 that makefile guarantees test modules will exist.
4553 (Freezing modules, modules: shadow, modules: unload)
4554 (modules: trace): Always put test modules in module path.
4555 (modules: importing): Likewise, and rely on AT_CHECK_M4 for
4557 * src/main.c (usage): Document default module search path.
4558 (import_environment, frozen_file_to_read, frozen_file_to_write):
4561 * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
4562 * tests/m4.in: ...not here.
4563 Reported by Ralf Wildenhues.
4565 2006-09-08 Eric Blake <ebb9@byu.net>
4567 * bootstrap: Kill unrelated copy-n-paste code from argument
4568 parsing. Let Makefile generate testsuite.
4569 * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
4571 2006-09-07 Eric Blake <ebb9@byu.net>
4573 * m4/m4module.h (m4_peek_input): No longer export.
4574 (m4_error_at_line, m4_warn_at_line): New prototypes.
4575 (m4_is_symbol_void): New macro.
4576 (m4_push_file): Update prototype.
4577 * m4/m4private.h (m4__peek_token): New prototype.
4578 (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
4579 * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
4580 * src/main.c (main): Allow reading from stdin twice.
4581 * modules/m4.c (include): Adjust to new prototype.
4582 * m4/input.c: General comment cleanup.
4583 (file_peek, file_read, file_unget, push_file): Set end flag on
4584 EOF, so that we don't call getc twice.
4585 (push_file, file_clean): Port fix from branch to avoid closing
4587 (pop_input): Port fix from branch to avoid reading free'd memory
4588 when input ends mid-string.
4589 (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
4590 (string_peek, string_read): Always use unsigned char.
4591 (m4_skip_line): Warn when dnl cut short by EOF.
4592 (peek_input): Rename from m4_peek_input.
4593 (match_input): Update signature, to distinguish between `(' token
4594 and multi-char quote or comment beginning with `('.
4595 (m4_input_exit): Cleanup now done in m4_pop_wrapup.
4596 (m4__peek_token): New function, ported from branch.
4597 (m4__next_token): Update to new token types.
4598 * m4/macro.c (expand_token, expand_argument): Use peek_token.
4599 * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
4600 (Invoking m4): Remerge from branch.
4602 * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
4603 (check-local): and put dependency here.
4604 Reported by Ralf Wildenhues.
4606 2006-09-05 Eric Blake <ebb9@byu.net>
4608 * m4/m4module.h (m4_debug_message): New prototype.
4609 (M4_DEBUG_TRACE_MODULE): New debug bit.
4610 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
4611 (M4_DEBUG_MESSAGE2): Delete these macros.
4612 * m4/debug.c (m4_debug_message): New method.
4613 (m4_debug_decode): Add module tracing as flag `m'.
4614 * m4/input.c (m4_push_file, file_clean): Use new method.
4615 * m4/path.c (m4_path_search): Likewise.
4616 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
4617 * m4/module.c (install_builtin_table, install_macro_table)
4618 (m4__module_open, module_close, module_remove): Promote several
4619 module debug messages outside of DEBUG_MODULES.
4620 (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
4621 DEBUG_MODULES with normal trace output.
4622 * src/main.c (usage): Document new flag.
4623 * doc/m4.texinfo (Debug Levels): Likewise.
4624 * Makefile.am ($(TESTSUITE)): Add missing dependency.
4625 * tests/m4.in: Neutralize platform-dependent module filenames.
4626 * tests/options.at (--debug): Update expected output.
4628 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4630 * doc/m4.texinfo: Fix some typos.
4631 * tests/others.at: Likewise.
4633 2006-09-05 Eric Blake <ebb9@byu.net>
4635 * m4/input.c (lex_debug): Remove dead code that broke compilation
4636 with --enable-debug.
4637 * m4/module.c (install_builtin_table, install_macro_table)
4638 (m4__module_init, m4__module_open, module_close)
4639 (module_remove): Fix compilation when --enable-debug.
4640 * m4/output.c (m4_shipout_text): Likewise.
4641 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
4642 libraries when --enable-debug.
4643 * configure.ac (DYNAMIC_MODULES): New variable, to pass
4644 information to testsuite.
4645 (modules to preload): Determine modules after we know whether
4646 shared libraries are supported.
4647 * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
4649 * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
4650 * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
4651 (modules: shadow, modules: unload, modules: importing)
4652 (modules: trace): Use new macro.
4653 * tests/builtins.at (gmp): Likewise.
4655 * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
4657 (expand_token): Avoid assertion just added to docs.
4658 (expand_macro): Track pending expansions, for when a symbol's
4659 definition changes during argument collection.
4660 (m4_macro_call, process_macro): Operate on symbol value, not
4661 symbol, since symbol may have changed during argument collection.
4662 * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
4663 (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
4664 (m4_get_symbol_value): Add fast macro version.
4665 * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
4666 (m4_macro_call): Adjust prototype.
4667 * m4/module.c (install_builtin_table): Check that flags are valid
4668 when creating builtin.
4669 * m4/symtab.c (m4__symtab_remove_module_references): Use
4670 m4_symbol_value_delete, rather than inlining it.
4671 (m4_symbol_value_copy): Copy placeholder text.
4672 (symbol_popval): Use m4_symbol_value_delete.
4673 (m4_symbol_value_delete): Implementation was missing when NDEBUG.
4674 Handle pending expansions.
4675 * modules/gnu.c (indir): Update to new prototype.
4676 * doc/m4.texinfo: Fix menus to be consistent with section names.
4677 (Defn): Add test that macro tokens flatten to empty string;
4678 triggered an assert before this patch.
4679 (Ifelse): Merge another node.
4680 (Loops): Split into...
4681 (Forloop, Foreach): New nodes; work is still underway on them.
4682 (Answers): Add more info on foreach macro; work is still underway.
4683 (Indir): Add test that indir collects arguments before looking up
4685 * TODO: Update based on this patch.
4687 2006-09-01 Eric Blake <ebb9@byu.net>
4689 * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
4690 * m4/hash.h (m4_free_hash_iterator): New prototype.
4691 * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
4692 ensure we don't do unsafe things while iterating.
4693 (HASH_ITER, ITER_CHAIN): New accessor macros.
4694 (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
4695 (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
4696 (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
4697 (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
4698 to catch unsafe actions.
4699 (m4_free_hash_iterator): New function, to avoid memory leaks, and
4700 when debugging, to track safe actions.
4701 (m4_hash_apply): Avoid memory leak.
4702 * m4/symtab.c (m4_symtab_apply): Likewise.
4703 * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
4704 in manually to src/ for now.
4705 * tests/builtins.at (gmp): Add keyword module.
4706 * tests/modules.at (Freezing modules, modules: shadow)
4707 (modules: unload, modules: importing, modules: trace): Likewise.
4709 2006-08-30 Eric Blake <ebb9@byu.net>
4711 * m4/utility.c (m4_warn): Factor "Warning" out of messages into
4713 (m4_bad_argc, m4_numeric_arg): Update all callers.
4714 * m4/macro.c (m4_macro_call): Likewise.
4715 * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
4716 (Indir, Builtin, Ifdef): More doc merges.
4717 (Loops): Mention that documenting foreach would be nice.
4718 (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
4719 (Include, Eval, Location, M4exit): s/input.m4/stdin/.
4720 * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
4721 (substitute, syncoutput): Update all m4_warn callers.
4722 * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
4723 (traceon, traceoff): Make warning message consistent.
4724 (define, pushdef): Update all m4_warn callers.
4725 * tests/generate.awk: Choose file name so that documentation can
4726 show command-line behavior.
4727 * tests/builtins.at (define): Update to new wording.
4728 * tests/macros.at (pushdef/popdef): Likewise.
4729 * tests/freeze.at (loading format 1): Likewise.
4730 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4732 * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
4734 (Defn): Add failing test case for mixing text and builtin.
4735 (Renamesyms): Improve wording, and identify core dump that needs
4738 2006-08-29 Eric Blake <ebb9@byu.net>
4740 * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
4741 (Arguments, Pseudo Arguments): More doc merges from the branch.
4742 (Macro expansion): Turn example into test.
4743 (Pseudo Arguments): Add example of avoiding argument.
4744 * modules/m4.c (undefine, popdef): Accept multiple arguments.
4745 (define, pushdef): Warn on non-text macro name.
4746 (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
4747 warning/error messages.
4748 (ifdef): Ignore extra arguments.
4749 * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
4750 (m4__symtab_remove_module_references): Check that there is no leak.
4751 * tests/macros.at (pushdef/popdef): Update to new message.
4752 * tests/builtins.at (define): Likewise.
4753 * tests/freeze.at (loading format 1): Likewise.
4754 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4756 * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
4757 (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
4758 as accessor function, to avoid compiler warning.
4759 * m4/module.c (m4__module_open): Move declaration of variable to
4760 avoid compiler warning.
4761 * src/main.c (main): Avoid shadowing a global variable.
4762 * src/freeze.c (produce_symbol_dump): Avoid unused variable
4763 warning when NDEBUG.
4764 * tests/options.at (--discard-comments, --import-environment)
4765 (--debug, --prepend-include, --help and --version): Rename tests
4766 to name option tested.
4768 2006-08-28 Eric Blake <ebb9@byu.net>
4770 * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
4771 * m4/module.c (install_builtin_table): ...to here, and add
4772 assertion that blind macros require arguments.
4773 * m4/m4module.h (struct m4_builtin): Document restrictions that
4774 must be met during module loading.
4775 * modules/gnu.c (changeresyntax, changesyntax): These are blind,
4776 so require an argument to avoid triggering assertion.
4777 (debugfile): Tweak error message.
4779 2006-08-25 Eric Blake <ebb9@byu.net>
4781 * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
4782 (M4_BUILTIN_SIDE_EFFECT): New enumerators.
4783 (struct m4_builtin): New member flags replaces groks_macro_args,
4784 blind_if_no_args. min_args and max_args are now 0-based.
4785 Rearrange members to reduce size on platforms where function
4786 pointers are 64 bits but regular pointers are 32.
4787 (m4_bad_argc): Add argument.
4788 * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
4789 * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
4790 effect into account.
4791 * m4/module.c (install_builtin_table): Adjust all users affected
4793 * m4/macro.c (m4_macro_call): Likewise.
4794 * src/freeze.c (reload_frozen_state): Likewise.
4795 * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
4796 * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
4797 * modules/import.c (builtin_functions): Likewise.
4798 * modules/load.c (builtin_functions): Likewise.
4799 * modules/modtest.c (builtin_functions): Likewise.
4800 * modules/mpeval.c (builtin_functions): Likewise.
4801 * modules/perl.c (builtin_functions): Likewise.
4802 * modules/shadow.c (builtin_functions): Likewise.
4803 * modules/stdlib.c (builtin_functions): Likewise.
4804 * modules/time.c (builtin_functions, mktime_functions)
4805 (strftime_functions): Likewise.
4806 * doc/m4.texinfo (Loops): Update test now that shift is blind.
4807 (Macro Arguments): Fix typo in test.
4808 (Patsubst): Fix typo in test.
4809 * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
4810 end of string. Fix return value when ignore_duplicates.
4811 * tests/builtins.at (patsubst): Fix typo in test.
4813 * tests/options.at (debug-flags): Update to reflect new message.
4814 (deprecated options, prepend-include, help and version): New
4816 * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
4817 test omits an input file name.
4818 * src/main.c (long_options, main): Add -B/--prepend-include.
4819 (usage): Document it.
4820 (main): `m4 --help --version' now displays help, not version.
4821 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4822 dirname filenamecat.
4823 * m4/m4module.h (m4_add_include_directory): Add parameter.
4824 * m4/m4private.h (m4__include_init): New prototype.
4825 * m4/m4.c (m4_create): Put `.' on path before options are
4827 * m4/path.c (includes): Assume C89. Use gnulib for file name
4829 (m4__include_init): New function.
4830 (search_path_add): Allow prepending.
4831 (m4_add_include_directory, search_path_env_init): Adjust callers.
4832 (m4_path_search): Relative names now invoke path search, since
4833 `.' might not be first.
4834 * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
4836 2006-08-25 Bruno Haible <bruno@clisp.org> (tiny change)
4837 and Eric Blake <ebb9@byu.net>
4839 * bootstrap: Run autopoint before gnulib-tool, since autopoint
4840 0.15 installs macros obsoleted by current gnulib.
4842 2006-08-25 Eric Blake <ebb9@byu.net>
4844 * doc/m4.texinfo (Macro Arguments): Another section merged;
4845 testsuite failures now exposed.
4847 2006-08-23 Eric Blake <ebb9@byu.net>
4849 * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
4850 (Input processing): More doc merges from the branch.
4851 (Regular expression syntax): Add introductory text.
4852 (Inhibiting Invocation): More doc merges from the branch.
4853 (Other tokens): Reorder after comments.
4854 * tests/generate.awk: Allow passing options to doc examples.
4856 2006-08-22 Eric Blake <ebb9@byu.net>
4858 * tests/options.at (debug-flags): New test.
4859 * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
4860 not negative, to distinguish failure in m4_debug_decode.
4861 (m4_debug_decode): Add new parameter.
4862 * modules/gnu.c (regexp): Slight cleanup.
4863 (renamesyms): Ignore excess arguments.
4864 (syncoutput): Make case-insensitive, warn on bad argument.
4865 (debugmode): Factor -+ handling out to...
4866 * m4/debug.c (m4_debug_decode): ...here.
4867 (m4_debug_message_prefix): Fix spacing.
4868 * src/main.c (main): Let -d option adjust flags.
4869 * m4/input.c (file_clean): Avoid printing empty file name.
4870 * doc/m4.texinfo (Syncoutput): Document new range of input.
4871 (Invoking m4): Document use of multiple -d flags.
4873 Start porting various fixes from the branch that use gnulib.
4874 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4875 binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
4876 regexprops-generic stdlib-safer unlocked-io.
4877 * m4/debug.c (m4_debug_set_output): Close debug file on exec.
4878 * m4/path.c (m4_path_search): Close input file on exec, reject
4879 empty file name, fix parameter naming.
4880 * m4/output.c (make_room_for): Close diversion file on exec.
4881 (includes): Assume C89 headers.
4882 (tmpfile): For now, we don't want tmpfile-safer, because we want
4884 * m4/m4private.h (includes): Use various gnulib headers.
4885 * doc/regexprops-generic.texi: Use gnulib's copy.
4887 * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
4888 * AUTHORS: Add copyright.
4889 * ChangeLog: Likewise.
4890 * README: Likewise. Require automake 1.9b or later.
4891 * HACKING: New file.
4892 * README-alpha: Add copyright.
4893 * THANKS: Likewise. Update.
4894 * doc/STYLE: Add copyright, and tweak for changed directories.
4895 * modules/README: Add copyright, and tweak for libtool version.
4896 * examples/COPYING: New file.
4897 * examples/WWW/COPYING: Likewise.
4898 * examples/WWW/m4lib/COPYING: Likewise.
4899 * modules/shadow.m4: Add copyright.
4900 * modules/perl.m4: Likewise.
4901 * modules/modtest.m4: Likewise.
4902 * modules/stdlib.m4: Likewise.
4903 * modules/time.m4: Likewise.
4904 * modules/time2.m4: Likewise.
4905 * po/Makevars: Likewise.
4906 * tests/iso8859.m4: Likewise.
4907 * tests/m4.in: Likewise.
4908 * NEWS: Add (C) to copyright.
4910 * m4/system_.h: Likewise.
4911 * tests/atlocal.in: Likewise.
4912 * tests/builtins.at: Likewise.
4913 * tests/freeze.at: Likewise.
4914 * tests/generate.awk: Likewise.
4915 * tests/macros.at: Likewise.
4916 * tests/modules.at: Likewise.
4917 * tests/options.at: Likewise.
4918 * tests/others.at: Likewise.
4919 * tests/testsuite.at: Likewise.
4920 * m4/utility.c: Spell out copyright years.
4921 * src/main.c: Likewise.
4923 * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
4925 2006-08-21 Eric Blake <ebb9@byu.net>
4927 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
4928 * modules/gnu.c (esyscmd): Use -1 for failure. Set sysval to 0
4929 when no arguments are given, but without losing warning about 0
4931 * modules/m4.c (syscmd): Likewise.
4932 (includes): Assume C89.
4933 (m4_sysval): Make static.
4934 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
4935 (sysval): Port calculation from branch.
4937 2006-08-20 Eric Blake <ebb9@byu.net>
4939 * m4/macro.c (expand_macro): Move argument check...
4940 (m4_macro_call): ...to here, so indir will warn.
4941 * modules/gnu.c (__program__): New macro, ported from branch.
4942 (builtin): Perform argument check.
4943 (changesyntax): Avoid out-of-bounds read.
4945 * modules/gnu.c (includes): Assume stdlib.h, errno.
4946 (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
4947 (substitute): Add caller parameter, avoid out-of-bounds memory
4949 (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
4952 2006-08-16 Eric Blake <ebb9@byu.net>
4954 * po/POTFILES.in: Add more files that contain translatable
4956 * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
4957 information to translators.
4958 (USE_MSGCTXT): New var for gettext 0.15.
4959 * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
4960 debug/trace messages in lower case.
4961 * m4/macro.c (expand_argument): Likewise.
4962 * m4/path.c (m4_path_search): Likewise.
4963 * src/main.c (main): Likewise.
4965 2006-08-14 Eric Blake <ebb9@byu.net>
4967 * src/main.c (usage): Document --import-environment.
4968 * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
4970 2006-08-11 Eric Blake <ebb9@byu.net>
4972 * bootstrap (func_get_translations): Only remove files when doing
4974 (func_update_po): Avoid CDPATH problems.
4976 2006-08-10 Eric Blake <ebb9@byu.net>
4978 * bootstrap (func_get_translations): New function.
4979 (func_update_po): Borrow ideas from tar to correctly pull in
4980 translations from newer location.
4982 2006-08-09 Eric Blake <ebb9@byu.net>
4984 * bootstrap: Recent gnulib no longer has jm_* macros to worry
4986 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4988 * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
4989 (m4_error, m4_warn): ... these new prototypes.
4990 (m4_current_file, m4_current_line): Move into context, rather
4991 than leaving as globals.
4992 (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
4993 (m4_undivert_all, m4_input_init): Now takes context.
4994 * m4/utility.c (m4_error, m4_warn): New functions.
4995 * m4/m4private.h: Assume errno exists.
4996 (struct m4): Move warning_status to a bit flag,
4997 and add exit_status. Adjust accessors accordingly.
4998 * src/main.c (print_program_name_CB): No longer needed.
4999 (main): Use new m4_get_fatal_warnings_opt.
5000 * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
5001 instead of issuing "INTERNAL ERROR". Pass context when needed,
5002 and use new accessors.
5003 * m4/input.c: Likewise.
5004 * m4/macro.c: Likewise.
5005 * m4/output.c: Likewise.
5006 * m4/utility.c: Likewise.
5007 * modules/evalparse.c: Likewise.
5008 * modules/gnu.c: Likewise.
5009 * modules/load.c: Likewise.
5010 * modules/m4.c: Likewise.
5011 * modules/mpeval.c: Likewise.
5012 * src/freeze.c: Likewise.
5013 * src/main.c: Likewise.
5014 * tests/macros.at: Adjust to new message format.
5015 * tests/builtins.at: Likewise.
5016 * tests/freeze.at: Likewise.
5017 * tests/modules.at: Likewise.
5018 * doc/m4.texinfo: Likewise.
5020 * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
5023 2006-08-03 Eric Blake <ebb9@byu.net>
5025 * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
5026 gracefully handle ENOSYS.
5030 2006-07-28 Eric Blake <ebb9@byu.net>
5032 * src/freeze.c (reload_frozen_state): Copy string when creating
5033 placeholder, to avoid memory corruption.
5034 * m4/symtab.c (symbol_popval): Avoid memory leak.
5035 (m4_symbol_rename): Avoid shadowing rename function.
5036 (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
5037 * tests/freeze.at (reloading unknown builtin): Add test.
5038 * tests/generate.awk: Capture m4.texinfo line number in
5039 testsuite.log, not just generated.at.
5041 Port idea from branch that a frozen file can request an unknown
5042 builtin without producing a warning unless the builtin is
5044 * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
5045 (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
5046 (m4_set_symbol_value_placeholder): New accessors.
5047 * m4/m4module.h (m4_is_symbol_placeholder),
5048 (m4_get_symbol_value_placeholder),
5049 (m4_set_symbol_value_placeholder),
5050 (m4_get_symbol_placeholder): Likewise.
5051 * m4/symtab.c (m4_is_symbol_value_placeholder),
5052 (m4_get_symbol_value_placeholder),
5053 (m4_set_symbol_value_placeholder): Likewise.
5054 (dump_symbol_CB): Handle new symbol type.
5055 * m4/macro.c (trace_pre): Likewise.
5056 (m4_macro_call): Warn when invoking a placeholder.
5057 * modules/m4.c (dumpdef): Handle dumping a placeholder.
5058 (defn): Warn when referencing a placeholder.
5059 * src/freeze.c (dump_symbol_CB): Ignore placeholder when
5061 (reload_frozen_state): When reloading unknown builtin, install a
5062 placeholder instead of warning.
5063 * tests/freeze.at (loading format 1): Allow warning when
5064 popdef'ing undefined function.
5066 2006-07-27 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
5068 * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
5069 function. Shift by 7, not 3, for consistency with
5070 gnulib/lib/hash.c. Don't assume hash word is 32 bits.
5072 2006-07-27 Eric Blake <ebb9@byu.net>
5074 * src/main.c (usage): Update to match branch.
5075 (main): Update --version info to distinguish between program name
5076 `m4' and package name `GNU M4'.
5077 (AUTHORS): Translate René Seindal's name.
5078 * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
5079 * Makefile.am (doc/m4.1): Update to match branch.
5080 * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
5083 * m4/system_.h (EXIT_MISMATCH): Define.
5084 * src/main.c (main): Don't clear syntax table for version 1.
5085 (usage): Document exit status.
5086 * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
5087 branch, and require V directive to appear first in file. Fix
5088 broken logic for detecting F and T in version 1 files.
5090 2006-07-22 Eric Blake <ebb9@byu.net>
5092 * src/main.c (stackovf_handler): Document the problems in our
5094 * src/stackovf.c: Forward port changes in branch to use POSIX
5095 sa_sigaction when available.
5096 (process_sigsegv): Avoid buffer overrun when error string is
5097 translated, although the fact that we translate in a signal
5098 handler is still a bug.
5099 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
5100 from branch to modernize checks.
5102 * modules/format.c (format): Avoid compiler warning that str may
5103 be used uninitialized.
5105 * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
5107 (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
5108 (DEBUG_MACRO): Remove unused macro.
5109 * src/stackovf.c: Avoid compiler warnings.
5110 * m4/input.c: Likewise.
5111 * m4/module.c: Likewise.
5112 * m4/output.c: Likewise.
5113 * m4/path.c: Likewise.
5114 * m4/symtab.c: Likewise.
5115 * m4/syntax.c: Likewise.
5117 2006-07-20 Eric Blake <ebb9@byu.net>
5119 * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
5120 Regenerate to explicitly ask for --assume-autoconf=2.60.
5122 2006-07-19 Eric Blake <ebb9@byu.net>
5124 * po/ChangeLog: Merge into main ChangeLog, then delete file.
5127 * doc/m4.texinfo (copying): Relax restriction on front-cover and
5130 2006-07-17 Eric Blake <ebb9@byu.net>
5132 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
5135 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
5137 * modules/format.c (includes): Use xvasprintf.h.
5138 (format): Make static. Avoid buffer overflow, that can lead to
5139 arbitrary code execution exploit. Only pass unsigned char to
5140 is*(). Support F, g, and G specifiers.
5141 * doc/m4.texinfo (Format): Expose buffer overrun bug. Document
5144 2006-07-17 Gary V. Vaughan <gary@gnu.org>
5146 Ensure M4 compiles correctly with -DDEBUG, and use a single
5147 consistent definition of various /DEBUG_[A-Z]+/ symbols:
5149 * m4/input.c: Have commented out out DEBUG_INPUT only by default.
5150 (m4_print_token): Use m4_get_symbol_value_text and
5151 m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
5152 and VALUE_FUNC respectively.
5153 (m4__next_token): Use m4_print_token call instead of obsolescent
5155 * m4/module.c: Have commented out out DEBUG_MODULE only by default.
5156 * m4/output.c: Similarly for DEBUG_OUTPUT.
5157 * m4/path.c: Similarly for DEBUG_INCL.
5158 * m4/symtax.c: Similarly for DEBUG_SYM.
5159 * m4/syntax.c: Similarly for DEBUG_SYNTAX.
5160 * src/stackovf.c: Similarly for DEBUG_STACKOVF.
5161 * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
5162 preprocessor macros defined with -DDEBUG compiles.
5164 2006-07-17 Gary V. Vaughan <gary@gnu.org> (tiny change)
5166 * bootstrap: Correct typo in --download-po argument parsing.
5168 2006-07-15 Eric Blake <ebb9@byu.net>
5170 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
5172 * tests/generate.awk (normalize): Recognize @tabchar.
5173 * doc/m4.texinfo (Top): Start merging from branch. Remove tabs.
5174 Fix menus. Upgrade FDL license from 1.1 to 1.2. Fix overfull
5176 (Index macro, Shell commands, Incompatiblities): Rename nodes
5177 from Index, UNIX commands, Other incompat.
5178 (Platform macros, Using frozen files, Frozen file format 1)
5179 (Frozen file format 2, Copying This Manual, Indices): New nodes.
5180 * Makefile.am (EXTRA_DIST): Distribute gendocs.
5181 (MAINTAINERCLEANFILES): Clean up files from gnulib.
5182 (doc_m4_TEXINFOS): Depend on fdl.texi.
5183 (web-manual): New maintainer target.
5185 2006-07-14 Gary V. Vaughan <gary@gnu.org>
5187 * doc/m4.texinfo (Modules): RMS asked me for an explanation of
5188 the modular architecture of M4. The result is paraphrased here
5189 for the benefit of future readers of the manual.
5191 2006-07-14 Gary V. Vaughan <gary@gnu.org> (tiny change)
5193 * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
5195 2006-07-14 Eric Blake <ebb9@byu.net>
5197 * src/main.c (main): Avoid compiler warning.
5198 * modules/gnu.c (renamesyms): Remove unused variable.
5200 2006-07-14 Gary V. Vaughan <gary@gnu.org>
5202 * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
5203 (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
5204 new functions for managing regexp syntax options.
5205 * m4/m4private.h (m4): Add regexp_syntax field.
5206 * m4/resyntax.c: New file implements the above.
5207 * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
5208 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
5209 (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
5210 (m4_patsubst_do, m4_renamesyms_do): Removed.
5211 (builtin_changeresyntax): New builtin to change regular expression
5213 (m4_resyntax_encode_safe): Factor out diagnostics code.
5214 * src/freeze.c (produce_resyntax_dump): New function to dump
5215 default regexp syntax specifier to frozen file.
5216 (reload_frozen_state): Updated to action 'R' directive.
5217 * src/main.c (usage): Describe new -r option.
5218 (long_options, OPTSTRING): Declare it.
5219 (main): Encode and store cli regexp syntax option argument.
5220 * tests/freeze.at (regexp syntax): New test that regexp syntax
5222 * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
5223 * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
5224 (Epatsubst and Patsubst): Renamed to...
5225 (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
5226 documentation and added new examples.
5227 (Changeresyntax): New section describing changeresyntax builtin,
5228 and regexp syntax names.
5229 (Regular expression syntax): New section describing differences
5230 between various regular expression syntaxes.
5231 (Frozen files): Document 'R' directive.
5234 2006-07-13 Gary V. Vaughan <gary@gnu.org>
5236 * bootstrap: Enhanced to work more like our other scripts:
5237 Add a copyright statement; support --version and --help; accept a
5238 --download-po option with argument as a substitute for DOWNLOAD_PO
5241 2006-07-11 Eric Blake <ebb9@byu.net>
5243 * Makefile.am (doc/m4.1): Port patch from branch that avoids
5245 * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
5248 2006-07-10 Gary V. Vaughan <gary@gnu.org> (tiny change)
5250 * tests/builtin.at (patsubst, regexp): Adjust these tests, now
5251 that `\0' is no longer accepted.
5253 * src/main.c (usage): Alphabetize options within their sections.
5255 * modules/gnu.c (m4_regexp_search, regsub, substitute)
5256 (esyscmd): Improve comments.
5258 * modules/gnu.c (substitute): Remove old warning for \0.
5259 (substitute_warned): No longer required. Removed.
5261 * modules/gnu.c: Put macro definitions into alphabetical order.
5263 2006-07-07 Eric Blake <ebb9@byu.net>
5265 * tests/freeze.at (loading format 1): New file, with new test.
5266 * tests/testsuite.at: Include it.
5267 * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
5268 * tests/modules.at (Freezing modules): Likewise.
5270 * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
5271 (AC_CHECK_HEADERS): Assume signal.h.
5272 (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
5273 (AC_CHECK_FUNCS_ONCE): Likewise.
5274 * src/m4.h (includes): Assume signal.h.
5276 2006-07-05 Eric Blake <ebb9@byu.net>
5278 Fix all testsuite failures on cygwin.
5279 * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
5280 branch-1_4. Solves testsuite failure when uninstalled m4 is
5281 shadowed by redefinition of PATH in libtool wrapper.
5282 * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
5283 contains the -no-undefined required by cygwin.
5284 (TESTS_ENVIRONMENT): Export abs_top_builddir.
5285 * tests/others.at (misc): Port to platforms where /etc/passwd
5286 does not exist or does not contain user named root.
5287 * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
5289 * tests/builtins.at (define, divert): Avoid overquoting.
5290 * tests/generate.awk (new_group): Likewise.
5292 2006-07-05 Gary V. Vaughan <gary@gnu.org>
5294 The regs_allocated field in a struct re_pattern_buffer refers
5295 to the state of a particular re_registers struct when used in
5296 successive matches using the same compiled pattern. Avoid a
5297 SEGV in `renamesyms' resulting from using a new re_registers
5298 with an existing re_pattern_buffer:
5300 * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
5301 pattern buffer and registers.
5302 (m4_regexp_search): New function to call re_regexp_search with
5303 correctly matched pattern buffer and register instantiations.
5304 (m4_regexp_compile): Return an m4_pattern_buffer. Adust all
5307 2006-07-04 Gary V. Vaughan <gary@gnu.org>
5309 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
5310 changes to gnulib getopt.m4 since last build.
5311 * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
5312 if the system getopt fails M4_GETOPT tests.
5314 2006-06-22 Eric Blake <ebb9@byu.net>
5316 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
5317 Reported by Bruno Haible.
5319 2006-06-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5321 * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
5323 2006-06-19 Eric Blake <ebb9@byu.net>
5327 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5329 * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
5330 (clean-local): Split into and depend upon...
5331 (clean-local-tests, clean-local-src): ...these two. The latter
5332 removes the libtool object directory below `src', to work around
5333 a buglet in Automake, failing to list it.
5334 (EXTRA_DIST): Distribute modules/perl.c.
5336 2006-06-19 Eric Blake <ebb9@byu.net>
5338 * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
5339 right side of dependency; VPATH does that.
5340 (stamp-vcl): Update to use libtool's algorithm.
5341 (EXTRA_DIST): Distribute stamp-vcl.
5342 Reported by Ralf Wildenhues.
5343 (TESTSUITE): Revert earlier change that used absolute path, as
5344 that broke 'make dist' in VPATH. Stick with $(srcdir) instead.
5345 (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
5346 (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
5347 atlocal takes care of it instead.
5348 (check-local, installcheck-local, clean-local): Inline absolute
5349 path to testsuite here, rather than relative path to testsuite
5352 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5354 * m4/m4private.h (DELETE): Cast away const here...
5355 * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
5356 * src/freeze.c (reload_frozen_state): Avoid uninitialized
5359 2006-06-19 Eric Blake <ebb9@byu.net>
5361 * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
5362 .info pages are built.
5363 Reported by Ralf Wildenhues.
5364 (EXTRA_DIST): Inline definition of testsuite, so that make dist
5367 2006-06-16 Eric Blake <ebb9@byu.net>
5369 Follow recommendations from autoconf manual for autotest.
5370 * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
5371 turn it into an absolute path until autotest provides an option
5372 that allows us to avoid changing directories. Properly quote
5374 (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
5375 (check-recursive): Delete unused target.
5376 ($(TESTSUITE)): Atomically update testsuite.
5377 (CD_TESTDIR): Simplify.
5378 (m4__cd): Delete unused macro.
5379 (check-local): Let TESTSUITEFLAGS influence the run.
5380 (installcheck-local): Let TESTSUITEFLAGS override
5381 AUTOTEST_PATH. Add dependencies.
5382 (clean-local): Clean up.
5383 (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
5384 * README: Document how to use the testsuite.
5386 2006-06-15 Eric Blake <ebb9@byu.net>
5388 * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
5390 * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
5391 clashes with m4sugar.
5392 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
5393 * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
5394 * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
5395 * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
5396 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
5397 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
5398 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
5399 * configure.ac: Likewise.
5400 (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
5401 * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
5403 * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
5405 Reduce compiler warnings. Inside GMP, mpq_t is an array type, so
5406 const mpq_t is not assignable from plain mpq_t. Avoid
5407 type-punning warnings caused trying to mix these types.
5408 * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
5409 (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
5410 * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
5411 (mult_term, exp_term): Remove type-punning casts.
5412 (numb_pow): Remove const qualifier.
5413 * src/freeze.c (reload_frozen_state): Fix typo in messages.
5414 Fix variables that can be used uninitialized, which fixes
5415 security hole where malicious frozen file can execute arbitrary
5418 2006-06-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5420 * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
5422 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5423 and Eric Blake <ebb9@byu.net>
5425 Allow `make dist' to work again.
5426 * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
5427 (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
5428 (cvs-dist): Fix typo.
5429 * NEWS: Match current version number.
5431 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5433 * Makefile.am (AM_CPPFLAGS): Add $(LTDLINCL), so the right
5436 * bootstrap: Do not run libtoolize manually, this is done
5437 correctly by autoreconf. Invoke autoreconf with --no-recursive
5438 to avoid unnecessary rerunning of autotools for libltdl.
5440 2006-06-13 Eric Blake <ebb9@byu.net>
5444 2006-06-12 Eric Blake <ebb9@byu.net>
5446 * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
5448 * src/m4.h: Don't declare mktemp.
5449 * m4/input.c (m4__next_token): Avoid bzero.
5450 * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
5451 * Makefile.am (doc/m4.1): Depend on installed help2man, rather
5452 than distributing outdated helptoman.pl.
5453 * doc/helptoman.pl: Delete.
5455 2006-06-10 Eric Blake <ebb9@byu.net>
5457 * README (Patches): Document the current dependence on CVS
5458 builds of autotools.
5459 * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
5460 * configure.ac: Use consistent quoting throughout.
5461 (AC_PREREQ): Bump to 2.59d.
5462 (AC_INIT): Package name begins with uppercase.
5463 (AC_ARG_WITH): Use AS_HELP_STRING.
5464 (AM_INIT_AUTOMAKE): Enable gnits mode.
5465 (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
5466 (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
5467 (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
5468 done by gnulib or automake, or which autoconf has declared
5470 * m4/m4private.h (Includes): Assume C89 or better, and use errno
5472 * m4/output.c (Includes): Likewise.
5473 * modules/gnu.c (Includes): Likewise.
5474 * modules/m4.c (Includes): Likewise.
5475 * src/m4.h (Includes): Likewise.
5477 * README-alpha: Update web address.
5478 * README: Likewise. Change encoding to ASCII. Remove old advice
5479 about cygwin. Document bootstrapping dependency.
5480 * AUTHORS: Update from branch-1_4.
5481 * THANKS: Likewise. Change encoding to UTF-8.
5482 * BACKLOG: Delete. This file is too old and unmaintained to be
5484 * ChangeLog: Change encoding to UTF-8.
5486 Avoid compiler warnings.
5487 * m4/macro.c (trace_format): Don't mark this as a printf format,
5488 since we don't accept the same set of modifiers as printf. It
5489 would be nice if gcc let us specify a custom format archetype.
5490 * src/main.c (main): Cast away const.
5492 2006-06-10 Andreas Schwab <schwab@suse.de> (tiny change)
5493 Eric Blake <ebb9@byu.net>
5495 * modules/time.c (ctime): Pass correctly typed variable to
5498 (localtime): Likewise.
5499 (strftime): Likewise.
5500 * m4/utility.c (m4_numeric_arg): For now, document arbitrary
5501 limit inherent in this interface.
5503 2006-05-08 Bruno Haible <bruno@clisp.org> (tiny change)
5505 * modules/m4.c (WEXITSTATUS): Provide fallback definition.
5506 (sysval): Use WEXITSTATUS.
5507 * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
5508 big-endian and little-endian wait status definitions.
5510 2006-05-06 Eric Blake <ebb9@byu.net>
5512 * po/Makevars (MSGID_BUGS_ADDRESS): Add.
5513 * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
5516 2006-05-06 Eric Blake <ebb9@byu.net>
5518 * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
5519 subdirectory to use.
5520 (support for -pipe): Move after LT_INIT, since it relies on
5523 2006-05-05 Eric Blake <ebb9@byu.net>
5525 * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
5529 2006-05-05 Bruno Haible <bruno@clisp.org>
5530 and Eric Blake <ebb9@byu.net>
5532 * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
5533 * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
5535 * bootstrap: Update usage of gnulib-tool.
5537 2006-05-04 Eric Blake <ebb9@byu.net>
5539 * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
5542 2005-12-05 Gary V. Vaughan <gary@gnu.org>
5544 * bootstrap (func_update_po): Synch with CVS GNU tar. wget 1.9.x
5545 and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
5546 Reported by Eric Blake <ebb9@byu.net>
5548 2005-12-04 Gary V. Vaughan <gary@gnu.org>
5550 * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
5551 http caching as -C is no longer supported by wget 1.10.x.
5552 Reported by Eric Blake <ebb9@byu.net>
5554 2005-10-20 Gary V. Vaughan <gary@gnu.org>
5556 * m4/module.c (caller_id): To match libtool-2.0 interface, changed
5558 (iface_id): ...an lt_dlinterface_id type.
5559 (m4__module_find): New abstraction for lt_dlhandle_fetch. Use
5560 throughout, instead of calling obsolete lt_dlhandle_find directly.
5561 (m4__module_next): Use multiloader-safe lt_dlhandle_iterate. Use
5562 throughout, instead of calling obsolete lt_dlhandle_next.
5563 * m4/m4private.h (m4__module_find): Declare it.
5564 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
5565 Use m4__module_next instead of obsolete lt_dlhandle_next.
5567 2005-10-20 Gary V. Vaughan <gary@gnu.org>
5569 * bootstrap (func_update_po): Update pofiles directly from the
5570 translation project.
5571 * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
5572 po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
5573 these files under source control anymore.
5574 Suggested by Eric Blake <ebb9@byu.net>
5576 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
5578 * ltdl/m4/m4-gnulib.m4: Update FSF contact address. Somehow this
5579 file escaped the address updates on 2005-05-01.
5581 2005-07-07 Gary V. Vaughan <gary@gnu.org>
5583 * bootstrap: Allow user overriding of gnulib-tool location, and
5584 correctly determine module source directories whether gnulib-tool
5585 is given as a relative or absolute path, or is found by searching
5587 Reported by Eric Blake <ebb9@byu.net>
5589 2005-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5591 * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
5592 and $RM are defined for various versions of
5593 AC_LIBTOOL_COMPILER_OPTION.
5595 * bootstrap (AUTORECONF): New variable to allow user overriding of
5598 2005-07-07 Gary V. Vaughan <gary@gnu.org>
5600 * doc/m4.texinfo (History): Add better notes on the ancestory of
5601 GNU m4, and other historical interest.
5603 2005-05-08 Gary V. Vaughan <gary@gnu.org>
5605 * m4/symtab.c (m4_symbol_rename): New function that performs a low
5606 level symbol rename.
5607 * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
5608 * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
5609 (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
5611 (erenamesyms, renamesyms): ...builtins that use these to implement
5612 macro renaming by regular expression.
5613 * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
5614 * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
5615 to stop the new generated tests from choking.
5617 2005-05-07 Gary V. Vaughan <gary@gnu.org>
5619 Since most of the build is handled from a single Makefile.am now,
5620 we can teach make about the dependencies between the m4 binary and
5621 the preopened modules it is built against:
5623 * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
5625 * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
5626 of the preopened modules have changed.
5628 2005-05-07 Gary V. Vaughan <gary@gnu.org>
5630 * configure.ac (gl_MODULES): Add mkstemp for machines that don't
5631 have a native implementation.
5633 2005-05-06 Gary V. Vaughan <gary@gnu.org>
5635 * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed. These are
5636 handled already by gnu/exit.h.
5638 * configure.ac (gl_MODULES): Add assert to support a
5639 --disable-assert configure time option for NDEBUG setting.
5641 * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
5642 * bootstrap (src_modules): Add version-etc-fsf.
5643 * src/main.c (version_etc_copyright): Removed.
5645 * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
5647 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5649 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
5651 * src/freeze.c (produce_frozen_state): Use \n line-endings even
5652 on Windows, so that the frozen file reader will work.
5653 Reported by Josef T. Burger <bolo@bolo.com>
5655 2005-05-04 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
5657 Forward port of a patch that allowed m4-1.4.2 to compile on
5660 * configure.ac (AC_CHECK_HEADERS): Add signal.h,
5662 * src/m4.h: And include them as appropriate.
5663 * src/main.c, src/stackovf.h: Don't include signal.h literally;
5664 m4.h will include the correct file.
5666 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5668 * m4/m4private.h: Make errno visible for the sources patched
5671 2005-05-04 Paul Eggert <eggert@twinsun.com>
5673 * src/main.c (print_program_name_CB): Preserve errno, since
5674 M4ERROR relies on this.
5675 * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
5676 * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
5677 * m4/path.c (m4_path_search): Don't let "free" trash errno when
5680 * m4/output.c (m4_insert_file): Don't assume errno has a valid
5681 value simply because fread returns zero. This fixes a
5682 portability bug reported by Marion Hakanson in
5683 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
5685 2005-05-04 Santiago Vila <sanvila@debian.org>
5687 * tests/stackovf.test: Use tempfile if available.
5689 2005-05-04 Robert Bihlmeyer <robbe@orcus.priv.at> (tiny change)
5691 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
5692 * m4/output.c (m4_insert_file): Do not mix buffered and
5693 unbuffered I/O, as this breaks on the Hurd.
5695 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5697 Gnulib has changed again. Reimport. Adjust. Rinse. Repeat.
5698 Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
5699 and libtoolize does a better job of ltdl importing now too, so
5700 take advantage of that while updating the tree:
5702 * acm4, config: Moved from here...
5703 * ltdl/m4, ltdl/config: ...to here.
5704 * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
5705 src/Makefile.am, tests/Makefile.am: Removed...
5706 * Makefile.am: ...and migrated to here, with adjustments to
5707 compensate for relative path differences.
5708 * commit: Adjust relative paths.
5709 * configure.ac: Adjust relative paths.
5710 (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
5712 (LT_PREREQ): 2.0 isn't released yet, but will work when it is! In
5713 the meanwhile, CVS HEAD libtool is needed.
5714 (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
5715 stricly new enough, we also need a patch.
5716 (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
5717 (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
5718 (gl_MODULES): Don't list getopt and version-etc, as they don't
5720 * bootstrap: After running gnulib-tool to import the listed
5721 modules, fetch getopt and version-etc into src manually.
5722 (ltdldir): Change to ltdl.
5723 * src/main.c: Adjust for changes in version-etc API.
5724 * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
5725 but works when the getopt module isn't to be included in the lib.
5726 * README: Add note about patching autoconf and automake to
5729 2005-05-02 Matt Kraai <kraai@debian.org> (tiny change)
5731 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
5732 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
5733 empty file rather than to a nonexistent file. This closes a
5734 common security hole.
5735 * modules/m4.c (m4_maketemp): Implement the above, by using
5736 mkstemp rather than mktemp.
5738 2005-05-01 Gary V. Vaughan <gary@gnu.org>
5740 The FSF are moving offices today. Changed their contact address
5741 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
5742 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
5744 2005-03-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5746 * tests/Makefile (clean-local): Ignore testsuite cleanup
5749 2005-03-11 Per Bothner <per@bothner.com> (tiny change)
5751 * tests/Makefile (clean-local): Only run the testsuite cleanup
5752 if the testsuite has been generated.
5754 2005-02-11 Stepan Kasal <kasal@ucw.cz>
5756 * TODO: slight clarification of the example of qindir usage.
5758 2005-02-08 Gary V. Vaughan <gary@gnu.org>
5760 * TODO: Add qindir requirement, and defn bug.
5761 From Stepan Kasal <kasal@ucw.cz>
5763 2005-02-08 Stepan Kasal <kasal@ucw.cz>
5765 * TODO: Add ``execution stack'', fix a typo.
5766 * doc/m4.texinfo: Typos.
5768 2004-12-24 Eric Blake <ebb9@byu.net>
5770 * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
5771 to the gnu subdirectory.
5772 * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
5773 * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
5774 * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
5775 * m4/system_.h: Likewise, in non-configured includes.
5777 2004-10-14 Noah Misch <noah@cs.caltech.edu>,
5778 Gary V. Vaughan <gary@gnu.org>
5780 * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
5781 Protect definitions from macro expansion under -DNDEBUG by
5782 parenthesising the expanded function names.
5783 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
5784 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
5785 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
5786 (m4_is_syntax_macro_escaped): Similarly protect function
5787 definitions from macro expansion under -DNDEBUG by #undefing the
5788 matching macro names before each definition. Also, move all the
5789 function definitions to the end of the file so that any
5790 invocations in the rest of the file pick up the fast macro
5792 * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
5793 (m4_set_debug_file, m4_set_trace_messages)
5794 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
5795 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
5796 (m4_set_max_debug_arg_length_opt): New fast macro versions of the
5797 option setter functions.
5799 2004-09-23 Gary V. Vaughan <gary@gnu.org>
5801 * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
5804 2004-09-23 Gary V. Vaughan <gary@gnu.org>
5806 * src/main.c: Include gnulib files from the correct directory.
5808 * gnulib/*: Don't store any of the gnulib files in arch, as they
5809 generate spurious changes.
5810 * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
5811 gnulib macros now share our macro directory.
5812 (SUBDIRS): Descend into `gnu' rather than `gnulib'.
5813 * bootstrap: Call gnulib-tool to import from the gnulib tree.
5814 (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
5815 gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
5816 the gettext macros from autopoint that overwrite the gnulib-tool
5817 imported versions. Import sources and Makefile.am into the `gnu'
5818 directory. Changed all callers.
5819 * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
5820 gl_INIT): Call these gnulib-tool macros instead of the hardcoded
5821 for imported modules.
5822 * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
5823 acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
5824 hardcoding the gnulib macros they wrap.
5826 2004-07-15 Gary V. Vaughan <gary@gnu.org>
5828 Latest CVS libtool can preload modules in libraries, including
5829 its own module loaders! Tweak m4 so that it doesn't try to treat
5830 libltdl's module loaders as m4 modules when freezing and on exit:
5832 * gnulib/acm4/*.m4: Don't store these files in arch since they
5833 generate spurious changes.
5834 * bootstrap: Simplify initial libtoolize call, since CVS
5835 libtoolize is smarter these days.
5836 * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
5838 * m4/module.h (m4__module_exit): Missing declaration.
5839 * m4/m4private.h (m4__module_next): New function declaration.
5840 * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
5841 encapsulation. Changed all callers.
5842 (m4__module_interface): New function to verify m4 loadable module
5844 (m4__module_init): Register the interface validator.
5845 (m4__module_exit): Only close my own modules.
5846 * modules/m4.c (unistd.h): Provide missing declaration.
5847 (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
5848 (m4_expand_ranges): More missing declarations.
5849 * modules/modtest.c (export_test): Ditto.
5850 * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
5851 * src/main.c (main): Bump copyright year.
5852 * tests/modules.at: Fix sed syntax error.
5855 2004-06-17 Gary V. Vaughan <gary@gnu.org>
5857 Tweaking to enable compilation with latest CVS libtool and
5858 libltdl. We can't just dump the library files directly into the
5859 m4 directory anymore now that libltdl is built from pieces itself:
5861 * bootstrap: Rewritten to use latest libtoolize sanely, and to
5862 set up libltdl subdirectory.
5863 * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
5864 gnulib subdirectory's config.
5865 (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
5866 (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
5868 (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
5869 configure.ac, so use AC_WITH_LTDL instead.
5870 * Makefile.am (SUBDIRS): Add libltdl.
5871 * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated. gnulib now uses
5873 * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
5874 (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
5875 (libm4_la_LIBADD): Add LIBLTDL.
5876 * m4/ltdl.c, m4/ltdl.h: Removed.
5877 * m4/m4module.h: Include canonical ltdl.h.
5880 2004-06-14 Gary V. Vaughan <gary@gnu.org>
5882 * gnulib/import: Now updates makefile fragments, and configure.ac.
5883 * gnulib/m4/gnulib.am: New file. Generated makefile fragments.
5884 * gnulib/m4/Makefile.am: include it.
5885 * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
5886 gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
5887 gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
5888 gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
5889 gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
5890 * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
5891 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
5892 gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
5893 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
5894 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
5895 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
5896 gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
5897 gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
5899 * gnulib/m4/getopt_int.h: New source file from latest gnulib
5901 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
5902 gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
5903 gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
5904 gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
5905 Updated source files from latest gnulib.
5907 2004-02-29 Gary V. Vaughan <gary@gnu.org>
5909 * config/mailnotify: New file for mailing commit notifications,
5910 imported from cvs-utils.
5911 * commit: Updated from cvs-utils and tweaked for m4.
5913 2003-12-01 Gary V. Vaughan <gary@gnu.org>
5915 * config/mkstamp: Updated from CVS libtool.
5916 * configure.ac: Generate a gnu coding standards compliant version
5917 number, and use it for the banner.
5918 * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
5919 mhen the TIMESTAMP changes in ChangeLog, but the file modification
5920 time doesn't (e.g. in cvs commit). Otherwise dist tarballs will
5921 contain the previous version number.
5922 * src/main.c: Make --version output conform to the GNU standard.
5924 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
5925 * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
5926 m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
5927 shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
5928 time_la_SOURCES): ...so that these are defaulted correctly, and
5929 can be removed from this file.
5930 (AM_LDFLAGS): Add -module...
5931 (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
5932 traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
5933 import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
5934 the individual settings can be removed.
5935 * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
5936 * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
5937 m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
5938 shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
5939 time_la_LIBADD): ...so that these are picked up as a deplib of
5940 libm4 and don't need to be set explicitly.
5942 2003-11-18 Gary V. Vaughan <gary@gnu.org>
5944 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
5945 from the standard build. It is too fragile.
5947 * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
5948 CVS libtool after merging m4 changes across to libtool.
5950 * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
5951 * m4/path.c (search_path_add): Ditto.
5953 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5955 * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
5956 libtool tags we don't use in configure. This reduces the size
5957 of the script from over 1Mb to under 700Kb.
5959 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5961 The import script was not written properly, and the last gnulib
5962 import was incomplete. Fixed that problem, and reimport our
5963 gnulib dependencies, which picks up the address calculation
5964 overflow checks described by Paul below. Also tweak the clients
5965 of the gnulib xalloc module not to use deprecated macros:
5967 * gnulib/import: Recurse through module dependencies rather than
5968 naively descending only one level.
5969 * configure.ac: Add calls to gnulib's strnlen and extension module
5971 * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
5973 * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
5974 gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
5975 gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
5976 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
5978 * gnulib/acm4/libtool.m4: Updated from CVS libtool.
5979 * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
5980 place of `xcalloc (1, S)'.
5981 * m4/m4.c (m4_create): Likewise.
5982 * m4/m4private.h (m4_symbol_value_create): Likewise.
5983 * m4/symtab.c (symtab_fetch): Likewise.
5984 * m4/syntax.c (m4_syntax_create): Likewise.
5985 * src/freeze.c (reload_frozen_state): Likewise.
5986 * m4/path.c (search_path_add): Eliminate use of deprecated NEW
5988 * m4/symtab.c (m4_symtab_create): Likewise.
5990 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5992 * tests/module.at: Comment typo.
5994 2003-10-10 Gary V. Vaughan <gary@gnu.org>
5996 * tests/modules.at (modules: importing): Apply some lateral
5997 thinking, and use AT_CHECK to compare the output of a sed pass
5998 over stderr against the canonical strerror string.
6000 * tests/modules.at (modules: importing): Edit the generated stderr
6001 output to canonicalize strerror output, before a comparison.
6003 2003-10-10 Gary V. Vaughan <gary@gnu.org>
6005 Tru64UNIX perl is sloppy with namespace pollution. This patch is
6006 careful not to trip over the mess:
6008 * modules/perl.c: Some builds of perl install headers that contain
6009 `#define try __builtin_try'. Be sure to undefine that macro
6010 before `m4/hash.h' gets included, which uses the `try' symbol.
6011 * m4/system_.h: Similarly for `bool'. Undefine `bool', `true' and
6012 `false' before including `stdbool.h'.
6013 (DELETE): This symbol is not in m4's namespace, and is in any
6014 case only used internally...
6015 * m4/m4private.h (DELETE): ...so move it to here.
6016 Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
6018 2003-10-08 Paul Eggert <eggert@twinsun.com>
6020 Don't use XMALLOC and XCALLOC. Once we install the
6021 corresponding patch into gnulib, this will fix some
6022 address-calculation overflow bugs on hosts where calloc (A, B)
6023 returns garbage when A*B overflows.
6025 * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
6026 maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
6027 xmalloc, XCALLOC with xcalloc.
6028 * m4/m4.c (m4_create): Likewise.
6029 * m4/m4private.h (m4_symbol_value_create): Likewise.
6030 * m4/output.c (m4_output_init): Likewise.
6031 * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
6032 * m4/syntax.c (remove_syntax_attribute): Likewise.
6033 * src/freeze.c (reload_frozen_state): Likewise.
6034 * src/main.c (main): Likewise.
6036 2003-10-07 Gary V. Vaughan <gary@gnu.org>
6038 * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
6039 gnulib/acm4 directories for aclocal m4 macros.
6040 * gnulib/Makefile.am (EXTRA_DIST): Removed.
6041 (MAINTAINERCLEANFILES): Add Makefile.in.
6042 * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
6044 * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
6045 * gnulib/import: New file. Temporary script for updating gnulib
6046 imported files, until gnulib-tool is working.
6047 * gnulib/config/codeset.m4, gnulib/config/error.m4,
6048 gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
6049 gnulib/config/getopt.m4, gnulib/config/gettext.m4,
6050 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
6051 gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
6052 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
6053 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
6054 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
6055 gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
6056 gnulib/config/nls.m4, gnulib/config/obstack.m4,
6057 gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
6058 gnulib/config/progtest.m4, gnulib/config/realloc.m4,
6059 gnulib/config/regex.m4, gnulib/config/restrict.m4.
6060 gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
6061 gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
6062 gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
6063 gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
6064 gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
6065 gnulib/config/xstrndup.m4: Removed.
6066 * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
6067 gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
6068 gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
6069 gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
6070 gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
6071 gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
6072 gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
6073 gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
6074 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
6075 gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
6076 gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
6077 gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
6078 gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
6079 gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
6080 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
6081 gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
6082 gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
6083 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
6084 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
6085 gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
6086 gnulib/import script.
6087 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
6088 gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
6089 gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
6090 gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
6091 gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
6092 gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
6093 gnulib with gnulib/import script.
6094 * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
6095 guards ready for gnulib-tool to autoupdate on import.
6096 * config/debug.m4, config/gmp.m4, config/m4-error.m4,
6097 config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
6098 config/stackovf.m4: Moved from here...
6099 * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
6100 acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
6101 acm4/stackovf.m4: ...to here, to separate aclocal macros from
6102 configure time helper scripts.
6103 * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
6104 * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
6105 m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
6106 src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
6108 * src/main.c (version_etc_copyright): Only output the current
6110 (version_etc): Call with new variadic API.
6112 2003-09-16 Gary V. Vaughan <gary@gnu.org>
6114 * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
6115 version-etc module from CVS gnulib.
6116 * po/POTFILES.in: Add gnulib/m4/version-etc.c.
6117 * src/Makefile.am: Build it.
6118 * src/main.c: Use it.
6120 * gnulib/m4/exit.h: Import exit module from CVS gnulib.
6121 * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
6122 * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
6125 2003-09-15 Charles Wilson <cygwin@cwilson.fastmail.fm>,
6126 Gary V. Vaughan <gary@gnu.org>
6128 * bootstrap: Separate options.
6129 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
6130 * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
6132 * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
6133 (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
6134 (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
6135 (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
6136 $(LTLIBINTL) for gettext support on cygwin.
6137 * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
6138 have $(LTLIBINTL) from the preloaded module la files.
6139 * README: Remove the warning about using --disable-nls on Windows
6142 2003-09-15 Gary V. Vaughan <gary@gnu.org>
6144 * gnulib/m4/regex.c: s/<regex.h>/"regex.h"/ or else the compiler
6145 picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
6148 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6150 * doc/STYLE: Document the gnulib header naming conventions, and
6152 * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
6153 gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
6154 gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
6156 * gnulib/m4/Makefile.am: Remove the rules to build these headers.
6158 * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
6159 module from CVS gnulib.
6160 * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
6161 (gl_FUNC_STRTOL): In favour of the module macro.
6163 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6165 Replace the getopt code with CVS gnulib getopt. The source files
6166 detect whether they are in a glibc environment and preprocess away
6167 all of the code if there is a system getopt, so we can compile
6168 them into the m4 executable unconditionally:
6170 * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
6171 gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
6172 * configure.ac (gl_GETOPT): Use this instead of homebrew inline
6174 * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
6176 * src/Makefile.am: Adjust.
6177 * src/main.c: Always include our shipped getopt.h.
6178 * po/POTFILES.in: Use new location of getopt.c.
6180 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6182 * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
6183 * config/Makefile.am: Removed. Automake 1.8 distributes the files
6184 in this directory automatically.
6185 * Makefile.am (EXTRA_DIST): Except config/mkstamp.
6187 * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
6189 * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
6191 * modules/Makefile.am (pkglibexecdir): Set it here.
6192 (pkgmodincdir): Renamed to pkgmodincludedir). Changed all clients.
6194 * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
6195 Import regex module from CVS gnulib.
6196 * gnulib/config/restrict.m4: Ditto for dependee module restrict.
6197 * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
6198 do extra substitutions for Makefile.
6199 * configure.ac: Use it.
6200 * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
6201 from regex_.h if necessary.
6202 * m4/system_.h: Include the correct version of regex.h.
6203 * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
6205 * po/POTFILES.in: Use new location of regex.c.
6207 * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
6208 realloc.c: automake distributes these files already.
6210 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6212 Replace the xstrzdup code by importing the xstrndup module from
6213 CVS gnulib, along with its dependencies: strndup and strnlen:
6215 * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
6216 gnulib/config/xstrndup.m4: Import xstrndup module from CVS
6218 * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
6219 gnulib/config/strndup.m4: Ditto wrt strndup.
6220 * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
6222 * gnulib/m4/Makefile.am: Add rules from newly imported modules.
6223 However, contrary to gnulib, we install xstrndup.h.
6224 * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
6225 * gnulib/lib/xstrzdup.c: Delete. This was never a gnulib file, it
6226 is an artifact of the old m4 portability layer.
6227 * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
6228 * m4/system_.h: Include xstrndup.h.
6229 * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
6231 2003-09-11 Gary V. Vaughan <gary@gnu.org>
6233 Reimport the latest xalloc module from CVS gnulib, and adjust the
6234 m4 sources to take advantage of xalloc xfree. Also create a new
6235 macro DELETE with the same semantics as the old m4 XFREE macro,
6236 and carefully tweak callers:
6238 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
6240 * m4/utility.c (xfree): Removed. This function is now supplied by
6242 * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
6243 * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
6244 * m4/symtab.c (m4_symtab_create): Ditto.
6245 * m4/system_.h: Removed XFREE redefine.
6246 (DELETE): New macro with same functionality as the original m4
6247 XFREE macro, but based on xalloc.h now. Changed all callers.
6248 * src/main.c (main): Use XMALLOC macro.
6249 * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
6251 * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
6253 2003-09-10 Gary V. Vaughan <gary@gnu.org>
6255 Import the xalloc module from CVS gnulib, along with its
6256 dependencies: exitfail, malloc and realloc. We had different
6257 semantics for our XFREE and a function xfree() not supplied by
6258 gnulib, so also a bit of work to keep everything running
6261 * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
6262 (gl_XALLOC): Use gnulib equivalents.
6263 * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
6264 gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
6265 * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
6266 * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
6268 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
6269 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
6270 * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
6272 (pkgincdir): Removed. Use pkgincludedir instead.
6273 * m4/m4private.h (XFREE): xfree already checks for NULL.
6274 * m4/system_.h: Use xalloc module, and remove macros already
6275 supplied by xalloc.h.
6276 * m4/utility.c (xfree): xalloc does not yet implement xfree, so
6277 moved the old definition from m4/xmalloc.c to here for now.
6279 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6281 Import the error and progname modules from CVS gnulib. Our old
6282 error.c subsumed the functionality of both, so a little adjustment
6283 was required to accomodate the split in sources. Also added more
6284 wrapper macros to choose between a system installed error.h or our
6285 shipped gnulib error module:
6287 * m4/error.c, m4/error.h: Removed.
6288 * m4/Makefile.am: Adjust.
6289 (pkgincdir): Removed. Use pkgincludedir instead.
6290 * m4/module.h, src/main.c: Don't include `m4/error.h'.
6291 * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
6293 * gnulib/m4/progname.c: Imported from CVS gnulib.
6294 * gnulib/m4/progname.h: Ditto.
6295 * src/main.c: Adjust to use progname module.
6296 * gnulib/m4/error.c: Imported from CVS gnulib.
6297 * gnulib/m4/error_.h: Ditto.
6298 * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
6299 if appropriate, and link a local error.h if the system version is
6301 (libgnu_la_SOURCES) Add progname module sources.
6302 * gnulib/config/error.m4: Imported from CVS gnulib.
6303 * gnulib/config/strerror_r.m4: Ditto.
6304 * config/m4-error.c: New file. Wrap gnulib error.m4 but arrange
6305 to have ERROR_H for Makefile substitutions and tell system.h
6306 whether the system error.h should be used, or a locally installed
6308 * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
6310 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6312 * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
6313 s/gettext_.h/gettext.h/.
6315 * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
6316 automake have been fixed.
6318 * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
6319 gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
6320 of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
6321 rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
6323 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6325 The gnulib obstack module requires the gnulib gettext module for
6326 systems that do not have GNU gettext installed. Because we use
6327 -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
6328 that directory incase it clashes with the system gettext.h. This
6329 delta uses gettext_.h and extra rules in the Makefile to make a
6330 link to gettext.h when needed:
6332 * Makefile.am (auxdir): Removed. No longer used.
6333 * configure.ac (ac_aux_dir): Removed AC_SUBST. No longer used.
6334 (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
6336 (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
6337 Makefile based build.
6338 (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
6339 of the macros are kept.
6340 * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
6341 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
6342 * config/Makefile (ACLOCAL_MACROS): Removed. Automake 1.7a
6343 distributes these automatically.
6344 * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
6345 warning from automake-1.7a.
6346 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
6347 m4_CHECK_DEBUGGING for consistency with gnulib prefixes. Changed
6349 * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
6350 wrt. m4_FUNC_OBSTACK.
6351 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
6352 wrt. m4_sys_STACKOVF.
6353 * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
6354 wrt. _m4_LIB_GMP, m4_LIB_GMP.
6355 (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
6356 namespace. Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
6358 * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
6359 * gnulib/m4/Makefile.am: Added a new block to make an appropriate
6360 gettext.h link on deficient systems.
6361 (pkginc_HEADERS): Mention $(GETTEXT_H).
6362 (EXTRA_HEADERS): Mention gettext.h.
6363 * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
6364 * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
6365 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
6366 gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
6367 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
6368 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
6369 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
6370 gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
6371 gnulib/config/po.m4, gnulib/config/progtest.m4,
6372 gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
6373 gnulib/config/ulonglong.m4: Imported from CVS gnulib.
6375 2003-09-05 Gary V. Vaughan <gary@gnu.org>
6377 We can't mirror the gnulib directory structure here, since we need
6378 to be able to eg. `#include <m4/obstack.h>' from our source files,
6379 which is much easier if the local obstack.h is created in a
6380 directory named m4. Rather than trying to symlink everything into
6381 the m4 directory, now we build a libtool convenience library from
6382 the sources we get from gnulib and link that with libm4.la:
6384 * gnulib/config/extensions.m4: Imported from CVS gnulib.
6385 * gnulib/config/unlocked-io.m4: Ditto.
6386 * gnulib/m4/unlocked-io.h: Ditto.
6387 * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
6388 gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
6389 * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
6390 gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
6391 * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
6392 * m4/Makefile.am: Adjust.
6393 * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
6394 macros we redistribute.
6395 * gnulib/m4/Makefile.am: New file. Build libgnu.la convenience
6396 library among others.
6397 (GNULIB_SRCS, GNULIB_MACROS): Removed.
6398 * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
6399 * config/m4-obstack.m4: Adjust.
6400 * po/POTFILES.in: Adjust.
6401 * configure.ac: Reformatting. Call newly imported gnulib macros.
6402 * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
6403 bogus calls of `#include "m4.h"'.
6404 * Makefile.am: INCLUDES has been deprecated in favour of
6406 * m4/Makefile.am: Ditto.
6407 * modules/Makefile.am: Ditto.
6408 * src/Makefile.am: Ditto.
6410 2003-09-05 Gary V. Vaughan <gary@gnu.org>
6412 * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
6414 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6416 Migrate the obstack support into the gnulib directories for easy
6417 synchronisation with upstream files in gnulib:
6419 * config/gnu-obstack.m4: Moved from here...
6420 * config/m4-obstack.m4: ...to here.
6421 * config/Makefile.am (SPECIFIC_MACROS): Adjust.
6422 * m4/obstack.c, m4/obstack_.h: Moved from here...
6423 * gnulib/obstack.c, gnulib/obstack.h: ...to here.
6424 * po/POTFILES.in: Adjust.
6425 * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
6426 * m4/Makefile.am: Add a whole new section to link the obstack
6427 sources from the gnulib tree if necessary.
6428 * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
6430 * config/m4-obstack.m4: Rewrite as a wrapper for
6431 gnulib/m4/obstack.m4.
6433 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6435 GNU M4 currently builds with a number of files adapted from
6436 upstream sources. Recently the gnulib project on savannah.gnu.org
6437 has pulled together a great many of these externally maintained
6438 files. This delta is the beginnings of isolating those files
6439 maintained in gnulib to make it easy to synchronise M4 with the
6440 upstream files prior to releases.
6442 * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
6444 (SUBDIRS): Added new gnulib subdirectory.
6445 * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
6446 * config/stdbool.m4: Moved from here...
6447 * gnulib/m4/stdbool.m4: ...to here.
6448 * m4/stdbool_.h: Moved from here...
6449 * gnulib/lib/stdbool_.h: ...to here.
6450 * gnulib/Makefile.am: New file. Make sure the gnulib tree is
6452 * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
6453 code to work with new stdbool_.h location.
6454 (gnulib_srcdir): New.
6456 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6458 * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
6459 (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
6461 (SPECIFIC_TOOLS): New variable. Moved mkstamp to here.
6462 (EXTRA_DIST): Use it.
6464 * bootstrap: CVS autoreconf leaves file droppings. Remove
6465 aclocal.m4t incase autoreconf doesn't.
6467 2003-08-29 Gary V. Vaughan <gary@gnu.org>
6469 * m4/gnu-obstack.h: Updated from CVS gnulib. For consistency with
6470 the other gnulib imports, renamed to m4/obstack_.h.
6471 * m4/obstack.c: Updated from CVS gnulib.
6472 * m4/Makefile.am (EXTRA_HEADERS): Adjust.
6473 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
6474 header tests from gnulib obstack module. AC_CONFIG_LINKS knows
6475 about vpath already, and $top_srcdir upsets CVS Automake, so the
6476 $top_srcdir reference was removed.
6478 * m4/system-h.in: For consistency with the gnulib imports, renamed
6480 * m4/Makefile (EXTRA_HEADERS): Adjust.
6481 * configure.ac (AC_CONFIG_FILES): Adjust.
6483 * m4/stdbool_.h: New file from gnulib for systems without their
6485 * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
6486 * config/stdbool.m4: New file. Macros from gnulib for same.
6487 * configure.ac: Use it.
6489 2003-08-27 Gary V. Vaughan <gary@gnu.org>
6491 * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
6492 * config/gmp.m4: Ditto.
6493 * config/gnu-obstack.m4: Ditto.
6494 * config/stackovf.m4: Ditto.
6495 * m4/builtin.c: Ditto.
6496 * m4/debug.c: Ditto.
6497 * m4/error.c: Ditto.
6498 * m4/error.h: Ditto.
6499 * m4/gnu-obstack.h: Ditto.
6502 * m4/input.c: Ditto.
6504 * m4/m4module.h: Ditto.
6505 * m4/m4private.h: Ditto.
6506 * m4/macro.c: Ditto.
6507 * m4/module.c: Ditto.
6508 * m4/obstack.c: Ditto.
6509 * m4/output.c: Ditto.
6511 * m4/regex.c: Ditto.
6512 * m4/regex.h: Ditto.
6513 * m4/strtol.c: Ditto.
6514 * m4/symtab.c: Ditto.
6515 * m4/syntax.c: Ditto.
6516 * m4/utility.c: Ditto.
6517 * m4/xmalloc.c: Ditto.
6518 * m4/xstrdup.c: Ditto.
6519 * m4/xstrzdup.c: Ditto.
6520 * modules/evalparse.c: Ditto.
6521 * modules/format.c: Ditto.
6522 * modules/gnu.c: Ditto.
6523 * modules/import.c: Ditto.
6524 * modules/load.c: Ditto.
6525 * modules/m4.c: Ditto.
6526 * modules/m4.h: Ditto.
6527 * modules/modtest.c: Ditto.
6528 * modules/mpeval.c: Ditto.
6529 * modules/perl.c: Ditto.
6530 * modules/shadow.c: Ditto.
6531 * modules/stdlib.c: Ditto.
6532 * modules/time.c: Ditto.
6533 * modules/traditional.c: Ditto.
6534 * src/freeze.c: Ditto.
6535 * src/getopt.c: Ditto.
6536 * src/getopt1.c: Ditto.
6538 * src/main.c: Ditto.
6539 * src/stackovf.c: Ditto.
6541 * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
6542 ac_default_headers is an autoconf internal variable.
6543 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
6544 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6546 * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
6547 * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
6550 2003-08-15 Gary V. Vaughan <gary@gnu.org>
6552 * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
6554 * system-h.in (m4_boolean): Removed in favour of using C99 bool if
6555 possible or faking one with a typedef. Changed all callers.
6557 2003-08-15 Gary V. Vaughan <gary@gnu.org>
6559 Still cleaning up the users' module API, by taking out the stuff
6560 that isn't used by any existing modules, and moving specialised
6561 functions out of libm4 and into the module they are used by.
6563 * m4/m4module.h (m4_skip_space): No need to export this. Moved...
6564 * m4/utility.c (m4_skip_space): ...to here the home of its only
6565 use, made static and renamed to `skip_space'. Changed all
6567 * m4/m4module.h (m4_expand_ranges): Removed prototype.
6568 * m4/utility.c (m4_expand_ranges): Moved definition from here...
6569 * modules/m4.c (m4_expand_ranges): ...to here, and exported using
6571 * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
6573 * modules/gnu.c (builtin_syntax): Import and use in this
6574 builtin implementation.
6575 * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
6577 * m4/macro.c (trace_flush): Except here where the macro is now
6579 * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6580 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
6582 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6583 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
6585 2003-08-14 Gary V. Vaughan <gary@gnu.org>
6587 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
6588 compiler based AC_CHECK_HEADER that was introduced in
6590 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6591 * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
6592 * configure.ac: Use renamed M4_AC_LIB_GMP.
6594 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
6595 macro that requires arguments! This stops the shell's bad
6596 substitution error at configure time.
6598 * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
6599 variables to the testsuite shell. Set the value of USE_GMP so
6600 that the gmp test will run!
6601 (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
6603 2003-08-11 Gary V. Vaughan <gary@gnu.org>
6605 Libltdl already has an excellent mechanism for accessing C symbols
6606 in modules. Lets use that! Remove all the exporting cruft and
6607 just use lt_dlsym in conjunction with a few conventions to
6608 simplify module writers' jobs. Also removed the table address
6609 caching code and otherwise simplified the module loader quite a
6610 bit. To access exported symbols in other modules, first the
6611 exporting module must name the symbols <modname>_LTX_<symname>,
6612 and the importing module must define a function type called
6613 <symname>_func. The importer then adds
6614 M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
6615 that wishes to call out to the exported functions. Care must be
6616 taken that <symname> is non-NULL in the importing module incase
6617 M4_MODULE_IMPORT fails, but otherwise it can be called as if the
6618 definition was in the importers source. Study
6619 `modules/{gnu.c,m4.{c,h}' for a model example. At the moment,
6620 m4_module_import will attempt to automatically load a module
6621 required for symbol access if it is not loaded already.
6623 * TODO: Removed the items fixed in this delta.
6624 * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
6626 * m4/ltdl.h (lt_dlhandle_find): Declare it.
6627 * m4/module.c (m4_module_unload): Use it.
6628 * src/freeze.c (reload_frozen_state): Ditto.
6629 * m4/m4module.h (m4_export): Deleted. Removed all references.
6630 (M4_MODULE_IMPORT): New user convenience macro for importing
6631 arbitrary symbols from other modules.
6632 * m4/module.c (m4_module_import): New function to service
6633 M4_MODULE_IMPORT macro.
6634 (module_data): Removed. Looking up the tables on demand with
6635 lt_dlsym, rather than caching their addresses here simplifies the
6637 (m4_get_module_builtin_table, m4_get_module_macro_table):
6638 Removed. Changed all callers.
6639 (set_module_macro_table, set_module_builtin_table): Renamed to
6640 install_macro_table and install_builtin_table respectively, and
6641 simplified now that the cache is no more.
6642 * modules/gnu.c (builtin_symbols): Use this new mechanism to
6643 import m4_dump_symbols from the m4 module.
6644 (builtin_esyscmd): Likewise for m4_set_sysval and
6646 * modules/m4.c (m4_export_table): Removed. Functions are
6647 addressed with the new mechanism which doesn't need this.
6648 (m4_set_sysval): New exported accessor function to prevent
6649 problems with variable access on inferior architectures.
6650 * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
6651 (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
6652 that we can have some type safety.
6653 * modules/modtest.c (export_test): C level exported function for
6654 testing the new import mechanism.
6655 * modules/import.c: New file for the import end of the test.
6656 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
6657 * tests/modules.at: New test cases for intermodule symbol
6660 2003-08-07 Gary V. Vaughan <gary@gnu.org>
6662 * m4/m4module.c (m4_string): Moved from here...
6663 * m4/m4private.c (m4_string): ...to here.
6665 * m4/utility.c (dumpdef_cmp): Removed stale declaration.
6667 2003-07-29 Gary V. Vaughan <gary@gnu.org>
6669 * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
6670 already available to module writers through
6671 m4_{get,set}_nesting_limit_opt(), so moved from here...
6672 * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
6673 (m4_create): Use it.
6675 2003-07-28 Gary V. Vaughan <gary@gnu.org>
6677 Aside from auditing path.c for m4module.h api obfuscation, this
6678 delta introduces the concept of private struct members in opaque
6679 data types to GNU m4: See the STYLE file for details.
6681 * TODO: Remind ourselves that a rewrite of path.c is needed.
6682 * m4/m4module.h (m4_search_path, struct m4_search_path_info):
6684 * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
6685 here and renamed. These type definitions are for internal api use
6686 only. Changed all callers.
6687 * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
6689 * m4/path.c (search_path_env_init, search_path_add): ...to here
6690 and renamed. These calls were never used outside this file.
6691 Changed all callers.
6692 (dirpath): Moved functionality of this static declaration...
6693 * m4/m4private.h (struct m4): ...to this new internal only
6694 search_path field. Changed all callers.
6695 (m4__get_search_path): Added new internal api accessor.
6696 * m4/path.c (m4_search_path_info_new): Removed. Not used.
6697 (m4_include_init): Removed...
6698 * m4/m4.c (m4_create): ...because the new m4 field is now
6700 (m4_delete): Recycle search_path memory.
6701 * src/main.c (main): Don't call m4_include_init now that it's
6703 * doc/STYLE: Document convention for private fields in opaque
6706 2003-07-24 Gary V. Vaughan <gary@gnu.org>
6708 Sometimes exporting the address of a symbol from a module isn't
6709 enough for other modules to call that symbol correctly. If
6710 custom data types are used for function parameters, they need to
6711 be known to the caller. This change introduces the concept of
6712 $(prefix)/include/modules/$(modulename).h to declare those
6713 structures. Also we move m4_dump_symbols from libm4 to the m4
6714 module to show this concept in action.
6716 * m4/m4module.h (m4_dump_symbol_data): Moved from here...
6717 * modules/m4.h (m4_dump_symbol_data): ...to this new file for
6718 exporting data structures from modules/m4.c.
6719 * modules/m4.c, modules/gnu.c: Include it.
6720 * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
6721 * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
6723 * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
6725 * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
6726 ...to here, with slight renaming.
6727 (m4_export_table): Prototype and add m4_dump_symbols.
6728 * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
6729 definition of m4_dump_symbols.
6730 * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
6731 * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
6733 2003-07-24 Gary V. Vaughan <gary@gnu.org>
6735 Create an export table in modules/m4.c in readiness for beefing up
6736 the module loader to track module exports and imports.
6738 * m4/m4module.h (m4_debug_flush_files): Removed prototype.
6739 * m4/debug.c (m4_debug_flush_files): Moved...
6740 * modules/m4.c (m4_sysval_flush): ...to here and renamed.
6741 * modules/gnu.c (builtin_esysval): Use it.
6742 * m4/m4module.h (m4_export): New type for declaring module symbols
6744 * modules/m4.c (m4_export_table): List symbols exported from this
6745 module for use by other modules.
6747 2003-07-24 Gary V. Vaughan <gary@gnu.org>
6749 An experiment: There is loads of code in libm4 which should be in
6750 the m4 module, but is also used by another module. Just because
6751 some linkers won't cope with calls across dynamic runtime loaded
6752 objects I initially left the code in libm4. It will tidy the
6753 module api immensely if this code moves to the right place, I just
6754 need to remember to invent a suitable calling mechanism at some
6755 point. For now, only modules that are statically linked and
6756 preloaded will get this treatment, so the only platforms that will
6757 break are those that require all symbols to be resolved at link
6760 * TODO: Reminder that what I am doing could reduce portability
6761 unless I do something more robust later.
6762 * m4/m4module.h (m4_sysval): No longer exported from libm4.
6763 * m4/utility.c (m4_sysval): No longer declared in libm4.
6764 * modules/Makefile.am: Reformatting.
6765 * modules/m4.c (m4_sysval): Declare it at place of use.
6766 * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
6768 2003-07-23 Gary V. Vaughan <gary@gnu.org>
6770 * m4/m4module.h: Reformatting and rearranging lines a bit.
6771 (m4_obstack): Save typing by typedefing `struct obstack'. Changed
6773 (m4_call_macro, m4_expand_input): Renamed...
6774 (m4_macro_call, m4_macro_expand_input): ...to these. Changed all
6776 (m4_expansion_level, m4_process_macro): Moved...
6777 * m4/macro.c (expansion_level, process_macro): ...to here, and
6780 * m4/m4module.h (program_name): Not used by modules at all, so
6782 * src/main.c (program_name): ...to here.
6783 (print_program_name): Renamed...
6784 (print_program_name_CB): ...to conform to the STYLE guide.
6786 2003-07-23 Gary V. Vaughan <gary@gnu.org>
6788 More refactoring of the m4module.h API. Replace #defines with an
6789 enum, and move non-public functions out of the public API.
6791 * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
6793 * m4/macro.c (stdarg.h): Add ANSI C variadic header.
6794 * m4/debug.c (m4_debug, trace): Moved...
6795 * m4/m4private.h (struct m4): ...to fields of this struct.
6796 (m4_get_debug_file, m4_get_trace_messages): New fast access macros
6798 * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
6799 * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
6800 * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
6801 * m4/m4module.h (m4_context_field_table): Add entries for new
6802 debug_file and trace_messages fields.
6803 (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
6804 (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
6805 (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
6806 (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
6807 (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
6808 (m4_is_debug_bit): New macro to simplfy checks against the debug
6810 (m4_trace_format, m4_trace_header, m4_trace_flush)
6811 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
6813 * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
6814 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
6815 * m4/macro.c (trace_format, trace_header, trace_flush)
6816 (trace_prepre, trace_pre, trace_post): ...to these newly static
6817 functions, since they are only ever used from this file. Changed
6820 2003-07-17 Gary V. Vaughan <gary@gnu.org>
6822 Change the macros for checking syntax so that matching against
6823 multiple possible syntax classes can be done with a single
6824 comparison some of the time. The various classes are now bits of
6825 an int that can be checked with bitwise logic operators.
6827 * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
6828 (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
6829 (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
6830 (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
6831 (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
6832 (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
6833 (M4_SYNTAX_ALNUM): Removed. Changed all callers.
6834 (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
6835 (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
6836 (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
6837 (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
6838 Replace all calls with invocations of these...
6839 (m4_is_syntax, m4_has_syntax): ...New macros.
6840 * src/freeze.c (produce_syntax_dump): Remove mask argument, which
6841 is no longer required with new macros. Changed all callers.
6843 2003-07-15 Gary V. Vaughan <gary@gnu.org>
6845 * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
6846 values are returned as part of the internal interface, so they
6848 * m4/private.h: ...to here.
6849 * m4/macro.c (expand_token): Check for out of range
6850 m4_peek_input() results before looking up in the syntax table.
6851 (collect_arguments): Ditto.
6853 * NEWS: Note `$' syntax class.
6855 2003-07-08 Paul Eggert <eggert@twinsun.com> and
6856 Gary V. Vaughan <gary@gnu.org>
6858 Conform to POSIX if the POSIXLY_CORRECT environment is set.
6859 --traditional `define' now smashes all the definitions.
6861 * NEWS: Explain this.
6862 * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
6863 (Extensions): Explain that extensions that are incompatible with
6864 POSIX are disabled if POSIXLY_CORRECT is set.
6865 (Incompatibilities): Remove.
6866 (Define, Other Incompat): Explain difference
6867 between GNU and POSIX behavior of define, pushdef, popdef.
6868 * m4/m4.c (m4_get_posixly_correct_opt): New undef.
6869 * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
6870 * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
6871 (m4_get_posixly_correct_opt): New macro.
6872 * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
6874 * modules/m4.c (builtin_functions): defn now takes any number of args.
6875 (builtin_define): Smash all the definitions if
6877 (builtin_defn)): Allow any number of arguments.
6878 (builtin_undivert): Do not allow nonnumeric arguments
6880 * src/main.c (main): Set posixly-correct behavior if either
6881 POSIXLY_CORRECT is set, or if -G is given.
6882 * tests/builtins.at: New test for smashed definitions.
6884 2003-06-27 Gary V. Vaughan <gary@gnu.org>
6886 * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
6887 * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
6888 not to slow the parser down.
6889 (M4__IS_STRING): New macro to test string syntax class membership.
6890 * m4/syntax.c: Adjust docucomment.
6891 (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
6892 (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
6893 * m4/input.c (init_builtin_token): Comment typo.
6894 (m4__next_token): Comment typo.
6895 Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
6896 by using the new M4__IS_STRING macro.
6897 * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
6898 variable references in macro expansions.
6900 * doc/m4.texinfo (Eregexp and Regexp): Typo.
6901 (Epatsubst and Patsubst): Typo.
6904 2003-06-26 Gary V. Vaughan <gary@gnu.org>
6906 Move the global variables that pertain to syntax to a new `struct
6907 m4_syntax_table', and then add one of these to `struct m4'. The
6908 ripple effect through the code to both change formerly global
6909 references, and make sure a suitable context is available in
6910 lexical scope is disproportionately large compared to the size of
6911 the change proper. This change is a large part of decoupling
6912 syntax.c from the rest of the code that uses it.
6914 * m4/m4private.h (struct m4): Add a syntax field.
6915 * m4/m4.c (m4_create): Initialise it,
6916 (m4_delete): Recycle it.
6917 (m4_get_symtab): Remove hand coded version...
6918 (m4_get_symbol_table): ...and generate this with cpp. Changed all
6920 * m4/m4module.h (m4_context_field_table): Add an extra field so we
6921 can generate m4_get_symbol_table. Add a new row for
6922 m4_get_syntax_table.
6923 (M4SYNTAX): Syntactic sugar for module writers.
6924 (m4_symtab): Renamed to m4_symbol_table. Changed all callers.
6925 (m4_syntax_table): New home for syntax related formerly global
6927 * m4/m4private.h (struct m4_syntax_table): Define it.
6928 * m4/input.c (m4_input_init): Initialisation of these formerly
6929 global variables moved...
6930 * m4/syntax.c (m4_syntax_create): ...to here.
6931 * m4/input.c (m4_input_exit): And similarly, recycling of the
6932 memory used by those values moved...
6933 * m4/syntax.c (m4_syntax_delete): ...to here.
6934 * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
6935 Moved to m4/m4private.h.
6936 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
6937 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
6938 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
6939 (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
6940 objects. Changed all callers that used to directly access the
6942 (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
6943 Removed and incorporated into m4_syntax_table structure.
6944 * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
6945 * m4/syntax.c (m4_set_syntax): Now returns an error status,
6946 instead of requiring a `struct m4' to generate its own errors.
6947 Changed all callers.
6948 * src/main.c (main): Now that the syntax table is initialised as
6949 part of m4_create, we have to manually wipe the syntax entries if
6950 we are about to read a frozen file.
6952 2003-06-26 Gary V. Vaughan <gary@gnu.org>
6954 * doc/STYLE: Added notes on callback naming schemes.
6956 * m4/module.c (m4_set_module_macro_table)
6957 (m4_set_module_builtin_table): Declarations weren't changed when
6958 definitions were renamed on 2003-06-19.
6960 * m4/hash.c (m4_hash_resize): ifdefed out. This function is
6961 neither used nor particularly appropriate since it exposes the
6962 internal workings of the hash module. I haven't yet decided
6963 whether to remove it entirely.
6965 2003-06-20 Gary V. Vaughan <gary@gnu.org>
6967 Two related changes, and a huge knockon effect throughout the
6968 source: Moved the option variables out of global space and into
6969 `struct m4'; made `m4_symtab' a real datatype, so that its api
6970 is not marred passing `struct m4' around just so it can decide
6971 whether to keep traced symbol names or not. Added setters and
6972 getters for the formerly global option variables, and obviously
6973 changed a vast number of functions to take a `struct m4' and use
6974 the getter funcs to find option values.
6976 * m4/utility.c (interactive, sync_output, debug_level)
6977 (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
6978 (max_debug_argument_length, warning_status, nesting_limit)
6979 (discard_comments): Removed.
6980 * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
6981 (debug_level, max_debug_argument_length, prefix_all_builtins)
6982 (suppress_warnings, discard_comments, interactive, sync_output):
6983 Removed from here...
6984 * m4/m4private.h (struct m4): ...and equivalent fields added to
6986 (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6987 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6988 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6989 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6990 (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
6991 macros for the new fields.
6992 * m4/m4module.h (m4_context_field_table)
6993 (m4_context_opt_bit_table): Helper macros used to generate
6994 prototypes, setters and getters for new option fields
6996 * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6997 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6998 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6999 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
7000 (m4_get_interactive_opt, m4_get_sync_output_opt)
7001 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
7002 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
7003 (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
7004 (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
7005 (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
7006 setter and getter functions generated by cpp from
7007 m4_context_field_table and m4_context_opt_bit_table, exported as
7008 part of the module api. Changed all callers.
7009 * m4/symtab (struct m4_symtab): Used as the concrete type for
7011 (m4_symtab_create): Allocate and initialise a new struct.
7012 (m4_symtab_apply): New function that works like m4_hash_apply, but
7013 with different callbacks specific to symbol tables. Changed all
7015 (symbol_destroy, arg_destroy, arg_copy): Renamed
7016 symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
7017 they have unused parameters for a reason!
7018 (dump_symbol_CB): New callback to dump the contents of a single
7020 (symtob_dump): Rewritten in terms of dump_symbol_CB.
7021 * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
7022 Changed all callers.
7023 * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
7024 of the contained `m4_symtab' at the `no_gnu_extensions' field.
7025 Although I'm not convinced these semantics are correct, they are
7026 at least consistent with how things were before this delta. Also
7027 set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
7029 2003-06-19 Gary V. Vaughan <gary@gnu.org>
7031 Tie down the interface to libm4 some more. Make more structures
7032 opaque to modules by moving them to m4private.h, and writing
7033 setters and getters. To win back the speed penalty for doing this
7034 also wrote macroized versions that do know about structure layout
7035 in m4private.h and #include that file into modules when NDEBUG is
7036 defined at compile time. There are still some accessor macros in
7037 m4private.h that need to go, but that is not necessary to clean
7040 * m4/m4module.h (m4_symbol_type): Moved...
7041 * m4/m4private.h (m4__symbol_type): ...to here.
7042 * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
7043 (m4_set_symbol_traced, m4_set_symbol_name_traced)
7044 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
7045 (m4_get_symbol_func, m4_symbol_value_create)
7046 (m4_symbol_value_delete, m4_set_symbol_value_text)
7047 (m4_set_symbol_value_func): New exported api to symbols.
7048 (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
7049 and m4_is_symbol_value_func.
7050 * m4/m4module.h: Prototype these guys.
7051 * m4/module.c (m4_set_module_macro_table)
7052 (m4_set_module_builtin_table): Make these static, there is no
7053 reason to pollute the api with them.
7054 * m4/m4private.h: Reformatting.
7055 (m4_get_symtab): Only define when NDEBUG is defined.
7056 (m4_get_symbol_value, m4_get_symbol_traced)
7057 (m4_set_symbol_traced, m4_set_symbol_name_traced)
7058 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
7059 (m4_get_symbol_func, m4_symbol_value_create)
7060 (m4_symbol_value_delete, m4_set_symbol_value_text)
7061 (m4_set_symbol_value_func): Macro implementations of the new
7062 functions when NDEBUG is defined.
7063 (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
7064 (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
7065 Superceded by the above. All callers changed.
7066 (M4ARG): Removed. This is no longer different to the
7067 m4/m4module.h definition.
7068 * modules/gnu.c, modules/m4.c: Only include m4private.h when
7069 NDEBUG is defined. That way we exercise the same (albeit slower)
7070 api that external modules must use.
7072 2003-06-18 Gary V. Vaughan <gary@gnu.org>
7074 Renamed some of the types and their accessors to make more sense.
7075 Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
7076 has a stack of SYMBOL_VALUEs.
7078 * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
7079 (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
7080 m4_get_symbol_value_type, m4_get_symbol_value_text,
7081 m4_get_symbol_value_func and m4_symbol_value_copy respectively.
7082 Changed all callers.
7083 (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
7084 (m4_get_token_type): Renamed
7085 * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
7086 to the internal api.
7087 * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
7089 (m4__symtab_init, m4__symtab_exit): Removed prototypes.
7090 (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
7091 (m4__token_type): Moved here from m4module.h.
7092 (m4__next_token): Renamed from m4_next_token.
7093 * m4/symtab.c: Removed some of the parameterised macro support
7094 functions for modularisation later.
7095 (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
7096 m4_hash_dup to perform a true deep copy of the SRC.
7097 (arg_copy): Callback for m4_symbol_value_copy.
7098 * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
7099 Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
7100 m4_get_symbol_value_func. Changed all callers.
7102 2003-06-18 Gary V. Vaughan <gary@gnu.org>
7104 Tidy up style of hash.[ch] in accordance with doc/STYLE.
7106 * m4/hash.c: Internal symbol renaming and formatting.
7107 (m4_hash_dup): New function to facilitate deep copies of hash
7109 (m4_hash_apply_func): Returns a void* now, which is a richer type
7110 for returning exceptions (NULL means keep going).
7111 (m4_hash_apply): Ditto.
7112 * m4/hash.h: Declare exported symbols with an explicit extern.
7115 2003-06-17 Gary V. Vaughan <gary@gnu.org>
7117 Still refactoring furiously. This delta represents a change in
7118 semantics to symtab.c. Instead of building temporary m4_tokens
7119 in the caller, and copying fields in the methods, we now create
7120 the actual m4_token for hashing in the caller so the methods just
7121 slot them in directly. Also, this means that we don't lookup a
7122 symbol and get back an allocated but VOID token to copy fields
7123 into, we create the token we want to push and pass that to
7124 m4_symbol_define or m4_symbol_pushdef. And that's it. There are
7125 a few other small changes to stop knowledge of the implementation
7126 of symtab.c leaking out into other files.
7128 * m4/macro.c (expand_argument): Comment typo corrected.
7129 * m4/symtab.c (symtab_fetch): New function to fetch the address of
7131 (m4_symbol_pushdef): Take an extra value parameter and use this
7132 directly as the new top of the value stack. All callers changed
7133 to build a token and pass responsibility for memory in, rather
7134 than copying as we used to.
7135 (m4_symbol_define): Also use the new value parameter directly as a
7136 replacement for the top of the value stack. All callers changed
7137 to build a token as above.
7138 (m4_set_symbol_traced): New function to set the traced bit on the
7139 named symbol, creating it if necessary.
7140 (symbol_popval): The guts of the old m4_symbol_popdef.
7141 (m4_symbol_popdef): Use it.
7142 * m4/builtin.c (m4_symbol_set_token): Removed,
7143 (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
7145 * m4/module.c (m4_set_module_builtin_table)
7146 (m4_set_module_macro_table): ...with these more orthogonal
7148 * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
7149 (m4_builtin_pushdef, m4_builtin_define): Removed. No longer
7151 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
7152 (m4_arg_signature_parse): Moved...
7153 * m4/symtab.c: ...to here.
7154 * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
7155 screw something up. Moved...
7156 * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
7157 actually does a proper deep copy of source to dest.
7159 2003-06-16 Gary V. Vaughan <gary@gnu.org>
7161 Further refactoring to stabilise the module API. Renaming some
7162 functions for orthogonality, and judicious definition migration to
7163 move things out of the set of exported symbols.
7165 * doc/STYLE: New file. Notes on coding style.
7166 * m4/m4module.c: Updated bitrotted docucomment at the top of the
7168 (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
7169 m4_get_module_name, m4_get_module_builtin_table,
7170 m4_get_module_macro_table which are verb phrases. Changed all
7172 * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
7174 * m4/module.c (m4_set_module_builtin_table)
7175 (m4_set_module_macro_table): ...here, and renamed. Changed all
7177 * m4/m4module.c (m4_module_data): This...
7178 * m4/m4private.c (struct m4_module_data): ...and this...
7179 * m4/module.c (module_data) ...consolidated here and no longer
7180 exported. Changed all callers.
7182 2003-06-16 Gary V. Vaughan <gary@gnu.org>
7184 Begin work on lifting the curse of the global variables. To start
7185 with create a `struct m4' context container, and replace
7186 `m4__symtab' with `context->symtab' throughout. This means
7187 initialising a context container in main, and adjusting many
7188 functions between main and the module entry points so that the
7189 container gets passed through. It would have been nice to
7190 defer this until after 1.5, but it has a major effect on the
7191 user's module writing ABI, so it needs to be addressed now - at
7192 least in the areas that impact the ABI. An interrelated change
7193 in the symtab API removes the dependency on a global symbol table,
7194 and instead focuses on a passed table (from the context
7197 * TODO: Reminders for finishing context functionality.
7198 * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
7199 * m4/m4.c: New file. Manage new struct m4 objects to eliminate
7200 global variables and eventually allow m4 to be reentrant.
7201 * m4/m4private.h (m4): Define the new structure here...
7202 (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
7203 don't carry the overhead of a function call.
7204 * m4/m4module.h: Prototype extern functions from m4/m4.c.
7205 (m4): Declare type for new struct m4 objects.
7206 (M4SYMTAB): User macro to ease finding the symbol table for the
7207 current context for module developers.
7208 (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
7210 (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
7211 (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
7212 (m4_call_macro, m4_dump_symbols, m4_expand_input)
7213 (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
7214 (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
7215 (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
7216 m4* context parameter. Changed definitions and all callers.
7217 (m4_symtab): Alias for m4_hash to decouple the
7218 m4_symtab api from m4_hash.
7219 (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
7221 (m4_symtab_create): New function to return an initialised
7223 (m4_symtab_delete): New function to delete an m4_symtab's memory.
7224 (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
7225 (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
7226 instead of simply using the global m4__symtab. Changed
7227 definitions and all callers.
7228 * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
7229 * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
7230 * src/main.c (main): Create a context and use that instead of the
7231 former global m4__symtab.
7233 2003-06-13 Gary V. Vaughan <gary@gnu.org>
7235 * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
7236 to the callback. Callbacks should not need to hardcode the
7237 hashtable they are working from, nor should we have to waste the
7238 userdata parameter to pass the table in.
7239 * m4/hash.h (m4_hash_apply_func): Require the initial table
7241 * m4/symtab.c (symtab_destroy): Use the passed table instead
7242 of hardcoding m4__symtab.
7243 (m4_symbol_popdef): Don't use the userdata parameter to pass the
7244 table to arg_destroy.
7245 (arg_destroy): Use the hash parameter, ignore userdata.
7246 * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
7248 (traceon, traceoff): Call set_trace with the extra initial
7251 2003-06-13 Gary V. Vaughan <gary@gnu.org>
7253 More refactoring to stabilise the module api, this time for
7254 symtab.c. Additionally, start to pay attention to function names
7255 that don't contain a verb like they should.
7257 * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
7258 wrapper for m4_hash_apply to decouple the symtab module from the
7260 (m4_symbol_builtin, m4_symbol_macro): Renamed to
7261 m4__symbol_set_builtin and m4__symbol_set_macro. Changed all
7263 (m4_symbol_delete): Create a macro version to save a function
7265 (m4_token_t, m4_data_t): These violate the POSIX reserved
7266 namespace. Renamed to m4_token_type and m4_symbol_type. Changed
7268 (m4_token_type): Renamed to m4_token_get_type.
7269 (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
7270 (m4_symtab_exit): Removed from the exported module
7272 * m4/m4private.h (m4__symtab, m4__symtab_init)
7273 (m4__symtab_remove_module_references, m4__symtab_exit): ...and
7274 renamed and added to the internal api. Changed all callers.
7275 (m4_symtab_apply): A faster macro version of the function for
7276 users of the internal api.
7277 * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
7278 symbol_destroy and arg_destroy.
7279 (symtab_debug): Added a prototype.
7280 (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
7281 so that callers in this file get the faster macro versions from
7284 2003-06-12 Gary V. Vaughan <gary@gnu.org>
7286 Refactoring modules to rationalise the API into an external
7287 documented (eventually!) API for use by modules in the `m4_'
7288 namespace declared in m4/m4module.h, an internal API between the
7289 source files we ship (including our shipped modules) in the `m4__'
7290 namespace declared in m4/m4private.h and making the rest as
7291 cohesive as possible with liberal use of the `static' keyword.
7292 This change represents an audit to m4/module.c along these
7295 * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
7296 Removed. No longer used.
7297 (m4_module_close): Removed prototypes.
7298 (m4_module_init, m4_module_open, m4_module_unload_all): Removed
7299 from the exported module api...
7300 * m4/m4private.h (m4__module_init, m4__module_open)
7301 (m4__module_exit): ...and renamed and added to the internal api.
7302 Changed all callers.
7303 (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
7304 Centralised definitions after renaming...
7305 * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
7306 (M4_FINISH_SYMBOL): ...and removing from here.
7307 (m4_module_dlerror, m4_module_remove, m4_module_close)
7308 (m4_caller_id): Not exported at all, so renamed to module_dlerror,
7309 module_remove, module_close and caller_id.
7310 (MODULE_SELF_NAME): New macro to make reporting self errors
7312 (m4_module_load, module_close, module_remove): Use it.
7313 * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
7315 * src/main.c (main): Use it.
7317 2003-06-12 Gary V. Vaughan <gary@gnu.org>
7319 * README: Remove references to --enable-changeword, which has been
7320 removed from the code.
7322 2003-06-11 Gary V. Vaughan <gary@gnu.org>
7324 Getting rid of the annoying bug with configure --enable-debug,
7325 which spewed -e: command not found errors. This was an interaction
7326 between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
7327 You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
7328 branch-1-5) to get the full fix.
7330 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
7331 of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
7332 and then use the probed value of $SED.
7333 (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
7334 this, it messes up the AC_REQUIRE stack.
7336 2003-06-10 Gary V. Vaughan <gary@gnu.org>
7338 * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
7339 the destroy callback.
7340 (m4_arg_destroy): Use the hash address to free the hash node key
7343 2003-06-06 Gary V. Vaughan <gary@gnu.org>
7345 First cut at formal parameters in macros.
7347 * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
7348 * m4/xstrzdup.c: New file.
7349 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
7350 associative array of parameter names to details.
7351 (m4_symbol_token): Capture macro names with parameter lists.
7352 (m4_arg_signature_parse): And build an associative array to hang
7353 from the symbol structure to map names to details.
7354 * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
7355 m4_hash_resize idiom. Now that we potentially add a little hash
7356 table to many of the entries in the symbol table, added an extra
7357 arg to set the initial size. Changed all callers.
7358 (m4_hash_apply): New function that is basically a generalised
7360 * m4/symtab.c (m4_symbol_apply): ...this. Now deleted. Adjusted
7361 all callers to call m4_hash_apply instead.
7362 (m4_arg_destroy): Recycle memory used by an m4_token_arg.
7363 (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
7364 m4_arg_signature association that might be attached to the symbol,
7365 * m4/hash.h (m4_hash_apply_func): Replacement type for...
7366 * m4/m4module.h (m4_symtab_apply_func): ...this. Now deleted.
7367 (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
7369 (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
7370 (M4_IS_IDENT): Detect characters that can be safely used in
7372 * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
7373 * m4/macro.c: Corrected grammar in some comments. Use `token'
7374 rather than `td' for m4_token variables.
7375 (m4_process_macro): If we find a dollar followed by some
7376 M4_IS_IDENT characters, replace that with the contents of the argv
7377 entry with offset stored in the m4_token_arg associated with the
7378 collected identifier.
7380 2003-06-05 Gary V. Vaughan <gary@gnu.org>
7382 Begin preparations for supporting formal parameters in m4 macros.
7384 * m4/m4private.h (struct m4_token_arg): Placeholder for holding
7385 the details of a formal parameter.
7386 (m4_token): Add an arg_signature member to hold a hash table for
7387 looking up formal parameters.
7388 * m4/input.c: Update more bitrotted comments.
7389 (m4_push_builtin): Initialise arg_signature member.
7390 (init_builtin_token): Copy arg_signature member.
7391 * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
7392 (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
7394 * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
7395 (m4_macro_pushdef, m4_macro_define): ...these, And...
7396 (m4_symbol_token): ...wrapped around this new function, which
7397 vastly simplifies the arguments required by the functions it
7399 Changed all callers.
7401 2003-06-05 Gary V. Vaughan <gary@gnu.org>
7403 * m4/macro.c: Format changes.
7405 2003-06-04 Gary V. Vaughan <gary@gnu.org>
7407 * m4/input.c: Updated various bitrotted comments.
7408 (m4_push_builtin): Just pass the whole m4_token, rather than
7409 extracting all the fields in the caller. This also allows us to
7410 check the token type for consistency.
7411 (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
7412 Renamed to builtin_funcs, builtin_peek, builtin_read,
7413 m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
7414 the code. Changed all callers.
7415 (struct input_block): Similarly renamed u_m member to u_b, and
7416 changed all callers.
7417 (m4_next_token): Use bzero to initialise the data fields.
7418 * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
7420 2003-05-29 Gary V. Vaughan <gary@gnu.org>
7422 These changes were necessary to get m4 to build on my iBook
7423 running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
7424 (GCC) 3.1 20020420 (prerelease)":
7426 * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
7427 inclusion of module loader headers.
7428 * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
7429 * m4/Makefile.am: Ditto.
7430 (libm4_la_LIBADD): Added $(LTLIBINTL).
7431 * m4/utility.c (program_name): Removed declaration in favour of
7432 the one already in error.c!
7433 * m4/m4module.h (program_name): Define to program_invocation_name
7434 when using GNU C library. Use an explicit extern declaration.
7435 (interactive, sync_output, debug_level, hash_table_size)
7436 (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
7437 (suppress_warnings, warning_status, nesting_limit, discard_comments)
7438 (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
7439 (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
7440 (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
7441 (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
7442 (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
7443 (m4_expansion_level, m4_expand_ranges, m4_expand_input)
7444 (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
7445 (m4_current_line, m4_current_diversion, m4_output_current_line):
7446 Don't rely on default, use an explicit extern.
7447 * m4/error.h (error, error_at_line, error_print_progname)
7448 (error_message_count, error_one_per_line): Ditto.
7449 * m4/ltdl.c: Update from CVS libtool.
7451 * commit: Update from CVS cvs-utils.
7453 2002-11-04 gettextize <bug-gnu-gettext@gnu.org>
7455 * po/Makefile.in.in: Upgrade to gettext-0.11.5.
7456 * po/boldquot.sed: New file, from gettext-0.11.5.
7457 * po/en@boldquot.header: New file, from gettext-0.11.5.
7458 * po/en@quot.header: New file, from gettext-0.11.5.
7459 * po/insert-header.sin: New file, from gettext-0.11.5.
7460 * po/quot.sed: New file, from gettext-0.11.5.
7461 * po/remove-potcdate.sin: New file, from gettext-0.11.5.
7462 * po/Rules-quot: New file, from gettext-0.11.5.
7464 2002-11-04 Akim Demaille <akim@epita.fr>
7466 * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
7468 * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
7470 2002-11-04 Akim Demaille <akim@epita.fr>
7472 * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
7474 2002-11-04 Akim Demaille <akim@epita.fr>
7476 * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
7477 used as `external', and Libtool 1.4.3.
7479 (LTLIBOBJS): Don't play with it.
7481 * Makefile.am (SUBDIRS): Remove intl.
7482 (ACLOCAL_AMFLAGS): Add -I config.
7483 (EXTRA_DIST): Add config/config.rpath.
7486 * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
7488 2002-05-29 Gary V. Vaughan <gary@gnu.org>
7490 Preparations for refactoring syntax tables to allow reverse
7491 lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
7492 speed of normal lookups in an array of unsigned short.
7494 * m4/input.c (single_quotes, single_comments, use_macro_escape):
7496 * m4/m4private.h (m4__single_quotes, m4__single_comments,
7497 m4__use_macro_escape): ...to here, and renamed. The `m4__' prefix
7498 is for internal symbols which unavoidably pollute the global
7499 namespace, but are not published APIs.
7500 Adjusted all callers.
7501 * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
7502 m4_set_comment, m4_set_syntax, set_syntax_internal,
7503 unset_syntax_attribute): Moved from this file...
7504 * m4/syntax.c: New. ...to this file.
7505 Also added an m4_syntax_exit stub for orthogonality.
7506 * src/main.c (main): Use it.
7507 * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
7508 * m4/m4module.h: Reformatting. New prototypes.
7510 2002-05-29 Gary V. Vaughan <gary@gnu.org>
7512 * bootstrap (aclocal_apiversion): The aclocal apiversion is
7513 distinct from the automake release number (in that the apiversion
7514 apparently has no micro-version-component).
7515 (aclocal_apilibdir): Use it.
7517 2002-05-28 Gary V. Vaughan <gary@gnu.org>
7519 * m4/hash.c (m4_hash_resize): New function.
7520 * m4/hash.h: Add prototype.
7521 * m4/symtab.c (m4_symtab_init): Use it. This could do with some
7522 benchmarking to find a good value for, say, autoconf. This is
7523 already a little quicker than before for me.
7525 * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
7526 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
7528 * m4/hash.h: Adjust prototypes.
7530 2002-01-22 Akim Demaille <akim@epita.fr>
7532 * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
7534 * tests/Makefile.am (package.m4): New.
7535 * tests/atlocal.in: Adjust to CVS Autotest.
7536 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
7537 * configure.ac: LIBOBJ is a forbidden string.
7538 Simplify AM_INIT_AUTOMAKE invocation.
7539 * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
7542 2002-01-21 gettextize <bug-gnu-utils@gnu.org>
7544 * po/Makefile.in.in: Upgrade to gettext-0.10.40.
7546 2001-10-19 Akim Demaille <akim@epita.fr>
7548 * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
7550 2001-10-19 Akim Demaille <akim@epita.fr>
7552 * m4/input.c (m4_next_token): Display where was opened what is
7555 2001-10-19 Akim Demaille <akim@epita.fr>
7557 * m4/macro.c (expand_argument): Display where was opened what is
7560 2001-10-18 Akim Demaille <akim@epita.fr>
7562 * m4/input.c, modules/m4.c: Formatting changes.
7564 2001-10-17 Gary V. Vaughan <gary@gnu.org>
7566 * bootstrap: s/configure.in/configure.ac/
7568 2001-10-16 Gary V. Vaughan <gary@gnu.org>
7570 * m4/symtab.c (m4_symbol_destroy): This function calls
7571 m4_symbol_popdef, which recycles a symbols memory when the last
7572 definition is popped. Since we were passing the address of the
7573 symbol name found in the symbol table, and it was being removed
7574 partway through m4_symbol_destroy() we were referencing freed
7575 memory for the balance of the function. Now we take a copy of the
7576 symbol name tring and use that as a key into the symbol
7577 table... that way if the original symbol name is freed, the copy
7580 2001-10-13 Akim Demaille <akim@epita.fr>
7582 * m4/ltdl.c: Update.
7584 2001-10-13 Akim Demaille <akim@epita.fr>
7586 * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
7587 Don't gettextize internal error messages.
7589 2001-10-13 Akim Demaille <akim@epita.fr>
7591 * tests/macros.at (Arity and defn): New failing test.
7592 (Arity, defn, and freeze): New.
7594 Fix `Arity and defn'.
7596 * m4/input.c (m4_push_macro): Don't forget the arity.
7597 * modules/m4.c (defn): Likewise.
7599 2001-10-13 Akim Demaille <akim@epita.fr>
7601 * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
7603 * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
7604 (Propagation of traceon, Propagation of --trace): this new file.
7606 2001-10-13 Akim Demaille <akim@epita.fr>
7608 * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
7609 interface instead of (name, argc...).
7610 Upon failure, specify which argument was guilty.
7613 2001-10-13 Akim Demaille <akim@epita.fr>
7615 * modules/evalparse.c: Save translators' time: don't translate
7616 internal error messages.
7617 (m4_evaluate): Simplify/normalize error messages.
7618 * doc/m4.texinfo (Eval): Adjust.
7620 2001-10-13 Akim Demaille <akim@epita.fr>
7622 * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
7623 where no checking is needed.
7624 * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
7625 interface instead of (name, argc...).
7627 * modules/gnu.c (m4_patsubst_do): Don't check argc, done
7630 2001-10-13 Akim Demaille <akim@epita.fr>
7632 * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
7633 exclude the builtin name from the count.
7634 * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
7635 calling ifelse with a single argument is valid.
7636 * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
7637 with 1 and 2 args, mostly to strengthen the test suite.
7639 2001-10-13 Akim Demaille <akim@epita.fr>
7641 * m4/output.c (m4_make_diversion, m4_insert_file)
7642 (m4_insert_diversion, +m4_freeze_diversions): Ansify.
7644 2001-10-12 Gary V. Vaughan <gary@gnu.org>
7646 * m4/input.c (init_builtin_token): Renamed from init_macro_token,
7647 since we call these things builtins in the rest of the code!
7649 * modules/gnu.c (m4_regexp_compile): s/%0/%s/
7651 2001-10-12 Gary V. Vaughan <gary@gnu.org>
7653 Rather than forcing each builtin definition to manage its own
7654 argument range checking, tabulate the maxima and minima for all
7655 builtins in each module. This forces us to consider what the
7656 valid ranges for each builtin should be, and moves the checking
7657 code out of each builtin implementation and into the builtin
7658 caller infrastructure.
7660 * m4/m4module.h (struct m4_builtin): Add argument minima and
7662 * m4/m4private.h (struct m4_token): Reflect them here too.
7663 * m4/input.c (struct input_block): ...and here.
7664 (m4_token_copy): New function for token copying.
7665 (init_macro_token): Copy them from a token to the input stack.
7666 (m4_next_token): Don't forget to initialise them for text
7668 * m4/macro.c (expand_argument): Use m4_token_copy, and also
7669 check argument counts before calling the builtin handler.
7670 * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
7671 (m4_symbol_macro): Likewise.
7672 * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
7673 parameters. Updated all callers.
7674 (m4_builtin_define): Ditto.
7675 (m4_macro_pushdef, m4_macro_define): Ditto.
7676 * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
7677 * modules/evalparse.c: Declare argument counts for defined
7678 builtins and remove explicit calls to m4_bad_argc().
7679 * modules/gnu.c: Ditto.
7680 * modules/load.c: Ditto.
7681 * modules/m4.c: Ditto.
7682 * modules/modtest.c: Ditto.
7683 * modules/mpeval.c: Ditto.
7684 * modules/perl.c: Ditto.
7685 * modules/shadow.c: Ditto.
7686 * modules/stdlib.c: Ditto.
7687 * modules/time.c: Ditto.
7690 2001-10-10 Gary V. Vaughan <gary@gnu.org>
7692 The trace semantics now attach the trace bit to a symbol name.
7693 For as long as a traceon(`foo') is active, calls to foo will be
7694 traced regardless of intervening undefines or module unloads.
7695 Fixed the flag propogation issues differently to the fixes
7696 reverted with the last attempt at nailing down trace:
7698 * m4/m4private.h: This file is not visible outside of the m4
7699 source tree, so I removed all the `M4_' and `m4_' prefixes to save
7700 on typing. Updated all clients.
7701 (m4_token): New typedef contains the fields that need to be passed
7702 around with the low level tokeniser.
7703 (m4_token_data): Removed.
7704 (m4_symbol): Now contains the traced flag again.
7705 * m4/symtab.c: Rewritten again. Now we don't remove symbols with
7706 the trace bit set. This change is contained entirely within this
7707 module and doesn't leak out into the callers. Updated all
7709 (m4_symbol_builtin, m4_symbol_macro): Adjusted to make use of the
7710 new fields in m4_token. Updated all clients.
7711 * m4/builtin.c (m4_builtin_pushdef): Needs a flags argument so
7712 that `groks_macro_args' and `blind_if_no_args' flags are retained
7713 when defn() results are passed around in m4 code. Updated all
7715 (m4_builtin_define): Ditto.
7716 (m4_macro_pushdef, m4_macro_define): Ditto.
7717 * m4/input.c (struct input_block): Add a flags field to facilitate
7719 (m4_push_macro): ...use it.
7720 (init_macro_token): Retrieve it.
7721 (m4_next_token): Initialise it.
7722 * m4/macro.c (expand_argument): Copy it.
7723 * m4/m4module.h: Adjust.
7724 * tests/builtins.at: Adjust the expected output of the trace
7725 tests to reflect the change in semantics.
7726 * tests/modules.at (modules: trace): Check that unloading a
7727 module which supplies a traced symbol definition doesn't lose te
7730 2001-10-07 Gary V. Vaughan <gary@gnu.org>
7732 * modules/gnu.c (m4_macro_table): Display the timetamp when
7733 expanding __m4_version__.
7735 * configure.ac (--with-modules): Forgot a comma in the
7736 AC_HELP_STRING parameter list.
7738 2001-10-05 Gary V. Vaughan <gary@gnu.org>
7740 * bootstrap: Remove aclocal.m4t when it is no longer required.
7742 2001-10-05 Akim Demaille <akim@epita.fr>
7744 * tests/Makefile.am: Adjust for gnuprog2.
7745 * tests/m4.in: There can be a leading path.
7746 * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
7747 * tests/testsuite.at: Adjust to the most recent Autotest.
7748 (AT_CHECK_M4_FILTER): Fix and rename as...
7750 * tests/others.at: Use it.
7752 * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
7753 variable in shell scripts, one uses `$'...
7755 2001-10-04 Gary V. Vaughan <gary@gnu.org>
7757 * configure.ac: `rm -f $m4_getopt_h' was lost.
7759 2001-10-04 Gary V. Vaughan <gary@gnu.org>
7761 * configure.ac (TIMESTAMP): Display with AS_BOX at configure
7762 time. Define it for config.h in order to...
7763 * src/main.c (main): ...display the timestamp for --version.
7765 2001-10-04 Akim Demaille <akim@epita.fr>
7767 * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
7768 previous builtins `regexp' and `patsubst'.
7769 (regexp, patsubst): Use them.
7770 (eregexp, epatsubst): New builtins.
7771 * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
7772 (Epatsubst and Patsubst, Eregexp and Regexp): these.
7773 (Extensions): More info on REs.
7775 2001-10-04 Akim Demaille <akim@epita.fr>
7777 * modules/modtest.c (init_handler): Consistently output to stderr.
7778 (finish_handler): New.
7779 (test): The `if' is an `assert'.
7780 * tests/modules.at: Adjust.
7782 2001-10-04 Akim Demaille <akim@epita.fr>
7784 * m4/utility.c (m4_bad_argc): Detail the mismatches.
7786 2001-10-01 Akim Demaille <akim@epita.fr>
7788 * tests/generate.awk: Tag the tests with `documentation'.
7789 * tests/modules.at (AT_CHECK_M4_MODTEST): New.
7790 Use the make the existing modtest tests more uniform, and complete
7791 the set of possibilities.
7793 2001-10-01 Akim Demaille <akim@epita.fr>
7795 * config/gmp.m4: Consult the user before using GMP: use
7797 * configure.ac: Adjust.
7798 * modules/gmp.c: No protection needed as the module is not built
7801 2001-10-01 Akim Demaille <akim@epita.fr>
7803 * tests/generate.awk: Remove debugging code.
7804 (fatal): Specify the current location.
7806 * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
7807 * modules/gnu.c, modules/m4.c: Use M4ARG.
7809 2001-10-01 Akim Demaille <akim@epita.fr>
7811 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
7812 (m4_regexp_compile): New.
7813 (regexp, patsubst): Use it.
7815 2001-09-30 Gary V. Vaughan <gary@gnu.org>
7817 Reinstate the memory handling improvements from the patch I just
7818 reverted. Relevant ChangeLog entries repeated here:
7820 * m4/module.c (m4_module_remove): New function that holds the core
7821 of the old m4_module_unload.
7822 (m4_module_unload): Use it.
7823 (m4_module_unload_all): When we know the modules will never be
7824 used again (i.e. on exit), free up as much module memory as
7825 possible. There are still some artifacts from resident modules
7826 living inside ltdl.c, but everything else is freed.
7827 * m4/debug.c (m4_debug_exit): Free memory allocated in
7829 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7830 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7831 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7832 * m4/m4module.h: Updated prototypes.
7833 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7834 * m4/hash.h: Updated prototypes.
7835 * src/main.c (main): Use all these new functions to clean up as
7836 much memory as possible before exit.
7838 2001-09-30 Gary V. Vaughan <gary@gnu.org>
7840 Reverted my large patch for removing the old m4_symbol
7841 structure on 2001-09-20. We are still not happy about the way
7842 trace works in conjunction with defn and undefine, and leaving
7843 the reverted patch active prevents us from moving the traced
7844 bit from the definition back to the symbol.
7846 2001-09-30 Gary V. Vaughan <gary@gnu.org>
7848 * configure.in: Moved to...
7849 * configure.ac: ...here. Added a libtool like timestamped
7850 banner, and tidied up the libltdl cruft.
7851 * config/mkstamp: Script to extract a timestamp from ChangeLog.
7852 * modules/Makefile.am (INCLTDL): Removed. This is required
7853 only when libltdl is configured in a subdirectory.
7854 * src/Makefile.am: Ditto.
7855 (LIBADD_DL): No need to add this again, libtool already knows
7856 that libm4.la depends on it.
7857 * m4/Makefile.am: Automake sets variables from AC_SUBST. Use
7860 * TODO: stackovf.c is basically broken.
7861 Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
7863 2001-09-28 Akim Demaille <akim@epita.fr>
7865 * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
7867 2001-09-27 Akim Demaille <akim@epita.fr>
7869 * tests/m4.in: Don't use short options.
7870 Simplify the stderr signature normalization.
7872 2001-09-27 Akim Demaille <akim@epita.fr>
7874 tests/m4 shall be position independent.
7878 * tests/testsuite.at: No args to AT_INIT.
7879 * configure.in, tests/Makefile.am: Adjust.
7881 2001-09-22 Akim Demaille <akim@epita.fr>
7883 Autotest has changed again.
7885 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
7886 (package.m4): Remove.
7887 * configure.in: Adjust to LIBADD_GMP.
7889 2001-09-21 Gary V. Vaughan <gary@gnu.org>
7891 * config/gmp.m4 (AC_ARG_WITH): Removed.
7892 (GMP_LIB): Renamed to LIBADD_GMP for consistency.
7893 (AC_LIB_GMP): When performing a test compile against libgmp,
7894 include the header gmp.h if possible, and link against -lgmp. If
7895 they both work define USE_GMP.
7896 * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
7897 (mpeval_LTX_init_func): Complain on load that there was no libgmp
7900 2001-09-20 Gary V. Vaughan <gary@gnu.org>
7902 * m4/evalparse.c: Moved to...
7903 * modules/evalparse.c: ...here. This code is shared between
7904 modules/mpeval.c and modules/m4.c, so there is no need to pollute
7905 the libm4 API with its details. Moderately rewritten to interface
7906 into its clients more simply.
7907 * m4/eval.c: Deleted. Migrated functionality to...
7908 * modules/m4.c: ...here.
7909 (builtin_eval): Implemented in terms of the new interface style.
7910 * modules/mpeval.c (builtin_mpeval): Ditto.
7911 * m4/m4module.h: Removed references to the former m4/eval.c.
7912 * m4/Makefile.am (libm4_la_SOURCES): Removed eval.c.
7913 (EXTRA_libm4_la_SOURCES): Deleted.
7914 * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
7915 (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
7917 2001-09-20 Akim Demaille <akim@epita.fr>
7919 * config/gmp.m4 (AM_WITH_GMP): Rename as...
7921 By default, use gmp.
7923 * configure.in: Adjust.
7924 Use Automake conditionals for USE_GMP.
7925 Always compute sizeof (long long int).
7926 This was a bug BTW, as `eval' (not `mpeval') depends on it:
7927 before, it was used _only_ if mpeval was not activated.
7928 * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
7929 (mpeval_la_LIBADD): New macros.
7930 * modules/mpeval.c: No longer be conditioned by WITH_GMP.
7932 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
7933 * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
7936 2001-09-20 Akim Demaille <akim@epita.fr>
7938 * tests/Makefile.am (package.m4): New.
7939 * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
7941 2001-09-20 Gary V. Vaughan <gary@gnu.org>
7943 More cleanup. After the last patch, m4_symbol holds nothing but
7944 the head of a chain of m4_token_data. So I have removed the old
7945 m4_symbol, so that m4_token_data chains are stored directly in the
7946 value cell of a hash table node. But there's more... m4_symbol
7947 was a more natural name for the symbol value cell, and now that it
7948 is gone I have renamed the former m4_token_data structure to
7949 m4_symbol. This change turned out to be a pig to get right, since
7950 the original code didn't need to modify the value cell itself,
7951 since changing the chain happened inside the m4_symbol that used
7952 to be returned -- I had to pass the address of the value cell
7953 across various function calls, incase the head value changed. I
7954 also tightened up the memory management to help me find a nasty
7955 memory corruption bug that took me all night to track down...
7957 * m4/m4private.h (struct m4_symbol): Removed.
7958 (struct m4_token_data): Renamed to `struct m4_symbol'. Updated
7960 * m4/hash.c (m4_hash_iterator_value): Return the address of the
7961 value cell. Updated all callers.
7962 * m4/symtab.c: Took advantage of the simplification in the data
7963 structures to rewrite a lot of this file more simply. There is
7964 still some room for optimisation here, but we should tackle that
7965 systematically closer to the release.
7967 * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
7968 revealed. This version is ahead of CVS libtool until I get chance
7969 to flush my changes.
7970 * m4/module.c (m4_module_remove): New function that holds the core
7971 of the old m4_module_unload.
7972 (m4_module_unload): Use it.
7973 (m4_module_unload_all): When we know the modules will never be
7974 used again (i.e. on exit), free up as much module memory as
7975 possible. There are still some artifacts from resident modules
7976 living inside ltdl.c, but everything else is freed.
7977 * m4/debug.c (m4_debug_exit): Free memory allocated in
7979 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7980 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7981 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7982 * m4/m4module.h: Updated prototypes.
7983 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7984 * m4/hash.h: Updated prototypes.
7985 * src/main.c (main): Use all these new functions to clean up as
7986 much memory as possible before exit.
7988 2001-09-18 Gary V. Vaughan <gary@gnu.org>
7990 The `traced' flag needs to be attached to the definition of a
7991 symbol rather than the current symbol containing the definition.
7992 Implementing this showed up some long standing post 1.4 bugs in
7993 flag propogation which I also fixed.
7995 * m4/m4private.h (struct m4_symbol): Remove the traced flag.
7996 (struct m4_token_data): And add it back in here.
7997 * m4/input.c (init_macro_token): Propogate the traced flag
7999 * m4/macro.c (expand_argument): Ditto.
8000 * tests/builtins.at (trace2, trace3): New tests based on Akim's
8003 2001-09-08 Gary V. Vaughan <gary@gnu.org>
8005 * m4/m4private.h (struct m4_token_data): Simplified by removing
8006 the redundant `traced' flag, and one level of structure nesting.
8007 (M4_TOKEN_DATA_FUNC_TRACED): Removed.
8008 * m4/input.c (init_macro_token): No need to initialise removed
8010 * m4/macro.c (expand_argument): No need to copy it either.
8011 * m4/utility.c (m4_token_data_func_traced): Or provide an access
8014 * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
8015 dependant on multiple symbols with the same key, so preserving
8016 relative symbol order in each bucket during resizing is no longer
8017 required. The resize function is considerably faster as a result.
8019 * m4/m4module.h, m4/builtin.c, m4/symtab.c:
8020 s/m4_symbol_insert/m4_symbol_define/g;
8021 s/m4_builtin_insert/m4_builtin_define/g;
8022 s/m4_macro_insert/m4_macro_define/g. Updated all callers.
8024 2001-09-08 Gary V. Vaughan <gary@gnu.org>
8026 Get rid of m4_symbol_lookup_t entirely. With Akim's earlier
8027 commits, the m4_lookup_symbol dispatch function is split into
8028 specialised functions that must be called directly.
8030 * m4/m4module.h (m4_symbol_lookup_t): Removed.
8031 * m4/symtab.c (m4_lookup_symbol): Removed.
8032 (m4_symbol_builtin, m4_symbol_macro): New functions.
8033 * m4/builtin.c (m4_builtin_define): Split into...
8034 (m4_builtin_pushdef, m4_builtin_insert): ...these.
8035 (m4_macro_define): Split into...
8036 (m4_macro_pushdef, m4_macro_insert): ...these.
8037 * src/main.c (main): Set command line macros from `-D' parameters
8038 using `m4_macro_define'.
8040 2001-09-08 Gary V. Vaughan <gary@gnu.org>
8042 * m4/symtab.c (m4_symtab_remove_module_references): Renamed as
8043 this from m4_remove_table_reference_symbols().
8044 * m4/m4module.h, m4/module.c: Updated all references.
8046 2001-09-07 Akim Demaille <akim@epita.fr>
8048 * modules/stdlib.c, modules/times.c: Misc cleanups.
8050 2001-09-07 Akim Demaille <akim@epita.fr>
8052 * configure.in: We now need Autoconf 2.52e.
8053 * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
8054 and `M4_SYMBOL_DELETE'.
8055 * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
8056 * src/main.c (main): Adjust.
8058 2001-09-06 Gary V. Vaughan <gary@gnu.org>
8060 Fix the obstack.h problem once and for all! At configure time we
8061 can test for a system supplied obstack.h: depending on the
8062 result, we now generate system.h with an #include of the correct
8063 header. As a bonus, I've also added a --with-included-obstack,
8064 incase the user doesn't like the system obstack for some
8065 reason... and also we can test the shipped obstack on a system
8066 that has oe of its own. We also now need to be careful to add
8067 build directories to the include search path, since the generated
8068 system.h will be in the build tree.
8070 * configure.in (AC_CONFIG_FILES): Generate system.h from
8072 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
8073 include the system obstack header or the copy shipped with M4.
8074 Allow the user to override configure and force the build to use
8075 the shipped version.
8076 * m4/system-h.in: New file, template for...
8077 * m4/system.h: ...this. Now deleted.
8078 * m4/m4module.h: Include system.h before everything else.
8079 * src/freeze.c: Ditto.
8080 * m4/Makefile.am (dist-hook): Remove generated system.h.
8081 (INCLUDES): Check builddir for generated headers before checking
8083 * modules/Makefile.am (INCLUDES): Ditto.
8084 * src/Makefile.am (INCLUDES): Ditto.
8086 2001-09-05 Gary V. Vaughan <gary@gnu.org>
8088 * TODO: Remove the items that have been addressed already.
8090 2001-09-05 Akim Demaille <akim@epita.fr>
8092 * src/main.c (main): Standardize --version.
8094 2001-09-05 Akim Demaille <akim@epita.fr>
8096 * modules/format.c (format): Have a bigger `str'.
8098 2001-09-05 Akim Demaille <akim@epita.fr>
8100 Rationalize warnings, reporting the macro name as if it were a
8101 program name, and assertions.
8103 * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
8105 * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
8107 Use assert for internal errors.
8108 * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
8110 * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
8112 * tests/builtins.at (pushpop): Adjust.
8114 2001-09-05 Akim Demaille <akim@epita.fr>
8116 * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
8119 2001-09-05 Akim Demaille <akim@epita.fr>
8121 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
8122 * m4/macro.c, m4/symtab.c: Adjust.
8124 2001-09-05 Akim Demaille <akim@epita.fr>
8126 * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
8127 (m4_symbol_pop, m4_symbol_del): this.
8128 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
8129 (m4_symbol_popdef, m4_symbol_delete): New.
8130 (m4_lookup_symbol): Adjust.
8131 * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
8133 2001-09-05 Akim Demaille <akim@epita.fr>
8135 * m4/m4module.h (m4_symbol_lookup): Rename as...
8136 (m4_symbol_lookup_t): this.
8138 2001-09-05 Akim Demaille <akim@epita.fr>
8140 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
8142 * m4/symtab.c (m4_lookup_symbol): Adjust.
8144 2001-09-03 Gary V. Vaughan <gary@gnu.org>
8146 Bootstrap will now work with Libtool 1.4.1 or higher:
8147 * bootstrap: Remove stale autom4te.cache files when
8149 * config/Makefile.am (ACLOCAL_MACROS): Add ltdl.m4 and
8151 * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
8152 libtool.m4 directly.
8153 Run libtoolize to refresh ltmain.sh.
8154 * config/ltmain.sh: Deleted.
8155 * acinclude.m4: Deleted.
8156 * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
8158 * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
8159 implementation for the cvs impaired libtool user.
8161 2001-09-03 Akim Demaille <akim@epita.fr>
8163 * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
8165 Avoid using `default' in switch, as it hides useful compiler
8166 warnings when a case is forgotten.
8168 2001-09-03 Akim Demaille <akim@epita.fr>
8170 * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
8171 is no such thing as `WITH_MODULES'.
8173 2001-09-03 Akim Demaille <akim@epita.fr>
8175 Improve the test suite's selfcontainedness.
8177 * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
8178 (Include, Undivert): Tag the other input files.
8179 * tests/generate.awk: Catch `@comment file:'.
8180 `-I $src' is no longer needed.
8181 `next' is really like `return': the rest is skipped.
8182 Adjust to `input.m4'.
8183 (fatal): New function.
8184 * tests/foo, tests/incl.m4: Remove.
8186 2001-09-01 Gary V. Vaughan <gary@gnu.org>
8188 The shadowing mechanism and, infact, the whole symbol table
8189 implementation was creaking under the weight of the features piled
8190 on top of it. We now have a separate hash table module which will
8191 dynamically resize to keep symbol density withing good performace
8192 limits, and a new symtab module layered above it. Symbol lookups
8193 are now marginally more efficient (since the shadowed flag is no
8194 longer required) and symbol removal, such as on module unload, is
8195 considerably faster due to a reorganisation of the data structures
8198 * src/main.c (main): Don't mention `-H'.
8199 * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
8202 * m4/hash.c: New generalised dynamic hash table data structure
8204 * m4/hash.h: Public interface.
8205 * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
8206 (libm4_la_SOURCES): Add hash.c.
8207 * m4/symtab.c: More or less rewritten from scratch, within the
8208 bounds of the previous API.
8209 (m4_symtab_apply): A cleaner version of the old hack_all_symbols
8210 call. Updated all callers.
8211 * m4/m4module.c: #include <m4/hash.h>, and changed all affected
8212 declarations to reflect API changes.
8213 (M4INIT): Generate a declaration too, to avoid the warning with
8214 --enable-debug builds.
8217 * m4/utility.c (hash_table_size): Removed.
8218 (m4_dump_symbols): Rewritten to build and qsort an array of symbol
8219 names, which are then looked up by builtin_dumpdef() as necessary.
8220 This implies a small speedup in builtin_symbols(), which discarded
8221 all of the symbol info under the old call.
8222 * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
8223 shadowing is implicit in respect to the new data structures.
8224 symbol names are no longer duplicated here, they are stored in the
8225 key field of the hash table.
8226 Moved macro_args and blind_no_args...
8227 (m4_token_data): ...to here.
8228 m4/macro.c (expand_macro): Added a name argument since the symbol
8229 name is no longer copied into each struct m4_symbol. Modified all
8231 (collect_arguments): Ditto.
8232 * modules/m4.c (set_trace): Ditto.
8233 * modules/gnu.c (builtin_symbols): Updated.
8234 * src/freeze.c (produce_symbol_dump): Much improved in light of
8235 the improved symbol table layout.
8237 2001-09-01 Gary V. Vaughan <gary@gnu.org>
8239 * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
8241 (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
8242 (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
8243 SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
8244 SYMBOL_HANDLE): Ditto.
8245 * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
8246 modules/gnu.c, modules/m4.c, src/freeze.c,
8247 src/main.c: Updated all references.
8249 * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
8250 Automake 1.5 chokes on dynamic source file lists, Besides, it is
8251 already listed in m4_LDADD... how did that ever used to work?
8252 * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
8254 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
8255 Suggested by Tim Van Holder <tim.van.holder@pandora.be>
8257 * tests/m4: Don't call the m4 wrapper script with libtool, it
8258 works fine all by itself.
8260 2001-08-30 Gary V. Vaughan <gary@gnu.org>
8262 The experimental `changeword' feature never took off, and has
8263 no obvious advantages over `changesyntax' to compensate the
8264 enormous speed penalty it carries:
8265 * configure.in (ENABLE_CHANGEWORD): Removed.
8266 * m4/m4module.h (m4_set_word_regexp): Removed.
8267 * m4/m4private.h (m4_token_data): Removed original_text field.
8268 * m4/utility.c (m4_token_data_orig_text): Removed.
8269 * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
8270 * m4/macro.c: Ditto.
8271 * src/main.c: Ditto.
8272 * modules/Makefile.am (changeword.la): Removed.
8273 * modules/changeword.c: File removed.
8274 * doc/m4.texinfo: References to changeword and --word-regexp
8276 * po/POTFILES.in: modules/changeword.c removed.
8277 * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
8278 * tests/builtins.at (changeword): Test removed.
8280 2001-08-30 Akim Demaille <akim@epita.fr>
8282 * bootstrap.sh: Create aclocal.m4 instead of modifying it.
8283 This also help having a single list of m4 files: in
8285 * config/Makefile.am (STANDARD_MACROS): Rename as...
8286 (ACLOCAL_MACROS): this.
8287 (list-standard-macros): Remove.
8290 2001-08-29 Gary V. Vaughan <gary@gnu.org>
8292 In an attempt to moderate my egomania...
8293 * tests/modules.at: Remove attributions.
8295 * tests/generate.awk: When making substitutions to "@&t@", either
8296 "&" or "\&" in the substitution string argument to gsub refer back
8297 to the matched text. "@\\&t@" seems to work though, Tests 43 and
8300 2001-08-29 Akim Demaille <akim@epita.fr>
8302 * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
8303 (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
8304 (sync-lines, trace, translit, undivert, wrap): Move to...
8305 * tests/builtins.at: this new file.
8306 * tests/others.at (Discard comments, import-environment): Move to...
8307 * tests/options.at: this new file.
8309 2001-08-29 Akim Demaille <akim@epita.fr>
8311 * tests/others.at (Freezing modules)
8312 (--module-directory: absolute path, modpath2, modpath3)
8313 (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
8314 * tests/modules.at: here, new file.
8315 * tests/others.at, tests/generate.awk: Add a banner.
8316 * tests/testsuite.at: Adjust.
8317 (AT_CHECK_M4_FILTER): New, but unused.
8319 2001-08-29 Akim Demaille <akim@epita.fr>
8321 * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
8323 * tests/others.at (wrap): Inline wrap.m4.
8324 (shadow): Inline shadow.m4.
8325 (iso8859): Don't specify the path from top_srcdir, but from srcdir.
8326 * tests/m4: Simplify.
8328 2001-08-29 Akim Demaille <akim@epita.fr>
8330 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
8333 2001-08-29 Akim Demaille <akim@epita.fr>
8335 * tests/generate.awk (normalize): s/@__@/@&t@/.
8337 2001-08-28 Akim Demaille <akim@epita.fr>
8339 * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
8341 2001-08-28 Gary V. Vaughan <gary@gnu.org>
8343 * bootstrap (generate.awk): Generate test cases with new script.
8345 2001-08-27 Akim Demaille <akim@epita.fr>
8347 * tests/Makefile.am (installcheck-local): Don't use
8348 `dc_install_base' which is not visible here, but `exec_prefix'
8349 which is clearly the RT anyway.
8350 * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
8351 related to testing a now installed m4.
8352 * tests/m4: Do it here.
8354 2001-08-27 Akim Demaille <akim@epita.fr>
8356 * tests/others.at (indir): Formatting change.
8358 2001-08-27 Akim Demaille <akim@epita.fr>
8360 * tests/Makefile.am (installcheck-local): New.
8361 * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
8363 Prefer options over envvars.
8364 * src/main.c (main): First bug caught by the test suite (yeah!):
8365 --batch lacked a `break' which resulted in an accidental
8366 invocation of --discard-comments.
8368 2001-08-27 Akim Demaille <akim@epita.fr>
8370 * tests/others.at (capitalize, changeword, comments, ddivert)
8371 (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
8372 (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
8373 (sysv-args, trace, translit, undivert): Don't rely on files in
8374 examples/: AT_DATA them.
8376 2001-08-27 Akim Demaille <akim@epita.fr>
8378 Let the test suite use a wrapper around the not installed m4 to
8379 pretend it is (installed).
8381 * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
8382 such a way that m4 does not process them.
8383 * configure.in: The package name seems to be `m4', not `M4'.
8385 * tests/atlocal.in (at_package, M4): Remove.
8386 * tests/testsuite.at, tests/others.at: Use m4, not $M4.
8388 2001-08-27 Akim Demaille <akim@epita.fr>
8390 * tests/Makefile.am (CLEANFILES): Remove.
8391 (DISTCLEANFILES, clean-local): New.
8392 * examples/mktests.sh: Remove.
8394 2001-08-27 Akim Demaille <akim@epita.fr>
8396 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
8397 Don't use aclocal: it's written by hand.
8398 * aclocal.m4: m4_include all the files instead of being built by
8400 * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
8401 until it reads the traces by itself.
8402 * configure.in: Require Autoconf 2.42c as we are now using
8403 AC_CONFIG_TESTDIR instead of AT_CONFIG.
8404 Catch unexpanded `jm_' macros.
8405 * config/atconfig.m4: Remove.
8406 * config/error.m4: new.
8407 * config/Makefile.am: Ship the files included by aclocal.m4.
8408 * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
8409 (TESTSUITE_AT): this, to please Automake.
8410 (TESTSUITE): This target uses autotest/autotest.m4, not
8411 autotest/general.m4.
8412 * tests/testsuite.at: Prereq Autotest 2.52c.
8413 * examples/Makefile.am (pkgdata_DATA): Rename as...
8414 (dist_pkgdata_DATA): this.
8415 * doc/Makefile.am (man_MANS): Rename as...
8416 (dist_man_mans): this.
8418 2001-08-20 Gary V. Vaughan <gary@gnu.org>
8420 * m4/system.h [cygwin*]: Thanks to Paul Sokolovsky and
8421 Robert Collins, building on Cygwin no longer requires Windows
8422 import and export symbol decorations.
8423 * m4/m4module.h (M4_SCOPE) [cygwin*]: Deleted all occurences.
8424 * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
8425 * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8426 * m4/error.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8427 * m4/input.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8428 * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8429 * m4/output.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8430 * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8431 * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8432 * configure.in (LIBM4_DLL_IMPORT) [cygwin*]: Don't set this
8434 * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
8435 * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
8437 2001-08-20 Gary V. Vaughan <gary@gnu.org>
8439 Ansify the source. Previously we had a mix, where my code was
8440 in a K&R compatible style, and the preexisting code was in ANSI
8441 style. Nothing is lost wrt release 1.4 by reverting to ANSI,
8442 and now the code base is much cleaner.
8444 * m4/system.h: Remove M4_PARAMS macro and all users. Remove
8445 VOID macro and all users.
8446 * m4/m4module.h: Ansify function prototypes and headers.
8447 * m4/builtin.c: Ditto.
8448 * m4/evalparse.c: Ditto.
8449 * m4/input.c: Ditto.
8450 * m4/macro.c: Ditto.
8451 * m4/module.c: Ditto.
8452 * m4/output.c: Ditto.
8454 * m4/symtab.c: Ditto.
8455 * m4/utility.c: Ditto.
8456 * modules/format.c: Ditto.
8457 * modules/gnu.c: Ditto.
8458 * modules/m4.c: Ditto.
8459 * modules/mpeval.c: Ditto.
8460 * src/freeze.c: Ditto.
8462 * src/main.c: Ditto.
8464 2001-08-20 Akim Demaille <akim@epita.fr>
8466 * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
8467 generated with stock 2.52.
8469 2001-08-20 Akim Demaille <akim@epita.fr>
8471 * config/atconfig.m4: New, until part of Autoconf per se.
8472 * configure.in (AT_CONFIG): Use it.
8474 * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
8475 * tests/atlocal.in: New.
8476 * tests/generate.awk: For the time being, the empty quadrigraph is
8478 * tests/others.at (changeword, gmp): Check the configuration
8479 variable against `yes'.
8480 * tests/testsuite.at (dnl): Allow it, as it's used all over the
8483 2001-08-20 Akim Demaille <akim@epita.fr>
8485 * m4/utility.c (m4_numeric_arg): Spell out the culprit.
8486 * modules/m4.c (undivert): Disable the possibility of undiverting
8487 several files at once: it is not documented, it is inconsistent
8488 with the other macros, it can be straightforwardly mocked by
8489 several invocations, and most importantly, it prevents the
8490 possibility of other kinds of extension.
8491 Use `m4_numeric_arg'.
8493 2001-08-20 Akim Demaille <akim@epita.fr>
8495 * examples/include.m4: Typo.
8496 * tests/generate.awk: Really add it.
8497 * tests/Makefile.am: Adjust.
8498 * tests/others.at (Discard comments): It sure fails without `-c'.
8499 (include, undivert): Add -I examples/.
8501 2001-08-20 Akim Demaille <akim@epita.fr>
8503 Use sprintf, not ecft and friends since it is standard, portable,
8504 simplifies the code, and since the latter is even deprecated
8505 according to the GNU libc documentation.
8507 * modules/format.c: Drop evct support.
8509 2001-08-19 Gary V. Vaughan <gary@gnu.org>
8511 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up. Don't test
8513 * configure.in: ...do it here instead.
8515 * c-boxes.el: Deleted.
8516 * m4/builtin.c: Reformat box comments to be closer to GNU
8518 * m4/debug.c: Ditto.
8520 * m4/evalparse.c: Ditto.
8521 * m4/input.c: Ditto.
8522 * m4/m4module.h: Ditto.
8523 * m4/macro.c: Ditto.
8524 * m4/output.c: Ditto.
8525 * m4/symtab.c: Ditto.
8526 * m4/utility.c: Ditto.
8527 * modules/changeword.c: Ditto.
8528 * modules/format.c: Ditto.
8529 * modules/gnu.c: Ditto.
8530 * modules/load.c: Ditto.
8531 * modules/m4.c: Ditto.
8532 * modules/modtest.c: Ditto.
8533 * modules/mpeval.c: Ditto.
8534 * modules/perl.c: Ditto.
8535 * modules/shadow.c: Ditto.
8536 * modules/stdlib.c: Ditto.
8537 * modules/time.c: Ditto.
8538 * src/freeze.c: Ditto.
8539 * src/main.c: Ditto.
8541 2001-08-17 Gary V. Vaughan <gary@gnu.org>
8543 * m4/module.c: Fixup some errors in the description comment.
8545 2001-08-17 Akim Demaille <akim@epita.fr>
8547 * tests/others.at (iso8859): Specify the path to the M4 test file.
8548 * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
8549 files in error messages.
8551 2001-08-17 Akim Demaille <akim@epita.fr>
8553 * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
8554 * tests/others.at: Adjust input files paths.
8555 * tests/atconfig.in: Set top_builddir.
8556 * tests/Makefile.am: Adjust.
8557 `testsuite' is in src, not build.
8559 2001-08-17 Akim Demaille <akim@epita.fr>
8561 * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
8562 (generate.at): Install a temporary hack until the actual
8563 generate.awk is added to the repository.
8564 * tests/atconfig.in: New.
8566 2001-08-17 Akim Demaille <akim@epita.fr>
8568 Really apply the patch ``Drop Autoconf 2.13 compatibility.''
8570 2001-08-17 Akim Demaille <akim@epita.fr>
8572 * doc/m4.texinfo: Promote proper quotation.
8574 2001-08-17 Akim Demaille <akim@epita.fr>
8576 Remove the non Autotest tests.
8578 * tests/other-tests/capitalize.test,
8579 * tests/other-tests/changeword.test,
8580 * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
8581 * tests/other-tests/debug.test,
8582 * tests/other-tests/discard-comments.m4,
8583 * tests/other-tests/discard-comments.test,
8584 * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8585 * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8586 * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8587 * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
8588 * tests/other-tests/hanoi.test,
8589 * tests/other-tests/import-environment.m4,
8590 * tests/other-tests/import-environment.test,
8591 * tests/other-tests/include.test, tests/other-tests/indir.test,
8592 * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
8593 * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
8594 * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
8595 * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
8596 * tests/other-tests/modtest.test,
8597 * tests/other-tests/multiquotes.test,
8598 * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
8599 * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
8600 * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
8601 * tests/other-tests/sync-lines.m4,
8602 * tests/other-tests/sync-lines.test,
8603 * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8604 * tests/other-tests/translit.test, tests/other-tests/undivert.test,
8605 * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8606 * tests/other-tests/wrap.test: Remove.
8608 * tests/run-test, tests/get-them: Remove.
8609 * tests/Makefile.am: Adjust.
8611 2001-08-17 Akim Demaille <akim@epita.fr>
8613 others.at no longer depends on other-tests/.
8615 * tests/others.at (stackovf): You're actually...
8617 (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
8618 (unload.test): Keep their authorship.
8619 (discard-comments, gmp, import-environment, modfreeze)
8620 (sync-lines): Embed the input files.
8621 * tests/stackovf.test: Copy from other-tests/stackovf.test.
8622 * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
8624 2001-08-17 Akim Demaille <akim@epita.fr>
8626 * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
8627 (M4exit): Tag the exit status of the example.
8628 * tests/get-them: Adjust.
8629 * tests/generate.awk: New, based on get-them.
8630 * tests/Makefile.am: Adjust to generate `generated.at'.
8631 * tests/testsuite.at: Adjust.
8632 (AT_CHECK_M4): Don't overquote. Blush...
8634 2001-08-17 Akim Demaille <akim@epita.fr>
8636 Start using Autotest. atconfig creation is still lacking.
8638 * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
8639 * examples/reverse.m4, tests/other-tests/import-environment.m4,
8640 * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
8641 * tests/other-tests/import-environment.test: Don't check LANGUAGE
8642 as it might be `unset', or set to `C'.
8643 * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
8644 * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8645 * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8646 * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
8647 * tests/other-tests/shadow.test: Adjust.
8648 * tests/testsuite.at, tests/others.at: New.
8649 * tests/Makefile.am: Adjust.
8651 2001-08-17 Akim Demaille <akim@epita.fr>
8653 Drop Autoconf 2.13 compatibility.
8655 * configure.in (changeword): No need to undefine it, as anyway if
8656 it's defined, M4sugar moved it as m4_changeword.
8657 And anyway, proper quotation is enough.
8658 (m4_pattern_allow): As it exists in 2.50, just use it.
8659 (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
8660 Don't handle Gettext's duties, let it handle them.
8661 * config/gnu-obstack.m4: Use m4_pattern_allow directly.
8663 2001-08-17 Akim Demaille <akim@epita.fr>
8665 * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
8666 (m4_errprint): Use fputs.
8667 * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
8668 dumpdef are not concerned.
8669 (Dumpdef, Errprint): Emphasize their insensitivity to
8671 * doc/Makefile.am: Add `TAGS' support.
8672 (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
8674 * config/Makefile.am (MAINTAINERCLEANFILES): New.
8676 2001-08-17 Akim Demaille <akim@epita.fr>
8678 * modules/Makefile.am (ETAGS_ARGS): New.
8680 2001-08-17 Akim Demaille <akim@epita.fr>
8682 * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
8685 2001-08-17 Akim Demaille <akim@epita.fr>
8687 * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
8689 2001-08-17 Akim Demaille <akim@epita.fr>
8691 * m4/m4module.h (m4/list.h): Don't include it.
8693 2001-08-16 Gary V. Vaughan <gary@gnu.org>
8695 m4_modules are no more, we use lt_dlhandles directly and let
8696 latest libltdl features manage the list of loaded modules.
8697 * acinclude.m4: Regenerated.
8698 * m4/ltdl.c: Updated from master copy.
8699 * m4/module.c: Reimplemented to take advantage of advances in
8701 * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
8702 list with lt_dlhandle_next.
8703 (m4_builtin_find_by_func): Ditto.
8704 (m4_builtin_table_install): Use lt_dlhandle.
8705 (m4_macro_define): Ditto.
8706 (m4_macro_table_install): Ditto.
8707 m4/module.h: Prototype new module management API.
8708 (m4_modules): No longer required.
8709 (m4_module_init_t, m4_module_finish_t): POSIX namespace
8710 violations, renamed to...
8711 (m4_module_init_func, m4_module_finish_func): ...these,
8713 (M4INIT_HANDLER): Clean way to declare init functions in modules.
8714 (M4FINISH_HANDLER): And similarly for finish functions.
8715 * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
8716 -- Add indirection to the CONC macro so that arguments are
8718 * modules/modtest.c (m4_init_module): Replaced with M4INIT_HANDLER.
8719 * modules/shadow.c (m4_init_module): Ditto.
8720 Due to new init function semantics, be careful to perform the
8721 initialisation only on first load.
8722 * modules/perl.c (m4_init_module): Ditto. And Ditto.
8723 (m4_finish_module): Replaced with M4FINISH_HANDLER.
8724 Due to new finish function semantics, be careful to perform the
8725 finalisation only on first load.
8726 * m4/m4private.h (m4_module): Removed in favour of...
8727 (m4_module_data): ...structure without all the wrapper fields.
8728 Instances of this new structure are stored associated lt_dlhandles
8729 with lt_dlcaller_data_set().
8730 * m4/builtin.c (m4_builtin_define): Takes a handle argument
8731 instead of the old module argument.
8732 (m4_builtin_table_install): Ditto.
8733 * modules/load.c (m4_resident_module): Removed. This is no
8734 longer implemented as a magic symbol...
8735 * modules/m4.c (m4_resident_module): Ditto.
8736 * modules/load.c (M4INIT_HANDLER): ...the module init function now
8737 uses the ltdl api to make the module resident.
8738 * modules/m4.c (M4INIT_HANDLER): Ditto.
8739 * modules/load.c (builtin_modules): Traverse the loaded module
8740 list with lt_dlhandle_next.
8741 (builtin_load): Much simplified in light of the reimplemented
8743 * src/freeze.c (produce_module_dump): Cleaned up and optimised in
8744 light of the m4/module.c rewrite.
8745 (produce_symbol_dump): Ditto.
8746 (reload_frozen_state): Ditto.
8747 * m4/list.c, m4/list.h: Files deleted. No longer required.
8748 * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
8749 (libm4_la_SOURCES): Delete list.c reference.
8750 * m4/m4private.h (m4_token_data): Add a handle field. This
8751 eliminates many of the searches to find the handle associated with
8752 various tokens that are passed between functions.
8753 (struct m4_symbol): Removed the module field. The
8754 module association does not belong with the symbol...
8755 * m4/input.c (struct m4_builtin): ...it belongs with the builtin
8756 that the module implementation code is from. Added a handle
8758 (m4_push_macro): Add a `handle' argument. Changed all callers.
8759 (init_macro_token): Set the `handle' field for the
8761 * m4/macro.c (expand_argument): Copy the new handle field during
8763 * modules/m4.c (macro_install): Use the new handle field to
8764 optimise the search for the correct builtin structure, and pass
8765 the handle details to m4_builtin_define.
8767 2001-08-15 Akim Demaille <akim@epita.fr>
8769 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
8770 when creating `m4/obstack.h'.
8771 * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
8773 * tests/defs: Make them absolute.
8774 (CDPATH) Neutralize.
8775 * tests/gethem: Use them.
8777 2001-08-14 Gary V. Vaughan <gary@gnu.org>
8779 * config/ltmain.sh: Doh! Import again for a quoting fix that
8780 prevented any regression test from passing.
8782 * m4/m4module.h (obstack.h): Choose between installed version
8783 and shipped version based on configure tests.
8784 * src/freeze.c (obstack.h): Ditto.
8786 * acconfig.h: Removed. No longer required.
8788 * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
8789 * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
8790 them to AC_INIT and AM_INIT_AUTOMAKE.
8791 * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
8792 disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
8793 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
8794 shell variable m4_cv_func_obstack_h.
8795 * tests/defs (M4): Be more careful about relative path to libtool
8796 script and m4 binary by using $srcdir.
8798 * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
8799 optargs to the existing libltdl search path.
8800 * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
8801 * m4/ltdl.c: Updated.
8803 * config/ltmain.sh: Ditto.
8805 2001-08-11 Gary V. Vaughan <gary@gnu.org>
8807 * src/main.c (main): Add `-b' (for `batch') mode switch to force
8808 interactive mode off.
8810 2001-08-10 Akim Demaille <akim@epita.fr>
8812 * configure.in: Require Autoconf 2.52.
8813 (AC_ARG_PROGRAM): Remove, handled by Automake.
8814 (m4_getopt): Rename as...
8815 (m4_getopt_h): this.
8816 Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
8817 Undefine `changeword' only if defined.
8818 * config/gnu-obstack.m4: Require Autoconf 2.52.
8819 (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
8822 2001-08-09 Yuji Minejima <ggb01164@nifty.ne.jp>
8824 * doc/m4.texinfo: Fix some typos, and apply some small
8827 2001-08-09 Andreas Schwab <schwab@suse.de>
8829 * src/main.c (main): Fix improper uses of error (missing format
8832 2001-08-07 Akim Demaille <akim@epita.fr>
8834 Improve `make distcheck'.
8836 * configure.in: Be sure to be able to run `mkconfig.sh' when src
8838 * Makefile.am (dist-hook): Remove, as it is no longer needed.
8839 * doc/m4.texinfo (Include): Add missing blank.
8840 * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
8843 2001-08-07 Akim Demaille <akim@epita.fr>
8845 * m4/evalparse.c: A better introductory comment.
8846 * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
8847 * m4/macro.c: Adjust old comments.
8848 * modules/README: Typo.
8850 2001-08-07 Akim Demaille <akim@epita.fr>
8852 * config/gnu-obstack.m4: New.
8854 2001-08-07 Akim Demaille <akim@epita.fr>
8856 * config/Makefile.am, config/stackovf.m4: New.
8857 * configure.in, Makefile.am: Adjust.
8859 2001-08-05 gettextize <bug-gnu-utils@gnu.org>
8861 * po/Makefile.in.in: Upgrade to gettext-0.10.39.
8862 * po/cat-id-tbl.c: Remove file.
8863 * po/stamp-cat-id: Remove file.
8865 2001-04-08 Roderick Koehle <Roderick.Koehle@infineon.com>
8867 * modules/format.c (format): Formatting for %f was not
8868 interpreting the position of the decimal point correctly for
8871 2000-12-01 Gary V. Vaughan <gary@gnu.org>
8873 * TODO: Removed m4exit bug.
8874 * modules/load.c (m4_resident_module): Make this module resident.
8875 * module/m4.c (m4_resident_module): Ditto.
8876 * m4/modules.c (m4_module_load): Use new ltdl resident modules
8877 feature to mark modules as resident if they export
8878 `m4_resident_module' as TRUE.
8879 (m4_module_unload): Do not remove resident modules, and take care
8880 with symbol insertion and deletion with resident modules.
8881 * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
8882 use resident modules feature.
8884 2000-11-30 Gary V. Vaughan <gary@gnu.org>
8886 * TODO: Updated. Removed some cruft that has since been fixed
8887 or implemented. Added some more entries.
8890 * modules/README: Updated.
8891 * doc/m4.texinfo: Updated.
8893 * modules/gnu.c (builtin_functions): Make indir orthogonal to
8894 builtin, in that each is recognised as a macro only with parameters
8895 (builtin_indir): Passing 0 arguments is now an error, as with
8898 * src/main.c (usage): Added missing description of `-c' option.
8900 2000-11-29 Gary V. Vaughan <gary@gnu.org>
8902 Consolidate the myriad of dispersed test scripts into the
8903 tests subdirectory. I think I now have all the file where I
8904 want them, so there shouldn't be anymore upheaval =)O|
8906 * tests/Makefile.am: Updated to run the new tests added below.
8907 * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
8908 tests/other-tests/ddivert.test, tests/other-tests/debug.test,
8909 tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8910 tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8911 tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8912 tests/other-tests/hanoi.test, tests/other-tests/include.test,
8913 tests/other-tests/indir.test, tests/other-tests/misc.test,
8914 tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
8915 tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8916 tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8917 tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
8918 tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
8919 tests/other-tests/reverse.test, tests/other-tests/shadow.test,
8920 tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8921 tests/other-tests/translit.test, tests/other-tests/undivert.test,
8922 tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8923 tests/other-tests/wrap.test: New tests based on the contents
8924 of the tests removed below.
8925 * examples/Makefile.am, modules/Makefile.am: Updated to
8926 reflect removed tests.
8927 * examples/defs,modules/defs: Removed.
8928 * examples/capitalize.test, examples/comments.test,
8929 examples/ddivert.test, examples/debug.test,
8930 examples/esyscmd.test, examples/exp.test,
8931 examples/foreach.test, examples/forloop.test,
8932 examples/fstab.test, examples/hanoi.test,
8933 examples/include.test, examples/indir.test,
8934 examples/misc.test, examples/multiquotes.test,
8935 examples/patsubst.test, examples/pushpop.test,
8936 examples/regexp.test, examples/reverse.test,
8937 examples/sysv-args.test, examples/trace.test,
8938 examples/translit.test, examples/undivert.test,
8939 examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
8940 modules/modpath1.test, modules/modpath2.test,
8941 modules/modpath3.test, modules/modpath4.test,
8942 modules/modtest.test, modules/shadow.test,
8943 modules/unfrozen.m4, modules/unload.test: Removed.
8945 Move the implementation of GMP support for the mpeval() builtin
8946 into a loadable module that depends on libgmp. mpeval() and
8947 eval() share a common parser, now in m4/evalparser.c; the code
8948 in m4/numb.c and m4/numb.h is now physically split between
8949 m4/eval.c (the eval() backend) and modules/mpeval.c (the
8950 mpeval() backend), rather than being differentiated by cpp
8951 macros and multiple inclusion. The mpeval module is always
8952 built but will generate an diagnostic if it is used from an
8953 installation that didn't link in the gmp library.
8954 * modules/Makefile.am: build and install the new mpeval module.
8955 * modules/mpeval.c: Now contains the former parts of m4/numb.c
8956 and m4/numb.h that are required for gmp support in mpeval().
8957 * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
8958 * m4/evalmp.c: Removed.
8959 * m4/m4module.h: Removed conditional prototype for
8961 * m4/eval.c: Rewritten. Contains the former parts of m4/numb.c
8962 and m4/numb.h that do not rely on gmp.
8963 * m4/evalparse.c: New file, contains the shared parts of the
8964 eval() and evalmp() parser implementations, and is no longer
8965 unencumbered by cpp magic to uncover the right parts.
8966 * m4/numb.h: Removed. It's former contents are split between
8967 m4/eval.c and modules/mpeval.c.
8970 * tests/other-tests/changeword.test: New test. Rudimentary
8971 testing of changeword builtin runs only if --wnable-changeword
8972 was used at configure time.
8973 * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
8974 alternation correctly. Split into two expressions to compensate.
8975 * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
8976 * modules/Makefile.am: Build changeword module.
8977 * modules/changeword.c (m4_macro_table): Define __m4_changeword__
8978 only when --enable-changeword was passed to configure.
8979 (builtin_changeword): If --enable-changeword was not used, then
8980 report that changeword() builtin has no support in m4 binary.
8982 2000-11-28 Gary V. Vaughan <gary@gnu.org>
8984 * src/main.c (main): Fixed a particularly nasty bug is
8985 user_search_path setting -- the -M flag processing must be
8986 extremely careful with search path ordering, or else the default
8987 installed module directory (possibly containing modules from a
8988 previous release) is placed earlier in the search path than any -M
8989 arguments (which are relied upon to load uninstalled modules with
8990 most of the tests in the regresion suite).
8992 * modules/load.c (builtin_load): Nasty hack to prevent adding
8993 symbols to symtab again if a module is loaded more than once.
8994 * modules/m4.c (builtin_ifelse): removed unused variable argv0.
8996 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed a
8997 possible NULL pointer dereference.
8999 * m4/module.c (m4_module_find_by_modname): Renamed from
9000 m4_module_modname_find. Fixed all references.
9001 (m4_module_find_by_builtin): New function.
9003 * modules/modfreeze.test: load the `load' module with each
9005 * src/freeze.c (produce_frozen_state): Simplified in light of
9006 module field in m4_symbol. Allow a third argument for text macros
9007 to name the originating module.
9008 (reload_frozen_state): ditto.
9009 * m4/m4module.h: Fixup prototypes.
9010 * m4/builtin.h (m4_builtin_define): Add a module argument so
9011 that symbols can be registered against the defining module.
9012 (m4_macro_define): ditto.
9013 * m4/m4private.h (m4_symbol): Make the module field const to save
9014 on casting in the rest of the code.
9015 (SYMBOL_MODULE): New macro.
9017 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
9018 symbol reference maintenance bugs when removing a symbol from the
9021 * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
9023 2000-11-27 Gary V. Vaughan <gary@gnu.org>
9025 * configure.in (m4_cv_func_obstack): A better check for whether
9026 libc has an obstack implementation.
9027 * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
9029 * configure.in (--with-modules): Changed semantics. This
9030 option is now used to list modules to be preopened.
9031 * src/m4.h: #include "ltdl.h" unconditionally.
9032 * src/main.c: Removed all dependencies on WITH_MODULES.
9033 * src/freeze.c: ditto.
9034 * modules/Makefile.am: ditto.
9035 * m4/m4.c (builtin_m4exit): ditto.
9036 * modules/modpath1.test: ditto.
9037 * modules/modpath2.test: ditto.
9038 * modules/modpath3.test: ditto.
9039 * modules/modpath4.test: ditto.
9040 * modules/modtest.test: ditto.
9041 * modules/shadow.test: ditto.
9042 * modules/unload.test: ditto.
9044 * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
9045 comes up on demand in LTLIBOBJS now.
9046 * configure.in (getopt_long): Creating and relying on a link for
9047 getopt.h on hosts with no getopt_long() of thier own works
9048 correctly now. This is necessary so that callers of getopt_long()
9049 can simply `#include <getopt.h>': the naive way of doing this
9050 would end up using our own getopt.h and the installed
9051 getopt_long(), which is asking for trouble!
9052 (obstack_init): A similar argument applies to obstack.h and
9055 * m4/ltdl.c: Upgraded to latest bleeding edge version again.
9056 On Solaris-2.5 (at least) the native dlopen implementation
9057 gets confused about m4.o when looking for module "m4". This
9058 version always looks for .la an .$lib_ext suffixed names first
9059 to work around the problem. Sigh.
9061 * po/POTFILES.in: Take account of these file movements.
9062 * src/Makefile.am (m4_SOURCES): removed eval.c.
9063 (EXTRA_m4_SOURCES): removed numb.c and numb.h.
9064 * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
9065 (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
9066 * modules/m4.c (builtin_eval): Use m4_evaluate().
9067 * m4/eval.c: Moved here from src/eval.c to facilitate
9068 implementation of eval() builtin as part of the `m4' loadable
9070 (m4_evaluate): renamed from evaluate for namespace cleanliness.
9071 * m4/numb.c: Moved here from src/numb.c, since it is #included
9072 into eval.c at compile time.
9073 * m4/m4module.h (m4_evaluate): Added prototype.
9074 * src/m4.h (evaluate): Removed prototype.
9076 2000-11-25 Gary V. Vaughan <gary@gnu.org>
9078 * modules/perl.c (builtin_perleval): Use PL_na for
9079 compatibility with perl-5.6.
9081 * src/main.c (main): It is now safe to
9082 ``m4_module_install("m4")'', without tripping over the m4
9084 * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
9085 versions having fixed the insidious module search order bug.
9087 * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
9088 supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
9090 * configure.in: Figure out whether to use the installed
9091 getopt.h or the supplied one.
9092 * src/Makefile.am: ditto.
9094 * po/POTFILES.in: List files in their new positions.
9096 * config/ltmain.sh: This needs to be checked in to match the
9097 libtool macros copied to acinclude.m4 (until a released
9098 libtool copes with m4's needs).
9099 * bootstrap: Run gettextize.
9101 2000-11-24 Gary V. Vaughan <gary@gnu.org>
9103 * AUTHORS: Added my details.
9106 * bootstrap: temporary update until released libtool catches up.
9108 * All files: Use new GNU GPL copyright blurb with current contact
9111 * configure.in (LTLIBOBJS): Use canonical code for calculation of
9114 * config: renamed acm4 directory to config to be more like
9115 other autoconfiscated packages.
9117 * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
9118 * config/debug.m4: New file implementing configure macros to add
9119 suitable debug flags to the compiler invocation.
9121 * modules/load.c: New file implementing the ``load'' and
9122 ``unload'' builtins.
9123 * tests/get-them: Set the module search directory to the modules
9124 build directory in generated tests.
9125 * modules/shadow.test: ditto.
9126 * modules/modtest.test: ditto.
9127 * modules/modpath1.test: ditto.
9128 * modules/modpath2.test: ditto.
9129 * modules/modpath3.test: ditto.
9130 * modules/modpath4.test: ditto.
9131 * modules/modtest.test: ditto.
9132 * modules/modfreeze.test: ditto.
9133 * modules/unload.test: ditto.
9135 * modules/changeword.c: New file implementing the ``changeword''
9136 builtin as a loadable module.
9137 * modules/mpeval.c: New file implementing the ``mpeval'' builtin
9138 as a loadable module.
9140 * src/main.c (main): Load the gnu module if m4 was started
9141 normally -- i.e. without the -G option.
9142 * modules/gnu.c: New file implementing a new loadable module wuth
9143 definitions for all the gnu extension builtins.
9144 * modules/format.c: Moved here from src/format.c. Now included
9147 * src/main.c (main): Load the traditional module if m4 was
9148 started in `no_gnu_extensions' mode.
9149 * modules/traditional.c: New file implementing the ``unix'' macro,
9150 required when m4 is executed in traditional mode, as a loadable
9153 * src/main.c: Renamed from m4.c to avoid confusion with
9155 (main): Always load the m4 module.
9156 * modules/m4.c: New file implementing a new loadable module with
9157 definitions for all m4 builtins that are not gnu extensions.
9159 * m4/Makefile.am: Adjusted to take new files below into account.
9160 * m4/m4module.h: Prototypes for exported functions and types moved
9161 to this directory from the src directory.
9162 * m4/m4private.h: Moved here from src/m4private.h to facilitate
9163 the migration of all builtin implementations to loadable modules.
9164 * m4/macro.c: Moved this file here from the src directory,
9165 renaming all exported symbols to use the prefix ``m4_''.
9166 * m4/builtin.c: ditto.
9167 * m4/module.c: ditto.
9168 * m4/symtab.c: ditto.
9169 * m4/debug.c: ditto.
9170 * m4/input.c: ditto.
9171 * m4/output.c: ditto.
9173 * m4/ltdl.h, m4/ltdl.c: ditto.
9174 * m4/utility.c: Odd functions moved here from files in the src
9175 directory to facilitate builtin migration.
9177 2000-08-12 Gary V. Vaughan <gary@gnu.org>
9179 * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
9180 error message, to make translators' jobs a little easier.
9181 (builtin_builtin): ditto.
9182 (builtin_traceon): ditto.
9183 (builtin_traceoff): ditto.
9184 Reported by Akim Demaille <akim@epita.fr>
9186 * m4/Makefile.am (pkgincdir): Deleted. Use automake's built in
9187 pkgincludedir instead.
9189 * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
9190 it is exported globally. Fixed all references.
9194 (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
9195 globally. Fixed all references.
9196 (DEF_LQUOTE): ditto.
9200 2000-07-28 Gary V. Vaughan <gary@gnu.org>
9205 * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
9206 (AC_OUTPUT): touch stamp-h.in, not stamp-h.
9208 * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
9209 Removed `Prev', `Next' and `Up' fields of all @nodes now that
9210 makeinfo calculates them for us, and to make any future
9211 reorganisation easier.
9212 (Frozen files): Document format version 2.
9213 `V' now takes argument `2'.
9214 `F' can take a single argument if symbol and builtin names
9215 are the same, or 3 arguments if the builtin is from a module.
9216 New `S' specification for saving syntax table contents.
9217 New `M' specification for saving loaded module names.
9218 * src/freeze.c: Implement them.
9219 * src/input.c (syntax_code): For interpreting frozen syntax
9222 * examples/Makefile.am: Add the contents of the WWW directory to
9224 * examples/WWW/Makefile: ditto,
9225 (%.htm): Compares file contents (not just sizes) to determine
9226 whether a change has occured.
9227 * examples/WWW/_header.htm: Bumped version number.
9228 * examples/WWW: Regenerated content.
9230 * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
9231 compilers comes much easier without ansi2knr.
9232 * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
9234 * m4/list.c: New generic list container type.
9235 * m4/list.h: Interface to new container type.
9236 * m4/Makefile.am (pkginc_HEADERS): Install list.h.
9237 (libm4_la_SOURCES): compile and link list.c.
9238 * src/builtin.c (builtin_tables): Use list container.
9239 * src/module.c (symtab): ditto.
9240 * src/symtab.c (symtab): ditto.
9242 * m4/system.h: New file for common preprocessor definitions.
9243 * m4/Makefile.am (pkginc_HEADERS): install system.h.
9244 * m4/error.c: Use system.h in place of inline preprocessor.
9245 * m4/error.h: ditto.
9246 * m4/module.c: ditto.
9247 * m4/module.h: ditto.
9248 * m4/xmalloc.c: ditto.
9250 * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
9252 * m4/xmalloc.c (xmalloc_exit_failure): ditto.
9254 * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
9255 it is exported globally. Fixed all references.
9257 (module_init_t): ditto.
9258 (module_finish_t): ditto.
9259 (token_data): ditto.
9260 (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
9261 it is exported globally. Fixed all references.
9262 (SYNTAX_IGNORE): ditto.
9263 (SYNTAX_SPACE): ditto.
9264 (SYNTAX_OPEN): ditto.
9265 (SYNTAX_CLOSE): ditto.
9266 (SYNTAX_COMMA): ditto.
9267 (SYNTAX_DOLLAR): ditto.
9268 (SYNTAX_ACTIVE): ditto.
9269 (SYNTAX_ESCAPE): ditto.
9270 (SYNTAX_ALPHA): ditto.
9271 (SYNTAX_NUM): ditto.
9272 (SYNTAX_ALNUM): ditto.
9273 (SYNTAX_LQUOTE): ditto.
9274 (SYNTAX_RQUOTE): ditto.
9275 (SYNTAX_BCOMM): ditto.
9276 (SYNTAX_ECOMM): ditto.
9277 (SYNTAX_VALUE): ditto.
9278 (SYNTAX_MASKS): ditto.
9296 (TOKEN_NONE): ditto.
9297 (TOKEN_STRING): ditto.
9298 (TOKEN_SPACE): ditto.
9299 (TOKEN_WORD): ditto.
9300 (TOKEN_SIMPLE): ditto.
9301 (TOKEN_MACDEF): ditto.
9303 * m4/m4module.h (voidstar): Removed in favour of `VOID' for
9304 consistency. Fixed all references.
9305 (STRING): Renamed to `m4_string' for consistency, and because if
9306 is exported globally. Fixed all references.
9307 (token_type): Renamed to `m4_token_t' for the same reasons.
9308 (token_data_type): Renamed to `m4_token_data_t' for the same
9311 * m4/m4module.h (XCALLOC): Wrapper macro which handles type
9315 (XFREE): Wrapper macro which avoids freeing NULL pointers.
9317 * m4/m4module.h (m4_macro): New type for module defined user
9319 * modules/modtest.c (m4_macro_table): Define module user macros.
9320 * modules/shadow.c (m4_macro_table): ditto.
9322 * m4/m4module.h (M4BUILTIN_HANDLER): For defining handlers
9323 declared with M4BUILTIN.
9325 * m4/xmalloc.c: Use memset if bzero is not available when
9326 emulating calloc with malloc.
9327 (xcalloc): Fallback to malloc/bzero if calloc is not available.
9328 (xfree): Added for consistency. Will not try to free NULL
9330 * src/m4.c (xfree): Deleted in favour of the above.
9331 * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
9332 linking with libdmalloc.
9333 * m4/xstrdup.c (WITH_DMALLOC): ditto.
9335 * modules/frozen.m4: New test case.
9336 * modules/unfrozen.m4: ditto.
9337 * modules/modfreeze.test: New test.
9338 * modules/unload.test: ditto.
9339 * modules/Makefile.am (EXTRA_DIST): Distribute them.
9341 * modules/modpath1.test: Don't try this test if module support is
9343 * modules/modpath2.test: ditto.
9344 * modules/modpath3.test: ditto.
9345 * modules/modpath4.test: ditto.
9346 * modules/modtest.test: ditto.
9347 * modules/shadow.test: ditto.
9349 * modules/perl.c: New module.
9350 * modules/perl.m4: Example of using it.
9351 * modules/Makefile.am (perl_la_SOURCES): Build new perl module.
9353 * src/m4.c (main): Assume interactive mode if STDIN is connected
9355 Changed startup sequence slightly so that syntax is not
9356 initialised from here when loading a frozen file.
9358 * src/builtin.c: Much improved macro definition style.
9359 * src/m4private.h: Internal structures for m4_builtin and
9360 m4_macro instances. These are not exposed to module writers.
9361 * src/module.c (module_modname_find): Find a module structure
9363 (make_macro_table): Build an internal macro table from a external
9365 (make_builtin_table): Build an internal builtin table from an
9366 external definition.
9368 * src/module.c (module_unload): Be extremely careful to remove
9369 builtins and macros that match the module being unloaded -- no
9370 longer assume that the top element can be removed incase another
9371 odule defines an identical name.
9372 * src/symtab.c (remove_table_reference_symbols): remove all symbol
9373 table entries which refer to a given builtin table.
9374 * src/builtin.c (remove_tables): Use it!
9376 2000-07-13 Thomas Tanner <tanner@ffii.org>
9378 * Makefile.am (SUBDIRS): we need modules/ for "make dist"
9379 * acm4/modules.m4: deleted
9380 * bootstrap: don't libtoolize libltdl!
9381 * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
9382 if set, enable WITH_MODULES and add modules to DLPREOPEN
9383 * examples/misc.test: redirect standard output
9384 * lib/Makefile.am: don't use DLLDFLAGS
9385 * lib/m4module.c: include necessary headers to silence GCC -Wall
9386 * lib/m4regex.c: fixes to silence GCC -Wall
9387 * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
9388 build modules conditionally
9389 * modules/shadow.c: define symbol aliases before using them
9390 * modules/test.c: define symbol aliases before using them
9391 * po/de.po: update translation
9392 * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
9393 pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
9395 * src/m4.c: initialize libltdl's preloaded symbols via
9396 LTDL_SET_PRELOADED_SYMBOLS
9397 * src/module.c: libltdl's memory management must be initialized
9398 before calling lt_dlinit!, fix warnings
9400 2000-01-18 Gary V. Vaughan <gary@gnu.org>
9402 * README: Caveat about nls not supported by dll architecture on
9405 * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
9407 * tests/Makefile.am (stamp-TESTS): now works with VPATH.
9408 * src/Makefile.am (m4_LDADD): use $(builddir) for VPATH.
9409 * modules/Makefile.am (LIBS): ditto.
9410 (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
9411 $(top_srcdir)/m4 (for only <m4module.h>).
9412 * modules/shadow.test: fixed for VPATH.
9413 * modules/modtest.test: ditto.
9414 * modules/modpath4.test: ditto.
9415 * modules/modpath3.test: ditto.
9416 * modules/modpath2.test: ditto.
9417 * modules/modpath1.test: ditto.
9419 * modules/time.test: Removed due to timezone dependence,
9420 * modules/Makefile.am (TESTS): Removed time.test.
9422 * configure.in: Use $3 of AC_DEFINE so that we can,,,
9423 * acconfig.h: Remove everything except the gettext parameters.
9424 * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
9426 * acm4/ltdl.m4: Updated to latest from libtool cvs.
9427 * acm4/modules.m4: Remove code which duplicates ltdl.m4 and
9428 increment serial number.
9430 * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
9431 src dir and immediately after libm4 is built for confidence that
9432 it doesn't rely on the src directory.
9433 (SUBDIRS): Moved doc dir to the end since helptoman.pl and
9434 makeinfo stop the build on cygwin (because they don't work).
9436 * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
9438 * m4/m4private.h: ...is not a public header, so moved to src.
9439 Add `#include <config.h>', `#define _COMPILING_M4' and
9441 * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
9442 * src/Makefile.am (noinst_HEADERS): add m4private.h.
9443 * src/builtin.c: `#include "m4private.h"' now takes care of the
9444 above. Duplicates removed.
9445 * src/debug.c: ditto.
9446 * src/eval.c: ditto.
9447 * src/evalmp.c: ditto.
9448 * src/format.c: ditto.
9449 * src/freeze.c: ditto.
9450 * src/input.c: ditto.
9452 * src/macro.c: ditto.
9453 * src/module.c: ditto.
9454 * src/numb.h: ditto.
9455 * src/output.c: ditto.
9456 * src/path.c: ditto.
9457 * stackovf.c: ditto.
9460 * po/POTFILES.in: compensate for renaming of lib/*.
9461 * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
9462 (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
9463 and then in $(top_srcdir)/lib (for eg. "m4private.h").
9464 * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
9466 * m4/m4error.h: Renamed error.h, for installation to
9467 $prefix/include/m4..
9468 * m4/m4obstack.h: Renamed obstack.h, for same reason.
9469 * m4/m4regex.h: Renamed regex.h, for same reason.
9470 * m4/m4error.c: Renamed error.c, and use #include "error.h".
9471 * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
9472 * m4/m4regex.c: Renamed regex.c, and fix #includes.
9474 * lib: moved to m4 to easily support header installation to
9476 * Makefile.am (SUBDIRS): renamed lib dir to m4.
9477 * configure.in (AC_OUTPUT): reference m4/Makefile.in.
9478 * acm4/regex.m4: Point to m4/regex.c.
9480 * examples/foreach.m4: Sanitise quoting.
9481 * examples/foreach.test: New torture test.
9482 From Akim Demaille <akim@epita.fr>
9484 2000-01-17 Gary V. Vaughan <gary@gnu.org>
9486 * src/ltdl.c: Use access() to abort doomed module load attempts
9487 if module file does not exist.
9489 * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
9490 getopt1.o will already be used if appropriate, so I moved getopt.c
9491 and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
9493 * modules/modpath1.test: Use correct filename in header line.
9494 * modules/modpath2.test: ditto.
9495 * modules/modpath3.test: ditto.
9496 * modules/modpath4.test: ditto.
9498 Without these changes lt_dlopen("test") attempts to
9499 LoadLibrary("/bin/test") on Windows, which although harmless
9500 generates a spurious error message which spoils most of the tests:
9501 * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
9502 (TESTS): s/test.test /modtest.test /
9503 (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
9504 (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
9505 * modules/modpath1.test: s/test.m4 /modtest.m4 /
9506 * modules/modpath2.test: ditto.
9507 * modules/modpath4.test: ditto.
9508 * modules/modpath3.test: s/-m test /-m modtest /
9509 * modules/shadow.m4: use {un,}loadmodule(`modtest').
9511 2000-01-16 Gary V. Vaughan <gary@gnu.org>
9513 * src/ltdl.c (find_file): Updated to new version with fixed memory
9514 allocation bug in `next'.
9515 * src/ltdl.h: updated to match.
9517 * modules/Makefile.am: Cleaned up and reordered.
9519 2000-01-16 René Seindal <rene@seindal.dk>
9521 * modules/Makefile.am (TESTS): New tests for the module system.
9523 * modules/*.test: New files.
9525 * src/m4.c (main): Added call to module_init().
9526 Treats -M and -m as the arguments -D -U and -t, ie deferred.
9528 * src/m4.h: Added declaration of module_init().
9530 * src/module.c (module_init): No longer static
9532 * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
9533 Added to shut up automake about non standard libtool library
9536 * src/module.c: Disabled DEBUG by default.
9538 * modules/README: Changed example from unload.m4 to shadow.m4
9540 * modules/shadow.m4: Renamed from unload.m4
9542 * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
9544 * src/m4.c (main): Functionality for -m and -M were reversed.
9547 2000-01-12 Gary V. Vaughan <gary@gnu.org>
9549 * doc/help2man.pl: updated to version 1.020.
9551 * lib/COPYING.LIB: updated to version 2.1.
9553 * lib/m4module.h: restructure the M4_SCOPE code to work when
9554 creating a dll which links with libm4.la and both DLL_EXPORT
9555 (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
9558 2000-01-11 Gary V. Vaughan <gary@gnu.org>
9560 Merged the following changes from my tree:
9562 1999-06-15 Gary V. Vaughan <gary@gnu.org>
9564 * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
9565 ported to compile shared libs.
9567 * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
9568 use `__declspec(dllimport)' when linking libm4.la on win32.
9569 * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
9571 * configure.in (M4OBJS): Discover whether we need the shipped
9572 implementation of getopt_long.
9573 * src/Makefile.am (m4_LDADD): Link the getopt objects into the
9574 main binary here, as opposed to the module library in lib/libm4.la.
9576 1999-06-14 Gary V. Vaughan <gary@gnu.org>
9578 * modules/README: Updated to describe the improved libltdl based
9580 * README (cygwin): Added some compilation notes for building m4
9581 correctly under cygwin.
9582 * TODO: Cleaned out the entries for the module system since they
9583 are now implemented.
9585 * *.[ch]: __P is in the compiler's reserved namespace, so replaced
9586 all instances of __P with M4_PARAMS.
9588 * lib/getdate.h: removed unreferenced file.
9590 * lib/m4private.h: New file to define the private interface to the
9591 token_data struct, which must be shared between m4module.c, and
9592 builtin.c but not exported to modules built from the installed
9593 m4module.h since it's size changes depending on compile time
9596 * src/m4.h: Lots of stuff moved to lib/m4module.h.
9598 * lib/m4module.h: New file to define the interface available when
9599 compiling m4 modules.
9600 * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
9601 necessary for module compilation into this new file.
9603 * lib/Makefile.am (include_HEADERS): install headers (renamed to
9604 avoid nameclash with other system headers) necessary for compiling
9606 (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
9607 so that modules can include the (renamed) installed headers and
9608 be guaranteed a matching implementation.
9609 * lib/m4error.h: renamed from error.h.
9610 * lib/m4obstack.h: renamed from obstack.h.
9611 * lib/m4regex.h: renamed from regex.h.
9612 * configure.in (AC_REPLACE_FUNCS): Don't look for a system
9613 implementation, simply include the shipped version
9614 unconditionally, otherwise it is hard for a module to know
9615 whether the m4obstack.h header it is using matches the
9616 implementation it ends up linking against.
9617 (jm_WITH_REGEX): Include regex into libm4 unconditionally for
9620 1999-05-18 Gary V. Vaughan <gary@gnu.org>
9622 * examples/misc.test: Don't run this test on machines which don't
9623 have a root user in /etc/passwd (e.g. cygwin).
9625 * tests/get-them (/^@example$/): Error messages might have a
9626 ``.exe'' suffix to the program name, or else use the libtool
9627 ``.libs/lt-m4'' binary, or generally have an unexpected path. All
9628 of these cases are now catered for when comparing error messages
9630 * tests/other-tests/*.test: ditto.
9631 * examples/*.test: ditto.
9633 * tests/defs (M4): use libtool execute mode.
9634 * examples/defs (M4): ditto.
9636 * tests/get-them (END): explicitly close any open file.
9637 (printthem): In a regular expression, '{' is the start of a repeat
9638 count! Use `[{]' for a literal open brace.
9639 (/^@node /): Don't use substr on a string shorter than the trim
9642 1999-05-17 Gary V. Vaughan <gary@gnu.org>
9644 * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
9646 (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
9648 2000-01-10 Andreas Schwab <schwab@suse.de>
9650 * tests/other-tests/gmp.test: Find config.sh in build directory.
9652 * configure.in: Find tests/mkconfig.sh in $srcdir.
9654 * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
9655 <signal.h> (for SUS2 compliant systems).
9657 * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
9660 2000-01-10 René Seindal <rene@seindal.dk>
9664 * TODO, NEWS: Cleaned up and updated.
9666 * src/m4.c (main): New variable exit_status for exit status in
9667 case of unreadable files. Now m4 will exit with EXIT_FAILURE if a
9668 file cannot be read instead of EXIT_SUCCESS.
9670 * src/builtin.c (m4_indir): Changed error message to help
9671 translators (from Akim Demaille <demaille@inf.enst.fr>).
9673 * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
9676 * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
9679 * src/input.c (match_input): Reordering of code, to avoid multiple
9680 calls to push_string_init() from obstack_grow(), which can happen
9681 with some compilers (found and fixed by James Bonfield
9682 <jkb@mrc-lmb.cam.ac.uk>).
9684 * src/stackovf.c: Added prototypes for ultrix.
9685 (setup_stackovf_trap): Added __P to cast.
9686 (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
9688 2000-01-09 René Seindal <rene@seindal.dk>
9690 * doc/m4.texinfo (Changequote): Added comment about changing
9691 quotes when the old quote is a part of the new.
9693 * src/builtin.c (expand_ranges): Added break after trailing dash.
9694 This caused misbehavious on some systems (found and fixed by Akim
9695 Demaille <demaille@inf.enst.fr>).
9697 * AUTHORS: Thomas Tanner included
9699 * acconfig.h: Added entry for ss_sp (see below).
9701 * configure.in (use_stackovf): Added check for stack_t with member
9702 ss_base instead of ss_sp (BSDI notably). (Reported by Paul Eggert
9703 <eggert@twinsun.com>).
9705 * doc/m4.texinfo (Frozen files): Added a simpler example for
9706 generating frozen files from several input files.
9708 1999-11-14 Paul Eggert <eggert@twinsun.com>
9710 * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
9711 lib/regex.c, lib/xmalloc.c.
9713 1999-11-10 René Seindal <rene@seindal.dk>
9715 * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
9717 * src/module.c: reindented.
9718 (module_load): return if this is a repeated load of same module.
9719 (module_init): slight change of logic to avoid repeated
9720 initialisation debug messages.
9722 * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
9723 in the distribution.
9725 * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
9726 automake warnings about missing lib prefix.
9727 (time_la_LDFLAGS): ditto
9728 (stdlib_la_LDFLAGS): ditto
9730 1999-11-10 Paul Eggert <eggert@twinsun.com>
9732 * src/m4.h: Include error.h, since our macros use error.
9733 * src/m4.c: Don't need to include error.h.
9735 1999-11-09 Paul Eggert <eggert@twinsun.com>
9737 * src/m4.h (voidstar): Define to void * if __STDC__ is defined
9738 and zero, as Solaris 7 cc does.
9739 (bcopy): Remove macro; no longer needed with new obstack.h.
9741 * src/output.c (freeze_diversions): Don't assume that a
9742 diversion size can fit in `int'. Check for diversion file
9743 size too large to be printed with `unsigned long'.
9745 * src/Makefile.am (CFLAGS): Omit -Wall.
9747 * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
9749 * src/debug.c (trace_format):
9750 Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
9752 * src/freeze.c (produce_frozen_state):
9753 Don't assume string lengths fit in int.
9755 1999-10-13 René Seindal <rene@seindal.dk>
9757 * po/cs.po: Czech translation added.
9759 * po/sv.po: Updated Swedish translation.
9761 * po/ru.po: Updated Russian translation.
9763 * po/pl.po: Updated Polish translation.
9765 * po/el.po: Greek translation added.
9767 1999-10-13 René Seindal <rene@seindal.dk>
9769 * configure.in (ALL_LINGUAS): Added Greek translation (el).
9770 (ALL_LINGUAS): Added Czech translation (cs).
9772 1999-03-30 Gary V. Vaughan <gary@gnu.org>
9774 * src/builtin.c: moved module loading functions into...
9775 * src/module.c: entirely new implementation using libltdl.
9776 * po/POTFILES.in: added src/module.c.
9777 * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
9778 are modules, not linktime libraries.
9779 (LDFLAGS): added -no-undefined -module and -avoid-version flags.
9780 * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
9781 avoidance on exported symbols.
9782 * modules/test.c (m4_macro_table, m4_init_module,
9783 m4_finish_module): ditto.
9784 * modules/time.c (m4_macro_table): ditto.
9786 * modules/time2.m4: new file which requires command line loading
9788 * src/m4.c (--load-module): dynamically load named runtime module
9789 into running executable before reading the source.
9790 (--module-directory): prepend a directory to the module search
9792 (module_init()): Do this the first time we load a module instead;
9793 if the module subsystem is broken normal m4 scripts can still run.
9794 * src/m4.h (install_builtin_table): is now exported.
9796 1999-03-26 Gary V. Vaughan <gary@gnu.org>
9798 * src/module.c: removed. No longer required.
9799 * po/POTFILES.in: removed src/module.c.
9801 * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
9802 the bootstrap script can recreate.
9803 * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
9804 * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
9805 * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
9806 * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
9807 (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
9808 * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
9809 * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
9810 * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
9812 * acinclude.m4: removed. `aclocal -I acm4' handles this much
9814 * acm4/Makefile.am (ACINCLUDE_M4): ditto.
9815 * acm4/gettext.m4: removed. It causes a multiple definition vs.
9816 the installed gettext.m4 file when running aclocal.
9818 1999-03-25 Gary V. Vaughan <gary@gnu.org>
9820 * configure.in (AM_INIT_AUTOMAKE): bumped version number to
9821 distinguish this from the last prerelease.
9822 (AC_LIBLTDL_CONVENIENCE): build libltdl as a convenience library
9823 in its own subdirectory.
9825 * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
9826 lib prefix on a module" feature.
9827 (LDFLAGS): Added `-module -avoid-version' flags to build
9828 versionless module libraries.
9829 * src/builtin.c (m4_load_module): use libltdl.
9830 (module_unload_all): use libltdl.
9831 * src/m4.c (module_init): initialise module loading on demand for
9832 better diagnostics, and so that m4 will still work even if
9833 the module code is broken.
9834 * src/m4.h (module_init): removed. No longer relevant.
9835 * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
9836 exported symbols for compatibility with dlpreopening.
9837 * modules/test.c (m4_macro_table, m4_init_module,
9838 m4_finish_module): ditto.
9839 * modules/time.c (m4_macro_table): ditto.
9841 * bootstrap: New file. Runs all the autoutils in the right order
9842 after a fresh checkout, or a make maintainer-clean.
9844 1999-02-18 Akim Demaille <demaille@inf.enst.fr>
9846 * src/builtin.c (dump_symbols): New function, factoring common
9847 content of m4_dumpdef and m4_symbols.
9848 (m4_dumpdef): Use it.
9849 (m4_symbols): New function, implementing `symbols'. Use it.
9850 * doc/m4.texinfo: Fixed missing commas after @xref, so that the
9851 file compile with modern makeinfo.
9852 (Symbols): New node, documenting symbols.
9853 (direntry): Modernize.
9855 1998-12-11 René Seindal <rene@seindal.dk>
9857 * src/builtin.c (predefined_tab): New predefined macros
9858 __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
9859 configure time options.
9861 1998-12-01 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
9863 * src/module.c (module_try_load): Don't try to be clever and
9864 overwrite argument string. Instead allocate all constructed
9865 strings locally, since they can have arbitrary lengths. Make
9866 arguments pointers to const.
9867 (module_search): Simplify due to above change.
9869 1998-11-29 René Seindal <rene@seindal.dk>
9873 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
9875 * tests/other-tests/import-environment.{m4,test}: New test.
9877 * tests/other-tests/discard-comments.{m4,test}: New test.
9879 * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
9881 * src/m4.c (main): New option -c --discard-comments.
9882 New global variable discard_comments.
9884 * src/m4.h (token_type): New TOKEN_NONE for tokens to be
9885 discarded, ie never returned from next_token().
9886 Added declaration of discard_comments.
9888 * src/input.c (next_token): Now loops until token type is not
9889 TOKEN_NONE. Comments are now given this type when comments should
9892 * doc/m4.texinfo (Invoking m4): Updated for --import-environment
9895 1998-11-28 René Seindal <rene@seindal.dk>
9897 * src/m4.c (main): New option --import-environment (no single
9900 * When configured with --with-gmp both the normal (fast) eval()
9901 and the gmp aware mpeval() are defined. To restore previous
9902 bahaviour use "define(`eval', defn(`mpeval'))".
9904 * tests/other-tests/gmp.m4: Changed to use mpeval().
9906 * src/evalmp.c: New file for compiling eval.c as gmp aware.
9907 Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
9909 * src/eval.c: Now includes "numb.c" directly. Everything in this
9910 file must by static, except evaluate(), which is changed to
9911 mp_evaluate() if USE_GMP in force.
9913 * src/numb.c: Changed to be included by eval.c instead of being
9914 compiled separately. Everything is declared static.
9916 * src/numb.h: Removed declarations of functions, as numb.c is now
9919 * src/builtin.c: Declaration of m4_mpeval() added.
9920 Inserted `mpeval' in builtin table.
9921 (do_eval): New function with common code for m4_eval and m4_mpeval.
9922 (m4_mpeval): New function for gmp version of eval.
9924 * src/m4.h: Declaration of mp_evaluate().
9926 * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
9927 (EXTRA_m4_SOURCES): Now has numb.c and numb.h
9929 * src/m4.c (main): m4 --version also shows which options were used
9930 for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
9932 1998-11-27 René Seindal <rene@seindal.dk>
9934 * Error messages now always print program name before input file
9935 name as specified by GNU coding standards. Reported by Akim
9936 Demaille <demaille@inf.enst.fr>.
9938 * doc/m4.texinfo (Include): Change due to changed error message
9942 * tests/get-them: Minor change to sed script due to changed error
9945 * src/m4.c (print_program_name): New func used to print program
9946 name, input file and line number in error (). Used as an
9947 error_print_progname handler.
9948 (reference_error): Removed.
9949 (main): Assigns error_print_progname.
9951 * src/m4.h (M4ERROR): Removed reference_error ().
9953 1998-11-25 René Seindal <rene@seindal.dk>
9955 * Updated to libtool 1.2b.
9957 * src/builtin.c (install_builtin_table): Added braces to avoid
9958 warning of ambiguous 'else'.
9960 * src/module.c: Inserted search path code from path.c modified to
9962 (module_init): Configured default path used only if M4MODPATH is
9964 (module_try_load): Now reads libMODULE.la as generated by libtool
9965 for actual module name.
9966 (module_load): Gives better error messages on failure.
9968 * src/m4.h: Added declarations of structures and functions for
9969 generic search path handling.
9971 * src/path.c: Removed all module specific code and introduced new
9972 functions of more generic search path handling.
9974 1998-11-24 René Seindal <rene@seindal.dk>
9976 * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
9977 included gettext, as <libintl.h> might not be found
9978 otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
9980 1998-11-22 René Seindal <rene@seindal.dk>
9982 * src/output.c (insert_diversion): Fixed bug that might cause m4
9983 to read from standard output! Triggered by input
9984 'divert(1)undivert(0)'. Test for divnum>0 changed to divnum>=0,
9985 so now 'undivert(0)' does nothing.
9987 1998-11-18 René Seindal <rene@seindal.dk>
9991 * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
9992 could be changed when compiling a illegal regexp, causing later
9993 use of the regexp to dump core.
9995 * src/module.c (module_load): Changed error message to conform to
9998 * src/m4.c (usage): Added message about reporting bugs.
10000 * doc/m4.texinfo (Changeword): Corrected a wrong example.
10001 (Changeword): Added note about the type of regexps used.
10003 * ltconfig, ltmain.sh: New files from Libtool 1.2.
10005 * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
10006 and AM_PROG_LIBTOOL.
10008 * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
10011 * modules/Makefile.am: Changed completely to compile modules using
10012 libtool. The modules are compiled as shared libraries, and are
10013 renamed when installed.
10015 * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
10016 USE_SHL_LOAD to HAVE_SHL_LOAD
10018 * src/builtin.c (shipout_string): Now tests for a NULL string.
10020 * src/module.c: New level of indirection around non-portable
10021 functions to load shared objects. Intended to encapsulate the non
10022 portable parts better and to reduce the number of #ifdefs in the
10025 * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
10026 directory modules/ to the distribution.
10028 1998-11-15 René Seindal <rene@seindal.dk>
10032 * modules/stdlib.c: New module `stdlib' defining some standard
10033 functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
10034 getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
10036 * src/builtin.c (shipout_string): New convenience function for
10037 builtins and modules.
10039 * src/module.c (module_load): Tentative support for
10040 shl_load/shl_findsym, but I cannot test it. Copied from MetaHTML.
10042 * Makefile.am (SUBDIRS): Directory modules added if configured.
10044 * modules/Makefile.am: Now correctly compiles and installs
10045 modules in pkglibexecdir.
10047 * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
10048 These two are now initialised by autoconf macros.
10050 * src/path.c (module_env_init): MODULE_PATH is always on the
10053 * src/Makefile.am: Now generated pathconf.h which defined the
10054 default MODULE_PATH.
10056 * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
10057 where modules are installed.
10059 * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
10060 by Brian J. Fox <bfox@datawave.net>. This change allow modules to
10061 build and install automatically, and it is prepared for other
10062 interfacec than dlopen().
10064 * src/builtin.c (predefined_tab): Added __m4_version__ for the
10065 current version of GNU m4. It is a GNU extension.
10067 1998-11-14 René Seindal <rene@seindal.dk>
10069 * tests/Makefile.am (GENERATED_TESTS): Added new
10070 generated-tests/changesy.8.test
10072 * doc/m4.texinfo (Changesyntax): Documentation for escape
10075 * src/macro.c (expand_token): Check for escaped macro call before
10076 symbol table lookup.
10078 * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
10081 * src/input.c: New static variable use_macro_escape, which is TRUE
10082 iff some character has code SYNTAX_ESCAPE
10083 (input_init): Added initialisation of use_macro_escape.
10084 (check_use_macro_escape): New function to synchronise
10085 use_macro_escape with the syntax table.
10086 (set_quotes): Added call to check_use_macro_escape()
10089 (next_token): Added new case for IS_ESCAPE.
10091 * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
10093 1998-10-13 René Seindal <rene@seindal.dk>
10097 * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
10100 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
10101 maintained tests in tests/other-tests. These currently tests for
10102 8-bit transparency, multiple precision arithmetic and sync-line
10103 output. Test for stackoverflow detection does not work.
10105 * examples/Makefile.am (TESTS): Added tests for all example files.
10107 * examples/mktests.sh: New file. Help program for creating test
10110 * tests/mkconfig.sh: New file to generate tests/config.m4 and
10111 tests/config.sh. This is for tests of configure selectable
10112 features. Picks up all set WITH_ and ENABLE_ veriables from
10115 * src/path.c (path_search): Added argument 'char **expanded_name'
10116 to return the expanded name.
10118 * src/m4.h: Added 2nd argument to declaration of path_search().
10120 * src/m4.c (main): Added 2nd argument to path_search().
10122 * src/freeze.c (reload_frozen_state): Do.
10124 * src/builtin.c (m4_undivert): Do.
10127 1998-10-11 René Seindal <rene@seindal.dk>
10129 * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
10131 * acm4/modules.m4: New file. Defines AM_WITH_MODULES.
10133 * acm4/gmp.m4: New file. Defines AM_WITH_GMP.
10135 * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
10137 * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
10139 * intl/: Updated to GNU gettext 0.10.35.
10141 * doc/m4.texinfo (Format): Documented that format is blind.
10143 * src/builtin.c (builtin_tab): Builtin format marked as blind.
10145 1998-10-07 René Seindal <rene@seindal.dk>
10149 * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
10150 .test, as the files are no longer just m4 input.
10152 * tests/get-them (FILE): Changed .m4 extension to .test.
10154 * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
10155 Otherwise quoted strings with leading whitespace first in a macro
10156 argument would be eliminated.
10158 * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
10159 (expand_argument): Do.
10161 * src/input.c (next_token): SPACE and NUM/OTHER characters are only
10162 grouped together iff both quote and comment strings are single
10163 character. Otherwise they might include a comment/quote leader.
10164 (next_token): Returns new token type TOKEN_SPACE.
10166 * src/builtin.c (push_builtin_table): New function to push a
10167 builtin_table on the stack without installing its contents.
10168 (find_builtin_by_name): Added call to push_builtin_table() if
10169 reading frozen files. Otherwise the builtins named in the frozen
10170 files could not be found.
10171 (install_builtin_table): Changed to use push_builtin_table()
10173 1998-10-04 René Seindal <rene@seindal.dk>
10175 * po/pl.po: Polish translation added.
10177 * po/POTFILES.in: src/module.c added.
10179 1998-10-04 René Seindal <rene@seindal.dk>
10183 * configure.in (ALL_LINGUAS): Added Polish pl.po
10185 1998-10-03 René Seindal <rene@seindal.dk>
10187 * Many files: Incorporated changes to implement dynamic modules.
10188 Detailed comments in src/modules.c and modules/README
10190 * src/module.c: New file, implements the OS dependant parts of
10191 dynamic module loading.
10193 * src/Makefile.am (m4_SOURCES): Added module.c
10195 * src/builtin.h: New file, declares some functions from builtin.c
10196 that are of use for other modules (shipout_int, numeric_arg,
10197 skip_space, bad_argc), and the macros ARG() and DECLARE().
10199 * src/builtin.c (install_builtin_table): New function. Each
10200 module brings in a builtin_table, which is pushed on a stack.
10201 (struct builtin_table): New struct for list of builtin_tables.
10202 (m4_loadmodule): New function to implement builtin "loadmodule".
10203 (shipout_int): No longer static, to be used by modules.
10207 (builtin_init): changed to call install_builtin_table()
10208 (find_builtin_by_name): Now searches all builtin_tables
10209 (find_builtin_by_addr): do.
10211 * src/path.c: Reorganised to allow for two search paths, one for
10212 include files and one for modules.
10214 * src/m4.h: Added declarations for new functions in module.c and
10217 * src/m4.c (main): Added call to module_init().
10219 * modules: New directory with a few demo modules.
10221 * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
10224 * configure.in: Added modules/Makefile to AC_OUTPUT.
10226 * configure.in: Added code to implement --with-modules. Tests for
10227 <dlfcn.h> and -ldl.
10229 * acconfig.h: Added WITH_MODULES
10231 1998-10-02 René Seindal <rene@seindal.dk>
10233 * examples/Makefile.am (pkgdata_DATA): Removed special target for
10234 check and variables TESTS. These tests are now run from the
10237 * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
10238 directory. The files stay there but the tests are run from the
10241 * tests/Makefile.am (EXTRA_DIST): Added run-test.
10243 * tests/run-test: New file. Run a test manually
10245 * tests/Makefile.am, tests/get_them: Moved automatically generated
10246 tests (from the manual) to sub directory tests/gentest/. The
10247 tests/ directory had gotten a bit messy.
10249 1998-09-06 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10251 * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
10252 wrap}.test: Added a few testcases.
10254 1998-08-21 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10258 * lib/Makefile.am (noinst_HEADERS): regex.h added
10260 * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
10261 acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
10263 * acm4/Makefile.am: created providing rules to create
10264 $(top_srcdir)/acinclude.m4 to be used by aclocal.
10266 * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
10267 `C'. Reported by Ulrich Drepper.
10269 * Makefile.am (SUBDIRS): Removed checks directory
10270 * configure.in (AC_OUTPUT): Removed checks/Makefile
10272 * doc/m4.texinfo (Patsubst,example): @comment added to preserve
10273 the space when m4.texinfo is edited and whitespace.el is active.
10274 (Defn,example): idem.
10276 1998-08-20 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10278 * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
10279 ../COPYING. ../Makefile is a file which is certainly present when
10280 test is executed in testSubDir. One can't be sure that the COPYING
10281 file is in .. or ../.. in all situations, the ../Makefile is
10284 * doc/m4.texinfo (Include): adjusted expected test output
10285 according to new tests, i.e. the input will always come from the
10286 file `in' created by the test.
10288 * tests/Makefile.am: Added three lines at the top to get
10289 esyscmd.1.test working.
10291 * tests/get-them: modified to generate clearer tests who will need
10292 less maintenance when new test examples are created in
10293 `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
10294 need the generic file `defs') shell scripts creating `in', `ok',
10295 `out' and when apropriate `okerr' and `err' in the directory
10296 `testSubDir' when executed. The compare of `ok' and `out'
10297 (and of `okerr' and `err') will be the exit status of the test.
10298 `out' must match `ok' (and `okerr' must match `err') for the test
10301 * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
10302 the tests generated by tests/get-them getting it input normally
10303 from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
10304 (dot) before the numeric part) is reserved for all other (hand
10305 written) tests. The `+' means one or more times.
10307 1998-08-12 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10309 * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
10310 supported short man page to refer to info documentation
10311 * helptoman.pl: added
10312 * configure.in: AC_PATH_PROG(PERL,perl)
10313 * Makefile.am (SUBDIRS): doc after src
10315 * libitized with libit 0.5 from
10316 ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
10318 * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
10319 * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
10320 replacement functions, (libm4_a_LIBADD): @LIBOBJS@
10321 * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
10322 lib/rx.{c,h}: added
10323 * configure.in (AC_CHECK_FUNC): getopt_long
10325 * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
10327 * TODO: added entry about dependencies
10329 1998-08-10 René Seindal <rene@seindal.dk>
10333 * doc/m4.texinfo (Changesyntax): Added documentation for the macro
10336 * src/builtin.c (m4_changesyntax): Added builtin macro
10337 "changesyntax" to modify the syntax table.
10339 * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
10340 table. All categories are assigned a syntax code and tokens are
10341 read according to this table.
10343 1998-08-09 René Seindal <rene@seindal.dk>
10345 * src/numb.{c,h}: New files, implements multiple precision eval
10346 using GNU gmp. Originally submitted by John Gerard Makecki
10347 (johnm@vlibs.com), later modified. Tested with GNU gmp 2.0.2.
10349 * doc/m4.texinfo (Eval): Added documentation for multiple
10350 precision arithmetic library support.
10352 * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
10353 to accommodate multiple precision eval.
10355 1998-08-07 René Seindal <rene@seindal.dk>
10357 * src/input.c (MATCH, match_input), src/m4.h: changed definition
10358 of comment and quote strings to `unsigned int' to allow eight bit
10359 chars (reported by andrewb@zip.com.au (Andrew Bettison)).
10361 * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
10362 patch from Mike Howard <mike@clove.com>
10364 1998-08-06 René Seindal <rene@seindal.dk>
10366 * gettext.m4: corrected AM_WITH_NLS to handle use of installed
10369 1998-08-03 René Seindal <rene@seindal.dk>
10373 * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
10374 and _ macro. M4 now builds with --disable-nls.
10376 * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
10377 to look for right message catalogs. Call indef'ed by ENABLE_NLS.
10379 * configure.in (ALL_LINGUAS): Added complete list of translations:
10380 de fr it ja nl ru sv.
10382 1998-05-23 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10384 * po/nl.po: Dutch translation by Erick Branderhorst.
10386 * po/fr.po: French translation by Erick Branderhorst, based on the
10387 translations by François Pinard in fr.msg and m4.cod.
10389 1998-05-22 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10393 * src/m4.c: #include <signal.h> not <sys/signal.h>.
10395 * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
10397 * checks/Makefile.am: explicit list tests in CHECKS.
10399 * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
10400 src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
10401 mkinstalldirs, install-sh: Added automake (1.3) support.
10403 * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
10404 obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
10405 Used libitize (0.4) to update.
10407 * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
10408 (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
10409 README accordingly.
10411 * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
10412 stack overflow functionality.
10414 1994-12-03 François Pinard <pinard@iro.umontreal.ca>
10416 * Prerelease 1.4.1.
10418 * Makefile.in (realclean-local): Delete stamp-h.in.
10420 * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
10421 Localize, adapting from how it is done in sharutils.
10423 * fr.tt: New file, for French.
10425 * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
10426 src/freeze.c: Rename PRODUCT to PACKAGE.
10428 1994-11-26 François Pinard <pinard@iro.umontreal.ca>
10430 * configure.in: Check for <libintl.h> and <locale.h>.
10431 * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
10432 src/stackovf.c: Rename _ to __P.
10433 * src/m4.h: Declare _ as a macro returning its argument, or else,
10434 include <libintl.h> and declare _ as gettext.
10435 * src/m4.c: Possibly include <locale.h> and call setlocale.
10436 * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
10437 src/input.c, src/macro.c, src/output.c, src/path.c,
10438 src/stackovf.c, src/symtab.c: Use _ macro over all localizable
10441 1994-11-07 François Pinard <pinard@iro.umontreal.ca>
10443 * doc/Makefile.in (stamp-vti): Use new -r option to date.
10445 * configure.in: Put --with-gmp in place, in prevision for John
10447 * acconfig.h: Document WITH_GMP.
10449 1994-11-05 François Pinard <pinard@iro.umontreal.ca>
10453 * doc/Makefile.in (realclean): Also remove stamp-vti.
10454 Reported by Eric Backus.
10456 1994-11-02 François Pinard <pinard@iro.umontreal.ca>
10458 * src/freeze.c (produce_frozen_state): If the frozen file cannot
10459 be opened, return immediately after producing the error message.
10460 Reported by Andreas Schwab.
10462 * configure.in: Check for const only after having found possible
10463 ANSIfying compiler flags, this is of no use to check it before.
10464 Reported by Alexander Lehmann.
10466 1994-11-01 François Pinard <pinard@iro.umontreal.ca>
10468 * src/macro.c (collect_arguments): Cast obstack arguments to
10469 (voidstar), so avoiding compiler warnings.
10470 Reported by Joseph E. Sacco.
10472 * src/freeze.c (produce_frozen_state): Cast printed lengths to
10473 (int) so they correspond to %d format items.
10474 Reported by Joseph E. Sacco.
10476 * src/m4.c (main): Cast the argument to xfree to (voidstar).
10477 * src/symtab.c (free_symbol): Idem.
10478 Reported by Karl Vogel.
10480 1994-10-31 François Pinard <pinard@iro.umontreal.ca>
10482 * Makefile.in (DISTFILES): Distribute BACKLOG.
10484 * configure.in: Define PRODUCT and VERSION.
10485 * acconfig.h: Document PRODUCT and VERSION.
10486 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
10487 constant string m4 and variable or parameter named version.
10489 1994-10-30 François Pinard <pinard@iro.umontreal.ca>
10491 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
10492 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
10493 defines __STDC__ to 0, for indicating it is *not* ANSI!
10494 Reported by Kaveh R. Ghazi.
10496 * configure.in: Added obsolescent tests for AIX and Minix.
10498 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
10499 which texclean does not exist anymore.
10500 Reported by Eric Backus, Jim Meyering, John David Anglin and
10503 1994-10-29 François Pinard <pinard@iro.umontreal.ca>
10505 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
10506 Reported by John David Anglin.
10508 * src/ansi2knr.c: New version, sent by Peter Deutsch.
10509 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
10510 ANSI2KNR, depending on the fact the compiler is ANSI or not.
10511 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
10512 Remove the sed filter after ansi2knr for debug.c. Use $O instead
10513 of $U, put underline in extensions rather than in basenames. Use
10514 implicit rules, now that regularity makes this possible.
10515 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
10516 of ansi2knr whenever it is needed.
10517 * configure.in: Adjusted for correct STACKOVF substitution.
10518 * src/debug.c (trace_format): When not __STDC__, use (...) as a
10519 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
10520 Reported by David MacKenzie.
10522 * Makefile.in: Remove binprefix. Use transform_name instead.
10523 Reported by David MacKenzie.
10525 * doc/Makefile.in: Create version.texi, use it, clean it.
10526 Reported by Jim Meyering.
10528 1994-10-28 François Pinard <pinard@iro.umontreal.ca>
10530 * Makefile.in (all, install, uninstall): Depend on Makefile.
10532 * Makefile.in: For actions invoking $(MAKE) from within compound
10533 sh statements, exit non-zero if the sub-make fails. Otherwise,
10534 the top-level make may exit successfully when it should fail.
10535 Reported by Jim Kingdon.
10537 * {,/*}Makefile.in: Use && after all cd, in case they fail.
10539 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
10540 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
10541 * configure.in: Substitute PRODUCT and VERSION.
10543 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
10545 1994-10-27 François Pinard <pinard@iro.umontreal.ca>
10547 * Makefile.in (mostlyclean-local): Do not remove *~.
10548 * */Makefile.in (mostlyclean): Idem.
10549 Reported by Robert E. Brown and Richard Stallman.
10551 1994-10-09 François Pinard <pinard@iro.umontreal.ca>
10553 * src/m4.h: Get rid of CONFIG_BROKETS.
10555 1994-10-02 François Pinard <pinard@iro.umontreal.ca>
10557 * configure.in: Use AC_ARG_PROGRAM.
10558 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
10559 Reported by David MacKenzie.
10561 1994-10-01 François Pinard <pinard@iro.umontreal.ca>
10563 * configure.in: Do not add -O to CFLAGS for GNU C, now that
10564 configure does it automatically.
10565 Reported by Jim Meyering.
10567 1994-09-23 François Pinard <pinard@iro.umontreal.ca>
10569 * src/stackovf.c: Declare the handler_t typedef earlier in the
10570 code, use it for stackovf_handler.
10571 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
10572 casting sigsegv_handler.
10573 Reported by Robert Bernstein.
10575 * src/m4.c (main): Initialize program_name to argv[0] without
10577 Reported by Karl Berry.
10579 1994-09-18 François Pinard <pinard@iro.umontreal.ca>
10581 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
10582 Reported by Karl Berry.
10584 1994-09-14 François Pinard <pinard@iro.umontreal.ca>
10586 * lib/Makefile.in (mostlyclean): Added.
10587 (TAGS): Make in $(srcdir).
10589 * configure.in: Use `choke me' in test, like everywhere!
10591 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
10592 unreacheable and useless.
10594 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
10596 * lib/Makefile.in (DISTFILES): Distribute TAGS.
10597 (distclean): Do not remove TAGS.
10598 (realclean): Remove it.
10599 * Makefile.in: Make TAGS in lib also, not just in src.
10600 Reported by Karl Berry.
10602 * Makefile.in (distclean, realclean): Instead of recursively
10603 calling $(MAKE) for the -local part, allow parallel execution of
10604 -recursive and -local, only delay the removal of config.status,
10605 which is repeated in both goals.
10607 1994-09-13 François Pinard <pinard@iro.umontreal.ca>
10611 * Makefile.in: Group all *clean-recursive goals in one, using sed
10612 to remove `-recursive' while calling make recursively. Also, use
10613 a subshell for each recursive $(MAKE).
10614 Reported by Jim Meyering.
10616 * src/m4.h (memcpy): Define with bcopy for BSD systems.
10617 Reported by Kaveh R. Ghazi.
10619 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
10620 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
10623 * configure.in: Use date instead of touch for stamp-h.
10624 * Makefile.in (stamp-h.in): Idem.
10626 * Makefile.in (distclean, realclean): Force serial execution of
10627 both goals, in case parallel makes are being used.
10628 Reported by Jim Meyering.
10630 * src/Makefile.in (DISTFILES): Distribute TAGS.
10631 (distclean): Do not remove TAGS.
10632 (realclean): Remove it.
10633 Reported by Karl Berry.
10635 1994-09-10 François Pinard <pinard@iro.umontreal.ca>
10637 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
10638 to old names, for following Autoconf.
10640 1994-09-08 François Pinard <pinard@iro.umontreal.ca>
10642 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
10643 ./install.sh will not be correctly referred to in sub-Makefiles.
10644 Reported by John David Anglin.
10646 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
10647 Reported by Eric Backus.
10649 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
10650 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
10651 config.status into remaking this directory's Makefile only.
10652 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
10653 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
10654 Reported by Jim Meyering.
10656 1994-09-06 François Pinard <pinard@iro.umontreal.ca>
10658 * configure.in: Correct stack overflow detection logic, taking
10659 care of systems having only incomplete implementations (like for
10660 Pyramid 9820 OSx 5.0d).
10661 Reported by Kaveh R. Ghazi.
10663 * src/Makefile.in (TAGS): Remote -t from etags call.
10665 1994-09-02 François Pinard <pinard@iro.umontreal.ca>
10667 * lib/Makefile.in (install): Depend on all.
10669 1994-08-31 François Pinard <pinard@iro.umontreal.ca>
10671 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
10672 Reported by Jim Meyering and John David Anglin.
10674 * Makefile.in (distclean-local): Delete config.log.
10675 Reported by Jim Meyering.
10677 Solidify frozen files with respect to -P:
10678 * src/m4.c: Have -P set prefix_all_buitins variable instead of
10679 calling a function by that name. Declare the variable.
10680 * src/m4.h: Adjust declaration for prefix_all_buitins.
10681 * src/builtin.c (builtin_init): Merge in functionality from
10682 previous prefix_all_buitins function, while making entries in the
10683 symbol table, but not modifying the builtin description itself.
10685 * src/freeze.c (reload_frozen_state): Add a useless `break;',
10686 because *many* compilers do not accept an empty `default:'.
10687 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
10688 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
10690 * configure.in: Use AC_TYPE_SIGNAL.
10691 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
10692 Reported by Robert Bernstein.
10694 * checks/Makefile.in (check): Modify PATH so check-them will find
10695 m4 in the src directory.
10696 * Makefile.in (check): Don't.
10697 Reported by Akiko Matsushita and Jim Meyering.
10699 * src/output.c (make_room_for, output_character_helper): New
10700 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
10701 a per buffer MAXIMUM_BUFFER_SIZE.
10703 * src/output.c (output_text): New function, for optimizing the
10704 output of strings of characters. Use it.
10706 1994-08-30 François Pinard <pinard@iro.umontreal.ca>
10708 * doc, src: New directories reorganizing the distribution.
10709 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
10711 * Makefile.in: Adjusted.
10712 * configure.in: Configure new Makefiles.
10714 * m4.h: Declare STRING typedef. Use it for comment and quote
10715 strings, adjusting all references. (This is the rudiments of a
10716 beginning for the eventual withdrawal of NUL terminated strings.)
10717 * output.c (shipout_text): Accept a length parameter, and use it.
10718 All callers adjusted.
10720 1994-08-29 François Pinard <pinard@iro.umontreal.ca>
10722 * m4.h: Include <unistd.h> if it exists.
10723 * stackovf.c: Don't.
10725 Clean up for current_diversion variable:
10726 * output.c: Move current_diversion from builtin.c.
10727 * m4.h: Declare current_diversion so builtin.c can access it.
10728 * output.c (output_init, make_diversion): Initialize or update
10730 * builtin.c (builtin_init, m4_divert): Leave current_diversion
10733 Remove limit on number of diversions:
10734 * output.c: Replace ndiversion by diversions, declare it.
10735 (output_init): Allocate only diversion 0.
10736 (make_diversion): Allocate new diversions as needed.
10737 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
10738 * m4.c: Still accept -N, but do nothing with it.
10739 Reported by David MacKenzie.
10742 * output.c (freeze_diversions): New function.
10743 * m4.h: Declare freeze_diversions.
10744 * freeze.c: Document frozen file format, revise it, call
10745 freeze_diversions to add diversions to frozen format, and code to
10746 reload them properly.
10747 * m4.c: Do not undivert automatically at end when status being
10748 frozen. Do not call builtin_init when reloading frozen state.
10750 Speed up diversion processing:
10751 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
10752 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
10753 structure and variables, cached variables out of output_diversion,
10754 reallocate_diversion_for and OUTPUT_CHARACTER.
10755 (shipout_text, make_diversion, insert_diversion): Adapted to new
10757 (insert_file): Use better buffering.
10758 Reported by David MacKenzie.
10760 1994-08-28 François Pinard <pinard@iro.umontreal.ca>
10762 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
10763 dist works from another build directory.
10765 1994-08-27 François Pinard <pinard@iro.umontreal.ca>
10767 * symtab.c (hack_all_symbols): Use hash_table_size instead of
10768 constant HASHMAX, for -H option to work better.
10770 * builtin.c (DECLARE): Simplify by using _ ().
10772 * freeze.c: New file.
10773 * Makefile.in: Compile it, distribute it.
10774 * m4.c: Recognize, document and process --freeze-state (-F) and
10775 --reload-state (-R) options. Pass a true flag to builtin_init
10776 only if no reloading some state.
10777 * builtin.c (define_builtin): Remove static specifier.
10778 (find_builtin_by_name): Remove static specifier.
10779 (builtin_init): Accept and obey a flag argument.
10780 * m4.h: Add declarations for freeze.c, changes for builtin.c.
10782 1994-08-24 François Pinard <pinard@iro.umontreal.ca>
10784 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
10787 * configure.in: Implement --with-dmalloc.
10788 * acconfig.h: Document WITH_DMALLOC.
10789 * m4.h: Add code for when WITH_DMALLOC.
10791 1994-08-15 François Pinard <pinard@iro.umontreal.ca>
10793 * m4.c (long_options): Use "error-output", the dash was missing.
10794 Reported by Akiko Matsushita.
10796 1994-08-12 François Pinard <pinard@iro.umontreal.ca>
10798 * m4.h: Include <sys/types.h>.
10799 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
10800 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
10802 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
10803 as size_t, not int.
10804 * builtin.c (dump_args): Declare len as size_t, not int.
10806 * debug.c: Prototype the forward declaration of debug_set_file.
10808 * builtin.c (m4_undivert): Replace div by file, for avoiding the
10809 shadowing of this variable.
10810 * output.c (insert_diversion): Idem.
10812 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
10813 (input_init): Duplicate default quote and comment strings.
10814 (set_quotes): Free previous quote strings in all cases. Duplicate
10815 even default quote strings.
10816 (set_comment): Free previous comment strings in all cases.
10817 Duplicate even default comment strings.
10819 * configure.in: Updated for Autoconf 2.0.
10820 * Makefile.in (distclean-local): Also delete config.cache.
10822 * m4.c (usage): Reorganize the --help output by topic. Include a
10823 description for debugging flags.
10825 1994-07-29 François Pinard <pinard@iro.umontreal.ca>
10827 * configure.in: If sigaction is available and SA_ONSTACK defined,
10828 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
10829 defined, use sigvec. Else don't compile stackovf.c.
10830 * stackovf.c (setup_stackovf_trap): Idem.
10831 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
10834 1994-07-21 François Pinard <pinard@iro.umontreal.ca>
10836 * m4.c (usage): Replace printf par fputs.
10838 1994-07-18 François Pinard <pinard@iro.umontreal.ca>
10842 1994-07-17 François Pinard <pinard@iro.umontreal.ca>
10844 * configure.in: Check for sigaction and sigvec. Add a new delayed
10845 check for RLIMIT_STACK, combine in the checking for getrlimit.
10846 All those things are not universally available.
10847 * stackovf.c: Split setting up the trap handler and catching
10848 signals, for better taking care of various configure outcomes.
10849 * examples/stackovf.sh: Correct a typo.
10850 Reported by Eric Backus, Jim Avera and Jim Meyering.
10852 1994-07-16 François Pinard <pinard@iro.umontreal.ca>
10854 * ansi2knr.c: New version sent by its author, Peter Deutsch.
10856 1994-07-15 François Pinard <pinard@iro.umontreal.ca>
10858 * Makefile.in: Modify so parallel make will not try making
10859 lib/libm4.a twice simultaneously.
10860 Reported by Jim Meyering.
10862 1994-07-14 François Pinard <pinard@iro.umontreal.ca>
10864 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
10865 error message, for when no code possibility exists. Even if this
10866 line is completely #ifdef'ed out, it brings a syntax error.
10867 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
10869 * Makefile.in (install): Have install depend on all too, for lib
10870 to be remade as needed.
10872 * examples/stackovf.sh: Try ksh, bsh and bash for shells
10873 providing ulimit, instead of using only ksh.
10874 Reported by Jim Avera and Joseph E. Sacco.
10876 1994-07-12 François Pinard <pinard@iro.umontreal.ca>
10878 * Makefile.in (check): Have it depend on all instead of m4. In
10879 this way, a change in lib will be detected and processed.
10881 * builtin.c (numeric_arg): Use strtol and verify the conversion,
10882 instead of using sscanf which stops as soon as there is a
10883 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
10884 and divert(1xyzzy) were all accepted without any warning or error
10886 * m4.h: Declare strtol as long if not including stdlib.h.
10887 * configure.in: Check for limits.h, and replace strtol if missing.
10888 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
10889 * lib/strtol.c: New file, from elsewhere.
10890 Reported by Andreas Schwab.
10892 1994-07-07 François Pinard <pinard@iro.umontreal.ca>
10894 * macro.c (expand_macro): Cast value to (boolean) prior to
10895 assigning it to traced.
10896 Reported by Tom McConnell.
10898 * Makefile.in (m4): Always make all in lib first.
10899 Reported by Jim Meyering.
10901 1994-07-06 Jim Avera <jima@netcom.com>
10903 * stackovf.c: Isolated OS-dependent sections; Improved portability,
10904 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
10905 handlers), and a default error message if the fault address is not
10906 available (when neither siginfo.h nor BSD sigcontext are supported).
10907 * configure.in: Changes for stackovf.h: Check for sigcontext,
10908 sigaction, sigstack, and define rlim_t as int if necessary.
10909 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
10910 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
10911 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
10913 1994-07-05 François Pinard <pinard@iro.umontreal.ca>
10915 * configure.in: Use AC_SET_MAKE.
10916 * Makefile.in: Use @SET_MAKE@.
10917 Reported by Jim Meyering.
10919 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
10920 Reported by Ian Taylor.
10922 1994-07-02 François Pinard <pinard@iro.umontreal.ca>
10924 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
10925 because siginfo.h is unrelated to standard headers, and siginfo.h
10926 is already checked for.
10927 Reported by Joseph E. Sacco.
10929 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
10931 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
10934 1994-06-29 François Pinard <pinard@iro.umontreal.ca>
10936 * builtin.c (substitute): Use \& to represent this part of the
10937 string which was matched by the whole regexp, instead of
10938 representing the whole string. Any usage of \0 issues a warning
10939 and acts like \&, it will disappear in some subsequent release.
10941 1994-06-27 François Pinard <pinard@iro.umontreal.ca>
10943 * m4.c: Complete prototype for forwarded declaration of usage.
10945 * input.c (init_macro_token): Correct own reference in error
10946 message. Previous name get_macro_func was referred to instead.
10947 (next_char): Correct own reference in error message. Previous
10948 name advance_input was referred to instead.
10950 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
10951 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
10952 and_term, not_term, logical_not_term, cmp_term, shift_term,
10953 add_term, mult_term, exp_term, unary_term, simple_term): Add
10954 prototype to forwarded declarations. Declare parameter v1 as
10955 eval_t * instead of int *. Same for local variable v2 in dyadic
10956 functions. Same for result in exp_term.
10957 * builtin.c (m4_eval): Declare value as eval_t instead of int.
10958 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
10959 unsigned_eval_t instead of unsigned int. Change casts accordingly.
10960 (shipout_int): Cast first argument of ntoa to eval_t.
10961 Reported by Thorsten Ohl.
10963 * macro.c: Complete the prototypes of forwarded expand_macro and
10965 Reported by Thorsten Ohl.
10967 * m4.h: Define voidstar as void * or char * depending on __STDC__.
10968 The Ultrix 3.1 compiler cannot do much with void pointers.
10970 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
10971 * m4.c (xfree): Replace void * by voidstar.
10972 Reported by Tom McConnell.
10974 * ansi2knr.1: New, from elsewhere.
10975 * Makefile.in (DISTFILES): Distribute ansi2knr.1
10977 * Makefile.in (stamp-h.in): Avoid running ./config.status if
10978 stamp-h does not exist yet. This avoids running it a second time
10979 just after the initial ./configure.
10980 Reported by David MacKenzie and Tom McConnell.
10982 * m4.h: Replace the enum debug_info declaration with a series of
10983 #define's. The Ultrix 3.1 compiler would otherwise need casting
10984 (int) to most references, when used in expressions.
10985 Reported by Tom McConnell.
10987 1994-06-25 François Pinard <pinard@iro.umontreal.ca>
10989 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
10990 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
10991 calls the compiler. Previously, FP_PROTOTYPES was only calling
10992 the preprocessor; by not being subject to CFLAGS, this was
10993 discouraging those flags asking for ANSI compilation.
10994 * acconfig.h: Document HAVE_PROTOTYPES.
10995 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
10996 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
10997 Reported by Eric Backus.
10999 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
11000 from the environment. Default CFLAGS to -g if not set.
11001 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
11002 * lib/Makefile.in: Have CFLAGS substituted from configure.
11003 Reported by Eric Backus and Tom McConnell.
11005 * configure.in: m4_undefine changeword before using AC_ENABLE.
11007 * m4.h: Declare prototypes for error (for ANSI compilers only),
11008 prefix_all_builtins and reference_error.
11009 Reported by Tom McConnell.
11011 * input.c (set_word_regexp): Do not try to initialize the array
11012 test from a string, this does not work with non-ANSI compilers.
11013 Reported by Eric Backus.
11015 * Makefile.in (dist): Clean examples/ before saving it.
11016 (distclean-local): Also remove stamp-h.
11017 Reported by Eric Backus.
11019 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
11020 non ANSI compilers.
11021 Reported by Tom McConnell.
11023 * checks/Makefile.in (clean): Depends on mostlyclean.
11024 (mostlyclean): New goal.
11026 1994-06-24 François Pinard <pinard@iro.umontreal.ca>
11028 * Makefile.in (DISTFILES): Distribute install.sh.
11029 * install.sh: New file, copied from elsewhere.
11030 Reported by Assar Westerlund and Kaveh R. Ghazi.
11032 1994-06-23 François Pinard <pinard@iro.umontreal.ca>
11034 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
11035 * acconfig.h: Explain ENABLE_CHANGEWORD.
11037 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
11038 from code provided by Pete Chown]
11039 * m4.h: Add original_text field to u_t variant of union u.
11040 Declare TOKEN_DATA_FUNC macro.
11041 * builtin.c: Declare changeword.
11042 (m4_changeword): New function.
11043 * input.c: Include "regex.h", define variables with word regexps.
11044 (input_init): Initialize the word regexp.
11045 (set_word_regexp): New.
11046 (next_token): Declare local variables, use the previous code if
11047 default_word_regexp is true. Else, match using a new code. Save
11049 * macro.c (expand_token): Ship out original text if not a macro
11051 Reported by Krste Asanovic and Pete Chown.
11053 [These modifs all depend upon ENABLE_CHANGEWORD]
11054 * m4.h: Declare external user_word_regexp.
11055 * m4.c: Declare user_word_regexp, and initialize it from
11056 --word-regexp or -W, or NULL if not specified.
11057 * input.c: Use user_word_regexp if specified, instead of
11058 DEFAULT_WORD_REGEXP.
11060 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
11063 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
11064 * checks/Makefile.in: Empty the suffix list.
11065 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
11067 * m4.c: Declare nesting_limit and initialize it to 250.
11068 Implement -LNUMBER or --nesting-limit=NUMBER to change its
11070 * m4.h: Declare nesting_limit as external.
11071 * macro.c (expand_macro): Stop execution whenever nesting limit
11073 Reported by Bengt Mertensson.
11075 * eval.c (evaluate): Diagnose excess characters in eval input.
11076 Things like `eval(08)' used to return 0 with no diagnostic.
11078 * m4.h: Capitalize first letter of all macro arguments in
11081 * m4.c: Declare warning_status, initialize it to 0. Add new
11082 option -E, or --fatal-warnings, which sets warning_status to
11083 EXIT_FAILURE instead.
11084 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
11085 EXIT_FAILURE if not otherwise done by header files.
11086 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
11087 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
11088 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
11089 argument of all M4ERROR calls.
11090 Reported by Noah Friedman.
11092 * examples/incl-test.m4: Renamed from incl_test.m4.
11093 * examples/include.m4: Include incl-test.m4 instead of
11095 * examples/multiquotes.m4: Renamed from multi-quotes.m.
11097 1994-06-22 François Pinard <pinard@iro.umontreal.ca>
11099 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
11100 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
11101 also tested it on a Sun Sparc workstation running SunOS 4.x.
11103 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
11104 49.format check, abusing a `union values' argument with sprintf
11105 without selecting the proper field. Now, save the formatting type
11106 first, delaying the fetch of the corresponding argument.
11107 Reported by Joseph E. Sacco and Tom Quinn.
11109 * format.c (format): Remove const from char *fmt declaration when
11110 not HAVE_EFGCVT, because a NUL may be forced into it.
11112 * m4.h: Declare atof() when not STDC_HEADERS.
11113 Reported by Joseph E. Sacco.
11115 * Regenerate configure using Autoconf 1.11, this corrects a
11116 problem about an incorrect cpp seting on NeXT 3.1.
11117 Reported by Alexander Lehmann.
11119 1994-06-05 François Pinard <pinard@iro.umontreal.ca>
11121 * m4.h (_): Change argument from `x' to `Args'.
11123 1994-04-22 François Pinard <pinard@iro.umontreal.ca>
11125 * m4.h: Rename Args() to _().
11126 * m4.h: Remove extern specifier from all function declarations.
11128 1994-04-22 Jim Avera <jima@netcom.com>
11130 * stackovf.c: New file implementing stack-overflow detection.
11131 * configure.in: Check for getrlimit, sigaction. If all of
11132 standard headers, getrlimit and sigaction, define USE_STACKOVF and
11133 substitute ${U}stackovf.o for STACKOVF.
11134 * acconfig.h: Declare USE_STACKOVF.
11135 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
11136 * m4.h: Declare setup_stackovf_trap().
11137 * m4.c: Call setup_stackovf_trap().
11138 * tests/stackovf_test.sh: New file.
11140 1994-04-13 François Pinard <pinard@iro.umontreal.ca>
11142 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
11144 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
11146 1994-01-30 François Pinard <pinard@iro.umontreal.ca>
11148 * m4.h: Remove definition of volatile, not used anymore.
11149 Reported by Jim Meyering and Joseph E. Sacco.
11151 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
11152 of `if ... else /* nothing */' for if macros.
11153 Reported by Jim Meyering.
11155 * builtin.c (m4_regexp): Reorganize the code for avoiding a
11156 warning from gcc about `repl' possibly used before defined.
11157 Reported by Jim Meyering.
11159 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
11160 Reported by Jim Meyering.
11162 1994-01-25 François Pinard <pinard@iro.umontreal.ca>
11164 * m4.h: Move the conditional definition of volatile after the
11165 inclusion of system files, because they may define it first.
11167 1994-01-04 François Pinard <pinard@iro.umontreal.ca>
11169 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
11170 get around a problem with Alpha make seeing a syntax error, there.
11171 Reported by Vern Paxson.
11173 1994-01-03 François Pinard <pinard@iro.umontreal.ca>
11175 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
11176 Reported by Richard Stallman.
11178 1993-12-25 François Pinard <pinard@iro.umontreal.ca>
11180 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
11181 instead of AC_HAVE_FUNCS.
11182 Reported by Noah Friedman.
11184 1993-12-01 François Pinard <pinard@iro.umontreal.ca>
11186 * m4.c: Initialize show_help and show_version to zero.
11188 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
11189 Use them in exit() and usage() calls.
11191 1993-11-27 François Pinard <pinard@iro.umontreal.ca>
11193 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
11194 syserr() macro. Delete errref, add reference_error and M4ERROR.
11195 * m4.c: Replace errref, which was returning an input reference
11196 string, with reference_error, which prints it on standard error.
11197 * builtin.c, output.c: Use errno as second parameter to error,
11198 instead of using syserr() with %s.
11199 * *.c: Use M4ERROR instead of error: no more errref() with %s.
11200 Doing so, the program name appears after the input reference
11201 instead of before, which eases M-x next-error processing.
11203 1993-11-24 François Pinard <pinard@iro.umontreal.ca>
11205 * checks/get-them: Escape braces with backslashes in patterns,
11206 because HPUX-9.01 awk needs this.
11207 Reported by Jim Meyering.
11209 1993-11-22 François Pinard <pinard@iro.umontreal.ca>
11211 * builtin.c: Declare "FILE *popen ();".
11213 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
11214 macros, replace error_message_prefix() declaration by errref()'s.
11215 Declare xrealloc, for use in errref().
11216 * m4.c: Delete error_message_prefix() function, add errref().
11217 * *.c: Use error() systematically in place of all error macros,
11218 now that error() flushes stdout first. Make needed adjustments.
11220 * m4.h: Remove const in sys_errlist[] declaration, it creates
11221 conflicts on SGI and Alpha.
11222 Reported by Kaveh R. Ghazi.
11224 1993-11-20 François Pinard <pinard@iro.umontreal.ca>
11226 * m4.c: Include <getopt.h> instead of "getopt.h".
11228 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
11229 * acconfig.h: New, for documenting HAVE_EFGCVT.
11230 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
11231 use them wherever appropriate. Also use -I. for compilations.
11232 * lib/Makefile.in: Use -I.. for compilations.
11233 * *.c: Include <config.h> or "config.h".
11235 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
11236 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
11238 1993-11-17 François Pinard <pinard@iro.umontreal.ca>
11240 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
11242 * input.c (input_init): Initialize quote and comment strings
11243 explicitely instead of calling set_quotes and set_comment: by
11244 doing so, we ensure we do not free uninitialized variables.
11246 * checks/check-them: Reverse arguments to both diff, so the
11247 expected is on the left and the obtained on the right.
11249 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
11250 macros. Delete declarations for m4error, warning, fatal and
11251 internal_error, add declaration for error_message_prefix.
11252 * m4.c: Delete m4error, warning, fatal and internal_error
11253 routines, add error_message_prefix routine.
11254 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
11255 warning with WARNING*, fatal with FATAL* and internal_error with
11257 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
11258 this is not needed anymore.
11260 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
11261 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
11262 and debug_message, add declaration for debug_message_prefix.
11263 * debug.c: Remove static specifier for FILE *debug declaration.
11264 Delete debug_print and debug_message routines, add
11265 debug_message_prefix routine.
11266 * builtin.c, debug.c: Replace debug_print routine calls with
11267 DEBUG_PRINT* macro calls.
11268 * input.c, path.c: Replace debug_message routine calls with
11269 DEBUG_MESSAGE* macro calls.
11271 * m4.h: Remove inclusion of <varargs.h>.
11272 * debug.c: Include <stdarg.h> or <varargs.h>.
11273 (trace_format): Use stdarg instead of varargs if __STDC__.
11275 * configure.in: Remove checks for vfprintf and _doprnt. These
11276 implementations use varargs tricks which are not portable enough.
11277 * lib/vfprintf.c: Deleted.
11278 * lib/_doprnt.c: Deleted.
11279 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
11280 Reported by Joel Sherrill.
11282 * path.c (add_include_directory): Use xstrdup.
11284 * builtin.c (find_builtin_by_name): Declare static.
11286 * *.[ch]: Add const to a few "char *" declarations.
11288 * configure.in: Remove commented tests for fileno() and fstat().
11289 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
11291 * debug.c (debug_flush_files): New.
11292 * m4.h: Declares it.
11293 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
11294 Reported by Nicolas Pioch.
11296 1993-11-12 François Pinard <pinard@iro.umontreal.ca>
11298 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
11299 Reported by Joel Sherrill.
11301 * builtin.c (prefix_all_builtins): Instead of the table size, use
11302 the null entry at end for stopping the loop. It was overwritten.
11303 Reported by Andreas Schwab and Jim Meyering.
11305 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
11306 Reported by Kaveh R. Ghazi.
11308 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
11309 Reported by Karl Vogel.
11311 1993-11-09 François Pinard <pinard@iro.umontreal.ca>
11313 * m4.h: Do not define volatile if already defined.
11314 Reported by René Seindal.
11316 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
11318 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
11319 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
11321 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
11323 * m4.h: Define strchr and strrchr in terms of index and rindex,
11324 instead of the other way around.
11325 * builtin.c, m4.c, path.c: Use strchr instead of index.
11327 * input.c (next_char): Remove a "break;" after a "return ...;".
11328 Reported by Tom McConnell.
11330 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
11334 * configure.in: Do not copy check files in the build hierarchy.
11335 * checks/check-them: Identify the m4 version being checked. For
11336 finding m4, look in $PATH instead of in the parent directory.
11337 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
11338 * checks/Makefile.in (.all-stamp): Always create check files in
11339 the source hierarchy, not anymore in the build hierarchy.
11340 (check): cd to the source hierarchy before performing checks.
11341 Do not copy nor clean COPYING anymore, take it from `..'.
11342 Reported by Tom McConnell.
11344 * Makefile.in (Makefile): Use $(SHELL).
11345 (config.status): Use $(SHELL). Use "config.status --recheck"
11346 instead of "configure --no-create", which is obsolete.
11347 Reported by Tom McConnell.
11349 1993-11-05 François Pinard <pinard@iro.umontreal.ca>
11351 * m4.c (usage): Use "%s" instead of "m4" in format string.
11352 Reported by Jim Meyering.
11354 * Makefile.in: Distribute mkinstalldirs.
11355 Reported by Pierre Gaumond.
11356 Reported by Jim Meyering.
11357 Reported by Tom McConnell.
11358 Reported by Andreas Gustafsson.
11360 * checks/check-them: Renamed from checks/check_them.
11361 * checks/get-them: Renamed from checks/get_them.
11362 * checks/.all-stamp: Renamed from checks/.all_stamp.
11363 * checks/Makefile.in: Changed accordingly.
11364 Reported by Jim Meyering.
11366 1993-11-04 François Pinard <pinard@iro.umontreal.ca>
11368 * lib/Makefile.in (dist): Correct permissions on files.
11370 * output.c: Declare tmpfile, some systems don't.
11372 1993-11-03 François Pinard <pinard@iro.umontreal.ca>
11374 * checks/Makefile.in (dist): Correct permissions on files.
11376 * Makefile.in (dist): Ensure recursive linking for subdirectory
11377 `examples', also set read/write permissions on all its files.
11379 * mkinstalldirs: New, from elsewhere.
11380 * Makefile.in: Use it.
11382 * debug.c: Synchronize debug messages and regular output when
11383 the debug file and stdout are redirected to the same file.
11384 * configure.in: Add (commented) checks for fileno and fstat.
11385 Reported by Jim Avera.
11387 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
11388 etc., arguments, then ignore the superfluous one. m4 used to
11389 diagnose missing arguments and return the empty string.
11390 Reported by Nick S. Kanakakorn.
11392 1993-11-02 François Pinard <pinard@iro.umontreal.ca>
11394 * m4.c (main): At end of all input, ensure all undiverted text
11395 goes to the main output stream.
11396 Reported by Andreas Gustafsson.
11398 * m4.c (main): exit (0), instead of return 0.
11400 * m4.c: Implement -P and --prefix-builtins.
11401 * builtin.c: Delete const specifier on builtin_tab.
11402 (prefix_all_builtins): New.
11403 Reported by Noah Friedman.
11404 Reported by Scott Bartram.
11406 * c-boxes.el: New, from elsewhere.
11407 * Makefile.in: Distribute it.
11409 * m4.h: Do not define bcopy if <string.h> defines it.
11410 Reported by Stephen Perkins.
11412 * builtin.c (define_macro): Allow a missing second argument, in
11413 which case it is implied empty. Affects define and pushdef.
11414 Reported by Eric Allman.
11416 1993-11-01 François Pinard <pinard@iro.umontreal.ca>
11418 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
11419 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
11420 * builtin.c: Initialize all the blindness fields in builtin_tab.
11421 (define_builtin): Copy the blindness of a builtin into its symbol.
11422 * macro.c (expand_token): Avoid processing a blind builtin if the
11423 next character is not an opening parenthesis.
11424 Reported by David MacKenzie.
11425 Reported by Noah Friedman.
11427 * configure.in: Ensure an exit status of 0 on completion.
11428 Reported by Vivek P. Singhal.
11430 * eval.c (eval_lex): Admit both lower and upper case letters for
11431 bases greater than 10. Only lower case letters were accepted.
11433 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
11434 Reported by Krste Asanovic.
11436 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
11437 * eval.c (logical_not_term): New name for not_term.
11438 * eval.c (xor_term): New, between or_term and and_term.
11439 * eval.c (not_term): New, between and_term and logical_not_term.
11440 * eval.c (shift_term): New, between cmp_term and add_term.
11441 Reported by Krste Asanovic: ~, ^, <<, >>.
11442 Reported by Ben A. Mesander: ** vs ^.
11444 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
11445 * m4.h: Delete xrealloc.c.
11446 * lib/xmalloc.c: New, from elsewhere.
11447 * lib/xstrdup.c: New, from elsewhere.
11448 * lib/Makefile.in: Distribute and compile them.
11450 * m4.c: Change progname to program_name.
11451 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
11452 * lib/error.c: New, from elsewhere.
11453 * lib/Makefile.in: Distribute and compile error.c.
11454 * configure.in: Check AC_VPRINTF and for strerror.
11455 * m4.c: Delete cmd_error. Use error instead.
11456 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
11458 * m4.h: Delete #define const, let Autoconf takes care of this.
11460 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
11461 Merge parse_args into main. Declare argv to be `char *const *',
11462 then remove superfluous casts.
11464 * m4.c: Rename --no-gnu-extensions to --traditional.
11465 Reported by Ben A. Mesander.
11467 * m4.c (usage): Add a status parameter. Supply one in various
11468 calls. Add --help processing. Remove -V for --version.
11470 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
11472 * lib/Makefile.in: Have an AR=ar declaration.
11473 Reported by Eric Backus.
11474 Reported by Bjorn R. Bjornsson.
11475 Reported by Tom Tromey.
11476 Reported by Kristine Lund.
11477 Reported by Marion Hakanson.
11479 1993-10-30 François Pinard <pinard@iro.umontreal.ca>
11481 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
11482 Reported by Noah Friedman.
11484 1993-10-25 François Pinard <pinard@iro.umontreal.ca>
11486 * Makefile.in: Remove MDEFINES and cleanup.
11488 1993-06-09 François Pinard <pinard@iro.umontreal.ca>
11490 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
11491 Create a gzip file.
11493 1993-02-06 François Pinard <pinard@iro.umontreal.ca>
11495 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
11496 ensure 777 mode for directories, so older tar's will restore file
11499 1993-01-17 François Pinard <pinard@iro.umontreal.ca>
11501 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
11502 so the installer can override automatically configured choices.
11503 Reported by Karl Berry.
11505 1993-01-15 François Pinard <pinard@iro.umontreal.ca>
11507 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
11508 previous version was not working properly on m68k-hp-bsd4.3.
11509 Reported by Roland McGrath.
11511 * lib/_doprnt.c: Stolen from Oleo distribution.
11512 * configure.in: Check for _doprnt.c if vfprintf.c selected.
11513 * lib/Makefile.in: Distribute _doprnt.c.
11514 Do not distribute regex.[ch].old anymore.
11516 1993-01-01 François Pinard <pinard@iro.umontreal.ca>
11518 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
11519 Richard wants it there.
11521 1992-12-27 François Pinard <pinard@iro.umontreal.ca>
11523 * Makefile.in: Add DEFS to MDEFINES.
11524 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
11525 (libm4.a): Remove the library before creating it.
11526 (distclean): Remove tags and TAGS too.
11528 1992-12-23 François Pinard <pinard@iro.umontreal.ca>
11530 * Makefile.in (dvi, m4.dvi): New goals.
11532 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
11533 macro.c, output.c, path.c, symtab.c: Change Copyright from
11534 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
11536 * examples/divert.m4: Deleted, this bug has been corrected.
11538 * Makefile.in (texclean, mostlyclean): New goals.
11540 * Makefile.in (clean): Remove clutter from ansi2knr.
11541 Reported by Pierre Gaumond.
11543 1992-12-20 François Pinard <pinard@iro.umontreal.ca>
11545 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
11546 might well use CFLAGS is s/he needs it.
11548 * Makefile.in: Allow installation of info files from a separate
11550 Reported by Jason Merrill.
11551 Reported by David MacKenzie.
11552 Reported by Skip Montanaro.
11553 Reported by Erez Zadok.
11554 Reported by Assar Westerlund.
11556 1992-12-19 François Pinard <pinard@iro.umontreal.ca>
11559 This is still a beta release for the future GNU m4 version 1.1.
11561 * lib/alloca.c: New, from elsewhere.
11562 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
11564 * m4.h: Do not define index/rindex if already defined. If
11565 FALSE/TRUE are already defined, do not redefine them, but merely
11566 define boolean typedef to int.
11568 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
11569 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
11570 because some C compilers do not like connectives with #ifdef.
11571 * m4.h: Define `volatile' only if __GNUC__, instead of once for
11572 __GNUC__ and once for __STDC__.
11573 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
11575 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
11576 Makefile dependencies. Without it, make keeps destroying and
11577 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
11579 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
11580 to diversion/DIVERSION, this was a spelling error.
11582 * m4.c: Declare version[], remove #include "version.h".
11583 * version.h: Deleted.
11584 * Makefile.in: Remove references to version.h.
11586 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
11587 production, by using a simpler and more robust algorithm. This
11588 solves the problem of synclines sometimes written in the middle of
11589 an output line. Delete sync_line() and output_lines variable.
11590 * m4.h: Remove sync_line prototype and output_lines declaration.
11591 * input.c (next_char), output.c (shipout_text): Remove references
11593 * input.c (push_file, pop_file): Merely put the value -1 in
11594 output_current_line instead of calling sync_line, for delaying a
11595 single `#line NUM FILE' before next output line. Do not test
11596 for sync_output, because this is unnecessary clutter.
11597 * output.c (make_divertion, insert_divertion): Idem.
11598 * input.c: Rename must_advance_line to start_of_input_line, for
11601 * debug.c (trace_header): Select a new debug line format, which
11602 better complies with GNU standards for formatting error messages.
11603 With option `-dfl', M-x next-error might be used on the output.
11604 * m4.c (vmesg): Adjust format of error output to GNU standards.
11605 * m4.texinfo: Adjust examples for `make check' to work.
11607 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
11608 case for enum debug_info constants, which were all lower case.
11610 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
11612 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
11613 collected patches. I tried a few times using newer regex.[ch], it
11614 mysteriously stopped aborting with this one. Insecure feeling...
11615 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
11617 1992-12-18 François Pinard <pinard@iro.umontreal.ca>
11619 * m4.c: Change `--no-warnings' to `--silent'.
11620 Reported by David MacKenzie.
11622 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
11623 leave it off for now. See comment in m4.c for justification.
11624 Reported by David MacKenzie.
11626 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
11627 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
11629 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
11631 * Makefile.in: Ensure recursive cleaning is done before local
11632 cleaning for all clean goals.
11634 * builtin.c (ntoa): Ensure the value is always interpreted as a
11635 signed quantity, whatever the radix is.
11637 1992-11-18 Jim Meyering <meyering@idefix>
11639 * builtin.c, format.c, input.c: Split long lines.
11640 * m4.c: Use typedef macro_definition instead of struct
11642 * symtab.c: Use typedef symbol instead of struct symbol.
11644 1992-11-17 François Pinard <pinard@iro.umontreal.ca>
11646 * *.[ch]: Remove all trailing whitespace, in code and comments.
11648 * configure.in: Find some awk.
11649 * Makefile.in: Add $(AWK) to MDEFINES.
11650 * checks/Makefile.in: Transmit $(AWK) to get_them.
11651 * checks/get_them: Use $AWK instead of gawk. Add a close in the
11652 awk script when switching files, because without this, mawk runs
11653 out of file descriptors.
11655 1992-11-16 François Pinard <pinard@iro.umontreal.ca>
11657 * Makefile.in (realclean): Delete m4.info*.
11658 Reported by Jim Meyering.
11660 * Makefile.in: Adjust and link with checks/Makefile.
11661 * checks/Makefile.in: New.
11662 * configure.in: Output checks/Makefile.
11664 * checks/get_them: Have the dnl header of each test more
11665 recognizable by next-error, also use a better message.
11667 1992-11-16 Jim Meyering <meyering@idefix>
11669 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
11670 And use that only if __GNUC__ since we're using it's GCC-specific
11671 semantics that tell the compiler the associated function doesn't
11674 * builtin.c (substitute): Don't use character as an array index.
11675 (dumpdef_cmp): Make formal arguments `const void *' to avoid
11676 warnings with gcc -W -Wall on systems with qsort prototype.
11677 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
11680 * eval.c (most functions): Add parentheses to assignments used
11681 as truth values go avoid warnings from gcc -Wall.
11683 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
11684 any functions that don't need external scope.
11686 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
11687 (many functions and arrays): Declare `const'.
11689 1992-11-15 François Pinard <pinard@iro.umontreal.ca>
11691 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
11692 removing the declaration from m4.h. Also rename false to FALSE
11695 * lib/Makefile.in (Makefile): New goal.
11697 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
11698 so heavily loaded. It gets more easily overridable, calling make.
11699 Reported by Jim Meyering.
11701 * Makefile.in (dist): Get .fname from the current directory name,
11702 instead of from version.h. I need updating many files manually,
11703 when the version changes, version.h is just one of them.
11705 1992-11-14 François Pinard <pinard@iro.umontreal.ca>
11707 * m4.h: Remove the tag `boolean' on the enum introducing typedef
11708 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
11709 Reported by Tom McConnell.
11711 1992-11-13 François Pinard <pinard@iro.umontreal.ca>
11713 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
11714 39.cleardiv, which were describing missing or spurious newlines.
11715 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
11716 do not depend on machine word size, `/bin/false' implementation,
11717 or `wc' output format. `make check' is more dependable, now.
11719 * checks/check_them: Summarize the failed tests by listing their
11720 name, at end. If none, issue `All checks successful'. Output
11721 `Checking' instead of `Input file:'.
11723 * checks/get_them, checks/check_them: Reindented.
11725 * Makefile.in (dist): chmod a+r before making the tar file.
11727 1992-11-12 François Pinard <pinard@iro.umontreal.ca>
11729 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
11731 * input.c (next_token): Reinitialize token_buttom just after using
11732 it as a watermark with obstack_free. Or else, a future token, big
11733 enough for triggering reallocation of the obstack chunk, could
11734 void the initialized value of token_buttom, later causing panic in
11735 obstack_free. Rename token_buttom to token_bottom everywhere.
11737 * m4.h: Before declaring errno, first include <errno.h> and
11738 ensure that it does not define errno.
11739 Reported by Richard Stallman.
11741 1992-11-11 François Pinard <pinard@iro.umontreal.ca>
11743 * builtin.c: Define and use DECLARE macro for builtins.
11745 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
11746 argument, this is a common idiom for introducing long comments.
11748 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
11749 arguments. The last argument was silently ignored.
11751 * m4.c (cmd_error): Add a missing semicolon before va_end().
11753 1992-11-10 François Pinard <pinard@iro.umontreal.ca>
11755 * Makefile.in: Now handle protoized sources. Define and use U.
11756 Compile and use ansi2knr with old compilers. Update DISTFILES.
11757 Add `aclocal.m4' to `configure' dependencies.
11758 * ansi2knr.c: New, from Ghostscript distribution.
11759 * configure.in: Define U through FP_PROTOTYPES for old compilers.
11760 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
11761 * aclocal.m4: New, provide FP_PROTOTYPES.
11762 * m4.h: Conditionnaly protoized through Args, save for varags.
11763 * builtin.c: Protoized. Then:
11764 Include <sys/types.h> if size_t is not defined, before "regex.h".
11765 (m4_ifelse): Fetch built-in name properly for diagnostic.
11766 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
11767 (m4_regexp): Add const to `msg' declaration.
11768 (m4_patsubst): Add const to `msg' declaration.
11769 * debug.c: Protoized, save for varargs.
11770 * eval.c: Protoized.
11771 * format.c: Protoized.
11772 * input.c: Protoized.
11773 * m4.c: Protoized, save for varargs. Then:
11774 (xfree): Accept void * instead of char *.
11775 (xmalloc): Return void * instead of char *.
11776 (xrealloc): Accept and return void * instead of char *.
11777 * macro.c: Protoized.
11778 * output.c: Protoized.
11779 * path.c: Protoized. Then cast some (char *) over xmalloc's.
11780 * symtab.c: Protoized.
11782 1992-11-06 François Pinard <pinard@iro.umontreal.ca>
11784 * m4.texinfo: Remove directory from diagnostics in 30.include,
11785 51.eval, 56.errprint and 57.m4exit tests.
11787 * m4.h: Remove declarations for int or void system functions, they
11788 cause more conflicting trouble than they make good.
11790 * configure.in: Avoid configuration header file. Add some tests.
11791 * m4.h: Remove #include "config.h".
11792 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
11793 Then, rewritten for better compliance with GNU standards.
11795 1992-11-05 François Pinard <pinard@iro.umontreal.ca>
11797 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
11798 because of a misplaced #endif.
11800 * Many *.[hc] files: Correct intra-line spacing here and there,
11801 according to GNU indent 1.6 advice.
11803 * configure.in: New, using Autoconf 1.2.
11804 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
11805 * Delete old configure.in, configure, etc/configure.in,
11806 etc/configure, lib/configure.in, lib/configure and config/*.
11807 Reported by Jason Merrill.
11809 * symtab.c (hash): Change (char) NULL to '\0'.
11810 Reported by Jason Merrill.
11812 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
11813 etc/nextvers.sh. Release numbers will be edited `by hand'.
11814 * version.h: De-automatize, force value in.
11816 * m4.c: Changes in order to use a newer getopt.h.
11817 Reported by David MacKenzie.
11819 * checks/: New name for examples/.
11820 * checks/get_them: New location for etc/get_examples.
11821 * checks/check_them: New location for etc/check_examples.
11822 * Makefile.in, checks/get_them, checks/check_them: Adjust.
11823 * lib/vfprintf.c: New location for etc/vfprintf.c.
11824 * Delete empty etc/.
11825 * examples/: New name for test/.
11827 1992-03-10 François Pinard <pinard@iro.umontreal.ca>
11829 * Makefile.in (check): Add m4 as dependency.
11831 * m4.c: Accept --no-warnings instead of --no_warnings, and
11832 --no-gnu-extensions instead of --no_gnu_extensions. Make the
11833 usage message more informative.
11834 Reported by David MacKenzie.
11836 1992-03-09 François Pinard <pinard@iro.umontreal.ca>
11838 * etc/check_examples: New name for check_examples.sh.
11839 * etc/get_examples: New name for get_examples.sh.
11840 * Makefile.in, etc/Makefile.in: Use new names.
11842 * Makefile.in: Transmit $(CC) while making in lib.
11844 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
11845 code disposition by hand.
11847 1992-03-08 François Pinard <pinard@iro.umontreal.ca>
11849 * m4.h: Delete definitions for abort() and exit().
11850 Reported by Richard Stallman.
11852 * config/hmake-unicos, config/s-unicos.h: New files.
11853 Reported by Hal Peterson.
11855 * eval.c (exp_term): Have N^0 return 1.
11856 Reported by Michael Fetterman.
11858 * eval.c, input.c, m4.h: Remove last comma in enums.
11859 Reported by Mike Lijewski.
11861 * Transfer of maintenance duties from René to François.
11863 1991-10-24 René Seindal <seindal@diku.dk>
11865 * Release 1.0. Many thanks to those, who provided me with bug
11866 reports and feedback.
11868 * Uses GNU configure, taken from the gdb distribution.
11870 * Uses GNU getopt(), with long option names.
11872 * The -Q/+quiet option is added, which suppresses warnings about
11873 missing or superflous arguments to built-in macros.
11875 * Added default options via the M4OPTS environment variable.
11877 * The built-in format can now be configured to use sprintf as
11878 the formatting engine, for systems without [efg]cvt(3).
11880 * GNU library code is moved to the ./lib subdirectory; other
11881 utility files are now in ./etc.
11883 * Several minor bugs have been fixed.
11885 1991-07-26 René Seindal <seindal@diku.dk>
11887 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
11888 François Pinard and Roland H. Pesch for providing me with reports.
11890 * The builtins incr and decr are now implemented without use of
11893 * The builtin indir is added, to allow for indirect macro calls
11894 (allows use of "illegal" macro names).
11896 * The debugging and tracing facilities has been enhanced
11897 considerably. See the manual for details.
11899 * The -tMACRO option is added, marks MACRO for tracing as soon
11902 * Builtins are traced after renaming iff they were before.
11904 * Named files can now be undiverted.
11906 * The -Nnum option can be used to increase the number of
11907 divertions available.
11909 * Calling changecom without arguments now disables all comment
11912 * The function m4_patsubst() is now consistently declared
11915 * A bug in dnl is fixed.
11917 * A bug in the multi-character quoting code is fixed.
11919 * Several typos in the manual has been corrected. More probably
11922 * The m4.info file is now installed along with the program.
11924 1990-11-15 René Seindal <seindal@diku.dk>
11926 * Updated and enhanced version. Release 0.75, manual 0.07.
11928 * Implemented search path for include files (-I option and
11929 M4PATH envronment variable).
11931 * Implemented builtin "format" for printf-like formatting.
11933 * Implemented builtin "regexp" for searching for regular
11936 * Implemented builtin "patsubst" for substitution with regular
11939 * Implemented builtin "esyscmd", which expands to a shell
11942 * Implemented "__file__" and "__line__" for use in error
11945 * Implemented character ranges in "translit".
11947 * Implemented control over debugging output.
11949 * Implemented multi-character quotes.
11951 * Implemented multi-character comment delimiters.
11953 * Changed predefined macro "gnu" to "__gnu__".
11955 * Changed predefined macro "unix" to "__unix__", when the -G
11956 option is not used. With -G, "unix" is still defined.
11958 * Changed "shift", "$@" and "$*" to not insert spaces afters
11961 * Added program name to error messages.
11963 * Fixed two missing null bytes bugs.
11965 1990-01-22 René Seindal <seindal@diku.dk>
11967 * Initial beta release. Release 0.50, manual 0.05.
11976 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
11977 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
11979 Copying and distribution of this file, with or without
11980 modification, are permitted provided the copyright notice
11981 and this notice are preserved.