1 2009-02-18 Eric Blake <ebb9@byu.net>
3 Synchronize THANKS with branch.
4 * THANKS: Import more names.
6 Improve handling of $ in syntax table.
7 * m4/m4module.h (m4_is_syntax_single_dollar): New function.
8 (M4_SYNTAX_DOLLAR, M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): Change to
9 be context rather than basic syntax categories.
10 (M4_SYNTAX_MASKS): Adjust macro.
11 * m4/m4private.h (struct m4_syntax_table): Add dollar and
12 is_single_dollar members.
13 (m4_is_syntax_single_dollar): Add fast alternative.
14 * m4/syntax.c (m4_syntax_create, reset_syntax_set): Adjust to
15 account for change to context categories.
16 (m4_set_syntax): Manage is_single_dollar.
17 (m4_is_syntax_single_dollar): New function.
18 * m4/macro.c (locate_dollar): New helper function.
19 (process_macro): Use it to speed up macro expansion.
20 * m4/input.c (m4__next_token): Adjust client.
21 * doc/m4.texinfo (Changesyntax): Document this.
23 2009-02-17 Eric Blake <ebb9@byu.net>
25 Sync changecom documentation with branch.
26 * doc/m4.texinfo (Changecom): Tweak wording.
27 * NEWS: Import changes from the branch.
29 Stage 29b: Process quotes and comments by buffer, not bytes.
30 Search for quote and comment delimiters by buffer when possible.
32 Speed impact: noticeable improvement, from fewer function calls.
33 * ltdl/m4/gnulib-cache.m4: Import memchr2 module.
34 * m4/input.c (m4__next_token): Add buffer reads to quote and
36 * NEWS: Document this.
38 2009-02-16 Eric Blake <ebb9@byu.net>
40 Stage 29a: Process dnl and macro names by buffer, not bytes.
41 Enhance input engine to provide lookahead buffer, rather than
42 forcing clients to call next_char for every byte. Utilize this
43 for the simplest clients.
45 Speed impact: noticeable improvement, from fewer function calls.
46 * ltdl/m4/gnulib-cache.m4: Import freadptr and freadseek modules.
47 * m4/input.c (struct input_funcs): Add virtual functions
48 buffer_func and consume_func.
49 (file_buffer, file_consume, string_buffer, string_consume)
50 (composite_buffer, composite_consume, eof_buffer): Implement
52 (file_funcs, string_funcs, composite_funcs, eof_funcs): Update
54 (buffer_retry): New sentinel.
55 (next_buffer, consume_buffer): New functions.
56 (m4_skip_line, match_input, consume_syntax): Use them for faster
58 Suggested by Bruno Haible.
60 Unify single and multi-character delimiter handling.
61 * m4/input.c (MATCH): Add a parameter.
62 (m4__next_token): Simplify logic and reduce redundancy.
63 (m4__next_token_is_open): Adjust caller.
64 * m4/syntax.c (m4_set_comment, m4_set_quotes): Handle delimiters
66 (m4_set_syntax): Recognize restoration of single delimiters.
68 Revamp changesyntax vs. changequote interactions.
69 * m4/m4module.h (M4_SYNTAX_VALUE): Delete unused macro.
70 (M4_SYNTAX_SUSPECT): New macro.
71 * m4/m4private.h (struct m4_syntax_table): Add suspect field.
72 * m4/syntax.c (check_is_single_quotes, check_is_single_comments)
73 (check_is_macro_escaped): Delete, by inlining body...
74 (m4_set_syntax): ...into here. Improves handling between
75 changesyntax and changequote/changecom.
76 (add_syntax_set, subtract_syntax_set, set_syntax_set): Simplify,
77 and let suspect field track needed cleanup.
78 (m4_set_quotes, m4_set_comment): Adjust meaning of
79 is_single_quotes and is_single_comment flags to always be true if
80 only one delimiter exists, regardless of its length. Ensure that
81 the syntax categories M4_SYNTAX_LQUOTE and M4_SYNTAX_BCOMM are
82 only used on 1-byte delimiters.
83 (add_syntax_attribute, remove_syntax_attribute): Change signature
84 to allow the use of fewer casts. Adjust the suspect field when
86 (m4_reset_syntax, set_quote_age): Adjust callers.
87 * m4/input.c (m4__next_token, m4__next_token_is_open): Simplify
89 * doc/m4.texinfo (Changesyntax): Update documentation and tests.
91 Improve changesyntax documentation.
92 * doc/m4.texinfo (Changesyntax): Merge two tables into one
95 Fix regression in multicharacter quotes, from 2008-01-26.
96 * m4/input.c (m4__next_token): Fix typo.
97 * tests/builtins.at (changequote): Enhance test.
99 2009-02-13 Eric Blake <ebb9@byu.net>
101 Speed up parsing when detecting input file change.
102 * m4/input.c (next_char): Clear input_change flag. Bug introduced
105 2009-02-12 Eric Blake <ebb9@byu.net>
107 Avoid quadratic code when walking definition stack.
108 * examples/stack_sep.m4: Use linear, not quadratic
110 * doc/m4.texinfo (Improved copy): Fix documentation, based on
111 recent autoconf bug fix.
112 * tests/others.at (recursion): Enhance test.
114 2009-02-11 Eric Blake <ebb9@byu.net>
116 Stage 28c: Warn on embedded NUL in remaining cases.
117 Ensure all remaining warnings can handle embedded NUL.
119 Speed impact: none noticed.
120 * m4/m4module.h (m4_debug_decode, m4_parse_truth_arg): Add
122 * m4/macro.c (m4_macro_call): Improve diagnostic.
123 * modules/m4.c (defn): Likewise.
124 * m4/debug.c (m4_debug_decode): Handle embedded NUL.
125 * m4/utility.c (m4_parse_truth_arg): Likewise.
126 * modules/format.c (arg_int, arg_long, arg_double): Likewise.
127 (arg_string): New function.
128 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Update callers.
129 * src/main.c (main): Likewise.
130 * src/freeze.c (reload_frozen_state): Likewise.
131 * modules/gnu.c (debugmode, syncoutput): Likewise.
132 * tests/options.at (--regexp-syntax): Adjust test.
133 * tests/freeze.at (reloading nul): Likewise.
134 * tests/null.m4: Likewise.
135 * tests/null.out: Likewise.
136 * tests/null.err: Likewise.
138 Stage 28b: Warn on embedded NUL in file arguments.
139 Quote warning messages related to file and other NUL-terminated
142 Speed impact: none noticed.
143 * m4/path.c (m4_path_search): Quote file names in message.
144 * modules/m4.c (syscmd, include, m4_make_temp): Handle embedded
146 * modules/gnu.c (debugfile, esyscmd): Likewise.
147 * tests/others.at (nul character): Adjust test.
148 * tests/builtins.at (mkdtemp, mkstemp): Likewise.
149 * tests/null.m4: Likewise.
150 * tests/null.out: Likewise.
151 * tests/null.err: Likewise.
153 Stage 28a: Warn on embedded NUL in numeric arguments.
154 Quote warning messages related to numeric parsing in order to
157 Speed impact: none noticed.
158 * m4/m4module.h (m4_numeric_arg): Adjust prototype.
159 * m4/utility.c (m4_numeric_arg): Add parameter.
160 * modules/gnu.c (debuglen): Adjust callers.
161 * modules/m4.c (incr, decr, divert, undivert, m4exit, substr)
163 * modules/evalparse.c (m4_evaluate): Likewise.
164 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
165 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
167 * doc/m4.texinfo (Changesyntax): Fix typo.
168 * tests/others.at (nul character): Adjust test.
169 * tests/null.m4: Likewise.
170 * tests/null.out: Likewise.
171 * tests/null.err: Likewise.
173 2009-02-11 Eric Blake <ebb9@byu.net>
175 Avoid regression in popdef(undef).
176 * doc/m4.texinfo (Trace): Enhance test, to cover regression
177 recently fixed on the branch.
179 2009-02-09 Eric Blake <ebb9@byu.net>
181 Enhance index to support starting offset.
182 * modules/m4.c (index): Add optional third argument.
183 * NEWS: Document this.
184 * doc/m4.texinfo (Index macro): Likewise.
185 (Macro Arguments): Adjust tests.
187 2009-01-24 Eric Blake <ebb9@byu.net>
189 Add URLs to --help output.
190 * src/main.c (usage): Use enhanced version-etc features.
192 2009-01-07 Eric Blake <ebb9@byu.net>
194 Enhance substr to support replacement text.
195 * doc/m4.texinfo (Substr): Document new semantics.
196 * modules/m4.c (substr): Support optional fourth argument.
197 * NEWS: Document this.
199 Enhance substr to support negative values.
200 * doc/m4.texinfo (Substr): Document new semantics, and how to
202 * modules/m4.c (substr): Support negative values.
203 * NEWS: Document this.
205 2009-01-05 Eric Blake <ebb9@byu.net>
208 * HACKING: Remove mention of xdelta.
209 * Makefile.am (EXTRA_DIST, MAINTAINERCLEANFILES): Let gnulib take
210 care of distributing gendocs.sh.
211 * maint.mk (web-manual): Use new feature of gendocs.
212 * ltdl/m4/gnulib-cache.m4: Regenerate.
214 2008-12-24 Eric Blake <ebb9@byu.net>
216 Relax eval as allowed by POSIX 2008.
217 * modules/evalparse.c (m4_evaluate): Warn, not error, on invalid
218 operator. Quote expression in warning.
219 * modules/mpeval.c (includes): Add quotearg.h.
220 * doc/m4.texinfo (Eval, Improved forloop): Update tests.
221 * NEWS: Update to reflect 1.6 support for `?:'.
223 2008-12-23 Eric Blake <ebb9@byu.net>
225 Add debugmode(o) to control dumpdef output location.
226 * m4/m4module.h (M4_DEBUG_TRACE_OUTPUT_DUMPDEF): New enumerator.
227 (M4_DEBUG_TRACE_VERBOSE): Update.
228 * m4/debug.c (m4_debug_decode): Support new debug option.
229 * src/freeze.c (produce_debugmode_state): Likewise.
230 * modules/m4.c (dumpdef): When set, force dumpdef to stderr rather
232 * src/main.c (usage): Document it.
233 * doc/m4.texinfo (Debugmode, Dumpdef, Debugging options)
234 (Debugfile): Likewise.
236 Based on an autoconf bug report by Paolo Bonzini.
238 Make --debugfile argument optional.
239 * src/main.c (long_options): Make the argument optional, to allow
240 setting debug file back to stderr.
241 (main): Make --debugfile order-dependent.
242 (usage): Document this.
243 * doc/m4.texinfo (Debugging options): Likewise.
245 * tests/options.at (--debugfile): Enhance test.
246 (--safer): Adjust to new semantics.
248 2008-12-22 Eric Blake <ebb9@byu.net>
251 * doc/m4.texinfo (Operation modes, Preprocessor features)
252 (Limits control, Frozen state, Debugging options)
253 (Dynamic loading features): Use lower case names in @var.
254 (Improved copy): Use @code, not @var, as appropriate.
256 2008-12-18 Eric Blake <ebb9@byu.net>
258 Deal with M4 1.4.x limitation on builtin tokens.
259 * doc/m4.texinfo (Composition): Mention limitation on curry.
260 (Improved copy): New node.
262 * examples/stack.m4: Likewise.
263 * examples/stack_sep.m4: New file.
264 * Makefile.am (dist_pkgdata_DATA): Distribute it.
266 2008-12-15 Eric Blake <ebb9@byu.net>
268 Double size of temp file cache.
269 * m4/output.c (tmp_file, tmp_file_owner): Split...
270 (tmp_file1, tmp_file2, tmp_file1_owner, tmp_file2_owner): ...into
272 (tmp_file2_recent): New variable.
273 (m4_tmpopen, m4_tmpclose, m4_tmpremove, m4_tmprename)
274 (m4_output_exit): Adjust callers.
276 Use fewer seeks on cached files.
277 * m4/output.c (m4_tmpfile): Use write, not append mode.
278 (m4_tmpopen): Add parameter to decide when to skip seeks.
279 (m4_tmprename, m4_make_diversion, insert_diversion_helper)
280 (m4_freeze_diversions): Adjust callers.
282 Cache most recently spilled diversion.
283 * m4/output.c (tmp_file, tmp_file_owner): New variables, for
284 1-deep cache of spilled diversions.
285 (m4_tmpfile): Open in append mode, since we might revisit
286 diversion without closing it now.
287 (m4_tmpopen): Check cache first.
288 (m4_tmpclose): Update cache, rather than closing. Add parameter.
289 (m4_tmpremove): Close cache before removing.
290 (m4_tmprename): Deal with open files when renaming.
291 (m4_output_exit): Close cache before exiting.
292 (make_room_for, m4_make_diversion, insert_diversion_helper):
294 * ltdl/m4/m4-rename.m4 (M4_RENAME): New file.
295 * configure.ac (M4_RENAME): Invoke it.
297 Correctly track size of in-memory diversions.
298 * m4/output.c (insert_diversion_helper): Correctly track total
299 in-memory diversion size after undivert.
301 Avoid quadratic behavior for some cases of divert/undivert.
302 * m4/output.c (struct m4_diversion): Improve comments.
303 (m4_tmpname, m4_make_diversion): Strengthen preconditions.
304 (m4_tmprename): New function.
305 (m4_output_init, m4_output_exit): Move after internal functions.
306 (make_room_for): Don't bother copying uninitialized bytes.
307 (insert_diversion_helper): Transfer metadata, rather than copying
308 contents, when undiverting into a previously unused diversion.
309 * tests/builtins.at (divert): Add a check to the test.
310 * doc/m4.texinfo (Undivert): Enhance test.
311 * NEWS: Document the speedup.
313 2008-12-02 Eric Blake <ebb9@byu.net>
315 Stage 27: Allow embedded NUL in text processing macros.
316 Pass NUL through regular expressions, format, and translit, and
317 diagnose it in eval and changeresyntax. Improve warning
318 capabilities of format.
320 Speed impact: none noticed.
321 * modules/m4.c (m4_expand_ranges): Don't append extra bytes.
322 (translit): Manage NUL bytes.
323 * modules/format.c (format): Likewise.
324 * modules/gnu.c (substitute, regexp_substitute): Likewise.
325 (m4_resyntax_encode_safe): Add parameter.
326 (regexp, patsubst, renamesyms): Update callers.
327 (regexp_compile): Adjust error message.
328 * modules/evalparse.c (m4_evaluate): Use consistent message.
329 (end_text): New variable.
330 (eval_init_lex): Add parameter.
331 (eval_lex): Detect embedded NUL.
332 * src/freeze.c (reload_frozen_state): Likewise.
333 * doc/m4.texinfo (Format): Update to cover new behavior.
334 (Eval): Mention that result is unquoted.
335 * tests/freeze.at (reloading nul): Enhance test.
336 * tests/null.m4: Likewise.
337 * tests/null.err: Update expected output.
338 * tests/null.out: Likewise.
339 * tests/options.at (--regexp-syntax): Likewise.
341 2008-11-28 Eric Blake <ebb9@byu.net>
343 Resync NEWS with branches.
344 * NEWS: Mention 1.4.12, update state of 1.6.
346 2008-11-26 Eric Blake <ebb9@byu.net>
348 Keep COPYING in repository.
349 * Makefile.am (MAINTAINERCLEANFILES): Don't remove COPYING.
350 * .cvsignore: Don't ignore it.
351 * .gitignore: Likewise.
352 * COPYING: Store in repository, per automake 1.10.2
355 2008-11-26 Eric Blake <ebb9@byu.net>
357 Document optimized forloop.
358 * doc/m4.texinfo (Improved forloop): Mention alternate style that
359 avoids define overhead.
360 * examples/forloop3.m4: New file.
361 * Makefile.am (dist_pkgdata_DATA): Distribute it.
363 Document copy composite using stack_foreach and curry.
364 * doc/m4.texinfo (Stacks): New node, to document pushdef stack
366 (Ifelse): Move define_blind...
367 (Composition): ...to this new node. Document currying, then use
368 it to implement copy and rename.
369 * examples/curry.m4: New file.
370 * examples/stack.m4: Likewise.
371 * Makefile.am (dist_pkgdata_DATA): Distribute them.
373 2008-11-04 Eric Blake <ebb9@byu.net>
376 * ltdl/m4/gnulib-cache.m4: Replace fdl module with fdl-1.3.
377 * Makefile.am (doc_m4_TEXINFOS, MAINTAINERCLEANFILES): Reflect
379 * doc/m4.texinfo (GNU Free Documentation License): Likewise.
381 2008-10-22 Eric Blake <ebb9@byu.net>
383 Give nicer error if user modifies testsuite but lacks autoconf.
384 * Makefile.am (AUTOM4TE): Use missing in the definition.
386 2008-10-09 Eric Blake <ebb9@byu.net>
388 Allow user to choose which sed to use in testsuite.
389 * tests/atlocal.in (SED): Inherit from configure results.
390 * tests/builtins.at (__m4_@&t@version__, divert, esyscmd)
391 (mkstemp, syscmd): Use $SED.
392 * tests/generate.awk (new_test): Likewise.
393 * tests/options.at (deprecated options, unknown option)
394 (--debugmode, --help and --version): Likewise.
395 * tests/testsuite.at (AT_CHECK_M4): Likewise.
396 * tests/others.at (directory, stderr closed, stdin seekable)
397 (stdout closed): Likewise.
398 (nul character): Likewise. Also, skip test if sed can't handle
401 Clean up testsuite invocation.
402 * tests/atlocal.in: Fix copyright notice.
403 * Makefile.am (TESTS_ENVIRONMENT): Delete; it wasn't being used.
404 (check-local, installcheck-local): Adjust clients. Add missing
407 2008-09-25 Eric Blake <ebb9@byu.net>
409 Tweak error message on command line failure.
410 * m4/m4private.h (includes): Use "quotearg.h".
411 * src/main.c (process_file, main): Use nicer quotes for file name
413 * m4/input.c (file_clean, m4_push_file): Likewise.
414 * m4/module.c (m4__module_open): Likewise.
415 * src/freeze.c (produce_frozen_state, reload_frozen_state):
417 * modules/gnu.c (debugfile): Likewise.
418 * modules/m4.c (undivert, include): Likewise.
419 * tests/others.at (directory, stdin closed): Update tests.
420 * tests/options.at (file names, --debugmode): Likewise.
421 * doc/m4.texinfo (Debugmode): Likewise.
423 Unify error handling for reading directories.
424 * m4/path.c (m4_path_search): Factor open attempts...
425 (m4_fopen): ...into new function, to reject directories.
426 * tests/others.at (directory): Enhance test.
427 * doc/m4.texinfo (Include): Document that directories cannot be
430 Avoid bugs on platforms that mishandle trailing /.
431 * ltdl/m4/gnulib-cache.m4: Import fopen module.
432 * tests/others.at (directory): New test.
434 2008-09-16 Eric Blake <ebb9@byu.net>
436 Fix bootstrap for Solaris /bin/sh.
437 * bootstrap: Avoid shell quoting pitfall.
439 2008-09-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
441 Typos in source code comments.
442 * modules/m4.c: Fix typos in comments.
443 * m4/input.c: Likewise.
444 * src/main.c: Likewise.
446 2008-08-29 Eric Blake <ebb9@byu.net>
448 Fix manual date information.
449 * doc/m4.texinfo: UPDATED refers to the day the manual was built,
450 not the release date of M4.
451 Based on a bison patch by Akim Demaille.
453 2008-08-27 Eric Blake <ebb9@byu.net>
456 * doc/m4.texinfo (Invoking m4): Fix example, since order of -d
460 2008-08-23 Eric Blake <ebb9@byu.net>
462 Allow debugmode control over whether defn(undef) warns.
463 * ltdl/m4/gnulib-cache.m4: Import verify module.
464 * m4/m4module.h (M4_DEBUG_TRACE_DEREF, M4_DEBUG_TRACE_INITIAL):
466 (M4_DEBUG_TRACE_VERBOSE, M4_DEBUG_TRACE_DEFAULT): Adjust.
467 * m4/m4.c (m4_create): Start with debugmode = d.
468 * src/main.c (usage): Mention this.
469 (main): Let -E impact debug mode.
470 * m4/utility.c (m4_symbol_value_lookup): Squelch undefined warning
472 * modules/gnu.c (builtin, inder): Likewise.
473 * m4/debug.c (m4_debug_decode): Parse new mode.
474 * src/freeze.c (produce_debugmode_state): Accomodate new mode.
475 * doc/m4.texinfo (Debugging options): Mention change in the
477 (Debugmode): Mention new flag d.
478 (Operation modes): Mention interaction with -E.
479 (Undefine, Defn, Pushdef, Indir, Builtin, Dumpdef): Document and
481 * tests/options.at (--debugmode): Update tests.
482 * tests/freeze.at (reloading debugmode): Likewise.
483 * NEWS: Document this.
484 Reported by Ralf Wildenhues; without this patch, M4 1.6+ would be
485 incompatible with Autoconf 2.62.
487 2008-08-22 Eric Blake <ebb9@byu.net>
489 Improve --debugmode behavior.
490 * m4/m4module.h (m4_debug_decode): Simplify interface.
491 * m4/debug.c (m4_debug_decode): Remove parameter, and handle
492 setting the new value.
493 * modules/gnu.c (debugmode): Adjust caller.
494 * src/freeze.c (reload_frozen_state): Likewise.
495 * src/main.c (main): Likewise.
496 (usage): Fix default for --debug.
497 * doc/m4.texinfo (Debugging options): Add an example.
499 2008-08-21 Eric Blake <ebb9@byu.net>
501 Avoid regression in defn(undef).
502 * doc/m4.texinfo (Trace): Enhance test, to cover regression
503 recently fixed on the branch.
505 2008-08-18 Eric Blake <ebb9@byu.net>
507 Remove deprecated -N option; fixes a regression from 2006-09-14.
508 * src/main.c (DIVERSIONS_OPTION): Delete.
509 (long_options, OPTSTRING, main): Remove -N/--diversions option.
510 * doc/m4.texinfo (Limits control): Remove it from the manual.
511 * NEWS: Mention that it is gone.
512 * tests/options.at (deprecated options): Update test.
514 Improve 'git diff' of manual source.
515 * .gitattributes (*.texi*): Add diff attribute.
516 * bootstrap: Tell git how to use it.
517 Inspired by Jim Meyering's similar patch for coreutils.
519 2008-08-07 Bruno Haible <bruno@clisp.org> (tiny change)
521 Run m4 tests prior to gnulib unit tests.
522 * Makefile.am (SUBDIRS): Swap order of directories.
524 2008-08-03 Eric Blake <ebb9@byu.net>
526 Stage 26: Allow embedded NUL in macro definitions.
527 Clean up final few locations that did not track macro definitions
528 by length, to allow embedded NUL. Make m4_arg_len callers aware
529 of issue of flattening builtins when determining length.
531 Speed impact: none noticed.
532 * m4/m4module.h (m4_arg_len): Add parameter.
533 (M4ARGLEN): Provide default for the parameter.
534 * m4/m4private.h (includes): Share xmemdup0.h among all libm4
536 * m4/macro.c (m4_arg_len): Fail if builtins are not flattened.
537 * m4/syntax.c (includes): Rely on m4private.h for xmemdup0.
538 * m4/symtab.c (includes): Likewise.
539 (m4_symbol_value_copy): Use xmemdup0.
540 * m4/module.c (install_macro_table): Likewise.
541 * src/freeze.c (reload_frozen_state): Likewise.
542 * tests/freeze.at (reloading nul): Enhance test.
543 * tests/null.m4: Likewise.
544 * tests/null.err: Update expected output.
545 * tests/null.out: Likewise.
547 Fix regression in commenting unbalanced quotes, from 2008-02-16.
548 * m4/m4private.h (m4__token_type): Add M4_TOKEN_COMMENT.
549 * m4/input.c (m4__next_token, m4_print_token): Supply new token
551 * m4/macro.c (expand_token): Penalize comments, as they can
552 contain unbalanced quotes; latent bug since 2007-12-07, exposed by
553 passing $@ references built from comments.
554 (expand_argument): Adjust caller.
555 * tests/others.at (Comments): Enhance test to catch it.
556 * NEWS: Mention the fix.
558 2008-07-30 Eric Blake <ebb9@byu.net>
560 Fix regression in trace output, introduced 2008-05-08.
561 * m4/input.c (m4__push_symbol): When cloning chains, break pointer
562 back to original chain; latent bug from 2008-02-02 that did not
563 cause misbehavior until trace output read unfinished chain.
564 * tests/builtins.at (debug): Add test for this.
566 2008-07-28 Eric Blake <ebb9@byu.net>
568 Optimize iteration examples.
569 * examples/forloop2.m4: Avoid excess indir, by passing current
570 counter value as parameter.
571 * examples/foreachq3.m4: Avoid unneeded ifelse, by injecting an
573 * doc/m4.texinfo (Improved forloop, Improved foreach): Update the
574 documentation to match.
576 2008-07-26 Eric Blake <ebb9@byu.net>
578 Give example for O(n) foreach on m4 1.4.x.
579 * examples/foreachq4.m4: New file.
580 * Makefile.am (dist_pkgdata_DATA): Distribute it.
581 * tests/others.at (recursion): Test it.
582 * doc/m4.texinfo (Improved foreach): Document linear foreach with
583 m4 1.4.5 and greater.
585 2008-07-19 Eric Blake <ebb9@byu.net>
587 Resynchronize docs from branch.
588 * doc/m4.texinfo (Undefine, Pushdef): Mention warning on undefined
589 name, particularly since the old documentation didn't match code.
590 (Standard Modules): Add caveat about using __m4_version__.
592 2008-07-11 Eric Blake <ebb9@byu.net>
594 Bump required automake to 1.10a; regression introduced 2008-01-22.
595 * configure.ac (AM_INIT_AUTOMAKE): Undo requirement downgrade to
596 1.10.1, since we also rely on pkglibexecdir.
597 * HACKING: Fix minimum requirement.
598 * bootstrap: Likewise.
600 Reported by Joel E. Denny.
602 Avoid bogus whitespace in @ovar, @dvar.
603 * doc/m4.texinfo (ovar, dvar): Add @c.
604 Based on patch by Ralf Wildenhues to Autoconf manual.
606 2008-06-23 Eric Blake <ebb9@byu.net>
608 Adjust to new gnulib-tool layout.
609 * ltdl/m4/gnulib-cache.m4: Reformat.
611 Fix bootstrap comment.
612 * bootstrap: DOWNLOAD_PO was previously removed.
614 2008-06-19 Eric Blake <ebb9@byu.net>
616 Revert speed regression from 2008-06-16.
617 * m4/output.c (m4_shipout_int): Avoid obstack_printf in hot path.
618 * modules/m4.c (numb_obstack): Likewise.
619 * m4/input.c (MATCH): Use fewer conditionals, and factor
621 (match_input): ...here for smaller code size.
622 * m4/syntax.c (m4_reset_syntax, m4_set_quotes, m4_set_comment):
623 Supply trailing NUL to delimiters, to meet contract of faster
626 2008-06-18 Eric Blake <ebb9@byu.net>
629 * m4/m4module.h: Use consistent spacing for pointer parameters.
630 * m4/m4private.h: Likewise.
632 Stage 25b: Handle embedded NUL in changesyntax and friends.
633 Track quote and comment delimiters by length, to allow embedded
634 NUL. Improve changesyntax to support assigning syntax to NUL.
636 Speed impact: none noticed.
637 * m4/m4module.h (m4_set_quotes, m4_set_comment, m4_set_syntax):
639 (m4_reset_syntax): New prototype.
640 * m4/syntax.c (add_syntax_set, subtract_syntax_set)
641 (set_syntax_set, m4_set_quotes, m4_set_comment): Add parameter, to
643 (m4_set_syntax): Likewise. Also, split code to reset the table...
644 (m4_reset_syntax): ...into a new function.
645 (m4_syntax_create): Adjust callers.
646 * m4/input.c (match_input, MATCH): Add parameter.
647 (m4__next_token, m4__next_token_is_open): Adjust callers.
648 * modules/m4.h (m4_expand_ranges_func): Add parameter.
649 * modules/m4.c (dumpdef): Handle NUL in dumped quotes.
650 (changequote, changecom, translit, m4_expand_ranges): Track
652 * modules/gnu.c (changesyntax): Handle embedded NUL.
653 * src/freeze.c (reload_frozen_state): Adjust callers.
654 * tests/freeze.at (reloading nul): Enhance test.
655 * tests/null.m4: Likewise.
656 * tests/null.out: Update expected output.
657 * tests/null.err: Likewise.
659 2008-06-16 Eric Blake <ebb9@byu.net>
661 Stage 25a: Use obstack_printf for easier output.
662 Convert macro tracing and other locations to use obstack_printf
663 rather than hand-rolled equivalents. Ensure that embedded NUL in
664 trace output does not truncate the trace string.
666 Speed impact: noticeable penalty, from obstack_printf overhead.
667 * ltdl/m4/gnulib-cache.m4: Import obstack-printf-posix module.
668 * m4/macro.c (trace_format): Delete; use obstack_printf instead.
669 (trace_header, trace_pre, trace_post): All callers updated.
670 * m4/output.c (m4_shipout_int, m4_tmpname): Use obstack_printf.
671 (m4_divert_text): Speed up syncline output.
672 * modules/m4.c (dumpdef): Handle embedded NUL.
673 (numb_obstack): Speed up eval output.
674 (maketemp): Use obstack_printf.
675 * modules/format.c (format): Likewise.
677 Add missing const qualifications.
678 * m4/resyntax.c (m4_resyntax_map): Declare array elements as
680 * modules/gnu.c (m4_builtin_table, m4_macro_table): Likewise.
681 * modules/import.c (m4_builtin_table): Likewise.
682 * modules/load.c (m4_builtin_table, m4_macro_table): Likewise.
683 * modules/m4.c (m4_builtin_table): Likewise.
684 * modules/modtest.c (m4_builtin_table, m4_macro_table): Likewise.
685 * modules/mpeval.c (m4_builtin_table, m4_macro_table): Likewise.
686 * modules/perl.c (m4_builtin_table, m4_macro_table): Likewise.
687 * modules/shadow.c (m4_builtin_table, m4_macro_table): Likewise.
688 * modules/stdlib.c (m4_builtin_table): Likewise.
689 * modules/time.c (m4_builtin_table): Likewise.
690 * modules/traditional.c (m4_macro_table): Likewise.
692 2008-06-10 Eric Blake <ebb9@byu.net>
694 Avoid corrupted frozen file if NUL appears on block boundary.
695 * m4/output.c (insert_file): Separate consecutive quotearg blocks
696 with \<newline>, in case last byte of first block was NUL.
698 2008-06-03 Eric Blake <ebb9@byu.net>
700 Fix printf type mismatches.
701 * m4/m4module.h (m4_bad_argc): Alter parameter type.
702 * m4/m4private.h (struct m4_call_info): Alter call_id type.
703 * m4/macro.c (expand_macro, m4__adjust_refcount): Use correct
705 * m4/utility.c (m4_bad_argc): Likewise.
707 Borrow bootstrap ideas from gnulib.
708 * bootstrap (options, DOWNLOAD_PO): Remove --download-po; the
709 advertized subset of languages didn't work. Use --skip-po
710 instead, for consistency with gnulib bootstrap.
711 (func_get_translations): Use rsync, not wget.
712 (func_update_po): Use a reference directory, to avoid changing
713 timestamps on unchanged .po files.
714 * TODO: Update accordingly.
716 Fix fallout from previous patch.
717 * doc/m4.texinfo (Builtin): Adjust expected output.
719 2008-06-02 Eric Blake <ebb9@byu.net>
721 Stage 24c: Improve display of macro names with embedded NUL.
722 Quote instances of problematic characters in macro names when
723 presented to user. Track location via call_info rather than
724 munging context for every expansion.
726 Speed impact: slight penalty, due to more bookkeeping.
727 * m4/m4module.h (m4_push_string_init): Add parameters.
728 * m4/m4private.h (struct m4_macro_args): Remove argv0 and
729 argv0_len, now redundant with info.
730 (m4__push_wrapup_init): Add parameter.
731 * m4/input.c (m4_push_string_init, m4__push_wrapup_init): Track
732 location from caller, rather than context.
733 (composite_peek, composite_read, match_input): Adjust callers.
734 * m4/utility.c (m4_symbol_value_lookup): Quote macro name.
735 (m4_verror_at_line): Allow NUL in macro name.
736 * m4/macro.c (trace_flush, m4_trace_prepare, trace_pre): Allow NUL
738 (expand_macro): No longer munge context location.
739 (collect_arguments, m4_arg_text, m4_arg_empty, m4_arg_len)
740 (m4_make_argv_ref, m4_push_arg, m4_wrap_args): Adjust callers.
741 * modules/gnu.c (builtin, indir): Likewise.
742 * tests/null.m4: Enhance test.
743 * tests/null.err: Adjust expected output.
744 * tests/null.out: Likewise.
746 Stage 24b: Allow embedded NUL in macro names.
747 Use length rather than NUL-termination when tracking macro names.
748 All APIs dealing with symbol table changed.
750 Speed impact: slight penalty, due to more bookkeeping.
751 * m4/m4module.h (m4_symtab_apply_func, m4_symbol_lookup)
752 (m4_symbol_pushdef, m4_symbol_define, m4_symbol_popdef)
753 (m4_symbol_rename, m4_symbol_delete): Add length parameter.
754 (m4_string): New type.
755 * ltdl/m4/gnulib-cache.m4: Import xmemdup0 module.
756 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): Account for
758 * m4/symtab.c (m4_symtab_delete, m4_symtab_apply, symtab_fetch)
759 (m4__symtab_remove_module_references, symbol_destroy_CB)
760 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_define)
761 (m4_symbol_popdef, m4_symbol_rename, m4_set_symbol_name_traced)
762 (m4_symbol_delete): Likewise.
763 * modules/m4.h (struct m4_dump_symbol_data): Adjust type to allow
765 * m4/macro.c (expand_token): Adjust all callers.
766 * m4/module.c (install_builtin_table, install_macro_table):
768 * m4/utility.c (m4_symbol_value_lookup): Likewise.
769 * modules/gnu.c (indir, renamesyms, m4symbols): Likewise.
770 * modules/m4.c (define, undefine, pushdef, popdef)
771 (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols, dumpdef)
772 (traceon, traceoff): Likewise.
773 * src/main.c (main): Likewise.
774 * src/freeze.c (dump_symbol_CB, reload_frozen_state): Likewise.
775 * tests/freeze.at (reloading nul): Augment test.
776 * tests/null.out: Adjust expected output.
778 Stage 24a: Use full call context in error reporting.
779 Replace const char *macro_name with const m4_call_info *call, so
780 that the next patch can pass the length of macro_name with
781 embedded NUL. Simplifies handling of global state.
783 Speed impact: none noticed.
784 * m4/m4module.h (m4_error, m4_warn): Change parameter type.
785 (m4_error_at_line, m4_warn_at_line): Delete.
786 (m4_debug_set_output, m4_skip_line, m4_bad_argc, m4_numeric_arg)
787 (m4_parse_truth_arg, m4_symbol_value_lookup): Adjust all clients.
788 * m4/m4private.h (m4__next_token): Likewise.
789 * m4/utility.c (m4_verror_at_line): Alter parameter, and use
790 caller's location if caller is provided.
791 (m4_error, m4_warn): Change parameter type.
792 (m4_error_at_line, m4_warn_at_line): Delete.
793 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg)
794 (m4_symbol_value_lookup): Adjust all callers.
795 * m4/debug.c (set_debug_file, m4_debug_set_output): Likewise.
796 * m4/input.c (m4_skip_line, m4__next_token): Likewise.
797 * m4/macro.c (expand_argument, collect_arguments, m4_macro_call)
798 (process_macro): Likewise.
799 * modules/m4.h (m4_make_temp_func): Likewise.
800 * modules/evalparse.c (m4_evaluate): Likewise.
801 * modules/format.c (arg_int, arg_long, arg_double, format):
803 * modules/gnu.c (builtin, changeresyntax, changesyntax, debugfile)
804 (debuglen, debugmode, esyscmd, indir, mkdtemp, patsubst, regexp)
805 (renamesyms, syncoutput, regexp_compile, substitute)
806 (regexp_substitute, m4_resyntax_encode_safe): Likewise.
807 * modules/m4.c (define, undefine, pushdef, popdef, ifdef, ifelse)
808 (m4_dump_symbols, defn, syscmd, incr, decr, divert, undivert, dnl)
809 (include, maketemp, mkstemp, m4exit, traceon, traceoff, substr):
811 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
812 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
814 * tests/options.at (--syncoutput): Add test for invalid
815 command-line argument. Split xfailed portion...
816 (--syncoutput and diversions): ...into new test.
817 (unknown option): New test.
818 * tests/freeze.at (reloading unknown builtin): Update expected
821 Adjust to recent gnulib change.
822 * configure.ac (AB_INIT): Delete, now that gnulib does this.
824 2008-05-28 Eric Blake <ebb9@byu.net>
826 Improve frozen debugmode behavior.
827 * m4/debug.c (m4_debug_decode): Make empty debugmode additive.
828 * src/main.c (main): Interleave -d with files.
829 * tests/options.at (--debugmode): Update test.
830 * tests/freeze.at (reloading debugmode): New test.
831 * doc/m4.texinfo (Debugging options, Debugmode): Document the
835 2008-05-27 Eric Blake <ebb9@byu.net>
837 Fix some testsuite failures on Solaris 8.
838 * tests/builtins.at (esyscmd, syscmd): Skip tests if system(2) is
840 * tests/others.at (stderr closed): Likewise. Also support Solaris
842 (stdin closed): Skip test if closed stdin gets reopened.
843 (stdout closed): Support Solaris wording for EBADF.
844 * tests/testsuite.at (AT_CHECK_M4): Likewise.
846 Fix configure message nesting, broken since 2001-09-20.
847 * ltdl/m4/gmp.m4 (M4_LIB_GMP): Don't cache result; the test is
848 not expensive, and AC_MSG_WARN doesn't work in AC_CACHE_CHECK.
850 Support 'make dist' with BSD make.
851 * Makefile.am (TESTSUITE_AT, MAINTAINERCLEANFILES): Qualify uses
852 of the generated file tests/generated.at.
853 (EXTRA_DIST, $(TESTSUITE)): Likewise for tests/package.m4.
854 * tests/others.at (stdout closed): Accomodate OpenBSD /bin/sh.
856 2008-05-24 Eric Blake <ebb9@byu.net>
858 Test NUL in frozen files.
859 * tests/testsuite.at (AT_CHECK_M4): Add parameter.
860 * tests/freeze.at (reloading nul): New test.
861 (AT_TEST_FREEZE): Inhibit -d when reloading frozen file.
862 (reloading unknown builtin): Likewise.
864 2008-05-23 Eric Blake <ebb9@byu.net>
866 Improve handling of frozen file errors.
867 * src/freeze.c (produce_frozen_state): Detect write failures.
868 (reload_frozen_state): Use close_stream.
869 * tests/freeze.at (freezing failure): New test.
871 Reported by Jean-Charles Longuet.
873 2008-05-19 Eric Blake <ebb9@byu.net>
875 In frozen file, split consecutive strings with newline.
876 * src/freeze.c (dump_symbol_CB): Add newline to 'T', 'F'.
877 (produce_frozen_state): Likewise for 'Q', 'C'.
878 (reload_frozen_state): Parse the new layout.
879 [GET_DIRECTIVE]: Fix format 1 regression from 2008-05-13.
880 * tests/freeze.at (loading format 2): Rewrite to new format.
881 (reloading unknown builtin): Likewise.
882 (loading format 1): Make sure backslash-newline is not
884 * doc/m4.texinfo (Frozen file format 2): Document the format.
885 * NEWS: Document this change.
887 Fix xgettext options.
888 * po/Makevars (XGETTEXT_OPTIONS): The " must be passed to
891 Fix spelling of René Seindal's name in --version output.
892 * ltdl/m4/gnulib-cache.m4: Import propername module.
893 * src/main.c (AUTHORS): Rewrite in terms of proper_name.
894 * po/Makevars (XGETTEXT_OPTIONS): Detect new functions.
895 * HACKING: Mention new prerequisite of gperf.
897 2008-05-18 Eric Blake <ebb9@byu.net>
899 Allow freezing the trace status of macros.
900 * src/freeze.c (produce_symbol_dump): Let undefined traced macros
902 (dump_symbol_CB): Also freeze trace state.
903 * tests/freeze.at (reloading traced macros): New test.
904 * doc/m4.texinfo (Using frozen files): Update documentation to
906 (Frozen file format 1): Improve synchronization with branch.
907 (Frozen file format 2): Reorder directives, and add `d', `t'.
908 * NEWS: Document this change.
910 2008-05-15 Eric Blake <ebb9@byu.net>
912 Fix frozen file regression in pushdef stacks from 2001-09-01.
913 * src/freeze.c (dump_symbol_CB): Push all values on the stack, not
914 just the current definition.
915 (reverse_symbol_value_stack): New helper method.
916 * tests/freeze.at (AT_TEST_FREEZE): New helper macro.
917 (reloading pushdef stack): New test.
918 (reloading unknown builtin): Enhance test.
920 2008-05-13 Eric Blake <ebb9@byu.net>
922 Fix frozen file regression in diversions from 2007-01-21.
923 * m4/output.c (insert_diversion_helper): Add parameter.
924 (m4_insert_file): Move contents...
925 (insert_file): ...to this new helper, with added parameter.
926 (m4_insert_diversion, m4_undivert_all, m4_freeze_diversions):
928 * src/freeze.c (produce_mem_dump): Simplify.
929 * tests/freeze.at (large diversion): Test for this.
931 Improve error message when frozen file is invalid.
932 * src/freeze.c (decode_char): Add parameter. Allow \<newline>
934 (reload_frozen_state): Track current line.
935 * tests/freeze.at (loading format 1, loading format 2): Update to
938 2008-05-10 Eric Blake <ebb9@byu.net>
940 Detect integer overflow when loading frozen file.
941 * src/freeze.c (reload_frozen_state) [GET_NUMBER]: Rewrite to fail
942 immediately on overflow.
943 * tests/freeze.at (loading format 2): Test this.
944 Reported by Jim Meyering.
946 2008-05-08 Eric Blake <ebb9@byu.net>
948 Stage 23: allow tracing of indirect macro calls.
949 Track all trace information as part of the argv struct, rather
950 than temporarily resetting global state. Teach indir to trace
951 macros that it invokes.
952 Memory impact: slight penalty, due to larger argv struct.
953 Speed impact: none noticed.
954 * m4/m4module.h (m4_input_block): Remove.
955 (m4_call_info): New opaque type.
956 (m4_trace_prepare, m4_arg_info): New prototypes.
957 (m4_macro_call, m4_push_string_finish, m4_input_print): Change
959 * m4/m4private.h (struct m4_macro_args): Add info field.
960 (struct m4_call_info): New structure.
961 (m4_arg_info): New accessor.
962 * m4/input.c (m4_input_block): Make typedef local.
963 (m4_push_string_init): Initialize length.
964 (m4_push_string_finish, m4_input_print): Change signature, so that
965 printing can be done before finalization.
966 (struct input_funcs): Add parameter to print_func.
967 (file_print, string_print, composite_print): Adjust accordingly.
968 * m4/macro.c (trace_header, trace_flush, trace_pre, trace_post):
969 Change signatures for stacked trace messages, and for using call
971 (trace_prepre): Export and rename...
972 (m4_trace_prepare): ...to this, for use by indir. Alter signature
974 (collect_arguments): Alter signature, to manage new field.
975 (expand_macro): Change call context management. Move tracing...
976 (m4_macro_call): ...here. Remove redundant parameter.
977 (m4_arg_argc): New function.
978 (m4_make_argv_ref): Replace unused skip parameter with new trace
979 parameter; manage new field.
980 * modules/gnu.c (builtin, indir): Adjust callers.
981 * src/main.c (usage): Update debugmode flag summary.
982 * tests/null.m4: Enhance test.
983 * tests/null.err: Update expected output.
984 * tests/macros.at (Tracing Hanoi Towers): Likewise.
985 * doc/m4.texinfo (Trace): Mention more about trace formatting.
986 (Debugmode): Enhance description of 'c' and 'x'. Enhance test to
987 cover line numbering details in traces.
988 (Debuglen): Enhance test to cover indir tracing.
989 * NEWS: Mention these changes.
990 Reported by Akim Demaille in the autoconf TODO file in 2000.
992 2008-05-07 Eric Blake <ebb9@byu.net>
994 Test for traceon regression just fixed in branch-1.6.
995 * doc/m4.texinfo (Trace): Enhance test.
996 * NEWS: Port news item from branch.
998 2008-05-05 Eric Blake <ebb9@byu.net>
1000 Stage 22: allow builtin token concatenation outside $@.
1001 Adjust the input and argument parsing engines to append builtins
1002 alongside text. Make define warn when builtins must be
1004 Memory impact: slight penalty, with fewer builtins flattened.
1005 Speed impact: slight penalty, from more bookkeeping.
1006 * m4/m4module.h (m4_is_arg_composite): New prototype.
1007 (m4_symbol_value_copy): Change return type.
1008 (m4_arg_text): Add parameter.
1009 (M4ARG): Adjust callers.
1010 * m4/m4private.h: Adjust comments.
1011 * m4/symtab.c (m4_symbol_value_copy): Detect when builtins are
1013 * m4/input.c (init_builtin_token): Add parameter, and allow
1014 concatenating builtins.
1015 (m4__next_token): Adjust caller.
1016 * m4/macro.c (m4_is_arg_composite): New function.
1017 (expand_argument): Allow builtin concatenation.
1018 (m4_arg_text): Add parameter.
1019 (m4__arg_adjust_refcount, m4__arg_print): Adjust callers.
1020 (m4_arg_equal): Fix comparison of builtin tokens.
1021 * modules/m4.c (define, pushdef): Warn when flattening builtins.
1022 * doc/m4.texinfo (Define): Remove dead comment.
1023 (Defn): Update to reflect code changes.
1024 * tests/builtins.at (defn): Remove xfail.
1025 * NEWS: Document this change.
1027 2008-05-03 Eric Blake <ebb9@byu.net>
1029 Document define_blind.
1030 * doc/m4.texinfo (Ifelse): Add a new composite macro.
1032 Suggested by Mike R.
1034 2008-05-01 Eric Blake <ebb9@byu.net>
1036 Avoid -Wshadow compiler warnings.
1037 * m4/output.c (threshold_diversion_CB): s/div/diversion/.
1038 * m4/macro.c (make_argv_ref, arg_symbol, m4_arg_symbol)
1039 (m4_is_arg_text, m4_is_arg_func, m4_arg_text, m4_arg_empty)
1040 (m4_arg_len, m4_arg_func, m4__arg_print, m4_make_argv_ref)
1041 (m4_push_arg, m4__push_arg_quote): s/index/arg/.
1042 * modules/format.c (format): Likewise.
1043 * modules/m4.c (ifelse): Likewise.
1045 Improve debugmode testing, based on recent branch-1.6 regressions.
1046 * doc/m4.texinfo (Debugmode): Enhance tests.
1047 * tests/generate.awk: Run tests from stdin, not input.m4. Support
1048 stderr munging when using -I examples.
1050 Fix regression in define from 2008-02-22.
1051 * m4/m4module.h (m4_symbol_value_copy): Add parameter.
1052 * m4/symtab.c (m4_symbol_value_copy): Support copying $@
1054 * m4/macro.c (expand_argument): Update callers.
1055 * modules/m4.c (define, pushdef): Likewise.
1056 * tests/builtins.at (define): Enhance test to catch this.
1058 2008-04-21 Eric Blake <ebb9@byu.net>
1060 Simplify previous patch.
1061 * tests/m4.in: Compress assignment.
1062 Suggested by Gary V. Vaughan.
1064 Fix --disable-shared testsuite regression from previous patch.
1065 * tests/m4.in: Export M4MODPATH, so that recursive m4 invocations
1068 Fix spelling of attribution to Christopher Strachey.
1069 * doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
1071 Reported by Fernando Carrijo.
1073 2008-04-17 Eric Blake <ebb9@byu.net>
1075 Fix testsuite bug when SIGPIPE is ignored.
1076 * tests/builtins.at (divert): Consume all of m4's output, to avoid
1077 spurious write failure.
1078 * src/main.c (main): In batch mode, restore default handling of
1080 * doc/m4.texinfo (Operation modes): Document SIGPIPE behavior.
1082 Reported by Bob Proulx, via his autobuilder.
1084 2008-04-15 Eric Blake <ebb9@byu.net>
1086 Fix 'make installcheck' after './configure --prefix-progname'.
1087 * tests/testsuite.at (AT_CHECK_M4): Allow overriding the m4
1089 (HELP_OTHER, PREPARE_TESTS): Document and use $M4.
1090 * tests/builtins.at (patsubst): Avoid space-tab.
1091 (divert, mkdtemp, mkstemp): Adjust tests to use $M4.
1092 * tests/options.at (--debugfile): Likewise.
1093 * tests/others.at (stdin seekable): Likewise.
1094 (fstab): Avoid space-tab.
1095 * Makefile.am (installcheck-local): Accomodate transformed name.
1096 (DISTCHECK_CONFIGURE_FLAGS): Ensure no regressions, by using gm4
1097 during 'make distcheck'.
1098 * cfg.mk: New file, borrowed from branch.
1100 Update prerequisite tools to match recent releases.
1101 * configure.ac (AC_PREREQ): Rely on released autoconf.
1102 (LT_PREREQ): Rely on released libtool.
1103 * tests/testsuite.at (m4_version_prereq): Update dependence.
1104 * bootstrap: Mention prerequisites.
1106 Work around OS/2 limitation of printf(1).
1107 * tests/null.m4: Use m4, not printf, to generate NUL byte.
1108 * tests/null.out: Check for esyscmd failure.
1109 Reported by Elbert Pol.
1111 2008-04-14 Eric Blake <ebb9@byu.net>
1113 Stage 21b: $@ concatenates builtins, m4wrap takes builtins.
1114 Improve arg_print to handle builtin tokens when printing to a
1115 known chain, rather than always flattening builtins. This allows
1116 m4wrap and $@ back-references to handle embedded builtin tokens.
1117 Memory impact: none.
1118 Speed impact: slight penalty, from more bookkeeping.
1119 * m4/m4module.h (m4_push_builtin): Add parameter.
1120 (m4_builtin_print, m4_push_wrapup_init, m4_push_wrapup_finish)
1121 (m4_arg_print, m4_symbol_value_print): Rename and reduce scope...
1122 * m4/m4private.h (m4__builtin_print, m4__push_wrapup_init)
1123 (m4__push_wrapup_finish, m4__arg_print, m4__symbol_value_print):
1124 ...to these, in some cases adding a parameter.
1125 (m4__append_builtin): New prototype.
1126 * m4/builtin.c (m4_builtin_print): Alter signature to print
1127 builtin to a growing symbol chain.
1128 * m4/symtab.c (m4__symbol_value_print): Alter signature.
1129 (m4_symbol_print, dump_symbol_CB): Adjust callers.
1130 * m4/input.c (builtin_peek, builtin_read, builtin_unget)
1131 (builtin_print, builtin_funcs): Delete, handled via composite
1133 (struct m4_input_block): Delete u.builtin member.
1134 (init_builtin_token): Only use composite block.
1135 (m4__append_builtin): New function.
1136 (m4_push_builtin, m4__push_wrapup_init): Alter signature.
1137 (m4__push_symbol): Allow builtin tokens.
1138 (m4__push_wrapup_finish): Rename.
1139 (composite_print, m4_print_token): Adjust callers.
1140 * m4/macro.c (m4_wrap_args, collect_arguments): Allow builtin
1142 (m4__arg_print): Alter signature.
1143 (trace_prepre, trace_pre, m4_arg_text, m4_arg_equal): Adjust
1145 * modules/m4.c (m4wrap): Allow builtin tokens.
1146 (defn, errprint): Adjust callers.
1147 * modules/gnu.c (builtin): Likewise.
1148 * doc/m4.texinfo (M4wrap): New test.
1149 (Debuglen): Adjust expected output.
1151 Stage 21a: Optimize checks for end of input.
1152 Create a new polymorphic input block type, which always fails with
1153 CHAR_EOF, so that remaining input routines no longer have to check
1154 for NULL input block.
1155 Memory impact: none.
1156 Speed impact: noticeable improvement, from fewer conditionals.
1157 * m4/input.c (eof_funcs, input_eof): New objects.
1158 (eof_peek, eof_read, eof_unget): New functions.
1159 (file_clean, m4_push_string_init, pop_input, m4_push_wrapup_init)
1160 (m4_pop_wrapup, next_char, peek_char, unget_input, m4_input_init)
1161 (m4_input_exit): Use placeholder to guarantee non-NULL isp and
1163 (next_char): Rename retry to allow_unget, and change sense for
1164 easier manipulation. All callers changed.
1166 Improve OS/2 detection.
1167 * modules/gnu.c (m4_macro_table): Ensure all possible identifiers
1168 are defined, not just the first. The testsuite ensures that
1169 exactly one gets defined.
1170 * m4/system_.h [__EMX__]: OS/2 is not Unix-compatible, no matter
1171 what other pre-defined macros it has.
1173 Reported by Elbert Pol.
1175 Ensure __m4_version__ is unquoted.
1176 * tests/builtins.at (__m4_@&t@version__): Augment test.
1178 Avoid GNU make failure on tarball.
1179 * Makefile.am (EXTRA_DIST): Distribute cfg.mk and maint.mk.
1181 2008-04-10 Eric Blake <ebb9@byu.net>
1183 Allow back-referenced macro names; fixes 2008-03-13 regression.
1184 * m4/m4module.h (m4_symbol_value_lookup): Change prototype.
1185 * m4/utility.c (m4_symbol_value_lookup): Change signature.
1186 * modules/m4.c (undefine, popdef, ifdef, m4_dump_symbols, defn):
1188 * tests/others.at (ifndef): New test.
1190 Be namespace clean for M4 version; fixes 2008-04-08 regression.
1191 * configure.ac (version): Rename...
1192 (M4_VERSION): ...to this, since using 'version' broke po.m4.
1194 2008-04-09 Eric Blake <ebb9@byu.net>
1196 Mention 1.4.11 release.
1197 * doc/m4.texinfo (History, Defn, Ifdef, Ifelse, M4wrap)
1198 (Extensions, Improved foreach): Distinguish 1.4.11 and 1.6.
1199 (Format): Add test of C99 hex-float parsing.
1200 * NEWS: Mention 1.4.11 release.
1201 * tests/builtins.at (divert): Add additional test.
1203 2008-04-08 Eric Blake <ebb9@byu.net>
1205 Overhaul inter-version releases to work with git.
1206 * configure.ac (version): New variable, which has nicer version
1207 contents when using git 1.5.5+, hardcoded to 1.9a otherwise.
1208 (TIMESTAMP): Delete, since CVS id expansion died with transition
1210 (AM_INIT_AUTOMAKE): Use version to decide gnu vs. gnits.
1211 * build-aux/mkstamp: Delete, no longer used.
1212 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Kill, to speed up
1213 rebuilds when timestamps don't matter.
1214 (MKSTAMP): Delete, no longer used.
1215 (EXTRA_DIST): No longer worry about mkstamp.
1216 (.version): New rule and distributed file.
1217 (doc/m4.1, tests/package.m4): Depend on .version, not
1218 configure.ac, for timestamp.
1219 * ltdl/m4/gnulib-cache.m4: Import git-version-gen module.
1220 * modules/gnu.c (__m4_version__): TIMESTAMP no longer exists.
1221 * src/main.c (main): Likewise.
1223 2008-03-28 Eric Blake <ebb9@byu.net>
1225 Use GNUmakefile module.
1226 * ltdl/m4/gnulib-cache.m4: Import gnumakefile module.
1227 * Makefile.am: Split off maintainer rules...
1228 * maint.mk: ...into this new file.
1230 2008-03-18 Eric Blake <ebb9@byu.net>
1232 Stage 20b: make m4wrap obey POSIX fifo ordering.
1233 Improve input engine to support location changes within symbol
1234 chains, then convert m4wrap to always build symbol chain.
1235 Memory impact: none.
1236 Speed impact: slight penalty, from more m4wrap bookkeeping.
1237 * m4/m4module.h (m4_wrap_args): Add prototype.
1238 * m4/m4private.h (enum m4__symbol_chain_type): Add M4__CHAIN_LOC.
1239 (struct m4__symbol_chain): Add struct u_l.
1240 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Use
1242 (composite_peek, composite_read, composite_clean): Handle location
1244 * m4/macro.c (m4_wrap_args): New function.
1245 * modules/m4.c (m4wrap): Use it.
1246 * doc/m4.texinfo (M4wrap): Sync with branch and POSIX.
1247 (Extensions): Document extension of multiple arguments.
1248 (Location, Improved m4wrap): Adjust example to match FIFO order.
1249 * tests/builtins.at (wrap): Likewise.
1250 * NEWS: Document this change.
1252 2008-03-17 Eric Blake <ebb9@byu.net>
1254 Stage 20a: reduce unget's in input engine.
1255 Now that out-of-range input placeholders like CHAR_BUILTIN are
1256 consumed outside of next_char, next_token should always consume
1257 rather than peek at the first character. Fewer peeks results in
1258 less ungetc overhead.
1259 Memory impact: none.
1260 Speed impact: noticeable improvement, from fewer function calls.
1261 * m4/input.c (struct input_funcs): Alter read_func prototype.
1262 (next_char, file_read, buildin_read, string_read, composite_read):
1263 Add allow_argv parameter.
1264 (init_builtin_token, init_argv_symbol): Require all prior input to
1266 (m4_skip_line, match_input, consume_syntax): Adjust callers.
1267 (m4__next_token): Consume first byte without peek.
1269 Update for fresh bootstrap.
1270 * ltdl/m4/gnulib-cache.m4: Updated copyright from upstream.
1272 2008-03-15 Eric Blake <ebb9@byu.net>
1274 Document join, in order to fix bug in m4wrap example.
1275 * examples/join.m4: New file.
1276 * examples/wraplifo2.m4: Likewise.
1277 * Makefile.am (EXTRA_DIST): Add new files.
1278 * doc/m4.texinfo (Improved m4wrap): New node.
1279 (Defn, Location): Enhance tests.
1280 (Shift): Document the composite macro join.
1281 (Incompatibilities): Move documentation of LIFO vs. FIFO...
1282 (M4wrap): ...here, to match improved example.
1284 2008-03-13 Eric Blake <ebb9@byu.net>
1286 Stage 19c: allow builtin tokens in more macros.
1287 Allow builtin tokens inside symbol chains, although for now, they
1288 are not allowed inside comments or quotes. Enable builtin token
1289 handling in more macros, if only to consistently diagnose invalid
1291 Memory impact: none.
1292 Speed impact: slight impact, due to more bookkeeping.
1293 * m4/m4module.h (m4_symbol_value_lookup, m4_builtin_print): New
1295 * m4/m4private.h (enum m4__symbol_chain_type): Add
1297 (struct m4__symbol_chain): Add builtin member.
1298 * m4/utility.c (m4_symbol_value_lookup): New method.
1299 * m4/builtin.c (m4_builtin_print): New function.
1300 * m4/symtab.c (m4_symbol_value_print): Use it.
1301 * m4/input.c (builtin_print): Likewise.
1302 (m4__push_symbol): Allow pushing builtin tokens.
1303 (composite_peek, composite_read, composite_unget, composite_clean)
1304 (composite_print): Handle builtin tokens.
1305 (init_builtin_token): Allow builtin tokens from composite input.
1306 (m4__next_token): Flatten builtins inside comment or string.
1307 * m4/macro.c (expand_argument): Strengthen assertion.
1308 (collect_arguments, m4_arg_equal, m4_arg_print, m4_push_args):
1309 Handle builtin tokens.
1310 (arg_symbol): Add parameter, and allow NULL level.
1311 (m4_arg_symbol, m4__push_arg_quote): Adjust callers.
1312 (m4_arg_text): Ensure all builtins have been flattened.
1313 * modules/m4.c (defn, dumpdef, popdef, traceoff, traceon)
1314 (undefine, m4_dump_symbols): Warn on invalid macro names.
1315 (ifdef, ifelse, shift): Handle builtin tokens.
1316 * modules/gnu.c (m4symbols): Likewise.
1317 * doc/m4.texinfo (Defn, Ifdef, Ifelse): Document and test the new
1319 (Debuglen): Likewise, and remove xfail.
1320 * NEWS: Mention the change.
1322 Stage 19b: invert sense of bit for handling builtin tokens.
1323 Pass builtin tokens by default, rather than as the exception, so
1324 that the logic can consistently refer to flattening arguments.
1325 Memory impact: none.
1327 * m4/m4module.h (M4BUILTIN_ENTRY): New convenience macro.
1328 (M4_BUILTIN_GROKS_MACRO): Rename...
1329 (M4_BUILTIN_FLATTEN_ARGS): ...and invert sense.
1330 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): Likewise...
1331 (m4_symbol_value_flatten_args, m4_symbol_flatten_args): ...to
1333 * m4/m4private.h (VALUE_MACRO_ARGS_BIT)
1334 (m4_symbol_value_groks_macro): Likewise...
1335 (VALUE_FLATTEN_ARGS_BIT, m4_symbol_value_flatten_args): ...to
1337 * m4/symtab.c (m4_symbol_value_groks_macro): Likewise...
1338 (m4_symbol_value_flatten_args): ...to this.
1339 * m4/macro.c (collect_arguments): Accomodate changed sense.
1340 * m4/module.c (m4__module_open): Require arguments if flattening
1342 * m4/input.c (m4_push_string_finish): For now, flatten all
1343 builtins pushed as back-references.
1344 * modules/gnu.c (m4_builtin_table, builtin): Adjust all clients.
1345 * modules/import.c (m4_builtin_table): Likewise.
1346 * modules/load.c (m4_builtin_table): Likewise.
1347 * modules/modtest.c (m4_builtin_table): Likewise.
1348 * modules/mpeval.c (m4_builtin_table): Likewise.
1349 * modules/perl.c (m4_builtin_table): Likewise.
1350 * modules/shadow.c (m4_builtin_table): Likewise.
1351 * modules/stdlib.c (m4_builtin_table): Likewise.
1352 * modules/time.c (m4_builtin_table): Likewise.
1353 * modules/m4.c (m4_builtin_table): Likewise.
1354 (mkstemp): Undo #undef hack from 2006-10-23, now that macro names
1355 are stringized without preprocessor expansion.
1356 * doc/m4.texinfo (Defn): Update comments to match reality.
1357 (Debuglen): Update test now that user macros pass builtin tokens.
1359 Stage 19a: sort and cache builtins loaded by a module.
1360 Rather than repeatedly using dlsym to browse the builtin table,
1361 copy off the table at module load time. Then, the input engine
1362 merely refers to the copy instead of duplicating information.
1363 Memory impact: slight penalty, due to more memory per module, but
1364 offset by less memory in input engine.
1365 Speed impact: slight improvement, due to faster builtin lookups.
1366 * m4/m4module.h (m4_set_symbol_value_builtin): Delete. Use
1367 m4_builtin_find_by_* instead.
1368 (m4_builtin_find_by_func): Change return type.
1369 * m4/m4private.h (m4__builtin): New struct.
1370 (m4_module): Add sorted list of loaded builtins.
1371 (struct m4_symbol_value): Change type of builtin value.
1372 (m4__set_symbol_value_builtin): New prototype and fast accessor.
1373 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1375 * m4/symtab.c (m4_set_symbol_value_builtin): Rename...
1376 (m4__set_symbol_value_builtin): ...and populate additional fields,
1378 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1380 * m4/module.c (install_builtin_table): Use cached table.
1381 (compare_builtin_CB): New helper function.
1382 (m4__module_open): Populate table.
1383 (module_remove): Free table.
1384 * m4/builtin.c (compare_builtin_name_CB): New helper function.
1385 (m4_builtin_find_by_name): Rewrite to use sorted table.
1386 (m4_builtin_find_by_func): Change return type.
1387 * m4/input.c (struct m4_input_block): Simplify u_b, since most
1388 fields can be determined from builtin.
1389 (builtin_peek, builtin_read, builtin_unget, init_builtin_token)
1390 (m4__next_token): Alter parsing so that only init_builtin_token
1392 (builtin_print, m4_push_builtin): Adjust all users.
1393 * tests/macros.at (Arity, defn, and freeze): Fix typo.
1395 Consistently cast malloc results, for C++ compilation.
1396 * m4/builtin.c (m4_builtin_find_by_name): Add cast.
1397 * m4/hash.c (m4_hash_new, m4_get_hash_iterator_next, node_new)
1398 (m4_hash_resize, maybe_grow): Likewise.
1399 * m4/m4.c (m4_create): Likewise.
1400 * m4/macro.c (expand_macro): Likewise.
1401 * m4/output.c (m4_tmpname): Likewise.
1402 * m4/path.c (search_path_add): Likewise.
1403 * m4/symtab.c (m4_symtab_create, m4_symbol_value_create)
1404 (symtab_fetch): Likewise.
1405 * m4/syntax.c (m4_syntax_create): Likewise.
1406 * modules/gnu.c (regexp_compile): Likewise.
1407 * src/main.c (main): Likewise.
1408 * src/freeze.c (reload_frozen_state): Likewise.
1410 2008-03-06 Eric Blake <ebb9@byu.net>
1412 Fix nested builtin(`shift',$@) regression from 2008-02-23.
1413 * m4/macro.c (make_argv_ref): Don't output expansion text when
1414 making wrapper for builtin or indir.
1415 * tests/builtins.at (builtin): New test.
1416 * NEWS: Document the fix.
1417 Reported by Andreas Schwab.
1419 2008-03-04 Eric Blake <ebb9@byu.net>
1421 The gnulib module free was deprecated.
1422 * ltdl/m4/gnulib-cache.m4: Remove free module.
1424 2008-02-29 Eric Blake <ebb9@byu.net>
1426 Import news from 1.4.10b.
1427 * NEWS: Update from branch.
1429 2008-02-23 Eric Blake <ebb9@byu.net>
1431 Stage 18: try harder to reuse argv in recursion.
1432 When pushing arguments that contain an existing $@ ref, reuse the
1433 ref rather than creating another layer of wrappers.
1434 Memory impact: noticeable improvement, due to better $@ reuse.
1435 Speed impact: noticeable improvement, due to O(n^2) to O(n)
1436 reduction in unboxed recursion.
1437 * m4/macro.c (make_argv_ref): Avoid wrapping $@ when possible.
1438 (m4_push_args): Let make_argv_ref take care of pending data.
1439 * doc/m4.texinfo (Improved foreach): Tweak wording to match new
1440 performance capability.
1441 * tests/others.at (recursion): Add tests to avoid performance
1444 2008-02-22 Eric Blake <ebb9@byu.net>
1447 * NEWS: Document change to __gnu__ on 2008-02-11.
1449 Stage 17: pass argv through quoted strings.
1450 Allow the concatenation of $@ references with other text input
1451 inside quoted contexts, which requires distinguishing between a
1452 wrapper around many arguments vs. a reference serving as part of a
1453 single argument. Also optimize based on whether argv contains
1454 builtin tokens that might need flattening to the empty string.
1455 Memory impact: noticeable improvement, due to O(n^2) to O(n)
1456 reduction from total reuse of $@ references.
1457 Speed impact: noticeable improvement, due to O(n^2) to O(n)
1458 reduction in boxed recursion.
1459 * m4/m4module.h (m4_arg_equal, m4_arg_len): Add parameter.
1460 (M4ARGLEN): Adjust definition.
1461 * m4/m4private.h (struct m4__symbol_chain): Add has_func member.
1462 (struct m4_symbol_value): Add wrapper and has_func members.
1463 (struct m4_macro_args): Add flatten and has_func members.
1464 * m4/input.c (append_quote_token): Return argv refs inside quoted
1466 (init_argv_symbol): Populate new fields.
1467 * m4/macro.c (expand_argument, collect_arguments, make_argv_ref)
1468 (m4_make_argv_ref): Likewise.
1469 (arg_symbol, arg_mark, m4_is_arg_text, m4_is_arg_func): Use new
1471 (m4_arg_equal, m4_arg_len): Handle quoted argv references, and add
1473 * modules/m4.c (ifelse): Adjust caller.
1475 2008-02-22 Gary V. Vaughan <gary@gnu.org>
1477 Fix regression in argument collection, from 2008-01-21.
1478 * m4/input.c (m4__next_token): When DEBUG_INPUT is defined,
1479 undo argument collection optimisation for strings, so that
1480 m4_print_token doesn't abort when it otherwise receives an
1481 unprintable M4_SYMBOL_VOID type token.
1483 2008-02-20 Eric Blake <ebb9@byu.net>
1485 Stage 16: cache quotes and improve m4_arg_print.
1486 Cache rather than always copying quotes when pushing $@ refs; in
1487 particular, reconstruct single-byte quotes on the fly. Allow NUL
1488 through m4wrap. Improve sharing of code that prints arguments.
1489 Memory impact: slight improvement, due to cached quotes.
1490 Speed impact: slight improvement, due to less copying.
1491 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print)
1492 (m4_arg_print): Adjust prototypes.
1493 (m4_dump_args): Delete.
1494 (m4_push_wrapup): Split...
1495 (m4_push_wrapup_init, m4_push_wrapup_finish): ...into these
1497 * m4/m4private.h (struct m4_syntax_table): Add cached_quote
1499 (m4__quote_cache, m4__quote_uncache): New prototypes.
1500 * m4/syntax.c (m4_syntax_create): Initialize the cache.
1501 (m4__quote_cache): New function.
1502 (m4_set_syntax): Update caller.
1503 * m4/symtab.c (m4_symbol_value_print): Add parameter.
1504 (m4_symbol_print, dump_symbol_CB): Adjust all callers.
1505 * m4/utility.c (m4_dump_args): Delete; callers should use
1506 m4_arg_print instead.
1507 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Split
1508 implementation, and allow embedded NUL.
1509 (m4_print_token, pop_input, composite_print, composite_peek):
1510 (composite_read, append_quote_token): Adjust all callers.
1511 * m4/macro.c (trace_prepre, m4_arg_text, make_argv_ref):
1513 (m4_arg_print): Add parameters.
1514 (trace_pre): Rewrite in terms of m4_arg_print.
1515 * modules/m4.c (errprint): Likewise.
1516 (m4wrap): Rewrite to allow embedded NUL.
1517 (dumpdef): Adjust caller.
1518 * doc/m4.texinfo (Debuglen): Enhance debuglen test.
1519 * tests/null.m4: Test for NUL in m4wrap.
1520 * tests/null.out: Update expected output.
1522 Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
1523 * m4/utility.c (m4_verror_at_line): Properly terminate the string.
1524 Reported by Ralf Wildenhues.
1526 * doc/m4.texinfo (Debuglen, Changesyntax): Fix typos.
1528 2008-02-19 Eric Blake <ebb9@byu.net>
1530 Clean up example on filtering defined symbols.
1531 * doc/m4.texinfo (Foreach, Improved foreach): Document another
1532 shortcoming in foreach.m4, and improve filter example by using
1535 * src/main.c (usage): Fix typo.
1537 2008-02-18 Eric Blake <ebb9@byu.net>
1539 Avoid some magic numbers.
1540 * m4/m4private.h (CHAR_EOF, CHAR_BUILTIN, CHAR_QUOTE, CHAR_ARGV)
1541 (CHAR_RETRY): Define in terms of UCHAR_MAX.
1542 * m4/syntax.c (m4_syntax_create, set_syntax_set)
1543 (reset_syntax_set, check_is_single_quotes)
1544 (check_is_single_comments, check_is_macro_escaped)
1545 (m4_set_quotes, m4_set_comment): Likewise.
1546 * modules/gnu.c (regexp_compile): Likewise.
1547 * modules/m4.c (translit): Likewise.
1548 * src/freeze.c (produce_syntax_dump): Likewise.
1549 Reported by Ralf Wildenhues.
1551 2008-02-16 Eric Blake <ebb9@byu.net>
1553 Add regression test for multi-character quote recursion.
1554 * examples/foreach2.m4: Use $0 rather than spelling out name.
1555 * examples/foreachq2.m4: Likewise.
1556 * examples/forloop2.m4: Likewise.
1557 * examples/hanoi.m4: Likewise.
1558 * examples/trace.m4: Likewise.
1559 * doc/m4.texinfo (Improved forloop): Document advantage of $0.
1560 (Improved foreach): Adjust dump from file.
1562 Stage 15: return argv refs back to collect_arguments.
1563 Collect an entire $@ reference at once rather than one argument at
1564 a time, outside of quotes (but inside quotes, $@ is still
1565 flattened for now). The skip_last field allows concatenation of
1566 $@ with other text when collecting arguments.
1567 Memory impact: noticeable improvement, due to better reuse of $@.
1568 Speed impact: noticeable improvement, due to less parsing.
1569 * m4/m4private.h (CHAR_ARGV): New input engine sentinel.
1570 (enum m4__token_type): Add M4_TOKEN_ARGV.
1571 (struct m4__symbol_chain): Add skip_last member to argv link.
1572 (m4__next_token): Add parameter.
1573 * m4/input.c (peek_char, file_peek, builtin_peek, string_peek)
1574 (composite_peek, m4__next_token): Add new parameter.
1575 (composite_read, append_quote_token): Support argv in quotes.
1576 (init_argv_symbol): New function.
1577 (m4__push_symbol, match_input, consume_syntax)
1578 (m4__next_token_is_open, m4_print_token): Adjust callers.
1579 * m4/macro.c (m4_macro_expand_input, m4__arg_adjust_refcount)
1580 (arg_mark, m4_arg_text, make_argv_ref): Likewise.
1581 (expand_argument, collect_arguments): Handle new token.
1582 (arg_symbol): Drill through $@ reference.
1583 * m4/syntax.c (set_quote_age): Detect disabled comments.
1584 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Fix debug code.
1586 2008-02-15 Eric Blake <ebb9@byu.net>
1588 * modules/gnu.c (regexp_compile): Use a fastmap for regex speed.
1590 2008-02-13 Eric Blake <ebb9@byu.net>
1592 Fix texinfo grammar.
1593 * doc/m4.texinfo (Eval, Incompatibilities): Use @. after capital.
1594 (History): Use @: after abbreviations.
1595 (M4exit): Use correct Latin abbreviation.
1596 (Dumpdef, Debugmode, Frozen file format 2): Use correct spacing
1599 2008-02-11 Eric Blake <ebb9@byu.net>
1601 Allow builtin text macros to specify number of arguments.
1602 * m4/m4module.h (struct m4_macro): Add argument limits to builtin
1604 * m4/module.c (install_macro_table): Allow text macros to warn on
1606 * modules/gnu.c (m4_macro_table): Update all clients.
1607 * modules/load.c (m4_macro_table): Likewise.
1608 * modules/mpeval.c (m4_macro_table): Likewise.
1609 * modules/perl.c (m4_macro_table): Likewise.
1610 * modules/shadow.c (m4_macro_table): Likewise.
1611 * modules/traditional.c (m4_macro_table): Likewise.
1612 * modules/modtest.c (m4_macro_table): Likewise. Also add text
1613 macros, for testing this.
1614 * doc/m4.texinfo (Standard Modules): Update text, and enhance
1616 * tests/modules.at (modules: text): New test.
1618 Fix regression in command line -D option, from 2006-08-25.
1619 * m4/m4private.h (m4_symbol_value_create): Delete fast accessor.
1620 * m4/m4module.h: Fix typo.
1621 * m4/symtab.c (m4_symbol_value_create): Prime the maximum number
1623 * tests/macros.at (Command line define): Enhance test.
1624 * tests/others.at (nul character): Enhance test.
1625 * tests/null.m4: Likewise.
1626 * tests/null.out: Likewise.
1628 Use gnulib's git-merge-changelog driver when available.
1629 * .gitattributes: Add merge attributes for ChangeLog.
1630 * bootstrap: Install driver, if not already present.
1632 2008-02-06 Eric Blake <ebb9@byu.net>
1634 Fix security hole introduced 2007-11-23.
1635 * m4/utility.c (m4_verror_at_line): Properly escape macro names.
1636 * src/main.c (main): Manage quoteargs defaults.
1637 * doc/m4.texinfo (Indir): Document and test this.
1639 Using raw strtod is not portable.
1640 * ltdl/m4/gnulib-cache.m4: Import the strtod module.
1642 2008-02-02 Eric Blake <ebb9@byu.net>
1644 Consistently use size_t for number of arguments.
1645 * m4/m4module.h (m4_builtin_func): Alter prototype.
1646 (struct m4_builtin): Adjust type of min_args, max_args.
1647 (M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
1648 (m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
1649 (m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
1650 (m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
1651 (m4_arg_print, m4_push_arg): Adjust all clients.
1652 * m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
1653 (m4_macro_args): Adjust type of various fields.
1654 (m4__push_arg_quote): Adjust all clients.
1655 * m4/input.c (m4_pop_wrapup): Likewise.
1656 * m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
1657 (arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
1658 (m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
1659 (m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
1660 (m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
1661 * m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
1662 * modules/evalparse.c (m4_evaluate): Likewise.
1663 * modules/gnu.c (changesyntax): Likewise.
1664 * modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
1665 (undivert, traceon, traceoff): Likewise.
1666 * modules/m4.h (m4_dump_symbols_func): Likewise.
1667 * modules/perl.c (perleval): Likewise.
1669 Stage 14b: allow pushing argv references.
1670 Push a $@ reference to the input engine in one go, rather than
1671 pushing each element. For now, argument collection still gets one
1672 argument of a $@ at a time; but the penalties of this patch make
1673 it easier to manage $@ efficiently in future patches.
1674 Memory impact: noticeable penalty, due to larger struct and O(n)
1675 to O(n^2) on unboxed recursion.
1676 Speed impact: noticeable penalty, due to more bookkeeping.
1677 * m4/m4private.h (struct m4__symbol_chain): Add comma and quotes
1679 (struct m4_macro_args): Add level field.
1680 (m4__arg_adjust_refcount, m4__push_arg_quote): New prototypes.
1681 * m4/input.c (m4__push_symbol, composite_peek, composite_read)
1682 (composite_unget, composite_clean, composite_print): Support $@
1684 * m4/macro.c (collect_arguments): Populate new field.
1685 (expand_macro): Move argv cleanup...
1686 (m4__arg_adjust_refcount): ...to this new function.
1687 (m4_arg_symbol, m4_make_argv_ref, m4_push_arg): Factor...
1688 (arg_symbol, make_argv_ref, m4__push_arg_quote): ...to these new
1689 helper functions, to add parameters.
1690 (m4_push_args): Adjust caller.
1691 * m4/symtab.c (m4_symbol_value_print): Likewise.
1693 Stage 14a: allow printing argv references.
1694 Refactor symbol-value printing code for better sharing, and to
1695 allow printing a contiguous text representation of a $@ ref.
1696 Memory impact: none.
1698 * m4/m4module.h (m4_arg_print): New prototype.
1699 (m4_symbol_value_print): Alter prototype.
1700 * m4/input.c (struct input_funcs): Add parameter to peek_func.
1701 (file_peek, builtin_peek, string_peek): Ignore new parameter.
1702 (composite_peek): Ignore new parameter, for now.
1703 (composite_clean, pop_input): Rework to minimize indirection, and
1704 to avoid infinite recursion in next patch.
1705 * m4/macro.c (trace_prepre, trace_pre): Adjust callers.
1706 (m4_arg_print): New function.
1707 * m4/symtab.c (m4_symbol_value_print): Update signature.
1708 (m4_symbol_print): Update caller.
1709 * m4/output.c (m4_shipout_string_trunc): Update comments.
1710 * m4/syntax.c (set_quote_age): Require comma as argument separator
1711 when dealing with $@ as a unit.
1712 * tests/builtins.at (ifelse): Augment test.
1713 * doc/m4.texinfo (Changesyntax): Document changesyntax deficiency.
1715 2008-01-31 Eric Blake <ebb9@byu.net>
1717 Kill hack for M4 1.4.4.
1718 * configure.ac (AM_GNU_GETTEXT_INTL_SUBDIR): Delete, now that
1719 we require new enough autoconf which in turn requires M4 1.4.5.
1721 2008-01-31 Gary V. Vaughan <gary@gnu.org>
1722 and Eric Blake <ebb9@byu.net>
1724 Depend on new libtool to use non-recursive build.
1725 * configure.ac (LT_PREREQ): Bump to alpha release version.
1726 (LTDL_INIT): Choose nonrecursive mode. Perform sanity check that
1727 installed libtool has correct symbols.
1728 * Makefile.am (SUBDIRS): Drop ltdl, now that it is built from the
1730 (AM_CPPFLAGS): Drop directories covered by libtool.
1731 (AM_LDFLAGS): Drop -no-undefined, covered by libtool.
1732 (include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
1733 macros, used by libtool.
1734 (lib_LTLIBRARIES): Also used by libtool.
1735 (ltdl/libltdlc.la): Delete, now that libtool does this.
1736 * bootstrap: Mention new requirements.
1737 (LIBTOOLIZE): Provide default program, and run libtoolize prior to
1739 (autoreconf): Also neutralize libtoolize, since it is run early.
1740 * HACKING: Mention updated prerequisites.
1742 2008-01-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1744 Fix build failure if installed libltdl is used.
1745 * Makefile.am (m4_libm4_la_DEPENDENCIES): Use $(LTDLDEPS).
1747 2008-01-28 Eric Blake <ebb9@byu.net>
1749 Depend on newer autoconf, for testsuite -C dir.
1750 * Makefile.am (CD_TESTDIR): Delete, no longer required.
1751 (check-local, installcheck-local, clean-local-tests): Use new -C
1752 option from autotest.
1753 * configure.ac (AC_PREREQ): Bump to 2.61a.347.
1754 * bootstrap: Mention new dependency.
1755 * HACKING: Likewise.
1757 2008-01-27 Eric Blake <ebb9@byu.net>
1759 Stage 13: push composite text tokens.
1760 Support pushing composite tokens, allowing back-references to be
1761 reused through multiple macro expansions. Add hueristic that
1762 avoids creating new reference when pushing existing references.
1763 Memory impact: noticeable improvement due to better reference
1764 reuse, except for O(n) to O(n^2) copying in boxed recursion.
1765 Speed impact: slight penalty, due to more bookkeeping.
1766 * m4/m4private.h (m4__push_symbol): Adjust prototype.
1767 * m4/input.c (m4__push_symbol): Add parameter, and support
1769 (append_quote_token): Add parameter, and support inlining of short
1771 (m4__next_token): Adjust caller.
1772 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
1774 2008-01-26 Eric Blake <ebb9@byu.net>
1776 Stage 12c: add macro for m4_arg_len.
1777 Make a common action easier to type.
1778 Memory impact: none.
1780 * m4/m4module.h (M4ARGLEN): New macro.
1781 * m4/macro.c (process_macro): Adjust all callers.
1782 * m4/utility.c (m4_dump_args): Likewise.
1783 * modules/m4.c (divert, maketemp, mkstemp, m4wrap, len, index)
1785 * modules/gnu.c (builtin, indir, mkdtemp, patsubst, regexp)
1786 (renamesyms): Likewise.
1787 * modules/stdlib.c (setenv): Likewise.
1789 Stage 12b: add m4_string_pair.
1790 Make passing quote delimiters around more efficient.
1791 Memory impact: none.
1792 Speed impact: slight penalty, due to more bookkeeping.
1793 * m4/m4module.h (m4_string_pair): New type.
1794 (m4_get_syntax_quotes, m4_get_syntax_comments): New prototypes.
1795 (m4_symbol_value_print, m4_symbol_print, m4_shipout_string_trunc):
1797 * m4/m4private.h (struct m4_string): Delete.
1798 (struct m4_syntax_table): Combine quote and comment members.
1799 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
1800 (m4_get_syntax_ecomm): Adjust accessors.
1801 (m4_get_syntax_quotes, m4_get_syntax_comments): New fast
1803 * m4/symtab.c (m4_symbol_value_print, m4_symbol_print):
1805 * m4/input.c (string_print, composite_print, m4_input_print):
1806 All callers updated.
1807 * m4/syntax.c (m4_syntax_delete, m4_set_syntax)
1808 (check_is_single_quotes, m4_set_quotes, set_quote_age)
1809 (m4_get_syntax_lquote, m4_get_syntax_rquote)
1810 (m4_get_syntax_quotes, check_is_single_comments, m4_set_comment)
1811 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
1812 (m4_get_syntax_comments): Likewise.
1813 * m4/macro.c (trace_prepre, trace_pre, m4_push_args): Likewise.
1814 * m4/output.c (m4_shipout_string, m4_shipout_string_trunc):
1816 * modules/m4.c (dumpdef, m4_make_temp): Likewise.
1817 * src/freeze.c (produce_frozen_state): Likewise.
1818 * tests/freeze.at (reloading unknown builtin): Update test.
1820 Stage 12a: make m4_symbol_chain a union.
1821 Shrink size of symbol chains by using a union.
1822 Memory impact: slight improvement, due to smaller struct.
1823 Speed impact: slight improvement, due to less bookkeeping.
1824 * m4/m4private.h (enum m4__symbol_chain_type): New enum.
1825 (struct m4_symbol_chain): Rename...
1826 (struct m4__symbol_chain): ...to this, since it is internal.
1827 * m4/symtab.c (m4_symbol_value_copy, m4_symbol_value_print): All
1829 * m4/input.c (struct m4_input_block, m4__push_symbol)
1830 (composite_peek, composite_read, composite_unget)
1831 (composite_clean, composite_print, m4__make_text_link)
1832 (append_quote_token): Likewise.
1833 * m4/macro.c (expand_macro, arg_mark, m4_arg_symbol, m4_arg_text)
1834 (m4_arg_equal, m4_arg_len, m4_make_argv_ref, m4_push_arg)
1835 (m4_push_args): Likewise.
1837 2008-01-23 Eric Blake <ebb9@byu.net>
1839 Adjust to recent libtool interface change.
1840 * configure.ac (LT_PREREQ): Require bleeding-edge libtool.
1841 (LT_WITH_LTDL): Delete, now that it is obsolete.
1842 (LTDL_INIT): Use new libtool macro.
1844 2008-01-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1845 and Eric Blake <ebb9@byu.net>
1847 Rely on newer automake.
1848 * configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1, and add lzma
1850 * bootstrap: Update automake requirement.
1851 (func_version): Fix --version output, broken since 2007-08-06.
1852 * HACKING: Likewise. Add lzma requirement.
1853 * Makefile.am (clean-local-src): Not needed any more with newest
1855 (clean-local): Adjust.
1856 * TODO: Remove completed item.
1858 2008-01-22 Eric Blake <ebb9@byu.net>
1861 * doc/m4.texinfo (Renamesyms): Avoid underfull hbox, and improve
1864 2008-01-21 Eric Blake <ebb9@byu.net>
1866 Stage 11: full circle for single argument references.
1867 Pass quoted strings through to argument collection in a single
1868 action, so that an argument can be reused throughout macro
1869 recursion if it remains unchanged.
1870 Memory impact: noticeable improvement, due to more reuse in
1871 argument collection stacks; O(n^2) to O(n) on boxed recursion.
1872 Speed impact: noticeable improvement, due to less copying.
1873 * m4/m4module.h (m4_arg_text): Add parameter.
1875 * m4/m4private.h (CHAR_QUOTE): New input engine sentinel.
1876 (m4__make_text_link): New prototype.
1877 (struct m4_symbol_chain): Add quote_age member.
1878 (struct m4_symbol_value): Add end member to chained symbol.
1879 (struct m4_macro_args): Add wrapper member.
1880 * m4/symtab.c (m4_symbol_value_print): Print composite tokens.
1881 (m4_symbol_value_copy, m4_symbol_value_delete): Recognize
1883 * m4/input.c (make_text_link): Rename...
1884 (m4__make_text_link): ...to this, and export.
1885 (m4_push_string_finish): Adjust caller.
1886 (make_text_link, m4__push_symbol): Update new field.
1887 (file_read, builtin_read, string_read, composite_read, next_char):
1889 (m4_skip_line, match_input, consume_syntax): Adjust callers.
1890 (append_quote_token): New function.
1891 (m4__next_token): Pass quoted strings onto argument collection.
1892 (m4_print_token) [DEBUG_INPUT]: Update.
1893 * m4/macro.c (expand_argument): Collect composite arguments.
1894 (collect_arguments): Update new field.
1895 (expand_macro): Reduce ref-count of back-references after use.
1896 (arg_mark, m4_arg_symbol, m4_make_argv_ref): Adjust to new member
1898 (m4_is_arg_text): Also recognize composite symbols as text.
1899 (m4_arg_text, m4_arg_len): Merge composite symbols as needed.
1900 (m4_arg_equal): Compare composite symbols.
1901 (m4_push_arg, m4_push_args): Handle composite symbols.
1902 (m4_arg_symbol): Relax assertion.
1903 (process_macro): Use single-argument references.
1904 * m4/output.c (m4_shipout_string_trunc): Update comment.
1905 * tests/macros.at (Rescanning macros): Augment test.
1907 2008-01-16 Eric Blake <ebb9@byu.net>
1909 Stage 10: avoid extra copying of strings and comments.
1910 When collecting tokens that are immune to further expansion, avoid
1911 copying data from one obstack to another by outputting it into the
1912 destination obstack to begin with. Also reduce copying done in
1914 Memory impact: slight improvement, due to better obstack usage.
1915 Speed impact: noticeable improvement, due less data copying.
1916 * ltdl/m4/gnulib-cache.m4: Import intprops and vasnprintf-posix
1918 * m4/m4private.h (m4__token_type): Adjust prototype.
1919 * m4/input.c (m4__next_token): Support new parameter.
1920 * m4/macro.c (m4_macro_expand_input, expand_token)
1921 (expand_argument, collect_arguments): Adjust callers.
1922 * modules/m4.c (ntoa): Tighten buffer size.
1923 * m4/output.c (m4_tmpname): Guarantee no buffer overflow.
1924 * modules/format.c (arg_int, arg_long, arg_double): New helper
1925 functions, to detect overflow or unparsed characters.
1926 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Adjust to check for
1927 missing or excess arguments.
1928 (format): Likewise, and also output directly into obstack if there
1930 * doc/m4.texinfo (History): Update for new year.
1931 (Format): Test for new warnings.
1933 2008-01-15 Eric Blake <ebb9@byu.net>
1935 * TODO: Update with some newer URLs.
1937 Verify linear `index'.
1938 * tests/builtins.at (index): New test.
1939 (translit): Make test take longer, to make quadratic algorithms
1942 2007-12-20 Eric Blake <ebb9@byu.net>
1944 Stage 9: share rather than copy single-arg refs.
1945 Use hooks of previous patch to create back-references to arguments
1946 in the input engine, and inline short text rather than always
1947 creating a FIFO link. Also start testing embedded NUL behavior.
1948 Until the argument collection engine also shares references, the
1949 memory usage increases.
1950 Memory impact: noticeable penalty, due to longer life of argv
1951 changing O(n) to O(n^2) on boxed recursion.
1952 Speed impact: slight improvement, due less data copying.
1953 * ltdl/m4/gnulib-cache.m4: Import memmem and quote modules.
1954 * m4/m4module.h (m4_arg_scratch): New prototype.
1955 * m4/m4private.h (m4__push_symbol): Add parameter.
1956 (m4_arg_scratch): Add fast accessor.
1957 (struct m4): Add expansion_level member, taken...
1958 * m4/macro.c (expansion_level): ...from here. Adjust all users.
1959 (expand_argument): Minor cleanup.
1960 (expand_macro): Track scratch space per macro call.
1961 (m4_arg_scratch): New function.
1962 (m4_make_argv_ref): Call new function.
1963 (m4_push_arg): Push reference to $0.
1964 (m4_push_args): Rework separator usage, since separators will
1966 (process_macro): Allow embedded NUL.
1967 * m4/input.c (INPUT_INLINE_THRESHOLD): New define.
1968 (m4__push_symbol): Add parameter. Inline short strings, and save
1969 references through rescanning.
1970 * m4/symtab.c (m4_set_symbol_value_text): Weaken assertion.
1971 * modules/m4.c (errprint, index): Handle NUL transparently.
1972 (dumpdef, translit): Use scratch space, rather than expansion
1974 * modules/gnu.c (renamesyms, m4symbols): Likewise.
1975 * tests/others.at (nul character): New test.
1976 (iso8859): Quote absolute file name, remove XFAIL.
1977 * tests/iso8859.m4: Avoid raw NUL in output.
1978 * tests/null.m4: New file.
1979 * tests/null.out: Likewise.
1980 * tests/null.err: Likewise.
1981 * Makefile.am (OTHER_FILES): Distribute new files.
1982 * .gitattributes: Treat new files as text.
1984 2007-12-17 Eric Blake <ebb9@byu.net>
1986 Stage 8: extend life of references into argv.
1987 Add hooks to lengthen the lifetime of arguments reused in a macro
1988 expansion, rather than always discarding arguments at the end of
1989 expand_macro. Rework the expand_macro obstacks to handle longer
1990 lifetimes. For now, the hooks remain unused.
1991 Memory impact: slight penalty, due to larger structs.
1992 Speed impact: slight penalty, due to more bookkeeping.
1993 * m4/system_.h (obstack_regrow): Delete.
1994 * m4/m4private.h (struct m4_symbol_chain): Add level field.
1995 (m4__push_symbol): Adjust prototype.
1996 (m4__adjust_refcount): New prototype.
1997 (DEBUG_MACRO) [DEBUG]: New debug control.
1998 (struct m4__macro_arg_stacks): New structure.
1999 (struct m4): Add arg_stacks, stacks_count fields.
2000 * m4/m4module.h (m4_make_argv_ref): Add parameter.
2001 * m4/macro.c (argc_stack, argv_stack): Delete, replaced by
2002 context->arg_stacks.
2003 (m4_macro_expand_input) [DEBUG_MACRO]: Add debug hooks,
2004 conditional on M4_DEBUG_MACRO envvar.
2005 (collect_arguments): Adjust signature.
2006 (expand_macro): Rework obstack handling.
2007 (m4__adjust_refcount, arg_mark): New functions.
2008 (m4_make_argv_ref): Populate new field.
2009 (m4_push_arg, m4_push_args): Track inuse.
2010 (process_macro): One less cast.
2011 * m4/m4.c (m4_delete): Clean up arg_stacks.
2012 * m4/input.c (make_text_link): Use new field.
2013 (m4__push_symbol, file_clean): Update signature.
2014 (composite_read): Bump refcount when done with reference.
2015 (composite_clean): New function.
2016 (pop_input): Adjust caller.
2017 * m4/debug.c (m4_debug_message): Make assertion match comment.
2018 * modules/gnu.c (builtin, indir): Adjust callers.
2019 * tests/builtins.at (ifelse): New test.
2020 (exp): Move and rename...
2021 * tests/others.at (countdown): ...to this.
2022 * doc/m4.texinfo (Improved foreach): Fix tracing usage in
2025 2007-12-13 Eric Blake <ebb9@byu.net>
2028 * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
2033 2007-12-13 Paolo Bonzini <bonzini@gnu.org> (tiny change)
2035 * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
2037 Reported by Giovanni Toffetti.
2039 2007-12-11 Eric Blake <ebb9@byu.net>
2041 Stage 7: use chained input support in input parser.
2042 Allow the LIFO input engine to rescan a macro expansion composed
2043 of smaller chunks of FIFO data, rather than the old approach of a
2044 monolithic string. For now, all chunks are still copied.
2045 Memory impact: slight penalty, due to FIFO chain overhead.
2046 Speed impact: slight penalty, due to extra bookkeeping.
2047 * m4/m4private.h (m4__push_symbol): New prototype.
2048 (struct m4_symbol_chain): Add const-safety.
2049 * m4/symtab.c (m4_symbol_value_print): Simplify.
2050 (dump_symbol_CB): Update caller.
2051 * m4/input.c (struct m4_input_block): Alter u_c member, first
2052 introduced 2006-10-25, but unused until now.
2053 (composite_peek, composite_read, composite_unget)
2054 (composite_print, init_builtin_token): Rewrite accordingly.
2055 (m4_push_wrapup): No longer need trailing NUL.
2056 (m4__push_symbol, make_text_link): New functions.
2057 (m4_push_string_finish): Use them.
2058 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
2059 (expand_macro): Simplify logic of nesting_limit.
2060 * src/main.c (main): Likewise.
2061 * doc/m4.texinfo (Dumpdef): Augment test.
2063 2007-12-08 Eric Blake <ebb9@byu.net>
2065 Stage 6: convert builtins to push arg at a time.
2066 Add new methods to factor all builtins whose expansion includes an
2067 argument, making back-reference creation easier in future patches.
2068 Factor out length-limited printing to obstacks, and use -1 rather
2069 than 0 for unlimited length.
2070 Memory impact: none.
2071 Speed impact: slight improvement, due to better code sharing.
2072 * m4/m4module.h (m4_shipout_text): Rename...
2073 (m4_divert_text): ...to this, to avoid confusion with m4_shipout_*
2074 that does not worry about sync lines.
2075 (m4_shipout_string_trunc): New prototype.
2076 * m4/output.c (m4_shipout_text): Rename...
2077 (m4_divert_text): ...to this.
2078 (m4_shipout_string): Move guts...
2079 (m4_shipout_string_trunc): ...to this new function.
2080 * m4/macro.c (m4_push_arg, m4_push_args): New functions.
2081 (expand_token, process_macro): Update callers.
2082 * m4/input.c (string_print): Likewise.
2083 * modules/m4.c (ifdef, ifelse, shift, substr, translit, divert):
2085 * modules/gnu.c (patsubst): Likewise.
2086 (debuglen): Use SIZE_MAX for unlimited debug length.
2087 * src/main.c (main): Likewise.
2088 * m4/m4.c (m4_create): Default max_debug_length to SIZE_MAX, not
2091 2007-12-07 Eric Blake <ebb9@byu.net>
2093 Minor security fix: Quote output of mkstemp.
2094 * modules/m4.c (m4_make_temp): Produce quoted output.
2095 * doc/m4.texinfo (Mkstemp, Mkdtemp): Update the documentation and
2098 Stage 5: add notion of quote age.
2099 Cache the quoting rules that were in effect when a string was
2100 parsed, to avoid reparsing that string if no changequote or other
2101 quote age change took place in the meantime. A quote_age of 0 is
2102 always safe, but does not benefit from caching.
2103 Memory impact: slight improvement, due to smaller struct in input
2105 Speed impact: slight penalty, due to more bookkeeping.
2106 * m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
2107 (m4_set_symbol_value_text): Adjust prototype.
2108 (m4_has_syntax): Factor out the unsigned char cast.
2109 * m4/m4private.h (struct m4_syntax_table): Add syntax_age and
2111 (m4__quote_age, m4__safe_quotes): New accessor macros, no need for
2112 functions at this point.
2113 (struct m4_symbol_value, struct m4_macro_args): Add quote_age
2115 (m4_set_symbol_value_text): Adjust fast accessor.
2116 (m4_get_symbol_value_quote_age): New fast accessor.
2117 * m4/symtab.c (m4_set_symbol_value_text): Add parameter.
2118 (m4_get_symbol_value_quote_age): New function.
2119 (m4_symbol_value_copy): Adjust callers.
2120 * m4/macro.c (expand_token): Add parameter, and track quote age.
2121 (expand_argument, collect_arguments): Track quote age.
2122 (m4_macro_expand_input, process_macro, m4_make_argv_ref)
2123 (m4_macro_expand_input): Update callers.
2124 (m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
2125 * m4/input.c: Comment cleanups.
2126 (struct m4_input_block): Reduce size.
2127 (m4__next_token): Report quote age.
2128 (m4_push_builtin, init_builtin_token): Update callers.
2129 * m4/utility.c (skip_space): Adjust callers.
2130 * m4/module.c (install_macro_table): Likewise.
2131 * m4/syntax.c (m4_set_syntax): Initialize and update quote age.
2132 (m4_set_quotes, m4_set_comment): Detect no-op changes, and update
2134 (set_quote_age): New helper function.
2135 (check_is_single_quotes, check_is_single_comments): Adjust
2137 * src/freeze.c (reload_frozen_state): Likewise.
2138 * src/main.c (main): Likewise.
2139 * modules/m4.c (define, pushdef): No need to set macro text.
2140 * tests/builtins.at (changequote, defn): New tests.
2141 * examples/wrapfifo.m4: New file.
2142 * examples/wraplifo.m4: New file.
2143 * Makefile.am (dist_pkgdata_DATA): Distribute new examples.
2145 2007-12-04 Eric Blake <ebb9@byu.net>
2147 Fix builds with OpenBSD make.
2148 * Makefile.am (HELP2MAN): New macro.
2149 (dist_man_MANS, doc/m4.1): Fix rules for building m4.1 into
2151 * README: Update copyright.
2152 * HACKING: Mention help2man and makeinfo dependencies.
2154 2007-11-29 Eric Blake <ebb9@byu.net>
2156 Stage 4: route indir, builtin through ref; make argv opaque.
2157 Finish making struct opaque to all but the input engine, by
2158 reworking obstack usage in expand_macro to better support creation
2159 of a $@ reference. Canonicalize the empty argument, to allow
2160 pointer comparison optimizations.
2161 Memory impact: slight penalty, due to larger struct.
2162 Speed impact: slight improvement, due to fewer function calls.
2163 * m4/system_.h (obstack_regrow): Fix precedence.
2164 * m4/m4module.h (m4_arg_equal, m4_arg_empty, m4_make_argv_ref):
2166 (struct m4_macro_args): Move...
2167 * m4/m4private.h (struct m4_macro_args): ...here, making it opaque
2168 to modules. Add has_ref member.
2169 (bool_bitfield): New helper typedef.
2170 (struct m4_symbol_chain): Add flatten and len members.
2171 * m4/macro.c (empty_symbol): New placeholder, for optimizing
2172 comparison with empty string.
2173 (m4_macro_expand_input): Initialize it.
2174 (collect_arguments): Alter signature, and populate new fields.
2175 (trace_pre, trace_post): Remove redundant parameter.
2176 (expand_macro): Alter handling of obstacks.
2177 (m4_arg_symbol): Account for wrapped argv.
2178 (m4_arg_equal, m4_arg_empty, m4_make_argv_ref): New methods.
2179 (m4_arg_text, m4_arg_len, m4_arg_func): Use new methods.
2180 * modules/m4.c (ifelse, syscmd): Likewise.
2181 * modules/evalparse.c (m4_evaluate): Likewise.
2182 (undefine, popdef, m4_dump_symbols): Optimize.
2183 * modules/gnu.c (builtin, indir, esyscmd, debugfile): Use new
2185 (changesyntax, regexp): Optimize.
2186 * m4/output.c (diversion_storage): Use typedef.
2188 Stage 3b: cache length, rather than computing it, in modules.
2189 Use cached token length in builtins and output engine.
2190 Memory impact: none.
2191 Speed impact: noticeable improvement, due to fewer function calls.
2192 * m4/hash.c (m4_hash_remove): Avoid double free on remove
2194 * m4/output.c (m4_shipout_string): Change semantics of len param.
2195 (m4_shipout_int): Use cached length.
2196 * m4/input.c (m4_push_string_finish): Likewise.
2197 * modules/m4.h (m4_make_temp_func): Add parameter.
2198 * m4/macro.c (expand_token, m4_arg_len): Use cached length.
2199 (collect_arguments, expand_macro): Alter signature.
2200 (trace_format): Don't use out-of-scope buffer.
2201 (process_macro): All callers changed.
2202 * m4/utility.c (m4_dump_args): Likewise.
2203 * m4/symtab.c (m4_symbol_value_print): Likewise.
2204 * modules/gnu.c (__file__, __program__, builtin, indir)
2205 (m4symbols, mkdtemp, regexp_compile, regexp_substitute,
2206 renamesyms, patsubst, regexp, regexp_compile): Likewise.
2207 * modules/load.c (m4modules): Likewise.
2208 * modules/m4.c (defn, m4wrap, maketemp, m4_make_temp)
2209 (numb_obstack, ifdef, ifelse, divert, len, substr): Likewise.
2210 * modules/perl.c (perleval): Likewise.
2211 * modules/stdlib.c (getcwd, getenv, getlogin, getpwnam, getpwuid)
2212 (hostname, uname, setenv): Likewise.
2213 * modules/mpeval.c (numb_obstack): Likewise.
2214 * src/freeze.c (dump_symbol_CB): Likewise.
2215 * doc/m4.texinfo (Renamesyms, Dumpdef, Changesyntax): Adjust test.
2216 * tests/builtins.at (mkstemp): Likewise.
2217 * tests/others.at (iso8859): XFAIL this test, now that
2218 length-based handling allows NUL through part but not all of M4.
2220 2007-11-28 Eric Blake <ebb9@byu.net>
2222 Stage 3a: cache length, rather than computing it, in libm4.
2223 Cache the length of a token in the input engine and symbol table,
2224 to avoid repeating lots of strlen calls. Additionally, by using
2225 obstack length rather than strlen, the input engine can now
2226 support embedded NUL.
2227 Memory impact: slight penalty, due to larger struct.
2228 Speed impact: slight improvement, due to fewer function calls.
2229 * m4/m4module.h (struct m4_macro_args): Cache length.
2230 (m4_get_symbol_len, m4_get_symbol_value_len): New accessors.
2231 (m4_set_symbol_value_text): Change signature.
2232 * m4/m4private.h (struct m4_symbol_value): Store string length.
2233 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2234 (m4_set_symbol_value_placeholder): Update accordingly.
2235 (m4_set_symbol_value_text): Change signature.
2236 (m4_get_symbol_value_len): New accessor.
2237 * m4/input.c (struct m4_input_block, string_peek, string_read)
2238 (string_unget, string_print, m4_push_string_finish)
2239 (m4_push_wrapup): Track length of string input.
2240 (m4__next_token): Adjust all users of symbol text to track length,
2242 * m4/macro.c (expand_argument, collect_arguments): Likewise.
2243 * m4/module.c (install_macro_table): Likewise.
2244 * modules/gnu.c (builtin, indir): Likewise.
2245 * modules/m4.c (define, pushdef): Likewise.
2246 * src/main.c (main): Likewise.
2247 * src/freeze.c (reload_frozen_state): Likewise.
2248 * m4/symtab.c (m4_symbol_value_copy): Likewise.
2249 (m4_get_symbol_value_len): New function.
2250 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2251 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
2252 Adjust implementation.
2254 2007-11-27 Eric Blake <ebb9@byu.net>
2256 Stage 2: use accessors, not direct reference, into argv.
2257 Outside of macro.c, use accessor methods rather than direct access
2258 into the argv struct.
2259 Memory impact: none.
2260 Speed impact: slight penalty, due to increased function calls.
2261 * m4/m4private.h (m4_arg_argc): New fast accessor.
2262 * m4/m4module.h (m4_arg_argc, m4_arg_symbol, m4_is_arg_text)
2263 (m4_is_arg_func, m4_arg_text, m4_arg_len, m4_arg_func): New
2265 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2266 (m4_macro_call): Make argc unsigned.
2267 (M4ARG): Use new accessors.
2268 * modules/m4.c (define, pushdef): Likewise.
2269 (undefine, popdef, ifelse, m4_dump_symbols, defn, undivert)
2270 (traceon, traceoff): Make argc unsigned.
2271 * modules/m4.h (m4_dump_symbols_func): Likewise.
2272 * modules/evalparse.c (m4_evaluate): Likewise.
2273 * modules/gnu.c (builtin, indir): Use new accessors.
2274 (changesyntax): Make argc unsigned.
2275 * modules/perl.c (perleval): Likewise.
2276 * m4/utility.c (m4_dump_args): Use new accessors.
2277 * m4/macro.c (trace_pre): Likewise.
2278 (m4_arg_symbol, m4_arg_argc, m4_is_arg_text, m4_is_arg_func)
2279 (m4_arg_text, m4_arg_len, m4_arg_func): New functions.
2280 (expand_macro, trace_pre, trace_post, m4_macro_call): Update argc
2283 2007-11-24 Eric Blake <ebb9@byu.net>
2285 Stage 1: convert m4_symbol_value** into new object.
2286 Pass a variable-size wrapper structure instead of an array to
2287 builtins, so that subsequent optimizations in the structure need
2288 not impact every builtin client.
2289 Memory impact: slight penalty, since struct is larger than array.
2290 Speed impact: slight penalty, due to increased bookkeeping.
2291 * ltdl/m4/gnulib-cache.m4: Import flexmember module.
2292 * m4/m4module.h (m4_macro_args): New type, will be opaque to
2294 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2295 (m4_macro_call): Alter signature to use m4_macro_args object.
2296 (M4ARG): Redefine to access new struct.
2297 * m4/m4private.h (M4_SYMBOL_COMP): New enumerator.
2298 (struct m4_symbol_chain): New type.
2299 (struct m4_symbol_value): Add chain alternative.
2300 * m4/macro.c (collect_arguments): Build new struct.
2301 (expand_macro, m4_macro_call, process_macro, trace_pre)
2302 (trace_post): Adjust implementation to use it.
2303 * m4/utility.c (m4_dump_args): Likewise.
2304 * modules/gnu.c (builtin, indir): Likewise.
2305 * modules/format.c (format): Likewise.
2306 * modules/m4.h (m4_dump_symbols_func): Likewise.
2307 * modules/m4.c (m4_dump_symbols, define, pushdef, defn, ifelse)
2308 (shift, include, errprint, m4wrap): Likewise.
2309 * modules/evalparse.c (m4_evaluate): Likewise.
2311 Pass only macro name to utility functions.
2312 * m4/m4module.h (m4_bad_argc, m4_numeric_arg): Adjust signature.
2313 * m4/utility.c (m4_bad_argc, m4_numeric_arg): Adjust
2315 * m4/macro.c (m4_macro_call): Adjust callers.
2316 * modules/gnu.c (builtin, debuglen): Likewise.
2317 * modules/m4.c (ifelse, incr, decr, divert, undivert, m4exit)
2319 * modules/evalparse.c (m4_evaluate): Likewise.
2320 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
2321 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
2324 2007-11-23 Eric Blake <ebb9@byu.net>
2326 Add macro name to debugfile messages.
2327 * m4/m4module.h (m4_debug_set_output): Add parameter.
2328 * m4/debug.c (m4_debug_set_output, set_debug_file): Pass macro
2330 * modules/gnu.c (debugfile): Adjust caller.
2331 * modules/m4.c (m4exit): Likewise.
2332 * src/main.c (main): Likewise.
2334 Factor out handling of macro name in error messages.
2335 * m4/m4module.h (m4_error, m4_error_at_line, m4_warn)
2336 (m4_warn_at_line): Add new parameter.
2337 * m4/utility.c (m4_verror_at_line): New helper method.
2338 (m4_error, m4_error_at_line, m4_warn, m4_warn_at_line): Add new
2340 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg): All callers
2342 * m4/debug.c: Likewise.
2343 * m4/input.c: Likewise.
2344 * m4/macro.c: Likewise.
2345 * m4/module.c: Likewise.
2346 * m4/output.c: Likewise.
2347 * m4/path.c: Likewise.
2348 * modules/evalparse.c: Likewise.
2349 * modules/format.c: Likewise.
2350 * modules/gnu.c: Likewise.
2351 * modules/load.c: Likewise.
2352 * modules/m4.c: Likewise.
2353 * modules/mpeval.c: Likewise.
2354 * src/freeze.c: Likewise.
2355 * src/main.c: Likewise.
2357 2007-11-14 Eric Blake <ebb9@byu.net>
2359 Handle some defn corner cases differently.
2360 * doc/m4.texinfo (Defn): Update documentation; although this still
2361 doesn't match the branch, since it may be changed before 2.0.
2362 * m4/macro.c (expand_argument): Consistently ignore builtins in
2363 concatenation contexts.
2364 * m4/m4private.h (m4__symbol_type): Fix C89 compliance bug.
2366 2007-11-13 Eric Blake <ebb9@byu.net>
2368 Note: Patches titled Stage 0 through N form a series of patches
2369 which decreases the algorithmic complexity of tail recursion in
2370 macro expansions from O(n^2) to O(n) in both time and memory, then
2371 performs cleanups, such as handling of embedded NUL, made easier
2372 by the code refactoring.
2374 Stage 0: Fix memory leak in tail recursion.
2375 Free expansion text in the input engine as soon as it is parsed,
2376 rather than when the recursive expansion completes.
2377 Memory impact: noticeable improvement, due to reduction from
2378 O(n^2) to O(n) on recursion.
2379 Speed impact: minor improvement, due to better memory usage.
2380 * m4/input.c (pop_input): Add flag parameter and return type.
2381 (next_char): Adjust caller.
2382 (m4_push_string_init): Let go of memory earlier.
2384 2007-11-07 Eric Blake <ebb9@byu.net>
2386 * tests/macros.at (Rescanning macros): Test more corner cases.
2388 2007-11-06 Eric Blake <ebb9@byu.net>
2390 * build-aux/mkstamp: Rename from ltdl/config/mkstamp.
2392 * Makefile.am (tests/package.m4): Work around bash bug.
2393 Reported by Ralf Wildenhues.
2395 2007-11-05 Eric Blake <ebb9@byu.net>
2397 For consistency with other GNU projects, use build-aux directory.
2398 * configure.ac (AC_CONFIG_AUX_DIR): Change ltdl/config to
2400 * bootstrap (config_aux_dir): Likewise.
2401 * Makefile.am (config_aux_dir): Likewise.
2402 * ltdl/m4/gnulib-cache.m4: Use --aux-dir option.
2404 2007-11-02 Eric Blake <ebb9@byu.net>
2406 Update some documentation about version control.
2407 * NEWS: M4 is now stored in git.
2408 * HACKING: Likewise.
2410 * bootstrap: Likewise.
2411 * commit: Delete, now that CVS commits are no longer necessary.
2412 * ltdl/config/mailnotify: No longer necessary; git's patch
2413 generation and mail capability is more powerful.
2415 Update to recent gnulib changes.
2416 * ltdl/m4/gnulib-cache.m4: Replace fprintf-posix, vasprintf-posix,
2417 xprintf, and xvasprintf with xprintf-posix and xvasprintf-posix.
2419 2007-11-01 Eric Blake <ebb9@byu.net>
2421 Improve error message when early end of file occurs.
2422 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
2423 (M4wrap): Adjust to new messages.
2424 (Improved capitalize): Enhance test.
2425 * m4/m4private.h (m4__next_token): Adjust prototype.
2426 * m4/input.c (m4__next_token): Add new parameter, and improve
2428 * m4/macro.c (m4_macro_expand_input, collect_arguments): Adjust
2430 (expand_argument): Likewise, and add parameter.
2432 2007-10-31 Eric Blake <ebb9@byu.net>
2434 Test more corner cases.
2435 * tests/macros.at (Rescanning macros): Beef up test.
2436 * doc/m4.texinfo (Changecom): Beef up test.
2437 (Improved foreach): Document alternate foreachq style.
2438 * examples/foreachq3.m4: New file.
2439 * examples/loop.m4: New file.
2440 * Makefile.am (dist_pkgdata_DATA): Distribute them.
2442 2007-10-28 Eric Blake <ebb9@byu.net>
2444 More test coverage for autoconf usage patterns.
2445 * doc/m4.texinfo (Shift): Document cond macro, and add new test.
2446 * tests/macros.at (Rescanning macros): New test.
2447 * tests/builtins.at (include): Augment test.
2449 2007-10-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2451 * Makefile.am: Adjust getopt handling to latest gnulib layout.
2453 2007-10-27 Eric Blake <ebb9@byu.net>
2455 Document one use of changequote(`(',`)').
2456 * doc/m4.texinfo (Changequote): Add new test, based on recent
2457 autoconf addition of m4_expand.
2459 2007-10-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2461 * Makefile.am (dist_pkgdata_DATA): Add examples/capitalize2.m4.
2463 2007-10-22 Eric Blake <ebb9@byu.net>
2465 Never let printf failures go undetected.
2466 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2468 * m4/system_.h: Include xprintf.h.
2469 * m4/debug.c (m4_debug_message_prefix, m4_debug_message): Wrap all
2470 use of printf, xprintf.
2471 * m4/input.c [DEBUG_INPUT]: Likewise.
2472 * m4/module.c [DEBUG_MODULES]: Likewise.
2473 * m4/output.c (m4_shipout_text, m4_shipout_int)
2474 (m4_freeze_diversions): Likewise.
2475 * m4/path.c [DEBUG_INCL]: Likewise.
2476 * m4/symtab.c [DEBUG_SYM]: Likewise.
2477 * m4/syntax.c [DEBUG_SYNTAX]: Likewise.
2478 * modules/modtest.c (export_test): Likewise.
2479 * src/freeze.c (produce_resyntax_dump, produce_syntax_dump)
2480 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
2482 * src/main.c (usage): Likewise.
2483 * po/POTFILES.in: Adjust to new file.
2484 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
2486 2007-10-18 Eric Blake <ebb9@byu.net>
2488 Fix 'm4 -F file -t undefined'.
2489 * src/freeze.c (produce_symbol_dump): Skip trace placeholders.
2490 * src/freeze.c (dump_symbol_CB): Also skip void symbols.
2491 * tests/freeze.at (reloading unknown builtin): Test for this bug.
2492 * m4/m4module.h (m4_symtab_apply): Add parameter.
2493 * m4/symtab.c (m4_symtab_apply): Ignore trace placeholders when
2495 (m4_symtab_delete, symtab_dump): Adjust callers.
2496 * modules/m4.c (m4_dump_symbols): Likewise.
2498 2007-10-09 Eric Blake <ebb9@byu.net>
2500 Fix regexp regression of 2007-09-29.
2501 * modules/gnu.c (substitute): Allow NULL buf when no
2502 subexpressions were present.
2503 (regexp): Handle \ escapes even with empty regex.
2504 * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
2506 Cache regex compilation for another autoconf speedup.
2507 * modules/gnu.c (gnu_buf): Replace...
2508 (REGEX_CACHE_SIZE, regex_cache): ...with new declarations.
2509 (m4_pattern_buffer): Add fields.
2510 (m4_regexp_compile): Rename...
2511 (regexp_compile): ...to this, and drop no_sub parameter.
2513 (M4FINISH_HANDLER): Clean up entire cache.
2514 (m4_regexp_search): Rename...
2515 (regex_search): ...to this, adjust to new struct contents, and add
2517 (m4_regexp_substitute): Rename...
2518 (regexp_substitute): ...to this.
2519 (substitute, patsubst, regexp, renamesyms): Adjust callers.
2521 2007-10-02 Eric Blake <ebb9@byu.net>
2523 Document quoting pitfalls in capitalize.
2524 * doc/m4.texinfo (Patsubst): Use the examples directory. Also
2526 (Improved capitalize): New node.
2527 * examples/capitalize.m4: Update to match manual.
2528 * examples/capitalize2.m4: New file.
2530 2007-10-01 Eric Blake <ebb9@byu.net>
2532 Another Autoconf usage pattern optimization.
2533 * modules/m4.c (m4_index): Optimize search for one byte.
2534 * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
2537 2007-09-29 Eric Blake <ebb9@byu.net>
2539 Optimize for Autoconf usage pattern.
2540 * modules/gnu.c (regexp, patsubst): Handle empty regex faster.
2542 * tests/testsuite.at (AT_CHECK_M4): Slight optimization.
2544 2007-09-24 Eric Blake <ebb9@byu.net>
2546 Create .gitignore alongside .cvsignore.
2547 * bootstrap (version control): Update to reflect git usage.
2549 2007-09-13 Eric Blake <ebb9@byu.net>
2551 * AUTHORS: Fix typo.
2553 2007-09-12 Gary V. Vaughan <gary@gnu.org>
2555 Be consistent about using 'module' for m4_module types and
2556 'handle' for lt_dlhandle types:
2558 * m4/m4private.h (m4_symbol_value): Rename handle element to
2559 method. Changed all references.
2560 (VALUE_MODULE, SYMBOL_MODULE): Renamed from VALUE_HANDLE and
2561 SYMBOL_HANDLE respectively. Changed all references.
2562 * m4/m4module.h (M4INIT_HANDLER, M4FINISH_HANDLER): Ditto.
2563 * m4/builtin.c (m4_builtin_find_by_name)
2564 (m4_builtin_find_by_func): Use module as the parameter name for
2565 pointers of type 'm4_module'.
2566 * m4/module.c (module_remove, m4_get_module_name)
2567 (install_builtin_table, install_macro_table)
2568 (m4_module_make_resident, m4__module_next, m4_module_refcount):
2570 * src/freeze.c (produce_module_dump): Ditto.
2571 * m4/input.c (m4_input_block): Rename handle element to method.
2572 Changed all references.
2573 * m4/symtab.c (m4__symtab_remove_module_references): Ditto.
2574 * modules/load.c: Use module as the variable name for pointers
2575 of type 'm4_module'.
2576 * modules/m4.c: Ditto.
2577 * modules/perl.c: Ditto.
2578 * modules/shadow.c: Ditto.
2580 2007-09-07 Eric Blake <ebb9@byu.net>
2582 Add refcount builtin.
2583 * modules/load.c (refcount): New builtin.
2584 (m4modules): Use correct type.
2585 * doc/m4.texinfo (Refcount): New section.
2586 * m4/m4private.h (struct m4_module): Add refcount member.
2587 (m4_module_refcount) [NDEBUG]: Add faster accessor macro.
2588 * m4/module.c (m4_module_load): Add symbols to table on first
2589 load by m4, regardless of other libltdl loads of same module.
2590 (m4_module_refcount): Use new struct member, rather than relying
2591 on libltdl count which might be inflated by unrelated loads.
2592 (m4__module_interface): Optimize.
2593 (m4__module_next, m4__module_find): Avoid assertions that could
2594 trigger with unrelated libltdl loads.
2595 (m4__module_open): Track m4 load count.
2596 (m4__module_exit): Only unload what m4 loaded.
2597 (module_remove): Track m4 unloads.
2598 * NEWS: Document new builtin.
2600 More conversion to m4_module*.
2601 * src/freeze.c (produce_module_dump, dump_symbol_CB)
2602 (reload_frozen_state): Use correct type.
2603 * m4/input.c (struct m4_input_block): Likewise.
2604 * m4/symtab.c (dump_symbol_CB): Likewise.
2606 * AUTHORS: Simplify, to match libtool and autoconf layout.
2607 * THANKS: Sync with branch.
2609 2007-09-06 Eric Blake <ebb9@byu.net>
2611 Wrap lt_dlhandle in struct m4_module.
2612 * m4/m4module.h (includes): No longer require clients to know
2614 (m4_module): New opaque declaration.
2615 (m4_export): Delete unused type.
2616 (M4INIT_HANDLER, M4FINISH_HANDLER, m4_module_init_func)
2617 (m4_module_finish_func, m4_module_load, m4_get_module_name)
2618 (m4_builtin_find_by_name, m4_builtin_find_by_func): Use new
2620 (m4_module_makeresident, m4_module_refcount): New declarations.
2621 * m4/m4private.h (includes): Move <ltdl.h> here.
2622 (m4_module): New declaration. Simple for now, but intended for
2624 (m4__module_open, m4__module_next, m4__module_find)
2625 (m4__symtab_remove_module_references): Use new wrapper.
2626 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
2628 * m4/module.c (m4_get_module_name, m4_module_import)
2629 (m4_module_load): Likewise.
2630 (install_builtin_table, install_macro_table): Likewise. Also,
2631 change return type since these always returned NULL and no one
2633 (m4_module_makeresident, m4_module_refcount): New functions.
2634 (m4_module_unload, m4__module_next, m4__module_find): Use new
2636 (m4__module_open): Populate new wrapper, and associate it with the
2638 (m4__module_exit): Use new wrapper.
2639 (module_remove): Likewise. Reclaim storage on last use.
2640 (module_close): Delete, and inline into module_remove.
2641 * m4/symtab.c (m4__symtab_remove_module_references): Use new
2643 * modules/load.c (load_init): Use new API.
2644 * modules/m4.c (m4_export_table): Kill unused declaration.
2645 (m4_init): Use new API.
2646 * modules/shadow.c (shadow_init): Use new API.
2647 * src/main.c (main): Adjust callers.
2648 * src/freeze.c (reload_frozen_state): Likewise.
2649 * tests/modules.at (unload load module): New test.
2651 2007-09-03 Gary V. Vaughan <gary@gnu.org>
2653 * bootstrap (ltdl/m4/.cvsignore): Add xstrtol module macros.
2654 * src/m4/.cvsignore: Add xstrtol module sources.
2656 2007-09-03 Gary V. Vaughan <gary@gnu.org>
2658 Work around a bug in darwin's awk:
2660 * bootstrap (func_get_translations): Use $AWK instead of raw
2661 `awk' so that the user can use an alternative implementation
2662 if the first awk in PATH doesn't behave as expected.
2663 (func_get_translations): The first awk script mangles the last
2664 entry passed to it for at least the awk implementation shipped
2665 with Darwin 8.10.1. Capture $3 into a variable too to work-
2666 around that problem.
2668 2007-08-29 Gary V. Vaughan <gary@gnu.org>
2670 As gnulib xstrtol is only used by main, and unconditionally pulls
2671 in a copy of getopt, undo bootstrap change from 2007-08-11 below,
2672 and copy the xstrtol code into src/ so that main() can use it
2673 without pushing the extra code into libm4:
2675 * bootstrap (src_modules): Add getopt and xstrtol modules.
2676 * Makefile.am (src_m4_SOURCES): Add xstrtol sources.
2677 * po/POTFILES.in: Move gnu/xstrtol-error.c to src/xstrtol-error.c.
2679 2007-08-11 Eric Blake <ebb9@byu.net>
2681 Another upstream xstrtol change.
2682 * po/POTFILES.in: Track changes in files containing messages.
2683 * bootstrap (src_modules): getopt is now pulled into libgnu.a, no
2684 need to grab it separately.
2685 * src/main.c (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
2687 (size_opt): Adjust to latest xstrtol interface.
2689 2007-08-10 Eric Blake <ebb9@byu.net>
2691 Documentation improvements.
2692 * doc/m4.texinfo (Defn): Resync with branch.
2693 (Compatibility, Extensions): Sync with branch.
2695 2007-08-07 Eric Blake <ebb9@byu.net>
2697 Adjust to gnulib xstrtol changes.
2698 * src/main.c (size_opt): Adjust signature, so that error strings
2699 are easier to translate.
2700 (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): New macros
2701 for tracking long options.
2702 (main): Track which long option was used.
2703 * tests/options.at (--debuglen, --nesting-limit): Adjust to change
2705 (deprecated options): Test that --arglength spelling shows up in
2708 2007-08-06 Eric Blake <ebb9@byu.net>
2710 Normalize all GPL license notices.
2711 * m4/COPYING.LIB: Delete - libm4 is not distributed under LGPLv2
2713 * Makefile.am: Update license wording.
2714 * bootstrap: Likewise.
2716 * configure.ac: Likewise.
2717 * ltdl/config/mailnotify: Likewise.
2718 * ltdl/config/mkstamp: Likewise.
2719 * ltdl/m4/debug.m4: Likewise.
2720 * ltdl/m4/gmp.m4: Likewise.
2721 * ltdl/m4/m4-error.m4: Likewise.
2722 * ltdl/m4/m4-getopt.m4: Likewise.
2723 * ltdl/m4/m4-gettext.m4: Likewise.
2724 * ltdl/m4/m4-obstack.m4: Likewise.
2725 * ltdl/m4/m4-regex.m4: Likewise.
2726 * ltdl/m4/stackovf.m4: Likewise.
2727 * m4/builtin.c: Likewise.
2728 * m4/debug.c: Likewise.
2729 * m4/hash.c: Likewise.
2730 * m4/hash.h: Likewise.
2731 * m4/input.c: Likewise.
2732 * m4/m4.c: Likewise.
2733 * m4/m4module.h: Likewise.
2734 * m4/m4private.h: Likewise.
2735 * m4/macro.c: Likewise.
2736 * m4/module.c: Likewise.
2737 * m4/output.c: Likewise.
2738 * m4/path.c: Likewise.
2739 * m4/resyntax.c: Likewise.
2740 * m4/symtab.c: Likewise.
2741 * m4/syntax.c: Likewise.
2742 * m4/system_.h: Likewise.
2743 * m4/utility.c: Likewise.
2744 * modules/evalparse.c: Likewise.
2745 * modules/format.c: Likewise.
2746 * modules/gnu.c: Likewise.
2747 * modules/import.c: Likewise.
2748 * modules/load.c: Likewise.
2749 * modules/m4.c: Likewise.
2750 * modules/m4.h: Likewise.
2751 * modules/modtest.c: Likewise.
2752 * modules/mpeval.c: Likewise.
2753 * modules/perl.c: Likewise.
2754 * modules/shadow.c: Likewise.
2755 * modules/stdlib.c: Likewise.
2756 * modules/time.c: Likewise.
2757 * modules/traditional.c: Likewise.
2758 * po/Makevars: Likewise.
2759 * src/freeze.c: Likewise.
2760 * src/m4.h: Likewise.
2761 * src/main.c: Likewise.
2762 * src/stackovf.c: Likewise.
2763 * tests/builtins.at: Likewise.
2764 * tests/freeze.at: Likewise.
2765 * tests/generate.awk: Likewise.
2766 * tests/m4.in: Likewise.
2767 * tests/macros.at: Likewise.
2768 * tests/modules.at: Likewise.
2769 * tests/options.at: Likewise.
2770 * tests/others.at: Likewise.
2771 * tests/stackovf.test: Likewise.
2772 * tests/testsuite.at: Likewise.
2774 2007-07-22 Eric Blake <ebb9@byu.net>
2776 Fix diversions on NetBSD, when fopen(name,"a+") seeks to end.
2777 * m4/output.c (m4_tmpopen): Explicitly seek to beginning.
2778 * tests/builtins.at (divert): Enhance test to cover this.
2780 Reported by Thomas Klausner.
2782 2007-07-20 Eric Blake <ebb9@byu.net>
2784 Fix 'make distcheck' issues.
2785 * bootstrap: Add more files that might be more up-to-date in
2787 * Makefile.am (EXTRA_DIST): No longer distribute removed diff.
2788 * config/m4/gnulib-cache.m4: Update to latest gnulib.
2790 2007-07-16 Eric Blake <ebb9@byu.net>
2792 * po/POTFILES.in: Track recent translation additions from gnulib
2795 2007-07-14 Eric Blake <ebb9@byu.net>
2797 Reflect upstream license .texi changes.
2798 * doc/m4.texinfo (Copying): Rename node...
2799 (GNU General Public License): ...to this.
2800 (GNU Free Documentation License): Adjust node location.
2801 * local/doc/gpl-3.0.texi.diff: Remove file.
2803 2007-07-10 Eric Blake <ebb9@byu.net>
2805 Upgrade to GPLv3, and document 1.4.10.
2806 * bootstrap: Adjust to GPLv3.
2807 (func_update): Port from branch.
2808 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
2809 --local-dir=local --import gpl-3.0'.
2810 * doc/m4.texinfo (History): Mention 1.4.11.
2811 (Copying This Package): New appendix.
2812 * NEWS: Document 1.4.10.
2813 * local/doc/gpl-3.0.texi.diff: New file.
2814 * Makefile.am: Update license.
2815 (doc_m4_TEXINFOS, EXTRA_DIST): Distribute additions.
2816 * commit: Update license.
2817 * configure.ac: Likewise.
2818 * ltdl/config/mailnotify: Likewise.
2819 * ltdl/config/mkstamp: Likewise.
2820 * ltdl/m4/debug.m4: Likewise.
2821 * ltdl/m4/gmp.m4: Likewise.
2822 * ltdl/m4/m4-error.m4: Likewise.
2823 * ltdl/m4/m4-getopt.m4: Likewise.
2824 * ltdl/m4/m4-gettext.m4: Likewise.
2825 * ltdl/m4/m4-obstack.m4: Likewise.
2826 * ltdl/m4/m4-regex.m4: Likewise.
2827 * ltdl/m4/stackovf.m4: Likewise.
2828 * m4/builtin.c: Likewise.
2829 * m4/debug.c: Likewise.
2830 * m4/hash.c: Likewise.
2831 * m4/hash.h: Likewise.
2832 * m4/input.c: Likewise.
2833 * m4/m4.c: Likewise.
2834 * m4/m4module.h: Likewise.
2835 * m4/m4private.h: Likewise.
2836 * m4/macro.c: Likewise.
2837 * m4/module.c: Likewise.
2838 * m4/output.c: Likewise.
2839 * m4/path.c: Likewise.
2840 * m4/resyntax.c: Likewise.
2841 * m4/symtab.c: Likewise.
2842 * m4/syntax.c: Likewise.
2843 * m4/system_.h: Likewise.
2844 * m4/utility.c: Likewise.
2845 * modules/evalparse.c: Likewise.
2846 * modules/format.c: Likewise.
2847 * modules/gnu.c: Likewise.
2848 * modules/import.c: Likewise.
2849 * modules/load.c: Likewise.
2850 * modules/m4.c: Likewise.
2851 * modules/m4.h: Likewise.
2852 * modules/modtest.c: Likewise.
2853 * modules/mpeval.c: Likewise.
2854 * modules/perl.c: Likewise.
2855 * modules/shadow.c: Likewise.
2856 * modules/stdlib.c: Likewise.
2857 * modules/time.c: Likewise.
2858 * modules/traditional.c: Likewise.
2859 * po/Makevars: Likewise.
2860 * src/freeze.c: Likewise.
2861 * src/m4.h: Likewise.
2862 * src/main.c: Likewise.
2863 * src/stackovf.c: Likewise.
2864 * tests/builtins.at: Likewise.
2865 * tests/freeze.at: Likewise.
2866 * tests/generate.awk: Likewise.
2867 * tests/m4.in: Likewise.
2868 * tests/macros.at: Likewise.
2869 * tests/modules.at: Likewise.
2870 * tests/options.at: Likewise.
2871 * tests/others.at: Likewise.
2872 * tests/stackovf.test: Likewise.
2873 * tests/testsuite.at: Likewise.
2875 2007-07-09 Eric Blake <ebb9@byu.net>
2877 * modules/format.c (format): Avoid undefined behavior with %c.
2879 2007-07-01 Gary V. Vaughan <gary@gnu.org>
2881 The translation project has moved.
2882 * bootstrap (func_get_translations): Use the new translation
2886 2007-06-26 Karl Berry <karl@freefriends.org> (tiny change)
2888 Match Free Software Directory categories.
2889 * doc/m4.texinfo (dircategory): Update.
2891 2007-05-31 Eric Blake <ebb9@byu.net>
2893 Add extension to divert builtin.
2894 * modules/m4.c (builtin_divert): Immediately divert second
2896 * m4/output.c (m4_output_text): Allow 0 length. Fixes regression
2898 (m4_shipout_text): Short-circuit on zero length.
2899 * tests/freeze.at (loading format 2): Expand test to catch
2900 regression. Also check out-of-range version.
2901 * tests/builtins.at (divert): Expand test to check corner cases
2903 * doc/m4.texinfo (Divert): Document the extension.
2905 Reported by Daniel Richard G.
2907 2007-05-30 Eric Blake <ebb9@byu.net>
2909 Port format improvements from branch.
2910 * doc/m4.texinfo (History): Mention upcoming 1.4.10 release.
2911 (Format): Enhance section.
2912 * modules/format.c (format): Accept %'hhd, and issue warnings on
2913 unrecognized specifiers.
2914 * modules/gnu.c (builtin_format): Adjust how format is called.
2916 2007-05-28 Eric Blake <ebb9@byu.net>
2918 * tests/options.at (--syncoutput): Add xfailed test.
2920 Fix sync line interaction with multiline comments.
2921 * doc/m4.texinfo (Preprocessor features): Improve documentation.
2922 (Syncoutput): Improve testsuite.
2923 (Incompatibilities): Add testcase, and document bug.
2924 * src/freeze.c (reload_frozen_state): Don't interfere with
2925 synclines when reloading state.
2926 * m4/input.c (m4__next_token): Report line where multiline tokens
2928 * m4/m4private.h (m4__token_type): Add parameter.
2929 * m4/m4module.h (m4_output_text): Export.
2930 (m4_shipout_text): Add parameter.
2931 * src/macro.c (m4_macro_expand_input, expand_token)
2932 (expand_argument): Adjust callers so that line is passed from
2934 * m4/output.c (output_text): Rename...
2935 (m4_output_text): ...to this, and export.
2936 (m4_insert_file, insert_diversion_helper): Update callers.
2937 (m4_shipout_text): Take new parameter for start line of token.
2938 Output at most one syncline per token.
2939 Reported by Sergey Poznyakoff.
2941 Fix large diversion corner cases.
2942 * tests/freeze.at (large diversion): New test.
2943 * m4/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
2944 (make_room_for): Use NULL, not 0, for pointers.
2945 (m4_freeze_diversions): Allow freezing large diversions.
2946 (insert_diversion_helper): Avoid using rewind.
2948 Also run gnulib unit tests during make check.
2949 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
2950 --tests-base=tests/gnu --with-tests'.
2951 * configure.ac (AC_CONFIG_FILES): Build tests/gnu testdir.
2952 * Makefile.am (SUBDIRS): Run gnulib tests before ours.
2954 2007-05-25 Eric Blake <ebb9@byu.net>
2956 * m4/system_.h: Include <stdint.h>, for intmax_t.
2958 Reported by Daniel Richard G.
2960 2007-05-24 Eric Blake <ebb9@byu.net>
2962 Provide consistent shift semantics regardless of hardware.
2963 * modules/m4.c (numb_lshift, numb_rshift, numb_urshift): Mask
2965 (number, unumber): Always use [u]intmax_t.
2966 Reported by Gary V. Vaughan.
2968 Support POSIX flush semantics on all platforms.
2969 * modules/m4.c (m4_sysval_flush): Rely on gnulib.
2970 * ltdl/m4/gnulib-cache.m4: Fix typo in previous commit.
2972 Work around cygwin and mingw fseeko bugs.
2973 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2975 * modules/m4.c (m4_sysval_flush): Prefer fseeko over fseek.
2977 2007-04-25 Eric Blake <ebb9@byu.net>
2979 Test that regression in 1.4.9's eval doesn't recur.
2980 * doc/m4.texinfo (Eval): Check negative division.
2983 2007-04-12 Eric Blake <ebb9@byu.net>
2985 Allow for running test in sticky or setgid directory.
2986 * tests/builtins.at (mkdtemp): Adjust test.
2988 Don't test for broken sed too soon.
2989 * tests/others.at (stdin seekable): Rearrange subtests.
2991 Work around 'stdin seekable' shortcoming on glibc.
2992 * ltdl/m4/gnulib-cache.m4: Use closein instead of closeout.
2993 * tests/others.at (stdin closed): Adjust to new output.
2994 * src/main.c (process_file): No need to return anything.
2995 (main): Use close_stdin instead of close_stdout.
2996 Reported by Ralf Wildenhues.
2998 Enable autobuild usage.
2999 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3001 * configure.ac (AB_INIT): Output autobuild information.
3003 2007-04-11 Eric Blake <ebb9@byu.net>
3005 Address testsuite shortcoming in 'stdout full' on glibc.
3006 * tests/others.at (stdout full): Adjust expected output when more
3007 than 1k text is printed to /dev/full.
3008 Reported by Ralf Wildenhues.
3010 2007-04-10 Eric Blake <ebb9@byu.net>
3012 * tests/macros.at (Arity and defn): Fix quoting.
3014 2007-04-09 Eric Blake <ebb9@byu.net>
3016 Address failure of 'seekable stdin' on Mac OS X.
3017 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3020 2007-04-07 Eric Blake <ebb9@byu.net>
3022 Include <config.h> first in all C files, and not in headers.
3023 Fixes regression for --disable-assert builds from 2007-04-02.
3024 * src/m4.h (includes): Don't include config.h here.
3025 * m4/m4private.h (includes): Likewise.
3026 * m4/builtin.c: Include config.h before anything else.
3027 * m4/debug.c: Likewise.
3028 * m4/hash.c: Likewise.
3029 * m4/input.c: Likewise.
3030 * m4/m4.c: Likewise.
3031 * m4/macro.c: Likewise.
3032 * m4/module.c: Likewise.
3033 * m4/symtab.c: Likewise.
3034 * m4/syntax.c: Likewise.
3035 * m4/utility.c: Likewise.
3036 * src/freeze.c: Likewise.
3037 * src/stackovf.c: Likewise.
3039 2007-04-03 Eric Blake <ebb9@byu.net>
3041 * modules/m4.c (numb_ratio, numb_divide, numb_modulo): Avoid
3042 SIGFPE on x86 architectures.
3043 Reported by Ralf Wildenhues.
3045 2007-04-02 Eric Blake <ebb9@byu.net>
3047 Fix warnings from last commit.
3048 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3049 fprintf-posix sprintf-posix'.
3050 * m4/macro.c (expand_macro, trace_format): Use correct specifier
3052 (process_macro): Avoid negative array index.
3053 * src/freeze.c (produce_resyntax_dump, produce_module_dump)
3054 (dump_symbol_CB, produce_frozen_state): Use correct specifier for
3057 2007-04-02 Gary V. Vaughan <gary@gnu.org>
3059 Get rid of the last 'differs in signedness' compiler warnings:
3061 * m4/macro.c (process_macro): m4_get_symbol_value_text() returns
3062 a regular 'char *', so variables to store the return address,
3063 and iterate through it should be regular 'char *' too.
3064 * m4/input.c (m4_input_block): The start and current members of
3065 the string part of this union store regular 'char *' types, so
3066 they should be regular 'char *' types too.
3068 2007-04-02 Gary V. Vaughan <gary@gnu.org>
3070 M4 was designed to have a small number of header files defining
3071 the interfaces to several source files each. Keeping this in
3072 mind allows us to tidy things up considerably. Having done this,
3073 it becomes clear that some of the installed headers reference
3074 other headers which are not installed (but that's another patch):
3076 * m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from
3078 * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
3079 ...to here, so client modules can benefit too.
3080 (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
3081 lowest level to save doing it multiple times elsewhere.
3082 * m4/debug.c (stdio.h): Removed. The portable <gnu/stdio--.h>
3083 is already included via m4private.h.
3084 * modules/time.c (stdio.h): Ditto.
3085 * modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>.
3086 * modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h>
3087 and <gnu/unistd--.h>,
3088 * m4/m4private.h (m4module.h): Use angle brackets for an installed
3090 * m4/hash.h (system.h): Ditto.
3091 * modules/gnu.c (progname.h): Removed.
3092 * src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h.
3093 * m4/m4private.h (assert.h, errno.h): Already included via
3095 * m4/input.c (ctype.h): Ditto.
3096 * m4/module.c (ltdl.h): Ditto.
3097 * m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h)
3099 * m4/path.c (config.h, stdlib.h): Ditto.
3100 * m4/utility.c (config.h): Ditto.
3101 * modules/evalparse.c (assert.h, ctype.h): Ditto.
3102 * modules/gnu.c (assert.h, ctype.h, errno.h): Ditto.
3103 * modules/import.c (assert.h): Ditto.
3104 * modules/m4.c (assert.h, errno.h): Ditto.
3105 * modules/modtest.c (assert.h): Ditto.
3106 * modules/stdlib.c (sys/types.h): DittAo.
3107 * src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h):
3109 * src/stackovf.c (assert.h): Ditto.
3110 * modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster
3111 private interfaces when NDEBUG is defined.
3112 * modules/import.c (m4/m4module.h, m4private.h): Ditto.
3113 * modules/load.c (m4/m4module.h, m4private.h): Ditto.
3114 * modules/m4.c (m4/m4module.h, m4private.h): Ditto.
3115 * modules/modtest.c (m4/m4module.h, m4private.h): Ditto.
3116 * modules/mpeval.c (m4/m4module.h, m4private.h): Ditto.
3117 * modules/perl.c (m4/m4module.h, m4private.h): Ditto.
3118 * modules/shadow.c (m4/m4module.h, m4private.h): Ditto.
3119 * modules/time.c (m4/m4module.h, m4private.h): Ditto.
3120 * modules/traditional.c (m4/m4module.h, m4private.h): Ditto.
3121 * src/m4.h (locale.h): Moved from here...
3122 * src/main.h: ...to here.
3123 (m4private.h): Already included via m4.h.
3124 * src/stackovf.c (m4private.h): Ditto.
3126 2007-03-28 Gary V. Vaughan <gary@gnu.org>
3128 * Makefile.am (stamp-vcl): Removed.
3129 (CONFIG_STATUS_DEPENDENCIES): Depend directly on ChangeLog.
3131 2007-03-28 Eric Blake <ebb9@byu.net>
3133 * src/main.c (usage): Improve note to TRANSLATORS.
3134 * m4/system_.h (EXIT_FAILURE): Reflect gnulib changes.
3136 * tests/builtins.at (__m4_version__): Fix bug when TIMESTAMP is
3139 2007-03-24 Eric Blake <ebb9@byu.net>
3141 * m4/output.c (m4_output_init): Update to latest gnulib.
3142 * bootstrap (ltdl/m4/.cvsignore): No longer track generated
3144 * NEWS: Reflect release of 1.4.9.
3147 2007-03-07 Eric Blake <ebb9@byu.net>
3151 Exercise gnulib's new POSIX *printf modules.
3152 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3154 * modules/format.c (format): Support %a and %A.
3155 * doc/m4.texinfo (Format): Test this addition.
3156 * NEWS: Document this addition.
3158 2007-03-03 Eric Blake <ebb9@byu.net>
3160 * m4/input.c (m4__next_token): Fix synclines when in batch mode.
3161 * doc/m4.texinfo (M4exit): Synch another section.
3162 (Syncoutput): Make similar to other sections.
3164 2007-03-01 Eric Blake <ebb9@byu.net>
3166 * doc/m4.texinfo: Improve the indices.
3167 (Concept index): Rearrange to be last.
3168 (Sysval): Merge from branch.
3170 * doc/m4.texinfo (Syscmd, Esyscmd): Merge more doc sections.
3172 2007-02-28 Eric Blake <ebb9@byu.net>
3174 POSIX XCU ERN 137 was approved.
3175 * modules/mpeval.c (numb_extension): Delete.
3176 * modules/m4.c (numb_extension): Likewise.
3177 * modules/evalparse.c (comma_term, condition_term): Always
3178 implement ?: and , operators.
3179 * m4/symtab.c: Update comment to match reality.
3180 * src/freeze.c (produce_frozen_state, reload_frozen_state): Avoid
3181 dereferencing context directly when accessor exists.
3182 * src/main.c (usage): Prefer GNU_M4 over EMACS.
3183 (struct macro_definition): Rename...
3184 (struct deferred): ...to match usage. All uses changed.
3185 * doc/m4.texinfo (Eval): Document this change.
3186 (Operation modes, Changeresyntax): Fix wording to prefer GNU_M4
3188 (Preprocessor features, Changesyntax): Fix inaccuracies.
3189 * NEWS: Import branch NEWS items for 1.4.x series. Document
3192 POSIX XCU ERN 118 was approved.
3193 * modules/m4.c (define): Kill posixly_correct distinction in
3194 define behavior, since POSIX says GNU behavior complies.
3195 * tests/builtins.at (define): Restore original semantics.
3196 * doc/m4.texinfo (Pushdef): Document portability issues with
3198 (Incompatibilities): Clean up wording of what POSIX requires.
3199 * NEWS: Document this.
3201 2007-02-26 Eric Blake <ebb9@byu.net>
3203 Re-enable clean bootstrap on cygwin.
3204 * Makefile.am (AM_LDFLAGS): For now, export all symbols from
3205 modules, since otherwise we run afoul of current libtool
3206 limitations on cygwin and mingw.
3208 2007-02-25 M. Levinson <levinsm@users.sourceforge.net> (tiny change)
3210 * src/freeze.c (reload_frozen_state): Avoid dereferencing freed
3211 memory. Fixes regression introduced 2007-01-20.
3213 2007-02-25 Eric Blake <ebb9@byu.net>
3215 * tests/freeze.at (loading format 2): Augment test to catch
3216 regression introduced on 2007-01-20.
3218 Reported by M. Levinson.
3220 * m4/system_.h (includes, EXIT_SUCCESS, EXIT_FAILURE): Adjust to
3223 2007-02-05 Eric Blake <ebb9@byu.net>
3225 * tests/options.at (--fatal-warnings): New test.
3226 * tests/others.at (stdin seekable): Exit on error.
3227 * m4/m4private.h (M4_OPT_WARN_EXIT_BIT): New bit.
3228 (m4_get_warnings_exit_opt): Access it.
3229 * m4/m4module.h (m4_context_opt_bit_table): Access it.
3230 * m4/utility.c (m4_error, m4_error_at_line): Only force an exit
3232 (m4_warn, m4_warn_at_line): Change exit status on -E, and force
3234 * src/m4.c (usage): Document new -E behavior.
3235 (main): Make -E an additive option.
3236 * doc/m4.texinfo (Operation modes): Document the change.
3237 Reported by Ralf Wildenhues.
3239 * tests/others.at (stdin seekable): Fix bug in test.
3240 * ltdl/m4/gnulib-cache.m4: Gnulib module strstr no longer exists.
3242 * m4/input.c (struct m4_input_block): Remove unused field traced.
3244 2007-02-03 Eric Blake <ebb9@byu.net>
3245 and Bruno Haible <bruno@clisp.org> (tiny change)
3247 * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
3249 Reported by Bruno Haible.
3251 2007-01-31 Eric Blake <ebb9@byu.net>
3253 * m4/resyntax.c (m4_regexp_syntax_encode): Detect allocation
3256 2007-01-26 Eric Blake <ebb9@byu.net>
3258 * m4/symtab.c (includes): Adjust to latest gnulib.
3259 * modules/m4.c (includes): Likewise.
3261 2007-01-23 Eric Blake <ebb9@byu.net>
3263 * m4/m4module.h (M4_SYNTAX_ASSIGN): Delete this unused
3264 extension to make enough room.
3265 (M4_SYNTAX_IGNORE): Change value to zero, since the (commented)
3266 code in input.c special cases this category.
3267 (M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): New values in preparation
3268 for define(eleventh,${11}) extension.
3269 * m4/syntax.c: Update comments accordingly.
3270 (m4_syntax_create, m4_syntax_code): Handle { and }.
3271 * m4/input.c (m4__next_token): Likewise.
3272 * src/freeze.c (produce_frozen_state): Support new categories.
3273 (reload_frozen_state): When loading version 1, disable syntax
3274 features not present in 1.4.x.
3275 * tests/freeze.at: Sort and rename existing tests.
3276 (loading format 1): Ensure we don't break v1 frozen files that
3278 (loading format 2, reloading changecom, reloading changesyntax):
3280 * doc/m4.texinfo (Changesyntax, Frozen file format 1): Document
3281 the new syntax categories.
3282 (Arguments): Update the FIXME comment.
3283 (M4wrap): Merge examples from branch, before worrying about fixing
3284 m4wrap to obey POSIX.
3285 (Using frozen files): Start merging from branch.
3288 2007-01-20 Eric Blake <ebb9@byu.net>
3290 * src/freeze.c (produce_char_dump): Delete. Replace with...
3291 (produce_mem_dump): ...this new function, to encode more strings.
3292 Also make the coding easier to read and slightly more compact.
3293 (produce_syntax_dump): Only dump non-default syntax codes.
3294 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
3295 Encode non-ASCII characters in user-supplied strings.
3296 (GET_STRING): Accept escape sequences in version 2.
3297 * NEWS: Document this change.
3300 2007-01-16 Eric Blake <ebb9@byu.net>
3302 Port patch from branch for stack overflow detection on BSD/OS.
3303 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Check for stack_t.ss_sp.
3304 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
3305 ! HAVE_STACK_T_SS_SP]: Use this check.
3306 Reported by Chris McGuire.
3308 2007-01-15 Eric Blake <ebb9@byu.net>
3310 * tests/builtins.at (__m4_version__): New test.
3311 * modules/traditional.c (m4_macro_table): Provide windows and os2
3312 macros, as appropriate. Add __traditional__ macro.
3313 * modules/mpeval.c (m4_macro_table): Name the macro __mpeval__,
3314 not __gmp__, to match module name.
3315 * modules/load.c (m4_macro_table): Name the macro __load__, not
3316 __modules__, to match module name.
3317 * doc/m4.texinfo (History, Shell commands, Platform macros): Merge
3319 (Standard Modules): Improve wording.
3320 (Incompatibilities): Move platform macros into their own node.
3321 (Load, Unload): Use actual examples.
3322 * NEWS: Document this change.
3325 2007-01-13 Eric Blake <ebb9@byu.net>
3327 * doc/m4.texinfo (Mpeval): Add tests.
3328 * tests/testsuite.at (AT_CHECK_GMP): New filter, factored from...
3329 * tests/builtins.at (gmp): ...here. Rename test to...
3331 * tests/generate.awk (new_test): Filter out mpeval tests when gmp
3333 * m4/m4module.h (m4_get_no_gnu_extensions_opt): Merge
3334 no_gnu_extensions with posixly_correct_opt, since they were set in
3336 * m4/m4private.h (struct m4): Remove no_gnu_extensions.
3337 * src/main.c (main): Update caller.
3338 * src/freeze.c (reload_frozen_state): Likewise.
3339 * modules/m4.c (m4wrap): Likewise.
3341 2007-01-12 Eric Blake <ebb9@byu.net>
3343 * m4/syntax.c (m4_set_comment): XCU ERN 131 was approved by
3344 POSIX, so update the comment.
3345 * doc/m4.texinfo (Inhibiting Invocation): XCU ERN 130 was
3346 approved by POSIX, so we can always have blind macros, even when
3348 (Ifelse): Mention the term `blind builtin'.
3350 2007-01-08 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3352 * doc/m4.texinfo: Fix a couple of typos.
3354 2007-01-08 Eric Blake <ebb9@byu.net>
3356 * ltdl/m4/gnulib-cache.m4: Update for new year.
3357 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Cover all error cases.
3358 Reported by Ralf Wildenhues.
3360 2007-01-06 Eric Blake <ebb9@byu.net>
3362 * m4/m4private.h (to_uchar): Move...
3363 * m4/m4module.h: here, so modules can use it.
3364 * src/main.c (usage, long_options): Support --posix as a synonym
3366 * modules/m4.c (numb_invert): Detect unsupported x**-y.
3367 (numb_incr, numb_urshift, numb_extension): New macros.
3368 (numb_obstack): Port patch from branch to support radix 1 output.
3369 * modules/mpeval.c (numb_obstack): Use \ for ratios.
3370 (numb_incr, numb_urshift, numb_extension): New macros.
3371 (mpq2mpz): Warn rather than error.
3372 * modules/evalparse.c (URSHIFT, NEGATIVE_EXPONENT): New
3374 (eval_error): Rearrange, so that all ignorable errors are less
3376 (eval_text, last_text): Obey C++ type safety rules.
3377 (numb_pow): Change return type.
3378 (exp_term): Adjust caller.
3379 (m4_evaluate): Fail on bad exponent.
3380 (logical_or_term, logical_and_term): Ignore failed ** in short
3382 (eval_lex): Fix typos when detecting <<= and >>=. Use \ instead
3383 of : for ratio. Support >>>, ,, and ?:. Port patch from branch
3384 to parse radix 1 numbers.
3385 (condition_term, comma_term): New parse functions.
3386 (shift_term): Support >>>.
3387 (m4_evaluate): Port patch from branch to output radix 1 numbers.
3388 Warn instead of error for most parse problems.
3389 * doc/m4.texinfo (Limits control, Eval): Document these changes.
3390 * NEWS: Document new operators and new command line option.
3392 2007-01-04 Eric Blake <ebb9@byu.net>
3394 * configure.ac (AC_SYS_LARGEFILE): Guarantee large file support.
3396 2007-01-03 Eric Blake <ebb9@byu.net>
3398 * doc/m4.texinfo (Format, Incr): More merges.
3399 (Eval): Ensure C precedence rules are met.
3400 * modules/evalparse.c (BADOP, INVALID_OPERATOR): New enumerators.
3401 (not_term, logical_not_term): Delete; these are same precedence
3402 as other unary operators.
3403 (equality_term): New; these are lower precedence than relational
3405 (eval_lex, simple_term, m4_evaluate): Recognize forbidden C
3406 operators for better error messages.
3407 (logical_or_term, logical_and_term): Short-circuit out the error
3408 of division by zero.
3409 (unary_term): Allow consecutive unary operators.
3410 * modules/m4.c (int2numb, numb2int): Delete; these potentially
3412 (numb_not, numb_eor, numb_ior, numb_and): Update callers.
3413 * modules/mpeval.c (reduce1, reduce2): Protect macros better.
3414 * NEWS: Document this change.
3416 2006-12-27 Eric Blake <ebb9@byu.net>
3418 * doc/m4.texinfo (Substr, Patsubst): Merge more sections from the
3420 * modules/m4.c (substr): Merge from branch.
3422 2006-12-26 Eric Blake <ebb9@byu.net>
3424 * doc/m4.texinfo (Changesyntax): Check for regressions with
3425 changesyntax(W=...).
3427 2006-12-22 Eric Blake <ebb9@byu.net>
3429 * m4/m4module.h (m4_set_syntax): Change signature.
3430 * modules/gnu.c (m4_resyntax_encode_safe): Reduce error to
3432 (changesyntax): Likewise, and update caller.
3433 * m4/m4private.h (m4_syntax_table): Add orig member.
3434 * m4/syntax.c (m4_set_quotes, m4_set_comment): Merge from branch.
3435 Don't set is_single_quotes and is_single_comments when the begin
3436 character is shadowed by another syntax type.
3437 (m4_syntax_create): Populate default syntax table.
3438 (add_syntax_attribute): Don't lose quote assignment.
3439 (remove_syntax_attribute): Only allow removing rquote or ecomm.
3440 (add_syntax_set, subtract_syntax_set, set_syntax_set)
3441 (reset_syntax_set): New helper routines.
3442 (m4_set_syntax): Alter semantics - NUL key reverts entire syntax
3443 to default, and empty chars reverts that key to default.
3444 (check_is_single_quotes, check_is_single_comments): New helper
3446 * modules/m4.c (changecom): Merge from branch.
3447 * m4/input.c (m4__next_token): Rearrange token recognition order
3448 to macro, quote, comment, in order to match traditional
3450 * src/freeze.c (reload_frozen_state): Update caller.
3451 * doc/m4.texinfo (Changequote, Changecom): Merge from branch, with
3453 (Changeresyntax): Revise to match style of surrounding sections
3454 and add more examples.
3455 (Changesyntax): Likewise, and update to new semantics.
3456 * NEWS: Document this change.
3458 * doc/m4.texinfo (Operation modes): Avoid underfull hbox.
3459 (M4wrap, Eval, Errprint): Fix typos.
3460 (Divnum): Not necessary to redivert in example.
3462 2006-12-21 Eric Blake <ebb9@byu.net>
3464 * doc/m4.texinfo (Len, Index macro, Regexp): More section merging
3467 2006-12-19 Eric Blake <ebb9@byu.net>
3469 * modules/m4.h (m4_sysval_flush_func): Adjust prototype.
3470 * modules/m4.c (m4_sysval_flush): Add parameter, so that m4exit
3471 can track write errors without all other callers warning multiple
3473 (sysval_flush_helper): New function.
3474 (dumpdef, syscmd, errprint, m4exit): Adjust callers.
3475 * modules/gnu.c (esyscmd): Likewise.
3476 * tests/others.at (stdout closed, stdout full): Error message
3479 2006-12-16 Eric Blake <ebb9@byu.net>
3481 * src/main.c: Fix missing include.
3483 * src/main.c (main): Check for errors when closing stdin.
3484 * modules/m4.c (m4exit): Missed part of previous patch: flush
3485 stdin before a successful exit.
3486 Reported by Ralf Wildenhues.
3488 2006-12-14 Eric Blake <ebb9@byu.net>
3490 * modules/m4.c (m4_sysval_flush): Flush stdin before exiting, as
3492 * tests/others.at (stdin seekable): New test.
3494 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3496 * doc/m4.texinfo: Fix some typos.
3498 2006-12-04 Eric Blake <ebb9@byu.net>
3500 * doc/m4.texinfo (Undivert, Divnum, Cleardivert): Merge more doc
3502 (Modules): Make style consistent.
3504 2006-11-16 Eric Blake <ebb9@byu.net>
3506 * bootstrap: Relax m4 requirement, thanks to...
3507 * configure.ac (Gettext support): ...this workaround to the 1.4.4
3508 bug. Undoes restriction added on 2006-11-09.
3510 * tests/builtins.at (esyscmd, syscmd): Redo, since spilled
3511 diversions are now closed when not active.
3512 (divert): Remove check now in the manual.
3513 * tests/others.at (stderr closed): Likewise.
3514 (stdout closed): Add a check.
3515 * doc/m4.texinfo (Include, Search Path, Diversions, Divert): Sync
3516 more docs with branch.
3518 2006-11-14 Eric Blake <ebb9@byu.net>
3520 Remerge sparse diversion handling from branch.
3521 * ltdl/m4/gnulib-cache.m4: Replace avltree-list with
3523 * m4/output.c (diversion_table): Change type to gl_oset_t.
3524 (m4_output_init, m4_output_exit, cleanup_tmpfile, make_room_for)
3525 (m4_make_diversion, insert_diversion_helper, m4_insert_diversion)
3526 (m4_undivert_all, m4_freeze_diversions): Adjust all callers.
3527 (div0, diversion_storage): New variables.
3528 (diversions, equal_diversion_CB): Deleted.
3529 (threshold_diversion_CB): New callback.
3530 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
3532 (m4_tmpfile): Move cloexec action here.
3534 * m4/resyntax.c (m4_regexp_syntax_encode): Avoid bug with signed
3537 2006-11-13 Eric Blake <ebb9@byu.net>
3539 Add several new command line options.
3540 * src/main.c (usage): Update.
3541 (OPTSTRING, long_options): Add --pushdef, --popdef, --gnu,
3542 --traceon, --traceoff, --syncoutput, --warnings, --unload-module.
3543 Make --regexp-syntax argument optional.
3544 (main): Support new options. Fix regression in interactive
3545 behavior from Nov 8.
3546 * m4/m4private.h (M4_OPT_SYNCOUTPUT_BIT): Rename from
3547 M4_OPT_SYNC_OUTPUT_BIT.
3548 * m4/m4module.h (m4_context_opt_bit_table): Rename sync_output to
3549 syncoutput, to match option.
3550 (m4_parse_truth_arg): New prototype.
3551 * m4/utility.c (m4_parse_truth_arg): Implement it.
3552 * m4/output.c (m4_shipout_text): Adjust sync_output caller.
3553 * modules/gnu.c (syncoutput): Adjust sync_output caller, and use
3555 * doc/m4.texinfo (Operation modes, Dynamic loading features)
3556 (Preprocessor features, Limits control, Debugging options)
3557 (Command line files): Update documentation.
3558 * tests/builtins.at (mkstemp): Simplify.
3559 * tests/macros.at (Command line pushdef): New test.
3560 (Command line define): Improve.
3561 * tests/options.at (--traceon and --traceoff, --syncoutput): New
3563 (POSIXLY_CORRECT): Likewise.
3564 (deprecated options): Augment.
3565 (--regexp-syntax): Update, now that -r takes optional arg.
3566 * NEWS: Reformat. Document new options.
3568 2006-11-11 Eric Blake <ebb9@byu.net>
3570 One step closer to allowing C++ compilation - don't blindly
3571 convert between char* and unsigned char*.
3572 * m4/m4module.h (m4_set_syntax): Change signature.
3573 * m4/m4private.h (m4_string): Use signed char.
3574 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
3575 (m4_get_syntax_ecomm): No longer a need to cast.
3576 * m4/syntax.c (m4_set_syntax, m4_syntax_create, m4_set_quotes):
3577 Reflect this change.
3578 * m4/macro.c (expand_argument): Simplify.
3579 (expand_token): Use proper type.
3580 * src/freeze.c (reload_frozen_state): Likewise.
3581 * m4/input.c (MATCH, match_input): Likewise.
3582 * modules/m4.c (translit): Likewise.
3583 * modules/gnu.c (substitute): Simplify.
3585 * m4/macro.c (trace_format): Use canonical type name.
3586 * m4/output.c (m4_freeze_diversions): Likewise.
3587 * src/freeze.c (produce_module_dump, dump_symbol_CB)
3588 (produce_frozen_state): Likewise.
3589 * m4/m4private.h (to_uchar): Grab from branch.
3590 * m4/input.c (string_peek, string_read): Use it.
3591 * m4/utility.c (skip_space): Likewise.
3592 * src/main.c (main): Likewise.
3593 * doc/m4.texinfo (Translit): Remerge from branch.
3594 * tests/builtins.at (translit): Test 8-bit range.
3595 * modules/m4.c (m4_expand_ranges): Merge from branch.
3597 2006-11-09 Eric Blake <ebb9@byu.net>
3599 * bootstrap: Validate that installed M4 is powerful enough.
3600 Reported by Gary V. Vaughan, analyzed by Stepan Kasal.
3602 2006-11-08 Eric Blake <ebb9@byu.net>
3604 Merge deferred handling of -D option from branch.
3605 * doc/m4.texinfo (Debugging options, Preprocessor features)
3606 (Dynamic loading features, Operation modes, Invoking m4):
3607 Document this change.
3608 * src/main.c (OPTSTRING): Specify in-order processing.
3609 (process_file): New function.
3610 (main): Use it to interleave files and deferred options.
3611 * tests/macros.at (Command line define): New test.
3612 * tests/generate.awk: Allow '@comment file' as first example
3614 * tests/options.at (option grouping): Update to reflect actual
3616 (file names): New test.
3618 2006-11-07 Eric Blake <ebb9@byu.net>
3620 * m4/output.c (cleanup_tmpfile, m4_insert_diversion_helper): Check
3623 * tests/builtins.at (m4exit): New test; failed on cygwin before
3625 * m4/output.c (cleanup_tmpfile): Close files before removing
3627 (make_room_for, m4_output_exit): Ensure that atexit handler
3628 invoked from m4_error sees consistent state.
3630 * doc/m4.texinfo (Errprint): Merge another doc node.
3631 * tests/builtins.at (dumpdef, errprint): New tests.
3632 * modules/m4.c (errprint): Merge from branch: flush before
3635 2006-11-02 Eric Blake <ebb9@byu.net>
3637 * bootstrap: Update bootstrap requirement wording.
3638 Reported by Bruno Haible.
3640 2006-10-31 Eric Blake <ebb9@byu.net>
3642 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3644 * doc/m4.texinfo (Translit): Merge from branch.
3645 * modules/m4.c (divert, substr): Ignore excess arguments.
3646 (index, translit): Merge from branch.
3647 * tests/builtins.at (translit): Add a test.
3649 2006-10-30 Eric Blake <ebb9@byu.net>
3651 * m4/m4private.h (m4_get_symbol_value_module): Delete accidental
3653 * m4/symtab.c (m4_get_symbol_value_module): Likewise.
3655 * modules/m4.c (m4_make_temp): Make safe across libtool.
3656 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Avoid warnings.
3657 * configure.ac (--with-modules): Accomodate changed module
3658 location when doing './configure --enable-debug'.
3660 2006-10-28 Eric Blake <ebb9@byu.net>
3662 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3665 2006-10-27 Eric Blake <ebb9@byu.net>
3667 * bootstrap (gnulib): No longer a need to patch after gnulib-tool
3669 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
3670 0.16, since 0.15 is incompatible with our automake requirement.
3672 * m4/macro.c (expand_argument): Fix missing initialization.
3673 * m4/m4private.h (struct m4_symbol_value): Store entire
3674 m4_builtin, not just the func.
3675 (m4_get_symbol_value_func): Update.
3676 (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
3678 * m4/m4module.h (m4_get_symbol_value_builtin)
3679 (m4_get_symbol_builtin): New prototypes.
3680 (m4_set_symbol_value_func): Delete, replace with...
3681 (m4_set_symbol_value_builtin): New function.
3682 (m4_builtin_find_by_name): Change signature.
3683 * m4/symtab.c (m4_symbol_value_print): Simplify.
3684 (m4_get_symbol_value_func): Update.
3685 (m4_get_symbol_value_builtin): New function.
3686 (m4_set_symbol_value_func): Delete, replace with...
3687 (m4_set_symbol_value_builtin): New function.
3688 (dump_symbol_CB) [DEBUG_SYM]: Simplify.
3689 * m4/builtin.c (m4_builtin_find_by_name): Change signature.
3690 * m4/input.c (struct m4_input_block): Remove unused trace member.
3691 (m4_push_builtin, builtin_print, init_builtin_token): Update
3693 * m4/module.c (install_builtin_table): Likewise.
3694 * src/freeze.c (reload_frozen_state): Likewise.
3695 * modules/gnu.c (builtin): Make it possible to retrieve a builtin
3696 token, even after the builtin has been undefined.
3697 * doc/m4.texinfo (Builtin): Document new capability.
3700 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3702 * modules/m4.c (m4_make_temp): Use it.
3703 * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
3705 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3707 * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
3710 2006-10-26 Eric Blake <ebb9@byu.net>
3712 Silence -O2 -Wall -Wwrite-strings warnings.
3713 * m4/m4private.h (m4_symbol_value): Const-ify text.
3714 * m4/m4module.h (m4_get_symbol_value_text)
3715 (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
3716 (m4_set_symbol_value_placeholder): Likewise.
3717 * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
3719 * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
3720 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
3721 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
3723 * modules/format.c (format): Likewise.
3724 * src/main.c (main): Likewise.
3725 * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
3726 * modules/shadow.c (shadow, test): Likewise.
3727 * m4/output.c (m4_make_diversion): Don't hold on to empty
3729 (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
3730 (m4_freeze_diversions): Likewise. Don't use uninitialized
3733 Convert diversions to list instead of sparse array, part 2.
3734 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3736 * m4/output.c (m4_diversion): Add next pointer and divnum members.
3737 (diversion_table): Convert to a list instead of a sparse array.
3738 (free_list): Maintain free list of reclaimed diversions.
3739 (equal_diversion_CB, cmp_diversion_CB): New functions.
3740 (m4_output_init): Set up list.
3741 (m4_output_exit): Tear down list.
3742 (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
3744 (m4_make_diversion): Change creation of new diversions.
3745 (m4_insert_diversion_helper): New function, to avoid list
3747 * tests/builtins.at (divert): The test now passes.
3748 * NEWS: Document this improvement.
3750 Convert diversions to list instead of sparse array, part 1.
3751 * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
3753 * m4/output.c (diversion, total_buffer_size, output_unused):
3754 Track size in size_t. All users changed.
3755 (struct diversion): Reduce size now, to compensate for part 2.
3756 (m4_make_diversion, make_room_for): Avoid malloc overflow.
3757 (m4_output_exit): Fix typo in assert.
3758 (m4_output_init, make_room_for, m4_make_diversion)
3759 (m4_insert_diversion, m4_freeze_diversions): Adjust users of
3760 struct m4_diversion to disambiguate the new union.
3761 * tests/builtins.at (divert): Detect this failure.
3763 2006-10-25 Eric Blake <ebb9@byu.net>
3765 * m4/m4module.h (m4_push_builtin): Add parameter.
3766 * modules/m4.c (defn): Update caller.
3767 * m4/input.c (file_read_init, string_read_init): No longer
3769 (input_funcs): Change signature of read_func, all callers
3771 (composite_peek, composite_read, composite_unget),
3772 (composite_print, composite_funcs): New input type. Not yet
3773 fully utilized, but one step closer to fixing defn.
3774 (m4_input_block): Make every input block track current file and
3775 line. Rename some members. Remove unused out_line. Add support
3776 for composite input block.
3777 (input_change): New flag.
3778 (file_peek, file_read, file_clean, file_unget, file_print):
3780 (m4_push_file, m4_push_builtin, m4_push_string_init)
3781 (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
3782 (m4_skip_line, pop_input): Track input block changes.
3783 (m4_pop_wrapup): Avoid overflow.
3784 (init_builtin_token): Handle composite input.
3785 (next_char): Handle input block changes.
3786 * doc/m4.texinfo (Location): Remerge from branch.
3788 * src/m4.h (includes): Need <locale.h> after all; fixes
3789 regression from yesterday.
3791 * m4/system_.h (obstack_regrow): New macro. Hopefully glibc will
3793 * m4/macro.c (expand_macro): Avoid referencing invalid memory.
3794 Handle nesting the argc obstack.
3795 (expand_token): Avoid unnecessary malloc.
3796 (collect_arguments): Copy name before invalidating it.
3797 (argc_stack, argv_stack): New variables.
3798 (m4_macro_expand_input): Initialize argc and argv stacks once per
3799 file, instead of once per macro.
3801 2006-10-24 Eric Blake <ebb9@byu.net>
3803 * src/m4.h (includes): Add gettext.h, for N_. Assume setlocale.
3805 2006-10-23 Eric Blake <ebb9@byu.net>
3807 * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
3808 from branch regarding stripped leading whitespace.
3810 * modules/m4.c (includes): Use safe headers even when configured
3811 with --enable-assert.
3812 (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
3813 #defined as mkstemp_safer.
3815 2006-10-21 Eric Blake <ebb9@byu.net>
3817 * modules/m4.c (m4_make_temp): Change signature.
3818 (maketemp, mkstemp): Update callers.
3819 * modules/m4.h (m4_make_temp_func): New export.
3820 * modules/gnu.c (mkdtemp): New macro.
3821 * doc/m4.texinfo (Operation modes): Document interaction with
3823 (Mkdtemp): New node.
3824 * tests/builtins.at (mkdtemp): New test.
3825 (mkstemp): Check for umask effect.
3826 * NEWS: Document new builtin.
3828 * tests/generate.awk (normalize): Update recognition of trailing
3830 * doc/m4.texinfo: Minor formatting fixes from branch.
3831 (Foreach, Improved foreach): Merge from branch.
3832 * examples/foreach.m4: Merge from branch.
3833 * examples/foreachq.m4: New file from branch.
3834 * examples/foreach2.m4: Likewise.
3835 * examples/foreachq2.m4: Likewise.
3837 * doc/m4.texinfo (titlepage): Add myself as author.
3838 * src/main.c (AUTHORS): Likewise.
3840 2006-10-19 Eric Blake <ebb9@byu.net>
3842 * modules/m4.c (m4_make_temp, mkstemp): New functions.
3843 (maketemp): Add POSIX behavior and a warning.
3844 * tests/others.at (maketemp): Move this test...
3845 * tests/builtins.at (mkstemp): ...to here, and beef up.
3846 * tests/options.at (--safer): Update to new warning message.
3847 * doc/m4.texinfo (Mkstemp): Sync from branch.
3848 (Extensions): Update maketemp behavior.
3849 * NEWS: Document that maketemp now always warns.
3851 * tests/generate.awk: For ease of doc-writing, simplify selection
3852 of '-Ipath/to/examples' to '@comment examples'.
3853 * examples/forloop.m4: Simplify.
3854 * examples/forloop2.m4: New file.
3855 * examples/quote.m4: New file.
3856 * doc/m4.texinfo (Improved forloop): New node.
3857 (Manual): Clarify use of examples directory.
3858 (Shift, Forloop): Resync from branch.
3859 (Include, Location): Update to new usage of examples directory.
3861 * m4/system_.h (includes): Pick up <unistd.h> before checking for
3863 (gettext_noop): Don't define here, let gettext.h do it instead.
3864 * po/POTFILES.in: Update entries to reflect gnulib imports.
3866 2006-10-16 Eric Blake <ebb9@byu.net>
3868 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3870 * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
3871 pkglibexecdir support.
3872 * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
3873 worry about pathconf.h, now that gnulib does it for us.
3874 (pkgmodincludedir): Simplify.
3875 (pkglibexecdir): Delete, now that automake does this.
3876 * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
3877 * src/main.c (usage): Likewise.
3878 * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
3880 * doc/m4.texinfo: Port some changes from the branch.
3881 (Invoking m4): Promote to a chapter, instead of a section of
3883 (Operation modes, Dynamic loading features, Preprocessor features)
3884 (Limits control Frozen state, Debugging options)
3885 (Command line files): Subdivide into new sections.
3886 (Cleardivert): Rename from cleardiv.
3888 2006-10-14 Eric Blake <ebb9@byu.net>
3890 * tests/others.at (stdin closed): Update to match previous patch.
3892 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
3894 Reported by Ralf Wildenhues.
3896 * modules/m4.c (undivert): Merge from branch.
3897 * doc/m4.texinfo (Improved fatal_error): Fix typo.
3898 (Improved exch): New node, copied from branch.
3899 (Improved cleardivert): Update from branch.
3902 2006-10-13 Eric Blake <ebb9@byu.net>
3904 * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
3906 * modules/gnu.c (builtin, indir): Transparently handle builtin
3908 * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
3909 * m4/input.c (m4_pop_wrapup): Display debug message when switching
3911 (m4_input_init): No need to use empty file any more.
3912 (file_print): Display correct file name.
3913 * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
3914 dereference a NULL file name.
3915 * m4/m4module.h (m4_pop_wrapup): New parameter.
3916 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
3918 * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
3919 * m4/symtab.c (m4_symbol_value_groks_macro): New method.
3920 * src/main.c (main): Adjust caller.
3921 * tests/options.at (--debugmode): Test more output from -dV.
3923 2006-10-12 Eric Blake <ebb9@byu.net>
3925 * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
3927 * m4/m4private.h (m4__next_token_is_open): New prototype.
3928 * m4/m4module.h (m4_push_single): Delete; push_string is an
3929 adequate interface, and removing support for this simplifies the
3931 (m4_push_wrapup): New parameter.
3932 (m4_is_syntax): Delete; m4_has_syntax is sufficient.
3933 (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
3934 start-quote and start-comment exclusive from other syntax
3936 * m4/syntax.c: Likewise.
3937 * m4/input.c (input_funcs): Make polymorphic without requiring
3938 clients to know whether they are located at isp. All users
3940 (file_names): New variable.
3941 (m4_input_init): Initialize it.
3942 (m4_push_file): Use it.
3943 (m4_input_exit): Free it after use.
3944 (m4__next_token): Simplify slightly.
3945 (m4__peek_token): Rename and simplify...
3946 (m4__next_token_is_open): ... to this. In particular, this
3947 allows us to avoid a double ungetc, which POSIX doesn't
3949 (struct m4_input_block, m4_push_single, single_peek, single_read):
3950 Remove support for single characters, as the input engine now
3951 guarantees we don't need it.
3952 (file_unget, string_unget, m4_input_print, unget_input):
3953 Strengthen assertions.
3954 (file_init_funcs, file_read_init): New for file reading.
3955 (string_init_funcs, string_read_init): New for wrapped text.
3956 (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
3957 Support wrapped text with locations.
3958 (m4_skip_line): Support dnl across include file boundary.
3959 (peek_char): Don't pop input when peeking.
3960 (file_peek): Peek can be called at the end of the file.
3961 (string_read): Don't read beyond string bounds.
3962 * m4/macro.c (expand_token, collect_arguments): Update callers.
3963 (expand_macro): Report errors at location of open parenthesis.
3964 (expand_token, expand_argument, process_macro): Avoid negative
3965 array dereferences with m4_has_syntax.
3966 * m4/utility.c (skip_space): Likewise.
3967 * modules/m4.c (m4wrap): Update caller.
3968 * tests/builtins.at (__file__, __line__, dnl): New tests.
3969 * tests/options.at (--debugmode): Normalize the output.
3970 * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
3971 Remerge recent changes from branch.
3972 (Improved fatal_error): New node from branch.
3974 2006-10-11 Eric Blake <ebb9@byu.net>
3976 * src/main.c (usage, long_options): Add --debugmode as an alias
3977 for --debug, to match macro name.
3978 * tests/options.at (--debugmode): Rename from --debug, and test
3980 (--discard-comments): Augment test.
3981 * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
3984 2006-10-10 Eric Blake <ebb9@byu.net>
3986 Trace improvements: debugmode(c) was always printing the last two
3987 lines paired, combine them; and show non-text expansions.
3988 * m4/macro.c (trace_prepre): Update to show what the macro will
3990 (trace_pre): No need to special-case on debugmode(c).
3991 (trace_post): Likewise. Also, show non-text expansions.
3992 (expand_macro): Update caller. Collecting arguments can change
3993 debug mode, so cache values beforehand.
3994 (trace_format): Remove support for unused %l%S%r, and fix support
3995 for %z to match gcc's attribute((printf)).
3996 (trace_header): Update caller.
3997 * m4/input.c (struct m4_input_block): Rename from input_block.
3998 (struct input_funcs): Add print_func member.
3999 (file_print, builtin_unget, builtin_print, string_print)
4000 (m4_input_print): New functions.
4001 (m4_push_string_finish): Change return type.
4002 (m4_push_file): Fix missing use of close parameter.
4003 * m4/debug.c (m4_debug_decode): Don't clear pending traces.
4004 * m4/m4module.h (m4_input_print): New prototype.
4005 * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
4006 to match behavior change.
4007 * tests/options.at (--debug): Likewise.
4008 * tests/macros.at (Propagation of traceon)
4009 (Propagation of --trace): Likewise.
4010 * tests/others.at (stderr closed, stdout closed, stdin closed):
4012 * doc/m4.texinfo (Forloop): Simplify.
4013 (Trace): Update to changed behavior.
4014 (Debugmode): Document this change.
4015 * src/main.c (usage): Likewise.
4018 2006-10-09 Eric Blake <ebb9@byu.net>
4020 * m4/path.c (m4_include_env_init): Don't alter result of getenv.
4021 Reported by Ralf Wildenhues.
4023 * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
4025 2006-10-07 Eric Blake <ebb9@byu.net>
4027 * m4/m4module.h (m4_set_exit_failure): New prototype.
4028 * m4/utility.c (m4_set_exit_failure): New function.
4029 * modules/m4.c (m4exit): Use it to avoid yet another global
4030 variable export in libm4.
4032 2006-10-06 Eric Blake <ebb9@byu.net>
4034 * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
4036 * tests/others.at (stdout closed): Fix final check.
4038 Replace uses of tmpfile with clean-temp, since tmpfile is
4039 incompatible with closeout.
4040 * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
4042 * tests/others.at (stderr closed): Likewise.
4043 * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
4044 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4046 * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
4047 (m4_tmpfile, cleanup_tmpfile): New functions.
4048 (make_room_for, m4_insert_diversion): Use clean-temp module.
4049 * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
4051 * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
4053 * m4/utility.c (m4_numeric_arg): Merge from branch.
4054 * modules/gnu.c (debuglen): New builtin.
4055 * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
4056 Rename --arglength to --debuglen.
4057 * tests/options.at (--arglength): Rename to --debuglen.
4058 (deprecated options): Augment test.
4059 * doc/m4.texinfo (Invoking m4): Document the name change.
4060 (Debugmode): Rename from Debug Levels.
4061 (Debugfile): Rename from Debug Output.
4062 (Debuglen): New node.
4063 * NEWS: Document these changes.
4065 * modules/m4.c (m4exit): Fix typo. Ensure desired exit status in
4066 case closing a module exits.
4068 * modules/m4.c (m4exit): Merge from branch.
4069 * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
4071 2006-10-05 Eric Blake <ebb9@byu.net>
4073 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4075 * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
4076 * src/main.c (main): Close stdout on exit.
4077 * m4/debug.c (set_debug_file): Check for write failure.
4078 * m4/m4.c (m4_delete): Don't mask write failure.
4079 * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
4080 macros before calling AT_CHECK.
4081 (M4_ONE_MEG_DEFN): New helper macro.
4082 * tests/others.at (stdout full): New test.
4083 (stderr closed, stdin closed, stdout closed): Augment.
4084 * tests/builtins.at (syscmd): New test.
4087 2006-10-04 Eric Blake <ebb9@byu.net>
4089 * tests/builtins.at: Alphabetize tests.
4090 * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
4091 * tests/generate.awk (new_test): Fix underquoting.
4092 * tests/others.at (maketemp): Rename from misc.
4093 (stdin closed, stdout closed, stderr closed): New tests.
4095 2006-10-03 Eric Blake <ebb9@byu.net>
4097 Avoid all global variables in modules, so that --disable-static
4099 * examples/incl.m4: New file, from branch.
4100 * Makefile.am (dist_pkgdata_DATA): Distribute it.
4101 * doc/m4.texinfo (Location): Merge this section from branch.
4102 (Include): Update the test.
4103 * tests/generate.awk (new_test): Allow for VPATH build
4104 pre-processing of expected __program__ output.
4105 * m4/m4module.h (m4_current_diversion, m4_output_current_line):
4106 Avoid global variables.
4107 (m4_context_field_table): Add current_diversion, output_line.
4108 (m4_output_init, m4_make_diversion): Add parameter.
4109 (m4_get_program_name, m4_set_program_name): New accessors.
4110 * m4/m4private.h (m4_get_current_diversion),
4111 (m4_set_current_diversion, m4_get_output_line)
4112 (m4_set_output_line): New accessors.
4113 * m4/utility.c (m4_get_program_name, m4_set_program_name): New
4115 * modules/m4.c (divnum, divert): Adjust callers.
4116 * modules/gnu.c (__program__): Likewise.
4117 * m4/output.c (m4_output_init, m4_make_diversion)
4118 (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
4119 (m4_insert_diversion): Likewise.
4120 * m4/input.c (file_clean, m4_push_file): Likewise.
4121 * src/freeze.c (reload_frozen_state): Likewise.
4122 * src/main.c (main, usage): Likewise.
4124 Partially plug memory leak when unloading gnu module.
4125 * tests/modules.at (unload gnu module): New test.
4126 * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
4127 (m4_regexp_compile): Move static storage to module visibility.
4128 * tests/options.at (--debug): Adjust to new output.
4130 2006-09-29 Eric Blake <ebb9@byu.net>
4132 Even when not the first option, --help can't have side effects.
4133 * tests/options.at (--debugfile): Detect bugs in this area.
4134 * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
4136 * src/main.c (main): Fix it by deferring debugfile change. Also,
4137 defer closing streams until after module tracing is done.
4138 * modules/gnu.c (debugfile): Make message consistent with command
4140 * doc/m4.texinfo (Invoking m4): Touch up the documentation.
4141 * NEWS: Document this fix.
4143 * modules/m4.c (dnl): Include macro name in warning message.
4144 * m4/input.c (m4_skip_line): Add parameter.
4145 * m4/m4module.h (m4_skip_line): Likewise.
4146 * src/main.c (usage): Update wording.
4147 * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
4148 issue of blind macros vs. POSIX is resolved.
4149 (Dnl): Merge another node from branch.
4151 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4153 * m4/system_.h (N_): Define.
4154 * src/main.c (main): Validate numeric arguments.
4155 (size_opt): New function, idea borrowed from coreutils.
4156 * m4/macro.c (expand_macro): -L0 implies no limit.
4157 * doc/m4.texinfo (Invoking m4): Document this change.
4159 * tests/options.at: (--arglength, --nesting-limit)
4160 (--regexp-syntax): New tests of argument validation.
4162 2006-09-28 Eric Blake <ebb9@byu.net>
4164 * tests/options.at: Alphabetize the tests.
4166 2006-09-27 Eric Blake <ebb9@byu.net>
4168 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
4169 another parameter to print module info.
4170 * m4/macro.c (trace_pre): Adjust caller.
4171 * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
4172 * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
4173 * NEWS: Document this.
4175 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4177 * m4/symtab.c (symbol_value_print): Rename to...
4178 (m4_symbol_value_print): ...this, and...
4179 (m4_symbol_print): Update to allow -L length truncation. Now
4180 truncation also affects dumpdef output and builtin names.
4181 * m4/m4private.h (nesting_limit, max_debug_argument_length):
4183 * m4/m4module.h (m4_symbol_print): Add parameter.
4184 (m4_symbol_value_print): New function.
4185 * modules/m4.c (dumpdef): Allow length truncation.
4186 * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
4188 * doc/m4.texinfo (Invoking m4): Document -l better.
4189 (Dumpdef, Debug Levels): Document the effect of -l.
4190 * NEWS: Document this change.
4192 * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
4193 (m4_expand_ranges): Ensure we aren't picking up partial object on
4195 * modules/stdlib.c (setenv): Allow extra arguments.
4196 * modules/time.c (ctime): Avoid side effect in call to
4198 * modules/gnu.c (m4_regexp_substitute): Likewise.
4199 (renamesyms): Avoid extra obstack_init.
4200 * src/freeze.c (reload_frozen_state): Remove debug comment.
4201 (produce_frozen_state): Simplify fprintf to puts where possible.
4202 * modules/modtest.c (modtest_init, modtest_finish): Likewise.
4203 * modules/import.c (import, symbol_fail, modules_fail): Likewise.
4204 * m4/macro.c (trace_flush): Likewise.
4205 * m4/debug.c (m4_debug_message_prefix): Likewise.
4206 * m4/path.c (include_dump): Likewise.
4207 * m4/module.c (module_remove): Likewise.
4208 (install_builtin_table): Simplify malloc and string
4211 2006-09-26 Eric Blake <ebb9@byu.net>
4213 * m4/m4module.h (m4_symbol_print): New prototype.
4214 (M4_DEBUG_TRACE_STACK): New enumerator.
4215 (m4_is_debug_bit): Allow use without requiring m4private.h.
4216 * m4/symtab.c (symbol_value_print, m4_symbol_print): New
4218 * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
4220 (dumpdef): Allow printing pushdef'd stacks.
4221 * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
4222 * src/main.c (usage): Document it.
4223 * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
4226 * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
4228 * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
4229 of lines during make.
4230 (AM_CPPFLAGS): Remove unneeded include path.
4231 (src_m4_CPPFLAGS): Remove redundant include path.
4232 * m4/system_.h Make preprocessor indentation consistent.
4233 (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
4235 (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
4237 (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
4238 (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
4239 (bool, true, false): Don't undefine here; stdbool takes care of
4241 * src/m4.h (includes): Assume config.h, and several standard
4243 (__CYGWIN__, WIN32): Don't define here; let system.h do it.
4244 * m4/m4private.h: Assume config.h.
4245 * m4/output.c: Likewise.
4246 * m4/path.c: Likewise.
4247 * m4/resyntax.c: Likewise.
4248 * m4/utility.c: Likewise.
4249 * modules/gnu.c: Likewise.
4250 * modules/import.c: Likewise.
4251 * modules/load.c: Likewise.
4252 * modules/m4.c: Likewise.
4253 * modules/modtest.c: Likewise.
4254 * modules/mpeval.c: Likewise.
4255 * modules/perl.c: Likewise.
4256 * modules/shadow.c: Likewise.
4257 * modules/stdlib.c: Likewise.
4258 * modules/time.c: Likewise.
4259 * modules/traditional.c: Likewise.
4261 2006-09-21 Eric Blake <ebb9@byu.net>
4263 * doc/m4.texinfo (Invoking m4): Add clarification on option
4264 processing behavior.
4265 * tests/options.at (option grouping): Test this.
4267 Reported by Mikhail Teterin.
4269 * bootstrap: Add --force option, based on idea from coreutils.
4270 * README: Document that ./bootstrap and autoreconf are for
4271 developers, and not lightly done in tarballs.
4273 2006-09-20 Eric Blake <ebb9@byu.net>
4275 * src/main.c (usage, OPTSTRING, main): Rename -e to -i. Make
4276 warnings consistent.
4277 (long_options, HASHSIZE_OPTION): Warn on -H.
4278 * doc/m4.texinfo (Invoking m4): Document this.
4279 * tests/options.at (deprecated options): Update.
4281 Change the default of interactive sessions to match sh.
4282 * src/main.c (usage): Document this.
4283 (enum interactive_choice): New enum.
4284 (main): Use it to defer decision of interactive until after
4285 argument processing.
4286 * doc/m4.texinfo (Invoking m4): Document this.
4287 * NEWS: Likewise, plus add missing mention of -b.
4288 Reported by Stepan Kasal.
4290 2006-09-19 Eric Blake <ebb9@byu.net>
4292 * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
4293 well as --error-output; the goal is to add -o/--output in some
4294 future version with semantics like gcc or autom4te.
4295 * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
4296 (Extensions): Reflect this update.
4297 (Renamesyms): Add another test.
4298 (Defn): Xfail for now, so that `make check' is happy.
4299 * NEWS: Document this change.
4300 * tests/generate.awk: Mark dynamic loading tests as such. Allow
4302 * tests/macros.at (Renamesyms collisions): New test, exposing
4303 renamesyms' coredump.
4304 * tests/options.at (--debugfile, --safer): Update to match
4307 * m4/debug.c (set_debug_file): Fix regression in -o when stdout
4308 and stderr are same file, introduced 2003-07-23.
4309 * tests/options.at (--debugfile): New test, to catch the bug.
4310 (deprecated options): Test --error-output.
4311 * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
4312 Deprecate --error-output, and replace it with --debugfile.
4313 * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
4314 Document this change.
4317 2006-09-18 Eric Blake <ebb9@byu.net>
4319 * modules/load.c (modules): Rename to...
4320 (m4modules): ...this, since it is an English word with 0
4322 * modules/gnu.c (symbols, m4symbols): Likewise.
4323 * doc/m4.texinfo (Listing Modules): Rename to...
4324 (M4modules): ...this.
4325 (Symbols): Rename to...
4326 (M4symbols): ...this.
4327 (Load, Foreach, Trace, Answers): Update to new spellings.
4328 * NEWS: Document this.
4330 * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
4331 such that without arguments, the global trace flag is changed
4332 rather than walking the table of all currently-defined macros.
4333 (set_trace_CB): No longer needed.
4334 * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
4335 (m4_set_symbol_traced): Delete.
4336 (m4_symtab_create): Nuke the nuke parameter.
4337 * m4/m4private.h (m4_get_symbol_value): Delete.
4338 * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
4339 (m4_set_symbol_name_traced): Free undefined entries that are no
4341 (symbol_destroy_CB): Update caller.
4342 * m4/m4.c (m4_create): Update caller.
4343 * src/main.c (main): Likewise.
4344 (usage): Fix typo in last commit.
4345 * doc/m4.texinfo: Minor cleanups throughout.
4346 (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
4347 more nodes from branch.
4348 (Trace): Document new semantics, and how to simulate the old.
4349 * tests/builtins.at (multiquotes): Adjust to new semantics.
4350 * NEWS: Update somewhat.
4352 2006-09-14 Eric Blake <ebb9@byu.net>
4354 Add --safer option, per debian bug 5898.
4355 * src/main.c (usage): Document new option.
4356 (SAFER_OPTION): New enumerator.
4357 (main): Set the option bit.
4358 * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
4360 * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
4361 (m4_get_safer_opt): New accessor.
4362 * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
4363 * modules/m4.c (syscmd, maketemp): Likewise.
4364 * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
4365 (Sysval, Maketemp): Add tests of this.
4366 * tests/options.at (--safer): Likewise.
4368 2006-09-13 Eric Blake <ebb9@byu.net>
4370 * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
4372 Reported by Ralf Wildenhues.
4375 * Makefile.am (check_LTLIBRARIES): Build test libraries in the
4376 tests directory, so we can be sure an installed build is not
4377 picking up uninstalled non-test libraries.
4378 (check-local, installcheck-local): Depend on test libraries.
4379 * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
4380 after file name. Fix quoting. Remove skipping the test, now
4381 that makefile guarantees test modules will exist.
4382 (Freezing modules, modules: shadow, modules: unload)
4383 (modules: trace): Always put test modules in module path.
4384 (modules: importing): Likewise, and rely on AT_CHECK_M4 for
4386 * src/main.c (usage): Document default module search path.
4387 (import_environment, frozen_file_to_read, frozen_file_to_write):
4390 * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
4391 * tests/m4.in: ...not here.
4392 Reported by Ralf Wildenhues.
4394 2006-09-08 Eric Blake <ebb9@byu.net>
4396 * bootstrap: Kill unrelated copy-n-paste code from argument
4397 parsing. Let Makefile generate testsuite.
4398 * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
4400 2006-09-07 Eric Blake <ebb9@byu.net>
4402 * m4/m4module.h (m4_peek_input): No longer export.
4403 (m4_error_at_line, m4_warn_at_line): New prototypes.
4404 (m4_is_symbol_void): New macro.
4405 (m4_push_file): Update prototype.
4406 * m4/m4private.h (m4__peek_token): New prototype.
4407 (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
4408 * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
4409 * src/main.c (main): Allow reading from stdin twice.
4410 * modules/m4.c (include): Adjust to new prototype.
4411 * m4/input.c: General comment cleanup.
4412 (file_peek, file_read, file_unget, push_file): Set end flag on
4413 EOF, so that we don't call getc twice.
4414 (push_file, file_clean): Port fix from branch to avoid closing
4416 (pop_input): Port fix from branch to avoid reading free'd memory
4417 when input ends mid-string.
4418 (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
4419 (string_peek, string_read): Always use unsigned char.
4420 (m4_skip_line): Warn when dnl cut short by EOF.
4421 (peek_input): Rename from m4_peek_input.
4422 (match_input): Update signature, to distinguish between `(' token
4423 and multi-char quote or comment beginning with `('.
4424 (m4_input_exit): Cleanup now done in m4_pop_wrapup.
4425 (m4__peek_token): New function, ported from branch.
4426 (m4__next_token): Update to new token types.
4427 * m4/macro.c (expand_token, expand_argument): Use peek_token.
4428 * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
4429 (Invoking m4): Remerge from branch.
4431 * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
4432 (check-local): and put dependency here.
4433 Reported by Ralf Wildenhues.
4435 2006-09-05 Eric Blake <ebb9@byu.net>
4437 * m4/m4module.h (m4_debug_message): New prototype.
4438 (M4_DEBUG_TRACE_MODULE): New debug bit.
4439 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
4440 (M4_DEBUG_MESSAGE2): Delete these macros.
4441 * m4/debug.c (m4_debug_message): New method.
4442 (m4_debug_decode): Add module tracing as flag `m'.
4443 * m4/input.c (m4_push_file, file_clean): Use new method.
4444 * m4/path.c (m4_path_search): Likewise.
4445 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
4446 * m4/module.c (install_builtin_table, install_macro_table)
4447 (m4__module_open, module_close, module_remove): Promote several
4448 module debug messages outside of DEBUG_MODULES.
4449 (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
4450 DEBUG_MODULES with normal trace output.
4451 * src/main.c (usage): Document new flag.
4452 * doc/m4.texinfo (Debug Levels): Likewise.
4453 * Makefile.am ($(TESTSUITE)): Add missing dependency.
4454 * tests/m4.in: Neutralize platform-dependent module filenames.
4455 * tests/options.at (--debug): Update expected output.
4457 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4459 * doc/m4.texinfo: Fix some typos.
4460 * tests/others.at: Likewise.
4462 2006-09-05 Eric Blake <ebb9@byu.net>
4464 * m4/input.c (lex_debug): Remove dead code that broke compilation
4465 with --enable-debug.
4466 * m4/module.c (install_builtin_table, install_macro_table)
4467 (m4__module_init, m4__module_open, module_close)
4468 (module_remove): Fix compilation when --enable-debug.
4469 * m4/output.c (m4_shipout_text): Likewise.
4470 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
4471 libraries when --enable-debug.
4472 * configure.ac (DYNAMIC_MODULES): New variable, to pass
4473 information to testsuite.
4474 (modules to preload): Determine modules after we know whether
4475 shared libraries are supported.
4476 * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
4478 * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
4479 * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
4480 (modules: shadow, modules: unload, modules: importing)
4481 (modules: trace): Use new macro.
4482 * tests/builtins.at (gmp): Likewise.
4484 * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
4486 (expand_token): Avoid assertion just added to docs.
4487 (expand_macro): Track pending expansions, for when a symbol's
4488 definition changes during argument collection.
4489 (m4_macro_call, process_macro): Operate on symbol value, not
4490 symbol, since symbol may have changed during argument collection.
4491 * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
4492 (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
4493 (m4_get_symbol_value): Add fast macro version.
4494 * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
4495 (m4_macro_call): Adjust prototype.
4496 * m4/module.c (install_builtin_table): Check that flags are valid
4497 when creating builtin.
4498 * m4/symtab.c (m4__symtab_remove_module_references): Use
4499 m4_symbol_value_delete, rather than inlining it.
4500 (m4_symbol_value_copy): Copy placeholder text.
4501 (symbol_popval): Use m4_symbol_value_delete.
4502 (m4_symbol_value_delete): Implementation was missing when NDEBUG.
4503 Handle pending expansions.
4504 * modules/gnu.c (indir): Update to new prototype.
4505 * doc/m4.texinfo: Fix menus to be consistent with section names.
4506 (Defn): Add test that macro tokens flatten to empty string;
4507 triggered an assert before this patch.
4508 (Ifelse): Merge another node.
4509 (Loops): Split into...
4510 (Forloop, Foreach): New nodes; work is still underway on them.
4511 (Answers): Add more info on foreach macro; work is still underway.
4512 (Indir): Add test that indir collects arguments before looking up
4514 * TODO: Update based on this patch.
4516 2006-09-01 Eric Blake <ebb9@byu.net>
4518 * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
4519 * m4/hash.h (m4_free_hash_iterator): New prototype.
4520 * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
4521 ensure we don't do unsafe things while iterating.
4522 (HASH_ITER, ITER_CHAIN): New accessor macros.
4523 (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
4524 (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
4525 (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
4526 (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
4527 to catch unsafe actions.
4528 (m4_free_hash_iterator): New function, to avoid memory leaks, and
4529 when debugging, to track safe actions.
4530 (m4_hash_apply): Avoid memory leak.
4531 * m4/symtab.c (m4_symtab_apply): Likewise.
4532 * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
4533 in manually to src/ for now.
4534 * tests/builtins.at (gmp): Add keyword module.
4535 * tests/modules.at (Freezing modules, modules: shadow)
4536 (modules: unload, modules: importing, modules: trace): Likewise.
4538 2006-08-30 Eric Blake <ebb9@byu.net>
4540 * m4/utility.c (m4_warn): Factor "Warning" out of messages into
4542 (m4_bad_argc, m4_numeric_arg): Update all callers.
4543 * m4/macro.c (m4_macro_call): Likewise.
4544 * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
4545 (Indir, Builtin, Ifdef): More doc merges.
4546 (Loops): Mention that documenting foreach would be nice.
4547 (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
4548 (Include, Eval, Location, M4exit): s/input.m4/stdin/.
4549 * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
4550 (substitute, syncoutput): Update all m4_warn callers.
4551 * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
4552 (traceon, traceoff): Make warning message consistent.
4553 (define, pushdef): Update all m4_warn callers.
4554 * tests/generate.awk: Choose file name so that documentation can
4555 show command-line behavior.
4556 * tests/builtins.at (define): Update to new wording.
4557 * tests/macros.at (pushdef/popdef): Likewise.
4558 * tests/freeze.at (loading format 1): Likewise.
4559 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4561 * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
4563 (Defn): Add failing test case for mixing text and builtin.
4564 (Renamesyms): Improve wording, and identify core dump that needs
4567 2006-08-29 Eric Blake <ebb9@byu.net>
4569 * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
4570 (Arguments, Pseudo Arguments): More doc merges from the branch.
4571 (Macro expansion): Turn example into test.
4572 (Pseudo Arguments): Add example of avoiding argument.
4573 * modules/m4.c (undefine, popdef): Accept multiple arguments.
4574 (define, pushdef): Warn on non-text macro name.
4575 (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
4576 warning/error messages.
4577 (ifdef): Ignore extra arguments.
4578 * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
4579 (m4__symtab_remove_module_references): Check that there is no leak.
4580 * tests/macros.at (pushdef/popdef): Update to new message.
4581 * tests/builtins.at (define): Likewise.
4582 * tests/freeze.at (loading format 1): Likewise.
4583 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4585 * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
4586 (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
4587 as accessor function, to avoid compiler warning.
4588 * m4/module.c (m4__module_open): Move declaration of variable to
4589 avoid compiler warning.
4590 * src/main.c (main): Avoid shadowing a global variable.
4591 * src/freeze.c (produce_symbol_dump): Avoid unused variable
4592 warning when NDEBUG.
4593 * tests/options.at (--discard-comments, --import-environment)
4594 (--debug, --prepend-include, --help and --version): Rename tests
4595 to name option tested.
4597 2006-08-28 Eric Blake <ebb9@byu.net>
4599 * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
4600 * m4/module.c (install_builtin_table): ...to here, and add
4601 assertion that blind macros require arguments.
4602 * m4/m4module.h (struct m4_builtin): Document restrictions that
4603 must be met during module loading.
4604 * modules/gnu.c (changeresyntax, changesyntax): These are blind,
4605 so require an argument to avoid triggering assertion.
4606 (debugfile): Tweak error message.
4608 2006-08-25 Eric Blake <ebb9@byu.net>
4610 * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
4611 (M4_BUILTIN_SIDE_EFFECT): New enumerators.
4612 (struct m4_builtin): New member flags replaces groks_macro_args,
4613 blind_if_no_args. min_args and max_args are now 0-based.
4614 Rearrange members to reduce size on platforms where function
4615 pointers are 64 bits but regular pointers are 32.
4616 (m4_bad_argc): Add argument.
4617 * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
4618 * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
4619 effect into account.
4620 * m4/module.c (install_builtin_table): Adjust all users affected
4622 * m4/macro.c (m4_macro_call): Likewise.
4623 * src/freeze.c (reload_frozen_state): Likewise.
4624 * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
4625 * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
4626 * modules/import.c (builtin_functions): Likewise.
4627 * modules/load.c (builtin_functions): Likewise.
4628 * modules/modtest.c (builtin_functions): Likewise.
4629 * modules/mpeval.c (builtin_functions): Likewise.
4630 * modules/perl.c (builtin_functions): Likewise.
4631 * modules/shadow.c (builtin_functions): Likewise.
4632 * modules/stdlib.c (builtin_functions): Likewise.
4633 * modules/time.c (builtin_functions, mktime_functions)
4634 (strftime_functions): Likewise.
4635 * doc/m4.texinfo (Loops): Update test now that shift is blind.
4636 (Macro Arguments): Fix typo in test.
4637 (Patsubst): Fix typo in test.
4638 * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
4639 end of string. Fix return value when ignore_duplicates.
4640 * tests/builtins.at (patsubst): Fix typo in test.
4642 * tests/options.at (debug-flags): Update to reflect new message.
4643 (deprecated options, prepend-include, help and version): New
4645 * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
4646 test omits an input file name.
4647 * src/main.c (long_options, main): Add -B/--prepend-include.
4648 (usage): Document it.
4649 (main): `m4 --help --version' now displays help, not version.
4650 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4651 dirname filenamecat.
4652 * m4/m4module.h (m4_add_include_directory): Add parameter.
4653 * m4/m4private.h (m4__include_init): New prototype.
4654 * m4/m4.c (m4_create): Put `.' on path before options are
4656 * m4/path.c (includes): Assume C89. Use gnulib for file name
4658 (m4__include_init): New function.
4659 (search_path_add): Allow prepending.
4660 (m4_add_include_directory, search_path_env_init): Adjust callers.
4661 (m4_path_search): Relative names now invoke path search, since
4662 `.' might not be first.
4663 * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
4665 2006-08-25 Bruno Haible <bruno@clisp.org> (tiny change)
4666 and Eric Blake <ebb9@byu.net>
4668 * bootstrap: Run autopoint before gnulib-tool, since autopoint
4669 0.15 installs macros obsoleted by current gnulib.
4671 2006-08-25 Eric Blake <ebb9@byu.net>
4673 * doc/m4.texinfo (Macro Arguments): Another section merged;
4674 testsuite failures now exposed.
4676 2006-08-23 Eric Blake <ebb9@byu.net>
4678 * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
4679 (Input processing): More doc merges from the branch.
4680 (Regular expression syntax): Add introductory text.
4681 (Inhibiting Invocation): More doc merges from the branch.
4682 (Other tokens): Reorder after comments.
4683 * tests/generate.awk: Allow passing options to doc examples.
4685 2006-08-22 Eric Blake <ebb9@byu.net>
4687 * tests/options.at (debug-flags): New test.
4688 * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
4689 not negative, to distinguish failure in m4_debug_decode.
4690 (m4_debug_decode): Add new parameter.
4691 * modules/gnu.c (regexp): Slight cleanup.
4692 (renamesyms): Ignore excess arguments.
4693 (syncoutput): Make case-insensitive, warn on bad argument.
4694 (debugmode): Factor -+ handling out to...
4695 * m4/debug.c (m4_debug_decode): ...here.
4696 (m4_debug_message_prefix): Fix spacing.
4697 * src/main.c (main): Let -d option adjust flags.
4698 * m4/input.c (file_clean): Avoid printing empty file name.
4699 * doc/m4.texinfo (Syncoutput): Document new range of input.
4700 (Invoking m4): Document use of multiple -d flags.
4702 Start porting various fixes from the branch that use gnulib.
4703 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4704 binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
4705 regexprops-generic stdlib-safer unlocked-io.
4706 * m4/debug.c (m4_debug_set_output): Close debug file on exec.
4707 * m4/path.c (m4_path_search): Close input file on exec, reject
4708 empty file name, fix parameter naming.
4709 * m4/output.c (make_room_for): Close diversion file on exec.
4710 (includes): Assume C89 headers.
4711 (tmpfile): For now, we don't want tmpfile-safer, because we want
4713 * m4/m4private.h (includes): Use various gnulib headers.
4714 * doc/regexprops-generic.texi: Use gnulib's copy.
4716 * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
4717 * AUTHORS: Add copyright.
4718 * ChangeLog: Likewise.
4719 * README: Likewise. Require automake 1.9b or later.
4720 * HACKING: New file.
4721 * README-alpha: Add copyright.
4722 * THANKS: Likewise. Update.
4723 * doc/STYLE: Add copyright, and tweak for changed directories.
4724 * modules/README: Add copyright, and tweak for libtool version.
4725 * examples/COPYING: New file.
4726 * examples/WWW/COPYING: Likewise.
4727 * examples/WWW/m4lib/COPYING: Likewise.
4728 * modules/shadow.m4: Add copyright.
4729 * modules/perl.m4: Likewise.
4730 * modules/modtest.m4: Likewise.
4731 * modules/stdlib.m4: Likewise.
4732 * modules/time.m4: Likewise.
4733 * modules/time2.m4: Likewise.
4734 * po/Makevars: Likewise.
4735 * tests/iso8859.m4: Likewise.
4736 * tests/m4.in: Likewise.
4737 * NEWS: Add (C) to copyright.
4739 * m4/system_.h: Likewise.
4740 * tests/atlocal.in: Likewise.
4741 * tests/builtins.at: Likewise.
4742 * tests/freeze.at: Likewise.
4743 * tests/generate.awk: Likewise.
4744 * tests/macros.at: Likewise.
4745 * tests/modules.at: Likewise.
4746 * tests/options.at: Likewise.
4747 * tests/others.at: Likewise.
4748 * tests/testsuite.at: Likewise.
4749 * m4/utility.c: Spell out copyright years.
4750 * src/main.c: Likewise.
4752 * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
4754 2006-08-21 Eric Blake <ebb9@byu.net>
4756 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
4757 * modules/gnu.c (esyscmd): Use -1 for failure. Set sysval to 0
4758 when no arguments are given, but without losing warning about 0
4760 * modules/m4.c (syscmd): Likewise.
4761 (includes): Assume C89.
4762 (m4_sysval): Make static.
4763 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
4764 (sysval): Port calculation from branch.
4766 2006-08-20 Eric Blake <ebb9@byu.net>
4768 * m4/macro.c (expand_macro): Move argument check...
4769 (m4_macro_call): ...to here, so indir will warn.
4770 * modules/gnu.c (__program__): New macro, ported from branch.
4771 (builtin): Perform argument check.
4772 (changesyntax): Avoid out-of-bounds read.
4774 * modules/gnu.c (includes): Assume stdlib.h, errno.
4775 (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
4776 (substitute): Add caller parameter, avoid out-of-bounds memory
4778 (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
4781 2006-08-16 Eric Blake <ebb9@byu.net>
4783 * po/POTFILES.in: Add more files that contain translatable
4785 * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
4786 information to translators.
4787 (USE_MSGCTXT): New var for gettext 0.15.
4788 * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
4789 debug/trace messages in lower case.
4790 * m4/macro.c (expand_argument): Likewise.
4791 * m4/path.c (m4_path_search): Likewise.
4792 * src/main.c (main): Likewise.
4794 2006-08-14 Eric Blake <ebb9@byu.net>
4796 * src/main.c (usage): Document --import-environment.
4797 * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
4799 2006-08-11 Eric Blake <ebb9@byu.net>
4801 * bootstrap (func_get_translations): Only remove files when doing
4803 (func_update_po): Avoid CDPATH problems.
4805 2006-08-10 Eric Blake <ebb9@byu.net>
4807 * bootstrap (func_get_translations): New function.
4808 (func_update_po): Borrow ideas from tar to correctly pull in
4809 translations from newer location.
4811 2006-08-09 Eric Blake <ebb9@byu.net>
4813 * bootstrap: Recent gnulib no longer has jm_* macros to worry
4815 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4817 * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
4818 (m4_error, m4_warn): ... these new prototypes.
4819 (m4_current_file, m4_current_line): Move into context, rather
4820 than leaving as globals.
4821 (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
4822 (m4_undivert_all, m4_input_init): Now takes context.
4823 * m4/utility.c (m4_error, m4_warn): New functions.
4824 * m4/m4private.h: Assume errno exists.
4825 (struct m4): Move warning_status to a bit flag,
4826 and add exit_status. Adjust accessors accordingly.
4827 * src/main.c (print_program_name_CB): No longer needed.
4828 (main): Use new m4_get_fatal_warnings_opt.
4829 * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
4830 instead of issuing "INTERNAL ERROR". Pass context when needed,
4831 and use new accessors.
4832 * m4/input.c: Likewise.
4833 * m4/macro.c: Likewise.
4834 * m4/output.c: Likewise.
4835 * m4/utility.c: Likewise.
4836 * modules/evalparse.c: Likewise.
4837 * modules/gnu.c: Likewise.
4838 * modules/load.c: Likewise.
4839 * modules/m4.c: Likewise.
4840 * modules/mpeval.c: Likewise.
4841 * src/freeze.c: Likewise.
4842 * src/main.c: Likewise.
4843 * tests/macros.at: Adjust to new message format.
4844 * tests/builtins.at: Likewise.
4845 * tests/freeze.at: Likewise.
4846 * tests/modules.at: Likewise.
4847 * doc/m4.texinfo: Likewise.
4849 * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
4852 2006-08-03 Eric Blake <ebb9@byu.net>
4854 * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
4855 gracefully handle ENOSYS.
4859 2006-07-28 Eric Blake <ebb9@byu.net>
4861 * src/freeze.c (reload_frozen_state): Copy string when creating
4862 placeholder, to avoid memory corruption.
4863 * m4/symtab.c (symbol_popval): Avoid memory leak.
4864 (m4_symbol_rename): Avoid shadowing rename function.
4865 (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
4866 * tests/freeze.at (reloading unknown builtin): Add test.
4867 * tests/generate.awk: Capture m4.texinfo line number in
4868 testsuite.log, not just generated.at.
4870 Port idea from branch that a frozen file can request an unknown
4871 builtin without producing a warning unless the builtin is
4873 * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
4874 (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
4875 (m4_set_symbol_value_placeholder): New accessors.
4876 * m4/m4module.h (m4_is_symbol_placeholder),
4877 (m4_get_symbol_value_placeholder),
4878 (m4_set_symbol_value_placeholder),
4879 (m4_get_symbol_placeholder): Likewise.
4880 * m4/symtab.c (m4_is_symbol_value_placeholder),
4881 (m4_get_symbol_value_placeholder),
4882 (m4_set_symbol_value_placeholder): Likewise.
4883 (dump_symbol_CB): Handle new symbol type.
4884 * m4/macro.c (trace_pre): Likewise.
4885 (m4_macro_call): Warn when invoking a placeholder.
4886 * modules/m4.c (dumpdef): Handle dumping a placeholder.
4887 (defn): Warn when referencing a placeholder.
4888 * src/freeze.c (dump_symbol_CB): Ignore placeholder when
4890 (reload_frozen_state): When reloading unknown builtin, install a
4891 placeholder instead of warning.
4892 * tests/freeze.at (loading format 1): Allow warning when
4893 popdef'ing undefined function.
4895 2006-07-27 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
4897 * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
4898 function. Shift by 7, not 3, for consistency with
4899 gnulib/lib/hash.c. Don't assume hash word is 32 bits.
4901 2006-07-27 Eric Blake <ebb9@byu.net>
4903 * src/main.c (usage): Update to match branch.
4904 (main): Update --version info to distinguish between program name
4905 `m4' and package name `GNU M4'.
4906 (AUTHORS): Translate René Seindal's name.
4907 * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
4908 * Makefile.am (doc/m4.1): Update to match branch.
4909 * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
4912 * m4/system_.h (EXIT_MISMATCH): Define.
4913 * src/main.c (main): Don't clear syntax table for version 1.
4914 (usage): Document exit status.
4915 * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
4916 branch, and require V directive to appear first in file. Fix
4917 broken logic for detecting F and T in version 1 files.
4919 2006-07-22 Eric Blake <ebb9@byu.net>
4921 * src/main.c (stackovf_handler): Document the problems in our
4923 * src/stackovf.c: Forward port changes in branch to use POSIX
4924 sa_sigaction when available.
4925 (process_sigsegv): Avoid buffer overrun when error string is
4926 translated, although the fact that we translate in a signal
4927 handler is still a bug.
4928 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
4929 from branch to modernize checks.
4931 * modules/format.c (format): Avoid compiler warning that str may
4932 be used uninitialized.
4934 * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
4936 (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
4937 (DEBUG_MACRO): Remove unused macro.
4938 * src/stackovf.c: Avoid compiler warnings.
4939 * m4/input.c: Likewise.
4940 * m4/module.c: Likewise.
4941 * m4/output.c: Likewise.
4942 * m4/path.c: Likewise.
4943 * m4/symtab.c: Likewise.
4944 * m4/syntax.c: Likewise.
4946 2006-07-20 Eric Blake <ebb9@byu.net>
4948 * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
4949 Regenerate to explicitly ask for --assume-autoconf=2.60.
4951 2006-07-19 Eric Blake <ebb9@byu.net>
4953 * po/ChangeLog: Merge into main ChangeLog, then delete file.
4956 * doc/m4.texinfo (copying): Relax restriction on front-cover and
4959 2006-07-17 Eric Blake <ebb9@byu.net>
4961 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
4964 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
4966 * modules/format.c (includes): Use xvasprintf.h.
4967 (format): Make static. Avoid buffer overflow, that can lead to
4968 arbitrary code execution exploit. Only pass unsigned char to
4969 is*(). Support F, g, and G specifiers.
4970 * doc/m4.texinfo (Format): Expose buffer overrun bug. Document
4973 2006-07-17 Gary V. Vaughan <gary@gnu.org>
4975 Ensure M4 compiles correctly with -DDEBUG, and use a single
4976 consistent definition of various /DEBUG_[A-Z]+/ symbols:
4978 * m4/input.c: Have commented out out DEBUG_INPUT only by default.
4979 (m4_print_token): Use m4_get_symbol_value_text and
4980 m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
4981 and VALUE_FUNC respectively.
4982 (m4__next_token): Use m4_print_token call instead of obsolescent
4984 * m4/module.c: Have commented out out DEBUG_MODULE only by default.
4985 * m4/output.c: Similarly for DEBUG_OUTPUT.
4986 * m4/path.c: Similarly for DEBUG_INCL.
4987 * m4/symtax.c: Similarly for DEBUG_SYM.
4988 * m4/syntax.c: Similarly for DEBUG_SYNTAX.
4989 * src/stackovf.c: Similarly for DEBUG_STACKOVF.
4990 * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
4991 preprocessor macros defined with -DDEBUG compiles.
4993 2006-07-17 Gary V. Vaughan <gary@gnu.org> (tiny change)
4995 * bootstrap: Correct typo in --download-po argument parsing.
4997 2006-07-15 Eric Blake <ebb9@byu.net>
4999 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
5001 * tests/generate.awk (normalize): Recognize @tabchar.
5002 * doc/m4.texinfo (Top): Start merging from branch. Remove tabs.
5003 Fix menus. Upgrade FDL license from 1.1 to 1.2. Fix overfull
5005 (Index macro, Shell commands, Incompatiblities): Rename nodes
5006 from Index, UNIX commands, Other incompat.
5007 (Platform macros, Using frozen files, Frozen file format 1)
5008 (Frozen file format 2, Copying This Manual, Indices): New nodes.
5009 * Makefile.am (EXTRA_DIST): Distribute gendocs.
5010 (MAINTAINERCLEANFILES): Clean up files from gnulib.
5011 (doc_m4_TEXINFOS): Depend on fdl.texi.
5012 (web-manual): New maintainer target.
5014 2006-07-14 Gary V. Vaughan <gary@gnu.org>
5016 * doc/m4.texinfo (Modules): RMS asked me for an explanation of
5017 the modular architecture of M4. The result is paraphrased here
5018 for the benefit of future readers of the manual.
5020 2006-07-14 Gary V. Vaughan <gary@gnu.org> (tiny change)
5022 * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
5024 2006-07-14 Eric Blake <ebb9@byu.net>
5026 * src/main.c (main): Avoid compiler warning.
5027 * modules/gnu.c (renamesyms): Remove unused variable.
5029 2006-07-14 Gary V. Vaughan <gary@gnu.org>
5031 * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
5032 (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
5033 new functions for managing regexp syntax options.
5034 * m4/m4private.h (m4): Add regexp_syntax field.
5035 * m4/resyntax.c: New file implements the above.
5036 * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
5037 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
5038 (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
5039 (m4_patsubst_do, m4_renamesyms_do): Removed.
5040 (builtin_changeresyntax): New builtin to change regular expression
5042 (m4_resyntax_encode_safe): Factor out diagnostics code.
5043 * src/freeze.c (produce_resyntax_dump): New function to dump
5044 default regexp syntax specifier to frozen file.
5045 (reload_frozen_state): Updated to action 'R' directive.
5046 * src/main.c (usage): Describe new -r option.
5047 (long_options, OPTSTRING): Declare it.
5048 (main): Encode and store cli regexp syntax option argument.
5049 * tests/freeze.at (regexp syntax): New test that regexp syntax
5051 * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
5052 * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
5053 (Epatsubst and Patsubst): Renamed to...
5054 (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
5055 documentation and added new examples.
5056 (Changeresyntax): New section describing changeresyntax builtin,
5057 and regexp syntax names.
5058 (Regular expression syntax): New section describing differences
5059 between various regular expression syntaxes.
5060 (Frozen files): Document 'R' directive.
5063 2006-07-13 Gary V. Vaughan <gary@gnu.org>
5065 * bootstrap: Enhanced to work more like our other scripts:
5066 Add a copyright statement; support --version and --help; accept a
5067 --download-po option with argument as a substitute for DOWNLOAD_PO
5070 2006-07-11 Eric Blake <ebb9@byu.net>
5072 * Makefile.am (doc/m4.1): Port patch from branch that avoids
5074 * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
5077 2006-07-10 Gary V. Vaughan <gary@gnu.org> (tiny change)
5079 * tests/builtin.at (patsubst, regexp): Adjust these tests, now
5080 that `\0' is no longer accepted.
5082 * src/main.c (usage): Alphabetize options within their sections.
5084 * modules/gnu.c (m4_regexp_search, regsub, substitute)
5085 (esyscmd): Improve comments.
5087 * modules/gnu.c (substitute): Remove old warning for \0.
5088 (substitute_warned): No longer required. Removed.
5090 * modules/gnu.c: Put macro definitions into alphabetical order.
5092 2006-07-07 Eric Blake <ebb9@byu.net>
5094 * tests/freeze.at (loading format 1): New file, with new test.
5095 * tests/testsuite.at: Include it.
5096 * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
5097 * tests/modules.at (Freezing modules): Likewise.
5099 * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
5100 (AC_CHECK_HEADERS): Assume signal.h.
5101 (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
5102 (AC_CHECK_FUNCS_ONCE): Likewise.
5103 * src/m4.h (includes): Assume signal.h.
5105 2006-07-05 Eric Blake <ebb9@byu.net>
5107 Fix all testsuite failures on cygwin.
5108 * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
5109 branch-1_4. Solves testsuite failure when uninstalled m4 is
5110 shadowed by redefinition of PATH in libtool wrapper.
5111 * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
5112 contains the -no-undefined required by cygwin.
5113 (TESTS_ENVIRONMENT): Export abs_top_builddir.
5114 * tests/others.at (misc): Port to platforms where /etc/passwd
5115 does not exist or does not contain user named root.
5116 * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
5118 * tests/builtins.at (define, divert): Avoid overquoting.
5119 * tests/generate.awk (new_group): Likewise.
5121 2006-07-05 Gary V. Vaughan <gary@gnu.org>
5123 The regs_allocated field in a struct re_pattern_buffer refers
5124 to the state of a particular re_registers struct when used in
5125 successive matches using the same compiled pattern. Avoid a
5126 SEGV in `renamesyms' resulting from using a new re_registers
5127 with an existing re_pattern_buffer:
5129 * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
5130 pattern buffer and registers.
5131 (m4_regexp_search): New function to call re_regexp_search with
5132 correctly matched pattern buffer and register instantiations.
5133 (m4_regexp_compile): Return an m4_pattern_buffer. Adust all
5136 2006-07-04 Gary V. Vaughan <gary@gnu.org>
5138 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
5139 changes to gnulib getopt.m4 since last build.
5140 * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
5141 if the system getopt fails M4_GETOPT tests.
5143 2006-06-22 Eric Blake <ebb9@byu.net>
5145 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
5146 Reported by Bruno Haible.
5148 2006-06-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5150 * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
5152 2006-06-19 Eric Blake <ebb9@byu.net>
5156 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5158 * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
5159 (clean-local): Split into and depend upon...
5160 (clean-local-tests, clean-local-src): ...these two. The latter
5161 removes the libtool object directory below `src', to work around
5162 a buglet in Automake, failing to list it.
5163 (EXTRA_DIST): Distribute modules/perl.c.
5165 2006-06-19 Eric Blake <ebb9@byu.net>
5167 * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
5168 right side of dependency; VPATH does that.
5169 (stamp-vcl): Update to use libtool's algorithm.
5170 (EXTRA_DIST): Distribute stamp-vcl.
5171 Reported by Ralf Wildenhues.
5172 (TESTSUITE): Revert earlier change that used absolute path, as
5173 that broke 'make dist' in VPATH. Stick with $(srcdir) instead.
5174 (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
5175 (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
5176 atlocal takes care of it instead.
5177 (check-local, installcheck-local, clean-local): Inline absolute
5178 path to testsuite here, rather than relative path to testsuite
5181 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5183 * m4/m4private.h (DELETE): Cast away const here...
5184 * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
5185 * src/freeze.c (reload_frozen_state): Avoid uninitialized
5188 2006-06-19 Eric Blake <ebb9@byu.net>
5190 * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
5191 .info pages are built.
5192 Reported by Ralf Wildenhues.
5193 (EXTRA_DIST): Inline definition of testsuite, so that make dist
5196 2006-06-16 Eric Blake <ebb9@byu.net>
5198 Follow recommendations from autoconf manual for autotest.
5199 * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
5200 turn it into an absolute path until autotest provides an option
5201 that allows us to avoid changing directories. Properly quote
5203 (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
5204 (check-recursive): Delete unused target.
5205 ($(TESTSUITE)): Atomically update testsuite.
5206 (CD_TESTDIR): Simplify.
5207 (m4__cd): Delete unused macro.
5208 (check-local): Let TESTSUITEFLAGS influence the run.
5209 (installcheck-local): Let TESTSUITEFLAGS override
5210 AUTOTEST_PATH. Add dependencies.
5211 (clean-local): Clean up.
5212 (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
5213 * README: Document how to use the testsuite.
5215 2006-06-15 Eric Blake <ebb9@byu.net>
5217 * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
5219 * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
5220 clashes with m4sugar.
5221 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
5222 * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
5223 * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
5224 * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
5225 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
5226 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
5227 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
5228 * configure.ac: Likewise.
5229 (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
5230 * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
5232 * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
5234 Reduce compiler warnings. Inside GMP, mpq_t is an array type, so
5235 const mpq_t is not assignable from plain mpq_t. Avoid
5236 type-punning warnings caused trying to mix these types.
5237 * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
5238 (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
5239 * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
5240 (mult_term, exp_term): Remove type-punning casts.
5241 (numb_pow): Remove const qualifier.
5242 * src/freeze.c (reload_frozen_state): Fix typo in messages.
5243 Fix variables that can be used uninitialized, which fixes
5244 security hole where malicious frozen file can execute arbitrary
5247 2006-06-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5249 * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
5251 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5252 and Eric Blake <ebb9@byu.net>
5254 Allow `make dist' to work again.
5255 * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
5256 (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
5257 (cvs-dist): Fix typo.
5258 * NEWS: Match current version number.
5260 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5262 * Makefile.am (AM_CPPFLAGS): Add $(LTDLINCL), so the right
5265 * bootstrap: Do not run libtoolize manually, this is done
5266 correctly by autoreconf. Invoke autoreconf with --no-recursive
5267 to avoid unnecessary rerunning of autotools for libltdl.
5269 2006-06-13 Eric Blake <ebb9@byu.net>
5273 2006-06-12 Eric Blake <ebb9@byu.net>
5275 * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
5277 * src/m4.h: Don't declare mktemp.
5278 * m4/input.c (m4__next_token): Avoid bzero.
5279 * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
5280 * Makefile.am (doc/m4.1): Depend on installed help2man, rather
5281 than distributing outdated helptoman.pl.
5282 * doc/helptoman.pl: Delete.
5284 2006-06-10 Eric Blake <ebb9@byu.net>
5286 * README (Patches): Document the current dependence on CVS
5287 builds of autotools.
5288 * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
5289 * configure.ac: Use consistent quoting throughout.
5290 (AC_PREREQ): Bump to 2.59d.
5291 (AC_INIT): Package name begins with uppercase.
5292 (AC_ARG_WITH): Use AS_HELP_STRING.
5293 (AM_INIT_AUTOMAKE): Enable gnits mode.
5294 (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
5295 (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
5296 (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
5297 done by gnulib or automake, or which autoconf has declared
5299 * m4/m4private.h (Includes): Assume C89 or better, and use errno
5301 * m4/output.c (Includes): Likewise.
5302 * modules/gnu.c (Includes): Likewise.
5303 * modules/m4.c (Includes): Likewise.
5304 * src/m4.h (Includes): Likewise.
5306 * README-alpha: Update web address.
5307 * README: Likewise. Change encoding to ASCII. Remove old advice
5308 about cygwin. Document bootstrapping dependency.
5309 * AUTHORS: Update from branch-1_4.
5310 * THANKS: Likewise. Change encoding to UTF-8.
5311 * BACKLOG: Delete. This file is too old and unmaintained to be
5313 * ChangeLog: Change encoding to UTF-8.
5315 Avoid compiler warnings.
5316 * m4/macro.c (trace_format): Don't mark this as a printf format,
5317 since we don't accept the same set of modifiers as printf. It
5318 would be nice if gcc let us specify a custom format archetype.
5319 * src/main.c (main): Cast away const.
5321 2006-06-10 Andreas Schwab <schwab@suse.de> (tiny change)
5322 Eric Blake <ebb9@byu.net>
5324 * modules/time.c (ctime): Pass correctly typed variable to
5327 (localtime): Likewise.
5328 (strftime): Likewise.
5329 * m4/utility.c (m4_numeric_arg): For now, document arbitrary
5330 limit inherent in this interface.
5332 2006-05-08 Bruno Haible <bruno@clisp.org> (tiny change)
5334 * modules/m4.c (WEXITSTATUS): Provide fallback definition.
5335 (sysval): Use WEXITSTATUS.
5336 * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
5337 big-endian and little-endian wait status definitions.
5339 2006-05-06 Eric Blake <ebb9@byu.net>
5341 * po/Makevars (MSGID_BUGS_ADDRESS): Add.
5342 * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
5345 2006-05-06 Eric Blake <ebb9@byu.net>
5347 * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
5348 subdirectory to use.
5349 (support for -pipe): Move after LT_INIT, since it relies on
5352 2006-05-05 Eric Blake <ebb9@byu.net>
5354 * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
5358 2006-05-05 Bruno Haible <bruno@clisp.org>
5359 and Eric Blake <ebb9@byu.net>
5361 * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
5362 * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
5364 * bootstrap: Update usage of gnulib-tool.
5366 2006-05-04 Eric Blake <ebb9@byu.net>
5368 * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
5371 2005-12-05 Gary V. Vaughan <gary@gnu.org>
5373 * bootstrap (func_update_po): Synch with CVS GNU tar. wget 1.9.x
5374 and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
5375 Reported by Eric Blake <ebb9@byu.net>
5377 2005-12-04 Gary V. Vaughan <gary@gnu.org>
5379 * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
5380 http caching as -C is no longer supported by wget 1.10.x.
5381 Reported by Eric Blake <ebb9@byu.net>
5383 2005-10-20 Gary V. Vaughan <gary@gnu.org>
5385 * m4/module.c (caller_id): To match libtool-2.0 interface, changed
5387 (iface_id): ...an lt_dlinterface_id type.
5388 (m4__module_find): New abstraction for lt_dlhandle_fetch. Use
5389 throughout, instead of calling obsolete lt_dlhandle_find directly.
5390 (m4__module_next): Use multiloader-safe lt_dlhandle_iterate. Use
5391 throughout, instead of calling obsolete lt_dlhandle_next.
5392 * m4/m4private.h (m4__module_find): Declare it.
5393 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
5394 Use m4__module_next instead of obsolete lt_dlhandle_next.
5396 2005-10-20 Gary V. Vaughan <gary@gnu.org>
5398 * bootstrap (func_update_po): Update pofiles directly from the
5399 translation project.
5400 * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
5401 po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
5402 these files under source control anymore.
5403 Suggested by Eric Blake <ebb9@byu.net>
5405 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
5407 * ltdl/m4/m4-gnulib.m4: Update FSF contact address. Somehow this
5408 file escaped the address updates on 2005-05-01.
5410 2005-07-07 Gary V. Vaughan <gary@gnu.org>
5412 * bootstrap: Allow user overriding of gnulib-tool location, and
5413 correctly determine module source directories whether gnulib-tool
5414 is given as a relative or absolute path, or is found by searching
5416 Reported by Eric Blake <ebb9@byu.net>
5418 2005-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5420 * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
5421 and $RM are defined for various versions of
5422 AC_LIBTOOL_COMPILER_OPTION.
5424 * bootstrap (AUTORECONF): New variable to allow user overriding of
5427 2005-07-07 Gary V. Vaughan <gary@gnu.org>
5429 * doc/m4.texinfo (History): Add better notes on the ancestory of
5430 GNU m4, and other historical interest.
5432 2005-05-08 Gary V. Vaughan <gary@gnu.org>
5434 * m4/symtab.c (m4_symbol_rename): New function that performs a low
5435 level symbol rename.
5436 * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
5437 * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
5438 (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
5440 (erenamesyms, renamesyms): ...builtins that use these to implement
5441 macro renaming by regular expression.
5442 * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
5443 * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
5444 to stop the new generated tests from choking.
5446 2005-05-07 Gary V. Vaughan <gary@gnu.org>
5448 Since most of the build is handled from a single Makefile.am now,
5449 we can teach make about the dependencies between the m4 binary and
5450 the preopened modules it is built against:
5452 * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
5454 * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
5455 of the preopened modules have changed.
5457 2005-05-07 Gary V. Vaughan <gary@gnu.org>
5459 * configure.ac (gl_MODULES): Add mkstemp for machines that don't
5460 have a native implementation.
5462 2005-05-06 Gary V. Vaughan <gary@gnu.org>
5464 * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed. These are
5465 handled already by gnu/exit.h.
5467 * configure.ac (gl_MODULES): Add assert to support a
5468 --disable-assert configure time option for NDEBUG setting.
5470 * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
5471 * bootstrap (src_modules): Add version-etc-fsf.
5472 * src/main.c (version_etc_copyright): Removed.
5474 * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
5476 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5478 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
5480 * src/freeze.c (produce_frozen_state): Use \n line-endings even
5481 on Windows, so that the frozen file reader will work.
5482 Reported by Josef T. Burger <bolo@bolo.com>
5484 2005-05-04 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
5486 Forward port of a patch that allowed m4-1.4.2 to compile on
5489 * configure.ac (AC_CHECK_HEADERS): Add signal.h,
5491 * src/m4.h: And include them as appropriate.
5492 * src/main.c, src/stackovf.h: Don't include signal.h literally;
5493 m4.h will include the correct file.
5495 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5497 * m4/m4private.h: Make errno visible for the sources patched
5500 2005-05-04 Paul Eggert <eggert@twinsun.com>
5502 * src/main.c (print_program_name_CB): Preserve errno, since
5503 M4ERROR relies on this.
5504 * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
5505 * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
5506 * m4/path.c (m4_path_search): Don't let "free" trash errno when
5509 * m4/output.c (m4_insert_file): Don't assume errno has a valid
5510 value simply because fread returns zero. This fixes a
5511 portability bug reported by Marion Hakanson in
5512 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
5514 2005-05-04 Santiago Vila <sanvila@debian.org>
5516 * tests/stackovf.test: Use tempfile if available.
5518 2005-05-04 Robert Bihlmeyer <robbe@orcus.priv.at> (tiny change)
5520 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
5521 * m4/output.c (m4_insert_file): Do not mix buffered and
5522 unbuffered I/O, as this breaks on the Hurd.
5524 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5526 Gnulib has changed again. Reimport. Adjust. Rinse. Repeat.
5527 Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
5528 and libtoolize does a better job of ltdl importing now too, so
5529 take advantage of that while updating the tree:
5531 * acm4, config: Moved from here...
5532 * ltdl/m4, ltdl/config: ...to here.
5533 * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
5534 src/Makefile.am, tests/Makefile.am: Removed...
5535 * Makefile.am: ...and migrated to here, with adjustments to
5536 compensate for relative path differences.
5537 * commit: Adjust relative paths.
5538 * configure.ac: Adjust relative paths.
5539 (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
5541 (LT_PREREQ): 2.0 isn't released yet, but will work when it is! In
5542 the meanwhile, CVS HEAD libtool is needed.
5543 (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
5544 stricly new enough, we also need a patch.
5545 (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
5546 (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
5547 (gl_MODULES): Don't list getopt and version-etc, as they don't
5549 * bootstrap: After running gnulib-tool to import the listed
5550 modules, fetch getopt and version-etc into src manually.
5551 (ltdldir): Change to ltdl.
5552 * src/main.c: Adjust for changes in version-etc API.
5553 * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
5554 but works when the getopt module isn't to be included in the lib.
5555 * README: Add note about patching autoconf and automake to
5558 2005-05-02 Matt Kraai <kraai@debian.org> (tiny change)
5560 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
5561 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
5562 empty file rather than to a nonexistent file. This closes a
5563 common security hole.
5564 * modules/m4.c (m4_maketemp): Implement the above, by using
5565 mkstemp rather than mktemp.
5567 2005-05-01 Gary V. Vaughan <gary@gnu.org>
5569 The FSF are moving offices today. Changed their contact address
5570 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
5571 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
5573 2005-03-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5575 * tests/Makefile (clean-local): Ignore testsuite cleanup
5578 2005-03-11 Per Bothner <per@bothner.com> (tiny change)
5580 * tests/Makefile (clean-local): Only run the testsuite cleanup
5581 if the testsuite has been generated.
5583 2005-02-11 Stepan Kasal <kasal@ucw.cz>
5585 * TODO: slight clarification of the example of qindir usage.
5587 2005-02-08 Gary V. Vaughan <gary@gnu.org>
5589 * TODO: Add qindir requirement, and defn bug.
5590 From Stepan Kasal <kasal@ucw.cz>
5592 2005-02-08 Stepan Kasal <kasal@ucw.cz>
5594 * TODO: Add ``execution stack'', fix a typo.
5595 * doc/m4.texinfo: Typos.
5597 2004-12-24 Eric Blake <ebb9@byu.net>
5599 * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
5600 to the gnu subdirectory.
5601 * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
5602 * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
5603 * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
5604 * m4/system_.h: Likewise, in non-configured includes.
5606 2004-10-14 Noah Misch <noah@cs.caltech.edu>,
5607 Gary V. Vaughan <gary@gnu.org>
5609 * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
5610 Protect definitions from macro expansion under -DNDEBUG by
5611 parenthesising the expanded function names.
5612 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
5613 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
5614 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
5615 (m4_is_syntax_macro_escaped): Similarly protect function
5616 definitions from macro expansion under -DNDEBUG by #undefing the
5617 matching macro names before each definition. Also, move all the
5618 function definitions to the end of the file so that any
5619 invocations in the rest of the file pick up the fast macro
5621 * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
5622 (m4_set_debug_file, m4_set_trace_messages)
5623 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
5624 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
5625 (m4_set_max_debug_arg_length_opt): New fast macro versions of the
5626 option setter functions.
5628 2004-09-23 Gary V. Vaughan <gary@gnu.org>
5630 * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
5633 2004-09-23 Gary V. Vaughan <gary@gnu.org>
5635 * src/main.c: Include gnulib files from the correct directory.
5637 * gnulib/*: Don't store any of the gnulib files in arch, as they
5638 generate spurious changes.
5639 * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
5640 gnulib macros now share our macro directory.
5641 (SUBDIRS): Descend into `gnu' rather than `gnulib'.
5642 * bootstrap: Call gnulib-tool to import from the gnulib tree.
5643 (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
5644 gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
5645 the gettext macros from autopoint that overwrite the gnulib-tool
5646 imported versions. Import sources and Makefile.am into the `gnu'
5647 directory. Changed all callers.
5648 * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
5649 gl_INIT): Call these gnulib-tool macros instead of the hardcoded
5650 for imported modules.
5651 * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
5652 acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
5653 hardcoding the gnulib macros they wrap.
5655 2004-07-15 Gary V. Vaughan <gary@gnu.org>
5657 Latest CVS libtool can preload modules in libraries, including
5658 its own module loaders! Tweak m4 so that it doesn't try to treat
5659 libltdl's module loaders as m4 modules when freezing and on exit:
5661 * gnulib/acm4/*.m4: Don't store these files in arch since they
5662 generate spurious changes.
5663 * bootstrap: Simplify initial libtoolize call, since CVS
5664 libtoolize is smarter these days.
5665 * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
5667 * m4/module.h (m4__module_exit): Missing declaration.
5668 * m4/m4private.h (m4__module_next): New function declaration.
5669 * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
5670 encapsulation. Changed all callers.
5671 (m4__module_interface): New function to verify m4 loadable module
5673 (m4__module_init): Register the interface validator.
5674 (m4__module_exit): Only close my own modules.
5675 * modules/m4.c (unistd.h): Provide missing declaration.
5676 (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
5677 (m4_expand_ranges): More missing declarations.
5678 * modules/modtest.c (export_test): Ditto.
5679 * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
5680 * src/main.c (main): Bump copyright year.
5681 * tests/modules.at: Fix sed syntax error.
5684 2004-06-17 Gary V. Vaughan <gary@gnu.org>
5686 Tweaking to enable compilation with latest CVS libtool and
5687 libltdl. We can't just dump the library files directly into the
5688 m4 directory anymore now that libltdl is built from pieces itself:
5690 * bootstrap: Rewritten to use latest libtoolize sanely, and to
5691 set up libltdl subdirectory.
5692 * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
5693 gnulib subdirectory's config.
5694 (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
5695 (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
5697 (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
5698 configure.ac, so use AC_WITH_LTDL instead.
5699 * Makefile.am (SUBDIRS): Add libltdl.
5700 * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated. gnulib now uses
5702 * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
5703 (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
5704 (libm4_la_LIBADD): Add LIBLTDL.
5705 * m4/ltdl.c, m4/ltdl.h: Removed.
5706 * m4/m4module.h: Include canonical ltdl.h.
5709 2004-06-14 Gary V. Vaughan <gary@gnu.org>
5711 * gnulib/import: Now updates makefile fragments, and configure.ac.
5712 * gnulib/m4/gnulib.am: New file. Generated makefile fragments.
5713 * gnulib/m4/Makefile.am: include it.
5714 * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
5715 gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
5716 gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
5717 gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
5718 gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
5719 * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
5720 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
5721 gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
5722 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
5723 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
5724 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
5725 gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
5726 gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
5728 * gnulib/m4/getopt_int.h: New source file from latest gnulib
5730 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
5731 gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
5732 gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
5733 gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
5734 Updated source files from latest gnulib.
5736 2004-02-29 Gary V. Vaughan <gary@gnu.org>
5738 * config/mailnotify: New file for mailing commit notifications,
5739 imported from cvs-utils.
5740 * commit: Updated from cvs-utils and tweaked for m4.
5742 2003-12-01 Gary V. Vaughan <gary@gnu.org>
5744 * config/mkstamp: Updated from CVS libtool.
5745 * configure.ac: Generate a gnu coding standards compliant version
5746 number, and use it for the banner.
5747 * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
5748 mhen the TIMESTAMP changes in ChangeLog, but the file modification
5749 time doesn't (e.g. in cvs commit). Otherwise dist tarballs will
5750 contain the previous version number.
5751 * src/main.c: Make --version output conform to the GNU standard.
5753 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
5754 * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
5755 m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
5756 shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
5757 time_la_SOURCES): ...so that these are defaulted correctly, and
5758 can be removed from this file.
5759 (AM_LDFLAGS): Add -module...
5760 (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
5761 traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
5762 import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
5763 the individual settings can be removed.
5764 * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
5765 * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
5766 m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
5767 shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
5768 time_la_LIBADD): ...so that these are picked up as a deplib of
5769 libm4 and don't need to be set explicitly.
5771 2003-11-18 Gary V. Vaughan <gary@gnu.org>
5773 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
5774 from the standard build. It is too fragile.
5776 * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
5777 CVS libtool after merging m4 changes across to libtool.
5779 * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
5780 * m4/path.c (search_path_add): Ditto.
5782 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5784 * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
5785 libtool tags we don't use in configure. This reduces the size
5786 of the script from over 1Mb to under 700Kb.
5788 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5790 The import script was not written properly, and the last gnulib
5791 import was incomplete. Fixed that problem, and reimport our
5792 gnulib dependencies, which picks up the address calculation
5793 overflow checks described by Paul below. Also tweak the clients
5794 of the gnulib xalloc module not to use deprecated macros:
5796 * gnulib/import: Recurse through module dependencies rather than
5797 naively descending only one level.
5798 * configure.ac: Add calls to gnulib's strnlen and extension module
5800 * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
5802 * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
5803 gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
5804 gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
5805 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
5807 * gnulib/acm4/libtool.m4: Updated from CVS libtool.
5808 * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
5809 place of `xcalloc (1, S)'.
5810 * m4/m4.c (m4_create): Likewise.
5811 * m4/m4private.h (m4_symbol_value_create): Likewise.
5812 * m4/symtab.c (symtab_fetch): Likewise.
5813 * m4/syntax.c (m4_syntax_create): Likewise.
5814 * src/freeze.c (reload_frozen_state): Likewise.
5815 * m4/path.c (search_path_add): Eliminate use of deprecated NEW
5817 * m4/symtab.c (m4_symtab_create): Likewise.
5819 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5821 * tests/module.at: Comment typo.
5823 2003-10-10 Gary V. Vaughan <gary@gnu.org>
5825 * tests/modules.at (modules: importing): Apply some lateral
5826 thinking, and use AT_CHECK to compare the output of a sed pass
5827 over stderr against the canonical strerror string.
5829 * tests/modules.at (modules: importing): Edit the generated stderr
5830 output to canonicalize strerror output, before a comparison.
5832 2003-10-10 Gary V. Vaughan <gary@gnu.org>
5834 Tru64UNIX perl is sloppy with namespace pollution. This patch is
5835 careful not to trip over the mess:
5837 * modules/perl.c: Some builds of perl install headers that contain
5838 `#define try __builtin_try'. Be sure to undefine that macro
5839 before `m4/hash.h' gets included, which uses the `try' symbol.
5840 * m4/system_.h: Similarly for `bool'. Undefine `bool', `true' and
5841 `false' before including `stdbool.h'.
5842 (DELETE): This symbol is not in m4's namespace, and is in any
5843 case only used internally...
5844 * m4/m4private.h (DELETE): ...so move it to here.
5845 Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
5847 2003-10-08 Paul Eggert <eggert@twinsun.com>
5849 Don't use XMALLOC and XCALLOC. Once we install the
5850 corresponding patch into gnulib, this will fix some
5851 address-calculation overflow bugs on hosts where calloc (A, B)
5852 returns garbage when A*B overflows.
5854 * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
5855 maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
5856 xmalloc, XCALLOC with xcalloc.
5857 * m4/m4.c (m4_create): Likewise.
5858 * m4/m4private.h (m4_symbol_value_create): Likewise.
5859 * m4/output.c (m4_output_init): Likewise.
5860 * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
5861 * m4/syntax.c (remove_syntax_attribute): Likewise.
5862 * src/freeze.c (reload_frozen_state): Likewise.
5863 * src/main.c (main): Likewise.
5865 2003-10-07 Gary V. Vaughan <gary@gnu.org>
5867 * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
5868 gnulib/acm4 directories for aclocal m4 macros.
5869 * gnulib/Makefile.am (EXTRA_DIST): Removed.
5870 (MAINTAINERCLEANFILES): Add Makefile.in.
5871 * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
5873 * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
5874 * gnulib/import: New file. Temporary script for updating gnulib
5875 imported files, until gnulib-tool is working.
5876 * gnulib/config/codeset.m4, gnulib/config/error.m4,
5877 gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
5878 gnulib/config/getopt.m4, gnulib/config/gettext.m4,
5879 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
5880 gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
5881 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
5882 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
5883 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
5884 gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
5885 gnulib/config/nls.m4, gnulib/config/obstack.m4,
5886 gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
5887 gnulib/config/progtest.m4, gnulib/config/realloc.m4,
5888 gnulib/config/regex.m4, gnulib/config/restrict.m4.
5889 gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
5890 gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
5891 gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
5892 gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
5893 gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
5894 gnulib/config/xstrndup.m4: Removed.
5895 * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
5896 gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
5897 gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
5898 gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
5899 gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
5900 gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
5901 gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
5902 gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
5903 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
5904 gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
5905 gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
5906 gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
5907 gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
5908 gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
5909 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
5910 gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
5911 gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
5912 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
5913 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
5914 gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
5915 gnulib/import script.
5916 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
5917 gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
5918 gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
5919 gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
5920 gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
5921 gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
5922 gnulib with gnulib/import script.
5923 * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
5924 guards ready for gnulib-tool to autoupdate on import.
5925 * config/debug.m4, config/gmp.m4, config/m4-error.m4,
5926 config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
5927 config/stackovf.m4: Moved from here...
5928 * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
5929 acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
5930 acm4/stackovf.m4: ...to here, to separate aclocal macros from
5931 configure time helper scripts.
5932 * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
5933 * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
5934 m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
5935 src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
5937 * src/main.c (version_etc_copyright): Only output the current
5939 (version_etc): Call with new variadic API.
5941 2003-09-16 Gary V. Vaughan <gary@gnu.org>
5943 * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
5944 version-etc module from CVS gnulib.
5945 * po/POTFILES.in: Add gnulib/m4/version-etc.c.
5946 * src/Makefile.am: Build it.
5947 * src/main.c: Use it.
5949 * gnulib/m4/exit.h: Import exit module from CVS gnulib.
5950 * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
5951 * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
5954 2003-09-15 Charles Wilson <cygwin@cwilson.fastmail.fm>,
5955 Gary V. Vaughan <gary@gnu.org>
5957 * bootstrap: Separate options.
5958 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
5959 * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
5961 * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
5962 (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
5963 (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
5964 (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
5965 $(LTLIBINTL) for gettext support on cygwin.
5966 * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
5967 have $(LTLIBINTL) from the preloaded module la files.
5968 * README: Remove the warning about using --disable-nls on Windows
5971 2003-09-15 Gary V. Vaughan <gary@gnu.org>
5973 * gnulib/m4/regex.c: s/<regex.h>/"regex.h"/ or else the compiler
5974 picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
5977 2003-09-12 Gary V. Vaughan <gary@gnu.org>
5979 * doc/STYLE: Document the gnulib header naming conventions, and
5981 * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
5982 gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
5983 gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
5985 * gnulib/m4/Makefile.am: Remove the rules to build these headers.
5987 * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
5988 module from CVS gnulib.
5989 * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
5990 (gl_FUNC_STRTOL): In favour of the module macro.
5992 2003-09-12 Gary V. Vaughan <gary@gnu.org>
5994 Replace the getopt code with CVS gnulib getopt. The source files
5995 detect whether they are in a glibc environment and preprocess away
5996 all of the code if there is a system getopt, so we can compile
5997 them into the m4 executable unconditionally:
5999 * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
6000 gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
6001 * configure.ac (gl_GETOPT): Use this instead of homebrew inline
6003 * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
6005 * src/Makefile.am: Adjust.
6006 * src/main.c: Always include our shipped getopt.h.
6007 * po/POTFILES.in: Use new location of getopt.c.
6009 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6011 * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
6012 * config/Makefile.am: Removed. Automake 1.8 distributes the files
6013 in this directory automatically.
6014 * Makefile.am (EXTRA_DIST): Except config/mkstamp.
6016 * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
6018 * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
6020 * modules/Makefile.am (pkglibexecdir): Set it here.
6021 (pkgmodincdir): Renamed to pkgmodincludedir). Changed all clients.
6023 * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
6024 Import regex module from CVS gnulib.
6025 * gnulib/config/restrict.m4: Ditto for dependee module restrict.
6026 * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
6027 do extra substitutions for Makefile.
6028 * configure.ac: Use it.
6029 * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
6030 from regex_.h if necessary.
6031 * m4/system_.h: Include the correct version of regex.h.
6032 * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
6034 * po/POTFILES.in: Use new location of regex.c.
6036 * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
6037 realloc.c: automake distributes these files already.
6039 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6041 Replace the xstrzdup code by importing the xstrndup module from
6042 CVS gnulib, along with its dependencies: strndup and strnlen:
6044 * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
6045 gnulib/config/xstrndup.m4: Import xstrndup module from CVS
6047 * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
6048 gnulib/config/strndup.m4: Ditto wrt strndup.
6049 * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
6051 * gnulib/m4/Makefile.am: Add rules from newly imported modules.
6052 However, contrary to gnulib, we install xstrndup.h.
6053 * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
6054 * gnulib/lib/xstrzdup.c: Delete. This was never a gnulib file, it
6055 is an artifact of the old m4 portability layer.
6056 * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
6057 * m4/system_.h: Include xstrndup.h.
6058 * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
6060 2003-09-11 Gary V. Vaughan <gary@gnu.org>
6062 Reimport the latest xalloc module from CVS gnulib, and adjust the
6063 m4 sources to take advantage of xalloc xfree. Also create a new
6064 macro DELETE with the same semantics as the old m4 XFREE macro,
6065 and carefully tweak callers:
6067 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
6069 * m4/utility.c (xfree): Removed. This function is now supplied by
6071 * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
6072 * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
6073 * m4/symtab.c (m4_symtab_create): Ditto.
6074 * m4/system_.h: Removed XFREE redefine.
6075 (DELETE): New macro with same functionality as the original m4
6076 XFREE macro, but based on xalloc.h now. Changed all callers.
6077 * src/main.c (main): Use XMALLOC macro.
6078 * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
6080 * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
6082 2003-09-10 Gary V. Vaughan <gary@gnu.org>
6084 Import the xalloc module from CVS gnulib, along with its
6085 dependencies: exitfail, malloc and realloc. We had different
6086 semantics for our XFREE and a function xfree() not supplied by
6087 gnulib, so also a bit of work to keep everything running
6090 * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
6091 (gl_XALLOC): Use gnulib equivalents.
6092 * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
6093 gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
6094 * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
6095 * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
6097 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
6098 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
6099 * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
6101 (pkgincdir): Removed. Use pkgincludedir instead.
6102 * m4/m4private.h (XFREE): xfree already checks for NULL.
6103 * m4/system_.h: Use xalloc module, and remove macros already
6104 supplied by xalloc.h.
6105 * m4/utility.c (xfree): xalloc does not yet implement xfree, so
6106 moved the old definition from m4/xmalloc.c to here for now.
6108 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6110 Import the error and progname modules from CVS gnulib. Our old
6111 error.c subsumed the functionality of both, so a little adjustment
6112 was required to accomodate the split in sources. Also added more
6113 wrapper macros to choose between a system installed error.h or our
6114 shipped gnulib error module:
6116 * m4/error.c, m4/error.h: Removed.
6117 * m4/Makefile.am: Adjust.
6118 (pkgincdir): Removed. Use pkgincludedir instead.
6119 * m4/module.h, src/main.c: Don't include `m4/error.h'.
6120 * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
6122 * gnulib/m4/progname.c: Imported from CVS gnulib.
6123 * gnulib/m4/progname.h: Ditto.
6124 * src/main.c: Adjust to use progname module.
6125 * gnulib/m4/error.c: Imported from CVS gnulib.
6126 * gnulib/m4/error_.h: Ditto.
6127 * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
6128 if appropriate, and link a local error.h if the system version is
6130 (libgnu_la_SOURCES) Add progname module sources.
6131 * gnulib/config/error.m4: Imported from CVS gnulib.
6132 * gnulib/config/strerror_r.m4: Ditto.
6133 * config/m4-error.c: New file. Wrap gnulib error.m4 but arrange
6134 to have ERROR_H for Makefile substitutions and tell system.h
6135 whether the system error.h should be used, or a locally installed
6137 * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
6139 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6141 * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
6142 s/gettext_.h/gettext.h/.
6144 * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
6145 automake have been fixed.
6147 * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
6148 gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
6149 of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
6150 rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
6152 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6154 The gnulib obstack module requires the gnulib gettext module for
6155 systems that do not have GNU gettext installed. Because we use
6156 -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
6157 that directory incase it clashes with the system gettext.h. This
6158 delta uses gettext_.h and extra rules in the Makefile to make a
6159 link to gettext.h when needed:
6161 * Makefile.am (auxdir): Removed. No longer used.
6162 * configure.ac (ac_aux_dir): Removed AC_SUBST. No longer used.
6163 (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
6165 (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
6166 Makefile based build.
6167 (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
6168 of the macros are kept.
6169 * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
6170 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
6171 * config/Makefile (ACLOCAL_MACROS): Removed. Automake 1.7a
6172 distributes these automatically.
6173 * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
6174 warning from automake-1.7a.
6175 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
6176 m4_CHECK_DEBUGGING for consistency with gnulib prefixes. Changed
6178 * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
6179 wrt. m4_FUNC_OBSTACK.
6180 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
6181 wrt. m4_sys_STACKOVF.
6182 * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
6183 wrt. _m4_LIB_GMP, m4_LIB_GMP.
6184 (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
6185 namespace. Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
6187 * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
6188 * gnulib/m4/Makefile.am: Added a new block to make an appropriate
6189 gettext.h link on deficient systems.
6190 (pkginc_HEADERS): Mention $(GETTEXT_H).
6191 (EXTRA_HEADERS): Mention gettext.h.
6192 * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
6193 * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
6194 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
6195 gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
6196 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
6197 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
6198 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
6199 gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
6200 gnulib/config/po.m4, gnulib/config/progtest.m4,
6201 gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
6202 gnulib/config/ulonglong.m4: Imported from CVS gnulib.
6204 2003-09-05 Gary V. Vaughan <gary@gnu.org>
6206 We can't mirror the gnulib directory structure here, since we need
6207 to be able to eg. `#include <m4/obstack.h>' from our source files,
6208 which is much easier if the local obstack.h is created in a
6209 directory named m4. Rather than trying to symlink everything into
6210 the m4 directory, now we build a libtool convenience library from
6211 the sources we get from gnulib and link that with libm4.la:
6213 * gnulib/config/extensions.m4: Imported from CVS gnulib.
6214 * gnulib/config/unlocked-io.m4: Ditto.
6215 * gnulib/m4/unlocked-io.h: Ditto.
6216 * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
6217 gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
6218 * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
6219 gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
6220 * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
6221 * m4/Makefile.am: Adjust.
6222 * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
6223 macros we redistribute.
6224 * gnulib/m4/Makefile.am: New file. Build libgnu.la convenience
6225 library among others.
6226 (GNULIB_SRCS, GNULIB_MACROS): Removed.
6227 * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
6228 * config/m4-obstack.m4: Adjust.
6229 * po/POTFILES.in: Adjust.
6230 * configure.ac: Reformatting. Call newly imported gnulib macros.
6231 * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
6232 bogus calls of `#include "m4.h"'.
6233 * Makefile.am: INCLUDES has been deprecated in favour of
6235 * m4/Makefile.am: Ditto.
6236 * modules/Makefile.am: Ditto.
6237 * src/Makefile.am: Ditto.
6239 2003-09-05 Gary V. Vaughan <gary@gnu.org>
6241 * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
6243 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6245 Migrate the obstack support into the gnulib directories for easy
6246 synchronisation with upstream files in gnulib:
6248 * config/gnu-obstack.m4: Moved from here...
6249 * config/m4-obstack.m4: ...to here.
6250 * config/Makefile.am (SPECIFIC_MACROS): Adjust.
6251 * m4/obstack.c, m4/obstack_.h: Moved from here...
6252 * gnulib/obstack.c, gnulib/obstack.h: ...to here.
6253 * po/POTFILES.in: Adjust.
6254 * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
6255 * m4/Makefile.am: Add a whole new section to link the obstack
6256 sources from the gnulib tree if necessary.
6257 * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
6259 * config/m4-obstack.m4: Rewrite as a wrapper for
6260 gnulib/m4/obstack.m4.
6262 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6264 GNU M4 currently builds with a number of files adapted from
6265 upstream sources. Recently the gnulib project on savannah.gnu.org
6266 has pulled together a great many of these externally maintained
6267 files. This delta is the beginnings of isolating those files
6268 maintained in gnulib to make it easy to synchronise M4 with the
6269 upstream files prior to releases.
6271 * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
6273 (SUBDIRS): Added new gnulib subdirectory.
6274 * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
6275 * config/stdbool.m4: Moved from here...
6276 * gnulib/m4/stdbool.m4: ...to here.
6277 * m4/stdbool_.h: Moved from here...
6278 * gnulib/lib/stdbool_.h: ...to here.
6279 * gnulib/Makefile.am: New file. Make sure the gnulib tree is
6281 * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
6282 code to work with new stdbool_.h location.
6283 (gnulib_srcdir): New.
6285 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6287 * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
6288 (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
6290 (SPECIFIC_TOOLS): New variable. Moved mkstamp to here.
6291 (EXTRA_DIST): Use it.
6293 * bootstrap: CVS autoreconf leaves file droppings. Remove
6294 aclocal.m4t incase autoreconf doesn't.
6296 2003-08-29 Gary V. Vaughan <gary@gnu.org>
6298 * m4/gnu-obstack.h: Updated from CVS gnulib. For consistency with
6299 the other gnulib imports, renamed to m4/obstack_.h.
6300 * m4/obstack.c: Updated from CVS gnulib.
6301 * m4/Makefile.am (EXTRA_HEADERS): Adjust.
6302 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
6303 header tests from gnulib obstack module. AC_CONFIG_LINKS knows
6304 about vpath already, and $top_srcdir upsets CVS Automake, so the
6305 $top_srcdir reference was removed.
6307 * m4/system-h.in: For consistency with the gnulib imports, renamed
6309 * m4/Makefile (EXTRA_HEADERS): Adjust.
6310 * configure.ac (AC_CONFIG_FILES): Adjust.
6312 * m4/stdbool_.h: New file from gnulib for systems without their
6314 * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
6315 * config/stdbool.m4: New file. Macros from gnulib for same.
6316 * configure.ac: Use it.
6318 2003-08-27 Gary V. Vaughan <gary@gnu.org>
6320 * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
6321 * config/gmp.m4: Ditto.
6322 * config/gnu-obstack.m4: Ditto.
6323 * config/stackovf.m4: Ditto.
6324 * m4/builtin.c: Ditto.
6325 * m4/debug.c: Ditto.
6326 * m4/error.c: Ditto.
6327 * m4/error.h: Ditto.
6328 * m4/gnu-obstack.h: Ditto.
6331 * m4/input.c: Ditto.
6333 * m4/m4module.h: Ditto.
6334 * m4/m4private.h: Ditto.
6335 * m4/macro.c: Ditto.
6336 * m4/module.c: Ditto.
6337 * m4/obstack.c: Ditto.
6338 * m4/output.c: Ditto.
6340 * m4/regex.c: Ditto.
6341 * m4/regex.h: Ditto.
6342 * m4/strtol.c: Ditto.
6343 * m4/symtab.c: Ditto.
6344 * m4/syntax.c: Ditto.
6345 * m4/utility.c: Ditto.
6346 * m4/xmalloc.c: Ditto.
6347 * m4/xstrdup.c: Ditto.
6348 * m4/xstrzdup.c: Ditto.
6349 * modules/evalparse.c: Ditto.
6350 * modules/format.c: Ditto.
6351 * modules/gnu.c: Ditto.
6352 * modules/import.c: Ditto.
6353 * modules/load.c: Ditto.
6354 * modules/m4.c: Ditto.
6355 * modules/m4.h: Ditto.
6356 * modules/modtest.c: Ditto.
6357 * modules/mpeval.c: Ditto.
6358 * modules/perl.c: Ditto.
6359 * modules/shadow.c: Ditto.
6360 * modules/stdlib.c: Ditto.
6361 * modules/time.c: Ditto.
6362 * modules/traditional.c: Ditto.
6363 * src/freeze.c: Ditto.
6364 * src/getopt.c: Ditto.
6365 * src/getopt1.c: Ditto.
6367 * src/main.c: Ditto.
6368 * src/stackovf.c: Ditto.
6370 * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
6371 ac_default_headers is an autoconf internal variable.
6372 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
6373 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6375 * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
6376 * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
6379 2003-08-15 Gary V. Vaughan <gary@gnu.org>
6381 * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
6383 * system-h.in (m4_boolean): Removed in favour of using C99 bool if
6384 possible or faking one with a typedef. Changed all callers.
6386 2003-08-15 Gary V. Vaughan <gary@gnu.org>
6388 Still cleaning up the users' module API, by taking out the stuff
6389 that isn't used by any existing modules, and moving specialised
6390 functions out of libm4 and into the module they are used by.
6392 * m4/m4module.h (m4_skip_space): No need to export this. Moved...
6393 * m4/utility.c (m4_skip_space): ...to here the home of its only
6394 use, made static and renamed to `skip_space'. Changed all
6396 * m4/m4module.h (m4_expand_ranges): Removed prototype.
6397 * m4/utility.c (m4_expand_ranges): Moved definition from here...
6398 * modules/m4.c (m4_expand_ranges): ...to here, and exported using
6400 * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
6402 * modules/gnu.c (builtin_syntax): Import and use in this
6403 builtin implementation.
6404 * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
6406 * m4/macro.c (trace_flush): Except here where the macro is now
6408 * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6409 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
6411 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6412 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
6414 2003-08-14 Gary V. Vaughan <gary@gnu.org>
6416 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
6417 compiler based AC_CHECK_HEADER that was introduced in
6419 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6420 * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
6421 * configure.ac: Use renamed M4_AC_LIB_GMP.
6423 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
6424 macro that requires arguments! This stops the shell's bad
6425 substitution error at configure time.
6427 * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
6428 variables to the testsuite shell. Set the value of USE_GMP so
6429 that the gmp test will run!
6430 (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
6432 2003-08-11 Gary V. Vaughan <gary@gnu.org>
6434 Libltdl already has an excellent mechanism for accessing C symbols
6435 in modules. Lets use that! Remove all the exporting cruft and
6436 just use lt_dlsym in conjunction with a few conventions to
6437 simplify module writers' jobs. Also removed the table address
6438 caching code and otherwise simplified the module loader quite a
6439 bit. To access exported symbols in other modules, first the
6440 exporting module must name the symbols <modname>_LTX_<symname>,
6441 and the importing module must define a function type called
6442 <symname>_func. The importer then adds
6443 M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
6444 that wishes to call out to the exported functions. Care must be
6445 taken that <symname> is non-NULL in the importing module incase
6446 M4_MODULE_IMPORT fails, but otherwise it can be called as if the
6447 definition was in the importers source. Study
6448 `modules/{gnu.c,m4.{c,h}' for a model example. At the moment,
6449 m4_module_import will attempt to automatically load a module
6450 required for symbol access if it is not loaded already.
6452 * TODO: Removed the items fixed in this delta.
6453 * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
6455 * m4/ltdl.h (lt_dlhandle_find): Declare it.
6456 * m4/module.c (m4_module_unload): Use it.
6457 * src/freeze.c (reload_frozen_state): Ditto.
6458 * m4/m4module.h (m4_export): Deleted. Removed all references.
6459 (M4_MODULE_IMPORT): New user convenience macro for importing
6460 arbitrary symbols from other modules.
6461 * m4/module.c (m4_module_import): New function to service
6462 M4_MODULE_IMPORT macro.
6463 (module_data): Removed. Looking up the tables on demand with
6464 lt_dlsym, rather than caching their addresses here simplifies the
6466 (m4_get_module_builtin_table, m4_get_module_macro_table):
6467 Removed. Changed all callers.
6468 (set_module_macro_table, set_module_builtin_table): Renamed to
6469 install_macro_table and install_builtin_table respectively, and
6470 simplified now that the cache is no more.
6471 * modules/gnu.c (builtin_symbols): Use this new mechanism to
6472 import m4_dump_symbols from the m4 module.
6473 (builtin_esyscmd): Likewise for m4_set_sysval and
6475 * modules/m4.c (m4_export_table): Removed. Functions are
6476 addressed with the new mechanism which doesn't need this.
6477 (m4_set_sysval): New exported accessor function to prevent
6478 problems with variable access on inferior architectures.
6479 * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
6480 (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
6481 that we can have some type safety.
6482 * modules/modtest.c (export_test): C level exported function for
6483 testing the new import mechanism.
6484 * modules/import.c: New file for the import end of the test.
6485 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
6486 * tests/modules.at: New test cases for intermodule symbol
6489 2003-08-07 Gary V. Vaughan <gary@gnu.org>
6491 * m4/m4module.c (m4_string): Moved from here...
6492 * m4/m4private.c (m4_string): ...to here.
6494 * m4/utility.c (dumpdef_cmp): Removed stale declaration.
6496 2003-07-29 Gary V. Vaughan <gary@gnu.org>
6498 * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
6499 already available to module writers through
6500 m4_{get,set}_nesting_limit_opt(), so moved from here...
6501 * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
6502 (m4_create): Use it.
6504 2003-07-28 Gary V. Vaughan <gary@gnu.org>
6506 Aside from auditing path.c for m4module.h api obfuscation, this
6507 delta introduces the concept of private struct members in opaque
6508 data types to GNU m4: See the STYLE file for details.
6510 * TODO: Remind ourselves that a rewrite of path.c is needed.
6511 * m4/m4module.h (m4_search_path, struct m4_search_path_info):
6513 * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
6514 here and renamed. These type definitions are for internal api use
6515 only. Changed all callers.
6516 * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
6518 * m4/path.c (search_path_env_init, search_path_add): ...to here
6519 and renamed. These calls were never used outside this file.
6520 Changed all callers.
6521 (dirpath): Moved functionality of this static declaration...
6522 * m4/m4private.h (struct m4): ...to this new internal only
6523 search_path field. Changed all callers.
6524 (m4__get_search_path): Added new internal api accessor.
6525 * m4/path.c (m4_search_path_info_new): Removed. Not used.
6526 (m4_include_init): Removed...
6527 * m4/m4.c (m4_create): ...because the new m4 field is now
6529 (m4_delete): Recycle search_path memory.
6530 * src/main.c (main): Don't call m4_include_init now that it's
6532 * doc/STYLE: Document convention for private fields in opaque
6535 2003-07-24 Gary V. Vaughan <gary@gnu.org>
6537 Sometimes exporting the address of a symbol from a module isn't
6538 enough for other modules to call that symbol correctly. If
6539 custom data types are used for function parameters, they need to
6540 be known to the caller. This change introduces the concept of
6541 $(prefix)/include/modules/$(modulename).h to declare those
6542 structures. Also we move m4_dump_symbols from libm4 to the m4
6543 module to show this concept in action.
6545 * m4/m4module.h (m4_dump_symbol_data): Moved from here...
6546 * modules/m4.h (m4_dump_symbol_data): ...to this new file for
6547 exporting data structures from modules/m4.c.
6548 * modules/m4.c, modules/gnu.c: Include it.
6549 * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
6550 * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
6552 * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
6554 * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
6555 ...to here, with slight renaming.
6556 (m4_export_table): Prototype and add m4_dump_symbols.
6557 * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
6558 definition of m4_dump_symbols.
6559 * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
6560 * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
6562 2003-07-24 Gary V. Vaughan <gary@gnu.org>
6564 Create an export table in modules/m4.c in readiness for beefing up
6565 the module loader to track module exports and imports.
6567 * m4/m4module.h (m4_debug_flush_files): Removed prototype.
6568 * m4/debug.c (m4_debug_flush_files): Moved...
6569 * modules/m4.c (m4_sysval_flush): ...to here and renamed.
6570 * modules/gnu.c (builtin_esysval): Use it.
6571 * m4/m4module.h (m4_export): New type for declaring module symbols
6573 * modules/m4.c (m4_export_table): List symbols exported from this
6574 module for use by other modules.
6576 2003-07-24 Gary V. Vaughan <gary@gnu.org>
6578 An experiment: There is loads of code in libm4 which should be in
6579 the m4 module, but is also used by another module. Just because
6580 some linkers won't cope with calls across dynamic runtime loaded
6581 objects I initially left the code in libm4. It will tidy the
6582 module api immensely if this code moves to the right place, I just
6583 need to remember to invent a suitable calling mechanism at some
6584 point. For now, only modules that are statically linked and
6585 preloaded will get this treatment, so the only platforms that will
6586 break are those that require all symbols to be resolved at link
6589 * TODO: Reminder that what I am doing could reduce portability
6590 unless I do something more robust later.
6591 * m4/m4module.h (m4_sysval): No longer exported from libm4.
6592 * m4/utility.c (m4_sysval): No longer declared in libm4.
6593 * modules/Makefile.am: Reformatting.
6594 * modules/m4.c (m4_sysval): Declare it at place of use.
6595 * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
6597 2003-07-23 Gary V. Vaughan <gary@gnu.org>
6599 * m4/m4module.h: Reformatting and rearranging lines a bit.
6600 (m4_obstack): Save typing by typedefing `struct obstack'. Changed
6602 (m4_call_macro, m4_expand_input): Renamed...
6603 (m4_macro_call, m4_macro_expand_input): ...to these. Changed all
6605 (m4_expansion_level, m4_process_macro): Moved...
6606 * m4/macro.c (expansion_level, process_macro): ...to here, and
6609 * m4/m4module.h (program_name): Not used by modules at all, so
6611 * src/main.c (program_name): ...to here.
6612 (print_program_name): Renamed...
6613 (print_program_name_CB): ...to conform to the STYLE guide.
6615 2003-07-23 Gary V. Vaughan <gary@gnu.org>
6617 More refactoring of the m4module.h API. Replace #defines with an
6618 enum, and move non-public functions out of the public API.
6620 * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
6622 * m4/macro.c (stdarg.h): Add ANSI C variadic header.
6623 * m4/debug.c (m4_debug, trace): Moved...
6624 * m4/m4private.h (struct m4): ...to fields of this struct.
6625 (m4_get_debug_file, m4_get_trace_messages): New fast access macros
6627 * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
6628 * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
6629 * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
6630 * m4/m4module.h (m4_context_field_table): Add entries for new
6631 debug_file and trace_messages fields.
6632 (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
6633 (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
6634 (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
6635 (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
6636 (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
6637 (m4_is_debug_bit): New macro to simplfy checks against the debug
6639 (m4_trace_format, m4_trace_header, m4_trace_flush)
6640 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
6642 * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
6643 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
6644 * m4/macro.c (trace_format, trace_header, trace_flush)
6645 (trace_prepre, trace_pre, trace_post): ...to these newly static
6646 functions, since they are only ever used from this file. Changed
6649 2003-07-17 Gary V. Vaughan <gary@gnu.org>
6651 Change the macros for checking syntax so that matching against
6652 multiple possible syntax classes can be done with a single
6653 comparison some of the time. The various classes are now bits of
6654 an int that can be checked with bitwise logic operators.
6656 * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
6657 (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
6658 (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
6659 (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
6660 (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
6661 (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
6662 (M4_SYNTAX_ALNUM): Removed. Changed all callers.
6663 (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
6664 (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
6665 (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
6666 (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
6667 Replace all calls with invocations of these...
6668 (m4_is_syntax, m4_has_syntax): ...New macros.
6669 * src/freeze.c (produce_syntax_dump): Remove mask argument, which
6670 is no longer required with new macros. Changed all callers.
6672 2003-07-15 Gary V. Vaughan <gary@gnu.org>
6674 * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
6675 values are returned as part of the internal interface, so they
6677 * m4/private.h: ...to here.
6678 * m4/macro.c (expand_token): Check for out of range
6679 m4_peek_input() results before looking up in the syntax table.
6680 (collect_arguments): Ditto.
6682 * NEWS: Note `$' syntax class.
6684 2003-07-08 Paul Eggert <eggert@twinsun.com> and
6685 Gary V. Vaughan <gary@gnu.org>
6687 Conform to POSIX if the POSIXLY_CORRECT environment is set.
6688 --traditional `define' now smashes all the definitions.
6690 * NEWS: Explain this.
6691 * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
6692 (Extensions): Explain that extensions that are incompatible with
6693 POSIX are disabled if POSIXLY_CORRECT is set.
6694 (Incompatibilities): Remove.
6695 (Define, Other Incompat): Explain difference
6696 between GNU and POSIX behavior of define, pushdef, popdef.
6697 * m4/m4.c (m4_get_posixly_correct_opt): New undef.
6698 * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
6699 * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
6700 (m4_get_posixly_correct_opt): New macro.
6701 * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
6703 * modules/m4.c (builtin_functions): defn now takes any number of args.
6704 (builtin_define): Smash all the definitions if
6706 (builtin_defn)): Allow any number of arguments.
6707 (builtin_undivert): Do not allow nonnumeric arguments
6709 * src/main.c (main): Set posixly-correct behavior if either
6710 POSIXLY_CORRECT is set, or if -G is given.
6711 * tests/builtins.at: New test for smashed definitions.
6713 2003-06-27 Gary V. Vaughan <gary@gnu.org>
6715 * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
6716 * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
6717 not to slow the parser down.
6718 (M4__IS_STRING): New macro to test string syntax class membership.
6719 * m4/syntax.c: Adjust docucomment.
6720 (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
6721 (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
6722 * m4/input.c (init_builtin_token): Comment typo.
6723 (m4__next_token): Comment typo.
6724 Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
6725 by using the new M4__IS_STRING macro.
6726 * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
6727 variable references in macro expansions.
6729 * doc/m4.texinfo (Eregexp and Regexp): Typo.
6730 (Epatsubst and Patsubst): Typo.
6733 2003-06-26 Gary V. Vaughan <gary@gnu.org>
6735 Move the global variables that pertain to syntax to a new `struct
6736 m4_syntax_table', and then add one of these to `struct m4'. The
6737 ripple effect through the code to both change formerly global
6738 references, and make sure a suitable context is available in
6739 lexical scope is disproportionately large compared to the size of
6740 the change proper. This change is a large part of decoupling
6741 syntax.c from the rest of the code that uses it.
6743 * m4/m4private.h (struct m4): Add a syntax field.
6744 * m4/m4.c (m4_create): Initialise it,
6745 (m4_delete): Recycle it.
6746 (m4_get_symtab): Remove hand coded version...
6747 (m4_get_symbol_table): ...and generate this with cpp. Changed all
6749 * m4/m4module.h (m4_context_field_table): Add an extra field so we
6750 can generate m4_get_symbol_table. Add a new row for
6751 m4_get_syntax_table.
6752 (M4SYNTAX): Syntactic sugar for module writers.
6753 (m4_symtab): Renamed to m4_symbol_table. Changed all callers.
6754 (m4_syntax_table): New home for syntax related formerly global
6756 * m4/m4private.h (struct m4_syntax_table): Define it.
6757 * m4/input.c (m4_input_init): Initialisation of these formerly
6758 global variables moved...
6759 * m4/syntax.c (m4_syntax_create): ...to here.
6760 * m4/input.c (m4_input_exit): And similarly, recycling of the
6761 memory used by those values moved...
6762 * m4/syntax.c (m4_syntax_delete): ...to here.
6763 * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
6764 Moved to m4/m4private.h.
6765 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
6766 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
6767 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
6768 (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
6769 objects. Changed all callers that used to directly access the
6771 (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
6772 Removed and incorporated into m4_syntax_table structure.
6773 * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
6774 * m4/syntax.c (m4_set_syntax): Now returns an error status,
6775 instead of requiring a `struct m4' to generate its own errors.
6776 Changed all callers.
6777 * src/main.c (main): Now that the syntax table is initialised as
6778 part of m4_create, we have to manually wipe the syntax entries if
6779 we are about to read a frozen file.
6781 2003-06-26 Gary V. Vaughan <gary@gnu.org>
6783 * doc/STYLE: Added notes on callback naming schemes.
6785 * m4/module.c (m4_set_module_macro_table)
6786 (m4_set_module_builtin_table): Declarations weren't changed when
6787 definitions were renamed on 2003-06-19.
6789 * m4/hash.c (m4_hash_resize): ifdefed out. This function is
6790 neither used nor particularly appropriate since it exposes the
6791 internal workings of the hash module. I haven't yet decided
6792 whether to remove it entirely.
6794 2003-06-20 Gary V. Vaughan <gary@gnu.org>
6796 Two related changes, and a huge knockon effect throughout the
6797 source: Moved the option variables out of global space and into
6798 `struct m4'; made `m4_symtab' a real datatype, so that its api
6799 is not marred passing `struct m4' around just so it can decide
6800 whether to keep traced symbol names or not. Added setters and
6801 getters for the formerly global option variables, and obviously
6802 changed a vast number of functions to take a `struct m4' and use
6803 the getter funcs to find option values.
6805 * m4/utility.c (interactive, sync_output, debug_level)
6806 (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
6807 (max_debug_argument_length, warning_status, nesting_limit)
6808 (discard_comments): Removed.
6809 * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
6810 (debug_level, max_debug_argument_length, prefix_all_builtins)
6811 (suppress_warnings, discard_comments, interactive, sync_output):
6812 Removed from here...
6813 * m4/m4private.h (struct m4): ...and equivalent fields added to
6815 (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6816 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6817 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6818 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6819 (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
6820 macros for the new fields.
6821 * m4/m4module.h (m4_context_field_table)
6822 (m4_context_opt_bit_table): Helper macros used to generate
6823 prototypes, setters and getters for new option fields
6825 * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6826 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6827 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6828 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6829 (m4_get_interactive_opt, m4_get_sync_output_opt)
6830 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
6831 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
6832 (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
6833 (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
6834 (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
6835 setter and getter functions generated by cpp from
6836 m4_context_field_table and m4_context_opt_bit_table, exported as
6837 part of the module api. Changed all callers.
6838 * m4/symtab (struct m4_symtab): Used as the concrete type for
6840 (m4_symtab_create): Allocate and initialise a new struct.
6841 (m4_symtab_apply): New function that works like m4_hash_apply, but
6842 with different callbacks specific to symbol tables. Changed all
6844 (symbol_destroy, arg_destroy, arg_copy): Renamed
6845 symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
6846 they have unused parameters for a reason!
6847 (dump_symbol_CB): New callback to dump the contents of a single
6849 (symtob_dump): Rewritten in terms of dump_symbol_CB.
6850 * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
6851 Changed all callers.
6852 * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
6853 of the contained `m4_symtab' at the `no_gnu_extensions' field.
6854 Although I'm not convinced these semantics are correct, they are
6855 at least consistent with how things were before this delta. Also
6856 set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
6858 2003-06-19 Gary V. Vaughan <gary@gnu.org>
6860 Tie down the interface to libm4 some more. Make more structures
6861 opaque to modules by moving them to m4private.h, and writing
6862 setters and getters. To win back the speed penalty for doing this
6863 also wrote macroized versions that do know about structure layout
6864 in m4private.h and #include that file into modules when NDEBUG is
6865 defined at compile time. There are still some accessor macros in
6866 m4private.h that need to go, but that is not necessary to clean
6869 * m4/m4module.h (m4_symbol_type): Moved...
6870 * m4/m4private.h (m4__symbol_type): ...to here.
6871 * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
6872 (m4_set_symbol_traced, m4_set_symbol_name_traced)
6873 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
6874 (m4_get_symbol_func, m4_symbol_value_create)
6875 (m4_symbol_value_delete, m4_set_symbol_value_text)
6876 (m4_set_symbol_value_func): New exported api to symbols.
6877 (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
6878 and m4_is_symbol_value_func.
6879 * m4/m4module.h: Prototype these guys.
6880 * m4/module.c (m4_set_module_macro_table)
6881 (m4_set_module_builtin_table): Make these static, there is no
6882 reason to pollute the api with them.
6883 * m4/m4private.h: Reformatting.
6884 (m4_get_symtab): Only define when NDEBUG is defined.
6885 (m4_get_symbol_value, m4_get_symbol_traced)
6886 (m4_set_symbol_traced, m4_set_symbol_name_traced)
6887 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
6888 (m4_get_symbol_func, m4_symbol_value_create)
6889 (m4_symbol_value_delete, m4_set_symbol_value_text)
6890 (m4_set_symbol_value_func): Macro implementations of the new
6891 functions when NDEBUG is defined.
6892 (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
6893 (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
6894 Superceded by the above. All callers changed.
6895 (M4ARG): Removed. This is no longer different to the
6896 m4/m4module.h definition.
6897 * modules/gnu.c, modules/m4.c: Only include m4private.h when
6898 NDEBUG is defined. That way we exercise the same (albeit slower)
6899 api that external modules must use.
6901 2003-06-18 Gary V. Vaughan <gary@gnu.org>
6903 Renamed some of the types and their accessors to make more sense.
6904 Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
6905 has a stack of SYMBOL_VALUEs.
6907 * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
6908 (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
6909 m4_get_symbol_value_type, m4_get_symbol_value_text,
6910 m4_get_symbol_value_func and m4_symbol_value_copy respectively.
6911 Changed all callers.
6912 (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
6913 (m4_get_token_type): Renamed
6914 * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
6915 to the internal api.
6916 * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
6918 (m4__symtab_init, m4__symtab_exit): Removed prototypes.
6919 (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
6920 (m4__token_type): Moved here from m4module.h.
6921 (m4__next_token): Renamed from m4_next_token.
6922 * m4/symtab.c: Removed some of the parameterised macro support
6923 functions for modularisation later.
6924 (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
6925 m4_hash_dup to perform a true deep copy of the SRC.
6926 (arg_copy): Callback for m4_symbol_value_copy.
6927 * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
6928 Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
6929 m4_get_symbol_value_func. Changed all callers.
6931 2003-06-18 Gary V. Vaughan <gary@gnu.org>
6933 Tidy up style of hash.[ch] in accordance with doc/STYLE.
6935 * m4/hash.c: Internal symbol renaming and formatting.
6936 (m4_hash_dup): New function to facilitate deep copies of hash
6938 (m4_hash_apply_func): Returns a void* now, which is a richer type
6939 for returning exceptions (NULL means keep going).
6940 (m4_hash_apply): Ditto.
6941 * m4/hash.h: Declare exported symbols with an explicit extern.
6944 2003-06-17 Gary V. Vaughan <gary@gnu.org>
6946 Still refactoring furiously. This delta represents a change in
6947 semantics to symtab.c. Instead of building temporary m4_tokens
6948 in the caller, and copying fields in the methods, we now create
6949 the actual m4_token for hashing in the caller so the methods just
6950 slot them in directly. Also, this means that we don't lookup a
6951 symbol and get back an allocated but VOID token to copy fields
6952 into, we create the token we want to push and pass that to
6953 m4_symbol_define or m4_symbol_pushdef. And that's it. There are
6954 a few other small changes to stop knowledge of the implementation
6955 of symtab.c leaking out into other files.
6957 * m4/macro.c (expand_argument): Comment typo corrected.
6958 * m4/symtab.c (symtab_fetch): New function to fetch the address of
6960 (m4_symbol_pushdef): Take an extra value parameter and use this
6961 directly as the new top of the value stack. All callers changed
6962 to build a token and pass responsibility for memory in, rather
6963 than copying as we used to.
6964 (m4_symbol_define): Also use the new value parameter directly as a
6965 replacement for the top of the value stack. All callers changed
6966 to build a token as above.
6967 (m4_set_symbol_traced): New function to set the traced bit on the
6968 named symbol, creating it if necessary.
6969 (symbol_popval): The guts of the old m4_symbol_popdef.
6970 (m4_symbol_popdef): Use it.
6971 * m4/builtin.c (m4_symbol_set_token): Removed,
6972 (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
6974 * m4/module.c (m4_set_module_builtin_table)
6975 (m4_set_module_macro_table): ...with these more orthogonal
6977 * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
6978 (m4_builtin_pushdef, m4_builtin_define): Removed. No longer
6980 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
6981 (m4_arg_signature_parse): Moved...
6982 * m4/symtab.c: ...to here.
6983 * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
6984 screw something up. Moved...
6985 * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
6986 actually does a proper deep copy of source to dest.
6988 2003-06-16 Gary V. Vaughan <gary@gnu.org>
6990 Further refactoring to stabilise the module API. Renaming some
6991 functions for orthogonality, and judicious definition migration to
6992 move things out of the set of exported symbols.
6994 * doc/STYLE: New file. Notes on coding style.
6995 * m4/m4module.c: Updated bitrotted docucomment at the top of the
6997 (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
6998 m4_get_module_name, m4_get_module_builtin_table,
6999 m4_get_module_macro_table which are verb phrases. Changed all
7001 * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
7003 * m4/module.c (m4_set_module_builtin_table)
7004 (m4_set_module_macro_table): ...here, and renamed. Changed all
7006 * m4/m4module.c (m4_module_data): This...
7007 * m4/m4private.c (struct m4_module_data): ...and this...
7008 * m4/module.c (module_data) ...consolidated here and no longer
7009 exported. Changed all callers.
7011 2003-06-16 Gary V. Vaughan <gary@gnu.org>
7013 Begin work on lifting the curse of the global variables. To start
7014 with create a `struct m4' context container, and replace
7015 `m4__symtab' with `context->symtab' throughout. This means
7016 initialising a context container in main, and adjusting many
7017 functions between main and the module entry points so that the
7018 container gets passed through. It would have been nice to
7019 defer this until after 1.5, but it has a major effect on the
7020 user's module writing ABI, so it needs to be addressed now - at
7021 least in the areas that impact the ABI. An interrelated change
7022 in the symtab API removes the dependency on a global symbol table,
7023 and instead focuses on a passed table (from the context
7026 * TODO: Reminders for finishing context functionality.
7027 * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
7028 * m4/m4.c: New file. Manage new struct m4 objects to eliminate
7029 global variables and eventually allow m4 to be reentrant.
7030 * m4/m4private.h (m4): Define the new structure here...
7031 (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
7032 don't carry the overhead of a function call.
7033 * m4/m4module.h: Prototype extern functions from m4/m4.c.
7034 (m4): Declare type for new struct m4 objects.
7035 (M4SYMTAB): User macro to ease finding the symbol table for the
7036 current context for module developers.
7037 (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
7039 (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
7040 (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
7041 (m4_call_macro, m4_dump_symbols, m4_expand_input)
7042 (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
7043 (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
7044 (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
7045 m4* context parameter. Changed definitions and all callers.
7046 (m4_symtab): Alias for m4_hash to decouple the
7047 m4_symtab api from m4_hash.
7048 (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
7050 (m4_symtab_create): New function to return an initialised
7052 (m4_symtab_delete): New function to delete an m4_symtab's memory.
7053 (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
7054 (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
7055 instead of simply using the global m4__symtab. Changed
7056 definitions and all callers.
7057 * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
7058 * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
7059 * src/main.c (main): Create a context and use that instead of the
7060 former global m4__symtab.
7062 2003-06-13 Gary V. Vaughan <gary@gnu.org>
7064 * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
7065 to the callback. Callbacks should not need to hardcode the
7066 hashtable they are working from, nor should we have to waste the
7067 userdata parameter to pass the table in.
7068 * m4/hash.h (m4_hash_apply_func): Require the initial table
7070 * m4/symtab.c (symtab_destroy): Use the passed table instead
7071 of hardcoding m4__symtab.
7072 (m4_symbol_popdef): Don't use the userdata parameter to pass the
7073 table to arg_destroy.
7074 (arg_destroy): Use the hash parameter, ignore userdata.
7075 * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
7077 (traceon, traceoff): Call set_trace with the extra initial
7080 2003-06-13 Gary V. Vaughan <gary@gnu.org>
7082 More refactoring to stabilise the module api, this time for
7083 symtab.c. Additionally, start to pay attention to function names
7084 that don't contain a verb like they should.
7086 * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
7087 wrapper for m4_hash_apply to decouple the symtab module from the
7089 (m4_symbol_builtin, m4_symbol_macro): Renamed to
7090 m4__symbol_set_builtin and m4__symbol_set_macro. Changed all
7092 (m4_symbol_delete): Create a macro version to save a function
7094 (m4_token_t, m4_data_t): These violate the POSIX reserved
7095 namespace. Renamed to m4_token_type and m4_symbol_type. Changed
7097 (m4_token_type): Renamed to m4_token_get_type.
7098 (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
7099 (m4_symtab_exit): Removed from the exported module
7101 * m4/m4private.h (m4__symtab, m4__symtab_init)
7102 (m4__symtab_remove_module_references, m4__symtab_exit): ...and
7103 renamed and added to the internal api. Changed all callers.
7104 (m4_symtab_apply): A faster macro version of the function for
7105 users of the internal api.
7106 * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
7107 symbol_destroy and arg_destroy.
7108 (symtab_debug): Added a prototype.
7109 (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
7110 so that callers in this file get the faster macro versions from
7113 2003-06-12 Gary V. Vaughan <gary@gnu.org>
7115 Refactoring modules to rationalise the API into an external
7116 documented (eventually!) API for use by modules in the `m4_'
7117 namespace declared in m4/m4module.h, an internal API between the
7118 source files we ship (including our shipped modules) in the `m4__'
7119 namespace declared in m4/m4private.h and making the rest as
7120 cohesive as possible with liberal use of the `static' keyword.
7121 This change represents an audit to m4/module.c along these
7124 * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
7125 Removed. No longer used.
7126 (m4_module_close): Removed prototypes.
7127 (m4_module_init, m4_module_open, m4_module_unload_all): Removed
7128 from the exported module api...
7129 * m4/m4private.h (m4__module_init, m4__module_open)
7130 (m4__module_exit): ...and renamed and added to the internal api.
7131 Changed all callers.
7132 (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
7133 Centralised definitions after renaming...
7134 * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
7135 (M4_FINISH_SYMBOL): ...and removing from here.
7136 (m4_module_dlerror, m4_module_remove, m4_module_close)
7137 (m4_caller_id): Not exported at all, so renamed to module_dlerror,
7138 module_remove, module_close and caller_id.
7139 (MODULE_SELF_NAME): New macro to make reporting self errors
7141 (m4_module_load, module_close, module_remove): Use it.
7142 * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
7144 * src/main.c (main): Use it.
7146 2003-06-12 Gary V. Vaughan <gary@gnu.org>
7148 * README: Remove references to --enable-changeword, which has been
7149 removed from the code.
7151 2003-06-11 Gary V. Vaughan <gary@gnu.org>
7153 Getting rid of the annoying bug with configure --enable-debug,
7154 which spewed -e: command not found errors. This was an interaction
7155 between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
7156 You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
7157 branch-1-5) to get the full fix.
7159 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
7160 of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
7161 and then use the probed value of $SED.
7162 (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
7163 this, it messes up the AC_REQUIRE stack.
7165 2003-06-10 Gary V. Vaughan <gary@gnu.org>
7167 * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
7168 the destroy callback.
7169 (m4_arg_destroy): Use the hash address to free the hash node key
7172 2003-06-06 Gary V. Vaughan <gary@gnu.org>
7174 First cut at formal parameters in macros.
7176 * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
7177 * m4/xstrzdup.c: New file.
7178 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
7179 associative array of parameter names to details.
7180 (m4_symbol_token): Capture macro names with parameter lists.
7181 (m4_arg_signature_parse): And build an associative array to hang
7182 from the symbol structure to map names to details.
7183 * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
7184 m4_hash_resize idiom. Now that we potentially add a little hash
7185 table to many of the entries in the symbol table, added an extra
7186 arg to set the initial size. Changed all callers.
7187 (m4_hash_apply): New function that is basically a generalised
7189 * m4/symtab.c (m4_symbol_apply): ...this. Now deleted. Adjusted
7190 all callers to call m4_hash_apply instead.
7191 (m4_arg_destroy): Recycle memory used by an m4_token_arg.
7192 (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
7193 m4_arg_signature association that might be attached to the symbol,
7194 * m4/hash.h (m4_hash_apply_func): Replacement type for...
7195 * m4/m4module.h (m4_symtab_apply_func): ...this. Now deleted.
7196 (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
7198 (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
7199 (M4_IS_IDENT): Detect characters that can be safely used in
7201 * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
7202 * m4/macro.c: Corrected grammar in some comments. Use `token'
7203 rather than `td' for m4_token variables.
7204 (m4_process_macro): If we find a dollar followed by some
7205 M4_IS_IDENT characters, replace that with the contents of the argv
7206 entry with offset stored in the m4_token_arg associated with the
7207 collected identifier.
7209 2003-06-05 Gary V. Vaughan <gary@gnu.org>
7211 Begin preparations for supporting formal parameters in m4 macros.
7213 * m4/m4private.h (struct m4_token_arg): Placeholder for holding
7214 the details of a formal parameter.
7215 (m4_token): Add an arg_signature member to hold a hash table for
7216 looking up formal parameters.
7217 * m4/input.c: Update more bitrotted comments.
7218 (m4_push_builtin): Initialise arg_signature member.
7219 (init_builtin_token): Copy arg_signature member.
7220 * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
7221 (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
7223 * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
7224 (m4_macro_pushdef, m4_macro_define): ...these, And...
7225 (m4_symbol_token): ...wrapped around this new function, which
7226 vastly simplifies the arguments required by the functions it
7228 Changed all callers.
7230 2003-06-05 Gary V. Vaughan <gary@gnu.org>
7232 * m4/macro.c: Format changes.
7234 2003-06-04 Gary V. Vaughan <gary@gnu.org>
7236 * m4/input.c: Updated various bitrotted comments.
7237 (m4_push_builtin): Just pass the whole m4_token, rather than
7238 extracting all the fields in the caller. This also allows us to
7239 check the token type for consistency.
7240 (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
7241 Renamed to builtin_funcs, builtin_peek, builtin_read,
7242 m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
7243 the code. Changed all callers.
7244 (struct input_block): Similarly renamed u_m member to u_b, and
7245 changed all callers.
7246 (m4_next_token): Use bzero to initialise the data fields.
7247 * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
7249 2003-05-29 Gary V. Vaughan <gary@gnu.org>
7251 These changes were necessary to get m4 to build on my iBook
7252 running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
7253 (GCC) 3.1 20020420 (prerelease)":
7255 * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
7256 inclusion of module loader headers.
7257 * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
7258 * m4/Makefile.am: Ditto.
7259 (libm4_la_LIBADD): Added $(LTLIBINTL).
7260 * m4/utility.c (program_name): Removed declaration in favour of
7261 the one already in error.c!
7262 * m4/m4module.h (program_name): Define to program_invocation_name
7263 when using GNU C library. Use an explicit extern declaration.
7264 (interactive, sync_output, debug_level, hash_table_size)
7265 (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
7266 (suppress_warnings, warning_status, nesting_limit, discard_comments)
7267 (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
7268 (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
7269 (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
7270 (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
7271 (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
7272 (m4_expansion_level, m4_expand_ranges, m4_expand_input)
7273 (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
7274 (m4_current_line, m4_current_diversion, m4_output_current_line):
7275 Don't rely on default, use an explicit extern.
7276 * m4/error.h (error, error_at_line, error_print_progname)
7277 (error_message_count, error_one_per_line): Ditto.
7278 * m4/ltdl.c: Update from CVS libtool.
7280 * commit: Update from CVS cvs-utils.
7282 2002-11-04 gettextize <bug-gnu-gettext@gnu.org>
7284 * po/Makefile.in.in: Upgrade to gettext-0.11.5.
7285 * po/boldquot.sed: New file, from gettext-0.11.5.
7286 * po/en@boldquot.header: New file, from gettext-0.11.5.
7287 * po/en@quot.header: New file, from gettext-0.11.5.
7288 * po/insert-header.sin: New file, from gettext-0.11.5.
7289 * po/quot.sed: New file, from gettext-0.11.5.
7290 * po/remove-potcdate.sin: New file, from gettext-0.11.5.
7291 * po/Rules-quot: New file, from gettext-0.11.5.
7293 2002-11-04 Akim Demaille <akim@epita.fr>
7295 * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
7297 * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
7299 2002-11-04 Akim Demaille <akim@epita.fr>
7301 * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
7303 2002-11-04 Akim Demaille <akim@epita.fr>
7305 * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
7306 used as `external', and Libtool 1.4.3.
7308 (LTLIBOBJS): Don't play with it.
7310 * Makefile.am (SUBDIRS): Remove intl.
7311 (ACLOCAL_AMFLAGS): Add -I config.
7312 (EXTRA_DIST): Add config/config.rpath.
7315 * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
7317 2002-05-29 Gary V. Vaughan <gary@gnu.org>
7319 Preparations for refactoring syntax tables to allow reverse
7320 lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
7321 speed of normal lookups in an array of unsigned short.
7323 * m4/input.c (single_quotes, single_comments, use_macro_escape):
7325 * m4/m4private.h (m4__single_quotes, m4__single_comments,
7326 m4__use_macro_escape): ...to here, and renamed. The `m4__' prefix
7327 is for internal symbols which unavoidably pollute the global
7328 namespace, but are not published APIs.
7329 Adjusted all callers.
7330 * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
7331 m4_set_comment, m4_set_syntax, set_syntax_internal,
7332 unset_syntax_attribute): Moved from this file...
7333 * m4/syntax.c: New. ...to this file.
7334 Also added an m4_syntax_exit stub for orthogonality.
7335 * src/main.c (main): Use it.
7336 * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
7337 * m4/m4module.h: Reformatting. New prototypes.
7339 2002-05-29 Gary V. Vaughan <gary@gnu.org>
7341 * bootstrap (aclocal_apiversion): The aclocal apiversion is
7342 distinct from the automake release number (in that the apiversion
7343 apparently has no micro-version-component).
7344 (aclocal_apilibdir): Use it.
7346 2002-05-28 Gary V. Vaughan <gary@gnu.org>
7348 * m4/hash.c (m4_hash_resize): New function.
7349 * m4/hash.h: Add prototype.
7350 * m4/symtab.c (m4_symtab_init): Use it. This could do with some
7351 benchmarking to find a good value for, say, autoconf. This is
7352 already a little quicker than before for me.
7354 * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
7355 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
7357 * m4/hash.h: Adjust prototypes.
7359 2002-01-22 Akim Demaille <akim@epita.fr>
7361 * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
7363 * tests/Makefile.am (package.m4): New.
7364 * tests/atlocal.in: Adjust to CVS Autotest.
7365 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
7366 * configure.ac: LIBOBJ is a forbidden string.
7367 Simplify AM_INIT_AUTOMAKE invocation.
7368 * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
7371 2002-01-21 gettextize <bug-gnu-utils@gnu.org>
7373 * po/Makefile.in.in: Upgrade to gettext-0.10.40.
7375 2001-10-19 Akim Demaille <akim@epita.fr>
7377 * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
7379 2001-10-19 Akim Demaille <akim@epita.fr>
7381 * m4/input.c (m4_next_token): Display where was opened what is
7384 2001-10-19 Akim Demaille <akim@epita.fr>
7386 * m4/macro.c (expand_argument): Display where was opened what is
7389 2001-10-18 Akim Demaille <akim@epita.fr>
7391 * m4/input.c, modules/m4.c: Formatting changes.
7393 2001-10-17 Gary V. Vaughan <gary@gnu.org>
7395 * bootstrap: s/configure.in/configure.ac/
7397 2001-10-16 Gary V. Vaughan <gary@gnu.org>
7399 * m4/symtab.c (m4_symbol_destroy): This function calls
7400 m4_symbol_popdef, which recycles a symbols memory when the last
7401 definition is popped. Since we were passing the address of the
7402 symbol name found in the symbol table, and it was being removed
7403 partway through m4_symbol_destroy() we were referencing freed
7404 memory for the balance of the function. Now we take a copy of the
7405 symbol name tring and use that as a key into the symbol
7406 table... that way if the original symbol name is freed, the copy
7409 2001-10-13 Akim Demaille <akim@epita.fr>
7411 * m4/ltdl.c: Update.
7413 2001-10-13 Akim Demaille <akim@epita.fr>
7415 * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
7416 Don't gettextize internal error messages.
7418 2001-10-13 Akim Demaille <akim@epita.fr>
7420 * tests/macros.at (Arity and defn): New failing test.
7421 (Arity, defn, and freeze): New.
7423 Fix `Arity and defn'.
7425 * m4/input.c (m4_push_macro): Don't forget the arity.
7426 * modules/m4.c (defn): Likewise.
7428 2001-10-13 Akim Demaille <akim@epita.fr>
7430 * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
7432 * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
7433 (Propagation of traceon, Propagation of --trace): this new file.
7435 2001-10-13 Akim Demaille <akim@epita.fr>
7437 * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
7438 interface instead of (name, argc...).
7439 Upon failure, specify which argument was guilty.
7442 2001-10-13 Akim Demaille <akim@epita.fr>
7444 * modules/evalparse.c: Save translators' time: don't translate
7445 internal error messages.
7446 (m4_evaluate): Simplify/normalize error messages.
7447 * doc/m4.texinfo (Eval): Adjust.
7449 2001-10-13 Akim Demaille <akim@epita.fr>
7451 * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
7452 where no checking is needed.
7453 * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
7454 interface instead of (name, argc...).
7456 * modules/gnu.c (m4_patsubst_do): Don't check argc, done
7459 2001-10-13 Akim Demaille <akim@epita.fr>
7461 * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
7462 exclude the builtin name from the count.
7463 * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
7464 calling ifelse with a single argument is valid.
7465 * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
7466 with 1 and 2 args, mostly to strengthen the test suite.
7468 2001-10-13 Akim Demaille <akim@epita.fr>
7470 * m4/output.c (m4_make_diversion, m4_insert_file)
7471 (m4_insert_diversion, +m4_freeze_diversions): Ansify.
7473 2001-10-12 Gary V. Vaughan <gary@gnu.org>
7475 * m4/input.c (init_builtin_token): Renamed from init_macro_token,
7476 since we call these things builtins in the rest of the code!
7478 * modules/gnu.c (m4_regexp_compile): s/%0/%s/
7480 2001-10-12 Gary V. Vaughan <gary@gnu.org>
7482 Rather than forcing each builtin definition to manage its own
7483 argument range checking, tabulate the maxima and minima for all
7484 builtins in each module. This forces us to consider what the
7485 valid ranges for each builtin should be, and moves the checking
7486 code out of each builtin implementation and into the builtin
7487 caller infrastructure.
7489 * m4/m4module.h (struct m4_builtin): Add argument minima and
7491 * m4/m4private.h (struct m4_token): Reflect them here too.
7492 * m4/input.c (struct input_block): ...and here.
7493 (m4_token_copy): New function for token copying.
7494 (init_macro_token): Copy them from a token to the input stack.
7495 (m4_next_token): Don't forget to initialise them for text
7497 * m4/macro.c (expand_argument): Use m4_token_copy, and also
7498 check argument counts before calling the builtin handler.
7499 * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
7500 (m4_symbol_macro): Likewise.
7501 * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
7502 parameters. Updated all callers.
7503 (m4_builtin_define): Ditto.
7504 (m4_macro_pushdef, m4_macro_define): Ditto.
7505 * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
7506 * modules/evalparse.c: Declare argument counts for defined
7507 builtins and remove explicit calls to m4_bad_argc().
7508 * modules/gnu.c: Ditto.
7509 * modules/load.c: Ditto.
7510 * modules/m4.c: Ditto.
7511 * modules/modtest.c: Ditto.
7512 * modules/mpeval.c: Ditto.
7513 * modules/perl.c: Ditto.
7514 * modules/shadow.c: Ditto.
7515 * modules/stdlib.c: Ditto.
7516 * modules/time.c: Ditto.
7519 2001-10-10 Gary V. Vaughan <gary@gnu.org>
7521 The trace semantics now attach the trace bit to a symbol name.
7522 For as long as a traceon(`foo') is active, calls to foo will be
7523 traced regardless of intervening undefines or module unloads.
7524 Fixed the flag propogation issues differently to the fixes
7525 reverted with the last attempt at nailing down trace:
7527 * m4/m4private.h: This file is not visible outside of the m4
7528 source tree, so I removed all the `M4_' and `m4_' prefixes to save
7529 on typing. Updated all clients.
7530 (m4_token): New typedef contains the fields that need to be passed
7531 around with the low level tokeniser.
7532 (m4_token_data): Removed.
7533 (m4_symbol): Now contains the traced flag again.
7534 * m4/symtab.c: Rewritten again. Now we don't remove symbols with
7535 the trace bit set. This change is contained entirely within this
7536 module and doesn't leak out into the callers. Updated all
7538 (m4_symbol_builtin, m4_symbol_macro): Adjusted to make use of the
7539 new fields in m4_token. Updated all clients.
7540 * m4/builtin.c (m4_builtin_pushdef): Needs a flags argument so
7541 that `groks_macro_args' and `blind_if_no_args' flags are retained
7542 when defn() results are passed around in m4 code. Updated all
7544 (m4_builtin_define): Ditto.
7545 (m4_macro_pushdef, m4_macro_define): Ditto.
7546 * m4/input.c (struct input_block): Add a flags field to facilitate
7548 (m4_push_macro): ...use it.
7549 (init_macro_token): Retrieve it.
7550 (m4_next_token): Initialise it.
7551 * m4/macro.c (expand_argument): Copy it.
7552 * m4/m4module.h: Adjust.
7553 * tests/builtins.at: Adjust the expected output of the trace
7554 tests to reflect the change in semantics.
7555 * tests/modules.at (modules: trace): Check that unloading a
7556 module which supplies a traced symbol definition doesn't lose te
7559 2001-10-07 Gary V. Vaughan <gary@gnu.org>
7561 * modules/gnu.c (m4_macro_table): Display the timetamp when
7562 expanding __m4_version__.
7564 * configure.ac (--with-modules): Forgot a comma in the
7565 AC_HELP_STRING parameter list.
7567 2001-10-05 Gary V. Vaughan <gary@gnu.org>
7569 * bootstrap: Remove aclocal.m4t when it is no longer required.
7571 2001-10-05 Akim Demaille <akim@epita.fr>
7573 * tests/Makefile.am: Adjust for gnuprog2.
7574 * tests/m4.in: There can be a leading path.
7575 * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
7576 * tests/testsuite.at: Adjust to the most recent Autotest.
7577 (AT_CHECK_M4_FILTER): Fix and rename as...
7579 * tests/others.at: Use it.
7581 * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
7582 variable in shell scripts, one uses `$'...
7584 2001-10-04 Gary V. Vaughan <gary@gnu.org>
7586 * configure.ac: `rm -f $m4_getopt_h' was lost.
7588 2001-10-04 Gary V. Vaughan <gary@gnu.org>
7590 * configure.ac (TIMESTAMP): Display with AS_BOX at configure
7591 time. Define it for config.h in order to...
7592 * src/main.c (main): ...display the timestamp for --version.
7594 2001-10-04 Akim Demaille <akim@epita.fr>
7596 * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
7597 previous builtins `regexp' and `patsubst'.
7598 (regexp, patsubst): Use them.
7599 (eregexp, epatsubst): New builtins.
7600 * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
7601 (Epatsubst and Patsubst, Eregexp and Regexp): these.
7602 (Extensions): More info on REs.
7604 2001-10-04 Akim Demaille <akim@epita.fr>
7606 * modules/modtest.c (init_handler): Consistently output to stderr.
7607 (finish_handler): New.
7608 (test): The `if' is an `assert'.
7609 * tests/modules.at: Adjust.
7611 2001-10-04 Akim Demaille <akim@epita.fr>
7613 * m4/utility.c (m4_bad_argc): Detail the mismatches.
7615 2001-10-01 Akim Demaille <akim@epita.fr>
7617 * tests/generate.awk: Tag the tests with `documentation'.
7618 * tests/modules.at (AT_CHECK_M4_MODTEST): New.
7619 Use the make the existing modtest tests more uniform, and complete
7620 the set of possibilities.
7622 2001-10-01 Akim Demaille <akim@epita.fr>
7624 * config/gmp.m4: Consult the user before using GMP: use
7626 * configure.ac: Adjust.
7627 * modules/gmp.c: No protection needed as the module is not built
7630 2001-10-01 Akim Demaille <akim@epita.fr>
7632 * tests/generate.awk: Remove debugging code.
7633 (fatal): Specify the current location.
7635 * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
7636 * modules/gnu.c, modules/m4.c: Use M4ARG.
7638 2001-10-01 Akim Demaille <akim@epita.fr>
7640 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
7641 (m4_regexp_compile): New.
7642 (regexp, patsubst): Use it.
7644 2001-09-30 Gary V. Vaughan <gary@gnu.org>
7646 Reinstate the memory handling improvements from the patch I just
7647 reverted. Relevant ChangeLog entries repeated here:
7649 * m4/module.c (m4_module_remove): New function that holds the core
7650 of the old m4_module_unload.
7651 (m4_module_unload): Use it.
7652 (m4_module_unload_all): When we know the modules will never be
7653 used again (i.e. on exit), free up as much module memory as
7654 possible. There are still some artifacts from resident modules
7655 living inside ltdl.c, but everything else is freed.
7656 * m4/debug.c (m4_debug_exit): Free memory allocated in
7658 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7659 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7660 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7661 * m4/m4module.h: Updated prototypes.
7662 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7663 * m4/hash.h: Updated prototypes.
7664 * src/main.c (main): Use all these new functions to clean up as
7665 much memory as possible before exit.
7667 2001-09-30 Gary V. Vaughan <gary@gnu.org>
7669 Reverted my large patch for removing the old m4_symbol
7670 structure on 2001-09-20. We are still not happy about the way
7671 trace works in conjunction with defn and undefine, and leaving
7672 the reverted patch active prevents us from moving the traced
7673 bit from the definition back to the symbol.
7675 2001-09-30 Gary V. Vaughan <gary@gnu.org>
7677 * configure.in: Moved to...
7678 * configure.ac: ...here. Added a libtool like timestamped
7679 banner, and tidied up the libltdl cruft.
7680 * config/mkstamp: Script to extract a timestamp from ChangeLog.
7681 * modules/Makefile.am (INCLTDL): Removed. This is required
7682 only when libltdl is configured in a subdirectory.
7683 * src/Makefile.am: Ditto.
7684 (LIBADD_DL): No need to add this again, libtool already knows
7685 that libm4.la depends on it.
7686 * m4/Makefile.am: Automake sets variables from AC_SUBST. Use
7689 * TODO: stackovf.c is basically broken.
7690 Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
7692 2001-09-28 Akim Demaille <akim@epita.fr>
7694 * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
7696 2001-09-27 Akim Demaille <akim@epita.fr>
7698 * tests/m4.in: Don't use short options.
7699 Simplify the stderr signature normalization.
7701 2001-09-27 Akim Demaille <akim@epita.fr>
7703 tests/m4 shall be position independent.
7707 * tests/testsuite.at: No args to AT_INIT.
7708 * configure.in, tests/Makefile.am: Adjust.
7710 2001-09-22 Akim Demaille <akim@epita.fr>
7712 Autotest has changed again.
7714 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
7715 (package.m4): Remove.
7716 * configure.in: Adjust to LIBADD_GMP.
7718 2001-09-21 Gary V. Vaughan <gary@gnu.org>
7720 * config/gmp.m4 (AC_ARG_WITH): Removed.
7721 (GMP_LIB): Renamed to LIBADD_GMP for consistency.
7722 (AC_LIB_GMP): When performing a test compile against libgmp,
7723 include the header gmp.h if possible, and link against -lgmp. If
7724 they both work define USE_GMP.
7725 * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
7726 (mpeval_LTX_init_func): Complain on load that there was no libgmp
7729 2001-09-20 Gary V. Vaughan <gary@gnu.org>
7731 * m4/evalparse.c: Moved to...
7732 * modules/evalparse.c: ...here. This code is shared between
7733 modules/mpeval.c and modules/m4.c, so there is no need to pollute
7734 the libm4 API with its details. Moderately rewritten to interface
7735 into its clients more simply.
7736 * m4/eval.c: Deleted. Migrated functionality to...
7737 * modules/m4.c: ...here.
7738 (builtin_eval): Implemented in terms of the new interface style.
7739 * modules/mpeval.c (builtin_mpeval): Ditto.
7740 * m4/m4module.h: Removed references to the former m4/eval.c.
7741 * m4/Makefile.am (libm4_la_SOURCES): Removed eval.c.
7742 (EXTRA_libm4_la_SOURCES): Deleted.
7743 * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
7744 (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
7746 2001-09-20 Akim Demaille <akim@epita.fr>
7748 * config/gmp.m4 (AM_WITH_GMP): Rename as...
7750 By default, use gmp.
7752 * configure.in: Adjust.
7753 Use Automake conditionals for USE_GMP.
7754 Always compute sizeof (long long int).
7755 This was a bug BTW, as `eval' (not `mpeval') depends on it:
7756 before, it was used _only_ if mpeval was not activated.
7757 * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
7758 (mpeval_la_LIBADD): New macros.
7759 * modules/mpeval.c: No longer be conditioned by WITH_GMP.
7761 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
7762 * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
7765 2001-09-20 Akim Demaille <akim@epita.fr>
7767 * tests/Makefile.am (package.m4): New.
7768 * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
7770 2001-09-20 Gary V. Vaughan <gary@gnu.org>
7772 More cleanup. After the last patch, m4_symbol holds nothing but
7773 the head of a chain of m4_token_data. So I have removed the old
7774 m4_symbol, so that m4_token_data chains are stored directly in the
7775 value cell of a hash table node. But there's more... m4_symbol
7776 was a more natural name for the symbol value cell, and now that it
7777 is gone I have renamed the former m4_token_data structure to
7778 m4_symbol. This change turned out to be a pig to get right, since
7779 the original code didn't need to modify the value cell itself,
7780 since changing the chain happened inside the m4_symbol that used
7781 to be returned -- I had to pass the address of the value cell
7782 across various function calls, incase the head value changed. I
7783 also tightened up the memory management to help me find a nasty
7784 memory corruption bug that took me all night to track down...
7786 * m4/m4private.h (struct m4_symbol): Removed.
7787 (struct m4_token_data): Renamed to `struct m4_symbol'. Updated
7789 * m4/hash.c (m4_hash_iterator_value): Return the address of the
7790 value cell. Updated all callers.
7791 * m4/symtab.c: Took advantage of the simplification in the data
7792 structures to rewrite a lot of this file more simply. There is
7793 still some room for optimisation here, but we should tackle that
7794 systematically closer to the release.
7796 * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
7797 revealed. This version is ahead of CVS libtool until I get chance
7798 to flush my changes.
7799 * m4/module.c (m4_module_remove): New function that holds the core
7800 of the old m4_module_unload.
7801 (m4_module_unload): Use it.
7802 (m4_module_unload_all): When we know the modules will never be
7803 used again (i.e. on exit), free up as much module memory as
7804 possible. There are still some artifacts from resident modules
7805 living inside ltdl.c, but everything else is freed.
7806 * m4/debug.c (m4_debug_exit): Free memory allocated in
7808 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7809 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7810 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7811 * m4/m4module.h: Updated prototypes.
7812 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7813 * m4/hash.h: Updated prototypes.
7814 * src/main.c (main): Use all these new functions to clean up as
7815 much memory as possible before exit.
7817 2001-09-18 Gary V. Vaughan <gary@gnu.org>
7819 The `traced' flag needs to be attached to the definition of a
7820 symbol rather than the current symbol containing the definition.
7821 Implementing this showed up some long standing post 1.4 bugs in
7822 flag propogation which I also fixed.
7824 * m4/m4private.h (struct m4_symbol): Remove the traced flag.
7825 (struct m4_token_data): And add it back in here.
7826 * m4/input.c (init_macro_token): Propogate the traced flag
7828 * m4/macro.c (expand_argument): Ditto.
7829 * tests/builtins.at (trace2, trace3): New tests based on Akim's
7832 2001-09-08 Gary V. Vaughan <gary@gnu.org>
7834 * m4/m4private.h (struct m4_token_data): Simplified by removing
7835 the redundant `traced' flag, and one level of structure nesting.
7836 (M4_TOKEN_DATA_FUNC_TRACED): Removed.
7837 * m4/input.c (init_macro_token): No need to initialise removed
7839 * m4/macro.c (expand_argument): No need to copy it either.
7840 * m4/utility.c (m4_token_data_func_traced): Or provide an access
7843 * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
7844 dependant on multiple symbols with the same key, so preserving
7845 relative symbol order in each bucket during resizing is no longer
7846 required. The resize function is considerably faster as a result.
7848 * m4/m4module.h, m4/builtin.c, m4/symtab.c:
7849 s/m4_symbol_insert/m4_symbol_define/g;
7850 s/m4_builtin_insert/m4_builtin_define/g;
7851 s/m4_macro_insert/m4_macro_define/g. Updated all callers.
7853 2001-09-08 Gary V. Vaughan <gary@gnu.org>
7855 Get rid of m4_symbol_lookup_t entirely. With Akim's earlier
7856 commits, the m4_lookup_symbol dispatch function is split into
7857 specialised functions that must be called directly.
7859 * m4/m4module.h (m4_symbol_lookup_t): Removed.
7860 * m4/symtab.c (m4_lookup_symbol): Removed.
7861 (m4_symbol_builtin, m4_symbol_macro): New functions.
7862 * m4/builtin.c (m4_builtin_define): Split into...
7863 (m4_builtin_pushdef, m4_builtin_insert): ...these.
7864 (m4_macro_define): Split into...
7865 (m4_macro_pushdef, m4_macro_insert): ...these.
7866 * src/main.c (main): Set command line macros from `-D' parameters
7867 using `m4_macro_define'.
7869 2001-09-08 Gary V. Vaughan <gary@gnu.org>
7871 * m4/symtab.c (m4_symtab_remove_module_references): Renamed as
7872 this from m4_remove_table_reference_symbols().
7873 * m4/m4module.h, m4/module.c: Updated all references.
7875 2001-09-07 Akim Demaille <akim@epita.fr>
7877 * modules/stdlib.c, modules/times.c: Misc cleanups.
7879 2001-09-07 Akim Demaille <akim@epita.fr>
7881 * configure.in: We now need Autoconf 2.52e.
7882 * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
7883 and `M4_SYMBOL_DELETE'.
7884 * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
7885 * src/main.c (main): Adjust.
7887 2001-09-06 Gary V. Vaughan <gary@gnu.org>
7889 Fix the obstack.h problem once and for all! At configure time we
7890 can test for a system supplied obstack.h: depending on the
7891 result, we now generate system.h with an #include of the correct
7892 header. As a bonus, I've also added a --with-included-obstack,
7893 incase the user doesn't like the system obstack for some
7894 reason... and also we can test the shipped obstack on a system
7895 that has oe of its own. We also now need to be careful to add
7896 build directories to the include search path, since the generated
7897 system.h will be in the build tree.
7899 * configure.in (AC_CONFIG_FILES): Generate system.h from
7901 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
7902 include the system obstack header or the copy shipped with M4.
7903 Allow the user to override configure and force the build to use
7904 the shipped version.
7905 * m4/system-h.in: New file, template for...
7906 * m4/system.h: ...this. Now deleted.
7907 * m4/m4module.h: Include system.h before everything else.
7908 * src/freeze.c: Ditto.
7909 * m4/Makefile.am (dist-hook): Remove generated system.h.
7910 (INCLUDES): Check builddir for generated headers before checking
7912 * modules/Makefile.am (INCLUDES): Ditto.
7913 * src/Makefile.am (INCLUDES): Ditto.
7915 2001-09-05 Gary V. Vaughan <gary@gnu.org>
7917 * TODO: Remove the items that have been addressed already.
7919 2001-09-05 Akim Demaille <akim@epita.fr>
7921 * src/main.c (main): Standardize --version.
7923 2001-09-05 Akim Demaille <akim@epita.fr>
7925 * modules/format.c (format): Have a bigger `str'.
7927 2001-09-05 Akim Demaille <akim@epita.fr>
7929 Rationalize warnings, reporting the macro name as if it were a
7930 program name, and assertions.
7932 * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
7934 * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
7936 Use assert for internal errors.
7937 * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
7939 * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
7941 * tests/builtins.at (pushpop): Adjust.
7943 2001-09-05 Akim Demaille <akim@epita.fr>
7945 * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
7948 2001-09-05 Akim Demaille <akim@epita.fr>
7950 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
7951 * m4/macro.c, m4/symtab.c: Adjust.
7953 2001-09-05 Akim Demaille <akim@epita.fr>
7955 * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
7956 (m4_symbol_pop, m4_symbol_del): this.
7957 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
7958 (m4_symbol_popdef, m4_symbol_delete): New.
7959 (m4_lookup_symbol): Adjust.
7960 * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
7962 2001-09-05 Akim Demaille <akim@epita.fr>
7964 * m4/m4module.h (m4_symbol_lookup): Rename as...
7965 (m4_symbol_lookup_t): this.
7967 2001-09-05 Akim Demaille <akim@epita.fr>
7969 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
7971 * m4/symtab.c (m4_lookup_symbol): Adjust.
7973 2001-09-03 Gary V. Vaughan <gary@gnu.org>
7975 Bootstrap will now work with Libtool 1.4.1 or higher:
7976 * bootstrap: Remove stale autom4te.cache files when
7978 * config/Makefile.am (ACLOCAL_MACROS): Add ltdl.m4 and
7980 * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
7981 libtool.m4 directly.
7982 Run libtoolize to refresh ltmain.sh.
7983 * config/ltmain.sh: Deleted.
7984 * acinclude.m4: Deleted.
7985 * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
7987 * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
7988 implementation for the cvs impaired libtool user.
7990 2001-09-03 Akim Demaille <akim@epita.fr>
7992 * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
7994 Avoid using `default' in switch, as it hides useful compiler
7995 warnings when a case is forgotten.
7997 2001-09-03 Akim Demaille <akim@epita.fr>
7999 * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
8000 is no such thing as `WITH_MODULES'.
8002 2001-09-03 Akim Demaille <akim@epita.fr>
8004 Improve the test suite's selfcontainedness.
8006 * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
8007 (Include, Undivert): Tag the other input files.
8008 * tests/generate.awk: Catch `@comment file:'.
8009 `-I $src' is no longer needed.
8010 `next' is really like `return': the rest is skipped.
8011 Adjust to `input.m4'.
8012 (fatal): New function.
8013 * tests/foo, tests/incl.m4: Remove.
8015 2001-09-01 Gary V. Vaughan <gary@gnu.org>
8017 The shadowing mechanism and, infact, the whole symbol table
8018 implementation was creaking under the weight of the features piled
8019 on top of it. We now have a separate hash table module which will
8020 dynamically resize to keep symbol density withing good performace
8021 limits, and a new symtab module layered above it. Symbol lookups
8022 are now marginally more efficient (since the shadowed flag is no
8023 longer required) and symbol removal, such as on module unload, is
8024 considerably faster due to a reorganisation of the data structures
8027 * src/main.c (main): Don't mention `-H'.
8028 * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
8031 * m4/hash.c: New generalised dynamic hash table data structure
8033 * m4/hash.h: Public interface.
8034 * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
8035 (libm4_la_SOURCES): Add hash.c.
8036 * m4/symtab.c: More or less rewritten from scratch, within the
8037 bounds of the previous API.
8038 (m4_symtab_apply): A cleaner version of the old hack_all_symbols
8039 call. Updated all callers.
8040 * m4/m4module.c: #include <m4/hash.h>, and changed all affected
8041 declarations to reflect API changes.
8042 (M4INIT): Generate a declaration too, to avoid the warning with
8043 --enable-debug builds.
8046 * m4/utility.c (hash_table_size): Removed.
8047 (m4_dump_symbols): Rewritten to build and qsort an array of symbol
8048 names, which are then looked up by builtin_dumpdef() as necessary.
8049 This implies a small speedup in builtin_symbols(), which discarded
8050 all of the symbol info under the old call.
8051 * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
8052 shadowing is implicit in respect to the new data structures.
8053 symbol names are no longer duplicated here, they are stored in the
8054 key field of the hash table.
8055 Moved macro_args and blind_no_args...
8056 (m4_token_data): ...to here.
8057 m4/macro.c (expand_macro): Added a name argument since the symbol
8058 name is no longer copied into each struct m4_symbol. Modified all
8060 (collect_arguments): Ditto.
8061 * modules/m4.c (set_trace): Ditto.
8062 * modules/gnu.c (builtin_symbols): Updated.
8063 * src/freeze.c (produce_symbol_dump): Much improved in light of
8064 the improved symbol table layout.
8066 2001-09-01 Gary V. Vaughan <gary@gnu.org>
8068 * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
8070 (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
8071 (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
8072 SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
8073 SYMBOL_HANDLE): Ditto.
8074 * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
8075 modules/gnu.c, modules/m4.c, src/freeze.c,
8076 src/main.c: Updated all references.
8078 * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
8079 Automake 1.5 chokes on dynamic source file lists, Besides, it is
8080 already listed in m4_LDADD... how did that ever used to work?
8081 * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
8083 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
8084 Suggested by Tim Van Holder <tim.van.holder@pandora.be>
8086 * tests/m4: Don't call the m4 wrapper script with libtool, it
8087 works fine all by itself.
8089 2001-08-30 Gary V. Vaughan <gary@gnu.org>
8091 The experimental `changeword' feature never took off, and has
8092 no obvious advantages over `changesyntax' to compensate the
8093 enormous speed penalty it carries:
8094 * configure.in (ENABLE_CHANGEWORD): Removed.
8095 * m4/m4module.h (m4_set_word_regexp): Removed.
8096 * m4/m4private.h (m4_token_data): Removed original_text field.
8097 * m4/utility.c (m4_token_data_orig_text): Removed.
8098 * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
8099 * m4/macro.c: Ditto.
8100 * src/main.c: Ditto.
8101 * modules/Makefile.am (changeword.la): Removed.
8102 * modules/changeword.c: File removed.
8103 * doc/m4.texinfo: References to changeword and --word-regexp
8105 * po/POTFILES.in: modules/changeword.c removed.
8106 * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
8107 * tests/builtins.at (changeword): Test removed.
8109 2001-08-30 Akim Demaille <akim@epita.fr>
8111 * bootstrap.sh: Create aclocal.m4 instead of modifying it.
8112 This also help having a single list of m4 files: in
8114 * config/Makefile.am (STANDARD_MACROS): Rename as...
8115 (ACLOCAL_MACROS): this.
8116 (list-standard-macros): Remove.
8119 2001-08-29 Gary V. Vaughan <gary@gnu.org>
8121 In an attempt to moderate my egomania...
8122 * tests/modules.at: Remove attributions.
8124 * tests/generate.awk: When making substitutions to "@&t@", either
8125 "&" or "\&" in the substitution string argument to gsub refer back
8126 to the matched text. "@\\&t@" seems to work though, Tests 43 and
8129 2001-08-29 Akim Demaille <akim@epita.fr>
8131 * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
8132 (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
8133 (sync-lines, trace, translit, undivert, wrap): Move to...
8134 * tests/builtins.at: this new file.
8135 * tests/others.at (Discard comments, import-environment): Move to...
8136 * tests/options.at: this new file.
8138 2001-08-29 Akim Demaille <akim@epita.fr>
8140 * tests/others.at (Freezing modules)
8141 (--module-directory: absolute path, modpath2, modpath3)
8142 (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
8143 * tests/modules.at: here, new file.
8144 * tests/others.at, tests/generate.awk: Add a banner.
8145 * tests/testsuite.at: Adjust.
8146 (AT_CHECK_M4_FILTER): New, but unused.
8148 2001-08-29 Akim Demaille <akim@epita.fr>
8150 * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
8152 * tests/others.at (wrap): Inline wrap.m4.
8153 (shadow): Inline shadow.m4.
8154 (iso8859): Don't specify the path from top_srcdir, but from srcdir.
8155 * tests/m4: Simplify.
8157 2001-08-29 Akim Demaille <akim@epita.fr>
8159 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
8162 2001-08-29 Akim Demaille <akim@epita.fr>
8164 * tests/generate.awk (normalize): s/@__@/@&t@/.
8166 2001-08-28 Akim Demaille <akim@epita.fr>
8168 * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
8170 2001-08-28 Gary V. Vaughan <gary@gnu.org>
8172 * bootstrap (generate.awk): Generate test cases with new script.
8174 2001-08-27 Akim Demaille <akim@epita.fr>
8176 * tests/Makefile.am (installcheck-local): Don't use
8177 `dc_install_base' which is not visible here, but `exec_prefix'
8178 which is clearly the RT anyway.
8179 * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
8180 related to testing a now installed m4.
8181 * tests/m4: Do it here.
8183 2001-08-27 Akim Demaille <akim@epita.fr>
8185 * tests/others.at (indir): Formatting change.
8187 2001-08-27 Akim Demaille <akim@epita.fr>
8189 * tests/Makefile.am (installcheck-local): New.
8190 * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
8192 Prefer options over envvars.
8193 * src/main.c (main): First bug caught by the test suite (yeah!):
8194 --batch lacked a `break' which resulted in an accidental
8195 invocation of --discard-comments.
8197 2001-08-27 Akim Demaille <akim@epita.fr>
8199 * tests/others.at (capitalize, changeword, comments, ddivert)
8200 (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
8201 (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
8202 (sysv-args, trace, translit, undivert): Don't rely on files in
8203 examples/: AT_DATA them.
8205 2001-08-27 Akim Demaille <akim@epita.fr>
8207 Let the test suite use a wrapper around the not installed m4 to
8208 pretend it is (installed).
8210 * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
8211 such a way that m4 does not process them.
8212 * configure.in: The package name seems to be `m4', not `M4'.
8214 * tests/atlocal.in (at_package, M4): Remove.
8215 * tests/testsuite.at, tests/others.at: Use m4, not $M4.
8217 2001-08-27 Akim Demaille <akim@epita.fr>
8219 * tests/Makefile.am (CLEANFILES): Remove.
8220 (DISTCLEANFILES, clean-local): New.
8221 * examples/mktests.sh: Remove.
8223 2001-08-27 Akim Demaille <akim@epita.fr>
8225 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
8226 Don't use aclocal: it's written by hand.
8227 * aclocal.m4: m4_include all the files instead of being built by
8229 * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
8230 until it reads the traces by itself.
8231 * configure.in: Require Autoconf 2.42c as we are now using
8232 AC_CONFIG_TESTDIR instead of AT_CONFIG.
8233 Catch unexpanded `jm_' macros.
8234 * config/atconfig.m4: Remove.
8235 * config/error.m4: new.
8236 * config/Makefile.am: Ship the files included by aclocal.m4.
8237 * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
8238 (TESTSUITE_AT): this, to please Automake.
8239 (TESTSUITE): This target uses autotest/autotest.m4, not
8240 autotest/general.m4.
8241 * tests/testsuite.at: Prereq Autotest 2.52c.
8242 * examples/Makefile.am (pkgdata_DATA): Rename as...
8243 (dist_pkgdata_DATA): this.
8244 * doc/Makefile.am (man_MANS): Rename as...
8245 (dist_man_mans): this.
8247 2001-08-20 Gary V. Vaughan <gary@gnu.org>
8249 * m4/system.h [cygwin*]: Thanks to Paul Sokolovsky and
8250 Robert Collins, building on Cygwin no longer requires Windows
8251 import and export symbol decorations.
8252 * m4/m4module.h (M4_SCOPE) [cygwin*]: Deleted all occurences.
8253 * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
8254 * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8255 * m4/error.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8256 * m4/input.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8257 * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8258 * m4/output.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8259 * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8260 * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8261 * configure.in (LIBM4_DLL_IMPORT) [cygwin*]: Don't set this
8263 * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
8264 * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
8266 2001-08-20 Gary V. Vaughan <gary@gnu.org>
8268 Ansify the source. Previously we had a mix, where my code was
8269 in a K&R compatible style, and the preexisting code was in ANSI
8270 style. Nothing is lost wrt release 1.4 by reverting to ANSI,
8271 and now the code base is much cleaner.
8273 * m4/system.h: Remove M4_PARAMS macro and all users. Remove
8274 VOID macro and all users.
8275 * m4/m4module.h: Ansify function prototypes and headers.
8276 * m4/builtin.c: Ditto.
8277 * m4/evalparse.c: Ditto.
8278 * m4/input.c: Ditto.
8279 * m4/macro.c: Ditto.
8280 * m4/module.c: Ditto.
8281 * m4/output.c: Ditto.
8283 * m4/symtab.c: Ditto.
8284 * m4/utility.c: Ditto.
8285 * modules/format.c: Ditto.
8286 * modules/gnu.c: Ditto.
8287 * modules/m4.c: Ditto.
8288 * modules/mpeval.c: Ditto.
8289 * src/freeze.c: Ditto.
8291 * src/main.c: Ditto.
8293 2001-08-20 Akim Demaille <akim@epita.fr>
8295 * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
8296 generated with stock 2.52.
8298 2001-08-20 Akim Demaille <akim@epita.fr>
8300 * config/atconfig.m4: New, until part of Autoconf per se.
8301 * configure.in (AT_CONFIG): Use it.
8303 * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
8304 * tests/atlocal.in: New.
8305 * tests/generate.awk: For the time being, the empty quadrigraph is
8307 * tests/others.at (changeword, gmp): Check the configuration
8308 variable against `yes'.
8309 * tests/testsuite.at (dnl): Allow it, as it's used all over the
8312 2001-08-20 Akim Demaille <akim@epita.fr>
8314 * m4/utility.c (m4_numeric_arg): Spell out the culprit.
8315 * modules/m4.c (undivert): Disable the possibility of undiverting
8316 several files at once: it is not documented, it is inconsistent
8317 with the other macros, it can be straightforwardly mocked by
8318 several invocations, and most importantly, it prevents the
8319 possibility of other kinds of extension.
8320 Use `m4_numeric_arg'.
8322 2001-08-20 Akim Demaille <akim@epita.fr>
8324 * examples/include.m4: Typo.
8325 * tests/generate.awk: Really add it.
8326 * tests/Makefile.am: Adjust.
8327 * tests/others.at (Discard comments): It sure fails without `-c'.
8328 (include, undivert): Add -I examples/.
8330 2001-08-20 Akim Demaille <akim@epita.fr>
8332 Use sprintf, not ecft and friends since it is standard, portable,
8333 simplifies the code, and since the latter is even deprecated
8334 according to the GNU libc documentation.
8336 * modules/format.c: Drop evct support.
8338 2001-08-19 Gary V. Vaughan <gary@gnu.org>
8340 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up. Don't test
8342 * configure.in: ...do it here instead.
8344 * c-boxes.el: Deleted.
8345 * m4/builtin.c: Reformat box comments to be closer to GNU
8347 * m4/debug.c: Ditto.
8349 * m4/evalparse.c: Ditto.
8350 * m4/input.c: Ditto.
8351 * m4/m4module.h: Ditto.
8352 * m4/macro.c: Ditto.
8353 * m4/output.c: Ditto.
8354 * m4/symtab.c: Ditto.
8355 * m4/utility.c: Ditto.
8356 * modules/changeword.c: Ditto.
8357 * modules/format.c: Ditto.
8358 * modules/gnu.c: Ditto.
8359 * modules/load.c: Ditto.
8360 * modules/m4.c: Ditto.
8361 * modules/modtest.c: Ditto.
8362 * modules/mpeval.c: Ditto.
8363 * modules/perl.c: Ditto.
8364 * modules/shadow.c: Ditto.
8365 * modules/stdlib.c: Ditto.
8366 * modules/time.c: Ditto.
8367 * src/freeze.c: Ditto.
8368 * src/main.c: Ditto.
8370 2001-08-17 Gary V. Vaughan <gary@gnu.org>
8372 * m4/module.c: Fixup some errors in the description comment.
8374 2001-08-17 Akim Demaille <akim@epita.fr>
8376 * tests/others.at (iso8859): Specify the path to the M4 test file.
8377 * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
8378 files in error messages.
8380 2001-08-17 Akim Demaille <akim@epita.fr>
8382 * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
8383 * tests/others.at: Adjust input files paths.
8384 * tests/atconfig.in: Set top_builddir.
8385 * tests/Makefile.am: Adjust.
8386 `testsuite' is in src, not build.
8388 2001-08-17 Akim Demaille <akim@epita.fr>
8390 * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
8391 (generate.at): Install a temporary hack until the actual
8392 generate.awk is added to the repository.
8393 * tests/atconfig.in: New.
8395 2001-08-17 Akim Demaille <akim@epita.fr>
8397 Really apply the patch ``Drop Autoconf 2.13 compatibility.''
8399 2001-08-17 Akim Demaille <akim@epita.fr>
8401 * doc/m4.texinfo: Promote proper quotation.
8403 2001-08-17 Akim Demaille <akim@epita.fr>
8405 Remove the non Autotest tests.
8407 * tests/other-tests/capitalize.test,
8408 * tests/other-tests/changeword.test,
8409 * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
8410 * tests/other-tests/debug.test,
8411 * tests/other-tests/discard-comments.m4,
8412 * tests/other-tests/discard-comments.test,
8413 * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8414 * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8415 * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8416 * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
8417 * tests/other-tests/hanoi.test,
8418 * tests/other-tests/import-environment.m4,
8419 * tests/other-tests/import-environment.test,
8420 * tests/other-tests/include.test, tests/other-tests/indir.test,
8421 * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
8422 * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
8423 * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
8424 * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
8425 * tests/other-tests/modtest.test,
8426 * tests/other-tests/multiquotes.test,
8427 * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
8428 * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
8429 * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
8430 * tests/other-tests/sync-lines.m4,
8431 * tests/other-tests/sync-lines.test,
8432 * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8433 * tests/other-tests/translit.test, tests/other-tests/undivert.test,
8434 * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8435 * tests/other-tests/wrap.test: Remove.
8437 * tests/run-test, tests/get-them: Remove.
8438 * tests/Makefile.am: Adjust.
8440 2001-08-17 Akim Demaille <akim@epita.fr>
8442 others.at no longer depends on other-tests/.
8444 * tests/others.at (stackovf): You're actually...
8446 (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
8447 (unload.test): Keep their authorship.
8448 (discard-comments, gmp, import-environment, modfreeze)
8449 (sync-lines): Embed the input files.
8450 * tests/stackovf.test: Copy from other-tests/stackovf.test.
8451 * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
8453 2001-08-17 Akim Demaille <akim@epita.fr>
8455 * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
8456 (M4exit): Tag the exit status of the example.
8457 * tests/get-them: Adjust.
8458 * tests/generate.awk: New, based on get-them.
8459 * tests/Makefile.am: Adjust to generate `generated.at'.
8460 * tests/testsuite.at: Adjust.
8461 (AT_CHECK_M4): Don't overquote. Blush...
8463 2001-08-17 Akim Demaille <akim@epita.fr>
8465 Start using Autotest. atconfig creation is still lacking.
8467 * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
8468 * examples/reverse.m4, tests/other-tests/import-environment.m4,
8469 * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
8470 * tests/other-tests/import-environment.test: Don't check LANGUAGE
8471 as it might be `unset', or set to `C'.
8472 * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
8473 * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8474 * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8475 * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
8476 * tests/other-tests/shadow.test: Adjust.
8477 * tests/testsuite.at, tests/others.at: New.
8478 * tests/Makefile.am: Adjust.
8480 2001-08-17 Akim Demaille <akim@epita.fr>
8482 Drop Autoconf 2.13 compatibility.
8484 * configure.in (changeword): No need to undefine it, as anyway if
8485 it's defined, M4sugar moved it as m4_changeword.
8486 And anyway, proper quotation is enough.
8487 (m4_pattern_allow): As it exists in 2.50, just use it.
8488 (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
8489 Don't handle Gettext's duties, let it handle them.
8490 * config/gnu-obstack.m4: Use m4_pattern_allow directly.
8492 2001-08-17 Akim Demaille <akim@epita.fr>
8494 * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
8495 (m4_errprint): Use fputs.
8496 * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
8497 dumpdef are not concerned.
8498 (Dumpdef, Errprint): Emphasize their insensitivity to
8500 * doc/Makefile.am: Add `TAGS' support.
8501 (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
8503 * config/Makefile.am (MAINTAINERCLEANFILES): New.
8505 2001-08-17 Akim Demaille <akim@epita.fr>
8507 * modules/Makefile.am (ETAGS_ARGS): New.
8509 2001-08-17 Akim Demaille <akim@epita.fr>
8511 * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
8514 2001-08-17 Akim Demaille <akim@epita.fr>
8516 * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
8518 2001-08-17 Akim Demaille <akim@epita.fr>
8520 * m4/m4module.h (m4/list.h): Don't include it.
8522 2001-08-16 Gary V. Vaughan <gary@gnu.org>
8524 m4_modules are no more, we use lt_dlhandles directly and let
8525 latest libltdl features manage the list of loaded modules.
8526 * acinclude.m4: Regenerated.
8527 * m4/ltdl.c: Updated from master copy.
8528 * m4/module.c: Reimplemented to take advantage of advances in
8530 * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
8531 list with lt_dlhandle_next.
8532 (m4_builtin_find_by_func): Ditto.
8533 (m4_builtin_table_install): Use lt_dlhandle.
8534 (m4_macro_define): Ditto.
8535 (m4_macro_table_install): Ditto.
8536 m4/module.h: Prototype new module management API.
8537 (m4_modules): No longer required.
8538 (m4_module_init_t, m4_module_finish_t): POSIX namespace
8539 violations, renamed to...
8540 (m4_module_init_func, m4_module_finish_func): ...these,
8542 (M4INIT_HANDLER): Clean way to declare init functions in modules.
8543 (M4FINISH_HANDLER): And similarly for finish functions.
8544 * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
8545 -- Add indirection to the CONC macro so that arguments are
8547 * modules/modtest.c (m4_init_module): Replaced with M4INIT_HANDLER.
8548 * modules/shadow.c (m4_init_module): Ditto.
8549 Due to new init function semantics, be careful to perform the
8550 initialisation only on first load.
8551 * modules/perl.c (m4_init_module): Ditto. And Ditto.
8552 (m4_finish_module): Replaced with M4FINISH_HANDLER.
8553 Due to new finish function semantics, be careful to perform the
8554 finalisation only on first load.
8555 * m4/m4private.h (m4_module): Removed in favour of...
8556 (m4_module_data): ...structure without all the wrapper fields.
8557 Instances of this new structure are stored associated lt_dlhandles
8558 with lt_dlcaller_data_set().
8559 * m4/builtin.c (m4_builtin_define): Takes a handle argument
8560 instead of the old module argument.
8561 (m4_builtin_table_install): Ditto.
8562 * modules/load.c (m4_resident_module): Removed. This is no
8563 longer implemented as a magic symbol...
8564 * modules/m4.c (m4_resident_module): Ditto.
8565 * modules/load.c (M4INIT_HANDLER): ...the module init function now
8566 uses the ltdl api to make the module resident.
8567 * modules/m4.c (M4INIT_HANDLER): Ditto.
8568 * modules/load.c (builtin_modules): Traverse the loaded module
8569 list with lt_dlhandle_next.
8570 (builtin_load): Much simplified in light of the reimplemented
8572 * src/freeze.c (produce_module_dump): Cleaned up and optimised in
8573 light of the m4/module.c rewrite.
8574 (produce_symbol_dump): Ditto.
8575 (reload_frozen_state): Ditto.
8576 * m4/list.c, m4/list.h: Files deleted. No longer required.
8577 * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
8578 (libm4_la_SOURCES): Delete list.c reference.
8579 * m4/m4private.h (m4_token_data): Add a handle field. This
8580 eliminates many of the searches to find the handle associated with
8581 various tokens that are passed between functions.
8582 (struct m4_symbol): Removed the module field. The
8583 module association does not belong with the symbol...
8584 * m4/input.c (struct m4_builtin): ...it belongs with the builtin
8585 that the module implementation code is from. Added a handle
8587 (m4_push_macro): Add a `handle' argument. Changed all callers.
8588 (init_macro_token): Set the `handle' field for the
8590 * m4/macro.c (expand_argument): Copy the new handle field during
8592 * modules/m4.c (macro_install): Use the new handle field to
8593 optimise the search for the correct builtin structure, and pass
8594 the handle details to m4_builtin_define.
8596 2001-08-15 Akim Demaille <akim@epita.fr>
8598 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
8599 when creating `m4/obstack.h'.
8600 * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
8602 * tests/defs: Make them absolute.
8603 (CDPATH) Neutralize.
8604 * tests/gethem: Use them.
8606 2001-08-14 Gary V. Vaughan <gary@gnu.org>
8608 * config/ltmain.sh: Doh! Import again for a quoting fix that
8609 prevented any regression test from passing.
8611 * m4/m4module.h (obstack.h): Choose between installed version
8612 and shipped version based on configure tests.
8613 * src/freeze.c (obstack.h): Ditto.
8615 * acconfig.h: Removed. No longer required.
8617 * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
8618 * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
8619 them to AC_INIT and AM_INIT_AUTOMAKE.
8620 * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
8621 disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
8622 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
8623 shell variable m4_cv_func_obstack_h.
8624 * tests/defs (M4): Be more careful about relative path to libtool
8625 script and m4 binary by using $srcdir.
8627 * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
8628 optargs to the existing libltdl search path.
8629 * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
8630 * m4/ltdl.c: Updated.
8632 * config/ltmain.sh: Ditto.
8634 2001-08-11 Gary V. Vaughan <gary@gnu.org>
8636 * src/main.c (main): Add `-b' (for `batch') mode switch to force
8637 interactive mode off.
8639 2001-08-10 Akim Demaille <akim@epita.fr>
8641 * configure.in: Require Autoconf 2.52.
8642 (AC_ARG_PROGRAM): Remove, handled by Automake.
8643 (m4_getopt): Rename as...
8644 (m4_getopt_h): this.
8645 Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
8646 Undefine `changeword' only if defined.
8647 * config/gnu-obstack.m4: Require Autoconf 2.52.
8648 (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
8651 2001-08-09 Yuji Minejima <ggb01164@nifty.ne.jp>
8653 * doc/m4.texinfo: Fix some typos, and apply some small
8656 2001-08-09 Andreas Schwab <schwab@suse.de>
8658 * src/main.c (main): Fix improper uses of error (missing format
8661 2001-08-07 Akim Demaille <akim@epita.fr>
8663 Improve `make distcheck'.
8665 * configure.in: Be sure to be able to run `mkconfig.sh' when src
8667 * Makefile.am (dist-hook): Remove, as it is no longer needed.
8668 * doc/m4.texinfo (Include): Add missing blank.
8669 * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
8672 2001-08-07 Akim Demaille <akim@epita.fr>
8674 * m4/evalparse.c: A better introductory comment.
8675 * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
8676 * m4/macro.c: Adjust old comments.
8677 * modules/README: Typo.
8679 2001-08-07 Akim Demaille <akim@epita.fr>
8681 * config/gnu-obstack.m4: New.
8683 2001-08-07 Akim Demaille <akim@epita.fr>
8685 * config/Makefile.am, config/stackovf.m4: New.
8686 * configure.in, Makefile.am: Adjust.
8688 2001-08-05 gettextize <bug-gnu-utils@gnu.org>
8690 * po/Makefile.in.in: Upgrade to gettext-0.10.39.
8691 * po/cat-id-tbl.c: Remove file.
8692 * po/stamp-cat-id: Remove file.
8694 2001-04-08 Roderick Koehle <Roderick.Koehle@infineon.com>
8696 * modules/format.c (format): Formatting for %f was not
8697 interpreting the position of the decimal point correctly for
8700 2000-12-01 Gary V. Vaughan <gary@gnu.org>
8702 * TODO: Removed m4exit bug.
8703 * modules/load.c (m4_resident_module): Make this module resident.
8704 * module/m4.c (m4_resident_module): Ditto.
8705 * m4/modules.c (m4_module_load): Use new ltdl resident modules
8706 feature to mark modules as resident if they export
8707 `m4_resident_module' as TRUE.
8708 (m4_module_unload): Do not remove resident modules, and take care
8709 with symbol insertion and deletion with resident modules.
8710 * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
8711 use resident modules feature.
8713 2000-11-30 Gary V. Vaughan <gary@gnu.org>
8715 * TODO: Updated. Removed some cruft that has since been fixed
8716 or implemented. Added some more entries.
8719 * modules/README: Updated.
8720 * doc/m4.texinfo: Updated.
8722 * modules/gnu.c (builtin_functions): Make indir orthogonal to
8723 builtin, in that each is recognised as a macro only with parameters
8724 (builtin_indir): Passing 0 arguments is now an error, as with
8727 * src/main.c (usage): Added missing description of `-c' option.
8729 2000-11-29 Gary V. Vaughan <gary@gnu.org>
8731 Consolidate the myriad of dispersed test scripts into the
8732 tests subdirectory. I think I now have all the file where I
8733 want them, so there shouldn't be anymore upheaval =)O|
8735 * tests/Makefile.am: Updated to run the new tests added below.
8736 * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
8737 tests/other-tests/ddivert.test, tests/other-tests/debug.test,
8738 tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8739 tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8740 tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8741 tests/other-tests/hanoi.test, tests/other-tests/include.test,
8742 tests/other-tests/indir.test, tests/other-tests/misc.test,
8743 tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
8744 tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8745 tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8746 tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
8747 tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
8748 tests/other-tests/reverse.test, tests/other-tests/shadow.test,
8749 tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8750 tests/other-tests/translit.test, tests/other-tests/undivert.test,
8751 tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8752 tests/other-tests/wrap.test: New tests based on the contents
8753 of the tests removed below.
8754 * examples/Makefile.am, modules/Makefile.am: Updated to
8755 reflect removed tests.
8756 * examples/defs,modules/defs: Removed.
8757 * examples/capitalize.test, examples/comments.test,
8758 examples/ddivert.test, examples/debug.test,
8759 examples/esyscmd.test, examples/exp.test,
8760 examples/foreach.test, examples/forloop.test,
8761 examples/fstab.test, examples/hanoi.test,
8762 examples/include.test, examples/indir.test,
8763 examples/misc.test, examples/multiquotes.test,
8764 examples/patsubst.test, examples/pushpop.test,
8765 examples/regexp.test, examples/reverse.test,
8766 examples/sysv-args.test, examples/trace.test,
8767 examples/translit.test, examples/undivert.test,
8768 examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
8769 modules/modpath1.test, modules/modpath2.test,
8770 modules/modpath3.test, modules/modpath4.test,
8771 modules/modtest.test, modules/shadow.test,
8772 modules/unfrozen.m4, modules/unload.test: Removed.
8774 Move the implementation of GMP support for the mpeval() builtin
8775 into a loadable module that depends on libgmp. mpeval() and
8776 eval() share a common parser, now in m4/evalparser.c; the code
8777 in m4/numb.c and m4/numb.h is now physically split between
8778 m4/eval.c (the eval() backend) and modules/mpeval.c (the
8779 mpeval() backend), rather than being differentiated by cpp
8780 macros and multiple inclusion. The mpeval module is always
8781 built but will generate an diagnostic if it is used from an
8782 installation that didn't link in the gmp library.
8783 * modules/Makefile.am: build and install the new mpeval module.
8784 * modules/mpeval.c: Now contains the former parts of m4/numb.c
8785 and m4/numb.h that are required for gmp support in mpeval().
8786 * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
8787 * m4/evalmp.c: Removed.
8788 * m4/m4module.h: Removed conditional prototype for
8790 * m4/eval.c: Rewritten. Contains the former parts of m4/numb.c
8791 and m4/numb.h that do not rely on gmp.
8792 * m4/evalparse.c: New file, contains the shared parts of the
8793 eval() and evalmp() parser implementations, and is no longer
8794 unencumbered by cpp magic to uncover the right parts.
8795 * m4/numb.h: Removed. It's former contents are split between
8796 m4/eval.c and modules/mpeval.c.
8799 * tests/other-tests/changeword.test: New test. Rudimentary
8800 testing of changeword builtin runs only if --wnable-changeword
8801 was used at configure time.
8802 * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
8803 alternation correctly. Split into two expressions to compensate.
8804 * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
8805 * modules/Makefile.am: Build changeword module.
8806 * modules/changeword.c (m4_macro_table): Define __m4_changeword__
8807 only when --enable-changeword was passed to configure.
8808 (builtin_changeword): If --enable-changeword was not used, then
8809 report that changeword() builtin has no support in m4 binary.
8811 2000-11-28 Gary V. Vaughan <gary@gnu.org>
8813 * src/main.c (main): Fixed a particularly nasty bug is
8814 user_search_path setting -- the -M flag processing must be
8815 extremely careful with search path ordering, or else the default
8816 installed module directory (possibly containing modules from a
8817 previous release) is placed earlier in the search path than any -M
8818 arguments (which are relied upon to load uninstalled modules with
8819 most of the tests in the regresion suite).
8821 * modules/load.c (builtin_load): Nasty hack to prevent adding
8822 symbols to symtab again if a module is loaded more than once.
8823 * modules/m4.c (builtin_ifelse): removed unused variable argv0.
8825 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed a
8826 possible NULL pointer dereference.
8828 * m4/module.c (m4_module_find_by_modname): Renamed from
8829 m4_module_modname_find. Fixed all references.
8830 (m4_module_find_by_builtin): New function.
8832 * modules/modfreeze.test: load the `load' module with each
8834 * src/freeze.c (produce_frozen_state): Simplified in light of
8835 module field in m4_symbol. Allow a third argument for text macros
8836 to name the originating module.
8837 (reload_frozen_state): ditto.
8838 * m4/m4module.h: Fixup prototypes.
8839 * m4/builtin.h (m4_builtin_define): Add a module argument so
8840 that symbols can be registered against the defining module.
8841 (m4_macro_define): ditto.
8842 * m4/m4private.h (m4_symbol): Make the module field const to save
8843 on casting in the rest of the code.
8844 (SYMBOL_MODULE): New macro.
8846 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
8847 symbol reference maintenance bugs when removing a symbol from the
8850 * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
8852 2000-11-27 Gary V. Vaughan <gary@gnu.org>
8854 * configure.in (m4_cv_func_obstack): A better check for whether
8855 libc has an obstack implementation.
8856 * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
8858 * configure.in (--with-modules): Changed semantics. This
8859 option is now used to list modules to be preopened.
8860 * src/m4.h: #include "ltdl.h" unconditionally.
8861 * src/main.c: Removed all dependencies on WITH_MODULES.
8862 * src/freeze.c: ditto.
8863 * modules/Makefile.am: ditto.
8864 * m4/m4.c (builtin_m4exit): ditto.
8865 * modules/modpath1.test: ditto.
8866 * modules/modpath2.test: ditto.
8867 * modules/modpath3.test: ditto.
8868 * modules/modpath4.test: ditto.
8869 * modules/modtest.test: ditto.
8870 * modules/shadow.test: ditto.
8871 * modules/unload.test: ditto.
8873 * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
8874 comes up on demand in LTLIBOBJS now.
8875 * configure.in (getopt_long): Creating and relying on a link for
8876 getopt.h on hosts with no getopt_long() of thier own works
8877 correctly now. This is necessary so that callers of getopt_long()
8878 can simply `#include <getopt.h>': the naive way of doing this
8879 would end up using our own getopt.h and the installed
8880 getopt_long(), which is asking for trouble!
8881 (obstack_init): A similar argument applies to obstack.h and
8884 * m4/ltdl.c: Upgraded to latest bleeding edge version again.
8885 On Solaris-2.5 (at least) the native dlopen implementation
8886 gets confused about m4.o when looking for module "m4". This
8887 version always looks for .la an .$lib_ext suffixed names first
8888 to work around the problem. Sigh.
8890 * po/POTFILES.in: Take account of these file movements.
8891 * src/Makefile.am (m4_SOURCES): removed eval.c.
8892 (EXTRA_m4_SOURCES): removed numb.c and numb.h.
8893 * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
8894 (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
8895 * modules/m4.c (builtin_eval): Use m4_evaluate().
8896 * m4/eval.c: Moved here from src/eval.c to facilitate
8897 implementation of eval() builtin as part of the `m4' loadable
8899 (m4_evaluate): renamed from evaluate for namespace cleanliness.
8900 * m4/numb.c: Moved here from src/numb.c, since it is #included
8901 into eval.c at compile time.
8902 * m4/m4module.h (m4_evaluate): Added prototype.
8903 * src/m4.h (evaluate): Removed prototype.
8905 2000-11-25 Gary V. Vaughan <gary@gnu.org>
8907 * modules/perl.c (builtin_perleval): Use PL_na for
8908 compatibility with perl-5.6.
8910 * src/main.c (main): It is now safe to
8911 ``m4_module_install("m4")'', without tripping over the m4
8913 * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
8914 versions having fixed the insidious module search order bug.
8916 * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
8917 supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
8919 * configure.in: Figure out whether to use the installed
8920 getopt.h or the supplied one.
8921 * src/Makefile.am: ditto.
8923 * po/POTFILES.in: List files in their new positions.
8925 * config/ltmain.sh: This needs to be checked in to match the
8926 libtool macros copied to acinclude.m4 (until a released
8927 libtool copes with m4's needs).
8928 * bootstrap: Run gettextize.
8930 2000-11-24 Gary V. Vaughan <gary@gnu.org>
8932 * AUTHORS: Added my details.
8935 * bootstrap: temporary update until released libtool catches up.
8937 * All files: Use new GNU GPL copyright blurb with current contact
8940 * configure.in (LTLIBOBJS): Use canonical code for calculation of
8943 * config: renamed acm4 directory to config to be more like
8944 other autoconfiscated packages.
8946 * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
8947 * config/debug.m4: New file implementing configure macros to add
8948 suitable debug flags to the compiler invocation.
8950 * modules/load.c: New file implementing the ``load'' and
8951 ``unload'' builtins.
8952 * tests/get-them: Set the module search directory to the modules
8953 build directory in generated tests.
8954 * modules/shadow.test: ditto.
8955 * modules/modtest.test: ditto.
8956 * modules/modpath1.test: ditto.
8957 * modules/modpath2.test: ditto.
8958 * modules/modpath3.test: ditto.
8959 * modules/modpath4.test: ditto.
8960 * modules/modtest.test: ditto.
8961 * modules/modfreeze.test: ditto.
8962 * modules/unload.test: ditto.
8964 * modules/changeword.c: New file implementing the ``changeword''
8965 builtin as a loadable module.
8966 * modules/mpeval.c: New file implementing the ``mpeval'' builtin
8967 as a loadable module.
8969 * src/main.c (main): Load the gnu module if m4 was started
8970 normally -- i.e. without the -G option.
8971 * modules/gnu.c: New file implementing a new loadable module wuth
8972 definitions for all the gnu extension builtins.
8973 * modules/format.c: Moved here from src/format.c. Now included
8976 * src/main.c (main): Load the traditional module if m4 was
8977 started in `no_gnu_extensions' mode.
8978 * modules/traditional.c: New file implementing the ``unix'' macro,
8979 required when m4 is executed in traditional mode, as a loadable
8982 * src/main.c: Renamed from m4.c to avoid confusion with
8984 (main): Always load the m4 module.
8985 * modules/m4.c: New file implementing a new loadable module with
8986 definitions for all m4 builtins that are not gnu extensions.
8988 * m4/Makefile.am: Adjusted to take new files below into account.
8989 * m4/m4module.h: Prototypes for exported functions and types moved
8990 to this directory from the src directory.
8991 * m4/m4private.h: Moved here from src/m4private.h to facilitate
8992 the migration of all builtin implementations to loadable modules.
8993 * m4/macro.c: Moved this file here from the src directory,
8994 renaming all exported symbols to use the prefix ``m4_''.
8995 * m4/builtin.c: ditto.
8996 * m4/module.c: ditto.
8997 * m4/symtab.c: ditto.
8998 * m4/debug.c: ditto.
8999 * m4/input.c: ditto.
9000 * m4/output.c: ditto.
9002 * m4/ltdl.h, m4/ltdl.c: ditto.
9003 * m4/utility.c: Odd functions moved here from files in the src
9004 directory to facilitate builtin migration.
9006 2000-08-12 Gary V. Vaughan <gary@gnu.org>
9008 * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
9009 error message, to make translators' jobs a little easier.
9010 (builtin_builtin): ditto.
9011 (builtin_traceon): ditto.
9012 (builtin_traceoff): ditto.
9013 Reported by Akim Demaille <akim@epita.fr>
9015 * m4/Makefile.am (pkgincdir): Deleted. Use automake's built in
9016 pkgincludedir instead.
9018 * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
9019 it is exported globally. Fixed all references.
9023 (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
9024 globally. Fixed all references.
9025 (DEF_LQUOTE): ditto.
9029 2000-07-28 Gary V. Vaughan <gary@gnu.org>
9034 * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
9035 (AC_OUTPUT): touch stamp-h.in, not stamp-h.
9037 * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
9038 Removed `Prev', `Next' and `Up' fields of all @nodes now that
9039 makeinfo calculates them for us, and to make any future
9040 reorganisation easier.
9041 (Frozen files): Document format version 2.
9042 `V' now takes argument `2'.
9043 `F' can take a single argument if symbol and builtin names
9044 are the same, or 3 arguments if the builtin is from a module.
9045 New `S' specification for saving syntax table contents.
9046 New `M' specification for saving loaded module names.
9047 * src/freeze.c: Implement them.
9048 * src/input.c (syntax_code): For interpreting frozen syntax
9051 * examples/Makefile.am: Add the contents of the WWW directory to
9053 * examples/WWW/Makefile: ditto,
9054 (%.htm): Compares file contents (not just sizes) to determine
9055 whether a change has occured.
9056 * examples/WWW/_header.htm: Bumped version number.
9057 * examples/WWW: Regenerated content.
9059 * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
9060 compilers comes much easier without ansi2knr.
9061 * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
9063 * m4/list.c: New generic list container type.
9064 * m4/list.h: Interface to new container type.
9065 * m4/Makefile.am (pkginc_HEADERS): Install list.h.
9066 (libm4_la_SOURCES): compile and link list.c.
9067 * src/builtin.c (builtin_tables): Use list container.
9068 * src/module.c (symtab): ditto.
9069 * src/symtab.c (symtab): ditto.
9071 * m4/system.h: New file for common preprocessor definitions.
9072 * m4/Makefile.am (pkginc_HEADERS): install system.h.
9073 * m4/error.c: Use system.h in place of inline preprocessor.
9074 * m4/error.h: ditto.
9075 * m4/module.c: ditto.
9076 * m4/module.h: ditto.
9077 * m4/xmalloc.c: ditto.
9079 * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
9081 * m4/xmalloc.c (xmalloc_exit_failure): ditto.
9083 * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
9084 it is exported globally. Fixed all references.
9086 (module_init_t): ditto.
9087 (module_finish_t): ditto.
9088 (token_data): ditto.
9089 (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
9090 it is exported globally. Fixed all references.
9091 (SYNTAX_IGNORE): ditto.
9092 (SYNTAX_SPACE): ditto.
9093 (SYNTAX_OPEN): ditto.
9094 (SYNTAX_CLOSE): ditto.
9095 (SYNTAX_COMMA): ditto.
9096 (SYNTAX_DOLLAR): ditto.
9097 (SYNTAX_ACTIVE): ditto.
9098 (SYNTAX_ESCAPE): ditto.
9099 (SYNTAX_ALPHA): ditto.
9100 (SYNTAX_NUM): ditto.
9101 (SYNTAX_ALNUM): ditto.
9102 (SYNTAX_LQUOTE): ditto.
9103 (SYNTAX_RQUOTE): ditto.
9104 (SYNTAX_BCOMM): ditto.
9105 (SYNTAX_ECOMM): ditto.
9106 (SYNTAX_VALUE): ditto.
9107 (SYNTAX_MASKS): ditto.
9125 (TOKEN_NONE): ditto.
9126 (TOKEN_STRING): ditto.
9127 (TOKEN_SPACE): ditto.
9128 (TOKEN_WORD): ditto.
9129 (TOKEN_SIMPLE): ditto.
9130 (TOKEN_MACDEF): ditto.
9132 * m4/m4module.h (voidstar): Removed in favour of `VOID' for
9133 consistency. Fixed all references.
9134 (STRING): Renamed to `m4_string' for consistency, and because if
9135 is exported globally. Fixed all references.
9136 (token_type): Renamed to `m4_token_t' for the same reasons.
9137 (token_data_type): Renamed to `m4_token_data_t' for the same
9140 * m4/m4module.h (XCALLOC): Wrapper macro which handles type
9144 (XFREE): Wrapper macro which avoids freeing NULL pointers.
9146 * m4/m4module.h (m4_macro): New type for module defined user
9148 * modules/modtest.c (m4_macro_table): Define module user macros.
9149 * modules/shadow.c (m4_macro_table): ditto.
9151 * m4/m4module.h (M4BUILTIN_HANDLER): For defining handlers
9152 declared with M4BUILTIN.
9154 * m4/xmalloc.c: Use memset if bzero is not available when
9155 emulating calloc with malloc.
9156 (xcalloc): Fallback to malloc/bzero if calloc is not available.
9157 (xfree): Added for consistency. Will not try to free NULL
9159 * src/m4.c (xfree): Deleted in favour of the above.
9160 * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
9161 linking with libdmalloc.
9162 * m4/xstrdup.c (WITH_DMALLOC): ditto.
9164 * modules/frozen.m4: New test case.
9165 * modules/unfrozen.m4: ditto.
9166 * modules/modfreeze.test: New test.
9167 * modules/unload.test: ditto.
9168 * modules/Makefile.am (EXTRA_DIST): Distribute them.
9170 * modules/modpath1.test: Don't try this test if module support is
9172 * modules/modpath2.test: ditto.
9173 * modules/modpath3.test: ditto.
9174 * modules/modpath4.test: ditto.
9175 * modules/modtest.test: ditto.
9176 * modules/shadow.test: ditto.
9178 * modules/perl.c: New module.
9179 * modules/perl.m4: Example of using it.
9180 * modules/Makefile.am (perl_la_SOURCES): Build new perl module.
9182 * src/m4.c (main): Assume interactive mode if STDIN is connected
9184 Changed startup sequence slightly so that syntax is not
9185 initialised from here when loading a frozen file.
9187 * src/builtin.c: Much improved macro definition style.
9188 * src/m4private.h: Internal structures for m4_builtin and
9189 m4_macro instances. These are not exposed to module writers.
9190 * src/module.c (module_modname_find): Find a module structure
9192 (make_macro_table): Build an internal macro table from a external
9194 (make_builtin_table): Build an internal builtin table from an
9195 external definition.
9197 * src/module.c (module_unload): Be extremely careful to remove
9198 builtins and macros that match the module being unloaded -- no
9199 longer assume that the top element can be removed incase another
9200 odule defines an identical name.
9201 * src/symtab.c (remove_table_reference_symbols): remove all symbol
9202 table entries which refer to a given builtin table.
9203 * src/builtin.c (remove_tables): Use it!
9205 2000-07-13 Thomas Tanner <tanner@ffii.org>
9207 * Makefile.am (SUBDIRS): we need modules/ for "make dist"
9208 * acm4/modules.m4: deleted
9209 * bootstrap: don't libtoolize libltdl!
9210 * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
9211 if set, enable WITH_MODULES and add modules to DLPREOPEN
9212 * examples/misc.test: redirect standard output
9213 * lib/Makefile.am: don't use DLLDFLAGS
9214 * lib/m4module.c: include necessary headers to silence GCC -Wall
9215 * lib/m4regex.c: fixes to silence GCC -Wall
9216 * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
9217 build modules conditionally
9218 * modules/shadow.c: define symbol aliases before using them
9219 * modules/test.c: define symbol aliases before using them
9220 * po/de.po: update translation
9221 * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
9222 pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
9224 * src/m4.c: initialize libltdl's preloaded symbols via
9225 LTDL_SET_PRELOADED_SYMBOLS
9226 * src/module.c: libltdl's memory management must be initialized
9227 before calling lt_dlinit!, fix warnings
9229 2000-01-18 Gary V. Vaughan <gary@gnu.org>
9231 * README: Caveat about nls not supported by dll architecture on
9234 * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
9236 * tests/Makefile.am (stamp-TESTS): now works with VPATH.
9237 * src/Makefile.am (m4_LDADD): use $(builddir) for VPATH.
9238 * modules/Makefile.am (LIBS): ditto.
9239 (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
9240 $(top_srcdir)/m4 (for only <m4module.h>).
9241 * modules/shadow.test: fixed for VPATH.
9242 * modules/modtest.test: ditto.
9243 * modules/modpath4.test: ditto.
9244 * modules/modpath3.test: ditto.
9245 * modules/modpath2.test: ditto.
9246 * modules/modpath1.test: ditto.
9248 * modules/time.test: Removed due to timezone dependence,
9249 * modules/Makefile.am (TESTS): Removed time.test.
9251 * configure.in: Use $3 of AC_DEFINE so that we can,,,
9252 * acconfig.h: Remove everything except the gettext parameters.
9253 * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
9255 * acm4/ltdl.m4: Updated to latest from libtool cvs.
9256 * acm4/modules.m4: Remove code which duplicates ltdl.m4 and
9257 increment serial number.
9259 * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
9260 src dir and immediately after libm4 is built for confidence that
9261 it doesn't rely on the src directory.
9262 (SUBDIRS): Moved doc dir to the end since helptoman.pl and
9263 makeinfo stop the build on cygwin (because they don't work).
9265 * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
9267 * m4/m4private.h: ...is not a public header, so moved to src.
9268 Add `#include <config.h>', `#define _COMPILING_M4' and
9270 * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
9271 * src/Makefile.am (noinst_HEADERS): add m4private.h.
9272 * src/builtin.c: `#include "m4private.h"' now takes care of the
9273 above. Duplicates removed.
9274 * src/debug.c: ditto.
9275 * src/eval.c: ditto.
9276 * src/evalmp.c: ditto.
9277 * src/format.c: ditto.
9278 * src/freeze.c: ditto.
9279 * src/input.c: ditto.
9281 * src/macro.c: ditto.
9282 * src/module.c: ditto.
9283 * src/numb.h: ditto.
9284 * src/output.c: ditto.
9285 * src/path.c: ditto.
9286 * stackovf.c: ditto.
9289 * po/POTFILES.in: compensate for renaming of lib/*.
9290 * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
9291 (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
9292 and then in $(top_srcdir)/lib (for eg. "m4private.h").
9293 * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
9295 * m4/m4error.h: Renamed error.h, for installation to
9296 $prefix/include/m4..
9297 * m4/m4obstack.h: Renamed obstack.h, for same reason.
9298 * m4/m4regex.h: Renamed regex.h, for same reason.
9299 * m4/m4error.c: Renamed error.c, and use #include "error.h".
9300 * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
9301 * m4/m4regex.c: Renamed regex.c, and fix #includes.
9303 * lib: moved to m4 to easily support header installation to
9305 * Makefile.am (SUBDIRS): renamed lib dir to m4.
9306 * configure.in (AC_OUTPUT): reference m4/Makefile.in.
9307 * acm4/regex.m4: Point to m4/regex.c.
9309 * examples/foreach.m4: Sanitise quoting.
9310 * examples/foreach.test: New torture test.
9311 From Akim Demaille <akim@epita.fr>
9313 2000-01-17 Gary V. Vaughan <gary@gnu.org>
9315 * src/ltdl.c: Use access() to abort doomed module load attempts
9316 if module file does not exist.
9318 * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
9319 getopt1.o will already be used if appropriate, so I moved getopt.c
9320 and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
9322 * modules/modpath1.test: Use correct filename in header line.
9323 * modules/modpath2.test: ditto.
9324 * modules/modpath3.test: ditto.
9325 * modules/modpath4.test: ditto.
9327 Without these changes lt_dlopen("test") attempts to
9328 LoadLibrary("/bin/test") on Windows, which although harmless
9329 generates a spurious error message which spoils most of the tests:
9330 * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
9331 (TESTS): s/test.test /modtest.test /
9332 (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
9333 (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
9334 * modules/modpath1.test: s/test.m4 /modtest.m4 /
9335 * modules/modpath2.test: ditto.
9336 * modules/modpath4.test: ditto.
9337 * modules/modpath3.test: s/-m test /-m modtest /
9338 * modules/shadow.m4: use {un,}loadmodule(`modtest').
9340 2000-01-16 Gary V. Vaughan <gary@gnu.org>
9342 * src/ltdl.c (find_file): Updated to new version with fixed memory
9343 allocation bug in `next'.
9344 * src/ltdl.h: updated to match.
9346 * modules/Makefile.am: Cleaned up and reordered.
9348 2000-01-16 René Seindal <rene@seindal.dk>
9350 * modules/Makefile.am (TESTS): New tests for the module system.
9352 * modules/*.test: New files.
9354 * src/m4.c (main): Added call to module_init().
9355 Treats -M and -m as the arguments -D -U and -t, ie deferred.
9357 * src/m4.h: Added declaration of module_init().
9359 * src/module.c (module_init): No longer static
9361 * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
9362 Added to shut up automake about non standard libtool library
9365 * src/module.c: Disabled DEBUG by default.
9367 * modules/README: Changed example from unload.m4 to shadow.m4
9369 * modules/shadow.m4: Renamed from unload.m4
9371 * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
9373 * src/m4.c (main): Functionality for -m and -M were reversed.
9376 2000-01-12 Gary V. Vaughan <gary@gnu.org>
9378 * doc/help2man.pl: updated to version 1.020.
9380 * lib/COPYING.LIB: updated to version 2.1.
9382 * lib/m4module.h: restructure the M4_SCOPE code to work when
9383 creating a dll which links with libm4.la and both DLL_EXPORT
9384 (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
9387 2000-01-11 Gary V. Vaughan <gary@gnu.org>
9389 Merged the following changes from my tree:
9391 1999-06-15 Gary V. Vaughan <gary@gnu.org>
9393 * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
9394 ported to compile shared libs.
9396 * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
9397 use `__declspec(dllimport)' when linking libm4.la on win32.
9398 * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
9400 * configure.in (M4OBJS): Discover whether we need the shipped
9401 implementation of getopt_long.
9402 * src/Makefile.am (m4_LDADD): Link the getopt objects into the
9403 main binary here, as opposed to the module library in lib/libm4.la.
9405 1999-06-14 Gary V. Vaughan <gary@gnu.org>
9407 * modules/README: Updated to describe the improved libltdl based
9409 * README (cygwin): Added some compilation notes for building m4
9410 correctly under cygwin.
9411 * TODO: Cleaned out the entries for the module system since they
9412 are now implemented.
9414 * *.[ch]: __P is in the compiler's reserved namespace, so replaced
9415 all instances of __P with M4_PARAMS.
9417 * lib/getdate.h: removed unreferenced file.
9419 * lib/m4private.h: New file to define the private interface to the
9420 token_data struct, which must be shared between m4module.c, and
9421 builtin.c but not exported to modules built from the installed
9422 m4module.h since it's size changes depending on compile time
9425 * src/m4.h: Lots of stuff moved to lib/m4module.h.
9427 * lib/m4module.h: New file to define the interface available when
9428 compiling m4 modules.
9429 * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
9430 necessary for module compilation into this new file.
9432 * lib/Makefile.am (include_HEADERS): install headers (renamed to
9433 avoid nameclash with other system headers) necessary for compiling
9435 (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
9436 so that modules can include the (renamed) installed headers and
9437 be guaranteed a matching implementation.
9438 * lib/m4error.h: renamed from error.h.
9439 * lib/m4obstack.h: renamed from obstack.h.
9440 * lib/m4regex.h: renamed from regex.h.
9441 * configure.in (AC_REPLACE_FUNCS): Don't look for a system
9442 implementation, simply include the shipped version
9443 unconditionally, otherwise it is hard for a module to know
9444 whether the m4obstack.h header it is using matches the
9445 implementation it ends up linking against.
9446 (jm_WITH_REGEX): Include regex into libm4 unconditionally for
9449 1999-05-18 Gary V. Vaughan <gary@gnu.org>
9451 * examples/misc.test: Don't run this test on machines which don't
9452 have a root user in /etc/passwd (e.g. cygwin).
9454 * tests/get-them (/^@example$/): Error messages might have a
9455 ``.exe'' suffix to the program name, or else use the libtool
9456 ``.libs/lt-m4'' binary, or generally have an unexpected path. All
9457 of these cases are now catered for when comparing error messages
9459 * tests/other-tests/*.test: ditto.
9460 * examples/*.test: ditto.
9462 * tests/defs (M4): use libtool execute mode.
9463 * examples/defs (M4): ditto.
9465 * tests/get-them (END): explicitly close any open file.
9466 (printthem): In a regular expression, '{' is the start of a repeat
9467 count! Use `[{]' for a literal open brace.
9468 (/^@node /): Don't use substr on a string shorter than the trim
9471 1999-05-17 Gary V. Vaughan <gary@gnu.org>
9473 * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
9475 (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
9477 2000-01-10 Andreas Schwab <schwab@suse.de>
9479 * tests/other-tests/gmp.test: Find config.sh in build directory.
9481 * configure.in: Find tests/mkconfig.sh in $srcdir.
9483 * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
9484 <signal.h> (for SUS2 compliant systems).
9486 * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
9489 2000-01-10 René Seindal <rene@seindal.dk>
9493 * TODO, NEWS: Cleaned up and updated.
9495 * src/m4.c (main): New variable exit_status for exit status in
9496 case of unreadable files. Now m4 will exit with EXIT_FAILURE if a
9497 file cannot be read instead of EXIT_SUCCESS.
9499 * src/builtin.c (m4_indir): Changed error message to help
9500 translators (from Akim Demaille <demaille@inf.enst.fr>).
9502 * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
9505 * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
9508 * src/input.c (match_input): Reordering of code, to avoid multiple
9509 calls to push_string_init() from obstack_grow(), which can happen
9510 with some compilers (found and fixed by James Bonfield
9511 <jkb@mrc-lmb.cam.ac.uk>).
9513 * src/stackovf.c: Added prototypes for ultrix.
9514 (setup_stackovf_trap): Added __P to cast.
9515 (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
9517 2000-01-09 René Seindal <rene@seindal.dk>
9519 * doc/m4.texinfo (Changequote): Added comment about changing
9520 quotes when the old quote is a part of the new.
9522 * src/builtin.c (expand_ranges): Added break after trailing dash.
9523 This caused misbehavious on some systems (found and fixed by Akim
9524 Demaille <demaille@inf.enst.fr>).
9526 * AUTHORS: Thomas Tanner included
9528 * acconfig.h: Added entry for ss_sp (see below).
9530 * configure.in (use_stackovf): Added check for stack_t with member
9531 ss_base instead of ss_sp (BSDI notably). (Reported by Paul Eggert
9532 <eggert@twinsun.com>).
9534 * doc/m4.texinfo (Frozen files): Added a simpler example for
9535 generating frozen files from several input files.
9537 1999-11-14 Paul Eggert <eggert@twinsun.com>
9539 * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
9540 lib/regex.c, lib/xmalloc.c.
9542 1999-11-10 René Seindal <rene@seindal.dk>
9544 * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
9546 * src/module.c: reindented.
9547 (module_load): return if this is a repeated load of same module.
9548 (module_init): slight change of logic to avoid repeated
9549 initialisation debug messages.
9551 * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
9552 in the distribution.
9554 * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
9555 automake warnings about missing lib prefix.
9556 (time_la_LDFLAGS): ditto
9557 (stdlib_la_LDFLAGS): ditto
9559 1999-11-10 Paul Eggert <eggert@twinsun.com>
9561 * src/m4.h: Include error.h, since our macros use error.
9562 * src/m4.c: Don't need to include error.h.
9564 1999-11-09 Paul Eggert <eggert@twinsun.com>
9566 * src/m4.h (voidstar): Define to void * if __STDC__ is defined
9567 and zero, as Solaris 7 cc does.
9568 (bcopy): Remove macro; no longer needed with new obstack.h.
9570 * src/output.c (freeze_diversions): Don't assume that a
9571 diversion size can fit in `int'. Check for diversion file
9572 size too large to be printed with `unsigned long'.
9574 * src/Makefile.am (CFLAGS): Omit -Wall.
9576 * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
9578 * src/debug.c (trace_format):
9579 Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
9581 * src/freeze.c (produce_frozen_state):
9582 Don't assume string lengths fit in int.
9584 1999-10-13 René Seindal <rene@seindal.dk>
9586 * po/cs.po: Czech translation added.
9588 * po/sv.po: Updated Swedish translation.
9590 * po/ru.po: Updated Russian translation.
9592 * po/pl.po: Updated Polish translation.
9594 * po/el.po: Greek translation added.
9596 1999-10-13 René Seindal <rene@seindal.dk>
9598 * configure.in (ALL_LINGUAS): Added Greek translation (el).
9599 (ALL_LINGUAS): Added Czech translation (cs).
9601 1999-03-30 Gary V. Vaughan <gary@gnu.org>
9603 * src/builtin.c: moved module loading functions into...
9604 * src/module.c: entirely new implementation using libltdl.
9605 * po/POTFILES.in: added src/module.c.
9606 * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
9607 are modules, not linktime libraries.
9608 (LDFLAGS): added -no-undefined -module and -avoid-version flags.
9609 * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
9610 avoidance on exported symbols.
9611 * modules/test.c (m4_macro_table, m4_init_module,
9612 m4_finish_module): ditto.
9613 * modules/time.c (m4_macro_table): ditto.
9615 * modules/time2.m4: new file which requires command line loading
9617 * src/m4.c (--load-module): dynamically load named runtime module
9618 into running executable before reading the source.
9619 (--module-directory): prepend a directory to the module search
9621 (module_init()): Do this the first time we load a module instead;
9622 if the module subsystem is broken normal m4 scripts can still run.
9623 * src/m4.h (install_builtin_table): is now exported.
9625 1999-03-26 Gary V. Vaughan <gary@gnu.org>
9627 * src/module.c: removed. No longer required.
9628 * po/POTFILES.in: removed src/module.c.
9630 * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
9631 the bootstrap script can recreate.
9632 * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
9633 * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
9634 * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
9635 * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
9636 (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
9637 * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
9638 * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
9639 * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
9641 * acinclude.m4: removed. `aclocal -I acm4' handles this much
9643 * acm4/Makefile.am (ACINCLUDE_M4): ditto.
9644 * acm4/gettext.m4: removed. It causes a multiple definition vs.
9645 the installed gettext.m4 file when running aclocal.
9647 1999-03-25 Gary V. Vaughan <gary@gnu.org>
9649 * configure.in (AM_INIT_AUTOMAKE): bumped version number to
9650 distinguish this from the last prerelease.
9651 (AC_LIBLTDL_CONVENIENCE): build libltdl as a convenience library
9652 in its own subdirectory.
9654 * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
9655 lib prefix on a module" feature.
9656 (LDFLAGS): Added `-module -avoid-version' flags to build
9657 versionless module libraries.
9658 * src/builtin.c (m4_load_module): use libltdl.
9659 (module_unload_all): use libltdl.
9660 * src/m4.c (module_init): initialise module loading on demand for
9661 better diagnostics, and so that m4 will still work even if
9662 the module code is broken.
9663 * src/m4.h (module_init): removed. No longer relevant.
9664 * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
9665 exported symbols for compatibility with dlpreopening.
9666 * modules/test.c (m4_macro_table, m4_init_module,
9667 m4_finish_module): ditto.
9668 * modules/time.c (m4_macro_table): ditto.
9670 * bootstrap: New file. Runs all the autoutils in the right order
9671 after a fresh checkout, or a make maintainer-clean.
9673 1999-02-18 Akim Demaille <demaille@inf.enst.fr>
9675 * src/builtin.c (dump_symbols): New function, factoring common
9676 content of m4_dumpdef and m4_symbols.
9677 (m4_dumpdef): Use it.
9678 (m4_symbols): New function, implementing `symbols'. Use it.
9679 * doc/m4.texinfo: Fixed missing commas after @xref, so that the
9680 file compile with modern makeinfo.
9681 (Symbols): New node, documenting symbols.
9682 (direntry): Modernize.
9684 1998-12-11 René Seindal <rene@seindal.dk>
9686 * src/builtin.c (predefined_tab): New predefined macros
9687 __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
9688 configure time options.
9690 1998-12-01 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
9692 * src/module.c (module_try_load): Don't try to be clever and
9693 overwrite argument string. Instead allocate all constructed
9694 strings locally, since they can have arbitrary lengths. Make
9695 arguments pointers to const.
9696 (module_search): Simplify due to above change.
9698 1998-11-29 René Seindal <rene@seindal.dk>
9702 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
9704 * tests/other-tests/import-environment.{m4,test}: New test.
9706 * tests/other-tests/discard-comments.{m4,test}: New test.
9708 * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
9710 * src/m4.c (main): New option -c --discard-comments.
9711 New global variable discard_comments.
9713 * src/m4.h (token_type): New TOKEN_NONE for tokens to be
9714 discarded, ie never returned from next_token().
9715 Added declaration of discard_comments.
9717 * src/input.c (next_token): Now loops until token type is not
9718 TOKEN_NONE. Comments are now given this type when comments should
9721 * doc/m4.texinfo (Invoking m4): Updated for --import-environment
9724 1998-11-28 René Seindal <rene@seindal.dk>
9726 * src/m4.c (main): New option --import-environment (no single
9729 * When configured with --with-gmp both the normal (fast) eval()
9730 and the gmp aware mpeval() are defined. To restore previous
9731 bahaviour use "define(`eval', defn(`mpeval'))".
9733 * tests/other-tests/gmp.m4: Changed to use mpeval().
9735 * src/evalmp.c: New file for compiling eval.c as gmp aware.
9736 Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
9738 * src/eval.c: Now includes "numb.c" directly. Everything in this
9739 file must by static, except evaluate(), which is changed to
9740 mp_evaluate() if USE_GMP in force.
9742 * src/numb.c: Changed to be included by eval.c instead of being
9743 compiled separately. Everything is declared static.
9745 * src/numb.h: Removed declarations of functions, as numb.c is now
9748 * src/builtin.c: Declaration of m4_mpeval() added.
9749 Inserted `mpeval' in builtin table.
9750 (do_eval): New function with common code for m4_eval and m4_mpeval.
9751 (m4_mpeval): New function for gmp version of eval.
9753 * src/m4.h: Declaration of mp_evaluate().
9755 * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
9756 (EXTRA_m4_SOURCES): Now has numb.c and numb.h
9758 * src/m4.c (main): m4 --version also shows which options were used
9759 for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
9761 1998-11-27 René Seindal <rene@seindal.dk>
9763 * Error messages now always print program name before input file
9764 name as specified by GNU coding standards. Reported by Akim
9765 Demaille <demaille@inf.enst.fr>.
9767 * doc/m4.texinfo (Include): Change due to changed error message
9771 * tests/get-them: Minor change to sed script due to changed error
9774 * src/m4.c (print_program_name): New func used to print program
9775 name, input file and line number in error (). Used as an
9776 error_print_progname handler.
9777 (reference_error): Removed.
9778 (main): Assigns error_print_progname.
9780 * src/m4.h (M4ERROR): Removed reference_error ().
9782 1998-11-25 René Seindal <rene@seindal.dk>
9784 * Updated to libtool 1.2b.
9786 * src/builtin.c (install_builtin_table): Added braces to avoid
9787 warning of ambiguous 'else'.
9789 * src/module.c: Inserted search path code from path.c modified to
9791 (module_init): Configured default path used only if M4MODPATH is
9793 (module_try_load): Now reads libMODULE.la as generated by libtool
9794 for actual module name.
9795 (module_load): Gives better error messages on failure.
9797 * src/m4.h: Added declarations of structures and functions for
9798 generic search path handling.
9800 * src/path.c: Removed all module specific code and introduced new
9801 functions of more generic search path handling.
9803 1998-11-24 René Seindal <rene@seindal.dk>
9805 * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
9806 included gettext, as <libintl.h> might not be found
9807 otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
9809 1998-11-22 René Seindal <rene@seindal.dk>
9811 * src/output.c (insert_diversion): Fixed bug that might cause m4
9812 to read from standard output! Triggered by input
9813 'divert(1)undivert(0)'. Test for divnum>0 changed to divnum>=0,
9814 so now 'undivert(0)' does nothing.
9816 1998-11-18 René Seindal <rene@seindal.dk>
9820 * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
9821 could be changed when compiling a illegal regexp, causing later
9822 use of the regexp to dump core.
9824 * src/module.c (module_load): Changed error message to conform to
9827 * src/m4.c (usage): Added message about reporting bugs.
9829 * doc/m4.texinfo (Changeword): Corrected a wrong example.
9830 (Changeword): Added note about the type of regexps used.
9832 * ltconfig, ltmain.sh: New files from Libtool 1.2.
9834 * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
9835 and AM_PROG_LIBTOOL.
9837 * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
9840 * modules/Makefile.am: Changed completely to compile modules using
9841 libtool. The modules are compiled as shared libraries, and are
9842 renamed when installed.
9844 * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
9845 USE_SHL_LOAD to HAVE_SHL_LOAD
9847 * src/builtin.c (shipout_string): Now tests for a NULL string.
9849 * src/module.c: New level of indirection around non-portable
9850 functions to load shared objects. Intended to encapsulate the non
9851 portable parts better and to reduce the number of #ifdefs in the
9854 * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
9855 directory modules/ to the distribution.
9857 1998-11-15 René Seindal <rene@seindal.dk>
9861 * modules/stdlib.c: New module `stdlib' defining some standard
9862 functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
9863 getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
9865 * src/builtin.c (shipout_string): New convenience function for
9866 builtins and modules.
9868 * src/module.c (module_load): Tentative support for
9869 shl_load/shl_findsym, but I cannot test it. Copied from MetaHTML.
9871 * Makefile.am (SUBDIRS): Directory modules added if configured.
9873 * modules/Makefile.am: Now correctly compiles and installs
9874 modules in pkglibexecdir.
9876 * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
9877 These two are now initialised by autoconf macros.
9879 * src/path.c (module_env_init): MODULE_PATH is always on the
9882 * src/Makefile.am: Now generated pathconf.h which defined the
9883 default MODULE_PATH.
9885 * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
9886 where modules are installed.
9888 * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
9889 by Brian J. Fox <bfox@datawave.net>. This change allow modules to
9890 build and install automatically, and it is prepared for other
9891 interfacec than dlopen().
9893 * src/builtin.c (predefined_tab): Added __m4_version__ for the
9894 current version of GNU m4. It is a GNU extension.
9896 1998-11-14 René Seindal <rene@seindal.dk>
9898 * tests/Makefile.am (GENERATED_TESTS): Added new
9899 generated-tests/changesy.8.test
9901 * doc/m4.texinfo (Changesyntax): Documentation for escape
9904 * src/macro.c (expand_token): Check for escaped macro call before
9905 symbol table lookup.
9907 * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
9910 * src/input.c: New static variable use_macro_escape, which is TRUE
9911 iff some character has code SYNTAX_ESCAPE
9912 (input_init): Added initialisation of use_macro_escape.
9913 (check_use_macro_escape): New function to synchronise
9914 use_macro_escape with the syntax table.
9915 (set_quotes): Added call to check_use_macro_escape()
9918 (next_token): Added new case for IS_ESCAPE.
9920 * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
9922 1998-10-13 René Seindal <rene@seindal.dk>
9926 * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
9929 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
9930 maintained tests in tests/other-tests. These currently tests for
9931 8-bit transparency, multiple precision arithmetic and sync-line
9932 output. Test for stackoverflow detection does not work.
9934 * examples/Makefile.am (TESTS): Added tests for all example files.
9936 * examples/mktests.sh: New file. Help program for creating test
9939 * tests/mkconfig.sh: New file to generate tests/config.m4 and
9940 tests/config.sh. This is for tests of configure selectable
9941 features. Picks up all set WITH_ and ENABLE_ veriables from
9944 * src/path.c (path_search): Added argument 'char **expanded_name'
9945 to return the expanded name.
9947 * src/m4.h: Added 2nd argument to declaration of path_search().
9949 * src/m4.c (main): Added 2nd argument to path_search().
9951 * src/freeze.c (reload_frozen_state): Do.
9953 * src/builtin.c (m4_undivert): Do.
9956 1998-10-11 René Seindal <rene@seindal.dk>
9958 * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
9960 * acm4/modules.m4: New file. Defines AM_WITH_MODULES.
9962 * acm4/gmp.m4: New file. Defines AM_WITH_GMP.
9964 * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
9966 * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
9968 * intl/: Updated to GNU gettext 0.10.35.
9970 * doc/m4.texinfo (Format): Documented that format is blind.
9972 * src/builtin.c (builtin_tab): Builtin format marked as blind.
9974 1998-10-07 René Seindal <rene@seindal.dk>
9978 * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
9979 .test, as the files are no longer just m4 input.
9981 * tests/get-them (FILE): Changed .m4 extension to .test.
9983 * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
9984 Otherwise quoted strings with leading whitespace first in a macro
9985 argument would be eliminated.
9987 * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
9988 (expand_argument): Do.
9990 * src/input.c (next_token): SPACE and NUM/OTHER characters are only
9991 grouped together iff both quote and comment strings are single
9992 character. Otherwise they might include a comment/quote leader.
9993 (next_token): Returns new token type TOKEN_SPACE.
9995 * src/builtin.c (push_builtin_table): New function to push a
9996 builtin_table on the stack without installing its contents.
9997 (find_builtin_by_name): Added call to push_builtin_table() if
9998 reading frozen files. Otherwise the builtins named in the frozen
9999 files could not be found.
10000 (install_builtin_table): Changed to use push_builtin_table()
10002 1998-10-04 René Seindal <rene@seindal.dk>
10004 * po/pl.po: Polish translation added.
10006 * po/POTFILES.in: src/module.c added.
10008 1998-10-04 René Seindal <rene@seindal.dk>
10012 * configure.in (ALL_LINGUAS): Added Polish pl.po
10014 1998-10-03 René Seindal <rene@seindal.dk>
10016 * Many files: Incorporated changes to implement dynamic modules.
10017 Detailed comments in src/modules.c and modules/README
10019 * src/module.c: New file, implements the OS dependant parts of
10020 dynamic module loading.
10022 * src/Makefile.am (m4_SOURCES): Added module.c
10024 * src/builtin.h: New file, declares some functions from builtin.c
10025 that are of use for other modules (shipout_int, numeric_arg,
10026 skip_space, bad_argc), and the macros ARG() and DECLARE().
10028 * src/builtin.c (install_builtin_table): New function. Each
10029 module brings in a builtin_table, which is pushed on a stack.
10030 (struct builtin_table): New struct for list of builtin_tables.
10031 (m4_loadmodule): New function to implement builtin "loadmodule".
10032 (shipout_int): No longer static, to be used by modules.
10036 (builtin_init): changed to call install_builtin_table()
10037 (find_builtin_by_name): Now searches all builtin_tables
10038 (find_builtin_by_addr): do.
10040 * src/path.c: Reorganised to allow for two search paths, one for
10041 include files and one for modules.
10043 * src/m4.h: Added declarations for new functions in module.c and
10046 * src/m4.c (main): Added call to module_init().
10048 * modules: New directory with a few demo modules.
10050 * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
10053 * configure.in: Added modules/Makefile to AC_OUTPUT.
10055 * configure.in: Added code to implement --with-modules. Tests for
10056 <dlfcn.h> and -ldl.
10058 * acconfig.h: Added WITH_MODULES
10060 1998-10-02 René Seindal <rene@seindal.dk>
10062 * examples/Makefile.am (pkgdata_DATA): Removed special target for
10063 check and variables TESTS. These tests are now run from the
10066 * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
10067 directory. The files stay there but the tests are run from the
10070 * tests/Makefile.am (EXTRA_DIST): Added run-test.
10072 * tests/run-test: New file. Run a test manually
10074 * tests/Makefile.am, tests/get_them: Moved automatically generated
10075 tests (from the manual) to sub directory tests/gentest/. The
10076 tests/ directory had gotten a bit messy.
10078 1998-09-06 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10080 * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
10081 wrap}.test: Added a few testcases.
10083 1998-08-21 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10087 * lib/Makefile.am (noinst_HEADERS): regex.h added
10089 * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
10090 acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
10092 * acm4/Makefile.am: created providing rules to create
10093 $(top_srcdir)/acinclude.m4 to be used by aclocal.
10095 * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
10096 `C'. Reported by Ulrich Drepper.
10098 * Makefile.am (SUBDIRS): Removed checks directory
10099 * configure.in (AC_OUTPUT): Removed checks/Makefile
10101 * doc/m4.texinfo (Patsubst,example): @comment added to preserve
10102 the space when m4.texinfo is edited and whitespace.el is active.
10103 (Defn,example): idem.
10105 1998-08-20 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10107 * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
10108 ../COPYING. ../Makefile is a file which is certainly present when
10109 test is executed in testSubDir. One can't be sure that the COPYING
10110 file is in .. or ../.. in all situations, the ../Makefile is
10113 * doc/m4.texinfo (Include): adjusted expected test output
10114 according to new tests, i.e. the input will always come from the
10115 file `in' created by the test.
10117 * tests/Makefile.am: Added three lines at the top to get
10118 esyscmd.1.test working.
10120 * tests/get-them: modified to generate clearer tests who will need
10121 less maintenance when new test examples are created in
10122 `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
10123 need the generic file `defs') shell scripts creating `in', `ok',
10124 `out' and when apropriate `okerr' and `err' in the directory
10125 `testSubDir' when executed. The compare of `ok' and `out'
10126 (and of `okerr' and `err') will be the exit status of the test.
10127 `out' must match `ok' (and `okerr' must match `err') for the test
10130 * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
10131 the tests generated by tests/get-them getting it input normally
10132 from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
10133 (dot) before the numeric part) is reserved for all other (hand
10134 written) tests. The `+' means one or more times.
10136 1998-08-12 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10138 * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
10139 supported short man page to refer to info documentation
10140 * helptoman.pl: added
10141 * configure.in: AC_PATH_PROG(PERL,perl)
10142 * Makefile.am (SUBDIRS): doc after src
10144 * libitized with libit 0.5 from
10145 ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
10147 * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
10148 * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
10149 replacement functions, (libm4_a_LIBADD): @LIBOBJS@
10150 * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
10151 lib/rx.{c,h}: added
10152 * configure.in (AC_CHECK_FUNC): getopt_long
10154 * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
10156 * TODO: added entry about dependencies
10158 1998-08-10 René Seindal <rene@seindal.dk>
10162 * doc/m4.texinfo (Changesyntax): Added documentation for the macro
10165 * src/builtin.c (m4_changesyntax): Added builtin macro
10166 "changesyntax" to modify the syntax table.
10168 * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
10169 table. All categories are assigned a syntax code and tokens are
10170 read according to this table.
10172 1998-08-09 René Seindal <rene@seindal.dk>
10174 * src/numb.{c,h}: New files, implements multiple precision eval
10175 using GNU gmp. Originally submitted by John Gerard Makecki
10176 (johnm@vlibs.com), later modified. Tested with GNU gmp 2.0.2.
10178 * doc/m4.texinfo (Eval): Added documentation for multiple
10179 precision arithmetic library support.
10181 * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
10182 to accommodate multiple precision eval.
10184 1998-08-07 René Seindal <rene@seindal.dk>
10186 * src/input.c (MATCH, match_input), src/m4.h: changed definition
10187 of comment and quote strings to `unsigned int' to allow eight bit
10188 chars (reported by andrewb@zip.com.au (Andrew Bettison)).
10190 * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
10191 patch from Mike Howard <mike@clove.com>
10193 1998-08-06 René Seindal <rene@seindal.dk>
10195 * gettext.m4: corrected AM_WITH_NLS to handle use of installed
10198 1998-08-03 René Seindal <rene@seindal.dk>
10202 * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
10203 and _ macro. M4 now builds with --disable-nls.
10205 * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
10206 to look for right message catalogs. Call indef'ed by ENABLE_NLS.
10208 * configure.in (ALL_LINGUAS): Added complete list of translations:
10209 de fr it ja nl ru sv.
10211 1998-05-23 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10213 * po/nl.po: Dutch translation by Erick Branderhorst.
10215 * po/fr.po: French translation by Erick Branderhorst, based on the
10216 translations by François Pinard in fr.msg and m4.cod.
10218 1998-05-22 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10222 * src/m4.c: #include <signal.h> not <sys/signal.h>.
10224 * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
10226 * checks/Makefile.am: explicit list tests in CHECKS.
10228 * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
10229 src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
10230 mkinstalldirs, install-sh: Added automake (1.3) support.
10232 * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
10233 obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
10234 Used libitize (0.4) to update.
10236 * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
10237 (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
10238 README accordingly.
10240 * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
10241 stack overflow functionality.
10243 1994-12-03 François Pinard <pinard@iro.umontreal.ca>
10245 * Prerelease 1.4.1.
10247 * Makefile.in (realclean-local): Delete stamp-h.in.
10249 * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
10250 Localize, adapting from how it is done in sharutils.
10252 * fr.tt: New file, for French.
10254 * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
10255 src/freeze.c: Rename PRODUCT to PACKAGE.
10257 1994-11-26 François Pinard <pinard@iro.umontreal.ca>
10259 * configure.in: Check for <libintl.h> and <locale.h>.
10260 * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
10261 src/stackovf.c: Rename _ to __P.
10262 * src/m4.h: Declare _ as a macro returning its argument, or else,
10263 include <libintl.h> and declare _ as gettext.
10264 * src/m4.c: Possibly include <locale.h> and call setlocale.
10265 * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
10266 src/input.c, src/macro.c, src/output.c, src/path.c,
10267 src/stackovf.c, src/symtab.c: Use _ macro over all localizable
10270 1994-11-07 François Pinard <pinard@iro.umontreal.ca>
10272 * doc/Makefile.in (stamp-vti): Use new -r option to date.
10274 * configure.in: Put --with-gmp in place, in prevision for John
10276 * acconfig.h: Document WITH_GMP.
10278 1994-11-05 François Pinard <pinard@iro.umontreal.ca>
10282 * doc/Makefile.in (realclean): Also remove stamp-vti.
10283 Reported by Eric Backus.
10285 1994-11-02 François Pinard <pinard@iro.umontreal.ca>
10287 * src/freeze.c (produce_frozen_state): If the frozen file cannot
10288 be opened, return immediately after producing the error message.
10289 Reported by Andreas Schwab.
10291 * configure.in: Check for const only after having found possible
10292 ANSIfying compiler flags, this is of no use to check it before.
10293 Reported by Alexander Lehmann.
10295 1994-11-01 François Pinard <pinard@iro.umontreal.ca>
10297 * src/macro.c (collect_arguments): Cast obstack arguments to
10298 (voidstar), so avoiding compiler warnings.
10299 Reported by Joseph E. Sacco.
10301 * src/freeze.c (produce_frozen_state): Cast printed lengths to
10302 (int) so they correspond to %d format items.
10303 Reported by Joseph E. Sacco.
10305 * src/m4.c (main): Cast the argument to xfree to (voidstar).
10306 * src/symtab.c (free_symbol): Idem.
10307 Reported by Karl Vogel.
10309 1994-10-31 François Pinard <pinard@iro.umontreal.ca>
10311 * Makefile.in (DISTFILES): Distribute BACKLOG.
10313 * configure.in: Define PRODUCT and VERSION.
10314 * acconfig.h: Document PRODUCT and VERSION.
10315 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
10316 constant string m4 and variable or parameter named version.
10318 1994-10-30 François Pinard <pinard@iro.umontreal.ca>
10320 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
10321 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
10322 defines __STDC__ to 0, for indicating it is *not* ANSI!
10323 Reported by Kaveh R. Ghazi.
10325 * configure.in: Added obsolescent tests for AIX and Minix.
10327 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
10328 which texclean does not exist anymore.
10329 Reported by Eric Backus, Jim Meyering, John David Anglin and
10332 1994-10-29 François Pinard <pinard@iro.umontreal.ca>
10334 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
10335 Reported by John David Anglin.
10337 * src/ansi2knr.c: New version, sent by Peter Deutsch.
10338 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
10339 ANSI2KNR, depending on the fact the compiler is ANSI or not.
10340 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
10341 Remove the sed filter after ansi2knr for debug.c. Use $O instead
10342 of $U, put underline in extensions rather than in basenames. Use
10343 implicit rules, now that regularity makes this possible.
10344 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
10345 of ansi2knr whenever it is needed.
10346 * configure.in: Adjusted for correct STACKOVF substitution.
10347 * src/debug.c (trace_format): When not __STDC__, use (...) as a
10348 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
10349 Reported by David MacKenzie.
10351 * Makefile.in: Remove binprefix. Use transform_name instead.
10352 Reported by David MacKenzie.
10354 * doc/Makefile.in: Create version.texi, use it, clean it.
10355 Reported by Jim Meyering.
10357 1994-10-28 François Pinard <pinard@iro.umontreal.ca>
10359 * Makefile.in (all, install, uninstall): Depend on Makefile.
10361 * Makefile.in: For actions invoking $(MAKE) from within compound
10362 sh statements, exit non-zero if the sub-make fails. Otherwise,
10363 the top-level make may exit successfully when it should fail.
10364 Reported by Jim Kingdon.
10366 * {,/*}Makefile.in: Use && after all cd, in case they fail.
10368 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
10369 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
10370 * configure.in: Substitute PRODUCT and VERSION.
10372 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
10374 1994-10-27 François Pinard <pinard@iro.umontreal.ca>
10376 * Makefile.in (mostlyclean-local): Do not remove *~.
10377 * */Makefile.in (mostlyclean): Idem.
10378 Reported by Robert E. Brown and Richard Stallman.
10380 1994-10-09 François Pinard <pinard@iro.umontreal.ca>
10382 * src/m4.h: Get rid of CONFIG_BROKETS.
10384 1994-10-02 François Pinard <pinard@iro.umontreal.ca>
10386 * configure.in: Use AC_ARG_PROGRAM.
10387 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
10388 Reported by David MacKenzie.
10390 1994-10-01 François Pinard <pinard@iro.umontreal.ca>
10392 * configure.in: Do not add -O to CFLAGS for GNU C, now that
10393 configure does it automatically.
10394 Reported by Jim Meyering.
10396 1994-09-23 François Pinard <pinard@iro.umontreal.ca>
10398 * src/stackovf.c: Declare the handler_t typedef earlier in the
10399 code, use it for stackovf_handler.
10400 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
10401 casting sigsegv_handler.
10402 Reported by Robert Bernstein.
10404 * src/m4.c (main): Initialize program_name to argv[0] without
10406 Reported by Karl Berry.
10408 1994-09-18 François Pinard <pinard@iro.umontreal.ca>
10410 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
10411 Reported by Karl Berry.
10413 1994-09-14 François Pinard <pinard@iro.umontreal.ca>
10415 * lib/Makefile.in (mostlyclean): Added.
10416 (TAGS): Make in $(srcdir).
10418 * configure.in: Use `choke me' in test, like everywhere!
10420 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
10421 unreacheable and useless.
10423 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
10425 * lib/Makefile.in (DISTFILES): Distribute TAGS.
10426 (distclean): Do not remove TAGS.
10427 (realclean): Remove it.
10428 * Makefile.in: Make TAGS in lib also, not just in src.
10429 Reported by Karl Berry.
10431 * Makefile.in (distclean, realclean): Instead of recursively
10432 calling $(MAKE) for the -local part, allow parallel execution of
10433 -recursive and -local, only delay the removal of config.status,
10434 which is repeated in both goals.
10436 1994-09-13 François Pinard <pinard@iro.umontreal.ca>
10440 * Makefile.in: Group all *clean-recursive goals in one, using sed
10441 to remove `-recursive' while calling make recursively. Also, use
10442 a subshell for each recursive $(MAKE).
10443 Reported by Jim Meyering.
10445 * src/m4.h (memcpy): Define with bcopy for BSD systems.
10446 Reported by Kaveh R. Ghazi.
10448 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
10449 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
10452 * configure.in: Use date instead of touch for stamp-h.
10453 * Makefile.in (stamp-h.in): Idem.
10455 * Makefile.in (distclean, realclean): Force serial execution of
10456 both goals, in case parallel makes are being used.
10457 Reported by Jim Meyering.
10459 * src/Makefile.in (DISTFILES): Distribute TAGS.
10460 (distclean): Do not remove TAGS.
10461 (realclean): Remove it.
10462 Reported by Karl Berry.
10464 1994-09-10 François Pinard <pinard@iro.umontreal.ca>
10466 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
10467 to old names, for following Autoconf.
10469 1994-09-08 François Pinard <pinard@iro.umontreal.ca>
10471 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
10472 ./install.sh will not be correctly referred to in sub-Makefiles.
10473 Reported by John David Anglin.
10475 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
10476 Reported by Eric Backus.
10478 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
10479 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
10480 config.status into remaking this directory's Makefile only.
10481 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
10482 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
10483 Reported by Jim Meyering.
10485 1994-09-06 François Pinard <pinard@iro.umontreal.ca>
10487 * configure.in: Correct stack overflow detection logic, taking
10488 care of systems having only incomplete implementations (like for
10489 Pyramid 9820 OSx 5.0d).
10490 Reported by Kaveh R. Ghazi.
10492 * src/Makefile.in (TAGS): Remote -t from etags call.
10494 1994-09-02 François Pinard <pinard@iro.umontreal.ca>
10496 * lib/Makefile.in (install): Depend on all.
10498 1994-08-31 François Pinard <pinard@iro.umontreal.ca>
10500 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
10501 Reported by Jim Meyering and John David Anglin.
10503 * Makefile.in (distclean-local): Delete config.log.
10504 Reported by Jim Meyering.
10506 Solidify frozen files with respect to -P:
10507 * src/m4.c: Have -P set prefix_all_buitins variable instead of
10508 calling a function by that name. Declare the variable.
10509 * src/m4.h: Adjust declaration for prefix_all_buitins.
10510 * src/builtin.c (builtin_init): Merge in functionality from
10511 previous prefix_all_buitins function, while making entries in the
10512 symbol table, but not modifying the builtin description itself.
10514 * src/freeze.c (reload_frozen_state): Add a useless `break;',
10515 because *many* compilers do not accept an empty `default:'.
10516 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
10517 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
10519 * configure.in: Use AC_TYPE_SIGNAL.
10520 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
10521 Reported by Robert Bernstein.
10523 * checks/Makefile.in (check): Modify PATH so check-them will find
10524 m4 in the src directory.
10525 * Makefile.in (check): Don't.
10526 Reported by Akiko Matsushita and Jim Meyering.
10528 * src/output.c (make_room_for, output_character_helper): New
10529 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
10530 a per buffer MAXIMUM_BUFFER_SIZE.
10532 * src/output.c (output_text): New function, for optimizing the
10533 output of strings of characters. Use it.
10535 1994-08-30 François Pinard <pinard@iro.umontreal.ca>
10537 * doc, src: New directories reorganizing the distribution.
10538 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
10540 * Makefile.in: Adjusted.
10541 * configure.in: Configure new Makefiles.
10543 * m4.h: Declare STRING typedef. Use it for comment and quote
10544 strings, adjusting all references. (This is the rudiments of a
10545 beginning for the eventual withdrawal of NUL terminated strings.)
10546 * output.c (shipout_text): Accept a length parameter, and use it.
10547 All callers adjusted.
10549 1994-08-29 François Pinard <pinard@iro.umontreal.ca>
10551 * m4.h: Include <unistd.h> if it exists.
10552 * stackovf.c: Don't.
10554 Clean up for current_diversion variable:
10555 * output.c: Move current_diversion from builtin.c.
10556 * m4.h: Declare current_diversion so builtin.c can access it.
10557 * output.c (output_init, make_diversion): Initialize or update
10559 * builtin.c (builtin_init, m4_divert): Leave current_diversion
10562 Remove limit on number of diversions:
10563 * output.c: Replace ndiversion by diversions, declare it.
10564 (output_init): Allocate only diversion 0.
10565 (make_diversion): Allocate new diversions as needed.
10566 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
10567 * m4.c: Still accept -N, but do nothing with it.
10568 Reported by David MacKenzie.
10571 * output.c (freeze_diversions): New function.
10572 * m4.h: Declare freeze_diversions.
10573 * freeze.c: Document frozen file format, revise it, call
10574 freeze_diversions to add diversions to frozen format, and code to
10575 reload them properly.
10576 * m4.c: Do not undivert automatically at end when status being
10577 frozen. Do not call builtin_init when reloading frozen state.
10579 Speed up diversion processing:
10580 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
10581 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
10582 structure and variables, cached variables out of output_diversion,
10583 reallocate_diversion_for and OUTPUT_CHARACTER.
10584 (shipout_text, make_diversion, insert_diversion): Adapted to new
10586 (insert_file): Use better buffering.
10587 Reported by David MacKenzie.
10589 1994-08-28 François Pinard <pinard@iro.umontreal.ca>
10591 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
10592 dist works from another build directory.
10594 1994-08-27 François Pinard <pinard@iro.umontreal.ca>
10596 * symtab.c (hack_all_symbols): Use hash_table_size instead of
10597 constant HASHMAX, for -H option to work better.
10599 * builtin.c (DECLARE): Simplify by using _ ().
10601 * freeze.c: New file.
10602 * Makefile.in: Compile it, distribute it.
10603 * m4.c: Recognize, document and process --freeze-state (-F) and
10604 --reload-state (-R) options. Pass a true flag to builtin_init
10605 only if no reloading some state.
10606 * builtin.c (define_builtin): Remove static specifier.
10607 (find_builtin_by_name): Remove static specifier.
10608 (builtin_init): Accept and obey a flag argument.
10609 * m4.h: Add declarations for freeze.c, changes for builtin.c.
10611 1994-08-24 François Pinard <pinard@iro.umontreal.ca>
10613 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
10616 * configure.in: Implement --with-dmalloc.
10617 * acconfig.h: Document WITH_DMALLOC.
10618 * m4.h: Add code for when WITH_DMALLOC.
10620 1994-08-15 François Pinard <pinard@iro.umontreal.ca>
10622 * m4.c (long_options): Use "error-output", the dash was missing.
10623 Reported by Akiko Matsushita.
10625 1994-08-12 François Pinard <pinard@iro.umontreal.ca>
10627 * m4.h: Include <sys/types.h>.
10628 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
10629 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
10631 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
10632 as size_t, not int.
10633 * builtin.c (dump_args): Declare len as size_t, not int.
10635 * debug.c: Prototype the forward declaration of debug_set_file.
10637 * builtin.c (m4_undivert): Replace div by file, for avoiding the
10638 shadowing of this variable.
10639 * output.c (insert_diversion): Idem.
10641 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
10642 (input_init): Duplicate default quote and comment strings.
10643 (set_quotes): Free previous quote strings in all cases. Duplicate
10644 even default quote strings.
10645 (set_comment): Free previous comment strings in all cases.
10646 Duplicate even default comment strings.
10648 * configure.in: Updated for Autoconf 2.0.
10649 * Makefile.in (distclean-local): Also delete config.cache.
10651 * m4.c (usage): Reorganize the --help output by topic. Include a
10652 description for debugging flags.
10654 1994-07-29 François Pinard <pinard@iro.umontreal.ca>
10656 * configure.in: If sigaction is available and SA_ONSTACK defined,
10657 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
10658 defined, use sigvec. Else don't compile stackovf.c.
10659 * stackovf.c (setup_stackovf_trap): Idem.
10660 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
10663 1994-07-21 François Pinard <pinard@iro.umontreal.ca>
10665 * m4.c (usage): Replace printf par fputs.
10667 1994-07-18 François Pinard <pinard@iro.umontreal.ca>
10671 1994-07-17 François Pinard <pinard@iro.umontreal.ca>
10673 * configure.in: Check for sigaction and sigvec. Add a new delayed
10674 check for RLIMIT_STACK, combine in the checking for getrlimit.
10675 All those things are not universally available.
10676 * stackovf.c: Split setting up the trap handler and catching
10677 signals, for better taking care of various configure outcomes.
10678 * examples/stackovf.sh: Correct a typo.
10679 Reported by Eric Backus, Jim Avera and Jim Meyering.
10681 1994-07-16 François Pinard <pinard@iro.umontreal.ca>
10683 * ansi2knr.c: New version sent by its author, Peter Deutsch.
10685 1994-07-15 François Pinard <pinard@iro.umontreal.ca>
10687 * Makefile.in: Modify so parallel make will not try making
10688 lib/libm4.a twice simultaneously.
10689 Reported by Jim Meyering.
10691 1994-07-14 François Pinard <pinard@iro.umontreal.ca>
10693 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
10694 error message, for when no code possibility exists. Even if this
10695 line is completely #ifdef'ed out, it brings a syntax error.
10696 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
10698 * Makefile.in (install): Have install depend on all too, for lib
10699 to be remade as needed.
10701 * examples/stackovf.sh: Try ksh, bsh and bash for shells
10702 providing ulimit, instead of using only ksh.
10703 Reported by Jim Avera and Joseph E. Sacco.
10705 1994-07-12 François Pinard <pinard@iro.umontreal.ca>
10707 * Makefile.in (check): Have it depend on all instead of m4. In
10708 this way, a change in lib will be detected and processed.
10710 * builtin.c (numeric_arg): Use strtol and verify the conversion,
10711 instead of using sscanf which stops as soon as there is a
10712 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
10713 and divert(1xyzzy) were all accepted without any warning or error
10715 * m4.h: Declare strtol as long if not including stdlib.h.
10716 * configure.in: Check for limits.h, and replace strtol if missing.
10717 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
10718 * lib/strtol.c: New file, from elsewhere.
10719 Reported by Andreas Schwab.
10721 1994-07-07 François Pinard <pinard@iro.umontreal.ca>
10723 * macro.c (expand_macro): Cast value to (boolean) prior to
10724 assigning it to traced.
10725 Reported by Tom McConnell.
10727 * Makefile.in (m4): Always make all in lib first.
10728 Reported by Jim Meyering.
10730 1994-07-06 Jim Avera <jima@netcom.com>
10732 * stackovf.c: Isolated OS-dependent sections; Improved portability,
10733 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
10734 handlers), and a default error message if the fault address is not
10735 available (when neither siginfo.h nor BSD sigcontext are supported).
10736 * configure.in: Changes for stackovf.h: Check for sigcontext,
10737 sigaction, sigstack, and define rlim_t as int if necessary.
10738 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
10739 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
10740 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
10742 1994-07-05 François Pinard <pinard@iro.umontreal.ca>
10744 * configure.in: Use AC_SET_MAKE.
10745 * Makefile.in: Use @SET_MAKE@.
10746 Reported by Jim Meyering.
10748 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
10749 Reported by Ian Taylor.
10751 1994-07-02 François Pinard <pinard@iro.umontreal.ca>
10753 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
10754 because siginfo.h is unrelated to standard headers, and siginfo.h
10755 is already checked for.
10756 Reported by Joseph E. Sacco.
10758 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
10760 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
10763 1994-06-29 François Pinard <pinard@iro.umontreal.ca>
10765 * builtin.c (substitute): Use \& to represent this part of the
10766 string which was matched by the whole regexp, instead of
10767 representing the whole string. Any usage of \0 issues a warning
10768 and acts like \&, it will disappear in some subsequent release.
10770 1994-06-27 François Pinard <pinard@iro.umontreal.ca>
10772 * m4.c: Complete prototype for forwarded declaration of usage.
10774 * input.c (init_macro_token): Correct own reference in error
10775 message. Previous name get_macro_func was referred to instead.
10776 (next_char): Correct own reference in error message. Previous
10777 name advance_input was referred to instead.
10779 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
10780 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
10781 and_term, not_term, logical_not_term, cmp_term, shift_term,
10782 add_term, mult_term, exp_term, unary_term, simple_term): Add
10783 prototype to forwarded declarations. Declare parameter v1 as
10784 eval_t * instead of int *. Same for local variable v2 in dyadic
10785 functions. Same for result in exp_term.
10786 * builtin.c (m4_eval): Declare value as eval_t instead of int.
10787 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
10788 unsigned_eval_t instead of unsigned int. Change casts accordingly.
10789 (shipout_int): Cast first argument of ntoa to eval_t.
10790 Reported by Thorsten Ohl.
10792 * macro.c: Complete the prototypes of forwarded expand_macro and
10794 Reported by Thorsten Ohl.
10796 * m4.h: Define voidstar as void * or char * depending on __STDC__.
10797 The Ultrix 3.1 compiler cannot do much with void pointers.
10799 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
10800 * m4.c (xfree): Replace void * by voidstar.
10801 Reported by Tom McConnell.
10803 * ansi2knr.1: New, from elsewhere.
10804 * Makefile.in (DISTFILES): Distribute ansi2knr.1
10806 * Makefile.in (stamp-h.in): Avoid running ./config.status if
10807 stamp-h does not exist yet. This avoids running it a second time
10808 just after the initial ./configure.
10809 Reported by David MacKenzie and Tom McConnell.
10811 * m4.h: Replace the enum debug_info declaration with a series of
10812 #define's. The Ultrix 3.1 compiler would otherwise need casting
10813 (int) to most references, when used in expressions.
10814 Reported by Tom McConnell.
10816 1994-06-25 François Pinard <pinard@iro.umontreal.ca>
10818 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
10819 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
10820 calls the compiler. Previously, FP_PROTOTYPES was only calling
10821 the preprocessor; by not being subject to CFLAGS, this was
10822 discouraging those flags asking for ANSI compilation.
10823 * acconfig.h: Document HAVE_PROTOTYPES.
10824 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
10825 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
10826 Reported by Eric Backus.
10828 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
10829 from the environment. Default CFLAGS to -g if not set.
10830 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
10831 * lib/Makefile.in: Have CFLAGS substituted from configure.
10832 Reported by Eric Backus and Tom McConnell.
10834 * configure.in: m4_undefine changeword before using AC_ENABLE.
10836 * m4.h: Declare prototypes for error (for ANSI compilers only),
10837 prefix_all_builtins and reference_error.
10838 Reported by Tom McConnell.
10840 * input.c (set_word_regexp): Do not try to initialize the array
10841 test from a string, this does not work with non-ANSI compilers.
10842 Reported by Eric Backus.
10844 * Makefile.in (dist): Clean examples/ before saving it.
10845 (distclean-local): Also remove stamp-h.
10846 Reported by Eric Backus.
10848 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
10849 non ANSI compilers.
10850 Reported by Tom McConnell.
10852 * checks/Makefile.in (clean): Depends on mostlyclean.
10853 (mostlyclean): New goal.
10855 1994-06-24 François Pinard <pinard@iro.umontreal.ca>
10857 * Makefile.in (DISTFILES): Distribute install.sh.
10858 * install.sh: New file, copied from elsewhere.
10859 Reported by Assar Westerlund and Kaveh R. Ghazi.
10861 1994-06-23 François Pinard <pinard@iro.umontreal.ca>
10863 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
10864 * acconfig.h: Explain ENABLE_CHANGEWORD.
10866 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
10867 from code provided by Pete Chown]
10868 * m4.h: Add original_text field to u_t variant of union u.
10869 Declare TOKEN_DATA_FUNC macro.
10870 * builtin.c: Declare changeword.
10871 (m4_changeword): New function.
10872 * input.c: Include "regex.h", define variables with word regexps.
10873 (input_init): Initialize the word regexp.
10874 (set_word_regexp): New.
10875 (next_token): Declare local variables, use the previous code if
10876 default_word_regexp is true. Else, match using a new code. Save
10878 * macro.c (expand_token): Ship out original text if not a macro
10880 Reported by Krste Asanovic and Pete Chown.
10882 [These modifs all depend upon ENABLE_CHANGEWORD]
10883 * m4.h: Declare external user_word_regexp.
10884 * m4.c: Declare user_word_regexp, and initialize it from
10885 --word-regexp or -W, or NULL if not specified.
10886 * input.c: Use user_word_regexp if specified, instead of
10887 DEFAULT_WORD_REGEXP.
10889 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
10892 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
10893 * checks/Makefile.in: Empty the suffix list.
10894 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
10896 * m4.c: Declare nesting_limit and initialize it to 250.
10897 Implement -LNUMBER or --nesting-limit=NUMBER to change its
10899 * m4.h: Declare nesting_limit as external.
10900 * macro.c (expand_macro): Stop execution whenever nesting limit
10902 Reported by Bengt Mertensson.
10904 * eval.c (evaluate): Diagnose excess characters in eval input.
10905 Things like `eval(08)' used to return 0 with no diagnostic.
10907 * m4.h: Capitalize first letter of all macro arguments in
10910 * m4.c: Declare warning_status, initialize it to 0. Add new
10911 option -E, or --fatal-warnings, which sets warning_status to
10912 EXIT_FAILURE instead.
10913 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
10914 EXIT_FAILURE if not otherwise done by header files.
10915 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
10916 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
10917 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
10918 argument of all M4ERROR calls.
10919 Reported by Noah Friedman.
10921 * examples/incl-test.m4: Renamed from incl_test.m4.
10922 * examples/include.m4: Include incl-test.m4 instead of
10924 * examples/multiquotes.m4: Renamed from multi-quotes.m.
10926 1994-06-22 François Pinard <pinard@iro.umontreal.ca>
10928 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
10929 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
10930 also tested it on a Sun Sparc workstation running SunOS 4.x.
10932 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
10933 49.format check, abusing a `union values' argument with sprintf
10934 without selecting the proper field. Now, save the formatting type
10935 first, delaying the fetch of the corresponding argument.
10936 Reported by Joseph E. Sacco and Tom Quinn.
10938 * format.c (format): Remove const from char *fmt declaration when
10939 not HAVE_EFGCVT, because a NUL may be forced into it.
10941 * m4.h: Declare atof() when not STDC_HEADERS.
10942 Reported by Joseph E. Sacco.
10944 * Regenerate configure using Autoconf 1.11, this corrects a
10945 problem about an incorrect cpp seting on NeXT 3.1.
10946 Reported by Alexander Lehmann.
10948 1994-06-05 François Pinard <pinard@iro.umontreal.ca>
10950 * m4.h (_): Change argument from `x' to `Args'.
10952 1994-04-22 François Pinard <pinard@iro.umontreal.ca>
10954 * m4.h: Rename Args() to _().
10955 * m4.h: Remove extern specifier from all function declarations.
10957 1994-04-22 Jim Avera <jima@netcom.com>
10959 * stackovf.c: New file implementing stack-overflow detection.
10960 * configure.in: Check for getrlimit, sigaction. If all of
10961 standard headers, getrlimit and sigaction, define USE_STACKOVF and
10962 substitute ${U}stackovf.o for STACKOVF.
10963 * acconfig.h: Declare USE_STACKOVF.
10964 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
10965 * m4.h: Declare setup_stackovf_trap().
10966 * m4.c: Call setup_stackovf_trap().
10967 * tests/stackovf_test.sh: New file.
10969 1994-04-13 François Pinard <pinard@iro.umontreal.ca>
10971 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
10973 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
10975 1994-01-30 François Pinard <pinard@iro.umontreal.ca>
10977 * m4.h: Remove definition of volatile, not used anymore.
10978 Reported by Jim Meyering and Joseph E. Sacco.
10980 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
10981 of `if ... else /* nothing */' for if macros.
10982 Reported by Jim Meyering.
10984 * builtin.c (m4_regexp): Reorganize the code for avoiding a
10985 warning from gcc about `repl' possibly used before defined.
10986 Reported by Jim Meyering.
10988 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
10989 Reported by Jim Meyering.
10991 1994-01-25 François Pinard <pinard@iro.umontreal.ca>
10993 * m4.h: Move the conditional definition of volatile after the
10994 inclusion of system files, because they may define it first.
10996 1994-01-04 François Pinard <pinard@iro.umontreal.ca>
10998 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
10999 get around a problem with Alpha make seeing a syntax error, there.
11000 Reported by Vern Paxson.
11002 1994-01-03 François Pinard <pinard@iro.umontreal.ca>
11004 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
11005 Reported by Richard Stallman.
11007 1993-12-25 François Pinard <pinard@iro.umontreal.ca>
11009 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
11010 instead of AC_HAVE_FUNCS.
11011 Reported by Noah Friedman.
11013 1993-12-01 François Pinard <pinard@iro.umontreal.ca>
11015 * m4.c: Initialize show_help and show_version to zero.
11017 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
11018 Use them in exit() and usage() calls.
11020 1993-11-27 François Pinard <pinard@iro.umontreal.ca>
11022 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
11023 syserr() macro. Delete errref, add reference_error and M4ERROR.
11024 * m4.c: Replace errref, which was returning an input reference
11025 string, with reference_error, which prints it on standard error.
11026 * builtin.c, output.c: Use errno as second parameter to error,
11027 instead of using syserr() with %s.
11028 * *.c: Use M4ERROR instead of error: no more errref() with %s.
11029 Doing so, the program name appears after the input reference
11030 instead of before, which eases M-x next-error processing.
11032 1993-11-24 François Pinard <pinard@iro.umontreal.ca>
11034 * checks/get-them: Escape braces with backslashes in patterns,
11035 because HPUX-9.01 awk needs this.
11036 Reported by Jim Meyering.
11038 1993-11-22 François Pinard <pinard@iro.umontreal.ca>
11040 * builtin.c: Declare "FILE *popen ();".
11042 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
11043 macros, replace error_message_prefix() declaration by errref()'s.
11044 Declare xrealloc, for use in errref().
11045 * m4.c: Delete error_message_prefix() function, add errref().
11046 * *.c: Use error() systematically in place of all error macros,
11047 now that error() flushes stdout first. Make needed adjustments.
11049 * m4.h: Remove const in sys_errlist[] declaration, it creates
11050 conflicts on SGI and Alpha.
11051 Reported by Kaveh R. Ghazi.
11053 1993-11-20 François Pinard <pinard@iro.umontreal.ca>
11055 * m4.c: Include <getopt.h> instead of "getopt.h".
11057 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
11058 * acconfig.h: New, for documenting HAVE_EFGCVT.
11059 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
11060 use them wherever appropriate. Also use -I. for compilations.
11061 * lib/Makefile.in: Use -I.. for compilations.
11062 * *.c: Include <config.h> or "config.h".
11064 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
11065 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
11067 1993-11-17 François Pinard <pinard@iro.umontreal.ca>
11069 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
11071 * input.c (input_init): Initialize quote and comment strings
11072 explicitely instead of calling set_quotes and set_comment: by
11073 doing so, we ensure we do not free uninitialized variables.
11075 * checks/check-them: Reverse arguments to both diff, so the
11076 expected is on the left and the obtained on the right.
11078 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
11079 macros. Delete declarations for m4error, warning, fatal and
11080 internal_error, add declaration for error_message_prefix.
11081 * m4.c: Delete m4error, warning, fatal and internal_error
11082 routines, add error_message_prefix routine.
11083 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
11084 warning with WARNING*, fatal with FATAL* and internal_error with
11086 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
11087 this is not needed anymore.
11089 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
11090 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
11091 and debug_message, add declaration for debug_message_prefix.
11092 * debug.c: Remove static specifier for FILE *debug declaration.
11093 Delete debug_print and debug_message routines, add
11094 debug_message_prefix routine.
11095 * builtin.c, debug.c: Replace debug_print routine calls with
11096 DEBUG_PRINT* macro calls.
11097 * input.c, path.c: Replace debug_message routine calls with
11098 DEBUG_MESSAGE* macro calls.
11100 * m4.h: Remove inclusion of <varargs.h>.
11101 * debug.c: Include <stdarg.h> or <varargs.h>.
11102 (trace_format): Use stdarg instead of varargs if __STDC__.
11104 * configure.in: Remove checks for vfprintf and _doprnt. These
11105 implementations use varargs tricks which are not portable enough.
11106 * lib/vfprintf.c: Deleted.
11107 * lib/_doprnt.c: Deleted.
11108 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
11109 Reported by Joel Sherrill.
11111 * path.c (add_include_directory): Use xstrdup.
11113 * builtin.c (find_builtin_by_name): Declare static.
11115 * *.[ch]: Add const to a few "char *" declarations.
11117 * configure.in: Remove commented tests for fileno() and fstat().
11118 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
11120 * debug.c (debug_flush_files): New.
11121 * m4.h: Declares it.
11122 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
11123 Reported by Nicolas Pioch.
11125 1993-11-12 François Pinard <pinard@iro.umontreal.ca>
11127 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
11128 Reported by Joel Sherrill.
11130 * builtin.c (prefix_all_builtins): Instead of the table size, use
11131 the null entry at end for stopping the loop. It was overwritten.
11132 Reported by Andreas Schwab and Jim Meyering.
11134 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
11135 Reported by Kaveh R. Ghazi.
11137 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
11138 Reported by Karl Vogel.
11140 1993-11-09 François Pinard <pinard@iro.umontreal.ca>
11142 * m4.h: Do not define volatile if already defined.
11143 Reported by René Seindal.
11145 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
11147 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
11148 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
11150 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
11152 * m4.h: Define strchr and strrchr in terms of index and rindex,
11153 instead of the other way around.
11154 * builtin.c, m4.c, path.c: Use strchr instead of index.
11156 * input.c (next_char): Remove a "break;" after a "return ...;".
11157 Reported by Tom McConnell.
11159 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
11163 * configure.in: Do not copy check files in the build hierarchy.
11164 * checks/check-them: Identify the m4 version being checked. For
11165 finding m4, look in $PATH instead of in the parent directory.
11166 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
11167 * checks/Makefile.in (.all-stamp): Always create check files in
11168 the source hierarchy, not anymore in the build hierarchy.
11169 (check): cd to the source hierarchy before performing checks.
11170 Do not copy nor clean COPYING anymore, take it from `..'.
11171 Reported by Tom McConnell.
11173 * Makefile.in (Makefile): Use $(SHELL).
11174 (config.status): Use $(SHELL). Use "config.status --recheck"
11175 instead of "configure --no-create", which is obsolete.
11176 Reported by Tom McConnell.
11178 1993-11-05 François Pinard <pinard@iro.umontreal.ca>
11180 * m4.c (usage): Use "%s" instead of "m4" in format string.
11181 Reported by Jim Meyering.
11183 * Makefile.in: Distribute mkinstalldirs.
11184 Reported by Pierre Gaumond.
11185 Reported by Jim Meyering.
11186 Reported by Tom McConnell.
11187 Reported by Andreas Gustafsson.
11189 * checks/check-them: Renamed from checks/check_them.
11190 * checks/get-them: Renamed from checks/get_them.
11191 * checks/.all-stamp: Renamed from checks/.all_stamp.
11192 * checks/Makefile.in: Changed accordingly.
11193 Reported by Jim Meyering.
11195 1993-11-04 François Pinard <pinard@iro.umontreal.ca>
11197 * lib/Makefile.in (dist): Correct permissions on files.
11199 * output.c: Declare tmpfile, some systems don't.
11201 1993-11-03 François Pinard <pinard@iro.umontreal.ca>
11203 * checks/Makefile.in (dist): Correct permissions on files.
11205 * Makefile.in (dist): Ensure recursive linking for subdirectory
11206 `examples', also set read/write permissions on all its files.
11208 * mkinstalldirs: New, from elsewhere.
11209 * Makefile.in: Use it.
11211 * debug.c: Synchronize debug messages and regular output when
11212 the debug file and stdout are redirected to the same file.
11213 * configure.in: Add (commented) checks for fileno and fstat.
11214 Reported by Jim Avera.
11216 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
11217 etc., arguments, then ignore the superfluous one. m4 used to
11218 diagnose missing arguments and return the empty string.
11219 Reported by Nick S. Kanakakorn.
11221 1993-11-02 François Pinard <pinard@iro.umontreal.ca>
11223 * m4.c (main): At end of all input, ensure all undiverted text
11224 goes to the main output stream.
11225 Reported by Andreas Gustafsson.
11227 * m4.c (main): exit (0), instead of return 0.
11229 * m4.c: Implement -P and --prefix-builtins.
11230 * builtin.c: Delete const specifier on builtin_tab.
11231 (prefix_all_builtins): New.
11232 Reported by Noah Friedman.
11233 Reported by Scott Bartram.
11235 * c-boxes.el: New, from elsewhere.
11236 * Makefile.in: Distribute it.
11238 * m4.h: Do not define bcopy if <string.h> defines it.
11239 Reported by Stephen Perkins.
11241 * builtin.c (define_macro): Allow a missing second argument, in
11242 which case it is implied empty. Affects define and pushdef.
11243 Reported by Eric Allman.
11245 1993-11-01 François Pinard <pinard@iro.umontreal.ca>
11247 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
11248 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
11249 * builtin.c: Initialize all the blindness fields in builtin_tab.
11250 (define_builtin): Copy the blindness of a builtin into its symbol.
11251 * macro.c (expand_token): Avoid processing a blind builtin if the
11252 next character is not an opening parenthesis.
11253 Reported by David MacKenzie.
11254 Reported by Noah Friedman.
11256 * configure.in: Ensure an exit status of 0 on completion.
11257 Reported by Vivek P. Singhal.
11259 * eval.c (eval_lex): Admit both lower and upper case letters for
11260 bases greater than 10. Only lower case letters were accepted.
11262 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
11263 Reported by Krste Asanovic.
11265 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
11266 * eval.c (logical_not_term): New name for not_term.
11267 * eval.c (xor_term): New, between or_term and and_term.
11268 * eval.c (not_term): New, between and_term and logical_not_term.
11269 * eval.c (shift_term): New, between cmp_term and add_term.
11270 Reported by Krste Asanovic: ~, ^, <<, >>.
11271 Reported by Ben A. Mesander: ** vs ^.
11273 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
11274 * m4.h: Delete xrealloc.c.
11275 * lib/xmalloc.c: New, from elsewhere.
11276 * lib/xstrdup.c: New, from elsewhere.
11277 * lib/Makefile.in: Distribute and compile them.
11279 * m4.c: Change progname to program_name.
11280 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
11281 * lib/error.c: New, from elsewhere.
11282 * lib/Makefile.in: Distribute and compile error.c.
11283 * configure.in: Check AC_VPRINTF and for strerror.
11284 * m4.c: Delete cmd_error. Use error instead.
11285 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
11287 * m4.h: Delete #define const, let Autoconf takes care of this.
11289 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
11290 Merge parse_args into main. Declare argv to be `char *const *',
11291 then remove superfluous casts.
11293 * m4.c: Rename --no-gnu-extensions to --traditional.
11294 Reported by Ben A. Mesander.
11296 * m4.c (usage): Add a status parameter. Supply one in various
11297 calls. Add --help processing. Remove -V for --version.
11299 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
11301 * lib/Makefile.in: Have an AR=ar declaration.
11302 Reported by Eric Backus.
11303 Reported by Bjorn R. Bjornsson.
11304 Reported by Tom Tromey.
11305 Reported by Kristine Lund.
11306 Reported by Marion Hakanson.
11308 1993-10-30 François Pinard <pinard@iro.umontreal.ca>
11310 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
11311 Reported by Noah Friedman.
11313 1993-10-25 François Pinard <pinard@iro.umontreal.ca>
11315 * Makefile.in: Remove MDEFINES and cleanup.
11317 1993-06-09 François Pinard <pinard@iro.umontreal.ca>
11319 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
11320 Create a gzip file.
11322 1993-02-06 François Pinard <pinard@iro.umontreal.ca>
11324 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
11325 ensure 777 mode for directories, so older tar's will restore file
11328 1993-01-17 François Pinard <pinard@iro.umontreal.ca>
11330 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
11331 so the installer can override automatically configured choices.
11332 Reported by Karl Berry.
11334 1993-01-15 François Pinard <pinard@iro.umontreal.ca>
11336 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
11337 previous version was not working properly on m68k-hp-bsd4.3.
11338 Reported by Roland McGrath.
11340 * lib/_doprnt.c: Stolen from Oleo distribution.
11341 * configure.in: Check for _doprnt.c if vfprintf.c selected.
11342 * lib/Makefile.in: Distribute _doprnt.c.
11343 Do not distribute regex.[ch].old anymore.
11345 1993-01-01 François Pinard <pinard@iro.umontreal.ca>
11347 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
11348 Richard wants it there.
11350 1992-12-27 François Pinard <pinard@iro.umontreal.ca>
11352 * Makefile.in: Add DEFS to MDEFINES.
11353 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
11354 (libm4.a): Remove the library before creating it.
11355 (distclean): Remove tags and TAGS too.
11357 1992-12-23 François Pinard <pinard@iro.umontreal.ca>
11359 * Makefile.in (dvi, m4.dvi): New goals.
11361 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
11362 macro.c, output.c, path.c, symtab.c: Change Copyright from
11363 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
11365 * examples/divert.m4: Deleted, this bug has been corrected.
11367 * Makefile.in (texclean, mostlyclean): New goals.
11369 * Makefile.in (clean): Remove clutter from ansi2knr.
11370 Reported by Pierre Gaumond.
11372 1992-12-20 François Pinard <pinard@iro.umontreal.ca>
11374 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
11375 might well use CFLAGS is s/he needs it.
11377 * Makefile.in: Allow installation of info files from a separate
11379 Reported by Jason Merrill.
11380 Reported by David MacKenzie.
11381 Reported by Skip Montanaro.
11382 Reported by Erez Zadok.
11383 Reported by Assar Westerlund.
11385 1992-12-19 François Pinard <pinard@iro.umontreal.ca>
11388 This is still a beta release for the future GNU m4 version 1.1.
11390 * lib/alloca.c: New, from elsewhere.
11391 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
11393 * m4.h: Do not define index/rindex if already defined. If
11394 FALSE/TRUE are already defined, do not redefine them, but merely
11395 define boolean typedef to int.
11397 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
11398 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
11399 because some C compilers do not like connectives with #ifdef.
11400 * m4.h: Define `volatile' only if __GNUC__, instead of once for
11401 __GNUC__ and once for __STDC__.
11402 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
11404 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
11405 Makefile dependencies. Without it, make keeps destroying and
11406 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
11408 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
11409 to diversion/DIVERSION, this was a spelling error.
11411 * m4.c: Declare version[], remove #include "version.h".
11412 * version.h: Deleted.
11413 * Makefile.in: Remove references to version.h.
11415 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
11416 production, by using a simpler and more robust algorithm. This
11417 solves the problem of synclines sometimes written in the middle of
11418 an output line. Delete sync_line() and output_lines variable.
11419 * m4.h: Remove sync_line prototype and output_lines declaration.
11420 * input.c (next_char), output.c (shipout_text): Remove references
11422 * input.c (push_file, pop_file): Merely put the value -1 in
11423 output_current_line instead of calling sync_line, for delaying a
11424 single `#line NUM FILE' before next output line. Do not test
11425 for sync_output, because this is unnecessary clutter.
11426 * output.c (make_divertion, insert_divertion): Idem.
11427 * input.c: Rename must_advance_line to start_of_input_line, for
11430 * debug.c (trace_header): Select a new debug line format, which
11431 better complies with GNU standards for formatting error messages.
11432 With option `-dfl', M-x next-error might be used on the output.
11433 * m4.c (vmesg): Adjust format of error output to GNU standards.
11434 * m4.texinfo: Adjust examples for `make check' to work.
11436 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
11437 case for enum debug_info constants, which were all lower case.
11439 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
11441 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
11442 collected patches. I tried a few times using newer regex.[ch], it
11443 mysteriously stopped aborting with this one. Insecure feeling...
11444 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
11446 1992-12-18 François Pinard <pinard@iro.umontreal.ca>
11448 * m4.c: Change `--no-warnings' to `--silent'.
11449 Reported by David MacKenzie.
11451 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
11452 leave it off for now. See comment in m4.c for justification.
11453 Reported by David MacKenzie.
11455 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
11456 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
11458 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
11460 * Makefile.in: Ensure recursive cleaning is done before local
11461 cleaning for all clean goals.
11463 * builtin.c (ntoa): Ensure the value is always interpreted as a
11464 signed quantity, whatever the radix is.
11466 1992-11-18 Jim Meyering <meyering@idefix>
11468 * builtin.c, format.c, input.c: Split long lines.
11469 * m4.c: Use typedef macro_definition instead of struct
11471 * symtab.c: Use typedef symbol instead of struct symbol.
11473 1992-11-17 François Pinard <pinard@iro.umontreal.ca>
11475 * *.[ch]: Remove all trailing whitespace, in code and comments.
11477 * configure.in: Find some awk.
11478 * Makefile.in: Add $(AWK) to MDEFINES.
11479 * checks/Makefile.in: Transmit $(AWK) to get_them.
11480 * checks/get_them: Use $AWK instead of gawk. Add a close in the
11481 awk script when switching files, because without this, mawk runs
11482 out of file descriptors.
11484 1992-11-16 François Pinard <pinard@iro.umontreal.ca>
11486 * Makefile.in (realclean): Delete m4.info*.
11487 Reported by Jim Meyering.
11489 * Makefile.in: Adjust and link with checks/Makefile.
11490 * checks/Makefile.in: New.
11491 * configure.in: Output checks/Makefile.
11493 * checks/get_them: Have the dnl header of each test more
11494 recognizable by next-error, also use a better message.
11496 1992-11-16 Jim Meyering <meyering@idefix>
11498 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
11499 And use that only if __GNUC__ since we're using it's GCC-specific
11500 semantics that tell the compiler the associated function doesn't
11503 * builtin.c (substitute): Don't use character as an array index.
11504 (dumpdef_cmp): Make formal arguments `const void *' to avoid
11505 warnings with gcc -W -Wall on systems with qsort prototype.
11506 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
11509 * eval.c (most functions): Add parentheses to assignments used
11510 as truth values go avoid warnings from gcc -Wall.
11512 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
11513 any functions that don't need external scope.
11515 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
11516 (many functions and arrays): Declare `const'.
11518 1992-11-15 François Pinard <pinard@iro.umontreal.ca>
11520 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
11521 removing the declaration from m4.h. Also rename false to FALSE
11524 * lib/Makefile.in (Makefile): New goal.
11526 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
11527 so heavily loaded. It gets more easily overridable, calling make.
11528 Reported by Jim Meyering.
11530 * Makefile.in (dist): Get .fname from the current directory name,
11531 instead of from version.h. I need updating many files manually,
11532 when the version changes, version.h is just one of them.
11534 1992-11-14 François Pinard <pinard@iro.umontreal.ca>
11536 * m4.h: Remove the tag `boolean' on the enum introducing typedef
11537 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
11538 Reported by Tom McConnell.
11540 1992-11-13 François Pinard <pinard@iro.umontreal.ca>
11542 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
11543 39.cleardiv, which were describing missing or spurious newlines.
11544 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
11545 do not depend on machine word size, `/bin/false' implementation,
11546 or `wc' output format. `make check' is more dependable, now.
11548 * checks/check_them: Summarize the failed tests by listing their
11549 name, at end. If none, issue `All checks successful'. Output
11550 `Checking' instead of `Input file:'.
11552 * checks/get_them, checks/check_them: Reindented.
11554 * Makefile.in (dist): chmod a+r before making the tar file.
11556 1992-11-12 François Pinard <pinard@iro.umontreal.ca>
11558 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
11560 * input.c (next_token): Reinitialize token_buttom just after using
11561 it as a watermark with obstack_free. Or else, a future token, big
11562 enough for triggering reallocation of the obstack chunk, could
11563 void the initialized value of token_buttom, later causing panic in
11564 obstack_free. Rename token_buttom to token_bottom everywhere.
11566 * m4.h: Before declaring errno, first include <errno.h> and
11567 ensure that it does not define errno.
11568 Reported by Richard Stallman.
11570 1992-11-11 François Pinard <pinard@iro.umontreal.ca>
11572 * builtin.c: Define and use DECLARE macro for builtins.
11574 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
11575 argument, this is a common idiom for introducing long comments.
11577 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
11578 arguments. The last argument was silently ignored.
11580 * m4.c (cmd_error): Add a missing semicolon before va_end().
11582 1992-11-10 François Pinard <pinard@iro.umontreal.ca>
11584 * Makefile.in: Now handle protoized sources. Define and use U.
11585 Compile and use ansi2knr with old compilers. Update DISTFILES.
11586 Add `aclocal.m4' to `configure' dependencies.
11587 * ansi2knr.c: New, from Ghostscript distribution.
11588 * configure.in: Define U through FP_PROTOTYPES for old compilers.
11589 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
11590 * aclocal.m4: New, provide FP_PROTOTYPES.
11591 * m4.h: Conditionnaly protoized through Args, save for varags.
11592 * builtin.c: Protoized. Then:
11593 Include <sys/types.h> if size_t is not defined, before "regex.h".
11594 (m4_ifelse): Fetch built-in name properly for diagnostic.
11595 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
11596 (m4_regexp): Add const to `msg' declaration.
11597 (m4_patsubst): Add const to `msg' declaration.
11598 * debug.c: Protoized, save for varargs.
11599 * eval.c: Protoized.
11600 * format.c: Protoized.
11601 * input.c: Protoized.
11602 * m4.c: Protoized, save for varargs. Then:
11603 (xfree): Accept void * instead of char *.
11604 (xmalloc): Return void * instead of char *.
11605 (xrealloc): Accept and return void * instead of char *.
11606 * macro.c: Protoized.
11607 * output.c: Protoized.
11608 * path.c: Protoized. Then cast some (char *) over xmalloc's.
11609 * symtab.c: Protoized.
11611 1992-11-06 François Pinard <pinard@iro.umontreal.ca>
11613 * m4.texinfo: Remove directory from diagnostics in 30.include,
11614 51.eval, 56.errprint and 57.m4exit tests.
11616 * m4.h: Remove declarations for int or void system functions, they
11617 cause more conflicting trouble than they make good.
11619 * configure.in: Avoid configuration header file. Add some tests.
11620 * m4.h: Remove #include "config.h".
11621 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
11622 Then, rewritten for better compliance with GNU standards.
11624 1992-11-05 François Pinard <pinard@iro.umontreal.ca>
11626 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
11627 because of a misplaced #endif.
11629 * Many *.[hc] files: Correct intra-line spacing here and there,
11630 according to GNU indent 1.6 advice.
11632 * configure.in: New, using Autoconf 1.2.
11633 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
11634 * Delete old configure.in, configure, etc/configure.in,
11635 etc/configure, lib/configure.in, lib/configure and config/*.
11636 Reported by Jason Merrill.
11638 * symtab.c (hash): Change (char) NULL to '\0'.
11639 Reported by Jason Merrill.
11641 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
11642 etc/nextvers.sh. Release numbers will be edited `by hand'.
11643 * version.h: De-automatize, force value in.
11645 * m4.c: Changes in order to use a newer getopt.h.
11646 Reported by David MacKenzie.
11648 * checks/: New name for examples/.
11649 * checks/get_them: New location for etc/get_examples.
11650 * checks/check_them: New location for etc/check_examples.
11651 * Makefile.in, checks/get_them, checks/check_them: Adjust.
11652 * lib/vfprintf.c: New location for etc/vfprintf.c.
11653 * Delete empty etc/.
11654 * examples/: New name for test/.
11656 1992-03-10 François Pinard <pinard@iro.umontreal.ca>
11658 * Makefile.in (check): Add m4 as dependency.
11660 * m4.c: Accept --no-warnings instead of --no_warnings, and
11661 --no-gnu-extensions instead of --no_gnu_extensions. Make the
11662 usage message more informative.
11663 Reported by David MacKenzie.
11665 1992-03-09 François Pinard <pinard@iro.umontreal.ca>
11667 * etc/check_examples: New name for check_examples.sh.
11668 * etc/get_examples: New name for get_examples.sh.
11669 * Makefile.in, etc/Makefile.in: Use new names.
11671 * Makefile.in: Transmit $(CC) while making in lib.
11673 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
11674 code disposition by hand.
11676 1992-03-08 François Pinard <pinard@iro.umontreal.ca>
11678 * m4.h: Delete definitions for abort() and exit().
11679 Reported by Richard Stallman.
11681 * config/hmake-unicos, config/s-unicos.h: New files.
11682 Reported by Hal Peterson.
11684 * eval.c (exp_term): Have N^0 return 1.
11685 Reported by Michael Fetterman.
11687 * eval.c, input.c, m4.h: Remove last comma in enums.
11688 Reported by Mike Lijewski.
11690 * Transfer of maintenance duties from René to François.
11692 1991-10-24 René Seindal <seindal@diku.dk>
11694 * Release 1.0. Many thanks to those, who provided me with bug
11695 reports and feedback.
11697 * Uses GNU configure, taken from the gdb distribution.
11699 * Uses GNU getopt(), with long option names.
11701 * The -Q/+quiet option is added, which suppresses warnings about
11702 missing or superflous arguments to built-in macros.
11704 * Added default options via the M4OPTS environment variable.
11706 * The built-in format can now be configured to use sprintf as
11707 the formatting engine, for systems without [efg]cvt(3).
11709 * GNU library code is moved to the ./lib subdirectory; other
11710 utility files are now in ./etc.
11712 * Several minor bugs have been fixed.
11714 1991-07-26 René Seindal <seindal@diku.dk>
11716 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
11717 François Pinard and Roland H. Pesch for providing me with reports.
11719 * The builtins incr and decr are now implemented without use of
11722 * The builtin indir is added, to allow for indirect macro calls
11723 (allows use of "illegal" macro names).
11725 * The debugging and tracing facilities has been enhanced
11726 considerably. See the manual for details.
11728 * The -tMACRO option is added, marks MACRO for tracing as soon
11731 * Builtins are traced after renaming iff they were before.
11733 * Named files can now be undiverted.
11735 * The -Nnum option can be used to increase the number of
11736 divertions available.
11738 * Calling changecom without arguments now disables all comment
11741 * The function m4_patsubst() is now consistently declared
11744 * A bug in dnl is fixed.
11746 * A bug in the multi-character quoting code is fixed.
11748 * Several typos in the manual has been corrected. More probably
11751 * The m4.info file is now installed along with the program.
11753 1990-11-15 René Seindal <seindal@diku.dk>
11755 * Updated and enhanced version. Release 0.75, manual 0.07.
11757 * Implemented search path for include files (-I option and
11758 M4PATH envronment variable).
11760 * Implemented builtin "format" for printf-like formatting.
11762 * Implemented builtin "regexp" for searching for regular
11765 * Implemented builtin "patsubst" for substitution with regular
11768 * Implemented builtin "esyscmd", which expands to a shell
11771 * Implemented "__file__" and "__line__" for use in error
11774 * Implemented character ranges in "translit".
11776 * Implemented control over debugging output.
11778 * Implemented multi-character quotes.
11780 * Implemented multi-character comment delimiters.
11782 * Changed predefined macro "gnu" to "__gnu__".
11784 * Changed predefined macro "unix" to "__unix__", when the -G
11785 option is not used. With -G, "unix" is still defined.
11787 * Changed "shift", "$@" and "$*" to not insert spaces afters
11790 * Added program name to error messages.
11792 * Fixed two missing null bytes bugs.
11794 1990-01-22 René Seindal <seindal@diku.dk>
11796 * Initial beta release. Release 0.50, manual 0.05.
11805 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
11806 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
11808 Copying and distribution of this file, with or without
11809 modification, are permitted provided the copyright notice
11810 and this notice are preserved.