1 2010-03-02 Giuseppe Scrivano <gscrivano@gnu.org> (tiny change)
3 Support bootstrap --gnulib-srcdir=DIR.
4 * bootstrap: Add --gnulib-srcdir option, which overrides
5 GNULIB_SRCDIR, for consistency with gnulib bootstrap.
7 2010-03-01 Eric Blake <eblake@redhat.com>
9 Mention release of version 1.4.14.
10 * gnulib: Update to latest.
11 * README: Drop CVS mention.
12 * HACKING: Tweak release instructions.
13 * NEWS: Mention the release.
14 * .prev-version: Record previous version.
15 * cfg.mk (old_NEWS_hash): Auto-update.
17 2010-02-24 Eric Blake <eblake@redhat.com>
19 Improve parsing example.
20 * doc/m4.texinfo (Input processing): Double-quote argument to
21 translit, for robustness.
23 Reported by Chris Penev.
25 2010-01-29 Eric Blake <ebb9@byu.net>
27 Document upcoming release.
28 * gnulib: Update to latest.
29 * doc/m4.texinfo (History): Mention 1.4.14.
30 * Makefile.am (src/getopt.h): Drop dependence on now-obsolete
33 2010-01-08 Eric Blake <ebb9@byu.net>
35 Address remaining 'make syntax-check' findings.
36 * gnulib: Update to latest.
37 * Makefile.am (tests/package.m4): Avoid @@ substitution.
38 (src_m4_LDADD): Link with libiconv.
39 * m4/m4private.h (STREQ): New macro.
40 * m4/resyntax.c (m4_regexp_syntax_encode): Use it.
41 * src/main.c (process_file): Likewise.
42 (includes): Drop unused header.
43 * m4/macro.c (m4_arg_equal): Adjust comment.
44 * m4/syntax.c: Likewise.
45 * m4/system_.h: Avoid useless preprocessor parenthesis.
46 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
47 * src/stackovf.c: Likewise.
48 (setup_stackovf_trap): Mark diagnostics.
49 * modules/mpeval.c (includes): Move quotearg.h inclusion...
50 * modules/evalparse.c (includes): ...to where it is used.
51 * cfg.mk (local-checks-to-skip): Exempt tests that cause spurious
52 failures, but first fix what they were intended to detect.
53 (_makefile_at_at_check_exceptions): Allow an exception.
55 2010-01-07 Eric Blake <ebb9@byu.net>
57 Use correct license on auxiliary documentation.
58 * gnulib: Update to latest.
59 * AUTHORS: Use GFDL 1.3, not 1.2.
60 * README-alpha: Likewise.
63 * doc/STYLE: Likewise.
64 * modules/README: Likewise.
65 * NEWS: Place under GFDL.
67 * cfg.mk (old_NEWS_hash): Update.
69 Address 'make sc_error_message_uppercase' failures.
70 * m4/output.c (m4_freeze_diversions): Silence false positive.
71 * src/main.c (main): Use 'warning', not 'Warning', in messages.
72 * m4/utility.c (m4_verror_at_line): Likewise.
73 * doc/m4.texinfo (Operation modes, Macro Arguments, Undefine)
74 (Defn, Pushdef, Indir, Builtin, Ifdef, Ifelse, Dumpdef, Trace)
75 (Debuglen, Debugfile, Dnl, Changeresyntax, Standard Modules)
76 (Index macro, Regexp, Substr, Translit, Patsubst, Format, Incr)
77 (Eval, Mkstemp, Syncoutput, Improved forloop)
78 (Improved fatal_error): Adjust expected output.
79 * tests/builtins.at (define, mkdtemp, mkstemp): Likewise.
80 * tests/freeze.at (loading format 1, reloading unknown builtin):
82 * tests/macros.at (Arity and defn, 'Arity, defn, and freeze')
83 (pushdef/popdef): Likewise.
84 * tests/null.err: Likewise.
85 * tests/options.at (deprecated options, POSIXLY_CORRECT)
86 (--fatal-warnings, --regexp-syntax, --syncoutput): Likewise.
87 * tests/others.at (nul character, stdin seekable): Likewise.
88 * tests/modules.at (AT_CHECK_M4_MODTEST, modules: text):
91 Address 'make sc_cast_of_argument_to_free' failures.
92 * m4/m4private.h (DELETE): Adjust comment and fix parentheses.
93 * m4/m4.c (m4_delete): Use it to avoid warning.
94 * m4/module.c (install_builtin_table, module_remove): Likewise.
95 * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy):
97 * .x-sc_cast_of_argument_to_free: New file.
98 * Makefile.am (syntax_check_exceptions): Distribute exceptions.
100 More whitespace cleanup.
101 * HACKING: Nuke trailing whitespace.
102 * examples/WWW/Makefile: Likewise.
103 * examples/WWW/_footer.htm: Likewise.
104 * examples/WWW/_header.htm: Likewise.
105 * examples/WWW/m4lib/bugs.m4: Likewise.
106 * examples/WWW/m4lib/html.m4: Likewise.
107 * examples/WWW/m4lib/menu.m4: Likewise.
108 * examples/WWW/m4lib/visions.m4: Likewise.
109 * examples/esyscmd.m4: Likewise.
110 * examples/fstab.m4: Avoid space-tab.
111 * examples/patsubst.m4: Likewise.
112 * NEWS: Prefer space over tab for alignment.
115 * bootstrap: Likewise.
116 * configure.ac: Likewise.
117 * ltdl/m4/stackovf.m4: Likewise.
118 * m4/hash.c: Likewise.
119 * m4/hash.h: Likewise.
120 * m4/input.c: Likewise.
122 * m4/m4module.h: Likewise.
123 * m4/m4private.h: Likewise.
124 * m4/macro.c: Likewise.
125 * m4/module.c: Likewise.
126 * m4/output.c: Likewise.
127 * m4/path.c: Likewise.
128 * m4/resyntax.c: Likewise.
129 * m4/symtab.c: Likewise.
130 * m4/syntax.c: Likewise.
131 * m4/system_.h: Likewise.
132 * modules/evalparse.c: Likewise.
133 * modules/format.c: Likewise.
134 * modules/gnu.c: Likewise.
135 * modules/import.c: Likewise.
136 * modules/load.c: Likewise.
137 * modules/m4.c: Likewise.
138 * modules/m4.h: Likewise.
139 * modules/modtest.c: Likewise.
140 * modules/mpeval.c: Likewise.
141 * modules/perl.c: Likewise.
142 * modules/shadow.c: Likewise.
143 * modules/stdlib.c: Likewise.
144 * modules/time.c: Likewise.
145 * modules/traditional.c: Likewise.
146 * src/freeze.c: Likewise.
147 * src/main.c: Likewise.
148 * src/stackovf.c: Likewise.
149 * tests/stackovf.test: Likewise.
150 * doc/STYLE: Mention the change.
152 2010-01-05 Eric Blake <ebb9@byu.net>
154 Document new indentation policy.
155 * HACKING: Document indentation policy.
156 * .x-sc_prohibit_tab_based_indentation: New file.
157 * cfg.mk (sc_prohibit_tab_based_indentation): New rule.
158 * Makefile.am (syntax_check_exceptions): Ship exception.
160 Switch to indentation by space, not tab.
161 * .gitmodules: Convert leading tabs to spaces.
163 * bootstrap: Likewise.
164 * configure.ac: Likewise.
165 * examples/WWW/m4lib/html.m4: Likewise.
166 * examples/WWW/m4lib/layout.m4: Likewise.
167 * examples/WWW/m4lib/menu.m4: Likewise.
168 * ltdl/m4/debug.m4: Likewise.
169 * ltdl/m4/gmp.m4: Likewise.
170 * ltdl/m4/m4-obstack.m4: Likewise.
171 * ltdl/m4/stackovf.m4: Likewise.
172 * m4/builtin.c: Likewise.
173 * m4/debug.c: Likewise.
174 * m4/hash.c: Likewise.
175 * m4/hash.h: Likewise.
176 * m4/input.c: Likewise.
178 * m4/m4module.h: Likewise.
179 * m4/m4private.h: Likewise.
180 * m4/macro.c: Likewise.
181 * m4/module.c: Likewise.
182 * m4/output.c: Likewise.
183 * m4/path.c: Likewise.
184 * m4/resyntax.c: Likewise.
185 * m4/symtab.c: Likewise.
186 * m4/syntax.c: Likewise.
187 * m4/utility.c: Likewise.
188 * modules/evalparse.c: Likewise.
189 * modules/format.c: Likewise.
190 * modules/gnu.c: Likewise.
191 * modules/load.c: Likewise.
192 * modules/m4.c: Likewise.
193 * modules/m4.h: Likewise.
194 * modules/mpeval.c: Likewise.
195 * modules/perl.c: Likewise.
196 * modules/stdlib.c: Likewise.
197 * modules/time.c: Likewise.
198 * src/freeze.c: Likewise.
199 * src/m4.h: Likewise.
200 * src/main.c: Likewise.
201 * src/stackovf.c: Likewise.
202 * tests/builtins.at: Likewise.
203 * tests/freeze.at: Likewise.
204 * tests/generate.awk: Likewise.
205 * tests/modules.at: Likewise.
206 * tests/others.at: Likewise.
207 * tests/stackovf.test: Likewise.
208 * tests/testsuite.at: Likewise.
210 Update copyright year.
211 All files impacted, via 'make update-copyright'. Additionally:
212 * .gitignore: Ignore backup files.
214 Prepare to bulk update copyright year.
216 * ltdl/m4/gnulib-cache.m4: Import update-copyright module.
217 * cfg.mk (update-copyright-env): Enforce longhand behavior.
218 * .x-update-copyright: New file.
219 * Makefile.am (syntax_check_exceptions): Distribute exception.
220 * ltdl/m4/debug.m4: Add FSF copyright.
221 * ltdl/m4/m4-error.m4: Fix FSF name in copyright.
222 * ltdl/m4/m4-getopt.m4: Likewise.
223 * ltdl/m4/m4-gettext.m4: Likewise.
224 * ltdl/m4/m4-obstack.m4: Likewise.
225 * ltdl/m4/m4-regex.m4: Likewise.
226 * ltdl/m4/m4-rename.m4: Likewise.
227 * ltdl/m4/m4-syscmd.m4: Likewise.
228 * modules/modtest.m4: Likewise.
229 * modules/perl.m4: Likewise.
230 * modules/shadow.m4: Likewise.
231 * modules/stdlib.m4: Likewise.
232 * modules/time.m4: Likewise.
233 * modules/time2.m4: Likewise.
234 * tests/iso8859.m4: Likewise.
236 Use gnulib maintainer-makefile module.
237 * ltdl/m4/gnulib-cache.m4: Import maintainer-makefile module.
238 * cfg.mk (local-checks-to-skip): Drop changelog-check; add
239 sc_cast_of_x_alloc_return_value.
240 (gnu_ftp_host-alpha, gnu_ftp_host-beta, gnu_ftp_host-major)
241 (gnu_rel_host): Delete; provided by maint.mk.
242 (old_NEWS_hash): New macro.
243 * .prev-version: New file.
244 * .x-sc_require_config_h: Likewise.
245 * .x-sc_require_config_h_first: Likewise.
246 * Makefile.am (syntax_check_exceptions, EXTRA_DIST): Ship new
248 * maint.mk: Remove from version control; use gnulib instead.
249 * .gitignore: Update.
251 Update to latest gnulib.
253 * ltdl/m4/gnulib-cache.m4: Import xoset.
254 * m4/output.c (includes): Ensure that gnulib oset usage will
255 call xalloc_die on memory failure.
256 * Makefile.am (src/getopt.h): Update snippet from gnulib.
257 (LINK_WARNING_H, ARG_NONNULL_H): New macros.
259 Fix testsuite failure on newer glibc.
260 * tests/testsuite.at (AT_CHECK_M4): Tolerate alternate getopt
262 * tests/options.at (deprecated options, unknown option)
263 (--debugmode): Adjust expected output accordingly.
264 Reported by Ralf Wildenhues.
266 2009-11-26 Eric Blake <ebb9@byu.net>
268 Update to newer gnulib.
270 * ltdl/m4/gnulib-cache.m4: Import inttypes, setenv, and unsetenv
272 * modules/m4.c (m4_make_temp): Adjust gen_tempname client.
273 * bootstrap (src_modules): Pick up getopt-gnu and its
275 * configure.ac (gl_VERSION_ETC): Support ./configure
277 (AC_CHECK_FUNCS_ONCE): Rely on gnulib for setenv, unsetenv.
278 * ltdl/m4/m4-getopt.m4: Rewrite to match current gnulib.
279 * Makefile.am (src/getopt.h): Likewise.
280 * modules/stdlib.c (setenv, unsetenv): Rely on gnulib.
282 2009-08-24 Eric Blake <ebb9@byu.net>
284 Pick up gnulib fixes for sub-process execution.
286 * tests/others.at (stdin and stdout closed): New test, to avoid
287 regression introduced on 1.4 branch on 2008-07-17.
288 * NEWS: Document the change.
290 A status of 127 does not always imply esyscmd failure.
291 * modules/gnu.c (esyscmd): Silence gnulib message; regression
292 introduced 2009-03-13.
293 * doc/m4.texinfo (Sysval): Test this.
294 * NEWS: Document the change.
296 2009-06-26 Eric Blake <ebb9@byu.net>
298 Use bitrotate for hashing.
299 * gnulib: Update to latest.
300 * ltdl/m4/gnulib-cache.m4: Import bitrotate module.
301 * m4/hash.c (m4_hash_string_hash): Use it.
303 Fix description of limits on diversions.
304 * doc/m4.texinfo (Diversions): Fix grammar. Be less pessimistic
307 Reported by Elias Benali.
309 2009-06-17 Eric Blake <ebb9@byu.net>
311 Stress test for hash resizing.
312 * tests/builtins.at (define): Enhance test.
314 2009-06-15 Eric Blake <ebb9@byu.net>
316 Document why bootstrap might touch state of tree.
317 * bootstrap: Fix typos. Add comment.
318 * HACKING: Add notes about this scenario.
319 * gnulib: Update to latest version.
320 * .gitignore: Track gnulib changes.
322 Drop .cvsignore and redundant .gitignore files.
323 * .cvsignore: Delete. We are moving further away from CVS.
324 * build-aux/.cvsignore: Likewise.
325 * doc/.cvsignore: Likewise.
326 * examples/.cvsignore: Likewise.
327 * ltdl/.cvsignore: Likewise.
328 * m4/.cvsignore: Likewise.
329 * modules/.cvsignore: Likewise.
330 * po/.cvsignore: Likewise.
331 * src/.cvsignore: Likewise.
332 * tests/.cvsignore: Likewise.
333 * .gitignore: Consolidate from other files.
334 * build-aux/.gitignore: Delete, now that it is consolidated.
335 * doc/.gitignore: Likewise.
336 * examples/.gitignore: Likewise.
337 * ltdl/.gitignore: Likewise.
338 * m4/.gitignore: Likewise.
339 * modules/.gitignore: Likewise.
340 * po/.gitignore: Likewise.
341 * src/.gitignore: Likewise.
342 * tests/.gitignore: Likewise.
343 * bootstrap: Simplify accordingly. Sync gnulib tree prior to
344 libtoolize, to avoid libtool overwriting config.guess.
346 Avoid compiler warning.
347 * m4/macro.c (process_macro): Use correct type for isdigit.
349 2009-06-13 Eric Blake <ebb9@byu.net>
351 Avoid snprintf link failures.
352 * ltdl/m4/gnulib-cache.m4: Import snprintf-posix module.
353 Reported by Ralf Wildenhues.
355 2009-06-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
357 Avoid pointer arithmetic on `void *'.
358 * modules/m4.c (dump_symbol_CB): Cast obstack_base return value
359 to `char *' before using it.
361 2009-05-04 Eric Blake <ebb9@byu.net>
363 Silence verbose testsuite runs.
364 * tests/testsuite.at (m4_version_prereq): Bump to recent
365 autoconf.git version where stdout-nolog was added.
366 * tests/builtins.at (esyscmd, syscmd): Use new stdout-nolog.
367 * tests/freeze.at (AT_TEST_FREEZE): Likewise.
368 * tests/others.at (stderr closed): Likewise.
369 * HACKING: Mention new requirement.
370 * bootstrap: Likewise.
371 Reported by Ralf Wildenhues.
373 2009-04-21 Eric Blake <ebb9@byu.net>
375 Be more explicit about default quoting characters.
376 * doc/m4.texinfo (Quoted strings): Call out characters by name.
378 Suggested by Mehul Sanghvi.
380 2009-04-16 Eric Blake <ebb9@byu.net>
382 Use gnulib rename module.
383 * ltdl/m4/gnulib-cache.m4: Import rename module. At the moment,
384 we don't tickle either of the platform bugs that it fixes, but it
385 is better to be safe than sorry.
387 Require newer automake features.
388 * configure.ac (AM_INIT_AUTOMAKE): Add dist-xz, color-tests,
389 parallel-tests, and silent-rules. Drop dist-lzma.
390 * HACKING: Update minimum requirements.
391 * gnulib: Update to latest version.
393 Mention release of 1.4.13.
394 * NEWS: Update to match release on branch-1.4.
395 * doc/m4.texinfo (History): Update release history.
396 (copying): Finish conversion to GFDL 1.3, started 2008-11-04.
398 2009-03-23 Eric Blake <ebb9@byu.net>
400 Exploit git submodule by adding appropriate symlinks.
401 * bootstrap: No longer copy files from gnulib.
402 * COPYING: Change to symlink pointing into gnulib.
404 * build-aux/compile: Likewise.
405 * build-aux/config.guess: Likewise.
406 * build-aux/config.sub: Likewise.
407 * build-aux/depcomp: Likewise.
408 * build-aux/install-sh: Likewise.
409 * build-aux/mdate-sh: Likewise.
410 * build-aux/missing: Likewise.
411 * build-aux/texinfo.tex: Likewise.
412 * .cvsignore: Reflect these changes.
413 * .gitignore: Likewise.
414 * build-aux/.cvsignore: New file.
415 * build-aux/.gitignore: Likewise.
417 Make gnulib a git submodule.
418 * .gitmodules: New file.
419 * gnulib: Record which version of gnulib has been tested.
420 * bootstrap: Aid in submodule usage.
421 * cfg.mk (gnulib_dir): Alter default location of gnulib.
422 * HACKING: Mention how to use submodule.
424 2009-03-21 Eric Blake <ebb9@byu.net>
426 Use memcmp2 to simplify lexicographic comparisons.
427 * ltdl/m4/gnulib-cache.m4: Import memcmp2.
428 * modules/m4.c (dumpdef_cmp_CB): Use it.
430 2009-03-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
432 Fix m4.1 build race, exposed by parallelism through GNUmakefile.
433 * Makefile.am (SUBDIRS): Add doc.
434 (Documentation rules): Move ...
435 * doc/Makefile.am: ... to this new file.
436 * configure.ac (AC_CONFIG_FILES): Generate doc/Makefile.
438 2009-03-13 Eric Blake <ebb9@byu.net>
440 Try to tolerate spaces in directory names in testsuite.
441 * tests/null.m4: Provide shell quoting, in case __program__
444 Fix awk script portability.
445 * checks/get-them: In gsub, properly escape {.
446 Reported by Gary V. Vaughan.
448 Make bootstrap easier on Solaris.
449 * bootstrap: Add GNULIB_SRCDIR. Useful when a wrapper script
450 gnulib-tool exists earlier on the path to work around /bin/sh
451 failure in parsing $GNULIB_SRCDIR/gnulib-tool.
453 2009-03-13 Eric Blake <ebb9@byu.net>
455 Allow configuration choice in syscmd shell.
456 * ltdl/m4/m4-syscmd.m4: New file.
457 * configure.ac (M4_SYSCMD): Use it to provide
459 (AC_CHECK_HEADERS_ONCE): No longer need to worry about
461 * modules/m4.c (syscmd): Use it to avoid hard-coding the shell
463 * modules/gnu.c (esyscmd): Likewise.
464 * doc/m4.texinfo (Syscmd, Esyscmd): Document this.
465 * README: Document new configure option.
468 Use gnulib pipe module instead of popen(3).
469 * ltdl/m4/gnulib-cache.m4: Import pipe and wait-process modules.
470 * modules/gnu.c (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS):
472 (esyscmd): Rewrite with pipe module.
473 Resolves a failure on AIX, reported by Gary V. Vaughan.
475 Use gnulib execute module instead of system(3).
476 * ltdl/m4/gnulib-cache.m4: Import execute module.
477 * m4/utility.c (m4_info_name): New function.
478 * m4/m4module.h (m4_info_name): New prototype.
479 * modules/m4.c (syscmd): Rewrite with execute module.
480 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS, m4_sysval): Move
482 * modules/gnu.c (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS)
484 Resolves a failure on AIX, reported by Gary V. Vaughan.
486 2009-03-05 Eric Blake <ebb9@byu.net>
488 Improve web-manual maintainer rule.
489 * maint.mk (web-manual): Factor package-specific detail...
490 * cfg.mk (manual_title): ...to new variable.
492 2009-02-23 Eric Blake <ebb9@byu.net>
494 Speed up translit when from argument is short.
495 * modules/m4.c (translit): Use memchr2 when possible.
496 * tests/builtins.at (translit): Add tests.
497 * NEWS: Document this.
499 2009-02-18 Eric Blake <ebb9@byu.net>
501 Prefer buffer over byte operations.
502 * modules/format.c (format): Use memchr for speed.
503 * modules/gnu.c (substitute): Likewise.
504 * m4/macro.c (locate_dollar): Inline into only caller...
505 (process_macro): ...and rearrange for readability.
506 * m4/input.c (consume_buffer): Allow C++ compilation.
507 * doc/m4.texinfo (Changesyntax): Enhance test.
509 Speed up esyscmd with buffer reads.
510 * modules/gnu.c (esyscmd): Read blocks directly into obstack,
511 rather than repeatedly reading bytes. Detect read errors.
513 Avoid risk of stack overflow.
514 * m4/output.c (insert_file): Avoid stack allocation of large
517 Synchronize THANKS with branch.
518 * THANKS: Import more names.
520 Improve handling of $ in syntax table.
521 * m4/m4module.h (m4_is_syntax_single_dollar): New function.
522 (M4_SYNTAX_DOLLAR, M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): Change to
523 be context rather than basic syntax categories.
524 (M4_SYNTAX_MASKS): Adjust macro.
525 * m4/m4private.h (struct m4_syntax_table): Add dollar and
526 is_single_dollar members.
527 (m4_is_syntax_single_dollar): Add fast alternative.
528 * m4/syntax.c (m4_syntax_create, reset_syntax_set): Adjust to
529 account for change to context categories.
530 (m4_set_syntax): Manage is_single_dollar.
531 (m4_is_syntax_single_dollar): New function.
532 * m4/macro.c (locate_dollar): New helper function.
533 (process_macro): Use it to speed up macro expansion.
534 * m4/input.c (m4__next_token): Adjust client.
535 * doc/m4.texinfo (Changesyntax): Document this.
537 2009-02-17 Eric Blake <ebb9@byu.net>
539 Sync changecom documentation with branch.
540 * doc/m4.texinfo (Changecom): Tweak wording.
541 * NEWS: Import changes from the branch.
543 Stage 29b: Process quotes and comments by buffer, not bytes.
544 Search for quote and comment delimiters by buffer when possible.
546 Speed impact: noticeable improvement, from fewer function calls.
547 * ltdl/m4/gnulib-cache.m4: Import memchr2 module.
548 * m4/input.c (m4__next_token): Add buffer reads to quote and
550 * NEWS: Document this.
552 2009-02-16 Eric Blake <ebb9@byu.net>
554 Stage 29a: Process dnl and macro names by buffer, not bytes.
555 Enhance input engine to provide lookahead buffer, rather than
556 forcing clients to call next_char for every byte. Utilize this
557 for the simplest clients.
559 Speed impact: noticeable improvement, from fewer function calls.
560 * ltdl/m4/gnulib-cache.m4: Import freadptr and freadseek modules.
561 * m4/input.c (struct input_funcs): Add virtual functions
562 buffer_func and consume_func.
563 (file_buffer, file_consume, string_buffer, string_consume)
564 (composite_buffer, composite_consume, eof_buffer): Implement
566 (file_funcs, string_funcs, composite_funcs, eof_funcs): Update
568 (buffer_retry): New sentinel.
569 (next_buffer, consume_buffer): New functions.
570 (m4_skip_line, match_input, consume_syntax): Use them for faster
572 Suggested by Bruno Haible.
574 Unify single and multi-character delimiter handling.
575 * m4/input.c (MATCH): Add a parameter.
576 (m4__next_token): Simplify logic and reduce redundancy.
577 (m4__next_token_is_open): Adjust caller.
578 * m4/syntax.c (m4_set_comment, m4_set_quotes): Handle delimiters
579 of differing lengths.
580 (m4_set_syntax): Recognize restoration of single delimiters.
582 Revamp changesyntax vs. changequote interactions.
583 * m4/m4module.h (M4_SYNTAX_VALUE): Delete unused macro.
584 (M4_SYNTAX_SUSPECT): New macro.
585 * m4/m4private.h (struct m4_syntax_table): Add suspect field.
586 * m4/syntax.c (check_is_single_quotes, check_is_single_comments)
587 (check_is_macro_escaped): Delete, by inlining body...
588 (m4_set_syntax): ...into here. Improves handling between
589 changesyntax and changequote/changecom.
590 (add_syntax_set, subtract_syntax_set, set_syntax_set): Simplify,
591 and let suspect field track needed cleanup.
592 (m4_set_quotes, m4_set_comment): Adjust meaning of
593 is_single_quotes and is_single_comment flags to always be true if
594 only one delimiter exists, regardless of its length. Ensure that
595 the syntax categories M4_SYNTAX_LQUOTE and M4_SYNTAX_BCOMM are
596 only used on 1-byte delimiters.
597 (add_syntax_attribute, remove_syntax_attribute): Change signature
598 to allow the use of fewer casts. Adjust the suspect field when
600 (m4_reset_syntax, set_quote_age): Adjust callers.
601 * m4/input.c (m4__next_token, m4__next_token_is_open): Simplify
603 * doc/m4.texinfo (Changesyntax): Update documentation and tests.
605 Improve changesyntax documentation.
606 * doc/m4.texinfo (Changesyntax): Merge two tables into one
609 Fix regression in multicharacter quotes, from 2008-01-26.
610 * m4/input.c (m4__next_token): Fix typo.
611 * tests/builtins.at (changequote): Enhance test.
613 2009-02-13 Eric Blake <ebb9@byu.net>
615 Speed up parsing when detecting input file change.
616 * m4/input.c (next_char): Clear input_change flag. Bug introduced
619 2009-02-12 Eric Blake <ebb9@byu.net>
621 Avoid quadratic code when walking definition stack.
622 * examples/stack_sep.m4: Use linear, not quadratic
624 * doc/m4.texinfo (Improved copy): Fix documentation, based on
625 recent autoconf bug fix.
626 * tests/others.at (recursion): Enhance test.
628 2009-02-11 Eric Blake <ebb9@byu.net>
630 Stage 28c: Warn on embedded NUL in remaining cases.
631 Ensure all remaining warnings can handle embedded NUL.
633 Speed impact: none noticed.
634 * m4/m4module.h (m4_debug_decode, m4_parse_truth_arg): Add
636 * m4/macro.c (m4_macro_call): Improve diagnostic.
637 * modules/m4.c (defn): Likewise.
638 * m4/debug.c (m4_debug_decode): Handle embedded NUL.
639 * m4/utility.c (m4_parse_truth_arg): Likewise.
640 * modules/format.c (arg_int, arg_long, arg_double): Likewise.
641 (arg_string): New function.
642 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Update callers.
643 * src/main.c (main): Likewise.
644 * src/freeze.c (reload_frozen_state): Likewise.
645 * modules/gnu.c (debugmode, syncoutput): Likewise.
646 * tests/options.at (--regexp-syntax): Adjust test.
647 * tests/freeze.at (reloading nul): Likewise.
648 * tests/null.m4: Likewise.
649 * tests/null.out: Likewise.
650 * tests/null.err: Likewise.
652 Stage 28b: Warn on embedded NUL in file arguments.
653 Quote warning messages related to file and other NUL-terminated
656 Speed impact: none noticed.
657 * m4/path.c (m4_path_search): Quote file names in message.
658 * modules/m4.c (syscmd, include, m4_make_temp): Handle embedded
660 * modules/gnu.c (debugfile, esyscmd): Likewise.
661 * tests/others.at (nul character): Adjust test.
662 * tests/builtins.at (mkdtemp, mkstemp): Likewise.
663 * tests/null.m4: Likewise.
664 * tests/null.out: Likewise.
665 * tests/null.err: Likewise.
667 Stage 28a: Warn on embedded NUL in numeric arguments.
668 Quote warning messages related to numeric parsing in order to
671 Speed impact: none noticed.
672 * m4/m4module.h (m4_numeric_arg): Adjust prototype.
673 * m4/utility.c (m4_numeric_arg): Add parameter.
674 * modules/gnu.c (debuglen): Adjust callers.
675 * modules/m4.c (incr, decr, divert, undivert, m4exit, substr)
677 * modules/evalparse.c (m4_evaluate): Likewise.
678 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
679 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
681 * doc/m4.texinfo (Changesyntax): Fix typo.
682 * tests/others.at (nul character): Adjust test.
683 * tests/null.m4: Likewise.
684 * tests/null.out: Likewise.
685 * tests/null.err: Likewise.
687 2009-02-11 Eric Blake <ebb9@byu.net>
689 Avoid regression in popdef(undef).
690 * doc/m4.texinfo (Trace): Enhance test, to cover regression
691 recently fixed on the branch.
693 2009-02-09 Eric Blake <ebb9@byu.net>
695 Enhance index to support starting offset.
696 * modules/m4.c (index): Add optional third argument.
697 * NEWS: Document this.
698 * doc/m4.texinfo (Index macro): Likewise.
699 (Macro Arguments): Adjust tests.
701 2009-01-24 Eric Blake <ebb9@byu.net>
703 Add URLs to --help output.
704 * src/main.c (usage): Use enhanced version-etc features.
706 2009-01-07 Eric Blake <ebb9@byu.net>
708 Enhance substr to support replacement text.
709 * doc/m4.texinfo (Substr): Document new semantics.
710 * modules/m4.c (substr): Support optional fourth argument.
711 * NEWS: Document this.
713 Enhance substr to support negative values.
714 * doc/m4.texinfo (Substr): Document new semantics, and how to
716 * modules/m4.c (substr): Support negative values.
717 * NEWS: Document this.
719 2009-01-05 Eric Blake <ebb9@byu.net>
722 * HACKING: Remove mention of xdelta.
723 * Makefile.am (EXTRA_DIST, MAINTAINERCLEANFILES): Let gnulib take
724 care of distributing gendocs.sh.
725 * maint.mk (web-manual): Use new feature of gendocs.
726 * ltdl/m4/gnulib-cache.m4: Regenerate.
728 2008-12-24 Eric Blake <ebb9@byu.net>
730 Relax eval as allowed by POSIX 2008.
731 * modules/evalparse.c (m4_evaluate): Warn, not error, on invalid
732 operator. Quote expression in warning.
733 * modules/mpeval.c (includes): Add quotearg.h.
734 * doc/m4.texinfo (Eval, Improved forloop): Update tests.
735 * NEWS: Update to reflect 1.6 support for `?:'.
737 2008-12-23 Eric Blake <ebb9@byu.net>
739 Add debugmode(o) to control dumpdef output location.
740 * m4/m4module.h (M4_DEBUG_TRACE_OUTPUT_DUMPDEF): New enumerator.
741 (M4_DEBUG_TRACE_VERBOSE): Update.
742 * m4/debug.c (m4_debug_decode): Support new debug option.
743 * src/freeze.c (produce_debugmode_state): Likewise.
744 * modules/m4.c (dumpdef): When set, force dumpdef to stderr rather
746 * src/main.c (usage): Document it.
747 * doc/m4.texinfo (Debugmode, Dumpdef, Debugging options)
748 (Debugfile): Likewise.
750 Based on an autoconf bug report by Paolo Bonzini.
752 Make --debugfile argument optional.
753 * src/main.c (long_options): Make the argument optional, to allow
754 setting debug file back to stderr.
755 (main): Make --debugfile order-dependent.
756 (usage): Document this.
757 * doc/m4.texinfo (Debugging options): Likewise.
759 * tests/options.at (--debugfile): Enhance test.
760 (--safer): Adjust to new semantics.
762 2008-12-22 Eric Blake <ebb9@byu.net>
765 * doc/m4.texinfo (Operation modes, Preprocessor features)
766 (Limits control, Frozen state, Debugging options)
767 (Dynamic loading features): Use lower case names in @var.
768 (Improved copy): Use @code, not @var, as appropriate.
770 2008-12-18 Eric Blake <ebb9@byu.net>
772 Deal with M4 1.4.x limitation on builtin tokens.
773 * doc/m4.texinfo (Composition): Mention limitation on curry.
774 (Improved copy): New node.
776 * examples/stack.m4: Likewise.
777 * examples/stack_sep.m4: New file.
778 * Makefile.am (dist_pkgdata_DATA): Distribute it.
780 2008-12-15 Eric Blake <ebb9@byu.net>
782 Double size of temp file cache.
783 * m4/output.c (tmp_file, tmp_file_owner): Split...
784 (tmp_file1, tmp_file2, tmp_file1_owner, tmp_file2_owner): ...into
786 (tmp_file2_recent): New variable.
787 (m4_tmpopen, m4_tmpclose, m4_tmpremove, m4_tmprename)
788 (m4_output_exit): Adjust callers.
790 Use fewer seeks on cached files.
791 * m4/output.c (m4_tmpfile): Use write, not append mode.
792 (m4_tmpopen): Add parameter to decide when to skip seeks.
793 (m4_tmprename, m4_make_diversion, insert_diversion_helper)
794 (m4_freeze_diversions): Adjust callers.
796 Cache most recently spilled diversion.
797 * m4/output.c (tmp_file, tmp_file_owner): New variables, for
798 1-deep cache of spilled diversions.
799 (m4_tmpfile): Open in append mode, since we might revisit
800 diversion without closing it now.
801 (m4_tmpopen): Check cache first.
802 (m4_tmpclose): Update cache, rather than closing. Add parameter.
803 (m4_tmpremove): Close cache before removing.
804 (m4_tmprename): Deal with open files when renaming.
805 (m4_output_exit): Close cache before exiting.
806 (make_room_for, m4_make_diversion, insert_diversion_helper):
808 * ltdl/m4/m4-rename.m4 (M4_RENAME): New file.
809 * configure.ac (M4_RENAME): Invoke it.
811 Correctly track size of in-memory diversions.
812 * m4/output.c (insert_diversion_helper): Correctly track total
813 in-memory diversion size after undivert.
815 Avoid quadratic behavior for some cases of divert/undivert.
816 * m4/output.c (struct m4_diversion): Improve comments.
817 (m4_tmpname, m4_make_diversion): Strengthen preconditions.
818 (m4_tmprename): New function.
819 (m4_output_init, m4_output_exit): Move after internal functions.
820 (make_room_for): Don't bother copying uninitialized bytes.
821 (insert_diversion_helper): Transfer metadata, rather than copying
822 contents, when undiverting into a previously unused diversion.
823 * tests/builtins.at (divert): Add a check to the test.
824 * doc/m4.texinfo (Undivert): Enhance test.
825 * NEWS: Document the speedup.
827 2008-12-02 Eric Blake <ebb9@byu.net>
829 Stage 27: Allow embedded NUL in text processing macros.
830 Pass NUL through regular expressions, format, and translit, and
831 diagnose it in eval and changeresyntax. Improve warning
832 capabilities of format.
834 Speed impact: none noticed.
835 * modules/m4.c (m4_expand_ranges): Don't append extra bytes.
836 (translit): Manage NUL bytes.
837 * modules/format.c (format): Likewise.
838 * modules/gnu.c (substitute, regexp_substitute): Likewise.
839 (m4_resyntax_encode_safe): Add parameter.
840 (regexp, patsubst, renamesyms): Update callers.
841 (regexp_compile): Adjust error message.
842 * modules/evalparse.c (m4_evaluate): Use consistent message.
843 (end_text): New variable.
844 (eval_init_lex): Add parameter.
845 (eval_lex): Detect embedded NUL.
846 * src/freeze.c (reload_frozen_state): Likewise.
847 * doc/m4.texinfo (Format): Update to cover new behavior.
848 (Eval): Mention that result is unquoted.
849 * tests/freeze.at (reloading nul): Enhance test.
850 * tests/null.m4: Likewise.
851 * tests/null.err: Update expected output.
852 * tests/null.out: Likewise.
853 * tests/options.at (--regexp-syntax): Likewise.
855 2008-11-28 Eric Blake <ebb9@byu.net>
857 Resync NEWS with branches.
858 * NEWS: Mention 1.4.12, update state of 1.6.
860 2008-11-26 Eric Blake <ebb9@byu.net>
862 Keep COPYING in repository.
863 * Makefile.am (MAINTAINERCLEANFILES): Don't remove COPYING.
864 * .cvsignore: Don't ignore it.
865 * .gitignore: Likewise.
866 * COPYING: Store in repository, per automake 1.10.2
869 2008-11-26 Eric Blake <ebb9@byu.net>
871 Document optimized forloop.
872 * doc/m4.texinfo (Improved forloop): Mention alternate style that
873 avoids define overhead.
874 * examples/forloop3.m4: New file.
875 * Makefile.am (dist_pkgdata_DATA): Distribute it.
877 Document copy composite using stack_foreach and curry.
878 * doc/m4.texinfo (Stacks): New node, to document pushdef stack
880 (Ifelse): Move define_blind...
881 (Composition): ...to this new node. Document currying, then use
882 it to implement copy and rename.
883 * examples/curry.m4: New file.
884 * examples/stack.m4: Likewise.
885 * Makefile.am (dist_pkgdata_DATA): Distribute them.
887 2008-11-04 Eric Blake <ebb9@byu.net>
890 * ltdl/m4/gnulib-cache.m4: Replace fdl module with fdl-1.3.
891 * Makefile.am (doc_m4_TEXINFOS, MAINTAINERCLEANFILES): Reflect
893 * doc/m4.texinfo (GNU Free Documentation License): Likewise.
895 2008-10-22 Eric Blake <ebb9@byu.net>
897 Give nicer error if user modifies testsuite but lacks autoconf.
898 * Makefile.am (AUTOM4TE): Use missing in the definition.
900 2008-10-09 Eric Blake <ebb9@byu.net>
902 Allow user to choose which sed to use in testsuite.
903 * tests/atlocal.in (SED): Inherit from configure results.
904 * tests/builtins.at (__m4_@&t@version__, divert, esyscmd)
905 (mkstemp, syscmd): Use $SED.
906 * tests/generate.awk (new_test): Likewise.
907 * tests/options.at (deprecated options, unknown option)
908 (--debugmode, --help and --version): Likewise.
909 * tests/testsuite.at (AT_CHECK_M4): Likewise.
910 * tests/others.at (directory, stderr closed, stdin seekable)
911 (stdout closed): Likewise.
912 (nul character): Likewise. Also, skip test if sed can't handle
915 Clean up testsuite invocation.
916 * tests/atlocal.in: Fix copyright notice.
917 * Makefile.am (TESTS_ENVIRONMENT): Delete; it wasn't being used.
918 (check-local, installcheck-local): Adjust clients. Add missing
921 2008-09-25 Eric Blake <ebb9@byu.net>
923 Tweak error message on command line failure.
924 * m4/m4private.h (includes): Use "quotearg.h".
925 * src/main.c (process_file, main): Use nicer quotes for file name
927 * m4/input.c (file_clean, m4_push_file): Likewise.
928 * m4/module.c (m4__module_open): Likewise.
929 * src/freeze.c (produce_frozen_state, reload_frozen_state):
931 * modules/gnu.c (debugfile): Likewise.
932 * modules/m4.c (undivert, include): Likewise.
933 * tests/others.at (directory, stdin closed): Update tests.
934 * tests/options.at (file names, --debugmode): Likewise.
935 * doc/m4.texinfo (Debugmode): Likewise.
937 Unify error handling for reading directories.
938 * m4/path.c (m4_path_search): Factor open attempts...
939 (m4_fopen): ...into new function, to reject directories.
940 * tests/others.at (directory): Enhance test.
941 * doc/m4.texinfo (Include): Document that directories cannot be
944 Avoid bugs on platforms that mishandle trailing /.
945 * ltdl/m4/gnulib-cache.m4: Import fopen module.
946 * tests/others.at (directory): New test.
948 2008-09-16 Eric Blake <ebb9@byu.net>
950 Fix bootstrap for Solaris /bin/sh.
951 * bootstrap: Avoid shell quoting pitfall.
953 2008-09-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
955 Typos in source code comments.
956 * modules/m4.c: Fix typos in comments.
957 * m4/input.c: Likewise.
958 * src/main.c: Likewise.
960 2008-08-29 Eric Blake <ebb9@byu.net>
962 Fix manual date information.
963 * doc/m4.texinfo: UPDATED refers to the day the manual was built,
964 not the release date of M4.
965 Based on a bison patch by Akim Demaille.
967 2008-08-27 Eric Blake <ebb9@byu.net>
970 * doc/m4.texinfo (Invoking m4): Fix example, since order of -d
974 2008-08-23 Eric Blake <ebb9@byu.net>
976 Allow debugmode control over whether defn(undef) warns.
977 * ltdl/m4/gnulib-cache.m4: Import verify module.
978 * m4/m4module.h (M4_DEBUG_TRACE_DEREF, M4_DEBUG_TRACE_INITIAL):
980 (M4_DEBUG_TRACE_VERBOSE, M4_DEBUG_TRACE_DEFAULT): Adjust.
981 * m4/m4.c (m4_create): Start with debugmode = d.
982 * src/main.c (usage): Mention this.
983 (main): Let -E impact debug mode.
984 * m4/utility.c (m4_symbol_value_lookup): Squelch undefined warning
986 * modules/gnu.c (builtin, inder): Likewise.
987 * m4/debug.c (m4_debug_decode): Parse new mode.
988 * src/freeze.c (produce_debugmode_state): Accomodate new mode.
989 * doc/m4.texinfo (Debugging options): Mention change in the
991 (Debugmode): Mention new flag d.
992 (Operation modes): Mention interaction with -E.
993 (Undefine, Defn, Pushdef, Indir, Builtin, Dumpdef): Document and
995 * tests/options.at (--debugmode): Update tests.
996 * tests/freeze.at (reloading debugmode): Likewise.
997 * NEWS: Document this.
998 Reported by Ralf Wildenhues; without this patch, M4 1.6+ would be
999 incompatible with Autoconf 2.62.
1001 2008-08-22 Eric Blake <ebb9@byu.net>
1003 Improve --debugmode behavior.
1004 * m4/m4module.h (m4_debug_decode): Simplify interface.
1005 * m4/debug.c (m4_debug_decode): Remove parameter, and handle
1006 setting the new value.
1007 * modules/gnu.c (debugmode): Adjust caller.
1008 * src/freeze.c (reload_frozen_state): Likewise.
1009 * src/main.c (main): Likewise.
1010 (usage): Fix default for --debug.
1011 * doc/m4.texinfo (Debugging options): Add an example.
1013 2008-08-21 Eric Blake <ebb9@byu.net>
1015 Avoid regression in defn(undef).
1016 * doc/m4.texinfo (Trace): Enhance test, to cover regression
1017 recently fixed on the branch.
1019 2008-08-18 Eric Blake <ebb9@byu.net>
1021 Remove deprecated -N option; fixes a regression from 2006-09-14.
1022 * src/main.c (DIVERSIONS_OPTION): Delete.
1023 (long_options, OPTSTRING, main): Remove -N/--diversions option.
1024 * doc/m4.texinfo (Limits control): Remove it from the manual.
1025 * NEWS: Mention that it is gone.
1026 * tests/options.at (deprecated options): Update test.
1028 Improve 'git diff' of manual source.
1029 * .gitattributes (*.texi*): Add diff attribute.
1030 * bootstrap: Tell git how to use it.
1031 Inspired by Jim Meyering's similar patch for coreutils.
1033 2008-08-07 Bruno Haible <bruno@clisp.org> (tiny change)
1035 Run m4 tests prior to gnulib unit tests.
1036 * Makefile.am (SUBDIRS): Swap order of directories.
1038 2008-08-03 Eric Blake <ebb9@byu.net>
1040 Stage 26: Allow embedded NUL in macro definitions.
1041 Clean up final few locations that did not track macro definitions
1042 by length, to allow embedded NUL. Make m4_arg_len callers aware
1043 of issue of flattening builtins when determining length.
1044 Memory impact: none.
1045 Speed impact: none noticed.
1046 * m4/m4module.h (m4_arg_len): Add parameter.
1047 (M4ARGLEN): Provide default for the parameter.
1048 * m4/m4private.h (includes): Share xmemdup0.h among all libm4
1050 * m4/macro.c (m4_arg_len): Fail if builtins are not flattened.
1051 * m4/syntax.c (includes): Rely on m4private.h for xmemdup0.
1052 * m4/symtab.c (includes): Likewise.
1053 (m4_symbol_value_copy): Use xmemdup0.
1054 * m4/module.c (install_macro_table): Likewise.
1055 * src/freeze.c (reload_frozen_state): Likewise.
1056 * tests/freeze.at (reloading nul): Enhance test.
1057 * tests/null.m4: Likewise.
1058 * tests/null.err: Update expected output.
1059 * tests/null.out: Likewise.
1061 Fix regression in commenting unbalanced quotes, from 2008-02-16.
1062 * m4/m4private.h (m4__token_type): Add M4_TOKEN_COMMENT.
1063 * m4/input.c (m4__next_token, m4_print_token): Supply new token
1065 * m4/macro.c (expand_token): Penalize comments, as they can
1066 contain unbalanced quotes; latent bug since 2007-12-07, exposed by
1067 passing $@ references built from comments.
1068 (expand_argument): Adjust caller.
1069 * tests/others.at (Comments): Enhance test to catch it.
1070 * NEWS: Mention the fix.
1072 2008-07-30 Eric Blake <ebb9@byu.net>
1074 Fix regression in trace output, introduced 2008-05-08.
1075 * m4/input.c (m4__push_symbol): When cloning chains, break pointer
1076 back to original chain; latent bug from 2008-02-02 that did not
1077 cause misbehavior until trace output read unfinished chain.
1078 * tests/builtins.at (debug): Add test for this.
1080 2008-07-28 Eric Blake <ebb9@byu.net>
1082 Optimize iteration examples.
1083 * examples/forloop2.m4: Avoid excess indir, by passing current
1084 counter value as parameter.
1085 * examples/foreachq3.m4: Avoid unneeded ifelse, by injecting an
1087 * doc/m4.texinfo (Improved forloop, Improved foreach): Update the
1088 documentation to match.
1090 2008-07-26 Eric Blake <ebb9@byu.net>
1092 Give example for O(n) foreach on m4 1.4.x.
1093 * examples/foreachq4.m4: New file.
1094 * Makefile.am (dist_pkgdata_DATA): Distribute it.
1095 * tests/others.at (recursion): Test it.
1096 * doc/m4.texinfo (Improved foreach): Document linear foreach with
1097 m4 1.4.5 and greater.
1099 2008-07-19 Eric Blake <ebb9@byu.net>
1101 Resynchronize docs from branch.
1102 * doc/m4.texinfo (Undefine, Pushdef): Mention warning on undefined
1103 name, particularly since the old documentation didn't match code.
1104 (Standard Modules): Add caveat about using __m4_version__.
1106 2008-07-11 Eric Blake <ebb9@byu.net>
1108 Bump required automake to 1.10a; regression introduced 2008-01-22.
1109 * configure.ac (AM_INIT_AUTOMAKE): Undo requirement downgrade to
1110 1.10.1, since we also rely on pkglibexecdir.
1111 * HACKING: Fix minimum requirement.
1112 * bootstrap: Likewise.
1114 Reported by Joel E. Denny.
1116 Avoid bogus whitespace in @ovar, @dvar.
1117 * doc/m4.texinfo (ovar, dvar): Add @c.
1118 Based on patch by Ralf Wildenhues to Autoconf manual.
1120 2008-06-23 Eric Blake <ebb9@byu.net>
1122 Adjust to new gnulib-tool layout.
1123 * ltdl/m4/gnulib-cache.m4: Reformat.
1125 Fix bootstrap comment.
1126 * bootstrap: DOWNLOAD_PO was previously removed.
1128 2008-06-19 Eric Blake <ebb9@byu.net>
1130 Revert speed regression from 2008-06-16.
1131 * m4/output.c (m4_shipout_int): Avoid obstack_printf in hot path.
1132 * modules/m4.c (numb_obstack): Likewise.
1133 * m4/input.c (MATCH): Use fewer conditionals, and factor
1135 (match_input): ...here for smaller code size.
1136 * m4/syntax.c (m4_reset_syntax, m4_set_quotes, m4_set_comment):
1137 Supply trailing NUL to delimiters, to meet contract of faster
1140 2008-06-18 Eric Blake <ebb9@byu.net>
1143 * m4/m4module.h: Use consistent spacing for pointer parameters.
1144 * m4/m4private.h: Likewise.
1146 Stage 25b: Handle embedded NUL in changesyntax and friends.
1147 Track quote and comment delimiters by length, to allow embedded
1148 NUL. Improve changesyntax to support assigning syntax to NUL.
1149 Memory impact: none.
1150 Speed impact: none noticed.
1151 * m4/m4module.h (m4_set_quotes, m4_set_comment, m4_set_syntax):
1153 (m4_reset_syntax): New prototype.
1154 * m4/syntax.c (add_syntax_set, subtract_syntax_set)
1155 (set_syntax_set, m4_set_quotes, m4_set_comment): Add parameter, to
1156 handle embedded NUL.
1157 (m4_set_syntax): Likewise. Also, split code to reset the table...
1158 (m4_reset_syntax): ...into a new function.
1159 (m4_syntax_create): Adjust callers.
1160 * m4/input.c (match_input, MATCH): Add parameter.
1161 (m4__next_token, m4__next_token_is_open): Adjust callers.
1162 * modules/m4.h (m4_expand_ranges_func): Add parameter.
1163 * modules/m4.c (dumpdef): Handle NUL in dumped quotes.
1164 (changequote, changecom, translit, m4_expand_ranges): Track
1166 * modules/gnu.c (changesyntax): Handle embedded NUL.
1167 * src/freeze.c (reload_frozen_state): Adjust callers.
1168 * tests/freeze.at (reloading nul): Enhance test.
1169 * tests/null.m4: Likewise.
1170 * tests/null.out: Update expected output.
1171 * tests/null.err: Likewise.
1173 2008-06-16 Eric Blake <ebb9@byu.net>
1175 Stage 25a: Use obstack_printf for easier output.
1176 Convert macro tracing and other locations to use obstack_printf
1177 rather than hand-rolled equivalents. Ensure that embedded NUL in
1178 trace output does not truncate the trace string.
1179 Memory impact: none.
1180 Speed impact: noticeable penalty, from obstack_printf overhead.
1181 * ltdl/m4/gnulib-cache.m4: Import obstack-printf-posix module.
1182 * m4/macro.c (trace_format): Delete; use obstack_printf instead.
1183 (trace_header, trace_pre, trace_post): All callers updated.
1184 * m4/output.c (m4_shipout_int, m4_tmpname): Use obstack_printf.
1185 (m4_divert_text): Speed up syncline output.
1186 * modules/m4.c (dumpdef): Handle embedded NUL.
1187 (numb_obstack): Speed up eval output.
1188 (maketemp): Use obstack_printf.
1189 * modules/format.c (format): Likewise.
1191 Add missing const qualifications.
1192 * m4/resyntax.c (m4_resyntax_map): Declare array elements as
1194 * modules/gnu.c (m4_builtin_table, m4_macro_table): Likewise.
1195 * modules/import.c (m4_builtin_table): Likewise.
1196 * modules/load.c (m4_builtin_table, m4_macro_table): Likewise.
1197 * modules/m4.c (m4_builtin_table): Likewise.
1198 * modules/modtest.c (m4_builtin_table, m4_macro_table): Likewise.
1199 * modules/mpeval.c (m4_builtin_table, m4_macro_table): Likewise.
1200 * modules/perl.c (m4_builtin_table, m4_macro_table): Likewise.
1201 * modules/shadow.c (m4_builtin_table, m4_macro_table): Likewise.
1202 * modules/stdlib.c (m4_builtin_table): Likewise.
1203 * modules/time.c (m4_builtin_table): Likewise.
1204 * modules/traditional.c (m4_macro_table): Likewise.
1206 2008-06-10 Eric Blake <ebb9@byu.net>
1208 Avoid corrupted frozen file if NUL appears on block boundary.
1209 * m4/output.c (insert_file): Separate consecutive quotearg blocks
1210 with \<newline>, in case last byte of first block was NUL.
1212 2008-06-03 Eric Blake <ebb9@byu.net>
1214 Fix printf type mismatches.
1215 * m4/m4module.h (m4_bad_argc): Alter parameter type.
1216 * m4/m4private.h (struct m4_call_info): Alter call_id type.
1217 * m4/macro.c (expand_macro, m4__adjust_refcount): Use correct
1219 * m4/utility.c (m4_bad_argc): Likewise.
1221 Borrow bootstrap ideas from gnulib.
1222 * bootstrap (options, DOWNLOAD_PO): Remove --download-po; the
1223 advertized subset of languages didn't work. Use --skip-po
1224 instead, for consistency with gnulib bootstrap.
1225 (func_get_translations): Use rsync, not wget.
1226 (func_update_po): Use a reference directory, to avoid changing
1227 timestamps on unchanged .po files.
1228 * TODO: Update accordingly.
1230 Fix fallout from previous patch.
1231 * doc/m4.texinfo (Builtin): Adjust expected output.
1233 2008-06-02 Eric Blake <ebb9@byu.net>
1235 Stage 24c: Improve display of macro names with embedded NUL.
1236 Quote instances of problematic characters in macro names when
1237 presented to user. Track location via call_info rather than
1238 munging context for every expansion.
1239 Memory impact: none.
1240 Speed impact: slight penalty, due to more bookkeeping.
1241 * m4/m4module.h (m4_push_string_init): Add parameters.
1242 * m4/m4private.h (struct m4_macro_args): Remove argv0 and
1243 argv0_len, now redundant with info.
1244 (m4__push_wrapup_init): Add parameter.
1245 * m4/input.c (m4_push_string_init, m4__push_wrapup_init): Track
1246 location from caller, rather than context.
1247 (composite_peek, composite_read, match_input): Adjust callers.
1248 * m4/utility.c (m4_symbol_value_lookup): Quote macro name.
1249 (m4_verror_at_line): Allow NUL in macro name.
1250 * m4/macro.c (trace_flush, m4_trace_prepare, trace_pre): Allow NUL
1252 (expand_macro): No longer munge context location.
1253 (collect_arguments, m4_arg_text, m4_arg_empty, m4_arg_len)
1254 (m4_make_argv_ref, m4_push_arg, m4_wrap_args): Adjust callers.
1255 * modules/gnu.c (builtin, indir): Likewise.
1256 * tests/null.m4: Enhance test.
1257 * tests/null.err: Adjust expected output.
1258 * tests/null.out: Likewise.
1260 Stage 24b: Allow embedded NUL in macro names.
1261 Use length rather than NUL-termination when tracking macro names.
1262 All APIs dealing with symbol table changed.
1263 Memory impact: none.
1264 Speed impact: slight penalty, due to more bookkeeping.
1265 * m4/m4module.h (m4_symtab_apply_func, m4_symbol_lookup)
1266 (m4_symbol_pushdef, m4_symbol_define, m4_symbol_popdef)
1267 (m4_symbol_rename, m4_symbol_delete): Add length parameter.
1268 (m4_string): New type.
1269 * ltdl/m4/gnulib-cache.m4: Import xmemdup0 module.
1270 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): Account for
1272 * m4/symtab.c (m4_symtab_delete, m4_symtab_apply, symtab_fetch)
1273 (m4__symtab_remove_module_references, symbol_destroy_CB)
1274 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_define)
1275 (m4_symbol_popdef, m4_symbol_rename, m4_set_symbol_name_traced)
1276 (m4_symbol_delete): Likewise.
1277 * modules/m4.h (struct m4_dump_symbol_data): Adjust type to allow
1279 * m4/macro.c (expand_token): Adjust all callers.
1280 * m4/module.c (install_builtin_table, install_macro_table):
1282 * m4/utility.c (m4_symbol_value_lookup): Likewise.
1283 * modules/gnu.c (indir, renamesyms, m4symbols): Likewise.
1284 * modules/m4.c (define, undefine, pushdef, popdef)
1285 (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols, dumpdef)
1286 (traceon, traceoff): Likewise.
1287 * src/main.c (main): Likewise.
1288 * src/freeze.c (dump_symbol_CB, reload_frozen_state): Likewise.
1289 * tests/freeze.at (reloading nul): Augment test.
1290 * tests/null.out: Adjust expected output.
1292 Stage 24a: Use full call context in error reporting.
1293 Replace const char *macro_name with const m4_call_info *call, so
1294 that the next patch can pass the length of macro_name with
1295 embedded NUL. Simplifies handling of global state.
1296 Memory impact: none.
1297 Speed impact: none noticed.
1298 * m4/m4module.h (m4_error, m4_warn): Change parameter type.
1299 (m4_error_at_line, m4_warn_at_line): Delete.
1300 (m4_debug_set_output, m4_skip_line, m4_bad_argc, m4_numeric_arg)
1301 (m4_parse_truth_arg, m4_symbol_value_lookup): Adjust all clients.
1302 * m4/m4private.h (m4__next_token): Likewise.
1303 * m4/utility.c (m4_verror_at_line): Alter parameter, and use
1304 caller's location if caller is provided.
1305 (m4_error, m4_warn): Change parameter type.
1306 (m4_error_at_line, m4_warn_at_line): Delete.
1307 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg)
1308 (m4_symbol_value_lookup): Adjust all callers.
1309 * m4/debug.c (set_debug_file, m4_debug_set_output): Likewise.
1310 * m4/input.c (m4_skip_line, m4__next_token): Likewise.
1311 * m4/macro.c (expand_argument, collect_arguments, m4_macro_call)
1312 (process_macro): Likewise.
1313 * modules/m4.h (m4_make_temp_func): Likewise.
1314 * modules/evalparse.c (m4_evaluate): Likewise.
1315 * modules/format.c (arg_int, arg_long, arg_double, format):
1317 * modules/gnu.c (builtin, changeresyntax, changesyntax, debugfile)
1318 (debuglen, debugmode, esyscmd, indir, mkdtemp, patsubst, regexp)
1319 (renamesyms, syncoutput, regexp_compile, substitute)
1320 (regexp_substitute, m4_resyntax_encode_safe): Likewise.
1321 * modules/m4.c (define, undefine, pushdef, popdef, ifdef, ifelse)
1322 (m4_dump_symbols, defn, syscmd, incr, decr, divert, undivert, dnl)
1323 (include, maketemp, mkstemp, m4exit, traceon, traceoff, substr):
1325 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
1326 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
1328 * tests/options.at (--syncoutput): Add test for invalid
1329 command-line argument. Split xfailed portion...
1330 (--syncoutput and diversions): ...into new test.
1331 (unknown option): New test.
1332 * tests/freeze.at (reloading unknown builtin): Update expected
1335 Adjust to recent gnulib change.
1336 * configure.ac (AB_INIT): Delete, now that gnulib does this.
1338 2008-05-28 Eric Blake <ebb9@byu.net>
1340 Improve frozen debugmode behavior.
1341 * m4/debug.c (m4_debug_decode): Make empty debugmode additive.
1342 * src/main.c (main): Interleave -d with files.
1343 * tests/options.at (--debugmode): Update test.
1344 * tests/freeze.at (reloading debugmode): New test.
1345 * doc/m4.texinfo (Debugging options, Debugmode): Document the
1349 2008-05-27 Eric Blake <ebb9@byu.net>
1351 Fix some testsuite failures on Solaris 8.
1352 * tests/builtins.at (esyscmd, syscmd): Skip tests if system(2) is
1354 * tests/others.at (stderr closed): Likewise. Also support Solaris
1356 (stdin closed): Skip test if closed stdin gets reopened.
1357 (stdout closed): Support Solaris wording for EBADF.
1358 * tests/testsuite.at (AT_CHECK_M4): Likewise.
1360 Fix configure message nesting, broken since 2001-09-20.
1361 * ltdl/m4/gmp.m4 (M4_LIB_GMP): Don't cache result; the test is
1362 not expensive, and AC_MSG_WARN doesn't work in AC_CACHE_CHECK.
1364 Support 'make dist' with BSD make.
1365 * Makefile.am (TESTSUITE_AT, MAINTAINERCLEANFILES): Qualify uses
1366 of the generated file tests/generated.at.
1367 (EXTRA_DIST, $(TESTSUITE)): Likewise for tests/package.m4.
1368 * tests/others.at (stdout closed): Accomodate OpenBSD /bin/sh.
1370 2008-05-24 Eric Blake <ebb9@byu.net>
1372 Test NUL in frozen files.
1373 * tests/testsuite.at (AT_CHECK_M4): Add parameter.
1374 * tests/freeze.at (reloading nul): New test.
1375 (AT_TEST_FREEZE): Inhibit -d when reloading frozen file.
1376 (reloading unknown builtin): Likewise.
1378 2008-05-23 Eric Blake <ebb9@byu.net>
1380 Improve handling of frozen file errors.
1381 * src/freeze.c (produce_frozen_state): Detect write failures.
1382 (reload_frozen_state): Use close_stream.
1383 * tests/freeze.at (freezing failure): New test.
1385 Reported by Jean-Charles Longuet.
1387 2008-05-19 Eric Blake <ebb9@byu.net>
1389 In frozen file, split consecutive strings with newline.
1390 * src/freeze.c (dump_symbol_CB): Add newline to 'T', 'F'.
1391 (produce_frozen_state): Likewise for 'Q', 'C'.
1392 (reload_frozen_state): Parse the new layout.
1393 [GET_DIRECTIVE]: Fix format 1 regression from 2008-05-13.
1394 * tests/freeze.at (loading format 2): Rewrite to new format.
1395 (reloading unknown builtin): Likewise.
1396 (loading format 1): Make sure backslash-newline is not
1398 * doc/m4.texinfo (Frozen file format 2): Document the format.
1399 * NEWS: Document this change.
1401 Fix xgettext options.
1402 * po/Makevars (XGETTEXT_OPTIONS): The " must be passed to
1405 Fix spelling of René Seindal's name in --version output.
1406 * ltdl/m4/gnulib-cache.m4: Import propername module.
1407 * src/main.c (AUTHORS): Rewrite in terms of proper_name.
1408 * po/Makevars (XGETTEXT_OPTIONS): Detect new functions.
1409 * HACKING: Mention new prerequisite of gperf.
1411 2008-05-18 Eric Blake <ebb9@byu.net>
1413 Allow freezing the trace status of macros.
1414 * src/freeze.c (produce_symbol_dump): Let undefined traced macros
1416 (dump_symbol_CB): Also freeze trace state.
1417 * tests/freeze.at (reloading traced macros): New test.
1418 * doc/m4.texinfo (Using frozen files): Update documentation to
1420 (Frozen file format 1): Improve synchronization with branch.
1421 (Frozen file format 2): Reorder directives, and add `d', `t'.
1422 * NEWS: Document this change.
1424 2008-05-15 Eric Blake <ebb9@byu.net>
1426 Fix frozen file regression in pushdef stacks from 2001-09-01.
1427 * src/freeze.c (dump_symbol_CB): Push all values on the stack, not
1428 just the current definition.
1429 (reverse_symbol_value_stack): New helper method.
1430 * tests/freeze.at (AT_TEST_FREEZE): New helper macro.
1431 (reloading pushdef stack): New test.
1432 (reloading unknown builtin): Enhance test.
1434 2008-05-13 Eric Blake <ebb9@byu.net>
1436 Fix frozen file regression in diversions from 2007-01-21.
1437 * m4/output.c (insert_diversion_helper): Add parameter.
1438 (m4_insert_file): Move contents...
1439 (insert_file): ...to this new helper, with added parameter.
1440 (m4_insert_diversion, m4_undivert_all, m4_freeze_diversions):
1442 * src/freeze.c (produce_mem_dump): Simplify.
1443 * tests/freeze.at (large diversion): Test for this.
1445 Improve error message when frozen file is invalid.
1446 * src/freeze.c (decode_char): Add parameter. Allow \<newline>
1448 (reload_frozen_state): Track current line.
1449 * tests/freeze.at (loading format 1, loading format 2): Update to
1452 2008-05-10 Eric Blake <ebb9@byu.net>
1454 Detect integer overflow when loading frozen file.
1455 * src/freeze.c (reload_frozen_state) [GET_NUMBER]: Rewrite to fail
1456 immediately on overflow.
1457 * tests/freeze.at (loading format 2): Test this.
1458 Reported by Jim Meyering.
1460 2008-05-08 Eric Blake <ebb9@byu.net>
1462 Stage 23: allow tracing of indirect macro calls.
1463 Track all trace information as part of the argv struct, rather
1464 than temporarily resetting global state. Teach indir to trace
1465 macros that it invokes.
1466 Memory impact: slight penalty, due to larger argv struct.
1467 Speed impact: none noticed.
1468 * m4/m4module.h (m4_input_block): Remove.
1469 (m4_call_info): New opaque type.
1470 (m4_trace_prepare, m4_arg_info): New prototypes.
1471 (m4_macro_call, m4_push_string_finish, m4_input_print): Change
1473 * m4/m4private.h (struct m4_macro_args): Add info field.
1474 (struct m4_call_info): New structure.
1475 (m4_arg_info): New accessor.
1476 * m4/input.c (m4_input_block): Make typedef local.
1477 (m4_push_string_init): Initialize length.
1478 (m4_push_string_finish, m4_input_print): Change signature, so that
1479 printing can be done before finalization.
1480 (struct input_funcs): Add parameter to print_func.
1481 (file_print, string_print, composite_print): Adjust accordingly.
1482 * m4/macro.c (trace_header, trace_flush, trace_pre, trace_post):
1483 Change signatures for stacked trace messages, and for using call
1485 (trace_prepre): Export and rename...
1486 (m4_trace_prepare): ...to this, for use by indir. Alter signature
1487 to use call context.
1488 (collect_arguments): Alter signature, to manage new field.
1489 (expand_macro): Change call context management. Move tracing...
1490 (m4_macro_call): ...here. Remove redundant parameter.
1491 (m4_arg_argc): New function.
1492 (m4_make_argv_ref): Replace unused skip parameter with new trace
1493 parameter; manage new field.
1494 * modules/gnu.c (builtin, indir): Adjust callers.
1495 * src/main.c (usage): Update debugmode flag summary.
1496 * tests/null.m4: Enhance test.
1497 * tests/null.err: Update expected output.
1498 * tests/macros.at (Tracing Hanoi Towers): Likewise.
1499 * doc/m4.texinfo (Trace): Mention more about trace formatting.
1500 (Debugmode): Enhance description of 'c' and 'x'. Enhance test to
1501 cover line numbering details in traces.
1502 (Debuglen): Enhance test to cover indir tracing.
1503 * NEWS: Mention these changes.
1504 Reported by Akim Demaille in the autoconf TODO file in 2000.
1506 2008-05-07 Eric Blake <ebb9@byu.net>
1508 Test for traceon regression just fixed in branch-1.6.
1509 * doc/m4.texinfo (Trace): Enhance test.
1510 * NEWS: Port news item from branch.
1512 2008-05-05 Eric Blake <ebb9@byu.net>
1514 Stage 22: allow builtin token concatenation outside $@.
1515 Adjust the input and argument parsing engines to append builtins
1516 alongside text. Make define warn when builtins must be
1518 Memory impact: slight penalty, with fewer builtins flattened.
1519 Speed impact: slight penalty, from more bookkeeping.
1520 * m4/m4module.h (m4_is_arg_composite): New prototype.
1521 (m4_symbol_value_copy): Change return type.
1522 (m4_arg_text): Add parameter.
1523 (M4ARG): Adjust callers.
1524 * m4/m4private.h: Adjust comments.
1525 * m4/symtab.c (m4_symbol_value_copy): Detect when builtins are
1527 * m4/input.c (init_builtin_token): Add parameter, and allow
1528 concatenating builtins.
1529 (m4__next_token): Adjust caller.
1530 * m4/macro.c (m4_is_arg_composite): New function.
1531 (expand_argument): Allow builtin concatenation.
1532 (m4_arg_text): Add parameter.
1533 (m4__arg_adjust_refcount, m4__arg_print): Adjust callers.
1534 (m4_arg_equal): Fix comparison of builtin tokens.
1535 * modules/m4.c (define, pushdef): Warn when flattening builtins.
1536 * doc/m4.texinfo (Define): Remove dead comment.
1537 (Defn): Update to reflect code changes.
1538 * tests/builtins.at (defn): Remove xfail.
1539 * NEWS: Document this change.
1541 2008-05-03 Eric Blake <ebb9@byu.net>
1543 Document define_blind.
1544 * doc/m4.texinfo (Ifelse): Add a new composite macro.
1546 Suggested by Mike R.
1548 2008-05-01 Eric Blake <ebb9@byu.net>
1550 Avoid -Wshadow compiler warnings.
1551 * m4/output.c (threshold_diversion_CB): s/div/diversion/.
1552 * m4/macro.c (make_argv_ref, arg_symbol, m4_arg_symbol)
1553 (m4_is_arg_text, m4_is_arg_func, m4_arg_text, m4_arg_empty)
1554 (m4_arg_len, m4_arg_func, m4__arg_print, m4_make_argv_ref)
1555 (m4_push_arg, m4__push_arg_quote): s/index/arg/.
1556 * modules/format.c (format): Likewise.
1557 * modules/m4.c (ifelse): Likewise.
1559 Improve debugmode testing, based on recent branch-1.6 regressions.
1560 * doc/m4.texinfo (Debugmode): Enhance tests.
1561 * tests/generate.awk: Run tests from stdin, not input.m4. Support
1562 stderr munging when using -I examples.
1564 Fix regression in define from 2008-02-22.
1565 * m4/m4module.h (m4_symbol_value_copy): Add parameter.
1566 * m4/symtab.c (m4_symbol_value_copy): Support copying $@
1568 * m4/macro.c (expand_argument): Update callers.
1569 * modules/m4.c (define, pushdef): Likewise.
1570 * tests/builtins.at (define): Enhance test to catch this.
1572 2008-04-21 Eric Blake <ebb9@byu.net>
1574 Simplify previous patch.
1575 * tests/m4.in: Compress assignment.
1576 Suggested by Gary V. Vaughan.
1578 Fix --disable-shared testsuite regression from previous patch.
1579 * tests/m4.in: Export M4MODPATH, so that recursive m4 invocations
1582 Fix spelling of attribution to Christopher Strachey.
1583 * doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
1585 Reported by Fernando Carrijo.
1587 2008-04-17 Eric Blake <ebb9@byu.net>
1589 Fix testsuite bug when SIGPIPE is ignored.
1590 * tests/builtins.at (divert): Consume all of m4's output, to avoid
1591 spurious write failure.
1592 * src/main.c (main): In batch mode, restore default handling of
1594 * doc/m4.texinfo (Operation modes): Document SIGPIPE behavior.
1596 Reported by Bob Proulx, via his autobuilder.
1598 2008-04-15 Eric Blake <ebb9@byu.net>
1600 Fix 'make installcheck' after './configure --prefix-progname'.
1601 * tests/testsuite.at (AT_CHECK_M4): Allow overriding the m4
1603 (HELP_OTHER, PREPARE_TESTS): Document and use $M4.
1604 * tests/builtins.at (patsubst): Avoid space-tab.
1605 (divert, mkdtemp, mkstemp): Adjust tests to use $M4.
1606 * tests/options.at (--debugfile): Likewise.
1607 * tests/others.at (stdin seekable): Likewise.
1608 (fstab): Avoid space-tab.
1609 * Makefile.am (installcheck-local): Accomodate transformed name.
1610 (DISTCHECK_CONFIGURE_FLAGS): Ensure no regressions, by using gm4
1611 during 'make distcheck'.
1612 * cfg.mk: New file, borrowed from branch.
1614 Update prerequisite tools to match recent releases.
1615 * configure.ac (AC_PREREQ): Rely on released autoconf.
1616 (LT_PREREQ): Rely on released libtool.
1617 * tests/testsuite.at (m4_version_prereq): Update dependence.
1618 * bootstrap: Mention prerequisites.
1620 Work around OS/2 limitation of printf(1).
1621 * tests/null.m4: Use m4, not printf, to generate NUL byte.
1622 * tests/null.out: Check for esyscmd failure.
1623 Reported by Elbert Pol.
1625 2008-04-14 Eric Blake <ebb9@byu.net>
1627 Stage 21b: $@ concatenates builtins, m4wrap takes builtins.
1628 Improve arg_print to handle builtin tokens when printing to a
1629 known chain, rather than always flattening builtins. This allows
1630 m4wrap and $@ back-references to handle embedded builtin tokens.
1631 Memory impact: none.
1632 Speed impact: slight penalty, from more bookkeeping.
1633 * m4/m4module.h (m4_push_builtin): Add parameter.
1634 (m4_builtin_print, m4_push_wrapup_init, m4_push_wrapup_finish)
1635 (m4_arg_print, m4_symbol_value_print): Rename and reduce scope...
1636 * m4/m4private.h (m4__builtin_print, m4__push_wrapup_init)
1637 (m4__push_wrapup_finish, m4__arg_print, m4__symbol_value_print):
1638 ...to these, in some cases adding a parameter.
1639 (m4__append_builtin): New prototype.
1640 * m4/builtin.c (m4_builtin_print): Alter signature to print
1641 builtin to a growing symbol chain.
1642 * m4/symtab.c (m4__symbol_value_print): Alter signature.
1643 (m4_symbol_print, dump_symbol_CB): Adjust callers.
1644 * m4/input.c (builtin_peek, builtin_read, builtin_unget)
1645 (builtin_print, builtin_funcs): Delete, handled via composite
1647 (struct m4_input_block): Delete u.builtin member.
1648 (init_builtin_token): Only use composite block.
1649 (m4__append_builtin): New function.
1650 (m4_push_builtin, m4__push_wrapup_init): Alter signature.
1651 (m4__push_symbol): Allow builtin tokens.
1652 (m4__push_wrapup_finish): Rename.
1653 (composite_print, m4_print_token): Adjust callers.
1654 * m4/macro.c (m4_wrap_args, collect_arguments): Allow builtin
1656 (m4__arg_print): Alter signature.
1657 (trace_prepre, trace_pre, m4_arg_text, m4_arg_equal): Adjust
1659 * modules/m4.c (m4wrap): Allow builtin tokens.
1660 (defn, errprint): Adjust callers.
1661 * modules/gnu.c (builtin): Likewise.
1662 * doc/m4.texinfo (M4wrap): New test.
1663 (Debuglen): Adjust expected output.
1665 Stage 21a: Optimize checks for end of input.
1666 Create a new polymorphic input block type, which always fails with
1667 CHAR_EOF, so that remaining input routines no longer have to check
1668 for NULL input block.
1669 Memory impact: none.
1670 Speed impact: noticeable improvement, from fewer conditionals.
1671 * m4/input.c (eof_funcs, input_eof): New objects.
1672 (eof_peek, eof_read, eof_unget): New functions.
1673 (file_clean, m4_push_string_init, pop_input, m4_push_wrapup_init)
1674 (m4_pop_wrapup, next_char, peek_char, unget_input, m4_input_init)
1675 (m4_input_exit): Use placeholder to guarantee non-NULL isp and
1677 (next_char): Rename retry to allow_unget, and change sense for
1678 easier manipulation. All callers changed.
1680 Improve OS/2 detection.
1681 * modules/gnu.c (m4_macro_table): Ensure all possible identifiers
1682 are defined, not just the first. The testsuite ensures that
1683 exactly one gets defined.
1684 * m4/system_.h [__EMX__]: OS/2 is not Unix-compatible, no matter
1685 what other pre-defined macros it has.
1687 Reported by Elbert Pol.
1689 Ensure __m4_version__ is unquoted.
1690 * tests/builtins.at (__m4_@&t@version__): Augment test.
1692 Avoid GNU make failure on tarball.
1693 * Makefile.am (EXTRA_DIST): Distribute cfg.mk and maint.mk.
1695 2008-04-10 Eric Blake <ebb9@byu.net>
1697 Allow back-referenced macro names; fixes 2008-03-13 regression.
1698 * m4/m4module.h (m4_symbol_value_lookup): Change prototype.
1699 * m4/utility.c (m4_symbol_value_lookup): Change signature.
1700 * modules/m4.c (undefine, popdef, ifdef, m4_dump_symbols, defn):
1702 * tests/others.at (ifndef): New test.
1704 Be namespace clean for M4 version; fixes 2008-04-08 regression.
1705 * configure.ac (version): Rename...
1706 (M4_VERSION): ...to this, since using 'version' broke po.m4.
1708 2008-04-09 Eric Blake <ebb9@byu.net>
1710 Mention 1.4.11 release.
1711 * doc/m4.texinfo (History, Defn, Ifdef, Ifelse, M4wrap)
1712 (Extensions, Improved foreach): Distinguish 1.4.11 and 1.6.
1713 (Format): Add test of C99 hex-float parsing.
1714 * NEWS: Mention 1.4.11 release.
1715 * tests/builtins.at (divert): Add additional test.
1717 2008-04-08 Eric Blake <ebb9@byu.net>
1719 Overhaul inter-version releases to work with git.
1720 * configure.ac (version): New variable, which has nicer version
1721 contents when using git 1.5.5+, hardcoded to 1.9a otherwise.
1722 (TIMESTAMP): Delete, since CVS id expansion died with transition
1724 (AM_INIT_AUTOMAKE): Use version to decide gnu vs. gnits.
1725 * build-aux/mkstamp: Delete, no longer used.
1726 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Kill, to speed up
1727 rebuilds when timestamps don't matter.
1728 (MKSTAMP): Delete, no longer used.
1729 (EXTRA_DIST): No longer worry about mkstamp.
1730 (.version): New rule and distributed file.
1731 (doc/m4.1, tests/package.m4): Depend on .version, not
1732 configure.ac, for timestamp.
1733 * ltdl/m4/gnulib-cache.m4: Import git-version-gen module.
1734 * modules/gnu.c (__m4_version__): TIMESTAMP no longer exists.
1735 * src/main.c (main): Likewise.
1737 2008-03-28 Eric Blake <ebb9@byu.net>
1739 Use GNUmakefile module.
1740 * ltdl/m4/gnulib-cache.m4: Import gnumakefile module.
1741 * Makefile.am: Split off maintainer rules...
1742 * maint.mk: ...into this new file.
1744 2008-03-18 Eric Blake <ebb9@byu.net>
1746 Stage 20b: make m4wrap obey POSIX fifo ordering.
1747 Improve input engine to support location changes within symbol
1748 chains, then convert m4wrap to always build symbol chain.
1749 Memory impact: none.
1750 Speed impact: slight penalty, from more m4wrap bookkeeping.
1751 * m4/m4module.h (m4_wrap_args): Add prototype.
1752 * m4/m4private.h (enum m4__symbol_chain_type): Add M4__CHAIN_LOC.
1753 (struct m4__symbol_chain): Add struct u_l.
1754 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Use
1756 (composite_peek, composite_read, composite_clean): Handle location
1758 * m4/macro.c (m4_wrap_args): New function.
1759 * modules/m4.c (m4wrap): Use it.
1760 * doc/m4.texinfo (M4wrap): Sync with branch and POSIX.
1761 (Extensions): Document extension of multiple arguments.
1762 (Location, Improved m4wrap): Adjust example to match FIFO order.
1763 * tests/builtins.at (wrap): Likewise.
1764 * NEWS: Document this change.
1766 2008-03-17 Eric Blake <ebb9@byu.net>
1768 Stage 20a: reduce unget's in input engine.
1769 Now that out-of-range input placeholders like CHAR_BUILTIN are
1770 consumed outside of next_char, next_token should always consume
1771 rather than peek at the first character. Fewer peeks results in
1772 less ungetc overhead.
1773 Memory impact: none.
1774 Speed impact: noticeable improvement, from fewer function calls.
1775 * m4/input.c (struct input_funcs): Alter read_func prototype.
1776 (next_char, file_read, buildin_read, string_read, composite_read):
1777 Add allow_argv parameter.
1778 (init_builtin_token, init_argv_symbol): Require all prior input to
1780 (m4_skip_line, match_input, consume_syntax): Adjust callers.
1781 (m4__next_token): Consume first byte without peek.
1783 Update for fresh bootstrap.
1784 * ltdl/m4/gnulib-cache.m4: Updated copyright from upstream.
1786 2008-03-15 Eric Blake <ebb9@byu.net>
1788 Document join, in order to fix bug in m4wrap example.
1789 * examples/join.m4: New file.
1790 * examples/wraplifo2.m4: Likewise.
1791 * Makefile.am (EXTRA_DIST): Add new files.
1792 * doc/m4.texinfo (Improved m4wrap): New node.
1793 (Defn, Location): Enhance tests.
1794 (Shift): Document the composite macro join.
1795 (Incompatibilities): Move documentation of LIFO vs. FIFO...
1796 (M4wrap): ...here, to match improved example.
1798 2008-03-13 Eric Blake <ebb9@byu.net>
1800 Stage 19c: allow builtin tokens in more macros.
1801 Allow builtin tokens inside symbol chains, although for now, they
1802 are not allowed inside comments or quotes. Enable builtin token
1803 handling in more macros, if only to consistently diagnose invalid
1805 Memory impact: none.
1806 Speed impact: slight impact, due to more bookkeeping.
1807 * m4/m4module.h (m4_symbol_value_lookup, m4_builtin_print): New
1809 * m4/m4private.h (enum m4__symbol_chain_type): Add
1811 (struct m4__symbol_chain): Add builtin member.
1812 * m4/utility.c (m4_symbol_value_lookup): New method.
1813 * m4/builtin.c (m4_builtin_print): New function.
1814 * m4/symtab.c (m4_symbol_value_print): Use it.
1815 * m4/input.c (builtin_print): Likewise.
1816 (m4__push_symbol): Allow pushing builtin tokens.
1817 (composite_peek, composite_read, composite_unget, composite_clean)
1818 (composite_print): Handle builtin tokens.
1819 (init_builtin_token): Allow builtin tokens from composite input.
1820 (m4__next_token): Flatten builtins inside comment or string.
1821 * m4/macro.c (expand_argument): Strengthen assertion.
1822 (collect_arguments, m4_arg_equal, m4_arg_print, m4_push_args):
1823 Handle builtin tokens.
1824 (arg_symbol): Add parameter, and allow NULL level.
1825 (m4_arg_symbol, m4__push_arg_quote): Adjust callers.
1826 (m4_arg_text): Ensure all builtins have been flattened.
1827 * modules/m4.c (defn, dumpdef, popdef, traceoff, traceon)
1828 (undefine, m4_dump_symbols): Warn on invalid macro names.
1829 (ifdef, ifelse, shift): Handle builtin tokens.
1830 * modules/gnu.c (m4symbols): Likewise.
1831 * doc/m4.texinfo (Defn, Ifdef, Ifelse): Document and test the new
1833 (Debuglen): Likewise, and remove xfail.
1834 * NEWS: Mention the change.
1836 Stage 19b: invert sense of bit for handling builtin tokens.
1837 Pass builtin tokens by default, rather than as the exception, so
1838 that the logic can consistently refer to flattening arguments.
1839 Memory impact: none.
1841 * m4/m4module.h (M4BUILTIN_ENTRY): New convenience macro.
1842 (M4_BUILTIN_GROKS_MACRO): Rename...
1843 (M4_BUILTIN_FLATTEN_ARGS): ...and invert sense.
1844 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): Likewise...
1845 (m4_symbol_value_flatten_args, m4_symbol_flatten_args): ...to
1847 * m4/m4private.h (VALUE_MACRO_ARGS_BIT)
1848 (m4_symbol_value_groks_macro): Likewise...
1849 (VALUE_FLATTEN_ARGS_BIT, m4_symbol_value_flatten_args): ...to
1851 * m4/symtab.c (m4_symbol_value_groks_macro): Likewise...
1852 (m4_symbol_value_flatten_args): ...to this.
1853 * m4/macro.c (collect_arguments): Accomodate changed sense.
1854 * m4/module.c (m4__module_open): Require arguments if flattening
1856 * m4/input.c (m4_push_string_finish): For now, flatten all
1857 builtins pushed as back-references.
1858 * modules/gnu.c (m4_builtin_table, builtin): Adjust all clients.
1859 * modules/import.c (m4_builtin_table): Likewise.
1860 * modules/load.c (m4_builtin_table): Likewise.
1861 * modules/modtest.c (m4_builtin_table): Likewise.
1862 * modules/mpeval.c (m4_builtin_table): Likewise.
1863 * modules/perl.c (m4_builtin_table): Likewise.
1864 * modules/shadow.c (m4_builtin_table): Likewise.
1865 * modules/stdlib.c (m4_builtin_table): Likewise.
1866 * modules/time.c (m4_builtin_table): Likewise.
1867 * modules/m4.c (m4_builtin_table): Likewise.
1868 (mkstemp): Undo #undef hack from 2006-10-23, now that macro names
1869 are stringized without preprocessor expansion.
1870 * doc/m4.texinfo (Defn): Update comments to match reality.
1871 (Debuglen): Update test now that user macros pass builtin tokens.
1873 Stage 19a: sort and cache builtins loaded by a module.
1874 Rather than repeatedly using dlsym to browse the builtin table,
1875 copy off the table at module load time. Then, the input engine
1876 merely refers to the copy instead of duplicating information.
1877 Memory impact: slight penalty, due to more memory per module, but
1878 offset by less memory in input engine.
1879 Speed impact: slight improvement, due to faster builtin lookups.
1880 * m4/m4module.h (m4_set_symbol_value_builtin): Delete. Use
1881 m4_builtin_find_by_* instead.
1882 (m4_builtin_find_by_func): Change return type.
1883 * m4/m4private.h (m4__builtin): New struct.
1884 (m4_module): Add sorted list of loaded builtins.
1885 (struct m4_symbol_value): Change type of builtin value.
1886 (m4__set_symbol_value_builtin): New prototype and fast accessor.
1887 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1889 * m4/symtab.c (m4_set_symbol_value_builtin): Rename...
1890 (m4__set_symbol_value_builtin): ...and populate additional fields,
1892 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1894 * m4/module.c (install_builtin_table): Use cached table.
1895 (compare_builtin_CB): New helper function.
1896 (m4__module_open): Populate table.
1897 (module_remove): Free table.
1898 * m4/builtin.c (compare_builtin_name_CB): New helper function.
1899 (m4_builtin_find_by_name): Rewrite to use sorted table.
1900 (m4_builtin_find_by_func): Change return type.
1901 * m4/input.c (struct m4_input_block): Simplify u_b, since most
1902 fields can be determined from builtin.
1903 (builtin_peek, builtin_read, builtin_unget, init_builtin_token)
1904 (m4__next_token): Alter parsing so that only init_builtin_token
1906 (builtin_print, m4_push_builtin): Adjust all users.
1907 * tests/macros.at (Arity, defn, and freeze): Fix typo.
1909 Consistently cast malloc results, for C++ compilation.
1910 * m4/builtin.c (m4_builtin_find_by_name): Add cast.
1911 * m4/hash.c (m4_hash_new, m4_get_hash_iterator_next, node_new)
1912 (m4_hash_resize, maybe_grow): Likewise.
1913 * m4/m4.c (m4_create): Likewise.
1914 * m4/macro.c (expand_macro): Likewise.
1915 * m4/output.c (m4_tmpname): Likewise.
1916 * m4/path.c (search_path_add): Likewise.
1917 * m4/symtab.c (m4_symtab_create, m4_symbol_value_create)
1918 (symtab_fetch): Likewise.
1919 * m4/syntax.c (m4_syntax_create): Likewise.
1920 * modules/gnu.c (regexp_compile): Likewise.
1921 * src/main.c (main): Likewise.
1922 * src/freeze.c (reload_frozen_state): Likewise.
1924 2008-03-06 Eric Blake <ebb9@byu.net>
1926 Fix nested builtin(`shift',$@) regression from 2008-02-23.
1927 * m4/macro.c (make_argv_ref): Don't output expansion text when
1928 making wrapper for builtin or indir.
1929 * tests/builtins.at (builtin): New test.
1930 * NEWS: Document the fix.
1931 Reported by Andreas Schwab.
1933 2008-03-04 Eric Blake <ebb9@byu.net>
1935 The gnulib module free was deprecated.
1936 * ltdl/m4/gnulib-cache.m4: Remove free module.
1938 2008-02-29 Eric Blake <ebb9@byu.net>
1940 Import news from 1.4.10b.
1941 * NEWS: Update from branch.
1943 2008-02-23 Eric Blake <ebb9@byu.net>
1945 Stage 18: try harder to reuse argv in recursion.
1946 When pushing arguments that contain an existing $@ ref, reuse the
1947 ref rather than creating another layer of wrappers.
1948 Memory impact: noticeable improvement, due to better $@ reuse.
1949 Speed impact: noticeable improvement, due to O(n^2) to O(n)
1950 reduction in unboxed recursion.
1951 * m4/macro.c (make_argv_ref): Avoid wrapping $@ when possible.
1952 (m4_push_args): Let make_argv_ref take care of pending data.
1953 * doc/m4.texinfo (Improved foreach): Tweak wording to match new
1954 performance capability.
1955 * tests/others.at (recursion): Add tests to avoid performance
1958 2008-02-22 Eric Blake <ebb9@byu.net>
1961 * NEWS: Document change to __gnu__ on 2008-02-11.
1963 Stage 17: pass argv through quoted strings.
1964 Allow the concatenation of $@ references with other text input
1965 inside quoted contexts, which requires distinguishing between a
1966 wrapper around many arguments vs. a reference serving as part of a
1967 single argument. Also optimize based on whether argv contains
1968 builtin tokens that might need flattening to the empty string.
1969 Memory impact: noticeable improvement, due to O(n^2) to O(n)
1970 reduction from total reuse of $@ references.
1971 Speed impact: noticeable improvement, due to O(n^2) to O(n)
1972 reduction in boxed recursion.
1973 * m4/m4module.h (m4_arg_equal, m4_arg_len): Add parameter.
1974 (M4ARGLEN): Adjust definition.
1975 * m4/m4private.h (struct m4__symbol_chain): Add has_func member.
1976 (struct m4_symbol_value): Add wrapper and has_func members.
1977 (struct m4_macro_args): Add flatten and has_func members.
1978 * m4/input.c (append_quote_token): Return argv refs inside quoted
1980 (init_argv_symbol): Populate new fields.
1981 * m4/macro.c (expand_argument, collect_arguments, make_argv_ref)
1982 (m4_make_argv_ref): Likewise.
1983 (arg_symbol, arg_mark, m4_is_arg_text, m4_is_arg_func): Use new
1985 (m4_arg_equal, m4_arg_len): Handle quoted argv references, and add
1987 * modules/m4.c (ifelse): Adjust caller.
1989 2008-02-22 Gary V. Vaughan <gary@gnu.org>
1991 Fix regression in argument collection, from 2008-01-21.
1992 * m4/input.c (m4__next_token): When DEBUG_INPUT is defined,
1993 undo argument collection optimisation for strings, so that
1994 m4_print_token doesn't abort when it otherwise receives an
1995 unprintable M4_SYMBOL_VOID type token.
1997 2008-02-20 Eric Blake <ebb9@byu.net>
1999 Stage 16: cache quotes and improve m4_arg_print.
2000 Cache rather than always copying quotes when pushing $@ refs; in
2001 particular, reconstruct single-byte quotes on the fly. Allow NUL
2002 through m4wrap. Improve sharing of code that prints arguments.
2003 Memory impact: slight improvement, due to cached quotes.
2004 Speed impact: slight improvement, due to less copying.
2005 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print)
2006 (m4_arg_print): Adjust prototypes.
2007 (m4_dump_args): Delete.
2008 (m4_push_wrapup): Split...
2009 (m4_push_wrapup_init, m4_push_wrapup_finish): ...into these
2011 * m4/m4private.h (struct m4_syntax_table): Add cached_quote
2013 (m4__quote_cache, m4__quote_uncache): New prototypes.
2014 * m4/syntax.c (m4_syntax_create): Initialize the cache.
2015 (m4__quote_cache): New function.
2016 (m4_set_syntax): Update caller.
2017 * m4/symtab.c (m4_symbol_value_print): Add parameter.
2018 (m4_symbol_print, dump_symbol_CB): Adjust all callers.
2019 * m4/utility.c (m4_dump_args): Delete; callers should use
2020 m4_arg_print instead.
2021 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Split
2022 implementation, and allow embedded NUL.
2023 (m4_print_token, pop_input, composite_print, composite_peek):
2024 (composite_read, append_quote_token): Adjust all callers.
2025 * m4/macro.c (trace_prepre, m4_arg_text, make_argv_ref):
2027 (m4_arg_print): Add parameters.
2028 (trace_pre): Rewrite in terms of m4_arg_print.
2029 * modules/m4.c (errprint): Likewise.
2030 (m4wrap): Rewrite to allow embedded NUL.
2031 (dumpdef): Adjust caller.
2032 * doc/m4.texinfo (Debuglen): Enhance debuglen test.
2033 * tests/null.m4: Test for NUL in m4wrap.
2034 * tests/null.out: Update expected output.
2036 Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
2037 * m4/utility.c (m4_verror_at_line): Properly terminate the string.
2038 Reported by Ralf Wildenhues.
2040 * doc/m4.texinfo (Debuglen, Changesyntax): Fix typos.
2042 2008-02-19 Eric Blake <ebb9@byu.net>
2044 Clean up example on filtering defined symbols.
2045 * doc/m4.texinfo (Foreach, Improved foreach): Document another
2046 shortcoming in foreach.m4, and improve filter example by using
2049 * src/main.c (usage): Fix typo.
2051 2008-02-18 Eric Blake <ebb9@byu.net>
2053 Avoid some magic numbers.
2054 * m4/m4private.h (CHAR_EOF, CHAR_BUILTIN, CHAR_QUOTE, CHAR_ARGV)
2055 (CHAR_RETRY): Define in terms of UCHAR_MAX.
2056 * m4/syntax.c (m4_syntax_create, set_syntax_set)
2057 (reset_syntax_set, check_is_single_quotes)
2058 (check_is_single_comments, check_is_macro_escaped)
2059 (m4_set_quotes, m4_set_comment): Likewise.
2060 * modules/gnu.c (regexp_compile): Likewise.
2061 * modules/m4.c (translit): Likewise.
2062 * src/freeze.c (produce_syntax_dump): Likewise.
2063 Reported by Ralf Wildenhues.
2065 2008-02-16 Eric Blake <ebb9@byu.net>
2067 Add regression test for multi-character quote recursion.
2068 * examples/foreach2.m4: Use $0 rather than spelling out name.
2069 * examples/foreachq2.m4: Likewise.
2070 * examples/forloop2.m4: Likewise.
2071 * examples/hanoi.m4: Likewise.
2072 * examples/trace.m4: Likewise.
2073 * doc/m4.texinfo (Improved forloop): Document advantage of $0.
2074 (Improved foreach): Adjust dump from file.
2076 Stage 15: return argv refs back to collect_arguments.
2077 Collect an entire $@ reference at once rather than one argument at
2078 a time, outside of quotes (but inside quotes, $@ is still
2079 flattened for now). The skip_last field allows concatenation of
2080 $@ with other text when collecting arguments.
2081 Memory impact: noticeable improvement, due to better reuse of $@.
2082 Speed impact: noticeable improvement, due to less parsing.
2083 * m4/m4private.h (CHAR_ARGV): New input engine sentinel.
2084 (enum m4__token_type): Add M4_TOKEN_ARGV.
2085 (struct m4__symbol_chain): Add skip_last member to argv link.
2086 (m4__next_token): Add parameter.
2087 * m4/input.c (peek_char, file_peek, builtin_peek, string_peek)
2088 (composite_peek, m4__next_token): Add new parameter.
2089 (composite_read, append_quote_token): Support argv in quotes.
2090 (init_argv_symbol): New function.
2091 (m4__push_symbol, match_input, consume_syntax)
2092 (m4__next_token_is_open, m4_print_token): Adjust callers.
2093 * m4/macro.c (m4_macro_expand_input, m4__arg_adjust_refcount)
2094 (arg_mark, m4_arg_text, make_argv_ref): Likewise.
2095 (expand_argument, collect_arguments): Handle new token.
2096 (arg_symbol): Drill through $@ reference.
2097 * m4/syntax.c (set_quote_age): Detect disabled comments.
2098 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Fix debug code.
2100 2008-02-15 Eric Blake <ebb9@byu.net>
2102 * modules/gnu.c (regexp_compile): Use a fastmap for regex speed.
2104 2008-02-13 Eric Blake <ebb9@byu.net>
2106 Fix texinfo grammar.
2107 * doc/m4.texinfo (Eval, Incompatibilities): Use @. after capital.
2108 (History): Use @: after abbreviations.
2109 (M4exit): Use correct Latin abbreviation.
2110 (Dumpdef, Debugmode, Frozen file format 2): Use correct spacing
2113 2008-02-11 Eric Blake <ebb9@byu.net>
2115 Allow builtin text macros to specify number of arguments.
2116 * m4/m4module.h (struct m4_macro): Add argument limits to builtin
2118 * m4/module.c (install_macro_table): Allow text macros to warn on
2120 * modules/gnu.c (m4_macro_table): Update all clients.
2121 * modules/load.c (m4_macro_table): Likewise.
2122 * modules/mpeval.c (m4_macro_table): Likewise.
2123 * modules/perl.c (m4_macro_table): Likewise.
2124 * modules/shadow.c (m4_macro_table): Likewise.
2125 * modules/traditional.c (m4_macro_table): Likewise.
2126 * modules/modtest.c (m4_macro_table): Likewise. Also add text
2127 macros, for testing this.
2128 * doc/m4.texinfo (Standard Modules): Update text, and enhance
2130 * tests/modules.at (modules: text): New test.
2132 Fix regression in command line -D option, from 2006-08-25.
2133 * m4/m4private.h (m4_symbol_value_create): Delete fast accessor.
2134 * m4/m4module.h: Fix typo.
2135 * m4/symtab.c (m4_symbol_value_create): Prime the maximum number
2137 * tests/macros.at (Command line define): Enhance test.
2138 * tests/others.at (nul character): Enhance test.
2139 * tests/null.m4: Likewise.
2140 * tests/null.out: Likewise.
2142 Use gnulib's git-merge-changelog driver when available.
2143 * .gitattributes: Add merge attributes for ChangeLog.
2144 * bootstrap: Install driver, if not already present.
2146 2008-02-06 Eric Blake <ebb9@byu.net>
2148 Fix security hole introduced 2007-11-23.
2149 * m4/utility.c (m4_verror_at_line): Properly escape macro names.
2150 * src/main.c (main): Manage quoteargs defaults.
2151 * doc/m4.texinfo (Indir): Document and test this.
2153 Using raw strtod is not portable.
2154 * ltdl/m4/gnulib-cache.m4: Import the strtod module.
2156 2008-02-02 Eric Blake <ebb9@byu.net>
2158 Consistently use size_t for number of arguments.
2159 * m4/m4module.h (m4_builtin_func): Alter prototype.
2160 (struct m4_builtin): Adjust type of min_args, max_args.
2161 (M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
2162 (m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
2163 (m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
2164 (m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
2165 (m4_arg_print, m4_push_arg): Adjust all clients.
2166 * m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
2167 (m4_macro_args): Adjust type of various fields.
2168 (m4__push_arg_quote): Adjust all clients.
2169 * m4/input.c (m4_pop_wrapup): Likewise.
2170 * m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
2171 (arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
2172 (m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
2173 (m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
2174 (m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
2175 * m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
2176 * modules/evalparse.c (m4_evaluate): Likewise.
2177 * modules/gnu.c (changesyntax): Likewise.
2178 * modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
2179 (undivert, traceon, traceoff): Likewise.
2180 * modules/m4.h (m4_dump_symbols_func): Likewise.
2181 * modules/perl.c (perleval): Likewise.
2183 Stage 14b: allow pushing argv references.
2184 Push a $@ reference to the input engine in one go, rather than
2185 pushing each element. For now, argument collection still gets one
2186 argument of a $@ at a time; but the penalties of this patch make
2187 it easier to manage $@ efficiently in future patches.
2188 Memory impact: noticeable penalty, due to larger struct and O(n)
2189 to O(n^2) on unboxed recursion.
2190 Speed impact: noticeable penalty, due to more bookkeeping.
2191 * m4/m4private.h (struct m4__symbol_chain): Add comma and quotes
2193 (struct m4_macro_args): Add level field.
2194 (m4__arg_adjust_refcount, m4__push_arg_quote): New prototypes.
2195 * m4/input.c (m4__push_symbol, composite_peek, composite_read)
2196 (composite_unget, composite_clean, composite_print): Support $@
2198 * m4/macro.c (collect_arguments): Populate new field.
2199 (expand_macro): Move argv cleanup...
2200 (m4__arg_adjust_refcount): ...to this new function.
2201 (m4_arg_symbol, m4_make_argv_ref, m4_push_arg): Factor...
2202 (arg_symbol, make_argv_ref, m4__push_arg_quote): ...to these new
2203 helper functions, to add parameters.
2204 (m4_push_args): Adjust caller.
2205 * m4/symtab.c (m4_symbol_value_print): Likewise.
2207 Stage 14a: allow printing argv references.
2208 Refactor symbol-value printing code for better sharing, and to
2209 allow printing a contiguous text representation of a $@ ref.
2210 Memory impact: none.
2212 * m4/m4module.h (m4_arg_print): New prototype.
2213 (m4_symbol_value_print): Alter prototype.
2214 * m4/input.c (struct input_funcs): Add parameter to peek_func.
2215 (file_peek, builtin_peek, string_peek): Ignore new parameter.
2216 (composite_peek): Ignore new parameter, for now.
2217 (composite_clean, pop_input): Rework to minimize indirection, and
2218 to avoid infinite recursion in next patch.
2219 * m4/macro.c (trace_prepre, trace_pre): Adjust callers.
2220 (m4_arg_print): New function.
2221 * m4/symtab.c (m4_symbol_value_print): Update signature.
2222 (m4_symbol_print): Update caller.
2223 * m4/output.c (m4_shipout_string_trunc): Update comments.
2224 * m4/syntax.c (set_quote_age): Require comma as argument separator
2225 when dealing with $@ as a unit.
2226 * tests/builtins.at (ifelse): Augment test.
2227 * doc/m4.texinfo (Changesyntax): Document changesyntax deficiency.
2229 2008-01-31 Eric Blake <ebb9@byu.net>
2231 Kill hack for M4 1.4.4.
2232 * configure.ac (AM_GNU_GETTEXT_INTL_SUBDIR): Delete, now that
2233 we require new enough autoconf which in turn requires M4 1.4.5.
2235 2008-01-31 Gary V. Vaughan <gary@gnu.org>
2236 and Eric Blake <ebb9@byu.net>
2238 Depend on new libtool to use non-recursive build.
2239 * configure.ac (LT_PREREQ): Bump to alpha release version.
2240 (LTDL_INIT): Choose nonrecursive mode. Perform sanity check that
2241 installed libtool has correct symbols.
2242 * Makefile.am (SUBDIRS): Drop ltdl, now that it is built from the
2244 (AM_CPPFLAGS): Drop directories covered by libtool.
2245 (AM_LDFLAGS): Drop -no-undefined, covered by libtool.
2246 (include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
2247 macros, used by libtool.
2248 (lib_LTLIBRARIES): Also used by libtool.
2249 (ltdl/libltdlc.la): Delete, now that libtool does this.
2250 * bootstrap: Mention new requirements.
2251 (LIBTOOLIZE): Provide default program, and run libtoolize prior to
2253 (autoreconf): Also neutralize libtoolize, since it is run early.
2254 * HACKING: Mention updated prerequisites.
2256 2008-01-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2258 Fix build failure if installed libltdl is used.
2259 * Makefile.am (m4_libm4_la_DEPENDENCIES): Use $(LTDLDEPS).
2261 2008-01-28 Eric Blake <ebb9@byu.net>
2263 Depend on newer autoconf, for testsuite -C dir.
2264 * Makefile.am (CD_TESTDIR): Delete, no longer required.
2265 (check-local, installcheck-local, clean-local-tests): Use new -C
2266 option from autotest.
2267 * configure.ac (AC_PREREQ): Bump to 2.61a.347.
2268 * bootstrap: Mention new dependency.
2269 * HACKING: Likewise.
2271 2008-01-27 Eric Blake <ebb9@byu.net>
2273 Stage 13: push composite text tokens.
2274 Support pushing composite tokens, allowing back-references to be
2275 reused through multiple macro expansions. Add hueristic that
2276 avoids creating new reference when pushing existing references.
2277 Memory impact: noticeable improvement due to better reference
2278 reuse, except for O(n) to O(n^2) copying in boxed recursion.
2279 Speed impact: slight penalty, due to more bookkeeping.
2280 * m4/m4private.h (m4__push_symbol): Adjust prototype.
2281 * m4/input.c (m4__push_symbol): Add parameter, and support
2283 (append_quote_token): Add parameter, and support inlining of short
2285 (m4__next_token): Adjust caller.
2286 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
2288 2008-01-26 Eric Blake <ebb9@byu.net>
2290 Stage 12c: add macro for m4_arg_len.
2291 Make a common action easier to type.
2292 Memory impact: none.
2294 * m4/m4module.h (M4ARGLEN): New macro.
2295 * m4/macro.c (process_macro): Adjust all callers.
2296 * m4/utility.c (m4_dump_args): Likewise.
2297 * modules/m4.c (divert, maketemp, mkstemp, m4wrap, len, index)
2299 * modules/gnu.c (builtin, indir, mkdtemp, patsubst, regexp)
2300 (renamesyms): Likewise.
2301 * modules/stdlib.c (setenv): Likewise.
2303 Stage 12b: add m4_string_pair.
2304 Make passing quote delimiters around more efficient.
2305 Memory impact: none.
2306 Speed impact: slight penalty, due to more bookkeeping.
2307 * m4/m4module.h (m4_string_pair): New type.
2308 (m4_get_syntax_quotes, m4_get_syntax_comments): New prototypes.
2309 (m4_symbol_value_print, m4_symbol_print, m4_shipout_string_trunc):
2311 * m4/m4private.h (struct m4_string): Delete.
2312 (struct m4_syntax_table): Combine quote and comment members.
2313 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
2314 (m4_get_syntax_ecomm): Adjust accessors.
2315 (m4_get_syntax_quotes, m4_get_syntax_comments): New fast
2317 * m4/symtab.c (m4_symbol_value_print, m4_symbol_print):
2319 * m4/input.c (string_print, composite_print, m4_input_print):
2320 All callers updated.
2321 * m4/syntax.c (m4_syntax_delete, m4_set_syntax)
2322 (check_is_single_quotes, m4_set_quotes, set_quote_age)
2323 (m4_get_syntax_lquote, m4_get_syntax_rquote)
2324 (m4_get_syntax_quotes, check_is_single_comments, m4_set_comment)
2325 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
2326 (m4_get_syntax_comments): Likewise.
2327 * m4/macro.c (trace_prepre, trace_pre, m4_push_args): Likewise.
2328 * m4/output.c (m4_shipout_string, m4_shipout_string_trunc):
2330 * modules/m4.c (dumpdef, m4_make_temp): Likewise.
2331 * src/freeze.c (produce_frozen_state): Likewise.
2332 * tests/freeze.at (reloading unknown builtin): Update test.
2334 Stage 12a: make m4_symbol_chain a union.
2335 Shrink size of symbol chains by using a union.
2336 Memory impact: slight improvement, due to smaller struct.
2337 Speed impact: slight improvement, due to less bookkeeping.
2338 * m4/m4private.h (enum m4__symbol_chain_type): New enum.
2339 (struct m4_symbol_chain): Rename...
2340 (struct m4__symbol_chain): ...to this, since it is internal.
2341 * m4/symtab.c (m4_symbol_value_copy, m4_symbol_value_print): All
2343 * m4/input.c (struct m4_input_block, m4__push_symbol)
2344 (composite_peek, composite_read, composite_unget)
2345 (composite_clean, composite_print, m4__make_text_link)
2346 (append_quote_token): Likewise.
2347 * m4/macro.c (expand_macro, arg_mark, m4_arg_symbol, m4_arg_text)
2348 (m4_arg_equal, m4_arg_len, m4_make_argv_ref, m4_push_arg)
2349 (m4_push_args): Likewise.
2351 2008-01-23 Eric Blake <ebb9@byu.net>
2353 Adjust to recent libtool interface change.
2354 * configure.ac (LT_PREREQ): Require bleeding-edge libtool.
2355 (LT_WITH_LTDL): Delete, now that it is obsolete.
2356 (LTDL_INIT): Use new libtool macro.
2358 2008-01-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2359 and Eric Blake <ebb9@byu.net>
2361 Rely on newer automake.
2362 * configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1, and add lzma
2364 * bootstrap: Update automake requirement.
2365 (func_version): Fix --version output, broken since 2007-08-06.
2366 * HACKING: Likewise. Add lzma requirement.
2367 * Makefile.am (clean-local-src): Not needed any more with newest
2369 (clean-local): Adjust.
2370 * TODO: Remove completed item.
2372 2008-01-22 Eric Blake <ebb9@byu.net>
2375 * doc/m4.texinfo (Renamesyms): Avoid underfull hbox, and improve
2378 2008-01-21 Eric Blake <ebb9@byu.net>
2380 Stage 11: full circle for single argument references.
2381 Pass quoted strings through to argument collection in a single
2382 action, so that an argument can be reused throughout macro
2383 recursion if it remains unchanged.
2384 Memory impact: noticeable improvement, due to more reuse in
2385 argument collection stacks; O(n^2) to O(n) on boxed recursion.
2386 Speed impact: noticeable improvement, due to less copying.
2387 * m4/m4module.h (m4_arg_text): Add parameter.
2389 * m4/m4private.h (CHAR_QUOTE): New input engine sentinel.
2390 (m4__make_text_link): New prototype.
2391 (struct m4_symbol_chain): Add quote_age member.
2392 (struct m4_symbol_value): Add end member to chained symbol.
2393 (struct m4_macro_args): Add wrapper member.
2394 * m4/symtab.c (m4_symbol_value_print): Print composite tokens.
2395 (m4_symbol_value_copy, m4_symbol_value_delete): Recognize
2397 * m4/input.c (make_text_link): Rename...
2398 (m4__make_text_link): ...to this, and export.
2399 (m4_push_string_finish): Adjust caller.
2400 (make_text_link, m4__push_symbol): Update new field.
2401 (file_read, builtin_read, string_read, composite_read, next_char):
2403 (m4_skip_line, match_input, consume_syntax): Adjust callers.
2404 (append_quote_token): New function.
2405 (m4__next_token): Pass quoted strings onto argument collection.
2406 (m4_print_token) [DEBUG_INPUT]: Update.
2407 * m4/macro.c (expand_argument): Collect composite arguments.
2408 (collect_arguments): Update new field.
2409 (expand_macro): Reduce ref-count of back-references after use.
2410 (arg_mark, m4_arg_symbol, m4_make_argv_ref): Adjust to new member
2412 (m4_is_arg_text): Also recognize composite symbols as text.
2413 (m4_arg_text, m4_arg_len): Merge composite symbols as needed.
2414 (m4_arg_equal): Compare composite symbols.
2415 (m4_push_arg, m4_push_args): Handle composite symbols.
2416 (m4_arg_symbol): Relax assertion.
2417 (process_macro): Use single-argument references.
2418 * m4/output.c (m4_shipout_string_trunc): Update comment.
2419 * tests/macros.at (Rescanning macros): Augment test.
2421 2008-01-16 Eric Blake <ebb9@byu.net>
2423 Stage 10: avoid extra copying of strings and comments.
2424 When collecting tokens that are immune to further expansion, avoid
2425 copying data from one obstack to another by outputting it into the
2426 destination obstack to begin with. Also reduce copying done in
2428 Memory impact: slight improvement, due to better obstack usage.
2429 Speed impact: noticeable improvement, due less data copying.
2430 * ltdl/m4/gnulib-cache.m4: Import intprops and vasnprintf-posix
2432 * m4/m4private.h (m4__token_type): Adjust prototype.
2433 * m4/input.c (m4__next_token): Support new parameter.
2434 * m4/macro.c (m4_macro_expand_input, expand_token)
2435 (expand_argument, collect_arguments): Adjust callers.
2436 * modules/m4.c (ntoa): Tighten buffer size.
2437 * m4/output.c (m4_tmpname): Guarantee no buffer overflow.
2438 * modules/format.c (arg_int, arg_long, arg_double): New helper
2439 functions, to detect overflow or unparsed characters.
2440 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Adjust to check for
2441 missing or excess arguments.
2442 (format): Likewise, and also output directly into obstack if there
2444 * doc/m4.texinfo (History): Update for new year.
2445 (Format): Test for new warnings.
2447 2008-01-15 Eric Blake <ebb9@byu.net>
2449 * TODO: Update with some newer URLs.
2451 Verify linear `index'.
2452 * tests/builtins.at (index): New test.
2453 (translit): Make test take longer, to make quadratic algorithms
2456 2007-12-20 Eric Blake <ebb9@byu.net>
2458 Stage 9: share rather than copy single-arg refs.
2459 Use hooks of previous patch to create back-references to arguments
2460 in the input engine, and inline short text rather than always
2461 creating a FIFO link. Also start testing embedded NUL behavior.
2462 Until the argument collection engine also shares references, the
2463 memory usage increases.
2464 Memory impact: noticeable penalty, due to longer life of argv
2465 changing O(n) to O(n^2) on boxed recursion.
2466 Speed impact: slight improvement, due less data copying.
2467 * ltdl/m4/gnulib-cache.m4: Import memmem and quote modules.
2468 * m4/m4module.h (m4_arg_scratch): New prototype.
2469 * m4/m4private.h (m4__push_symbol): Add parameter.
2470 (m4_arg_scratch): Add fast accessor.
2471 (struct m4): Add expansion_level member, taken...
2472 * m4/macro.c (expansion_level): ...from here. Adjust all users.
2473 (expand_argument): Minor cleanup.
2474 (expand_macro): Track scratch space per macro call.
2475 (m4_arg_scratch): New function.
2476 (m4_make_argv_ref): Call new function.
2477 (m4_push_arg): Push reference to $0.
2478 (m4_push_args): Rework separator usage, since separators will
2480 (process_macro): Allow embedded NUL.
2481 * m4/input.c (INPUT_INLINE_THRESHOLD): New define.
2482 (m4__push_symbol): Add parameter. Inline short strings, and save
2483 references through rescanning.
2484 * m4/symtab.c (m4_set_symbol_value_text): Weaken assertion.
2485 * modules/m4.c (errprint, index): Handle NUL transparently.
2486 (dumpdef, translit): Use scratch space, rather than expansion
2488 * modules/gnu.c (renamesyms, m4symbols): Likewise.
2489 * tests/others.at (nul character): New test.
2490 (iso8859): Quote absolute file name, remove XFAIL.
2491 * tests/iso8859.m4: Avoid raw NUL in output.
2492 * tests/null.m4: New file.
2493 * tests/null.out: Likewise.
2494 * tests/null.err: Likewise.
2495 * Makefile.am (OTHER_FILES): Distribute new files.
2496 * .gitattributes: Treat new files as text.
2498 2007-12-17 Eric Blake <ebb9@byu.net>
2500 Stage 8: extend life of references into argv.
2501 Add hooks to lengthen the lifetime of arguments reused in a macro
2502 expansion, rather than always discarding arguments at the end of
2503 expand_macro. Rework the expand_macro obstacks to handle longer
2504 lifetimes. For now, the hooks remain unused.
2505 Memory impact: slight penalty, due to larger structs.
2506 Speed impact: slight penalty, due to more bookkeeping.
2507 * m4/system_.h (obstack_regrow): Delete.
2508 * m4/m4private.h (struct m4_symbol_chain): Add level field.
2509 (m4__push_symbol): Adjust prototype.
2510 (m4__adjust_refcount): New prototype.
2511 (DEBUG_MACRO) [DEBUG]: New debug control.
2512 (struct m4__macro_arg_stacks): New structure.
2513 (struct m4): Add arg_stacks, stacks_count fields.
2514 * m4/m4module.h (m4_make_argv_ref): Add parameter.
2515 * m4/macro.c (argc_stack, argv_stack): Delete, replaced by
2516 context->arg_stacks.
2517 (m4_macro_expand_input) [DEBUG_MACRO]: Add debug hooks,
2518 conditional on M4_DEBUG_MACRO envvar.
2519 (collect_arguments): Adjust signature.
2520 (expand_macro): Rework obstack handling.
2521 (m4__adjust_refcount, arg_mark): New functions.
2522 (m4_make_argv_ref): Populate new field.
2523 (m4_push_arg, m4_push_args): Track inuse.
2524 (process_macro): One less cast.
2525 * m4/m4.c (m4_delete): Clean up arg_stacks.
2526 * m4/input.c (make_text_link): Use new field.
2527 (m4__push_symbol, file_clean): Update signature.
2528 (composite_read): Bump refcount when done with reference.
2529 (composite_clean): New function.
2530 (pop_input): Adjust caller.
2531 * m4/debug.c (m4_debug_message): Make assertion match comment.
2532 * modules/gnu.c (builtin, indir): Adjust callers.
2533 * tests/builtins.at (ifelse): New test.
2534 (exp): Move and rename...
2535 * tests/others.at (countdown): ...to this.
2536 * doc/m4.texinfo (Improved foreach): Fix tracing usage in
2539 2007-12-13 Eric Blake <ebb9@byu.net>
2542 * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
2547 2007-12-13 Paolo Bonzini <bonzini@gnu.org> (tiny change)
2549 * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
2551 Reported by Giovanni Toffetti.
2553 2007-12-11 Eric Blake <ebb9@byu.net>
2555 Stage 7: use chained input support in input parser.
2556 Allow the LIFO input engine to rescan a macro expansion composed
2557 of smaller chunks of FIFO data, rather than the old approach of a
2558 monolithic string. For now, all chunks are still copied.
2559 Memory impact: slight penalty, due to FIFO chain overhead.
2560 Speed impact: slight penalty, due to extra bookkeeping.
2561 * m4/m4private.h (m4__push_symbol): New prototype.
2562 (struct m4_symbol_chain): Add const-safety.
2563 * m4/symtab.c (m4_symbol_value_print): Simplify.
2564 (dump_symbol_CB): Update caller.
2565 * m4/input.c (struct m4_input_block): Alter u_c member, first
2566 introduced 2006-10-25, but unused until now.
2567 (composite_peek, composite_read, composite_unget)
2568 (composite_print, init_builtin_token): Rewrite accordingly.
2569 (m4_push_wrapup): No longer need trailing NUL.
2570 (m4__push_symbol, make_text_link): New functions.
2571 (m4_push_string_finish): Use them.
2572 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
2573 (expand_macro): Simplify logic of nesting_limit.
2574 * src/main.c (main): Likewise.
2575 * doc/m4.texinfo (Dumpdef): Augment test.
2577 2007-12-08 Eric Blake <ebb9@byu.net>
2579 Stage 6: convert builtins to push arg at a time.
2580 Add new methods to factor all builtins whose expansion includes an
2581 argument, making back-reference creation easier in future patches.
2582 Factor out length-limited printing to obstacks, and use -1 rather
2583 than 0 for unlimited length.
2584 Memory impact: none.
2585 Speed impact: slight improvement, due to better code sharing.
2586 * m4/m4module.h (m4_shipout_text): Rename...
2587 (m4_divert_text): ...to this, to avoid confusion with m4_shipout_*
2588 that does not worry about sync lines.
2589 (m4_shipout_string_trunc): New prototype.
2590 * m4/output.c (m4_shipout_text): Rename...
2591 (m4_divert_text): ...to this.
2592 (m4_shipout_string): Move guts...
2593 (m4_shipout_string_trunc): ...to this new function.
2594 * m4/macro.c (m4_push_arg, m4_push_args): New functions.
2595 (expand_token, process_macro): Update callers.
2596 * m4/input.c (string_print): Likewise.
2597 * modules/m4.c (ifdef, ifelse, shift, substr, translit, divert):
2599 * modules/gnu.c (patsubst): Likewise.
2600 (debuglen): Use SIZE_MAX for unlimited debug length.
2601 * src/main.c (main): Likewise.
2602 * m4/m4.c (m4_create): Default max_debug_length to SIZE_MAX, not
2605 2007-12-07 Eric Blake <ebb9@byu.net>
2607 Minor security fix: Quote output of mkstemp.
2608 * modules/m4.c (m4_make_temp): Produce quoted output.
2609 * doc/m4.texinfo (Mkstemp, Mkdtemp): Update the documentation and
2612 Stage 5: add notion of quote age.
2613 Cache the quoting rules that were in effect when a string was
2614 parsed, to avoid reparsing that string if no changequote or other
2615 quote age change took place in the meantime. A quote_age of 0 is
2616 always safe, but does not benefit from caching.
2617 Memory impact: slight improvement, due to smaller struct in input
2619 Speed impact: slight penalty, due to more bookkeeping.
2620 * m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
2621 (m4_set_symbol_value_text): Adjust prototype.
2622 (m4_has_syntax): Factor out the unsigned char cast.
2623 * m4/m4private.h (struct m4_syntax_table): Add syntax_age and
2625 (m4__quote_age, m4__safe_quotes): New accessor macros, no need for
2626 functions at this point.
2627 (struct m4_symbol_value, struct m4_macro_args): Add quote_age
2629 (m4_set_symbol_value_text): Adjust fast accessor.
2630 (m4_get_symbol_value_quote_age): New fast accessor.
2631 * m4/symtab.c (m4_set_symbol_value_text): Add parameter.
2632 (m4_get_symbol_value_quote_age): New function.
2633 (m4_symbol_value_copy): Adjust callers.
2634 * m4/macro.c (expand_token): Add parameter, and track quote age.
2635 (expand_argument, collect_arguments): Track quote age.
2636 (m4_macro_expand_input, process_macro, m4_make_argv_ref)
2637 (m4_macro_expand_input): Update callers.
2638 (m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
2639 * m4/input.c: Comment cleanups.
2640 (struct m4_input_block): Reduce size.
2641 (m4__next_token): Report quote age.
2642 (m4_push_builtin, init_builtin_token): Update callers.
2643 * m4/utility.c (skip_space): Adjust callers.
2644 * m4/module.c (install_macro_table): Likewise.
2645 * m4/syntax.c (m4_set_syntax): Initialize and update quote age.
2646 (m4_set_quotes, m4_set_comment): Detect no-op changes, and update
2648 (set_quote_age): New helper function.
2649 (check_is_single_quotes, check_is_single_comments): Adjust
2651 * src/freeze.c (reload_frozen_state): Likewise.
2652 * src/main.c (main): Likewise.
2653 * modules/m4.c (define, pushdef): No need to set macro text.
2654 * tests/builtins.at (changequote, defn): New tests.
2655 * examples/wrapfifo.m4: New file.
2656 * examples/wraplifo.m4: New file.
2657 * Makefile.am (dist_pkgdata_DATA): Distribute new examples.
2659 2007-12-04 Eric Blake <ebb9@byu.net>
2661 Fix builds with OpenBSD make.
2662 * Makefile.am (HELP2MAN): New macro.
2663 (dist_man_MANS, doc/m4.1): Fix rules for building m4.1 into
2665 * README: Update copyright.
2666 * HACKING: Mention help2man and makeinfo dependencies.
2668 2007-11-29 Eric Blake <ebb9@byu.net>
2670 Stage 4: route indir, builtin through ref; make argv opaque.
2671 Finish making struct opaque to all but the input engine, by
2672 reworking obstack usage in expand_macro to better support creation
2673 of a $@ reference. Canonicalize the empty argument, to allow
2674 pointer comparison optimizations.
2675 Memory impact: slight penalty, due to larger struct.
2676 Speed impact: slight improvement, due to fewer function calls.
2677 * m4/system_.h (obstack_regrow): Fix precedence.
2678 * m4/m4module.h (m4_arg_equal, m4_arg_empty, m4_make_argv_ref):
2680 (struct m4_macro_args): Move...
2681 * m4/m4private.h (struct m4_macro_args): ...here, making it opaque
2682 to modules. Add has_ref member.
2683 (bool_bitfield): New helper typedef.
2684 (struct m4_symbol_chain): Add flatten and len members.
2685 * m4/macro.c (empty_symbol): New placeholder, for optimizing
2686 comparison with empty string.
2687 (m4_macro_expand_input): Initialize it.
2688 (collect_arguments): Alter signature, and populate new fields.
2689 (trace_pre, trace_post): Remove redundant parameter.
2690 (expand_macro): Alter handling of obstacks.
2691 (m4_arg_symbol): Account for wrapped argv.
2692 (m4_arg_equal, m4_arg_empty, m4_make_argv_ref): New methods.
2693 (m4_arg_text, m4_arg_len, m4_arg_func): Use new methods.
2694 * modules/m4.c (ifelse, syscmd): Likewise.
2695 * modules/evalparse.c (m4_evaluate): Likewise.
2696 (undefine, popdef, m4_dump_symbols): Optimize.
2697 * modules/gnu.c (builtin, indir, esyscmd, debugfile): Use new
2699 (changesyntax, regexp): Optimize.
2700 * m4/output.c (diversion_storage): Use typedef.
2702 Stage 3b: cache length, rather than computing it, in modules.
2703 Use cached token length in builtins and output engine.
2704 Memory impact: none.
2705 Speed impact: noticeable improvement, due to fewer function calls.
2706 * m4/hash.c (m4_hash_remove): Avoid double free on remove
2708 * m4/output.c (m4_shipout_string): Change semantics of len param.
2709 (m4_shipout_int): Use cached length.
2710 * m4/input.c (m4_push_string_finish): Likewise.
2711 * modules/m4.h (m4_make_temp_func): Add parameter.
2712 * m4/macro.c (expand_token, m4_arg_len): Use cached length.
2713 (collect_arguments, expand_macro): Alter signature.
2714 (trace_format): Don't use out-of-scope buffer.
2715 (process_macro): All callers changed.
2716 * m4/utility.c (m4_dump_args): Likewise.
2717 * m4/symtab.c (m4_symbol_value_print): Likewise.
2718 * modules/gnu.c (__file__, __program__, builtin, indir)
2719 (m4symbols, mkdtemp, regexp_compile, regexp_substitute,
2720 renamesyms, patsubst, regexp, regexp_compile): Likewise.
2721 * modules/load.c (m4modules): Likewise.
2722 * modules/m4.c (defn, m4wrap, maketemp, m4_make_temp)
2723 (numb_obstack, ifdef, ifelse, divert, len, substr): Likewise.
2724 * modules/perl.c (perleval): Likewise.
2725 * modules/stdlib.c (getcwd, getenv, getlogin, getpwnam, getpwuid)
2726 (hostname, uname, setenv): Likewise.
2727 * modules/mpeval.c (numb_obstack): Likewise.
2728 * src/freeze.c (dump_symbol_CB): Likewise.
2729 * doc/m4.texinfo (Renamesyms, Dumpdef, Changesyntax): Adjust test.
2730 * tests/builtins.at (mkstemp): Likewise.
2731 * tests/others.at (iso8859): XFAIL this test, now that
2732 length-based handling allows NUL through part but not all of M4.
2734 2007-11-28 Eric Blake <ebb9@byu.net>
2736 Stage 3a: cache length, rather than computing it, in libm4.
2737 Cache the length of a token in the input engine and symbol table,
2738 to avoid repeating lots of strlen calls. Additionally, by using
2739 obstack length rather than strlen, the input engine can now
2740 support embedded NUL.
2741 Memory impact: slight penalty, due to larger struct.
2742 Speed impact: slight improvement, due to fewer function calls.
2743 * m4/m4module.h (struct m4_macro_args): Cache length.
2744 (m4_get_symbol_len, m4_get_symbol_value_len): New accessors.
2745 (m4_set_symbol_value_text): Change signature.
2746 * m4/m4private.h (struct m4_symbol_value): Store string length.
2747 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2748 (m4_set_symbol_value_placeholder): Update accordingly.
2749 (m4_set_symbol_value_text): Change signature.
2750 (m4_get_symbol_value_len): New accessor.
2751 * m4/input.c (struct m4_input_block, string_peek, string_read)
2752 (string_unget, string_print, m4_push_string_finish)
2753 (m4_push_wrapup): Track length of string input.
2754 (m4__next_token): Adjust all users of symbol text to track length,
2756 * m4/macro.c (expand_argument, collect_arguments): Likewise.
2757 * m4/module.c (install_macro_table): Likewise.
2758 * modules/gnu.c (builtin, indir): Likewise.
2759 * modules/m4.c (define, pushdef): Likewise.
2760 * src/main.c (main): Likewise.
2761 * src/freeze.c (reload_frozen_state): Likewise.
2762 * m4/symtab.c (m4_symbol_value_copy): Likewise.
2763 (m4_get_symbol_value_len): New function.
2764 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2765 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
2766 Adjust implementation.
2768 2007-11-27 Eric Blake <ebb9@byu.net>
2770 Stage 2: use accessors, not direct reference, into argv.
2771 Outside of macro.c, use accessor methods rather than direct access
2772 into the argv struct.
2773 Memory impact: none.
2774 Speed impact: slight penalty, due to increased function calls.
2775 * m4/m4private.h (m4_arg_argc): New fast accessor.
2776 * m4/m4module.h (m4_arg_argc, m4_arg_symbol, m4_is_arg_text)
2777 (m4_is_arg_func, m4_arg_text, m4_arg_len, m4_arg_func): New
2779 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2780 (m4_macro_call): Make argc unsigned.
2781 (M4ARG): Use new accessors.
2782 * modules/m4.c (define, pushdef): Likewise.
2783 (undefine, popdef, ifelse, m4_dump_symbols, defn, undivert)
2784 (traceon, traceoff): Make argc unsigned.
2785 * modules/m4.h (m4_dump_symbols_func): Likewise.
2786 * modules/evalparse.c (m4_evaluate): Likewise.
2787 * modules/gnu.c (builtin, indir): Use new accessors.
2788 (changesyntax): Make argc unsigned.
2789 * modules/perl.c (perleval): Likewise.
2790 * m4/utility.c (m4_dump_args): Use new accessors.
2791 * m4/macro.c (trace_pre): Likewise.
2792 (m4_arg_symbol, m4_arg_argc, m4_is_arg_text, m4_is_arg_func)
2793 (m4_arg_text, m4_arg_len, m4_arg_func): New functions.
2794 (expand_macro, trace_pre, trace_post, m4_macro_call): Update argc
2797 2007-11-24 Eric Blake <ebb9@byu.net>
2799 Stage 1: convert m4_symbol_value** into new object.
2800 Pass a variable-size wrapper structure instead of an array to
2801 builtins, so that subsequent optimizations in the structure need
2802 not impact every builtin client.
2803 Memory impact: slight penalty, since struct is larger than array.
2804 Speed impact: slight penalty, due to increased bookkeeping.
2805 * ltdl/m4/gnulib-cache.m4: Import flexmember module.
2806 * m4/m4module.h (m4_macro_args): New type, will be opaque to
2808 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2809 (m4_macro_call): Alter signature to use m4_macro_args object.
2810 (M4ARG): Redefine to access new struct.
2811 * m4/m4private.h (M4_SYMBOL_COMP): New enumerator.
2812 (struct m4_symbol_chain): New type.
2813 (struct m4_symbol_value): Add chain alternative.
2814 * m4/macro.c (collect_arguments): Build new struct.
2815 (expand_macro, m4_macro_call, process_macro, trace_pre)
2816 (trace_post): Adjust implementation to use it.
2817 * m4/utility.c (m4_dump_args): Likewise.
2818 * modules/gnu.c (builtin, indir): Likewise.
2819 * modules/format.c (format): Likewise.
2820 * modules/m4.h (m4_dump_symbols_func): Likewise.
2821 * modules/m4.c (m4_dump_symbols, define, pushdef, defn, ifelse)
2822 (shift, include, errprint, m4wrap): Likewise.
2823 * modules/evalparse.c (m4_evaluate): Likewise.
2825 Pass only macro name to utility functions.
2826 * m4/m4module.h (m4_bad_argc, m4_numeric_arg): Adjust signature.
2827 * m4/utility.c (m4_bad_argc, m4_numeric_arg): Adjust
2829 * m4/macro.c (m4_macro_call): Adjust callers.
2830 * modules/gnu.c (builtin, debuglen): Likewise.
2831 * modules/m4.c (ifelse, incr, decr, divert, undivert, m4exit)
2833 * modules/evalparse.c (m4_evaluate): Likewise.
2834 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
2835 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
2838 2007-11-23 Eric Blake <ebb9@byu.net>
2840 Add macro name to debugfile messages.
2841 * m4/m4module.h (m4_debug_set_output): Add parameter.
2842 * m4/debug.c (m4_debug_set_output, set_debug_file): Pass macro
2844 * modules/gnu.c (debugfile): Adjust caller.
2845 * modules/m4.c (m4exit): Likewise.
2846 * src/main.c (main): Likewise.
2848 Factor out handling of macro name in error messages.
2849 * m4/m4module.h (m4_error, m4_error_at_line, m4_warn)
2850 (m4_warn_at_line): Add new parameter.
2851 * m4/utility.c (m4_verror_at_line): New helper method.
2852 (m4_error, m4_error_at_line, m4_warn, m4_warn_at_line): Add new
2854 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg): All callers
2856 * m4/debug.c: Likewise.
2857 * m4/input.c: Likewise.
2858 * m4/macro.c: Likewise.
2859 * m4/module.c: Likewise.
2860 * m4/output.c: Likewise.
2861 * m4/path.c: Likewise.
2862 * modules/evalparse.c: Likewise.
2863 * modules/format.c: Likewise.
2864 * modules/gnu.c: Likewise.
2865 * modules/load.c: Likewise.
2866 * modules/m4.c: Likewise.
2867 * modules/mpeval.c: Likewise.
2868 * src/freeze.c: Likewise.
2869 * src/main.c: Likewise.
2871 2007-11-14 Eric Blake <ebb9@byu.net>
2873 Handle some defn corner cases differently.
2874 * doc/m4.texinfo (Defn): Update documentation; although this still
2875 doesn't match the branch, since it may be changed before 2.0.
2876 * m4/macro.c (expand_argument): Consistently ignore builtins in
2877 concatenation contexts.
2878 * m4/m4private.h (m4__symbol_type): Fix C89 compliance bug.
2880 2007-11-13 Eric Blake <ebb9@byu.net>
2882 Note: Patches titled Stage 0 through N form a series of patches
2883 which decreases the algorithmic complexity of tail recursion in
2884 macro expansions from O(n^2) to O(n) in both time and memory, then
2885 performs cleanups, such as handling of embedded NUL, made easier
2886 by the code refactoring.
2888 Stage 0: Fix memory leak in tail recursion.
2889 Free expansion text in the input engine as soon as it is parsed,
2890 rather than when the recursive expansion completes.
2891 Memory impact: noticeable improvement, due to reduction from
2892 O(n^2) to O(n) on recursion.
2893 Speed impact: minor improvement, due to better memory usage.
2894 * m4/input.c (pop_input): Add flag parameter and return type.
2895 (next_char): Adjust caller.
2896 (m4_push_string_init): Let go of memory earlier.
2898 2007-11-07 Eric Blake <ebb9@byu.net>
2900 * tests/macros.at (Rescanning macros): Test more corner cases.
2902 2007-11-06 Eric Blake <ebb9@byu.net>
2904 * build-aux/mkstamp: Rename from ltdl/config/mkstamp.
2906 * Makefile.am (tests/package.m4): Work around bash bug.
2907 Reported by Ralf Wildenhues.
2909 2007-11-05 Eric Blake <ebb9@byu.net>
2911 For consistency with other GNU projects, use build-aux directory.
2912 * configure.ac (AC_CONFIG_AUX_DIR): Change ltdl/config to
2914 * bootstrap (config_aux_dir): Likewise.
2915 * Makefile.am (config_aux_dir): Likewise.
2916 * ltdl/m4/gnulib-cache.m4: Use --aux-dir option.
2918 2007-11-02 Eric Blake <ebb9@byu.net>
2920 Update some documentation about version control.
2921 * NEWS: M4 is now stored in git.
2922 * HACKING: Likewise.
2924 * bootstrap: Likewise.
2925 * commit: Delete, now that CVS commits are no longer necessary.
2926 * ltdl/config/mailnotify: No longer necessary; git's patch
2927 generation and mail capability is more powerful.
2929 Update to recent gnulib changes.
2930 * ltdl/m4/gnulib-cache.m4: Replace fprintf-posix, vasprintf-posix,
2931 xprintf, and xvasprintf with xprintf-posix and xvasprintf-posix.
2933 2007-11-01 Eric Blake <ebb9@byu.net>
2935 Improve error message when early end of file occurs.
2936 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
2937 (M4wrap): Adjust to new messages.
2938 (Improved capitalize): Enhance test.
2939 * m4/m4private.h (m4__next_token): Adjust prototype.
2940 * m4/input.c (m4__next_token): Add new parameter, and improve
2942 * m4/macro.c (m4_macro_expand_input, collect_arguments): Adjust
2944 (expand_argument): Likewise, and add parameter.
2946 2007-10-31 Eric Blake <ebb9@byu.net>
2948 Test more corner cases.
2949 * tests/macros.at (Rescanning macros): Beef up test.
2950 * doc/m4.texinfo (Changecom): Beef up test.
2951 (Improved foreach): Document alternate foreachq style.
2952 * examples/foreachq3.m4: New file.
2953 * examples/loop.m4: New file.
2954 * Makefile.am (dist_pkgdata_DATA): Distribute them.
2956 2007-10-28 Eric Blake <ebb9@byu.net>
2958 More test coverage for autoconf usage patterns.
2959 * doc/m4.texinfo (Shift): Document cond macro, and add new test.
2960 * tests/macros.at (Rescanning macros): New test.
2961 * tests/builtins.at (include): Augment test.
2963 2007-10-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2965 * Makefile.am: Adjust getopt handling to latest gnulib layout.
2967 2007-10-27 Eric Blake <ebb9@byu.net>
2969 Document one use of changequote(`(',`)').
2970 * doc/m4.texinfo (Changequote): Add new test, based on recent
2971 autoconf addition of m4_expand.
2973 2007-10-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2975 * Makefile.am (dist_pkgdata_DATA): Add examples/capitalize2.m4.
2977 2007-10-22 Eric Blake <ebb9@byu.net>
2979 Never let printf failures go undetected.
2980 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2982 * m4/system_.h: Include xprintf.h.
2983 * m4/debug.c (m4_debug_message_prefix, m4_debug_message): Wrap all
2984 use of printf, xprintf.
2985 * m4/input.c [DEBUG_INPUT]: Likewise.
2986 * m4/module.c [DEBUG_MODULES]: Likewise.
2987 * m4/output.c (m4_shipout_text, m4_shipout_int)
2988 (m4_freeze_diversions): Likewise.
2989 * m4/path.c [DEBUG_INCL]: Likewise.
2990 * m4/symtab.c [DEBUG_SYM]: Likewise.
2991 * m4/syntax.c [DEBUG_SYNTAX]: Likewise.
2992 * modules/modtest.c (export_test): Likewise.
2993 * src/freeze.c (produce_resyntax_dump, produce_syntax_dump)
2994 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
2996 * src/main.c (usage): Likewise.
2997 * po/POTFILES.in: Adjust to new file.
2998 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
3000 2007-10-18 Eric Blake <ebb9@byu.net>
3002 Fix 'm4 -F file -t undefined'.
3003 * src/freeze.c (produce_symbol_dump): Skip trace placeholders.
3004 * src/freeze.c (dump_symbol_CB): Also skip void symbols.
3005 * tests/freeze.at (reloading unknown builtin): Test for this bug.
3006 * m4/m4module.h (m4_symtab_apply): Add parameter.
3007 * m4/symtab.c (m4_symtab_apply): Ignore trace placeholders when
3009 (m4_symtab_delete, symtab_dump): Adjust callers.
3010 * modules/m4.c (m4_dump_symbols): Likewise.
3012 2007-10-09 Eric Blake <ebb9@byu.net>
3014 Fix regexp regression of 2007-09-29.
3015 * modules/gnu.c (substitute): Allow NULL buf when no
3016 subexpressions were present.
3017 (regexp): Handle \ escapes even with empty regex.
3018 * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
3020 Cache regex compilation for another autoconf speedup.
3021 * modules/gnu.c (gnu_buf): Replace...
3022 (REGEX_CACHE_SIZE, regex_cache): ...with new declarations.
3023 (m4_pattern_buffer): Add fields.
3024 (m4_regexp_compile): Rename...
3025 (regexp_compile): ...to this, and drop no_sub parameter.
3027 (M4FINISH_HANDLER): Clean up entire cache.
3028 (m4_regexp_search): Rename...
3029 (regex_search): ...to this, adjust to new struct contents, and add
3031 (m4_regexp_substitute): Rename...
3032 (regexp_substitute): ...to this.
3033 (substitute, patsubst, regexp, renamesyms): Adjust callers.
3035 2007-10-02 Eric Blake <ebb9@byu.net>
3037 Document quoting pitfalls in capitalize.
3038 * doc/m4.texinfo (Patsubst): Use the examples directory. Also
3040 (Improved capitalize): New node.
3041 * examples/capitalize.m4: Update to match manual.
3042 * examples/capitalize2.m4: New file.
3044 2007-10-01 Eric Blake <ebb9@byu.net>
3046 Another Autoconf usage pattern optimization.
3047 * modules/m4.c (m4_index): Optimize search for one byte.
3048 * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
3051 2007-09-29 Eric Blake <ebb9@byu.net>
3053 Optimize for Autoconf usage pattern.
3054 * modules/gnu.c (regexp, patsubst): Handle empty regex faster.
3056 * tests/testsuite.at (AT_CHECK_M4): Slight optimization.
3058 2007-09-24 Eric Blake <ebb9@byu.net>
3060 Create .gitignore alongside .cvsignore.
3061 * bootstrap (version control): Update to reflect git usage.
3063 2007-09-13 Eric Blake <ebb9@byu.net>
3065 * AUTHORS: Fix typo.
3067 2007-09-12 Gary V. Vaughan <gary@gnu.org>
3069 Be consistent about using 'module' for m4_module types and
3070 'handle' for lt_dlhandle types:
3072 * m4/m4private.h (m4_symbol_value): Rename handle element to
3073 method. Changed all references.
3074 (VALUE_MODULE, SYMBOL_MODULE): Renamed from VALUE_HANDLE and
3075 SYMBOL_HANDLE respectively. Changed all references.
3076 * m4/m4module.h (M4INIT_HANDLER, M4FINISH_HANDLER): Ditto.
3077 * m4/builtin.c (m4_builtin_find_by_name)
3078 (m4_builtin_find_by_func): Use module as the parameter name for
3079 pointers of type 'm4_module'.
3080 * m4/module.c (module_remove, m4_get_module_name)
3081 (install_builtin_table, install_macro_table)
3082 (m4_module_make_resident, m4__module_next, m4_module_refcount):
3084 * src/freeze.c (produce_module_dump): Ditto.
3085 * m4/input.c (m4_input_block): Rename handle element to method.
3086 Changed all references.
3087 * m4/symtab.c (m4__symtab_remove_module_references): Ditto.
3088 * modules/load.c: Use module as the variable name for pointers
3089 of type 'm4_module'.
3090 * modules/m4.c: Ditto.
3091 * modules/perl.c: Ditto.
3092 * modules/shadow.c: Ditto.
3094 2007-09-07 Eric Blake <ebb9@byu.net>
3096 Add refcount builtin.
3097 * modules/load.c (refcount): New builtin.
3098 (m4modules): Use correct type.
3099 * doc/m4.texinfo (Refcount): New section.
3100 * m4/m4private.h (struct m4_module): Add refcount member.
3101 (m4_module_refcount) [NDEBUG]: Add faster accessor macro.
3102 * m4/module.c (m4_module_load): Add symbols to table on first
3103 load by m4, regardless of other libltdl loads of same module.
3104 (m4_module_refcount): Use new struct member, rather than relying
3105 on libltdl count which might be inflated by unrelated loads.
3106 (m4__module_interface): Optimize.
3107 (m4__module_next, m4__module_find): Avoid assertions that could
3108 trigger with unrelated libltdl loads.
3109 (m4__module_open): Track m4 load count.
3110 (m4__module_exit): Only unload what m4 loaded.
3111 (module_remove): Track m4 unloads.
3112 * NEWS: Document new builtin.
3114 More conversion to m4_module*.
3115 * src/freeze.c (produce_module_dump, dump_symbol_CB)
3116 (reload_frozen_state): Use correct type.
3117 * m4/input.c (struct m4_input_block): Likewise.
3118 * m4/symtab.c (dump_symbol_CB): Likewise.
3120 * AUTHORS: Simplify, to match libtool and autoconf layout.
3121 * THANKS: Sync with branch.
3123 2007-09-06 Eric Blake <ebb9@byu.net>
3125 Wrap lt_dlhandle in struct m4_module.
3126 * m4/m4module.h (includes): No longer require clients to know
3128 (m4_module): New opaque declaration.
3129 (m4_export): Delete unused type.
3130 (M4INIT_HANDLER, M4FINISH_HANDLER, m4_module_init_func)
3131 (m4_module_finish_func, m4_module_load, m4_get_module_name)
3132 (m4_builtin_find_by_name, m4_builtin_find_by_func): Use new
3134 (m4_module_makeresident, m4_module_refcount): New declarations.
3135 * m4/m4private.h (includes): Move <ltdl.h> here.
3136 (m4_module): New declaration. Simple for now, but intended for
3138 (m4__module_open, m4__module_next, m4__module_find)
3139 (m4__symtab_remove_module_references): Use new wrapper.
3140 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
3142 * m4/module.c (m4_get_module_name, m4_module_import)
3143 (m4_module_load): Likewise.
3144 (install_builtin_table, install_macro_table): Likewise. Also,
3145 change return type since these always returned NULL and no one
3147 (m4_module_makeresident, m4_module_refcount): New functions.
3148 (m4_module_unload, m4__module_next, m4__module_find): Use new
3150 (m4__module_open): Populate new wrapper, and associate it with the
3152 (m4__module_exit): Use new wrapper.
3153 (module_remove): Likewise. Reclaim storage on last use.
3154 (module_close): Delete, and inline into module_remove.
3155 * m4/symtab.c (m4__symtab_remove_module_references): Use new
3157 * modules/load.c (load_init): Use new API.
3158 * modules/m4.c (m4_export_table): Kill unused declaration.
3159 (m4_init): Use new API.
3160 * modules/shadow.c (shadow_init): Use new API.
3161 * src/main.c (main): Adjust callers.
3162 * src/freeze.c (reload_frozen_state): Likewise.
3163 * tests/modules.at (unload load module): New test.
3165 2007-09-03 Gary V. Vaughan <gary@gnu.org>
3167 * bootstrap (ltdl/m4/.cvsignore): Add xstrtol module macros.
3168 * src/m4/.cvsignore: Add xstrtol module sources.
3170 2007-09-03 Gary V. Vaughan <gary@gnu.org>
3172 Work around a bug in darwin's awk:
3174 * bootstrap (func_get_translations): Use $AWK instead of raw
3175 `awk' so that the user can use an alternative implementation
3176 if the first awk in PATH doesn't behave as expected.
3177 (func_get_translations): The first awk script mangles the last
3178 entry passed to it for at least the awk implementation shipped
3179 with Darwin 8.10.1. Capture $3 into a variable too to work-
3180 around that problem.
3182 2007-08-29 Gary V. Vaughan <gary@gnu.org>
3184 As gnulib xstrtol is only used by main, and unconditionally pulls
3185 in a copy of getopt, undo bootstrap change from 2007-08-11 below,
3186 and copy the xstrtol code into src/ so that main() can use it
3187 without pushing the extra code into libm4:
3189 * bootstrap (src_modules): Add getopt and xstrtol modules.
3190 * Makefile.am (src_m4_SOURCES): Add xstrtol sources.
3191 * po/POTFILES.in: Move gnu/xstrtol-error.c to src/xstrtol-error.c.
3193 2007-08-11 Eric Blake <ebb9@byu.net>
3195 Another upstream xstrtol change.
3196 * po/POTFILES.in: Track changes in files containing messages.
3197 * bootstrap (src_modules): getopt is now pulled into libgnu.a, no
3198 need to grab it separately.
3199 * src/main.c (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
3201 (size_opt): Adjust to latest xstrtol interface.
3203 2007-08-10 Eric Blake <ebb9@byu.net>
3205 Documentation improvements.
3206 * doc/m4.texinfo (Defn): Resync with branch.
3207 (Compatibility, Extensions): Sync with branch.
3209 2007-08-07 Eric Blake <ebb9@byu.net>
3211 Adjust to gnulib xstrtol changes.
3212 * src/main.c (size_opt): Adjust signature, so that error strings
3213 are easier to translate.
3214 (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): New macros
3215 for tracking long options.
3216 (main): Track which long option was used.
3217 * tests/options.at (--debuglen, --nesting-limit): Adjust to change
3219 (deprecated options): Test that --arglength spelling shows up in
3222 2007-08-06 Eric Blake <ebb9@byu.net>
3224 Normalize all GPL license notices.
3225 * m4/COPYING.LIB: Delete - libm4 is not distributed under LGPLv2
3227 * Makefile.am: Update license wording.
3228 * bootstrap: Likewise.
3230 * configure.ac: Likewise.
3231 * ltdl/config/mailnotify: Likewise.
3232 * ltdl/config/mkstamp: Likewise.
3233 * ltdl/m4/debug.m4: Likewise.
3234 * ltdl/m4/gmp.m4: Likewise.
3235 * ltdl/m4/m4-error.m4: Likewise.
3236 * ltdl/m4/m4-getopt.m4: Likewise.
3237 * ltdl/m4/m4-gettext.m4: Likewise.
3238 * ltdl/m4/m4-obstack.m4: Likewise.
3239 * ltdl/m4/m4-regex.m4: Likewise.
3240 * ltdl/m4/stackovf.m4: Likewise.
3241 * m4/builtin.c: Likewise.
3242 * m4/debug.c: Likewise.
3243 * m4/hash.c: Likewise.
3244 * m4/hash.h: Likewise.
3245 * m4/input.c: Likewise.
3246 * m4/m4.c: Likewise.
3247 * m4/m4module.h: Likewise.
3248 * m4/m4private.h: Likewise.
3249 * m4/macro.c: Likewise.
3250 * m4/module.c: Likewise.
3251 * m4/output.c: Likewise.
3252 * m4/path.c: Likewise.
3253 * m4/resyntax.c: Likewise.
3254 * m4/symtab.c: Likewise.
3255 * m4/syntax.c: Likewise.
3256 * m4/system_.h: Likewise.
3257 * m4/utility.c: Likewise.
3258 * modules/evalparse.c: Likewise.
3259 * modules/format.c: Likewise.
3260 * modules/gnu.c: Likewise.
3261 * modules/import.c: Likewise.
3262 * modules/load.c: Likewise.
3263 * modules/m4.c: Likewise.
3264 * modules/m4.h: Likewise.
3265 * modules/modtest.c: Likewise.
3266 * modules/mpeval.c: Likewise.
3267 * modules/perl.c: Likewise.
3268 * modules/shadow.c: Likewise.
3269 * modules/stdlib.c: Likewise.
3270 * modules/time.c: Likewise.
3271 * modules/traditional.c: Likewise.
3272 * po/Makevars: Likewise.
3273 * src/freeze.c: Likewise.
3274 * src/m4.h: Likewise.
3275 * src/main.c: Likewise.
3276 * src/stackovf.c: Likewise.
3277 * tests/builtins.at: Likewise.
3278 * tests/freeze.at: Likewise.
3279 * tests/generate.awk: Likewise.
3280 * tests/m4.in: Likewise.
3281 * tests/macros.at: Likewise.
3282 * tests/modules.at: Likewise.
3283 * tests/options.at: Likewise.
3284 * tests/others.at: Likewise.
3285 * tests/stackovf.test: Likewise.
3286 * tests/testsuite.at: Likewise.
3288 2007-07-22 Eric Blake <ebb9@byu.net>
3290 Fix diversions on NetBSD, when fopen(name,"a+") seeks to end.
3291 * m4/output.c (m4_tmpopen): Explicitly seek to beginning.
3292 * tests/builtins.at (divert): Enhance test to cover this.
3294 Reported by Thomas Klausner.
3296 2007-07-20 Eric Blake <ebb9@byu.net>
3298 Fix 'make distcheck' issues.
3299 * bootstrap: Add more files that might be more up-to-date in
3301 * Makefile.am (EXTRA_DIST): No longer distribute removed diff.
3302 * config/m4/gnulib-cache.m4: Update to latest gnulib.
3304 2007-07-16 Eric Blake <ebb9@byu.net>
3306 * po/POTFILES.in: Track recent translation additions from gnulib
3309 2007-07-14 Eric Blake <ebb9@byu.net>
3311 Reflect upstream license .texi changes.
3312 * doc/m4.texinfo (Copying): Rename node...
3313 (GNU General Public License): ...to this.
3314 (GNU Free Documentation License): Adjust node location.
3315 * local/doc/gpl-3.0.texi.diff: Remove file.
3317 2007-07-10 Eric Blake <ebb9@byu.net>
3319 Upgrade to GPLv3, and document 1.4.10.
3320 * bootstrap: Adjust to GPLv3.
3321 (func_update): Port from branch.
3322 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
3323 --local-dir=local --import gpl-3.0'.
3324 * doc/m4.texinfo (History): Mention 1.4.11.
3325 (Copying This Package): New appendix.
3326 * NEWS: Document 1.4.10.
3327 * local/doc/gpl-3.0.texi.diff: New file.
3328 * Makefile.am: Update license.
3329 (doc_m4_TEXINFOS, EXTRA_DIST): Distribute additions.
3330 * commit: Update license.
3331 * configure.ac: Likewise.
3332 * ltdl/config/mailnotify: Likewise.
3333 * ltdl/config/mkstamp: Likewise.
3334 * ltdl/m4/debug.m4: Likewise.
3335 * ltdl/m4/gmp.m4: Likewise.
3336 * ltdl/m4/m4-error.m4: Likewise.
3337 * ltdl/m4/m4-getopt.m4: Likewise.
3338 * ltdl/m4/m4-gettext.m4: Likewise.
3339 * ltdl/m4/m4-obstack.m4: Likewise.
3340 * ltdl/m4/m4-regex.m4: Likewise.
3341 * ltdl/m4/stackovf.m4: Likewise.
3342 * m4/builtin.c: Likewise.
3343 * m4/debug.c: Likewise.
3344 * m4/hash.c: Likewise.
3345 * m4/hash.h: Likewise.
3346 * m4/input.c: Likewise.
3347 * m4/m4.c: Likewise.
3348 * m4/m4module.h: Likewise.
3349 * m4/m4private.h: Likewise.
3350 * m4/macro.c: Likewise.
3351 * m4/module.c: Likewise.
3352 * m4/output.c: Likewise.
3353 * m4/path.c: Likewise.
3354 * m4/resyntax.c: Likewise.
3355 * m4/symtab.c: Likewise.
3356 * m4/syntax.c: Likewise.
3357 * m4/system_.h: Likewise.
3358 * m4/utility.c: Likewise.
3359 * modules/evalparse.c: Likewise.
3360 * modules/format.c: Likewise.
3361 * modules/gnu.c: Likewise.
3362 * modules/import.c: Likewise.
3363 * modules/load.c: Likewise.
3364 * modules/m4.c: Likewise.
3365 * modules/m4.h: Likewise.
3366 * modules/modtest.c: Likewise.
3367 * modules/mpeval.c: Likewise.
3368 * modules/perl.c: Likewise.
3369 * modules/shadow.c: Likewise.
3370 * modules/stdlib.c: Likewise.
3371 * modules/time.c: Likewise.
3372 * modules/traditional.c: Likewise.
3373 * po/Makevars: Likewise.
3374 * src/freeze.c: Likewise.
3375 * src/m4.h: Likewise.
3376 * src/main.c: Likewise.
3377 * src/stackovf.c: Likewise.
3378 * tests/builtins.at: Likewise.
3379 * tests/freeze.at: Likewise.
3380 * tests/generate.awk: Likewise.
3381 * tests/m4.in: Likewise.
3382 * tests/macros.at: Likewise.
3383 * tests/modules.at: Likewise.
3384 * tests/options.at: Likewise.
3385 * tests/others.at: Likewise.
3386 * tests/stackovf.test: Likewise.
3387 * tests/testsuite.at: Likewise.
3389 2007-07-09 Eric Blake <ebb9@byu.net>
3391 * modules/format.c (format): Avoid undefined behavior with %c.
3393 2007-07-01 Gary V. Vaughan <gary@gnu.org>
3395 The translation project has moved.
3396 * bootstrap (func_get_translations): Use the new translation
3400 2007-06-26 Karl Berry <karl@freefriends.org> (tiny change)
3402 Match Free Software Directory categories.
3403 * doc/m4.texinfo (dircategory): Update.
3405 2007-05-31 Eric Blake <ebb9@byu.net>
3407 Add extension to divert builtin.
3408 * modules/m4.c (builtin_divert): Immediately divert second
3410 * m4/output.c (m4_output_text): Allow 0 length. Fixes regression
3412 (m4_shipout_text): Short-circuit on zero length.
3413 * tests/freeze.at (loading format 2): Expand test to catch
3414 regression. Also check out-of-range version.
3415 * tests/builtins.at (divert): Expand test to check corner cases
3417 * doc/m4.texinfo (Divert): Document the extension.
3419 Reported by Daniel Richard G.
3421 2007-05-30 Eric Blake <ebb9@byu.net>
3423 Port format improvements from branch.
3424 * doc/m4.texinfo (History): Mention upcoming 1.4.10 release.
3425 (Format): Enhance section.
3426 * modules/format.c (format): Accept %'hhd, and issue warnings on
3427 unrecognized specifiers.
3428 * modules/gnu.c (builtin_format): Adjust how format is called.
3430 2007-05-28 Eric Blake <ebb9@byu.net>
3432 * tests/options.at (--syncoutput): Add xfailed test.
3434 Fix sync line interaction with multiline comments.
3435 * doc/m4.texinfo (Preprocessor features): Improve documentation.
3436 (Syncoutput): Improve testsuite.
3437 (Incompatibilities): Add testcase, and document bug.
3438 * src/freeze.c (reload_frozen_state): Don't interfere with
3439 synclines when reloading state.
3440 * m4/input.c (m4__next_token): Report line where multiline tokens
3442 * m4/m4private.h (m4__token_type): Add parameter.
3443 * m4/m4module.h (m4_output_text): Export.
3444 (m4_shipout_text): Add parameter.
3445 * src/macro.c (m4_macro_expand_input, expand_token)
3446 (expand_argument): Adjust callers so that line is passed from
3448 * m4/output.c (output_text): Rename...
3449 (m4_output_text): ...to this, and export.
3450 (m4_insert_file, insert_diversion_helper): Update callers.
3451 (m4_shipout_text): Take new parameter for start line of token.
3452 Output at most one syncline per token.
3453 Reported by Sergey Poznyakoff.
3455 Fix large diversion corner cases.
3456 * tests/freeze.at (large diversion): New test.
3457 * m4/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
3458 (make_room_for): Use NULL, not 0, for pointers.
3459 (m4_freeze_diversions): Allow freezing large diversions.
3460 (insert_diversion_helper): Avoid using rewind.
3462 Also run gnulib unit tests during make check.
3463 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
3464 --tests-base=tests/gnu --with-tests'.
3465 * configure.ac (AC_CONFIG_FILES): Build tests/gnu testdir.
3466 * Makefile.am (SUBDIRS): Run gnulib tests before ours.
3468 2007-05-25 Eric Blake <ebb9@byu.net>
3470 * m4/system_.h: Include <stdint.h>, for intmax_t.
3472 Reported by Daniel Richard G.
3474 2007-05-24 Eric Blake <ebb9@byu.net>
3476 Provide consistent shift semantics regardless of hardware.
3477 * modules/m4.c (numb_lshift, numb_rshift, numb_urshift): Mask
3479 (number, unumber): Always use [u]intmax_t.
3480 Reported by Gary V. Vaughan.
3482 Support POSIX flush semantics on all platforms.
3483 * modules/m4.c (m4_sysval_flush): Rely on gnulib.
3484 * ltdl/m4/gnulib-cache.m4: Fix typo in previous commit.
3486 Work around cygwin and mingw fseeko bugs.
3487 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3489 * modules/m4.c (m4_sysval_flush): Prefer fseeko over fseek.
3491 2007-04-25 Eric Blake <ebb9@byu.net>
3493 Test that regression in 1.4.9's eval doesn't recur.
3494 * doc/m4.texinfo (Eval): Check negative division.
3497 2007-04-12 Eric Blake <ebb9@byu.net>
3499 Allow for running test in sticky or setgid directory.
3500 * tests/builtins.at (mkdtemp): Adjust test.
3502 Don't test for broken sed too soon.
3503 * tests/others.at (stdin seekable): Rearrange subtests.
3505 Work around 'stdin seekable' shortcoming on glibc.
3506 * ltdl/m4/gnulib-cache.m4: Use closein instead of closeout.
3507 * tests/others.at (stdin closed): Adjust to new output.
3508 * src/main.c (process_file): No need to return anything.
3509 (main): Use close_stdin instead of close_stdout.
3510 Reported by Ralf Wildenhues.
3512 Enable autobuild usage.
3513 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3515 * configure.ac (AB_INIT): Output autobuild information.
3517 2007-04-11 Eric Blake <ebb9@byu.net>
3519 Address testsuite shortcoming in 'stdout full' on glibc.
3520 * tests/others.at (stdout full): Adjust expected output when more
3521 than 1k text is printed to /dev/full.
3522 Reported by Ralf Wildenhues.
3524 2007-04-10 Eric Blake <ebb9@byu.net>
3526 * tests/macros.at (Arity and defn): Fix quoting.
3528 2007-04-09 Eric Blake <ebb9@byu.net>
3530 Address failure of 'seekable stdin' on Mac OS X.
3531 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3534 2007-04-07 Eric Blake <ebb9@byu.net>
3536 Include <config.h> first in all C files, and not in headers.
3537 Fixes regression for --disable-assert builds from 2007-04-02.
3538 * src/m4.h (includes): Don't include config.h here.
3539 * m4/m4private.h (includes): Likewise.
3540 * m4/builtin.c: Include config.h before anything else.
3541 * m4/debug.c: Likewise.
3542 * m4/hash.c: Likewise.
3543 * m4/input.c: Likewise.
3544 * m4/m4.c: Likewise.
3545 * m4/macro.c: Likewise.
3546 * m4/module.c: Likewise.
3547 * m4/symtab.c: Likewise.
3548 * m4/syntax.c: Likewise.
3549 * m4/utility.c: Likewise.
3550 * src/freeze.c: Likewise.
3551 * src/stackovf.c: Likewise.
3553 2007-04-03 Eric Blake <ebb9@byu.net>
3555 * modules/m4.c (numb_ratio, numb_divide, numb_modulo): Avoid
3556 SIGFPE on x86 architectures.
3557 Reported by Ralf Wildenhues.
3559 2007-04-02 Eric Blake <ebb9@byu.net>
3561 Fix warnings from last commit.
3562 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3563 fprintf-posix sprintf-posix'.
3564 * m4/macro.c (expand_macro, trace_format): Use correct specifier
3566 (process_macro): Avoid negative array index.
3567 * src/freeze.c (produce_resyntax_dump, produce_module_dump)
3568 (dump_symbol_CB, produce_frozen_state): Use correct specifier for
3571 2007-04-02 Gary V. Vaughan <gary@gnu.org>
3573 Get rid of the last 'differs in signedness' compiler warnings:
3575 * m4/macro.c (process_macro): m4_get_symbol_value_text() returns
3576 a regular 'char *', so variables to store the return address,
3577 and iterate through it should be regular 'char *' too.
3578 * m4/input.c (m4_input_block): The start and current members of
3579 the string part of this union store regular 'char *' types, so
3580 they should be regular 'char *' types too.
3582 2007-04-02 Gary V. Vaughan <gary@gnu.org>
3584 M4 was designed to have a small number of header files defining
3585 the interfaces to several source files each. Keeping this in
3586 mind allows us to tidy things up considerably. Having done this,
3587 it becomes clear that some of the installed headers reference
3588 other headers which are not installed (but that's another patch):
3590 * m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from
3592 * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
3593 ...to here, so client modules can benefit too.
3594 (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
3595 lowest level to save doing it multiple times elsewhere.
3596 * m4/debug.c (stdio.h): Removed. The portable <gnu/stdio--.h>
3597 is already included via m4private.h.
3598 * modules/time.c (stdio.h): Ditto.
3599 * modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>.
3600 * modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h>
3601 and <gnu/unistd--.h>,
3602 * m4/m4private.h (m4module.h): Use angle brackets for an installed
3604 * m4/hash.h (system.h): Ditto.
3605 * modules/gnu.c (progname.h): Removed.
3606 * src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h.
3607 * m4/m4private.h (assert.h, errno.h): Already included via
3609 * m4/input.c (ctype.h): Ditto.
3610 * m4/module.c (ltdl.h): Ditto.
3611 * m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h)
3613 * m4/path.c (config.h, stdlib.h): Ditto.
3614 * m4/utility.c (config.h): Ditto.
3615 * modules/evalparse.c (assert.h, ctype.h): Ditto.
3616 * modules/gnu.c (assert.h, ctype.h, errno.h): Ditto.
3617 * modules/import.c (assert.h): Ditto.
3618 * modules/m4.c (assert.h, errno.h): Ditto.
3619 * modules/modtest.c (assert.h): Ditto.
3620 * modules/stdlib.c (sys/types.h): DittAo.
3621 * src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h):
3623 * src/stackovf.c (assert.h): Ditto.
3624 * modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster
3625 private interfaces when NDEBUG is defined.
3626 * modules/import.c (m4/m4module.h, m4private.h): Ditto.
3627 * modules/load.c (m4/m4module.h, m4private.h): Ditto.
3628 * modules/m4.c (m4/m4module.h, m4private.h): Ditto.
3629 * modules/modtest.c (m4/m4module.h, m4private.h): Ditto.
3630 * modules/mpeval.c (m4/m4module.h, m4private.h): Ditto.
3631 * modules/perl.c (m4/m4module.h, m4private.h): Ditto.
3632 * modules/shadow.c (m4/m4module.h, m4private.h): Ditto.
3633 * modules/time.c (m4/m4module.h, m4private.h): Ditto.
3634 * modules/traditional.c (m4/m4module.h, m4private.h): Ditto.
3635 * src/m4.h (locale.h): Moved from here...
3636 * src/main.h: ...to here.
3637 (m4private.h): Already included via m4.h.
3638 * src/stackovf.c (m4private.h): Ditto.
3640 2007-03-28 Gary V. Vaughan <gary@gnu.org>
3642 * Makefile.am (stamp-vcl): Removed.
3643 (CONFIG_STATUS_DEPENDENCIES): Depend directly on ChangeLog.
3645 2007-03-28 Eric Blake <ebb9@byu.net>
3647 * src/main.c (usage): Improve note to TRANSLATORS.
3648 * m4/system_.h (EXIT_FAILURE): Reflect gnulib changes.
3650 * tests/builtins.at (__m4_version__): Fix bug when TIMESTAMP is
3653 2007-03-24 Eric Blake <ebb9@byu.net>
3655 * m4/output.c (m4_output_init): Update to latest gnulib.
3656 * bootstrap (ltdl/m4/.cvsignore): No longer track generated
3658 * NEWS: Reflect release of 1.4.9.
3661 2007-03-07 Eric Blake <ebb9@byu.net>
3665 Exercise gnulib's new POSIX *printf modules.
3666 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3668 * modules/format.c (format): Support %a and %A.
3669 * doc/m4.texinfo (Format): Test this addition.
3670 * NEWS: Document this addition.
3672 2007-03-03 Eric Blake <ebb9@byu.net>
3674 * m4/input.c (m4__next_token): Fix synclines when in batch mode.
3675 * doc/m4.texinfo (M4exit): Synch another section.
3676 (Syncoutput): Make similar to other sections.
3678 2007-03-01 Eric Blake <ebb9@byu.net>
3680 * doc/m4.texinfo: Improve the indices.
3681 (Concept index): Rearrange to be last.
3682 (Sysval): Merge from branch.
3684 * doc/m4.texinfo (Syscmd, Esyscmd): Merge more doc sections.
3686 2007-02-28 Eric Blake <ebb9@byu.net>
3688 POSIX XCU ERN 137 was approved.
3689 * modules/mpeval.c (numb_extension): Delete.
3690 * modules/m4.c (numb_extension): Likewise.
3691 * modules/evalparse.c (comma_term, condition_term): Always
3692 implement ?: and , operators.
3693 * m4/symtab.c: Update comment to match reality.
3694 * src/freeze.c (produce_frozen_state, reload_frozen_state): Avoid
3695 dereferencing context directly when accessor exists.
3696 * src/main.c (usage): Prefer GNU_M4 over EMACS.
3697 (struct macro_definition): Rename...
3698 (struct deferred): ...to match usage. All uses changed.
3699 * doc/m4.texinfo (Eval): Document this change.
3700 (Operation modes, Changeresyntax): Fix wording to prefer GNU_M4
3702 (Preprocessor features, Changesyntax): Fix inaccuracies.
3703 * NEWS: Import branch NEWS items for 1.4.x series. Document
3706 POSIX XCU ERN 118 was approved.
3707 * modules/m4.c (define): Kill posixly_correct distinction in
3708 define behavior, since POSIX says GNU behavior complies.
3709 * tests/builtins.at (define): Restore original semantics.
3710 * doc/m4.texinfo (Pushdef): Document portability issues with
3712 (Incompatibilities): Clean up wording of what POSIX requires.
3713 * NEWS: Document this.
3715 2007-02-26 Eric Blake <ebb9@byu.net>
3717 Re-enable clean bootstrap on cygwin.
3718 * Makefile.am (AM_LDFLAGS): For now, export all symbols from
3719 modules, since otherwise we run afoul of current libtool
3720 limitations on cygwin and mingw.
3722 2007-02-25 M. Levinson <levinsm@users.sourceforge.net> (tiny change)
3724 * src/freeze.c (reload_frozen_state): Avoid dereferencing freed
3725 memory. Fixes regression introduced 2007-01-20.
3727 2007-02-25 Eric Blake <ebb9@byu.net>
3729 * tests/freeze.at (loading format 2): Augment test to catch
3730 regression introduced on 2007-01-20.
3732 Reported by M. Levinson.
3734 * m4/system_.h (includes, EXIT_SUCCESS, EXIT_FAILURE): Adjust to
3737 2007-02-05 Eric Blake <ebb9@byu.net>
3739 * tests/options.at (--fatal-warnings): New test.
3740 * tests/others.at (stdin seekable): Exit on error.
3741 * m4/m4private.h (M4_OPT_WARN_EXIT_BIT): New bit.
3742 (m4_get_warnings_exit_opt): Access it.
3743 * m4/m4module.h (m4_context_opt_bit_table): Access it.
3744 * m4/utility.c (m4_error, m4_error_at_line): Only force an exit
3746 (m4_warn, m4_warn_at_line): Change exit status on -E, and force
3748 * src/m4.c (usage): Document new -E behavior.
3749 (main): Make -E an additive option.
3750 * doc/m4.texinfo (Operation modes): Document the change.
3751 Reported by Ralf Wildenhues.
3753 * tests/others.at (stdin seekable): Fix bug in test.
3754 * ltdl/m4/gnulib-cache.m4: Gnulib module strstr no longer exists.
3756 * m4/input.c (struct m4_input_block): Remove unused field traced.
3758 2007-02-03 Eric Blake <ebb9@byu.net>
3759 and Bruno Haible <bruno@clisp.org> (tiny change)
3761 * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
3763 Reported by Bruno Haible.
3765 2007-01-31 Eric Blake <ebb9@byu.net>
3767 * m4/resyntax.c (m4_regexp_syntax_encode): Detect allocation
3770 2007-01-26 Eric Blake <ebb9@byu.net>
3772 * m4/symtab.c (includes): Adjust to latest gnulib.
3773 * modules/m4.c (includes): Likewise.
3775 2007-01-23 Eric Blake <ebb9@byu.net>
3777 * m4/m4module.h (M4_SYNTAX_ASSIGN): Delete this unused
3778 extension to make enough room.
3779 (M4_SYNTAX_IGNORE): Change value to zero, since the (commented)
3780 code in input.c special cases this category.
3781 (M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): New values in preparation
3782 for define(eleventh,${11}) extension.
3783 * m4/syntax.c: Update comments accordingly.
3784 (m4_syntax_create, m4_syntax_code): Handle { and }.
3785 * m4/input.c (m4__next_token): Likewise.
3786 * src/freeze.c (produce_frozen_state): Support new categories.
3787 (reload_frozen_state): When loading version 1, disable syntax
3788 features not present in 1.4.x.
3789 * tests/freeze.at: Sort and rename existing tests.
3790 (loading format 1): Ensure we don't break v1 frozen files that
3792 (loading format 2, reloading changecom, reloading changesyntax):
3794 * doc/m4.texinfo (Changesyntax, Frozen file format 1): Document
3795 the new syntax categories.
3796 (Arguments): Update the FIXME comment.
3797 (M4wrap): Merge examples from branch, before worrying about fixing
3798 m4wrap to obey POSIX.
3799 (Using frozen files): Start merging from branch.
3802 2007-01-20 Eric Blake <ebb9@byu.net>
3804 * src/freeze.c (produce_char_dump): Delete. Replace with...
3805 (produce_mem_dump): ...this new function, to encode more strings.
3806 Also make the coding easier to read and slightly more compact.
3807 (produce_syntax_dump): Only dump non-default syntax codes.
3808 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
3809 Encode non-ASCII characters in user-supplied strings.
3810 (GET_STRING): Accept escape sequences in version 2.
3811 * NEWS: Document this change.
3814 2007-01-16 Eric Blake <ebb9@byu.net>
3816 Port patch from branch for stack overflow detection on BSD/OS.
3817 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Check for stack_t.ss_sp.
3818 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
3819 ! HAVE_STACK_T_SS_SP]: Use this check.
3820 Reported by Chris McGuire.
3822 2007-01-15 Eric Blake <ebb9@byu.net>
3824 * tests/builtins.at (__m4_version__): New test.
3825 * modules/traditional.c (m4_macro_table): Provide windows and os2
3826 macros, as appropriate. Add __traditional__ macro.
3827 * modules/mpeval.c (m4_macro_table): Name the macro __mpeval__,
3828 not __gmp__, to match module name.
3829 * modules/load.c (m4_macro_table): Name the macro __load__, not
3830 __modules__, to match module name.
3831 * doc/m4.texinfo (History, Shell commands, Platform macros): Merge
3833 (Standard Modules): Improve wording.
3834 (Incompatibilities): Move platform macros into their own node.
3835 (Load, Unload): Use actual examples.
3836 * NEWS: Document this change.
3839 2007-01-13 Eric Blake <ebb9@byu.net>
3841 * doc/m4.texinfo (Mpeval): Add tests.
3842 * tests/testsuite.at (AT_CHECK_GMP): New filter, factored from...
3843 * tests/builtins.at (gmp): ...here. Rename test to...
3845 * tests/generate.awk (new_test): Filter out mpeval tests when gmp
3847 * m4/m4module.h (m4_get_no_gnu_extensions_opt): Merge
3848 no_gnu_extensions with posixly_correct_opt, since they were set in
3850 * m4/m4private.h (struct m4): Remove no_gnu_extensions.
3851 * src/main.c (main): Update caller.
3852 * src/freeze.c (reload_frozen_state): Likewise.
3853 * modules/m4.c (m4wrap): Likewise.
3855 2007-01-12 Eric Blake <ebb9@byu.net>
3857 * m4/syntax.c (m4_set_comment): XCU ERN 131 was approved by
3858 POSIX, so update the comment.
3859 * doc/m4.texinfo (Inhibiting Invocation): XCU ERN 130 was
3860 approved by POSIX, so we can always have blind macros, even when
3862 (Ifelse): Mention the term `blind builtin'.
3864 2007-01-08 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3866 * doc/m4.texinfo: Fix a couple of typos.
3868 2007-01-08 Eric Blake <ebb9@byu.net>
3870 * ltdl/m4/gnulib-cache.m4: Update for new year.
3871 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Cover all error cases.
3872 Reported by Ralf Wildenhues.
3874 2007-01-06 Eric Blake <ebb9@byu.net>
3876 * m4/m4private.h (to_uchar): Move...
3877 * m4/m4module.h: here, so modules can use it.
3878 * src/main.c (usage, long_options): Support --posix as a synonym
3880 * modules/m4.c (numb_invert): Detect unsupported x**-y.
3881 (numb_incr, numb_urshift, numb_extension): New macros.
3882 (numb_obstack): Port patch from branch to support radix 1 output.
3883 * modules/mpeval.c (numb_obstack): Use \ for ratios.
3884 (numb_incr, numb_urshift, numb_extension): New macros.
3885 (mpq2mpz): Warn rather than error.
3886 * modules/evalparse.c (URSHIFT, NEGATIVE_EXPONENT): New
3888 (eval_error): Rearrange, so that all ignorable errors are less
3890 (eval_text, last_text): Obey C++ type safety rules.
3891 (numb_pow): Change return type.
3892 (exp_term): Adjust caller.
3893 (m4_evaluate): Fail on bad exponent.
3894 (logical_or_term, logical_and_term): Ignore failed ** in short
3896 (eval_lex): Fix typos when detecting <<= and >>=. Use \ instead
3897 of : for ratio. Support >>>, ,, and ?:. Port patch from branch
3898 to parse radix 1 numbers.
3899 (condition_term, comma_term): New parse functions.
3900 (shift_term): Support >>>.
3901 (m4_evaluate): Port patch from branch to output radix 1 numbers.
3902 Warn instead of error for most parse problems.
3903 * doc/m4.texinfo (Limits control, Eval): Document these changes.
3904 * NEWS: Document new operators and new command line option.
3906 2007-01-04 Eric Blake <ebb9@byu.net>
3908 * configure.ac (AC_SYS_LARGEFILE): Guarantee large file support.
3910 2007-01-03 Eric Blake <ebb9@byu.net>
3912 * doc/m4.texinfo (Format, Incr): More merges.
3913 (Eval): Ensure C precedence rules are met.
3914 * modules/evalparse.c (BADOP, INVALID_OPERATOR): New enumerators.
3915 (not_term, logical_not_term): Delete; these are same precedence
3916 as other unary operators.
3917 (equality_term): New; these are lower precedence than relational
3919 (eval_lex, simple_term, m4_evaluate): Recognize forbidden C
3920 operators for better error messages.
3921 (logical_or_term, logical_and_term): Short-circuit out the error
3922 of division by zero.
3923 (unary_term): Allow consecutive unary operators.
3924 * modules/m4.c (int2numb, numb2int): Delete; these potentially
3926 (numb_not, numb_eor, numb_ior, numb_and): Update callers.
3927 * modules/mpeval.c (reduce1, reduce2): Protect macros better.
3928 * NEWS: Document this change.
3930 2006-12-27 Eric Blake <ebb9@byu.net>
3932 * doc/m4.texinfo (Substr, Patsubst): Merge more sections from the
3934 * modules/m4.c (substr): Merge from branch.
3936 2006-12-26 Eric Blake <ebb9@byu.net>
3938 * doc/m4.texinfo (Changesyntax): Check for regressions with
3939 changesyntax(W=...).
3941 2006-12-22 Eric Blake <ebb9@byu.net>
3943 * m4/m4module.h (m4_set_syntax): Change signature.
3944 * modules/gnu.c (m4_resyntax_encode_safe): Reduce error to
3946 (changesyntax): Likewise, and update caller.
3947 * m4/m4private.h (m4_syntax_table): Add orig member.
3948 * m4/syntax.c (m4_set_quotes, m4_set_comment): Merge from branch.
3949 Don't set is_single_quotes and is_single_comments when the begin
3950 character is shadowed by another syntax type.
3951 (m4_syntax_create): Populate default syntax table.
3952 (add_syntax_attribute): Don't lose quote assignment.
3953 (remove_syntax_attribute): Only allow removing rquote or ecomm.
3954 (add_syntax_set, subtract_syntax_set, set_syntax_set)
3955 (reset_syntax_set): New helper routines.
3956 (m4_set_syntax): Alter semantics - NUL key reverts entire syntax
3957 to default, and empty chars reverts that key to default.
3958 (check_is_single_quotes, check_is_single_comments): New helper
3960 * modules/m4.c (changecom): Merge from branch.
3961 * m4/input.c (m4__next_token): Rearrange token recognition order
3962 to macro, quote, comment, in order to match traditional
3964 * src/freeze.c (reload_frozen_state): Update caller.
3965 * doc/m4.texinfo (Changequote, Changecom): Merge from branch, with
3967 (Changeresyntax): Revise to match style of surrounding sections
3968 and add more examples.
3969 (Changesyntax): Likewise, and update to new semantics.
3970 * NEWS: Document this change.
3972 * doc/m4.texinfo (Operation modes): Avoid underfull hbox.
3973 (M4wrap, Eval, Errprint): Fix typos.
3974 (Divnum): Not necessary to redivert in example.
3976 2006-12-21 Eric Blake <ebb9@byu.net>
3978 * doc/m4.texinfo (Len, Index macro, Regexp): More section merging
3981 2006-12-19 Eric Blake <ebb9@byu.net>
3983 * modules/m4.h (m4_sysval_flush_func): Adjust prototype.
3984 * modules/m4.c (m4_sysval_flush): Add parameter, so that m4exit
3985 can track write errors without all other callers warning multiple
3987 (sysval_flush_helper): New function.
3988 (dumpdef, syscmd, errprint, m4exit): Adjust callers.
3989 * modules/gnu.c (esyscmd): Likewise.
3990 * tests/others.at (stdout closed, stdout full): Error message
3993 2006-12-16 Eric Blake <ebb9@byu.net>
3995 * src/main.c: Fix missing include.
3997 * src/main.c (main): Check for errors when closing stdin.
3998 * modules/m4.c (m4exit): Missed part of previous patch: flush
3999 stdin before a successful exit.
4000 Reported by Ralf Wildenhues.
4002 2006-12-14 Eric Blake <ebb9@byu.net>
4004 * modules/m4.c (m4_sysval_flush): Flush stdin before exiting, as
4006 * tests/others.at (stdin seekable): New test.
4008 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4010 * doc/m4.texinfo: Fix some typos.
4012 2006-12-04 Eric Blake <ebb9@byu.net>
4014 * doc/m4.texinfo (Undivert, Divnum, Cleardivert): Merge more doc
4016 (Modules): Make style consistent.
4018 2006-11-16 Eric Blake <ebb9@byu.net>
4020 * bootstrap: Relax m4 requirement, thanks to...
4021 * configure.ac (Gettext support): ...this workaround to the 1.4.4
4022 bug. Undoes restriction added on 2006-11-09.
4024 * tests/builtins.at (esyscmd, syscmd): Redo, since spilled
4025 diversions are now closed when not active.
4026 (divert): Remove check now in the manual.
4027 * tests/others.at (stderr closed): Likewise.
4028 (stdout closed): Add a check.
4029 * doc/m4.texinfo (Include, Search Path, Diversions, Divert): Sync
4030 more docs with branch.
4032 2006-11-14 Eric Blake <ebb9@byu.net>
4034 Remerge sparse diversion handling from branch.
4035 * ltdl/m4/gnulib-cache.m4: Replace avltree-list with
4037 * m4/output.c (diversion_table): Change type to gl_oset_t.
4038 (m4_output_init, m4_output_exit, cleanup_tmpfile, make_room_for)
4039 (m4_make_diversion, insert_diversion_helper, m4_insert_diversion)
4040 (m4_undivert_all, m4_freeze_diversions): Adjust all callers.
4041 (div0, diversion_storage): New variables.
4042 (diversions, equal_diversion_CB): Deleted.
4043 (threshold_diversion_CB): New callback.
4044 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
4046 (m4_tmpfile): Move cloexec action here.
4048 * m4/resyntax.c (m4_regexp_syntax_encode): Avoid bug with signed
4051 2006-11-13 Eric Blake <ebb9@byu.net>
4053 Add several new command line options.
4054 * src/main.c (usage): Update.
4055 (OPTSTRING, long_options): Add --pushdef, --popdef, --gnu,
4056 --traceon, --traceoff, --syncoutput, --warnings, --unload-module.
4057 Make --regexp-syntax argument optional.
4058 (main): Support new options. Fix regression in interactive
4059 behavior from Nov 8.
4060 * m4/m4private.h (M4_OPT_SYNCOUTPUT_BIT): Rename from
4061 M4_OPT_SYNC_OUTPUT_BIT.
4062 * m4/m4module.h (m4_context_opt_bit_table): Rename sync_output to
4063 syncoutput, to match option.
4064 (m4_parse_truth_arg): New prototype.
4065 * m4/utility.c (m4_parse_truth_arg): Implement it.
4066 * m4/output.c (m4_shipout_text): Adjust sync_output caller.
4067 * modules/gnu.c (syncoutput): Adjust sync_output caller, and use
4069 * doc/m4.texinfo (Operation modes, Dynamic loading features)
4070 (Preprocessor features, Limits control, Debugging options)
4071 (Command line files): Update documentation.
4072 * tests/builtins.at (mkstemp): Simplify.
4073 * tests/macros.at (Command line pushdef): New test.
4074 (Command line define): Improve.
4075 * tests/options.at (--traceon and --traceoff, --syncoutput): New
4077 (POSIXLY_CORRECT): Likewise.
4078 (deprecated options): Augment.
4079 (--regexp-syntax): Update, now that -r takes optional arg.
4080 * NEWS: Reformat. Document new options.
4082 2006-11-11 Eric Blake <ebb9@byu.net>
4084 One step closer to allowing C++ compilation - don't blindly
4085 convert between char* and unsigned char*.
4086 * m4/m4module.h (m4_set_syntax): Change signature.
4087 * m4/m4private.h (m4_string): Use signed char.
4088 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
4089 (m4_get_syntax_ecomm): No longer a need to cast.
4090 * m4/syntax.c (m4_set_syntax, m4_syntax_create, m4_set_quotes):
4091 Reflect this change.
4092 * m4/macro.c (expand_argument): Simplify.
4093 (expand_token): Use proper type.
4094 * src/freeze.c (reload_frozen_state): Likewise.
4095 * m4/input.c (MATCH, match_input): Likewise.
4096 * modules/m4.c (translit): Likewise.
4097 * modules/gnu.c (substitute): Simplify.
4099 * m4/macro.c (trace_format): Use canonical type name.
4100 * m4/output.c (m4_freeze_diversions): Likewise.
4101 * src/freeze.c (produce_module_dump, dump_symbol_CB)
4102 (produce_frozen_state): Likewise.
4103 * m4/m4private.h (to_uchar): Grab from branch.
4104 * m4/input.c (string_peek, string_read): Use it.
4105 * m4/utility.c (skip_space): Likewise.
4106 * src/main.c (main): Likewise.
4107 * doc/m4.texinfo (Translit): Remerge from branch.
4108 * tests/builtins.at (translit): Test 8-bit range.
4109 * modules/m4.c (m4_expand_ranges): Merge from branch.
4111 2006-11-09 Eric Blake <ebb9@byu.net>
4113 * bootstrap: Validate that installed M4 is powerful enough.
4114 Reported by Gary V. Vaughan, analyzed by Stepan Kasal.
4116 2006-11-08 Eric Blake <ebb9@byu.net>
4118 Merge deferred handling of -D option from branch.
4119 * doc/m4.texinfo (Debugging options, Preprocessor features)
4120 (Dynamic loading features, Operation modes, Invoking m4):
4121 Document this change.
4122 * src/main.c (OPTSTRING): Specify in-order processing.
4123 (process_file): New function.
4124 (main): Use it to interleave files and deferred options.
4125 * tests/macros.at (Command line define): New test.
4126 * tests/generate.awk: Allow '@comment file' as first example
4128 * tests/options.at (option grouping): Update to reflect actual
4130 (file names): New test.
4132 2006-11-07 Eric Blake <ebb9@byu.net>
4134 * m4/output.c (cleanup_tmpfile, m4_insert_diversion_helper): Check
4137 * tests/builtins.at (m4exit): New test; failed on cygwin before
4139 * m4/output.c (cleanup_tmpfile): Close files before removing
4141 (make_room_for, m4_output_exit): Ensure that atexit handler
4142 invoked from m4_error sees consistent state.
4144 * doc/m4.texinfo (Errprint): Merge another doc node.
4145 * tests/builtins.at (dumpdef, errprint): New tests.
4146 * modules/m4.c (errprint): Merge from branch: flush before
4149 2006-11-02 Eric Blake <ebb9@byu.net>
4151 * bootstrap: Update bootstrap requirement wording.
4152 Reported by Bruno Haible.
4154 2006-10-31 Eric Blake <ebb9@byu.net>
4156 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
4158 * doc/m4.texinfo (Translit): Merge from branch.
4159 * modules/m4.c (divert, substr): Ignore excess arguments.
4160 (index, translit): Merge from branch.
4161 * tests/builtins.at (translit): Add a test.
4163 2006-10-30 Eric Blake <ebb9@byu.net>
4165 * m4/m4private.h (m4_get_symbol_value_module): Delete accidental
4167 * m4/symtab.c (m4_get_symbol_value_module): Likewise.
4169 * modules/m4.c (m4_make_temp): Make safe across libtool.
4170 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Avoid warnings.
4171 * configure.ac (--with-modules): Accomodate changed module
4172 location when doing './configure --enable-debug'.
4174 2006-10-28 Eric Blake <ebb9@byu.net>
4176 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
4179 2006-10-27 Eric Blake <ebb9@byu.net>
4181 * bootstrap (gnulib): No longer a need to patch after gnulib-tool
4183 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
4184 0.16, since 0.15 is incompatible with our automake requirement.
4186 * m4/macro.c (expand_argument): Fix missing initialization.
4187 * m4/m4private.h (struct m4_symbol_value): Store entire
4188 m4_builtin, not just the func.
4189 (m4_get_symbol_value_func): Update.
4190 (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
4192 * m4/m4module.h (m4_get_symbol_value_builtin)
4193 (m4_get_symbol_builtin): New prototypes.
4194 (m4_set_symbol_value_func): Delete, replace with...
4195 (m4_set_symbol_value_builtin): New function.
4196 (m4_builtin_find_by_name): Change signature.
4197 * m4/symtab.c (m4_symbol_value_print): Simplify.
4198 (m4_get_symbol_value_func): Update.
4199 (m4_get_symbol_value_builtin): New function.
4200 (m4_set_symbol_value_func): Delete, replace with...
4201 (m4_set_symbol_value_builtin): New function.
4202 (dump_symbol_CB) [DEBUG_SYM]: Simplify.
4203 * m4/builtin.c (m4_builtin_find_by_name): Change signature.
4204 * m4/input.c (struct m4_input_block): Remove unused trace member.
4205 (m4_push_builtin, builtin_print, init_builtin_token): Update
4207 * m4/module.c (install_builtin_table): Likewise.
4208 * src/freeze.c (reload_frozen_state): Likewise.
4209 * modules/gnu.c (builtin): Make it possible to retrieve a builtin
4210 token, even after the builtin has been undefined.
4211 * doc/m4.texinfo (Builtin): Document new capability.
4214 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
4216 * modules/m4.c (m4_make_temp): Use it.
4217 * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
4219 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4221 * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
4224 2006-10-26 Eric Blake <ebb9@byu.net>
4226 Silence -O2 -Wall -Wwrite-strings warnings.
4227 * m4/m4private.h (m4_symbol_value): Const-ify text.
4228 * m4/m4module.h (m4_get_symbol_value_text)
4229 (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
4230 (m4_set_symbol_value_placeholder): Likewise.
4231 * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
4233 * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
4234 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
4235 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
4237 * modules/format.c (format): Likewise.
4238 * src/main.c (main): Likewise.
4239 * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
4240 * modules/shadow.c (shadow, test): Likewise.
4241 * m4/output.c (m4_make_diversion): Don't hold on to empty
4243 (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
4244 (m4_freeze_diversions): Likewise. Don't use uninitialized
4247 Convert diversions to list instead of sparse array, part 2.
4248 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
4250 * m4/output.c (m4_diversion): Add next pointer and divnum members.
4251 (diversion_table): Convert to a list instead of a sparse array.
4252 (free_list): Maintain free list of reclaimed diversions.
4253 (equal_diversion_CB, cmp_diversion_CB): New functions.
4254 (m4_output_init): Set up list.
4255 (m4_output_exit): Tear down list.
4256 (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
4258 (m4_make_diversion): Change creation of new diversions.
4259 (m4_insert_diversion_helper): New function, to avoid list
4261 * tests/builtins.at (divert): The test now passes.
4262 * NEWS: Document this improvement.
4264 Convert diversions to list instead of sparse array, part 1.
4265 * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
4267 * m4/output.c (diversion, total_buffer_size, output_unused):
4268 Track size in size_t. All users changed.
4269 (struct diversion): Reduce size now, to compensate for part 2.
4270 (m4_make_diversion, make_room_for): Avoid malloc overflow.
4271 (m4_output_exit): Fix typo in assert.
4272 (m4_output_init, make_room_for, m4_make_diversion)
4273 (m4_insert_diversion, m4_freeze_diversions): Adjust users of
4274 struct m4_diversion to disambiguate the new union.
4275 * tests/builtins.at (divert): Detect this failure.
4277 2006-10-25 Eric Blake <ebb9@byu.net>
4279 * m4/m4module.h (m4_push_builtin): Add parameter.
4280 * modules/m4.c (defn): Update caller.
4281 * m4/input.c (file_read_init, string_read_init): No longer
4283 (input_funcs): Change signature of read_func, all callers
4285 (composite_peek, composite_read, composite_unget),
4286 (composite_print, composite_funcs): New input type. Not yet
4287 fully utilized, but one step closer to fixing defn.
4288 (m4_input_block): Make every input block track current file and
4289 line. Rename some members. Remove unused out_line. Add support
4290 for composite input block.
4291 (input_change): New flag.
4292 (file_peek, file_read, file_clean, file_unget, file_print):
4294 (m4_push_file, m4_push_builtin, m4_push_string_init)
4295 (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
4296 (m4_skip_line, pop_input): Track input block changes.
4297 (m4_pop_wrapup): Avoid overflow.
4298 (init_builtin_token): Handle composite input.
4299 (next_char): Handle input block changes.
4300 * doc/m4.texinfo (Location): Remerge from branch.
4302 * src/m4.h (includes): Need <locale.h> after all; fixes
4303 regression from yesterday.
4305 * m4/system_.h (obstack_regrow): New macro. Hopefully glibc will
4307 * m4/macro.c (expand_macro): Avoid referencing invalid memory.
4308 Handle nesting the argc obstack.
4309 (expand_token): Avoid unnecessary malloc.
4310 (collect_arguments): Copy name before invalidating it.
4311 (argc_stack, argv_stack): New variables.
4312 (m4_macro_expand_input): Initialize argc and argv stacks once per
4313 file, instead of once per macro.
4315 2006-10-24 Eric Blake <ebb9@byu.net>
4317 * src/m4.h (includes): Add gettext.h, for N_. Assume setlocale.
4319 2006-10-23 Eric Blake <ebb9@byu.net>
4321 * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
4322 from branch regarding stripped leading whitespace.
4324 * modules/m4.c (includes): Use safe headers even when configured
4325 with --enable-assert.
4326 (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
4327 #defined as mkstemp_safer.
4329 2006-10-21 Eric Blake <ebb9@byu.net>
4331 * modules/m4.c (m4_make_temp): Change signature.
4332 (maketemp, mkstemp): Update callers.
4333 * modules/m4.h (m4_make_temp_func): New export.
4334 * modules/gnu.c (mkdtemp): New macro.
4335 * doc/m4.texinfo (Operation modes): Document interaction with
4337 (Mkdtemp): New node.
4338 * tests/builtins.at (mkdtemp): New test.
4339 (mkstemp): Check for umask effect.
4340 * NEWS: Document new builtin.
4342 * tests/generate.awk (normalize): Update recognition of trailing
4344 * doc/m4.texinfo: Minor formatting fixes from branch.
4345 (Foreach, Improved foreach): Merge from branch.
4346 * examples/foreach.m4: Merge from branch.
4347 * examples/foreachq.m4: New file from branch.
4348 * examples/foreach2.m4: Likewise.
4349 * examples/foreachq2.m4: Likewise.
4351 * doc/m4.texinfo (titlepage): Add myself as author.
4352 * src/main.c (AUTHORS): Likewise.
4354 2006-10-19 Eric Blake <ebb9@byu.net>
4356 * modules/m4.c (m4_make_temp, mkstemp): New functions.
4357 (maketemp): Add POSIX behavior and a warning.
4358 * tests/others.at (maketemp): Move this test...
4359 * tests/builtins.at (mkstemp): ...to here, and beef up.
4360 * tests/options.at (--safer): Update to new warning message.
4361 * doc/m4.texinfo (Mkstemp): Sync from branch.
4362 (Extensions): Update maketemp behavior.
4363 * NEWS: Document that maketemp now always warns.
4365 * tests/generate.awk: For ease of doc-writing, simplify selection
4366 of '-Ipath/to/examples' to '@comment examples'.
4367 * examples/forloop.m4: Simplify.
4368 * examples/forloop2.m4: New file.
4369 * examples/quote.m4: New file.
4370 * doc/m4.texinfo (Improved forloop): New node.
4371 (Manual): Clarify use of examples directory.
4372 (Shift, Forloop): Resync from branch.
4373 (Include, Location): Update to new usage of examples directory.
4375 * m4/system_.h (includes): Pick up <unistd.h> before checking for
4377 (gettext_noop): Don't define here, let gettext.h do it instead.
4378 * po/POTFILES.in: Update entries to reflect gnulib imports.
4380 2006-10-16 Eric Blake <ebb9@byu.net>
4382 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
4384 * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
4385 pkglibexecdir support.
4386 * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
4387 worry about pathconf.h, now that gnulib does it for us.
4388 (pkgmodincludedir): Simplify.
4389 (pkglibexecdir): Delete, now that automake does this.
4390 * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
4391 * src/main.c (usage): Likewise.
4392 * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
4394 * doc/m4.texinfo: Port some changes from the branch.
4395 (Invoking m4): Promote to a chapter, instead of a section of
4397 (Operation modes, Dynamic loading features, Preprocessor features)
4398 (Limits control Frozen state, Debugging options)
4399 (Command line files): Subdivide into new sections.
4400 (Cleardivert): Rename from cleardiv.
4402 2006-10-14 Eric Blake <ebb9@byu.net>
4404 * tests/others.at (stdin closed): Update to match previous patch.
4406 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
4408 Reported by Ralf Wildenhues.
4410 * modules/m4.c (undivert): Merge from branch.
4411 * doc/m4.texinfo (Improved fatal_error): Fix typo.
4412 (Improved exch): New node, copied from branch.
4413 (Improved cleardivert): Update from branch.
4416 2006-10-13 Eric Blake <ebb9@byu.net>
4418 * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
4420 * modules/gnu.c (builtin, indir): Transparently handle builtin
4422 * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
4423 * m4/input.c (m4_pop_wrapup): Display debug message when switching
4425 (m4_input_init): No need to use empty file any more.
4426 (file_print): Display correct file name.
4427 * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
4428 dereference a NULL file name.
4429 * m4/m4module.h (m4_pop_wrapup): New parameter.
4430 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
4432 * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
4433 * m4/symtab.c (m4_symbol_value_groks_macro): New method.
4434 * src/main.c (main): Adjust caller.
4435 * tests/options.at (--debugmode): Test more output from -dV.
4437 2006-10-12 Eric Blake <ebb9@byu.net>
4439 * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
4441 * m4/m4private.h (m4__next_token_is_open): New prototype.
4442 * m4/m4module.h (m4_push_single): Delete; push_string is an
4443 adequate interface, and removing support for this simplifies the
4445 (m4_push_wrapup): New parameter.
4446 (m4_is_syntax): Delete; m4_has_syntax is sufficient.
4447 (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
4448 start-quote and start-comment exclusive from other syntax
4450 * m4/syntax.c: Likewise.
4451 * m4/input.c (input_funcs): Make polymorphic without requiring
4452 clients to know whether they are located at isp. All users
4454 (file_names): New variable.
4455 (m4_input_init): Initialize it.
4456 (m4_push_file): Use it.
4457 (m4_input_exit): Free it after use.
4458 (m4__next_token): Simplify slightly.
4459 (m4__peek_token): Rename and simplify...
4460 (m4__next_token_is_open): ... to this. In particular, this
4461 allows us to avoid a double ungetc, which POSIX doesn't
4463 (struct m4_input_block, m4_push_single, single_peek, single_read):
4464 Remove support for single characters, as the input engine now
4465 guarantees we don't need it.
4466 (file_unget, string_unget, m4_input_print, unget_input):
4467 Strengthen assertions.
4468 (file_init_funcs, file_read_init): New for file reading.
4469 (string_init_funcs, string_read_init): New for wrapped text.
4470 (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
4471 Support wrapped text with locations.
4472 (m4_skip_line): Support dnl across include file boundary.
4473 (peek_char): Don't pop input when peeking.
4474 (file_peek): Peek can be called at the end of the file.
4475 (string_read): Don't read beyond string bounds.
4476 * m4/macro.c (expand_token, collect_arguments): Update callers.
4477 (expand_macro): Report errors at location of open parenthesis.
4478 (expand_token, expand_argument, process_macro): Avoid negative
4479 array dereferences with m4_has_syntax.
4480 * m4/utility.c (skip_space): Likewise.
4481 * modules/m4.c (m4wrap): Update caller.
4482 * tests/builtins.at (__file__, __line__, dnl): New tests.
4483 * tests/options.at (--debugmode): Normalize the output.
4484 * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
4485 Remerge recent changes from branch.
4486 (Improved fatal_error): New node from branch.
4488 2006-10-11 Eric Blake <ebb9@byu.net>
4490 * src/main.c (usage, long_options): Add --debugmode as an alias
4491 for --debug, to match macro name.
4492 * tests/options.at (--debugmode): Rename from --debug, and test
4494 (--discard-comments): Augment test.
4495 * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
4498 2006-10-10 Eric Blake <ebb9@byu.net>
4500 Trace improvements: debugmode(c) was always printing the last two
4501 lines paired, combine them; and show non-text expansions.
4502 * m4/macro.c (trace_prepre): Update to show what the macro will
4504 (trace_pre): No need to special-case on debugmode(c).
4505 (trace_post): Likewise. Also, show non-text expansions.
4506 (expand_macro): Update caller. Collecting arguments can change
4507 debug mode, so cache values beforehand.
4508 (trace_format): Remove support for unused %l%S%r, and fix support
4509 for %z to match gcc's attribute((printf)).
4510 (trace_header): Update caller.
4511 * m4/input.c (struct m4_input_block): Rename from input_block.
4512 (struct input_funcs): Add print_func member.
4513 (file_print, builtin_unget, builtin_print, string_print)
4514 (m4_input_print): New functions.
4515 (m4_push_string_finish): Change return type.
4516 (m4_push_file): Fix missing use of close parameter.
4517 * m4/debug.c (m4_debug_decode): Don't clear pending traces.
4518 * m4/m4module.h (m4_input_print): New prototype.
4519 * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
4520 to match behavior change.
4521 * tests/options.at (--debug): Likewise.
4522 * tests/macros.at (Propagation of traceon)
4523 (Propagation of --trace): Likewise.
4524 * tests/others.at (stderr closed, stdout closed, stdin closed):
4526 * doc/m4.texinfo (Forloop): Simplify.
4527 (Trace): Update to changed behavior.
4528 (Debugmode): Document this change.
4529 * src/main.c (usage): Likewise.
4532 2006-10-09 Eric Blake <ebb9@byu.net>
4534 * m4/path.c (m4_include_env_init): Don't alter result of getenv.
4535 Reported by Ralf Wildenhues.
4537 * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
4539 2006-10-07 Eric Blake <ebb9@byu.net>
4541 * m4/m4module.h (m4_set_exit_failure): New prototype.
4542 * m4/utility.c (m4_set_exit_failure): New function.
4543 * modules/m4.c (m4exit): Use it to avoid yet another global
4544 variable export in libm4.
4546 2006-10-06 Eric Blake <ebb9@byu.net>
4548 * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
4550 * tests/others.at (stdout closed): Fix final check.
4552 Replace uses of tmpfile with clean-temp, since tmpfile is
4553 incompatible with closeout.
4554 * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
4556 * tests/others.at (stderr closed): Likewise.
4557 * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
4558 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4560 * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
4561 (m4_tmpfile, cleanup_tmpfile): New functions.
4562 (make_room_for, m4_insert_diversion): Use clean-temp module.
4563 * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
4565 * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
4567 * m4/utility.c (m4_numeric_arg): Merge from branch.
4568 * modules/gnu.c (debuglen): New builtin.
4569 * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
4570 Rename --arglength to --debuglen.
4571 * tests/options.at (--arglength): Rename to --debuglen.
4572 (deprecated options): Augment test.
4573 * doc/m4.texinfo (Invoking m4): Document the name change.
4574 (Debugmode): Rename from Debug Levels.
4575 (Debugfile): Rename from Debug Output.
4576 (Debuglen): New node.
4577 * NEWS: Document these changes.
4579 * modules/m4.c (m4exit): Fix typo. Ensure desired exit status in
4580 case closing a module exits.
4582 * modules/m4.c (m4exit): Merge from branch.
4583 * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
4585 2006-10-05 Eric Blake <ebb9@byu.net>
4587 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4589 * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
4590 * src/main.c (main): Close stdout on exit.
4591 * m4/debug.c (set_debug_file): Check for write failure.
4592 * m4/m4.c (m4_delete): Don't mask write failure.
4593 * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
4594 macros before calling AT_CHECK.
4595 (M4_ONE_MEG_DEFN): New helper macro.
4596 * tests/others.at (stdout full): New test.
4597 (stderr closed, stdin closed, stdout closed): Augment.
4598 * tests/builtins.at (syscmd): New test.
4601 2006-10-04 Eric Blake <ebb9@byu.net>
4603 * tests/builtins.at: Alphabetize tests.
4604 * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
4605 * tests/generate.awk (new_test): Fix underquoting.
4606 * tests/others.at (maketemp): Rename from misc.
4607 (stdin closed, stdout closed, stderr closed): New tests.
4609 2006-10-03 Eric Blake <ebb9@byu.net>
4611 Avoid all global variables in modules, so that --disable-static
4613 * examples/incl.m4: New file, from branch.
4614 * Makefile.am (dist_pkgdata_DATA): Distribute it.
4615 * doc/m4.texinfo (Location): Merge this section from branch.
4616 (Include): Update the test.
4617 * tests/generate.awk (new_test): Allow for VPATH build
4618 pre-processing of expected __program__ output.
4619 * m4/m4module.h (m4_current_diversion, m4_output_current_line):
4620 Avoid global variables.
4621 (m4_context_field_table): Add current_diversion, output_line.
4622 (m4_output_init, m4_make_diversion): Add parameter.
4623 (m4_get_program_name, m4_set_program_name): New accessors.
4624 * m4/m4private.h (m4_get_current_diversion),
4625 (m4_set_current_diversion, m4_get_output_line)
4626 (m4_set_output_line): New accessors.
4627 * m4/utility.c (m4_get_program_name, m4_set_program_name): New
4629 * modules/m4.c (divnum, divert): Adjust callers.
4630 * modules/gnu.c (__program__): Likewise.
4631 * m4/output.c (m4_output_init, m4_make_diversion)
4632 (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
4633 (m4_insert_diversion): Likewise.
4634 * m4/input.c (file_clean, m4_push_file): Likewise.
4635 * src/freeze.c (reload_frozen_state): Likewise.
4636 * src/main.c (main, usage): Likewise.
4638 Partially plug memory leak when unloading gnu module.
4639 * tests/modules.at (unload gnu module): New test.
4640 * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
4641 (m4_regexp_compile): Move static storage to module visibility.
4642 * tests/options.at (--debug): Adjust to new output.
4644 2006-09-29 Eric Blake <ebb9@byu.net>
4646 Even when not the first option, --help can't have side effects.
4647 * tests/options.at (--debugfile): Detect bugs in this area.
4648 * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
4650 * src/main.c (main): Fix it by deferring debugfile change. Also,
4651 defer closing streams until after module tracing is done.
4652 * modules/gnu.c (debugfile): Make message consistent with command
4654 * doc/m4.texinfo (Invoking m4): Touch up the documentation.
4655 * NEWS: Document this fix.
4657 * modules/m4.c (dnl): Include macro name in warning message.
4658 * m4/input.c (m4_skip_line): Add parameter.
4659 * m4/m4module.h (m4_skip_line): Likewise.
4660 * src/main.c (usage): Update wording.
4661 * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
4662 issue of blind macros vs. POSIX is resolved.
4663 (Dnl): Merge another node from branch.
4665 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4667 * m4/system_.h (N_): Define.
4668 * src/main.c (main): Validate numeric arguments.
4669 (size_opt): New function, idea borrowed from coreutils.
4670 * m4/macro.c (expand_macro): -L0 implies no limit.
4671 * doc/m4.texinfo (Invoking m4): Document this change.
4673 * tests/options.at: (--arglength, --nesting-limit)
4674 (--regexp-syntax): New tests of argument validation.
4676 2006-09-28 Eric Blake <ebb9@byu.net>
4678 * tests/options.at: Alphabetize the tests.
4680 2006-09-27 Eric Blake <ebb9@byu.net>
4682 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
4683 another parameter to print module info.
4684 * m4/macro.c (trace_pre): Adjust caller.
4685 * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
4686 * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
4687 * NEWS: Document this.
4689 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4691 * m4/symtab.c (symbol_value_print): Rename to...
4692 (m4_symbol_value_print): ...this, and...
4693 (m4_symbol_print): Update to allow -L length truncation. Now
4694 truncation also affects dumpdef output and builtin names.
4695 * m4/m4private.h (nesting_limit, max_debug_argument_length):
4697 * m4/m4module.h (m4_symbol_print): Add parameter.
4698 (m4_symbol_value_print): New function.
4699 * modules/m4.c (dumpdef): Allow length truncation.
4700 * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
4702 * doc/m4.texinfo (Invoking m4): Document -l better.
4703 (Dumpdef, Debug Levels): Document the effect of -l.
4704 * NEWS: Document this change.
4706 * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
4707 (m4_expand_ranges): Ensure we aren't picking up partial object on
4709 * modules/stdlib.c (setenv): Allow extra arguments.
4710 * modules/time.c (ctime): Avoid side effect in call to
4712 * modules/gnu.c (m4_regexp_substitute): Likewise.
4713 (renamesyms): Avoid extra obstack_init.
4714 * src/freeze.c (reload_frozen_state): Remove debug comment.
4715 (produce_frozen_state): Simplify fprintf to puts where possible.
4716 * modules/modtest.c (modtest_init, modtest_finish): Likewise.
4717 * modules/import.c (import, symbol_fail, modules_fail): Likewise.
4718 * m4/macro.c (trace_flush): Likewise.
4719 * m4/debug.c (m4_debug_message_prefix): Likewise.
4720 * m4/path.c (include_dump): Likewise.
4721 * m4/module.c (module_remove): Likewise.
4722 (install_builtin_table): Simplify malloc and string
4725 2006-09-26 Eric Blake <ebb9@byu.net>
4727 * m4/m4module.h (m4_symbol_print): New prototype.
4728 (M4_DEBUG_TRACE_STACK): New enumerator.
4729 (m4_is_debug_bit): Allow use without requiring m4private.h.
4730 * m4/symtab.c (symbol_value_print, m4_symbol_print): New
4732 * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
4734 (dumpdef): Allow printing pushdef'd stacks.
4735 * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
4736 * src/main.c (usage): Document it.
4737 * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
4740 * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
4742 * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
4743 of lines during make.
4744 (AM_CPPFLAGS): Remove unneeded include path.
4745 (src_m4_CPPFLAGS): Remove redundant include path.
4746 * m4/system_.h Make preprocessor indentation consistent.
4747 (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
4749 (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
4751 (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
4752 (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
4753 (bool, true, false): Don't undefine here; stdbool takes care of
4755 * src/m4.h (includes): Assume config.h, and several standard
4757 (__CYGWIN__, WIN32): Don't define here; let system.h do it.
4758 * m4/m4private.h: Assume config.h.
4759 * m4/output.c: Likewise.
4760 * m4/path.c: Likewise.
4761 * m4/resyntax.c: Likewise.
4762 * m4/utility.c: Likewise.
4763 * modules/gnu.c: Likewise.
4764 * modules/import.c: Likewise.
4765 * modules/load.c: Likewise.
4766 * modules/m4.c: Likewise.
4767 * modules/modtest.c: Likewise.
4768 * modules/mpeval.c: Likewise.
4769 * modules/perl.c: Likewise.
4770 * modules/shadow.c: Likewise.
4771 * modules/stdlib.c: Likewise.
4772 * modules/time.c: Likewise.
4773 * modules/traditional.c: Likewise.
4775 2006-09-21 Eric Blake <ebb9@byu.net>
4777 * doc/m4.texinfo (Invoking m4): Add clarification on option
4778 processing behavior.
4779 * tests/options.at (option grouping): Test this.
4781 Reported by Mikhail Teterin.
4783 * bootstrap: Add --force option, based on idea from coreutils.
4784 * README: Document that ./bootstrap and autoreconf are for
4785 developers, and not lightly done in tarballs.
4787 2006-09-20 Eric Blake <ebb9@byu.net>
4789 * src/main.c (usage, OPTSTRING, main): Rename -e to -i. Make
4790 warnings consistent.
4791 (long_options, HASHSIZE_OPTION): Warn on -H.
4792 * doc/m4.texinfo (Invoking m4): Document this.
4793 * tests/options.at (deprecated options): Update.
4795 Change the default of interactive sessions to match sh.
4796 * src/main.c (usage): Document this.
4797 (enum interactive_choice): New enum.
4798 (main): Use it to defer decision of interactive until after
4799 argument processing.
4800 * doc/m4.texinfo (Invoking m4): Document this.
4801 * NEWS: Likewise, plus add missing mention of -b.
4802 Reported by Stepan Kasal.
4804 2006-09-19 Eric Blake <ebb9@byu.net>
4806 * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
4807 well as --error-output; the goal is to add -o/--output in some
4808 future version with semantics like gcc or autom4te.
4809 * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
4810 (Extensions): Reflect this update.
4811 (Renamesyms): Add another test.
4812 (Defn): Xfail for now, so that `make check' is happy.
4813 * NEWS: Document this change.
4814 * tests/generate.awk: Mark dynamic loading tests as such. Allow
4816 * tests/macros.at (Renamesyms collisions): New test, exposing
4817 renamesyms' coredump.
4818 * tests/options.at (--debugfile, --safer): Update to match
4821 * m4/debug.c (set_debug_file): Fix regression in -o when stdout
4822 and stderr are same file, introduced 2003-07-23.
4823 * tests/options.at (--debugfile): New test, to catch the bug.
4824 (deprecated options): Test --error-output.
4825 * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
4826 Deprecate --error-output, and replace it with --debugfile.
4827 * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
4828 Document this change.
4831 2006-09-18 Eric Blake <ebb9@byu.net>
4833 * modules/load.c (modules): Rename to...
4834 (m4modules): ...this, since it is an English word with 0
4836 * modules/gnu.c (symbols, m4symbols): Likewise.
4837 * doc/m4.texinfo (Listing Modules): Rename to...
4838 (M4modules): ...this.
4839 (Symbols): Rename to...
4840 (M4symbols): ...this.
4841 (Load, Foreach, Trace, Answers): Update to new spellings.
4842 * NEWS: Document this.
4844 * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
4845 such that without arguments, the global trace flag is changed
4846 rather than walking the table of all currently-defined macros.
4847 (set_trace_CB): No longer needed.
4848 * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
4849 (m4_set_symbol_traced): Delete.
4850 (m4_symtab_create): Nuke the nuke parameter.
4851 * m4/m4private.h (m4_get_symbol_value): Delete.
4852 * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
4853 (m4_set_symbol_name_traced): Free undefined entries that are no
4855 (symbol_destroy_CB): Update caller.
4856 * m4/m4.c (m4_create): Update caller.
4857 * src/main.c (main): Likewise.
4858 (usage): Fix typo in last commit.
4859 * doc/m4.texinfo: Minor cleanups throughout.
4860 (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
4861 more nodes from branch.
4862 (Trace): Document new semantics, and how to simulate the old.
4863 * tests/builtins.at (multiquotes): Adjust to new semantics.
4864 * NEWS: Update somewhat.
4866 2006-09-14 Eric Blake <ebb9@byu.net>
4868 Add --safer option, per debian bug 5898.
4869 * src/main.c (usage): Document new option.
4870 (SAFER_OPTION): New enumerator.
4871 (main): Set the option bit.
4872 * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
4874 * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
4875 (m4_get_safer_opt): New accessor.
4876 * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
4877 * modules/m4.c (syscmd, maketemp): Likewise.
4878 * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
4879 (Sysval, Maketemp): Add tests of this.
4880 * tests/options.at (--safer): Likewise.
4882 2006-09-13 Eric Blake <ebb9@byu.net>
4884 * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
4886 Reported by Ralf Wildenhues.
4889 * Makefile.am (check_LTLIBRARIES): Build test libraries in the
4890 tests directory, so we can be sure an installed build is not
4891 picking up uninstalled non-test libraries.
4892 (check-local, installcheck-local): Depend on test libraries.
4893 * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
4894 after file name. Fix quoting. Remove skipping the test, now
4895 that makefile guarantees test modules will exist.
4896 (Freezing modules, modules: shadow, modules: unload)
4897 (modules: trace): Always put test modules in module path.
4898 (modules: importing): Likewise, and rely on AT_CHECK_M4 for
4900 * src/main.c (usage): Document default module search path.
4901 (import_environment, frozen_file_to_read, frozen_file_to_write):
4904 * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
4905 * tests/m4.in: ...not here.
4906 Reported by Ralf Wildenhues.
4908 2006-09-08 Eric Blake <ebb9@byu.net>
4910 * bootstrap: Kill unrelated copy-n-paste code from argument
4911 parsing. Let Makefile generate testsuite.
4912 * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
4914 2006-09-07 Eric Blake <ebb9@byu.net>
4916 * m4/m4module.h (m4_peek_input): No longer export.
4917 (m4_error_at_line, m4_warn_at_line): New prototypes.
4918 (m4_is_symbol_void): New macro.
4919 (m4_push_file): Update prototype.
4920 * m4/m4private.h (m4__peek_token): New prototype.
4921 (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
4922 * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
4923 * src/main.c (main): Allow reading from stdin twice.
4924 * modules/m4.c (include): Adjust to new prototype.
4925 * m4/input.c: General comment cleanup.
4926 (file_peek, file_read, file_unget, push_file): Set end flag on
4927 EOF, so that we don't call getc twice.
4928 (push_file, file_clean): Port fix from branch to avoid closing
4930 (pop_input): Port fix from branch to avoid reading free'd memory
4931 when input ends mid-string.
4932 (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
4933 (string_peek, string_read): Always use unsigned char.
4934 (m4_skip_line): Warn when dnl cut short by EOF.
4935 (peek_input): Rename from m4_peek_input.
4936 (match_input): Update signature, to distinguish between `(' token
4937 and multi-char quote or comment beginning with `('.
4938 (m4_input_exit): Cleanup now done in m4_pop_wrapup.
4939 (m4__peek_token): New function, ported from branch.
4940 (m4__next_token): Update to new token types.
4941 * m4/macro.c (expand_token, expand_argument): Use peek_token.
4942 * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
4943 (Invoking m4): Remerge from branch.
4945 * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
4946 (check-local): and put dependency here.
4947 Reported by Ralf Wildenhues.
4949 2006-09-05 Eric Blake <ebb9@byu.net>
4951 * m4/m4module.h (m4_debug_message): New prototype.
4952 (M4_DEBUG_TRACE_MODULE): New debug bit.
4953 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
4954 (M4_DEBUG_MESSAGE2): Delete these macros.
4955 * m4/debug.c (m4_debug_message): New method.
4956 (m4_debug_decode): Add module tracing as flag `m'.
4957 * m4/input.c (m4_push_file, file_clean): Use new method.
4958 * m4/path.c (m4_path_search): Likewise.
4959 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
4960 * m4/module.c (install_builtin_table, install_macro_table)
4961 (m4__module_open, module_close, module_remove): Promote several
4962 module debug messages outside of DEBUG_MODULES.
4963 (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
4964 DEBUG_MODULES with normal trace output.
4965 * src/main.c (usage): Document new flag.
4966 * doc/m4.texinfo (Debug Levels): Likewise.
4967 * Makefile.am ($(TESTSUITE)): Add missing dependency.
4968 * tests/m4.in: Neutralize platform-dependent module filenames.
4969 * tests/options.at (--debug): Update expected output.
4971 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4973 * doc/m4.texinfo: Fix some typos.
4974 * tests/others.at: Likewise.
4976 2006-09-05 Eric Blake <ebb9@byu.net>
4978 * m4/input.c (lex_debug): Remove dead code that broke compilation
4979 with --enable-debug.
4980 * m4/module.c (install_builtin_table, install_macro_table)
4981 (m4__module_init, m4__module_open, module_close)
4982 (module_remove): Fix compilation when --enable-debug.
4983 * m4/output.c (m4_shipout_text): Likewise.
4984 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
4985 libraries when --enable-debug.
4986 * configure.ac (DYNAMIC_MODULES): New variable, to pass
4987 information to testsuite.
4988 (modules to preload): Determine modules after we know whether
4989 shared libraries are supported.
4990 * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
4992 * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
4993 * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
4994 (modules: shadow, modules: unload, modules: importing)
4995 (modules: trace): Use new macro.
4996 * tests/builtins.at (gmp): Likewise.
4998 * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
5000 (expand_token): Avoid assertion just added to docs.
5001 (expand_macro): Track pending expansions, for when a symbol's
5002 definition changes during argument collection.
5003 (m4_macro_call, process_macro): Operate on symbol value, not
5004 symbol, since symbol may have changed during argument collection.
5005 * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
5006 (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
5007 (m4_get_symbol_value): Add fast macro version.
5008 * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
5009 (m4_macro_call): Adjust prototype.
5010 * m4/module.c (install_builtin_table): Check that flags are valid
5011 when creating builtin.
5012 * m4/symtab.c (m4__symtab_remove_module_references): Use
5013 m4_symbol_value_delete, rather than inlining it.
5014 (m4_symbol_value_copy): Copy placeholder text.
5015 (symbol_popval): Use m4_symbol_value_delete.
5016 (m4_symbol_value_delete): Implementation was missing when NDEBUG.
5017 Handle pending expansions.
5018 * modules/gnu.c (indir): Update to new prototype.
5019 * doc/m4.texinfo: Fix menus to be consistent with section names.
5020 (Defn): Add test that macro tokens flatten to empty string;
5021 triggered an assert before this patch.
5022 (Ifelse): Merge another node.
5023 (Loops): Split into...
5024 (Forloop, Foreach): New nodes; work is still underway on them.
5025 (Answers): Add more info on foreach macro; work is still underway.
5026 (Indir): Add test that indir collects arguments before looking up
5028 * TODO: Update based on this patch.
5030 2006-09-01 Eric Blake <ebb9@byu.net>
5032 * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
5033 * m4/hash.h (m4_free_hash_iterator): New prototype.
5034 * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
5035 ensure we don't do unsafe things while iterating.
5036 (HASH_ITER, ITER_CHAIN): New accessor macros.
5037 (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
5038 (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
5039 (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
5040 (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
5041 to catch unsafe actions.
5042 (m4_free_hash_iterator): New function, to avoid memory leaks, and
5043 when debugging, to track safe actions.
5044 (m4_hash_apply): Avoid memory leak.
5045 * m4/symtab.c (m4_symtab_apply): Likewise.
5046 * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
5047 in manually to src/ for now.
5048 * tests/builtins.at (gmp): Add keyword module.
5049 * tests/modules.at (Freezing modules, modules: shadow)
5050 (modules: unload, modules: importing, modules: trace): Likewise.
5052 2006-08-30 Eric Blake <ebb9@byu.net>
5054 * m4/utility.c (m4_warn): Factor "Warning" out of messages into
5056 (m4_bad_argc, m4_numeric_arg): Update all callers.
5057 * m4/macro.c (m4_macro_call): Likewise.
5058 * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
5059 (Indir, Builtin, Ifdef): More doc merges.
5060 (Loops): Mention that documenting foreach would be nice.
5061 (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
5062 (Include, Eval, Location, M4exit): s/input.m4/stdin/.
5063 * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
5064 (substitute, syncoutput): Update all m4_warn callers.
5065 * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
5066 (traceon, traceoff): Make warning message consistent.
5067 (define, pushdef): Update all m4_warn callers.
5068 * tests/generate.awk: Choose file name so that documentation can
5069 show command-line behavior.
5070 * tests/builtins.at (define): Update to new wording.
5071 * tests/macros.at (pushdef/popdef): Likewise.
5072 * tests/freeze.at (loading format 1): Likewise.
5073 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
5075 * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
5077 (Defn): Add failing test case for mixing text and builtin.
5078 (Renamesyms): Improve wording, and identify core dump that needs
5081 2006-08-29 Eric Blake <ebb9@byu.net>
5083 * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
5084 (Arguments, Pseudo Arguments): More doc merges from the branch.
5085 (Macro expansion): Turn example into test.
5086 (Pseudo Arguments): Add example of avoiding argument.
5087 * modules/m4.c (undefine, popdef): Accept multiple arguments.
5088 (define, pushdef): Warn on non-text macro name.
5089 (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
5090 warning/error messages.
5091 (ifdef): Ignore extra arguments.
5092 * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
5093 (m4__symtab_remove_module_references): Check that there is no leak.
5094 * tests/macros.at (pushdef/popdef): Update to new message.
5095 * tests/builtins.at (define): Likewise.
5096 * tests/freeze.at (loading format 1): Likewise.
5097 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
5099 * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
5100 (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
5101 as accessor function, to avoid compiler warning.
5102 * m4/module.c (m4__module_open): Move declaration of variable to
5103 avoid compiler warning.
5104 * src/main.c (main): Avoid shadowing a global variable.
5105 * src/freeze.c (produce_symbol_dump): Avoid unused variable
5106 warning when NDEBUG.
5107 * tests/options.at (--discard-comments, --import-environment)
5108 (--debug, --prepend-include, --help and --version): Rename tests
5109 to name option tested.
5111 2006-08-28 Eric Blake <ebb9@byu.net>
5113 * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
5114 * m4/module.c (install_builtin_table): ...to here, and add
5115 assertion that blind macros require arguments.
5116 * m4/m4module.h (struct m4_builtin): Document restrictions that
5117 must be met during module loading.
5118 * modules/gnu.c (changeresyntax, changesyntax): These are blind,
5119 so require an argument to avoid triggering assertion.
5120 (debugfile): Tweak error message.
5122 2006-08-25 Eric Blake <ebb9@byu.net>
5124 * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
5125 (M4_BUILTIN_SIDE_EFFECT): New enumerators.
5126 (struct m4_builtin): New member flags replaces groks_macro_args,
5127 blind_if_no_args. min_args and max_args are now 0-based.
5128 Rearrange members to reduce size on platforms where function
5129 pointers are 64 bits but regular pointers are 32.
5130 (m4_bad_argc): Add argument.
5131 * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
5132 * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
5133 effect into account.
5134 * m4/module.c (install_builtin_table): Adjust all users affected
5136 * m4/macro.c (m4_macro_call): Likewise.
5137 * src/freeze.c (reload_frozen_state): Likewise.
5138 * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
5139 * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
5140 * modules/import.c (builtin_functions): Likewise.
5141 * modules/load.c (builtin_functions): Likewise.
5142 * modules/modtest.c (builtin_functions): Likewise.
5143 * modules/mpeval.c (builtin_functions): Likewise.
5144 * modules/perl.c (builtin_functions): Likewise.
5145 * modules/shadow.c (builtin_functions): Likewise.
5146 * modules/stdlib.c (builtin_functions): Likewise.
5147 * modules/time.c (builtin_functions, mktime_functions)
5148 (strftime_functions): Likewise.
5149 * doc/m4.texinfo (Loops): Update test now that shift is blind.
5150 (Macro Arguments): Fix typo in test.
5151 (Patsubst): Fix typo in test.
5152 * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
5153 end of string. Fix return value when ignore_duplicates.
5154 * tests/builtins.at (patsubst): Fix typo in test.
5156 * tests/options.at (debug-flags): Update to reflect new message.
5157 (deprecated options, prepend-include, help and version): New
5159 * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
5160 test omits an input file name.
5161 * src/main.c (long_options, main): Add -B/--prepend-include.
5162 (usage): Document it.
5163 (main): `m4 --help --version' now displays help, not version.
5164 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
5165 dirname filenamecat.
5166 * m4/m4module.h (m4_add_include_directory): Add parameter.
5167 * m4/m4private.h (m4__include_init): New prototype.
5168 * m4/m4.c (m4_create): Put `.' on path before options are
5170 * m4/path.c (includes): Assume C89. Use gnulib for file name
5172 (m4__include_init): New function.
5173 (search_path_add): Allow prepending.
5174 (m4_add_include_directory, search_path_env_init): Adjust callers.
5175 (m4_path_search): Relative names now invoke path search, since
5176 `.' might not be first.
5177 * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
5179 2006-08-25 Bruno Haible <bruno@clisp.org> (tiny change)
5180 and Eric Blake <ebb9@byu.net>
5182 * bootstrap: Run autopoint before gnulib-tool, since autopoint
5183 0.15 installs macros obsoleted by current gnulib.
5185 2006-08-25 Eric Blake <ebb9@byu.net>
5187 * doc/m4.texinfo (Macro Arguments): Another section merged;
5188 testsuite failures now exposed.
5190 2006-08-23 Eric Blake <ebb9@byu.net>
5192 * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
5193 (Input processing): More doc merges from the branch.
5194 (Regular expression syntax): Add introductory text.
5195 (Inhibiting Invocation): More doc merges from the branch.
5196 (Other tokens): Reorder after comments.
5197 * tests/generate.awk: Allow passing options to doc examples.
5199 2006-08-22 Eric Blake <ebb9@byu.net>
5201 * tests/options.at (debug-flags): New test.
5202 * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
5203 not negative, to distinguish failure in m4_debug_decode.
5204 (m4_debug_decode): Add new parameter.
5205 * modules/gnu.c (regexp): Slight cleanup.
5206 (renamesyms): Ignore excess arguments.
5207 (syncoutput): Make case-insensitive, warn on bad argument.
5208 (debugmode): Factor -+ handling out to...
5209 * m4/debug.c (m4_debug_decode): ...here.
5210 (m4_debug_message_prefix): Fix spacing.
5211 * src/main.c (main): Let -d option adjust flags.
5212 * m4/input.c (file_clean): Avoid printing empty file name.
5213 * doc/m4.texinfo (Syncoutput): Document new range of input.
5214 (Invoking m4): Document use of multiple -d flags.
5216 Start porting various fixes from the branch that use gnulib.
5217 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
5218 binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
5219 regexprops-generic stdlib-safer unlocked-io.
5220 * m4/debug.c (m4_debug_set_output): Close debug file on exec.
5221 * m4/path.c (m4_path_search): Close input file on exec, reject
5222 empty file name, fix parameter naming.
5223 * m4/output.c (make_room_for): Close diversion file on exec.
5224 (includes): Assume C89 headers.
5225 (tmpfile): For now, we don't want tmpfile-safer, because we want
5227 * m4/m4private.h (includes): Use various gnulib headers.
5228 * doc/regexprops-generic.texi: Use gnulib's copy.
5230 * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
5231 * AUTHORS: Add copyright.
5232 * ChangeLog: Likewise.
5233 * README: Likewise. Require automake 1.9b or later.
5234 * HACKING: New file.
5235 * README-alpha: Add copyright.
5236 * THANKS: Likewise. Update.
5237 * doc/STYLE: Add copyright, and tweak for changed directories.
5238 * modules/README: Add copyright, and tweak for libtool version.
5239 * examples/COPYING: New file.
5240 * examples/WWW/COPYING: Likewise.
5241 * examples/WWW/m4lib/COPYING: Likewise.
5242 * modules/shadow.m4: Add copyright.
5243 * modules/perl.m4: Likewise.
5244 * modules/modtest.m4: Likewise.
5245 * modules/stdlib.m4: Likewise.
5246 * modules/time.m4: Likewise.
5247 * modules/time2.m4: Likewise.
5248 * po/Makevars: Likewise.
5249 * tests/iso8859.m4: Likewise.
5250 * tests/m4.in: Likewise.
5251 * NEWS: Add (C) to copyright.
5253 * m4/system_.h: Likewise.
5254 * tests/atlocal.in: Likewise.
5255 * tests/builtins.at: Likewise.
5256 * tests/freeze.at: Likewise.
5257 * tests/generate.awk: Likewise.
5258 * tests/macros.at: Likewise.
5259 * tests/modules.at: Likewise.
5260 * tests/options.at: Likewise.
5261 * tests/others.at: Likewise.
5262 * tests/testsuite.at: Likewise.
5263 * m4/utility.c: Spell out copyright years.
5264 * src/main.c: Likewise.
5266 * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
5268 2006-08-21 Eric Blake <ebb9@byu.net>
5270 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
5271 * modules/gnu.c (esyscmd): Use -1 for failure. Set sysval to 0
5272 when no arguments are given, but without losing warning about 0
5274 * modules/m4.c (syscmd): Likewise.
5275 (includes): Assume C89.
5276 (m4_sysval): Make static.
5277 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
5278 (sysval): Port calculation from branch.
5280 2006-08-20 Eric Blake <ebb9@byu.net>
5282 * m4/macro.c (expand_macro): Move argument check...
5283 (m4_macro_call): ...to here, so indir will warn.
5284 * modules/gnu.c (__program__): New macro, ported from branch.
5285 (builtin): Perform argument check.
5286 (changesyntax): Avoid out-of-bounds read.
5288 * modules/gnu.c (includes): Assume stdlib.h, errno.
5289 (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
5290 (substitute): Add caller parameter, avoid out-of-bounds memory
5292 (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
5295 2006-08-16 Eric Blake <ebb9@byu.net>
5297 * po/POTFILES.in: Add more files that contain translatable
5299 * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
5300 information to translators.
5301 (USE_MSGCTXT): New var for gettext 0.15.
5302 * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
5303 debug/trace messages in lower case.
5304 * m4/macro.c (expand_argument): Likewise.
5305 * m4/path.c (m4_path_search): Likewise.
5306 * src/main.c (main): Likewise.
5308 2006-08-14 Eric Blake <ebb9@byu.net>
5310 * src/main.c (usage): Document --import-environment.
5311 * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
5313 2006-08-11 Eric Blake <ebb9@byu.net>
5315 * bootstrap (func_get_translations): Only remove files when doing
5317 (func_update_po): Avoid CDPATH problems.
5319 2006-08-10 Eric Blake <ebb9@byu.net>
5321 * bootstrap (func_get_translations): New function.
5322 (func_update_po): Borrow ideas from tar to correctly pull in
5323 translations from newer location.
5325 2006-08-09 Eric Blake <ebb9@byu.net>
5327 * bootstrap: Recent gnulib no longer has jm_* macros to worry
5329 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
5331 * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
5332 (m4_error, m4_warn): ... these new prototypes.
5333 (m4_current_file, m4_current_line): Move into context, rather
5334 than leaving as globals.
5335 (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
5336 (m4_undivert_all, m4_input_init): Now takes context.
5337 * m4/utility.c (m4_error, m4_warn): New functions.
5338 * m4/m4private.h: Assume errno exists.
5339 (struct m4): Move warning_status to a bit flag,
5340 and add exit_status. Adjust accessors accordingly.
5341 * src/main.c (print_program_name_CB): No longer needed.
5342 (main): Use new m4_get_fatal_warnings_opt.
5343 * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
5344 instead of issuing "INTERNAL ERROR". Pass context when needed,
5345 and use new accessors.
5346 * m4/input.c: Likewise.
5347 * m4/macro.c: Likewise.
5348 * m4/output.c: Likewise.
5349 * m4/utility.c: Likewise.
5350 * modules/evalparse.c: Likewise.
5351 * modules/gnu.c: Likewise.
5352 * modules/load.c: Likewise.
5353 * modules/m4.c: Likewise.
5354 * modules/mpeval.c: Likewise.
5355 * src/freeze.c: Likewise.
5356 * src/main.c: Likewise.
5357 * tests/macros.at: Adjust to new message format.
5358 * tests/builtins.at: Likewise.
5359 * tests/freeze.at: Likewise.
5360 * tests/modules.at: Likewise.
5361 * doc/m4.texinfo: Likewise.
5363 * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
5366 2006-08-03 Eric Blake <ebb9@byu.net>
5368 * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
5369 gracefully handle ENOSYS.
5373 2006-07-28 Eric Blake <ebb9@byu.net>
5375 * src/freeze.c (reload_frozen_state): Copy string when creating
5376 placeholder, to avoid memory corruption.
5377 * m4/symtab.c (symbol_popval): Avoid memory leak.
5378 (m4_symbol_rename): Avoid shadowing rename function.
5379 (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
5380 * tests/freeze.at (reloading unknown builtin): Add test.
5381 * tests/generate.awk: Capture m4.texinfo line number in
5382 testsuite.log, not just generated.at.
5384 Port idea from branch that a frozen file can request an unknown
5385 builtin without producing a warning unless the builtin is
5387 * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
5388 (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
5389 (m4_set_symbol_value_placeholder): New accessors.
5390 * m4/m4module.h (m4_is_symbol_placeholder),
5391 (m4_get_symbol_value_placeholder),
5392 (m4_set_symbol_value_placeholder),
5393 (m4_get_symbol_placeholder): Likewise.
5394 * m4/symtab.c (m4_is_symbol_value_placeholder),
5395 (m4_get_symbol_value_placeholder),
5396 (m4_set_symbol_value_placeholder): Likewise.
5397 (dump_symbol_CB): Handle new symbol type.
5398 * m4/macro.c (trace_pre): Likewise.
5399 (m4_macro_call): Warn when invoking a placeholder.
5400 * modules/m4.c (dumpdef): Handle dumping a placeholder.
5401 (defn): Warn when referencing a placeholder.
5402 * src/freeze.c (dump_symbol_CB): Ignore placeholder when
5404 (reload_frozen_state): When reloading unknown builtin, install a
5405 placeholder instead of warning.
5406 * tests/freeze.at (loading format 1): Allow warning when
5407 popdef'ing undefined function.
5409 2006-07-27 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
5411 * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
5412 function. Shift by 7, not 3, for consistency with
5413 gnulib/lib/hash.c. Don't assume hash word is 32 bits.
5415 2006-07-27 Eric Blake <ebb9@byu.net>
5417 * src/main.c (usage): Update to match branch.
5418 (main): Update --version info to distinguish between program name
5419 `m4' and package name `GNU M4'.
5420 (AUTHORS): Translate René Seindal's name.
5421 * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
5422 * Makefile.am (doc/m4.1): Update to match branch.
5423 * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
5426 * m4/system_.h (EXIT_MISMATCH): Define.
5427 * src/main.c (main): Don't clear syntax table for version 1.
5428 (usage): Document exit status.
5429 * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
5430 branch, and require V directive to appear first in file. Fix
5431 broken logic for detecting F and T in version 1 files.
5433 2006-07-22 Eric Blake <ebb9@byu.net>
5435 * src/main.c (stackovf_handler): Document the problems in our
5437 * src/stackovf.c: Forward port changes in branch to use POSIX
5438 sa_sigaction when available.
5439 (process_sigsegv): Avoid buffer overrun when error string is
5440 translated, although the fact that we translate in a signal
5441 handler is still a bug.
5442 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
5443 from branch to modernize checks.
5445 * modules/format.c (format): Avoid compiler warning that str may
5446 be used uninitialized.
5448 * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
5450 (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
5451 (DEBUG_MACRO): Remove unused macro.
5452 * src/stackovf.c: Avoid compiler warnings.
5453 * m4/input.c: Likewise.
5454 * m4/module.c: Likewise.
5455 * m4/output.c: Likewise.
5456 * m4/path.c: Likewise.
5457 * m4/symtab.c: Likewise.
5458 * m4/syntax.c: Likewise.
5460 2006-07-20 Eric Blake <ebb9@byu.net>
5462 * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
5463 Regenerate to explicitly ask for --assume-autoconf=2.60.
5465 2006-07-19 Eric Blake <ebb9@byu.net>
5467 * po/ChangeLog: Merge into main ChangeLog, then delete file.
5470 * doc/m4.texinfo (copying): Relax restriction on front-cover and
5473 2006-07-17 Eric Blake <ebb9@byu.net>
5475 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
5478 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
5480 * modules/format.c (includes): Use xvasprintf.h.
5481 (format): Make static. Avoid buffer overflow, that can lead to
5482 arbitrary code execution exploit. Only pass unsigned char to
5483 is*(). Support F, g, and G specifiers.
5484 * doc/m4.texinfo (Format): Expose buffer overrun bug. Document
5487 2006-07-17 Gary V. Vaughan <gary@gnu.org>
5489 Ensure M4 compiles correctly with -DDEBUG, and use a single
5490 consistent definition of various /DEBUG_[A-Z]+/ symbols:
5492 * m4/input.c: Have commented out out DEBUG_INPUT only by default.
5493 (m4_print_token): Use m4_get_symbol_value_text and
5494 m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
5495 and VALUE_FUNC respectively.
5496 (m4__next_token): Use m4_print_token call instead of obsolescent
5498 * m4/module.c: Have commented out out DEBUG_MODULE only by default.
5499 * m4/output.c: Similarly for DEBUG_OUTPUT.
5500 * m4/path.c: Similarly for DEBUG_INCL.
5501 * m4/symtax.c: Similarly for DEBUG_SYM.
5502 * m4/syntax.c: Similarly for DEBUG_SYNTAX.
5503 * src/stackovf.c: Similarly for DEBUG_STACKOVF.
5504 * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
5505 preprocessor macros defined with -DDEBUG compiles.
5507 2006-07-17 Gary V. Vaughan <gary@gnu.org> (tiny change)
5509 * bootstrap: Correct typo in --download-po argument parsing.
5511 2006-07-15 Eric Blake <ebb9@byu.net>
5513 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
5515 * tests/generate.awk (normalize): Recognize @tabchar.
5516 * doc/m4.texinfo (Top): Start merging from branch. Remove tabs.
5517 Fix menus. Upgrade FDL license from 1.1 to 1.2. Fix overfull
5519 (Index macro, Shell commands, Incompatiblities): Rename nodes
5520 from Index, UNIX commands, Other incompat.
5521 (Platform macros, Using frozen files, Frozen file format 1)
5522 (Frozen file format 2, Copying This Manual, Indices): New nodes.
5523 * Makefile.am (EXTRA_DIST): Distribute gendocs.
5524 (MAINTAINERCLEANFILES): Clean up files from gnulib.
5525 (doc_m4_TEXINFOS): Depend on fdl.texi.
5526 (web-manual): New maintainer target.
5528 2006-07-14 Gary V. Vaughan <gary@gnu.org>
5530 * doc/m4.texinfo (Modules): RMS asked me for an explanation of
5531 the modular architecture of M4. The result is paraphrased here
5532 for the benefit of future readers of the manual.
5534 2006-07-14 Gary V. Vaughan <gary@gnu.org> (tiny change)
5536 * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
5538 2006-07-14 Eric Blake <ebb9@byu.net>
5540 * src/main.c (main): Avoid compiler warning.
5541 * modules/gnu.c (renamesyms): Remove unused variable.
5543 2006-07-14 Gary V. Vaughan <gary@gnu.org>
5545 * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
5546 (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
5547 new functions for managing regexp syntax options.
5548 * m4/m4private.h (m4): Add regexp_syntax field.
5549 * m4/resyntax.c: New file implements the above.
5550 * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
5551 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
5552 (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
5553 (m4_patsubst_do, m4_renamesyms_do): Removed.
5554 (builtin_changeresyntax): New builtin to change regular expression
5556 (m4_resyntax_encode_safe): Factor out diagnostics code.
5557 * src/freeze.c (produce_resyntax_dump): New function to dump
5558 default regexp syntax specifier to frozen file.
5559 (reload_frozen_state): Updated to action 'R' directive.
5560 * src/main.c (usage): Describe new -r option.
5561 (long_options, OPTSTRING): Declare it.
5562 (main): Encode and store cli regexp syntax option argument.
5563 * tests/freeze.at (regexp syntax): New test that regexp syntax
5565 * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
5566 * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
5567 (Epatsubst and Patsubst): Renamed to...
5568 (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
5569 documentation and added new examples.
5570 (Changeresyntax): New section describing changeresyntax builtin,
5571 and regexp syntax names.
5572 (Regular expression syntax): New section describing differences
5573 between various regular expression syntaxes.
5574 (Frozen files): Document 'R' directive.
5577 2006-07-13 Gary V. Vaughan <gary@gnu.org>
5579 * bootstrap: Enhanced to work more like our other scripts:
5580 Add a copyright statement; support --version and --help; accept a
5581 --download-po option with argument as a substitute for DOWNLOAD_PO
5584 2006-07-11 Eric Blake <ebb9@byu.net>
5586 * Makefile.am (doc/m4.1): Port patch from branch that avoids
5588 * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
5591 2006-07-10 Gary V. Vaughan <gary@gnu.org> (tiny change)
5593 * tests/builtin.at (patsubst, regexp): Adjust these tests, now
5594 that `\0' is no longer accepted.
5596 * src/main.c (usage): Alphabetize options within their sections.
5598 * modules/gnu.c (m4_regexp_search, regsub, substitute)
5599 (esyscmd): Improve comments.
5601 * modules/gnu.c (substitute): Remove old warning for \0.
5602 (substitute_warned): No longer required. Removed.
5604 * modules/gnu.c: Put macro definitions into alphabetical order.
5606 2006-07-07 Eric Blake <ebb9@byu.net>
5608 * tests/freeze.at (loading format 1): New file, with new test.
5609 * tests/testsuite.at: Include it.
5610 * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
5611 * tests/modules.at (Freezing modules): Likewise.
5613 * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
5614 (AC_CHECK_HEADERS): Assume signal.h.
5615 (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
5616 (AC_CHECK_FUNCS_ONCE): Likewise.
5617 * src/m4.h (includes): Assume signal.h.
5619 2006-07-05 Eric Blake <ebb9@byu.net>
5621 Fix all testsuite failures on cygwin.
5622 * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
5623 branch-1_4. Solves testsuite failure when uninstalled m4 is
5624 shadowed by redefinition of PATH in libtool wrapper.
5625 * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
5626 contains the -no-undefined required by cygwin.
5627 (TESTS_ENVIRONMENT): Export abs_top_builddir.
5628 * tests/others.at (misc): Port to platforms where /etc/passwd
5629 does not exist or does not contain user named root.
5630 * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
5632 * tests/builtins.at (define, divert): Avoid overquoting.
5633 * tests/generate.awk (new_group): Likewise.
5635 2006-07-05 Gary V. Vaughan <gary@gnu.org>
5637 The regs_allocated field in a struct re_pattern_buffer refers
5638 to the state of a particular re_registers struct when used in
5639 successive matches using the same compiled pattern. Avoid a
5640 SEGV in `renamesyms' resulting from using a new re_registers
5641 with an existing re_pattern_buffer:
5643 * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
5644 pattern buffer and registers.
5645 (m4_regexp_search): New function to call re_regexp_search with
5646 correctly matched pattern buffer and register instantiations.
5647 (m4_regexp_compile): Return an m4_pattern_buffer. Adust all
5650 2006-07-04 Gary V. Vaughan <gary@gnu.org>
5652 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
5653 changes to gnulib getopt.m4 since last build.
5654 * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
5655 if the system getopt fails M4_GETOPT tests.
5657 2006-06-22 Eric Blake <ebb9@byu.net>
5659 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
5660 Reported by Bruno Haible.
5662 2006-06-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5664 * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
5666 2006-06-19 Eric Blake <ebb9@byu.net>
5670 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5672 * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
5673 (clean-local): Split into and depend upon...
5674 (clean-local-tests, clean-local-src): ...these two. The latter
5675 removes the libtool object directory below `src', to work around
5676 a buglet in Automake, failing to list it.
5677 (EXTRA_DIST): Distribute modules/perl.c.
5679 2006-06-19 Eric Blake <ebb9@byu.net>
5681 * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
5682 right side of dependency; VPATH does that.
5683 (stamp-vcl): Update to use libtool's algorithm.
5684 (EXTRA_DIST): Distribute stamp-vcl.
5685 Reported by Ralf Wildenhues.
5686 (TESTSUITE): Revert earlier change that used absolute path, as
5687 that broke 'make dist' in VPATH. Stick with $(srcdir) instead.
5688 (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
5689 (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
5690 atlocal takes care of it instead.
5691 (check-local, installcheck-local, clean-local): Inline absolute
5692 path to testsuite here, rather than relative path to testsuite
5695 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5697 * m4/m4private.h (DELETE): Cast away const here...
5698 * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
5699 * src/freeze.c (reload_frozen_state): Avoid uninitialized
5702 2006-06-19 Eric Blake <ebb9@byu.net>
5704 * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
5705 .info pages are built.
5706 Reported by Ralf Wildenhues.
5707 (EXTRA_DIST): Inline definition of testsuite, so that make dist
5710 2006-06-16 Eric Blake <ebb9@byu.net>
5712 Follow recommendations from autoconf manual for autotest.
5713 * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
5714 turn it into an absolute path until autotest provides an option
5715 that allows us to avoid changing directories. Properly quote
5717 (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
5718 (check-recursive): Delete unused target.
5719 ($(TESTSUITE)): Atomically update testsuite.
5720 (CD_TESTDIR): Simplify.
5721 (m4__cd): Delete unused macro.
5722 (check-local): Let TESTSUITEFLAGS influence the run.
5723 (installcheck-local): Let TESTSUITEFLAGS override
5724 AUTOTEST_PATH. Add dependencies.
5725 (clean-local): Clean up.
5726 (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
5727 * README: Document how to use the testsuite.
5729 2006-06-15 Eric Blake <ebb9@byu.net>
5731 * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
5733 * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
5734 clashes with m4sugar.
5735 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
5736 * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
5737 * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
5738 * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
5739 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
5740 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
5741 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
5742 * configure.ac: Likewise.
5743 (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
5744 * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
5746 * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
5748 Reduce compiler warnings. Inside GMP, mpq_t is an array type, so
5749 const mpq_t is not assignable from plain mpq_t. Avoid
5750 type-punning warnings caused trying to mix these types.
5751 * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
5752 (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
5753 * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
5754 (mult_term, exp_term): Remove type-punning casts.
5755 (numb_pow): Remove const qualifier.
5756 * src/freeze.c (reload_frozen_state): Fix typo in messages.
5757 Fix variables that can be used uninitialized, which fixes
5758 security hole where malicious frozen file can execute arbitrary
5761 2006-06-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5763 * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
5765 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5766 and Eric Blake <ebb9@byu.net>
5768 Allow `make dist' to work again.
5769 * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
5770 (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
5771 (cvs-dist): Fix typo.
5772 * NEWS: Match current version number.
5774 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5776 * Makefile.am (AM_CPPFLAGS): Add $(LTDLINCL), so the right
5779 * bootstrap: Do not run libtoolize manually, this is done
5780 correctly by autoreconf. Invoke autoreconf with --no-recursive
5781 to avoid unnecessary rerunning of autotools for libltdl.
5783 2006-06-13 Eric Blake <ebb9@byu.net>
5787 2006-06-12 Eric Blake <ebb9@byu.net>
5789 * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
5791 * src/m4.h: Don't declare mktemp.
5792 * m4/input.c (m4__next_token): Avoid bzero.
5793 * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
5794 * Makefile.am (doc/m4.1): Depend on installed help2man, rather
5795 than distributing outdated helptoman.pl.
5796 * doc/helptoman.pl: Delete.
5798 2006-06-10 Eric Blake <ebb9@byu.net>
5800 * README (Patches): Document the current dependence on CVS
5801 builds of autotools.
5802 * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
5803 * configure.ac: Use consistent quoting throughout.
5804 (AC_PREREQ): Bump to 2.59d.
5805 (AC_INIT): Package name begins with uppercase.
5806 (AC_ARG_WITH): Use AS_HELP_STRING.
5807 (AM_INIT_AUTOMAKE): Enable gnits mode.
5808 (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
5809 (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
5810 (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
5811 done by gnulib or automake, or which autoconf has declared
5813 * m4/m4private.h (Includes): Assume C89 or better, and use errno
5815 * m4/output.c (Includes): Likewise.
5816 * modules/gnu.c (Includes): Likewise.
5817 * modules/m4.c (Includes): Likewise.
5818 * src/m4.h (Includes): Likewise.
5820 * README-alpha: Update web address.
5821 * README: Likewise. Change encoding to ASCII. Remove old advice
5822 about cygwin. Document bootstrapping dependency.
5823 * AUTHORS: Update from branch-1_4.
5824 * THANKS: Likewise. Change encoding to UTF-8.
5825 * BACKLOG: Delete. This file is too old and unmaintained to be
5827 * ChangeLog: Change encoding to UTF-8.
5829 Avoid compiler warnings.
5830 * m4/macro.c (trace_format): Don't mark this as a printf format,
5831 since we don't accept the same set of modifiers as printf. It
5832 would be nice if gcc let us specify a custom format archetype.
5833 * src/main.c (main): Cast away const.
5835 2006-06-10 Andreas Schwab <schwab@suse.de> (tiny change)
5836 Eric Blake <ebb9@byu.net>
5838 * modules/time.c (ctime): Pass correctly typed variable to
5841 (localtime): Likewise.
5842 (strftime): Likewise.
5843 * m4/utility.c (m4_numeric_arg): For now, document arbitrary
5844 limit inherent in this interface.
5846 2006-05-08 Bruno Haible <bruno@clisp.org> (tiny change)
5848 * modules/m4.c (WEXITSTATUS): Provide fallback definition.
5849 (sysval): Use WEXITSTATUS.
5850 * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
5851 big-endian and little-endian wait status definitions.
5853 2006-05-06 Eric Blake <ebb9@byu.net>
5855 * po/Makevars (MSGID_BUGS_ADDRESS): Add.
5856 * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
5859 2006-05-06 Eric Blake <ebb9@byu.net>
5861 * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
5862 subdirectory to use.
5863 (support for -pipe): Move after LT_INIT, since it relies on
5866 2006-05-05 Eric Blake <ebb9@byu.net>
5868 * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
5872 2006-05-05 Bruno Haible <bruno@clisp.org>
5873 and Eric Blake <ebb9@byu.net>
5875 * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
5876 * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
5878 * bootstrap: Update usage of gnulib-tool.
5880 2006-05-04 Eric Blake <ebb9@byu.net>
5882 * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
5885 2005-12-05 Gary V. Vaughan <gary@gnu.org>
5887 * bootstrap (func_update_po): Synch with CVS GNU tar. wget 1.9.x
5888 and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
5889 Reported by Eric Blake <ebb9@byu.net>
5891 2005-12-04 Gary V. Vaughan <gary@gnu.org>
5893 * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
5894 http caching as -C is no longer supported by wget 1.10.x.
5895 Reported by Eric Blake <ebb9@byu.net>
5897 2005-10-20 Gary V. Vaughan <gary@gnu.org>
5899 * m4/module.c (caller_id): To match libtool-2.0 interface, changed
5901 (iface_id): ...an lt_dlinterface_id type.
5902 (m4__module_find): New abstraction for lt_dlhandle_fetch. Use
5903 throughout, instead of calling obsolete lt_dlhandle_find directly.
5904 (m4__module_next): Use multiloader-safe lt_dlhandle_iterate. Use
5905 throughout, instead of calling obsolete lt_dlhandle_next.
5906 * m4/m4private.h (m4__module_find): Declare it.
5907 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
5908 Use m4__module_next instead of obsolete lt_dlhandle_next.
5910 2005-10-20 Gary V. Vaughan <gary@gnu.org>
5912 * bootstrap (func_update_po): Update pofiles directly from the
5913 translation project.
5914 * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
5915 po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
5916 these files under source control anymore.
5917 Suggested by Eric Blake <ebb9@byu.net>
5919 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
5921 * ltdl/m4/m4-gnulib.m4: Update FSF contact address. Somehow this
5922 file escaped the address updates on 2005-05-01.
5924 2005-07-07 Gary V. Vaughan <gary@gnu.org>
5926 * bootstrap: Allow user overriding of gnulib-tool location, and
5927 correctly determine module source directories whether gnulib-tool
5928 is given as a relative or absolute path, or is found by searching
5930 Reported by Eric Blake <ebb9@byu.net>
5932 2005-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5934 * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
5935 and $RM are defined for various versions of
5936 AC_LIBTOOL_COMPILER_OPTION.
5938 * bootstrap (AUTORECONF): New variable to allow user overriding of
5941 2005-07-07 Gary V. Vaughan <gary@gnu.org>
5943 * doc/m4.texinfo (History): Add better notes on the ancestory of
5944 GNU m4, and other historical interest.
5946 2005-05-08 Gary V. Vaughan <gary@gnu.org>
5948 * m4/symtab.c (m4_symbol_rename): New function that performs a low
5949 level symbol rename.
5950 * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
5951 * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
5952 (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
5954 (erenamesyms, renamesyms): ...builtins that use these to implement
5955 macro renaming by regular expression.
5956 * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
5957 * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
5958 to stop the new generated tests from choking.
5960 2005-05-07 Gary V. Vaughan <gary@gnu.org>
5962 Since most of the build is handled from a single Makefile.am now,
5963 we can teach make about the dependencies between the m4 binary and
5964 the preopened modules it is built against:
5966 * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
5968 * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
5969 of the preopened modules have changed.
5971 2005-05-07 Gary V. Vaughan <gary@gnu.org>
5973 * configure.ac (gl_MODULES): Add mkstemp for machines that don't
5974 have a native implementation.
5976 2005-05-06 Gary V. Vaughan <gary@gnu.org>
5978 * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed. These are
5979 handled already by gnu/exit.h.
5981 * configure.ac (gl_MODULES): Add assert to support a
5982 --disable-assert configure time option for NDEBUG setting.
5984 * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
5985 * bootstrap (src_modules): Add version-etc-fsf.
5986 * src/main.c (version_etc_copyright): Removed.
5988 * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
5990 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5992 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
5994 * src/freeze.c (produce_frozen_state): Use \n line-endings even
5995 on Windows, so that the frozen file reader will work.
5996 Reported by Josef T. Burger <bolo@bolo.com>
5998 2005-05-04 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
6000 Forward port of a patch that allowed m4-1.4.2 to compile on
6003 * configure.ac (AC_CHECK_HEADERS): Add signal.h,
6005 * src/m4.h: And include them as appropriate.
6006 * src/main.c, src/stackovf.h: Don't include signal.h literally;
6007 m4.h will include the correct file.
6009 2005-05-04 Gary V. Vaughan <gary@gnu.org>
6011 * m4/m4private.h: Make errno visible for the sources patched
6014 2005-05-04 Paul Eggert <eggert@twinsun.com>
6016 * src/main.c (print_program_name_CB): Preserve errno, since
6017 M4ERROR relies on this.
6018 * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
6019 * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
6020 * m4/path.c (m4_path_search): Don't let "free" trash errno when
6023 * m4/output.c (m4_insert_file): Don't assume errno has a valid
6024 value simply because fread returns zero. This fixes a
6025 portability bug reported by Marion Hakanson in
6026 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
6028 2005-05-04 Santiago Vila <sanvila@debian.org>
6030 * tests/stackovf.test: Use tempfile if available.
6032 2005-05-04 Robert Bihlmeyer <robbe@orcus.priv.at> (tiny change)
6034 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
6035 * m4/output.c (m4_insert_file): Do not mix buffered and
6036 unbuffered I/O, as this breaks on the Hurd.
6038 2005-05-04 Gary V. Vaughan <gary@gnu.org>
6040 Gnulib has changed again. Reimport. Adjust. Rinse. Repeat.
6041 Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
6042 and libtoolize does a better job of ltdl importing now too, so
6043 take advantage of that while updating the tree:
6045 * acm4, config: Moved from here...
6046 * ltdl/m4, ltdl/config: ...to here.
6047 * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
6048 src/Makefile.am, tests/Makefile.am: Removed...
6049 * Makefile.am: ...and migrated to here, with adjustments to
6050 compensate for relative path differences.
6051 * commit: Adjust relative paths.
6052 * configure.ac: Adjust relative paths.
6053 (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
6055 (LT_PREREQ): 2.0 isn't released yet, but will work when it is! In
6056 the meanwhile, CVS HEAD libtool is needed.
6057 (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
6058 stricly new enough, we also need a patch.
6059 (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
6060 (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
6061 (gl_MODULES): Don't list getopt and version-etc, as they don't
6063 * bootstrap: After running gnulib-tool to import the listed
6064 modules, fetch getopt and version-etc into src manually.
6065 (ltdldir): Change to ltdl.
6066 * src/main.c: Adjust for changes in version-etc API.
6067 * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
6068 but works when the getopt module isn't to be included in the lib.
6069 * README: Add note about patching autoconf and automake to
6072 2005-05-02 Matt Kraai <kraai@debian.org> (tiny change)
6074 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
6075 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
6076 empty file rather than to a nonexistent file. This closes a
6077 common security hole.
6078 * modules/m4.c (m4_maketemp): Implement the above, by using
6079 mkstemp rather than mktemp.
6081 2005-05-01 Gary V. Vaughan <gary@gnu.org>
6083 The FSF are moving offices today. Changed their contact address
6084 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
6085 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
6087 2005-03-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
6089 * tests/Makefile (clean-local): Ignore testsuite cleanup
6092 2005-03-11 Per Bothner <per@bothner.com> (tiny change)
6094 * tests/Makefile (clean-local): Only run the testsuite cleanup
6095 if the testsuite has been generated.
6097 2005-02-11 Stepan Kasal <kasal@ucw.cz>
6099 * TODO: slight clarification of the example of qindir usage.
6101 2005-02-08 Gary V. Vaughan <gary@gnu.org>
6103 * TODO: Add qindir requirement, and defn bug.
6104 From Stepan Kasal <kasal@ucw.cz>
6106 2005-02-08 Stepan Kasal <kasal@ucw.cz>
6108 * TODO: Add ``execution stack'', fix a typo.
6109 * doc/m4.texinfo: Typos.
6111 2004-12-24 Eric Blake <ebb9@byu.net>
6113 * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
6114 to the gnu subdirectory.
6115 * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
6116 * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
6117 * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
6118 * m4/system_.h: Likewise, in non-configured includes.
6120 2004-10-14 Noah Misch <noah@cs.caltech.edu>,
6121 Gary V. Vaughan <gary@gnu.org>
6123 * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
6124 Protect definitions from macro expansion under -DNDEBUG by
6125 parenthesising the expanded function names.
6126 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
6127 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
6128 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
6129 (m4_is_syntax_macro_escaped): Similarly protect function
6130 definitions from macro expansion under -DNDEBUG by #undefing the
6131 matching macro names before each definition. Also, move all the
6132 function definitions to the end of the file so that any
6133 invocations in the rest of the file pick up the fast macro
6135 * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
6136 (m4_set_debug_file, m4_set_trace_messages)
6137 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
6138 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
6139 (m4_set_max_debug_arg_length_opt): New fast macro versions of the
6140 option setter functions.
6142 2004-09-23 Gary V. Vaughan <gary@gnu.org>
6144 * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
6147 2004-09-23 Gary V. Vaughan <gary@gnu.org>
6149 * src/main.c: Include gnulib files from the correct directory.
6151 * gnulib/*: Don't store any of the gnulib files in arch, as they
6152 generate spurious changes.
6153 * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
6154 gnulib macros now share our macro directory.
6155 (SUBDIRS): Descend into `gnu' rather than `gnulib'.
6156 * bootstrap: Call gnulib-tool to import from the gnulib tree.
6157 (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
6158 gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
6159 the gettext macros from autopoint that overwrite the gnulib-tool
6160 imported versions. Import sources and Makefile.am into the `gnu'
6161 directory. Changed all callers.
6162 * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
6163 gl_INIT): Call these gnulib-tool macros instead of the hardcoded
6164 for imported modules.
6165 * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
6166 acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
6167 hardcoding the gnulib macros they wrap.
6169 2004-07-15 Gary V. Vaughan <gary@gnu.org>
6171 Latest CVS libtool can preload modules in libraries, including
6172 its own module loaders! Tweak m4 so that it doesn't try to treat
6173 libltdl's module loaders as m4 modules when freezing and on exit:
6175 * gnulib/acm4/*.m4: Don't store these files in arch since they
6176 generate spurious changes.
6177 * bootstrap: Simplify initial libtoolize call, since CVS
6178 libtoolize is smarter these days.
6179 * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
6181 * m4/module.h (m4__module_exit): Missing declaration.
6182 * m4/m4private.h (m4__module_next): New function declaration.
6183 * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
6184 encapsulation. Changed all callers.
6185 (m4__module_interface): New function to verify m4 loadable module
6187 (m4__module_init): Register the interface validator.
6188 (m4__module_exit): Only close my own modules.
6189 * modules/m4.c (unistd.h): Provide missing declaration.
6190 (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
6191 (m4_expand_ranges): More missing declarations.
6192 * modules/modtest.c (export_test): Ditto.
6193 * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
6194 * src/main.c (main): Bump copyright year.
6195 * tests/modules.at: Fix sed syntax error.
6198 2004-06-17 Gary V. Vaughan <gary@gnu.org>
6200 Tweaking to enable compilation with latest CVS libtool and
6201 libltdl. We can't just dump the library files directly into the
6202 m4 directory anymore now that libltdl is built from pieces itself:
6204 * bootstrap: Rewritten to use latest libtoolize sanely, and to
6205 set up libltdl subdirectory.
6206 * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
6207 gnulib subdirectory's config.
6208 (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
6209 (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
6211 (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
6212 configure.ac, so use AC_WITH_LTDL instead.
6213 * Makefile.am (SUBDIRS): Add libltdl.
6214 * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated. gnulib now uses
6216 * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
6217 (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
6218 (libm4_la_LIBADD): Add LIBLTDL.
6219 * m4/ltdl.c, m4/ltdl.h: Removed.
6220 * m4/m4module.h: Include canonical ltdl.h.
6223 2004-06-14 Gary V. Vaughan <gary@gnu.org>
6225 * gnulib/import: Now updates makefile fragments, and configure.ac.
6226 * gnulib/m4/gnulib.am: New file. Generated makefile fragments.
6227 * gnulib/m4/Makefile.am: include it.
6228 * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
6229 gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
6230 gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
6231 gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
6232 gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
6233 * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
6234 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
6235 gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
6236 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
6237 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
6238 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
6239 gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
6240 gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
6242 * gnulib/m4/getopt_int.h: New source file from latest gnulib
6244 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
6245 gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
6246 gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
6247 gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
6248 Updated source files from latest gnulib.
6250 2004-02-29 Gary V. Vaughan <gary@gnu.org>
6252 * config/mailnotify: New file for mailing commit notifications,
6253 imported from cvs-utils.
6254 * commit: Updated from cvs-utils and tweaked for m4.
6256 2003-12-01 Gary V. Vaughan <gary@gnu.org>
6258 * config/mkstamp: Updated from CVS libtool.
6259 * configure.ac: Generate a gnu coding standards compliant version
6260 number, and use it for the banner.
6261 * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
6262 mhen the TIMESTAMP changes in ChangeLog, but the file modification
6263 time doesn't (e.g. in cvs commit). Otherwise dist tarballs will
6264 contain the previous version number.
6265 * src/main.c: Make --version output conform to the GNU standard.
6267 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
6268 * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
6269 m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
6270 shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
6271 time_la_SOURCES): ...so that these are defaulted correctly, and
6272 can be removed from this file.
6273 (AM_LDFLAGS): Add -module...
6274 (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
6275 traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
6276 import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
6277 the individual settings can be removed.
6278 * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
6279 * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
6280 m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
6281 shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
6282 time_la_LIBADD): ...so that these are picked up as a deplib of
6283 libm4 and don't need to be set explicitly.
6285 2003-11-18 Gary V. Vaughan <gary@gnu.org>
6287 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
6288 from the standard build. It is too fragile.
6290 * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
6291 CVS libtool after merging m4 changes across to libtool.
6293 * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
6294 * m4/path.c (search_path_add): Ditto.
6296 2003-11-13 Gary V. Vaughan <gary@gnu.org>
6298 * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
6299 libtool tags we don't use in configure. This reduces the size
6300 of the script from over 1Mb to under 700Kb.
6302 2003-11-13 Gary V. Vaughan <gary@gnu.org>
6304 The import script was not written properly, and the last gnulib
6305 import was incomplete. Fixed that problem, and reimport our
6306 gnulib dependencies, which picks up the address calculation
6307 overflow checks described by Paul below. Also tweak the clients
6308 of the gnulib xalloc module not to use deprecated macros:
6310 * gnulib/import: Recurse through module dependencies rather than
6311 naively descending only one level.
6312 * configure.ac: Add calls to gnulib's strnlen and extension module
6314 * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
6316 * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
6317 gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
6318 gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
6319 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
6321 * gnulib/acm4/libtool.m4: Updated from CVS libtool.
6322 * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
6323 place of `xcalloc (1, S)'.
6324 * m4/m4.c (m4_create): Likewise.
6325 * m4/m4private.h (m4_symbol_value_create): Likewise.
6326 * m4/symtab.c (symtab_fetch): Likewise.
6327 * m4/syntax.c (m4_syntax_create): Likewise.
6328 * src/freeze.c (reload_frozen_state): Likewise.
6329 * m4/path.c (search_path_add): Eliminate use of deprecated NEW
6331 * m4/symtab.c (m4_symtab_create): Likewise.
6333 2003-11-13 Gary V. Vaughan <gary@gnu.org>
6335 * tests/module.at: Comment typo.
6337 2003-10-10 Gary V. Vaughan <gary@gnu.org>
6339 * tests/modules.at (modules: importing): Apply some lateral
6340 thinking, and use AT_CHECK to compare the output of a sed pass
6341 over stderr against the canonical strerror string.
6343 * tests/modules.at (modules: importing): Edit the generated stderr
6344 output to canonicalize strerror output, before a comparison.
6346 2003-10-10 Gary V. Vaughan <gary@gnu.org>
6348 Tru64UNIX perl is sloppy with namespace pollution. This patch is
6349 careful not to trip over the mess:
6351 * modules/perl.c: Some builds of perl install headers that contain
6352 `#define try __builtin_try'. Be sure to undefine that macro
6353 before `m4/hash.h' gets included, which uses the `try' symbol.
6354 * m4/system_.h: Similarly for `bool'. Undefine `bool', `true' and
6355 `false' before including `stdbool.h'.
6356 (DELETE): This symbol is not in m4's namespace, and is in any
6357 case only used internally...
6358 * m4/m4private.h (DELETE): ...so move it to here.
6359 Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
6361 2003-10-08 Paul Eggert <eggert@twinsun.com>
6363 Don't use XMALLOC and XCALLOC. Once we install the
6364 corresponding patch into gnulib, this will fix some
6365 address-calculation overflow bugs on hosts where calloc (A, B)
6366 returns garbage when A*B overflows.
6368 * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
6369 maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
6370 xmalloc, XCALLOC with xcalloc.
6371 * m4/m4.c (m4_create): Likewise.
6372 * m4/m4private.h (m4_symbol_value_create): Likewise.
6373 * m4/output.c (m4_output_init): Likewise.
6374 * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
6375 * m4/syntax.c (remove_syntax_attribute): Likewise.
6376 * src/freeze.c (reload_frozen_state): Likewise.
6377 * src/main.c (main): Likewise.
6379 2003-10-07 Gary V. Vaughan <gary@gnu.org>
6381 * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
6382 gnulib/acm4 directories for aclocal m4 macros.
6383 * gnulib/Makefile.am (EXTRA_DIST): Removed.
6384 (MAINTAINERCLEANFILES): Add Makefile.in.
6385 * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
6387 * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
6388 * gnulib/import: New file. Temporary script for updating gnulib
6389 imported files, until gnulib-tool is working.
6390 * gnulib/config/codeset.m4, gnulib/config/error.m4,
6391 gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
6392 gnulib/config/getopt.m4, gnulib/config/gettext.m4,
6393 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
6394 gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
6395 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
6396 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
6397 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
6398 gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
6399 gnulib/config/nls.m4, gnulib/config/obstack.m4,
6400 gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
6401 gnulib/config/progtest.m4, gnulib/config/realloc.m4,
6402 gnulib/config/regex.m4, gnulib/config/restrict.m4.
6403 gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
6404 gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
6405 gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
6406 gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
6407 gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
6408 gnulib/config/xstrndup.m4: Removed.
6409 * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
6410 gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
6411 gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
6412 gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
6413 gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
6414 gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
6415 gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
6416 gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
6417 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
6418 gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
6419 gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
6420 gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
6421 gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
6422 gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
6423 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
6424 gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
6425 gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
6426 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
6427 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
6428 gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
6429 gnulib/import script.
6430 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
6431 gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
6432 gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
6433 gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
6434 gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
6435 gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
6436 gnulib with gnulib/import script.
6437 * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
6438 guards ready for gnulib-tool to autoupdate on import.
6439 * config/debug.m4, config/gmp.m4, config/m4-error.m4,
6440 config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
6441 config/stackovf.m4: Moved from here...
6442 * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
6443 acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
6444 acm4/stackovf.m4: ...to here, to separate aclocal macros from
6445 configure time helper scripts.
6446 * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
6447 * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
6448 m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
6449 src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
6451 * src/main.c (version_etc_copyright): Only output the current
6453 (version_etc): Call with new variadic API.
6455 2003-09-16 Gary V. Vaughan <gary@gnu.org>
6457 * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
6458 version-etc module from CVS gnulib.
6459 * po/POTFILES.in: Add gnulib/m4/version-etc.c.
6460 * src/Makefile.am: Build it.
6461 * src/main.c: Use it.
6463 * gnulib/m4/exit.h: Import exit module from CVS gnulib.
6464 * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
6465 * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
6468 2003-09-15 Charles Wilson <cygwin@cwilson.fastmail.fm>,
6469 Gary V. Vaughan <gary@gnu.org>
6471 * bootstrap: Separate options.
6472 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
6473 * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
6475 * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
6476 (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
6477 (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
6478 (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
6479 $(LTLIBINTL) for gettext support on cygwin.
6480 * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
6481 have $(LTLIBINTL) from the preloaded module la files.
6482 * README: Remove the warning about using --disable-nls on Windows
6485 2003-09-15 Gary V. Vaughan <gary@gnu.org>
6487 * gnulib/m4/regex.c: s/<regex.h>/"regex.h"/ or else the compiler
6488 picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
6491 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6493 * doc/STYLE: Document the gnulib header naming conventions, and
6495 * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
6496 gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
6497 gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
6499 * gnulib/m4/Makefile.am: Remove the rules to build these headers.
6501 * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
6502 module from CVS gnulib.
6503 * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
6504 (gl_FUNC_STRTOL): In favour of the module macro.
6506 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6508 Replace the getopt code with CVS gnulib getopt. The source files
6509 detect whether they are in a glibc environment and preprocess away
6510 all of the code if there is a system getopt, so we can compile
6511 them into the m4 executable unconditionally:
6513 * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
6514 gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
6515 * configure.ac (gl_GETOPT): Use this instead of homebrew inline
6517 * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
6519 * src/Makefile.am: Adjust.
6520 * src/main.c: Always include our shipped getopt.h.
6521 * po/POTFILES.in: Use new location of getopt.c.
6523 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6525 * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
6526 * config/Makefile.am: Removed. Automake 1.8 distributes the files
6527 in this directory automatically.
6528 * Makefile.am (EXTRA_DIST): Except config/mkstamp.
6530 * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
6532 * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
6534 * modules/Makefile.am (pkglibexecdir): Set it here.
6535 (pkgmodincdir): Renamed to pkgmodincludedir). Changed all clients.
6537 * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
6538 Import regex module from CVS gnulib.
6539 * gnulib/config/restrict.m4: Ditto for dependee module restrict.
6540 * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
6541 do extra substitutions for Makefile.
6542 * configure.ac: Use it.
6543 * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
6544 from regex_.h if necessary.
6545 * m4/system_.h: Include the correct version of regex.h.
6546 * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
6548 * po/POTFILES.in: Use new location of regex.c.
6550 * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
6551 realloc.c: automake distributes these files already.
6553 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6555 Replace the xstrzdup code by importing the xstrndup module from
6556 CVS gnulib, along with its dependencies: strndup and strnlen:
6558 * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
6559 gnulib/config/xstrndup.m4: Import xstrndup module from CVS
6561 * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
6562 gnulib/config/strndup.m4: Ditto wrt strndup.
6563 * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
6565 * gnulib/m4/Makefile.am: Add rules from newly imported modules.
6566 However, contrary to gnulib, we install xstrndup.h.
6567 * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
6568 * gnulib/lib/xstrzdup.c: Delete. This was never a gnulib file, it
6569 is an artifact of the old m4 portability layer.
6570 * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
6571 * m4/system_.h: Include xstrndup.h.
6572 * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
6574 2003-09-11 Gary V. Vaughan <gary@gnu.org>
6576 Reimport the latest xalloc module from CVS gnulib, and adjust the
6577 m4 sources to take advantage of xalloc xfree. Also create a new
6578 macro DELETE with the same semantics as the old m4 XFREE macro,
6579 and carefully tweak callers:
6581 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
6583 * m4/utility.c (xfree): Removed. This function is now supplied by
6585 * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
6586 * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
6587 * m4/symtab.c (m4_symtab_create): Ditto.
6588 * m4/system_.h: Removed XFREE redefine.
6589 (DELETE): New macro with same functionality as the original m4
6590 XFREE macro, but based on xalloc.h now. Changed all callers.
6591 * src/main.c (main): Use XMALLOC macro.
6592 * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
6594 * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
6596 2003-09-10 Gary V. Vaughan <gary@gnu.org>
6598 Import the xalloc module from CVS gnulib, along with its
6599 dependencies: exitfail, malloc and realloc. We had different
6600 semantics for our XFREE and a function xfree() not supplied by
6601 gnulib, so also a bit of work to keep everything running
6604 * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
6605 (gl_XALLOC): Use gnulib equivalents.
6606 * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
6607 gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
6608 * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
6609 * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
6611 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
6612 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
6613 * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
6615 (pkgincdir): Removed. Use pkgincludedir instead.
6616 * m4/m4private.h (XFREE): xfree already checks for NULL.
6617 * m4/system_.h: Use xalloc module, and remove macros already
6618 supplied by xalloc.h.
6619 * m4/utility.c (xfree): xalloc does not yet implement xfree, so
6620 moved the old definition from m4/xmalloc.c to here for now.
6622 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6624 Import the error and progname modules from CVS gnulib. Our old
6625 error.c subsumed the functionality of both, so a little adjustment
6626 was required to accomodate the split in sources. Also added more
6627 wrapper macros to choose between a system installed error.h or our
6628 shipped gnulib error module:
6630 * m4/error.c, m4/error.h: Removed.
6631 * m4/Makefile.am: Adjust.
6632 (pkgincdir): Removed. Use pkgincludedir instead.
6633 * m4/module.h, src/main.c: Don't include `m4/error.h'.
6634 * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
6636 * gnulib/m4/progname.c: Imported from CVS gnulib.
6637 * gnulib/m4/progname.h: Ditto.
6638 * src/main.c: Adjust to use progname module.
6639 * gnulib/m4/error.c: Imported from CVS gnulib.
6640 * gnulib/m4/error_.h: Ditto.
6641 * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
6642 if appropriate, and link a local error.h if the system version is
6644 (libgnu_la_SOURCES) Add progname module sources.
6645 * gnulib/config/error.m4: Imported from CVS gnulib.
6646 * gnulib/config/strerror_r.m4: Ditto.
6647 * config/m4-error.c: New file. Wrap gnulib error.m4 but arrange
6648 to have ERROR_H for Makefile substitutions and tell system.h
6649 whether the system error.h should be used, or a locally installed
6651 * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
6653 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6655 * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
6656 s/gettext_.h/gettext.h/.
6658 * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
6659 automake have been fixed.
6661 * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
6662 gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
6663 of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
6664 rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
6666 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6668 The gnulib obstack module requires the gnulib gettext module for
6669 systems that do not have GNU gettext installed. Because we use
6670 -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
6671 that directory incase it clashes with the system gettext.h. This
6672 delta uses gettext_.h and extra rules in the Makefile to make a
6673 link to gettext.h when needed:
6675 * Makefile.am (auxdir): Removed. No longer used.
6676 * configure.ac (ac_aux_dir): Removed AC_SUBST. No longer used.
6677 (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
6679 (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
6680 Makefile based build.
6681 (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
6682 of the macros are kept.
6683 * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
6684 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
6685 * config/Makefile (ACLOCAL_MACROS): Removed. Automake 1.7a
6686 distributes these automatically.
6687 * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
6688 warning from automake-1.7a.
6689 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
6690 m4_CHECK_DEBUGGING for consistency with gnulib prefixes. Changed
6692 * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
6693 wrt. m4_FUNC_OBSTACK.
6694 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
6695 wrt. m4_sys_STACKOVF.
6696 * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
6697 wrt. _m4_LIB_GMP, m4_LIB_GMP.
6698 (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
6699 namespace. Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
6701 * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
6702 * gnulib/m4/Makefile.am: Added a new block to make an appropriate
6703 gettext.h link on deficient systems.
6704 (pkginc_HEADERS): Mention $(GETTEXT_H).
6705 (EXTRA_HEADERS): Mention gettext.h.
6706 * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
6707 * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
6708 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
6709 gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
6710 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
6711 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
6712 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
6713 gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
6714 gnulib/config/po.m4, gnulib/config/progtest.m4,
6715 gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
6716 gnulib/config/ulonglong.m4: Imported from CVS gnulib.
6718 2003-09-05 Gary V. Vaughan <gary@gnu.org>
6720 We can't mirror the gnulib directory structure here, since we need
6721 to be able to eg. `#include <m4/obstack.h>' from our source files,
6722 which is much easier if the local obstack.h is created in a
6723 directory named m4. Rather than trying to symlink everything into
6724 the m4 directory, now we build a libtool convenience library from
6725 the sources we get from gnulib and link that with libm4.la:
6727 * gnulib/config/extensions.m4: Imported from CVS gnulib.
6728 * gnulib/config/unlocked-io.m4: Ditto.
6729 * gnulib/m4/unlocked-io.h: Ditto.
6730 * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
6731 gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
6732 * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
6733 gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
6734 * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
6735 * m4/Makefile.am: Adjust.
6736 * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
6737 macros we redistribute.
6738 * gnulib/m4/Makefile.am: New file. Build libgnu.la convenience
6739 library among others.
6740 (GNULIB_SRCS, GNULIB_MACROS): Removed.
6741 * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
6742 * config/m4-obstack.m4: Adjust.
6743 * po/POTFILES.in: Adjust.
6744 * configure.ac: Reformatting. Call newly imported gnulib macros.
6745 * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
6746 bogus calls of `#include "m4.h"'.
6747 * Makefile.am: INCLUDES has been deprecated in favour of
6749 * m4/Makefile.am: Ditto.
6750 * modules/Makefile.am: Ditto.
6751 * src/Makefile.am: Ditto.
6753 2003-09-05 Gary V. Vaughan <gary@gnu.org>
6755 * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
6757 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6759 Migrate the obstack support into the gnulib directories for easy
6760 synchronisation with upstream files in gnulib:
6762 * config/gnu-obstack.m4: Moved from here...
6763 * config/m4-obstack.m4: ...to here.
6764 * config/Makefile.am (SPECIFIC_MACROS): Adjust.
6765 * m4/obstack.c, m4/obstack_.h: Moved from here...
6766 * gnulib/obstack.c, gnulib/obstack.h: ...to here.
6767 * po/POTFILES.in: Adjust.
6768 * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
6769 * m4/Makefile.am: Add a whole new section to link the obstack
6770 sources from the gnulib tree if necessary.
6771 * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
6773 * config/m4-obstack.m4: Rewrite as a wrapper for
6774 gnulib/m4/obstack.m4.
6776 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6778 GNU M4 currently builds with a number of files adapted from
6779 upstream sources. Recently the gnulib project on savannah.gnu.org
6780 has pulled together a great many of these externally maintained
6781 files. This delta is the beginnings of isolating those files
6782 maintained in gnulib to make it easy to synchronise M4 with the
6783 upstream files prior to releases.
6785 * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
6787 (SUBDIRS): Added new gnulib subdirectory.
6788 * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
6789 * config/stdbool.m4: Moved from here...
6790 * gnulib/m4/stdbool.m4: ...to here.
6791 * m4/stdbool_.h: Moved from here...
6792 * gnulib/lib/stdbool_.h: ...to here.
6793 * gnulib/Makefile.am: New file. Make sure the gnulib tree is
6795 * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
6796 code to work with new stdbool_.h location.
6797 (gnulib_srcdir): New.
6799 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6801 * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
6802 (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
6804 (SPECIFIC_TOOLS): New variable. Moved mkstamp to here.
6805 (EXTRA_DIST): Use it.
6807 * bootstrap: CVS autoreconf leaves file droppings. Remove
6808 aclocal.m4t incase autoreconf doesn't.
6810 2003-08-29 Gary V. Vaughan <gary@gnu.org>
6812 * m4/gnu-obstack.h: Updated from CVS gnulib. For consistency with
6813 the other gnulib imports, renamed to m4/obstack_.h.
6814 * m4/obstack.c: Updated from CVS gnulib.
6815 * m4/Makefile.am (EXTRA_HEADERS): Adjust.
6816 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
6817 header tests from gnulib obstack module. AC_CONFIG_LINKS knows
6818 about vpath already, and $top_srcdir upsets CVS Automake, so the
6819 $top_srcdir reference was removed.
6821 * m4/system-h.in: For consistency with the gnulib imports, renamed
6823 * m4/Makefile (EXTRA_HEADERS): Adjust.
6824 * configure.ac (AC_CONFIG_FILES): Adjust.
6826 * m4/stdbool_.h: New file from gnulib for systems without their
6828 * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
6829 * config/stdbool.m4: New file. Macros from gnulib for same.
6830 * configure.ac: Use it.
6832 2003-08-27 Gary V. Vaughan <gary@gnu.org>
6834 * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
6835 * config/gmp.m4: Ditto.
6836 * config/gnu-obstack.m4: Ditto.
6837 * config/stackovf.m4: Ditto.
6838 * m4/builtin.c: Ditto.
6839 * m4/debug.c: Ditto.
6840 * m4/error.c: Ditto.
6841 * m4/error.h: Ditto.
6842 * m4/gnu-obstack.h: Ditto.
6845 * m4/input.c: Ditto.
6847 * m4/m4module.h: Ditto.
6848 * m4/m4private.h: Ditto.
6849 * m4/macro.c: Ditto.
6850 * m4/module.c: Ditto.
6851 * m4/obstack.c: Ditto.
6852 * m4/output.c: Ditto.
6854 * m4/regex.c: Ditto.
6855 * m4/regex.h: Ditto.
6856 * m4/strtol.c: Ditto.
6857 * m4/symtab.c: Ditto.
6858 * m4/syntax.c: Ditto.
6859 * m4/utility.c: Ditto.
6860 * m4/xmalloc.c: Ditto.
6861 * m4/xstrdup.c: Ditto.
6862 * m4/xstrzdup.c: Ditto.
6863 * modules/evalparse.c: Ditto.
6864 * modules/format.c: Ditto.
6865 * modules/gnu.c: Ditto.
6866 * modules/import.c: Ditto.
6867 * modules/load.c: Ditto.
6868 * modules/m4.c: Ditto.
6869 * modules/m4.h: Ditto.
6870 * modules/modtest.c: Ditto.
6871 * modules/mpeval.c: Ditto.
6872 * modules/perl.c: Ditto.
6873 * modules/shadow.c: Ditto.
6874 * modules/stdlib.c: Ditto.
6875 * modules/time.c: Ditto.
6876 * modules/traditional.c: Ditto.
6877 * src/freeze.c: Ditto.
6878 * src/getopt.c: Ditto.
6879 * src/getopt1.c: Ditto.
6881 * src/main.c: Ditto.
6882 * src/stackovf.c: Ditto.
6884 * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
6885 ac_default_headers is an autoconf internal variable.
6886 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
6887 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6889 * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
6890 * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
6893 2003-08-15 Gary V. Vaughan <gary@gnu.org>
6895 * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
6897 * system-h.in (m4_boolean): Removed in favour of using C99 bool if
6898 possible or faking one with a typedef. Changed all callers.
6900 2003-08-15 Gary V. Vaughan <gary@gnu.org>
6902 Still cleaning up the users' module API, by taking out the stuff
6903 that isn't used by any existing modules, and moving specialised
6904 functions out of libm4 and into the module they are used by.
6906 * m4/m4module.h (m4_skip_space): No need to export this. Moved...
6907 * m4/utility.c (m4_skip_space): ...to here the home of its only
6908 use, made static and renamed to `skip_space'. Changed all
6910 * m4/m4module.h (m4_expand_ranges): Removed prototype.
6911 * m4/utility.c (m4_expand_ranges): Moved definition from here...
6912 * modules/m4.c (m4_expand_ranges): ...to here, and exported using
6914 * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
6916 * modules/gnu.c (builtin_syntax): Import and use in this
6917 builtin implementation.
6918 * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
6920 * m4/macro.c (trace_flush): Except here where the macro is now
6922 * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6923 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
6925 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6926 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
6928 2003-08-14 Gary V. Vaughan <gary@gnu.org>
6930 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
6931 compiler based AC_CHECK_HEADER that was introduced in
6933 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6934 * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
6935 * configure.ac: Use renamed M4_AC_LIB_GMP.
6937 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
6938 macro that requires arguments! This stops the shell's bad
6939 substitution error at configure time.
6941 * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
6942 variables to the testsuite shell. Set the value of USE_GMP so
6943 that the gmp test will run!
6944 (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
6946 2003-08-11 Gary V. Vaughan <gary@gnu.org>
6948 Libltdl already has an excellent mechanism for accessing C symbols
6949 in modules. Lets use that! Remove all the exporting cruft and
6950 just use lt_dlsym in conjunction with a few conventions to
6951 simplify module writers' jobs. Also removed the table address
6952 caching code and otherwise simplified the module loader quite a
6953 bit. To access exported symbols in other modules, first the
6954 exporting module must name the symbols <modname>_LTX_<symname>,
6955 and the importing module must define a function type called
6956 <symname>_func. The importer then adds
6957 M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
6958 that wishes to call out to the exported functions. Care must be
6959 taken that <symname> is non-NULL in the importing module incase
6960 M4_MODULE_IMPORT fails, but otherwise it can be called as if the
6961 definition was in the importers source. Study
6962 `modules/{gnu.c,m4.{c,h}' for a model example. At the moment,
6963 m4_module_import will attempt to automatically load a module
6964 required for symbol access if it is not loaded already.
6966 * TODO: Removed the items fixed in this delta.
6967 * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
6969 * m4/ltdl.h (lt_dlhandle_find): Declare it.
6970 * m4/module.c (m4_module_unload): Use it.
6971 * src/freeze.c (reload_frozen_state): Ditto.
6972 * m4/m4module.h (m4_export): Deleted. Removed all references.
6973 (M4_MODULE_IMPORT): New user convenience macro for importing
6974 arbitrary symbols from other modules.
6975 * m4/module.c (m4_module_import): New function to service
6976 M4_MODULE_IMPORT macro.
6977 (module_data): Removed. Looking up the tables on demand with
6978 lt_dlsym, rather than caching their addresses here simplifies the
6980 (m4_get_module_builtin_table, m4_get_module_macro_table):
6981 Removed. Changed all callers.
6982 (set_module_macro_table, set_module_builtin_table): Renamed to
6983 install_macro_table and install_builtin_table respectively, and
6984 simplified now that the cache is no more.
6985 * modules/gnu.c (builtin_symbols): Use this new mechanism to
6986 import m4_dump_symbols from the m4 module.
6987 (builtin_esyscmd): Likewise for m4_set_sysval and
6989 * modules/m4.c (m4_export_table): Removed. Functions are
6990 addressed with the new mechanism which doesn't need this.
6991 (m4_set_sysval): New exported accessor function to prevent
6992 problems with variable access on inferior architectures.
6993 * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
6994 (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
6995 that we can have some type safety.
6996 * modules/modtest.c (export_test): C level exported function for
6997 testing the new import mechanism.
6998 * modules/import.c: New file for the import end of the test.
6999 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
7000 * tests/modules.at: New test cases for intermodule symbol
7003 2003-08-07 Gary V. Vaughan <gary@gnu.org>
7005 * m4/m4module.c (m4_string): Moved from here...
7006 * m4/m4private.c (m4_string): ...to here.
7008 * m4/utility.c (dumpdef_cmp): Removed stale declaration.
7010 2003-07-29 Gary V. Vaughan <gary@gnu.org>
7012 * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
7013 already available to module writers through
7014 m4_{get,set}_nesting_limit_opt(), so moved from here...
7015 * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
7016 (m4_create): Use it.
7018 2003-07-28 Gary V. Vaughan <gary@gnu.org>
7020 Aside from auditing path.c for m4module.h api obfuscation, this
7021 delta introduces the concept of private struct members in opaque
7022 data types to GNU m4: See the STYLE file for details.
7024 * TODO: Remind ourselves that a rewrite of path.c is needed.
7025 * m4/m4module.h (m4_search_path, struct m4_search_path_info):
7027 * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
7028 here and renamed. These type definitions are for internal api use
7029 only. Changed all callers.
7030 * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
7032 * m4/path.c (search_path_env_init, search_path_add): ...to here
7033 and renamed. These calls were never used outside this file.
7034 Changed all callers.
7035 (dirpath): Moved functionality of this static declaration...
7036 * m4/m4private.h (struct m4): ...to this new internal only
7037 search_path field. Changed all callers.
7038 (m4__get_search_path): Added new internal api accessor.
7039 * m4/path.c (m4_search_path_info_new): Removed. Not used.
7040 (m4_include_init): Removed...
7041 * m4/m4.c (m4_create): ...because the new m4 field is now
7043 (m4_delete): Recycle search_path memory.
7044 * src/main.c (main): Don't call m4_include_init now that it's
7046 * doc/STYLE: Document convention for private fields in opaque
7049 2003-07-24 Gary V. Vaughan <gary@gnu.org>
7051 Sometimes exporting the address of a symbol from a module isn't
7052 enough for other modules to call that symbol correctly. If
7053 custom data types are used for function parameters, they need to
7054 be known to the caller. This change introduces the concept of
7055 $(prefix)/include/modules/$(modulename).h to declare those
7056 structures. Also we move m4_dump_symbols from libm4 to the m4
7057 module to show this concept in action.
7059 * m4/m4module.h (m4_dump_symbol_data): Moved from here...
7060 * modules/m4.h (m4_dump_symbol_data): ...to this new file for
7061 exporting data structures from modules/m4.c.
7062 * modules/m4.c, modules/gnu.c: Include it.
7063 * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
7064 * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
7066 * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
7068 * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
7069 ...to here, with slight renaming.
7070 (m4_export_table): Prototype and add m4_dump_symbols.
7071 * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
7072 definition of m4_dump_symbols.
7073 * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
7074 * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
7076 2003-07-24 Gary V. Vaughan <gary@gnu.org>
7078 Create an export table in modules/m4.c in readiness for beefing up
7079 the module loader to track module exports and imports.
7081 * m4/m4module.h (m4_debug_flush_files): Removed prototype.
7082 * m4/debug.c (m4_debug_flush_files): Moved...
7083 * modules/m4.c (m4_sysval_flush): ...to here and renamed.
7084 * modules/gnu.c (builtin_esysval): Use it.
7085 * m4/m4module.h (m4_export): New type for declaring module symbols
7087 * modules/m4.c (m4_export_table): List symbols exported from this
7088 module for use by other modules.
7090 2003-07-24 Gary V. Vaughan <gary@gnu.org>
7092 An experiment: There is loads of code in libm4 which should be in
7093 the m4 module, but is also used by another module. Just because
7094 some linkers won't cope with calls across dynamic runtime loaded
7095 objects I initially left the code in libm4. It will tidy the
7096 module api immensely if this code moves to the right place, I just
7097 need to remember to invent a suitable calling mechanism at some
7098 point. For now, only modules that are statically linked and
7099 preloaded will get this treatment, so the only platforms that will
7100 break are those that require all symbols to be resolved at link
7103 * TODO: Reminder that what I am doing could reduce portability
7104 unless I do something more robust later.
7105 * m4/m4module.h (m4_sysval): No longer exported from libm4.
7106 * m4/utility.c (m4_sysval): No longer declared in libm4.
7107 * modules/Makefile.am: Reformatting.
7108 * modules/m4.c (m4_sysval): Declare it at place of use.
7109 * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
7111 2003-07-23 Gary V. Vaughan <gary@gnu.org>
7113 * m4/m4module.h: Reformatting and rearranging lines a bit.
7114 (m4_obstack): Save typing by typedefing `struct obstack'. Changed
7116 (m4_call_macro, m4_expand_input): Renamed...
7117 (m4_macro_call, m4_macro_expand_input): ...to these. Changed all
7119 (m4_expansion_level, m4_process_macro): Moved...
7120 * m4/macro.c (expansion_level, process_macro): ...to here, and
7123 * m4/m4module.h (program_name): Not used by modules at all, so
7125 * src/main.c (program_name): ...to here.
7126 (print_program_name): Renamed...
7127 (print_program_name_CB): ...to conform to the STYLE guide.
7129 2003-07-23 Gary V. Vaughan <gary@gnu.org>
7131 More refactoring of the m4module.h API. Replace #defines with an
7132 enum, and move non-public functions out of the public API.
7134 * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
7136 * m4/macro.c (stdarg.h): Add ANSI C variadic header.
7137 * m4/debug.c (m4_debug, trace): Moved...
7138 * m4/m4private.h (struct m4): ...to fields of this struct.
7139 (m4_get_debug_file, m4_get_trace_messages): New fast access macros
7141 * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
7142 * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
7143 * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
7144 * m4/m4module.h (m4_context_field_table): Add entries for new
7145 debug_file and trace_messages fields.
7146 (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
7147 (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
7148 (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
7149 (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
7150 (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
7151 (m4_is_debug_bit): New macro to simplfy checks against the debug
7153 (m4_trace_format, m4_trace_header, m4_trace_flush)
7154 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
7156 * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
7157 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
7158 * m4/macro.c (trace_format, trace_header, trace_flush)
7159 (trace_prepre, trace_pre, trace_post): ...to these newly static
7160 functions, since they are only ever used from this file. Changed
7163 2003-07-17 Gary V. Vaughan <gary@gnu.org>
7165 Change the macros for checking syntax so that matching against
7166 multiple possible syntax classes can be done with a single
7167 comparison some of the time. The various classes are now bits of
7168 an int that can be checked with bitwise logic operators.
7170 * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
7171 (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
7172 (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
7173 (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
7174 (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
7175 (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
7176 (M4_SYNTAX_ALNUM): Removed. Changed all callers.
7177 (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
7178 (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
7179 (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
7180 (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
7181 Replace all calls with invocations of these...
7182 (m4_is_syntax, m4_has_syntax): ...New macros.
7183 * src/freeze.c (produce_syntax_dump): Remove mask argument, which
7184 is no longer required with new macros. Changed all callers.
7186 2003-07-15 Gary V. Vaughan <gary@gnu.org>
7188 * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
7189 values are returned as part of the internal interface, so they
7191 * m4/private.h: ...to here.
7192 * m4/macro.c (expand_token): Check for out of range
7193 m4_peek_input() results before looking up in the syntax table.
7194 (collect_arguments): Ditto.
7196 * NEWS: Note `$' syntax class.
7198 2003-07-08 Paul Eggert <eggert@twinsun.com> and
7199 Gary V. Vaughan <gary@gnu.org>
7201 Conform to POSIX if the POSIXLY_CORRECT environment is set.
7202 --traditional `define' now smashes all the definitions.
7204 * NEWS: Explain this.
7205 * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
7206 (Extensions): Explain that extensions that are incompatible with
7207 POSIX are disabled if POSIXLY_CORRECT is set.
7208 (Incompatibilities): Remove.
7209 (Define, Other Incompat): Explain difference
7210 between GNU and POSIX behavior of define, pushdef, popdef.
7211 * m4/m4.c (m4_get_posixly_correct_opt): New undef.
7212 * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
7213 * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
7214 (m4_get_posixly_correct_opt): New macro.
7215 * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
7217 * modules/m4.c (builtin_functions): defn now takes any number of args.
7218 (builtin_define): Smash all the definitions if
7220 (builtin_defn)): Allow any number of arguments.
7221 (builtin_undivert): Do not allow nonnumeric arguments
7223 * src/main.c (main): Set posixly-correct behavior if either
7224 POSIXLY_CORRECT is set, or if -G is given.
7225 * tests/builtins.at: New test for smashed definitions.
7227 2003-06-27 Gary V. Vaughan <gary@gnu.org>
7229 * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
7230 * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
7231 not to slow the parser down.
7232 (M4__IS_STRING): New macro to test string syntax class membership.
7233 * m4/syntax.c: Adjust docucomment.
7234 (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
7235 (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
7236 * m4/input.c (init_builtin_token): Comment typo.
7237 (m4__next_token): Comment typo.
7238 Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
7239 by using the new M4__IS_STRING macro.
7240 * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
7241 variable references in macro expansions.
7243 * doc/m4.texinfo (Eregexp and Regexp): Typo.
7244 (Epatsubst and Patsubst): Typo.
7247 2003-06-26 Gary V. Vaughan <gary@gnu.org>
7249 Move the global variables that pertain to syntax to a new `struct
7250 m4_syntax_table', and then add one of these to `struct m4'. The
7251 ripple effect through the code to both change formerly global
7252 references, and make sure a suitable context is available in
7253 lexical scope is disproportionately large compared to the size of
7254 the change proper. This change is a large part of decoupling
7255 syntax.c from the rest of the code that uses it.
7257 * m4/m4private.h (struct m4): Add a syntax field.
7258 * m4/m4.c (m4_create): Initialise it,
7259 (m4_delete): Recycle it.
7260 (m4_get_symtab): Remove hand coded version...
7261 (m4_get_symbol_table): ...and generate this with cpp. Changed all
7263 * m4/m4module.h (m4_context_field_table): Add an extra field so we
7264 can generate m4_get_symbol_table. Add a new row for
7265 m4_get_syntax_table.
7266 (M4SYNTAX): Syntactic sugar for module writers.
7267 (m4_symtab): Renamed to m4_symbol_table. Changed all callers.
7268 (m4_syntax_table): New home for syntax related formerly global
7270 * m4/m4private.h (struct m4_syntax_table): Define it.
7271 * m4/input.c (m4_input_init): Initialisation of these formerly
7272 global variables moved...
7273 * m4/syntax.c (m4_syntax_create): ...to here.
7274 * m4/input.c (m4_input_exit): And similarly, recycling of the
7275 memory used by those values moved...
7276 * m4/syntax.c (m4_syntax_delete): ...to here.
7277 * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
7278 Moved to m4/m4private.h.
7279 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
7280 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
7281 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
7282 (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
7283 objects. Changed all callers that used to directly access the
7285 (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
7286 Removed and incorporated into m4_syntax_table structure.
7287 * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
7288 * m4/syntax.c (m4_set_syntax): Now returns an error status,
7289 instead of requiring a `struct m4' to generate its own errors.
7290 Changed all callers.
7291 * src/main.c (main): Now that the syntax table is initialised as
7292 part of m4_create, we have to manually wipe the syntax entries if
7293 we are about to read a frozen file.
7295 2003-06-26 Gary V. Vaughan <gary@gnu.org>
7297 * doc/STYLE: Added notes on callback naming schemes.
7299 * m4/module.c (m4_set_module_macro_table)
7300 (m4_set_module_builtin_table): Declarations weren't changed when
7301 definitions were renamed on 2003-06-19.
7303 * m4/hash.c (m4_hash_resize): ifdefed out. This function is
7304 neither used nor particularly appropriate since it exposes the
7305 internal workings of the hash module. I haven't yet decided
7306 whether to remove it entirely.
7308 2003-06-20 Gary V. Vaughan <gary@gnu.org>
7310 Two related changes, and a huge knockon effect throughout the
7311 source: Moved the option variables out of global space and into
7312 `struct m4'; made `m4_symtab' a real datatype, so that its api
7313 is not marred passing `struct m4' around just so it can decide
7314 whether to keep traced symbol names or not. Added setters and
7315 getters for the formerly global option variables, and obviously
7316 changed a vast number of functions to take a `struct m4' and use
7317 the getter funcs to find option values.
7319 * m4/utility.c (interactive, sync_output, debug_level)
7320 (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
7321 (max_debug_argument_length, warning_status, nesting_limit)
7322 (discard_comments): Removed.
7323 * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
7324 (debug_level, max_debug_argument_length, prefix_all_builtins)
7325 (suppress_warnings, discard_comments, interactive, sync_output):
7326 Removed from here...
7327 * m4/m4private.h (struct m4): ...and equivalent fields added to
7329 (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
7330 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
7331 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
7332 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
7333 (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
7334 macros for the new fields.
7335 * m4/m4module.h (m4_context_field_table)
7336 (m4_context_opt_bit_table): Helper macros used to generate
7337 prototypes, setters and getters for new option fields
7339 * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
7340 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
7341 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
7342 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
7343 (m4_get_interactive_opt, m4_get_sync_output_opt)
7344 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
7345 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
7346 (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
7347 (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
7348 (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
7349 setter and getter functions generated by cpp from
7350 m4_context_field_table and m4_context_opt_bit_table, exported as
7351 part of the module api. Changed all callers.
7352 * m4/symtab (struct m4_symtab): Used as the concrete type for
7354 (m4_symtab_create): Allocate and initialise a new struct.
7355 (m4_symtab_apply): New function that works like m4_hash_apply, but
7356 with different callbacks specific to symbol tables. Changed all
7358 (symbol_destroy, arg_destroy, arg_copy): Renamed
7359 symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
7360 they have unused parameters for a reason!
7361 (dump_symbol_CB): New callback to dump the contents of a single
7363 (symtob_dump): Rewritten in terms of dump_symbol_CB.
7364 * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
7365 Changed all callers.
7366 * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
7367 of the contained `m4_symtab' at the `no_gnu_extensions' field.
7368 Although I'm not convinced these semantics are correct, they are
7369 at least consistent with how things were before this delta. Also
7370 set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
7372 2003-06-19 Gary V. Vaughan <gary@gnu.org>
7374 Tie down the interface to libm4 some more. Make more structures
7375 opaque to modules by moving them to m4private.h, and writing
7376 setters and getters. To win back the speed penalty for doing this
7377 also wrote macroized versions that do know about structure layout
7378 in m4private.h and #include that file into modules when NDEBUG is
7379 defined at compile time. There are still some accessor macros in
7380 m4private.h that need to go, but that is not necessary to clean
7383 * m4/m4module.h (m4_symbol_type): Moved...
7384 * m4/m4private.h (m4__symbol_type): ...to here.
7385 * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
7386 (m4_set_symbol_traced, m4_set_symbol_name_traced)
7387 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
7388 (m4_get_symbol_func, m4_symbol_value_create)
7389 (m4_symbol_value_delete, m4_set_symbol_value_text)
7390 (m4_set_symbol_value_func): New exported api to symbols.
7391 (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
7392 and m4_is_symbol_value_func.
7393 * m4/m4module.h: Prototype these guys.
7394 * m4/module.c (m4_set_module_macro_table)
7395 (m4_set_module_builtin_table): Make these static, there is no
7396 reason to pollute the api with them.
7397 * m4/m4private.h: Reformatting.
7398 (m4_get_symtab): Only define when NDEBUG is defined.
7399 (m4_get_symbol_value, m4_get_symbol_traced)
7400 (m4_set_symbol_traced, m4_set_symbol_name_traced)
7401 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
7402 (m4_get_symbol_func, m4_symbol_value_create)
7403 (m4_symbol_value_delete, m4_set_symbol_value_text)
7404 (m4_set_symbol_value_func): Macro implementations of the new
7405 functions when NDEBUG is defined.
7406 (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
7407 (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
7408 Superceded by the above. All callers changed.
7409 (M4ARG): Removed. This is no longer different to the
7410 m4/m4module.h definition.
7411 * modules/gnu.c, modules/m4.c: Only include m4private.h when
7412 NDEBUG is defined. That way we exercise the same (albeit slower)
7413 api that external modules must use.
7415 2003-06-18 Gary V. Vaughan <gary@gnu.org>
7417 Renamed some of the types and their accessors to make more sense.
7418 Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
7419 has a stack of SYMBOL_VALUEs.
7421 * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
7422 (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
7423 m4_get_symbol_value_type, m4_get_symbol_value_text,
7424 m4_get_symbol_value_func and m4_symbol_value_copy respectively.
7425 Changed all callers.
7426 (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
7427 (m4_get_token_type): Renamed
7428 * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
7429 to the internal api.
7430 * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
7432 (m4__symtab_init, m4__symtab_exit): Removed prototypes.
7433 (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
7434 (m4__token_type): Moved here from m4module.h.
7435 (m4__next_token): Renamed from m4_next_token.
7436 * m4/symtab.c: Removed some of the parameterised macro support
7437 functions for modularisation later.
7438 (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
7439 m4_hash_dup to perform a true deep copy of the SRC.
7440 (arg_copy): Callback for m4_symbol_value_copy.
7441 * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
7442 Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
7443 m4_get_symbol_value_func. Changed all callers.
7445 2003-06-18 Gary V. Vaughan <gary@gnu.org>
7447 Tidy up style of hash.[ch] in accordance with doc/STYLE.
7449 * m4/hash.c: Internal symbol renaming and formatting.
7450 (m4_hash_dup): New function to facilitate deep copies of hash
7452 (m4_hash_apply_func): Returns a void* now, which is a richer type
7453 for returning exceptions (NULL means keep going).
7454 (m4_hash_apply): Ditto.
7455 * m4/hash.h: Declare exported symbols with an explicit extern.
7458 2003-06-17 Gary V. Vaughan <gary@gnu.org>
7460 Still refactoring furiously. This delta represents a change in
7461 semantics to symtab.c. Instead of building temporary m4_tokens
7462 in the caller, and copying fields in the methods, we now create
7463 the actual m4_token for hashing in the caller so the methods just
7464 slot them in directly. Also, this means that we don't lookup a
7465 symbol and get back an allocated but VOID token to copy fields
7466 into, we create the token we want to push and pass that to
7467 m4_symbol_define or m4_symbol_pushdef. And that's it. There are
7468 a few other small changes to stop knowledge of the implementation
7469 of symtab.c leaking out into other files.
7471 * m4/macro.c (expand_argument): Comment typo corrected.
7472 * m4/symtab.c (symtab_fetch): New function to fetch the address of
7474 (m4_symbol_pushdef): Take an extra value parameter and use this
7475 directly as the new top of the value stack. All callers changed
7476 to build a token and pass responsibility for memory in, rather
7477 than copying as we used to.
7478 (m4_symbol_define): Also use the new value parameter directly as a
7479 replacement for the top of the value stack. All callers changed
7480 to build a token as above.
7481 (m4_set_symbol_traced): New function to set the traced bit on the
7482 named symbol, creating it if necessary.
7483 (symbol_popval): The guts of the old m4_symbol_popdef.
7484 (m4_symbol_popdef): Use it.
7485 * m4/builtin.c (m4_symbol_set_token): Removed,
7486 (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
7488 * m4/module.c (m4_set_module_builtin_table)
7489 (m4_set_module_macro_table): ...with these more orthogonal
7491 * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
7492 (m4_builtin_pushdef, m4_builtin_define): Removed. No longer
7494 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
7495 (m4_arg_signature_parse): Moved...
7496 * m4/symtab.c: ...to here.
7497 * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
7498 screw something up. Moved...
7499 * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
7500 actually does a proper deep copy of source to dest.
7502 2003-06-16 Gary V. Vaughan <gary@gnu.org>
7504 Further refactoring to stabilise the module API. Renaming some
7505 functions for orthogonality, and judicious definition migration to
7506 move things out of the set of exported symbols.
7508 * doc/STYLE: New file. Notes on coding style.
7509 * m4/m4module.c: Updated bitrotted docucomment at the top of the
7511 (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
7512 m4_get_module_name, m4_get_module_builtin_table,
7513 m4_get_module_macro_table which are verb phrases. Changed all
7515 * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
7517 * m4/module.c (m4_set_module_builtin_table)
7518 (m4_set_module_macro_table): ...here, and renamed. Changed all
7520 * m4/m4module.c (m4_module_data): This...
7521 * m4/m4private.c (struct m4_module_data): ...and this...
7522 * m4/module.c (module_data) ...consolidated here and no longer
7523 exported. Changed all callers.
7525 2003-06-16 Gary V. Vaughan <gary@gnu.org>
7527 Begin work on lifting the curse of the global variables. To start
7528 with create a `struct m4' context container, and replace
7529 `m4__symtab' with `context->symtab' throughout. This means
7530 initialising a context container in main, and adjusting many
7531 functions between main and the module entry points so that the
7532 container gets passed through. It would have been nice to
7533 defer this until after 1.5, but it has a major effect on the
7534 user's module writing ABI, so it needs to be addressed now - at
7535 least in the areas that impact the ABI. An interrelated change
7536 in the symtab API removes the dependency on a global symbol table,
7537 and instead focuses on a passed table (from the context
7540 * TODO: Reminders for finishing context functionality.
7541 * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
7542 * m4/m4.c: New file. Manage new struct m4 objects to eliminate
7543 global variables and eventually allow m4 to be reentrant.
7544 * m4/m4private.h (m4): Define the new structure here...
7545 (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
7546 don't carry the overhead of a function call.
7547 * m4/m4module.h: Prototype extern functions from m4/m4.c.
7548 (m4): Declare type for new struct m4 objects.
7549 (M4SYMTAB): User macro to ease finding the symbol table for the
7550 current context for module developers.
7551 (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
7553 (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
7554 (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
7555 (m4_call_macro, m4_dump_symbols, m4_expand_input)
7556 (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
7557 (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
7558 (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
7559 m4* context parameter. Changed definitions and all callers.
7560 (m4_symtab): Alias for m4_hash to decouple the
7561 m4_symtab api from m4_hash.
7562 (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
7564 (m4_symtab_create): New function to return an initialised
7566 (m4_symtab_delete): New function to delete an m4_symtab's memory.
7567 (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
7568 (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
7569 instead of simply using the global m4__symtab. Changed
7570 definitions and all callers.
7571 * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
7572 * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
7573 * src/main.c (main): Create a context and use that instead of the
7574 former global m4__symtab.
7576 2003-06-13 Gary V. Vaughan <gary@gnu.org>
7578 * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
7579 to the callback. Callbacks should not need to hardcode the
7580 hashtable they are working from, nor should we have to waste the
7581 userdata parameter to pass the table in.
7582 * m4/hash.h (m4_hash_apply_func): Require the initial table
7584 * m4/symtab.c (symtab_destroy): Use the passed table instead
7585 of hardcoding m4__symtab.
7586 (m4_symbol_popdef): Don't use the userdata parameter to pass the
7587 table to arg_destroy.
7588 (arg_destroy): Use the hash parameter, ignore userdata.
7589 * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
7591 (traceon, traceoff): Call set_trace with the extra initial
7594 2003-06-13 Gary V. Vaughan <gary@gnu.org>
7596 More refactoring to stabilise the module api, this time for
7597 symtab.c. Additionally, start to pay attention to function names
7598 that don't contain a verb like they should.
7600 * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
7601 wrapper for m4_hash_apply to decouple the symtab module from the
7603 (m4_symbol_builtin, m4_symbol_macro): Renamed to
7604 m4__symbol_set_builtin and m4__symbol_set_macro. Changed all
7606 (m4_symbol_delete): Create a macro version to save a function
7608 (m4_token_t, m4_data_t): These violate the POSIX reserved
7609 namespace. Renamed to m4_token_type and m4_symbol_type. Changed
7611 (m4_token_type): Renamed to m4_token_get_type.
7612 (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
7613 (m4_symtab_exit): Removed from the exported module
7615 * m4/m4private.h (m4__symtab, m4__symtab_init)
7616 (m4__symtab_remove_module_references, m4__symtab_exit): ...and
7617 renamed and added to the internal api. Changed all callers.
7618 (m4_symtab_apply): A faster macro version of the function for
7619 users of the internal api.
7620 * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
7621 symbol_destroy and arg_destroy.
7622 (symtab_debug): Added a prototype.
7623 (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
7624 so that callers in this file get the faster macro versions from
7627 2003-06-12 Gary V. Vaughan <gary@gnu.org>
7629 Refactoring modules to rationalise the API into an external
7630 documented (eventually!) API for use by modules in the `m4_'
7631 namespace declared in m4/m4module.h, an internal API between the
7632 source files we ship (including our shipped modules) in the `m4__'
7633 namespace declared in m4/m4private.h and making the rest as
7634 cohesive as possible with liberal use of the `static' keyword.
7635 This change represents an audit to m4/module.c along these
7638 * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
7639 Removed. No longer used.
7640 (m4_module_close): Removed prototypes.
7641 (m4_module_init, m4_module_open, m4_module_unload_all): Removed
7642 from the exported module api...
7643 * m4/m4private.h (m4__module_init, m4__module_open)
7644 (m4__module_exit): ...and renamed and added to the internal api.
7645 Changed all callers.
7646 (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
7647 Centralised definitions after renaming...
7648 * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
7649 (M4_FINISH_SYMBOL): ...and removing from here.
7650 (m4_module_dlerror, m4_module_remove, m4_module_close)
7651 (m4_caller_id): Not exported at all, so renamed to module_dlerror,
7652 module_remove, module_close and caller_id.
7653 (MODULE_SELF_NAME): New macro to make reporting self errors
7655 (m4_module_load, module_close, module_remove): Use it.
7656 * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
7658 * src/main.c (main): Use it.
7660 2003-06-12 Gary V. Vaughan <gary@gnu.org>
7662 * README: Remove references to --enable-changeword, which has been
7663 removed from the code.
7665 2003-06-11 Gary V. Vaughan <gary@gnu.org>
7667 Getting rid of the annoying bug with configure --enable-debug,
7668 which spewed -e: command not found errors. This was an interaction
7669 between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
7670 You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
7671 branch-1-5) to get the full fix.
7673 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
7674 of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
7675 and then use the probed value of $SED.
7676 (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
7677 this, it messes up the AC_REQUIRE stack.
7679 2003-06-10 Gary V. Vaughan <gary@gnu.org>
7681 * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
7682 the destroy callback.
7683 (m4_arg_destroy): Use the hash address to free the hash node key
7686 2003-06-06 Gary V. Vaughan <gary@gnu.org>
7688 First cut at formal parameters in macros.
7690 * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
7691 * m4/xstrzdup.c: New file.
7692 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
7693 associative array of parameter names to details.
7694 (m4_symbol_token): Capture macro names with parameter lists.
7695 (m4_arg_signature_parse): And build an associative array to hang
7696 from the symbol structure to map names to details.
7697 * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
7698 m4_hash_resize idiom. Now that we potentially add a little hash
7699 table to many of the entries in the symbol table, added an extra
7700 arg to set the initial size. Changed all callers.
7701 (m4_hash_apply): New function that is basically a generalised
7703 * m4/symtab.c (m4_symbol_apply): ...this. Now deleted. Adjusted
7704 all callers to call m4_hash_apply instead.
7705 (m4_arg_destroy): Recycle memory used by an m4_token_arg.
7706 (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
7707 m4_arg_signature association that might be attached to the symbol,
7708 * m4/hash.h (m4_hash_apply_func): Replacement type for...
7709 * m4/m4module.h (m4_symtab_apply_func): ...this. Now deleted.
7710 (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
7712 (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
7713 (M4_IS_IDENT): Detect characters that can be safely used in
7715 * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
7716 * m4/macro.c: Corrected grammar in some comments. Use `token'
7717 rather than `td' for m4_token variables.
7718 (m4_process_macro): If we find a dollar followed by some
7719 M4_IS_IDENT characters, replace that with the contents of the argv
7720 entry with offset stored in the m4_token_arg associated with the
7721 collected identifier.
7723 2003-06-05 Gary V. Vaughan <gary@gnu.org>
7725 Begin preparations for supporting formal parameters in m4 macros.
7727 * m4/m4private.h (struct m4_token_arg): Placeholder for holding
7728 the details of a formal parameter.
7729 (m4_token): Add an arg_signature member to hold a hash table for
7730 looking up formal parameters.
7731 * m4/input.c: Update more bitrotted comments.
7732 (m4_push_builtin): Initialise arg_signature member.
7733 (init_builtin_token): Copy arg_signature member.
7734 * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
7735 (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
7737 * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
7738 (m4_macro_pushdef, m4_macro_define): ...these, And...
7739 (m4_symbol_token): ...wrapped around this new function, which
7740 vastly simplifies the arguments required by the functions it
7742 Changed all callers.
7744 2003-06-05 Gary V. Vaughan <gary@gnu.org>
7746 * m4/macro.c: Format changes.
7748 2003-06-04 Gary V. Vaughan <gary@gnu.org>
7750 * m4/input.c: Updated various bitrotted comments.
7751 (m4_push_builtin): Just pass the whole m4_token, rather than
7752 extracting all the fields in the caller. This also allows us to
7753 check the token type for consistency.
7754 (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
7755 Renamed to builtin_funcs, builtin_peek, builtin_read,
7756 m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
7757 the code. Changed all callers.
7758 (struct input_block): Similarly renamed u_m member to u_b, and
7759 changed all callers.
7760 (m4_next_token): Use bzero to initialise the data fields.
7761 * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
7763 2003-05-29 Gary V. Vaughan <gary@gnu.org>
7765 These changes were necessary to get m4 to build on my iBook
7766 running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
7767 (GCC) 3.1 20020420 (prerelease)":
7769 * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
7770 inclusion of module loader headers.
7771 * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
7772 * m4/Makefile.am: Ditto.
7773 (libm4_la_LIBADD): Added $(LTLIBINTL).
7774 * m4/utility.c (program_name): Removed declaration in favour of
7775 the one already in error.c!
7776 * m4/m4module.h (program_name): Define to program_invocation_name
7777 when using GNU C library. Use an explicit extern declaration.
7778 (interactive, sync_output, debug_level, hash_table_size)
7779 (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
7780 (suppress_warnings, warning_status, nesting_limit, discard_comments)
7781 (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
7782 (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
7783 (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
7784 (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
7785 (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
7786 (m4_expansion_level, m4_expand_ranges, m4_expand_input)
7787 (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
7788 (m4_current_line, m4_current_diversion, m4_output_current_line):
7789 Don't rely on default, use an explicit extern.
7790 * m4/error.h (error, error_at_line, error_print_progname)
7791 (error_message_count, error_one_per_line): Ditto.
7792 * m4/ltdl.c: Update from CVS libtool.
7794 * commit: Update from CVS cvs-utils.
7796 2002-11-04 gettextize <bug-gnu-gettext@gnu.org>
7798 * po/Makefile.in.in: Upgrade to gettext-0.11.5.
7799 * po/boldquot.sed: New file, from gettext-0.11.5.
7800 * po/en@boldquot.header: New file, from gettext-0.11.5.
7801 * po/en@quot.header: New file, from gettext-0.11.5.
7802 * po/insert-header.sin: New file, from gettext-0.11.5.
7803 * po/quot.sed: New file, from gettext-0.11.5.
7804 * po/remove-potcdate.sin: New file, from gettext-0.11.5.
7805 * po/Rules-quot: New file, from gettext-0.11.5.
7807 2002-11-04 Akim Demaille <akim@epita.fr>
7809 * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
7811 * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
7813 2002-11-04 Akim Demaille <akim@epita.fr>
7815 * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
7817 2002-11-04 Akim Demaille <akim@epita.fr>
7819 * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
7820 used as `external', and Libtool 1.4.3.
7822 (LTLIBOBJS): Don't play with it.
7824 * Makefile.am (SUBDIRS): Remove intl.
7825 (ACLOCAL_AMFLAGS): Add -I config.
7826 (EXTRA_DIST): Add config/config.rpath.
7829 * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
7831 2002-05-29 Gary V. Vaughan <gary@gnu.org>
7833 Preparations for refactoring syntax tables to allow reverse
7834 lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
7835 speed of normal lookups in an array of unsigned short.
7837 * m4/input.c (single_quotes, single_comments, use_macro_escape):
7839 * m4/m4private.h (m4__single_quotes, m4__single_comments,
7840 m4__use_macro_escape): ...to here, and renamed. The `m4__' prefix
7841 is for internal symbols which unavoidably pollute the global
7842 namespace, but are not published APIs.
7843 Adjusted all callers.
7844 * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
7845 m4_set_comment, m4_set_syntax, set_syntax_internal,
7846 unset_syntax_attribute): Moved from this file...
7847 * m4/syntax.c: New. ...to this file.
7848 Also added an m4_syntax_exit stub for orthogonality.
7849 * src/main.c (main): Use it.
7850 * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
7851 * m4/m4module.h: Reformatting. New prototypes.
7853 2002-05-29 Gary V. Vaughan <gary@gnu.org>
7855 * bootstrap (aclocal_apiversion): The aclocal apiversion is
7856 distinct from the automake release number (in that the apiversion
7857 apparently has no micro-version-component).
7858 (aclocal_apilibdir): Use it.
7860 2002-05-28 Gary V. Vaughan <gary@gnu.org>
7862 * m4/hash.c (m4_hash_resize): New function.
7863 * m4/hash.h: Add prototype.
7864 * m4/symtab.c (m4_symtab_init): Use it. This could do with some
7865 benchmarking to find a good value for, say, autoconf. This is
7866 already a little quicker than before for me.
7868 * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
7869 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
7871 * m4/hash.h: Adjust prototypes.
7873 2002-01-22 Akim Demaille <akim@epita.fr>
7875 * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
7877 * tests/Makefile.am (package.m4): New.
7878 * tests/atlocal.in: Adjust to CVS Autotest.
7879 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
7880 * configure.ac: LIBOBJ is a forbidden string.
7881 Simplify AM_INIT_AUTOMAKE invocation.
7882 * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
7885 2002-01-21 gettextize <bug-gnu-utils@gnu.org>
7887 * po/Makefile.in.in: Upgrade to gettext-0.10.40.
7889 2001-10-19 Akim Demaille <akim@epita.fr>
7891 * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
7893 2001-10-19 Akim Demaille <akim@epita.fr>
7895 * m4/input.c (m4_next_token): Display where was opened what is
7898 2001-10-19 Akim Demaille <akim@epita.fr>
7900 * m4/macro.c (expand_argument): Display where was opened what is
7903 2001-10-18 Akim Demaille <akim@epita.fr>
7905 * m4/input.c, modules/m4.c: Formatting changes.
7907 2001-10-17 Gary V. Vaughan <gary@gnu.org>
7909 * bootstrap: s/configure.in/configure.ac/
7911 2001-10-16 Gary V. Vaughan <gary@gnu.org>
7913 * m4/symtab.c (m4_symbol_destroy): This function calls
7914 m4_symbol_popdef, which recycles a symbols memory when the last
7915 definition is popped. Since we were passing the address of the
7916 symbol name found in the symbol table, and it was being removed
7917 partway through m4_symbol_destroy() we were referencing freed
7918 memory for the balance of the function. Now we take a copy of the
7919 symbol name tring and use that as a key into the symbol
7920 table... that way if the original symbol name is freed, the copy
7923 2001-10-13 Akim Demaille <akim@epita.fr>
7925 * m4/ltdl.c: Update.
7927 2001-10-13 Akim Demaille <akim@epita.fr>
7929 * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
7930 Don't gettextize internal error messages.
7932 2001-10-13 Akim Demaille <akim@epita.fr>
7934 * tests/macros.at (Arity and defn): New failing test.
7935 (Arity, defn, and freeze): New.
7937 Fix `Arity and defn'.
7939 * m4/input.c (m4_push_macro): Don't forget the arity.
7940 * modules/m4.c (defn): Likewise.
7942 2001-10-13 Akim Demaille <akim@epita.fr>
7944 * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
7946 * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
7947 (Propagation of traceon, Propagation of --trace): this new file.
7949 2001-10-13 Akim Demaille <akim@epita.fr>
7951 * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
7952 interface instead of (name, argc...).
7953 Upon failure, specify which argument was guilty.
7956 2001-10-13 Akim Demaille <akim@epita.fr>
7958 * modules/evalparse.c: Save translators' time: don't translate
7959 internal error messages.
7960 (m4_evaluate): Simplify/normalize error messages.
7961 * doc/m4.texinfo (Eval): Adjust.
7963 2001-10-13 Akim Demaille <akim@epita.fr>
7965 * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
7966 where no checking is needed.
7967 * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
7968 interface instead of (name, argc...).
7970 * modules/gnu.c (m4_patsubst_do): Don't check argc, done
7973 2001-10-13 Akim Demaille <akim@epita.fr>
7975 * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
7976 exclude the builtin name from the count.
7977 * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
7978 calling ifelse with a single argument is valid.
7979 * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
7980 with 1 and 2 args, mostly to strengthen the test suite.
7982 2001-10-13 Akim Demaille <akim@epita.fr>
7984 * m4/output.c (m4_make_diversion, m4_insert_file)
7985 (m4_insert_diversion, +m4_freeze_diversions): Ansify.
7987 2001-10-12 Gary V. Vaughan <gary@gnu.org>
7989 * m4/input.c (init_builtin_token): Renamed from init_macro_token,
7990 since we call these things builtins in the rest of the code!
7992 * modules/gnu.c (m4_regexp_compile): s/%0/%s/
7994 2001-10-12 Gary V. Vaughan <gary@gnu.org>
7996 Rather than forcing each builtin definition to manage its own
7997 argument range checking, tabulate the maxima and minima for all
7998 builtins in each module. This forces us to consider what the
7999 valid ranges for each builtin should be, and moves the checking
8000 code out of each builtin implementation and into the builtin
8001 caller infrastructure.
8003 * m4/m4module.h (struct m4_builtin): Add argument minima and
8005 * m4/m4private.h (struct m4_token): Reflect them here too.
8006 * m4/input.c (struct input_block): ...and here.
8007 (m4_token_copy): New function for token copying.
8008 (init_macro_token): Copy them from a token to the input stack.
8009 (m4_next_token): Don't forget to initialise them for text
8011 * m4/macro.c (expand_argument): Use m4_token_copy, and also
8012 check argument counts before calling the builtin handler.
8013 * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
8014 (m4_symbol_macro): Likewise.
8015 * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
8016 parameters. Updated all callers.
8017 (m4_builtin_define): Ditto.
8018 (m4_macro_pushdef, m4_macro_define): Ditto.
8019 * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
8020 * modules/evalparse.c: Declare argument counts for defined
8021 builtins and remove explicit calls to m4_bad_argc().
8022 * modules/gnu.c: Ditto.
8023 * modules/load.c: Ditto.
8024 * modules/m4.c: Ditto.
8025 * modules/modtest.c: Ditto.
8026 * modules/mpeval.c: Ditto.
8027 * modules/perl.c: Ditto.
8028 * modules/shadow.c: Ditto.
8029 * modules/stdlib.c: Ditto.
8030 * modules/time.c: Ditto.
8033 2001-10-10 Gary V. Vaughan <gary@gnu.org>
8035 The trace semantics now attach the trace bit to a symbol name.
8036 For as long as a traceon(`foo') is active, calls to foo will be
8037 traced regardless of intervening undefines or module unloads.
8038 Fixed the flag propogation issues differently to the fixes
8039 reverted with the last attempt at nailing down trace:
8041 * m4/m4private.h: This file is not visible outside of the m4
8042 source tree, so I removed all the `M4_' and `m4_' prefixes to save
8043 on typing. Updated all clients.
8044 (m4_token): New typedef contains the fields that need to be passed
8045 around with the low level tokeniser.
8046 (m4_token_data): Removed.
8047 (m4_symbol): Now contains the traced flag again.
8048 * m4/symtab.c: Rewritten again. Now we don't remove symbols with
8049 the trace bit set. This change is contained entirely within this
8050 module and doesn't leak out into the callers. Updated all
8052 (m4_symbol_builtin, m4_symbol_macro): Adjusted to make use of the
8053 new fields in m4_token. Updated all clients.
8054 * m4/builtin.c (m4_builtin_pushdef): Needs a flags argument so
8055 that `groks_macro_args' and `blind_if_no_args' flags are retained
8056 when defn() results are passed around in m4 code. Updated all
8058 (m4_builtin_define): Ditto.
8059 (m4_macro_pushdef, m4_macro_define): Ditto.
8060 * m4/input.c (struct input_block): Add a flags field to facilitate
8062 (m4_push_macro): ...use it.
8063 (init_macro_token): Retrieve it.
8064 (m4_next_token): Initialise it.
8065 * m4/macro.c (expand_argument): Copy it.
8066 * m4/m4module.h: Adjust.
8067 * tests/builtins.at: Adjust the expected output of the trace
8068 tests to reflect the change in semantics.
8069 * tests/modules.at (modules: trace): Check that unloading a
8070 module which supplies a traced symbol definition doesn't lose te
8073 2001-10-07 Gary V. Vaughan <gary@gnu.org>
8075 * modules/gnu.c (m4_macro_table): Display the timetamp when
8076 expanding __m4_version__.
8078 * configure.ac (--with-modules): Forgot a comma in the
8079 AC_HELP_STRING parameter list.
8081 2001-10-05 Gary V. Vaughan <gary@gnu.org>
8083 * bootstrap: Remove aclocal.m4t when it is no longer required.
8085 2001-10-05 Akim Demaille <akim@epita.fr>
8087 * tests/Makefile.am: Adjust for gnuprog2.
8088 * tests/m4.in: There can be a leading path.
8089 * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
8090 * tests/testsuite.at: Adjust to the most recent Autotest.
8091 (AT_CHECK_M4_FILTER): Fix and rename as...
8093 * tests/others.at: Use it.
8095 * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
8096 variable in shell scripts, one uses `$'...
8098 2001-10-04 Gary V. Vaughan <gary@gnu.org>
8100 * configure.ac: `rm -f $m4_getopt_h' was lost.
8102 2001-10-04 Gary V. Vaughan <gary@gnu.org>
8104 * configure.ac (TIMESTAMP): Display with AS_BOX at configure
8105 time. Define it for config.h in order to...
8106 * src/main.c (main): ...display the timestamp for --version.
8108 2001-10-04 Akim Demaille <akim@epita.fr>
8110 * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
8111 previous builtins `regexp' and `patsubst'.
8112 (regexp, patsubst): Use them.
8113 (eregexp, epatsubst): New builtins.
8114 * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
8115 (Epatsubst and Patsubst, Eregexp and Regexp): these.
8116 (Extensions): More info on REs.
8118 2001-10-04 Akim Demaille <akim@epita.fr>
8120 * modules/modtest.c (init_handler): Consistently output to stderr.
8121 (finish_handler): New.
8122 (test): The `if' is an `assert'.
8123 * tests/modules.at: Adjust.
8125 2001-10-04 Akim Demaille <akim@epita.fr>
8127 * m4/utility.c (m4_bad_argc): Detail the mismatches.
8129 2001-10-01 Akim Demaille <akim@epita.fr>
8131 * tests/generate.awk: Tag the tests with `documentation'.
8132 * tests/modules.at (AT_CHECK_M4_MODTEST): New.
8133 Use the make the existing modtest tests more uniform, and complete
8134 the set of possibilities.
8136 2001-10-01 Akim Demaille <akim@epita.fr>
8138 * config/gmp.m4: Consult the user before using GMP: use
8140 * configure.ac: Adjust.
8141 * modules/gmp.c: No protection needed as the module is not built
8144 2001-10-01 Akim Demaille <akim@epita.fr>
8146 * tests/generate.awk: Remove debugging code.
8147 (fatal): Specify the current location.
8149 * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
8150 * modules/gnu.c, modules/m4.c: Use M4ARG.
8152 2001-10-01 Akim Demaille <akim@epita.fr>
8154 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
8155 (m4_regexp_compile): New.
8156 (regexp, patsubst): Use it.
8158 2001-09-30 Gary V. Vaughan <gary@gnu.org>
8160 Reinstate the memory handling improvements from the patch I just
8161 reverted. Relevant ChangeLog entries repeated here:
8163 * m4/module.c (m4_module_remove): New function that holds the core
8164 of the old m4_module_unload.
8165 (m4_module_unload): Use it.
8166 (m4_module_unload_all): When we know the modules will never be
8167 used again (i.e. on exit), free up as much module memory as
8168 possible. There are still some artifacts from resident modules
8169 living inside ltdl.c, but everything else is freed.
8170 * m4/debug.c (m4_debug_exit): Free memory allocated in
8172 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
8173 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
8174 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
8175 * m4/m4module.h: Updated prototypes.
8176 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
8177 * m4/hash.h: Updated prototypes.
8178 * src/main.c (main): Use all these new functions to clean up as
8179 much memory as possible before exit.
8181 2001-09-30 Gary V. Vaughan <gary@gnu.org>
8183 Reverted my large patch for removing the old m4_symbol
8184 structure on 2001-09-20. We are still not happy about the way
8185 trace works in conjunction with defn and undefine, and leaving
8186 the reverted patch active prevents us from moving the traced
8187 bit from the definition back to the symbol.
8189 2001-09-30 Gary V. Vaughan <gary@gnu.org>
8191 * configure.in: Moved to...
8192 * configure.ac: ...here. Added a libtool like timestamped
8193 banner, and tidied up the libltdl cruft.
8194 * config/mkstamp: Script to extract a timestamp from ChangeLog.
8195 * modules/Makefile.am (INCLTDL): Removed. This is required
8196 only when libltdl is configured in a subdirectory.
8197 * src/Makefile.am: Ditto.
8198 (LIBADD_DL): No need to add this again, libtool already knows
8199 that libm4.la depends on it.
8200 * m4/Makefile.am: Automake sets variables from AC_SUBST. Use
8203 * TODO: stackovf.c is basically broken.
8204 Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
8206 2001-09-28 Akim Demaille <akim@epita.fr>
8208 * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
8210 2001-09-27 Akim Demaille <akim@epita.fr>
8212 * tests/m4.in: Don't use short options.
8213 Simplify the stderr signature normalization.
8215 2001-09-27 Akim Demaille <akim@epita.fr>
8217 tests/m4 shall be position independent.
8221 * tests/testsuite.at: No args to AT_INIT.
8222 * configure.in, tests/Makefile.am: Adjust.
8224 2001-09-22 Akim Demaille <akim@epita.fr>
8226 Autotest has changed again.
8228 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
8229 (package.m4): Remove.
8230 * configure.in: Adjust to LIBADD_GMP.
8232 2001-09-21 Gary V. Vaughan <gary@gnu.org>
8234 * config/gmp.m4 (AC_ARG_WITH): Removed.
8235 (GMP_LIB): Renamed to LIBADD_GMP for consistency.
8236 (AC_LIB_GMP): When performing a test compile against libgmp,
8237 include the header gmp.h if possible, and link against -lgmp. If
8238 they both work define USE_GMP.
8239 * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
8240 (mpeval_LTX_init_func): Complain on load that there was no libgmp
8243 2001-09-20 Gary V. Vaughan <gary@gnu.org>
8245 * m4/evalparse.c: Moved to...
8246 * modules/evalparse.c: ...here. This code is shared between
8247 modules/mpeval.c and modules/m4.c, so there is no need to pollute
8248 the libm4 API with its details. Moderately rewritten to interface
8249 into its clients more simply.
8250 * m4/eval.c: Deleted. Migrated functionality to...
8251 * modules/m4.c: ...here.
8252 (builtin_eval): Implemented in terms of the new interface style.
8253 * modules/mpeval.c (builtin_mpeval): Ditto.
8254 * m4/m4module.h: Removed references to the former m4/eval.c.
8255 * m4/Makefile.am (libm4_la_SOURCES): Removed eval.c.
8256 (EXTRA_libm4_la_SOURCES): Deleted.
8257 * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
8258 (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
8260 2001-09-20 Akim Demaille <akim@epita.fr>
8262 * config/gmp.m4 (AM_WITH_GMP): Rename as...
8264 By default, use gmp.
8266 * configure.in: Adjust.
8267 Use Automake conditionals for USE_GMP.
8268 Always compute sizeof (long long int).
8269 This was a bug BTW, as `eval' (not `mpeval') depends on it:
8270 before, it was used _only_ if mpeval was not activated.
8271 * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
8272 (mpeval_la_LIBADD): New macros.
8273 * modules/mpeval.c: No longer be conditioned by WITH_GMP.
8275 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
8276 * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
8279 2001-09-20 Akim Demaille <akim@epita.fr>
8281 * tests/Makefile.am (package.m4): New.
8282 * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
8284 2001-09-20 Gary V. Vaughan <gary@gnu.org>
8286 More cleanup. After the last patch, m4_symbol holds nothing but
8287 the head of a chain of m4_token_data. So I have removed the old
8288 m4_symbol, so that m4_token_data chains are stored directly in the
8289 value cell of a hash table node. But there's more... m4_symbol
8290 was a more natural name for the symbol value cell, and now that it
8291 is gone I have renamed the former m4_token_data structure to
8292 m4_symbol. This change turned out to be a pig to get right, since
8293 the original code didn't need to modify the value cell itself,
8294 since changing the chain happened inside the m4_symbol that used
8295 to be returned -- I had to pass the address of the value cell
8296 across various function calls, incase the head value changed. I
8297 also tightened up the memory management to help me find a nasty
8298 memory corruption bug that took me all night to track down...
8300 * m4/m4private.h (struct m4_symbol): Removed.
8301 (struct m4_token_data): Renamed to `struct m4_symbol'. Updated
8303 * m4/hash.c (m4_hash_iterator_value): Return the address of the
8304 value cell. Updated all callers.
8305 * m4/symtab.c: Took advantage of the simplification in the data
8306 structures to rewrite a lot of this file more simply. There is
8307 still some room for optimisation here, but we should tackle that
8308 systematically closer to the release.
8310 * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
8311 revealed. This version is ahead of CVS libtool until I get chance
8312 to flush my changes.
8313 * m4/module.c (m4_module_remove): New function that holds the core
8314 of the old m4_module_unload.
8315 (m4_module_unload): Use it.
8316 (m4_module_unload_all): When we know the modules will never be
8317 used again (i.e. on exit), free up as much module memory as
8318 possible. There are still some artifacts from resident modules
8319 living inside ltdl.c, but everything else is freed.
8320 * m4/debug.c (m4_debug_exit): Free memory allocated in
8322 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
8323 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
8324 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
8325 * m4/m4module.h: Updated prototypes.
8326 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
8327 * m4/hash.h: Updated prototypes.
8328 * src/main.c (main): Use all these new functions to clean up as
8329 much memory as possible before exit.
8331 2001-09-18 Gary V. Vaughan <gary@gnu.org>
8333 The `traced' flag needs to be attached to the definition of a
8334 symbol rather than the current symbol containing the definition.
8335 Implementing this showed up some long standing post 1.4 bugs in
8336 flag propogation which I also fixed.
8338 * m4/m4private.h (struct m4_symbol): Remove the traced flag.
8339 (struct m4_token_data): And add it back in here.
8340 * m4/input.c (init_macro_token): Propogate the traced flag
8342 * m4/macro.c (expand_argument): Ditto.
8343 * tests/builtins.at (trace2, trace3): New tests based on Akim's
8346 2001-09-08 Gary V. Vaughan <gary@gnu.org>
8348 * m4/m4private.h (struct m4_token_data): Simplified by removing
8349 the redundant `traced' flag, and one level of structure nesting.
8350 (M4_TOKEN_DATA_FUNC_TRACED): Removed.
8351 * m4/input.c (init_macro_token): No need to initialise removed
8353 * m4/macro.c (expand_argument): No need to copy it either.
8354 * m4/utility.c (m4_token_data_func_traced): Or provide an access
8357 * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
8358 dependant on multiple symbols with the same key, so preserving
8359 relative symbol order in each bucket during resizing is no longer
8360 required. The resize function is considerably faster as a result.
8362 * m4/m4module.h, m4/builtin.c, m4/symtab.c:
8363 s/m4_symbol_insert/m4_symbol_define/g;
8364 s/m4_builtin_insert/m4_builtin_define/g;
8365 s/m4_macro_insert/m4_macro_define/g. Updated all callers.
8367 2001-09-08 Gary V. Vaughan <gary@gnu.org>
8369 Get rid of m4_symbol_lookup_t entirely. With Akim's earlier
8370 commits, the m4_lookup_symbol dispatch function is split into
8371 specialised functions that must be called directly.
8373 * m4/m4module.h (m4_symbol_lookup_t): Removed.
8374 * m4/symtab.c (m4_lookup_symbol): Removed.
8375 (m4_symbol_builtin, m4_symbol_macro): New functions.
8376 * m4/builtin.c (m4_builtin_define): Split into...
8377 (m4_builtin_pushdef, m4_builtin_insert): ...these.
8378 (m4_macro_define): Split into...
8379 (m4_macro_pushdef, m4_macro_insert): ...these.
8380 * src/main.c (main): Set command line macros from `-D' parameters
8381 using `m4_macro_define'.
8383 2001-09-08 Gary V. Vaughan <gary@gnu.org>
8385 * m4/symtab.c (m4_symtab_remove_module_references): Renamed as
8386 this from m4_remove_table_reference_symbols().
8387 * m4/m4module.h, m4/module.c: Updated all references.
8389 2001-09-07 Akim Demaille <akim@epita.fr>
8391 * modules/stdlib.c, modules/times.c: Misc cleanups.
8393 2001-09-07 Akim Demaille <akim@epita.fr>
8395 * configure.in: We now need Autoconf 2.52e.
8396 * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
8397 and `M4_SYMBOL_DELETE'.
8398 * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
8399 * src/main.c (main): Adjust.
8401 2001-09-06 Gary V. Vaughan <gary@gnu.org>
8403 Fix the obstack.h problem once and for all! At configure time we
8404 can test for a system supplied obstack.h: depending on the
8405 result, we now generate system.h with an #include of the correct
8406 header. As a bonus, I've also added a --with-included-obstack,
8407 incase the user doesn't like the system obstack for some
8408 reason... and also we can test the shipped obstack on a system
8409 that has oe of its own. We also now need to be careful to add
8410 build directories to the include search path, since the generated
8411 system.h will be in the build tree.
8413 * configure.in (AC_CONFIG_FILES): Generate system.h from
8415 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
8416 include the system obstack header or the copy shipped with M4.
8417 Allow the user to override configure and force the build to use
8418 the shipped version.
8419 * m4/system-h.in: New file, template for...
8420 * m4/system.h: ...this. Now deleted.
8421 * m4/m4module.h: Include system.h before everything else.
8422 * src/freeze.c: Ditto.
8423 * m4/Makefile.am (dist-hook): Remove generated system.h.
8424 (INCLUDES): Check builddir for generated headers before checking
8426 * modules/Makefile.am (INCLUDES): Ditto.
8427 * src/Makefile.am (INCLUDES): Ditto.
8429 2001-09-05 Gary V. Vaughan <gary@gnu.org>
8431 * TODO: Remove the items that have been addressed already.
8433 2001-09-05 Akim Demaille <akim@epita.fr>
8435 * src/main.c (main): Standardize --version.
8437 2001-09-05 Akim Demaille <akim@epita.fr>
8439 * modules/format.c (format): Have a bigger `str'.
8441 2001-09-05 Akim Demaille <akim@epita.fr>
8443 Rationalize warnings, reporting the macro name as if it were a
8444 program name, and assertions.
8446 * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
8448 * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
8450 Use assert for internal errors.
8451 * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
8453 * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
8455 * tests/builtins.at (pushpop): Adjust.
8457 2001-09-05 Akim Demaille <akim@epita.fr>
8459 * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
8462 2001-09-05 Akim Demaille <akim@epita.fr>
8464 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
8465 * m4/macro.c, m4/symtab.c: Adjust.
8467 2001-09-05 Akim Demaille <akim@epita.fr>
8469 * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
8470 (m4_symbol_pop, m4_symbol_del): this.
8471 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
8472 (m4_symbol_popdef, m4_symbol_delete): New.
8473 (m4_lookup_symbol): Adjust.
8474 * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
8476 2001-09-05 Akim Demaille <akim@epita.fr>
8478 * m4/m4module.h (m4_symbol_lookup): Rename as...
8479 (m4_symbol_lookup_t): this.
8481 2001-09-05 Akim Demaille <akim@epita.fr>
8483 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
8485 * m4/symtab.c (m4_lookup_symbol): Adjust.
8487 2001-09-03 Gary V. Vaughan <gary@gnu.org>
8489 Bootstrap will now work with Libtool 1.4.1 or higher:
8490 * bootstrap: Remove stale autom4te.cache files when
8492 * config/Makefile.am (ACLOCAL_MACROS): Add ltdl.m4 and
8494 * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
8495 libtool.m4 directly.
8496 Run libtoolize to refresh ltmain.sh.
8497 * config/ltmain.sh: Deleted.
8498 * acinclude.m4: Deleted.
8499 * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
8501 * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
8502 implementation for the cvs impaired libtool user.
8504 2001-09-03 Akim Demaille <akim@epita.fr>
8506 * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
8508 Avoid using `default' in switch, as it hides useful compiler
8509 warnings when a case is forgotten.
8511 2001-09-03 Akim Demaille <akim@epita.fr>
8513 * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
8514 is no such thing as `WITH_MODULES'.
8516 2001-09-03 Akim Demaille <akim@epita.fr>
8518 Improve the test suite's selfcontainedness.
8520 * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
8521 (Include, Undivert): Tag the other input files.
8522 * tests/generate.awk: Catch `@comment file:'.
8523 `-I $src' is no longer needed.
8524 `next' is really like `return': the rest is skipped.
8525 Adjust to `input.m4'.
8526 (fatal): New function.
8527 * tests/foo, tests/incl.m4: Remove.
8529 2001-09-01 Gary V. Vaughan <gary@gnu.org>
8531 The shadowing mechanism and, infact, the whole symbol table
8532 implementation was creaking under the weight of the features piled
8533 on top of it. We now have a separate hash table module which will
8534 dynamically resize to keep symbol density withing good performace
8535 limits, and a new symtab module layered above it. Symbol lookups
8536 are now marginally more efficient (since the shadowed flag is no
8537 longer required) and symbol removal, such as on module unload, is
8538 considerably faster due to a reorganisation of the data structures
8541 * src/main.c (main): Don't mention `-H'.
8542 * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
8545 * m4/hash.c: New generalised dynamic hash table data structure
8547 * m4/hash.h: Public interface.
8548 * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
8549 (libm4_la_SOURCES): Add hash.c.
8550 * m4/symtab.c: More or less rewritten from scratch, within the
8551 bounds of the previous API.
8552 (m4_symtab_apply): A cleaner version of the old hack_all_symbols
8553 call. Updated all callers.
8554 * m4/m4module.c: #include <m4/hash.h>, and changed all affected
8555 declarations to reflect API changes.
8556 (M4INIT): Generate a declaration too, to avoid the warning with
8557 --enable-debug builds.
8560 * m4/utility.c (hash_table_size): Removed.
8561 (m4_dump_symbols): Rewritten to build and qsort an array of symbol
8562 names, which are then looked up by builtin_dumpdef() as necessary.
8563 This implies a small speedup in builtin_symbols(), which discarded
8564 all of the symbol info under the old call.
8565 * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
8566 shadowing is implicit in respect to the new data structures.
8567 symbol names are no longer duplicated here, they are stored in the
8568 key field of the hash table.
8569 Moved macro_args and blind_no_args...
8570 (m4_token_data): ...to here.
8571 m4/macro.c (expand_macro): Added a name argument since the symbol
8572 name is no longer copied into each struct m4_symbol. Modified all
8574 (collect_arguments): Ditto.
8575 * modules/m4.c (set_trace): Ditto.
8576 * modules/gnu.c (builtin_symbols): Updated.
8577 * src/freeze.c (produce_symbol_dump): Much improved in light of
8578 the improved symbol table layout.
8580 2001-09-01 Gary V. Vaughan <gary@gnu.org>
8582 * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
8584 (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
8585 (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
8586 SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
8587 SYMBOL_HANDLE): Ditto.
8588 * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
8589 modules/gnu.c, modules/m4.c, src/freeze.c,
8590 src/main.c: Updated all references.
8592 * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
8593 Automake 1.5 chokes on dynamic source file lists, Besides, it is
8594 already listed in m4_LDADD... how did that ever used to work?
8595 * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
8597 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
8598 Suggested by Tim Van Holder <tim.van.holder@pandora.be>
8600 * tests/m4: Don't call the m4 wrapper script with libtool, it
8601 works fine all by itself.
8603 2001-08-30 Gary V. Vaughan <gary@gnu.org>
8605 The experimental `changeword' feature never took off, and has
8606 no obvious advantages over `changesyntax' to compensate the
8607 enormous speed penalty it carries:
8608 * configure.in (ENABLE_CHANGEWORD): Removed.
8609 * m4/m4module.h (m4_set_word_regexp): Removed.
8610 * m4/m4private.h (m4_token_data): Removed original_text field.
8611 * m4/utility.c (m4_token_data_orig_text): Removed.
8612 * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
8613 * m4/macro.c: Ditto.
8614 * src/main.c: Ditto.
8615 * modules/Makefile.am (changeword.la): Removed.
8616 * modules/changeword.c: File removed.
8617 * doc/m4.texinfo: References to changeword and --word-regexp
8619 * po/POTFILES.in: modules/changeword.c removed.
8620 * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
8621 * tests/builtins.at (changeword): Test removed.
8623 2001-08-30 Akim Demaille <akim@epita.fr>
8625 * bootstrap.sh: Create aclocal.m4 instead of modifying it.
8626 This also help having a single list of m4 files: in
8628 * config/Makefile.am (STANDARD_MACROS): Rename as...
8629 (ACLOCAL_MACROS): this.
8630 (list-standard-macros): Remove.
8633 2001-08-29 Gary V. Vaughan <gary@gnu.org>
8635 In an attempt to moderate my egomania...
8636 * tests/modules.at: Remove attributions.
8638 * tests/generate.awk: When making substitutions to "@&t@", either
8639 "&" or "\&" in the substitution string argument to gsub refer back
8640 to the matched text. "@\\&t@" seems to work though, Tests 43 and
8643 2001-08-29 Akim Demaille <akim@epita.fr>
8645 * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
8646 (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
8647 (sync-lines, trace, translit, undivert, wrap): Move to...
8648 * tests/builtins.at: this new file.
8649 * tests/others.at (Discard comments, import-environment): Move to...
8650 * tests/options.at: this new file.
8652 2001-08-29 Akim Demaille <akim@epita.fr>
8654 * tests/others.at (Freezing modules)
8655 (--module-directory: absolute path, modpath2, modpath3)
8656 (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
8657 * tests/modules.at: here, new file.
8658 * tests/others.at, tests/generate.awk: Add a banner.
8659 * tests/testsuite.at: Adjust.
8660 (AT_CHECK_M4_FILTER): New, but unused.
8662 2001-08-29 Akim Demaille <akim@epita.fr>
8664 * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
8666 * tests/others.at (wrap): Inline wrap.m4.
8667 (shadow): Inline shadow.m4.
8668 (iso8859): Don't specify the path from top_srcdir, but from srcdir.
8669 * tests/m4: Simplify.
8671 2001-08-29 Akim Demaille <akim@epita.fr>
8673 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
8676 2001-08-29 Akim Demaille <akim@epita.fr>
8678 * tests/generate.awk (normalize): s/@__@/@&t@/.
8680 2001-08-28 Akim Demaille <akim@epita.fr>
8682 * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
8684 2001-08-28 Gary V. Vaughan <gary@gnu.org>
8686 * bootstrap (generate.awk): Generate test cases with new script.
8688 2001-08-27 Akim Demaille <akim@epita.fr>
8690 * tests/Makefile.am (installcheck-local): Don't use
8691 `dc_install_base' which is not visible here, but `exec_prefix'
8692 which is clearly the RT anyway.
8693 * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
8694 related to testing a now installed m4.
8695 * tests/m4: Do it here.
8697 2001-08-27 Akim Demaille <akim@epita.fr>
8699 * tests/others.at (indir): Formatting change.
8701 2001-08-27 Akim Demaille <akim@epita.fr>
8703 * tests/Makefile.am (installcheck-local): New.
8704 * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
8706 Prefer options over envvars.
8707 * src/main.c (main): First bug caught by the test suite (yeah!):
8708 --batch lacked a `break' which resulted in an accidental
8709 invocation of --discard-comments.
8711 2001-08-27 Akim Demaille <akim@epita.fr>
8713 * tests/others.at (capitalize, changeword, comments, ddivert)
8714 (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
8715 (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
8716 (sysv-args, trace, translit, undivert): Don't rely on files in
8717 examples/: AT_DATA them.
8719 2001-08-27 Akim Demaille <akim@epita.fr>
8721 Let the test suite use a wrapper around the not installed m4 to
8722 pretend it is (installed).
8724 * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
8725 such a way that m4 does not process them.
8726 * configure.in: The package name seems to be `m4', not `M4'.
8728 * tests/atlocal.in (at_package, M4): Remove.
8729 * tests/testsuite.at, tests/others.at: Use m4, not $M4.
8731 2001-08-27 Akim Demaille <akim@epita.fr>
8733 * tests/Makefile.am (CLEANFILES): Remove.
8734 (DISTCLEANFILES, clean-local): New.
8735 * examples/mktests.sh: Remove.
8737 2001-08-27 Akim Demaille <akim@epita.fr>
8739 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
8740 Don't use aclocal: it's written by hand.
8741 * aclocal.m4: m4_include all the files instead of being built by
8743 * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
8744 until it reads the traces by itself.
8745 * configure.in: Require Autoconf 2.42c as we are now using
8746 AC_CONFIG_TESTDIR instead of AT_CONFIG.
8747 Catch unexpanded `jm_' macros.
8748 * config/atconfig.m4: Remove.
8749 * config/error.m4: new.
8750 * config/Makefile.am: Ship the files included by aclocal.m4.
8751 * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
8752 (TESTSUITE_AT): this, to please Automake.
8753 (TESTSUITE): This target uses autotest/autotest.m4, not
8754 autotest/general.m4.
8755 * tests/testsuite.at: Prereq Autotest 2.52c.
8756 * examples/Makefile.am (pkgdata_DATA): Rename as...
8757 (dist_pkgdata_DATA): this.
8758 * doc/Makefile.am (man_MANS): Rename as...
8759 (dist_man_mans): this.
8761 2001-08-20 Gary V. Vaughan <gary@gnu.org>
8763 * m4/system.h [cygwin*]: Thanks to Paul Sokolovsky and
8764 Robert Collins, building on Cygwin no longer requires Windows
8765 import and export symbol decorations.
8766 * m4/m4module.h (M4_SCOPE) [cygwin*]: Deleted all occurences.
8767 * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
8768 * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8769 * m4/error.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8770 * m4/input.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8771 * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8772 * m4/output.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8773 * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8774 * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8775 * configure.in (LIBM4_DLL_IMPORT) [cygwin*]: Don't set this
8777 * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
8778 * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
8780 2001-08-20 Gary V. Vaughan <gary@gnu.org>
8782 Ansify the source. Previously we had a mix, where my code was
8783 in a K&R compatible style, and the preexisting code was in ANSI
8784 style. Nothing is lost wrt release 1.4 by reverting to ANSI,
8785 and now the code base is much cleaner.
8787 * m4/system.h: Remove M4_PARAMS macro and all users. Remove
8788 VOID macro and all users.
8789 * m4/m4module.h: Ansify function prototypes and headers.
8790 * m4/builtin.c: Ditto.
8791 * m4/evalparse.c: Ditto.
8792 * m4/input.c: Ditto.
8793 * m4/macro.c: Ditto.
8794 * m4/module.c: Ditto.
8795 * m4/output.c: Ditto.
8797 * m4/symtab.c: Ditto.
8798 * m4/utility.c: Ditto.
8799 * modules/format.c: Ditto.
8800 * modules/gnu.c: Ditto.
8801 * modules/m4.c: Ditto.
8802 * modules/mpeval.c: Ditto.
8803 * src/freeze.c: Ditto.
8805 * src/main.c: Ditto.
8807 2001-08-20 Akim Demaille <akim@epita.fr>
8809 * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
8810 generated with stock 2.52.
8812 2001-08-20 Akim Demaille <akim@epita.fr>
8814 * config/atconfig.m4: New, until part of Autoconf per se.
8815 * configure.in (AT_CONFIG): Use it.
8817 * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
8818 * tests/atlocal.in: New.
8819 * tests/generate.awk: For the time being, the empty quadrigraph is
8821 * tests/others.at (changeword, gmp): Check the configuration
8822 variable against `yes'.
8823 * tests/testsuite.at (dnl): Allow it, as it's used all over the
8826 2001-08-20 Akim Demaille <akim@epita.fr>
8828 * m4/utility.c (m4_numeric_arg): Spell out the culprit.
8829 * modules/m4.c (undivert): Disable the possibility of undiverting
8830 several files at once: it is not documented, it is inconsistent
8831 with the other macros, it can be straightforwardly mocked by
8832 several invocations, and most importantly, it prevents the
8833 possibility of other kinds of extension.
8834 Use `m4_numeric_arg'.
8836 2001-08-20 Akim Demaille <akim@epita.fr>
8838 * examples/include.m4: Typo.
8839 * tests/generate.awk: Really add it.
8840 * tests/Makefile.am: Adjust.
8841 * tests/others.at (Discard comments): It sure fails without `-c'.
8842 (include, undivert): Add -I examples/.
8844 2001-08-20 Akim Demaille <akim@epita.fr>
8846 Use sprintf, not ecft and friends since it is standard, portable,
8847 simplifies the code, and since the latter is even deprecated
8848 according to the GNU libc documentation.
8850 * modules/format.c: Drop evct support.
8852 2001-08-19 Gary V. Vaughan <gary@gnu.org>
8854 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up. Don't test
8856 * configure.in: ...do it here instead.
8858 * c-boxes.el: Deleted.
8859 * m4/builtin.c: Reformat box comments to be closer to GNU
8861 * m4/debug.c: Ditto.
8863 * m4/evalparse.c: Ditto.
8864 * m4/input.c: Ditto.
8865 * m4/m4module.h: Ditto.
8866 * m4/macro.c: Ditto.
8867 * m4/output.c: Ditto.
8868 * m4/symtab.c: Ditto.
8869 * m4/utility.c: Ditto.
8870 * modules/changeword.c: Ditto.
8871 * modules/format.c: Ditto.
8872 * modules/gnu.c: Ditto.
8873 * modules/load.c: Ditto.
8874 * modules/m4.c: Ditto.
8875 * modules/modtest.c: Ditto.
8876 * modules/mpeval.c: Ditto.
8877 * modules/perl.c: Ditto.
8878 * modules/shadow.c: Ditto.
8879 * modules/stdlib.c: Ditto.
8880 * modules/time.c: Ditto.
8881 * src/freeze.c: Ditto.
8882 * src/main.c: Ditto.
8884 2001-08-17 Gary V. Vaughan <gary@gnu.org>
8886 * m4/module.c: Fixup some errors in the description comment.
8888 2001-08-17 Akim Demaille <akim@epita.fr>
8890 * tests/others.at (iso8859): Specify the path to the M4 test file.
8891 * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
8892 files in error messages.
8894 2001-08-17 Akim Demaille <akim@epita.fr>
8896 * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
8897 * tests/others.at: Adjust input files paths.
8898 * tests/atconfig.in: Set top_builddir.
8899 * tests/Makefile.am: Adjust.
8900 `testsuite' is in src, not build.
8902 2001-08-17 Akim Demaille <akim@epita.fr>
8904 * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
8905 (generate.at): Install a temporary hack until the actual
8906 generate.awk is added to the repository.
8907 * tests/atconfig.in: New.
8909 2001-08-17 Akim Demaille <akim@epita.fr>
8911 Really apply the patch ``Drop Autoconf 2.13 compatibility.''
8913 2001-08-17 Akim Demaille <akim@epita.fr>
8915 * doc/m4.texinfo: Promote proper quotation.
8917 2001-08-17 Akim Demaille <akim@epita.fr>
8919 Remove the non Autotest tests.
8921 * tests/other-tests/capitalize.test,
8922 * tests/other-tests/changeword.test,
8923 * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
8924 * tests/other-tests/debug.test,
8925 * tests/other-tests/discard-comments.m4,
8926 * tests/other-tests/discard-comments.test,
8927 * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8928 * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8929 * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8930 * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
8931 * tests/other-tests/hanoi.test,
8932 * tests/other-tests/import-environment.m4,
8933 * tests/other-tests/import-environment.test,
8934 * tests/other-tests/include.test, tests/other-tests/indir.test,
8935 * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
8936 * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
8937 * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
8938 * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
8939 * tests/other-tests/modtest.test,
8940 * tests/other-tests/multiquotes.test,
8941 * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
8942 * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
8943 * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
8944 * tests/other-tests/sync-lines.m4,
8945 * tests/other-tests/sync-lines.test,
8946 * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8947 * tests/other-tests/translit.test, tests/other-tests/undivert.test,
8948 * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8949 * tests/other-tests/wrap.test: Remove.
8951 * tests/run-test, tests/get-them: Remove.
8952 * tests/Makefile.am: Adjust.
8954 2001-08-17 Akim Demaille <akim@epita.fr>
8956 others.at no longer depends on other-tests/.
8958 * tests/others.at (stackovf): You're actually...
8960 (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
8961 (unload.test): Keep their authorship.
8962 (discard-comments, gmp, import-environment, modfreeze)
8963 (sync-lines): Embed the input files.
8964 * tests/stackovf.test: Copy from other-tests/stackovf.test.
8965 * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
8967 2001-08-17 Akim Demaille <akim@epita.fr>
8969 * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
8970 (M4exit): Tag the exit status of the example.
8971 * tests/get-them: Adjust.
8972 * tests/generate.awk: New, based on get-them.
8973 * tests/Makefile.am: Adjust to generate `generated.at'.
8974 * tests/testsuite.at: Adjust.
8975 (AT_CHECK_M4): Don't overquote. Blush...
8977 2001-08-17 Akim Demaille <akim@epita.fr>
8979 Start using Autotest. atconfig creation is still lacking.
8981 * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
8982 * examples/reverse.m4, tests/other-tests/import-environment.m4,
8983 * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
8984 * tests/other-tests/import-environment.test: Don't check LANGUAGE
8985 as it might be `unset', or set to `C'.
8986 * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
8987 * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8988 * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8989 * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
8990 * tests/other-tests/shadow.test: Adjust.
8991 * tests/testsuite.at, tests/others.at: New.
8992 * tests/Makefile.am: Adjust.
8994 2001-08-17 Akim Demaille <akim@epita.fr>
8996 Drop Autoconf 2.13 compatibility.
8998 * configure.in (changeword): No need to undefine it, as anyway if
8999 it's defined, M4sugar moved it as m4_changeword.
9000 And anyway, proper quotation is enough.
9001 (m4_pattern_allow): As it exists in 2.50, just use it.
9002 (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
9003 Don't handle Gettext's duties, let it handle them.
9004 * config/gnu-obstack.m4: Use m4_pattern_allow directly.
9006 2001-08-17 Akim Demaille <akim@epita.fr>
9008 * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
9009 (m4_errprint): Use fputs.
9010 * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
9011 dumpdef are not concerned.
9012 (Dumpdef, Errprint): Emphasize their insensitivity to
9014 * doc/Makefile.am: Add `TAGS' support.
9015 (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
9017 * config/Makefile.am (MAINTAINERCLEANFILES): New.
9019 2001-08-17 Akim Demaille <akim@epita.fr>
9021 * modules/Makefile.am (ETAGS_ARGS): New.
9023 2001-08-17 Akim Demaille <akim@epita.fr>
9025 * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
9028 2001-08-17 Akim Demaille <akim@epita.fr>
9030 * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
9032 2001-08-17 Akim Demaille <akim@epita.fr>
9034 * m4/m4module.h (m4/list.h): Don't include it.
9036 2001-08-16 Gary V. Vaughan <gary@gnu.org>
9038 m4_modules are no more, we use lt_dlhandles directly and let
9039 latest libltdl features manage the list of loaded modules.
9040 * acinclude.m4: Regenerated.
9041 * m4/ltdl.c: Updated from master copy.
9042 * m4/module.c: Reimplemented to take advantage of advances in
9044 * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
9045 list with lt_dlhandle_next.
9046 (m4_builtin_find_by_func): Ditto.
9047 (m4_builtin_table_install): Use lt_dlhandle.
9048 (m4_macro_define): Ditto.
9049 (m4_macro_table_install): Ditto.
9050 m4/module.h: Prototype new module management API.
9051 (m4_modules): No longer required.
9052 (m4_module_init_t, m4_module_finish_t): POSIX namespace
9053 violations, renamed to...
9054 (m4_module_init_func, m4_module_finish_func): ...these,
9056 (M4INIT_HANDLER): Clean way to declare init functions in modules.
9057 (M4FINISH_HANDLER): And similarly for finish functions.
9058 * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
9059 -- Add indirection to the CONC macro so that arguments are
9061 * modules/modtest.c (m4_init_module): Replaced with M4INIT_HANDLER.
9062 * modules/shadow.c (m4_init_module): Ditto.
9063 Due to new init function semantics, be careful to perform the
9064 initialisation only on first load.
9065 * modules/perl.c (m4_init_module): Ditto. And Ditto.
9066 (m4_finish_module): Replaced with M4FINISH_HANDLER.
9067 Due to new finish function semantics, be careful to perform the
9068 finalisation only on first load.
9069 * m4/m4private.h (m4_module): Removed in favour of...
9070 (m4_module_data): ...structure without all the wrapper fields.
9071 Instances of this new structure are stored associated lt_dlhandles
9072 with lt_dlcaller_data_set().
9073 * m4/builtin.c (m4_builtin_define): Takes a handle argument
9074 instead of the old module argument.
9075 (m4_builtin_table_install): Ditto.
9076 * modules/load.c (m4_resident_module): Removed. This is no
9077 longer implemented as a magic symbol...
9078 * modules/m4.c (m4_resident_module): Ditto.
9079 * modules/load.c (M4INIT_HANDLER): ...the module init function now
9080 uses the ltdl api to make the module resident.
9081 * modules/m4.c (M4INIT_HANDLER): Ditto.
9082 * modules/load.c (builtin_modules): Traverse the loaded module
9083 list with lt_dlhandle_next.
9084 (builtin_load): Much simplified in light of the reimplemented
9086 * src/freeze.c (produce_module_dump): Cleaned up and optimised in
9087 light of the m4/module.c rewrite.
9088 (produce_symbol_dump): Ditto.
9089 (reload_frozen_state): Ditto.
9090 * m4/list.c, m4/list.h: Files deleted. No longer required.
9091 * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
9092 (libm4_la_SOURCES): Delete list.c reference.
9093 * m4/m4private.h (m4_token_data): Add a handle field. This
9094 eliminates many of the searches to find the handle associated with
9095 various tokens that are passed between functions.
9096 (struct m4_symbol): Removed the module field. The
9097 module association does not belong with the symbol...
9098 * m4/input.c (struct m4_builtin): ...it belongs with the builtin
9099 that the module implementation code is from. Added a handle
9101 (m4_push_macro): Add a `handle' argument. Changed all callers.
9102 (init_macro_token): Set the `handle' field for the
9104 * m4/macro.c (expand_argument): Copy the new handle field during
9106 * modules/m4.c (macro_install): Use the new handle field to
9107 optimise the search for the correct builtin structure, and pass
9108 the handle details to m4_builtin_define.
9110 2001-08-15 Akim Demaille <akim@epita.fr>
9112 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
9113 when creating `m4/obstack.h'.
9114 * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
9116 * tests/defs: Make them absolute.
9117 (CDPATH) Neutralize.
9118 * tests/gethem: Use them.
9120 2001-08-14 Gary V. Vaughan <gary@gnu.org>
9122 * config/ltmain.sh: Doh! Import again for a quoting fix that
9123 prevented any regression test from passing.
9125 * m4/m4module.h (obstack.h): Choose between installed version
9126 and shipped version based on configure tests.
9127 * src/freeze.c (obstack.h): Ditto.
9129 * acconfig.h: Removed. No longer required.
9131 * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
9132 * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
9133 them to AC_INIT and AM_INIT_AUTOMAKE.
9134 * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
9135 disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
9136 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
9137 shell variable m4_cv_func_obstack_h.
9138 * tests/defs (M4): Be more careful about relative path to libtool
9139 script and m4 binary by using $srcdir.
9141 * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
9142 optargs to the existing libltdl search path.
9143 * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
9144 * m4/ltdl.c: Updated.
9146 * config/ltmain.sh: Ditto.
9148 2001-08-11 Gary V. Vaughan <gary@gnu.org>
9150 * src/main.c (main): Add `-b' (for `batch') mode switch to force
9151 interactive mode off.
9153 2001-08-10 Akim Demaille <akim@epita.fr>
9155 * configure.in: Require Autoconf 2.52.
9156 (AC_ARG_PROGRAM): Remove, handled by Automake.
9157 (m4_getopt): Rename as...
9158 (m4_getopt_h): this.
9159 Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
9160 Undefine `changeword' only if defined.
9161 * config/gnu-obstack.m4: Require Autoconf 2.52.
9162 (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
9165 2001-08-09 Yuji Minejima <ggb01164@nifty.ne.jp>
9167 * doc/m4.texinfo: Fix some typos, and apply some small
9170 2001-08-09 Andreas Schwab <schwab@suse.de>
9172 * src/main.c (main): Fix improper uses of error (missing format
9175 2001-08-07 Akim Demaille <akim@epita.fr>
9177 Improve `make distcheck'.
9179 * configure.in: Be sure to be able to run `mkconfig.sh' when src
9181 * Makefile.am (dist-hook): Remove, as it is no longer needed.
9182 * doc/m4.texinfo (Include): Add missing blank.
9183 * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
9186 2001-08-07 Akim Demaille <akim@epita.fr>
9188 * m4/evalparse.c: A better introductory comment.
9189 * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
9190 * m4/macro.c: Adjust old comments.
9191 * modules/README: Typo.
9193 2001-08-07 Akim Demaille <akim@epita.fr>
9195 * config/gnu-obstack.m4: New.
9197 2001-08-07 Akim Demaille <akim@epita.fr>
9199 * config/Makefile.am, config/stackovf.m4: New.
9200 * configure.in, Makefile.am: Adjust.
9202 2001-08-05 gettextize <bug-gnu-utils@gnu.org>
9204 * po/Makefile.in.in: Upgrade to gettext-0.10.39.
9205 * po/cat-id-tbl.c: Remove file.
9206 * po/stamp-cat-id: Remove file.
9208 2001-04-08 Roderick Koehle <Roderick.Koehle@infineon.com>
9210 * modules/format.c (format): Formatting for %f was not
9211 interpreting the position of the decimal point correctly for
9214 2000-12-01 Gary V. Vaughan <gary@gnu.org>
9216 * TODO: Removed m4exit bug.
9217 * modules/load.c (m4_resident_module): Make this module resident.
9218 * module/m4.c (m4_resident_module): Ditto.
9219 * m4/modules.c (m4_module_load): Use new ltdl resident modules
9220 feature to mark modules as resident if they export
9221 `m4_resident_module' as TRUE.
9222 (m4_module_unload): Do not remove resident modules, and take care
9223 with symbol insertion and deletion with resident modules.
9224 * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
9225 use resident modules feature.
9227 2000-11-30 Gary V. Vaughan <gary@gnu.org>
9229 * TODO: Updated. Removed some cruft that has since been fixed
9230 or implemented. Added some more entries.
9233 * modules/README: Updated.
9234 * doc/m4.texinfo: Updated.
9236 * modules/gnu.c (builtin_functions): Make indir orthogonal to
9237 builtin, in that each is recognised as a macro only with parameters
9238 (builtin_indir): Passing 0 arguments is now an error, as with
9241 * src/main.c (usage): Added missing description of `-c' option.
9243 2000-11-29 Gary V. Vaughan <gary@gnu.org>
9245 Consolidate the myriad of dispersed test scripts into the
9246 tests subdirectory. I think I now have all the file where I
9247 want them, so there shouldn't be anymore upheaval =)O|
9249 * tests/Makefile.am: Updated to run the new tests added below.
9250 * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
9251 tests/other-tests/ddivert.test, tests/other-tests/debug.test,
9252 tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
9253 tests/other-tests/foreach.test, tests/other-tests/forloop.test,
9254 tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
9255 tests/other-tests/hanoi.test, tests/other-tests/include.test,
9256 tests/other-tests/indir.test, tests/other-tests/misc.test,
9257 tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
9258 tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
9259 tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
9260 tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
9261 tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
9262 tests/other-tests/reverse.test, tests/other-tests/shadow.test,
9263 tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
9264 tests/other-tests/translit.test, tests/other-tests/undivert.test,
9265 tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
9266 tests/other-tests/wrap.test: New tests based on the contents
9267 of the tests removed below.
9268 * examples/Makefile.am, modules/Makefile.am: Updated to
9269 reflect removed tests.
9270 * examples/defs,modules/defs: Removed.
9271 * examples/capitalize.test, examples/comments.test,
9272 examples/ddivert.test, examples/debug.test,
9273 examples/esyscmd.test, examples/exp.test,
9274 examples/foreach.test, examples/forloop.test,
9275 examples/fstab.test, examples/hanoi.test,
9276 examples/include.test, examples/indir.test,
9277 examples/misc.test, examples/multiquotes.test,
9278 examples/patsubst.test, examples/pushpop.test,
9279 examples/regexp.test, examples/reverse.test,
9280 examples/sysv-args.test, examples/trace.test,
9281 examples/translit.test, examples/undivert.test,
9282 examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
9283 modules/modpath1.test, modules/modpath2.test,
9284 modules/modpath3.test, modules/modpath4.test,
9285 modules/modtest.test, modules/shadow.test,
9286 modules/unfrozen.m4, modules/unload.test: Removed.
9288 Move the implementation of GMP support for the mpeval() builtin
9289 into a loadable module that depends on libgmp. mpeval() and
9290 eval() share a common parser, now in m4/evalparser.c; the code
9291 in m4/numb.c and m4/numb.h is now physically split between
9292 m4/eval.c (the eval() backend) and modules/mpeval.c (the
9293 mpeval() backend), rather than being differentiated by cpp
9294 macros and multiple inclusion. The mpeval module is always
9295 built but will generate an diagnostic if it is used from an
9296 installation that didn't link in the gmp library.
9297 * modules/Makefile.am: build and install the new mpeval module.
9298 * modules/mpeval.c: Now contains the former parts of m4/numb.c
9299 and m4/numb.h that are required for gmp support in mpeval().
9300 * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
9301 * m4/evalmp.c: Removed.
9302 * m4/m4module.h: Removed conditional prototype for
9304 * m4/eval.c: Rewritten. Contains the former parts of m4/numb.c
9305 and m4/numb.h that do not rely on gmp.
9306 * m4/evalparse.c: New file, contains the shared parts of the
9307 eval() and evalmp() parser implementations, and is no longer
9308 unencumbered by cpp magic to uncover the right parts.
9309 * m4/numb.h: Removed. It's former contents are split between
9310 m4/eval.c and modules/mpeval.c.
9313 * tests/other-tests/changeword.test: New test. Rudimentary
9314 testing of changeword builtin runs only if --wnable-changeword
9315 was used at configure time.
9316 * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
9317 alternation correctly. Split into two expressions to compensate.
9318 * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
9319 * modules/Makefile.am: Build changeword module.
9320 * modules/changeword.c (m4_macro_table): Define __m4_changeword__
9321 only when --enable-changeword was passed to configure.
9322 (builtin_changeword): If --enable-changeword was not used, then
9323 report that changeword() builtin has no support in m4 binary.
9325 2000-11-28 Gary V. Vaughan <gary@gnu.org>
9327 * src/main.c (main): Fixed a particularly nasty bug is
9328 user_search_path setting -- the -M flag processing must be
9329 extremely careful with search path ordering, or else the default
9330 installed module directory (possibly containing modules from a
9331 previous release) is placed earlier in the search path than any -M
9332 arguments (which are relied upon to load uninstalled modules with
9333 most of the tests in the regresion suite).
9335 * modules/load.c (builtin_load): Nasty hack to prevent adding
9336 symbols to symtab again if a module is loaded more than once.
9337 * modules/m4.c (builtin_ifelse): removed unused variable argv0.
9339 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed a
9340 possible NULL pointer dereference.
9342 * m4/module.c (m4_module_find_by_modname): Renamed from
9343 m4_module_modname_find. Fixed all references.
9344 (m4_module_find_by_builtin): New function.
9346 * modules/modfreeze.test: load the `load' module with each
9348 * src/freeze.c (produce_frozen_state): Simplified in light of
9349 module field in m4_symbol. Allow a third argument for text macros
9350 to name the originating module.
9351 (reload_frozen_state): ditto.
9352 * m4/m4module.h: Fixup prototypes.
9353 * m4/builtin.h (m4_builtin_define): Add a module argument so
9354 that symbols can be registered against the defining module.
9355 (m4_macro_define): ditto.
9356 * m4/m4private.h (m4_symbol): Make the module field const to save
9357 on casting in the rest of the code.
9358 (SYMBOL_MODULE): New macro.
9360 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
9361 symbol reference maintenance bugs when removing a symbol from the
9364 * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
9366 2000-11-27 Gary V. Vaughan <gary@gnu.org>
9368 * configure.in (m4_cv_func_obstack): A better check for whether
9369 libc has an obstack implementation.
9370 * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
9372 * configure.in (--with-modules): Changed semantics. This
9373 option is now used to list modules to be preopened.
9374 * src/m4.h: #include "ltdl.h" unconditionally.
9375 * src/main.c: Removed all dependencies on WITH_MODULES.
9376 * src/freeze.c: ditto.
9377 * modules/Makefile.am: ditto.
9378 * m4/m4.c (builtin_m4exit): ditto.
9379 * modules/modpath1.test: ditto.
9380 * modules/modpath2.test: ditto.
9381 * modules/modpath3.test: ditto.
9382 * modules/modpath4.test: ditto.
9383 * modules/modtest.test: ditto.
9384 * modules/shadow.test: ditto.
9385 * modules/unload.test: ditto.
9387 * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
9388 comes up on demand in LTLIBOBJS now.
9389 * configure.in (getopt_long): Creating and relying on a link for
9390 getopt.h on hosts with no getopt_long() of thier own works
9391 correctly now. This is necessary so that callers of getopt_long()
9392 can simply `#include <getopt.h>': the naive way of doing this
9393 would end up using our own getopt.h and the installed
9394 getopt_long(), which is asking for trouble!
9395 (obstack_init): A similar argument applies to obstack.h and
9398 * m4/ltdl.c: Upgraded to latest bleeding edge version again.
9399 On Solaris-2.5 (at least) the native dlopen implementation
9400 gets confused about m4.o when looking for module "m4". This
9401 version always looks for .la an .$lib_ext suffixed names first
9402 to work around the problem. Sigh.
9404 * po/POTFILES.in: Take account of these file movements.
9405 * src/Makefile.am (m4_SOURCES): removed eval.c.
9406 (EXTRA_m4_SOURCES): removed numb.c and numb.h.
9407 * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
9408 (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
9409 * modules/m4.c (builtin_eval): Use m4_evaluate().
9410 * m4/eval.c: Moved here from src/eval.c to facilitate
9411 implementation of eval() builtin as part of the `m4' loadable
9413 (m4_evaluate): renamed from evaluate for namespace cleanliness.
9414 * m4/numb.c: Moved here from src/numb.c, since it is #included
9415 into eval.c at compile time.
9416 * m4/m4module.h (m4_evaluate): Added prototype.
9417 * src/m4.h (evaluate): Removed prototype.
9419 2000-11-25 Gary V. Vaughan <gary@gnu.org>
9421 * modules/perl.c (builtin_perleval): Use PL_na for
9422 compatibility with perl-5.6.
9424 * src/main.c (main): It is now safe to
9425 ``m4_module_install("m4")'', without tripping over the m4
9427 * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
9428 versions having fixed the insidious module search order bug.
9430 * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
9431 supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
9433 * configure.in: Figure out whether to use the installed
9434 getopt.h or the supplied one.
9435 * src/Makefile.am: ditto.
9437 * po/POTFILES.in: List files in their new positions.
9439 * config/ltmain.sh: This needs to be checked in to match the
9440 libtool macros copied to acinclude.m4 (until a released
9441 libtool copes with m4's needs).
9442 * bootstrap: Run gettextize.
9444 2000-11-24 Gary V. Vaughan <gary@gnu.org>
9446 * AUTHORS: Added my details.
9449 * bootstrap: temporary update until released libtool catches up.
9451 * All files: Use new GNU GPL copyright blurb with current contact
9454 * configure.in (LTLIBOBJS): Use canonical code for calculation of
9457 * config: renamed acm4 directory to config to be more like
9458 other autoconfiscated packages.
9460 * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
9461 * config/debug.m4: New file implementing configure macros to add
9462 suitable debug flags to the compiler invocation.
9464 * modules/load.c: New file implementing the ``load'' and
9465 ``unload'' builtins.
9466 * tests/get-them: Set the module search directory to the modules
9467 build directory in generated tests.
9468 * modules/shadow.test: ditto.
9469 * modules/modtest.test: ditto.
9470 * modules/modpath1.test: ditto.
9471 * modules/modpath2.test: ditto.
9472 * modules/modpath3.test: ditto.
9473 * modules/modpath4.test: ditto.
9474 * modules/modtest.test: ditto.
9475 * modules/modfreeze.test: ditto.
9476 * modules/unload.test: ditto.
9478 * modules/changeword.c: New file implementing the ``changeword''
9479 builtin as a loadable module.
9480 * modules/mpeval.c: New file implementing the ``mpeval'' builtin
9481 as a loadable module.
9483 * src/main.c (main): Load the gnu module if m4 was started
9484 normally -- i.e. without the -G option.
9485 * modules/gnu.c: New file implementing a new loadable module wuth
9486 definitions for all the gnu extension builtins.
9487 * modules/format.c: Moved here from src/format.c. Now included
9490 * src/main.c (main): Load the traditional module if m4 was
9491 started in `no_gnu_extensions' mode.
9492 * modules/traditional.c: New file implementing the ``unix'' macro,
9493 required when m4 is executed in traditional mode, as a loadable
9496 * src/main.c: Renamed from m4.c to avoid confusion with
9498 (main): Always load the m4 module.
9499 * modules/m4.c: New file implementing a new loadable module with
9500 definitions for all m4 builtins that are not gnu extensions.
9502 * m4/Makefile.am: Adjusted to take new files below into account.
9503 * m4/m4module.h: Prototypes for exported functions and types moved
9504 to this directory from the src directory.
9505 * m4/m4private.h: Moved here from src/m4private.h to facilitate
9506 the migration of all builtin implementations to loadable modules.
9507 * m4/macro.c: Moved this file here from the src directory,
9508 renaming all exported symbols to use the prefix ``m4_''.
9509 * m4/builtin.c: ditto.
9510 * m4/module.c: ditto.
9511 * m4/symtab.c: ditto.
9512 * m4/debug.c: ditto.
9513 * m4/input.c: ditto.
9514 * m4/output.c: ditto.
9516 * m4/ltdl.h, m4/ltdl.c: ditto.
9517 * m4/utility.c: Odd functions moved here from files in the src
9518 directory to facilitate builtin migration.
9520 2000-08-12 Gary V. Vaughan <gary@gnu.org>
9522 * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
9523 error message, to make translators' jobs a little easier.
9524 (builtin_builtin): ditto.
9525 (builtin_traceon): ditto.
9526 (builtin_traceoff): ditto.
9527 Reported by Akim Demaille <akim@epita.fr>
9529 * m4/Makefile.am (pkgincdir): Deleted. Use automake's built in
9530 pkgincludedir instead.
9532 * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
9533 it is exported globally. Fixed all references.
9537 (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
9538 globally. Fixed all references.
9539 (DEF_LQUOTE): ditto.
9543 2000-07-28 Gary V. Vaughan <gary@gnu.org>
9548 * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
9549 (AC_OUTPUT): touch stamp-h.in, not stamp-h.
9551 * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
9552 Removed `Prev', `Next' and `Up' fields of all @nodes now that
9553 makeinfo calculates them for us, and to make any future
9554 reorganisation easier.
9555 (Frozen files): Document format version 2.
9556 `V' now takes argument `2'.
9557 `F' can take a single argument if symbol and builtin names
9558 are the same, or 3 arguments if the builtin is from a module.
9559 New `S' specification for saving syntax table contents.
9560 New `M' specification for saving loaded module names.
9561 * src/freeze.c: Implement them.
9562 * src/input.c (syntax_code): For interpreting frozen syntax
9565 * examples/Makefile.am: Add the contents of the WWW directory to
9567 * examples/WWW/Makefile: ditto,
9568 (%.htm): Compares file contents (not just sizes) to determine
9569 whether a change has occured.
9570 * examples/WWW/_header.htm: Bumped version number.
9571 * examples/WWW: Regenerated content.
9573 * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
9574 compilers comes much easier without ansi2knr.
9575 * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
9577 * m4/list.c: New generic list container type.
9578 * m4/list.h: Interface to new container type.
9579 * m4/Makefile.am (pkginc_HEADERS): Install list.h.
9580 (libm4_la_SOURCES): compile and link list.c.
9581 * src/builtin.c (builtin_tables): Use list container.
9582 * src/module.c (symtab): ditto.
9583 * src/symtab.c (symtab): ditto.
9585 * m4/system.h: New file for common preprocessor definitions.
9586 * m4/Makefile.am (pkginc_HEADERS): install system.h.
9587 * m4/error.c: Use system.h in place of inline preprocessor.
9588 * m4/error.h: ditto.
9589 * m4/module.c: ditto.
9590 * m4/module.h: ditto.
9591 * m4/xmalloc.c: ditto.
9593 * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
9595 * m4/xmalloc.c (xmalloc_exit_failure): ditto.
9597 * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
9598 it is exported globally. Fixed all references.
9600 (module_init_t): ditto.
9601 (module_finish_t): ditto.
9602 (token_data): ditto.
9603 (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
9604 it is exported globally. Fixed all references.
9605 (SYNTAX_IGNORE): ditto.
9606 (SYNTAX_SPACE): ditto.
9607 (SYNTAX_OPEN): ditto.
9608 (SYNTAX_CLOSE): ditto.
9609 (SYNTAX_COMMA): ditto.
9610 (SYNTAX_DOLLAR): ditto.
9611 (SYNTAX_ACTIVE): ditto.
9612 (SYNTAX_ESCAPE): ditto.
9613 (SYNTAX_ALPHA): ditto.
9614 (SYNTAX_NUM): ditto.
9615 (SYNTAX_ALNUM): ditto.
9616 (SYNTAX_LQUOTE): ditto.
9617 (SYNTAX_RQUOTE): ditto.
9618 (SYNTAX_BCOMM): ditto.
9619 (SYNTAX_ECOMM): ditto.
9620 (SYNTAX_VALUE): ditto.
9621 (SYNTAX_MASKS): ditto.
9639 (TOKEN_NONE): ditto.
9640 (TOKEN_STRING): ditto.
9641 (TOKEN_SPACE): ditto.
9642 (TOKEN_WORD): ditto.
9643 (TOKEN_SIMPLE): ditto.
9644 (TOKEN_MACDEF): ditto.
9646 * m4/m4module.h (voidstar): Removed in favour of `VOID' for
9647 consistency. Fixed all references.
9648 (STRING): Renamed to `m4_string' for consistency, and because if
9649 is exported globally. Fixed all references.
9650 (token_type): Renamed to `m4_token_t' for the same reasons.
9651 (token_data_type): Renamed to `m4_token_data_t' for the same
9654 * m4/m4module.h (XCALLOC): Wrapper macro which handles type
9658 (XFREE): Wrapper macro which avoids freeing NULL pointers.
9660 * m4/m4module.h (m4_macro): New type for module defined user
9662 * modules/modtest.c (m4_macro_table): Define module user macros.
9663 * modules/shadow.c (m4_macro_table): ditto.
9665 * m4/m4module.h (M4BUILTIN_HANDLER): For defining handlers
9666 declared with M4BUILTIN.
9668 * m4/xmalloc.c: Use memset if bzero is not available when
9669 emulating calloc with malloc.
9670 (xcalloc): Fallback to malloc/bzero if calloc is not available.
9671 (xfree): Added for consistency. Will not try to free NULL
9673 * src/m4.c (xfree): Deleted in favour of the above.
9674 * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
9675 linking with libdmalloc.
9676 * m4/xstrdup.c (WITH_DMALLOC): ditto.
9678 * modules/frozen.m4: New test case.
9679 * modules/unfrozen.m4: ditto.
9680 * modules/modfreeze.test: New test.
9681 * modules/unload.test: ditto.
9682 * modules/Makefile.am (EXTRA_DIST): Distribute them.
9684 * modules/modpath1.test: Don't try this test if module support is
9686 * modules/modpath2.test: ditto.
9687 * modules/modpath3.test: ditto.
9688 * modules/modpath4.test: ditto.
9689 * modules/modtest.test: ditto.
9690 * modules/shadow.test: ditto.
9692 * modules/perl.c: New module.
9693 * modules/perl.m4: Example of using it.
9694 * modules/Makefile.am (perl_la_SOURCES): Build new perl module.
9696 * src/m4.c (main): Assume interactive mode if STDIN is connected
9698 Changed startup sequence slightly so that syntax is not
9699 initialised from here when loading a frozen file.
9701 * src/builtin.c: Much improved macro definition style.
9702 * src/m4private.h: Internal structures for m4_builtin and
9703 m4_macro instances. These are not exposed to module writers.
9704 * src/module.c (module_modname_find): Find a module structure
9706 (make_macro_table): Build an internal macro table from a external
9708 (make_builtin_table): Build an internal builtin table from an
9709 external definition.
9711 * src/module.c (module_unload): Be extremely careful to remove
9712 builtins and macros that match the module being unloaded -- no
9713 longer assume that the top element can be removed incase another
9714 odule defines an identical name.
9715 * src/symtab.c (remove_table_reference_symbols): remove all symbol
9716 table entries which refer to a given builtin table.
9717 * src/builtin.c (remove_tables): Use it!
9719 2000-07-13 Thomas Tanner <tanner@ffii.org>
9721 * Makefile.am (SUBDIRS): we need modules/ for "make dist"
9722 * acm4/modules.m4: deleted
9723 * bootstrap: don't libtoolize libltdl!
9724 * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
9725 if set, enable WITH_MODULES and add modules to DLPREOPEN
9726 * examples/misc.test: redirect standard output
9727 * lib/Makefile.am: don't use DLLDFLAGS
9728 * lib/m4module.c: include necessary headers to silence GCC -Wall
9729 * lib/m4regex.c: fixes to silence GCC -Wall
9730 * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
9731 build modules conditionally
9732 * modules/shadow.c: define symbol aliases before using them
9733 * modules/test.c: define symbol aliases before using them
9734 * po/de.po: update translation
9735 * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
9736 pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
9738 * src/m4.c: initialize libltdl's preloaded symbols via
9739 LTDL_SET_PRELOADED_SYMBOLS
9740 * src/module.c: libltdl's memory management must be initialized
9741 before calling lt_dlinit!, fix warnings
9743 2000-01-18 Gary V. Vaughan <gary@gnu.org>
9745 * README: Caveat about nls not supported by dll architecture on
9748 * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
9750 * tests/Makefile.am (stamp-TESTS): now works with VPATH.
9751 * src/Makefile.am (m4_LDADD): use $(builddir) for VPATH.
9752 * modules/Makefile.am (LIBS): ditto.
9753 (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
9754 $(top_srcdir)/m4 (for only <m4module.h>).
9755 * modules/shadow.test: fixed for VPATH.
9756 * modules/modtest.test: ditto.
9757 * modules/modpath4.test: ditto.
9758 * modules/modpath3.test: ditto.
9759 * modules/modpath2.test: ditto.
9760 * modules/modpath1.test: ditto.
9762 * modules/time.test: Removed due to timezone dependence,
9763 * modules/Makefile.am (TESTS): Removed time.test.
9765 * configure.in: Use $3 of AC_DEFINE so that we can,,,
9766 * acconfig.h: Remove everything except the gettext parameters.
9767 * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
9769 * acm4/ltdl.m4: Updated to latest from libtool cvs.
9770 * acm4/modules.m4: Remove code which duplicates ltdl.m4 and
9771 increment serial number.
9773 * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
9774 src dir and immediately after libm4 is built for confidence that
9775 it doesn't rely on the src directory.
9776 (SUBDIRS): Moved doc dir to the end since helptoman.pl and
9777 makeinfo stop the build on cygwin (because they don't work).
9779 * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
9781 * m4/m4private.h: ...is not a public header, so moved to src.
9782 Add `#include <config.h>', `#define _COMPILING_M4' and
9784 * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
9785 * src/Makefile.am (noinst_HEADERS): add m4private.h.
9786 * src/builtin.c: `#include "m4private.h"' now takes care of the
9787 above. Duplicates removed.
9788 * src/debug.c: ditto.
9789 * src/eval.c: ditto.
9790 * src/evalmp.c: ditto.
9791 * src/format.c: ditto.
9792 * src/freeze.c: ditto.
9793 * src/input.c: ditto.
9795 * src/macro.c: ditto.
9796 * src/module.c: ditto.
9797 * src/numb.h: ditto.
9798 * src/output.c: ditto.
9799 * src/path.c: ditto.
9800 * stackovf.c: ditto.
9803 * po/POTFILES.in: compensate for renaming of lib/*.
9804 * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
9805 (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
9806 and then in $(top_srcdir)/lib (for eg. "m4private.h").
9807 * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
9809 * m4/m4error.h: Renamed error.h, for installation to
9810 $prefix/include/m4..
9811 * m4/m4obstack.h: Renamed obstack.h, for same reason.
9812 * m4/m4regex.h: Renamed regex.h, for same reason.
9813 * m4/m4error.c: Renamed error.c, and use #include "error.h".
9814 * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
9815 * m4/m4regex.c: Renamed regex.c, and fix #includes.
9817 * lib: moved to m4 to easily support header installation to
9819 * Makefile.am (SUBDIRS): renamed lib dir to m4.
9820 * configure.in (AC_OUTPUT): reference m4/Makefile.in.
9821 * acm4/regex.m4: Point to m4/regex.c.
9823 * examples/foreach.m4: Sanitise quoting.
9824 * examples/foreach.test: New torture test.
9825 From Akim Demaille <akim@epita.fr>
9827 2000-01-17 Gary V. Vaughan <gary@gnu.org>
9829 * src/ltdl.c: Use access() to abort doomed module load attempts
9830 if module file does not exist.
9832 * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
9833 getopt1.o will already be used if appropriate, so I moved getopt.c
9834 and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
9836 * modules/modpath1.test: Use correct filename in header line.
9837 * modules/modpath2.test: ditto.
9838 * modules/modpath3.test: ditto.
9839 * modules/modpath4.test: ditto.
9841 Without these changes lt_dlopen("test") attempts to
9842 LoadLibrary("/bin/test") on Windows, which although harmless
9843 generates a spurious error message which spoils most of the tests:
9844 * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
9845 (TESTS): s/test.test /modtest.test /
9846 (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
9847 (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
9848 * modules/modpath1.test: s/test.m4 /modtest.m4 /
9849 * modules/modpath2.test: ditto.
9850 * modules/modpath4.test: ditto.
9851 * modules/modpath3.test: s/-m test /-m modtest /
9852 * modules/shadow.m4: use {un,}loadmodule(`modtest').
9854 2000-01-16 Gary V. Vaughan <gary@gnu.org>
9856 * src/ltdl.c (find_file): Updated to new version with fixed memory
9857 allocation bug in `next'.
9858 * src/ltdl.h: updated to match.
9860 * modules/Makefile.am: Cleaned up and reordered.
9862 2000-01-16 René Seindal <rene@seindal.dk>
9864 * modules/Makefile.am (TESTS): New tests for the module system.
9866 * modules/*.test: New files.
9868 * src/m4.c (main): Added call to module_init().
9869 Treats -M and -m as the arguments -D -U and -t, ie deferred.
9871 * src/m4.h: Added declaration of module_init().
9873 * src/module.c (module_init): No longer static
9875 * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
9876 Added to shut up automake about non standard libtool library
9879 * src/module.c: Disabled DEBUG by default.
9881 * modules/README: Changed example from unload.m4 to shadow.m4
9883 * modules/shadow.m4: Renamed from unload.m4
9885 * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
9887 * src/m4.c (main): Functionality for -m and -M were reversed.
9890 2000-01-12 Gary V. Vaughan <gary@gnu.org>
9892 * doc/help2man.pl: updated to version 1.020.
9894 * lib/COPYING.LIB: updated to version 2.1.
9896 * lib/m4module.h: restructure the M4_SCOPE code to work when
9897 creating a dll which links with libm4.la and both DLL_EXPORT
9898 (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
9901 2000-01-11 Gary V. Vaughan <gary@gnu.org>
9903 Merged the following changes from my tree:
9905 1999-06-15 Gary V. Vaughan <gary@gnu.org>
9907 * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
9908 ported to compile shared libs.
9910 * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
9911 use `__declspec(dllimport)' when linking libm4.la on win32.
9912 * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
9914 * configure.in (M4OBJS): Discover whether we need the shipped
9915 implementation of getopt_long.
9916 * src/Makefile.am (m4_LDADD): Link the getopt objects into the
9917 main binary here, as opposed to the module library in lib/libm4.la.
9919 1999-06-14 Gary V. Vaughan <gary@gnu.org>
9921 * modules/README: Updated to describe the improved libltdl based
9923 * README (cygwin): Added some compilation notes for building m4
9924 correctly under cygwin.
9925 * TODO: Cleaned out the entries for the module system since they
9926 are now implemented.
9928 * *.[ch]: __P is in the compiler's reserved namespace, so replaced
9929 all instances of __P with M4_PARAMS.
9931 * lib/getdate.h: removed unreferenced file.
9933 * lib/m4private.h: New file to define the private interface to the
9934 token_data struct, which must be shared between m4module.c, and
9935 builtin.c but not exported to modules built from the installed
9936 m4module.h since it's size changes depending on compile time
9939 * src/m4.h: Lots of stuff moved to lib/m4module.h.
9941 * lib/m4module.h: New file to define the interface available when
9942 compiling m4 modules.
9943 * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
9944 necessary for module compilation into this new file.
9946 * lib/Makefile.am (include_HEADERS): install headers (renamed to
9947 avoid nameclash with other system headers) necessary for compiling
9949 (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
9950 so that modules can include the (renamed) installed headers and
9951 be guaranteed a matching implementation.
9952 * lib/m4error.h: renamed from error.h.
9953 * lib/m4obstack.h: renamed from obstack.h.
9954 * lib/m4regex.h: renamed from regex.h.
9955 * configure.in (AC_REPLACE_FUNCS): Don't look for a system
9956 implementation, simply include the shipped version
9957 unconditionally, otherwise it is hard for a module to know
9958 whether the m4obstack.h header it is using matches the
9959 implementation it ends up linking against.
9960 (jm_WITH_REGEX): Include regex into libm4 unconditionally for
9963 1999-05-18 Gary V. Vaughan <gary@gnu.org>
9965 * examples/misc.test: Don't run this test on machines which don't
9966 have a root user in /etc/passwd (e.g. cygwin).
9968 * tests/get-them (/^@example$/): Error messages might have a
9969 ``.exe'' suffix to the program name, or else use the libtool
9970 ``.libs/lt-m4'' binary, or generally have an unexpected path. All
9971 of these cases are now catered for when comparing error messages
9973 * tests/other-tests/*.test: ditto.
9974 * examples/*.test: ditto.
9976 * tests/defs (M4): use libtool execute mode.
9977 * examples/defs (M4): ditto.
9979 * tests/get-them (END): explicitly close any open file.
9980 (printthem): In a regular expression, '{' is the start of a repeat
9981 count! Use `[{]' for a literal open brace.
9982 (/^@node /): Don't use substr on a string shorter than the trim
9985 1999-05-17 Gary V. Vaughan <gary@gnu.org>
9987 * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
9989 (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
9991 2000-01-10 Andreas Schwab <schwab@suse.de>
9993 * tests/other-tests/gmp.test: Find config.sh in build directory.
9995 * configure.in: Find tests/mkconfig.sh in $srcdir.
9997 * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
9998 <signal.h> (for SUS2 compliant systems).
10000 * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
10003 2000-01-10 René Seindal <rene@seindal.dk>
10007 * TODO, NEWS: Cleaned up and updated.
10009 * src/m4.c (main): New variable exit_status for exit status in
10010 case of unreadable files. Now m4 will exit with EXIT_FAILURE if a
10011 file cannot be read instead of EXIT_SUCCESS.
10013 * src/builtin.c (m4_indir): Changed error message to help
10014 translators (from Akim Demaille <demaille@inf.enst.fr>).
10016 * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
10019 * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
10022 * src/input.c (match_input): Reordering of code, to avoid multiple
10023 calls to push_string_init() from obstack_grow(), which can happen
10024 with some compilers (found and fixed by James Bonfield
10025 <jkb@mrc-lmb.cam.ac.uk>).
10027 * src/stackovf.c: Added prototypes for ultrix.
10028 (setup_stackovf_trap): Added __P to cast.
10029 (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
10031 2000-01-09 René Seindal <rene@seindal.dk>
10033 * doc/m4.texinfo (Changequote): Added comment about changing
10034 quotes when the old quote is a part of the new.
10036 * src/builtin.c (expand_ranges): Added break after trailing dash.
10037 This caused misbehavious on some systems (found and fixed by Akim
10038 Demaille <demaille@inf.enst.fr>).
10040 * AUTHORS: Thomas Tanner included
10042 * acconfig.h: Added entry for ss_sp (see below).
10044 * configure.in (use_stackovf): Added check for stack_t with member
10045 ss_base instead of ss_sp (BSDI notably). (Reported by Paul Eggert
10046 <eggert@twinsun.com>).
10048 * doc/m4.texinfo (Frozen files): Added a simpler example for
10049 generating frozen files from several input files.
10051 1999-11-14 Paul Eggert <eggert@twinsun.com>
10053 * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
10054 lib/regex.c, lib/xmalloc.c.
10056 1999-11-10 René Seindal <rene@seindal.dk>
10058 * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
10060 * src/module.c: reindented.
10061 (module_load): return if this is a repeated load of same module.
10062 (module_init): slight change of logic to avoid repeated
10063 initialisation debug messages.
10065 * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
10066 in the distribution.
10068 * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
10069 automake warnings about missing lib prefix.
10070 (time_la_LDFLAGS): ditto
10071 (stdlib_la_LDFLAGS): ditto
10073 1999-11-10 Paul Eggert <eggert@twinsun.com>
10075 * src/m4.h: Include error.h, since our macros use error.
10076 * src/m4.c: Don't need to include error.h.
10078 1999-11-09 Paul Eggert <eggert@twinsun.com>
10080 * src/m4.h (voidstar): Define to void * if __STDC__ is defined
10081 and zero, as Solaris 7 cc does.
10082 (bcopy): Remove macro; no longer needed with new obstack.h.
10084 * src/output.c (freeze_diversions): Don't assume that a
10085 diversion size can fit in `int'. Check for diversion file
10086 size too large to be printed with `unsigned long'.
10088 * src/Makefile.am (CFLAGS): Omit -Wall.
10090 * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
10092 * src/debug.c (trace_format):
10093 Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
10095 * src/freeze.c (produce_frozen_state):
10096 Don't assume string lengths fit in int.
10098 1999-10-13 René Seindal <rene@seindal.dk>
10100 * po/cs.po: Czech translation added.
10102 * po/sv.po: Updated Swedish translation.
10104 * po/ru.po: Updated Russian translation.
10106 * po/pl.po: Updated Polish translation.
10108 * po/el.po: Greek translation added.
10110 1999-10-13 René Seindal <rene@seindal.dk>
10112 * configure.in (ALL_LINGUAS): Added Greek translation (el).
10113 (ALL_LINGUAS): Added Czech translation (cs).
10115 1999-03-30 Gary V. Vaughan <gary@gnu.org>
10117 * src/builtin.c: moved module loading functions into...
10118 * src/module.c: entirely new implementation using libltdl.
10119 * po/POTFILES.in: added src/module.c.
10120 * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
10121 are modules, not linktime libraries.
10122 (LDFLAGS): added -no-undefined -module and -avoid-version flags.
10123 * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
10124 avoidance on exported symbols.
10125 * modules/test.c (m4_macro_table, m4_init_module,
10126 m4_finish_module): ditto.
10127 * modules/time.c (m4_macro_table): ditto.
10129 * modules/time2.m4: new file which requires command line loading
10131 * src/m4.c (--load-module): dynamically load named runtime module
10132 into running executable before reading the source.
10133 (--module-directory): prepend a directory to the module search
10135 (module_init()): Do this the first time we load a module instead;
10136 if the module subsystem is broken normal m4 scripts can still run.
10137 * src/m4.h (install_builtin_table): is now exported.
10139 1999-03-26 Gary V. Vaughan <gary@gnu.org>
10141 * src/module.c: removed. No longer required.
10142 * po/POTFILES.in: removed src/module.c.
10144 * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
10145 the bootstrap script can recreate.
10146 * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
10147 * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
10148 * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
10149 * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
10150 (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
10151 * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
10152 * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
10153 * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
10155 * acinclude.m4: removed. `aclocal -I acm4' handles this much
10157 * acm4/Makefile.am (ACINCLUDE_M4): ditto.
10158 * acm4/gettext.m4: removed. It causes a multiple definition vs.
10159 the installed gettext.m4 file when running aclocal.
10161 1999-03-25 Gary V. Vaughan <gary@gnu.org>
10163 * configure.in (AM_INIT_AUTOMAKE): bumped version number to
10164 distinguish this from the last prerelease.
10165 (AC_LIBLTDL_CONVENIENCE): build libltdl as a convenience library
10166 in its own subdirectory.
10168 * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
10169 lib prefix on a module" feature.
10170 (LDFLAGS): Added `-module -avoid-version' flags to build
10171 versionless module libraries.
10172 * src/builtin.c (m4_load_module): use libltdl.
10173 (module_unload_all): use libltdl.
10174 * src/m4.c (module_init): initialise module loading on demand for
10175 better diagnostics, and so that m4 will still work even if
10176 the module code is broken.
10177 * src/m4.h (module_init): removed. No longer relevant.
10178 * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
10179 exported symbols for compatibility with dlpreopening.
10180 * modules/test.c (m4_macro_table, m4_init_module,
10181 m4_finish_module): ditto.
10182 * modules/time.c (m4_macro_table): ditto.
10184 * bootstrap: New file. Runs all the autoutils in the right order
10185 after a fresh checkout, or a make maintainer-clean.
10187 1999-02-18 Akim Demaille <demaille@inf.enst.fr>
10189 * src/builtin.c (dump_symbols): New function, factoring common
10190 content of m4_dumpdef and m4_symbols.
10191 (m4_dumpdef): Use it.
10192 (m4_symbols): New function, implementing `symbols'. Use it.
10193 * doc/m4.texinfo: Fixed missing commas after @xref, so that the
10194 file compile with modern makeinfo.
10195 (Symbols): New node, documenting symbols.
10196 (direntry): Modernize.
10198 1998-12-11 René Seindal <rene@seindal.dk>
10200 * src/builtin.c (predefined_tab): New predefined macros
10201 __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
10202 configure time options.
10204 1998-12-01 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
10206 * src/module.c (module_try_load): Don't try to be clever and
10207 overwrite argument string. Instead allocate all constructed
10208 strings locally, since they can have arbitrary lengths. Make
10209 arguments pointers to const.
10210 (module_search): Simplify due to above change.
10212 1998-11-29 René Seindal <rene@seindal.dk>
10216 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
10218 * tests/other-tests/import-environment.{m4,test}: New test.
10220 * tests/other-tests/discard-comments.{m4,test}: New test.
10222 * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
10224 * src/m4.c (main): New option -c --discard-comments.
10225 New global variable discard_comments.
10227 * src/m4.h (token_type): New TOKEN_NONE for tokens to be
10228 discarded, ie never returned from next_token().
10229 Added declaration of discard_comments.
10231 * src/input.c (next_token): Now loops until token type is not
10232 TOKEN_NONE. Comments are now given this type when comments should
10235 * doc/m4.texinfo (Invoking m4): Updated for --import-environment
10238 1998-11-28 René Seindal <rene@seindal.dk>
10240 * src/m4.c (main): New option --import-environment (no single
10243 * When configured with --with-gmp both the normal (fast) eval()
10244 and the gmp aware mpeval() are defined. To restore previous
10245 bahaviour use "define(`eval', defn(`mpeval'))".
10247 * tests/other-tests/gmp.m4: Changed to use mpeval().
10249 * src/evalmp.c: New file for compiling eval.c as gmp aware.
10250 Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
10252 * src/eval.c: Now includes "numb.c" directly. Everything in this
10253 file must by static, except evaluate(), which is changed to
10254 mp_evaluate() if USE_GMP in force.
10256 * src/numb.c: Changed to be included by eval.c instead of being
10257 compiled separately. Everything is declared static.
10259 * src/numb.h: Removed declarations of functions, as numb.c is now
10260 included by eval.c.
10262 * src/builtin.c: Declaration of m4_mpeval() added.
10263 Inserted `mpeval' in builtin table.
10264 (do_eval): New function with common code for m4_eval and m4_mpeval.
10265 (m4_mpeval): New function for gmp version of eval.
10267 * src/m4.h: Declaration of mp_evaluate().
10269 * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
10270 (EXTRA_m4_SOURCES): Now has numb.c and numb.h
10272 * src/m4.c (main): m4 --version also shows which options were used
10273 for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
10275 1998-11-27 René Seindal <rene@seindal.dk>
10277 * Error messages now always print program name before input file
10278 name as specified by GNU coding standards. Reported by Akim
10279 Demaille <demaille@inf.enst.fr>.
10281 * doc/m4.texinfo (Include): Change due to changed error message
10285 * tests/get-them: Minor change to sed script due to changed error
10288 * src/m4.c (print_program_name): New func used to print program
10289 name, input file and line number in error (). Used as an
10290 error_print_progname handler.
10291 (reference_error): Removed.
10292 (main): Assigns error_print_progname.
10294 * src/m4.h (M4ERROR): Removed reference_error ().
10296 1998-11-25 René Seindal <rene@seindal.dk>
10298 * Updated to libtool 1.2b.
10300 * src/builtin.c (install_builtin_table): Added braces to avoid
10301 warning of ambiguous 'else'.
10303 * src/module.c: Inserted search path code from path.c modified to
10305 (module_init): Configured default path used only if M4MODPATH is
10307 (module_try_load): Now reads libMODULE.la as generated by libtool
10308 for actual module name.
10309 (module_load): Gives better error messages on failure.
10311 * src/m4.h: Added declarations of structures and functions for
10312 generic search path handling.
10314 * src/path.c: Removed all module specific code and introduced new
10315 functions of more generic search path handling.
10317 1998-11-24 René Seindal <rene@seindal.dk>
10319 * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
10320 included gettext, as <libintl.h> might not be found
10321 otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
10323 1998-11-22 René Seindal <rene@seindal.dk>
10325 * src/output.c (insert_diversion): Fixed bug that might cause m4
10326 to read from standard output! Triggered by input
10327 'divert(1)undivert(0)'. Test for divnum>0 changed to divnum>=0,
10328 so now 'undivert(0)' does nothing.
10330 1998-11-18 René Seindal <rene@seindal.dk>
10334 * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
10335 could be changed when compiling a illegal regexp, causing later
10336 use of the regexp to dump core.
10338 * src/module.c (module_load): Changed error message to conform to
10341 * src/m4.c (usage): Added message about reporting bugs.
10343 * doc/m4.texinfo (Changeword): Corrected a wrong example.
10344 (Changeword): Added note about the type of regexps used.
10346 * ltconfig, ltmain.sh: New files from Libtool 1.2.
10348 * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
10349 and AM_PROG_LIBTOOL.
10351 * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
10354 * modules/Makefile.am: Changed completely to compile modules using
10355 libtool. The modules are compiled as shared libraries, and are
10356 renamed when installed.
10358 * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
10359 USE_SHL_LOAD to HAVE_SHL_LOAD
10361 * src/builtin.c (shipout_string): Now tests for a NULL string.
10363 * src/module.c: New level of indirection around non-portable
10364 functions to load shared objects. Intended to encapsulate the non
10365 portable parts better and to reduce the number of #ifdefs in the
10368 * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
10369 directory modules/ to the distribution.
10371 1998-11-15 René Seindal <rene@seindal.dk>
10375 * modules/stdlib.c: New module `stdlib' defining some standard
10376 functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
10377 getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
10379 * src/builtin.c (shipout_string): New convenience function for
10380 builtins and modules.
10382 * src/module.c (module_load): Tentative support for
10383 shl_load/shl_findsym, but I cannot test it. Copied from MetaHTML.
10385 * Makefile.am (SUBDIRS): Directory modules added if configured.
10387 * modules/Makefile.am: Now correctly compiles and installs
10388 modules in pkglibexecdir.
10390 * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
10391 These two are now initialised by autoconf macros.
10393 * src/path.c (module_env_init): MODULE_PATH is always on the
10396 * src/Makefile.am: Now generated pathconf.h which defined the
10397 default MODULE_PATH.
10399 * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
10400 where modules are installed.
10402 * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
10403 by Brian J. Fox <bfox@datawave.net>. This change allow modules to
10404 build and install automatically, and it is prepared for other
10405 interfacec than dlopen().
10407 * src/builtin.c (predefined_tab): Added __m4_version__ for the
10408 current version of GNU m4. It is a GNU extension.
10410 1998-11-14 René Seindal <rene@seindal.dk>
10412 * tests/Makefile.am (GENERATED_TESTS): Added new
10413 generated-tests/changesy.8.test
10415 * doc/m4.texinfo (Changesyntax): Documentation for escape
10418 * src/macro.c (expand_token): Check for escaped macro call before
10419 symbol table lookup.
10421 * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
10424 * src/input.c: New static variable use_macro_escape, which is TRUE
10425 iff some character has code SYNTAX_ESCAPE
10426 (input_init): Added initialisation of use_macro_escape.
10427 (check_use_macro_escape): New function to synchronise
10428 use_macro_escape with the syntax table.
10429 (set_quotes): Added call to check_use_macro_escape()
10432 (next_token): Added new case for IS_ESCAPE.
10434 * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
10436 1998-10-13 René Seindal <rene@seindal.dk>
10440 * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
10443 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
10444 maintained tests in tests/other-tests. These currently tests for
10445 8-bit transparency, multiple precision arithmetic and sync-line
10446 output. Test for stackoverflow detection does not work.
10448 * examples/Makefile.am (TESTS): Added tests for all example files.
10450 * examples/mktests.sh: New file. Help program for creating test
10453 * tests/mkconfig.sh: New file to generate tests/config.m4 and
10454 tests/config.sh. This is for tests of configure selectable
10455 features. Picks up all set WITH_ and ENABLE_ veriables from
10458 * src/path.c (path_search): Added argument 'char **expanded_name'
10459 to return the expanded name.
10461 * src/m4.h: Added 2nd argument to declaration of path_search().
10463 * src/m4.c (main): Added 2nd argument to path_search().
10465 * src/freeze.c (reload_frozen_state): Do.
10467 * src/builtin.c (m4_undivert): Do.
10470 1998-10-11 René Seindal <rene@seindal.dk>
10472 * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
10474 * acm4/modules.m4: New file. Defines AM_WITH_MODULES.
10476 * acm4/gmp.m4: New file. Defines AM_WITH_GMP.
10478 * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
10480 * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
10482 * intl/: Updated to GNU gettext 0.10.35.
10484 * doc/m4.texinfo (Format): Documented that format is blind.
10486 * src/builtin.c (builtin_tab): Builtin format marked as blind.
10488 1998-10-07 René Seindal <rene@seindal.dk>
10492 * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
10493 .test, as the files are no longer just m4 input.
10495 * tests/get-them (FILE): Changed .m4 extension to .test.
10497 * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
10498 Otherwise quoted strings with leading whitespace first in a macro
10499 argument would be eliminated.
10501 * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
10502 (expand_argument): Do.
10504 * src/input.c (next_token): SPACE and NUM/OTHER characters are only
10505 grouped together iff both quote and comment strings are single
10506 character. Otherwise they might include a comment/quote leader.
10507 (next_token): Returns new token type TOKEN_SPACE.
10509 * src/builtin.c (push_builtin_table): New function to push a
10510 builtin_table on the stack without installing its contents.
10511 (find_builtin_by_name): Added call to push_builtin_table() if
10512 reading frozen files. Otherwise the builtins named in the frozen
10513 files could not be found.
10514 (install_builtin_table): Changed to use push_builtin_table()
10516 1998-10-04 René Seindal <rene@seindal.dk>
10518 * po/pl.po: Polish translation added.
10520 * po/POTFILES.in: src/module.c added.
10522 1998-10-04 René Seindal <rene@seindal.dk>
10526 * configure.in (ALL_LINGUAS): Added Polish pl.po
10528 1998-10-03 René Seindal <rene@seindal.dk>
10530 * Many files: Incorporated changes to implement dynamic modules.
10531 Detailed comments in src/modules.c and modules/README
10533 * src/module.c: New file, implements the OS dependant parts of
10534 dynamic module loading.
10536 * src/Makefile.am (m4_SOURCES): Added module.c
10538 * src/builtin.h: New file, declares some functions from builtin.c
10539 that are of use for other modules (shipout_int, numeric_arg,
10540 skip_space, bad_argc), and the macros ARG() and DECLARE().
10542 * src/builtin.c (install_builtin_table): New function. Each
10543 module brings in a builtin_table, which is pushed on a stack.
10544 (struct builtin_table): New struct for list of builtin_tables.
10545 (m4_loadmodule): New function to implement builtin "loadmodule".
10546 (shipout_int): No longer static, to be used by modules.
10550 (builtin_init): changed to call install_builtin_table()
10551 (find_builtin_by_name): Now searches all builtin_tables
10552 (find_builtin_by_addr): do.
10554 * src/path.c: Reorganised to allow for two search paths, one for
10555 include files and one for modules.
10557 * src/m4.h: Added declarations for new functions in module.c and
10560 * src/m4.c (main): Added call to module_init().
10562 * modules: New directory with a few demo modules.
10564 * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
10567 * configure.in: Added modules/Makefile to AC_OUTPUT.
10569 * configure.in: Added code to implement --with-modules. Tests for
10570 <dlfcn.h> and -ldl.
10572 * acconfig.h: Added WITH_MODULES
10574 1998-10-02 René Seindal <rene@seindal.dk>
10576 * examples/Makefile.am (pkgdata_DATA): Removed special target for
10577 check and variables TESTS. These tests are now run from the
10580 * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
10581 directory. The files stay there but the tests are run from the
10584 * tests/Makefile.am (EXTRA_DIST): Added run-test.
10586 * tests/run-test: New file. Run a test manually
10588 * tests/Makefile.am, tests/get_them: Moved automatically generated
10589 tests (from the manual) to sub directory tests/gentest/. The
10590 tests/ directory had gotten a bit messy.
10592 1998-09-06 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10594 * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
10595 wrap}.test: Added a few testcases.
10597 1998-08-21 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10601 * lib/Makefile.am (noinst_HEADERS): regex.h added
10603 * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
10604 acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
10606 * acm4/Makefile.am: created providing rules to create
10607 $(top_srcdir)/acinclude.m4 to be used by aclocal.
10609 * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
10610 `C'. Reported by Ulrich Drepper.
10612 * Makefile.am (SUBDIRS): Removed checks directory
10613 * configure.in (AC_OUTPUT): Removed checks/Makefile
10615 * doc/m4.texinfo (Patsubst,example): @comment added to preserve
10616 the space when m4.texinfo is edited and whitespace.el is active.
10617 (Defn,example): idem.
10619 1998-08-20 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10621 * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
10622 ../COPYING. ../Makefile is a file which is certainly present when
10623 test is executed in testSubDir. One can't be sure that the COPYING
10624 file is in .. or ../.. in all situations, the ../Makefile is
10627 * doc/m4.texinfo (Include): adjusted expected test output
10628 according to new tests, i.e. the input will always come from the
10629 file `in' created by the test.
10631 * tests/Makefile.am: Added three lines at the top to get
10632 esyscmd.1.test working.
10634 * tests/get-them: modified to generate clearer tests who will need
10635 less maintenance when new test examples are created in
10636 `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
10637 need the generic file `defs') shell scripts creating `in', `ok',
10638 `out' and when apropriate `okerr' and `err' in the directory
10639 `testSubDir' when executed. The compare of `ok' and `out'
10640 (and of `okerr' and `err') will be the exit status of the test.
10641 `out' must match `ok' (and `okerr' must match `err') for the test
10644 * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
10645 the tests generated by tests/get-them getting it input normally
10646 from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
10647 (dot) before the numeric part) is reserved for all other (hand
10648 written) tests. The `+' means one or more times.
10650 1998-08-12 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10652 * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
10653 supported short man page to refer to info documentation
10654 * helptoman.pl: added
10655 * configure.in: AC_PATH_PROG(PERL,perl)
10656 * Makefile.am (SUBDIRS): doc after src
10658 * libitized with libit 0.5 from
10659 ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
10661 * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
10662 * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
10663 replacement functions, (libm4_a_LIBADD): @LIBOBJS@
10664 * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
10665 lib/rx.{c,h}: added
10666 * configure.in (AC_CHECK_FUNC): getopt_long
10668 * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
10670 * TODO: added entry about dependencies
10672 1998-08-10 René Seindal <rene@seindal.dk>
10676 * doc/m4.texinfo (Changesyntax): Added documentation for the macro
10679 * src/builtin.c (m4_changesyntax): Added builtin macro
10680 "changesyntax" to modify the syntax table.
10682 * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
10683 table. All categories are assigned a syntax code and tokens are
10684 read according to this table.
10686 1998-08-09 René Seindal <rene@seindal.dk>
10688 * src/numb.{c,h}: New files, implements multiple precision eval
10689 using GNU gmp. Originally submitted by John Gerard Makecki
10690 (johnm@vlibs.com), later modified. Tested with GNU gmp 2.0.2.
10692 * doc/m4.texinfo (Eval): Added documentation for multiple
10693 precision arithmetic library support.
10695 * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
10696 to accommodate multiple precision eval.
10698 1998-08-07 René Seindal <rene@seindal.dk>
10700 * src/input.c (MATCH, match_input), src/m4.h: changed definition
10701 of comment and quote strings to `unsigned int' to allow eight bit
10702 chars (reported by andrewb@zip.com.au (Andrew Bettison)).
10704 * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
10705 patch from Mike Howard <mike@clove.com>
10707 1998-08-06 René Seindal <rene@seindal.dk>
10709 * gettext.m4: corrected AM_WITH_NLS to handle use of installed
10712 1998-08-03 René Seindal <rene@seindal.dk>
10716 * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
10717 and _ macro. M4 now builds with --disable-nls.
10719 * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
10720 to look for right message catalogs. Call indef'ed by ENABLE_NLS.
10722 * configure.in (ALL_LINGUAS): Added complete list of translations:
10723 de fr it ja nl ru sv.
10725 1998-05-23 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10727 * po/nl.po: Dutch translation by Erick Branderhorst.
10729 * po/fr.po: French translation by Erick Branderhorst, based on the
10730 translations by François Pinard in fr.msg and m4.cod.
10732 1998-05-22 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10736 * src/m4.c: #include <signal.h> not <sys/signal.h>.
10738 * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
10740 * checks/Makefile.am: explicit list tests in CHECKS.
10742 * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
10743 src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
10744 mkinstalldirs, install-sh: Added automake (1.3) support.
10746 * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
10747 obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
10748 Used libitize (0.4) to update.
10750 * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
10751 (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
10752 README accordingly.
10754 * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
10755 stack overflow functionality.
10757 1994-12-03 François Pinard <pinard@iro.umontreal.ca>
10759 * Prerelease 1.4.1.
10761 * Makefile.in (realclean-local): Delete stamp-h.in.
10763 * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
10764 Localize, adapting from how it is done in sharutils.
10766 * fr.tt: New file, for French.
10768 * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
10769 src/freeze.c: Rename PRODUCT to PACKAGE.
10771 1994-11-26 François Pinard <pinard@iro.umontreal.ca>
10773 * configure.in: Check for <libintl.h> and <locale.h>.
10774 * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
10775 src/stackovf.c: Rename _ to __P.
10776 * src/m4.h: Declare _ as a macro returning its argument, or else,
10777 include <libintl.h> and declare _ as gettext.
10778 * src/m4.c: Possibly include <locale.h> and call setlocale.
10779 * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
10780 src/input.c, src/macro.c, src/output.c, src/path.c,
10781 src/stackovf.c, src/symtab.c: Use _ macro over all localizable
10784 1994-11-07 François Pinard <pinard@iro.umontreal.ca>
10786 * doc/Makefile.in (stamp-vti): Use new -r option to date.
10788 * configure.in: Put --with-gmp in place, in prevision for John
10790 * acconfig.h: Document WITH_GMP.
10792 1994-11-05 François Pinard <pinard@iro.umontreal.ca>
10796 * doc/Makefile.in (realclean): Also remove stamp-vti.
10797 Reported by Eric Backus.
10799 1994-11-02 François Pinard <pinard@iro.umontreal.ca>
10801 * src/freeze.c (produce_frozen_state): If the frozen file cannot
10802 be opened, return immediately after producing the error message.
10803 Reported by Andreas Schwab.
10805 * configure.in: Check for const only after having found possible
10806 ANSIfying compiler flags, this is of no use to check it before.
10807 Reported by Alexander Lehmann.
10809 1994-11-01 François Pinard <pinard@iro.umontreal.ca>
10811 * src/macro.c (collect_arguments): Cast obstack arguments to
10812 (voidstar), so avoiding compiler warnings.
10813 Reported by Joseph E. Sacco.
10815 * src/freeze.c (produce_frozen_state): Cast printed lengths to
10816 (int) so they correspond to %d format items.
10817 Reported by Joseph E. Sacco.
10819 * src/m4.c (main): Cast the argument to xfree to (voidstar).
10820 * src/symtab.c (free_symbol): Idem.
10821 Reported by Karl Vogel.
10823 1994-10-31 François Pinard <pinard@iro.umontreal.ca>
10825 * Makefile.in (DISTFILES): Distribute BACKLOG.
10827 * configure.in: Define PRODUCT and VERSION.
10828 * acconfig.h: Document PRODUCT and VERSION.
10829 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
10830 constant string m4 and variable or parameter named version.
10832 1994-10-30 François Pinard <pinard@iro.umontreal.ca>
10834 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
10835 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
10836 defines __STDC__ to 0, for indicating it is *not* ANSI!
10837 Reported by Kaveh R. Ghazi.
10839 * configure.in: Added obsolescent tests for AIX and Minix.
10841 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
10842 which texclean does not exist anymore.
10843 Reported by Eric Backus, Jim Meyering, John David Anglin and
10846 1994-10-29 François Pinard <pinard@iro.umontreal.ca>
10848 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
10849 Reported by John David Anglin.
10851 * src/ansi2knr.c: New version, sent by Peter Deutsch.
10852 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
10853 ANSI2KNR, depending on the fact the compiler is ANSI or not.
10854 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
10855 Remove the sed filter after ansi2knr for debug.c. Use $O instead
10856 of $U, put underline in extensions rather than in basenames. Use
10857 implicit rules, now that regularity makes this possible.
10858 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
10859 of ansi2knr whenever it is needed.
10860 * configure.in: Adjusted for correct STACKOVF substitution.
10861 * src/debug.c (trace_format): When not __STDC__, use (...) as a
10862 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
10863 Reported by David MacKenzie.
10865 * Makefile.in: Remove binprefix. Use transform_name instead.
10866 Reported by David MacKenzie.
10868 * doc/Makefile.in: Create version.texi, use it, clean it.
10869 Reported by Jim Meyering.
10871 1994-10-28 François Pinard <pinard@iro.umontreal.ca>
10873 * Makefile.in (all, install, uninstall): Depend on Makefile.
10875 * Makefile.in: For actions invoking $(MAKE) from within compound
10876 sh statements, exit non-zero if the sub-make fails. Otherwise,
10877 the top-level make may exit successfully when it should fail.
10878 Reported by Jim Kingdon.
10880 * {,/*}Makefile.in: Use && after all cd, in case they fail.
10882 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
10883 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
10884 * configure.in: Substitute PRODUCT and VERSION.
10886 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
10888 1994-10-27 François Pinard <pinard@iro.umontreal.ca>
10890 * Makefile.in (mostlyclean-local): Do not remove *~.
10891 * */Makefile.in (mostlyclean): Idem.
10892 Reported by Robert E. Brown and Richard Stallman.
10894 1994-10-09 François Pinard <pinard@iro.umontreal.ca>
10896 * src/m4.h: Get rid of CONFIG_BROKETS.
10898 1994-10-02 François Pinard <pinard@iro.umontreal.ca>
10900 * configure.in: Use AC_ARG_PROGRAM.
10901 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
10902 Reported by David MacKenzie.
10904 1994-10-01 François Pinard <pinard@iro.umontreal.ca>
10906 * configure.in: Do not add -O to CFLAGS for GNU C, now that
10907 configure does it automatically.
10908 Reported by Jim Meyering.
10910 1994-09-23 François Pinard <pinard@iro.umontreal.ca>
10912 * src/stackovf.c: Declare the handler_t typedef earlier in the
10913 code, use it for stackovf_handler.
10914 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
10915 casting sigsegv_handler.
10916 Reported by Robert Bernstein.
10918 * src/m4.c (main): Initialize program_name to argv[0] without
10920 Reported by Karl Berry.
10922 1994-09-18 François Pinard <pinard@iro.umontreal.ca>
10924 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
10925 Reported by Karl Berry.
10927 1994-09-14 François Pinard <pinard@iro.umontreal.ca>
10929 * lib/Makefile.in (mostlyclean): Added.
10930 (TAGS): Make in $(srcdir).
10932 * configure.in: Use `choke me' in test, like everywhere!
10934 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
10935 unreacheable and useless.
10937 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
10939 * lib/Makefile.in (DISTFILES): Distribute TAGS.
10940 (distclean): Do not remove TAGS.
10941 (realclean): Remove it.
10942 * Makefile.in: Make TAGS in lib also, not just in src.
10943 Reported by Karl Berry.
10945 * Makefile.in (distclean, realclean): Instead of recursively
10946 calling $(MAKE) for the -local part, allow parallel execution of
10947 -recursive and -local, only delay the removal of config.status,
10948 which is repeated in both goals.
10950 1994-09-13 François Pinard <pinard@iro.umontreal.ca>
10954 * Makefile.in: Group all *clean-recursive goals in one, using sed
10955 to remove `-recursive' while calling make recursively. Also, use
10956 a subshell for each recursive $(MAKE).
10957 Reported by Jim Meyering.
10959 * src/m4.h (memcpy): Define with bcopy for BSD systems.
10960 Reported by Kaveh R. Ghazi.
10962 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
10963 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
10966 * configure.in: Use date instead of touch for stamp-h.
10967 * Makefile.in (stamp-h.in): Idem.
10969 * Makefile.in (distclean, realclean): Force serial execution of
10970 both goals, in case parallel makes are being used.
10971 Reported by Jim Meyering.
10973 * src/Makefile.in (DISTFILES): Distribute TAGS.
10974 (distclean): Do not remove TAGS.
10975 (realclean): Remove it.
10976 Reported by Karl Berry.
10978 1994-09-10 François Pinard <pinard@iro.umontreal.ca>
10980 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
10981 to old names, for following Autoconf.
10983 1994-09-08 François Pinard <pinard@iro.umontreal.ca>
10985 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
10986 ./install.sh will not be correctly referred to in sub-Makefiles.
10987 Reported by John David Anglin.
10989 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
10990 Reported by Eric Backus.
10992 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
10993 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
10994 config.status into remaking this directory's Makefile only.
10995 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
10996 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
10997 Reported by Jim Meyering.
10999 1994-09-06 François Pinard <pinard@iro.umontreal.ca>
11001 * configure.in: Correct stack overflow detection logic, taking
11002 care of systems having only incomplete implementations (like for
11003 Pyramid 9820 OSx 5.0d).
11004 Reported by Kaveh R. Ghazi.
11006 * src/Makefile.in (TAGS): Remote -t from etags call.
11008 1994-09-02 François Pinard <pinard@iro.umontreal.ca>
11010 * lib/Makefile.in (install): Depend on all.
11012 1994-08-31 François Pinard <pinard@iro.umontreal.ca>
11014 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
11015 Reported by Jim Meyering and John David Anglin.
11017 * Makefile.in (distclean-local): Delete config.log.
11018 Reported by Jim Meyering.
11020 Solidify frozen files with respect to -P:
11021 * src/m4.c: Have -P set prefix_all_buitins variable instead of
11022 calling a function by that name. Declare the variable.
11023 * src/m4.h: Adjust declaration for prefix_all_buitins.
11024 * src/builtin.c (builtin_init): Merge in functionality from
11025 previous prefix_all_buitins function, while making entries in the
11026 symbol table, but not modifying the builtin description itself.
11028 * src/freeze.c (reload_frozen_state): Add a useless `break;',
11029 because *many* compilers do not accept an empty `default:'.
11030 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
11031 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
11033 * configure.in: Use AC_TYPE_SIGNAL.
11034 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
11035 Reported by Robert Bernstein.
11037 * checks/Makefile.in (check): Modify PATH so check-them will find
11038 m4 in the src directory.
11039 * Makefile.in (check): Don't.
11040 Reported by Akiko Matsushita and Jim Meyering.
11042 * src/output.c (make_room_for, output_character_helper): New
11043 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
11044 a per buffer MAXIMUM_BUFFER_SIZE.
11046 * src/output.c (output_text): New function, for optimizing the
11047 output of strings of characters. Use it.
11049 1994-08-30 François Pinard <pinard@iro.umontreal.ca>
11051 * doc, src: New directories reorganizing the distribution.
11052 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
11054 * Makefile.in: Adjusted.
11055 * configure.in: Configure new Makefiles.
11057 * m4.h: Declare STRING typedef. Use it for comment and quote
11058 strings, adjusting all references. (This is the rudiments of a
11059 beginning for the eventual withdrawal of NUL terminated strings.)
11060 * output.c (shipout_text): Accept a length parameter, and use it.
11061 All callers adjusted.
11063 1994-08-29 François Pinard <pinard@iro.umontreal.ca>
11065 * m4.h: Include <unistd.h> if it exists.
11066 * stackovf.c: Don't.
11068 Clean up for current_diversion variable:
11069 * output.c: Move current_diversion from builtin.c.
11070 * m4.h: Declare current_diversion so builtin.c can access it.
11071 * output.c (output_init, make_diversion): Initialize or update
11073 * builtin.c (builtin_init, m4_divert): Leave current_diversion
11076 Remove limit on number of diversions:
11077 * output.c: Replace ndiversion by diversions, declare it.
11078 (output_init): Allocate only diversion 0.
11079 (make_diversion): Allocate new diversions as needed.
11080 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
11081 * m4.c: Still accept -N, but do nothing with it.
11082 Reported by David MacKenzie.
11085 * output.c (freeze_diversions): New function.
11086 * m4.h: Declare freeze_diversions.
11087 * freeze.c: Document frozen file format, revise it, call
11088 freeze_diversions to add diversions to frozen format, and code to
11089 reload them properly.
11090 * m4.c: Do not undivert automatically at end when status being
11091 frozen. Do not call builtin_init when reloading frozen state.
11093 Speed up diversion processing:
11094 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
11095 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
11096 structure and variables, cached variables out of output_diversion,
11097 reallocate_diversion_for and OUTPUT_CHARACTER.
11098 (shipout_text, make_diversion, insert_diversion): Adapted to new
11100 (insert_file): Use better buffering.
11101 Reported by David MacKenzie.
11103 1994-08-28 François Pinard <pinard@iro.umontreal.ca>
11105 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
11106 dist works from another build directory.
11108 1994-08-27 François Pinard <pinard@iro.umontreal.ca>
11110 * symtab.c (hack_all_symbols): Use hash_table_size instead of
11111 constant HASHMAX, for -H option to work better.
11113 * builtin.c (DECLARE): Simplify by using _ ().
11115 * freeze.c: New file.
11116 * Makefile.in: Compile it, distribute it.
11117 * m4.c: Recognize, document and process --freeze-state (-F) and
11118 --reload-state (-R) options. Pass a true flag to builtin_init
11119 only if no reloading some state.
11120 * builtin.c (define_builtin): Remove static specifier.
11121 (find_builtin_by_name): Remove static specifier.
11122 (builtin_init): Accept and obey a flag argument.
11123 * m4.h: Add declarations for freeze.c, changes for builtin.c.
11125 1994-08-24 François Pinard <pinard@iro.umontreal.ca>
11127 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
11130 * configure.in: Implement --with-dmalloc.
11131 * acconfig.h: Document WITH_DMALLOC.
11132 * m4.h: Add code for when WITH_DMALLOC.
11134 1994-08-15 François Pinard <pinard@iro.umontreal.ca>
11136 * m4.c (long_options): Use "error-output", the dash was missing.
11137 Reported by Akiko Matsushita.
11139 1994-08-12 François Pinard <pinard@iro.umontreal.ca>
11141 * m4.h: Include <sys/types.h>.
11142 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
11143 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
11145 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
11146 as size_t, not int.
11147 * builtin.c (dump_args): Declare len as size_t, not int.
11149 * debug.c: Prototype the forward declaration of debug_set_file.
11151 * builtin.c (m4_undivert): Replace div by file, for avoiding the
11152 shadowing of this variable.
11153 * output.c (insert_diversion): Idem.
11155 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
11156 (input_init): Duplicate default quote and comment strings.
11157 (set_quotes): Free previous quote strings in all cases. Duplicate
11158 even default quote strings.
11159 (set_comment): Free previous comment strings in all cases.
11160 Duplicate even default comment strings.
11162 * configure.in: Updated for Autoconf 2.0.
11163 * Makefile.in (distclean-local): Also delete config.cache.
11165 * m4.c (usage): Reorganize the --help output by topic. Include a
11166 description for debugging flags.
11168 1994-07-29 François Pinard <pinard@iro.umontreal.ca>
11170 * configure.in: If sigaction is available and SA_ONSTACK defined,
11171 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
11172 defined, use sigvec. Else don't compile stackovf.c.
11173 * stackovf.c (setup_stackovf_trap): Idem.
11174 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
11177 1994-07-21 François Pinard <pinard@iro.umontreal.ca>
11179 * m4.c (usage): Replace printf par fputs.
11181 1994-07-18 François Pinard <pinard@iro.umontreal.ca>
11185 1994-07-17 François Pinard <pinard@iro.umontreal.ca>
11187 * configure.in: Check for sigaction and sigvec. Add a new delayed
11188 check for RLIMIT_STACK, combine in the checking for getrlimit.
11189 All those things are not universally available.
11190 * stackovf.c: Split setting up the trap handler and catching
11191 signals, for better taking care of various configure outcomes.
11192 * examples/stackovf.sh: Correct a typo.
11193 Reported by Eric Backus, Jim Avera and Jim Meyering.
11195 1994-07-16 François Pinard <pinard@iro.umontreal.ca>
11197 * ansi2knr.c: New version sent by its author, Peter Deutsch.
11199 1994-07-15 François Pinard <pinard@iro.umontreal.ca>
11201 * Makefile.in: Modify so parallel make will not try making
11202 lib/libm4.a twice simultaneously.
11203 Reported by Jim Meyering.
11205 1994-07-14 François Pinard <pinard@iro.umontreal.ca>
11207 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
11208 error message, for when no code possibility exists. Even if this
11209 line is completely #ifdef'ed out, it brings a syntax error.
11210 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
11212 * Makefile.in (install): Have install depend on all too, for lib
11213 to be remade as needed.
11215 * examples/stackovf.sh: Try ksh, bsh and bash for shells
11216 providing ulimit, instead of using only ksh.
11217 Reported by Jim Avera and Joseph E. Sacco.
11219 1994-07-12 François Pinard <pinard@iro.umontreal.ca>
11221 * Makefile.in (check): Have it depend on all instead of m4. In
11222 this way, a change in lib will be detected and processed.
11224 * builtin.c (numeric_arg): Use strtol and verify the conversion,
11225 instead of using sscanf which stops as soon as there is a
11226 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
11227 and divert(1xyzzy) were all accepted without any warning or error
11229 * m4.h: Declare strtol as long if not including stdlib.h.
11230 * configure.in: Check for limits.h, and replace strtol if missing.
11231 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
11232 * lib/strtol.c: New file, from elsewhere.
11233 Reported by Andreas Schwab.
11235 1994-07-07 François Pinard <pinard@iro.umontreal.ca>
11237 * macro.c (expand_macro): Cast value to (boolean) prior to
11238 assigning it to traced.
11239 Reported by Tom McConnell.
11241 * Makefile.in (m4): Always make all in lib first.
11242 Reported by Jim Meyering.
11244 1994-07-06 Jim Avera <jima@netcom.com>
11246 * stackovf.c: Isolated OS-dependent sections; Improved portability,
11247 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
11248 handlers), and a default error message if the fault address is not
11249 available (when neither siginfo.h nor BSD sigcontext are supported).
11250 * configure.in: Changes for stackovf.h: Check for sigcontext,
11251 sigaction, sigstack, and define rlim_t as int if necessary.
11252 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
11253 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
11254 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
11256 1994-07-05 François Pinard <pinard@iro.umontreal.ca>
11258 * configure.in: Use AC_SET_MAKE.
11259 * Makefile.in: Use @SET_MAKE@.
11260 Reported by Jim Meyering.
11262 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
11263 Reported by Ian Taylor.
11265 1994-07-02 François Pinard <pinard@iro.umontreal.ca>
11267 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
11268 because siginfo.h is unrelated to standard headers, and siginfo.h
11269 is already checked for.
11270 Reported by Joseph E. Sacco.
11272 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
11274 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
11277 1994-06-29 François Pinard <pinard@iro.umontreal.ca>
11279 * builtin.c (substitute): Use \& to represent this part of the
11280 string which was matched by the whole regexp, instead of
11281 representing the whole string. Any usage of \0 issues a warning
11282 and acts like \&, it will disappear in some subsequent release.
11284 1994-06-27 François Pinard <pinard@iro.umontreal.ca>
11286 * m4.c: Complete prototype for forwarded declaration of usage.
11288 * input.c (init_macro_token): Correct own reference in error
11289 message. Previous name get_macro_func was referred to instead.
11290 (next_char): Correct own reference in error message. Previous
11291 name advance_input was referred to instead.
11293 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
11294 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
11295 and_term, not_term, logical_not_term, cmp_term, shift_term,
11296 add_term, mult_term, exp_term, unary_term, simple_term): Add
11297 prototype to forwarded declarations. Declare parameter v1 as
11298 eval_t * instead of int *. Same for local variable v2 in dyadic
11299 functions. Same for result in exp_term.
11300 * builtin.c (m4_eval): Declare value as eval_t instead of int.
11301 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
11302 unsigned_eval_t instead of unsigned int. Change casts accordingly.
11303 (shipout_int): Cast first argument of ntoa to eval_t.
11304 Reported by Thorsten Ohl.
11306 * macro.c: Complete the prototypes of forwarded expand_macro and
11308 Reported by Thorsten Ohl.
11310 * m4.h: Define voidstar as void * or char * depending on __STDC__.
11311 The Ultrix 3.1 compiler cannot do much with void pointers.
11313 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
11314 * m4.c (xfree): Replace void * by voidstar.
11315 Reported by Tom McConnell.
11317 * ansi2knr.1: New, from elsewhere.
11318 * Makefile.in (DISTFILES): Distribute ansi2knr.1
11320 * Makefile.in (stamp-h.in): Avoid running ./config.status if
11321 stamp-h does not exist yet. This avoids running it a second time
11322 just after the initial ./configure.
11323 Reported by David MacKenzie and Tom McConnell.
11325 * m4.h: Replace the enum debug_info declaration with a series of
11326 #define's. The Ultrix 3.1 compiler would otherwise need casting
11327 (int) to most references, when used in expressions.
11328 Reported by Tom McConnell.
11330 1994-06-25 François Pinard <pinard@iro.umontreal.ca>
11332 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
11333 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
11334 calls the compiler. Previously, FP_PROTOTYPES was only calling
11335 the preprocessor; by not being subject to CFLAGS, this was
11336 discouraging those flags asking for ANSI compilation.
11337 * acconfig.h: Document HAVE_PROTOTYPES.
11338 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
11339 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
11340 Reported by Eric Backus.
11342 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
11343 from the environment. Default CFLAGS to -g if not set.
11344 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
11345 * lib/Makefile.in: Have CFLAGS substituted from configure.
11346 Reported by Eric Backus and Tom McConnell.
11348 * configure.in: m4_undefine changeword before using AC_ENABLE.
11350 * m4.h: Declare prototypes for error (for ANSI compilers only),
11351 prefix_all_builtins and reference_error.
11352 Reported by Tom McConnell.
11354 * input.c (set_word_regexp): Do not try to initialize the array
11355 test from a string, this does not work with non-ANSI compilers.
11356 Reported by Eric Backus.
11358 * Makefile.in (dist): Clean examples/ before saving it.
11359 (distclean-local): Also remove stamp-h.
11360 Reported by Eric Backus.
11362 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
11363 non ANSI compilers.
11364 Reported by Tom McConnell.
11366 * checks/Makefile.in (clean): Depends on mostlyclean.
11367 (mostlyclean): New goal.
11369 1994-06-24 François Pinard <pinard@iro.umontreal.ca>
11371 * Makefile.in (DISTFILES): Distribute install.sh.
11372 * install.sh: New file, copied from elsewhere.
11373 Reported by Assar Westerlund and Kaveh R. Ghazi.
11375 1994-06-23 François Pinard <pinard@iro.umontreal.ca>
11377 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
11378 * acconfig.h: Explain ENABLE_CHANGEWORD.
11380 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
11381 from code provided by Pete Chown]
11382 * m4.h: Add original_text field to u_t variant of union u.
11383 Declare TOKEN_DATA_FUNC macro.
11384 * builtin.c: Declare changeword.
11385 (m4_changeword): New function.
11386 * input.c: Include "regex.h", define variables with word regexps.
11387 (input_init): Initialize the word regexp.
11388 (set_word_regexp): New.
11389 (next_token): Declare local variables, use the previous code if
11390 default_word_regexp is true. Else, match using a new code. Save
11392 * macro.c (expand_token): Ship out original text if not a macro
11394 Reported by Krste Asanovic and Pete Chown.
11396 [These modifs all depend upon ENABLE_CHANGEWORD]
11397 * m4.h: Declare external user_word_regexp.
11398 * m4.c: Declare user_word_regexp, and initialize it from
11399 --word-regexp or -W, or NULL if not specified.
11400 * input.c: Use user_word_regexp if specified, instead of
11401 DEFAULT_WORD_REGEXP.
11403 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
11406 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
11407 * checks/Makefile.in: Empty the suffix list.
11408 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
11410 * m4.c: Declare nesting_limit and initialize it to 250.
11411 Implement -LNUMBER or --nesting-limit=NUMBER to change its
11413 * m4.h: Declare nesting_limit as external.
11414 * macro.c (expand_macro): Stop execution whenever nesting limit
11416 Reported by Bengt Mertensson.
11418 * eval.c (evaluate): Diagnose excess characters in eval input.
11419 Things like `eval(08)' used to return 0 with no diagnostic.
11421 * m4.h: Capitalize first letter of all macro arguments in
11424 * m4.c: Declare warning_status, initialize it to 0. Add new
11425 option -E, or --fatal-warnings, which sets warning_status to
11426 EXIT_FAILURE instead.
11427 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
11428 EXIT_FAILURE if not otherwise done by header files.
11429 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
11430 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
11431 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
11432 argument of all M4ERROR calls.
11433 Reported by Noah Friedman.
11435 * examples/incl-test.m4: Renamed from incl_test.m4.
11436 * examples/include.m4: Include incl-test.m4 instead of
11438 * examples/multiquotes.m4: Renamed from multi-quotes.m.
11440 1994-06-22 François Pinard <pinard@iro.umontreal.ca>
11442 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
11443 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
11444 also tested it on a Sun Sparc workstation running SunOS 4.x.
11446 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
11447 49.format check, abusing a `union values' argument with sprintf
11448 without selecting the proper field. Now, save the formatting type
11449 first, delaying the fetch of the corresponding argument.
11450 Reported by Joseph E. Sacco and Tom Quinn.
11452 * format.c (format): Remove const from char *fmt declaration when
11453 not HAVE_EFGCVT, because a NUL may be forced into it.
11455 * m4.h: Declare atof() when not STDC_HEADERS.
11456 Reported by Joseph E. Sacco.
11458 * Regenerate configure using Autoconf 1.11, this corrects a
11459 problem about an incorrect cpp seting on NeXT 3.1.
11460 Reported by Alexander Lehmann.
11462 1994-06-05 François Pinard <pinard@iro.umontreal.ca>
11464 * m4.h (_): Change argument from `x' to `Args'.
11466 1994-04-22 François Pinard <pinard@iro.umontreal.ca>
11468 * m4.h: Rename Args() to _().
11469 * m4.h: Remove extern specifier from all function declarations.
11471 1994-04-22 Jim Avera <jima@netcom.com>
11473 * stackovf.c: New file implementing stack-overflow detection.
11474 * configure.in: Check for getrlimit, sigaction. If all of
11475 standard headers, getrlimit and sigaction, define USE_STACKOVF and
11476 substitute ${U}stackovf.o for STACKOVF.
11477 * acconfig.h: Declare USE_STACKOVF.
11478 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
11479 * m4.h: Declare setup_stackovf_trap().
11480 * m4.c: Call setup_stackovf_trap().
11481 * tests/stackovf_test.sh: New file.
11483 1994-04-13 François Pinard <pinard@iro.umontreal.ca>
11485 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
11487 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
11489 1994-01-30 François Pinard <pinard@iro.umontreal.ca>
11491 * m4.h: Remove definition of volatile, not used anymore.
11492 Reported by Jim Meyering and Joseph E. Sacco.
11494 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
11495 of `if ... else /* nothing */' for if macros.
11496 Reported by Jim Meyering.
11498 * builtin.c (m4_regexp): Reorganize the code for avoiding a
11499 warning from gcc about `repl' possibly used before defined.
11500 Reported by Jim Meyering.
11502 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
11503 Reported by Jim Meyering.
11505 1994-01-25 François Pinard <pinard@iro.umontreal.ca>
11507 * m4.h: Move the conditional definition of volatile after the
11508 inclusion of system files, because they may define it first.
11510 1994-01-04 François Pinard <pinard@iro.umontreal.ca>
11512 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
11513 get around a problem with Alpha make seeing a syntax error, there.
11514 Reported by Vern Paxson.
11516 1994-01-03 François Pinard <pinard@iro.umontreal.ca>
11518 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
11519 Reported by Richard Stallman.
11521 1993-12-25 François Pinard <pinard@iro.umontreal.ca>
11523 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
11524 instead of AC_HAVE_FUNCS.
11525 Reported by Noah Friedman.
11527 1993-12-01 François Pinard <pinard@iro.umontreal.ca>
11529 * m4.c: Initialize show_help and show_version to zero.
11531 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
11532 Use them in exit() and usage() calls.
11534 1993-11-27 François Pinard <pinard@iro.umontreal.ca>
11536 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
11537 syserr() macro. Delete errref, add reference_error and M4ERROR.
11538 * m4.c: Replace errref, which was returning an input reference
11539 string, with reference_error, which prints it on standard error.
11540 * builtin.c, output.c: Use errno as second parameter to error,
11541 instead of using syserr() with %s.
11542 * *.c: Use M4ERROR instead of error: no more errref() with %s.
11543 Doing so, the program name appears after the input reference
11544 instead of before, which eases M-x next-error processing.
11546 1993-11-24 François Pinard <pinard@iro.umontreal.ca>
11548 * checks/get-them: Escape braces with backslashes in patterns,
11549 because HPUX-9.01 awk needs this.
11550 Reported by Jim Meyering.
11552 1993-11-22 François Pinard <pinard@iro.umontreal.ca>
11554 * builtin.c: Declare "FILE *popen ();".
11556 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
11557 macros, replace error_message_prefix() declaration by errref()'s.
11558 Declare xrealloc, for use in errref().
11559 * m4.c: Delete error_message_prefix() function, add errref().
11560 * *.c: Use error() systematically in place of all error macros,
11561 now that error() flushes stdout first. Make needed adjustments.
11563 * m4.h: Remove const in sys_errlist[] declaration, it creates
11564 conflicts on SGI and Alpha.
11565 Reported by Kaveh R. Ghazi.
11567 1993-11-20 François Pinard <pinard@iro.umontreal.ca>
11569 * m4.c: Include <getopt.h> instead of "getopt.h".
11571 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
11572 * acconfig.h: New, for documenting HAVE_EFGCVT.
11573 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
11574 use them wherever appropriate. Also use -I. for compilations.
11575 * lib/Makefile.in: Use -I.. for compilations.
11576 * *.c: Include <config.h> or "config.h".
11578 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
11579 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
11581 1993-11-17 François Pinard <pinard@iro.umontreal.ca>
11583 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
11585 * input.c (input_init): Initialize quote and comment strings
11586 explicitely instead of calling set_quotes and set_comment: by
11587 doing so, we ensure we do not free uninitialized variables.
11589 * checks/check-them: Reverse arguments to both diff, so the
11590 expected is on the left and the obtained on the right.
11592 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
11593 macros. Delete declarations for m4error, warning, fatal and
11594 internal_error, add declaration for error_message_prefix.
11595 * m4.c: Delete m4error, warning, fatal and internal_error
11596 routines, add error_message_prefix routine.
11597 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
11598 warning with WARNING*, fatal with FATAL* and internal_error with
11600 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
11601 this is not needed anymore.
11603 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
11604 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
11605 and debug_message, add declaration for debug_message_prefix.
11606 * debug.c: Remove static specifier for FILE *debug declaration.
11607 Delete debug_print and debug_message routines, add
11608 debug_message_prefix routine.
11609 * builtin.c, debug.c: Replace debug_print routine calls with
11610 DEBUG_PRINT* macro calls.
11611 * input.c, path.c: Replace debug_message routine calls with
11612 DEBUG_MESSAGE* macro calls.
11614 * m4.h: Remove inclusion of <varargs.h>.
11615 * debug.c: Include <stdarg.h> or <varargs.h>.
11616 (trace_format): Use stdarg instead of varargs if __STDC__.
11618 * configure.in: Remove checks for vfprintf and _doprnt. These
11619 implementations use varargs tricks which are not portable enough.
11620 * lib/vfprintf.c: Deleted.
11621 * lib/_doprnt.c: Deleted.
11622 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
11623 Reported by Joel Sherrill.
11625 * path.c (add_include_directory): Use xstrdup.
11627 * builtin.c (find_builtin_by_name): Declare static.
11629 * *.[ch]: Add const to a few "char *" declarations.
11631 * configure.in: Remove commented tests for fileno() and fstat().
11632 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
11634 * debug.c (debug_flush_files): New.
11635 * m4.h: Declares it.
11636 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
11637 Reported by Nicolas Pioch.
11639 1993-11-12 François Pinard <pinard@iro.umontreal.ca>
11641 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
11642 Reported by Joel Sherrill.
11644 * builtin.c (prefix_all_builtins): Instead of the table size, use
11645 the null entry at end for stopping the loop. It was overwritten.
11646 Reported by Andreas Schwab and Jim Meyering.
11648 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
11649 Reported by Kaveh R. Ghazi.
11651 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
11652 Reported by Karl Vogel.
11654 1993-11-09 François Pinard <pinard@iro.umontreal.ca>
11656 * m4.h: Do not define volatile if already defined.
11657 Reported by René Seindal.
11659 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
11661 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
11662 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
11664 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
11666 * m4.h: Define strchr and strrchr in terms of index and rindex,
11667 instead of the other way around.
11668 * builtin.c, m4.c, path.c: Use strchr instead of index.
11670 * input.c (next_char): Remove a "break;" after a "return ...;".
11671 Reported by Tom McConnell.
11673 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
11677 * configure.in: Do not copy check files in the build hierarchy.
11678 * checks/check-them: Identify the m4 version being checked. For
11679 finding m4, look in $PATH instead of in the parent directory.
11680 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
11681 * checks/Makefile.in (.all-stamp): Always create check files in
11682 the source hierarchy, not anymore in the build hierarchy.
11683 (check): cd to the source hierarchy before performing checks.
11684 Do not copy nor clean COPYING anymore, take it from `..'.
11685 Reported by Tom McConnell.
11687 * Makefile.in (Makefile): Use $(SHELL).
11688 (config.status): Use $(SHELL). Use "config.status --recheck"
11689 instead of "configure --no-create", which is obsolete.
11690 Reported by Tom McConnell.
11692 1993-11-05 François Pinard <pinard@iro.umontreal.ca>
11694 * m4.c (usage): Use "%s" instead of "m4" in format string.
11695 Reported by Jim Meyering.
11697 * Makefile.in: Distribute mkinstalldirs.
11698 Reported by Pierre Gaumond.
11699 Reported by Jim Meyering.
11700 Reported by Tom McConnell.
11701 Reported by Andreas Gustafsson.
11703 * checks/check-them: Renamed from checks/check_them.
11704 * checks/get-them: Renamed from checks/get_them.
11705 * checks/.all-stamp: Renamed from checks/.all_stamp.
11706 * checks/Makefile.in: Changed accordingly.
11707 Reported by Jim Meyering.
11709 1993-11-04 François Pinard <pinard@iro.umontreal.ca>
11711 * lib/Makefile.in (dist): Correct permissions on files.
11713 * output.c: Declare tmpfile, some systems don't.
11715 1993-11-03 François Pinard <pinard@iro.umontreal.ca>
11717 * checks/Makefile.in (dist): Correct permissions on files.
11719 * Makefile.in (dist): Ensure recursive linking for subdirectory
11720 `examples', also set read/write permissions on all its files.
11722 * mkinstalldirs: New, from elsewhere.
11723 * Makefile.in: Use it.
11725 * debug.c: Synchronize debug messages and regular output when
11726 the debug file and stdout are redirected to the same file.
11727 * configure.in: Add (commented) checks for fileno and fstat.
11728 Reported by Jim Avera.
11730 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
11731 etc., arguments, then ignore the superfluous one. m4 used to
11732 diagnose missing arguments and return the empty string.
11733 Reported by Nick S. Kanakakorn.
11735 1993-11-02 François Pinard <pinard@iro.umontreal.ca>
11737 * m4.c (main): At end of all input, ensure all undiverted text
11738 goes to the main output stream.
11739 Reported by Andreas Gustafsson.
11741 * m4.c (main): exit (0), instead of return 0.
11743 * m4.c: Implement -P and --prefix-builtins.
11744 * builtin.c: Delete const specifier on builtin_tab.
11745 (prefix_all_builtins): New.
11746 Reported by Noah Friedman.
11747 Reported by Scott Bartram.
11749 * c-boxes.el: New, from elsewhere.
11750 * Makefile.in: Distribute it.
11752 * m4.h: Do not define bcopy if <string.h> defines it.
11753 Reported by Stephen Perkins.
11755 * builtin.c (define_macro): Allow a missing second argument, in
11756 which case it is implied empty. Affects define and pushdef.
11757 Reported by Eric Allman.
11759 1993-11-01 François Pinard <pinard@iro.umontreal.ca>
11761 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
11762 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
11763 * builtin.c: Initialize all the blindness fields in builtin_tab.
11764 (define_builtin): Copy the blindness of a builtin into its symbol.
11765 * macro.c (expand_token): Avoid processing a blind builtin if the
11766 next character is not an opening parenthesis.
11767 Reported by David MacKenzie.
11768 Reported by Noah Friedman.
11770 * configure.in: Ensure an exit status of 0 on completion.
11771 Reported by Vivek P. Singhal.
11773 * eval.c (eval_lex): Admit both lower and upper case letters for
11774 bases greater than 10. Only lower case letters were accepted.
11776 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
11777 Reported by Krste Asanovic.
11779 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
11780 * eval.c (logical_not_term): New name for not_term.
11781 * eval.c (xor_term): New, between or_term and and_term.
11782 * eval.c (not_term): New, between and_term and logical_not_term.
11783 * eval.c (shift_term): New, between cmp_term and add_term.
11784 Reported by Krste Asanovic: ~, ^, <<, >>.
11785 Reported by Ben A. Mesander: ** vs ^.
11787 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
11788 * m4.h: Delete xrealloc.c.
11789 * lib/xmalloc.c: New, from elsewhere.
11790 * lib/xstrdup.c: New, from elsewhere.
11791 * lib/Makefile.in: Distribute and compile them.
11793 * m4.c: Change progname to program_name.
11794 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
11795 * lib/error.c: New, from elsewhere.
11796 * lib/Makefile.in: Distribute and compile error.c.
11797 * configure.in: Check AC_VPRINTF and for strerror.
11798 * m4.c: Delete cmd_error. Use error instead.
11799 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
11801 * m4.h: Delete #define const, let Autoconf takes care of this.
11803 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
11804 Merge parse_args into main. Declare argv to be `char *const *',
11805 then remove superfluous casts.
11807 * m4.c: Rename --no-gnu-extensions to --traditional.
11808 Reported by Ben A. Mesander.
11810 * m4.c (usage): Add a status parameter. Supply one in various
11811 calls. Add --help processing. Remove -V for --version.
11813 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
11815 * lib/Makefile.in: Have an AR=ar declaration.
11816 Reported by Eric Backus.
11817 Reported by Bjorn R. Bjornsson.
11818 Reported by Tom Tromey.
11819 Reported by Kristine Lund.
11820 Reported by Marion Hakanson.
11822 1993-10-30 François Pinard <pinard@iro.umontreal.ca>
11824 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
11825 Reported by Noah Friedman.
11827 1993-10-25 François Pinard <pinard@iro.umontreal.ca>
11829 * Makefile.in: Remove MDEFINES and cleanup.
11831 1993-06-09 François Pinard <pinard@iro.umontreal.ca>
11833 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
11834 Create a gzip file.
11836 1993-02-06 François Pinard <pinard@iro.umontreal.ca>
11838 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
11839 ensure 777 mode for directories, so older tar's will restore file
11842 1993-01-17 François Pinard <pinard@iro.umontreal.ca>
11844 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
11845 so the installer can override automatically configured choices.
11846 Reported by Karl Berry.
11848 1993-01-15 François Pinard <pinard@iro.umontreal.ca>
11850 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
11851 previous version was not working properly on m68k-hp-bsd4.3.
11852 Reported by Roland McGrath.
11854 * lib/_doprnt.c: Stolen from Oleo distribution.
11855 * configure.in: Check for _doprnt.c if vfprintf.c selected.
11856 * lib/Makefile.in: Distribute _doprnt.c.
11857 Do not distribute regex.[ch].old anymore.
11859 1993-01-01 François Pinard <pinard@iro.umontreal.ca>
11861 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
11862 Richard wants it there.
11864 1992-12-27 François Pinard <pinard@iro.umontreal.ca>
11866 * Makefile.in: Add DEFS to MDEFINES.
11867 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
11868 (libm4.a): Remove the library before creating it.
11869 (distclean): Remove tags and TAGS too.
11871 1992-12-23 François Pinard <pinard@iro.umontreal.ca>
11873 * Makefile.in (dvi, m4.dvi): New goals.
11875 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
11876 macro.c, output.c, path.c, symtab.c: Change Copyright from
11877 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
11879 * examples/divert.m4: Deleted, this bug has been corrected.
11881 * Makefile.in (texclean, mostlyclean): New goals.
11883 * Makefile.in (clean): Remove clutter from ansi2knr.
11884 Reported by Pierre Gaumond.
11886 1992-12-20 François Pinard <pinard@iro.umontreal.ca>
11888 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
11889 might well use CFLAGS is s/he needs it.
11891 * Makefile.in: Allow installation of info files from a separate
11893 Reported by Jason Merrill.
11894 Reported by David MacKenzie.
11895 Reported by Skip Montanaro.
11896 Reported by Erez Zadok.
11897 Reported by Assar Westerlund.
11899 1992-12-19 François Pinard <pinard@iro.umontreal.ca>
11902 This is still a beta release for the future GNU m4 version 1.1.
11904 * lib/alloca.c: New, from elsewhere.
11905 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
11907 * m4.h: Do not define index/rindex if already defined. If
11908 FALSE/TRUE are already defined, do not redefine them, but merely
11909 define boolean typedef to int.
11911 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
11912 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
11913 because some C compilers do not like connectives with #ifdef.
11914 * m4.h: Define `volatile' only if __GNUC__, instead of once for
11915 __GNUC__ and once for __STDC__.
11916 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
11918 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
11919 Makefile dependencies. Without it, make keeps destroying and
11920 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
11922 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
11923 to diversion/DIVERSION, this was a spelling error.
11925 * m4.c: Declare version[], remove #include "version.h".
11926 * version.h: Deleted.
11927 * Makefile.in: Remove references to version.h.
11929 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
11930 production, by using a simpler and more robust algorithm. This
11931 solves the problem of synclines sometimes written in the middle of
11932 an output line. Delete sync_line() and output_lines variable.
11933 * m4.h: Remove sync_line prototype and output_lines declaration.
11934 * input.c (next_char), output.c (shipout_text): Remove references
11936 * input.c (push_file, pop_file): Merely put the value -1 in
11937 output_current_line instead of calling sync_line, for delaying a
11938 single `#line NUM FILE' before next output line. Do not test
11939 for sync_output, because this is unnecessary clutter.
11940 * output.c (make_divertion, insert_divertion): Idem.
11941 * input.c: Rename must_advance_line to start_of_input_line, for
11944 * debug.c (trace_header): Select a new debug line format, which
11945 better complies with GNU standards for formatting error messages.
11946 With option `-dfl', M-x next-error might be used on the output.
11947 * m4.c (vmesg): Adjust format of error output to GNU standards.
11948 * m4.texinfo: Adjust examples for `make check' to work.
11950 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
11951 case for enum debug_info constants, which were all lower case.
11953 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
11955 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
11956 collected patches. I tried a few times using newer regex.[ch], it
11957 mysteriously stopped aborting with this one. Insecure feeling...
11958 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
11960 1992-12-18 François Pinard <pinard@iro.umontreal.ca>
11962 * m4.c: Change `--no-warnings' to `--silent'.
11963 Reported by David MacKenzie.
11965 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
11966 leave it off for now. See comment in m4.c for justification.
11967 Reported by David MacKenzie.
11969 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
11970 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
11972 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
11974 * Makefile.in: Ensure recursive cleaning is done before local
11975 cleaning for all clean goals.
11977 * builtin.c (ntoa): Ensure the value is always interpreted as a
11978 signed quantity, whatever the radix is.
11980 1992-11-18 Jim Meyering <meyering@idefix>
11982 * builtin.c, format.c, input.c: Split long lines.
11983 * m4.c: Use typedef macro_definition instead of struct
11985 * symtab.c: Use typedef symbol instead of struct symbol.
11987 1992-11-17 François Pinard <pinard@iro.umontreal.ca>
11989 * *.[ch]: Remove all trailing whitespace, in code and comments.
11991 * configure.in: Find some awk.
11992 * Makefile.in: Add $(AWK) to MDEFINES.
11993 * checks/Makefile.in: Transmit $(AWK) to get_them.
11994 * checks/get_them: Use $AWK instead of gawk. Add a close in the
11995 awk script when switching files, because without this, mawk runs
11996 out of file descriptors.
11998 1992-11-16 François Pinard <pinard@iro.umontreal.ca>
12000 * Makefile.in (realclean): Delete m4.info*.
12001 Reported by Jim Meyering.
12003 * Makefile.in: Adjust and link with checks/Makefile.
12004 * checks/Makefile.in: New.
12005 * configure.in: Output checks/Makefile.
12007 * checks/get_them: Have the dnl header of each test more
12008 recognizable by next-error, also use a better message.
12010 1992-11-16 Jim Meyering <meyering@idefix>
12012 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
12013 And use that only if __GNUC__ since we're using it's GCC-specific
12014 semantics that tell the compiler the associated function doesn't
12017 * builtin.c (substitute): Don't use character as an array index.
12018 (dumpdef_cmp): Make formal arguments `const void *' to avoid
12019 warnings with gcc -W -Wall on systems with qsort prototype.
12020 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
12023 * eval.c (most functions): Add parentheses to assignments used
12024 as truth values go avoid warnings from gcc -Wall.
12026 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
12027 any functions that don't need external scope.
12029 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
12030 (many functions and arrays): Declare `const'.
12032 1992-11-15 François Pinard <pinard@iro.umontreal.ca>
12034 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
12035 removing the declaration from m4.h. Also rename false to FALSE
12038 * lib/Makefile.in (Makefile): New goal.
12040 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
12041 so heavily loaded. It gets more easily overridable, calling make.
12042 Reported by Jim Meyering.
12044 * Makefile.in (dist): Get .fname from the current directory name,
12045 instead of from version.h. I need updating many files manually,
12046 when the version changes, version.h is just one of them.
12048 1992-11-14 François Pinard <pinard@iro.umontreal.ca>
12050 * m4.h: Remove the tag `boolean' on the enum introducing typedef
12051 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
12052 Reported by Tom McConnell.
12054 1992-11-13 François Pinard <pinard@iro.umontreal.ca>
12056 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
12057 39.cleardiv, which were describing missing or spurious newlines.
12058 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
12059 do not depend on machine word size, `/bin/false' implementation,
12060 or `wc' output format. `make check' is more dependable, now.
12062 * checks/check_them: Summarize the failed tests by listing their
12063 name, at end. If none, issue `All checks successful'. Output
12064 `Checking' instead of `Input file:'.
12066 * checks/get_them, checks/check_them: Reindented.
12068 * Makefile.in (dist): chmod a+r before making the tar file.
12070 1992-11-12 François Pinard <pinard@iro.umontreal.ca>
12072 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
12074 * input.c (next_token): Reinitialize token_buttom just after using
12075 it as a watermark with obstack_free. Or else, a future token, big
12076 enough for triggering reallocation of the obstack chunk, could
12077 void the initialized value of token_buttom, later causing panic in
12078 obstack_free. Rename token_buttom to token_bottom everywhere.
12080 * m4.h: Before declaring errno, first include <errno.h> and
12081 ensure that it does not define errno.
12082 Reported by Richard Stallman.
12084 1992-11-11 François Pinard <pinard@iro.umontreal.ca>
12086 * builtin.c: Define and use DECLARE macro for builtins.
12088 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
12089 argument, this is a common idiom for introducing long comments.
12091 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
12092 arguments. The last argument was silently ignored.
12094 * m4.c (cmd_error): Add a missing semicolon before va_end().
12096 1992-11-10 François Pinard <pinard@iro.umontreal.ca>
12098 * Makefile.in: Now handle protoized sources. Define and use U.
12099 Compile and use ansi2knr with old compilers. Update DISTFILES.
12100 Add `aclocal.m4' to `configure' dependencies.
12101 * ansi2knr.c: New, from Ghostscript distribution.
12102 * configure.in: Define U through FP_PROTOTYPES for old compilers.
12103 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
12104 * aclocal.m4: New, provide FP_PROTOTYPES.
12105 * m4.h: Conditionnaly protoized through Args, save for varags.
12106 * builtin.c: Protoized. Then:
12107 Include <sys/types.h> if size_t is not defined, before "regex.h".
12108 (m4_ifelse): Fetch built-in name properly for diagnostic.
12109 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
12110 (m4_regexp): Add const to `msg' declaration.
12111 (m4_patsubst): Add const to `msg' declaration.
12112 * debug.c: Protoized, save for varargs.
12113 * eval.c: Protoized.
12114 * format.c: Protoized.
12115 * input.c: Protoized.
12116 * m4.c: Protoized, save for varargs. Then:
12117 (xfree): Accept void * instead of char *.
12118 (xmalloc): Return void * instead of char *.
12119 (xrealloc): Accept and return void * instead of char *.
12120 * macro.c: Protoized.
12121 * output.c: Protoized.
12122 * path.c: Protoized. Then cast some (char *) over xmalloc's.
12123 * symtab.c: Protoized.
12125 1992-11-06 François Pinard <pinard@iro.umontreal.ca>
12127 * m4.texinfo: Remove directory from diagnostics in 30.include,
12128 51.eval, 56.errprint and 57.m4exit tests.
12130 * m4.h: Remove declarations for int or void system functions, they
12131 cause more conflicting trouble than they make good.
12133 * configure.in: Avoid configuration header file. Add some tests.
12134 * m4.h: Remove #include "config.h".
12135 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
12136 Then, rewritten for better compliance with GNU standards.
12138 1992-11-05 François Pinard <pinard@iro.umontreal.ca>
12140 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
12141 because of a misplaced #endif.
12143 * Many *.[hc] files: Correct intra-line spacing here and there,
12144 according to GNU indent 1.6 advice.
12146 * configure.in: New, using Autoconf 1.2.
12147 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
12148 * Delete old configure.in, configure, etc/configure.in,
12149 etc/configure, lib/configure.in, lib/configure and config/*.
12150 Reported by Jason Merrill.
12152 * symtab.c (hash): Change (char) NULL to '\0'.
12153 Reported by Jason Merrill.
12155 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
12156 etc/nextvers.sh. Release numbers will be edited `by hand'.
12157 * version.h: De-automatize, force value in.
12159 * m4.c: Changes in order to use a newer getopt.h.
12160 Reported by David MacKenzie.
12162 * checks/: New name for examples/.
12163 * checks/get_them: New location for etc/get_examples.
12164 * checks/check_them: New location for etc/check_examples.
12165 * Makefile.in, checks/get_them, checks/check_them: Adjust.
12166 * lib/vfprintf.c: New location for etc/vfprintf.c.
12167 * Delete empty etc/.
12168 * examples/: New name for test/.
12170 1992-03-10 François Pinard <pinard@iro.umontreal.ca>
12172 * Makefile.in (check): Add m4 as dependency.
12174 * m4.c: Accept --no-warnings instead of --no_warnings, and
12175 --no-gnu-extensions instead of --no_gnu_extensions. Make the
12176 usage message more informative.
12177 Reported by David MacKenzie.
12179 1992-03-09 François Pinard <pinard@iro.umontreal.ca>
12181 * etc/check_examples: New name for check_examples.sh.
12182 * etc/get_examples: New name for get_examples.sh.
12183 * Makefile.in, etc/Makefile.in: Use new names.
12185 * Makefile.in: Transmit $(CC) while making in lib.
12187 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
12188 code disposition by hand.
12190 1992-03-08 François Pinard <pinard@iro.umontreal.ca>
12192 * m4.h: Delete definitions for abort() and exit().
12193 Reported by Richard Stallman.
12195 * config/hmake-unicos, config/s-unicos.h: New files.
12196 Reported by Hal Peterson.
12198 * eval.c (exp_term): Have N^0 return 1.
12199 Reported by Michael Fetterman.
12201 * eval.c, input.c, m4.h: Remove last comma in enums.
12202 Reported by Mike Lijewski.
12204 * Transfer of maintenance duties from René to François.
12206 1991-10-24 René Seindal <seindal@diku.dk>
12208 * Release 1.0. Many thanks to those, who provided me with bug
12209 reports and feedback.
12211 * Uses GNU configure, taken from the gdb distribution.
12213 * Uses GNU getopt(), with long option names.
12215 * The -Q/+quiet option is added, which suppresses warnings about
12216 missing or superflous arguments to built-in macros.
12218 * Added default options via the M4OPTS environment variable.
12220 * The built-in format can now be configured to use sprintf as
12221 the formatting engine, for systems without [efg]cvt(3).
12223 * GNU library code is moved to the ./lib subdirectory; other
12224 utility files are now in ./etc.
12226 * Several minor bugs have been fixed.
12228 1991-07-26 René Seindal <seindal@diku.dk>
12230 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
12231 François Pinard and Roland H. Pesch for providing me with reports.
12233 * The builtins incr and decr are now implemented without use of
12236 * The builtin indir is added, to allow for indirect macro calls
12237 (allows use of "illegal" macro names).
12239 * The debugging and tracing facilities has been enhanced
12240 considerably. See the manual for details.
12242 * The -tMACRO option is added, marks MACRO for tracing as soon
12245 * Builtins are traced after renaming iff they were before.
12247 * Named files can now be undiverted.
12249 * The -Nnum option can be used to increase the number of
12250 divertions available.
12252 * Calling changecom without arguments now disables all comment
12255 * The function m4_patsubst() is now consistently declared
12258 * A bug in dnl is fixed.
12260 * A bug in the multi-character quoting code is fixed.
12262 * Several typos in the manual has been corrected. More probably
12265 * The m4.info file is now installed along with the program.
12267 1990-11-15 René Seindal <seindal@diku.dk>
12269 * Updated and enhanced version. Release 0.75, manual 0.07.
12271 * Implemented search path for include files (-I option and
12272 M4PATH envronment variable).
12274 * Implemented builtin "format" for printf-like formatting.
12276 * Implemented builtin "regexp" for searching for regular
12279 * Implemented builtin "patsubst" for substitution with regular
12282 * Implemented builtin "esyscmd", which expands to a shell
12285 * Implemented "__file__" and "__line__" for use in error
12288 * Implemented character ranges in "translit".
12290 * Implemented control over debugging output.
12292 * Implemented multi-character quotes.
12294 * Implemented multi-character comment delimiters.
12296 * Changed predefined macro "gnu" to "__gnu__".
12298 * Changed predefined macro "unix" to "__unix__", when the -G
12299 option is not used. With -G, "unix" is still defined.
12301 * Changed "shift", "$@" and "$*" to not insert spaces afters
12304 * Added program name to error messages.
12306 * Fixed two missing null bytes bugs.
12308 1990-01-22 René Seindal <seindal@diku.dk>
12310 * Initial beta release. Release 0.50, manual 0.05.
12319 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
12320 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
12322 Copying and distribution of this file, with or without
12323 modification, are permitted provided the copyright notice
12324 and this notice are preserved.