1 2013-09-15 Gary V. Vaughan <gary@gnu.org>
3 doc: use .texi extension consistently.
4 * doc/m4.texinfo: Rename from this...
5 * doc/m4.texi: ...to this.
6 * Makefile.am (m4_texinfo): Rename from this...
7 (m4_texi): ...to this. Adjust all callers.
8 * doc/Makeflie.am (m4_TEXINFOS): Adjust.
10 bootstrap: set copyright_holder explicitly.
11 * bootstrap.conf (copyright_holder): Explicitly set to the FSF.
13 configury: don't check in generated files.
14 * COPYING: Install explicitly to avoid confusion over M4
16 * INSTALL, build-aux/compile, bulid-aux/config.guess,
17 build-aux/config.sub, build-aux/depcomp, build-aux/install-sh,
18 build-aux/mdate-sh, build-aux/missing, build-aux/texinfo.tex:
21 configury: don't install modules to pkglibexecdir.
22 Modern Automake (correctly) oerrors out when trying to install
23 modules to pkglibexecdir; we should be using pkglibdir here.
24 * Makefile.am (pkglibexec_LTLIBRARIES): Rename from this...
25 (pkglib_LTLIBRARIES): ...to this.
27 bootstrap: sync with upstream.
28 * bootstrap.conf: New file.
29 * gl/build-aux/bootstrap.in, gl/build-aux/extract-trace,
30 gl/build-aux/funclib.sh, gl/build-aux/options-parser: Update
31 from upstream to pick up recent improvements.
32 * bootstrap: Regenerate.
33 * ltdl/m3/gnulib-cache.m4: Regenerate.
35 2010-03-02 Giuseppe Scrivano <gscrivano@gnu.org> (tiny change)
37 Support bootstrap --gnulib-srcdir=DIR.
38 * bootstrap: Add --gnulib-srcdir option, which overrides
39 GNULIB_SRCDIR, for consistency with gnulib bootstrap.
41 2010-03-01 Eric Blake <eblake@redhat.com>
43 Mention release of version 1.4.14.
44 * gnulib: Update to latest.
45 * README: Drop CVS mention.
46 * HACKING: Tweak release instructions.
47 * NEWS: Mention the release.
48 * .prev-version: Record previous version.
49 * cfg.mk (old_NEWS_hash): Auto-update.
51 2010-02-24 Eric Blake <eblake@redhat.com>
53 Improve parsing example.
54 * doc/m4.texinfo (Input processing): Double-quote argument to
55 translit, for robustness.
57 Reported by Chris Penev.
59 2010-01-29 Eric Blake <ebb9@byu.net>
61 Document upcoming release.
62 * gnulib: Update to latest.
63 * doc/m4.texinfo (History): Mention 1.4.14.
64 * Makefile.am (src/getopt.h): Drop dependence on now-obsolete
67 2010-01-08 Eric Blake <ebb9@byu.net>
69 Address remaining 'make syntax-check' findings.
70 * gnulib: Update to latest.
71 * Makefile.am (tests/package.m4): Avoid @@ substitution.
72 (src_m4_LDADD): Link with libiconv.
73 * m4/m4private.h (STREQ): New macro.
74 * m4/resyntax.c (m4_regexp_syntax_encode): Use it.
75 * src/main.c (process_file): Likewise.
76 (includes): Drop unused header.
77 * m4/macro.c (m4_arg_equal): Adjust comment.
78 * m4/syntax.c: Likewise.
79 * m4/system_.h: Avoid useless preprocessor parenthesis.
80 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
81 * src/stackovf.c: Likewise.
82 (setup_stackovf_trap): Mark diagnostics.
83 * modules/mpeval.c (includes): Move quotearg.h inclusion...
84 * modules/evalparse.c (includes): ...to where it is used.
85 * cfg.mk (local-checks-to-skip): Exempt tests that cause spurious
86 failures, but first fix what they were intended to detect.
87 (_makefile_at_at_check_exceptions): Allow an exception.
89 2010-01-07 Eric Blake <ebb9@byu.net>
91 Use correct license on auxiliary documentation.
92 * gnulib: Update to latest.
93 * AUTHORS: Use GFDL 1.3, not 1.2.
94 * README-alpha: Likewise.
97 * doc/STYLE: Likewise.
98 * modules/README: Likewise.
99 * NEWS: Place under GFDL.
101 * cfg.mk (old_NEWS_hash): Update.
103 Address 'make sc_error_message_uppercase' failures.
104 * m4/output.c (m4_freeze_diversions): Silence false positive.
105 * src/main.c (main): Use 'warning', not 'Warning', in messages.
106 * m4/utility.c (m4_verror_at_line): Likewise.
107 * doc/m4.texinfo (Operation modes, Macro Arguments, Undefine)
108 (Defn, Pushdef, Indir, Builtin, Ifdef, Ifelse, Dumpdef, Trace)
109 (Debuglen, Debugfile, Dnl, Changeresyntax, Standard Modules)
110 (Index macro, Regexp, Substr, Translit, Patsubst, Format, Incr)
111 (Eval, Mkstemp, Syncoutput, Improved forloop)
112 (Improved fatal_error): Adjust expected output.
113 * tests/builtins.at (define, mkdtemp, mkstemp): Likewise.
114 * tests/freeze.at (loading format 1, reloading unknown builtin):
116 * tests/macros.at (Arity and defn, 'Arity, defn, and freeze')
117 (pushdef/popdef): Likewise.
118 * tests/null.err: Likewise.
119 * tests/options.at (deprecated options, POSIXLY_CORRECT)
120 (--fatal-warnings, --regexp-syntax, --syncoutput): Likewise.
121 * tests/others.at (nul character, stdin seekable): Likewise.
122 * tests/modules.at (AT_CHECK_M4_MODTEST, modules: text):
125 Address 'make sc_cast_of_argument_to_free' failures.
126 * m4/m4private.h (DELETE): Adjust comment and fix parentheses.
127 * m4/m4.c (m4_delete): Use it to avoid warning.
128 * m4/module.c (install_builtin_table, module_remove): Likewise.
129 * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy):
131 * .x-sc_cast_of_argument_to_free: New file.
132 * Makefile.am (syntax_check_exceptions): Distribute exceptions.
134 More whitespace cleanup.
135 * HACKING: Nuke trailing whitespace.
136 * examples/WWW/Makefile: Likewise.
137 * examples/WWW/_footer.htm: Likewise.
138 * examples/WWW/_header.htm: Likewise.
139 * examples/WWW/m4lib/bugs.m4: Likewise.
140 * examples/WWW/m4lib/html.m4: Likewise.
141 * examples/WWW/m4lib/menu.m4: Likewise.
142 * examples/WWW/m4lib/visions.m4: Likewise.
143 * examples/esyscmd.m4: Likewise.
144 * examples/fstab.m4: Avoid space-tab.
145 * examples/patsubst.m4: Likewise.
146 * NEWS: Prefer space over tab for alignment.
149 * bootstrap: Likewise.
150 * configure.ac: Likewise.
151 * ltdl/m4/stackovf.m4: Likewise.
152 * m4/hash.c: Likewise.
153 * m4/hash.h: Likewise.
154 * m4/input.c: Likewise.
156 * m4/m4module.h: Likewise.
157 * m4/m4private.h: Likewise.
158 * m4/macro.c: Likewise.
159 * m4/module.c: Likewise.
160 * m4/output.c: Likewise.
161 * m4/path.c: Likewise.
162 * m4/resyntax.c: Likewise.
163 * m4/symtab.c: Likewise.
164 * m4/syntax.c: Likewise.
165 * m4/system_.h: Likewise.
166 * modules/evalparse.c: Likewise.
167 * modules/format.c: Likewise.
168 * modules/gnu.c: Likewise.
169 * modules/import.c: Likewise.
170 * modules/load.c: Likewise.
171 * modules/m4.c: Likewise.
172 * modules/m4.h: Likewise.
173 * modules/modtest.c: Likewise.
174 * modules/mpeval.c: Likewise.
175 * modules/perl.c: Likewise.
176 * modules/shadow.c: Likewise.
177 * modules/stdlib.c: Likewise.
178 * modules/time.c: Likewise.
179 * modules/traditional.c: Likewise.
180 * src/freeze.c: Likewise.
181 * src/main.c: Likewise.
182 * src/stackovf.c: Likewise.
183 * tests/stackovf.test: Likewise.
184 * doc/STYLE: Mention the change.
186 2010-01-05 Eric Blake <ebb9@byu.net>
188 Document new indentation policy.
189 * HACKING: Document indentation policy.
190 * .x-sc_prohibit_tab_based_indentation: New file.
191 * cfg.mk (sc_prohibit_tab_based_indentation): New rule.
192 * Makefile.am (syntax_check_exceptions): Ship exception.
194 Switch to indentation by space, not tab.
195 * .gitmodules: Convert leading tabs to spaces.
197 * bootstrap: Likewise.
198 * configure.ac: Likewise.
199 * examples/WWW/m4lib/html.m4: Likewise.
200 * examples/WWW/m4lib/layout.m4: Likewise.
201 * examples/WWW/m4lib/menu.m4: Likewise.
202 * ltdl/m4/debug.m4: Likewise.
203 * ltdl/m4/gmp.m4: Likewise.
204 * ltdl/m4/m4-obstack.m4: Likewise.
205 * ltdl/m4/stackovf.m4: Likewise.
206 * m4/builtin.c: Likewise.
207 * m4/debug.c: Likewise.
208 * m4/hash.c: Likewise.
209 * m4/hash.h: Likewise.
210 * m4/input.c: Likewise.
212 * m4/m4module.h: Likewise.
213 * m4/m4private.h: Likewise.
214 * m4/macro.c: Likewise.
215 * m4/module.c: Likewise.
216 * m4/output.c: Likewise.
217 * m4/path.c: Likewise.
218 * m4/resyntax.c: Likewise.
219 * m4/symtab.c: Likewise.
220 * m4/syntax.c: Likewise.
221 * m4/utility.c: Likewise.
222 * modules/evalparse.c: Likewise.
223 * modules/format.c: Likewise.
224 * modules/gnu.c: Likewise.
225 * modules/load.c: Likewise.
226 * modules/m4.c: Likewise.
227 * modules/m4.h: Likewise.
228 * modules/mpeval.c: Likewise.
229 * modules/perl.c: Likewise.
230 * modules/stdlib.c: Likewise.
231 * modules/time.c: Likewise.
232 * src/freeze.c: Likewise.
233 * src/m4.h: Likewise.
234 * src/main.c: Likewise.
235 * src/stackovf.c: Likewise.
236 * tests/builtins.at: Likewise.
237 * tests/freeze.at: Likewise.
238 * tests/generate.awk: Likewise.
239 * tests/modules.at: Likewise.
240 * tests/others.at: Likewise.
241 * tests/stackovf.test: Likewise.
242 * tests/testsuite.at: Likewise.
244 Update copyright year.
245 All files impacted, via 'make update-copyright'. Additionally:
246 * .gitignore: Ignore backup files.
248 Prepare to bulk update copyright year.
250 * ltdl/m4/gnulib-cache.m4: Import update-copyright module.
251 * cfg.mk (update-copyright-env): Enforce longhand behavior.
252 * .x-update-copyright: New file.
253 * Makefile.am (syntax_check_exceptions): Distribute exception.
254 * ltdl/m4/debug.m4: Add FSF copyright.
255 * ltdl/m4/m4-error.m4: Fix FSF name in copyright.
256 * ltdl/m4/m4-getopt.m4: Likewise.
257 * ltdl/m4/m4-gettext.m4: Likewise.
258 * ltdl/m4/m4-obstack.m4: Likewise.
259 * ltdl/m4/m4-regex.m4: Likewise.
260 * ltdl/m4/m4-rename.m4: Likewise.
261 * ltdl/m4/m4-syscmd.m4: Likewise.
262 * modules/modtest.m4: Likewise.
263 * modules/perl.m4: Likewise.
264 * modules/shadow.m4: Likewise.
265 * modules/stdlib.m4: Likewise.
266 * modules/time.m4: Likewise.
267 * modules/time2.m4: Likewise.
268 * tests/iso8859.m4: Likewise.
270 Use gnulib maintainer-makefile module.
271 * ltdl/m4/gnulib-cache.m4: Import maintainer-makefile module.
272 * cfg.mk (local-checks-to-skip): Drop changelog-check; add
273 sc_cast_of_x_alloc_return_value.
274 (gnu_ftp_host-alpha, gnu_ftp_host-beta, gnu_ftp_host-major)
275 (gnu_rel_host): Delete; provided by maint.mk.
276 (old_NEWS_hash): New macro.
277 * .prev-version: New file.
278 * .x-sc_require_config_h: Likewise.
279 * .x-sc_require_config_h_first: Likewise.
280 * Makefile.am (syntax_check_exceptions, EXTRA_DIST): Ship new
282 * maint.mk: Remove from version control; use gnulib instead.
283 * .gitignore: Update.
285 Update to latest gnulib.
287 * ltdl/m4/gnulib-cache.m4: Import xoset.
288 * m4/output.c (includes): Ensure that gnulib oset usage will
289 call xalloc_die on memory failure.
290 * Makefile.am (src/getopt.h): Update snippet from gnulib.
291 (LINK_WARNING_H, ARG_NONNULL_H): New macros.
293 Fix testsuite failure on newer glibc.
294 * tests/testsuite.at (AT_CHECK_M4): Tolerate alternate getopt
296 * tests/options.at (deprecated options, unknown option)
297 (--debugmode): Adjust expected output accordingly.
298 Reported by Ralf Wildenhues.
300 2009-11-26 Eric Blake <ebb9@byu.net>
302 Update to newer gnulib.
304 * ltdl/m4/gnulib-cache.m4: Import inttypes, setenv, and unsetenv
306 * modules/m4.c (m4_make_temp): Adjust gen_tempname client.
307 * bootstrap (src_modules): Pick up getopt-gnu and its
309 * configure.ac (gl_VERSION_ETC): Support ./configure
311 (AC_CHECK_FUNCS_ONCE): Rely on gnulib for setenv, unsetenv.
312 * ltdl/m4/m4-getopt.m4: Rewrite to match current gnulib.
313 * Makefile.am (src/getopt.h): Likewise.
314 * modules/stdlib.c (setenv, unsetenv): Rely on gnulib.
316 2009-08-24 Eric Blake <ebb9@byu.net>
318 Pick up gnulib fixes for sub-process execution.
320 * tests/others.at (stdin and stdout closed): New test, to avoid
321 regression introduced on 1.4 branch on 2008-07-17.
322 * NEWS: Document the change.
324 A status of 127 does not always imply esyscmd failure.
325 * modules/gnu.c (esyscmd): Silence gnulib message; regression
326 introduced 2009-03-13.
327 * doc/m4.texinfo (Sysval): Test this.
328 * NEWS: Document the change.
330 2009-06-26 Eric Blake <ebb9@byu.net>
332 Use bitrotate for hashing.
333 * gnulib: Update to latest.
334 * ltdl/m4/gnulib-cache.m4: Import bitrotate module.
335 * m4/hash.c (m4_hash_string_hash): Use it.
337 Fix description of limits on diversions.
338 * doc/m4.texinfo (Diversions): Fix grammar. Be less pessimistic
341 Reported by Elias Benali.
343 2009-06-17 Eric Blake <ebb9@byu.net>
345 Stress test for hash resizing.
346 * tests/builtins.at (define): Enhance test.
348 2009-06-15 Eric Blake <ebb9@byu.net>
350 Document why bootstrap might touch state of tree.
351 * bootstrap: Fix typos. Add comment.
352 * HACKING: Add notes about this scenario.
353 * gnulib: Update to latest version.
354 * .gitignore: Track gnulib changes.
356 Drop .cvsignore and redundant .gitignore files.
357 * .cvsignore: Delete. We are moving further away from CVS.
358 * build-aux/.cvsignore: Likewise.
359 * doc/.cvsignore: Likewise.
360 * examples/.cvsignore: Likewise.
361 * ltdl/.cvsignore: Likewise.
362 * m4/.cvsignore: Likewise.
363 * modules/.cvsignore: Likewise.
364 * po/.cvsignore: Likewise.
365 * src/.cvsignore: Likewise.
366 * tests/.cvsignore: Likewise.
367 * .gitignore: Consolidate from other files.
368 * build-aux/.gitignore: Delete, now that it is consolidated.
369 * doc/.gitignore: Likewise.
370 * examples/.gitignore: Likewise.
371 * ltdl/.gitignore: Likewise.
372 * m4/.gitignore: Likewise.
373 * modules/.gitignore: Likewise.
374 * po/.gitignore: Likewise.
375 * src/.gitignore: Likewise.
376 * tests/.gitignore: Likewise.
377 * bootstrap: Simplify accordingly. Sync gnulib tree prior to
378 libtoolize, to avoid libtool overwriting config.guess.
380 Avoid compiler warning.
381 * m4/macro.c (process_macro): Use correct type for isdigit.
383 2009-06-13 Eric Blake <ebb9@byu.net>
385 Avoid snprintf link failures.
386 * ltdl/m4/gnulib-cache.m4: Import snprintf-posix module.
387 Reported by Ralf Wildenhues.
389 2009-06-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
391 Avoid pointer arithmetic on `void *'.
392 * modules/m4.c (dump_symbol_CB): Cast obstack_base return value
393 to `char *' before using it.
395 2009-05-04 Eric Blake <ebb9@byu.net>
397 Silence verbose testsuite runs.
398 * tests/testsuite.at (m4_version_prereq): Bump to recent
399 autoconf.git version where stdout-nolog was added.
400 * tests/builtins.at (esyscmd, syscmd): Use new stdout-nolog.
401 * tests/freeze.at (AT_TEST_FREEZE): Likewise.
402 * tests/others.at (stderr closed): Likewise.
403 * HACKING: Mention new requirement.
404 * bootstrap: Likewise.
405 Reported by Ralf Wildenhues.
407 2009-04-21 Eric Blake <ebb9@byu.net>
409 Be more explicit about default quoting characters.
410 * doc/m4.texinfo (Quoted strings): Call out characters by name.
412 Suggested by Mehul Sanghvi.
414 2009-04-16 Eric Blake <ebb9@byu.net>
416 Use gnulib rename module.
417 * ltdl/m4/gnulib-cache.m4: Import rename module. At the moment,
418 we don't tickle either of the platform bugs that it fixes, but it
419 is better to be safe than sorry.
421 Require newer automake features.
422 * configure.ac (AM_INIT_AUTOMAKE): Add dist-xz, color-tests,
423 parallel-tests, and silent-rules. Drop dist-lzma.
424 * HACKING: Update minimum requirements.
425 * gnulib: Update to latest version.
427 Mention release of 1.4.13.
428 * NEWS: Update to match release on branch-1.4.
429 * doc/m4.texinfo (History): Update release history.
430 (copying): Finish conversion to GFDL 1.3, started 2008-11-04.
432 2009-03-23 Eric Blake <ebb9@byu.net>
434 Exploit git submodule by adding appropriate symlinks.
435 * bootstrap: No longer copy files from gnulib.
436 * COPYING: Change to symlink pointing into gnulib.
438 * build-aux/compile: Likewise.
439 * build-aux/config.guess: Likewise.
440 * build-aux/config.sub: Likewise.
441 * build-aux/depcomp: Likewise.
442 * build-aux/install-sh: Likewise.
443 * build-aux/mdate-sh: Likewise.
444 * build-aux/missing: Likewise.
445 * build-aux/texinfo.tex: Likewise.
446 * .cvsignore: Reflect these changes.
447 * .gitignore: Likewise.
448 * build-aux/.cvsignore: New file.
449 * build-aux/.gitignore: Likewise.
451 Make gnulib a git submodule.
452 * .gitmodules: New file.
453 * gnulib: Record which version of gnulib has been tested.
454 * bootstrap: Aid in submodule usage.
455 * cfg.mk (gnulib_dir): Alter default location of gnulib.
456 * HACKING: Mention how to use submodule.
458 2009-03-21 Eric Blake <ebb9@byu.net>
460 Use memcmp2 to simplify lexicographic comparisons.
461 * ltdl/m4/gnulib-cache.m4: Import memcmp2.
462 * modules/m4.c (dumpdef_cmp_CB): Use it.
464 2009-03-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
466 Fix m4.1 build race, exposed by parallelism through GNUmakefile.
467 * Makefile.am (SUBDIRS): Add doc.
468 (Documentation rules): Move ...
469 * doc/Makefile.am: ... to this new file.
470 * configure.ac (AC_CONFIG_FILES): Generate doc/Makefile.
472 2009-03-13 Eric Blake <ebb9@byu.net>
474 Try to tolerate spaces in directory names in testsuite.
475 * tests/null.m4: Provide shell quoting, in case __program__
478 Fix awk script portability.
479 * checks/get-them: In gsub, properly escape {.
480 Reported by Gary V. Vaughan.
482 Make bootstrap easier on Solaris.
483 * bootstrap: Add GNULIB_SRCDIR. Useful when a wrapper script
484 gnulib-tool exists earlier on the path to work around /bin/sh
485 failure in parsing $GNULIB_SRCDIR/gnulib-tool.
487 2009-03-13 Eric Blake <ebb9@byu.net>
489 Allow configuration choice in syscmd shell.
490 * ltdl/m4/m4-syscmd.m4: New file.
491 * configure.ac (M4_SYSCMD): Use it to provide
493 (AC_CHECK_HEADERS_ONCE): No longer need to worry about
495 * modules/m4.c (syscmd): Use it to avoid hard-coding the shell
497 * modules/gnu.c (esyscmd): Likewise.
498 * doc/m4.texinfo (Syscmd, Esyscmd): Document this.
499 * README: Document new configure option.
502 Use gnulib pipe module instead of popen(3).
503 * ltdl/m4/gnulib-cache.m4: Import pipe and wait-process modules.
504 * modules/gnu.c (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS):
506 (esyscmd): Rewrite with pipe module.
507 Resolves a failure on AIX, reported by Gary V. Vaughan.
509 Use gnulib execute module instead of system(3).
510 * ltdl/m4/gnulib-cache.m4: Import execute module.
511 * m4/utility.c (m4_info_name): New function.
512 * m4/m4module.h (m4_info_name): New prototype.
513 * modules/m4.c (syscmd): Rewrite with execute module.
514 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS, m4_sysval): Move
516 * modules/gnu.c (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS)
518 Resolves a failure on AIX, reported by Gary V. Vaughan.
520 2009-03-05 Eric Blake <ebb9@byu.net>
522 Improve web-manual maintainer rule.
523 * maint.mk (web-manual): Factor package-specific detail...
524 * cfg.mk (manual_title): ...to new variable.
526 2009-02-23 Eric Blake <ebb9@byu.net>
528 Speed up translit when from argument is short.
529 * modules/m4.c (translit): Use memchr2 when possible.
530 * tests/builtins.at (translit): Add tests.
531 * NEWS: Document this.
533 2009-02-18 Eric Blake <ebb9@byu.net>
535 Prefer buffer over byte operations.
536 * modules/format.c (format): Use memchr for speed.
537 * modules/gnu.c (substitute): Likewise.
538 * m4/macro.c (locate_dollar): Inline into only caller...
539 (process_macro): ...and rearrange for readability.
540 * m4/input.c (consume_buffer): Allow C++ compilation.
541 * doc/m4.texinfo (Changesyntax): Enhance test.
543 Speed up esyscmd with buffer reads.
544 * modules/gnu.c (esyscmd): Read blocks directly into obstack,
545 rather than repeatedly reading bytes. Detect read errors.
547 Avoid risk of stack overflow.
548 * m4/output.c (insert_file): Avoid stack allocation of large
551 Synchronize THANKS with branch.
552 * THANKS: Import more names.
554 Improve handling of $ in syntax table.
555 * m4/m4module.h (m4_is_syntax_single_dollar): New function.
556 (M4_SYNTAX_DOLLAR, M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): Change to
557 be context rather than basic syntax categories.
558 (M4_SYNTAX_MASKS): Adjust macro.
559 * m4/m4private.h (struct m4_syntax_table): Add dollar and
560 is_single_dollar members.
561 (m4_is_syntax_single_dollar): Add fast alternative.
562 * m4/syntax.c (m4_syntax_create, reset_syntax_set): Adjust to
563 account for change to context categories.
564 (m4_set_syntax): Manage is_single_dollar.
565 (m4_is_syntax_single_dollar): New function.
566 * m4/macro.c (locate_dollar): New helper function.
567 (process_macro): Use it to speed up macro expansion.
568 * m4/input.c (m4__next_token): Adjust client.
569 * doc/m4.texinfo (Changesyntax): Document this.
571 2009-02-17 Eric Blake <ebb9@byu.net>
573 Sync changecom documentation with branch.
574 * doc/m4.texinfo (Changecom): Tweak wording.
575 * NEWS: Import changes from the branch.
577 Stage 29b: Process quotes and comments by buffer, not bytes.
578 Search for quote and comment delimiters by buffer when possible.
580 Speed impact: noticeable improvement, from fewer function calls.
581 * ltdl/m4/gnulib-cache.m4: Import memchr2 module.
582 * m4/input.c (m4__next_token): Add buffer reads to quote and
584 * NEWS: Document this.
586 2009-02-16 Eric Blake <ebb9@byu.net>
588 Stage 29a: Process dnl and macro names by buffer, not bytes.
589 Enhance input engine to provide lookahead buffer, rather than
590 forcing clients to call next_char for every byte. Utilize this
591 for the simplest clients.
593 Speed impact: noticeable improvement, from fewer function calls.
594 * ltdl/m4/gnulib-cache.m4: Import freadptr and freadseek modules.
595 * m4/input.c (struct input_funcs): Add virtual functions
596 buffer_func and consume_func.
597 (file_buffer, file_consume, string_buffer, string_consume)
598 (composite_buffer, composite_consume, eof_buffer): Implement
600 (file_funcs, string_funcs, composite_funcs, eof_funcs): Update
602 (buffer_retry): New sentinel.
603 (next_buffer, consume_buffer): New functions.
604 (m4_skip_line, match_input, consume_syntax): Use them for faster
606 Suggested by Bruno Haible.
608 Unify single and multi-character delimiter handling.
609 * m4/input.c (MATCH): Add a parameter.
610 (m4__next_token): Simplify logic and reduce redundancy.
611 (m4__next_token_is_open): Adjust caller.
612 * m4/syntax.c (m4_set_comment, m4_set_quotes): Handle delimiters
613 of differing lengths.
614 (m4_set_syntax): Recognize restoration of single delimiters.
616 Revamp changesyntax vs. changequote interactions.
617 * m4/m4module.h (M4_SYNTAX_VALUE): Delete unused macro.
618 (M4_SYNTAX_SUSPECT): New macro.
619 * m4/m4private.h (struct m4_syntax_table): Add suspect field.
620 * m4/syntax.c (check_is_single_quotes, check_is_single_comments)
621 (check_is_macro_escaped): Delete, by inlining body...
622 (m4_set_syntax): ...into here. Improves handling between
623 changesyntax and changequote/changecom.
624 (add_syntax_set, subtract_syntax_set, set_syntax_set): Simplify,
625 and let suspect field track needed cleanup.
626 (m4_set_quotes, m4_set_comment): Adjust meaning of
627 is_single_quotes and is_single_comment flags to always be true if
628 only one delimiter exists, regardless of its length. Ensure that
629 the syntax categories M4_SYNTAX_LQUOTE and M4_SYNTAX_BCOMM are
630 only used on 1-byte delimiters.
631 (add_syntax_attribute, remove_syntax_attribute): Change signature
632 to allow the use of fewer casts. Adjust the suspect field when
634 (m4_reset_syntax, set_quote_age): Adjust callers.
635 * m4/input.c (m4__next_token, m4__next_token_is_open): Simplify
637 * doc/m4.texinfo (Changesyntax): Update documentation and tests.
639 Improve changesyntax documentation.
640 * doc/m4.texinfo (Changesyntax): Merge two tables into one
643 Fix regression in multicharacter quotes, from 2008-01-26.
644 * m4/input.c (m4__next_token): Fix typo.
645 * tests/builtins.at (changequote): Enhance test.
647 2009-02-13 Eric Blake <ebb9@byu.net>
649 Speed up parsing when detecting input file change.
650 * m4/input.c (next_char): Clear input_change flag. Bug introduced
653 2009-02-12 Eric Blake <ebb9@byu.net>
655 Avoid quadratic code when walking definition stack.
656 * examples/stack_sep.m4: Use linear, not quadratic
658 * doc/m4.texinfo (Improved copy): Fix documentation, based on
659 recent autoconf bug fix.
660 * tests/others.at (recursion): Enhance test.
662 2009-02-11 Eric Blake <ebb9@byu.net>
664 Stage 28c: Warn on embedded NUL in remaining cases.
665 Ensure all remaining warnings can handle embedded NUL.
667 Speed impact: none noticed.
668 * m4/m4module.h (m4_debug_decode, m4_parse_truth_arg): Add
670 * m4/macro.c (m4_macro_call): Improve diagnostic.
671 * modules/m4.c (defn): Likewise.
672 * m4/debug.c (m4_debug_decode): Handle embedded NUL.
673 * m4/utility.c (m4_parse_truth_arg): Likewise.
674 * modules/format.c (arg_int, arg_long, arg_double): Likewise.
675 (arg_string): New function.
676 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Update callers.
677 * src/main.c (main): Likewise.
678 * src/freeze.c (reload_frozen_state): Likewise.
679 * modules/gnu.c (debugmode, syncoutput): Likewise.
680 * tests/options.at (--regexp-syntax): Adjust test.
681 * tests/freeze.at (reloading nul): Likewise.
682 * tests/null.m4: Likewise.
683 * tests/null.out: Likewise.
684 * tests/null.err: Likewise.
686 Stage 28b: Warn on embedded NUL in file arguments.
687 Quote warning messages related to file and other NUL-terminated
690 Speed impact: none noticed.
691 * m4/path.c (m4_path_search): Quote file names in message.
692 * modules/m4.c (syscmd, include, m4_make_temp): Handle embedded
694 * modules/gnu.c (debugfile, esyscmd): Likewise.
695 * tests/others.at (nul character): Adjust test.
696 * tests/builtins.at (mkdtemp, mkstemp): Likewise.
697 * tests/null.m4: Likewise.
698 * tests/null.out: Likewise.
699 * tests/null.err: Likewise.
701 Stage 28a: Warn on embedded NUL in numeric arguments.
702 Quote warning messages related to numeric parsing in order to
705 Speed impact: none noticed.
706 * m4/m4module.h (m4_numeric_arg): Adjust prototype.
707 * m4/utility.c (m4_numeric_arg): Add parameter.
708 * modules/gnu.c (debuglen): Adjust callers.
709 * modules/m4.c (incr, decr, divert, undivert, m4exit, substr)
711 * modules/evalparse.c (m4_evaluate): Likewise.
712 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
713 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
715 * doc/m4.texinfo (Changesyntax): Fix typo.
716 * tests/others.at (nul character): Adjust test.
717 * tests/null.m4: Likewise.
718 * tests/null.out: Likewise.
719 * tests/null.err: Likewise.
721 2009-02-11 Eric Blake <ebb9@byu.net>
723 Avoid regression in popdef(undef).
724 * doc/m4.texinfo (Trace): Enhance test, to cover regression
725 recently fixed on the branch.
727 2009-02-09 Eric Blake <ebb9@byu.net>
729 Enhance index to support starting offset.
730 * modules/m4.c (index): Add optional third argument.
731 * NEWS: Document this.
732 * doc/m4.texinfo (Index macro): Likewise.
733 (Macro Arguments): Adjust tests.
735 2009-01-24 Eric Blake <ebb9@byu.net>
737 Add URLs to --help output.
738 * src/main.c (usage): Use enhanced version-etc features.
740 2009-01-07 Eric Blake <ebb9@byu.net>
742 Enhance substr to support replacement text.
743 * doc/m4.texinfo (Substr): Document new semantics.
744 * modules/m4.c (substr): Support optional fourth argument.
745 * NEWS: Document this.
747 Enhance substr to support negative values.
748 * doc/m4.texinfo (Substr): Document new semantics, and how to
750 * modules/m4.c (substr): Support negative values.
751 * NEWS: Document this.
753 2009-01-05 Eric Blake <ebb9@byu.net>
756 * HACKING: Remove mention of xdelta.
757 * Makefile.am (EXTRA_DIST, MAINTAINERCLEANFILES): Let gnulib take
758 care of distributing gendocs.sh.
759 * maint.mk (web-manual): Use new feature of gendocs.
760 * ltdl/m4/gnulib-cache.m4: Regenerate.
762 2008-12-24 Eric Blake <ebb9@byu.net>
764 Relax eval as allowed by POSIX 2008.
765 * modules/evalparse.c (m4_evaluate): Warn, not error, on invalid
766 operator. Quote expression in warning.
767 * modules/mpeval.c (includes): Add quotearg.h.
768 * doc/m4.texinfo (Eval, Improved forloop): Update tests.
769 * NEWS: Update to reflect 1.6 support for `?:'.
771 2008-12-23 Eric Blake <ebb9@byu.net>
773 Add debugmode(o) to control dumpdef output location.
774 * m4/m4module.h (M4_DEBUG_TRACE_OUTPUT_DUMPDEF): New enumerator.
775 (M4_DEBUG_TRACE_VERBOSE): Update.
776 * m4/debug.c (m4_debug_decode): Support new debug option.
777 * src/freeze.c (produce_debugmode_state): Likewise.
778 * modules/m4.c (dumpdef): When set, force dumpdef to stderr rather
780 * src/main.c (usage): Document it.
781 * doc/m4.texinfo (Debugmode, Dumpdef, Debugging options)
782 (Debugfile): Likewise.
784 Based on an autoconf bug report by Paolo Bonzini.
786 Make --debugfile argument optional.
787 * src/main.c (long_options): Make the argument optional, to allow
788 setting debug file back to stderr.
789 (main): Make --debugfile order-dependent.
790 (usage): Document this.
791 * doc/m4.texinfo (Debugging options): Likewise.
793 * tests/options.at (--debugfile): Enhance test.
794 (--safer): Adjust to new semantics.
796 2008-12-22 Eric Blake <ebb9@byu.net>
799 * doc/m4.texinfo (Operation modes, Preprocessor features)
800 (Limits control, Frozen state, Debugging options)
801 (Dynamic loading features): Use lower case names in @var.
802 (Improved copy): Use @code, not @var, as appropriate.
804 2008-12-18 Eric Blake <ebb9@byu.net>
806 Deal with M4 1.4.x limitation on builtin tokens.
807 * doc/m4.texinfo (Composition): Mention limitation on curry.
808 (Improved copy): New node.
810 * examples/stack.m4: Likewise.
811 * examples/stack_sep.m4: New file.
812 * Makefile.am (dist_pkgdata_DATA): Distribute it.
814 2008-12-15 Eric Blake <ebb9@byu.net>
816 Double size of temp file cache.
817 * m4/output.c (tmp_file, tmp_file_owner): Split...
818 (tmp_file1, tmp_file2, tmp_file1_owner, tmp_file2_owner): ...into
820 (tmp_file2_recent): New variable.
821 (m4_tmpopen, m4_tmpclose, m4_tmpremove, m4_tmprename)
822 (m4_output_exit): Adjust callers.
824 Use fewer seeks on cached files.
825 * m4/output.c (m4_tmpfile): Use write, not append mode.
826 (m4_tmpopen): Add parameter to decide when to skip seeks.
827 (m4_tmprename, m4_make_diversion, insert_diversion_helper)
828 (m4_freeze_diversions): Adjust callers.
830 Cache most recently spilled diversion.
831 * m4/output.c (tmp_file, tmp_file_owner): New variables, for
832 1-deep cache of spilled diversions.
833 (m4_tmpfile): Open in append mode, since we might revisit
834 diversion without closing it now.
835 (m4_tmpopen): Check cache first.
836 (m4_tmpclose): Update cache, rather than closing. Add parameter.
837 (m4_tmpremove): Close cache before removing.
838 (m4_tmprename): Deal with open files when renaming.
839 (m4_output_exit): Close cache before exiting.
840 (make_room_for, m4_make_diversion, insert_diversion_helper):
842 * ltdl/m4/m4-rename.m4 (M4_RENAME): New file.
843 * configure.ac (M4_RENAME): Invoke it.
845 Correctly track size of in-memory diversions.
846 * m4/output.c (insert_diversion_helper): Correctly track total
847 in-memory diversion size after undivert.
849 Avoid quadratic behavior for some cases of divert/undivert.
850 * m4/output.c (struct m4_diversion): Improve comments.
851 (m4_tmpname, m4_make_diversion): Strengthen preconditions.
852 (m4_tmprename): New function.
853 (m4_output_init, m4_output_exit): Move after internal functions.
854 (make_room_for): Don't bother copying uninitialized bytes.
855 (insert_diversion_helper): Transfer metadata, rather than copying
856 contents, when undiverting into a previously unused diversion.
857 * tests/builtins.at (divert): Add a check to the test.
858 * doc/m4.texinfo (Undivert): Enhance test.
859 * NEWS: Document the speedup.
861 2008-12-02 Eric Blake <ebb9@byu.net>
863 Stage 27: Allow embedded NUL in text processing macros.
864 Pass NUL through regular expressions, format, and translit, and
865 diagnose it in eval and changeresyntax. Improve warning
866 capabilities of format.
868 Speed impact: none noticed.
869 * modules/m4.c (m4_expand_ranges): Don't append extra bytes.
870 (translit): Manage NUL bytes.
871 * modules/format.c (format): Likewise.
872 * modules/gnu.c (substitute, regexp_substitute): Likewise.
873 (m4_resyntax_encode_safe): Add parameter.
874 (regexp, patsubst, renamesyms): Update callers.
875 (regexp_compile): Adjust error message.
876 * modules/evalparse.c (m4_evaluate): Use consistent message.
877 (end_text): New variable.
878 (eval_init_lex): Add parameter.
879 (eval_lex): Detect embedded NUL.
880 * src/freeze.c (reload_frozen_state): Likewise.
881 * doc/m4.texinfo (Format): Update to cover new behavior.
882 (Eval): Mention that result is unquoted.
883 * tests/freeze.at (reloading nul): Enhance test.
884 * tests/null.m4: Likewise.
885 * tests/null.err: Update expected output.
886 * tests/null.out: Likewise.
887 * tests/options.at (--regexp-syntax): Likewise.
889 2008-11-28 Eric Blake <ebb9@byu.net>
891 Resync NEWS with branches.
892 * NEWS: Mention 1.4.12, update state of 1.6.
894 2008-11-26 Eric Blake <ebb9@byu.net>
896 Keep COPYING in repository.
897 * Makefile.am (MAINTAINERCLEANFILES): Don't remove COPYING.
898 * .cvsignore: Don't ignore it.
899 * .gitignore: Likewise.
900 * COPYING: Store in repository, per automake 1.10.2
903 2008-11-26 Eric Blake <ebb9@byu.net>
905 Document optimized forloop.
906 * doc/m4.texinfo (Improved forloop): Mention alternate style that
907 avoids define overhead.
908 * examples/forloop3.m4: New file.
909 * Makefile.am (dist_pkgdata_DATA): Distribute it.
911 Document copy composite using stack_foreach and curry.
912 * doc/m4.texinfo (Stacks): New node, to document pushdef stack
914 (Ifelse): Move define_blind...
915 (Composition): ...to this new node. Document currying, then use
916 it to implement copy and rename.
917 * examples/curry.m4: New file.
918 * examples/stack.m4: Likewise.
919 * Makefile.am (dist_pkgdata_DATA): Distribute them.
921 2008-11-04 Eric Blake <ebb9@byu.net>
924 * ltdl/m4/gnulib-cache.m4: Replace fdl module with fdl-1.3.
925 * Makefile.am (doc_m4_TEXINFOS, MAINTAINERCLEANFILES): Reflect
927 * doc/m4.texinfo (GNU Free Documentation License): Likewise.
929 2008-10-22 Eric Blake <ebb9@byu.net>
931 Give nicer error if user modifies testsuite but lacks autoconf.
932 * Makefile.am (AUTOM4TE): Use missing in the definition.
934 2008-10-09 Eric Blake <ebb9@byu.net>
936 Allow user to choose which sed to use in testsuite.
937 * tests/atlocal.in (SED): Inherit from configure results.
938 * tests/builtins.at (__m4_@&t@version__, divert, esyscmd)
939 (mkstemp, syscmd): Use $SED.
940 * tests/generate.awk (new_test): Likewise.
941 * tests/options.at (deprecated options, unknown option)
942 (--debugmode, --help and --version): Likewise.
943 * tests/testsuite.at (AT_CHECK_M4): Likewise.
944 * tests/others.at (directory, stderr closed, stdin seekable)
945 (stdout closed): Likewise.
946 (nul character): Likewise. Also, skip test if sed can't handle
949 Clean up testsuite invocation.
950 * tests/atlocal.in: Fix copyright notice.
951 * Makefile.am (TESTS_ENVIRONMENT): Delete; it wasn't being used.
952 (check-local, installcheck-local): Adjust clients. Add missing
955 2008-09-25 Eric Blake <ebb9@byu.net>
957 Tweak error message on command line failure.
958 * m4/m4private.h (includes): Use "quotearg.h".
959 * src/main.c (process_file, main): Use nicer quotes for file name
961 * m4/input.c (file_clean, m4_push_file): Likewise.
962 * m4/module.c (m4__module_open): Likewise.
963 * src/freeze.c (produce_frozen_state, reload_frozen_state):
965 * modules/gnu.c (debugfile): Likewise.
966 * modules/m4.c (undivert, include): Likewise.
967 * tests/others.at (directory, stdin closed): Update tests.
968 * tests/options.at (file names, --debugmode): Likewise.
969 * doc/m4.texinfo (Debugmode): Likewise.
971 Unify error handling for reading directories.
972 * m4/path.c (m4_path_search): Factor open attempts...
973 (m4_fopen): ...into new function, to reject directories.
974 * tests/others.at (directory): Enhance test.
975 * doc/m4.texinfo (Include): Document that directories cannot be
978 Avoid bugs on platforms that mishandle trailing /.
979 * ltdl/m4/gnulib-cache.m4: Import fopen module.
980 * tests/others.at (directory): New test.
982 2008-09-16 Eric Blake <ebb9@byu.net>
984 Fix bootstrap for Solaris /bin/sh.
985 * bootstrap: Avoid shell quoting pitfall.
987 2008-09-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
989 Typos in source code comments.
990 * modules/m4.c: Fix typos in comments.
991 * m4/input.c: Likewise.
992 * src/main.c: Likewise.
994 2008-08-29 Eric Blake <ebb9@byu.net>
996 Fix manual date information.
997 * doc/m4.texinfo: UPDATED refers to the day the manual was built,
998 not the release date of M4.
999 Based on a bison patch by Akim Demaille.
1001 2008-08-27 Eric Blake <ebb9@byu.net>
1004 * doc/m4.texinfo (Invoking m4): Fix example, since order of -d
1006 (Dumpdef): Fix typo.
1008 2008-08-23 Eric Blake <ebb9@byu.net>
1010 Allow debugmode control over whether defn(undef) warns.
1011 * ltdl/m4/gnulib-cache.m4: Import verify module.
1012 * m4/m4module.h (M4_DEBUG_TRACE_DEREF, M4_DEBUG_TRACE_INITIAL):
1014 (M4_DEBUG_TRACE_VERBOSE, M4_DEBUG_TRACE_DEFAULT): Adjust.
1015 * m4/m4.c (m4_create): Start with debugmode = d.
1016 * src/main.c (usage): Mention this.
1017 (main): Let -E impact debug mode.
1018 * m4/utility.c (m4_symbol_value_lookup): Squelch undefined warning
1020 * modules/gnu.c (builtin, inder): Likewise.
1021 * m4/debug.c (m4_debug_decode): Parse new mode.
1022 * src/freeze.c (produce_debugmode_state): Accomodate new mode.
1023 * doc/m4.texinfo (Debugging options): Mention change in the
1025 (Debugmode): Mention new flag d.
1026 (Operation modes): Mention interaction with -E.
1027 (Undefine, Defn, Pushdef, Indir, Builtin, Dumpdef): Document and
1029 * tests/options.at (--debugmode): Update tests.
1030 * tests/freeze.at (reloading debugmode): Likewise.
1031 * NEWS: Document this.
1032 Reported by Ralf Wildenhues; without this patch, M4 1.6+ would be
1033 incompatible with Autoconf 2.62.
1035 2008-08-22 Eric Blake <ebb9@byu.net>
1037 Improve --debugmode behavior.
1038 * m4/m4module.h (m4_debug_decode): Simplify interface.
1039 * m4/debug.c (m4_debug_decode): Remove parameter, and handle
1040 setting the new value.
1041 * modules/gnu.c (debugmode): Adjust caller.
1042 * src/freeze.c (reload_frozen_state): Likewise.
1043 * src/main.c (main): Likewise.
1044 (usage): Fix default for --debug.
1045 * doc/m4.texinfo (Debugging options): Add an example.
1047 2008-08-21 Eric Blake <ebb9@byu.net>
1049 Avoid regression in defn(undef).
1050 * doc/m4.texinfo (Trace): Enhance test, to cover regression
1051 recently fixed on the branch.
1053 2008-08-18 Eric Blake <ebb9@byu.net>
1055 Remove deprecated -N option; fixes a regression from 2006-09-14.
1056 * src/main.c (DIVERSIONS_OPTION): Delete.
1057 (long_options, OPTSTRING, main): Remove -N/--diversions option.
1058 * doc/m4.texinfo (Limits control): Remove it from the manual.
1059 * NEWS: Mention that it is gone.
1060 * tests/options.at (deprecated options): Update test.
1062 Improve 'git diff' of manual source.
1063 * .gitattributes (*.texi*): Add diff attribute.
1064 * bootstrap: Tell git how to use it.
1065 Inspired by Jim Meyering's similar patch for coreutils.
1067 2008-08-07 Bruno Haible <bruno@clisp.org> (tiny change)
1069 Run m4 tests prior to gnulib unit tests.
1070 * Makefile.am (SUBDIRS): Swap order of directories.
1072 2008-08-03 Eric Blake <ebb9@byu.net>
1074 Stage 26: Allow embedded NUL in macro definitions.
1075 Clean up final few locations that did not track macro definitions
1076 by length, to allow embedded NUL. Make m4_arg_len callers aware
1077 of issue of flattening builtins when determining length.
1078 Memory impact: none.
1079 Speed impact: none noticed.
1080 * m4/m4module.h (m4_arg_len): Add parameter.
1081 (M4ARGLEN): Provide default for the parameter.
1082 * m4/m4private.h (includes): Share xmemdup0.h among all libm4
1084 * m4/macro.c (m4_arg_len): Fail if builtins are not flattened.
1085 * m4/syntax.c (includes): Rely on m4private.h for xmemdup0.
1086 * m4/symtab.c (includes): Likewise.
1087 (m4_symbol_value_copy): Use xmemdup0.
1088 * m4/module.c (install_macro_table): Likewise.
1089 * src/freeze.c (reload_frozen_state): Likewise.
1090 * tests/freeze.at (reloading nul): Enhance test.
1091 * tests/null.m4: Likewise.
1092 * tests/null.err: Update expected output.
1093 * tests/null.out: Likewise.
1095 Fix regression in commenting unbalanced quotes, from 2008-02-16.
1096 * m4/m4private.h (m4__token_type): Add M4_TOKEN_COMMENT.
1097 * m4/input.c (m4__next_token, m4_print_token): Supply new token
1099 * m4/macro.c (expand_token): Penalize comments, as they can
1100 contain unbalanced quotes; latent bug since 2007-12-07, exposed by
1101 passing $@ references built from comments.
1102 (expand_argument): Adjust caller.
1103 * tests/others.at (Comments): Enhance test to catch it.
1104 * NEWS: Mention the fix.
1106 2008-07-30 Eric Blake <ebb9@byu.net>
1108 Fix regression in trace output, introduced 2008-05-08.
1109 * m4/input.c (m4__push_symbol): When cloning chains, break pointer
1110 back to original chain; latent bug from 2008-02-02 that did not
1111 cause misbehavior until trace output read unfinished chain.
1112 * tests/builtins.at (debug): Add test for this.
1114 2008-07-28 Eric Blake <ebb9@byu.net>
1116 Optimize iteration examples.
1117 * examples/forloop2.m4: Avoid excess indir, by passing current
1118 counter value as parameter.
1119 * examples/foreachq3.m4: Avoid unneeded ifelse, by injecting an
1121 * doc/m4.texinfo (Improved forloop, Improved foreach): Update the
1122 documentation to match.
1124 2008-07-26 Eric Blake <ebb9@byu.net>
1126 Give example for O(n) foreach on m4 1.4.x.
1127 * examples/foreachq4.m4: New file.
1128 * Makefile.am (dist_pkgdata_DATA): Distribute it.
1129 * tests/others.at (recursion): Test it.
1130 * doc/m4.texinfo (Improved foreach): Document linear foreach with
1131 m4 1.4.5 and greater.
1133 2008-07-19 Eric Blake <ebb9@byu.net>
1135 Resynchronize docs from branch.
1136 * doc/m4.texinfo (Undefine, Pushdef): Mention warning on undefined
1137 name, particularly since the old documentation didn't match code.
1138 (Standard Modules): Add caveat about using __m4_version__.
1140 2008-07-11 Eric Blake <ebb9@byu.net>
1142 Bump required automake to 1.10a; regression introduced 2008-01-22.
1143 * configure.ac (AM_INIT_AUTOMAKE): Undo requirement downgrade to
1144 1.10.1, since we also rely on pkglibexecdir.
1145 * HACKING: Fix minimum requirement.
1146 * bootstrap: Likewise.
1148 Reported by Joel E. Denny.
1150 Avoid bogus whitespace in @ovar, @dvar.
1151 * doc/m4.texinfo (ovar, dvar): Add @c.
1152 Based on patch by Ralf Wildenhues to Autoconf manual.
1154 2008-06-23 Eric Blake <ebb9@byu.net>
1156 Adjust to new gnulib-tool layout.
1157 * ltdl/m4/gnulib-cache.m4: Reformat.
1159 Fix bootstrap comment.
1160 * bootstrap: DOWNLOAD_PO was previously removed.
1162 2008-06-19 Eric Blake <ebb9@byu.net>
1164 Revert speed regression from 2008-06-16.
1165 * m4/output.c (m4_shipout_int): Avoid obstack_printf in hot path.
1166 * modules/m4.c (numb_obstack): Likewise.
1167 * m4/input.c (MATCH): Use fewer conditionals, and factor
1169 (match_input): ...here for smaller code size.
1170 * m4/syntax.c (m4_reset_syntax, m4_set_quotes, m4_set_comment):
1171 Supply trailing NUL to delimiters, to meet contract of faster
1174 2008-06-18 Eric Blake <ebb9@byu.net>
1177 * m4/m4module.h: Use consistent spacing for pointer parameters.
1178 * m4/m4private.h: Likewise.
1180 Stage 25b: Handle embedded NUL in changesyntax and friends.
1181 Track quote and comment delimiters by length, to allow embedded
1182 NUL. Improve changesyntax to support assigning syntax to NUL.
1183 Memory impact: none.
1184 Speed impact: none noticed.
1185 * m4/m4module.h (m4_set_quotes, m4_set_comment, m4_set_syntax):
1187 (m4_reset_syntax): New prototype.
1188 * m4/syntax.c (add_syntax_set, subtract_syntax_set)
1189 (set_syntax_set, m4_set_quotes, m4_set_comment): Add parameter, to
1190 handle embedded NUL.
1191 (m4_set_syntax): Likewise. Also, split code to reset the table...
1192 (m4_reset_syntax): ...into a new function.
1193 (m4_syntax_create): Adjust callers.
1194 * m4/input.c (match_input, MATCH): Add parameter.
1195 (m4__next_token, m4__next_token_is_open): Adjust callers.
1196 * modules/m4.h (m4_expand_ranges_func): Add parameter.
1197 * modules/m4.c (dumpdef): Handle NUL in dumped quotes.
1198 (changequote, changecom, translit, m4_expand_ranges): Track
1200 * modules/gnu.c (changesyntax): Handle embedded NUL.
1201 * src/freeze.c (reload_frozen_state): Adjust callers.
1202 * tests/freeze.at (reloading nul): Enhance test.
1203 * tests/null.m4: Likewise.
1204 * tests/null.out: Update expected output.
1205 * tests/null.err: Likewise.
1207 2008-06-16 Eric Blake <ebb9@byu.net>
1209 Stage 25a: Use obstack_printf for easier output.
1210 Convert macro tracing and other locations to use obstack_printf
1211 rather than hand-rolled equivalents. Ensure that embedded NUL in
1212 trace output does not truncate the trace string.
1213 Memory impact: none.
1214 Speed impact: noticeable penalty, from obstack_printf overhead.
1215 * ltdl/m4/gnulib-cache.m4: Import obstack-printf-posix module.
1216 * m4/macro.c (trace_format): Delete; use obstack_printf instead.
1217 (trace_header, trace_pre, trace_post): All callers updated.
1218 * m4/output.c (m4_shipout_int, m4_tmpname): Use obstack_printf.
1219 (m4_divert_text): Speed up syncline output.
1220 * modules/m4.c (dumpdef): Handle embedded NUL.
1221 (numb_obstack): Speed up eval output.
1222 (maketemp): Use obstack_printf.
1223 * modules/format.c (format): Likewise.
1225 Add missing const qualifications.
1226 * m4/resyntax.c (m4_resyntax_map): Declare array elements as
1228 * modules/gnu.c (m4_builtin_table, m4_macro_table): Likewise.
1229 * modules/import.c (m4_builtin_table): Likewise.
1230 * modules/load.c (m4_builtin_table, m4_macro_table): Likewise.
1231 * modules/m4.c (m4_builtin_table): Likewise.
1232 * modules/modtest.c (m4_builtin_table, m4_macro_table): Likewise.
1233 * modules/mpeval.c (m4_builtin_table, m4_macro_table): Likewise.
1234 * modules/perl.c (m4_builtin_table, m4_macro_table): Likewise.
1235 * modules/shadow.c (m4_builtin_table, m4_macro_table): Likewise.
1236 * modules/stdlib.c (m4_builtin_table): Likewise.
1237 * modules/time.c (m4_builtin_table): Likewise.
1238 * modules/traditional.c (m4_macro_table): Likewise.
1240 2008-06-10 Eric Blake <ebb9@byu.net>
1242 Avoid corrupted frozen file if NUL appears on block boundary.
1243 * m4/output.c (insert_file): Separate consecutive quotearg blocks
1244 with \<newline>, in case last byte of first block was NUL.
1246 2008-06-03 Eric Blake <ebb9@byu.net>
1248 Fix printf type mismatches.
1249 * m4/m4module.h (m4_bad_argc): Alter parameter type.
1250 * m4/m4private.h (struct m4_call_info): Alter call_id type.
1251 * m4/macro.c (expand_macro, m4__adjust_refcount): Use correct
1253 * m4/utility.c (m4_bad_argc): Likewise.
1255 Borrow bootstrap ideas from gnulib.
1256 * bootstrap (options, DOWNLOAD_PO): Remove --download-po; the
1257 advertized subset of languages didn't work. Use --skip-po
1258 instead, for consistency with gnulib bootstrap.
1259 (func_get_translations): Use rsync, not wget.
1260 (func_update_po): Use a reference directory, to avoid changing
1261 timestamps on unchanged .po files.
1262 * TODO: Update accordingly.
1264 Fix fallout from previous patch.
1265 * doc/m4.texinfo (Builtin): Adjust expected output.
1267 2008-06-02 Eric Blake <ebb9@byu.net>
1269 Stage 24c: Improve display of macro names with embedded NUL.
1270 Quote instances of problematic characters in macro names when
1271 presented to user. Track location via call_info rather than
1272 munging context for every expansion.
1273 Memory impact: none.
1274 Speed impact: slight penalty, due to more bookkeeping.
1275 * m4/m4module.h (m4_push_string_init): Add parameters.
1276 * m4/m4private.h (struct m4_macro_args): Remove argv0 and
1277 argv0_len, now redundant with info.
1278 (m4__push_wrapup_init): Add parameter.
1279 * m4/input.c (m4_push_string_init, m4__push_wrapup_init): Track
1280 location from caller, rather than context.
1281 (composite_peek, composite_read, match_input): Adjust callers.
1282 * m4/utility.c (m4_symbol_value_lookup): Quote macro name.
1283 (m4_verror_at_line): Allow NUL in macro name.
1284 * m4/macro.c (trace_flush, m4_trace_prepare, trace_pre): Allow NUL
1286 (expand_macro): No longer munge context location.
1287 (collect_arguments, m4_arg_text, m4_arg_empty, m4_arg_len)
1288 (m4_make_argv_ref, m4_push_arg, m4_wrap_args): Adjust callers.
1289 * modules/gnu.c (builtin, indir): Likewise.
1290 * tests/null.m4: Enhance test.
1291 * tests/null.err: Adjust expected output.
1292 * tests/null.out: Likewise.
1294 Stage 24b: Allow embedded NUL in macro names.
1295 Use length rather than NUL-termination when tracking macro names.
1296 All APIs dealing with symbol table changed.
1297 Memory impact: none.
1298 Speed impact: slight penalty, due to more bookkeeping.
1299 * m4/m4module.h (m4_symtab_apply_func, m4_symbol_lookup)
1300 (m4_symbol_pushdef, m4_symbol_define, m4_symbol_popdef)
1301 (m4_symbol_rename, m4_symbol_delete): Add length parameter.
1302 (m4_string): New type.
1303 * ltdl/m4/gnulib-cache.m4: Import xmemdup0 module.
1304 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): Account for
1306 * m4/symtab.c (m4_symtab_delete, m4_symtab_apply, symtab_fetch)
1307 (m4__symtab_remove_module_references, symbol_destroy_CB)
1308 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_define)
1309 (m4_symbol_popdef, m4_symbol_rename, m4_set_symbol_name_traced)
1310 (m4_symbol_delete): Likewise.
1311 * modules/m4.h (struct m4_dump_symbol_data): Adjust type to allow
1313 * m4/macro.c (expand_token): Adjust all callers.
1314 * m4/module.c (install_builtin_table, install_macro_table):
1316 * m4/utility.c (m4_symbol_value_lookup): Likewise.
1317 * modules/gnu.c (indir, renamesyms, m4symbols): Likewise.
1318 * modules/m4.c (define, undefine, pushdef, popdef)
1319 (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols, dumpdef)
1320 (traceon, traceoff): Likewise.
1321 * src/main.c (main): Likewise.
1322 * src/freeze.c (dump_symbol_CB, reload_frozen_state): Likewise.
1323 * tests/freeze.at (reloading nul): Augment test.
1324 * tests/null.out: Adjust expected output.
1326 Stage 24a: Use full call context in error reporting.
1327 Replace const char *macro_name with const m4_call_info *call, so
1328 that the next patch can pass the length of macro_name with
1329 embedded NUL. Simplifies handling of global state.
1330 Memory impact: none.
1331 Speed impact: none noticed.
1332 * m4/m4module.h (m4_error, m4_warn): Change parameter type.
1333 (m4_error_at_line, m4_warn_at_line): Delete.
1334 (m4_debug_set_output, m4_skip_line, m4_bad_argc, m4_numeric_arg)
1335 (m4_parse_truth_arg, m4_symbol_value_lookup): Adjust all clients.
1336 * m4/m4private.h (m4__next_token): Likewise.
1337 * m4/utility.c (m4_verror_at_line): Alter parameter, and use
1338 caller's location if caller is provided.
1339 (m4_error, m4_warn): Change parameter type.
1340 (m4_error_at_line, m4_warn_at_line): Delete.
1341 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg)
1342 (m4_symbol_value_lookup): Adjust all callers.
1343 * m4/debug.c (set_debug_file, m4_debug_set_output): Likewise.
1344 * m4/input.c (m4_skip_line, m4__next_token): Likewise.
1345 * m4/macro.c (expand_argument, collect_arguments, m4_macro_call)
1346 (process_macro): Likewise.
1347 * modules/m4.h (m4_make_temp_func): Likewise.
1348 * modules/evalparse.c (m4_evaluate): Likewise.
1349 * modules/format.c (arg_int, arg_long, arg_double, format):
1351 * modules/gnu.c (builtin, changeresyntax, changesyntax, debugfile)
1352 (debuglen, debugmode, esyscmd, indir, mkdtemp, patsubst, regexp)
1353 (renamesyms, syncoutput, regexp_compile, substitute)
1354 (regexp_substitute, m4_resyntax_encode_safe): Likewise.
1355 * modules/m4.c (define, undefine, pushdef, popdef, ifdef, ifelse)
1356 (m4_dump_symbols, defn, syscmd, incr, decr, divert, undivert, dnl)
1357 (include, maketemp, mkstemp, m4exit, traceon, traceoff, substr):
1359 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
1360 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
1362 * tests/options.at (--syncoutput): Add test for invalid
1363 command-line argument. Split xfailed portion...
1364 (--syncoutput and diversions): ...into new test.
1365 (unknown option): New test.
1366 * tests/freeze.at (reloading unknown builtin): Update expected
1369 Adjust to recent gnulib change.
1370 * configure.ac (AB_INIT): Delete, now that gnulib does this.
1372 2008-05-28 Eric Blake <ebb9@byu.net>
1374 Improve frozen debugmode behavior.
1375 * m4/debug.c (m4_debug_decode): Make empty debugmode additive.
1376 * src/main.c (main): Interleave -d with files.
1377 * tests/options.at (--debugmode): Update test.
1378 * tests/freeze.at (reloading debugmode): New test.
1379 * doc/m4.texinfo (Debugging options, Debugmode): Document the
1383 2008-05-27 Eric Blake <ebb9@byu.net>
1385 Fix some testsuite failures on Solaris 8.
1386 * tests/builtins.at (esyscmd, syscmd): Skip tests if system(2) is
1388 * tests/others.at (stderr closed): Likewise. Also support Solaris
1390 (stdin closed): Skip test if closed stdin gets reopened.
1391 (stdout closed): Support Solaris wording for EBADF.
1392 * tests/testsuite.at (AT_CHECK_M4): Likewise.
1394 Fix configure message nesting, broken since 2001-09-20.
1395 * ltdl/m4/gmp.m4 (M4_LIB_GMP): Don't cache result; the test is
1396 not expensive, and AC_MSG_WARN doesn't work in AC_CACHE_CHECK.
1398 Support 'make dist' with BSD make.
1399 * Makefile.am (TESTSUITE_AT, MAINTAINERCLEANFILES): Qualify uses
1400 of the generated file tests/generated.at.
1401 (EXTRA_DIST, $(TESTSUITE)): Likewise for tests/package.m4.
1402 * tests/others.at (stdout closed): Accomodate OpenBSD /bin/sh.
1404 2008-05-24 Eric Blake <ebb9@byu.net>
1406 Test NUL in frozen files.
1407 * tests/testsuite.at (AT_CHECK_M4): Add parameter.
1408 * tests/freeze.at (reloading nul): New test.
1409 (AT_TEST_FREEZE): Inhibit -d when reloading frozen file.
1410 (reloading unknown builtin): Likewise.
1412 2008-05-23 Eric Blake <ebb9@byu.net>
1414 Improve handling of frozen file errors.
1415 * src/freeze.c (produce_frozen_state): Detect write failures.
1416 (reload_frozen_state): Use close_stream.
1417 * tests/freeze.at (freezing failure): New test.
1419 Reported by Jean-Charles Longuet.
1421 2008-05-19 Eric Blake <ebb9@byu.net>
1423 In frozen file, split consecutive strings with newline.
1424 * src/freeze.c (dump_symbol_CB): Add newline to 'T', 'F'.
1425 (produce_frozen_state): Likewise for 'Q', 'C'.
1426 (reload_frozen_state): Parse the new layout.
1427 [GET_DIRECTIVE]: Fix format 1 regression from 2008-05-13.
1428 * tests/freeze.at (loading format 2): Rewrite to new format.
1429 (reloading unknown builtin): Likewise.
1430 (loading format 1): Make sure backslash-newline is not
1432 * doc/m4.texinfo (Frozen file format 2): Document the format.
1433 * NEWS: Document this change.
1435 Fix xgettext options.
1436 * po/Makevars (XGETTEXT_OPTIONS): The " must be passed to
1439 Fix spelling of René Seindal's name in --version output.
1440 * ltdl/m4/gnulib-cache.m4: Import propername module.
1441 * src/main.c (AUTHORS): Rewrite in terms of proper_name.
1442 * po/Makevars (XGETTEXT_OPTIONS): Detect new functions.
1443 * HACKING: Mention new prerequisite of gperf.
1445 2008-05-18 Eric Blake <ebb9@byu.net>
1447 Allow freezing the trace status of macros.
1448 * src/freeze.c (produce_symbol_dump): Let undefined traced macros
1450 (dump_symbol_CB): Also freeze trace state.
1451 * tests/freeze.at (reloading traced macros): New test.
1452 * doc/m4.texinfo (Using frozen files): Update documentation to
1454 (Frozen file format 1): Improve synchronization with branch.
1455 (Frozen file format 2): Reorder directives, and add `d', `t'.
1456 * NEWS: Document this change.
1458 2008-05-15 Eric Blake <ebb9@byu.net>
1460 Fix frozen file regression in pushdef stacks from 2001-09-01.
1461 * src/freeze.c (dump_symbol_CB): Push all values on the stack, not
1462 just the current definition.
1463 (reverse_symbol_value_stack): New helper method.
1464 * tests/freeze.at (AT_TEST_FREEZE): New helper macro.
1465 (reloading pushdef stack): New test.
1466 (reloading unknown builtin): Enhance test.
1468 2008-05-13 Eric Blake <ebb9@byu.net>
1470 Fix frozen file regression in diversions from 2007-01-21.
1471 * m4/output.c (insert_diversion_helper): Add parameter.
1472 (m4_insert_file): Move contents...
1473 (insert_file): ...to this new helper, with added parameter.
1474 (m4_insert_diversion, m4_undivert_all, m4_freeze_diversions):
1476 * src/freeze.c (produce_mem_dump): Simplify.
1477 * tests/freeze.at (large diversion): Test for this.
1479 Improve error message when frozen file is invalid.
1480 * src/freeze.c (decode_char): Add parameter. Allow \<newline>
1482 (reload_frozen_state): Track current line.
1483 * tests/freeze.at (loading format 1, loading format 2): Update to
1486 2008-05-10 Eric Blake <ebb9@byu.net>
1488 Detect integer overflow when loading frozen file.
1489 * src/freeze.c (reload_frozen_state) [GET_NUMBER]: Rewrite to fail
1490 immediately on overflow.
1491 * tests/freeze.at (loading format 2): Test this.
1492 Reported by Jim Meyering.
1494 2008-05-08 Eric Blake <ebb9@byu.net>
1496 Stage 23: allow tracing of indirect macro calls.
1497 Track all trace information as part of the argv struct, rather
1498 than temporarily resetting global state. Teach indir to trace
1499 macros that it invokes.
1500 Memory impact: slight penalty, due to larger argv struct.
1501 Speed impact: none noticed.
1502 * m4/m4module.h (m4_input_block): Remove.
1503 (m4_call_info): New opaque type.
1504 (m4_trace_prepare, m4_arg_info): New prototypes.
1505 (m4_macro_call, m4_push_string_finish, m4_input_print): Change
1507 * m4/m4private.h (struct m4_macro_args): Add info field.
1508 (struct m4_call_info): New structure.
1509 (m4_arg_info): New accessor.
1510 * m4/input.c (m4_input_block): Make typedef local.
1511 (m4_push_string_init): Initialize length.
1512 (m4_push_string_finish, m4_input_print): Change signature, so that
1513 printing can be done before finalization.
1514 (struct input_funcs): Add parameter to print_func.
1515 (file_print, string_print, composite_print): Adjust accordingly.
1516 * m4/macro.c (trace_header, trace_flush, trace_pre, trace_post):
1517 Change signatures for stacked trace messages, and for using call
1519 (trace_prepre): Export and rename...
1520 (m4_trace_prepare): ...to this, for use by indir. Alter signature
1521 to use call context.
1522 (collect_arguments): Alter signature, to manage new field.
1523 (expand_macro): Change call context management. Move tracing...
1524 (m4_macro_call): ...here. Remove redundant parameter.
1525 (m4_arg_argc): New function.
1526 (m4_make_argv_ref): Replace unused skip parameter with new trace
1527 parameter; manage new field.
1528 * modules/gnu.c (builtin, indir): Adjust callers.
1529 * src/main.c (usage): Update debugmode flag summary.
1530 * tests/null.m4: Enhance test.
1531 * tests/null.err: Update expected output.
1532 * tests/macros.at (Tracing Hanoi Towers): Likewise.
1533 * doc/m4.texinfo (Trace): Mention more about trace formatting.
1534 (Debugmode): Enhance description of 'c' and 'x'. Enhance test to
1535 cover line numbering details in traces.
1536 (Debuglen): Enhance test to cover indir tracing.
1537 * NEWS: Mention these changes.
1538 Reported by Akim Demaille in the autoconf TODO file in 2000.
1540 2008-05-07 Eric Blake <ebb9@byu.net>
1542 Test for traceon regression just fixed in branch-1.6.
1543 * doc/m4.texinfo (Trace): Enhance test.
1544 * NEWS: Port news item from branch.
1546 2008-05-05 Eric Blake <ebb9@byu.net>
1548 Stage 22: allow builtin token concatenation outside $@.
1549 Adjust the input and argument parsing engines to append builtins
1550 alongside text. Make define warn when builtins must be
1552 Memory impact: slight penalty, with fewer builtins flattened.
1553 Speed impact: slight penalty, from more bookkeeping.
1554 * m4/m4module.h (m4_is_arg_composite): New prototype.
1555 (m4_symbol_value_copy): Change return type.
1556 (m4_arg_text): Add parameter.
1557 (M4ARG): Adjust callers.
1558 * m4/m4private.h: Adjust comments.
1559 * m4/symtab.c (m4_symbol_value_copy): Detect when builtins are
1561 * m4/input.c (init_builtin_token): Add parameter, and allow
1562 concatenating builtins.
1563 (m4__next_token): Adjust caller.
1564 * m4/macro.c (m4_is_arg_composite): New function.
1565 (expand_argument): Allow builtin concatenation.
1566 (m4_arg_text): Add parameter.
1567 (m4__arg_adjust_refcount, m4__arg_print): Adjust callers.
1568 (m4_arg_equal): Fix comparison of builtin tokens.
1569 * modules/m4.c (define, pushdef): Warn when flattening builtins.
1570 * doc/m4.texinfo (Define): Remove dead comment.
1571 (Defn): Update to reflect code changes.
1572 * tests/builtins.at (defn): Remove xfail.
1573 * NEWS: Document this change.
1575 2008-05-03 Eric Blake <ebb9@byu.net>
1577 Document define_blind.
1578 * doc/m4.texinfo (Ifelse): Add a new composite macro.
1580 Suggested by Mike R.
1582 2008-05-01 Eric Blake <ebb9@byu.net>
1584 Avoid -Wshadow compiler warnings.
1585 * m4/output.c (threshold_diversion_CB): s/div/diversion/.
1586 * m4/macro.c (make_argv_ref, arg_symbol, m4_arg_symbol)
1587 (m4_is_arg_text, m4_is_arg_func, m4_arg_text, m4_arg_empty)
1588 (m4_arg_len, m4_arg_func, m4__arg_print, m4_make_argv_ref)
1589 (m4_push_arg, m4__push_arg_quote): s/index/arg/.
1590 * modules/format.c (format): Likewise.
1591 * modules/m4.c (ifelse): Likewise.
1593 Improve debugmode testing, based on recent branch-1.6 regressions.
1594 * doc/m4.texinfo (Debugmode): Enhance tests.
1595 * tests/generate.awk: Run tests from stdin, not input.m4. Support
1596 stderr munging when using -I examples.
1598 Fix regression in define from 2008-02-22.
1599 * m4/m4module.h (m4_symbol_value_copy): Add parameter.
1600 * m4/symtab.c (m4_symbol_value_copy): Support copying $@
1602 * m4/macro.c (expand_argument): Update callers.
1603 * modules/m4.c (define, pushdef): Likewise.
1604 * tests/builtins.at (define): Enhance test to catch this.
1606 2008-04-21 Eric Blake <ebb9@byu.net>
1608 Simplify previous patch.
1609 * tests/m4.in: Compress assignment.
1610 Suggested by Gary V. Vaughan.
1612 Fix --disable-shared testsuite regression from previous patch.
1613 * tests/m4.in: Export M4MODPATH, so that recursive m4 invocations
1616 Fix spelling of attribution to Christopher Strachey.
1617 * doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
1619 Reported by Fernando Carrijo.
1621 2008-04-17 Eric Blake <ebb9@byu.net>
1623 Fix testsuite bug when SIGPIPE is ignored.
1624 * tests/builtins.at (divert): Consume all of m4's output, to avoid
1625 spurious write failure.
1626 * src/main.c (main): In batch mode, restore default handling of
1628 * doc/m4.texinfo (Operation modes): Document SIGPIPE behavior.
1630 Reported by Bob Proulx, via his autobuilder.
1632 2008-04-15 Eric Blake <ebb9@byu.net>
1634 Fix 'make installcheck' after './configure --prefix-progname'.
1635 * tests/testsuite.at (AT_CHECK_M4): Allow overriding the m4
1637 (HELP_OTHER, PREPARE_TESTS): Document and use $M4.
1638 * tests/builtins.at (patsubst): Avoid space-tab.
1639 (divert, mkdtemp, mkstemp): Adjust tests to use $M4.
1640 * tests/options.at (--debugfile): Likewise.
1641 * tests/others.at (stdin seekable): Likewise.
1642 (fstab): Avoid space-tab.
1643 * Makefile.am (installcheck-local): Accomodate transformed name.
1644 (DISTCHECK_CONFIGURE_FLAGS): Ensure no regressions, by using gm4
1645 during 'make distcheck'.
1646 * cfg.mk: New file, borrowed from branch.
1648 Update prerequisite tools to match recent releases.
1649 * configure.ac (AC_PREREQ): Rely on released autoconf.
1650 (LT_PREREQ): Rely on released libtool.
1651 * tests/testsuite.at (m4_version_prereq): Update dependence.
1652 * bootstrap: Mention prerequisites.
1654 Work around OS/2 limitation of printf(1).
1655 * tests/null.m4: Use m4, not printf, to generate NUL byte.
1656 * tests/null.out: Check for esyscmd failure.
1657 Reported by Elbert Pol.
1659 2008-04-14 Eric Blake <ebb9@byu.net>
1661 Stage 21b: $@ concatenates builtins, m4wrap takes builtins.
1662 Improve arg_print to handle builtin tokens when printing to a
1663 known chain, rather than always flattening builtins. This allows
1664 m4wrap and $@ back-references to handle embedded builtin tokens.
1665 Memory impact: none.
1666 Speed impact: slight penalty, from more bookkeeping.
1667 * m4/m4module.h (m4_push_builtin): Add parameter.
1668 (m4_builtin_print, m4_push_wrapup_init, m4_push_wrapup_finish)
1669 (m4_arg_print, m4_symbol_value_print): Rename and reduce scope...
1670 * m4/m4private.h (m4__builtin_print, m4__push_wrapup_init)
1671 (m4__push_wrapup_finish, m4__arg_print, m4__symbol_value_print):
1672 ...to these, in some cases adding a parameter.
1673 (m4__append_builtin): New prototype.
1674 * m4/builtin.c (m4_builtin_print): Alter signature to print
1675 builtin to a growing symbol chain.
1676 * m4/symtab.c (m4__symbol_value_print): Alter signature.
1677 (m4_symbol_print, dump_symbol_CB): Adjust callers.
1678 * m4/input.c (builtin_peek, builtin_read, builtin_unget)
1679 (builtin_print, builtin_funcs): Delete, handled via composite
1681 (struct m4_input_block): Delete u.builtin member.
1682 (init_builtin_token): Only use composite block.
1683 (m4__append_builtin): New function.
1684 (m4_push_builtin, m4__push_wrapup_init): Alter signature.
1685 (m4__push_symbol): Allow builtin tokens.
1686 (m4__push_wrapup_finish): Rename.
1687 (composite_print, m4_print_token): Adjust callers.
1688 * m4/macro.c (m4_wrap_args, collect_arguments): Allow builtin
1690 (m4__arg_print): Alter signature.
1691 (trace_prepre, trace_pre, m4_arg_text, m4_arg_equal): Adjust
1693 * modules/m4.c (m4wrap): Allow builtin tokens.
1694 (defn, errprint): Adjust callers.
1695 * modules/gnu.c (builtin): Likewise.
1696 * doc/m4.texinfo (M4wrap): New test.
1697 (Debuglen): Adjust expected output.
1699 Stage 21a: Optimize checks for end of input.
1700 Create a new polymorphic input block type, which always fails with
1701 CHAR_EOF, so that remaining input routines no longer have to check
1702 for NULL input block.
1703 Memory impact: none.
1704 Speed impact: noticeable improvement, from fewer conditionals.
1705 * m4/input.c (eof_funcs, input_eof): New objects.
1706 (eof_peek, eof_read, eof_unget): New functions.
1707 (file_clean, m4_push_string_init, pop_input, m4_push_wrapup_init)
1708 (m4_pop_wrapup, next_char, peek_char, unget_input, m4_input_init)
1709 (m4_input_exit): Use placeholder to guarantee non-NULL isp and
1711 (next_char): Rename retry to allow_unget, and change sense for
1712 easier manipulation. All callers changed.
1714 Improve OS/2 detection.
1715 * modules/gnu.c (m4_macro_table): Ensure all possible identifiers
1716 are defined, not just the first. The testsuite ensures that
1717 exactly one gets defined.
1718 * m4/system_.h [__EMX__]: OS/2 is not Unix-compatible, no matter
1719 what other pre-defined macros it has.
1721 Reported by Elbert Pol.
1723 Ensure __m4_version__ is unquoted.
1724 * tests/builtins.at (__m4_@&t@version__): Augment test.
1726 Avoid GNU make failure on tarball.
1727 * Makefile.am (EXTRA_DIST): Distribute cfg.mk and maint.mk.
1729 2008-04-10 Eric Blake <ebb9@byu.net>
1731 Allow back-referenced macro names; fixes 2008-03-13 regression.
1732 * m4/m4module.h (m4_symbol_value_lookup): Change prototype.
1733 * m4/utility.c (m4_symbol_value_lookup): Change signature.
1734 * modules/m4.c (undefine, popdef, ifdef, m4_dump_symbols, defn):
1736 * tests/others.at (ifndef): New test.
1738 Be namespace clean for M4 version; fixes 2008-04-08 regression.
1739 * configure.ac (version): Rename...
1740 (M4_VERSION): ...to this, since using 'version' broke po.m4.
1742 2008-04-09 Eric Blake <ebb9@byu.net>
1744 Mention 1.4.11 release.
1745 * doc/m4.texinfo (History, Defn, Ifdef, Ifelse, M4wrap)
1746 (Extensions, Improved foreach): Distinguish 1.4.11 and 1.6.
1747 (Format): Add test of C99 hex-float parsing.
1748 * NEWS: Mention 1.4.11 release.
1749 * tests/builtins.at (divert): Add additional test.
1751 2008-04-08 Eric Blake <ebb9@byu.net>
1753 Overhaul inter-version releases to work with git.
1754 * configure.ac (version): New variable, which has nicer version
1755 contents when using git 1.5.5+, hardcoded to 1.9a otherwise.
1756 (TIMESTAMP): Delete, since CVS id expansion died with transition
1758 (AM_INIT_AUTOMAKE): Use version to decide gnu vs. gnits.
1759 * build-aux/mkstamp: Delete, no longer used.
1760 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Kill, to speed up
1761 rebuilds when timestamps don't matter.
1762 (MKSTAMP): Delete, no longer used.
1763 (EXTRA_DIST): No longer worry about mkstamp.
1764 (.version): New rule and distributed file.
1765 (doc/m4.1, tests/package.m4): Depend on .version, not
1766 configure.ac, for timestamp.
1767 * ltdl/m4/gnulib-cache.m4: Import git-version-gen module.
1768 * modules/gnu.c (__m4_version__): TIMESTAMP no longer exists.
1769 * src/main.c (main): Likewise.
1771 2008-03-28 Eric Blake <ebb9@byu.net>
1773 Use GNUmakefile module.
1774 * ltdl/m4/gnulib-cache.m4: Import gnumakefile module.
1775 * Makefile.am: Split off maintainer rules...
1776 * maint.mk: ...into this new file.
1778 2008-03-18 Eric Blake <ebb9@byu.net>
1780 Stage 20b: make m4wrap obey POSIX fifo ordering.
1781 Improve input engine to support location changes within symbol
1782 chains, then convert m4wrap to always build symbol chain.
1783 Memory impact: none.
1784 Speed impact: slight penalty, from more m4wrap bookkeeping.
1785 * m4/m4module.h (m4_wrap_args): Add prototype.
1786 * m4/m4private.h (enum m4__symbol_chain_type): Add M4__CHAIN_LOC.
1787 (struct m4__symbol_chain): Add struct u_l.
1788 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Use
1790 (composite_peek, composite_read, composite_clean): Handle location
1792 * m4/macro.c (m4_wrap_args): New function.
1793 * modules/m4.c (m4wrap): Use it.
1794 * doc/m4.texinfo (M4wrap): Sync with branch and POSIX.
1795 (Extensions): Document extension of multiple arguments.
1796 (Location, Improved m4wrap): Adjust example to match FIFO order.
1797 * tests/builtins.at (wrap): Likewise.
1798 * NEWS: Document this change.
1800 2008-03-17 Eric Blake <ebb9@byu.net>
1802 Stage 20a: reduce unget's in input engine.
1803 Now that out-of-range input placeholders like CHAR_BUILTIN are
1804 consumed outside of next_char, next_token should always consume
1805 rather than peek at the first character. Fewer peeks results in
1806 less ungetc overhead.
1807 Memory impact: none.
1808 Speed impact: noticeable improvement, from fewer function calls.
1809 * m4/input.c (struct input_funcs): Alter read_func prototype.
1810 (next_char, file_read, buildin_read, string_read, composite_read):
1811 Add allow_argv parameter.
1812 (init_builtin_token, init_argv_symbol): Require all prior input to
1814 (m4_skip_line, match_input, consume_syntax): Adjust callers.
1815 (m4__next_token): Consume first byte without peek.
1817 Update for fresh bootstrap.
1818 * ltdl/m4/gnulib-cache.m4: Updated copyright from upstream.
1820 2008-03-15 Eric Blake <ebb9@byu.net>
1822 Document join, in order to fix bug in m4wrap example.
1823 * examples/join.m4: New file.
1824 * examples/wraplifo2.m4: Likewise.
1825 * Makefile.am (EXTRA_DIST): Add new files.
1826 * doc/m4.texinfo (Improved m4wrap): New node.
1827 (Defn, Location): Enhance tests.
1828 (Shift): Document the composite macro join.
1829 (Incompatibilities): Move documentation of LIFO vs. FIFO...
1830 (M4wrap): ...here, to match improved example.
1832 2008-03-13 Eric Blake <ebb9@byu.net>
1834 Stage 19c: allow builtin tokens in more macros.
1835 Allow builtin tokens inside symbol chains, although for now, they
1836 are not allowed inside comments or quotes. Enable builtin token
1837 handling in more macros, if only to consistently diagnose invalid
1839 Memory impact: none.
1840 Speed impact: slight impact, due to more bookkeeping.
1841 * m4/m4module.h (m4_symbol_value_lookup, m4_builtin_print): New
1843 * m4/m4private.h (enum m4__symbol_chain_type): Add
1845 (struct m4__symbol_chain): Add builtin member.
1846 * m4/utility.c (m4_symbol_value_lookup): New method.
1847 * m4/builtin.c (m4_builtin_print): New function.
1848 * m4/symtab.c (m4_symbol_value_print): Use it.
1849 * m4/input.c (builtin_print): Likewise.
1850 (m4__push_symbol): Allow pushing builtin tokens.
1851 (composite_peek, composite_read, composite_unget, composite_clean)
1852 (composite_print): Handle builtin tokens.
1853 (init_builtin_token): Allow builtin tokens from composite input.
1854 (m4__next_token): Flatten builtins inside comment or string.
1855 * m4/macro.c (expand_argument): Strengthen assertion.
1856 (collect_arguments, m4_arg_equal, m4_arg_print, m4_push_args):
1857 Handle builtin tokens.
1858 (arg_symbol): Add parameter, and allow NULL level.
1859 (m4_arg_symbol, m4__push_arg_quote): Adjust callers.
1860 (m4_arg_text): Ensure all builtins have been flattened.
1861 * modules/m4.c (defn, dumpdef, popdef, traceoff, traceon)
1862 (undefine, m4_dump_symbols): Warn on invalid macro names.
1863 (ifdef, ifelse, shift): Handle builtin tokens.
1864 * modules/gnu.c (m4symbols): Likewise.
1865 * doc/m4.texinfo (Defn, Ifdef, Ifelse): Document and test the new
1867 (Debuglen): Likewise, and remove xfail.
1868 * NEWS: Mention the change.
1870 Stage 19b: invert sense of bit for handling builtin tokens.
1871 Pass builtin tokens by default, rather than as the exception, so
1872 that the logic can consistently refer to flattening arguments.
1873 Memory impact: none.
1875 * m4/m4module.h (M4BUILTIN_ENTRY): New convenience macro.
1876 (M4_BUILTIN_GROKS_MACRO): Rename...
1877 (M4_BUILTIN_FLATTEN_ARGS): ...and invert sense.
1878 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): Likewise...
1879 (m4_symbol_value_flatten_args, m4_symbol_flatten_args): ...to
1881 * m4/m4private.h (VALUE_MACRO_ARGS_BIT)
1882 (m4_symbol_value_groks_macro): Likewise...
1883 (VALUE_FLATTEN_ARGS_BIT, m4_symbol_value_flatten_args): ...to
1885 * m4/symtab.c (m4_symbol_value_groks_macro): Likewise...
1886 (m4_symbol_value_flatten_args): ...to this.
1887 * m4/macro.c (collect_arguments): Accomodate changed sense.
1888 * m4/module.c (m4__module_open): Require arguments if flattening
1890 * m4/input.c (m4_push_string_finish): For now, flatten all
1891 builtins pushed as back-references.
1892 * modules/gnu.c (m4_builtin_table, builtin): Adjust all clients.
1893 * modules/import.c (m4_builtin_table): Likewise.
1894 * modules/load.c (m4_builtin_table): Likewise.
1895 * modules/modtest.c (m4_builtin_table): Likewise.
1896 * modules/mpeval.c (m4_builtin_table): Likewise.
1897 * modules/perl.c (m4_builtin_table): Likewise.
1898 * modules/shadow.c (m4_builtin_table): Likewise.
1899 * modules/stdlib.c (m4_builtin_table): Likewise.
1900 * modules/time.c (m4_builtin_table): Likewise.
1901 * modules/m4.c (m4_builtin_table): Likewise.
1902 (mkstemp): Undo #undef hack from 2006-10-23, now that macro names
1903 are stringized without preprocessor expansion.
1904 * doc/m4.texinfo (Defn): Update comments to match reality.
1905 (Debuglen): Update test now that user macros pass builtin tokens.
1907 Stage 19a: sort and cache builtins loaded by a module.
1908 Rather than repeatedly using dlsym to browse the builtin table,
1909 copy off the table at module load time. Then, the input engine
1910 merely refers to the copy instead of duplicating information.
1911 Memory impact: slight penalty, due to more memory per module, but
1912 offset by less memory in input engine.
1913 Speed impact: slight improvement, due to faster builtin lookups.
1914 * m4/m4module.h (m4_set_symbol_value_builtin): Delete. Use
1915 m4_builtin_find_by_* instead.
1916 (m4_builtin_find_by_func): Change return type.
1917 * m4/m4private.h (m4__builtin): New struct.
1918 (m4_module): Add sorted list of loaded builtins.
1919 (struct m4_symbol_value): Change type of builtin value.
1920 (m4__set_symbol_value_builtin): New prototype and fast accessor.
1921 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1923 * m4/symtab.c (m4_set_symbol_value_builtin): Rename...
1924 (m4__set_symbol_value_builtin): ...and populate additional fields,
1926 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1928 * m4/module.c (install_builtin_table): Use cached table.
1929 (compare_builtin_CB): New helper function.
1930 (m4__module_open): Populate table.
1931 (module_remove): Free table.
1932 * m4/builtin.c (compare_builtin_name_CB): New helper function.
1933 (m4_builtin_find_by_name): Rewrite to use sorted table.
1934 (m4_builtin_find_by_func): Change return type.
1935 * m4/input.c (struct m4_input_block): Simplify u_b, since most
1936 fields can be determined from builtin.
1937 (builtin_peek, builtin_read, builtin_unget, init_builtin_token)
1938 (m4__next_token): Alter parsing so that only init_builtin_token
1940 (builtin_print, m4_push_builtin): Adjust all users.
1941 * tests/macros.at (Arity, defn, and freeze): Fix typo.
1943 Consistently cast malloc results, for C++ compilation.
1944 * m4/builtin.c (m4_builtin_find_by_name): Add cast.
1945 * m4/hash.c (m4_hash_new, m4_get_hash_iterator_next, node_new)
1946 (m4_hash_resize, maybe_grow): Likewise.
1947 * m4/m4.c (m4_create): Likewise.
1948 * m4/macro.c (expand_macro): Likewise.
1949 * m4/output.c (m4_tmpname): Likewise.
1950 * m4/path.c (search_path_add): Likewise.
1951 * m4/symtab.c (m4_symtab_create, m4_symbol_value_create)
1952 (symtab_fetch): Likewise.
1953 * m4/syntax.c (m4_syntax_create): Likewise.
1954 * modules/gnu.c (regexp_compile): Likewise.
1955 * src/main.c (main): Likewise.
1956 * src/freeze.c (reload_frozen_state): Likewise.
1958 2008-03-06 Eric Blake <ebb9@byu.net>
1960 Fix nested builtin(`shift',$@) regression from 2008-02-23.
1961 * m4/macro.c (make_argv_ref): Don't output expansion text when
1962 making wrapper for builtin or indir.
1963 * tests/builtins.at (builtin): New test.
1964 * NEWS: Document the fix.
1965 Reported by Andreas Schwab.
1967 2008-03-04 Eric Blake <ebb9@byu.net>
1969 The gnulib module free was deprecated.
1970 * ltdl/m4/gnulib-cache.m4: Remove free module.
1972 2008-02-29 Eric Blake <ebb9@byu.net>
1974 Import news from 1.4.10b.
1975 * NEWS: Update from branch.
1977 2008-02-23 Eric Blake <ebb9@byu.net>
1979 Stage 18: try harder to reuse argv in recursion.
1980 When pushing arguments that contain an existing $@ ref, reuse the
1981 ref rather than creating another layer of wrappers.
1982 Memory impact: noticeable improvement, due to better $@ reuse.
1983 Speed impact: noticeable improvement, due to O(n^2) to O(n)
1984 reduction in unboxed recursion.
1985 * m4/macro.c (make_argv_ref): Avoid wrapping $@ when possible.
1986 (m4_push_args): Let make_argv_ref take care of pending data.
1987 * doc/m4.texinfo (Improved foreach): Tweak wording to match new
1988 performance capability.
1989 * tests/others.at (recursion): Add tests to avoid performance
1992 2008-02-22 Eric Blake <ebb9@byu.net>
1995 * NEWS: Document change to __gnu__ on 2008-02-11.
1997 Stage 17: pass argv through quoted strings.
1998 Allow the concatenation of $@ references with other text input
1999 inside quoted contexts, which requires distinguishing between a
2000 wrapper around many arguments vs. a reference serving as part of a
2001 single argument. Also optimize based on whether argv contains
2002 builtin tokens that might need flattening to the empty string.
2003 Memory impact: noticeable improvement, due to O(n^2) to O(n)
2004 reduction from total reuse of $@ references.
2005 Speed impact: noticeable improvement, due to O(n^2) to O(n)
2006 reduction in boxed recursion.
2007 * m4/m4module.h (m4_arg_equal, m4_arg_len): Add parameter.
2008 (M4ARGLEN): Adjust definition.
2009 * m4/m4private.h (struct m4__symbol_chain): Add has_func member.
2010 (struct m4_symbol_value): Add wrapper and has_func members.
2011 (struct m4_macro_args): Add flatten and has_func members.
2012 * m4/input.c (append_quote_token): Return argv refs inside quoted
2014 (init_argv_symbol): Populate new fields.
2015 * m4/macro.c (expand_argument, collect_arguments, make_argv_ref)
2016 (m4_make_argv_ref): Likewise.
2017 (arg_symbol, arg_mark, m4_is_arg_text, m4_is_arg_func): Use new
2019 (m4_arg_equal, m4_arg_len): Handle quoted argv references, and add
2021 * modules/m4.c (ifelse): Adjust caller.
2023 2008-02-22 Gary V. Vaughan <gary@gnu.org>
2025 Fix regression in argument collection, from 2008-01-21.
2026 * m4/input.c (m4__next_token): When DEBUG_INPUT is defined,
2027 undo argument collection optimisation for strings, so that
2028 m4_print_token doesn't abort when it otherwise receives an
2029 unprintable M4_SYMBOL_VOID type token.
2031 2008-02-20 Eric Blake <ebb9@byu.net>
2033 Stage 16: cache quotes and improve m4_arg_print.
2034 Cache rather than always copying quotes when pushing $@ refs; in
2035 particular, reconstruct single-byte quotes on the fly. Allow NUL
2036 through m4wrap. Improve sharing of code that prints arguments.
2037 Memory impact: slight improvement, due to cached quotes.
2038 Speed impact: slight improvement, due to less copying.
2039 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print)
2040 (m4_arg_print): Adjust prototypes.
2041 (m4_dump_args): Delete.
2042 (m4_push_wrapup): Split...
2043 (m4_push_wrapup_init, m4_push_wrapup_finish): ...into these
2045 * m4/m4private.h (struct m4_syntax_table): Add cached_quote
2047 (m4__quote_cache, m4__quote_uncache): New prototypes.
2048 * m4/syntax.c (m4_syntax_create): Initialize the cache.
2049 (m4__quote_cache): New function.
2050 (m4_set_syntax): Update caller.
2051 * m4/symtab.c (m4_symbol_value_print): Add parameter.
2052 (m4_symbol_print, dump_symbol_CB): Adjust all callers.
2053 * m4/utility.c (m4_dump_args): Delete; callers should use
2054 m4_arg_print instead.
2055 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Split
2056 implementation, and allow embedded NUL.
2057 (m4_print_token, pop_input, composite_print, composite_peek):
2058 (composite_read, append_quote_token): Adjust all callers.
2059 * m4/macro.c (trace_prepre, m4_arg_text, make_argv_ref):
2061 (m4_arg_print): Add parameters.
2062 (trace_pre): Rewrite in terms of m4_arg_print.
2063 * modules/m4.c (errprint): Likewise.
2064 (m4wrap): Rewrite to allow embedded NUL.
2065 (dumpdef): Adjust caller.
2066 * doc/m4.texinfo (Debuglen): Enhance debuglen test.
2067 * tests/null.m4: Test for NUL in m4wrap.
2068 * tests/null.out: Update expected output.
2070 Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
2071 * m4/utility.c (m4_verror_at_line): Properly terminate the string.
2072 Reported by Ralf Wildenhues.
2074 * doc/m4.texinfo (Debuglen, Changesyntax): Fix typos.
2076 2008-02-19 Eric Blake <ebb9@byu.net>
2078 Clean up example on filtering defined symbols.
2079 * doc/m4.texinfo (Foreach, Improved foreach): Document another
2080 shortcoming in foreach.m4, and improve filter example by using
2083 * src/main.c (usage): Fix typo.
2085 2008-02-18 Eric Blake <ebb9@byu.net>
2087 Avoid some magic numbers.
2088 * m4/m4private.h (CHAR_EOF, CHAR_BUILTIN, CHAR_QUOTE, CHAR_ARGV)
2089 (CHAR_RETRY): Define in terms of UCHAR_MAX.
2090 * m4/syntax.c (m4_syntax_create, set_syntax_set)
2091 (reset_syntax_set, check_is_single_quotes)
2092 (check_is_single_comments, check_is_macro_escaped)
2093 (m4_set_quotes, m4_set_comment): Likewise.
2094 * modules/gnu.c (regexp_compile): Likewise.
2095 * modules/m4.c (translit): Likewise.
2096 * src/freeze.c (produce_syntax_dump): Likewise.
2097 Reported by Ralf Wildenhues.
2099 2008-02-16 Eric Blake <ebb9@byu.net>
2101 Add regression test for multi-character quote recursion.
2102 * examples/foreach2.m4: Use $0 rather than spelling out name.
2103 * examples/foreachq2.m4: Likewise.
2104 * examples/forloop2.m4: Likewise.
2105 * examples/hanoi.m4: Likewise.
2106 * examples/trace.m4: Likewise.
2107 * doc/m4.texinfo (Improved forloop): Document advantage of $0.
2108 (Improved foreach): Adjust dump from file.
2110 Stage 15: return argv refs back to collect_arguments.
2111 Collect an entire $@ reference at once rather than one argument at
2112 a time, outside of quotes (but inside quotes, $@ is still
2113 flattened for now). The skip_last field allows concatenation of
2114 $@ with other text when collecting arguments.
2115 Memory impact: noticeable improvement, due to better reuse of $@.
2116 Speed impact: noticeable improvement, due to less parsing.
2117 * m4/m4private.h (CHAR_ARGV): New input engine sentinel.
2118 (enum m4__token_type): Add M4_TOKEN_ARGV.
2119 (struct m4__symbol_chain): Add skip_last member to argv link.
2120 (m4__next_token): Add parameter.
2121 * m4/input.c (peek_char, file_peek, builtin_peek, string_peek)
2122 (composite_peek, m4__next_token): Add new parameter.
2123 (composite_read, append_quote_token): Support argv in quotes.
2124 (init_argv_symbol): New function.
2125 (m4__push_symbol, match_input, consume_syntax)
2126 (m4__next_token_is_open, m4_print_token): Adjust callers.
2127 * m4/macro.c (m4_macro_expand_input, m4__arg_adjust_refcount)
2128 (arg_mark, m4_arg_text, make_argv_ref): Likewise.
2129 (expand_argument, collect_arguments): Handle new token.
2130 (arg_symbol): Drill through $@ reference.
2131 * m4/syntax.c (set_quote_age): Detect disabled comments.
2132 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Fix debug code.
2134 2008-02-15 Eric Blake <ebb9@byu.net>
2136 * modules/gnu.c (regexp_compile): Use a fastmap for regex speed.
2138 2008-02-13 Eric Blake <ebb9@byu.net>
2140 Fix texinfo grammar.
2141 * doc/m4.texinfo (Eval, Incompatibilities): Use @. after capital.
2142 (History): Use @: after abbreviations.
2143 (M4exit): Use correct Latin abbreviation.
2144 (Dumpdef, Debugmode, Frozen file format 2): Use correct spacing
2147 2008-02-11 Eric Blake <ebb9@byu.net>
2149 Allow builtin text macros to specify number of arguments.
2150 * m4/m4module.h (struct m4_macro): Add argument limits to builtin
2152 * m4/module.c (install_macro_table): Allow text macros to warn on
2154 * modules/gnu.c (m4_macro_table): Update all clients.
2155 * modules/load.c (m4_macro_table): Likewise.
2156 * modules/mpeval.c (m4_macro_table): Likewise.
2157 * modules/perl.c (m4_macro_table): Likewise.
2158 * modules/shadow.c (m4_macro_table): Likewise.
2159 * modules/traditional.c (m4_macro_table): Likewise.
2160 * modules/modtest.c (m4_macro_table): Likewise. Also add text
2161 macros, for testing this.
2162 * doc/m4.texinfo (Standard Modules): Update text, and enhance
2164 * tests/modules.at (modules: text): New test.
2166 Fix regression in command line -D option, from 2006-08-25.
2167 * m4/m4private.h (m4_symbol_value_create): Delete fast accessor.
2168 * m4/m4module.h: Fix typo.
2169 * m4/symtab.c (m4_symbol_value_create): Prime the maximum number
2171 * tests/macros.at (Command line define): Enhance test.
2172 * tests/others.at (nul character): Enhance test.
2173 * tests/null.m4: Likewise.
2174 * tests/null.out: Likewise.
2176 Use gnulib's git-merge-changelog driver when available.
2177 * .gitattributes: Add merge attributes for ChangeLog.
2178 * bootstrap: Install driver, if not already present.
2180 2008-02-06 Eric Blake <ebb9@byu.net>
2182 Fix security hole introduced 2007-11-23.
2183 * m4/utility.c (m4_verror_at_line): Properly escape macro names.
2184 * src/main.c (main): Manage quoteargs defaults.
2185 * doc/m4.texinfo (Indir): Document and test this.
2187 Using raw strtod is not portable.
2188 * ltdl/m4/gnulib-cache.m4: Import the strtod module.
2190 2008-02-02 Eric Blake <ebb9@byu.net>
2192 Consistently use size_t for number of arguments.
2193 * m4/m4module.h (m4_builtin_func): Alter prototype.
2194 (struct m4_builtin): Adjust type of min_args, max_args.
2195 (M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
2196 (m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
2197 (m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
2198 (m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
2199 (m4_arg_print, m4_push_arg): Adjust all clients.
2200 * m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
2201 (m4_macro_args): Adjust type of various fields.
2202 (m4__push_arg_quote): Adjust all clients.
2203 * m4/input.c (m4_pop_wrapup): Likewise.
2204 * m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
2205 (arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
2206 (m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
2207 (m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
2208 (m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
2209 * m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
2210 * modules/evalparse.c (m4_evaluate): Likewise.
2211 * modules/gnu.c (changesyntax): Likewise.
2212 * modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
2213 (undivert, traceon, traceoff): Likewise.
2214 * modules/m4.h (m4_dump_symbols_func): Likewise.
2215 * modules/perl.c (perleval): Likewise.
2217 Stage 14b: allow pushing argv references.
2218 Push a $@ reference to the input engine in one go, rather than
2219 pushing each element. For now, argument collection still gets one
2220 argument of a $@ at a time; but the penalties of this patch make
2221 it easier to manage $@ efficiently in future patches.
2222 Memory impact: noticeable penalty, due to larger struct and O(n)
2223 to O(n^2) on unboxed recursion.
2224 Speed impact: noticeable penalty, due to more bookkeeping.
2225 * m4/m4private.h (struct m4__symbol_chain): Add comma and quotes
2227 (struct m4_macro_args): Add level field.
2228 (m4__arg_adjust_refcount, m4__push_arg_quote): New prototypes.
2229 * m4/input.c (m4__push_symbol, composite_peek, composite_read)
2230 (composite_unget, composite_clean, composite_print): Support $@
2232 * m4/macro.c (collect_arguments): Populate new field.
2233 (expand_macro): Move argv cleanup...
2234 (m4__arg_adjust_refcount): ...to this new function.
2235 (m4_arg_symbol, m4_make_argv_ref, m4_push_arg): Factor...
2236 (arg_symbol, make_argv_ref, m4__push_arg_quote): ...to these new
2237 helper functions, to add parameters.
2238 (m4_push_args): Adjust caller.
2239 * m4/symtab.c (m4_symbol_value_print): Likewise.
2241 Stage 14a: allow printing argv references.
2242 Refactor symbol-value printing code for better sharing, and to
2243 allow printing a contiguous text representation of a $@ ref.
2244 Memory impact: none.
2246 * m4/m4module.h (m4_arg_print): New prototype.
2247 (m4_symbol_value_print): Alter prototype.
2248 * m4/input.c (struct input_funcs): Add parameter to peek_func.
2249 (file_peek, builtin_peek, string_peek): Ignore new parameter.
2250 (composite_peek): Ignore new parameter, for now.
2251 (composite_clean, pop_input): Rework to minimize indirection, and
2252 to avoid infinite recursion in next patch.
2253 * m4/macro.c (trace_prepre, trace_pre): Adjust callers.
2254 (m4_arg_print): New function.
2255 * m4/symtab.c (m4_symbol_value_print): Update signature.
2256 (m4_symbol_print): Update caller.
2257 * m4/output.c (m4_shipout_string_trunc): Update comments.
2258 * m4/syntax.c (set_quote_age): Require comma as argument separator
2259 when dealing with $@ as a unit.
2260 * tests/builtins.at (ifelse): Augment test.
2261 * doc/m4.texinfo (Changesyntax): Document changesyntax deficiency.
2263 2008-01-31 Eric Blake <ebb9@byu.net>
2265 Kill hack for M4 1.4.4.
2266 * configure.ac (AM_GNU_GETTEXT_INTL_SUBDIR): Delete, now that
2267 we require new enough autoconf which in turn requires M4 1.4.5.
2269 2008-01-31 Gary V. Vaughan <gary@gnu.org>
2270 and Eric Blake <ebb9@byu.net>
2272 Depend on new libtool to use non-recursive build.
2273 * configure.ac (LT_PREREQ): Bump to alpha release version.
2274 (LTDL_INIT): Choose nonrecursive mode. Perform sanity check that
2275 installed libtool has correct symbols.
2276 * Makefile.am (SUBDIRS): Drop ltdl, now that it is built from the
2278 (AM_CPPFLAGS): Drop directories covered by libtool.
2279 (AM_LDFLAGS): Drop -no-undefined, covered by libtool.
2280 (include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
2281 macros, used by libtool.
2282 (lib_LTLIBRARIES): Also used by libtool.
2283 (ltdl/libltdlc.la): Delete, now that libtool does this.
2284 * bootstrap: Mention new requirements.
2285 (LIBTOOLIZE): Provide default program, and run libtoolize prior to
2287 (autoreconf): Also neutralize libtoolize, since it is run early.
2288 * HACKING: Mention updated prerequisites.
2290 2008-01-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2292 Fix build failure if installed libltdl is used.
2293 * Makefile.am (m4_libm4_la_DEPENDENCIES): Use $(LTDLDEPS).
2295 2008-01-28 Eric Blake <ebb9@byu.net>
2297 Depend on newer autoconf, for testsuite -C dir.
2298 * Makefile.am (CD_TESTDIR): Delete, no longer required.
2299 (check-local, installcheck-local, clean-local-tests): Use new -C
2300 option from autotest.
2301 * configure.ac (AC_PREREQ): Bump to 2.61a.347.
2302 * bootstrap: Mention new dependency.
2303 * HACKING: Likewise.
2305 2008-01-27 Eric Blake <ebb9@byu.net>
2307 Stage 13: push composite text tokens.
2308 Support pushing composite tokens, allowing back-references to be
2309 reused through multiple macro expansions. Add hueristic that
2310 avoids creating new reference when pushing existing references.
2311 Memory impact: noticeable improvement due to better reference
2312 reuse, except for O(n) to O(n^2) copying in boxed recursion.
2313 Speed impact: slight penalty, due to more bookkeeping.
2314 * m4/m4private.h (m4__push_symbol): Adjust prototype.
2315 * m4/input.c (m4__push_symbol): Add parameter, and support
2317 (append_quote_token): Add parameter, and support inlining of short
2319 (m4__next_token): Adjust caller.
2320 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
2322 2008-01-26 Eric Blake <ebb9@byu.net>
2324 Stage 12c: add macro for m4_arg_len.
2325 Make a common action easier to type.
2326 Memory impact: none.
2328 * m4/m4module.h (M4ARGLEN): New macro.
2329 * m4/macro.c (process_macro): Adjust all callers.
2330 * m4/utility.c (m4_dump_args): Likewise.
2331 * modules/m4.c (divert, maketemp, mkstemp, m4wrap, len, index)
2333 * modules/gnu.c (builtin, indir, mkdtemp, patsubst, regexp)
2334 (renamesyms): Likewise.
2335 * modules/stdlib.c (setenv): Likewise.
2337 Stage 12b: add m4_string_pair.
2338 Make passing quote delimiters around more efficient.
2339 Memory impact: none.
2340 Speed impact: slight penalty, due to more bookkeeping.
2341 * m4/m4module.h (m4_string_pair): New type.
2342 (m4_get_syntax_quotes, m4_get_syntax_comments): New prototypes.
2343 (m4_symbol_value_print, m4_symbol_print, m4_shipout_string_trunc):
2345 * m4/m4private.h (struct m4_string): Delete.
2346 (struct m4_syntax_table): Combine quote and comment members.
2347 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
2348 (m4_get_syntax_ecomm): Adjust accessors.
2349 (m4_get_syntax_quotes, m4_get_syntax_comments): New fast
2351 * m4/symtab.c (m4_symbol_value_print, m4_symbol_print):
2353 * m4/input.c (string_print, composite_print, m4_input_print):
2354 All callers updated.
2355 * m4/syntax.c (m4_syntax_delete, m4_set_syntax)
2356 (check_is_single_quotes, m4_set_quotes, set_quote_age)
2357 (m4_get_syntax_lquote, m4_get_syntax_rquote)
2358 (m4_get_syntax_quotes, check_is_single_comments, m4_set_comment)
2359 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
2360 (m4_get_syntax_comments): Likewise.
2361 * m4/macro.c (trace_prepre, trace_pre, m4_push_args): Likewise.
2362 * m4/output.c (m4_shipout_string, m4_shipout_string_trunc):
2364 * modules/m4.c (dumpdef, m4_make_temp): Likewise.
2365 * src/freeze.c (produce_frozen_state): Likewise.
2366 * tests/freeze.at (reloading unknown builtin): Update test.
2368 Stage 12a: make m4_symbol_chain a union.
2369 Shrink size of symbol chains by using a union.
2370 Memory impact: slight improvement, due to smaller struct.
2371 Speed impact: slight improvement, due to less bookkeeping.
2372 * m4/m4private.h (enum m4__symbol_chain_type): New enum.
2373 (struct m4_symbol_chain): Rename...
2374 (struct m4__symbol_chain): ...to this, since it is internal.
2375 * m4/symtab.c (m4_symbol_value_copy, m4_symbol_value_print): All
2377 * m4/input.c (struct m4_input_block, m4__push_symbol)
2378 (composite_peek, composite_read, composite_unget)
2379 (composite_clean, composite_print, m4__make_text_link)
2380 (append_quote_token): Likewise.
2381 * m4/macro.c (expand_macro, arg_mark, m4_arg_symbol, m4_arg_text)
2382 (m4_arg_equal, m4_arg_len, m4_make_argv_ref, m4_push_arg)
2383 (m4_push_args): Likewise.
2385 2008-01-23 Eric Blake <ebb9@byu.net>
2387 Adjust to recent libtool interface change.
2388 * configure.ac (LT_PREREQ): Require bleeding-edge libtool.
2389 (LT_WITH_LTDL): Delete, now that it is obsolete.
2390 (LTDL_INIT): Use new libtool macro.
2392 2008-01-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2393 and Eric Blake <ebb9@byu.net>
2395 Rely on newer automake.
2396 * configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1, and add lzma
2398 * bootstrap: Update automake requirement.
2399 (func_version): Fix --version output, broken since 2007-08-06.
2400 * HACKING: Likewise. Add lzma requirement.
2401 * Makefile.am (clean-local-src): Not needed any more with newest
2403 (clean-local): Adjust.
2404 * TODO: Remove completed item.
2406 2008-01-22 Eric Blake <ebb9@byu.net>
2409 * doc/m4.texinfo (Renamesyms): Avoid underfull hbox, and improve
2412 2008-01-21 Eric Blake <ebb9@byu.net>
2414 Stage 11: full circle for single argument references.
2415 Pass quoted strings through to argument collection in a single
2416 action, so that an argument can be reused throughout macro
2417 recursion if it remains unchanged.
2418 Memory impact: noticeable improvement, due to more reuse in
2419 argument collection stacks; O(n^2) to O(n) on boxed recursion.
2420 Speed impact: noticeable improvement, due to less copying.
2421 * m4/m4module.h (m4_arg_text): Add parameter.
2423 * m4/m4private.h (CHAR_QUOTE): New input engine sentinel.
2424 (m4__make_text_link): New prototype.
2425 (struct m4_symbol_chain): Add quote_age member.
2426 (struct m4_symbol_value): Add end member to chained symbol.
2427 (struct m4_macro_args): Add wrapper member.
2428 * m4/symtab.c (m4_symbol_value_print): Print composite tokens.
2429 (m4_symbol_value_copy, m4_symbol_value_delete): Recognize
2431 * m4/input.c (make_text_link): Rename...
2432 (m4__make_text_link): ...to this, and export.
2433 (m4_push_string_finish): Adjust caller.
2434 (make_text_link, m4__push_symbol): Update new field.
2435 (file_read, builtin_read, string_read, composite_read, next_char):
2437 (m4_skip_line, match_input, consume_syntax): Adjust callers.
2438 (append_quote_token): New function.
2439 (m4__next_token): Pass quoted strings onto argument collection.
2440 (m4_print_token) [DEBUG_INPUT]: Update.
2441 * m4/macro.c (expand_argument): Collect composite arguments.
2442 (collect_arguments): Update new field.
2443 (expand_macro): Reduce ref-count of back-references after use.
2444 (arg_mark, m4_arg_symbol, m4_make_argv_ref): Adjust to new member
2446 (m4_is_arg_text): Also recognize composite symbols as text.
2447 (m4_arg_text, m4_arg_len): Merge composite symbols as needed.
2448 (m4_arg_equal): Compare composite symbols.
2449 (m4_push_arg, m4_push_args): Handle composite symbols.
2450 (m4_arg_symbol): Relax assertion.
2451 (process_macro): Use single-argument references.
2452 * m4/output.c (m4_shipout_string_trunc): Update comment.
2453 * tests/macros.at (Rescanning macros): Augment test.
2455 2008-01-16 Eric Blake <ebb9@byu.net>
2457 Stage 10: avoid extra copying of strings and comments.
2458 When collecting tokens that are immune to further expansion, avoid
2459 copying data from one obstack to another by outputting it into the
2460 destination obstack to begin with. Also reduce copying done in
2462 Memory impact: slight improvement, due to better obstack usage.
2463 Speed impact: noticeable improvement, due less data copying.
2464 * ltdl/m4/gnulib-cache.m4: Import intprops and vasnprintf-posix
2466 * m4/m4private.h (m4__token_type): Adjust prototype.
2467 * m4/input.c (m4__next_token): Support new parameter.
2468 * m4/macro.c (m4_macro_expand_input, expand_token)
2469 (expand_argument, collect_arguments): Adjust callers.
2470 * modules/m4.c (ntoa): Tighten buffer size.
2471 * m4/output.c (m4_tmpname): Guarantee no buffer overflow.
2472 * modules/format.c (arg_int, arg_long, arg_double): New helper
2473 functions, to detect overflow or unparsed characters.
2474 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Adjust to check for
2475 missing or excess arguments.
2476 (format): Likewise, and also output directly into obstack if there
2478 * doc/m4.texinfo (History): Update for new year.
2479 (Format): Test for new warnings.
2481 2008-01-15 Eric Blake <ebb9@byu.net>
2483 * TODO: Update with some newer URLs.
2485 Verify linear `index'.
2486 * tests/builtins.at (index): New test.
2487 (translit): Make test take longer, to make quadratic algorithms
2490 2007-12-20 Eric Blake <ebb9@byu.net>
2492 Stage 9: share rather than copy single-arg refs.
2493 Use hooks of previous patch to create back-references to arguments
2494 in the input engine, and inline short text rather than always
2495 creating a FIFO link. Also start testing embedded NUL behavior.
2496 Until the argument collection engine also shares references, the
2497 memory usage increases.
2498 Memory impact: noticeable penalty, due to longer life of argv
2499 changing O(n) to O(n^2) on boxed recursion.
2500 Speed impact: slight improvement, due less data copying.
2501 * ltdl/m4/gnulib-cache.m4: Import memmem and quote modules.
2502 * m4/m4module.h (m4_arg_scratch): New prototype.
2503 * m4/m4private.h (m4__push_symbol): Add parameter.
2504 (m4_arg_scratch): Add fast accessor.
2505 (struct m4): Add expansion_level member, taken...
2506 * m4/macro.c (expansion_level): ...from here. Adjust all users.
2507 (expand_argument): Minor cleanup.
2508 (expand_macro): Track scratch space per macro call.
2509 (m4_arg_scratch): New function.
2510 (m4_make_argv_ref): Call new function.
2511 (m4_push_arg): Push reference to $0.
2512 (m4_push_args): Rework separator usage, since separators will
2514 (process_macro): Allow embedded NUL.
2515 * m4/input.c (INPUT_INLINE_THRESHOLD): New define.
2516 (m4__push_symbol): Add parameter. Inline short strings, and save
2517 references through rescanning.
2518 * m4/symtab.c (m4_set_symbol_value_text): Weaken assertion.
2519 * modules/m4.c (errprint, index): Handle NUL transparently.
2520 (dumpdef, translit): Use scratch space, rather than expansion
2522 * modules/gnu.c (renamesyms, m4symbols): Likewise.
2523 * tests/others.at (nul character): New test.
2524 (iso8859): Quote absolute file name, remove XFAIL.
2525 * tests/iso8859.m4: Avoid raw NUL in output.
2526 * tests/null.m4: New file.
2527 * tests/null.out: Likewise.
2528 * tests/null.err: Likewise.
2529 * Makefile.am (OTHER_FILES): Distribute new files.
2530 * .gitattributes: Treat new files as text.
2532 2007-12-17 Eric Blake <ebb9@byu.net>
2534 Stage 8: extend life of references into argv.
2535 Add hooks to lengthen the lifetime of arguments reused in a macro
2536 expansion, rather than always discarding arguments at the end of
2537 expand_macro. Rework the expand_macro obstacks to handle longer
2538 lifetimes. For now, the hooks remain unused.
2539 Memory impact: slight penalty, due to larger structs.
2540 Speed impact: slight penalty, due to more bookkeeping.
2541 * m4/system_.h (obstack_regrow): Delete.
2542 * m4/m4private.h (struct m4_symbol_chain): Add level field.
2543 (m4__push_symbol): Adjust prototype.
2544 (m4__adjust_refcount): New prototype.
2545 (DEBUG_MACRO) [DEBUG]: New debug control.
2546 (struct m4__macro_arg_stacks): New structure.
2547 (struct m4): Add arg_stacks, stacks_count fields.
2548 * m4/m4module.h (m4_make_argv_ref): Add parameter.
2549 * m4/macro.c (argc_stack, argv_stack): Delete, replaced by
2550 context->arg_stacks.
2551 (m4_macro_expand_input) [DEBUG_MACRO]: Add debug hooks,
2552 conditional on M4_DEBUG_MACRO envvar.
2553 (collect_arguments): Adjust signature.
2554 (expand_macro): Rework obstack handling.
2555 (m4__adjust_refcount, arg_mark): New functions.
2556 (m4_make_argv_ref): Populate new field.
2557 (m4_push_arg, m4_push_args): Track inuse.
2558 (process_macro): One less cast.
2559 * m4/m4.c (m4_delete): Clean up arg_stacks.
2560 * m4/input.c (make_text_link): Use new field.
2561 (m4__push_symbol, file_clean): Update signature.
2562 (composite_read): Bump refcount when done with reference.
2563 (composite_clean): New function.
2564 (pop_input): Adjust caller.
2565 * m4/debug.c (m4_debug_message): Make assertion match comment.
2566 * modules/gnu.c (builtin, indir): Adjust callers.
2567 * tests/builtins.at (ifelse): New test.
2568 (exp): Move and rename...
2569 * tests/others.at (countdown): ...to this.
2570 * doc/m4.texinfo (Improved foreach): Fix tracing usage in
2573 2007-12-13 Eric Blake <ebb9@byu.net>
2576 * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
2581 2007-12-13 Paolo Bonzini <bonzini@gnu.org> (tiny change)
2583 * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
2585 Reported by Giovanni Toffetti.
2587 2007-12-11 Eric Blake <ebb9@byu.net>
2589 Stage 7: use chained input support in input parser.
2590 Allow the LIFO input engine to rescan a macro expansion composed
2591 of smaller chunks of FIFO data, rather than the old approach of a
2592 monolithic string. For now, all chunks are still copied.
2593 Memory impact: slight penalty, due to FIFO chain overhead.
2594 Speed impact: slight penalty, due to extra bookkeeping.
2595 * m4/m4private.h (m4__push_symbol): New prototype.
2596 (struct m4_symbol_chain): Add const-safety.
2597 * m4/symtab.c (m4_symbol_value_print): Simplify.
2598 (dump_symbol_CB): Update caller.
2599 * m4/input.c (struct m4_input_block): Alter u_c member, first
2600 introduced 2006-10-25, but unused until now.
2601 (composite_peek, composite_read, composite_unget)
2602 (composite_print, init_builtin_token): Rewrite accordingly.
2603 (m4_push_wrapup): No longer need trailing NUL.
2604 (m4__push_symbol, make_text_link): New functions.
2605 (m4_push_string_finish): Use them.
2606 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
2607 (expand_macro): Simplify logic of nesting_limit.
2608 * src/main.c (main): Likewise.
2609 * doc/m4.texinfo (Dumpdef): Augment test.
2611 2007-12-08 Eric Blake <ebb9@byu.net>
2613 Stage 6: convert builtins to push arg at a time.
2614 Add new methods to factor all builtins whose expansion includes an
2615 argument, making back-reference creation easier in future patches.
2616 Factor out length-limited printing to obstacks, and use -1 rather
2617 than 0 for unlimited length.
2618 Memory impact: none.
2619 Speed impact: slight improvement, due to better code sharing.
2620 * m4/m4module.h (m4_shipout_text): Rename...
2621 (m4_divert_text): ...to this, to avoid confusion with m4_shipout_*
2622 that does not worry about sync lines.
2623 (m4_shipout_string_trunc): New prototype.
2624 * m4/output.c (m4_shipout_text): Rename...
2625 (m4_divert_text): ...to this.
2626 (m4_shipout_string): Move guts...
2627 (m4_shipout_string_trunc): ...to this new function.
2628 * m4/macro.c (m4_push_arg, m4_push_args): New functions.
2629 (expand_token, process_macro): Update callers.
2630 * m4/input.c (string_print): Likewise.
2631 * modules/m4.c (ifdef, ifelse, shift, substr, translit, divert):
2633 * modules/gnu.c (patsubst): Likewise.
2634 (debuglen): Use SIZE_MAX for unlimited debug length.
2635 * src/main.c (main): Likewise.
2636 * m4/m4.c (m4_create): Default max_debug_length to SIZE_MAX, not
2639 2007-12-07 Eric Blake <ebb9@byu.net>
2641 Minor security fix: Quote output of mkstemp.
2642 * modules/m4.c (m4_make_temp): Produce quoted output.
2643 * doc/m4.texinfo (Mkstemp, Mkdtemp): Update the documentation and
2646 Stage 5: add notion of quote age.
2647 Cache the quoting rules that were in effect when a string was
2648 parsed, to avoid reparsing that string if no changequote or other
2649 quote age change took place in the meantime. A quote_age of 0 is
2650 always safe, but does not benefit from caching.
2651 Memory impact: slight improvement, due to smaller struct in input
2653 Speed impact: slight penalty, due to more bookkeeping.
2654 * m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
2655 (m4_set_symbol_value_text): Adjust prototype.
2656 (m4_has_syntax): Factor out the unsigned char cast.
2657 * m4/m4private.h (struct m4_syntax_table): Add syntax_age and
2659 (m4__quote_age, m4__safe_quotes): New accessor macros, no need for
2660 functions at this point.
2661 (struct m4_symbol_value, struct m4_macro_args): Add quote_age
2663 (m4_set_symbol_value_text): Adjust fast accessor.
2664 (m4_get_symbol_value_quote_age): New fast accessor.
2665 * m4/symtab.c (m4_set_symbol_value_text): Add parameter.
2666 (m4_get_symbol_value_quote_age): New function.
2667 (m4_symbol_value_copy): Adjust callers.
2668 * m4/macro.c (expand_token): Add parameter, and track quote age.
2669 (expand_argument, collect_arguments): Track quote age.
2670 (m4_macro_expand_input, process_macro, m4_make_argv_ref)
2671 (m4_macro_expand_input): Update callers.
2672 (m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
2673 * m4/input.c: Comment cleanups.
2674 (struct m4_input_block): Reduce size.
2675 (m4__next_token): Report quote age.
2676 (m4_push_builtin, init_builtin_token): Update callers.
2677 * m4/utility.c (skip_space): Adjust callers.
2678 * m4/module.c (install_macro_table): Likewise.
2679 * m4/syntax.c (m4_set_syntax): Initialize and update quote age.
2680 (m4_set_quotes, m4_set_comment): Detect no-op changes, and update
2682 (set_quote_age): New helper function.
2683 (check_is_single_quotes, check_is_single_comments): Adjust
2685 * src/freeze.c (reload_frozen_state): Likewise.
2686 * src/main.c (main): Likewise.
2687 * modules/m4.c (define, pushdef): No need to set macro text.
2688 * tests/builtins.at (changequote, defn): New tests.
2689 * examples/wrapfifo.m4: New file.
2690 * examples/wraplifo.m4: New file.
2691 * Makefile.am (dist_pkgdata_DATA): Distribute new examples.
2693 2007-12-04 Eric Blake <ebb9@byu.net>
2695 Fix builds with OpenBSD make.
2696 * Makefile.am (HELP2MAN): New macro.
2697 (dist_man_MANS, doc/m4.1): Fix rules for building m4.1 into
2699 * README: Update copyright.
2700 * HACKING: Mention help2man and makeinfo dependencies.
2702 2007-11-29 Eric Blake <ebb9@byu.net>
2704 Stage 4: route indir, builtin through ref; make argv opaque.
2705 Finish making struct opaque to all but the input engine, by
2706 reworking obstack usage in expand_macro to better support creation
2707 of a $@ reference. Canonicalize the empty argument, to allow
2708 pointer comparison optimizations.
2709 Memory impact: slight penalty, due to larger struct.
2710 Speed impact: slight improvement, due to fewer function calls.
2711 * m4/system_.h (obstack_regrow): Fix precedence.
2712 * m4/m4module.h (m4_arg_equal, m4_arg_empty, m4_make_argv_ref):
2714 (struct m4_macro_args): Move...
2715 * m4/m4private.h (struct m4_macro_args): ...here, making it opaque
2716 to modules. Add has_ref member.
2717 (bool_bitfield): New helper typedef.
2718 (struct m4_symbol_chain): Add flatten and len members.
2719 * m4/macro.c (empty_symbol): New placeholder, for optimizing
2720 comparison with empty string.
2721 (m4_macro_expand_input): Initialize it.
2722 (collect_arguments): Alter signature, and populate new fields.
2723 (trace_pre, trace_post): Remove redundant parameter.
2724 (expand_macro): Alter handling of obstacks.
2725 (m4_arg_symbol): Account for wrapped argv.
2726 (m4_arg_equal, m4_arg_empty, m4_make_argv_ref): New methods.
2727 (m4_arg_text, m4_arg_len, m4_arg_func): Use new methods.
2728 * modules/m4.c (ifelse, syscmd): Likewise.
2729 * modules/evalparse.c (m4_evaluate): Likewise.
2730 (undefine, popdef, m4_dump_symbols): Optimize.
2731 * modules/gnu.c (builtin, indir, esyscmd, debugfile): Use new
2733 (changesyntax, regexp): Optimize.
2734 * m4/output.c (diversion_storage): Use typedef.
2736 Stage 3b: cache length, rather than computing it, in modules.
2737 Use cached token length in builtins and output engine.
2738 Memory impact: none.
2739 Speed impact: noticeable improvement, due to fewer function calls.
2740 * m4/hash.c (m4_hash_remove): Avoid double free on remove
2742 * m4/output.c (m4_shipout_string): Change semantics of len param.
2743 (m4_shipout_int): Use cached length.
2744 * m4/input.c (m4_push_string_finish): Likewise.
2745 * modules/m4.h (m4_make_temp_func): Add parameter.
2746 * m4/macro.c (expand_token, m4_arg_len): Use cached length.
2747 (collect_arguments, expand_macro): Alter signature.
2748 (trace_format): Don't use out-of-scope buffer.
2749 (process_macro): All callers changed.
2750 * m4/utility.c (m4_dump_args): Likewise.
2751 * m4/symtab.c (m4_symbol_value_print): Likewise.
2752 * modules/gnu.c (__file__, __program__, builtin, indir)
2753 (m4symbols, mkdtemp, regexp_compile, regexp_substitute,
2754 renamesyms, patsubst, regexp, regexp_compile): Likewise.
2755 * modules/load.c (m4modules): Likewise.
2756 * modules/m4.c (defn, m4wrap, maketemp, m4_make_temp)
2757 (numb_obstack, ifdef, ifelse, divert, len, substr): Likewise.
2758 * modules/perl.c (perleval): Likewise.
2759 * modules/stdlib.c (getcwd, getenv, getlogin, getpwnam, getpwuid)
2760 (hostname, uname, setenv): Likewise.
2761 * modules/mpeval.c (numb_obstack): Likewise.
2762 * src/freeze.c (dump_symbol_CB): Likewise.
2763 * doc/m4.texinfo (Renamesyms, Dumpdef, Changesyntax): Adjust test.
2764 * tests/builtins.at (mkstemp): Likewise.
2765 * tests/others.at (iso8859): XFAIL this test, now that
2766 length-based handling allows NUL through part but not all of M4.
2768 2007-11-28 Eric Blake <ebb9@byu.net>
2770 Stage 3a: cache length, rather than computing it, in libm4.
2771 Cache the length of a token in the input engine and symbol table,
2772 to avoid repeating lots of strlen calls. Additionally, by using
2773 obstack length rather than strlen, the input engine can now
2774 support embedded NUL.
2775 Memory impact: slight penalty, due to larger struct.
2776 Speed impact: slight improvement, due to fewer function calls.
2777 * m4/m4module.h (struct m4_macro_args): Cache length.
2778 (m4_get_symbol_len, m4_get_symbol_value_len): New accessors.
2779 (m4_set_symbol_value_text): Change signature.
2780 * m4/m4private.h (struct m4_symbol_value): Store string length.
2781 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2782 (m4_set_symbol_value_placeholder): Update accordingly.
2783 (m4_set_symbol_value_text): Change signature.
2784 (m4_get_symbol_value_len): New accessor.
2785 * m4/input.c (struct m4_input_block, string_peek, string_read)
2786 (string_unget, string_print, m4_push_string_finish)
2787 (m4_push_wrapup): Track length of string input.
2788 (m4__next_token): Adjust all users of symbol text to track length,
2790 * m4/macro.c (expand_argument, collect_arguments): Likewise.
2791 * m4/module.c (install_macro_table): Likewise.
2792 * modules/gnu.c (builtin, indir): Likewise.
2793 * modules/m4.c (define, pushdef): Likewise.
2794 * src/main.c (main): Likewise.
2795 * src/freeze.c (reload_frozen_state): Likewise.
2796 * m4/symtab.c (m4_symbol_value_copy): Likewise.
2797 (m4_get_symbol_value_len): New function.
2798 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2799 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
2800 Adjust implementation.
2802 2007-11-27 Eric Blake <ebb9@byu.net>
2804 Stage 2: use accessors, not direct reference, into argv.
2805 Outside of macro.c, use accessor methods rather than direct access
2806 into the argv struct.
2807 Memory impact: none.
2808 Speed impact: slight penalty, due to increased function calls.
2809 * m4/m4private.h (m4_arg_argc): New fast accessor.
2810 * m4/m4module.h (m4_arg_argc, m4_arg_symbol, m4_is_arg_text)
2811 (m4_is_arg_func, m4_arg_text, m4_arg_len, m4_arg_func): New
2813 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2814 (m4_macro_call): Make argc unsigned.
2815 (M4ARG): Use new accessors.
2816 * modules/m4.c (define, pushdef): Likewise.
2817 (undefine, popdef, ifelse, m4_dump_symbols, defn, undivert)
2818 (traceon, traceoff): Make argc unsigned.
2819 * modules/m4.h (m4_dump_symbols_func): Likewise.
2820 * modules/evalparse.c (m4_evaluate): Likewise.
2821 * modules/gnu.c (builtin, indir): Use new accessors.
2822 (changesyntax): Make argc unsigned.
2823 * modules/perl.c (perleval): Likewise.
2824 * m4/utility.c (m4_dump_args): Use new accessors.
2825 * m4/macro.c (trace_pre): Likewise.
2826 (m4_arg_symbol, m4_arg_argc, m4_is_arg_text, m4_is_arg_func)
2827 (m4_arg_text, m4_arg_len, m4_arg_func): New functions.
2828 (expand_macro, trace_pre, trace_post, m4_macro_call): Update argc
2831 2007-11-24 Eric Blake <ebb9@byu.net>
2833 Stage 1: convert m4_symbol_value** into new object.
2834 Pass a variable-size wrapper structure instead of an array to
2835 builtins, so that subsequent optimizations in the structure need
2836 not impact every builtin client.
2837 Memory impact: slight penalty, since struct is larger than array.
2838 Speed impact: slight penalty, due to increased bookkeeping.
2839 * ltdl/m4/gnulib-cache.m4: Import flexmember module.
2840 * m4/m4module.h (m4_macro_args): New type, will be opaque to
2842 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2843 (m4_macro_call): Alter signature to use m4_macro_args object.
2844 (M4ARG): Redefine to access new struct.
2845 * m4/m4private.h (M4_SYMBOL_COMP): New enumerator.
2846 (struct m4_symbol_chain): New type.
2847 (struct m4_symbol_value): Add chain alternative.
2848 * m4/macro.c (collect_arguments): Build new struct.
2849 (expand_macro, m4_macro_call, process_macro, trace_pre)
2850 (trace_post): Adjust implementation to use it.
2851 * m4/utility.c (m4_dump_args): Likewise.
2852 * modules/gnu.c (builtin, indir): Likewise.
2853 * modules/format.c (format): Likewise.
2854 * modules/m4.h (m4_dump_symbols_func): Likewise.
2855 * modules/m4.c (m4_dump_symbols, define, pushdef, defn, ifelse)
2856 (shift, include, errprint, m4wrap): Likewise.
2857 * modules/evalparse.c (m4_evaluate): Likewise.
2859 Pass only macro name to utility functions.
2860 * m4/m4module.h (m4_bad_argc, m4_numeric_arg): Adjust signature.
2861 * m4/utility.c (m4_bad_argc, m4_numeric_arg): Adjust
2863 * m4/macro.c (m4_macro_call): Adjust callers.
2864 * modules/gnu.c (builtin, debuglen): Likewise.
2865 * modules/m4.c (ifelse, incr, decr, divert, undivert, m4exit)
2867 * modules/evalparse.c (m4_evaluate): Likewise.
2868 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
2869 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
2872 2007-11-23 Eric Blake <ebb9@byu.net>
2874 Add macro name to debugfile messages.
2875 * m4/m4module.h (m4_debug_set_output): Add parameter.
2876 * m4/debug.c (m4_debug_set_output, set_debug_file): Pass macro
2878 * modules/gnu.c (debugfile): Adjust caller.
2879 * modules/m4.c (m4exit): Likewise.
2880 * src/main.c (main): Likewise.
2882 Factor out handling of macro name in error messages.
2883 * m4/m4module.h (m4_error, m4_error_at_line, m4_warn)
2884 (m4_warn_at_line): Add new parameter.
2885 * m4/utility.c (m4_verror_at_line): New helper method.
2886 (m4_error, m4_error_at_line, m4_warn, m4_warn_at_line): Add new
2888 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg): All callers
2890 * m4/debug.c: Likewise.
2891 * m4/input.c: Likewise.
2892 * m4/macro.c: Likewise.
2893 * m4/module.c: Likewise.
2894 * m4/output.c: Likewise.
2895 * m4/path.c: Likewise.
2896 * modules/evalparse.c: Likewise.
2897 * modules/format.c: Likewise.
2898 * modules/gnu.c: Likewise.
2899 * modules/load.c: Likewise.
2900 * modules/m4.c: Likewise.
2901 * modules/mpeval.c: Likewise.
2902 * src/freeze.c: Likewise.
2903 * src/main.c: Likewise.
2905 2007-11-14 Eric Blake <ebb9@byu.net>
2907 Handle some defn corner cases differently.
2908 * doc/m4.texinfo (Defn): Update documentation; although this still
2909 doesn't match the branch, since it may be changed before 2.0.
2910 * m4/macro.c (expand_argument): Consistently ignore builtins in
2911 concatenation contexts.
2912 * m4/m4private.h (m4__symbol_type): Fix C89 compliance bug.
2914 2007-11-13 Eric Blake <ebb9@byu.net>
2916 Note: Patches titled Stage 0 through N form a series of patches
2917 which decreases the algorithmic complexity of tail recursion in
2918 macro expansions from O(n^2) to O(n) in both time and memory, then
2919 performs cleanups, such as handling of embedded NUL, made easier
2920 by the code refactoring.
2922 Stage 0: Fix memory leak in tail recursion.
2923 Free expansion text in the input engine as soon as it is parsed,
2924 rather than when the recursive expansion completes.
2925 Memory impact: noticeable improvement, due to reduction from
2926 O(n^2) to O(n) on recursion.
2927 Speed impact: minor improvement, due to better memory usage.
2928 * m4/input.c (pop_input): Add flag parameter and return type.
2929 (next_char): Adjust caller.
2930 (m4_push_string_init): Let go of memory earlier.
2932 2007-11-07 Eric Blake <ebb9@byu.net>
2934 * tests/macros.at (Rescanning macros): Test more corner cases.
2936 2007-11-06 Eric Blake <ebb9@byu.net>
2938 * build-aux/mkstamp: Rename from ltdl/config/mkstamp.
2940 * Makefile.am (tests/package.m4): Work around bash bug.
2941 Reported by Ralf Wildenhues.
2943 2007-11-05 Eric Blake <ebb9@byu.net>
2945 For consistency with other GNU projects, use build-aux directory.
2946 * configure.ac (AC_CONFIG_AUX_DIR): Change ltdl/config to
2948 * bootstrap (config_aux_dir): Likewise.
2949 * Makefile.am (config_aux_dir): Likewise.
2950 * ltdl/m4/gnulib-cache.m4: Use --aux-dir option.
2952 2007-11-02 Eric Blake <ebb9@byu.net>
2954 Update some documentation about version control.
2955 * NEWS: M4 is now stored in git.
2956 * HACKING: Likewise.
2958 * bootstrap: Likewise.
2959 * commit: Delete, now that CVS commits are no longer necessary.
2960 * ltdl/config/mailnotify: No longer necessary; git's patch
2961 generation and mail capability is more powerful.
2963 Update to recent gnulib changes.
2964 * ltdl/m4/gnulib-cache.m4: Replace fprintf-posix, vasprintf-posix,
2965 xprintf, and xvasprintf with xprintf-posix and xvasprintf-posix.
2967 2007-11-01 Eric Blake <ebb9@byu.net>
2969 Improve error message when early end of file occurs.
2970 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
2971 (M4wrap): Adjust to new messages.
2972 (Improved capitalize): Enhance test.
2973 * m4/m4private.h (m4__next_token): Adjust prototype.
2974 * m4/input.c (m4__next_token): Add new parameter, and improve
2976 * m4/macro.c (m4_macro_expand_input, collect_arguments): Adjust
2978 (expand_argument): Likewise, and add parameter.
2980 2007-10-31 Eric Blake <ebb9@byu.net>
2982 Test more corner cases.
2983 * tests/macros.at (Rescanning macros): Beef up test.
2984 * doc/m4.texinfo (Changecom): Beef up test.
2985 (Improved foreach): Document alternate foreachq style.
2986 * examples/foreachq3.m4: New file.
2987 * examples/loop.m4: New file.
2988 * Makefile.am (dist_pkgdata_DATA): Distribute them.
2990 2007-10-28 Eric Blake <ebb9@byu.net>
2992 More test coverage for autoconf usage patterns.
2993 * doc/m4.texinfo (Shift): Document cond macro, and add new test.
2994 * tests/macros.at (Rescanning macros): New test.
2995 * tests/builtins.at (include): Augment test.
2997 2007-10-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2999 * Makefile.am: Adjust getopt handling to latest gnulib layout.
3001 2007-10-27 Eric Blake <ebb9@byu.net>
3003 Document one use of changequote(`(',`)').
3004 * doc/m4.texinfo (Changequote): Add new test, based on recent
3005 autoconf addition of m4_expand.
3007 2007-10-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3009 * Makefile.am (dist_pkgdata_DATA): Add examples/capitalize2.m4.
3011 2007-10-22 Eric Blake <ebb9@byu.net>
3013 Never let printf failures go undetected.
3014 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3016 * m4/system_.h: Include xprintf.h.
3017 * m4/debug.c (m4_debug_message_prefix, m4_debug_message): Wrap all
3018 use of printf, xprintf.
3019 * m4/input.c [DEBUG_INPUT]: Likewise.
3020 * m4/module.c [DEBUG_MODULES]: Likewise.
3021 * m4/output.c (m4_shipout_text, m4_shipout_int)
3022 (m4_freeze_diversions): Likewise.
3023 * m4/path.c [DEBUG_INCL]: Likewise.
3024 * m4/symtab.c [DEBUG_SYM]: Likewise.
3025 * m4/syntax.c [DEBUG_SYNTAX]: Likewise.
3026 * modules/modtest.c (export_test): Likewise.
3027 * src/freeze.c (produce_resyntax_dump, produce_syntax_dump)
3028 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
3030 * src/main.c (usage): Likewise.
3031 * po/POTFILES.in: Adjust to new file.
3032 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
3034 2007-10-18 Eric Blake <ebb9@byu.net>
3036 Fix 'm4 -F file -t undefined'.
3037 * src/freeze.c (produce_symbol_dump): Skip trace placeholders.
3038 * src/freeze.c (dump_symbol_CB): Also skip void symbols.
3039 * tests/freeze.at (reloading unknown builtin): Test for this bug.
3040 * m4/m4module.h (m4_symtab_apply): Add parameter.
3041 * m4/symtab.c (m4_symtab_apply): Ignore trace placeholders when
3043 (m4_symtab_delete, symtab_dump): Adjust callers.
3044 * modules/m4.c (m4_dump_symbols): Likewise.
3046 2007-10-09 Eric Blake <ebb9@byu.net>
3048 Fix regexp regression of 2007-09-29.
3049 * modules/gnu.c (substitute): Allow NULL buf when no
3050 subexpressions were present.
3051 (regexp): Handle \ escapes even with empty regex.
3052 * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
3054 Cache regex compilation for another autoconf speedup.
3055 * modules/gnu.c (gnu_buf): Replace...
3056 (REGEX_CACHE_SIZE, regex_cache): ...with new declarations.
3057 (m4_pattern_buffer): Add fields.
3058 (m4_regexp_compile): Rename...
3059 (regexp_compile): ...to this, and drop no_sub parameter.
3061 (M4FINISH_HANDLER): Clean up entire cache.
3062 (m4_regexp_search): Rename...
3063 (regex_search): ...to this, adjust to new struct contents, and add
3065 (m4_regexp_substitute): Rename...
3066 (regexp_substitute): ...to this.
3067 (substitute, patsubst, regexp, renamesyms): Adjust callers.
3069 2007-10-02 Eric Blake <ebb9@byu.net>
3071 Document quoting pitfalls in capitalize.
3072 * doc/m4.texinfo (Patsubst): Use the examples directory. Also
3074 (Improved capitalize): New node.
3075 * examples/capitalize.m4: Update to match manual.
3076 * examples/capitalize2.m4: New file.
3078 2007-10-01 Eric Blake <ebb9@byu.net>
3080 Another Autoconf usage pattern optimization.
3081 * modules/m4.c (m4_index): Optimize search for one byte.
3082 * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
3085 2007-09-29 Eric Blake <ebb9@byu.net>
3087 Optimize for Autoconf usage pattern.
3088 * modules/gnu.c (regexp, patsubst): Handle empty regex faster.
3090 * tests/testsuite.at (AT_CHECK_M4): Slight optimization.
3092 2007-09-24 Eric Blake <ebb9@byu.net>
3094 Create .gitignore alongside .cvsignore.
3095 * bootstrap (version control): Update to reflect git usage.
3097 2007-09-13 Eric Blake <ebb9@byu.net>
3099 * AUTHORS: Fix typo.
3101 2007-09-12 Gary V. Vaughan <gary@gnu.org>
3103 Be consistent about using 'module' for m4_module types and
3104 'handle' for lt_dlhandle types:
3106 * m4/m4private.h (m4_symbol_value): Rename handle element to
3107 method. Changed all references.
3108 (VALUE_MODULE, SYMBOL_MODULE): Renamed from VALUE_HANDLE and
3109 SYMBOL_HANDLE respectively. Changed all references.
3110 * m4/m4module.h (M4INIT_HANDLER, M4FINISH_HANDLER): Ditto.
3111 * m4/builtin.c (m4_builtin_find_by_name)
3112 (m4_builtin_find_by_func): Use module as the parameter name for
3113 pointers of type 'm4_module'.
3114 * m4/module.c (module_remove, m4_get_module_name)
3115 (install_builtin_table, install_macro_table)
3116 (m4_module_make_resident, m4__module_next, m4_module_refcount):
3118 * src/freeze.c (produce_module_dump): Ditto.
3119 * m4/input.c (m4_input_block): Rename handle element to method.
3120 Changed all references.
3121 * m4/symtab.c (m4__symtab_remove_module_references): Ditto.
3122 * modules/load.c: Use module as the variable name for pointers
3123 of type 'm4_module'.
3124 * modules/m4.c: Ditto.
3125 * modules/perl.c: Ditto.
3126 * modules/shadow.c: Ditto.
3128 2007-09-07 Eric Blake <ebb9@byu.net>
3130 Add refcount builtin.
3131 * modules/load.c (refcount): New builtin.
3132 (m4modules): Use correct type.
3133 * doc/m4.texinfo (Refcount): New section.
3134 * m4/m4private.h (struct m4_module): Add refcount member.
3135 (m4_module_refcount) [NDEBUG]: Add faster accessor macro.
3136 * m4/module.c (m4_module_load): Add symbols to table on first
3137 load by m4, regardless of other libltdl loads of same module.
3138 (m4_module_refcount): Use new struct member, rather than relying
3139 on libltdl count which might be inflated by unrelated loads.
3140 (m4__module_interface): Optimize.
3141 (m4__module_next, m4__module_find): Avoid assertions that could
3142 trigger with unrelated libltdl loads.
3143 (m4__module_open): Track m4 load count.
3144 (m4__module_exit): Only unload what m4 loaded.
3145 (module_remove): Track m4 unloads.
3146 * NEWS: Document new builtin.
3148 More conversion to m4_module*.
3149 * src/freeze.c (produce_module_dump, dump_symbol_CB)
3150 (reload_frozen_state): Use correct type.
3151 * m4/input.c (struct m4_input_block): Likewise.
3152 * m4/symtab.c (dump_symbol_CB): Likewise.
3154 * AUTHORS: Simplify, to match libtool and autoconf layout.
3155 * THANKS: Sync with branch.
3157 2007-09-06 Eric Blake <ebb9@byu.net>
3159 Wrap lt_dlhandle in struct m4_module.
3160 * m4/m4module.h (includes): No longer require clients to know
3162 (m4_module): New opaque declaration.
3163 (m4_export): Delete unused type.
3164 (M4INIT_HANDLER, M4FINISH_HANDLER, m4_module_init_func)
3165 (m4_module_finish_func, m4_module_load, m4_get_module_name)
3166 (m4_builtin_find_by_name, m4_builtin_find_by_func): Use new
3168 (m4_module_makeresident, m4_module_refcount): New declarations.
3169 * m4/m4private.h (includes): Move <ltdl.h> here.
3170 (m4_module): New declaration. Simple for now, but intended for
3172 (m4__module_open, m4__module_next, m4__module_find)
3173 (m4__symtab_remove_module_references): Use new wrapper.
3174 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
3176 * m4/module.c (m4_get_module_name, m4_module_import)
3177 (m4_module_load): Likewise.
3178 (install_builtin_table, install_macro_table): Likewise. Also,
3179 change return type since these always returned NULL and no one
3181 (m4_module_makeresident, m4_module_refcount): New functions.
3182 (m4_module_unload, m4__module_next, m4__module_find): Use new
3184 (m4__module_open): Populate new wrapper, and associate it with the
3186 (m4__module_exit): Use new wrapper.
3187 (module_remove): Likewise. Reclaim storage on last use.
3188 (module_close): Delete, and inline into module_remove.
3189 * m4/symtab.c (m4__symtab_remove_module_references): Use new
3191 * modules/load.c (load_init): Use new API.
3192 * modules/m4.c (m4_export_table): Kill unused declaration.
3193 (m4_init): Use new API.
3194 * modules/shadow.c (shadow_init): Use new API.
3195 * src/main.c (main): Adjust callers.
3196 * src/freeze.c (reload_frozen_state): Likewise.
3197 * tests/modules.at (unload load module): New test.
3199 2007-09-03 Gary V. Vaughan <gary@gnu.org>
3201 * bootstrap (ltdl/m4/.cvsignore): Add xstrtol module macros.
3202 * src/m4/.cvsignore: Add xstrtol module sources.
3204 2007-09-03 Gary V. Vaughan <gary@gnu.org>
3206 Work around a bug in darwin's awk:
3208 * bootstrap (func_get_translations): Use $AWK instead of raw
3209 `awk' so that the user can use an alternative implementation
3210 if the first awk in PATH doesn't behave as expected.
3211 (func_get_translations): The first awk script mangles the last
3212 entry passed to it for at least the awk implementation shipped
3213 with Darwin 8.10.1. Capture $3 into a variable too to work-
3214 around that problem.
3216 2007-08-29 Gary V. Vaughan <gary@gnu.org>
3218 As gnulib xstrtol is only used by main, and unconditionally pulls
3219 in a copy of getopt, undo bootstrap change from 2007-08-11 below,
3220 and copy the xstrtol code into src/ so that main() can use it
3221 without pushing the extra code into libm4:
3223 * bootstrap (src_modules): Add getopt and xstrtol modules.
3224 * Makefile.am (src_m4_SOURCES): Add xstrtol sources.
3225 * po/POTFILES.in: Move gnu/xstrtol-error.c to src/xstrtol-error.c.
3227 2007-08-11 Eric Blake <ebb9@byu.net>
3229 Another upstream xstrtol change.
3230 * po/POTFILES.in: Track changes in files containing messages.
3231 * bootstrap (src_modules): getopt is now pulled into libgnu.a, no
3232 need to grab it separately.
3233 * src/main.c (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
3235 (size_opt): Adjust to latest xstrtol interface.
3237 2007-08-10 Eric Blake <ebb9@byu.net>
3239 Documentation improvements.
3240 * doc/m4.texinfo (Defn): Resync with branch.
3241 (Compatibility, Extensions): Sync with branch.
3243 2007-08-07 Eric Blake <ebb9@byu.net>
3245 Adjust to gnulib xstrtol changes.
3246 * src/main.c (size_opt): Adjust signature, so that error strings
3247 are easier to translate.
3248 (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): New macros
3249 for tracking long options.
3250 (main): Track which long option was used.
3251 * tests/options.at (--debuglen, --nesting-limit): Adjust to change
3253 (deprecated options): Test that --arglength spelling shows up in
3256 2007-08-06 Eric Blake <ebb9@byu.net>
3258 Normalize all GPL license notices.
3259 * m4/COPYING.LIB: Delete - libm4 is not distributed under LGPLv2
3261 * Makefile.am: Update license wording.
3262 * bootstrap: Likewise.
3264 * configure.ac: Likewise.
3265 * ltdl/config/mailnotify: Likewise.
3266 * ltdl/config/mkstamp: Likewise.
3267 * ltdl/m4/debug.m4: Likewise.
3268 * ltdl/m4/gmp.m4: Likewise.
3269 * ltdl/m4/m4-error.m4: Likewise.
3270 * ltdl/m4/m4-getopt.m4: Likewise.
3271 * ltdl/m4/m4-gettext.m4: Likewise.
3272 * ltdl/m4/m4-obstack.m4: Likewise.
3273 * ltdl/m4/m4-regex.m4: Likewise.
3274 * ltdl/m4/stackovf.m4: Likewise.
3275 * m4/builtin.c: Likewise.
3276 * m4/debug.c: Likewise.
3277 * m4/hash.c: Likewise.
3278 * m4/hash.h: Likewise.
3279 * m4/input.c: Likewise.
3280 * m4/m4.c: Likewise.
3281 * m4/m4module.h: Likewise.
3282 * m4/m4private.h: Likewise.
3283 * m4/macro.c: Likewise.
3284 * m4/module.c: Likewise.
3285 * m4/output.c: Likewise.
3286 * m4/path.c: Likewise.
3287 * m4/resyntax.c: Likewise.
3288 * m4/symtab.c: Likewise.
3289 * m4/syntax.c: Likewise.
3290 * m4/system_.h: Likewise.
3291 * m4/utility.c: Likewise.
3292 * modules/evalparse.c: Likewise.
3293 * modules/format.c: Likewise.
3294 * modules/gnu.c: Likewise.
3295 * modules/import.c: Likewise.
3296 * modules/load.c: Likewise.
3297 * modules/m4.c: Likewise.
3298 * modules/m4.h: Likewise.
3299 * modules/modtest.c: Likewise.
3300 * modules/mpeval.c: Likewise.
3301 * modules/perl.c: Likewise.
3302 * modules/shadow.c: Likewise.
3303 * modules/stdlib.c: Likewise.
3304 * modules/time.c: Likewise.
3305 * modules/traditional.c: Likewise.
3306 * po/Makevars: Likewise.
3307 * src/freeze.c: Likewise.
3308 * src/m4.h: Likewise.
3309 * src/main.c: Likewise.
3310 * src/stackovf.c: Likewise.
3311 * tests/builtins.at: Likewise.
3312 * tests/freeze.at: Likewise.
3313 * tests/generate.awk: Likewise.
3314 * tests/m4.in: Likewise.
3315 * tests/macros.at: Likewise.
3316 * tests/modules.at: Likewise.
3317 * tests/options.at: Likewise.
3318 * tests/others.at: Likewise.
3319 * tests/stackovf.test: Likewise.
3320 * tests/testsuite.at: Likewise.
3322 2007-07-22 Eric Blake <ebb9@byu.net>
3324 Fix diversions on NetBSD, when fopen(name,"a+") seeks to end.
3325 * m4/output.c (m4_tmpopen): Explicitly seek to beginning.
3326 * tests/builtins.at (divert): Enhance test to cover this.
3328 Reported by Thomas Klausner.
3330 2007-07-20 Eric Blake <ebb9@byu.net>
3332 Fix 'make distcheck' issues.
3333 * bootstrap: Add more files that might be more up-to-date in
3335 * Makefile.am (EXTRA_DIST): No longer distribute removed diff.
3336 * config/m4/gnulib-cache.m4: Update to latest gnulib.
3338 2007-07-16 Eric Blake <ebb9@byu.net>
3340 * po/POTFILES.in: Track recent translation additions from gnulib
3343 2007-07-14 Eric Blake <ebb9@byu.net>
3345 Reflect upstream license .texi changes.
3346 * doc/m4.texinfo (Copying): Rename node...
3347 (GNU General Public License): ...to this.
3348 (GNU Free Documentation License): Adjust node location.
3349 * local/doc/gpl-3.0.texi.diff: Remove file.
3351 2007-07-10 Eric Blake <ebb9@byu.net>
3353 Upgrade to GPLv3, and document 1.4.10.
3354 * bootstrap: Adjust to GPLv3.
3355 (func_update): Port from branch.
3356 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
3357 --local-dir=local --import gpl-3.0'.
3358 * doc/m4.texinfo (History): Mention 1.4.11.
3359 (Copying This Package): New appendix.
3360 * NEWS: Document 1.4.10.
3361 * local/doc/gpl-3.0.texi.diff: New file.
3362 * Makefile.am: Update license.
3363 (doc_m4_TEXINFOS, EXTRA_DIST): Distribute additions.
3364 * commit: Update license.
3365 * configure.ac: Likewise.
3366 * ltdl/config/mailnotify: Likewise.
3367 * ltdl/config/mkstamp: Likewise.
3368 * ltdl/m4/debug.m4: Likewise.
3369 * ltdl/m4/gmp.m4: Likewise.
3370 * ltdl/m4/m4-error.m4: Likewise.
3371 * ltdl/m4/m4-getopt.m4: Likewise.
3372 * ltdl/m4/m4-gettext.m4: Likewise.
3373 * ltdl/m4/m4-obstack.m4: Likewise.
3374 * ltdl/m4/m4-regex.m4: Likewise.
3375 * ltdl/m4/stackovf.m4: Likewise.
3376 * m4/builtin.c: Likewise.
3377 * m4/debug.c: Likewise.
3378 * m4/hash.c: Likewise.
3379 * m4/hash.h: Likewise.
3380 * m4/input.c: Likewise.
3381 * m4/m4.c: Likewise.
3382 * m4/m4module.h: Likewise.
3383 * m4/m4private.h: Likewise.
3384 * m4/macro.c: Likewise.
3385 * m4/module.c: Likewise.
3386 * m4/output.c: Likewise.
3387 * m4/path.c: Likewise.
3388 * m4/resyntax.c: Likewise.
3389 * m4/symtab.c: Likewise.
3390 * m4/syntax.c: Likewise.
3391 * m4/system_.h: Likewise.
3392 * m4/utility.c: Likewise.
3393 * modules/evalparse.c: Likewise.
3394 * modules/format.c: Likewise.
3395 * modules/gnu.c: Likewise.
3396 * modules/import.c: Likewise.
3397 * modules/load.c: Likewise.
3398 * modules/m4.c: Likewise.
3399 * modules/m4.h: Likewise.
3400 * modules/modtest.c: Likewise.
3401 * modules/mpeval.c: Likewise.
3402 * modules/perl.c: Likewise.
3403 * modules/shadow.c: Likewise.
3404 * modules/stdlib.c: Likewise.
3405 * modules/time.c: Likewise.
3406 * modules/traditional.c: Likewise.
3407 * po/Makevars: Likewise.
3408 * src/freeze.c: Likewise.
3409 * src/m4.h: Likewise.
3410 * src/main.c: Likewise.
3411 * src/stackovf.c: Likewise.
3412 * tests/builtins.at: Likewise.
3413 * tests/freeze.at: Likewise.
3414 * tests/generate.awk: Likewise.
3415 * tests/m4.in: Likewise.
3416 * tests/macros.at: Likewise.
3417 * tests/modules.at: Likewise.
3418 * tests/options.at: Likewise.
3419 * tests/others.at: Likewise.
3420 * tests/stackovf.test: Likewise.
3421 * tests/testsuite.at: Likewise.
3423 2007-07-09 Eric Blake <ebb9@byu.net>
3425 * modules/format.c (format): Avoid undefined behavior with %c.
3427 2007-07-01 Gary V. Vaughan <gary@gnu.org>
3429 The translation project has moved.
3430 * bootstrap (func_get_translations): Use the new translation
3434 2007-06-26 Karl Berry <karl@freefriends.org> (tiny change)
3436 Match Free Software Directory categories.
3437 * doc/m4.texinfo (dircategory): Update.
3439 2007-05-31 Eric Blake <ebb9@byu.net>
3441 Add extension to divert builtin.
3442 * modules/m4.c (builtin_divert): Immediately divert second
3444 * m4/output.c (m4_output_text): Allow 0 length. Fixes regression
3446 (m4_shipout_text): Short-circuit on zero length.
3447 * tests/freeze.at (loading format 2): Expand test to catch
3448 regression. Also check out-of-range version.
3449 * tests/builtins.at (divert): Expand test to check corner cases
3451 * doc/m4.texinfo (Divert): Document the extension.
3453 Reported by Daniel Richard G.
3455 2007-05-30 Eric Blake <ebb9@byu.net>
3457 Port format improvements from branch.
3458 * doc/m4.texinfo (History): Mention upcoming 1.4.10 release.
3459 (Format): Enhance section.
3460 * modules/format.c (format): Accept %'hhd, and issue warnings on
3461 unrecognized specifiers.
3462 * modules/gnu.c (builtin_format): Adjust how format is called.
3464 2007-05-28 Eric Blake <ebb9@byu.net>
3466 * tests/options.at (--syncoutput): Add xfailed test.
3468 Fix sync line interaction with multiline comments.
3469 * doc/m4.texinfo (Preprocessor features): Improve documentation.
3470 (Syncoutput): Improve testsuite.
3471 (Incompatibilities): Add testcase, and document bug.
3472 * src/freeze.c (reload_frozen_state): Don't interfere with
3473 synclines when reloading state.
3474 * m4/input.c (m4__next_token): Report line where multiline tokens
3476 * m4/m4private.h (m4__token_type): Add parameter.
3477 * m4/m4module.h (m4_output_text): Export.
3478 (m4_shipout_text): Add parameter.
3479 * src/macro.c (m4_macro_expand_input, expand_token)
3480 (expand_argument): Adjust callers so that line is passed from
3482 * m4/output.c (output_text): Rename...
3483 (m4_output_text): ...to this, and export.
3484 (m4_insert_file, insert_diversion_helper): Update callers.
3485 (m4_shipout_text): Take new parameter for start line of token.
3486 Output at most one syncline per token.
3487 Reported by Sergey Poznyakoff.
3489 Fix large diversion corner cases.
3490 * tests/freeze.at (large diversion): New test.
3491 * m4/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
3492 (make_room_for): Use NULL, not 0, for pointers.
3493 (m4_freeze_diversions): Allow freezing large diversions.
3494 (insert_diversion_helper): Avoid using rewind.
3496 Also run gnulib unit tests during make check.
3497 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
3498 --tests-base=tests/gnu --with-tests'.
3499 * configure.ac (AC_CONFIG_FILES): Build tests/gnu testdir.
3500 * Makefile.am (SUBDIRS): Run gnulib tests before ours.
3502 2007-05-25 Eric Blake <ebb9@byu.net>
3504 * m4/system_.h: Include <stdint.h>, for intmax_t.
3506 Reported by Daniel Richard G.
3508 2007-05-24 Eric Blake <ebb9@byu.net>
3510 Provide consistent shift semantics regardless of hardware.
3511 * modules/m4.c (numb_lshift, numb_rshift, numb_urshift): Mask
3513 (number, unumber): Always use [u]intmax_t.
3514 Reported by Gary V. Vaughan.
3516 Support POSIX flush semantics on all platforms.
3517 * modules/m4.c (m4_sysval_flush): Rely on gnulib.
3518 * ltdl/m4/gnulib-cache.m4: Fix typo in previous commit.
3520 Work around cygwin and mingw fseeko bugs.
3521 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3523 * modules/m4.c (m4_sysval_flush): Prefer fseeko over fseek.
3525 2007-04-25 Eric Blake <ebb9@byu.net>
3527 Test that regression in 1.4.9's eval doesn't recur.
3528 * doc/m4.texinfo (Eval): Check negative division.
3531 2007-04-12 Eric Blake <ebb9@byu.net>
3533 Allow for running test in sticky or setgid directory.
3534 * tests/builtins.at (mkdtemp): Adjust test.
3536 Don't test for broken sed too soon.
3537 * tests/others.at (stdin seekable): Rearrange subtests.
3539 Work around 'stdin seekable' shortcoming on glibc.
3540 * ltdl/m4/gnulib-cache.m4: Use closein instead of closeout.
3541 * tests/others.at (stdin closed): Adjust to new output.
3542 * src/main.c (process_file): No need to return anything.
3543 (main): Use close_stdin instead of close_stdout.
3544 Reported by Ralf Wildenhues.
3546 Enable autobuild usage.
3547 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3549 * configure.ac (AB_INIT): Output autobuild information.
3551 2007-04-11 Eric Blake <ebb9@byu.net>
3553 Address testsuite shortcoming in 'stdout full' on glibc.
3554 * tests/others.at (stdout full): Adjust expected output when more
3555 than 1k text is printed to /dev/full.
3556 Reported by Ralf Wildenhues.
3558 2007-04-10 Eric Blake <ebb9@byu.net>
3560 * tests/macros.at (Arity and defn): Fix quoting.
3562 2007-04-09 Eric Blake <ebb9@byu.net>
3564 Address failure of 'seekable stdin' on Mac OS X.
3565 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3568 2007-04-07 Eric Blake <ebb9@byu.net>
3570 Include <config.h> first in all C files, and not in headers.
3571 Fixes regression for --disable-assert builds from 2007-04-02.
3572 * src/m4.h (includes): Don't include config.h here.
3573 * m4/m4private.h (includes): Likewise.
3574 * m4/builtin.c: Include config.h before anything else.
3575 * m4/debug.c: Likewise.
3576 * m4/hash.c: Likewise.
3577 * m4/input.c: Likewise.
3578 * m4/m4.c: Likewise.
3579 * m4/macro.c: Likewise.
3580 * m4/module.c: Likewise.
3581 * m4/symtab.c: Likewise.
3582 * m4/syntax.c: Likewise.
3583 * m4/utility.c: Likewise.
3584 * src/freeze.c: Likewise.
3585 * src/stackovf.c: Likewise.
3587 2007-04-03 Eric Blake <ebb9@byu.net>
3589 * modules/m4.c (numb_ratio, numb_divide, numb_modulo): Avoid
3590 SIGFPE on x86 architectures.
3591 Reported by Ralf Wildenhues.
3593 2007-04-02 Eric Blake <ebb9@byu.net>
3595 Fix warnings from last commit.
3596 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3597 fprintf-posix sprintf-posix'.
3598 * m4/macro.c (expand_macro, trace_format): Use correct specifier
3600 (process_macro): Avoid negative array index.
3601 * src/freeze.c (produce_resyntax_dump, produce_module_dump)
3602 (dump_symbol_CB, produce_frozen_state): Use correct specifier for
3605 2007-04-02 Gary V. Vaughan <gary@gnu.org>
3607 Get rid of the last 'differs in signedness' compiler warnings:
3609 * m4/macro.c (process_macro): m4_get_symbol_value_text() returns
3610 a regular 'char *', so variables to store the return address,
3611 and iterate through it should be regular 'char *' too.
3612 * m4/input.c (m4_input_block): The start and current members of
3613 the string part of this union store regular 'char *' types, so
3614 they should be regular 'char *' types too.
3616 2007-04-02 Gary V. Vaughan <gary@gnu.org>
3618 M4 was designed to have a small number of header files defining
3619 the interfaces to several source files each. Keeping this in
3620 mind allows us to tidy things up considerably. Having done this,
3621 it becomes clear that some of the installed headers reference
3622 other headers which are not installed (but that's another patch):
3624 * m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from
3626 * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
3627 ...to here, so client modules can benefit too.
3628 (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
3629 lowest level to save doing it multiple times elsewhere.
3630 * m4/debug.c (stdio.h): Removed. The portable <gnu/stdio--.h>
3631 is already included via m4private.h.
3632 * modules/time.c (stdio.h): Ditto.
3633 * modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>.
3634 * modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h>
3635 and <gnu/unistd--.h>,
3636 * m4/m4private.h (m4module.h): Use angle brackets for an installed
3638 * m4/hash.h (system.h): Ditto.
3639 * modules/gnu.c (progname.h): Removed.
3640 * src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h.
3641 * m4/m4private.h (assert.h, errno.h): Already included via
3643 * m4/input.c (ctype.h): Ditto.
3644 * m4/module.c (ltdl.h): Ditto.
3645 * m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h)
3647 * m4/path.c (config.h, stdlib.h): Ditto.
3648 * m4/utility.c (config.h): Ditto.
3649 * modules/evalparse.c (assert.h, ctype.h): Ditto.
3650 * modules/gnu.c (assert.h, ctype.h, errno.h): Ditto.
3651 * modules/import.c (assert.h): Ditto.
3652 * modules/m4.c (assert.h, errno.h): Ditto.
3653 * modules/modtest.c (assert.h): Ditto.
3654 * modules/stdlib.c (sys/types.h): DittAo.
3655 * src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h):
3657 * src/stackovf.c (assert.h): Ditto.
3658 * modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster
3659 private interfaces when NDEBUG is defined.
3660 * modules/import.c (m4/m4module.h, m4private.h): Ditto.
3661 * modules/load.c (m4/m4module.h, m4private.h): Ditto.
3662 * modules/m4.c (m4/m4module.h, m4private.h): Ditto.
3663 * modules/modtest.c (m4/m4module.h, m4private.h): Ditto.
3664 * modules/mpeval.c (m4/m4module.h, m4private.h): Ditto.
3665 * modules/perl.c (m4/m4module.h, m4private.h): Ditto.
3666 * modules/shadow.c (m4/m4module.h, m4private.h): Ditto.
3667 * modules/time.c (m4/m4module.h, m4private.h): Ditto.
3668 * modules/traditional.c (m4/m4module.h, m4private.h): Ditto.
3669 * src/m4.h (locale.h): Moved from here...
3670 * src/main.h: ...to here.
3671 (m4private.h): Already included via m4.h.
3672 * src/stackovf.c (m4private.h): Ditto.
3674 2007-03-28 Gary V. Vaughan <gary@gnu.org>
3676 * Makefile.am (stamp-vcl): Removed.
3677 (CONFIG_STATUS_DEPENDENCIES): Depend directly on ChangeLog.
3679 2007-03-28 Eric Blake <ebb9@byu.net>
3681 * src/main.c (usage): Improve note to TRANSLATORS.
3682 * m4/system_.h (EXIT_FAILURE): Reflect gnulib changes.
3684 * tests/builtins.at (__m4_version__): Fix bug when TIMESTAMP is
3687 2007-03-24 Eric Blake <ebb9@byu.net>
3689 * m4/output.c (m4_output_init): Update to latest gnulib.
3690 * bootstrap (ltdl/m4/.cvsignore): No longer track generated
3692 * NEWS: Reflect release of 1.4.9.
3695 2007-03-07 Eric Blake <ebb9@byu.net>
3699 Exercise gnulib's new POSIX *printf modules.
3700 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3702 * modules/format.c (format): Support %a and %A.
3703 * doc/m4.texinfo (Format): Test this addition.
3704 * NEWS: Document this addition.
3706 2007-03-03 Eric Blake <ebb9@byu.net>
3708 * m4/input.c (m4__next_token): Fix synclines when in batch mode.
3709 * doc/m4.texinfo (M4exit): Synch another section.
3710 (Syncoutput): Make similar to other sections.
3712 2007-03-01 Eric Blake <ebb9@byu.net>
3714 * doc/m4.texinfo: Improve the indices.
3715 (Concept index): Rearrange to be last.
3716 (Sysval): Merge from branch.
3718 * doc/m4.texinfo (Syscmd, Esyscmd): Merge more doc sections.
3720 2007-02-28 Eric Blake <ebb9@byu.net>
3722 POSIX XCU ERN 137 was approved.
3723 * modules/mpeval.c (numb_extension): Delete.
3724 * modules/m4.c (numb_extension): Likewise.
3725 * modules/evalparse.c (comma_term, condition_term): Always
3726 implement ?: and , operators.
3727 * m4/symtab.c: Update comment to match reality.
3728 * src/freeze.c (produce_frozen_state, reload_frozen_state): Avoid
3729 dereferencing context directly when accessor exists.
3730 * src/main.c (usage): Prefer GNU_M4 over EMACS.
3731 (struct macro_definition): Rename...
3732 (struct deferred): ...to match usage. All uses changed.
3733 * doc/m4.texinfo (Eval): Document this change.
3734 (Operation modes, Changeresyntax): Fix wording to prefer GNU_M4
3736 (Preprocessor features, Changesyntax): Fix inaccuracies.
3737 * NEWS: Import branch NEWS items for 1.4.x series. Document
3740 POSIX XCU ERN 118 was approved.
3741 * modules/m4.c (define): Kill posixly_correct distinction in
3742 define behavior, since POSIX says GNU behavior complies.
3743 * tests/builtins.at (define): Restore original semantics.
3744 * doc/m4.texinfo (Pushdef): Document portability issues with
3746 (Incompatibilities): Clean up wording of what POSIX requires.
3747 * NEWS: Document this.
3749 2007-02-26 Eric Blake <ebb9@byu.net>
3751 Re-enable clean bootstrap on cygwin.
3752 * Makefile.am (AM_LDFLAGS): For now, export all symbols from
3753 modules, since otherwise we run afoul of current libtool
3754 limitations on cygwin and mingw.
3756 2007-02-25 M. Levinson <levinsm@users.sourceforge.net> (tiny change)
3758 * src/freeze.c (reload_frozen_state): Avoid dereferencing freed
3759 memory. Fixes regression introduced 2007-01-20.
3761 2007-02-25 Eric Blake <ebb9@byu.net>
3763 * tests/freeze.at (loading format 2): Augment test to catch
3764 regression introduced on 2007-01-20.
3766 Reported by M. Levinson.
3768 * m4/system_.h (includes, EXIT_SUCCESS, EXIT_FAILURE): Adjust to
3771 2007-02-05 Eric Blake <ebb9@byu.net>
3773 * tests/options.at (--fatal-warnings): New test.
3774 * tests/others.at (stdin seekable): Exit on error.
3775 * m4/m4private.h (M4_OPT_WARN_EXIT_BIT): New bit.
3776 (m4_get_warnings_exit_opt): Access it.
3777 * m4/m4module.h (m4_context_opt_bit_table): Access it.
3778 * m4/utility.c (m4_error, m4_error_at_line): Only force an exit
3780 (m4_warn, m4_warn_at_line): Change exit status on -E, and force
3782 * src/m4.c (usage): Document new -E behavior.
3783 (main): Make -E an additive option.
3784 * doc/m4.texinfo (Operation modes): Document the change.
3785 Reported by Ralf Wildenhues.
3787 * tests/others.at (stdin seekable): Fix bug in test.
3788 * ltdl/m4/gnulib-cache.m4: Gnulib module strstr no longer exists.
3790 * m4/input.c (struct m4_input_block): Remove unused field traced.
3792 2007-02-03 Eric Blake <ebb9@byu.net>
3793 and Bruno Haible <bruno@clisp.org> (tiny change)
3795 * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
3797 Reported by Bruno Haible.
3799 2007-01-31 Eric Blake <ebb9@byu.net>
3801 * m4/resyntax.c (m4_regexp_syntax_encode): Detect allocation
3804 2007-01-26 Eric Blake <ebb9@byu.net>
3806 * m4/symtab.c (includes): Adjust to latest gnulib.
3807 * modules/m4.c (includes): Likewise.
3809 2007-01-23 Eric Blake <ebb9@byu.net>
3811 * m4/m4module.h (M4_SYNTAX_ASSIGN): Delete this unused
3812 extension to make enough room.
3813 (M4_SYNTAX_IGNORE): Change value to zero, since the (commented)
3814 code in input.c special cases this category.
3815 (M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): New values in preparation
3816 for define(eleventh,${11}) extension.
3817 * m4/syntax.c: Update comments accordingly.
3818 (m4_syntax_create, m4_syntax_code): Handle { and }.
3819 * m4/input.c (m4__next_token): Likewise.
3820 * src/freeze.c (produce_frozen_state): Support new categories.
3821 (reload_frozen_state): When loading version 1, disable syntax
3822 features not present in 1.4.x.
3823 * tests/freeze.at: Sort and rename existing tests.
3824 (loading format 1): Ensure we don't break v1 frozen files that
3826 (loading format 2, reloading changecom, reloading changesyntax):
3828 * doc/m4.texinfo (Changesyntax, Frozen file format 1): Document
3829 the new syntax categories.
3830 (Arguments): Update the FIXME comment.
3831 (M4wrap): Merge examples from branch, before worrying about fixing
3832 m4wrap to obey POSIX.
3833 (Using frozen files): Start merging from branch.
3836 2007-01-20 Eric Blake <ebb9@byu.net>
3838 * src/freeze.c (produce_char_dump): Delete. Replace with...
3839 (produce_mem_dump): ...this new function, to encode more strings.
3840 Also make the coding easier to read and slightly more compact.
3841 (produce_syntax_dump): Only dump non-default syntax codes.
3842 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
3843 Encode non-ASCII characters in user-supplied strings.
3844 (GET_STRING): Accept escape sequences in version 2.
3845 * NEWS: Document this change.
3848 2007-01-16 Eric Blake <ebb9@byu.net>
3850 Port patch from branch for stack overflow detection on BSD/OS.
3851 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Check for stack_t.ss_sp.
3852 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
3853 ! HAVE_STACK_T_SS_SP]: Use this check.
3854 Reported by Chris McGuire.
3856 2007-01-15 Eric Blake <ebb9@byu.net>
3858 * tests/builtins.at (__m4_version__): New test.
3859 * modules/traditional.c (m4_macro_table): Provide windows and os2
3860 macros, as appropriate. Add __traditional__ macro.
3861 * modules/mpeval.c (m4_macro_table): Name the macro __mpeval__,
3862 not __gmp__, to match module name.
3863 * modules/load.c (m4_macro_table): Name the macro __load__, not
3864 __modules__, to match module name.
3865 * doc/m4.texinfo (History, Shell commands, Platform macros): Merge
3867 (Standard Modules): Improve wording.
3868 (Incompatibilities): Move platform macros into their own node.
3869 (Load, Unload): Use actual examples.
3870 * NEWS: Document this change.
3873 2007-01-13 Eric Blake <ebb9@byu.net>
3875 * doc/m4.texinfo (Mpeval): Add tests.
3876 * tests/testsuite.at (AT_CHECK_GMP): New filter, factored from...
3877 * tests/builtins.at (gmp): ...here. Rename test to...
3879 * tests/generate.awk (new_test): Filter out mpeval tests when gmp
3881 * m4/m4module.h (m4_get_no_gnu_extensions_opt): Merge
3882 no_gnu_extensions with posixly_correct_opt, since they were set in
3884 * m4/m4private.h (struct m4): Remove no_gnu_extensions.
3885 * src/main.c (main): Update caller.
3886 * src/freeze.c (reload_frozen_state): Likewise.
3887 * modules/m4.c (m4wrap): Likewise.
3889 2007-01-12 Eric Blake <ebb9@byu.net>
3891 * m4/syntax.c (m4_set_comment): XCU ERN 131 was approved by
3892 POSIX, so update the comment.
3893 * doc/m4.texinfo (Inhibiting Invocation): XCU ERN 130 was
3894 approved by POSIX, so we can always have blind macros, even when
3896 (Ifelse): Mention the term `blind builtin'.
3898 2007-01-08 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3900 * doc/m4.texinfo: Fix a couple of typos.
3902 2007-01-08 Eric Blake <ebb9@byu.net>
3904 * ltdl/m4/gnulib-cache.m4: Update for new year.
3905 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Cover all error cases.
3906 Reported by Ralf Wildenhues.
3908 2007-01-06 Eric Blake <ebb9@byu.net>
3910 * m4/m4private.h (to_uchar): Move...
3911 * m4/m4module.h: here, so modules can use it.
3912 * src/main.c (usage, long_options): Support --posix as a synonym
3914 * modules/m4.c (numb_invert): Detect unsupported x**-y.
3915 (numb_incr, numb_urshift, numb_extension): New macros.
3916 (numb_obstack): Port patch from branch to support radix 1 output.
3917 * modules/mpeval.c (numb_obstack): Use \ for ratios.
3918 (numb_incr, numb_urshift, numb_extension): New macros.
3919 (mpq2mpz): Warn rather than error.
3920 * modules/evalparse.c (URSHIFT, NEGATIVE_EXPONENT): New
3922 (eval_error): Rearrange, so that all ignorable errors are less
3924 (eval_text, last_text): Obey C++ type safety rules.
3925 (numb_pow): Change return type.
3926 (exp_term): Adjust caller.
3927 (m4_evaluate): Fail on bad exponent.
3928 (logical_or_term, logical_and_term): Ignore failed ** in short
3930 (eval_lex): Fix typos when detecting <<= and >>=. Use \ instead
3931 of : for ratio. Support >>>, ,, and ?:. Port patch from branch
3932 to parse radix 1 numbers.
3933 (condition_term, comma_term): New parse functions.
3934 (shift_term): Support >>>.
3935 (m4_evaluate): Port patch from branch to output radix 1 numbers.
3936 Warn instead of error for most parse problems.
3937 * doc/m4.texinfo (Limits control, Eval): Document these changes.
3938 * NEWS: Document new operators and new command line option.
3940 2007-01-04 Eric Blake <ebb9@byu.net>
3942 * configure.ac (AC_SYS_LARGEFILE): Guarantee large file support.
3944 2007-01-03 Eric Blake <ebb9@byu.net>
3946 * doc/m4.texinfo (Format, Incr): More merges.
3947 (Eval): Ensure C precedence rules are met.
3948 * modules/evalparse.c (BADOP, INVALID_OPERATOR): New enumerators.
3949 (not_term, logical_not_term): Delete; these are same precedence
3950 as other unary operators.
3951 (equality_term): New; these are lower precedence than relational
3953 (eval_lex, simple_term, m4_evaluate): Recognize forbidden C
3954 operators for better error messages.
3955 (logical_or_term, logical_and_term): Short-circuit out the error
3956 of division by zero.
3957 (unary_term): Allow consecutive unary operators.
3958 * modules/m4.c (int2numb, numb2int): Delete; these potentially
3960 (numb_not, numb_eor, numb_ior, numb_and): Update callers.
3961 * modules/mpeval.c (reduce1, reduce2): Protect macros better.
3962 * NEWS: Document this change.
3964 2006-12-27 Eric Blake <ebb9@byu.net>
3966 * doc/m4.texinfo (Substr, Patsubst): Merge more sections from the
3968 * modules/m4.c (substr): Merge from branch.
3970 2006-12-26 Eric Blake <ebb9@byu.net>
3972 * doc/m4.texinfo (Changesyntax): Check for regressions with
3973 changesyntax(W=...).
3975 2006-12-22 Eric Blake <ebb9@byu.net>
3977 * m4/m4module.h (m4_set_syntax): Change signature.
3978 * modules/gnu.c (m4_resyntax_encode_safe): Reduce error to
3980 (changesyntax): Likewise, and update caller.
3981 * m4/m4private.h (m4_syntax_table): Add orig member.
3982 * m4/syntax.c (m4_set_quotes, m4_set_comment): Merge from branch.
3983 Don't set is_single_quotes and is_single_comments when the begin
3984 character is shadowed by another syntax type.
3985 (m4_syntax_create): Populate default syntax table.
3986 (add_syntax_attribute): Don't lose quote assignment.
3987 (remove_syntax_attribute): Only allow removing rquote or ecomm.
3988 (add_syntax_set, subtract_syntax_set, set_syntax_set)
3989 (reset_syntax_set): New helper routines.
3990 (m4_set_syntax): Alter semantics - NUL key reverts entire syntax
3991 to default, and empty chars reverts that key to default.
3992 (check_is_single_quotes, check_is_single_comments): New helper
3994 * modules/m4.c (changecom): Merge from branch.
3995 * m4/input.c (m4__next_token): Rearrange token recognition order
3996 to macro, quote, comment, in order to match traditional
3998 * src/freeze.c (reload_frozen_state): Update caller.
3999 * doc/m4.texinfo (Changequote, Changecom): Merge from branch, with
4001 (Changeresyntax): Revise to match style of surrounding sections
4002 and add more examples.
4003 (Changesyntax): Likewise, and update to new semantics.
4004 * NEWS: Document this change.
4006 * doc/m4.texinfo (Operation modes): Avoid underfull hbox.
4007 (M4wrap, Eval, Errprint): Fix typos.
4008 (Divnum): Not necessary to redivert in example.
4010 2006-12-21 Eric Blake <ebb9@byu.net>
4012 * doc/m4.texinfo (Len, Index macro, Regexp): More section merging
4015 2006-12-19 Eric Blake <ebb9@byu.net>
4017 * modules/m4.h (m4_sysval_flush_func): Adjust prototype.
4018 * modules/m4.c (m4_sysval_flush): Add parameter, so that m4exit
4019 can track write errors without all other callers warning multiple
4021 (sysval_flush_helper): New function.
4022 (dumpdef, syscmd, errprint, m4exit): Adjust callers.
4023 * modules/gnu.c (esyscmd): Likewise.
4024 * tests/others.at (stdout closed, stdout full): Error message
4027 2006-12-16 Eric Blake <ebb9@byu.net>
4029 * src/main.c: Fix missing include.
4031 * src/main.c (main): Check for errors when closing stdin.
4032 * modules/m4.c (m4exit): Missed part of previous patch: flush
4033 stdin before a successful exit.
4034 Reported by Ralf Wildenhues.
4036 2006-12-14 Eric Blake <ebb9@byu.net>
4038 * modules/m4.c (m4_sysval_flush): Flush stdin before exiting, as
4040 * tests/others.at (stdin seekable): New test.
4042 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4044 * doc/m4.texinfo: Fix some typos.
4046 2006-12-04 Eric Blake <ebb9@byu.net>
4048 * doc/m4.texinfo (Undivert, Divnum, Cleardivert): Merge more doc
4050 (Modules): Make style consistent.
4052 2006-11-16 Eric Blake <ebb9@byu.net>
4054 * bootstrap: Relax m4 requirement, thanks to...
4055 * configure.ac (Gettext support): ...this workaround to the 1.4.4
4056 bug. Undoes restriction added on 2006-11-09.
4058 * tests/builtins.at (esyscmd, syscmd): Redo, since spilled
4059 diversions are now closed when not active.
4060 (divert): Remove check now in the manual.
4061 * tests/others.at (stderr closed): Likewise.
4062 (stdout closed): Add a check.
4063 * doc/m4.texinfo (Include, Search Path, Diversions, Divert): Sync
4064 more docs with branch.
4066 2006-11-14 Eric Blake <ebb9@byu.net>
4068 Remerge sparse diversion handling from branch.
4069 * ltdl/m4/gnulib-cache.m4: Replace avltree-list with
4071 * m4/output.c (diversion_table): Change type to gl_oset_t.
4072 (m4_output_init, m4_output_exit, cleanup_tmpfile, make_room_for)
4073 (m4_make_diversion, insert_diversion_helper, m4_insert_diversion)
4074 (m4_undivert_all, m4_freeze_diversions): Adjust all callers.
4075 (div0, diversion_storage): New variables.
4076 (diversions, equal_diversion_CB): Deleted.
4077 (threshold_diversion_CB): New callback.
4078 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
4080 (m4_tmpfile): Move cloexec action here.
4082 * m4/resyntax.c (m4_regexp_syntax_encode): Avoid bug with signed
4085 2006-11-13 Eric Blake <ebb9@byu.net>
4087 Add several new command line options.
4088 * src/main.c (usage): Update.
4089 (OPTSTRING, long_options): Add --pushdef, --popdef, --gnu,
4090 --traceon, --traceoff, --syncoutput, --warnings, --unload-module.
4091 Make --regexp-syntax argument optional.
4092 (main): Support new options. Fix regression in interactive
4093 behavior from Nov 8.
4094 * m4/m4private.h (M4_OPT_SYNCOUTPUT_BIT): Rename from
4095 M4_OPT_SYNC_OUTPUT_BIT.
4096 * m4/m4module.h (m4_context_opt_bit_table): Rename sync_output to
4097 syncoutput, to match option.
4098 (m4_parse_truth_arg): New prototype.
4099 * m4/utility.c (m4_parse_truth_arg): Implement it.
4100 * m4/output.c (m4_shipout_text): Adjust sync_output caller.
4101 * modules/gnu.c (syncoutput): Adjust sync_output caller, and use
4103 * doc/m4.texinfo (Operation modes, Dynamic loading features)
4104 (Preprocessor features, Limits control, Debugging options)
4105 (Command line files): Update documentation.
4106 * tests/builtins.at (mkstemp): Simplify.
4107 * tests/macros.at (Command line pushdef): New test.
4108 (Command line define): Improve.
4109 * tests/options.at (--traceon and --traceoff, --syncoutput): New
4111 (POSIXLY_CORRECT): Likewise.
4112 (deprecated options): Augment.
4113 (--regexp-syntax): Update, now that -r takes optional arg.
4114 * NEWS: Reformat. Document new options.
4116 2006-11-11 Eric Blake <ebb9@byu.net>
4118 One step closer to allowing C++ compilation - don't blindly
4119 convert between char* and unsigned char*.
4120 * m4/m4module.h (m4_set_syntax): Change signature.
4121 * m4/m4private.h (m4_string): Use signed char.
4122 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
4123 (m4_get_syntax_ecomm): No longer a need to cast.
4124 * m4/syntax.c (m4_set_syntax, m4_syntax_create, m4_set_quotes):
4125 Reflect this change.
4126 * m4/macro.c (expand_argument): Simplify.
4127 (expand_token): Use proper type.
4128 * src/freeze.c (reload_frozen_state): Likewise.
4129 * m4/input.c (MATCH, match_input): Likewise.
4130 * modules/m4.c (translit): Likewise.
4131 * modules/gnu.c (substitute): Simplify.
4133 * m4/macro.c (trace_format): Use canonical type name.
4134 * m4/output.c (m4_freeze_diversions): Likewise.
4135 * src/freeze.c (produce_module_dump, dump_symbol_CB)
4136 (produce_frozen_state): Likewise.
4137 * m4/m4private.h (to_uchar): Grab from branch.
4138 * m4/input.c (string_peek, string_read): Use it.
4139 * m4/utility.c (skip_space): Likewise.
4140 * src/main.c (main): Likewise.
4141 * doc/m4.texinfo (Translit): Remerge from branch.
4142 * tests/builtins.at (translit): Test 8-bit range.
4143 * modules/m4.c (m4_expand_ranges): Merge from branch.
4145 2006-11-09 Eric Blake <ebb9@byu.net>
4147 * bootstrap: Validate that installed M4 is powerful enough.
4148 Reported by Gary V. Vaughan, analyzed by Stepan Kasal.
4150 2006-11-08 Eric Blake <ebb9@byu.net>
4152 Merge deferred handling of -D option from branch.
4153 * doc/m4.texinfo (Debugging options, Preprocessor features)
4154 (Dynamic loading features, Operation modes, Invoking m4):
4155 Document this change.
4156 * src/main.c (OPTSTRING): Specify in-order processing.
4157 (process_file): New function.
4158 (main): Use it to interleave files and deferred options.
4159 * tests/macros.at (Command line define): New test.
4160 * tests/generate.awk: Allow '@comment file' as first example
4162 * tests/options.at (option grouping): Update to reflect actual
4164 (file names): New test.
4166 2006-11-07 Eric Blake <ebb9@byu.net>
4168 * m4/output.c (cleanup_tmpfile, m4_insert_diversion_helper): Check
4171 * tests/builtins.at (m4exit): New test; failed on cygwin before
4173 * m4/output.c (cleanup_tmpfile): Close files before removing
4175 (make_room_for, m4_output_exit): Ensure that atexit handler
4176 invoked from m4_error sees consistent state.
4178 * doc/m4.texinfo (Errprint): Merge another doc node.
4179 * tests/builtins.at (dumpdef, errprint): New tests.
4180 * modules/m4.c (errprint): Merge from branch: flush before
4183 2006-11-02 Eric Blake <ebb9@byu.net>
4185 * bootstrap: Update bootstrap requirement wording.
4186 Reported by Bruno Haible.
4188 2006-10-31 Eric Blake <ebb9@byu.net>
4190 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
4192 * doc/m4.texinfo (Translit): Merge from branch.
4193 * modules/m4.c (divert, substr): Ignore excess arguments.
4194 (index, translit): Merge from branch.
4195 * tests/builtins.at (translit): Add a test.
4197 2006-10-30 Eric Blake <ebb9@byu.net>
4199 * m4/m4private.h (m4_get_symbol_value_module): Delete accidental
4201 * m4/symtab.c (m4_get_symbol_value_module): Likewise.
4203 * modules/m4.c (m4_make_temp): Make safe across libtool.
4204 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Avoid warnings.
4205 * configure.ac (--with-modules): Accomodate changed module
4206 location when doing './configure --enable-debug'.
4208 2006-10-28 Eric Blake <ebb9@byu.net>
4210 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
4213 2006-10-27 Eric Blake <ebb9@byu.net>
4215 * bootstrap (gnulib): No longer a need to patch after gnulib-tool
4217 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
4218 0.16, since 0.15 is incompatible with our automake requirement.
4220 * m4/macro.c (expand_argument): Fix missing initialization.
4221 * m4/m4private.h (struct m4_symbol_value): Store entire
4222 m4_builtin, not just the func.
4223 (m4_get_symbol_value_func): Update.
4224 (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
4226 * m4/m4module.h (m4_get_symbol_value_builtin)
4227 (m4_get_symbol_builtin): New prototypes.
4228 (m4_set_symbol_value_func): Delete, replace with...
4229 (m4_set_symbol_value_builtin): New function.
4230 (m4_builtin_find_by_name): Change signature.
4231 * m4/symtab.c (m4_symbol_value_print): Simplify.
4232 (m4_get_symbol_value_func): Update.
4233 (m4_get_symbol_value_builtin): New function.
4234 (m4_set_symbol_value_func): Delete, replace with...
4235 (m4_set_symbol_value_builtin): New function.
4236 (dump_symbol_CB) [DEBUG_SYM]: Simplify.
4237 * m4/builtin.c (m4_builtin_find_by_name): Change signature.
4238 * m4/input.c (struct m4_input_block): Remove unused trace member.
4239 (m4_push_builtin, builtin_print, init_builtin_token): Update
4241 * m4/module.c (install_builtin_table): Likewise.
4242 * src/freeze.c (reload_frozen_state): Likewise.
4243 * modules/gnu.c (builtin): Make it possible to retrieve a builtin
4244 token, even after the builtin has been undefined.
4245 * doc/m4.texinfo (Builtin): Document new capability.
4248 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
4250 * modules/m4.c (m4_make_temp): Use it.
4251 * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
4253 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4255 * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
4258 2006-10-26 Eric Blake <ebb9@byu.net>
4260 Silence -O2 -Wall -Wwrite-strings warnings.
4261 * m4/m4private.h (m4_symbol_value): Const-ify text.
4262 * m4/m4module.h (m4_get_symbol_value_text)
4263 (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
4264 (m4_set_symbol_value_placeholder): Likewise.
4265 * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
4267 * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
4268 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
4269 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
4271 * modules/format.c (format): Likewise.
4272 * src/main.c (main): Likewise.
4273 * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
4274 * modules/shadow.c (shadow, test): Likewise.
4275 * m4/output.c (m4_make_diversion): Don't hold on to empty
4277 (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
4278 (m4_freeze_diversions): Likewise. Don't use uninitialized
4281 Convert diversions to list instead of sparse array, part 2.
4282 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
4284 * m4/output.c (m4_diversion): Add next pointer and divnum members.
4285 (diversion_table): Convert to a list instead of a sparse array.
4286 (free_list): Maintain free list of reclaimed diversions.
4287 (equal_diversion_CB, cmp_diversion_CB): New functions.
4288 (m4_output_init): Set up list.
4289 (m4_output_exit): Tear down list.
4290 (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
4292 (m4_make_diversion): Change creation of new diversions.
4293 (m4_insert_diversion_helper): New function, to avoid list
4295 * tests/builtins.at (divert): The test now passes.
4296 * NEWS: Document this improvement.
4298 Convert diversions to list instead of sparse array, part 1.
4299 * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
4301 * m4/output.c (diversion, total_buffer_size, output_unused):
4302 Track size in size_t. All users changed.
4303 (struct diversion): Reduce size now, to compensate for part 2.
4304 (m4_make_diversion, make_room_for): Avoid malloc overflow.
4305 (m4_output_exit): Fix typo in assert.
4306 (m4_output_init, make_room_for, m4_make_diversion)
4307 (m4_insert_diversion, m4_freeze_diversions): Adjust users of
4308 struct m4_diversion to disambiguate the new union.
4309 * tests/builtins.at (divert): Detect this failure.
4311 2006-10-25 Eric Blake <ebb9@byu.net>
4313 * m4/m4module.h (m4_push_builtin): Add parameter.
4314 * modules/m4.c (defn): Update caller.
4315 * m4/input.c (file_read_init, string_read_init): No longer
4317 (input_funcs): Change signature of read_func, all callers
4319 (composite_peek, composite_read, composite_unget),
4320 (composite_print, composite_funcs): New input type. Not yet
4321 fully utilized, but one step closer to fixing defn.
4322 (m4_input_block): Make every input block track current file and
4323 line. Rename some members. Remove unused out_line. Add support
4324 for composite input block.
4325 (input_change): New flag.
4326 (file_peek, file_read, file_clean, file_unget, file_print):
4328 (m4_push_file, m4_push_builtin, m4_push_string_init)
4329 (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
4330 (m4_skip_line, pop_input): Track input block changes.
4331 (m4_pop_wrapup): Avoid overflow.
4332 (init_builtin_token): Handle composite input.
4333 (next_char): Handle input block changes.
4334 * doc/m4.texinfo (Location): Remerge from branch.
4336 * src/m4.h (includes): Need <locale.h> after all; fixes
4337 regression from yesterday.
4339 * m4/system_.h (obstack_regrow): New macro. Hopefully glibc will
4341 * m4/macro.c (expand_macro): Avoid referencing invalid memory.
4342 Handle nesting the argc obstack.
4343 (expand_token): Avoid unnecessary malloc.
4344 (collect_arguments): Copy name before invalidating it.
4345 (argc_stack, argv_stack): New variables.
4346 (m4_macro_expand_input): Initialize argc and argv stacks once per
4347 file, instead of once per macro.
4349 2006-10-24 Eric Blake <ebb9@byu.net>
4351 * src/m4.h (includes): Add gettext.h, for N_. Assume setlocale.
4353 2006-10-23 Eric Blake <ebb9@byu.net>
4355 * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
4356 from branch regarding stripped leading whitespace.
4358 * modules/m4.c (includes): Use safe headers even when configured
4359 with --enable-assert.
4360 (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
4361 #defined as mkstemp_safer.
4363 2006-10-21 Eric Blake <ebb9@byu.net>
4365 * modules/m4.c (m4_make_temp): Change signature.
4366 (maketemp, mkstemp): Update callers.
4367 * modules/m4.h (m4_make_temp_func): New export.
4368 * modules/gnu.c (mkdtemp): New macro.
4369 * doc/m4.texinfo (Operation modes): Document interaction with
4371 (Mkdtemp): New node.
4372 * tests/builtins.at (mkdtemp): New test.
4373 (mkstemp): Check for umask effect.
4374 * NEWS: Document new builtin.
4376 * tests/generate.awk (normalize): Update recognition of trailing
4378 * doc/m4.texinfo: Minor formatting fixes from branch.
4379 (Foreach, Improved foreach): Merge from branch.
4380 * examples/foreach.m4: Merge from branch.
4381 * examples/foreachq.m4: New file from branch.
4382 * examples/foreach2.m4: Likewise.
4383 * examples/foreachq2.m4: Likewise.
4385 * doc/m4.texinfo (titlepage): Add myself as author.
4386 * src/main.c (AUTHORS): Likewise.
4388 2006-10-19 Eric Blake <ebb9@byu.net>
4390 * modules/m4.c (m4_make_temp, mkstemp): New functions.
4391 (maketemp): Add POSIX behavior and a warning.
4392 * tests/others.at (maketemp): Move this test...
4393 * tests/builtins.at (mkstemp): ...to here, and beef up.
4394 * tests/options.at (--safer): Update to new warning message.
4395 * doc/m4.texinfo (Mkstemp): Sync from branch.
4396 (Extensions): Update maketemp behavior.
4397 * NEWS: Document that maketemp now always warns.
4399 * tests/generate.awk: For ease of doc-writing, simplify selection
4400 of '-Ipath/to/examples' to '@comment examples'.
4401 * examples/forloop.m4: Simplify.
4402 * examples/forloop2.m4: New file.
4403 * examples/quote.m4: New file.
4404 * doc/m4.texinfo (Improved forloop): New node.
4405 (Manual): Clarify use of examples directory.
4406 (Shift, Forloop): Resync from branch.
4407 (Include, Location): Update to new usage of examples directory.
4409 * m4/system_.h (includes): Pick up <unistd.h> before checking for
4411 (gettext_noop): Don't define here, let gettext.h do it instead.
4412 * po/POTFILES.in: Update entries to reflect gnulib imports.
4414 2006-10-16 Eric Blake <ebb9@byu.net>
4416 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
4418 * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
4419 pkglibexecdir support.
4420 * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
4421 worry about pathconf.h, now that gnulib does it for us.
4422 (pkgmodincludedir): Simplify.
4423 (pkglibexecdir): Delete, now that automake does this.
4424 * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
4425 * src/main.c (usage): Likewise.
4426 * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
4428 * doc/m4.texinfo: Port some changes from the branch.
4429 (Invoking m4): Promote to a chapter, instead of a section of
4431 (Operation modes, Dynamic loading features, Preprocessor features)
4432 (Limits control Frozen state, Debugging options)
4433 (Command line files): Subdivide into new sections.
4434 (Cleardivert): Rename from cleardiv.
4436 2006-10-14 Eric Blake <ebb9@byu.net>
4438 * tests/others.at (stdin closed): Update to match previous patch.
4440 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
4442 Reported by Ralf Wildenhues.
4444 * modules/m4.c (undivert): Merge from branch.
4445 * doc/m4.texinfo (Improved fatal_error): Fix typo.
4446 (Improved exch): New node, copied from branch.
4447 (Improved cleardivert): Update from branch.
4450 2006-10-13 Eric Blake <ebb9@byu.net>
4452 * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
4454 * modules/gnu.c (builtin, indir): Transparently handle builtin
4456 * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
4457 * m4/input.c (m4_pop_wrapup): Display debug message when switching
4459 (m4_input_init): No need to use empty file any more.
4460 (file_print): Display correct file name.
4461 * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
4462 dereference a NULL file name.
4463 * m4/m4module.h (m4_pop_wrapup): New parameter.
4464 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
4466 * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
4467 * m4/symtab.c (m4_symbol_value_groks_macro): New method.
4468 * src/main.c (main): Adjust caller.
4469 * tests/options.at (--debugmode): Test more output from -dV.
4471 2006-10-12 Eric Blake <ebb9@byu.net>
4473 * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
4475 * m4/m4private.h (m4__next_token_is_open): New prototype.
4476 * m4/m4module.h (m4_push_single): Delete; push_string is an
4477 adequate interface, and removing support for this simplifies the
4479 (m4_push_wrapup): New parameter.
4480 (m4_is_syntax): Delete; m4_has_syntax is sufficient.
4481 (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
4482 start-quote and start-comment exclusive from other syntax
4484 * m4/syntax.c: Likewise.
4485 * m4/input.c (input_funcs): Make polymorphic without requiring
4486 clients to know whether they are located at isp. All users
4488 (file_names): New variable.
4489 (m4_input_init): Initialize it.
4490 (m4_push_file): Use it.
4491 (m4_input_exit): Free it after use.
4492 (m4__next_token): Simplify slightly.
4493 (m4__peek_token): Rename and simplify...
4494 (m4__next_token_is_open): ... to this. In particular, this
4495 allows us to avoid a double ungetc, which POSIX doesn't
4497 (struct m4_input_block, m4_push_single, single_peek, single_read):
4498 Remove support for single characters, as the input engine now
4499 guarantees we don't need it.
4500 (file_unget, string_unget, m4_input_print, unget_input):
4501 Strengthen assertions.
4502 (file_init_funcs, file_read_init): New for file reading.
4503 (string_init_funcs, string_read_init): New for wrapped text.
4504 (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
4505 Support wrapped text with locations.
4506 (m4_skip_line): Support dnl across include file boundary.
4507 (peek_char): Don't pop input when peeking.
4508 (file_peek): Peek can be called at the end of the file.
4509 (string_read): Don't read beyond string bounds.
4510 * m4/macro.c (expand_token, collect_arguments): Update callers.
4511 (expand_macro): Report errors at location of open parenthesis.
4512 (expand_token, expand_argument, process_macro): Avoid negative
4513 array dereferences with m4_has_syntax.
4514 * m4/utility.c (skip_space): Likewise.
4515 * modules/m4.c (m4wrap): Update caller.
4516 * tests/builtins.at (__file__, __line__, dnl): New tests.
4517 * tests/options.at (--debugmode): Normalize the output.
4518 * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
4519 Remerge recent changes from branch.
4520 (Improved fatal_error): New node from branch.
4522 2006-10-11 Eric Blake <ebb9@byu.net>
4524 * src/main.c (usage, long_options): Add --debugmode as an alias
4525 for --debug, to match macro name.
4526 * tests/options.at (--debugmode): Rename from --debug, and test
4528 (--discard-comments): Augment test.
4529 * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
4532 2006-10-10 Eric Blake <ebb9@byu.net>
4534 Trace improvements: debugmode(c) was always printing the last two
4535 lines paired, combine them; and show non-text expansions.
4536 * m4/macro.c (trace_prepre): Update to show what the macro will
4538 (trace_pre): No need to special-case on debugmode(c).
4539 (trace_post): Likewise. Also, show non-text expansions.
4540 (expand_macro): Update caller. Collecting arguments can change
4541 debug mode, so cache values beforehand.
4542 (trace_format): Remove support for unused %l%S%r, and fix support
4543 for %z to match gcc's attribute((printf)).
4544 (trace_header): Update caller.
4545 * m4/input.c (struct m4_input_block): Rename from input_block.
4546 (struct input_funcs): Add print_func member.
4547 (file_print, builtin_unget, builtin_print, string_print)
4548 (m4_input_print): New functions.
4549 (m4_push_string_finish): Change return type.
4550 (m4_push_file): Fix missing use of close parameter.
4551 * m4/debug.c (m4_debug_decode): Don't clear pending traces.
4552 * m4/m4module.h (m4_input_print): New prototype.
4553 * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
4554 to match behavior change.
4555 * tests/options.at (--debug): Likewise.
4556 * tests/macros.at (Propagation of traceon)
4557 (Propagation of --trace): Likewise.
4558 * tests/others.at (stderr closed, stdout closed, stdin closed):
4560 * doc/m4.texinfo (Forloop): Simplify.
4561 (Trace): Update to changed behavior.
4562 (Debugmode): Document this change.
4563 * src/main.c (usage): Likewise.
4566 2006-10-09 Eric Blake <ebb9@byu.net>
4568 * m4/path.c (m4_include_env_init): Don't alter result of getenv.
4569 Reported by Ralf Wildenhues.
4571 * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
4573 2006-10-07 Eric Blake <ebb9@byu.net>
4575 * m4/m4module.h (m4_set_exit_failure): New prototype.
4576 * m4/utility.c (m4_set_exit_failure): New function.
4577 * modules/m4.c (m4exit): Use it to avoid yet another global
4578 variable export in libm4.
4580 2006-10-06 Eric Blake <ebb9@byu.net>
4582 * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
4584 * tests/others.at (stdout closed): Fix final check.
4586 Replace uses of tmpfile with clean-temp, since tmpfile is
4587 incompatible with closeout.
4588 * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
4590 * tests/others.at (stderr closed): Likewise.
4591 * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
4592 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4594 * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
4595 (m4_tmpfile, cleanup_tmpfile): New functions.
4596 (make_room_for, m4_insert_diversion): Use clean-temp module.
4597 * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
4599 * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
4601 * m4/utility.c (m4_numeric_arg): Merge from branch.
4602 * modules/gnu.c (debuglen): New builtin.
4603 * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
4604 Rename --arglength to --debuglen.
4605 * tests/options.at (--arglength): Rename to --debuglen.
4606 (deprecated options): Augment test.
4607 * doc/m4.texinfo (Invoking m4): Document the name change.
4608 (Debugmode): Rename from Debug Levels.
4609 (Debugfile): Rename from Debug Output.
4610 (Debuglen): New node.
4611 * NEWS: Document these changes.
4613 * modules/m4.c (m4exit): Fix typo. Ensure desired exit status in
4614 case closing a module exits.
4616 * modules/m4.c (m4exit): Merge from branch.
4617 * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
4619 2006-10-05 Eric Blake <ebb9@byu.net>
4621 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4623 * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
4624 * src/main.c (main): Close stdout on exit.
4625 * m4/debug.c (set_debug_file): Check for write failure.
4626 * m4/m4.c (m4_delete): Don't mask write failure.
4627 * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
4628 macros before calling AT_CHECK.
4629 (M4_ONE_MEG_DEFN): New helper macro.
4630 * tests/others.at (stdout full): New test.
4631 (stderr closed, stdin closed, stdout closed): Augment.
4632 * tests/builtins.at (syscmd): New test.
4635 2006-10-04 Eric Blake <ebb9@byu.net>
4637 * tests/builtins.at: Alphabetize tests.
4638 * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
4639 * tests/generate.awk (new_test): Fix underquoting.
4640 * tests/others.at (maketemp): Rename from misc.
4641 (stdin closed, stdout closed, stderr closed): New tests.
4643 2006-10-03 Eric Blake <ebb9@byu.net>
4645 Avoid all global variables in modules, so that --disable-static
4647 * examples/incl.m4: New file, from branch.
4648 * Makefile.am (dist_pkgdata_DATA): Distribute it.
4649 * doc/m4.texinfo (Location): Merge this section from branch.
4650 (Include): Update the test.
4651 * tests/generate.awk (new_test): Allow for VPATH build
4652 pre-processing of expected __program__ output.
4653 * m4/m4module.h (m4_current_diversion, m4_output_current_line):
4654 Avoid global variables.
4655 (m4_context_field_table): Add current_diversion, output_line.
4656 (m4_output_init, m4_make_diversion): Add parameter.
4657 (m4_get_program_name, m4_set_program_name): New accessors.
4658 * m4/m4private.h (m4_get_current_diversion),
4659 (m4_set_current_diversion, m4_get_output_line)
4660 (m4_set_output_line): New accessors.
4661 * m4/utility.c (m4_get_program_name, m4_set_program_name): New
4663 * modules/m4.c (divnum, divert): Adjust callers.
4664 * modules/gnu.c (__program__): Likewise.
4665 * m4/output.c (m4_output_init, m4_make_diversion)
4666 (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
4667 (m4_insert_diversion): Likewise.
4668 * m4/input.c (file_clean, m4_push_file): Likewise.
4669 * src/freeze.c (reload_frozen_state): Likewise.
4670 * src/main.c (main, usage): Likewise.
4672 Partially plug memory leak when unloading gnu module.
4673 * tests/modules.at (unload gnu module): New test.
4674 * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
4675 (m4_regexp_compile): Move static storage to module visibility.
4676 * tests/options.at (--debug): Adjust to new output.
4678 2006-09-29 Eric Blake <ebb9@byu.net>
4680 Even when not the first option, --help can't have side effects.
4681 * tests/options.at (--debugfile): Detect bugs in this area.
4682 * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
4684 * src/main.c (main): Fix it by deferring debugfile change. Also,
4685 defer closing streams until after module tracing is done.
4686 * modules/gnu.c (debugfile): Make message consistent with command
4688 * doc/m4.texinfo (Invoking m4): Touch up the documentation.
4689 * NEWS: Document this fix.
4691 * modules/m4.c (dnl): Include macro name in warning message.
4692 * m4/input.c (m4_skip_line): Add parameter.
4693 * m4/m4module.h (m4_skip_line): Likewise.
4694 * src/main.c (usage): Update wording.
4695 * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
4696 issue of blind macros vs. POSIX is resolved.
4697 (Dnl): Merge another node from branch.
4699 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4701 * m4/system_.h (N_): Define.
4702 * src/main.c (main): Validate numeric arguments.
4703 (size_opt): New function, idea borrowed from coreutils.
4704 * m4/macro.c (expand_macro): -L0 implies no limit.
4705 * doc/m4.texinfo (Invoking m4): Document this change.
4707 * tests/options.at: (--arglength, --nesting-limit)
4708 (--regexp-syntax): New tests of argument validation.
4710 2006-09-28 Eric Blake <ebb9@byu.net>
4712 * tests/options.at: Alphabetize the tests.
4714 2006-09-27 Eric Blake <ebb9@byu.net>
4716 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
4717 another parameter to print module info.
4718 * m4/macro.c (trace_pre): Adjust caller.
4719 * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
4720 * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
4721 * NEWS: Document this.
4723 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4725 * m4/symtab.c (symbol_value_print): Rename to...
4726 (m4_symbol_value_print): ...this, and...
4727 (m4_symbol_print): Update to allow -L length truncation. Now
4728 truncation also affects dumpdef output and builtin names.
4729 * m4/m4private.h (nesting_limit, max_debug_argument_length):
4731 * m4/m4module.h (m4_symbol_print): Add parameter.
4732 (m4_symbol_value_print): New function.
4733 * modules/m4.c (dumpdef): Allow length truncation.
4734 * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
4736 * doc/m4.texinfo (Invoking m4): Document -l better.
4737 (Dumpdef, Debug Levels): Document the effect of -l.
4738 * NEWS: Document this change.
4740 * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
4741 (m4_expand_ranges): Ensure we aren't picking up partial object on
4743 * modules/stdlib.c (setenv): Allow extra arguments.
4744 * modules/time.c (ctime): Avoid side effect in call to
4746 * modules/gnu.c (m4_regexp_substitute): Likewise.
4747 (renamesyms): Avoid extra obstack_init.
4748 * src/freeze.c (reload_frozen_state): Remove debug comment.
4749 (produce_frozen_state): Simplify fprintf to puts where possible.
4750 * modules/modtest.c (modtest_init, modtest_finish): Likewise.
4751 * modules/import.c (import, symbol_fail, modules_fail): Likewise.
4752 * m4/macro.c (trace_flush): Likewise.
4753 * m4/debug.c (m4_debug_message_prefix): Likewise.
4754 * m4/path.c (include_dump): Likewise.
4755 * m4/module.c (module_remove): Likewise.
4756 (install_builtin_table): Simplify malloc and string
4759 2006-09-26 Eric Blake <ebb9@byu.net>
4761 * m4/m4module.h (m4_symbol_print): New prototype.
4762 (M4_DEBUG_TRACE_STACK): New enumerator.
4763 (m4_is_debug_bit): Allow use without requiring m4private.h.
4764 * m4/symtab.c (symbol_value_print, m4_symbol_print): New
4766 * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
4768 (dumpdef): Allow printing pushdef'd stacks.
4769 * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
4770 * src/main.c (usage): Document it.
4771 * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
4774 * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
4776 * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
4777 of lines during make.
4778 (AM_CPPFLAGS): Remove unneeded include path.
4779 (src_m4_CPPFLAGS): Remove redundant include path.
4780 * m4/system_.h Make preprocessor indentation consistent.
4781 (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
4783 (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
4785 (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
4786 (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
4787 (bool, true, false): Don't undefine here; stdbool takes care of
4789 * src/m4.h (includes): Assume config.h, and several standard
4791 (__CYGWIN__, WIN32): Don't define here; let system.h do it.
4792 * m4/m4private.h: Assume config.h.
4793 * m4/output.c: Likewise.
4794 * m4/path.c: Likewise.
4795 * m4/resyntax.c: Likewise.
4796 * m4/utility.c: Likewise.
4797 * modules/gnu.c: Likewise.
4798 * modules/import.c: Likewise.
4799 * modules/load.c: Likewise.
4800 * modules/m4.c: Likewise.
4801 * modules/modtest.c: Likewise.
4802 * modules/mpeval.c: Likewise.
4803 * modules/perl.c: Likewise.
4804 * modules/shadow.c: Likewise.
4805 * modules/stdlib.c: Likewise.
4806 * modules/time.c: Likewise.
4807 * modules/traditional.c: Likewise.
4809 2006-09-21 Eric Blake <ebb9@byu.net>
4811 * doc/m4.texinfo (Invoking m4): Add clarification on option
4812 processing behavior.
4813 * tests/options.at (option grouping): Test this.
4815 Reported by Mikhail Teterin.
4817 * bootstrap: Add --force option, based on idea from coreutils.
4818 * README: Document that ./bootstrap and autoreconf are for
4819 developers, and not lightly done in tarballs.
4821 2006-09-20 Eric Blake <ebb9@byu.net>
4823 * src/main.c (usage, OPTSTRING, main): Rename -e to -i. Make
4824 warnings consistent.
4825 (long_options, HASHSIZE_OPTION): Warn on -H.
4826 * doc/m4.texinfo (Invoking m4): Document this.
4827 * tests/options.at (deprecated options): Update.
4829 Change the default of interactive sessions to match sh.
4830 * src/main.c (usage): Document this.
4831 (enum interactive_choice): New enum.
4832 (main): Use it to defer decision of interactive until after
4833 argument processing.
4834 * doc/m4.texinfo (Invoking m4): Document this.
4835 * NEWS: Likewise, plus add missing mention of -b.
4836 Reported by Stepan Kasal.
4838 2006-09-19 Eric Blake <ebb9@byu.net>
4840 * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
4841 well as --error-output; the goal is to add -o/--output in some
4842 future version with semantics like gcc or autom4te.
4843 * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
4844 (Extensions): Reflect this update.
4845 (Renamesyms): Add another test.
4846 (Defn): Xfail for now, so that `make check' is happy.
4847 * NEWS: Document this change.
4848 * tests/generate.awk: Mark dynamic loading tests as such. Allow
4850 * tests/macros.at (Renamesyms collisions): New test, exposing
4851 renamesyms' coredump.
4852 * tests/options.at (--debugfile, --safer): Update to match
4855 * m4/debug.c (set_debug_file): Fix regression in -o when stdout
4856 and stderr are same file, introduced 2003-07-23.
4857 * tests/options.at (--debugfile): New test, to catch the bug.
4858 (deprecated options): Test --error-output.
4859 * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
4860 Deprecate --error-output, and replace it with --debugfile.
4861 * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
4862 Document this change.
4865 2006-09-18 Eric Blake <ebb9@byu.net>
4867 * modules/load.c (modules): Rename to...
4868 (m4modules): ...this, since it is an English word with 0
4870 * modules/gnu.c (symbols, m4symbols): Likewise.
4871 * doc/m4.texinfo (Listing Modules): Rename to...
4872 (M4modules): ...this.
4873 (Symbols): Rename to...
4874 (M4symbols): ...this.
4875 (Load, Foreach, Trace, Answers): Update to new spellings.
4876 * NEWS: Document this.
4878 * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
4879 such that without arguments, the global trace flag is changed
4880 rather than walking the table of all currently-defined macros.
4881 (set_trace_CB): No longer needed.
4882 * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
4883 (m4_set_symbol_traced): Delete.
4884 (m4_symtab_create): Nuke the nuke parameter.
4885 * m4/m4private.h (m4_get_symbol_value): Delete.
4886 * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
4887 (m4_set_symbol_name_traced): Free undefined entries that are no
4889 (symbol_destroy_CB): Update caller.
4890 * m4/m4.c (m4_create): Update caller.
4891 * src/main.c (main): Likewise.
4892 (usage): Fix typo in last commit.
4893 * doc/m4.texinfo: Minor cleanups throughout.
4894 (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
4895 more nodes from branch.
4896 (Trace): Document new semantics, and how to simulate the old.
4897 * tests/builtins.at (multiquotes): Adjust to new semantics.
4898 * NEWS: Update somewhat.
4900 2006-09-14 Eric Blake <ebb9@byu.net>
4902 Add --safer option, per debian bug 5898.
4903 * src/main.c (usage): Document new option.
4904 (SAFER_OPTION): New enumerator.
4905 (main): Set the option bit.
4906 * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
4908 * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
4909 (m4_get_safer_opt): New accessor.
4910 * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
4911 * modules/m4.c (syscmd, maketemp): Likewise.
4912 * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
4913 (Sysval, Maketemp): Add tests of this.
4914 * tests/options.at (--safer): Likewise.
4916 2006-09-13 Eric Blake <ebb9@byu.net>
4918 * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
4920 Reported by Ralf Wildenhues.
4923 * Makefile.am (check_LTLIBRARIES): Build test libraries in the
4924 tests directory, so we can be sure an installed build is not
4925 picking up uninstalled non-test libraries.
4926 (check-local, installcheck-local): Depend on test libraries.
4927 * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
4928 after file name. Fix quoting. Remove skipping the test, now
4929 that makefile guarantees test modules will exist.
4930 (Freezing modules, modules: shadow, modules: unload)
4931 (modules: trace): Always put test modules in module path.
4932 (modules: importing): Likewise, and rely on AT_CHECK_M4 for
4934 * src/main.c (usage): Document default module search path.
4935 (import_environment, frozen_file_to_read, frozen_file_to_write):
4938 * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
4939 * tests/m4.in: ...not here.
4940 Reported by Ralf Wildenhues.
4942 2006-09-08 Eric Blake <ebb9@byu.net>
4944 * bootstrap: Kill unrelated copy-n-paste code from argument
4945 parsing. Let Makefile generate testsuite.
4946 * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
4948 2006-09-07 Eric Blake <ebb9@byu.net>
4950 * m4/m4module.h (m4_peek_input): No longer export.
4951 (m4_error_at_line, m4_warn_at_line): New prototypes.
4952 (m4_is_symbol_void): New macro.
4953 (m4_push_file): Update prototype.
4954 * m4/m4private.h (m4__peek_token): New prototype.
4955 (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
4956 * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
4957 * src/main.c (main): Allow reading from stdin twice.
4958 * modules/m4.c (include): Adjust to new prototype.
4959 * m4/input.c: General comment cleanup.
4960 (file_peek, file_read, file_unget, push_file): Set end flag on
4961 EOF, so that we don't call getc twice.
4962 (push_file, file_clean): Port fix from branch to avoid closing
4964 (pop_input): Port fix from branch to avoid reading free'd memory
4965 when input ends mid-string.
4966 (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
4967 (string_peek, string_read): Always use unsigned char.
4968 (m4_skip_line): Warn when dnl cut short by EOF.
4969 (peek_input): Rename from m4_peek_input.
4970 (match_input): Update signature, to distinguish between `(' token
4971 and multi-char quote or comment beginning with `('.
4972 (m4_input_exit): Cleanup now done in m4_pop_wrapup.
4973 (m4__peek_token): New function, ported from branch.
4974 (m4__next_token): Update to new token types.
4975 * m4/macro.c (expand_token, expand_argument): Use peek_token.
4976 * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
4977 (Invoking m4): Remerge from branch.
4979 * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
4980 (check-local): and put dependency here.
4981 Reported by Ralf Wildenhues.
4983 2006-09-05 Eric Blake <ebb9@byu.net>
4985 * m4/m4module.h (m4_debug_message): New prototype.
4986 (M4_DEBUG_TRACE_MODULE): New debug bit.
4987 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
4988 (M4_DEBUG_MESSAGE2): Delete these macros.
4989 * m4/debug.c (m4_debug_message): New method.
4990 (m4_debug_decode): Add module tracing as flag `m'.
4991 * m4/input.c (m4_push_file, file_clean): Use new method.
4992 * m4/path.c (m4_path_search): Likewise.
4993 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
4994 * m4/module.c (install_builtin_table, install_macro_table)
4995 (m4__module_open, module_close, module_remove): Promote several
4996 module debug messages outside of DEBUG_MODULES.
4997 (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
4998 DEBUG_MODULES with normal trace output.
4999 * src/main.c (usage): Document new flag.
5000 * doc/m4.texinfo (Debug Levels): Likewise.
5001 * Makefile.am ($(TESTSUITE)): Add missing dependency.
5002 * tests/m4.in: Neutralize platform-dependent module filenames.
5003 * tests/options.at (--debug): Update expected output.
5005 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5007 * doc/m4.texinfo: Fix some typos.
5008 * tests/others.at: Likewise.
5010 2006-09-05 Eric Blake <ebb9@byu.net>
5012 * m4/input.c (lex_debug): Remove dead code that broke compilation
5013 with --enable-debug.
5014 * m4/module.c (install_builtin_table, install_macro_table)
5015 (m4__module_init, m4__module_open, module_close)
5016 (module_remove): Fix compilation when --enable-debug.
5017 * m4/output.c (m4_shipout_text): Likewise.
5018 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
5019 libraries when --enable-debug.
5020 * configure.ac (DYNAMIC_MODULES): New variable, to pass
5021 information to testsuite.
5022 (modules to preload): Determine modules after we know whether
5023 shared libraries are supported.
5024 * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
5026 * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
5027 * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
5028 (modules: shadow, modules: unload, modules: importing)
5029 (modules: trace): Use new macro.
5030 * tests/builtins.at (gmp): Likewise.
5032 * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
5034 (expand_token): Avoid assertion just added to docs.
5035 (expand_macro): Track pending expansions, for when a symbol's
5036 definition changes during argument collection.
5037 (m4_macro_call, process_macro): Operate on symbol value, not
5038 symbol, since symbol may have changed during argument collection.
5039 * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
5040 (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
5041 (m4_get_symbol_value): Add fast macro version.
5042 * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
5043 (m4_macro_call): Adjust prototype.
5044 * m4/module.c (install_builtin_table): Check that flags are valid
5045 when creating builtin.
5046 * m4/symtab.c (m4__symtab_remove_module_references): Use
5047 m4_symbol_value_delete, rather than inlining it.
5048 (m4_symbol_value_copy): Copy placeholder text.
5049 (symbol_popval): Use m4_symbol_value_delete.
5050 (m4_symbol_value_delete): Implementation was missing when NDEBUG.
5051 Handle pending expansions.
5052 * modules/gnu.c (indir): Update to new prototype.
5053 * doc/m4.texinfo: Fix menus to be consistent with section names.
5054 (Defn): Add test that macro tokens flatten to empty string;
5055 triggered an assert before this patch.
5056 (Ifelse): Merge another node.
5057 (Loops): Split into...
5058 (Forloop, Foreach): New nodes; work is still underway on them.
5059 (Answers): Add more info on foreach macro; work is still underway.
5060 (Indir): Add test that indir collects arguments before looking up
5062 * TODO: Update based on this patch.
5064 2006-09-01 Eric Blake <ebb9@byu.net>
5066 * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
5067 * m4/hash.h (m4_free_hash_iterator): New prototype.
5068 * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
5069 ensure we don't do unsafe things while iterating.
5070 (HASH_ITER, ITER_CHAIN): New accessor macros.
5071 (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
5072 (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
5073 (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
5074 (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
5075 to catch unsafe actions.
5076 (m4_free_hash_iterator): New function, to avoid memory leaks, and
5077 when debugging, to track safe actions.
5078 (m4_hash_apply): Avoid memory leak.
5079 * m4/symtab.c (m4_symtab_apply): Likewise.
5080 * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
5081 in manually to src/ for now.
5082 * tests/builtins.at (gmp): Add keyword module.
5083 * tests/modules.at (Freezing modules, modules: shadow)
5084 (modules: unload, modules: importing, modules: trace): Likewise.
5086 2006-08-30 Eric Blake <ebb9@byu.net>
5088 * m4/utility.c (m4_warn): Factor "Warning" out of messages into
5090 (m4_bad_argc, m4_numeric_arg): Update all callers.
5091 * m4/macro.c (m4_macro_call): Likewise.
5092 * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
5093 (Indir, Builtin, Ifdef): More doc merges.
5094 (Loops): Mention that documenting foreach would be nice.
5095 (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
5096 (Include, Eval, Location, M4exit): s/input.m4/stdin/.
5097 * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
5098 (substitute, syncoutput): Update all m4_warn callers.
5099 * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
5100 (traceon, traceoff): Make warning message consistent.
5101 (define, pushdef): Update all m4_warn callers.
5102 * tests/generate.awk: Choose file name so that documentation can
5103 show command-line behavior.
5104 * tests/builtins.at (define): Update to new wording.
5105 * tests/macros.at (pushdef/popdef): Likewise.
5106 * tests/freeze.at (loading format 1): Likewise.
5107 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
5109 * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
5111 (Defn): Add failing test case for mixing text and builtin.
5112 (Renamesyms): Improve wording, and identify core dump that needs
5115 2006-08-29 Eric Blake <ebb9@byu.net>
5117 * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
5118 (Arguments, Pseudo Arguments): More doc merges from the branch.
5119 (Macro expansion): Turn example into test.
5120 (Pseudo Arguments): Add example of avoiding argument.
5121 * modules/m4.c (undefine, popdef): Accept multiple arguments.
5122 (define, pushdef): Warn on non-text macro name.
5123 (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
5124 warning/error messages.
5125 (ifdef): Ignore extra arguments.
5126 * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
5127 (m4__symtab_remove_module_references): Check that there is no leak.
5128 * tests/macros.at (pushdef/popdef): Update to new message.
5129 * tests/builtins.at (define): Likewise.
5130 * tests/freeze.at (loading format 1): Likewise.
5131 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
5133 * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
5134 (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
5135 as accessor function, to avoid compiler warning.
5136 * m4/module.c (m4__module_open): Move declaration of variable to
5137 avoid compiler warning.
5138 * src/main.c (main): Avoid shadowing a global variable.
5139 * src/freeze.c (produce_symbol_dump): Avoid unused variable
5140 warning when NDEBUG.
5141 * tests/options.at (--discard-comments, --import-environment)
5142 (--debug, --prepend-include, --help and --version): Rename tests
5143 to name option tested.
5145 2006-08-28 Eric Blake <ebb9@byu.net>
5147 * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
5148 * m4/module.c (install_builtin_table): ...to here, and add
5149 assertion that blind macros require arguments.
5150 * m4/m4module.h (struct m4_builtin): Document restrictions that
5151 must be met during module loading.
5152 * modules/gnu.c (changeresyntax, changesyntax): These are blind,
5153 so require an argument to avoid triggering assertion.
5154 (debugfile): Tweak error message.
5156 2006-08-25 Eric Blake <ebb9@byu.net>
5158 * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
5159 (M4_BUILTIN_SIDE_EFFECT): New enumerators.
5160 (struct m4_builtin): New member flags replaces groks_macro_args,
5161 blind_if_no_args. min_args and max_args are now 0-based.
5162 Rearrange members to reduce size on platforms where function
5163 pointers are 64 bits but regular pointers are 32.
5164 (m4_bad_argc): Add argument.
5165 * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
5166 * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
5167 effect into account.
5168 * m4/module.c (install_builtin_table): Adjust all users affected
5170 * m4/macro.c (m4_macro_call): Likewise.
5171 * src/freeze.c (reload_frozen_state): Likewise.
5172 * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
5173 * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
5174 * modules/import.c (builtin_functions): Likewise.
5175 * modules/load.c (builtin_functions): Likewise.
5176 * modules/modtest.c (builtin_functions): Likewise.
5177 * modules/mpeval.c (builtin_functions): Likewise.
5178 * modules/perl.c (builtin_functions): Likewise.
5179 * modules/shadow.c (builtin_functions): Likewise.
5180 * modules/stdlib.c (builtin_functions): Likewise.
5181 * modules/time.c (builtin_functions, mktime_functions)
5182 (strftime_functions): Likewise.
5183 * doc/m4.texinfo (Loops): Update test now that shift is blind.
5184 (Macro Arguments): Fix typo in test.
5185 (Patsubst): Fix typo in test.
5186 * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
5187 end of string. Fix return value when ignore_duplicates.
5188 * tests/builtins.at (patsubst): Fix typo in test.
5190 * tests/options.at (debug-flags): Update to reflect new message.
5191 (deprecated options, prepend-include, help and version): New
5193 * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
5194 test omits an input file name.
5195 * src/main.c (long_options, main): Add -B/--prepend-include.
5196 (usage): Document it.
5197 (main): `m4 --help --version' now displays help, not version.
5198 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
5199 dirname filenamecat.
5200 * m4/m4module.h (m4_add_include_directory): Add parameter.
5201 * m4/m4private.h (m4__include_init): New prototype.
5202 * m4/m4.c (m4_create): Put `.' on path before options are
5204 * m4/path.c (includes): Assume C89. Use gnulib for file name
5206 (m4__include_init): New function.
5207 (search_path_add): Allow prepending.
5208 (m4_add_include_directory, search_path_env_init): Adjust callers.
5209 (m4_path_search): Relative names now invoke path search, since
5210 `.' might not be first.
5211 * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
5213 2006-08-25 Bruno Haible <bruno@clisp.org> (tiny change)
5214 and Eric Blake <ebb9@byu.net>
5216 * bootstrap: Run autopoint before gnulib-tool, since autopoint
5217 0.15 installs macros obsoleted by current gnulib.
5219 2006-08-25 Eric Blake <ebb9@byu.net>
5221 * doc/m4.texinfo (Macro Arguments): Another section merged;
5222 testsuite failures now exposed.
5224 2006-08-23 Eric Blake <ebb9@byu.net>
5226 * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
5227 (Input processing): More doc merges from the branch.
5228 (Regular expression syntax): Add introductory text.
5229 (Inhibiting Invocation): More doc merges from the branch.
5230 (Other tokens): Reorder after comments.
5231 * tests/generate.awk: Allow passing options to doc examples.
5233 2006-08-22 Eric Blake <ebb9@byu.net>
5235 * tests/options.at (debug-flags): New test.
5236 * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
5237 not negative, to distinguish failure in m4_debug_decode.
5238 (m4_debug_decode): Add new parameter.
5239 * modules/gnu.c (regexp): Slight cleanup.
5240 (renamesyms): Ignore excess arguments.
5241 (syncoutput): Make case-insensitive, warn on bad argument.
5242 (debugmode): Factor -+ handling out to...
5243 * m4/debug.c (m4_debug_decode): ...here.
5244 (m4_debug_message_prefix): Fix spacing.
5245 * src/main.c (main): Let -d option adjust flags.
5246 * m4/input.c (file_clean): Avoid printing empty file name.
5247 * doc/m4.texinfo (Syncoutput): Document new range of input.
5248 (Invoking m4): Document use of multiple -d flags.
5250 Start porting various fixes from the branch that use gnulib.
5251 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
5252 binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
5253 regexprops-generic stdlib-safer unlocked-io.
5254 * m4/debug.c (m4_debug_set_output): Close debug file on exec.
5255 * m4/path.c (m4_path_search): Close input file on exec, reject
5256 empty file name, fix parameter naming.
5257 * m4/output.c (make_room_for): Close diversion file on exec.
5258 (includes): Assume C89 headers.
5259 (tmpfile): For now, we don't want tmpfile-safer, because we want
5261 * m4/m4private.h (includes): Use various gnulib headers.
5262 * doc/regexprops-generic.texi: Use gnulib's copy.
5264 * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
5265 * AUTHORS: Add copyright.
5266 * ChangeLog: Likewise.
5267 * README: Likewise. Require automake 1.9b or later.
5268 * HACKING: New file.
5269 * README-alpha: Add copyright.
5270 * THANKS: Likewise. Update.
5271 * doc/STYLE: Add copyright, and tweak for changed directories.
5272 * modules/README: Add copyright, and tweak for libtool version.
5273 * examples/COPYING: New file.
5274 * examples/WWW/COPYING: Likewise.
5275 * examples/WWW/m4lib/COPYING: Likewise.
5276 * modules/shadow.m4: Add copyright.
5277 * modules/perl.m4: Likewise.
5278 * modules/modtest.m4: Likewise.
5279 * modules/stdlib.m4: Likewise.
5280 * modules/time.m4: Likewise.
5281 * modules/time2.m4: Likewise.
5282 * po/Makevars: Likewise.
5283 * tests/iso8859.m4: Likewise.
5284 * tests/m4.in: Likewise.
5285 * NEWS: Add (C) to copyright.
5287 * m4/system_.h: Likewise.
5288 * tests/atlocal.in: Likewise.
5289 * tests/builtins.at: Likewise.
5290 * tests/freeze.at: Likewise.
5291 * tests/generate.awk: Likewise.
5292 * tests/macros.at: Likewise.
5293 * tests/modules.at: Likewise.
5294 * tests/options.at: Likewise.
5295 * tests/others.at: Likewise.
5296 * tests/testsuite.at: Likewise.
5297 * m4/utility.c: Spell out copyright years.
5298 * src/main.c: Likewise.
5300 * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
5302 2006-08-21 Eric Blake <ebb9@byu.net>
5304 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
5305 * modules/gnu.c (esyscmd): Use -1 for failure. Set sysval to 0
5306 when no arguments are given, but without losing warning about 0
5308 * modules/m4.c (syscmd): Likewise.
5309 (includes): Assume C89.
5310 (m4_sysval): Make static.
5311 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
5312 (sysval): Port calculation from branch.
5314 2006-08-20 Eric Blake <ebb9@byu.net>
5316 * m4/macro.c (expand_macro): Move argument check...
5317 (m4_macro_call): ...to here, so indir will warn.
5318 * modules/gnu.c (__program__): New macro, ported from branch.
5319 (builtin): Perform argument check.
5320 (changesyntax): Avoid out-of-bounds read.
5322 * modules/gnu.c (includes): Assume stdlib.h, errno.
5323 (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
5324 (substitute): Add caller parameter, avoid out-of-bounds memory
5326 (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
5329 2006-08-16 Eric Blake <ebb9@byu.net>
5331 * po/POTFILES.in: Add more files that contain translatable
5333 * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
5334 information to translators.
5335 (USE_MSGCTXT): New var for gettext 0.15.
5336 * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
5337 debug/trace messages in lower case.
5338 * m4/macro.c (expand_argument): Likewise.
5339 * m4/path.c (m4_path_search): Likewise.
5340 * src/main.c (main): Likewise.
5342 2006-08-14 Eric Blake <ebb9@byu.net>
5344 * src/main.c (usage): Document --import-environment.
5345 * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
5347 2006-08-11 Eric Blake <ebb9@byu.net>
5349 * bootstrap (func_get_translations): Only remove files when doing
5351 (func_update_po): Avoid CDPATH problems.
5353 2006-08-10 Eric Blake <ebb9@byu.net>
5355 * bootstrap (func_get_translations): New function.
5356 (func_update_po): Borrow ideas from tar to correctly pull in
5357 translations from newer location.
5359 2006-08-09 Eric Blake <ebb9@byu.net>
5361 * bootstrap: Recent gnulib no longer has jm_* macros to worry
5363 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
5365 * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
5366 (m4_error, m4_warn): ... these new prototypes.
5367 (m4_current_file, m4_current_line): Move into context, rather
5368 than leaving as globals.
5369 (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
5370 (m4_undivert_all, m4_input_init): Now takes context.
5371 * m4/utility.c (m4_error, m4_warn): New functions.
5372 * m4/m4private.h: Assume errno exists.
5373 (struct m4): Move warning_status to a bit flag,
5374 and add exit_status. Adjust accessors accordingly.
5375 * src/main.c (print_program_name_CB): No longer needed.
5376 (main): Use new m4_get_fatal_warnings_opt.
5377 * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
5378 instead of issuing "INTERNAL ERROR". Pass context when needed,
5379 and use new accessors.
5380 * m4/input.c: Likewise.
5381 * m4/macro.c: Likewise.
5382 * m4/output.c: Likewise.
5383 * m4/utility.c: Likewise.
5384 * modules/evalparse.c: Likewise.
5385 * modules/gnu.c: Likewise.
5386 * modules/load.c: Likewise.
5387 * modules/m4.c: Likewise.
5388 * modules/mpeval.c: Likewise.
5389 * src/freeze.c: Likewise.
5390 * src/main.c: Likewise.
5391 * tests/macros.at: Adjust to new message format.
5392 * tests/builtins.at: Likewise.
5393 * tests/freeze.at: Likewise.
5394 * tests/modules.at: Likewise.
5395 * doc/m4.texinfo: Likewise.
5397 * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
5400 2006-08-03 Eric Blake <ebb9@byu.net>
5402 * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
5403 gracefully handle ENOSYS.
5407 2006-07-28 Eric Blake <ebb9@byu.net>
5409 * src/freeze.c (reload_frozen_state): Copy string when creating
5410 placeholder, to avoid memory corruption.
5411 * m4/symtab.c (symbol_popval): Avoid memory leak.
5412 (m4_symbol_rename): Avoid shadowing rename function.
5413 (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
5414 * tests/freeze.at (reloading unknown builtin): Add test.
5415 * tests/generate.awk: Capture m4.texinfo line number in
5416 testsuite.log, not just generated.at.
5418 Port idea from branch that a frozen file can request an unknown
5419 builtin without producing a warning unless the builtin is
5421 * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
5422 (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
5423 (m4_set_symbol_value_placeholder): New accessors.
5424 * m4/m4module.h (m4_is_symbol_placeholder),
5425 (m4_get_symbol_value_placeholder),
5426 (m4_set_symbol_value_placeholder),
5427 (m4_get_symbol_placeholder): Likewise.
5428 * m4/symtab.c (m4_is_symbol_value_placeholder),
5429 (m4_get_symbol_value_placeholder),
5430 (m4_set_symbol_value_placeholder): Likewise.
5431 (dump_symbol_CB): Handle new symbol type.
5432 * m4/macro.c (trace_pre): Likewise.
5433 (m4_macro_call): Warn when invoking a placeholder.
5434 * modules/m4.c (dumpdef): Handle dumping a placeholder.
5435 (defn): Warn when referencing a placeholder.
5436 * src/freeze.c (dump_symbol_CB): Ignore placeholder when
5438 (reload_frozen_state): When reloading unknown builtin, install a
5439 placeholder instead of warning.
5440 * tests/freeze.at (loading format 1): Allow warning when
5441 popdef'ing undefined function.
5443 2006-07-27 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
5445 * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
5446 function. Shift by 7, not 3, for consistency with
5447 gnulib/lib/hash.c. Don't assume hash word is 32 bits.
5449 2006-07-27 Eric Blake <ebb9@byu.net>
5451 * src/main.c (usage): Update to match branch.
5452 (main): Update --version info to distinguish between program name
5453 `m4' and package name `GNU M4'.
5454 (AUTHORS): Translate René Seindal's name.
5455 * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
5456 * Makefile.am (doc/m4.1): Update to match branch.
5457 * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
5460 * m4/system_.h (EXIT_MISMATCH): Define.
5461 * src/main.c (main): Don't clear syntax table for version 1.
5462 (usage): Document exit status.
5463 * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
5464 branch, and require V directive to appear first in file. Fix
5465 broken logic for detecting F and T in version 1 files.
5467 2006-07-22 Eric Blake <ebb9@byu.net>
5469 * src/main.c (stackovf_handler): Document the problems in our
5471 * src/stackovf.c: Forward port changes in branch to use POSIX
5472 sa_sigaction when available.
5473 (process_sigsegv): Avoid buffer overrun when error string is
5474 translated, although the fact that we translate in a signal
5475 handler is still a bug.
5476 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
5477 from branch to modernize checks.
5479 * modules/format.c (format): Avoid compiler warning that str may
5480 be used uninitialized.
5482 * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
5484 (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
5485 (DEBUG_MACRO): Remove unused macro.
5486 * src/stackovf.c: Avoid compiler warnings.
5487 * m4/input.c: Likewise.
5488 * m4/module.c: Likewise.
5489 * m4/output.c: Likewise.
5490 * m4/path.c: Likewise.
5491 * m4/symtab.c: Likewise.
5492 * m4/syntax.c: Likewise.
5494 2006-07-20 Eric Blake <ebb9@byu.net>
5496 * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
5497 Regenerate to explicitly ask for --assume-autoconf=2.60.
5499 2006-07-19 Eric Blake <ebb9@byu.net>
5501 * po/ChangeLog: Merge into main ChangeLog, then delete file.
5504 * doc/m4.texinfo (copying): Relax restriction on front-cover and
5507 2006-07-17 Eric Blake <ebb9@byu.net>
5509 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
5512 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
5514 * modules/format.c (includes): Use xvasprintf.h.
5515 (format): Make static. Avoid buffer overflow, that can lead to
5516 arbitrary code execution exploit. Only pass unsigned char to
5517 is*(). Support F, g, and G specifiers.
5518 * doc/m4.texinfo (Format): Expose buffer overrun bug. Document
5521 2006-07-17 Gary V. Vaughan <gary@gnu.org>
5523 Ensure M4 compiles correctly with -DDEBUG, and use a single
5524 consistent definition of various /DEBUG_[A-Z]+/ symbols:
5526 * m4/input.c: Have commented out out DEBUG_INPUT only by default.
5527 (m4_print_token): Use m4_get_symbol_value_text and
5528 m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
5529 and VALUE_FUNC respectively.
5530 (m4__next_token): Use m4_print_token call instead of obsolescent
5532 * m4/module.c: Have commented out out DEBUG_MODULE only by default.
5533 * m4/output.c: Similarly for DEBUG_OUTPUT.
5534 * m4/path.c: Similarly for DEBUG_INCL.
5535 * m4/symtax.c: Similarly for DEBUG_SYM.
5536 * m4/syntax.c: Similarly for DEBUG_SYNTAX.
5537 * src/stackovf.c: Similarly for DEBUG_STACKOVF.
5538 * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
5539 preprocessor macros defined with -DDEBUG compiles.
5541 2006-07-17 Gary V. Vaughan <gary@gnu.org> (tiny change)
5543 * bootstrap: Correct typo in --download-po argument parsing.
5545 2006-07-15 Eric Blake <ebb9@byu.net>
5547 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
5549 * tests/generate.awk (normalize): Recognize @tabchar.
5550 * doc/m4.texinfo (Top): Start merging from branch. Remove tabs.
5551 Fix menus. Upgrade FDL license from 1.1 to 1.2. Fix overfull
5553 (Index macro, Shell commands, Incompatiblities): Rename nodes
5554 from Index, UNIX commands, Other incompat.
5555 (Platform macros, Using frozen files, Frozen file format 1)
5556 (Frozen file format 2, Copying This Manual, Indices): New nodes.
5557 * Makefile.am (EXTRA_DIST): Distribute gendocs.
5558 (MAINTAINERCLEANFILES): Clean up files from gnulib.
5559 (doc_m4_TEXINFOS): Depend on fdl.texi.
5560 (web-manual): New maintainer target.
5562 2006-07-14 Gary V. Vaughan <gary@gnu.org>
5564 * doc/m4.texinfo (Modules): RMS asked me for an explanation of
5565 the modular architecture of M4. The result is paraphrased here
5566 for the benefit of future readers of the manual.
5568 2006-07-14 Gary V. Vaughan <gary@gnu.org> (tiny change)
5570 * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
5572 2006-07-14 Eric Blake <ebb9@byu.net>
5574 * src/main.c (main): Avoid compiler warning.
5575 * modules/gnu.c (renamesyms): Remove unused variable.
5577 2006-07-14 Gary V. Vaughan <gary@gnu.org>
5579 * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
5580 (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
5581 new functions for managing regexp syntax options.
5582 * m4/m4private.h (m4): Add regexp_syntax field.
5583 * m4/resyntax.c: New file implements the above.
5584 * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
5585 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
5586 (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
5587 (m4_patsubst_do, m4_renamesyms_do): Removed.
5588 (builtin_changeresyntax): New builtin to change regular expression
5590 (m4_resyntax_encode_safe): Factor out diagnostics code.
5591 * src/freeze.c (produce_resyntax_dump): New function to dump
5592 default regexp syntax specifier to frozen file.
5593 (reload_frozen_state): Updated to action 'R' directive.
5594 * src/main.c (usage): Describe new -r option.
5595 (long_options, OPTSTRING): Declare it.
5596 (main): Encode and store cli regexp syntax option argument.
5597 * tests/freeze.at (regexp syntax): New test that regexp syntax
5599 * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
5600 * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
5601 (Epatsubst and Patsubst): Renamed to...
5602 (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
5603 documentation and added new examples.
5604 (Changeresyntax): New section describing changeresyntax builtin,
5605 and regexp syntax names.
5606 (Regular expression syntax): New section describing differences
5607 between various regular expression syntaxes.
5608 (Frozen files): Document 'R' directive.
5611 2006-07-13 Gary V. Vaughan <gary@gnu.org>
5613 * bootstrap: Enhanced to work more like our other scripts:
5614 Add a copyright statement; support --version and --help; accept a
5615 --download-po option with argument as a substitute for DOWNLOAD_PO
5618 2006-07-11 Eric Blake <ebb9@byu.net>
5620 * Makefile.am (doc/m4.1): Port patch from branch that avoids
5622 * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
5625 2006-07-10 Gary V. Vaughan <gary@gnu.org> (tiny change)
5627 * tests/builtin.at (patsubst, regexp): Adjust these tests, now
5628 that `\0' is no longer accepted.
5630 * src/main.c (usage): Alphabetize options within their sections.
5632 * modules/gnu.c (m4_regexp_search, regsub, substitute)
5633 (esyscmd): Improve comments.
5635 * modules/gnu.c (substitute): Remove old warning for \0.
5636 (substitute_warned): No longer required. Removed.
5638 * modules/gnu.c: Put macro definitions into alphabetical order.
5640 2006-07-07 Eric Blake <ebb9@byu.net>
5642 * tests/freeze.at (loading format 1): New file, with new test.
5643 * tests/testsuite.at: Include it.
5644 * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
5645 * tests/modules.at (Freezing modules): Likewise.
5647 * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
5648 (AC_CHECK_HEADERS): Assume signal.h.
5649 (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
5650 (AC_CHECK_FUNCS_ONCE): Likewise.
5651 * src/m4.h (includes): Assume signal.h.
5653 2006-07-05 Eric Blake <ebb9@byu.net>
5655 Fix all testsuite failures on cygwin.
5656 * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
5657 branch-1_4. Solves testsuite failure when uninstalled m4 is
5658 shadowed by redefinition of PATH in libtool wrapper.
5659 * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
5660 contains the -no-undefined required by cygwin.
5661 (TESTS_ENVIRONMENT): Export abs_top_builddir.
5662 * tests/others.at (misc): Port to platforms where /etc/passwd
5663 does not exist or does not contain user named root.
5664 * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
5666 * tests/builtins.at (define, divert): Avoid overquoting.
5667 * tests/generate.awk (new_group): Likewise.
5669 2006-07-05 Gary V. Vaughan <gary@gnu.org>
5671 The regs_allocated field in a struct re_pattern_buffer refers
5672 to the state of a particular re_registers struct when used in
5673 successive matches using the same compiled pattern. Avoid a
5674 SEGV in `renamesyms' resulting from using a new re_registers
5675 with an existing re_pattern_buffer:
5677 * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
5678 pattern buffer and registers.
5679 (m4_regexp_search): New function to call re_regexp_search with
5680 correctly matched pattern buffer and register instantiations.
5681 (m4_regexp_compile): Return an m4_pattern_buffer. Adust all
5684 2006-07-04 Gary V. Vaughan <gary@gnu.org>
5686 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
5687 changes to gnulib getopt.m4 since last build.
5688 * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
5689 if the system getopt fails M4_GETOPT tests.
5691 2006-06-22 Eric Blake <ebb9@byu.net>
5693 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
5694 Reported by Bruno Haible.
5696 2006-06-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5698 * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
5700 2006-06-19 Eric Blake <ebb9@byu.net>
5704 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5706 * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
5707 (clean-local): Split into and depend upon...
5708 (clean-local-tests, clean-local-src): ...these two. The latter
5709 removes the libtool object directory below `src', to work around
5710 a buglet in Automake, failing to list it.
5711 (EXTRA_DIST): Distribute modules/perl.c.
5713 2006-06-19 Eric Blake <ebb9@byu.net>
5715 * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
5716 right side of dependency; VPATH does that.
5717 (stamp-vcl): Update to use libtool's algorithm.
5718 (EXTRA_DIST): Distribute stamp-vcl.
5719 Reported by Ralf Wildenhues.
5720 (TESTSUITE): Revert earlier change that used absolute path, as
5721 that broke 'make dist' in VPATH. Stick with $(srcdir) instead.
5722 (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
5723 (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
5724 atlocal takes care of it instead.
5725 (check-local, installcheck-local, clean-local): Inline absolute
5726 path to testsuite here, rather than relative path to testsuite
5729 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5731 * m4/m4private.h (DELETE): Cast away const here...
5732 * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
5733 * src/freeze.c (reload_frozen_state): Avoid uninitialized
5736 2006-06-19 Eric Blake <ebb9@byu.net>
5738 * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
5739 .info pages are built.
5740 Reported by Ralf Wildenhues.
5741 (EXTRA_DIST): Inline definition of testsuite, so that make dist
5744 2006-06-16 Eric Blake <ebb9@byu.net>
5746 Follow recommendations from autoconf manual for autotest.
5747 * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
5748 turn it into an absolute path until autotest provides an option
5749 that allows us to avoid changing directories. Properly quote
5751 (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
5752 (check-recursive): Delete unused target.
5753 ($(TESTSUITE)): Atomically update testsuite.
5754 (CD_TESTDIR): Simplify.
5755 (m4__cd): Delete unused macro.
5756 (check-local): Let TESTSUITEFLAGS influence the run.
5757 (installcheck-local): Let TESTSUITEFLAGS override
5758 AUTOTEST_PATH. Add dependencies.
5759 (clean-local): Clean up.
5760 (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
5761 * README: Document how to use the testsuite.
5763 2006-06-15 Eric Blake <ebb9@byu.net>
5765 * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
5767 * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
5768 clashes with m4sugar.
5769 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
5770 * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
5771 * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
5772 * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
5773 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
5774 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
5775 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
5776 * configure.ac: Likewise.
5777 (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
5778 * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
5780 * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
5782 Reduce compiler warnings. Inside GMP, mpq_t is an array type, so
5783 const mpq_t is not assignable from plain mpq_t. Avoid
5784 type-punning warnings caused trying to mix these types.
5785 * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
5786 (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
5787 * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
5788 (mult_term, exp_term): Remove type-punning casts.
5789 (numb_pow): Remove const qualifier.
5790 * src/freeze.c (reload_frozen_state): Fix typo in messages.
5791 Fix variables that can be used uninitialized, which fixes
5792 security hole where malicious frozen file can execute arbitrary
5795 2006-06-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5797 * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
5799 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5800 and Eric Blake <ebb9@byu.net>
5802 Allow `make dist' to work again.
5803 * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
5804 (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
5805 (cvs-dist): Fix typo.
5806 * NEWS: Match current version number.
5808 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5810 * Makefile.am (AM_CPPFLAGS): Add $(LTDLINCL), so the right
5813 * bootstrap: Do not run libtoolize manually, this is done
5814 correctly by autoreconf. Invoke autoreconf with --no-recursive
5815 to avoid unnecessary rerunning of autotools for libltdl.
5817 2006-06-13 Eric Blake <ebb9@byu.net>
5821 2006-06-12 Eric Blake <ebb9@byu.net>
5823 * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
5825 * src/m4.h: Don't declare mktemp.
5826 * m4/input.c (m4__next_token): Avoid bzero.
5827 * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
5828 * Makefile.am (doc/m4.1): Depend on installed help2man, rather
5829 than distributing outdated helptoman.pl.
5830 * doc/helptoman.pl: Delete.
5832 2006-06-10 Eric Blake <ebb9@byu.net>
5834 * README (Patches): Document the current dependence on CVS
5835 builds of autotools.
5836 * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
5837 * configure.ac: Use consistent quoting throughout.
5838 (AC_PREREQ): Bump to 2.59d.
5839 (AC_INIT): Package name begins with uppercase.
5840 (AC_ARG_WITH): Use AS_HELP_STRING.
5841 (AM_INIT_AUTOMAKE): Enable gnits mode.
5842 (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
5843 (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
5844 (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
5845 done by gnulib or automake, or which autoconf has declared
5847 * m4/m4private.h (Includes): Assume C89 or better, and use errno
5849 * m4/output.c (Includes): Likewise.
5850 * modules/gnu.c (Includes): Likewise.
5851 * modules/m4.c (Includes): Likewise.
5852 * src/m4.h (Includes): Likewise.
5854 * README-alpha: Update web address.
5855 * README: Likewise. Change encoding to ASCII. Remove old advice
5856 about cygwin. Document bootstrapping dependency.
5857 * AUTHORS: Update from branch-1_4.
5858 * THANKS: Likewise. Change encoding to UTF-8.
5859 * BACKLOG: Delete. This file is too old and unmaintained to be
5861 * ChangeLog: Change encoding to UTF-8.
5863 Avoid compiler warnings.
5864 * m4/macro.c (trace_format): Don't mark this as a printf format,
5865 since we don't accept the same set of modifiers as printf. It
5866 would be nice if gcc let us specify a custom format archetype.
5867 * src/main.c (main): Cast away const.
5869 2006-06-10 Andreas Schwab <schwab@suse.de> (tiny change)
5870 Eric Blake <ebb9@byu.net>
5872 * modules/time.c (ctime): Pass correctly typed variable to
5875 (localtime): Likewise.
5876 (strftime): Likewise.
5877 * m4/utility.c (m4_numeric_arg): For now, document arbitrary
5878 limit inherent in this interface.
5880 2006-05-08 Bruno Haible <bruno@clisp.org> (tiny change)
5882 * modules/m4.c (WEXITSTATUS): Provide fallback definition.
5883 (sysval): Use WEXITSTATUS.
5884 * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
5885 big-endian and little-endian wait status definitions.
5887 2006-05-06 Eric Blake <ebb9@byu.net>
5889 * po/Makevars (MSGID_BUGS_ADDRESS): Add.
5890 * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
5893 2006-05-06 Eric Blake <ebb9@byu.net>
5895 * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
5896 subdirectory to use.
5897 (support for -pipe): Move after LT_INIT, since it relies on
5900 2006-05-05 Eric Blake <ebb9@byu.net>
5902 * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
5906 2006-05-05 Bruno Haible <bruno@clisp.org>
5907 and Eric Blake <ebb9@byu.net>
5909 * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
5910 * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
5912 * bootstrap: Update usage of gnulib-tool.
5914 2006-05-04 Eric Blake <ebb9@byu.net>
5916 * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
5919 2005-12-05 Gary V. Vaughan <gary@gnu.org>
5921 * bootstrap (func_update_po): Synch with CVS GNU tar. wget 1.9.x
5922 and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
5923 Reported by Eric Blake <ebb9@byu.net>
5925 2005-12-04 Gary V. Vaughan <gary@gnu.org>
5927 * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
5928 http caching as -C is no longer supported by wget 1.10.x.
5929 Reported by Eric Blake <ebb9@byu.net>
5931 2005-10-20 Gary V. Vaughan <gary@gnu.org>
5933 * m4/module.c (caller_id): To match libtool-2.0 interface, changed
5935 (iface_id): ...an lt_dlinterface_id type.
5936 (m4__module_find): New abstraction for lt_dlhandle_fetch. Use
5937 throughout, instead of calling obsolete lt_dlhandle_find directly.
5938 (m4__module_next): Use multiloader-safe lt_dlhandle_iterate. Use
5939 throughout, instead of calling obsolete lt_dlhandle_next.
5940 * m4/m4private.h (m4__module_find): Declare it.
5941 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
5942 Use m4__module_next instead of obsolete lt_dlhandle_next.
5944 2005-10-20 Gary V. Vaughan <gary@gnu.org>
5946 * bootstrap (func_update_po): Update pofiles directly from the
5947 translation project.
5948 * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
5949 po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
5950 these files under source control anymore.
5951 Suggested by Eric Blake <ebb9@byu.net>
5953 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
5955 * ltdl/m4/m4-gnulib.m4: Update FSF contact address. Somehow this
5956 file escaped the address updates on 2005-05-01.
5958 2005-07-07 Gary V. Vaughan <gary@gnu.org>
5960 * bootstrap: Allow user overriding of gnulib-tool location, and
5961 correctly determine module source directories whether gnulib-tool
5962 is given as a relative or absolute path, or is found by searching
5964 Reported by Eric Blake <ebb9@byu.net>
5966 2005-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5968 * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
5969 and $RM are defined for various versions of
5970 AC_LIBTOOL_COMPILER_OPTION.
5972 * bootstrap (AUTORECONF): New variable to allow user overriding of
5975 2005-07-07 Gary V. Vaughan <gary@gnu.org>
5977 * doc/m4.texinfo (History): Add better notes on the ancestory of
5978 GNU m4, and other historical interest.
5980 2005-05-08 Gary V. Vaughan <gary@gnu.org>
5982 * m4/symtab.c (m4_symbol_rename): New function that performs a low
5983 level symbol rename.
5984 * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
5985 * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
5986 (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
5988 (erenamesyms, renamesyms): ...builtins that use these to implement
5989 macro renaming by regular expression.
5990 * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
5991 * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
5992 to stop the new generated tests from choking.
5994 2005-05-07 Gary V. Vaughan <gary@gnu.org>
5996 Since most of the build is handled from a single Makefile.am now,
5997 we can teach make about the dependencies between the m4 binary and
5998 the preopened modules it is built against:
6000 * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
6002 * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
6003 of the preopened modules have changed.
6005 2005-05-07 Gary V. Vaughan <gary@gnu.org>
6007 * configure.ac (gl_MODULES): Add mkstemp for machines that don't
6008 have a native implementation.
6010 2005-05-06 Gary V. Vaughan <gary@gnu.org>
6012 * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed. These are
6013 handled already by gnu/exit.h.
6015 * configure.ac (gl_MODULES): Add assert to support a
6016 --disable-assert configure time option for NDEBUG setting.
6018 * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
6019 * bootstrap (src_modules): Add version-etc-fsf.
6020 * src/main.c (version_etc_copyright): Removed.
6022 * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
6024 2005-05-04 Gary V. Vaughan <gary@gnu.org>
6026 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
6028 * src/freeze.c (produce_frozen_state): Use \n line-endings even
6029 on Windows, so that the frozen file reader will work.
6030 Reported by Josef T. Burger <bolo@bolo.com>
6032 2005-05-04 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
6034 Forward port of a patch that allowed m4-1.4.2 to compile on
6037 * configure.ac (AC_CHECK_HEADERS): Add signal.h,
6039 * src/m4.h: And include them as appropriate.
6040 * src/main.c, src/stackovf.h: Don't include signal.h literally;
6041 m4.h will include the correct file.
6043 2005-05-04 Gary V. Vaughan <gary@gnu.org>
6045 * m4/m4private.h: Make errno visible for the sources patched
6048 2005-05-04 Paul Eggert <eggert@twinsun.com>
6050 * src/main.c (print_program_name_CB): Preserve errno, since
6051 M4ERROR relies on this.
6052 * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
6053 * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
6054 * m4/path.c (m4_path_search): Don't let "free" trash errno when
6057 * m4/output.c (m4_insert_file): Don't assume errno has a valid
6058 value simply because fread returns zero. This fixes a
6059 portability bug reported by Marion Hakanson in
6060 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
6062 2005-05-04 Santiago Vila <sanvila@debian.org>
6064 * tests/stackovf.test: Use tempfile if available.
6066 2005-05-04 Robert Bihlmeyer <robbe@orcus.priv.at> (tiny change)
6068 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
6069 * m4/output.c (m4_insert_file): Do not mix buffered and
6070 unbuffered I/O, as this breaks on the Hurd.
6072 2005-05-04 Gary V. Vaughan <gary@gnu.org>
6074 Gnulib has changed again. Reimport. Adjust. Rinse. Repeat.
6075 Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
6076 and libtoolize does a better job of ltdl importing now too, so
6077 take advantage of that while updating the tree:
6079 * acm4, config: Moved from here...
6080 * ltdl/m4, ltdl/config: ...to here.
6081 * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
6082 src/Makefile.am, tests/Makefile.am: Removed...
6083 * Makefile.am: ...and migrated to here, with adjustments to
6084 compensate for relative path differences.
6085 * commit: Adjust relative paths.
6086 * configure.ac: Adjust relative paths.
6087 (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
6089 (LT_PREREQ): 2.0 isn't released yet, but will work when it is! In
6090 the meanwhile, CVS HEAD libtool is needed.
6091 (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
6092 stricly new enough, we also need a patch.
6093 (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
6094 (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
6095 (gl_MODULES): Don't list getopt and version-etc, as they don't
6097 * bootstrap: After running gnulib-tool to import the listed
6098 modules, fetch getopt and version-etc into src manually.
6099 (ltdldir): Change to ltdl.
6100 * src/main.c: Adjust for changes in version-etc API.
6101 * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
6102 but works when the getopt module isn't to be included in the lib.
6103 * README: Add note about patching autoconf and automake to
6106 2005-05-02 Matt Kraai <kraai@debian.org> (tiny change)
6108 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
6109 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
6110 empty file rather than to a nonexistent file. This closes a
6111 common security hole.
6112 * modules/m4.c (m4_maketemp): Implement the above, by using
6113 mkstemp rather than mktemp.
6115 2005-05-01 Gary V. Vaughan <gary@gnu.org>
6117 The FSF are moving offices today. Changed their contact address
6118 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
6119 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
6121 2005-03-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
6123 * tests/Makefile (clean-local): Ignore testsuite cleanup
6126 2005-03-11 Per Bothner <per@bothner.com> (tiny change)
6128 * tests/Makefile (clean-local): Only run the testsuite cleanup
6129 if the testsuite has been generated.
6131 2005-02-11 Stepan Kasal <kasal@ucw.cz>
6133 * TODO: slight clarification of the example of qindir usage.
6135 2005-02-08 Gary V. Vaughan <gary@gnu.org>
6137 * TODO: Add qindir requirement, and defn bug.
6138 From Stepan Kasal <kasal@ucw.cz>
6140 2005-02-08 Stepan Kasal <kasal@ucw.cz>
6142 * TODO: Add ``execution stack'', fix a typo.
6143 * doc/m4.texinfo: Typos.
6145 2004-12-24 Eric Blake <ebb9@byu.net>
6147 * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
6148 to the gnu subdirectory.
6149 * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
6150 * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
6151 * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
6152 * m4/system_.h: Likewise, in non-configured includes.
6154 2004-10-14 Noah Misch <noah@cs.caltech.edu>,
6155 Gary V. Vaughan <gary@gnu.org>
6157 * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
6158 Protect definitions from macro expansion under -DNDEBUG by
6159 parenthesising the expanded function names.
6160 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
6161 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
6162 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
6163 (m4_is_syntax_macro_escaped): Similarly protect function
6164 definitions from macro expansion under -DNDEBUG by #undefing the
6165 matching macro names before each definition. Also, move all the
6166 function definitions to the end of the file so that any
6167 invocations in the rest of the file pick up the fast macro
6169 * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
6170 (m4_set_debug_file, m4_set_trace_messages)
6171 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
6172 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
6173 (m4_set_max_debug_arg_length_opt): New fast macro versions of the
6174 option setter functions.
6176 2004-09-23 Gary V. Vaughan <gary@gnu.org>
6178 * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
6181 2004-09-23 Gary V. Vaughan <gary@gnu.org>
6183 * src/main.c: Include gnulib files from the correct directory.
6185 * gnulib/*: Don't store any of the gnulib files in arch, as they
6186 generate spurious changes.
6187 * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
6188 gnulib macros now share our macro directory.
6189 (SUBDIRS): Descend into `gnu' rather than `gnulib'.
6190 * bootstrap: Call gnulib-tool to import from the gnulib tree.
6191 (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
6192 gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
6193 the gettext macros from autopoint that overwrite the gnulib-tool
6194 imported versions. Import sources and Makefile.am into the `gnu'
6195 directory. Changed all callers.
6196 * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
6197 gl_INIT): Call these gnulib-tool macros instead of the hardcoded
6198 for imported modules.
6199 * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
6200 acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
6201 hardcoding the gnulib macros they wrap.
6203 2004-07-15 Gary V. Vaughan <gary@gnu.org>
6205 Latest CVS libtool can preload modules in libraries, including
6206 its own module loaders! Tweak m4 so that it doesn't try to treat
6207 libltdl's module loaders as m4 modules when freezing and on exit:
6209 * gnulib/acm4/*.m4: Don't store these files in arch since they
6210 generate spurious changes.
6211 * bootstrap: Simplify initial libtoolize call, since CVS
6212 libtoolize is smarter these days.
6213 * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
6215 * m4/module.h (m4__module_exit): Missing declaration.
6216 * m4/m4private.h (m4__module_next): New function declaration.
6217 * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
6218 encapsulation. Changed all callers.
6219 (m4__module_interface): New function to verify m4 loadable module
6221 (m4__module_init): Register the interface validator.
6222 (m4__module_exit): Only close my own modules.
6223 * modules/m4.c (unistd.h): Provide missing declaration.
6224 (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
6225 (m4_expand_ranges): More missing declarations.
6226 * modules/modtest.c (export_test): Ditto.
6227 * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
6228 * src/main.c (main): Bump copyright year.
6229 * tests/modules.at: Fix sed syntax error.
6232 2004-06-17 Gary V. Vaughan <gary@gnu.org>
6234 Tweaking to enable compilation with latest CVS libtool and
6235 libltdl. We can't just dump the library files directly into the
6236 m4 directory anymore now that libltdl is built from pieces itself:
6238 * bootstrap: Rewritten to use latest libtoolize sanely, and to
6239 set up libltdl subdirectory.
6240 * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
6241 gnulib subdirectory's config.
6242 (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
6243 (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
6245 (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
6246 configure.ac, so use AC_WITH_LTDL instead.
6247 * Makefile.am (SUBDIRS): Add libltdl.
6248 * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated. gnulib now uses
6250 * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
6251 (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
6252 (libm4_la_LIBADD): Add LIBLTDL.
6253 * m4/ltdl.c, m4/ltdl.h: Removed.
6254 * m4/m4module.h: Include canonical ltdl.h.
6257 2004-06-14 Gary V. Vaughan <gary@gnu.org>
6259 * gnulib/import: Now updates makefile fragments, and configure.ac.
6260 * gnulib/m4/gnulib.am: New file. Generated makefile fragments.
6261 * gnulib/m4/Makefile.am: include it.
6262 * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
6263 gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
6264 gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
6265 gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
6266 gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
6267 * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
6268 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
6269 gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
6270 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
6271 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
6272 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
6273 gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
6274 gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
6276 * gnulib/m4/getopt_int.h: New source file from latest gnulib
6278 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
6279 gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
6280 gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
6281 gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
6282 Updated source files from latest gnulib.
6284 2004-02-29 Gary V. Vaughan <gary@gnu.org>
6286 * config/mailnotify: New file for mailing commit notifications,
6287 imported from cvs-utils.
6288 * commit: Updated from cvs-utils and tweaked for m4.
6290 2003-12-01 Gary V. Vaughan <gary@gnu.org>
6292 * config/mkstamp: Updated from CVS libtool.
6293 * configure.ac: Generate a gnu coding standards compliant version
6294 number, and use it for the banner.
6295 * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
6296 mhen the TIMESTAMP changes in ChangeLog, but the file modification
6297 time doesn't (e.g. in cvs commit). Otherwise dist tarballs will
6298 contain the previous version number.
6299 * src/main.c: Make --version output conform to the GNU standard.
6301 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
6302 * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
6303 m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
6304 shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
6305 time_la_SOURCES): ...so that these are defaulted correctly, and
6306 can be removed from this file.
6307 (AM_LDFLAGS): Add -module...
6308 (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
6309 traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
6310 import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
6311 the individual settings can be removed.
6312 * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
6313 * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
6314 m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
6315 shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
6316 time_la_LIBADD): ...so that these are picked up as a deplib of
6317 libm4 and don't need to be set explicitly.
6319 2003-11-18 Gary V. Vaughan <gary@gnu.org>
6321 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
6322 from the standard build. It is too fragile.
6324 * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
6325 CVS libtool after merging m4 changes across to libtool.
6327 * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
6328 * m4/path.c (search_path_add): Ditto.
6330 2003-11-13 Gary V. Vaughan <gary@gnu.org>
6332 * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
6333 libtool tags we don't use in configure. This reduces the size
6334 of the script from over 1Mb to under 700Kb.
6336 2003-11-13 Gary V. Vaughan <gary@gnu.org>
6338 The import script was not written properly, and the last gnulib
6339 import was incomplete. Fixed that problem, and reimport our
6340 gnulib dependencies, which picks up the address calculation
6341 overflow checks described by Paul below. Also tweak the clients
6342 of the gnulib xalloc module not to use deprecated macros:
6344 * gnulib/import: Recurse through module dependencies rather than
6345 naively descending only one level.
6346 * configure.ac: Add calls to gnulib's strnlen and extension module
6348 * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
6350 * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
6351 gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
6352 gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
6353 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
6355 * gnulib/acm4/libtool.m4: Updated from CVS libtool.
6356 * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
6357 place of `xcalloc (1, S)'.
6358 * m4/m4.c (m4_create): Likewise.
6359 * m4/m4private.h (m4_symbol_value_create): Likewise.
6360 * m4/symtab.c (symtab_fetch): Likewise.
6361 * m4/syntax.c (m4_syntax_create): Likewise.
6362 * src/freeze.c (reload_frozen_state): Likewise.
6363 * m4/path.c (search_path_add): Eliminate use of deprecated NEW
6365 * m4/symtab.c (m4_symtab_create): Likewise.
6367 2003-11-13 Gary V. Vaughan <gary@gnu.org>
6369 * tests/module.at: Comment typo.
6371 2003-10-10 Gary V. Vaughan <gary@gnu.org>
6373 * tests/modules.at (modules: importing): Apply some lateral
6374 thinking, and use AT_CHECK to compare the output of a sed pass
6375 over stderr against the canonical strerror string.
6377 * tests/modules.at (modules: importing): Edit the generated stderr
6378 output to canonicalize strerror output, before a comparison.
6380 2003-10-10 Gary V. Vaughan <gary@gnu.org>
6382 Tru64UNIX perl is sloppy with namespace pollution. This patch is
6383 careful not to trip over the mess:
6385 * modules/perl.c: Some builds of perl install headers that contain
6386 `#define try __builtin_try'. Be sure to undefine that macro
6387 before `m4/hash.h' gets included, which uses the `try' symbol.
6388 * m4/system_.h: Similarly for `bool'. Undefine `bool', `true' and
6389 `false' before including `stdbool.h'.
6390 (DELETE): This symbol is not in m4's namespace, and is in any
6391 case only used internally...
6392 * m4/m4private.h (DELETE): ...so move it to here.
6393 Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
6395 2003-10-08 Paul Eggert <eggert@twinsun.com>
6397 Don't use XMALLOC and XCALLOC. Once we install the
6398 corresponding patch into gnulib, this will fix some
6399 address-calculation overflow bugs on hosts where calloc (A, B)
6400 returns garbage when A*B overflows.
6402 * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
6403 maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
6404 xmalloc, XCALLOC with xcalloc.
6405 * m4/m4.c (m4_create): Likewise.
6406 * m4/m4private.h (m4_symbol_value_create): Likewise.
6407 * m4/output.c (m4_output_init): Likewise.
6408 * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
6409 * m4/syntax.c (remove_syntax_attribute): Likewise.
6410 * src/freeze.c (reload_frozen_state): Likewise.
6411 * src/main.c (main): Likewise.
6413 2003-10-07 Gary V. Vaughan <gary@gnu.org>
6415 * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
6416 gnulib/acm4 directories for aclocal m4 macros.
6417 * gnulib/Makefile.am (EXTRA_DIST): Removed.
6418 (MAINTAINERCLEANFILES): Add Makefile.in.
6419 * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
6421 * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
6422 * gnulib/import: New file. Temporary script for updating gnulib
6423 imported files, until gnulib-tool is working.
6424 * gnulib/config/codeset.m4, gnulib/config/error.m4,
6425 gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
6426 gnulib/config/getopt.m4, gnulib/config/gettext.m4,
6427 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
6428 gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
6429 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
6430 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
6431 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
6432 gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
6433 gnulib/config/nls.m4, gnulib/config/obstack.m4,
6434 gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
6435 gnulib/config/progtest.m4, gnulib/config/realloc.m4,
6436 gnulib/config/regex.m4, gnulib/config/restrict.m4.
6437 gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
6438 gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
6439 gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
6440 gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
6441 gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
6442 gnulib/config/xstrndup.m4: Removed.
6443 * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
6444 gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
6445 gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
6446 gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
6447 gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
6448 gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
6449 gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
6450 gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
6451 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
6452 gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
6453 gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
6454 gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
6455 gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
6456 gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
6457 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
6458 gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
6459 gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
6460 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
6461 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
6462 gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
6463 gnulib/import script.
6464 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
6465 gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
6466 gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
6467 gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
6468 gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
6469 gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
6470 gnulib with gnulib/import script.
6471 * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
6472 guards ready for gnulib-tool to autoupdate on import.
6473 * config/debug.m4, config/gmp.m4, config/m4-error.m4,
6474 config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
6475 config/stackovf.m4: Moved from here...
6476 * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
6477 acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
6478 acm4/stackovf.m4: ...to here, to separate aclocal macros from
6479 configure time helper scripts.
6480 * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
6481 * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
6482 m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
6483 src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
6485 * src/main.c (version_etc_copyright): Only output the current
6487 (version_etc): Call with new variadic API.
6489 2003-09-16 Gary V. Vaughan <gary@gnu.org>
6491 * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
6492 version-etc module from CVS gnulib.
6493 * po/POTFILES.in: Add gnulib/m4/version-etc.c.
6494 * src/Makefile.am: Build it.
6495 * src/main.c: Use it.
6497 * gnulib/m4/exit.h: Import exit module from CVS gnulib.
6498 * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
6499 * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
6502 2003-09-15 Charles Wilson <cygwin@cwilson.fastmail.fm>,
6503 Gary V. Vaughan <gary@gnu.org>
6505 * bootstrap: Separate options.
6506 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
6507 * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
6509 * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
6510 (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
6511 (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
6512 (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
6513 $(LTLIBINTL) for gettext support on cygwin.
6514 * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
6515 have $(LTLIBINTL) from the preloaded module la files.
6516 * README: Remove the warning about using --disable-nls on Windows
6519 2003-09-15 Gary V. Vaughan <gary@gnu.org>
6521 * gnulib/m4/regex.c: s/<regex.h>/"regex.h"/ or else the compiler
6522 picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
6525 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6527 * doc/STYLE: Document the gnulib header naming conventions, and
6529 * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
6530 gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
6531 gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
6533 * gnulib/m4/Makefile.am: Remove the rules to build these headers.
6535 * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
6536 module from CVS gnulib.
6537 * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
6538 (gl_FUNC_STRTOL): In favour of the module macro.
6540 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6542 Replace the getopt code with CVS gnulib getopt. The source files
6543 detect whether they are in a glibc environment and preprocess away
6544 all of the code if there is a system getopt, so we can compile
6545 them into the m4 executable unconditionally:
6547 * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
6548 gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
6549 * configure.ac (gl_GETOPT): Use this instead of homebrew inline
6551 * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
6553 * src/Makefile.am: Adjust.
6554 * src/main.c: Always include our shipped getopt.h.
6555 * po/POTFILES.in: Use new location of getopt.c.
6557 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6559 * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
6560 * config/Makefile.am: Removed. Automake 1.8 distributes the files
6561 in this directory automatically.
6562 * Makefile.am (EXTRA_DIST): Except config/mkstamp.
6564 * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
6566 * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
6568 * modules/Makefile.am (pkglibexecdir): Set it here.
6569 (pkgmodincdir): Renamed to pkgmodincludedir). Changed all clients.
6571 * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
6572 Import regex module from CVS gnulib.
6573 * gnulib/config/restrict.m4: Ditto for dependee module restrict.
6574 * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
6575 do extra substitutions for Makefile.
6576 * configure.ac: Use it.
6577 * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
6578 from regex_.h if necessary.
6579 * m4/system_.h: Include the correct version of regex.h.
6580 * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
6582 * po/POTFILES.in: Use new location of regex.c.
6584 * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
6585 realloc.c: automake distributes these files already.
6587 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6589 Replace the xstrzdup code by importing the xstrndup module from
6590 CVS gnulib, along with its dependencies: strndup and strnlen:
6592 * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
6593 gnulib/config/xstrndup.m4: Import xstrndup module from CVS
6595 * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
6596 gnulib/config/strndup.m4: Ditto wrt strndup.
6597 * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
6599 * gnulib/m4/Makefile.am: Add rules from newly imported modules.
6600 However, contrary to gnulib, we install xstrndup.h.
6601 * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
6602 * gnulib/lib/xstrzdup.c: Delete. This was never a gnulib file, it
6603 is an artifact of the old m4 portability layer.
6604 * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
6605 * m4/system_.h: Include xstrndup.h.
6606 * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
6608 2003-09-11 Gary V. Vaughan <gary@gnu.org>
6610 Reimport the latest xalloc module from CVS gnulib, and adjust the
6611 m4 sources to take advantage of xalloc xfree. Also create a new
6612 macro DELETE with the same semantics as the old m4 XFREE macro,
6613 and carefully tweak callers:
6615 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
6617 * m4/utility.c (xfree): Removed. This function is now supplied by
6619 * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
6620 * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
6621 * m4/symtab.c (m4_symtab_create): Ditto.
6622 * m4/system_.h: Removed XFREE redefine.
6623 (DELETE): New macro with same functionality as the original m4
6624 XFREE macro, but based on xalloc.h now. Changed all callers.
6625 * src/main.c (main): Use XMALLOC macro.
6626 * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
6628 * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
6630 2003-09-10 Gary V. Vaughan <gary@gnu.org>
6632 Import the xalloc module from CVS gnulib, along with its
6633 dependencies: exitfail, malloc and realloc. We had different
6634 semantics for our XFREE and a function xfree() not supplied by
6635 gnulib, so also a bit of work to keep everything running
6638 * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
6639 (gl_XALLOC): Use gnulib equivalents.
6640 * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
6641 gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
6642 * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
6643 * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
6645 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
6646 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
6647 * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
6649 (pkgincdir): Removed. Use pkgincludedir instead.
6650 * m4/m4private.h (XFREE): xfree already checks for NULL.
6651 * m4/system_.h: Use xalloc module, and remove macros already
6652 supplied by xalloc.h.
6653 * m4/utility.c (xfree): xalloc does not yet implement xfree, so
6654 moved the old definition from m4/xmalloc.c to here for now.
6656 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6658 Import the error and progname modules from CVS gnulib. Our old
6659 error.c subsumed the functionality of both, so a little adjustment
6660 was required to accomodate the split in sources. Also added more
6661 wrapper macros to choose between a system installed error.h or our
6662 shipped gnulib error module:
6664 * m4/error.c, m4/error.h: Removed.
6665 * m4/Makefile.am: Adjust.
6666 (pkgincdir): Removed. Use pkgincludedir instead.
6667 * m4/module.h, src/main.c: Don't include `m4/error.h'.
6668 * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
6670 * gnulib/m4/progname.c: Imported from CVS gnulib.
6671 * gnulib/m4/progname.h: Ditto.
6672 * src/main.c: Adjust to use progname module.
6673 * gnulib/m4/error.c: Imported from CVS gnulib.
6674 * gnulib/m4/error_.h: Ditto.
6675 * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
6676 if appropriate, and link a local error.h if the system version is
6678 (libgnu_la_SOURCES) Add progname module sources.
6679 * gnulib/config/error.m4: Imported from CVS gnulib.
6680 * gnulib/config/strerror_r.m4: Ditto.
6681 * config/m4-error.c: New file. Wrap gnulib error.m4 but arrange
6682 to have ERROR_H for Makefile substitutions and tell system.h
6683 whether the system error.h should be used, or a locally installed
6685 * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
6687 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6689 * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
6690 s/gettext_.h/gettext.h/.
6692 * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
6693 automake have been fixed.
6695 * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
6696 gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
6697 of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
6698 rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
6700 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6702 The gnulib obstack module requires the gnulib gettext module for
6703 systems that do not have GNU gettext installed. Because we use
6704 -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
6705 that directory incase it clashes with the system gettext.h. This
6706 delta uses gettext_.h and extra rules in the Makefile to make a
6707 link to gettext.h when needed:
6709 * Makefile.am (auxdir): Removed. No longer used.
6710 * configure.ac (ac_aux_dir): Removed AC_SUBST. No longer used.
6711 (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
6713 (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
6714 Makefile based build.
6715 (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
6716 of the macros are kept.
6717 * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
6718 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
6719 * config/Makefile (ACLOCAL_MACROS): Removed. Automake 1.7a
6720 distributes these automatically.
6721 * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
6722 warning from automake-1.7a.
6723 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
6724 m4_CHECK_DEBUGGING for consistency with gnulib prefixes. Changed
6726 * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
6727 wrt. m4_FUNC_OBSTACK.
6728 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
6729 wrt. m4_sys_STACKOVF.
6730 * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
6731 wrt. _m4_LIB_GMP, m4_LIB_GMP.
6732 (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
6733 namespace. Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
6735 * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
6736 * gnulib/m4/Makefile.am: Added a new block to make an appropriate
6737 gettext.h link on deficient systems.
6738 (pkginc_HEADERS): Mention $(GETTEXT_H).
6739 (EXTRA_HEADERS): Mention gettext.h.
6740 * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
6741 * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
6742 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
6743 gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
6744 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
6745 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
6746 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
6747 gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
6748 gnulib/config/po.m4, gnulib/config/progtest.m4,
6749 gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
6750 gnulib/config/ulonglong.m4: Imported from CVS gnulib.
6752 2003-09-05 Gary V. Vaughan <gary@gnu.org>
6754 We can't mirror the gnulib directory structure here, since we need
6755 to be able to eg. `#include <m4/obstack.h>' from our source files,
6756 which is much easier if the local obstack.h is created in a
6757 directory named m4. Rather than trying to symlink everything into
6758 the m4 directory, now we build a libtool convenience library from
6759 the sources we get from gnulib and link that with libm4.la:
6761 * gnulib/config/extensions.m4: Imported from CVS gnulib.
6762 * gnulib/config/unlocked-io.m4: Ditto.
6763 * gnulib/m4/unlocked-io.h: Ditto.
6764 * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
6765 gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
6766 * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
6767 gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
6768 * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
6769 * m4/Makefile.am: Adjust.
6770 * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
6771 macros we redistribute.
6772 * gnulib/m4/Makefile.am: New file. Build libgnu.la convenience
6773 library among others.
6774 (GNULIB_SRCS, GNULIB_MACROS): Removed.
6775 * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
6776 * config/m4-obstack.m4: Adjust.
6777 * po/POTFILES.in: Adjust.
6778 * configure.ac: Reformatting. Call newly imported gnulib macros.
6779 * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
6780 bogus calls of `#include "m4.h"'.
6781 * Makefile.am: INCLUDES has been deprecated in favour of
6783 * m4/Makefile.am: Ditto.
6784 * modules/Makefile.am: Ditto.
6785 * src/Makefile.am: Ditto.
6787 2003-09-05 Gary V. Vaughan <gary@gnu.org>
6789 * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
6791 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6793 Migrate the obstack support into the gnulib directories for easy
6794 synchronisation with upstream files in gnulib:
6796 * config/gnu-obstack.m4: Moved from here...
6797 * config/m4-obstack.m4: ...to here.
6798 * config/Makefile.am (SPECIFIC_MACROS): Adjust.
6799 * m4/obstack.c, m4/obstack_.h: Moved from here...
6800 * gnulib/obstack.c, gnulib/obstack.h: ...to here.
6801 * po/POTFILES.in: Adjust.
6802 * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
6803 * m4/Makefile.am: Add a whole new section to link the obstack
6804 sources from the gnulib tree if necessary.
6805 * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
6807 * config/m4-obstack.m4: Rewrite as a wrapper for
6808 gnulib/m4/obstack.m4.
6810 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6812 GNU M4 currently builds with a number of files adapted from
6813 upstream sources. Recently the gnulib project on savannah.gnu.org
6814 has pulled together a great many of these externally maintained
6815 files. This delta is the beginnings of isolating those files
6816 maintained in gnulib to make it easy to synchronise M4 with the
6817 upstream files prior to releases.
6819 * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
6821 (SUBDIRS): Added new gnulib subdirectory.
6822 * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
6823 * config/stdbool.m4: Moved from here...
6824 * gnulib/m4/stdbool.m4: ...to here.
6825 * m4/stdbool_.h: Moved from here...
6826 * gnulib/lib/stdbool_.h: ...to here.
6827 * gnulib/Makefile.am: New file. Make sure the gnulib tree is
6829 * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
6830 code to work with new stdbool_.h location.
6831 (gnulib_srcdir): New.
6833 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6835 * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
6836 (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
6838 (SPECIFIC_TOOLS): New variable. Moved mkstamp to here.
6839 (EXTRA_DIST): Use it.
6841 * bootstrap: CVS autoreconf leaves file droppings. Remove
6842 aclocal.m4t incase autoreconf doesn't.
6844 2003-08-29 Gary V. Vaughan <gary@gnu.org>
6846 * m4/gnu-obstack.h: Updated from CVS gnulib. For consistency with
6847 the other gnulib imports, renamed to m4/obstack_.h.
6848 * m4/obstack.c: Updated from CVS gnulib.
6849 * m4/Makefile.am (EXTRA_HEADERS): Adjust.
6850 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
6851 header tests from gnulib obstack module. AC_CONFIG_LINKS knows
6852 about vpath already, and $top_srcdir upsets CVS Automake, so the
6853 $top_srcdir reference was removed.
6855 * m4/system-h.in: For consistency with the gnulib imports, renamed
6857 * m4/Makefile (EXTRA_HEADERS): Adjust.
6858 * configure.ac (AC_CONFIG_FILES): Adjust.
6860 * m4/stdbool_.h: New file from gnulib for systems without their
6862 * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
6863 * config/stdbool.m4: New file. Macros from gnulib for same.
6864 * configure.ac: Use it.
6866 2003-08-27 Gary V. Vaughan <gary@gnu.org>
6868 * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
6869 * config/gmp.m4: Ditto.
6870 * config/gnu-obstack.m4: Ditto.
6871 * config/stackovf.m4: Ditto.
6872 * m4/builtin.c: Ditto.
6873 * m4/debug.c: Ditto.
6874 * m4/error.c: Ditto.
6875 * m4/error.h: Ditto.
6876 * m4/gnu-obstack.h: Ditto.
6879 * m4/input.c: Ditto.
6881 * m4/m4module.h: Ditto.
6882 * m4/m4private.h: Ditto.
6883 * m4/macro.c: Ditto.
6884 * m4/module.c: Ditto.
6885 * m4/obstack.c: Ditto.
6886 * m4/output.c: Ditto.
6888 * m4/regex.c: Ditto.
6889 * m4/regex.h: Ditto.
6890 * m4/strtol.c: Ditto.
6891 * m4/symtab.c: Ditto.
6892 * m4/syntax.c: Ditto.
6893 * m4/utility.c: Ditto.
6894 * m4/xmalloc.c: Ditto.
6895 * m4/xstrdup.c: Ditto.
6896 * m4/xstrzdup.c: Ditto.
6897 * modules/evalparse.c: Ditto.
6898 * modules/format.c: Ditto.
6899 * modules/gnu.c: Ditto.
6900 * modules/import.c: Ditto.
6901 * modules/load.c: Ditto.
6902 * modules/m4.c: Ditto.
6903 * modules/m4.h: Ditto.
6904 * modules/modtest.c: Ditto.
6905 * modules/mpeval.c: Ditto.
6906 * modules/perl.c: Ditto.
6907 * modules/shadow.c: Ditto.
6908 * modules/stdlib.c: Ditto.
6909 * modules/time.c: Ditto.
6910 * modules/traditional.c: Ditto.
6911 * src/freeze.c: Ditto.
6912 * src/getopt.c: Ditto.
6913 * src/getopt1.c: Ditto.
6915 * src/main.c: Ditto.
6916 * src/stackovf.c: Ditto.
6918 * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
6919 ac_default_headers is an autoconf internal variable.
6920 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
6921 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6923 * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
6924 * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
6927 2003-08-15 Gary V. Vaughan <gary@gnu.org>
6929 * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
6931 * system-h.in (m4_boolean): Removed in favour of using C99 bool if
6932 possible or faking one with a typedef. Changed all callers.
6934 2003-08-15 Gary V. Vaughan <gary@gnu.org>
6936 Still cleaning up the users' module API, by taking out the stuff
6937 that isn't used by any existing modules, and moving specialised
6938 functions out of libm4 and into the module they are used by.
6940 * m4/m4module.h (m4_skip_space): No need to export this. Moved...
6941 * m4/utility.c (m4_skip_space): ...to here the home of its only
6942 use, made static and renamed to `skip_space'. Changed all
6944 * m4/m4module.h (m4_expand_ranges): Removed prototype.
6945 * m4/utility.c (m4_expand_ranges): Moved definition from here...
6946 * modules/m4.c (m4_expand_ranges): ...to here, and exported using
6948 * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
6950 * modules/gnu.c (builtin_syntax): Import and use in this
6951 builtin implementation.
6952 * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
6954 * m4/macro.c (trace_flush): Except here where the macro is now
6956 * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6957 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
6959 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6960 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
6962 2003-08-14 Gary V. Vaughan <gary@gnu.org>
6964 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
6965 compiler based AC_CHECK_HEADER that was introduced in
6967 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6968 * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
6969 * configure.ac: Use renamed M4_AC_LIB_GMP.
6971 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
6972 macro that requires arguments! This stops the shell's bad
6973 substitution error at configure time.
6975 * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
6976 variables to the testsuite shell. Set the value of USE_GMP so
6977 that the gmp test will run!
6978 (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
6980 2003-08-11 Gary V. Vaughan <gary@gnu.org>
6982 Libltdl already has an excellent mechanism for accessing C symbols
6983 in modules. Lets use that! Remove all the exporting cruft and
6984 just use lt_dlsym in conjunction with a few conventions to
6985 simplify module writers' jobs. Also removed the table address
6986 caching code and otherwise simplified the module loader quite a
6987 bit. To access exported symbols in other modules, first the
6988 exporting module must name the symbols <modname>_LTX_<symname>,
6989 and the importing module must define a function type called
6990 <symname>_func. The importer then adds
6991 M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
6992 that wishes to call out to the exported functions. Care must be
6993 taken that <symname> is non-NULL in the importing module incase
6994 M4_MODULE_IMPORT fails, but otherwise it can be called as if the
6995 definition was in the importers source. Study
6996 `modules/{gnu.c,m4.{c,h}' for a model example. At the moment,
6997 m4_module_import will attempt to automatically load a module
6998 required for symbol access if it is not loaded already.
7000 * TODO: Removed the items fixed in this delta.
7001 * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
7003 * m4/ltdl.h (lt_dlhandle_find): Declare it.
7004 * m4/module.c (m4_module_unload): Use it.
7005 * src/freeze.c (reload_frozen_state): Ditto.
7006 * m4/m4module.h (m4_export): Deleted. Removed all references.
7007 (M4_MODULE_IMPORT): New user convenience macro for importing
7008 arbitrary symbols from other modules.
7009 * m4/module.c (m4_module_import): New function to service
7010 M4_MODULE_IMPORT macro.
7011 (module_data): Removed. Looking up the tables on demand with
7012 lt_dlsym, rather than caching their addresses here simplifies the
7014 (m4_get_module_builtin_table, m4_get_module_macro_table):
7015 Removed. Changed all callers.
7016 (set_module_macro_table, set_module_builtin_table): Renamed to
7017 install_macro_table and install_builtin_table respectively, and
7018 simplified now that the cache is no more.
7019 * modules/gnu.c (builtin_symbols): Use this new mechanism to
7020 import m4_dump_symbols from the m4 module.
7021 (builtin_esyscmd): Likewise for m4_set_sysval and
7023 * modules/m4.c (m4_export_table): Removed. Functions are
7024 addressed with the new mechanism which doesn't need this.
7025 (m4_set_sysval): New exported accessor function to prevent
7026 problems with variable access on inferior architectures.
7027 * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
7028 (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
7029 that we can have some type safety.
7030 * modules/modtest.c (export_test): C level exported function for
7031 testing the new import mechanism.
7032 * modules/import.c: New file for the import end of the test.
7033 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
7034 * tests/modules.at: New test cases for intermodule symbol
7037 2003-08-07 Gary V. Vaughan <gary@gnu.org>
7039 * m4/m4module.c (m4_string): Moved from here...
7040 * m4/m4private.c (m4_string): ...to here.
7042 * m4/utility.c (dumpdef_cmp): Removed stale declaration.
7044 2003-07-29 Gary V. Vaughan <gary@gnu.org>
7046 * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
7047 already available to module writers through
7048 m4_{get,set}_nesting_limit_opt(), so moved from here...
7049 * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
7050 (m4_create): Use it.
7052 2003-07-28 Gary V. Vaughan <gary@gnu.org>
7054 Aside from auditing path.c for m4module.h api obfuscation, this
7055 delta introduces the concept of private struct members in opaque
7056 data types to GNU m4: See the STYLE file for details.
7058 * TODO: Remind ourselves that a rewrite of path.c is needed.
7059 * m4/m4module.h (m4_search_path, struct m4_search_path_info):
7061 * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
7062 here and renamed. These type definitions are for internal api use
7063 only. Changed all callers.
7064 * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
7066 * m4/path.c (search_path_env_init, search_path_add): ...to here
7067 and renamed. These calls were never used outside this file.
7068 Changed all callers.
7069 (dirpath): Moved functionality of this static declaration...
7070 * m4/m4private.h (struct m4): ...to this new internal only
7071 search_path field. Changed all callers.
7072 (m4__get_search_path): Added new internal api accessor.
7073 * m4/path.c (m4_search_path_info_new): Removed. Not used.
7074 (m4_include_init): Removed...
7075 * m4/m4.c (m4_create): ...because the new m4 field is now
7077 (m4_delete): Recycle search_path memory.
7078 * src/main.c (main): Don't call m4_include_init now that it's
7080 * doc/STYLE: Document convention for private fields in opaque
7083 2003-07-24 Gary V. Vaughan <gary@gnu.org>
7085 Sometimes exporting the address of a symbol from a module isn't
7086 enough for other modules to call that symbol correctly. If
7087 custom data types are used for function parameters, they need to
7088 be known to the caller. This change introduces the concept of
7089 $(prefix)/include/modules/$(modulename).h to declare those
7090 structures. Also we move m4_dump_symbols from libm4 to the m4
7091 module to show this concept in action.
7093 * m4/m4module.h (m4_dump_symbol_data): Moved from here...
7094 * modules/m4.h (m4_dump_symbol_data): ...to this new file for
7095 exporting data structures from modules/m4.c.
7096 * modules/m4.c, modules/gnu.c: Include it.
7097 * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
7098 * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
7100 * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
7102 * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
7103 ...to here, with slight renaming.
7104 (m4_export_table): Prototype and add m4_dump_symbols.
7105 * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
7106 definition of m4_dump_symbols.
7107 * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
7108 * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
7110 2003-07-24 Gary V. Vaughan <gary@gnu.org>
7112 Create an export table in modules/m4.c in readiness for beefing up
7113 the module loader to track module exports and imports.
7115 * m4/m4module.h (m4_debug_flush_files): Removed prototype.
7116 * m4/debug.c (m4_debug_flush_files): Moved...
7117 * modules/m4.c (m4_sysval_flush): ...to here and renamed.
7118 * modules/gnu.c (builtin_esysval): Use it.
7119 * m4/m4module.h (m4_export): New type for declaring module symbols
7121 * modules/m4.c (m4_export_table): List symbols exported from this
7122 module for use by other modules.
7124 2003-07-24 Gary V. Vaughan <gary@gnu.org>
7126 An experiment: There is loads of code in libm4 which should be in
7127 the m4 module, but is also used by another module. Just because
7128 some linkers won't cope with calls across dynamic runtime loaded
7129 objects I initially left the code in libm4. It will tidy the
7130 module api immensely if this code moves to the right place, I just
7131 need to remember to invent a suitable calling mechanism at some
7132 point. For now, only modules that are statically linked and
7133 preloaded will get this treatment, so the only platforms that will
7134 break are those that require all symbols to be resolved at link
7137 * TODO: Reminder that what I am doing could reduce portability
7138 unless I do something more robust later.
7139 * m4/m4module.h (m4_sysval): No longer exported from libm4.
7140 * m4/utility.c (m4_sysval): No longer declared in libm4.
7141 * modules/Makefile.am: Reformatting.
7142 * modules/m4.c (m4_sysval): Declare it at place of use.
7143 * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
7145 2003-07-23 Gary V. Vaughan <gary@gnu.org>
7147 * m4/m4module.h: Reformatting and rearranging lines a bit.
7148 (m4_obstack): Save typing by typedefing `struct obstack'. Changed
7150 (m4_call_macro, m4_expand_input): Renamed...
7151 (m4_macro_call, m4_macro_expand_input): ...to these. Changed all
7153 (m4_expansion_level, m4_process_macro): Moved...
7154 * m4/macro.c (expansion_level, process_macro): ...to here, and
7157 * m4/m4module.h (program_name): Not used by modules at all, so
7159 * src/main.c (program_name): ...to here.
7160 (print_program_name): Renamed...
7161 (print_program_name_CB): ...to conform to the STYLE guide.
7163 2003-07-23 Gary V. Vaughan <gary@gnu.org>
7165 More refactoring of the m4module.h API. Replace #defines with an
7166 enum, and move non-public functions out of the public API.
7168 * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
7170 * m4/macro.c (stdarg.h): Add ANSI C variadic header.
7171 * m4/debug.c (m4_debug, trace): Moved...
7172 * m4/m4private.h (struct m4): ...to fields of this struct.
7173 (m4_get_debug_file, m4_get_trace_messages): New fast access macros
7175 * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
7176 * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
7177 * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
7178 * m4/m4module.h (m4_context_field_table): Add entries for new
7179 debug_file and trace_messages fields.
7180 (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
7181 (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
7182 (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
7183 (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
7184 (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
7185 (m4_is_debug_bit): New macro to simplfy checks against the debug
7187 (m4_trace_format, m4_trace_header, m4_trace_flush)
7188 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
7190 * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
7191 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
7192 * m4/macro.c (trace_format, trace_header, trace_flush)
7193 (trace_prepre, trace_pre, trace_post): ...to these newly static
7194 functions, since they are only ever used from this file. Changed
7197 2003-07-17 Gary V. Vaughan <gary@gnu.org>
7199 Change the macros for checking syntax so that matching against
7200 multiple possible syntax classes can be done with a single
7201 comparison some of the time. The various classes are now bits of
7202 an int that can be checked with bitwise logic operators.
7204 * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
7205 (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
7206 (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
7207 (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
7208 (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
7209 (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
7210 (M4_SYNTAX_ALNUM): Removed. Changed all callers.
7211 (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
7212 (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
7213 (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
7214 (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
7215 Replace all calls with invocations of these...
7216 (m4_is_syntax, m4_has_syntax): ...New macros.
7217 * src/freeze.c (produce_syntax_dump): Remove mask argument, which
7218 is no longer required with new macros. Changed all callers.
7220 2003-07-15 Gary V. Vaughan <gary@gnu.org>
7222 * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
7223 values are returned as part of the internal interface, so they
7225 * m4/private.h: ...to here.
7226 * m4/macro.c (expand_token): Check for out of range
7227 m4_peek_input() results before looking up in the syntax table.
7228 (collect_arguments): Ditto.
7230 * NEWS: Note `$' syntax class.
7232 2003-07-08 Paul Eggert <eggert@twinsun.com> and
7233 Gary V. Vaughan <gary@gnu.org>
7235 Conform to POSIX if the POSIXLY_CORRECT environment is set.
7236 --traditional `define' now smashes all the definitions.
7238 * NEWS: Explain this.
7239 * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
7240 (Extensions): Explain that extensions that are incompatible with
7241 POSIX are disabled if POSIXLY_CORRECT is set.
7242 (Incompatibilities): Remove.
7243 (Define, Other Incompat): Explain difference
7244 between GNU and POSIX behavior of define, pushdef, popdef.
7245 * m4/m4.c (m4_get_posixly_correct_opt): New undef.
7246 * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
7247 * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
7248 (m4_get_posixly_correct_opt): New macro.
7249 * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
7251 * modules/m4.c (builtin_functions): defn now takes any number of args.
7252 (builtin_define): Smash all the definitions if
7254 (builtin_defn)): Allow any number of arguments.
7255 (builtin_undivert): Do not allow nonnumeric arguments
7257 * src/main.c (main): Set posixly-correct behavior if either
7258 POSIXLY_CORRECT is set, or if -G is given.
7259 * tests/builtins.at: New test for smashed definitions.
7261 2003-06-27 Gary V. Vaughan <gary@gnu.org>
7263 * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
7264 * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
7265 not to slow the parser down.
7266 (M4__IS_STRING): New macro to test string syntax class membership.
7267 * m4/syntax.c: Adjust docucomment.
7268 (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
7269 (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
7270 * m4/input.c (init_builtin_token): Comment typo.
7271 (m4__next_token): Comment typo.
7272 Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
7273 by using the new M4__IS_STRING macro.
7274 * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
7275 variable references in macro expansions.
7277 * doc/m4.texinfo (Eregexp and Regexp): Typo.
7278 (Epatsubst and Patsubst): Typo.
7281 2003-06-26 Gary V. Vaughan <gary@gnu.org>
7283 Move the global variables that pertain to syntax to a new `struct
7284 m4_syntax_table', and then add one of these to `struct m4'. The
7285 ripple effect through the code to both change formerly global
7286 references, and make sure a suitable context is available in
7287 lexical scope is disproportionately large compared to the size of
7288 the change proper. This change is a large part of decoupling
7289 syntax.c from the rest of the code that uses it.
7291 * m4/m4private.h (struct m4): Add a syntax field.
7292 * m4/m4.c (m4_create): Initialise it,
7293 (m4_delete): Recycle it.
7294 (m4_get_symtab): Remove hand coded version...
7295 (m4_get_symbol_table): ...and generate this with cpp. Changed all
7297 * m4/m4module.h (m4_context_field_table): Add an extra field so we
7298 can generate m4_get_symbol_table. Add a new row for
7299 m4_get_syntax_table.
7300 (M4SYNTAX): Syntactic sugar for module writers.
7301 (m4_symtab): Renamed to m4_symbol_table. Changed all callers.
7302 (m4_syntax_table): New home for syntax related formerly global
7304 * m4/m4private.h (struct m4_syntax_table): Define it.
7305 * m4/input.c (m4_input_init): Initialisation of these formerly
7306 global variables moved...
7307 * m4/syntax.c (m4_syntax_create): ...to here.
7308 * m4/input.c (m4_input_exit): And similarly, recycling of the
7309 memory used by those values moved...
7310 * m4/syntax.c (m4_syntax_delete): ...to here.
7311 * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
7312 Moved to m4/m4private.h.
7313 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
7314 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
7315 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
7316 (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
7317 objects. Changed all callers that used to directly access the
7319 (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
7320 Removed and incorporated into m4_syntax_table structure.
7321 * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
7322 * m4/syntax.c (m4_set_syntax): Now returns an error status,
7323 instead of requiring a `struct m4' to generate its own errors.
7324 Changed all callers.
7325 * src/main.c (main): Now that the syntax table is initialised as
7326 part of m4_create, we have to manually wipe the syntax entries if
7327 we are about to read a frozen file.
7329 2003-06-26 Gary V. Vaughan <gary@gnu.org>
7331 * doc/STYLE: Added notes on callback naming schemes.
7333 * m4/module.c (m4_set_module_macro_table)
7334 (m4_set_module_builtin_table): Declarations weren't changed when
7335 definitions were renamed on 2003-06-19.
7337 * m4/hash.c (m4_hash_resize): ifdefed out. This function is
7338 neither used nor particularly appropriate since it exposes the
7339 internal workings of the hash module. I haven't yet decided
7340 whether to remove it entirely.
7342 2003-06-20 Gary V. Vaughan <gary@gnu.org>
7344 Two related changes, and a huge knockon effect throughout the
7345 source: Moved the option variables out of global space and into
7346 `struct m4'; made `m4_symtab' a real datatype, so that its api
7347 is not marred passing `struct m4' around just so it can decide
7348 whether to keep traced symbol names or not. Added setters and
7349 getters for the formerly global option variables, and obviously
7350 changed a vast number of functions to take a `struct m4' and use
7351 the getter funcs to find option values.
7353 * m4/utility.c (interactive, sync_output, debug_level)
7354 (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
7355 (max_debug_argument_length, warning_status, nesting_limit)
7356 (discard_comments): Removed.
7357 * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
7358 (debug_level, max_debug_argument_length, prefix_all_builtins)
7359 (suppress_warnings, discard_comments, interactive, sync_output):
7360 Removed from here...
7361 * m4/m4private.h (struct m4): ...and equivalent fields added to
7363 (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
7364 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
7365 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
7366 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
7367 (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
7368 macros for the new fields.
7369 * m4/m4module.h (m4_context_field_table)
7370 (m4_context_opt_bit_table): Helper macros used to generate
7371 prototypes, setters and getters for new option fields
7373 * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
7374 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
7375 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
7376 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
7377 (m4_get_interactive_opt, m4_get_sync_output_opt)
7378 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
7379 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
7380 (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
7381 (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
7382 (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
7383 setter and getter functions generated by cpp from
7384 m4_context_field_table and m4_context_opt_bit_table, exported as
7385 part of the module api. Changed all callers.
7386 * m4/symtab (struct m4_symtab): Used as the concrete type for
7388 (m4_symtab_create): Allocate and initialise a new struct.
7389 (m4_symtab_apply): New function that works like m4_hash_apply, but
7390 with different callbacks specific to symbol tables. Changed all
7392 (symbol_destroy, arg_destroy, arg_copy): Renamed
7393 symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
7394 they have unused parameters for a reason!
7395 (dump_symbol_CB): New callback to dump the contents of a single
7397 (symtob_dump): Rewritten in terms of dump_symbol_CB.
7398 * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
7399 Changed all callers.
7400 * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
7401 of the contained `m4_symtab' at the `no_gnu_extensions' field.
7402 Although I'm not convinced these semantics are correct, they are
7403 at least consistent with how things were before this delta. Also
7404 set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
7406 2003-06-19 Gary V. Vaughan <gary@gnu.org>
7408 Tie down the interface to libm4 some more. Make more structures
7409 opaque to modules by moving them to m4private.h, and writing
7410 setters and getters. To win back the speed penalty for doing this
7411 also wrote macroized versions that do know about structure layout
7412 in m4private.h and #include that file into modules when NDEBUG is
7413 defined at compile time. There are still some accessor macros in
7414 m4private.h that need to go, but that is not necessary to clean
7417 * m4/m4module.h (m4_symbol_type): Moved...
7418 * m4/m4private.h (m4__symbol_type): ...to here.
7419 * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
7420 (m4_set_symbol_traced, m4_set_symbol_name_traced)
7421 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
7422 (m4_get_symbol_func, m4_symbol_value_create)
7423 (m4_symbol_value_delete, m4_set_symbol_value_text)
7424 (m4_set_symbol_value_func): New exported api to symbols.
7425 (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
7426 and m4_is_symbol_value_func.
7427 * m4/m4module.h: Prototype these guys.
7428 * m4/module.c (m4_set_module_macro_table)
7429 (m4_set_module_builtin_table): Make these static, there is no
7430 reason to pollute the api with them.
7431 * m4/m4private.h: Reformatting.
7432 (m4_get_symtab): Only define when NDEBUG is defined.
7433 (m4_get_symbol_value, m4_get_symbol_traced)
7434 (m4_set_symbol_traced, m4_set_symbol_name_traced)
7435 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
7436 (m4_get_symbol_func, m4_symbol_value_create)
7437 (m4_symbol_value_delete, m4_set_symbol_value_text)
7438 (m4_set_symbol_value_func): Macro implementations of the new
7439 functions when NDEBUG is defined.
7440 (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
7441 (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
7442 Superceded by the above. All callers changed.
7443 (M4ARG): Removed. This is no longer different to the
7444 m4/m4module.h definition.
7445 * modules/gnu.c, modules/m4.c: Only include m4private.h when
7446 NDEBUG is defined. That way we exercise the same (albeit slower)
7447 api that external modules must use.
7449 2003-06-18 Gary V. Vaughan <gary@gnu.org>
7451 Renamed some of the types and their accessors to make more sense.
7452 Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
7453 has a stack of SYMBOL_VALUEs.
7455 * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
7456 (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
7457 m4_get_symbol_value_type, m4_get_symbol_value_text,
7458 m4_get_symbol_value_func and m4_symbol_value_copy respectively.
7459 Changed all callers.
7460 (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
7461 (m4_get_token_type): Renamed
7462 * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
7463 to the internal api.
7464 * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
7466 (m4__symtab_init, m4__symtab_exit): Removed prototypes.
7467 (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
7468 (m4__token_type): Moved here from m4module.h.
7469 (m4__next_token): Renamed from m4_next_token.
7470 * m4/symtab.c: Removed some of the parameterised macro support
7471 functions for modularisation later.
7472 (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
7473 m4_hash_dup to perform a true deep copy of the SRC.
7474 (arg_copy): Callback for m4_symbol_value_copy.
7475 * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
7476 Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
7477 m4_get_symbol_value_func. Changed all callers.
7479 2003-06-18 Gary V. Vaughan <gary@gnu.org>
7481 Tidy up style of hash.[ch] in accordance with doc/STYLE.
7483 * m4/hash.c: Internal symbol renaming and formatting.
7484 (m4_hash_dup): New function to facilitate deep copies of hash
7486 (m4_hash_apply_func): Returns a void* now, which is a richer type
7487 for returning exceptions (NULL means keep going).
7488 (m4_hash_apply): Ditto.
7489 * m4/hash.h: Declare exported symbols with an explicit extern.
7492 2003-06-17 Gary V. Vaughan <gary@gnu.org>
7494 Still refactoring furiously. This delta represents a change in
7495 semantics to symtab.c. Instead of building temporary m4_tokens
7496 in the caller, and copying fields in the methods, we now create
7497 the actual m4_token for hashing in the caller so the methods just
7498 slot them in directly. Also, this means that we don't lookup a
7499 symbol and get back an allocated but VOID token to copy fields
7500 into, we create the token we want to push and pass that to
7501 m4_symbol_define or m4_symbol_pushdef. And that's it. There are
7502 a few other small changes to stop knowledge of the implementation
7503 of symtab.c leaking out into other files.
7505 * m4/macro.c (expand_argument): Comment typo corrected.
7506 * m4/symtab.c (symtab_fetch): New function to fetch the address of
7508 (m4_symbol_pushdef): Take an extra value parameter and use this
7509 directly as the new top of the value stack. All callers changed
7510 to build a token and pass responsibility for memory in, rather
7511 than copying as we used to.
7512 (m4_symbol_define): Also use the new value parameter directly as a
7513 replacement for the top of the value stack. All callers changed
7514 to build a token as above.
7515 (m4_set_symbol_traced): New function to set the traced bit on the
7516 named symbol, creating it if necessary.
7517 (symbol_popval): The guts of the old m4_symbol_popdef.
7518 (m4_symbol_popdef): Use it.
7519 * m4/builtin.c (m4_symbol_set_token): Removed,
7520 (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
7522 * m4/module.c (m4_set_module_builtin_table)
7523 (m4_set_module_macro_table): ...with these more orthogonal
7525 * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
7526 (m4_builtin_pushdef, m4_builtin_define): Removed. No longer
7528 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
7529 (m4_arg_signature_parse): Moved...
7530 * m4/symtab.c: ...to here.
7531 * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
7532 screw something up. Moved...
7533 * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
7534 actually does a proper deep copy of source to dest.
7536 2003-06-16 Gary V. Vaughan <gary@gnu.org>
7538 Further refactoring to stabilise the module API. Renaming some
7539 functions for orthogonality, and judicious definition migration to
7540 move things out of the set of exported symbols.
7542 * doc/STYLE: New file. Notes on coding style.
7543 * m4/m4module.c: Updated bitrotted docucomment at the top of the
7545 (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
7546 m4_get_module_name, m4_get_module_builtin_table,
7547 m4_get_module_macro_table which are verb phrases. Changed all
7549 * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
7551 * m4/module.c (m4_set_module_builtin_table)
7552 (m4_set_module_macro_table): ...here, and renamed. Changed all
7554 * m4/m4module.c (m4_module_data): This...
7555 * m4/m4private.c (struct m4_module_data): ...and this...
7556 * m4/module.c (module_data) ...consolidated here and no longer
7557 exported. Changed all callers.
7559 2003-06-16 Gary V. Vaughan <gary@gnu.org>
7561 Begin work on lifting the curse of the global variables. To start
7562 with create a `struct m4' context container, and replace
7563 `m4__symtab' with `context->symtab' throughout. This means
7564 initialising a context container in main, and adjusting many
7565 functions between main and the module entry points so that the
7566 container gets passed through. It would have been nice to
7567 defer this until after 1.5, but it has a major effect on the
7568 user's module writing ABI, so it needs to be addressed now - at
7569 least in the areas that impact the ABI. An interrelated change
7570 in the symtab API removes the dependency on a global symbol table,
7571 and instead focuses on a passed table (from the context
7574 * TODO: Reminders for finishing context functionality.
7575 * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
7576 * m4/m4.c: New file. Manage new struct m4 objects to eliminate
7577 global variables and eventually allow m4 to be reentrant.
7578 * m4/m4private.h (m4): Define the new structure here...
7579 (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
7580 don't carry the overhead of a function call.
7581 * m4/m4module.h: Prototype extern functions from m4/m4.c.
7582 (m4): Declare type for new struct m4 objects.
7583 (M4SYMTAB): User macro to ease finding the symbol table for the
7584 current context for module developers.
7585 (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
7587 (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
7588 (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
7589 (m4_call_macro, m4_dump_symbols, m4_expand_input)
7590 (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
7591 (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
7592 (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
7593 m4* context parameter. Changed definitions and all callers.
7594 (m4_symtab): Alias for m4_hash to decouple the
7595 m4_symtab api from m4_hash.
7596 (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
7598 (m4_symtab_create): New function to return an initialised
7600 (m4_symtab_delete): New function to delete an m4_symtab's memory.
7601 (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
7602 (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
7603 instead of simply using the global m4__symtab. Changed
7604 definitions and all callers.
7605 * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
7606 * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
7607 * src/main.c (main): Create a context and use that instead of the
7608 former global m4__symtab.
7610 2003-06-13 Gary V. Vaughan <gary@gnu.org>
7612 * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
7613 to the callback. Callbacks should not need to hardcode the
7614 hashtable they are working from, nor should we have to waste the
7615 userdata parameter to pass the table in.
7616 * m4/hash.h (m4_hash_apply_func): Require the initial table
7618 * m4/symtab.c (symtab_destroy): Use the passed table instead
7619 of hardcoding m4__symtab.
7620 (m4_symbol_popdef): Don't use the userdata parameter to pass the
7621 table to arg_destroy.
7622 (arg_destroy): Use the hash parameter, ignore userdata.
7623 * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
7625 (traceon, traceoff): Call set_trace with the extra initial
7628 2003-06-13 Gary V. Vaughan <gary@gnu.org>
7630 More refactoring to stabilise the module api, this time for
7631 symtab.c. Additionally, start to pay attention to function names
7632 that don't contain a verb like they should.
7634 * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
7635 wrapper for m4_hash_apply to decouple the symtab module from the
7637 (m4_symbol_builtin, m4_symbol_macro): Renamed to
7638 m4__symbol_set_builtin and m4__symbol_set_macro. Changed all
7640 (m4_symbol_delete): Create a macro version to save a function
7642 (m4_token_t, m4_data_t): These violate the POSIX reserved
7643 namespace. Renamed to m4_token_type and m4_symbol_type. Changed
7645 (m4_token_type): Renamed to m4_token_get_type.
7646 (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
7647 (m4_symtab_exit): Removed from the exported module
7649 * m4/m4private.h (m4__symtab, m4__symtab_init)
7650 (m4__symtab_remove_module_references, m4__symtab_exit): ...and
7651 renamed and added to the internal api. Changed all callers.
7652 (m4_symtab_apply): A faster macro version of the function for
7653 users of the internal api.
7654 * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
7655 symbol_destroy and arg_destroy.
7656 (symtab_debug): Added a prototype.
7657 (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
7658 so that callers in this file get the faster macro versions from
7661 2003-06-12 Gary V. Vaughan <gary@gnu.org>
7663 Refactoring modules to rationalise the API into an external
7664 documented (eventually!) API for use by modules in the `m4_'
7665 namespace declared in m4/m4module.h, an internal API between the
7666 source files we ship (including our shipped modules) in the `m4__'
7667 namespace declared in m4/m4private.h and making the rest as
7668 cohesive as possible with liberal use of the `static' keyword.
7669 This change represents an audit to m4/module.c along these
7672 * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
7673 Removed. No longer used.
7674 (m4_module_close): Removed prototypes.
7675 (m4_module_init, m4_module_open, m4_module_unload_all): Removed
7676 from the exported module api...
7677 * m4/m4private.h (m4__module_init, m4__module_open)
7678 (m4__module_exit): ...and renamed and added to the internal api.
7679 Changed all callers.
7680 (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
7681 Centralised definitions after renaming...
7682 * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
7683 (M4_FINISH_SYMBOL): ...and removing from here.
7684 (m4_module_dlerror, m4_module_remove, m4_module_close)
7685 (m4_caller_id): Not exported at all, so renamed to module_dlerror,
7686 module_remove, module_close and caller_id.
7687 (MODULE_SELF_NAME): New macro to make reporting self errors
7689 (m4_module_load, module_close, module_remove): Use it.
7690 * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
7692 * src/main.c (main): Use it.
7694 2003-06-12 Gary V. Vaughan <gary@gnu.org>
7696 * README: Remove references to --enable-changeword, which has been
7697 removed from the code.
7699 2003-06-11 Gary V. Vaughan <gary@gnu.org>
7701 Getting rid of the annoying bug with configure --enable-debug,
7702 which spewed -e: command not found errors. This was an interaction
7703 between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
7704 You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
7705 branch-1-5) to get the full fix.
7707 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
7708 of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
7709 and then use the probed value of $SED.
7710 (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
7711 this, it messes up the AC_REQUIRE stack.
7713 2003-06-10 Gary V. Vaughan <gary@gnu.org>
7715 * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
7716 the destroy callback.
7717 (m4_arg_destroy): Use the hash address to free the hash node key
7720 2003-06-06 Gary V. Vaughan <gary@gnu.org>
7722 First cut at formal parameters in macros.
7724 * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
7725 * m4/xstrzdup.c: New file.
7726 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
7727 associative array of parameter names to details.
7728 (m4_symbol_token): Capture macro names with parameter lists.
7729 (m4_arg_signature_parse): And build an associative array to hang
7730 from the symbol structure to map names to details.
7731 * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
7732 m4_hash_resize idiom. Now that we potentially add a little hash
7733 table to many of the entries in the symbol table, added an extra
7734 arg to set the initial size. Changed all callers.
7735 (m4_hash_apply): New function that is basically a generalised
7737 * m4/symtab.c (m4_symbol_apply): ...this. Now deleted. Adjusted
7738 all callers to call m4_hash_apply instead.
7739 (m4_arg_destroy): Recycle memory used by an m4_token_arg.
7740 (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
7741 m4_arg_signature association that might be attached to the symbol,
7742 * m4/hash.h (m4_hash_apply_func): Replacement type for...
7743 * m4/m4module.h (m4_symtab_apply_func): ...this. Now deleted.
7744 (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
7746 (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
7747 (M4_IS_IDENT): Detect characters that can be safely used in
7749 * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
7750 * m4/macro.c: Corrected grammar in some comments. Use `token'
7751 rather than `td' for m4_token variables.
7752 (m4_process_macro): If we find a dollar followed by some
7753 M4_IS_IDENT characters, replace that with the contents of the argv
7754 entry with offset stored in the m4_token_arg associated with the
7755 collected identifier.
7757 2003-06-05 Gary V. Vaughan <gary@gnu.org>
7759 Begin preparations for supporting formal parameters in m4 macros.
7761 * m4/m4private.h (struct m4_token_arg): Placeholder for holding
7762 the details of a formal parameter.
7763 (m4_token): Add an arg_signature member to hold a hash table for
7764 looking up formal parameters.
7765 * m4/input.c: Update more bitrotted comments.
7766 (m4_push_builtin): Initialise arg_signature member.
7767 (init_builtin_token): Copy arg_signature member.
7768 * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
7769 (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
7771 * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
7772 (m4_macro_pushdef, m4_macro_define): ...these, And...
7773 (m4_symbol_token): ...wrapped around this new function, which
7774 vastly simplifies the arguments required by the functions it
7776 Changed all callers.
7778 2003-06-05 Gary V. Vaughan <gary@gnu.org>
7780 * m4/macro.c: Format changes.
7782 2003-06-04 Gary V. Vaughan <gary@gnu.org>
7784 * m4/input.c: Updated various bitrotted comments.
7785 (m4_push_builtin): Just pass the whole m4_token, rather than
7786 extracting all the fields in the caller. This also allows us to
7787 check the token type for consistency.
7788 (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
7789 Renamed to builtin_funcs, builtin_peek, builtin_read,
7790 m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
7791 the code. Changed all callers.
7792 (struct input_block): Similarly renamed u_m member to u_b, and
7793 changed all callers.
7794 (m4_next_token): Use bzero to initialise the data fields.
7795 * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
7797 2003-05-29 Gary V. Vaughan <gary@gnu.org>
7799 These changes were necessary to get m4 to build on my iBook
7800 running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
7801 (GCC) 3.1 20020420 (prerelease)":
7803 * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
7804 inclusion of module loader headers.
7805 * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
7806 * m4/Makefile.am: Ditto.
7807 (libm4_la_LIBADD): Added $(LTLIBINTL).
7808 * m4/utility.c (program_name): Removed declaration in favour of
7809 the one already in error.c!
7810 * m4/m4module.h (program_name): Define to program_invocation_name
7811 when using GNU C library. Use an explicit extern declaration.
7812 (interactive, sync_output, debug_level, hash_table_size)
7813 (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
7814 (suppress_warnings, warning_status, nesting_limit, discard_comments)
7815 (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
7816 (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
7817 (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
7818 (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
7819 (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
7820 (m4_expansion_level, m4_expand_ranges, m4_expand_input)
7821 (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
7822 (m4_current_line, m4_current_diversion, m4_output_current_line):
7823 Don't rely on default, use an explicit extern.
7824 * m4/error.h (error, error_at_line, error_print_progname)
7825 (error_message_count, error_one_per_line): Ditto.
7826 * m4/ltdl.c: Update from CVS libtool.
7828 * commit: Update from CVS cvs-utils.
7830 2002-11-04 gettextize <bug-gnu-gettext@gnu.org>
7832 * po/Makefile.in.in: Upgrade to gettext-0.11.5.
7833 * po/boldquot.sed: New file, from gettext-0.11.5.
7834 * po/en@boldquot.header: New file, from gettext-0.11.5.
7835 * po/en@quot.header: New file, from gettext-0.11.5.
7836 * po/insert-header.sin: New file, from gettext-0.11.5.
7837 * po/quot.sed: New file, from gettext-0.11.5.
7838 * po/remove-potcdate.sin: New file, from gettext-0.11.5.
7839 * po/Rules-quot: New file, from gettext-0.11.5.
7841 2002-11-04 Akim Demaille <akim@epita.fr>
7843 * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
7845 * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
7847 2002-11-04 Akim Demaille <akim@epita.fr>
7849 * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
7851 2002-11-04 Akim Demaille <akim@epita.fr>
7853 * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
7854 used as `external', and Libtool 1.4.3.
7856 (LTLIBOBJS): Don't play with it.
7858 * Makefile.am (SUBDIRS): Remove intl.
7859 (ACLOCAL_AMFLAGS): Add -I config.
7860 (EXTRA_DIST): Add config/config.rpath.
7863 * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
7865 2002-05-29 Gary V. Vaughan <gary@gnu.org>
7867 Preparations for refactoring syntax tables to allow reverse
7868 lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
7869 speed of normal lookups in an array of unsigned short.
7871 * m4/input.c (single_quotes, single_comments, use_macro_escape):
7873 * m4/m4private.h (m4__single_quotes, m4__single_comments,
7874 m4__use_macro_escape): ...to here, and renamed. The `m4__' prefix
7875 is for internal symbols which unavoidably pollute the global
7876 namespace, but are not published APIs.
7877 Adjusted all callers.
7878 * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
7879 m4_set_comment, m4_set_syntax, set_syntax_internal,
7880 unset_syntax_attribute): Moved from this file...
7881 * m4/syntax.c: New. ...to this file.
7882 Also added an m4_syntax_exit stub for orthogonality.
7883 * src/main.c (main): Use it.
7884 * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
7885 * m4/m4module.h: Reformatting. New prototypes.
7887 2002-05-29 Gary V. Vaughan <gary@gnu.org>
7889 * bootstrap (aclocal_apiversion): The aclocal apiversion is
7890 distinct from the automake release number (in that the apiversion
7891 apparently has no micro-version-component).
7892 (aclocal_apilibdir): Use it.
7894 2002-05-28 Gary V. Vaughan <gary@gnu.org>
7896 * m4/hash.c (m4_hash_resize): New function.
7897 * m4/hash.h: Add prototype.
7898 * m4/symtab.c (m4_symtab_init): Use it. This could do with some
7899 benchmarking to find a good value for, say, autoconf. This is
7900 already a little quicker than before for me.
7902 * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
7903 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
7905 * m4/hash.h: Adjust prototypes.
7907 2002-01-22 Akim Demaille <akim@epita.fr>
7909 * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
7911 * tests/Makefile.am (package.m4): New.
7912 * tests/atlocal.in: Adjust to CVS Autotest.
7913 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
7914 * configure.ac: LIBOBJ is a forbidden string.
7915 Simplify AM_INIT_AUTOMAKE invocation.
7916 * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
7919 2002-01-21 gettextize <bug-gnu-utils@gnu.org>
7921 * po/Makefile.in.in: Upgrade to gettext-0.10.40.
7923 2001-10-19 Akim Demaille <akim@epita.fr>
7925 * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
7927 2001-10-19 Akim Demaille <akim@epita.fr>
7929 * m4/input.c (m4_next_token): Display where was opened what is
7932 2001-10-19 Akim Demaille <akim@epita.fr>
7934 * m4/macro.c (expand_argument): Display where was opened what is
7937 2001-10-18 Akim Demaille <akim@epita.fr>
7939 * m4/input.c, modules/m4.c: Formatting changes.
7941 2001-10-17 Gary V. Vaughan <gary@gnu.org>
7943 * bootstrap: s/configure.in/configure.ac/
7945 2001-10-16 Gary V. Vaughan <gary@gnu.org>
7947 * m4/symtab.c (m4_symbol_destroy): This function calls
7948 m4_symbol_popdef, which recycles a symbols memory when the last
7949 definition is popped. Since we were passing the address of the
7950 symbol name found in the symbol table, and it was being removed
7951 partway through m4_symbol_destroy() we were referencing freed
7952 memory for the balance of the function. Now we take a copy of the
7953 symbol name tring and use that as a key into the symbol
7954 table... that way if the original symbol name is freed, the copy
7957 2001-10-13 Akim Demaille <akim@epita.fr>
7959 * m4/ltdl.c: Update.
7961 2001-10-13 Akim Demaille <akim@epita.fr>
7963 * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
7964 Don't gettextize internal error messages.
7966 2001-10-13 Akim Demaille <akim@epita.fr>
7968 * tests/macros.at (Arity and defn): New failing test.
7969 (Arity, defn, and freeze): New.
7971 Fix `Arity and defn'.
7973 * m4/input.c (m4_push_macro): Don't forget the arity.
7974 * modules/m4.c (defn): Likewise.
7976 2001-10-13 Akim Demaille <akim@epita.fr>
7978 * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
7980 * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
7981 (Propagation of traceon, Propagation of --trace): this new file.
7983 2001-10-13 Akim Demaille <akim@epita.fr>
7985 * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
7986 interface instead of (name, argc...).
7987 Upon failure, specify which argument was guilty.
7990 2001-10-13 Akim Demaille <akim@epita.fr>
7992 * modules/evalparse.c: Save translators' time: don't translate
7993 internal error messages.
7994 (m4_evaluate): Simplify/normalize error messages.
7995 * doc/m4.texinfo (Eval): Adjust.
7997 2001-10-13 Akim Demaille <akim@epita.fr>
7999 * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
8000 where no checking is needed.
8001 * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
8002 interface instead of (name, argc...).
8004 * modules/gnu.c (m4_patsubst_do): Don't check argc, done
8007 2001-10-13 Akim Demaille <akim@epita.fr>
8009 * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
8010 exclude the builtin name from the count.
8011 * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
8012 calling ifelse with a single argument is valid.
8013 * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
8014 with 1 and 2 args, mostly to strengthen the test suite.
8016 2001-10-13 Akim Demaille <akim@epita.fr>
8018 * m4/output.c (m4_make_diversion, m4_insert_file)
8019 (m4_insert_diversion, +m4_freeze_diversions): Ansify.
8021 2001-10-12 Gary V. Vaughan <gary@gnu.org>
8023 * m4/input.c (init_builtin_token): Renamed from init_macro_token,
8024 since we call these things builtins in the rest of the code!
8026 * modules/gnu.c (m4_regexp_compile): s/%0/%s/
8028 2001-10-12 Gary V. Vaughan <gary@gnu.org>
8030 Rather than forcing each builtin definition to manage its own
8031 argument range checking, tabulate the maxima and minima for all
8032 builtins in each module. This forces us to consider what the
8033 valid ranges for each builtin should be, and moves the checking
8034 code out of each builtin implementation and into the builtin
8035 caller infrastructure.
8037 * m4/m4module.h (struct m4_builtin): Add argument minima and
8039 * m4/m4private.h (struct m4_token): Reflect them here too.
8040 * m4/input.c (struct input_block): ...and here.
8041 (m4_token_copy): New function for token copying.
8042 (init_macro_token): Copy them from a token to the input stack.
8043 (m4_next_token): Don't forget to initialise them for text
8045 * m4/macro.c (expand_argument): Use m4_token_copy, and also
8046 check argument counts before calling the builtin handler.
8047 * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
8048 (m4_symbol_macro): Likewise.
8049 * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
8050 parameters. Updated all callers.
8051 (m4_builtin_define): Ditto.
8052 (m4_macro_pushdef, m4_macro_define): Ditto.
8053 * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
8054 * modules/evalparse.c: Declare argument counts for defined
8055 builtins and remove explicit calls to m4_bad_argc().
8056 * modules/gnu.c: Ditto.
8057 * modules/load.c: Ditto.
8058 * modules/m4.c: Ditto.
8059 * modules/modtest.c: Ditto.
8060 * modules/mpeval.c: Ditto.
8061 * modules/perl.c: Ditto.
8062 * modules/shadow.c: Ditto.
8063 * modules/stdlib.c: Ditto.
8064 * modules/time.c: Ditto.
8067 2001-10-10 Gary V. Vaughan <gary@gnu.org>
8069 The trace semantics now attach the trace bit to a symbol name.
8070 For as long as a traceon(`foo') is active, calls to foo will be
8071 traced regardless of intervening undefines or module unloads.
8072 Fixed the flag propogation issues differently to the fixes
8073 reverted with the last attempt at nailing down trace:
8075 * m4/m4private.h: This file is not visible outside of the m4
8076 source tree, so I removed all the `M4_' and `m4_' prefixes to save
8077 on typing. Updated all clients.
8078 (m4_token): New typedef contains the fields that need to be passed
8079 around with the low level tokeniser.
8080 (m4_token_data): Removed.
8081 (m4_symbol): Now contains the traced flag again.
8082 * m4/symtab.c: Rewritten again. Now we don't remove symbols with
8083 the trace bit set. This change is contained entirely within this
8084 module and doesn't leak out into the callers. Updated all
8086 (m4_symbol_builtin, m4_symbol_macro): Adjusted to make use of the
8087 new fields in m4_token. Updated all clients.
8088 * m4/builtin.c (m4_builtin_pushdef): Needs a flags argument so
8089 that `groks_macro_args' and `blind_if_no_args' flags are retained
8090 when defn() results are passed around in m4 code. Updated all
8092 (m4_builtin_define): Ditto.
8093 (m4_macro_pushdef, m4_macro_define): Ditto.
8094 * m4/input.c (struct input_block): Add a flags field to facilitate
8096 (m4_push_macro): ...use it.
8097 (init_macro_token): Retrieve it.
8098 (m4_next_token): Initialise it.
8099 * m4/macro.c (expand_argument): Copy it.
8100 * m4/m4module.h: Adjust.
8101 * tests/builtins.at: Adjust the expected output of the trace
8102 tests to reflect the change in semantics.
8103 * tests/modules.at (modules: trace): Check that unloading a
8104 module which supplies a traced symbol definition doesn't lose te
8107 2001-10-07 Gary V. Vaughan <gary@gnu.org>
8109 * modules/gnu.c (m4_macro_table): Display the timetamp when
8110 expanding __m4_version__.
8112 * configure.ac (--with-modules): Forgot a comma in the
8113 AC_HELP_STRING parameter list.
8115 2001-10-05 Gary V. Vaughan <gary@gnu.org>
8117 * bootstrap: Remove aclocal.m4t when it is no longer required.
8119 2001-10-05 Akim Demaille <akim@epita.fr>
8121 * tests/Makefile.am: Adjust for gnuprog2.
8122 * tests/m4.in: There can be a leading path.
8123 * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
8124 * tests/testsuite.at: Adjust to the most recent Autotest.
8125 (AT_CHECK_M4_FILTER): Fix and rename as...
8127 * tests/others.at: Use it.
8129 * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
8130 variable in shell scripts, one uses `$'...
8132 2001-10-04 Gary V. Vaughan <gary@gnu.org>
8134 * configure.ac: `rm -f $m4_getopt_h' was lost.
8136 2001-10-04 Gary V. Vaughan <gary@gnu.org>
8138 * configure.ac (TIMESTAMP): Display with AS_BOX at configure
8139 time. Define it for config.h in order to...
8140 * src/main.c (main): ...display the timestamp for --version.
8142 2001-10-04 Akim Demaille <akim@epita.fr>
8144 * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
8145 previous builtins `regexp' and `patsubst'.
8146 (regexp, patsubst): Use them.
8147 (eregexp, epatsubst): New builtins.
8148 * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
8149 (Epatsubst and Patsubst, Eregexp and Regexp): these.
8150 (Extensions): More info on REs.
8152 2001-10-04 Akim Demaille <akim@epita.fr>
8154 * modules/modtest.c (init_handler): Consistently output to stderr.
8155 (finish_handler): New.
8156 (test): The `if' is an `assert'.
8157 * tests/modules.at: Adjust.
8159 2001-10-04 Akim Demaille <akim@epita.fr>
8161 * m4/utility.c (m4_bad_argc): Detail the mismatches.
8163 2001-10-01 Akim Demaille <akim@epita.fr>
8165 * tests/generate.awk: Tag the tests with `documentation'.
8166 * tests/modules.at (AT_CHECK_M4_MODTEST): New.
8167 Use the make the existing modtest tests more uniform, and complete
8168 the set of possibilities.
8170 2001-10-01 Akim Demaille <akim@epita.fr>
8172 * config/gmp.m4: Consult the user before using GMP: use
8174 * configure.ac: Adjust.
8175 * modules/gmp.c: No protection needed as the module is not built
8178 2001-10-01 Akim Demaille <akim@epita.fr>
8180 * tests/generate.awk: Remove debugging code.
8181 (fatal): Specify the current location.
8183 * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
8184 * modules/gnu.c, modules/m4.c: Use M4ARG.
8186 2001-10-01 Akim Demaille <akim@epita.fr>
8188 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
8189 (m4_regexp_compile): New.
8190 (regexp, patsubst): Use it.
8192 2001-09-30 Gary V. Vaughan <gary@gnu.org>
8194 Reinstate the memory handling improvements from the patch I just
8195 reverted. Relevant ChangeLog entries repeated here:
8197 * m4/module.c (m4_module_remove): New function that holds the core
8198 of the old m4_module_unload.
8199 (m4_module_unload): Use it.
8200 (m4_module_unload_all): When we know the modules will never be
8201 used again (i.e. on exit), free up as much module memory as
8202 possible. There are still some artifacts from resident modules
8203 living inside ltdl.c, but everything else is freed.
8204 * m4/debug.c (m4_debug_exit): Free memory allocated in
8206 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
8207 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
8208 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
8209 * m4/m4module.h: Updated prototypes.
8210 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
8211 * m4/hash.h: Updated prototypes.
8212 * src/main.c (main): Use all these new functions to clean up as
8213 much memory as possible before exit.
8215 2001-09-30 Gary V. Vaughan <gary@gnu.org>
8217 Reverted my large patch for removing the old m4_symbol
8218 structure on 2001-09-20. We are still not happy about the way
8219 trace works in conjunction with defn and undefine, and leaving
8220 the reverted patch active prevents us from moving the traced
8221 bit from the definition back to the symbol.
8223 2001-09-30 Gary V. Vaughan <gary@gnu.org>
8225 * configure.in: Moved to...
8226 * configure.ac: ...here. Added a libtool like timestamped
8227 banner, and tidied up the libltdl cruft.
8228 * config/mkstamp: Script to extract a timestamp from ChangeLog.
8229 * modules/Makefile.am (INCLTDL): Removed. This is required
8230 only when libltdl is configured in a subdirectory.
8231 * src/Makefile.am: Ditto.
8232 (LIBADD_DL): No need to add this again, libtool already knows
8233 that libm4.la depends on it.
8234 * m4/Makefile.am: Automake sets variables from AC_SUBST. Use
8237 * TODO: stackovf.c is basically broken.
8238 Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
8240 2001-09-28 Akim Demaille <akim@epita.fr>
8242 * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
8244 2001-09-27 Akim Demaille <akim@epita.fr>
8246 * tests/m4.in: Don't use short options.
8247 Simplify the stderr signature normalization.
8249 2001-09-27 Akim Demaille <akim@epita.fr>
8251 tests/m4 shall be position independent.
8255 * tests/testsuite.at: No args to AT_INIT.
8256 * configure.in, tests/Makefile.am: Adjust.
8258 2001-09-22 Akim Demaille <akim@epita.fr>
8260 Autotest has changed again.
8262 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
8263 (package.m4): Remove.
8264 * configure.in: Adjust to LIBADD_GMP.
8266 2001-09-21 Gary V. Vaughan <gary@gnu.org>
8268 * config/gmp.m4 (AC_ARG_WITH): Removed.
8269 (GMP_LIB): Renamed to LIBADD_GMP for consistency.
8270 (AC_LIB_GMP): When performing a test compile against libgmp,
8271 include the header gmp.h if possible, and link against -lgmp. If
8272 they both work define USE_GMP.
8273 * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
8274 (mpeval_LTX_init_func): Complain on load that there was no libgmp
8277 2001-09-20 Gary V. Vaughan <gary@gnu.org>
8279 * m4/evalparse.c: Moved to...
8280 * modules/evalparse.c: ...here. This code is shared between
8281 modules/mpeval.c and modules/m4.c, so there is no need to pollute
8282 the libm4 API with its details. Moderately rewritten to interface
8283 into its clients more simply.
8284 * m4/eval.c: Deleted. Migrated functionality to...
8285 * modules/m4.c: ...here.
8286 (builtin_eval): Implemented in terms of the new interface style.
8287 * modules/mpeval.c (builtin_mpeval): Ditto.
8288 * m4/m4module.h: Removed references to the former m4/eval.c.
8289 * m4/Makefile.am (libm4_la_SOURCES): Removed eval.c.
8290 (EXTRA_libm4_la_SOURCES): Deleted.
8291 * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
8292 (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
8294 2001-09-20 Akim Demaille <akim@epita.fr>
8296 * config/gmp.m4 (AM_WITH_GMP): Rename as...
8298 By default, use gmp.
8300 * configure.in: Adjust.
8301 Use Automake conditionals for USE_GMP.
8302 Always compute sizeof (long long int).
8303 This was a bug BTW, as `eval' (not `mpeval') depends on it:
8304 before, it was used _only_ if mpeval was not activated.
8305 * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
8306 (mpeval_la_LIBADD): New macros.
8307 * modules/mpeval.c: No longer be conditioned by WITH_GMP.
8309 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
8310 * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
8313 2001-09-20 Akim Demaille <akim@epita.fr>
8315 * tests/Makefile.am (package.m4): New.
8316 * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
8318 2001-09-20 Gary V. Vaughan <gary@gnu.org>
8320 More cleanup. After the last patch, m4_symbol holds nothing but
8321 the head of a chain of m4_token_data. So I have removed the old
8322 m4_symbol, so that m4_token_data chains are stored directly in the
8323 value cell of a hash table node. But there's more... m4_symbol
8324 was a more natural name for the symbol value cell, and now that it
8325 is gone I have renamed the former m4_token_data structure to
8326 m4_symbol. This change turned out to be a pig to get right, since
8327 the original code didn't need to modify the value cell itself,
8328 since changing the chain happened inside the m4_symbol that used
8329 to be returned -- I had to pass the address of the value cell
8330 across various function calls, incase the head value changed. I
8331 also tightened up the memory management to help me find a nasty
8332 memory corruption bug that took me all night to track down...
8334 * m4/m4private.h (struct m4_symbol): Removed.
8335 (struct m4_token_data): Renamed to `struct m4_symbol'. Updated
8337 * m4/hash.c (m4_hash_iterator_value): Return the address of the
8338 value cell. Updated all callers.
8339 * m4/symtab.c: Took advantage of the simplification in the data
8340 structures to rewrite a lot of this file more simply. There is
8341 still some room for optimisation here, but we should tackle that
8342 systematically closer to the release.
8344 * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
8345 revealed. This version is ahead of CVS libtool until I get chance
8346 to flush my changes.
8347 * m4/module.c (m4_module_remove): New function that holds the core
8348 of the old m4_module_unload.
8349 (m4_module_unload): Use it.
8350 (m4_module_unload_all): When we know the modules will never be
8351 used again (i.e. on exit), free up as much module memory as
8352 possible. There are still some artifacts from resident modules
8353 living inside ltdl.c, but everything else is freed.
8354 * m4/debug.c (m4_debug_exit): Free memory allocated in
8356 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
8357 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
8358 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
8359 * m4/m4module.h: Updated prototypes.
8360 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
8361 * m4/hash.h: Updated prototypes.
8362 * src/main.c (main): Use all these new functions to clean up as
8363 much memory as possible before exit.
8365 2001-09-18 Gary V. Vaughan <gary@gnu.org>
8367 The `traced' flag needs to be attached to the definition of a
8368 symbol rather than the current symbol containing the definition.
8369 Implementing this showed up some long standing post 1.4 bugs in
8370 flag propogation which I also fixed.
8372 * m4/m4private.h (struct m4_symbol): Remove the traced flag.
8373 (struct m4_token_data): And add it back in here.
8374 * m4/input.c (init_macro_token): Propogate the traced flag
8376 * m4/macro.c (expand_argument): Ditto.
8377 * tests/builtins.at (trace2, trace3): New tests based on Akim's
8380 2001-09-08 Gary V. Vaughan <gary@gnu.org>
8382 * m4/m4private.h (struct m4_token_data): Simplified by removing
8383 the redundant `traced' flag, and one level of structure nesting.
8384 (M4_TOKEN_DATA_FUNC_TRACED): Removed.
8385 * m4/input.c (init_macro_token): No need to initialise removed
8387 * m4/macro.c (expand_argument): No need to copy it either.
8388 * m4/utility.c (m4_token_data_func_traced): Or provide an access
8391 * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
8392 dependant on multiple symbols with the same key, so preserving
8393 relative symbol order in each bucket during resizing is no longer
8394 required. The resize function is considerably faster as a result.
8396 * m4/m4module.h, m4/builtin.c, m4/symtab.c:
8397 s/m4_symbol_insert/m4_symbol_define/g;
8398 s/m4_builtin_insert/m4_builtin_define/g;
8399 s/m4_macro_insert/m4_macro_define/g. Updated all callers.
8401 2001-09-08 Gary V. Vaughan <gary@gnu.org>
8403 Get rid of m4_symbol_lookup_t entirely. With Akim's earlier
8404 commits, the m4_lookup_symbol dispatch function is split into
8405 specialised functions that must be called directly.
8407 * m4/m4module.h (m4_symbol_lookup_t): Removed.
8408 * m4/symtab.c (m4_lookup_symbol): Removed.
8409 (m4_symbol_builtin, m4_symbol_macro): New functions.
8410 * m4/builtin.c (m4_builtin_define): Split into...
8411 (m4_builtin_pushdef, m4_builtin_insert): ...these.
8412 (m4_macro_define): Split into...
8413 (m4_macro_pushdef, m4_macro_insert): ...these.
8414 * src/main.c (main): Set command line macros from `-D' parameters
8415 using `m4_macro_define'.
8417 2001-09-08 Gary V. Vaughan <gary@gnu.org>
8419 * m4/symtab.c (m4_symtab_remove_module_references): Renamed as
8420 this from m4_remove_table_reference_symbols().
8421 * m4/m4module.h, m4/module.c: Updated all references.
8423 2001-09-07 Akim Demaille <akim@epita.fr>
8425 * modules/stdlib.c, modules/times.c: Misc cleanups.
8427 2001-09-07 Akim Demaille <akim@epita.fr>
8429 * configure.in: We now need Autoconf 2.52e.
8430 * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
8431 and `M4_SYMBOL_DELETE'.
8432 * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
8433 * src/main.c (main): Adjust.
8435 2001-09-06 Gary V. Vaughan <gary@gnu.org>
8437 Fix the obstack.h problem once and for all! At configure time we
8438 can test for a system supplied obstack.h: depending on the
8439 result, we now generate system.h with an #include of the correct
8440 header. As a bonus, I've also added a --with-included-obstack,
8441 incase the user doesn't like the system obstack for some
8442 reason... and also we can test the shipped obstack on a system
8443 that has oe of its own. We also now need to be careful to add
8444 build directories to the include search path, since the generated
8445 system.h will be in the build tree.
8447 * configure.in (AC_CONFIG_FILES): Generate system.h from
8449 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
8450 include the system obstack header or the copy shipped with M4.
8451 Allow the user to override configure and force the build to use
8452 the shipped version.
8453 * m4/system-h.in: New file, template for...
8454 * m4/system.h: ...this. Now deleted.
8455 * m4/m4module.h: Include system.h before everything else.
8456 * src/freeze.c: Ditto.
8457 * m4/Makefile.am (dist-hook): Remove generated system.h.
8458 (INCLUDES): Check builddir for generated headers before checking
8460 * modules/Makefile.am (INCLUDES): Ditto.
8461 * src/Makefile.am (INCLUDES): Ditto.
8463 2001-09-05 Gary V. Vaughan <gary@gnu.org>
8465 * TODO: Remove the items that have been addressed already.
8467 2001-09-05 Akim Demaille <akim@epita.fr>
8469 * src/main.c (main): Standardize --version.
8471 2001-09-05 Akim Demaille <akim@epita.fr>
8473 * modules/format.c (format): Have a bigger `str'.
8475 2001-09-05 Akim Demaille <akim@epita.fr>
8477 Rationalize warnings, reporting the macro name as if it were a
8478 program name, and assertions.
8480 * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
8482 * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
8484 Use assert for internal errors.
8485 * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
8487 * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
8489 * tests/builtins.at (pushpop): Adjust.
8491 2001-09-05 Akim Demaille <akim@epita.fr>
8493 * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
8496 2001-09-05 Akim Demaille <akim@epita.fr>
8498 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
8499 * m4/macro.c, m4/symtab.c: Adjust.
8501 2001-09-05 Akim Demaille <akim@epita.fr>
8503 * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
8504 (m4_symbol_pop, m4_symbol_del): this.
8505 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
8506 (m4_symbol_popdef, m4_symbol_delete): New.
8507 (m4_lookup_symbol): Adjust.
8508 * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
8510 2001-09-05 Akim Demaille <akim@epita.fr>
8512 * m4/m4module.h (m4_symbol_lookup): Rename as...
8513 (m4_symbol_lookup_t): this.
8515 2001-09-05 Akim Demaille <akim@epita.fr>
8517 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
8519 * m4/symtab.c (m4_lookup_symbol): Adjust.
8521 2001-09-03 Gary V. Vaughan <gary@gnu.org>
8523 Bootstrap will now work with Libtool 1.4.1 or higher:
8524 * bootstrap: Remove stale autom4te.cache files when
8526 * config/Makefile.am (ACLOCAL_MACROS): Add ltdl.m4 and
8528 * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
8529 libtool.m4 directly.
8530 Run libtoolize to refresh ltmain.sh.
8531 * config/ltmain.sh: Deleted.
8532 * acinclude.m4: Deleted.
8533 * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
8535 * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
8536 implementation for the cvs impaired libtool user.
8538 2001-09-03 Akim Demaille <akim@epita.fr>
8540 * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
8542 Avoid using `default' in switch, as it hides useful compiler
8543 warnings when a case is forgotten.
8545 2001-09-03 Akim Demaille <akim@epita.fr>
8547 * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
8548 is no such thing as `WITH_MODULES'.
8550 2001-09-03 Akim Demaille <akim@epita.fr>
8552 Improve the test suite's selfcontainedness.
8554 * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
8555 (Include, Undivert): Tag the other input files.
8556 * tests/generate.awk: Catch `@comment file:'.
8557 `-I $src' is no longer needed.
8558 `next' is really like `return': the rest is skipped.
8559 Adjust to `input.m4'.
8560 (fatal): New function.
8561 * tests/foo, tests/incl.m4: Remove.
8563 2001-09-01 Gary V. Vaughan <gary@gnu.org>
8565 The shadowing mechanism and, infact, the whole symbol table
8566 implementation was creaking under the weight of the features piled
8567 on top of it. We now have a separate hash table module which will
8568 dynamically resize to keep symbol density withing good performace
8569 limits, and a new symtab module layered above it. Symbol lookups
8570 are now marginally more efficient (since the shadowed flag is no
8571 longer required) and symbol removal, such as on module unload, is
8572 considerably faster due to a reorganisation of the data structures
8575 * src/main.c (main): Don't mention `-H'.
8576 * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
8579 * m4/hash.c: New generalised dynamic hash table data structure
8581 * m4/hash.h: Public interface.
8582 * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
8583 (libm4_la_SOURCES): Add hash.c.
8584 * m4/symtab.c: More or less rewritten from scratch, within the
8585 bounds of the previous API.
8586 (m4_symtab_apply): A cleaner version of the old hack_all_symbols
8587 call. Updated all callers.
8588 * m4/m4module.c: #include <m4/hash.h>, and changed all affected
8589 declarations to reflect API changes.
8590 (M4INIT): Generate a declaration too, to avoid the warning with
8591 --enable-debug builds.
8594 * m4/utility.c (hash_table_size): Removed.
8595 (m4_dump_symbols): Rewritten to build and qsort an array of symbol
8596 names, which are then looked up by builtin_dumpdef() as necessary.
8597 This implies a small speedup in builtin_symbols(), which discarded
8598 all of the symbol info under the old call.
8599 * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
8600 shadowing is implicit in respect to the new data structures.
8601 symbol names are no longer duplicated here, they are stored in the
8602 key field of the hash table.
8603 Moved macro_args and blind_no_args...
8604 (m4_token_data): ...to here.
8605 m4/macro.c (expand_macro): Added a name argument since the symbol
8606 name is no longer copied into each struct m4_symbol. Modified all
8608 (collect_arguments): Ditto.
8609 * modules/m4.c (set_trace): Ditto.
8610 * modules/gnu.c (builtin_symbols): Updated.
8611 * src/freeze.c (produce_symbol_dump): Much improved in light of
8612 the improved symbol table layout.
8614 2001-09-01 Gary V. Vaughan <gary@gnu.org>
8616 * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
8618 (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
8619 (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
8620 SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
8621 SYMBOL_HANDLE): Ditto.
8622 * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
8623 modules/gnu.c, modules/m4.c, src/freeze.c,
8624 src/main.c: Updated all references.
8626 * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
8627 Automake 1.5 chokes on dynamic source file lists, Besides, it is
8628 already listed in m4_LDADD... how did that ever used to work?
8629 * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
8631 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
8632 Suggested by Tim Van Holder <tim.van.holder@pandora.be>
8634 * tests/m4: Don't call the m4 wrapper script with libtool, it
8635 works fine all by itself.
8637 2001-08-30 Gary V. Vaughan <gary@gnu.org>
8639 The experimental `changeword' feature never took off, and has
8640 no obvious advantages over `changesyntax' to compensate the
8641 enormous speed penalty it carries:
8642 * configure.in (ENABLE_CHANGEWORD): Removed.
8643 * m4/m4module.h (m4_set_word_regexp): Removed.
8644 * m4/m4private.h (m4_token_data): Removed original_text field.
8645 * m4/utility.c (m4_token_data_orig_text): Removed.
8646 * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
8647 * m4/macro.c: Ditto.
8648 * src/main.c: Ditto.
8649 * modules/Makefile.am (changeword.la): Removed.
8650 * modules/changeword.c: File removed.
8651 * doc/m4.texinfo: References to changeword and --word-regexp
8653 * po/POTFILES.in: modules/changeword.c removed.
8654 * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
8655 * tests/builtins.at (changeword): Test removed.
8657 2001-08-30 Akim Demaille <akim@epita.fr>
8659 * bootstrap.sh: Create aclocal.m4 instead of modifying it.
8660 This also help having a single list of m4 files: in
8662 * config/Makefile.am (STANDARD_MACROS): Rename as...
8663 (ACLOCAL_MACROS): this.
8664 (list-standard-macros): Remove.
8667 2001-08-29 Gary V. Vaughan <gary@gnu.org>
8669 In an attempt to moderate my egomania...
8670 * tests/modules.at: Remove attributions.
8672 * tests/generate.awk: When making substitutions to "@&t@", either
8673 "&" or "\&" in the substitution string argument to gsub refer back
8674 to the matched text. "@\\&t@" seems to work though, Tests 43 and
8677 2001-08-29 Akim Demaille <akim@epita.fr>
8679 * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
8680 (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
8681 (sync-lines, trace, translit, undivert, wrap): Move to...
8682 * tests/builtins.at: this new file.
8683 * tests/others.at (Discard comments, import-environment): Move to...
8684 * tests/options.at: this new file.
8686 2001-08-29 Akim Demaille <akim@epita.fr>
8688 * tests/others.at (Freezing modules)
8689 (--module-directory: absolute path, modpath2, modpath3)
8690 (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
8691 * tests/modules.at: here, new file.
8692 * tests/others.at, tests/generate.awk: Add a banner.
8693 * tests/testsuite.at: Adjust.
8694 (AT_CHECK_M4_FILTER): New, but unused.
8696 2001-08-29 Akim Demaille <akim@epita.fr>
8698 * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
8700 * tests/others.at (wrap): Inline wrap.m4.
8701 (shadow): Inline shadow.m4.
8702 (iso8859): Don't specify the path from top_srcdir, but from srcdir.
8703 * tests/m4: Simplify.
8705 2001-08-29 Akim Demaille <akim@epita.fr>
8707 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
8710 2001-08-29 Akim Demaille <akim@epita.fr>
8712 * tests/generate.awk (normalize): s/@__@/@&t@/.
8714 2001-08-28 Akim Demaille <akim@epita.fr>
8716 * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
8718 2001-08-28 Gary V. Vaughan <gary@gnu.org>
8720 * bootstrap (generate.awk): Generate test cases with new script.
8722 2001-08-27 Akim Demaille <akim@epita.fr>
8724 * tests/Makefile.am (installcheck-local): Don't use
8725 `dc_install_base' which is not visible here, but `exec_prefix'
8726 which is clearly the RT anyway.
8727 * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
8728 related to testing a now installed m4.
8729 * tests/m4: Do it here.
8731 2001-08-27 Akim Demaille <akim@epita.fr>
8733 * tests/others.at (indir): Formatting change.
8735 2001-08-27 Akim Demaille <akim@epita.fr>
8737 * tests/Makefile.am (installcheck-local): New.
8738 * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
8740 Prefer options over envvars.
8741 * src/main.c (main): First bug caught by the test suite (yeah!):
8742 --batch lacked a `break' which resulted in an accidental
8743 invocation of --discard-comments.
8745 2001-08-27 Akim Demaille <akim@epita.fr>
8747 * tests/others.at (capitalize, changeword, comments, ddivert)
8748 (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
8749 (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
8750 (sysv-args, trace, translit, undivert): Don't rely on files in
8751 examples/: AT_DATA them.
8753 2001-08-27 Akim Demaille <akim@epita.fr>
8755 Let the test suite use a wrapper around the not installed m4 to
8756 pretend it is (installed).
8758 * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
8759 such a way that m4 does not process them.
8760 * configure.in: The package name seems to be `m4', not `M4'.
8762 * tests/atlocal.in (at_package, M4): Remove.
8763 * tests/testsuite.at, tests/others.at: Use m4, not $M4.
8765 2001-08-27 Akim Demaille <akim@epita.fr>
8767 * tests/Makefile.am (CLEANFILES): Remove.
8768 (DISTCLEANFILES, clean-local): New.
8769 * examples/mktests.sh: Remove.
8771 2001-08-27 Akim Demaille <akim@epita.fr>
8773 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
8774 Don't use aclocal: it's written by hand.
8775 * aclocal.m4: m4_include all the files instead of being built by
8777 * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
8778 until it reads the traces by itself.
8779 * configure.in: Require Autoconf 2.42c as we are now using
8780 AC_CONFIG_TESTDIR instead of AT_CONFIG.
8781 Catch unexpanded `jm_' macros.
8782 * config/atconfig.m4: Remove.
8783 * config/error.m4: new.
8784 * config/Makefile.am: Ship the files included by aclocal.m4.
8785 * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
8786 (TESTSUITE_AT): this, to please Automake.
8787 (TESTSUITE): This target uses autotest/autotest.m4, not
8788 autotest/general.m4.
8789 * tests/testsuite.at: Prereq Autotest 2.52c.
8790 * examples/Makefile.am (pkgdata_DATA): Rename as...
8791 (dist_pkgdata_DATA): this.
8792 * doc/Makefile.am (man_MANS): Rename as...
8793 (dist_man_mans): this.
8795 2001-08-20 Gary V. Vaughan <gary@gnu.org>
8797 * m4/system.h [cygwin*]: Thanks to Paul Sokolovsky and
8798 Robert Collins, building on Cygwin no longer requires Windows
8799 import and export symbol decorations.
8800 * m4/m4module.h (M4_SCOPE) [cygwin*]: Deleted all occurences.
8801 * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
8802 * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8803 * m4/error.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8804 * m4/input.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8805 * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8806 * m4/output.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8807 * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8808 * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8809 * configure.in (LIBM4_DLL_IMPORT) [cygwin*]: Don't set this
8811 * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
8812 * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
8814 2001-08-20 Gary V. Vaughan <gary@gnu.org>
8816 Ansify the source. Previously we had a mix, where my code was
8817 in a K&R compatible style, and the preexisting code was in ANSI
8818 style. Nothing is lost wrt release 1.4 by reverting to ANSI,
8819 and now the code base is much cleaner.
8821 * m4/system.h: Remove M4_PARAMS macro and all users. Remove
8822 VOID macro and all users.
8823 * m4/m4module.h: Ansify function prototypes and headers.
8824 * m4/builtin.c: Ditto.
8825 * m4/evalparse.c: Ditto.
8826 * m4/input.c: Ditto.
8827 * m4/macro.c: Ditto.
8828 * m4/module.c: Ditto.
8829 * m4/output.c: Ditto.
8831 * m4/symtab.c: Ditto.
8832 * m4/utility.c: Ditto.
8833 * modules/format.c: Ditto.
8834 * modules/gnu.c: Ditto.
8835 * modules/m4.c: Ditto.
8836 * modules/mpeval.c: Ditto.
8837 * src/freeze.c: Ditto.
8839 * src/main.c: Ditto.
8841 2001-08-20 Akim Demaille <akim@epita.fr>
8843 * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
8844 generated with stock 2.52.
8846 2001-08-20 Akim Demaille <akim@epita.fr>
8848 * config/atconfig.m4: New, until part of Autoconf per se.
8849 * configure.in (AT_CONFIG): Use it.
8851 * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
8852 * tests/atlocal.in: New.
8853 * tests/generate.awk: For the time being, the empty quadrigraph is
8855 * tests/others.at (changeword, gmp): Check the configuration
8856 variable against `yes'.
8857 * tests/testsuite.at (dnl): Allow it, as it's used all over the
8860 2001-08-20 Akim Demaille <akim@epita.fr>
8862 * m4/utility.c (m4_numeric_arg): Spell out the culprit.
8863 * modules/m4.c (undivert): Disable the possibility of undiverting
8864 several files at once: it is not documented, it is inconsistent
8865 with the other macros, it can be straightforwardly mocked by
8866 several invocations, and most importantly, it prevents the
8867 possibility of other kinds of extension.
8868 Use `m4_numeric_arg'.
8870 2001-08-20 Akim Demaille <akim@epita.fr>
8872 * examples/include.m4: Typo.
8873 * tests/generate.awk: Really add it.
8874 * tests/Makefile.am: Adjust.
8875 * tests/others.at (Discard comments): It sure fails without `-c'.
8876 (include, undivert): Add -I examples/.
8878 2001-08-20 Akim Demaille <akim@epita.fr>
8880 Use sprintf, not ecft and friends since it is standard, portable,
8881 simplifies the code, and since the latter is even deprecated
8882 according to the GNU libc documentation.
8884 * modules/format.c: Drop evct support.
8886 2001-08-19 Gary V. Vaughan <gary@gnu.org>
8888 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up. Don't test
8890 * configure.in: ...do it here instead.
8892 * c-boxes.el: Deleted.
8893 * m4/builtin.c: Reformat box comments to be closer to GNU
8895 * m4/debug.c: Ditto.
8897 * m4/evalparse.c: Ditto.
8898 * m4/input.c: Ditto.
8899 * m4/m4module.h: Ditto.
8900 * m4/macro.c: Ditto.
8901 * m4/output.c: Ditto.
8902 * m4/symtab.c: Ditto.
8903 * m4/utility.c: Ditto.
8904 * modules/changeword.c: Ditto.
8905 * modules/format.c: Ditto.
8906 * modules/gnu.c: Ditto.
8907 * modules/load.c: Ditto.
8908 * modules/m4.c: Ditto.
8909 * modules/modtest.c: Ditto.
8910 * modules/mpeval.c: Ditto.
8911 * modules/perl.c: Ditto.
8912 * modules/shadow.c: Ditto.
8913 * modules/stdlib.c: Ditto.
8914 * modules/time.c: Ditto.
8915 * src/freeze.c: Ditto.
8916 * src/main.c: Ditto.
8918 2001-08-17 Gary V. Vaughan <gary@gnu.org>
8920 * m4/module.c: Fixup some errors in the description comment.
8922 2001-08-17 Akim Demaille <akim@epita.fr>
8924 * tests/others.at (iso8859): Specify the path to the M4 test file.
8925 * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
8926 files in error messages.
8928 2001-08-17 Akim Demaille <akim@epita.fr>
8930 * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
8931 * tests/others.at: Adjust input files paths.
8932 * tests/atconfig.in: Set top_builddir.
8933 * tests/Makefile.am: Adjust.
8934 `testsuite' is in src, not build.
8936 2001-08-17 Akim Demaille <akim@epita.fr>
8938 * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
8939 (generate.at): Install a temporary hack until the actual
8940 generate.awk is added to the repository.
8941 * tests/atconfig.in: New.
8943 2001-08-17 Akim Demaille <akim@epita.fr>
8945 Really apply the patch ``Drop Autoconf 2.13 compatibility.''
8947 2001-08-17 Akim Demaille <akim@epita.fr>
8949 * doc/m4.texinfo: Promote proper quotation.
8951 2001-08-17 Akim Demaille <akim@epita.fr>
8953 Remove the non Autotest tests.
8955 * tests/other-tests/capitalize.test,
8956 * tests/other-tests/changeword.test,
8957 * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
8958 * tests/other-tests/debug.test,
8959 * tests/other-tests/discard-comments.m4,
8960 * tests/other-tests/discard-comments.test,
8961 * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8962 * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8963 * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8964 * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
8965 * tests/other-tests/hanoi.test,
8966 * tests/other-tests/import-environment.m4,
8967 * tests/other-tests/import-environment.test,
8968 * tests/other-tests/include.test, tests/other-tests/indir.test,
8969 * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
8970 * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
8971 * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
8972 * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
8973 * tests/other-tests/modtest.test,
8974 * tests/other-tests/multiquotes.test,
8975 * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
8976 * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
8977 * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
8978 * tests/other-tests/sync-lines.m4,
8979 * tests/other-tests/sync-lines.test,
8980 * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8981 * tests/other-tests/translit.test, tests/other-tests/undivert.test,
8982 * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8983 * tests/other-tests/wrap.test: Remove.
8985 * tests/run-test, tests/get-them: Remove.
8986 * tests/Makefile.am: Adjust.
8988 2001-08-17 Akim Demaille <akim@epita.fr>
8990 others.at no longer depends on other-tests/.
8992 * tests/others.at (stackovf): You're actually...
8994 (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
8995 (unload.test): Keep their authorship.
8996 (discard-comments, gmp, import-environment, modfreeze)
8997 (sync-lines): Embed the input files.
8998 * tests/stackovf.test: Copy from other-tests/stackovf.test.
8999 * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
9001 2001-08-17 Akim Demaille <akim@epita.fr>
9003 * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
9004 (M4exit): Tag the exit status of the example.
9005 * tests/get-them: Adjust.
9006 * tests/generate.awk: New, based on get-them.
9007 * tests/Makefile.am: Adjust to generate `generated.at'.
9008 * tests/testsuite.at: Adjust.
9009 (AT_CHECK_M4): Don't overquote. Blush...
9011 2001-08-17 Akim Demaille <akim@epita.fr>
9013 Start using Autotest. atconfig creation is still lacking.
9015 * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
9016 * examples/reverse.m4, tests/other-tests/import-environment.m4,
9017 * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
9018 * tests/other-tests/import-environment.test: Don't check LANGUAGE
9019 as it might be `unset', or set to `C'.
9020 * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
9021 * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
9022 * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
9023 * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
9024 * tests/other-tests/shadow.test: Adjust.
9025 * tests/testsuite.at, tests/others.at: New.
9026 * tests/Makefile.am: Adjust.
9028 2001-08-17 Akim Demaille <akim@epita.fr>
9030 Drop Autoconf 2.13 compatibility.
9032 * configure.in (changeword): No need to undefine it, as anyway if
9033 it's defined, M4sugar moved it as m4_changeword.
9034 And anyway, proper quotation is enough.
9035 (m4_pattern_allow): As it exists in 2.50, just use it.
9036 (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
9037 Don't handle Gettext's duties, let it handle them.
9038 * config/gnu-obstack.m4: Use m4_pattern_allow directly.
9040 2001-08-17 Akim Demaille <akim@epita.fr>
9042 * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
9043 (m4_errprint): Use fputs.
9044 * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
9045 dumpdef are not concerned.
9046 (Dumpdef, Errprint): Emphasize their insensitivity to
9048 * doc/Makefile.am: Add `TAGS' support.
9049 (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
9051 * config/Makefile.am (MAINTAINERCLEANFILES): New.
9053 2001-08-17 Akim Demaille <akim@epita.fr>
9055 * modules/Makefile.am (ETAGS_ARGS): New.
9057 2001-08-17 Akim Demaille <akim@epita.fr>
9059 * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
9062 2001-08-17 Akim Demaille <akim@epita.fr>
9064 * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
9066 2001-08-17 Akim Demaille <akim@epita.fr>
9068 * m4/m4module.h (m4/list.h): Don't include it.
9070 2001-08-16 Gary V. Vaughan <gary@gnu.org>
9072 m4_modules are no more, we use lt_dlhandles directly and let
9073 latest libltdl features manage the list of loaded modules.
9074 * acinclude.m4: Regenerated.
9075 * m4/ltdl.c: Updated from master copy.
9076 * m4/module.c: Reimplemented to take advantage of advances in
9078 * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
9079 list with lt_dlhandle_next.
9080 (m4_builtin_find_by_func): Ditto.
9081 (m4_builtin_table_install): Use lt_dlhandle.
9082 (m4_macro_define): Ditto.
9083 (m4_macro_table_install): Ditto.
9084 m4/module.h: Prototype new module management API.
9085 (m4_modules): No longer required.
9086 (m4_module_init_t, m4_module_finish_t): POSIX namespace
9087 violations, renamed to...
9088 (m4_module_init_func, m4_module_finish_func): ...these,
9090 (M4INIT_HANDLER): Clean way to declare init functions in modules.
9091 (M4FINISH_HANDLER): And similarly for finish functions.
9092 * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
9093 -- Add indirection to the CONC macro so that arguments are
9095 * modules/modtest.c (m4_init_module): Replaced with M4INIT_HANDLER.
9096 * modules/shadow.c (m4_init_module): Ditto.
9097 Due to new init function semantics, be careful to perform the
9098 initialisation only on first load.
9099 * modules/perl.c (m4_init_module): Ditto. And Ditto.
9100 (m4_finish_module): Replaced with M4FINISH_HANDLER.
9101 Due to new finish function semantics, be careful to perform the
9102 finalisation only on first load.
9103 * m4/m4private.h (m4_module): Removed in favour of...
9104 (m4_module_data): ...structure without all the wrapper fields.
9105 Instances of this new structure are stored associated lt_dlhandles
9106 with lt_dlcaller_data_set().
9107 * m4/builtin.c (m4_builtin_define): Takes a handle argument
9108 instead of the old module argument.
9109 (m4_builtin_table_install): Ditto.
9110 * modules/load.c (m4_resident_module): Removed. This is no
9111 longer implemented as a magic symbol...
9112 * modules/m4.c (m4_resident_module): Ditto.
9113 * modules/load.c (M4INIT_HANDLER): ...the module init function now
9114 uses the ltdl api to make the module resident.
9115 * modules/m4.c (M4INIT_HANDLER): Ditto.
9116 * modules/load.c (builtin_modules): Traverse the loaded module
9117 list with lt_dlhandle_next.
9118 (builtin_load): Much simplified in light of the reimplemented
9120 * src/freeze.c (produce_module_dump): Cleaned up and optimised in
9121 light of the m4/module.c rewrite.
9122 (produce_symbol_dump): Ditto.
9123 (reload_frozen_state): Ditto.
9124 * m4/list.c, m4/list.h: Files deleted. No longer required.
9125 * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
9126 (libm4_la_SOURCES): Delete list.c reference.
9127 * m4/m4private.h (m4_token_data): Add a handle field. This
9128 eliminates many of the searches to find the handle associated with
9129 various tokens that are passed between functions.
9130 (struct m4_symbol): Removed the module field. The
9131 module association does not belong with the symbol...
9132 * m4/input.c (struct m4_builtin): ...it belongs with the builtin
9133 that the module implementation code is from. Added a handle
9135 (m4_push_macro): Add a `handle' argument. Changed all callers.
9136 (init_macro_token): Set the `handle' field for the
9138 * m4/macro.c (expand_argument): Copy the new handle field during
9140 * modules/m4.c (macro_install): Use the new handle field to
9141 optimise the search for the correct builtin structure, and pass
9142 the handle details to m4_builtin_define.
9144 2001-08-15 Akim Demaille <akim@epita.fr>
9146 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
9147 when creating `m4/obstack.h'.
9148 * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
9150 * tests/defs: Make them absolute.
9151 (CDPATH) Neutralize.
9152 * tests/gethem: Use them.
9154 2001-08-14 Gary V. Vaughan <gary@gnu.org>
9156 * config/ltmain.sh: Doh! Import again for a quoting fix that
9157 prevented any regression test from passing.
9159 * m4/m4module.h (obstack.h): Choose between installed version
9160 and shipped version based on configure tests.
9161 * src/freeze.c (obstack.h): Ditto.
9163 * acconfig.h: Removed. No longer required.
9165 * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
9166 * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
9167 them to AC_INIT and AM_INIT_AUTOMAKE.
9168 * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
9169 disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
9170 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
9171 shell variable m4_cv_func_obstack_h.
9172 * tests/defs (M4): Be more careful about relative path to libtool
9173 script and m4 binary by using $srcdir.
9175 * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
9176 optargs to the existing libltdl search path.
9177 * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
9178 * m4/ltdl.c: Updated.
9180 * config/ltmain.sh: Ditto.
9182 2001-08-11 Gary V. Vaughan <gary@gnu.org>
9184 * src/main.c (main): Add `-b' (for `batch') mode switch to force
9185 interactive mode off.
9187 2001-08-10 Akim Demaille <akim@epita.fr>
9189 * configure.in: Require Autoconf 2.52.
9190 (AC_ARG_PROGRAM): Remove, handled by Automake.
9191 (m4_getopt): Rename as...
9192 (m4_getopt_h): this.
9193 Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
9194 Undefine `changeword' only if defined.
9195 * config/gnu-obstack.m4: Require Autoconf 2.52.
9196 (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
9199 2001-08-09 Yuji Minejima <ggb01164@nifty.ne.jp>
9201 * doc/m4.texinfo: Fix some typos, and apply some small
9204 2001-08-09 Andreas Schwab <schwab@suse.de>
9206 * src/main.c (main): Fix improper uses of error (missing format
9209 2001-08-07 Akim Demaille <akim@epita.fr>
9211 Improve `make distcheck'.
9213 * configure.in: Be sure to be able to run `mkconfig.sh' when src
9215 * Makefile.am (dist-hook): Remove, as it is no longer needed.
9216 * doc/m4.texinfo (Include): Add missing blank.
9217 * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
9220 2001-08-07 Akim Demaille <akim@epita.fr>
9222 * m4/evalparse.c: A better introductory comment.
9223 * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
9224 * m4/macro.c: Adjust old comments.
9225 * modules/README: Typo.
9227 2001-08-07 Akim Demaille <akim@epita.fr>
9229 * config/gnu-obstack.m4: New.
9231 2001-08-07 Akim Demaille <akim@epita.fr>
9233 * config/Makefile.am, config/stackovf.m4: New.
9234 * configure.in, Makefile.am: Adjust.
9236 2001-08-05 gettextize <bug-gnu-utils@gnu.org>
9238 * po/Makefile.in.in: Upgrade to gettext-0.10.39.
9239 * po/cat-id-tbl.c: Remove file.
9240 * po/stamp-cat-id: Remove file.
9242 2001-04-08 Roderick Koehle <Roderick.Koehle@infineon.com>
9244 * modules/format.c (format): Formatting for %f was not
9245 interpreting the position of the decimal point correctly for
9248 2000-12-01 Gary V. Vaughan <gary@gnu.org>
9250 * TODO: Removed m4exit bug.
9251 * modules/load.c (m4_resident_module): Make this module resident.
9252 * module/m4.c (m4_resident_module): Ditto.
9253 * m4/modules.c (m4_module_load): Use new ltdl resident modules
9254 feature to mark modules as resident if they export
9255 `m4_resident_module' as TRUE.
9256 (m4_module_unload): Do not remove resident modules, and take care
9257 with symbol insertion and deletion with resident modules.
9258 * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
9259 use resident modules feature.
9261 2000-11-30 Gary V. Vaughan <gary@gnu.org>
9263 * TODO: Updated. Removed some cruft that has since been fixed
9264 or implemented. Added some more entries.
9267 * modules/README: Updated.
9268 * doc/m4.texinfo: Updated.
9270 * modules/gnu.c (builtin_functions): Make indir orthogonal to
9271 builtin, in that each is recognised as a macro only with parameters
9272 (builtin_indir): Passing 0 arguments is now an error, as with
9275 * src/main.c (usage): Added missing description of `-c' option.
9277 2000-11-29 Gary V. Vaughan <gary@gnu.org>
9279 Consolidate the myriad of dispersed test scripts into the
9280 tests subdirectory. I think I now have all the file where I
9281 want them, so there shouldn't be anymore upheaval =)O|
9283 * tests/Makefile.am: Updated to run the new tests added below.
9284 * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
9285 tests/other-tests/ddivert.test, tests/other-tests/debug.test,
9286 tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
9287 tests/other-tests/foreach.test, tests/other-tests/forloop.test,
9288 tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
9289 tests/other-tests/hanoi.test, tests/other-tests/include.test,
9290 tests/other-tests/indir.test, tests/other-tests/misc.test,
9291 tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
9292 tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
9293 tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
9294 tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
9295 tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
9296 tests/other-tests/reverse.test, tests/other-tests/shadow.test,
9297 tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
9298 tests/other-tests/translit.test, tests/other-tests/undivert.test,
9299 tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
9300 tests/other-tests/wrap.test: New tests based on the contents
9301 of the tests removed below.
9302 * examples/Makefile.am, modules/Makefile.am: Updated to
9303 reflect removed tests.
9304 * examples/defs,modules/defs: Removed.
9305 * examples/capitalize.test, examples/comments.test,
9306 examples/ddivert.test, examples/debug.test,
9307 examples/esyscmd.test, examples/exp.test,
9308 examples/foreach.test, examples/forloop.test,
9309 examples/fstab.test, examples/hanoi.test,
9310 examples/include.test, examples/indir.test,
9311 examples/misc.test, examples/multiquotes.test,
9312 examples/patsubst.test, examples/pushpop.test,
9313 examples/regexp.test, examples/reverse.test,
9314 examples/sysv-args.test, examples/trace.test,
9315 examples/translit.test, examples/undivert.test,
9316 examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
9317 modules/modpath1.test, modules/modpath2.test,
9318 modules/modpath3.test, modules/modpath4.test,
9319 modules/modtest.test, modules/shadow.test,
9320 modules/unfrozen.m4, modules/unload.test: Removed.
9322 Move the implementation of GMP support for the mpeval() builtin
9323 into a loadable module that depends on libgmp. mpeval() and
9324 eval() share a common parser, now in m4/evalparser.c; the code
9325 in m4/numb.c and m4/numb.h is now physically split between
9326 m4/eval.c (the eval() backend) and modules/mpeval.c (the
9327 mpeval() backend), rather than being differentiated by cpp
9328 macros and multiple inclusion. The mpeval module is always
9329 built but will generate an diagnostic if it is used from an
9330 installation that didn't link in the gmp library.
9331 * modules/Makefile.am: build and install the new mpeval module.
9332 * modules/mpeval.c: Now contains the former parts of m4/numb.c
9333 and m4/numb.h that are required for gmp support in mpeval().
9334 * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
9335 * m4/evalmp.c: Removed.
9336 * m4/m4module.h: Removed conditional prototype for
9338 * m4/eval.c: Rewritten. Contains the former parts of m4/numb.c
9339 and m4/numb.h that do not rely on gmp.
9340 * m4/evalparse.c: New file, contains the shared parts of the
9341 eval() and evalmp() parser implementations, and is no longer
9342 unencumbered by cpp magic to uncover the right parts.
9343 * m4/numb.h: Removed. It's former contents are split between
9344 m4/eval.c and modules/mpeval.c.
9347 * tests/other-tests/changeword.test: New test. Rudimentary
9348 testing of changeword builtin runs only if --wnable-changeword
9349 was used at configure time.
9350 * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
9351 alternation correctly. Split into two expressions to compensate.
9352 * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
9353 * modules/Makefile.am: Build changeword module.
9354 * modules/changeword.c (m4_macro_table): Define __m4_changeword__
9355 only when --enable-changeword was passed to configure.
9356 (builtin_changeword): If --enable-changeword was not used, then
9357 report that changeword() builtin has no support in m4 binary.
9359 2000-11-28 Gary V. Vaughan <gary@gnu.org>
9361 * src/main.c (main): Fixed a particularly nasty bug is
9362 user_search_path setting -- the -M flag processing must be
9363 extremely careful with search path ordering, or else the default
9364 installed module directory (possibly containing modules from a
9365 previous release) is placed earlier in the search path than any -M
9366 arguments (which are relied upon to load uninstalled modules with
9367 most of the tests in the regresion suite).
9369 * modules/load.c (builtin_load): Nasty hack to prevent adding
9370 symbols to symtab again if a module is loaded more than once.
9371 * modules/m4.c (builtin_ifelse): removed unused variable argv0.
9373 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed a
9374 possible NULL pointer dereference.
9376 * m4/module.c (m4_module_find_by_modname): Renamed from
9377 m4_module_modname_find. Fixed all references.
9378 (m4_module_find_by_builtin): New function.
9380 * modules/modfreeze.test: load the `load' module with each
9382 * src/freeze.c (produce_frozen_state): Simplified in light of
9383 module field in m4_symbol. Allow a third argument for text macros
9384 to name the originating module.
9385 (reload_frozen_state): ditto.
9386 * m4/m4module.h: Fixup prototypes.
9387 * m4/builtin.h (m4_builtin_define): Add a module argument so
9388 that symbols can be registered against the defining module.
9389 (m4_macro_define): ditto.
9390 * m4/m4private.h (m4_symbol): Make the module field const to save
9391 on casting in the rest of the code.
9392 (SYMBOL_MODULE): New macro.
9394 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
9395 symbol reference maintenance bugs when removing a symbol from the
9398 * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
9400 2000-11-27 Gary V. Vaughan <gary@gnu.org>
9402 * configure.in (m4_cv_func_obstack): A better check for whether
9403 libc has an obstack implementation.
9404 * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
9406 * configure.in (--with-modules): Changed semantics. This
9407 option is now used to list modules to be preopened.
9408 * src/m4.h: #include "ltdl.h" unconditionally.
9409 * src/main.c: Removed all dependencies on WITH_MODULES.
9410 * src/freeze.c: ditto.
9411 * modules/Makefile.am: ditto.
9412 * m4/m4.c (builtin_m4exit): ditto.
9413 * modules/modpath1.test: ditto.
9414 * modules/modpath2.test: ditto.
9415 * modules/modpath3.test: ditto.
9416 * modules/modpath4.test: ditto.
9417 * modules/modtest.test: ditto.
9418 * modules/shadow.test: ditto.
9419 * modules/unload.test: ditto.
9421 * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
9422 comes up on demand in LTLIBOBJS now.
9423 * configure.in (getopt_long): Creating and relying on a link for
9424 getopt.h on hosts with no getopt_long() of thier own works
9425 correctly now. This is necessary so that callers of getopt_long()
9426 can simply `#include <getopt.h>': the naive way of doing this
9427 would end up using our own getopt.h and the installed
9428 getopt_long(), which is asking for trouble!
9429 (obstack_init): A similar argument applies to obstack.h and
9432 * m4/ltdl.c: Upgraded to latest bleeding edge version again.
9433 On Solaris-2.5 (at least) the native dlopen implementation
9434 gets confused about m4.o when looking for module "m4". This
9435 version always looks for .la an .$lib_ext suffixed names first
9436 to work around the problem. Sigh.
9438 * po/POTFILES.in: Take account of these file movements.
9439 * src/Makefile.am (m4_SOURCES): removed eval.c.
9440 (EXTRA_m4_SOURCES): removed numb.c and numb.h.
9441 * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
9442 (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
9443 * modules/m4.c (builtin_eval): Use m4_evaluate().
9444 * m4/eval.c: Moved here from src/eval.c to facilitate
9445 implementation of eval() builtin as part of the `m4' loadable
9447 (m4_evaluate): renamed from evaluate for namespace cleanliness.
9448 * m4/numb.c: Moved here from src/numb.c, since it is #included
9449 into eval.c at compile time.
9450 * m4/m4module.h (m4_evaluate): Added prototype.
9451 * src/m4.h (evaluate): Removed prototype.
9453 2000-11-25 Gary V. Vaughan <gary@gnu.org>
9455 * modules/perl.c (builtin_perleval): Use PL_na for
9456 compatibility with perl-5.6.
9458 * src/main.c (main): It is now safe to
9459 ``m4_module_install("m4")'', without tripping over the m4
9461 * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
9462 versions having fixed the insidious module search order bug.
9464 * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
9465 supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
9467 * configure.in: Figure out whether to use the installed
9468 getopt.h or the supplied one.
9469 * src/Makefile.am: ditto.
9471 * po/POTFILES.in: List files in their new positions.
9473 * config/ltmain.sh: This needs to be checked in to match the
9474 libtool macros copied to acinclude.m4 (until a released
9475 libtool copes with m4's needs).
9476 * bootstrap: Run gettextize.
9478 2000-11-24 Gary V. Vaughan <gary@gnu.org>
9480 * AUTHORS: Added my details.
9483 * bootstrap: temporary update until released libtool catches up.
9485 * All files: Use new GNU GPL copyright blurb with current contact
9488 * configure.in (LTLIBOBJS): Use canonical code for calculation of
9491 * config: renamed acm4 directory to config to be more like
9492 other autoconfiscated packages.
9494 * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
9495 * config/debug.m4: New file implementing configure macros to add
9496 suitable debug flags to the compiler invocation.
9498 * modules/load.c: New file implementing the ``load'' and
9499 ``unload'' builtins.
9500 * tests/get-them: Set the module search directory to the modules
9501 build directory in generated tests.
9502 * modules/shadow.test: ditto.
9503 * modules/modtest.test: ditto.
9504 * modules/modpath1.test: ditto.
9505 * modules/modpath2.test: ditto.
9506 * modules/modpath3.test: ditto.
9507 * modules/modpath4.test: ditto.
9508 * modules/modtest.test: ditto.
9509 * modules/modfreeze.test: ditto.
9510 * modules/unload.test: ditto.
9512 * modules/changeword.c: New file implementing the ``changeword''
9513 builtin as a loadable module.
9514 * modules/mpeval.c: New file implementing the ``mpeval'' builtin
9515 as a loadable module.
9517 * src/main.c (main): Load the gnu module if m4 was started
9518 normally -- i.e. without the -G option.
9519 * modules/gnu.c: New file implementing a new loadable module wuth
9520 definitions for all the gnu extension builtins.
9521 * modules/format.c: Moved here from src/format.c. Now included
9524 * src/main.c (main): Load the traditional module if m4 was
9525 started in `no_gnu_extensions' mode.
9526 * modules/traditional.c: New file implementing the ``unix'' macro,
9527 required when m4 is executed in traditional mode, as a loadable
9530 * src/main.c: Renamed from m4.c to avoid confusion with
9532 (main): Always load the m4 module.
9533 * modules/m4.c: New file implementing a new loadable module with
9534 definitions for all m4 builtins that are not gnu extensions.
9536 * m4/Makefile.am: Adjusted to take new files below into account.
9537 * m4/m4module.h: Prototypes for exported functions and types moved
9538 to this directory from the src directory.
9539 * m4/m4private.h: Moved here from src/m4private.h to facilitate
9540 the migration of all builtin implementations to loadable modules.
9541 * m4/macro.c: Moved this file here from the src directory,
9542 renaming all exported symbols to use the prefix ``m4_''.
9543 * m4/builtin.c: ditto.
9544 * m4/module.c: ditto.
9545 * m4/symtab.c: ditto.
9546 * m4/debug.c: ditto.
9547 * m4/input.c: ditto.
9548 * m4/output.c: ditto.
9550 * m4/ltdl.h, m4/ltdl.c: ditto.
9551 * m4/utility.c: Odd functions moved here from files in the src
9552 directory to facilitate builtin migration.
9554 2000-08-12 Gary V. Vaughan <gary@gnu.org>
9556 * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
9557 error message, to make translators' jobs a little easier.
9558 (builtin_builtin): ditto.
9559 (builtin_traceon): ditto.
9560 (builtin_traceoff): ditto.
9561 Reported by Akim Demaille <akim@epita.fr>
9563 * m4/Makefile.am (pkgincdir): Deleted. Use automake's built in
9564 pkgincludedir instead.
9566 * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
9567 it is exported globally. Fixed all references.
9571 (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
9572 globally. Fixed all references.
9573 (DEF_LQUOTE): ditto.
9577 2000-07-28 Gary V. Vaughan <gary@gnu.org>
9582 * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
9583 (AC_OUTPUT): touch stamp-h.in, not stamp-h.
9585 * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
9586 Removed `Prev', `Next' and `Up' fields of all @nodes now that
9587 makeinfo calculates them for us, and to make any future
9588 reorganisation easier.
9589 (Frozen files): Document format version 2.
9590 `V' now takes argument `2'.
9591 `F' can take a single argument if symbol and builtin names
9592 are the same, or 3 arguments if the builtin is from a module.
9593 New `S' specification for saving syntax table contents.
9594 New `M' specification for saving loaded module names.
9595 * src/freeze.c: Implement them.
9596 * src/input.c (syntax_code): For interpreting frozen syntax
9599 * examples/Makefile.am: Add the contents of the WWW directory to
9601 * examples/WWW/Makefile: ditto,
9602 (%.htm): Compares file contents (not just sizes) to determine
9603 whether a change has occured.
9604 * examples/WWW/_header.htm: Bumped version number.
9605 * examples/WWW: Regenerated content.
9607 * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
9608 compilers comes much easier without ansi2knr.
9609 * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
9611 * m4/list.c: New generic list container type.
9612 * m4/list.h: Interface to new container type.
9613 * m4/Makefile.am (pkginc_HEADERS): Install list.h.
9614 (libm4_la_SOURCES): compile and link list.c.
9615 * src/builtin.c (builtin_tables): Use list container.
9616 * src/module.c (symtab): ditto.
9617 * src/symtab.c (symtab): ditto.
9619 * m4/system.h: New file for common preprocessor definitions.
9620 * m4/Makefile.am (pkginc_HEADERS): install system.h.
9621 * m4/error.c: Use system.h in place of inline preprocessor.
9622 * m4/error.h: ditto.
9623 * m4/module.c: ditto.
9624 * m4/module.h: ditto.
9625 * m4/xmalloc.c: ditto.
9627 * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
9629 * m4/xmalloc.c (xmalloc_exit_failure): ditto.
9631 * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
9632 it is exported globally. Fixed all references.
9634 (module_init_t): ditto.
9635 (module_finish_t): ditto.
9636 (token_data): ditto.
9637 (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
9638 it is exported globally. Fixed all references.
9639 (SYNTAX_IGNORE): ditto.
9640 (SYNTAX_SPACE): ditto.
9641 (SYNTAX_OPEN): ditto.
9642 (SYNTAX_CLOSE): ditto.
9643 (SYNTAX_COMMA): ditto.
9644 (SYNTAX_DOLLAR): ditto.
9645 (SYNTAX_ACTIVE): ditto.
9646 (SYNTAX_ESCAPE): ditto.
9647 (SYNTAX_ALPHA): ditto.
9648 (SYNTAX_NUM): ditto.
9649 (SYNTAX_ALNUM): ditto.
9650 (SYNTAX_LQUOTE): ditto.
9651 (SYNTAX_RQUOTE): ditto.
9652 (SYNTAX_BCOMM): ditto.
9653 (SYNTAX_ECOMM): ditto.
9654 (SYNTAX_VALUE): ditto.
9655 (SYNTAX_MASKS): ditto.
9673 (TOKEN_NONE): ditto.
9674 (TOKEN_STRING): ditto.
9675 (TOKEN_SPACE): ditto.
9676 (TOKEN_WORD): ditto.
9677 (TOKEN_SIMPLE): ditto.
9678 (TOKEN_MACDEF): ditto.
9680 * m4/m4module.h (voidstar): Removed in favour of `VOID' for
9681 consistency. Fixed all references.
9682 (STRING): Renamed to `m4_string' for consistency, and because if
9683 is exported globally. Fixed all references.
9684 (token_type): Renamed to `m4_token_t' for the same reasons.
9685 (token_data_type): Renamed to `m4_token_data_t' for the same
9688 * m4/m4module.h (XCALLOC): Wrapper macro which handles type
9692 (XFREE): Wrapper macro which avoids freeing NULL pointers.
9694 * m4/m4module.h (m4_macro): New type for module defined user
9696 * modules/modtest.c (m4_macro_table): Define module user macros.
9697 * modules/shadow.c (m4_macro_table): ditto.
9699 * m4/m4module.h (M4BUILTIN_HANDLER): For defining handlers
9700 declared with M4BUILTIN.
9702 * m4/xmalloc.c: Use memset if bzero is not available when
9703 emulating calloc with malloc.
9704 (xcalloc): Fallback to malloc/bzero if calloc is not available.
9705 (xfree): Added for consistency. Will not try to free NULL
9707 * src/m4.c (xfree): Deleted in favour of the above.
9708 * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
9709 linking with libdmalloc.
9710 * m4/xstrdup.c (WITH_DMALLOC): ditto.
9712 * modules/frozen.m4: New test case.
9713 * modules/unfrozen.m4: ditto.
9714 * modules/modfreeze.test: New test.
9715 * modules/unload.test: ditto.
9716 * modules/Makefile.am (EXTRA_DIST): Distribute them.
9718 * modules/modpath1.test: Don't try this test if module support is
9720 * modules/modpath2.test: ditto.
9721 * modules/modpath3.test: ditto.
9722 * modules/modpath4.test: ditto.
9723 * modules/modtest.test: ditto.
9724 * modules/shadow.test: ditto.
9726 * modules/perl.c: New module.
9727 * modules/perl.m4: Example of using it.
9728 * modules/Makefile.am (perl_la_SOURCES): Build new perl module.
9730 * src/m4.c (main): Assume interactive mode if STDIN is connected
9732 Changed startup sequence slightly so that syntax is not
9733 initialised from here when loading a frozen file.
9735 * src/builtin.c: Much improved macro definition style.
9736 * src/m4private.h: Internal structures for m4_builtin and
9737 m4_macro instances. These are not exposed to module writers.
9738 * src/module.c (module_modname_find): Find a module structure
9740 (make_macro_table): Build an internal macro table from a external
9742 (make_builtin_table): Build an internal builtin table from an
9743 external definition.
9745 * src/module.c (module_unload): Be extremely careful to remove
9746 builtins and macros that match the module being unloaded -- no
9747 longer assume that the top element can be removed incase another
9748 odule defines an identical name.
9749 * src/symtab.c (remove_table_reference_symbols): remove all symbol
9750 table entries which refer to a given builtin table.
9751 * src/builtin.c (remove_tables): Use it!
9753 2000-07-13 Thomas Tanner <tanner@ffii.org>
9755 * Makefile.am (SUBDIRS): we need modules/ for "make dist"
9756 * acm4/modules.m4: deleted
9757 * bootstrap: don't libtoolize libltdl!
9758 * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
9759 if set, enable WITH_MODULES and add modules to DLPREOPEN
9760 * examples/misc.test: redirect standard output
9761 * lib/Makefile.am: don't use DLLDFLAGS
9762 * lib/m4module.c: include necessary headers to silence GCC -Wall
9763 * lib/m4regex.c: fixes to silence GCC -Wall
9764 * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
9765 build modules conditionally
9766 * modules/shadow.c: define symbol aliases before using them
9767 * modules/test.c: define symbol aliases before using them
9768 * po/de.po: update translation
9769 * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
9770 pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
9772 * src/m4.c: initialize libltdl's preloaded symbols via
9773 LTDL_SET_PRELOADED_SYMBOLS
9774 * src/module.c: libltdl's memory management must be initialized
9775 before calling lt_dlinit!, fix warnings
9777 2000-01-18 Gary V. Vaughan <gary@gnu.org>
9779 * README: Caveat about nls not supported by dll architecture on
9782 * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
9784 * tests/Makefile.am (stamp-TESTS): now works with VPATH.
9785 * src/Makefile.am (m4_LDADD): use $(builddir) for VPATH.
9786 * modules/Makefile.am (LIBS): ditto.
9787 (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
9788 $(top_srcdir)/m4 (for only <m4module.h>).
9789 * modules/shadow.test: fixed for VPATH.
9790 * modules/modtest.test: ditto.
9791 * modules/modpath4.test: ditto.
9792 * modules/modpath3.test: ditto.
9793 * modules/modpath2.test: ditto.
9794 * modules/modpath1.test: ditto.
9796 * modules/time.test: Removed due to timezone dependence,
9797 * modules/Makefile.am (TESTS): Removed time.test.
9799 * configure.in: Use $3 of AC_DEFINE so that we can,,,
9800 * acconfig.h: Remove everything except the gettext parameters.
9801 * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
9803 * acm4/ltdl.m4: Updated to latest from libtool cvs.
9804 * acm4/modules.m4: Remove code which duplicates ltdl.m4 and
9805 increment serial number.
9807 * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
9808 src dir and immediately after libm4 is built for confidence that
9809 it doesn't rely on the src directory.
9810 (SUBDIRS): Moved doc dir to the end since helptoman.pl and
9811 makeinfo stop the build on cygwin (because they don't work).
9813 * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
9815 * m4/m4private.h: ...is not a public header, so moved to src.
9816 Add `#include <config.h>', `#define _COMPILING_M4' and
9818 * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
9819 * src/Makefile.am (noinst_HEADERS): add m4private.h.
9820 * src/builtin.c: `#include "m4private.h"' now takes care of the
9821 above. Duplicates removed.
9822 * src/debug.c: ditto.
9823 * src/eval.c: ditto.
9824 * src/evalmp.c: ditto.
9825 * src/format.c: ditto.
9826 * src/freeze.c: ditto.
9827 * src/input.c: ditto.
9829 * src/macro.c: ditto.
9830 * src/module.c: ditto.
9831 * src/numb.h: ditto.
9832 * src/output.c: ditto.
9833 * src/path.c: ditto.
9834 * stackovf.c: ditto.
9837 * po/POTFILES.in: compensate for renaming of lib/*.
9838 * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
9839 (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
9840 and then in $(top_srcdir)/lib (for eg. "m4private.h").
9841 * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
9843 * m4/m4error.h: Renamed error.h, for installation to
9844 $prefix/include/m4..
9845 * m4/m4obstack.h: Renamed obstack.h, for same reason.
9846 * m4/m4regex.h: Renamed regex.h, for same reason.
9847 * m4/m4error.c: Renamed error.c, and use #include "error.h".
9848 * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
9849 * m4/m4regex.c: Renamed regex.c, and fix #includes.
9851 * lib: moved to m4 to easily support header installation to
9853 * Makefile.am (SUBDIRS): renamed lib dir to m4.
9854 * configure.in (AC_OUTPUT): reference m4/Makefile.in.
9855 * acm4/regex.m4: Point to m4/regex.c.
9857 * examples/foreach.m4: Sanitise quoting.
9858 * examples/foreach.test: New torture test.
9859 From Akim Demaille <akim@epita.fr>
9861 2000-01-17 Gary V. Vaughan <gary@gnu.org>
9863 * src/ltdl.c: Use access() to abort doomed module load attempts
9864 if module file does not exist.
9866 * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
9867 getopt1.o will already be used if appropriate, so I moved getopt.c
9868 and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
9870 * modules/modpath1.test: Use correct filename in header line.
9871 * modules/modpath2.test: ditto.
9872 * modules/modpath3.test: ditto.
9873 * modules/modpath4.test: ditto.
9875 Without these changes lt_dlopen("test") attempts to
9876 LoadLibrary("/bin/test") on Windows, which although harmless
9877 generates a spurious error message which spoils most of the tests:
9878 * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
9879 (TESTS): s/test.test /modtest.test /
9880 (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
9881 (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
9882 * modules/modpath1.test: s/test.m4 /modtest.m4 /
9883 * modules/modpath2.test: ditto.
9884 * modules/modpath4.test: ditto.
9885 * modules/modpath3.test: s/-m test /-m modtest /
9886 * modules/shadow.m4: use {un,}loadmodule(`modtest').
9888 2000-01-16 Gary V. Vaughan <gary@gnu.org>
9890 * src/ltdl.c (find_file): Updated to new version with fixed memory
9891 allocation bug in `next'.
9892 * src/ltdl.h: updated to match.
9894 * modules/Makefile.am: Cleaned up and reordered.
9896 2000-01-16 René Seindal <rene@seindal.dk>
9898 * modules/Makefile.am (TESTS): New tests for the module system.
9900 * modules/*.test: New files.
9902 * src/m4.c (main): Added call to module_init().
9903 Treats -M and -m as the arguments -D -U and -t, ie deferred.
9905 * src/m4.h: Added declaration of module_init().
9907 * src/module.c (module_init): No longer static
9909 * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
9910 Added to shut up automake about non standard libtool library
9913 * src/module.c: Disabled DEBUG by default.
9915 * modules/README: Changed example from unload.m4 to shadow.m4
9917 * modules/shadow.m4: Renamed from unload.m4
9919 * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
9921 * src/m4.c (main): Functionality for -m and -M were reversed.
9924 2000-01-12 Gary V. Vaughan <gary@gnu.org>
9926 * doc/help2man.pl: updated to version 1.020.
9928 * lib/COPYING.LIB: updated to version 2.1.
9930 * lib/m4module.h: restructure the M4_SCOPE code to work when
9931 creating a dll which links with libm4.la and both DLL_EXPORT
9932 (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
9935 2000-01-11 Gary V. Vaughan <gary@gnu.org>
9937 Merged the following changes from my tree:
9939 1999-06-15 Gary V. Vaughan <gary@gnu.org>
9941 * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
9942 ported to compile shared libs.
9944 * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
9945 use `__declspec(dllimport)' when linking libm4.la on win32.
9946 * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
9948 * configure.in (M4OBJS): Discover whether we need the shipped
9949 implementation of getopt_long.
9950 * src/Makefile.am (m4_LDADD): Link the getopt objects into the
9951 main binary here, as opposed to the module library in lib/libm4.la.
9953 1999-06-14 Gary V. Vaughan <gary@gnu.org>
9955 * modules/README: Updated to describe the improved libltdl based
9957 * README (cygwin): Added some compilation notes for building m4
9958 correctly under cygwin.
9959 * TODO: Cleaned out the entries for the module system since they
9960 are now implemented.
9962 * *.[ch]: __P is in the compiler's reserved namespace, so replaced
9963 all instances of __P with M4_PARAMS.
9965 * lib/getdate.h: removed unreferenced file.
9967 * lib/m4private.h: New file to define the private interface to the
9968 token_data struct, which must be shared between m4module.c, and
9969 builtin.c but not exported to modules built from the installed
9970 m4module.h since it's size changes depending on compile time
9973 * src/m4.h: Lots of stuff moved to lib/m4module.h.
9975 * lib/m4module.h: New file to define the interface available when
9976 compiling m4 modules.
9977 * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
9978 necessary for module compilation into this new file.
9980 * lib/Makefile.am (include_HEADERS): install headers (renamed to
9981 avoid nameclash with other system headers) necessary for compiling
9983 (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
9984 so that modules can include the (renamed) installed headers and
9985 be guaranteed a matching implementation.
9986 * lib/m4error.h: renamed from error.h.
9987 * lib/m4obstack.h: renamed from obstack.h.
9988 * lib/m4regex.h: renamed from regex.h.
9989 * configure.in (AC_REPLACE_FUNCS): Don't look for a system
9990 implementation, simply include the shipped version
9991 unconditionally, otherwise it is hard for a module to know
9992 whether the m4obstack.h header it is using matches the
9993 implementation it ends up linking against.
9994 (jm_WITH_REGEX): Include regex into libm4 unconditionally for
9997 1999-05-18 Gary V. Vaughan <gary@gnu.org>
9999 * examples/misc.test: Don't run this test on machines which don't
10000 have a root user in /etc/passwd (e.g. cygwin).
10002 * tests/get-them (/^@example$/): Error messages might have a
10003 ``.exe'' suffix to the program name, or else use the libtool
10004 ``.libs/lt-m4'' binary, or generally have an unexpected path. All
10005 of these cases are now catered for when comparing error messages
10006 in generated tests.
10007 * tests/other-tests/*.test: ditto.
10008 * examples/*.test: ditto.
10010 * tests/defs (M4): use libtool execute mode.
10011 * examples/defs (M4): ditto.
10013 * tests/get-them (END): explicitly close any open file.
10014 (printthem): In a regular expression, '{' is the start of a repeat
10015 count! Use `[{]' for a literal open brace.
10016 (/^@node /): Don't use substr on a string shorter than the trim
10019 1999-05-17 Gary V. Vaughan <gary@gnu.org>
10021 * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
10023 (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
10025 2000-01-10 Andreas Schwab <schwab@suse.de>
10027 * tests/other-tests/gmp.test: Find config.sh in build directory.
10029 * configure.in: Find tests/mkconfig.sh in $srcdir.
10031 * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
10032 <signal.h> (for SUS2 compliant systems).
10034 * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
10037 2000-01-10 René Seindal <rene@seindal.dk>
10041 * TODO, NEWS: Cleaned up and updated.
10043 * src/m4.c (main): New variable exit_status for exit status in
10044 case of unreadable files. Now m4 will exit with EXIT_FAILURE if a
10045 file cannot be read instead of EXIT_SUCCESS.
10047 * src/builtin.c (m4_indir): Changed error message to help
10048 translators (from Akim Demaille <demaille@inf.enst.fr>).
10050 * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
10053 * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
10056 * src/input.c (match_input): Reordering of code, to avoid multiple
10057 calls to push_string_init() from obstack_grow(), which can happen
10058 with some compilers (found and fixed by James Bonfield
10059 <jkb@mrc-lmb.cam.ac.uk>).
10061 * src/stackovf.c: Added prototypes for ultrix.
10062 (setup_stackovf_trap): Added __P to cast.
10063 (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
10065 2000-01-09 René Seindal <rene@seindal.dk>
10067 * doc/m4.texinfo (Changequote): Added comment about changing
10068 quotes when the old quote is a part of the new.
10070 * src/builtin.c (expand_ranges): Added break after trailing dash.
10071 This caused misbehavious on some systems (found and fixed by Akim
10072 Demaille <demaille@inf.enst.fr>).
10074 * AUTHORS: Thomas Tanner included
10076 * acconfig.h: Added entry for ss_sp (see below).
10078 * configure.in (use_stackovf): Added check for stack_t with member
10079 ss_base instead of ss_sp (BSDI notably). (Reported by Paul Eggert
10080 <eggert@twinsun.com>).
10082 * doc/m4.texinfo (Frozen files): Added a simpler example for
10083 generating frozen files from several input files.
10085 1999-11-14 Paul Eggert <eggert@twinsun.com>
10087 * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
10088 lib/regex.c, lib/xmalloc.c.
10090 1999-11-10 René Seindal <rene@seindal.dk>
10092 * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
10094 * src/module.c: reindented.
10095 (module_load): return if this is a repeated load of same module.
10096 (module_init): slight change of logic to avoid repeated
10097 initialisation debug messages.
10099 * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
10100 in the distribution.
10102 * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
10103 automake warnings about missing lib prefix.
10104 (time_la_LDFLAGS): ditto
10105 (stdlib_la_LDFLAGS): ditto
10107 1999-11-10 Paul Eggert <eggert@twinsun.com>
10109 * src/m4.h: Include error.h, since our macros use error.
10110 * src/m4.c: Don't need to include error.h.
10112 1999-11-09 Paul Eggert <eggert@twinsun.com>
10114 * src/m4.h (voidstar): Define to void * if __STDC__ is defined
10115 and zero, as Solaris 7 cc does.
10116 (bcopy): Remove macro; no longer needed with new obstack.h.
10118 * src/output.c (freeze_diversions): Don't assume that a
10119 diversion size can fit in `int'. Check for diversion file
10120 size too large to be printed with `unsigned long'.
10122 * src/Makefile.am (CFLAGS): Omit -Wall.
10124 * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
10126 * src/debug.c (trace_format):
10127 Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
10129 * src/freeze.c (produce_frozen_state):
10130 Don't assume string lengths fit in int.
10132 1999-10-13 René Seindal <rene@seindal.dk>
10134 * po/cs.po: Czech translation added.
10136 * po/sv.po: Updated Swedish translation.
10138 * po/ru.po: Updated Russian translation.
10140 * po/pl.po: Updated Polish translation.
10142 * po/el.po: Greek translation added.
10144 1999-10-13 René Seindal <rene@seindal.dk>
10146 * configure.in (ALL_LINGUAS): Added Greek translation (el).
10147 (ALL_LINGUAS): Added Czech translation (cs).
10149 1999-03-30 Gary V. Vaughan <gary@gnu.org>
10151 * src/builtin.c: moved module loading functions into...
10152 * src/module.c: entirely new implementation using libltdl.
10153 * po/POTFILES.in: added src/module.c.
10154 * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
10155 are modules, not linktime libraries.
10156 (LDFLAGS): added -no-undefined -module and -avoid-version flags.
10157 * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
10158 avoidance on exported symbols.
10159 * modules/test.c (m4_macro_table, m4_init_module,
10160 m4_finish_module): ditto.
10161 * modules/time.c (m4_macro_table): ditto.
10163 * modules/time2.m4: new file which requires command line loading
10165 * src/m4.c (--load-module): dynamically load named runtime module
10166 into running executable before reading the source.
10167 (--module-directory): prepend a directory to the module search
10169 (module_init()): Do this the first time we load a module instead;
10170 if the module subsystem is broken normal m4 scripts can still run.
10171 * src/m4.h (install_builtin_table): is now exported.
10173 1999-03-26 Gary V. Vaughan <gary@gnu.org>
10175 * src/module.c: removed. No longer required.
10176 * po/POTFILES.in: removed src/module.c.
10178 * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
10179 the bootstrap script can recreate.
10180 * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
10181 * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
10182 * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
10183 * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
10184 (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
10185 * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
10186 * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
10187 * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
10189 * acinclude.m4: removed. `aclocal -I acm4' handles this much
10191 * acm4/Makefile.am (ACINCLUDE_M4): ditto.
10192 * acm4/gettext.m4: removed. It causes a multiple definition vs.
10193 the installed gettext.m4 file when running aclocal.
10195 1999-03-25 Gary V. Vaughan <gary@gnu.org>
10197 * configure.in (AM_INIT_AUTOMAKE): bumped version number to
10198 distinguish this from the last prerelease.
10199 (AC_LIBLTDL_CONVENIENCE): build libltdl as a convenience library
10200 in its own subdirectory.
10202 * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
10203 lib prefix on a module" feature.
10204 (LDFLAGS): Added `-module -avoid-version' flags to build
10205 versionless module libraries.
10206 * src/builtin.c (m4_load_module): use libltdl.
10207 (module_unload_all): use libltdl.
10208 * src/m4.c (module_init): initialise module loading on demand for
10209 better diagnostics, and so that m4 will still work even if
10210 the module code is broken.
10211 * src/m4.h (module_init): removed. No longer relevant.
10212 * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
10213 exported symbols for compatibility with dlpreopening.
10214 * modules/test.c (m4_macro_table, m4_init_module,
10215 m4_finish_module): ditto.
10216 * modules/time.c (m4_macro_table): ditto.
10218 * bootstrap: New file. Runs all the autoutils in the right order
10219 after a fresh checkout, or a make maintainer-clean.
10221 1999-02-18 Akim Demaille <demaille@inf.enst.fr>
10223 * src/builtin.c (dump_symbols): New function, factoring common
10224 content of m4_dumpdef and m4_symbols.
10225 (m4_dumpdef): Use it.
10226 (m4_symbols): New function, implementing `symbols'. Use it.
10227 * doc/m4.texinfo: Fixed missing commas after @xref, so that the
10228 file compile with modern makeinfo.
10229 (Symbols): New node, documenting symbols.
10230 (direntry): Modernize.
10232 1998-12-11 René Seindal <rene@seindal.dk>
10234 * src/builtin.c (predefined_tab): New predefined macros
10235 __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
10236 configure time options.
10238 1998-12-01 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
10240 * src/module.c (module_try_load): Don't try to be clever and
10241 overwrite argument string. Instead allocate all constructed
10242 strings locally, since they can have arbitrary lengths. Make
10243 arguments pointers to const.
10244 (module_search): Simplify due to above change.
10246 1998-11-29 René Seindal <rene@seindal.dk>
10250 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
10252 * tests/other-tests/import-environment.{m4,test}: New test.
10254 * tests/other-tests/discard-comments.{m4,test}: New test.
10256 * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
10258 * src/m4.c (main): New option -c --discard-comments.
10259 New global variable discard_comments.
10261 * src/m4.h (token_type): New TOKEN_NONE for tokens to be
10262 discarded, ie never returned from next_token().
10263 Added declaration of discard_comments.
10265 * src/input.c (next_token): Now loops until token type is not
10266 TOKEN_NONE. Comments are now given this type when comments should
10269 * doc/m4.texinfo (Invoking m4): Updated for --import-environment
10272 1998-11-28 René Seindal <rene@seindal.dk>
10274 * src/m4.c (main): New option --import-environment (no single
10277 * When configured with --with-gmp both the normal (fast) eval()
10278 and the gmp aware mpeval() are defined. To restore previous
10279 bahaviour use "define(`eval', defn(`mpeval'))".
10281 * tests/other-tests/gmp.m4: Changed to use mpeval().
10283 * src/evalmp.c: New file for compiling eval.c as gmp aware.
10284 Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
10286 * src/eval.c: Now includes "numb.c" directly. Everything in this
10287 file must by static, except evaluate(), which is changed to
10288 mp_evaluate() if USE_GMP in force.
10290 * src/numb.c: Changed to be included by eval.c instead of being
10291 compiled separately. Everything is declared static.
10293 * src/numb.h: Removed declarations of functions, as numb.c is now
10294 included by eval.c.
10296 * src/builtin.c: Declaration of m4_mpeval() added.
10297 Inserted `mpeval' in builtin table.
10298 (do_eval): New function with common code for m4_eval and m4_mpeval.
10299 (m4_mpeval): New function for gmp version of eval.
10301 * src/m4.h: Declaration of mp_evaluate().
10303 * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
10304 (EXTRA_m4_SOURCES): Now has numb.c and numb.h
10306 * src/m4.c (main): m4 --version also shows which options were used
10307 for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
10309 1998-11-27 René Seindal <rene@seindal.dk>
10311 * Error messages now always print program name before input file
10312 name as specified by GNU coding standards. Reported by Akim
10313 Demaille <demaille@inf.enst.fr>.
10315 * doc/m4.texinfo (Include): Change due to changed error message
10319 * tests/get-them: Minor change to sed script due to changed error
10322 * src/m4.c (print_program_name): New func used to print program
10323 name, input file and line number in error (). Used as an
10324 error_print_progname handler.
10325 (reference_error): Removed.
10326 (main): Assigns error_print_progname.
10328 * src/m4.h (M4ERROR): Removed reference_error ().
10330 1998-11-25 René Seindal <rene@seindal.dk>
10332 * Updated to libtool 1.2b.
10334 * src/builtin.c (install_builtin_table): Added braces to avoid
10335 warning of ambiguous 'else'.
10337 * src/module.c: Inserted search path code from path.c modified to
10339 (module_init): Configured default path used only if M4MODPATH is
10341 (module_try_load): Now reads libMODULE.la as generated by libtool
10342 for actual module name.
10343 (module_load): Gives better error messages on failure.
10345 * src/m4.h: Added declarations of structures and functions for
10346 generic search path handling.
10348 * src/path.c: Removed all module specific code and introduced new
10349 functions of more generic search path handling.
10351 1998-11-24 René Seindal <rene@seindal.dk>
10353 * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
10354 included gettext, as <libintl.h> might not be found
10355 otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
10357 1998-11-22 René Seindal <rene@seindal.dk>
10359 * src/output.c (insert_diversion): Fixed bug that might cause m4
10360 to read from standard output! Triggered by input
10361 'divert(1)undivert(0)'. Test for divnum>0 changed to divnum>=0,
10362 so now 'undivert(0)' does nothing.
10364 1998-11-18 René Seindal <rene@seindal.dk>
10368 * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
10369 could be changed when compiling a illegal regexp, causing later
10370 use of the regexp to dump core.
10372 * src/module.c (module_load): Changed error message to conform to
10375 * src/m4.c (usage): Added message about reporting bugs.
10377 * doc/m4.texinfo (Changeword): Corrected a wrong example.
10378 (Changeword): Added note about the type of regexps used.
10380 * ltconfig, ltmain.sh: New files from Libtool 1.2.
10382 * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
10383 and AM_PROG_LIBTOOL.
10385 * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
10388 * modules/Makefile.am: Changed completely to compile modules using
10389 libtool. The modules are compiled as shared libraries, and are
10390 renamed when installed.
10392 * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
10393 USE_SHL_LOAD to HAVE_SHL_LOAD
10395 * src/builtin.c (shipout_string): Now tests for a NULL string.
10397 * src/module.c: New level of indirection around non-portable
10398 functions to load shared objects. Intended to encapsulate the non
10399 portable parts better and to reduce the number of #ifdefs in the
10402 * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
10403 directory modules/ to the distribution.
10405 1998-11-15 René Seindal <rene@seindal.dk>
10409 * modules/stdlib.c: New module `stdlib' defining some standard
10410 functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
10411 getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
10413 * src/builtin.c (shipout_string): New convenience function for
10414 builtins and modules.
10416 * src/module.c (module_load): Tentative support for
10417 shl_load/shl_findsym, but I cannot test it. Copied from MetaHTML.
10419 * Makefile.am (SUBDIRS): Directory modules added if configured.
10421 * modules/Makefile.am: Now correctly compiles and installs
10422 modules in pkglibexecdir.
10424 * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
10425 These two are now initialised by autoconf macros.
10427 * src/path.c (module_env_init): MODULE_PATH is always on the
10430 * src/Makefile.am: Now generated pathconf.h which defined the
10431 default MODULE_PATH.
10433 * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
10434 where modules are installed.
10436 * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
10437 by Brian J. Fox <bfox@datawave.net>. This change allow modules to
10438 build and install automatically, and it is prepared for other
10439 interfacec than dlopen().
10441 * src/builtin.c (predefined_tab): Added __m4_version__ for the
10442 current version of GNU m4. It is a GNU extension.
10444 1998-11-14 René Seindal <rene@seindal.dk>
10446 * tests/Makefile.am (GENERATED_TESTS): Added new
10447 generated-tests/changesy.8.test
10449 * doc/m4.texinfo (Changesyntax): Documentation for escape
10452 * src/macro.c (expand_token): Check for escaped macro call before
10453 symbol table lookup.
10455 * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
10458 * src/input.c: New static variable use_macro_escape, which is TRUE
10459 iff some character has code SYNTAX_ESCAPE
10460 (input_init): Added initialisation of use_macro_escape.
10461 (check_use_macro_escape): New function to synchronise
10462 use_macro_escape with the syntax table.
10463 (set_quotes): Added call to check_use_macro_escape()
10466 (next_token): Added new case for IS_ESCAPE.
10468 * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
10470 1998-10-13 René Seindal <rene@seindal.dk>
10474 * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
10477 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
10478 maintained tests in tests/other-tests. These currently tests for
10479 8-bit transparency, multiple precision arithmetic and sync-line
10480 output. Test for stackoverflow detection does not work.
10482 * examples/Makefile.am (TESTS): Added tests for all example files.
10484 * examples/mktests.sh: New file. Help program for creating test
10487 * tests/mkconfig.sh: New file to generate tests/config.m4 and
10488 tests/config.sh. This is for tests of configure selectable
10489 features. Picks up all set WITH_ and ENABLE_ veriables from
10492 * src/path.c (path_search): Added argument 'char **expanded_name'
10493 to return the expanded name.
10495 * src/m4.h: Added 2nd argument to declaration of path_search().
10497 * src/m4.c (main): Added 2nd argument to path_search().
10499 * src/freeze.c (reload_frozen_state): Do.
10501 * src/builtin.c (m4_undivert): Do.
10504 1998-10-11 René Seindal <rene@seindal.dk>
10506 * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
10508 * acm4/modules.m4: New file. Defines AM_WITH_MODULES.
10510 * acm4/gmp.m4: New file. Defines AM_WITH_GMP.
10512 * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
10514 * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
10516 * intl/: Updated to GNU gettext 0.10.35.
10518 * doc/m4.texinfo (Format): Documented that format is blind.
10520 * src/builtin.c (builtin_tab): Builtin format marked as blind.
10522 1998-10-07 René Seindal <rene@seindal.dk>
10526 * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
10527 .test, as the files are no longer just m4 input.
10529 * tests/get-them (FILE): Changed .m4 extension to .test.
10531 * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
10532 Otherwise quoted strings with leading whitespace first in a macro
10533 argument would be eliminated.
10535 * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
10536 (expand_argument): Do.
10538 * src/input.c (next_token): SPACE and NUM/OTHER characters are only
10539 grouped together iff both quote and comment strings are single
10540 character. Otherwise they might include a comment/quote leader.
10541 (next_token): Returns new token type TOKEN_SPACE.
10543 * src/builtin.c (push_builtin_table): New function to push a
10544 builtin_table on the stack without installing its contents.
10545 (find_builtin_by_name): Added call to push_builtin_table() if
10546 reading frozen files. Otherwise the builtins named in the frozen
10547 files could not be found.
10548 (install_builtin_table): Changed to use push_builtin_table()
10550 1998-10-04 René Seindal <rene@seindal.dk>
10552 * po/pl.po: Polish translation added.
10554 * po/POTFILES.in: src/module.c added.
10556 1998-10-04 René Seindal <rene@seindal.dk>
10560 * configure.in (ALL_LINGUAS): Added Polish pl.po
10562 1998-10-03 René Seindal <rene@seindal.dk>
10564 * Many files: Incorporated changes to implement dynamic modules.
10565 Detailed comments in src/modules.c and modules/README
10567 * src/module.c: New file, implements the OS dependant parts of
10568 dynamic module loading.
10570 * src/Makefile.am (m4_SOURCES): Added module.c
10572 * src/builtin.h: New file, declares some functions from builtin.c
10573 that are of use for other modules (shipout_int, numeric_arg,
10574 skip_space, bad_argc), and the macros ARG() and DECLARE().
10576 * src/builtin.c (install_builtin_table): New function. Each
10577 module brings in a builtin_table, which is pushed on a stack.
10578 (struct builtin_table): New struct for list of builtin_tables.
10579 (m4_loadmodule): New function to implement builtin "loadmodule".
10580 (shipout_int): No longer static, to be used by modules.
10584 (builtin_init): changed to call install_builtin_table()
10585 (find_builtin_by_name): Now searches all builtin_tables
10586 (find_builtin_by_addr): do.
10588 * src/path.c: Reorganised to allow for two search paths, one for
10589 include files and one for modules.
10591 * src/m4.h: Added declarations for new functions in module.c and
10594 * src/m4.c (main): Added call to module_init().
10596 * modules: New directory with a few demo modules.
10598 * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
10601 * configure.in: Added modules/Makefile to AC_OUTPUT.
10603 * configure.in: Added code to implement --with-modules. Tests for
10604 <dlfcn.h> and -ldl.
10606 * acconfig.h: Added WITH_MODULES
10608 1998-10-02 René Seindal <rene@seindal.dk>
10610 * examples/Makefile.am (pkgdata_DATA): Removed special target for
10611 check and variables TESTS. These tests are now run from the
10614 * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
10615 directory. The files stay there but the tests are run from the
10618 * tests/Makefile.am (EXTRA_DIST): Added run-test.
10620 * tests/run-test: New file. Run a test manually
10622 * tests/Makefile.am, tests/get_them: Moved automatically generated
10623 tests (from the manual) to sub directory tests/gentest/. The
10624 tests/ directory had gotten a bit messy.
10626 1998-09-06 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10628 * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
10629 wrap}.test: Added a few testcases.
10631 1998-08-21 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10635 * lib/Makefile.am (noinst_HEADERS): regex.h added
10637 * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
10638 acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
10640 * acm4/Makefile.am: created providing rules to create
10641 $(top_srcdir)/acinclude.m4 to be used by aclocal.
10643 * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
10644 `C'. Reported by Ulrich Drepper.
10646 * Makefile.am (SUBDIRS): Removed checks directory
10647 * configure.in (AC_OUTPUT): Removed checks/Makefile
10649 * doc/m4.texinfo (Patsubst,example): @comment added to preserve
10650 the space when m4.texinfo is edited and whitespace.el is active.
10651 (Defn,example): idem.
10653 1998-08-20 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10655 * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
10656 ../COPYING. ../Makefile is a file which is certainly present when
10657 test is executed in testSubDir. One can't be sure that the COPYING
10658 file is in .. or ../.. in all situations, the ../Makefile is
10661 * doc/m4.texinfo (Include): adjusted expected test output
10662 according to new tests, i.e. the input will always come from the
10663 file `in' created by the test.
10665 * tests/Makefile.am: Added three lines at the top to get
10666 esyscmd.1.test working.
10668 * tests/get-them: modified to generate clearer tests who will need
10669 less maintenance when new test examples are created in
10670 `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
10671 need the generic file `defs') shell scripts creating `in', `ok',
10672 `out' and when apropriate `okerr' and `err' in the directory
10673 `testSubDir' when executed. The compare of `ok' and `out'
10674 (and of `okerr' and `err') will be the exit status of the test.
10675 `out' must match `ok' (and `okerr' must match `err') for the test
10678 * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
10679 the tests generated by tests/get-them getting it input normally
10680 from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
10681 (dot) before the numeric part) is reserved for all other (hand
10682 written) tests. The `+' means one or more times.
10684 1998-08-12 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10686 * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
10687 supported short man page to refer to info documentation
10688 * helptoman.pl: added
10689 * configure.in: AC_PATH_PROG(PERL,perl)
10690 * Makefile.am (SUBDIRS): doc after src
10692 * libitized with libit 0.5 from
10693 ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
10695 * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
10696 * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
10697 replacement functions, (libm4_a_LIBADD): @LIBOBJS@
10698 * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
10699 lib/rx.{c,h}: added
10700 * configure.in (AC_CHECK_FUNC): getopt_long
10702 * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
10704 * TODO: added entry about dependencies
10706 1998-08-10 René Seindal <rene@seindal.dk>
10710 * doc/m4.texinfo (Changesyntax): Added documentation for the macro
10713 * src/builtin.c (m4_changesyntax): Added builtin macro
10714 "changesyntax" to modify the syntax table.
10716 * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
10717 table. All categories are assigned a syntax code and tokens are
10718 read according to this table.
10720 1998-08-09 René Seindal <rene@seindal.dk>
10722 * src/numb.{c,h}: New files, implements multiple precision eval
10723 using GNU gmp. Originally submitted by John Gerard Makecki
10724 (johnm@vlibs.com), later modified. Tested with GNU gmp 2.0.2.
10726 * doc/m4.texinfo (Eval): Added documentation for multiple
10727 precision arithmetic library support.
10729 * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
10730 to accommodate multiple precision eval.
10732 1998-08-07 René Seindal <rene@seindal.dk>
10734 * src/input.c (MATCH, match_input), src/m4.h: changed definition
10735 of comment and quote strings to `unsigned int' to allow eight bit
10736 chars (reported by andrewb@zip.com.au (Andrew Bettison)).
10738 * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
10739 patch from Mike Howard <mike@clove.com>
10741 1998-08-06 René Seindal <rene@seindal.dk>
10743 * gettext.m4: corrected AM_WITH_NLS to handle use of installed
10746 1998-08-03 René Seindal <rene@seindal.dk>
10750 * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
10751 and _ macro. M4 now builds with --disable-nls.
10753 * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
10754 to look for right message catalogs. Call indef'ed by ENABLE_NLS.
10756 * configure.in (ALL_LINGUAS): Added complete list of translations:
10757 de fr it ja nl ru sv.
10759 1998-05-23 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10761 * po/nl.po: Dutch translation by Erick Branderhorst.
10763 * po/fr.po: French translation by Erick Branderhorst, based on the
10764 translations by François Pinard in fr.msg and m4.cod.
10766 1998-05-22 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10770 * src/m4.c: #include <signal.h> not <sys/signal.h>.
10772 * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
10774 * checks/Makefile.am: explicit list tests in CHECKS.
10776 * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
10777 src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
10778 mkinstalldirs, install-sh: Added automake (1.3) support.
10780 * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
10781 obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
10782 Used libitize (0.4) to update.
10784 * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
10785 (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
10786 README accordingly.
10788 * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
10789 stack overflow functionality.
10791 1994-12-03 François Pinard <pinard@iro.umontreal.ca>
10793 * Prerelease 1.4.1.
10795 * Makefile.in (realclean-local): Delete stamp-h.in.
10797 * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
10798 Localize, adapting from how it is done in sharutils.
10800 * fr.tt: New file, for French.
10802 * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
10803 src/freeze.c: Rename PRODUCT to PACKAGE.
10805 1994-11-26 François Pinard <pinard@iro.umontreal.ca>
10807 * configure.in: Check for <libintl.h> and <locale.h>.
10808 * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
10809 src/stackovf.c: Rename _ to __P.
10810 * src/m4.h: Declare _ as a macro returning its argument, or else,
10811 include <libintl.h> and declare _ as gettext.
10812 * src/m4.c: Possibly include <locale.h> and call setlocale.
10813 * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
10814 src/input.c, src/macro.c, src/output.c, src/path.c,
10815 src/stackovf.c, src/symtab.c: Use _ macro over all localizable
10818 1994-11-07 François Pinard <pinard@iro.umontreal.ca>
10820 * doc/Makefile.in (stamp-vti): Use new -r option to date.
10822 * configure.in: Put --with-gmp in place, in prevision for John
10824 * acconfig.h: Document WITH_GMP.
10826 1994-11-05 François Pinard <pinard@iro.umontreal.ca>
10830 * doc/Makefile.in (realclean): Also remove stamp-vti.
10831 Reported by Eric Backus.
10833 1994-11-02 François Pinard <pinard@iro.umontreal.ca>
10835 * src/freeze.c (produce_frozen_state): If the frozen file cannot
10836 be opened, return immediately after producing the error message.
10837 Reported by Andreas Schwab.
10839 * configure.in: Check for const only after having found possible
10840 ANSIfying compiler flags, this is of no use to check it before.
10841 Reported by Alexander Lehmann.
10843 1994-11-01 François Pinard <pinard@iro.umontreal.ca>
10845 * src/macro.c (collect_arguments): Cast obstack arguments to
10846 (voidstar), so avoiding compiler warnings.
10847 Reported by Joseph E. Sacco.
10849 * src/freeze.c (produce_frozen_state): Cast printed lengths to
10850 (int) so they correspond to %d format items.
10851 Reported by Joseph E. Sacco.
10853 * src/m4.c (main): Cast the argument to xfree to (voidstar).
10854 * src/symtab.c (free_symbol): Idem.
10855 Reported by Karl Vogel.
10857 1994-10-31 François Pinard <pinard@iro.umontreal.ca>
10859 * Makefile.in (DISTFILES): Distribute BACKLOG.
10861 * configure.in: Define PRODUCT and VERSION.
10862 * acconfig.h: Document PRODUCT and VERSION.
10863 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
10864 constant string m4 and variable or parameter named version.
10866 1994-10-30 François Pinard <pinard@iro.umontreal.ca>
10868 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
10869 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
10870 defines __STDC__ to 0, for indicating it is *not* ANSI!
10871 Reported by Kaveh R. Ghazi.
10873 * configure.in: Added obsolescent tests for AIX and Minix.
10875 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
10876 which texclean does not exist anymore.
10877 Reported by Eric Backus, Jim Meyering, John David Anglin and
10880 1994-10-29 François Pinard <pinard@iro.umontreal.ca>
10882 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
10883 Reported by John David Anglin.
10885 * src/ansi2knr.c: New version, sent by Peter Deutsch.
10886 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
10887 ANSI2KNR, depending on the fact the compiler is ANSI or not.
10888 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
10889 Remove the sed filter after ansi2knr for debug.c. Use $O instead
10890 of $U, put underline in extensions rather than in basenames. Use
10891 implicit rules, now that regularity makes this possible.
10892 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
10893 of ansi2knr whenever it is needed.
10894 * configure.in: Adjusted for correct STACKOVF substitution.
10895 * src/debug.c (trace_format): When not __STDC__, use (...) as a
10896 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
10897 Reported by David MacKenzie.
10899 * Makefile.in: Remove binprefix. Use transform_name instead.
10900 Reported by David MacKenzie.
10902 * doc/Makefile.in: Create version.texi, use it, clean it.
10903 Reported by Jim Meyering.
10905 1994-10-28 François Pinard <pinard@iro.umontreal.ca>
10907 * Makefile.in (all, install, uninstall): Depend on Makefile.
10909 * Makefile.in: For actions invoking $(MAKE) from within compound
10910 sh statements, exit non-zero if the sub-make fails. Otherwise,
10911 the top-level make may exit successfully when it should fail.
10912 Reported by Jim Kingdon.
10914 * {,/*}Makefile.in: Use && after all cd, in case they fail.
10916 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
10917 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
10918 * configure.in: Substitute PRODUCT and VERSION.
10920 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
10922 1994-10-27 François Pinard <pinard@iro.umontreal.ca>
10924 * Makefile.in (mostlyclean-local): Do not remove *~.
10925 * */Makefile.in (mostlyclean): Idem.
10926 Reported by Robert E. Brown and Richard Stallman.
10928 1994-10-09 François Pinard <pinard@iro.umontreal.ca>
10930 * src/m4.h: Get rid of CONFIG_BROKETS.
10932 1994-10-02 François Pinard <pinard@iro.umontreal.ca>
10934 * configure.in: Use AC_ARG_PROGRAM.
10935 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
10936 Reported by David MacKenzie.
10938 1994-10-01 François Pinard <pinard@iro.umontreal.ca>
10940 * configure.in: Do not add -O to CFLAGS for GNU C, now that
10941 configure does it automatically.
10942 Reported by Jim Meyering.
10944 1994-09-23 François Pinard <pinard@iro.umontreal.ca>
10946 * src/stackovf.c: Declare the handler_t typedef earlier in the
10947 code, use it for stackovf_handler.
10948 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
10949 casting sigsegv_handler.
10950 Reported by Robert Bernstein.
10952 * src/m4.c (main): Initialize program_name to argv[0] without
10954 Reported by Karl Berry.
10956 1994-09-18 François Pinard <pinard@iro.umontreal.ca>
10958 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
10959 Reported by Karl Berry.
10961 1994-09-14 François Pinard <pinard@iro.umontreal.ca>
10963 * lib/Makefile.in (mostlyclean): Added.
10964 (TAGS): Make in $(srcdir).
10966 * configure.in: Use `choke me' in test, like everywhere!
10968 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
10969 unreacheable and useless.
10971 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
10973 * lib/Makefile.in (DISTFILES): Distribute TAGS.
10974 (distclean): Do not remove TAGS.
10975 (realclean): Remove it.
10976 * Makefile.in: Make TAGS in lib also, not just in src.
10977 Reported by Karl Berry.
10979 * Makefile.in (distclean, realclean): Instead of recursively
10980 calling $(MAKE) for the -local part, allow parallel execution of
10981 -recursive and -local, only delay the removal of config.status,
10982 which is repeated in both goals.
10984 1994-09-13 François Pinard <pinard@iro.umontreal.ca>
10988 * Makefile.in: Group all *clean-recursive goals in one, using sed
10989 to remove `-recursive' while calling make recursively. Also, use
10990 a subshell for each recursive $(MAKE).
10991 Reported by Jim Meyering.
10993 * src/m4.h (memcpy): Define with bcopy for BSD systems.
10994 Reported by Kaveh R. Ghazi.
10996 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
10997 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
11000 * configure.in: Use date instead of touch for stamp-h.
11001 * Makefile.in (stamp-h.in): Idem.
11003 * Makefile.in (distclean, realclean): Force serial execution of
11004 both goals, in case parallel makes are being used.
11005 Reported by Jim Meyering.
11007 * src/Makefile.in (DISTFILES): Distribute TAGS.
11008 (distclean): Do not remove TAGS.
11009 (realclean): Remove it.
11010 Reported by Karl Berry.
11012 1994-09-10 François Pinard <pinard@iro.umontreal.ca>
11014 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
11015 to old names, for following Autoconf.
11017 1994-09-08 François Pinard <pinard@iro.umontreal.ca>
11019 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
11020 ./install.sh will not be correctly referred to in sub-Makefiles.
11021 Reported by John David Anglin.
11023 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
11024 Reported by Eric Backus.
11026 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
11027 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
11028 config.status into remaking this directory's Makefile only.
11029 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
11030 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
11031 Reported by Jim Meyering.
11033 1994-09-06 François Pinard <pinard@iro.umontreal.ca>
11035 * configure.in: Correct stack overflow detection logic, taking
11036 care of systems having only incomplete implementations (like for
11037 Pyramid 9820 OSx 5.0d).
11038 Reported by Kaveh R. Ghazi.
11040 * src/Makefile.in (TAGS): Remote -t from etags call.
11042 1994-09-02 François Pinard <pinard@iro.umontreal.ca>
11044 * lib/Makefile.in (install): Depend on all.
11046 1994-08-31 François Pinard <pinard@iro.umontreal.ca>
11048 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
11049 Reported by Jim Meyering and John David Anglin.
11051 * Makefile.in (distclean-local): Delete config.log.
11052 Reported by Jim Meyering.
11054 Solidify frozen files with respect to -P:
11055 * src/m4.c: Have -P set prefix_all_buitins variable instead of
11056 calling a function by that name. Declare the variable.
11057 * src/m4.h: Adjust declaration for prefix_all_buitins.
11058 * src/builtin.c (builtin_init): Merge in functionality from
11059 previous prefix_all_buitins function, while making entries in the
11060 symbol table, but not modifying the builtin description itself.
11062 * src/freeze.c (reload_frozen_state): Add a useless `break;',
11063 because *many* compilers do not accept an empty `default:'.
11064 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
11065 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
11067 * configure.in: Use AC_TYPE_SIGNAL.
11068 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
11069 Reported by Robert Bernstein.
11071 * checks/Makefile.in (check): Modify PATH so check-them will find
11072 m4 in the src directory.
11073 * Makefile.in (check): Don't.
11074 Reported by Akiko Matsushita and Jim Meyering.
11076 * src/output.c (make_room_for, output_character_helper): New
11077 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
11078 a per buffer MAXIMUM_BUFFER_SIZE.
11080 * src/output.c (output_text): New function, for optimizing the
11081 output of strings of characters. Use it.
11083 1994-08-30 François Pinard <pinard@iro.umontreal.ca>
11085 * doc, src: New directories reorganizing the distribution.
11086 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
11088 * Makefile.in: Adjusted.
11089 * configure.in: Configure new Makefiles.
11091 * m4.h: Declare STRING typedef. Use it for comment and quote
11092 strings, adjusting all references. (This is the rudiments of a
11093 beginning for the eventual withdrawal of NUL terminated strings.)
11094 * output.c (shipout_text): Accept a length parameter, and use it.
11095 All callers adjusted.
11097 1994-08-29 François Pinard <pinard@iro.umontreal.ca>
11099 * m4.h: Include <unistd.h> if it exists.
11100 * stackovf.c: Don't.
11102 Clean up for current_diversion variable:
11103 * output.c: Move current_diversion from builtin.c.
11104 * m4.h: Declare current_diversion so builtin.c can access it.
11105 * output.c (output_init, make_diversion): Initialize or update
11107 * builtin.c (builtin_init, m4_divert): Leave current_diversion
11110 Remove limit on number of diversions:
11111 * output.c: Replace ndiversion by diversions, declare it.
11112 (output_init): Allocate only diversion 0.
11113 (make_diversion): Allocate new diversions as needed.
11114 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
11115 * m4.c: Still accept -N, but do nothing with it.
11116 Reported by David MacKenzie.
11119 * output.c (freeze_diversions): New function.
11120 * m4.h: Declare freeze_diversions.
11121 * freeze.c: Document frozen file format, revise it, call
11122 freeze_diversions to add diversions to frozen format, and code to
11123 reload them properly.
11124 * m4.c: Do not undivert automatically at end when status being
11125 frozen. Do not call builtin_init when reloading frozen state.
11127 Speed up diversion processing:
11128 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
11129 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
11130 structure and variables, cached variables out of output_diversion,
11131 reallocate_diversion_for and OUTPUT_CHARACTER.
11132 (shipout_text, make_diversion, insert_diversion): Adapted to new
11134 (insert_file): Use better buffering.
11135 Reported by David MacKenzie.
11137 1994-08-28 François Pinard <pinard@iro.umontreal.ca>
11139 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
11140 dist works from another build directory.
11142 1994-08-27 François Pinard <pinard@iro.umontreal.ca>
11144 * symtab.c (hack_all_symbols): Use hash_table_size instead of
11145 constant HASHMAX, for -H option to work better.
11147 * builtin.c (DECLARE): Simplify by using _ ().
11149 * freeze.c: New file.
11150 * Makefile.in: Compile it, distribute it.
11151 * m4.c: Recognize, document and process --freeze-state (-F) and
11152 --reload-state (-R) options. Pass a true flag to builtin_init
11153 only if no reloading some state.
11154 * builtin.c (define_builtin): Remove static specifier.
11155 (find_builtin_by_name): Remove static specifier.
11156 (builtin_init): Accept and obey a flag argument.
11157 * m4.h: Add declarations for freeze.c, changes for builtin.c.
11159 1994-08-24 François Pinard <pinard@iro.umontreal.ca>
11161 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
11164 * configure.in: Implement --with-dmalloc.
11165 * acconfig.h: Document WITH_DMALLOC.
11166 * m4.h: Add code for when WITH_DMALLOC.
11168 1994-08-15 François Pinard <pinard@iro.umontreal.ca>
11170 * m4.c (long_options): Use "error-output", the dash was missing.
11171 Reported by Akiko Matsushita.
11173 1994-08-12 François Pinard <pinard@iro.umontreal.ca>
11175 * m4.h: Include <sys/types.h>.
11176 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
11177 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
11179 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
11180 as size_t, not int.
11181 * builtin.c (dump_args): Declare len as size_t, not int.
11183 * debug.c: Prototype the forward declaration of debug_set_file.
11185 * builtin.c (m4_undivert): Replace div by file, for avoiding the
11186 shadowing of this variable.
11187 * output.c (insert_diversion): Idem.
11189 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
11190 (input_init): Duplicate default quote and comment strings.
11191 (set_quotes): Free previous quote strings in all cases. Duplicate
11192 even default quote strings.
11193 (set_comment): Free previous comment strings in all cases.
11194 Duplicate even default comment strings.
11196 * configure.in: Updated for Autoconf 2.0.
11197 * Makefile.in (distclean-local): Also delete config.cache.
11199 * m4.c (usage): Reorganize the --help output by topic. Include a
11200 description for debugging flags.
11202 1994-07-29 François Pinard <pinard@iro.umontreal.ca>
11204 * configure.in: If sigaction is available and SA_ONSTACK defined,
11205 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
11206 defined, use sigvec. Else don't compile stackovf.c.
11207 * stackovf.c (setup_stackovf_trap): Idem.
11208 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
11211 1994-07-21 François Pinard <pinard@iro.umontreal.ca>
11213 * m4.c (usage): Replace printf par fputs.
11215 1994-07-18 François Pinard <pinard@iro.umontreal.ca>
11219 1994-07-17 François Pinard <pinard@iro.umontreal.ca>
11221 * configure.in: Check for sigaction and sigvec. Add a new delayed
11222 check for RLIMIT_STACK, combine in the checking for getrlimit.
11223 All those things are not universally available.
11224 * stackovf.c: Split setting up the trap handler and catching
11225 signals, for better taking care of various configure outcomes.
11226 * examples/stackovf.sh: Correct a typo.
11227 Reported by Eric Backus, Jim Avera and Jim Meyering.
11229 1994-07-16 François Pinard <pinard@iro.umontreal.ca>
11231 * ansi2knr.c: New version sent by its author, Peter Deutsch.
11233 1994-07-15 François Pinard <pinard@iro.umontreal.ca>
11235 * Makefile.in: Modify so parallel make will not try making
11236 lib/libm4.a twice simultaneously.
11237 Reported by Jim Meyering.
11239 1994-07-14 François Pinard <pinard@iro.umontreal.ca>
11241 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
11242 error message, for when no code possibility exists. Even if this
11243 line is completely #ifdef'ed out, it brings a syntax error.
11244 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
11246 * Makefile.in (install): Have install depend on all too, for lib
11247 to be remade as needed.
11249 * examples/stackovf.sh: Try ksh, bsh and bash for shells
11250 providing ulimit, instead of using only ksh.
11251 Reported by Jim Avera and Joseph E. Sacco.
11253 1994-07-12 François Pinard <pinard@iro.umontreal.ca>
11255 * Makefile.in (check): Have it depend on all instead of m4. In
11256 this way, a change in lib will be detected and processed.
11258 * builtin.c (numeric_arg): Use strtol and verify the conversion,
11259 instead of using sscanf which stops as soon as there is a
11260 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
11261 and divert(1xyzzy) were all accepted without any warning or error
11263 * m4.h: Declare strtol as long if not including stdlib.h.
11264 * configure.in: Check for limits.h, and replace strtol if missing.
11265 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
11266 * lib/strtol.c: New file, from elsewhere.
11267 Reported by Andreas Schwab.
11269 1994-07-07 François Pinard <pinard@iro.umontreal.ca>
11271 * macro.c (expand_macro): Cast value to (boolean) prior to
11272 assigning it to traced.
11273 Reported by Tom McConnell.
11275 * Makefile.in (m4): Always make all in lib first.
11276 Reported by Jim Meyering.
11278 1994-07-06 Jim Avera <jima@netcom.com>
11280 * stackovf.c: Isolated OS-dependent sections; Improved portability,
11281 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
11282 handlers), and a default error message if the fault address is not
11283 available (when neither siginfo.h nor BSD sigcontext are supported).
11284 * configure.in: Changes for stackovf.h: Check for sigcontext,
11285 sigaction, sigstack, and define rlim_t as int if necessary.
11286 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
11287 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
11288 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
11290 1994-07-05 François Pinard <pinard@iro.umontreal.ca>
11292 * configure.in: Use AC_SET_MAKE.
11293 * Makefile.in: Use @SET_MAKE@.
11294 Reported by Jim Meyering.
11296 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
11297 Reported by Ian Taylor.
11299 1994-07-02 François Pinard <pinard@iro.umontreal.ca>
11301 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
11302 because siginfo.h is unrelated to standard headers, and siginfo.h
11303 is already checked for.
11304 Reported by Joseph E. Sacco.
11306 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
11308 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
11311 1994-06-29 François Pinard <pinard@iro.umontreal.ca>
11313 * builtin.c (substitute): Use \& to represent this part of the
11314 string which was matched by the whole regexp, instead of
11315 representing the whole string. Any usage of \0 issues a warning
11316 and acts like \&, it will disappear in some subsequent release.
11318 1994-06-27 François Pinard <pinard@iro.umontreal.ca>
11320 * m4.c: Complete prototype for forwarded declaration of usage.
11322 * input.c (init_macro_token): Correct own reference in error
11323 message. Previous name get_macro_func was referred to instead.
11324 (next_char): Correct own reference in error message. Previous
11325 name advance_input was referred to instead.
11327 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
11328 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
11329 and_term, not_term, logical_not_term, cmp_term, shift_term,
11330 add_term, mult_term, exp_term, unary_term, simple_term): Add
11331 prototype to forwarded declarations. Declare parameter v1 as
11332 eval_t * instead of int *. Same for local variable v2 in dyadic
11333 functions. Same for result in exp_term.
11334 * builtin.c (m4_eval): Declare value as eval_t instead of int.
11335 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
11336 unsigned_eval_t instead of unsigned int. Change casts accordingly.
11337 (shipout_int): Cast first argument of ntoa to eval_t.
11338 Reported by Thorsten Ohl.
11340 * macro.c: Complete the prototypes of forwarded expand_macro and
11342 Reported by Thorsten Ohl.
11344 * m4.h: Define voidstar as void * or char * depending on __STDC__.
11345 The Ultrix 3.1 compiler cannot do much with void pointers.
11347 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
11348 * m4.c (xfree): Replace void * by voidstar.
11349 Reported by Tom McConnell.
11351 * ansi2knr.1: New, from elsewhere.
11352 * Makefile.in (DISTFILES): Distribute ansi2knr.1
11354 * Makefile.in (stamp-h.in): Avoid running ./config.status if
11355 stamp-h does not exist yet. This avoids running it a second time
11356 just after the initial ./configure.
11357 Reported by David MacKenzie and Tom McConnell.
11359 * m4.h: Replace the enum debug_info declaration with a series of
11360 #define's. The Ultrix 3.1 compiler would otherwise need casting
11361 (int) to most references, when used in expressions.
11362 Reported by Tom McConnell.
11364 1994-06-25 François Pinard <pinard@iro.umontreal.ca>
11366 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
11367 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
11368 calls the compiler. Previously, FP_PROTOTYPES was only calling
11369 the preprocessor; by not being subject to CFLAGS, this was
11370 discouraging those flags asking for ANSI compilation.
11371 * acconfig.h: Document HAVE_PROTOTYPES.
11372 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
11373 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
11374 Reported by Eric Backus.
11376 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
11377 from the environment. Default CFLAGS to -g if not set.
11378 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
11379 * lib/Makefile.in: Have CFLAGS substituted from configure.
11380 Reported by Eric Backus and Tom McConnell.
11382 * configure.in: m4_undefine changeword before using AC_ENABLE.
11384 * m4.h: Declare prototypes for error (for ANSI compilers only),
11385 prefix_all_builtins and reference_error.
11386 Reported by Tom McConnell.
11388 * input.c (set_word_regexp): Do not try to initialize the array
11389 test from a string, this does not work with non-ANSI compilers.
11390 Reported by Eric Backus.
11392 * Makefile.in (dist): Clean examples/ before saving it.
11393 (distclean-local): Also remove stamp-h.
11394 Reported by Eric Backus.
11396 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
11397 non ANSI compilers.
11398 Reported by Tom McConnell.
11400 * checks/Makefile.in (clean): Depends on mostlyclean.
11401 (mostlyclean): New goal.
11403 1994-06-24 François Pinard <pinard@iro.umontreal.ca>
11405 * Makefile.in (DISTFILES): Distribute install.sh.
11406 * install.sh: New file, copied from elsewhere.
11407 Reported by Assar Westerlund and Kaveh R. Ghazi.
11409 1994-06-23 François Pinard <pinard@iro.umontreal.ca>
11411 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
11412 * acconfig.h: Explain ENABLE_CHANGEWORD.
11414 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
11415 from code provided by Pete Chown]
11416 * m4.h: Add original_text field to u_t variant of union u.
11417 Declare TOKEN_DATA_FUNC macro.
11418 * builtin.c: Declare changeword.
11419 (m4_changeword): New function.
11420 * input.c: Include "regex.h", define variables with word regexps.
11421 (input_init): Initialize the word regexp.
11422 (set_word_regexp): New.
11423 (next_token): Declare local variables, use the previous code if
11424 default_word_regexp is true. Else, match using a new code. Save
11426 * macro.c (expand_token): Ship out original text if not a macro
11428 Reported by Krste Asanovic and Pete Chown.
11430 [These modifs all depend upon ENABLE_CHANGEWORD]
11431 * m4.h: Declare external user_word_regexp.
11432 * m4.c: Declare user_word_regexp, and initialize it from
11433 --word-regexp or -W, or NULL if not specified.
11434 * input.c: Use user_word_regexp if specified, instead of
11435 DEFAULT_WORD_REGEXP.
11437 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
11440 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
11441 * checks/Makefile.in: Empty the suffix list.
11442 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
11444 * m4.c: Declare nesting_limit and initialize it to 250.
11445 Implement -LNUMBER or --nesting-limit=NUMBER to change its
11447 * m4.h: Declare nesting_limit as external.
11448 * macro.c (expand_macro): Stop execution whenever nesting limit
11450 Reported by Bengt Mertensson.
11452 * eval.c (evaluate): Diagnose excess characters in eval input.
11453 Things like `eval(08)' used to return 0 with no diagnostic.
11455 * m4.h: Capitalize first letter of all macro arguments in
11458 * m4.c: Declare warning_status, initialize it to 0. Add new
11459 option -E, or --fatal-warnings, which sets warning_status to
11460 EXIT_FAILURE instead.
11461 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
11462 EXIT_FAILURE if not otherwise done by header files.
11463 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
11464 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
11465 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
11466 argument of all M4ERROR calls.
11467 Reported by Noah Friedman.
11469 * examples/incl-test.m4: Renamed from incl_test.m4.
11470 * examples/include.m4: Include incl-test.m4 instead of
11472 * examples/multiquotes.m4: Renamed from multi-quotes.m.
11474 1994-06-22 François Pinard <pinard@iro.umontreal.ca>
11476 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
11477 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
11478 also tested it on a Sun Sparc workstation running SunOS 4.x.
11480 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
11481 49.format check, abusing a `union values' argument with sprintf
11482 without selecting the proper field. Now, save the formatting type
11483 first, delaying the fetch of the corresponding argument.
11484 Reported by Joseph E. Sacco and Tom Quinn.
11486 * format.c (format): Remove const from char *fmt declaration when
11487 not HAVE_EFGCVT, because a NUL may be forced into it.
11489 * m4.h: Declare atof() when not STDC_HEADERS.
11490 Reported by Joseph E. Sacco.
11492 * Regenerate configure using Autoconf 1.11, this corrects a
11493 problem about an incorrect cpp seting on NeXT 3.1.
11494 Reported by Alexander Lehmann.
11496 1994-06-05 François Pinard <pinard@iro.umontreal.ca>
11498 * m4.h (_): Change argument from `x' to `Args'.
11500 1994-04-22 François Pinard <pinard@iro.umontreal.ca>
11502 * m4.h: Rename Args() to _().
11503 * m4.h: Remove extern specifier from all function declarations.
11505 1994-04-22 Jim Avera <jima@netcom.com>
11507 * stackovf.c: New file implementing stack-overflow detection.
11508 * configure.in: Check for getrlimit, sigaction. If all of
11509 standard headers, getrlimit and sigaction, define USE_STACKOVF and
11510 substitute ${U}stackovf.o for STACKOVF.
11511 * acconfig.h: Declare USE_STACKOVF.
11512 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
11513 * m4.h: Declare setup_stackovf_trap().
11514 * m4.c: Call setup_stackovf_trap().
11515 * tests/stackovf_test.sh: New file.
11517 1994-04-13 François Pinard <pinard@iro.umontreal.ca>
11519 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
11521 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
11523 1994-01-30 François Pinard <pinard@iro.umontreal.ca>
11525 * m4.h: Remove definition of volatile, not used anymore.
11526 Reported by Jim Meyering and Joseph E. Sacco.
11528 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
11529 of `if ... else /* nothing */' for if macros.
11530 Reported by Jim Meyering.
11532 * builtin.c (m4_regexp): Reorganize the code for avoiding a
11533 warning from gcc about `repl' possibly used before defined.
11534 Reported by Jim Meyering.
11536 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
11537 Reported by Jim Meyering.
11539 1994-01-25 François Pinard <pinard@iro.umontreal.ca>
11541 * m4.h: Move the conditional definition of volatile after the
11542 inclusion of system files, because they may define it first.
11544 1994-01-04 François Pinard <pinard@iro.umontreal.ca>
11546 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
11547 get around a problem with Alpha make seeing a syntax error, there.
11548 Reported by Vern Paxson.
11550 1994-01-03 François Pinard <pinard@iro.umontreal.ca>
11552 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
11553 Reported by Richard Stallman.
11555 1993-12-25 François Pinard <pinard@iro.umontreal.ca>
11557 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
11558 instead of AC_HAVE_FUNCS.
11559 Reported by Noah Friedman.
11561 1993-12-01 François Pinard <pinard@iro.umontreal.ca>
11563 * m4.c: Initialize show_help and show_version to zero.
11565 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
11566 Use them in exit() and usage() calls.
11568 1993-11-27 François Pinard <pinard@iro.umontreal.ca>
11570 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
11571 syserr() macro. Delete errref, add reference_error and M4ERROR.
11572 * m4.c: Replace errref, which was returning an input reference
11573 string, with reference_error, which prints it on standard error.
11574 * builtin.c, output.c: Use errno as second parameter to error,
11575 instead of using syserr() with %s.
11576 * *.c: Use M4ERROR instead of error: no more errref() with %s.
11577 Doing so, the program name appears after the input reference
11578 instead of before, which eases M-x next-error processing.
11580 1993-11-24 François Pinard <pinard@iro.umontreal.ca>
11582 * checks/get-them: Escape braces with backslashes in patterns,
11583 because HPUX-9.01 awk needs this.
11584 Reported by Jim Meyering.
11586 1993-11-22 François Pinard <pinard@iro.umontreal.ca>
11588 * builtin.c: Declare "FILE *popen ();".
11590 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
11591 macros, replace error_message_prefix() declaration by errref()'s.
11592 Declare xrealloc, for use in errref().
11593 * m4.c: Delete error_message_prefix() function, add errref().
11594 * *.c: Use error() systematically in place of all error macros,
11595 now that error() flushes stdout first. Make needed adjustments.
11597 * m4.h: Remove const in sys_errlist[] declaration, it creates
11598 conflicts on SGI and Alpha.
11599 Reported by Kaveh R. Ghazi.
11601 1993-11-20 François Pinard <pinard@iro.umontreal.ca>
11603 * m4.c: Include <getopt.h> instead of "getopt.h".
11605 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
11606 * acconfig.h: New, for documenting HAVE_EFGCVT.
11607 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
11608 use them wherever appropriate. Also use -I. for compilations.
11609 * lib/Makefile.in: Use -I.. for compilations.
11610 * *.c: Include <config.h> or "config.h".
11612 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
11613 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
11615 1993-11-17 François Pinard <pinard@iro.umontreal.ca>
11617 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
11619 * input.c (input_init): Initialize quote and comment strings
11620 explicitely instead of calling set_quotes and set_comment: by
11621 doing so, we ensure we do not free uninitialized variables.
11623 * checks/check-them: Reverse arguments to both diff, so the
11624 expected is on the left and the obtained on the right.
11626 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
11627 macros. Delete declarations for m4error, warning, fatal and
11628 internal_error, add declaration for error_message_prefix.
11629 * m4.c: Delete m4error, warning, fatal and internal_error
11630 routines, add error_message_prefix routine.
11631 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
11632 warning with WARNING*, fatal with FATAL* and internal_error with
11634 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
11635 this is not needed anymore.
11637 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
11638 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
11639 and debug_message, add declaration for debug_message_prefix.
11640 * debug.c: Remove static specifier for FILE *debug declaration.
11641 Delete debug_print and debug_message routines, add
11642 debug_message_prefix routine.
11643 * builtin.c, debug.c: Replace debug_print routine calls with
11644 DEBUG_PRINT* macro calls.
11645 * input.c, path.c: Replace debug_message routine calls with
11646 DEBUG_MESSAGE* macro calls.
11648 * m4.h: Remove inclusion of <varargs.h>.
11649 * debug.c: Include <stdarg.h> or <varargs.h>.
11650 (trace_format): Use stdarg instead of varargs if __STDC__.
11652 * configure.in: Remove checks for vfprintf and _doprnt. These
11653 implementations use varargs tricks which are not portable enough.
11654 * lib/vfprintf.c: Deleted.
11655 * lib/_doprnt.c: Deleted.
11656 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
11657 Reported by Joel Sherrill.
11659 * path.c (add_include_directory): Use xstrdup.
11661 * builtin.c (find_builtin_by_name): Declare static.
11663 * *.[ch]: Add const to a few "char *" declarations.
11665 * configure.in: Remove commented tests for fileno() and fstat().
11666 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
11668 * debug.c (debug_flush_files): New.
11669 * m4.h: Declares it.
11670 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
11671 Reported by Nicolas Pioch.
11673 1993-11-12 François Pinard <pinard@iro.umontreal.ca>
11675 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
11676 Reported by Joel Sherrill.
11678 * builtin.c (prefix_all_builtins): Instead of the table size, use
11679 the null entry at end for stopping the loop. It was overwritten.
11680 Reported by Andreas Schwab and Jim Meyering.
11682 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
11683 Reported by Kaveh R. Ghazi.
11685 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
11686 Reported by Karl Vogel.
11688 1993-11-09 François Pinard <pinard@iro.umontreal.ca>
11690 * m4.h: Do not define volatile if already defined.
11691 Reported by René Seindal.
11693 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
11695 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
11696 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
11698 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
11700 * m4.h: Define strchr and strrchr in terms of index and rindex,
11701 instead of the other way around.
11702 * builtin.c, m4.c, path.c: Use strchr instead of index.
11704 * input.c (next_char): Remove a "break;" after a "return ...;".
11705 Reported by Tom McConnell.
11707 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
11711 * configure.in: Do not copy check files in the build hierarchy.
11712 * checks/check-them: Identify the m4 version being checked. For
11713 finding m4, look in $PATH instead of in the parent directory.
11714 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
11715 * checks/Makefile.in (.all-stamp): Always create check files in
11716 the source hierarchy, not anymore in the build hierarchy.
11717 (check): cd to the source hierarchy before performing checks.
11718 Do not copy nor clean COPYING anymore, take it from `..'.
11719 Reported by Tom McConnell.
11721 * Makefile.in (Makefile): Use $(SHELL).
11722 (config.status): Use $(SHELL). Use "config.status --recheck"
11723 instead of "configure --no-create", which is obsolete.
11724 Reported by Tom McConnell.
11726 1993-11-05 François Pinard <pinard@iro.umontreal.ca>
11728 * m4.c (usage): Use "%s" instead of "m4" in format string.
11729 Reported by Jim Meyering.
11731 * Makefile.in: Distribute mkinstalldirs.
11732 Reported by Pierre Gaumond.
11733 Reported by Jim Meyering.
11734 Reported by Tom McConnell.
11735 Reported by Andreas Gustafsson.
11737 * checks/check-them: Renamed from checks/check_them.
11738 * checks/get-them: Renamed from checks/get_them.
11739 * checks/.all-stamp: Renamed from checks/.all_stamp.
11740 * checks/Makefile.in: Changed accordingly.
11741 Reported by Jim Meyering.
11743 1993-11-04 François Pinard <pinard@iro.umontreal.ca>
11745 * lib/Makefile.in (dist): Correct permissions on files.
11747 * output.c: Declare tmpfile, some systems don't.
11749 1993-11-03 François Pinard <pinard@iro.umontreal.ca>
11751 * checks/Makefile.in (dist): Correct permissions on files.
11753 * Makefile.in (dist): Ensure recursive linking for subdirectory
11754 `examples', also set read/write permissions on all its files.
11756 * mkinstalldirs: New, from elsewhere.
11757 * Makefile.in: Use it.
11759 * debug.c: Synchronize debug messages and regular output when
11760 the debug file and stdout are redirected to the same file.
11761 * configure.in: Add (commented) checks for fileno and fstat.
11762 Reported by Jim Avera.
11764 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
11765 etc., arguments, then ignore the superfluous one. m4 used to
11766 diagnose missing arguments and return the empty string.
11767 Reported by Nick S. Kanakakorn.
11769 1993-11-02 François Pinard <pinard@iro.umontreal.ca>
11771 * m4.c (main): At end of all input, ensure all undiverted text
11772 goes to the main output stream.
11773 Reported by Andreas Gustafsson.
11775 * m4.c (main): exit (0), instead of return 0.
11777 * m4.c: Implement -P and --prefix-builtins.
11778 * builtin.c: Delete const specifier on builtin_tab.
11779 (prefix_all_builtins): New.
11780 Reported by Noah Friedman.
11781 Reported by Scott Bartram.
11783 * c-boxes.el: New, from elsewhere.
11784 * Makefile.in: Distribute it.
11786 * m4.h: Do not define bcopy if <string.h> defines it.
11787 Reported by Stephen Perkins.
11789 * builtin.c (define_macro): Allow a missing second argument, in
11790 which case it is implied empty. Affects define and pushdef.
11791 Reported by Eric Allman.
11793 1993-11-01 François Pinard <pinard@iro.umontreal.ca>
11795 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
11796 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
11797 * builtin.c: Initialize all the blindness fields in builtin_tab.
11798 (define_builtin): Copy the blindness of a builtin into its symbol.
11799 * macro.c (expand_token): Avoid processing a blind builtin if the
11800 next character is not an opening parenthesis.
11801 Reported by David MacKenzie.
11802 Reported by Noah Friedman.
11804 * configure.in: Ensure an exit status of 0 on completion.
11805 Reported by Vivek P. Singhal.
11807 * eval.c (eval_lex): Admit both lower and upper case letters for
11808 bases greater than 10. Only lower case letters were accepted.
11810 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
11811 Reported by Krste Asanovic.
11813 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
11814 * eval.c (logical_not_term): New name for not_term.
11815 * eval.c (xor_term): New, between or_term and and_term.
11816 * eval.c (not_term): New, between and_term and logical_not_term.
11817 * eval.c (shift_term): New, between cmp_term and add_term.
11818 Reported by Krste Asanovic: ~, ^, <<, >>.
11819 Reported by Ben A. Mesander: ** vs ^.
11821 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
11822 * m4.h: Delete xrealloc.c.
11823 * lib/xmalloc.c: New, from elsewhere.
11824 * lib/xstrdup.c: New, from elsewhere.
11825 * lib/Makefile.in: Distribute and compile them.
11827 * m4.c: Change progname to program_name.
11828 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
11829 * lib/error.c: New, from elsewhere.
11830 * lib/Makefile.in: Distribute and compile error.c.
11831 * configure.in: Check AC_VPRINTF and for strerror.
11832 * m4.c: Delete cmd_error. Use error instead.
11833 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
11835 * m4.h: Delete #define const, let Autoconf takes care of this.
11837 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
11838 Merge parse_args into main. Declare argv to be `char *const *',
11839 then remove superfluous casts.
11841 * m4.c: Rename --no-gnu-extensions to --traditional.
11842 Reported by Ben A. Mesander.
11844 * m4.c (usage): Add a status parameter. Supply one in various
11845 calls. Add --help processing. Remove -V for --version.
11847 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
11849 * lib/Makefile.in: Have an AR=ar declaration.
11850 Reported by Eric Backus.
11851 Reported by Bjorn R. Bjornsson.
11852 Reported by Tom Tromey.
11853 Reported by Kristine Lund.
11854 Reported by Marion Hakanson.
11856 1993-10-30 François Pinard <pinard@iro.umontreal.ca>
11858 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
11859 Reported by Noah Friedman.
11861 1993-10-25 François Pinard <pinard@iro.umontreal.ca>
11863 * Makefile.in: Remove MDEFINES and cleanup.
11865 1993-06-09 François Pinard <pinard@iro.umontreal.ca>
11867 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
11868 Create a gzip file.
11870 1993-02-06 François Pinard <pinard@iro.umontreal.ca>
11872 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
11873 ensure 777 mode for directories, so older tar's will restore file
11876 1993-01-17 François Pinard <pinard@iro.umontreal.ca>
11878 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
11879 so the installer can override automatically configured choices.
11880 Reported by Karl Berry.
11882 1993-01-15 François Pinard <pinard@iro.umontreal.ca>
11884 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
11885 previous version was not working properly on m68k-hp-bsd4.3.
11886 Reported by Roland McGrath.
11888 * lib/_doprnt.c: Stolen from Oleo distribution.
11889 * configure.in: Check for _doprnt.c if vfprintf.c selected.
11890 * lib/Makefile.in: Distribute _doprnt.c.
11891 Do not distribute regex.[ch].old anymore.
11893 1993-01-01 François Pinard <pinard@iro.umontreal.ca>
11895 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
11896 Richard wants it there.
11898 1992-12-27 François Pinard <pinard@iro.umontreal.ca>
11900 * Makefile.in: Add DEFS to MDEFINES.
11901 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
11902 (libm4.a): Remove the library before creating it.
11903 (distclean): Remove tags and TAGS too.
11905 1992-12-23 François Pinard <pinard@iro.umontreal.ca>
11907 * Makefile.in (dvi, m4.dvi): New goals.
11909 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
11910 macro.c, output.c, path.c, symtab.c: Change Copyright from
11911 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
11913 * examples/divert.m4: Deleted, this bug has been corrected.
11915 * Makefile.in (texclean, mostlyclean): New goals.
11917 * Makefile.in (clean): Remove clutter from ansi2knr.
11918 Reported by Pierre Gaumond.
11920 1992-12-20 François Pinard <pinard@iro.umontreal.ca>
11922 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
11923 might well use CFLAGS is s/he needs it.
11925 * Makefile.in: Allow installation of info files from a separate
11927 Reported by Jason Merrill.
11928 Reported by David MacKenzie.
11929 Reported by Skip Montanaro.
11930 Reported by Erez Zadok.
11931 Reported by Assar Westerlund.
11933 1992-12-19 François Pinard <pinard@iro.umontreal.ca>
11936 This is still a beta release for the future GNU m4 version 1.1.
11938 * lib/alloca.c: New, from elsewhere.
11939 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
11941 * m4.h: Do not define index/rindex if already defined. If
11942 FALSE/TRUE are already defined, do not redefine them, but merely
11943 define boolean typedef to int.
11945 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
11946 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
11947 because some C compilers do not like connectives with #ifdef.
11948 * m4.h: Define `volatile' only if __GNUC__, instead of once for
11949 __GNUC__ and once for __STDC__.
11950 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
11952 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
11953 Makefile dependencies. Without it, make keeps destroying and
11954 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
11956 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
11957 to diversion/DIVERSION, this was a spelling error.
11959 * m4.c: Declare version[], remove #include "version.h".
11960 * version.h: Deleted.
11961 * Makefile.in: Remove references to version.h.
11963 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
11964 production, by using a simpler and more robust algorithm. This
11965 solves the problem of synclines sometimes written in the middle of
11966 an output line. Delete sync_line() and output_lines variable.
11967 * m4.h: Remove sync_line prototype and output_lines declaration.
11968 * input.c (next_char), output.c (shipout_text): Remove references
11970 * input.c (push_file, pop_file): Merely put the value -1 in
11971 output_current_line instead of calling sync_line, for delaying a
11972 single `#line NUM FILE' before next output line. Do not test
11973 for sync_output, because this is unnecessary clutter.
11974 * output.c (make_divertion, insert_divertion): Idem.
11975 * input.c: Rename must_advance_line to start_of_input_line, for
11978 * debug.c (trace_header): Select a new debug line format, which
11979 better complies with GNU standards for formatting error messages.
11980 With option `-dfl', M-x next-error might be used on the output.
11981 * m4.c (vmesg): Adjust format of error output to GNU standards.
11982 * m4.texinfo: Adjust examples for `make check' to work.
11984 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
11985 case for enum debug_info constants, which were all lower case.
11987 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
11989 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
11990 collected patches. I tried a few times using newer regex.[ch], it
11991 mysteriously stopped aborting with this one. Insecure feeling...
11992 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
11994 1992-12-18 François Pinard <pinard@iro.umontreal.ca>
11996 * m4.c: Change `--no-warnings' to `--silent'.
11997 Reported by David MacKenzie.
11999 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
12000 leave it off for now. See comment in m4.c for justification.
12001 Reported by David MacKenzie.
12003 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
12004 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
12006 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
12008 * Makefile.in: Ensure recursive cleaning is done before local
12009 cleaning for all clean goals.
12011 * builtin.c (ntoa): Ensure the value is always interpreted as a
12012 signed quantity, whatever the radix is.
12014 1992-11-18 Jim Meyering <meyering@idefix>
12016 * builtin.c, format.c, input.c: Split long lines.
12017 * m4.c: Use typedef macro_definition instead of struct
12019 * symtab.c: Use typedef symbol instead of struct symbol.
12021 1992-11-17 François Pinard <pinard@iro.umontreal.ca>
12023 * *.[ch]: Remove all trailing whitespace, in code and comments.
12025 * configure.in: Find some awk.
12026 * Makefile.in: Add $(AWK) to MDEFINES.
12027 * checks/Makefile.in: Transmit $(AWK) to get_them.
12028 * checks/get_them: Use $AWK instead of gawk. Add a close in the
12029 awk script when switching files, because without this, mawk runs
12030 out of file descriptors.
12032 1992-11-16 François Pinard <pinard@iro.umontreal.ca>
12034 * Makefile.in (realclean): Delete m4.info*.
12035 Reported by Jim Meyering.
12037 * Makefile.in: Adjust and link with checks/Makefile.
12038 * checks/Makefile.in: New.
12039 * configure.in: Output checks/Makefile.
12041 * checks/get_them: Have the dnl header of each test more
12042 recognizable by next-error, also use a better message.
12044 1992-11-16 Jim Meyering <meyering@idefix>
12046 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
12047 And use that only if __GNUC__ since we're using it's GCC-specific
12048 semantics that tell the compiler the associated function doesn't
12051 * builtin.c (substitute): Don't use character as an array index.
12052 (dumpdef_cmp): Make formal arguments `const void *' to avoid
12053 warnings with gcc -W -Wall on systems with qsort prototype.
12054 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
12057 * eval.c (most functions): Add parentheses to assignments used
12058 as truth values go avoid warnings from gcc -Wall.
12060 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
12061 any functions that don't need external scope.
12063 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
12064 (many functions and arrays): Declare `const'.
12066 1992-11-15 François Pinard <pinard@iro.umontreal.ca>
12068 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
12069 removing the declaration from m4.h. Also rename false to FALSE
12072 * lib/Makefile.in (Makefile): New goal.
12074 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
12075 so heavily loaded. It gets more easily overridable, calling make.
12076 Reported by Jim Meyering.
12078 * Makefile.in (dist): Get .fname from the current directory name,
12079 instead of from version.h. I need updating many files manually,
12080 when the version changes, version.h is just one of them.
12082 1992-11-14 François Pinard <pinard@iro.umontreal.ca>
12084 * m4.h: Remove the tag `boolean' on the enum introducing typedef
12085 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
12086 Reported by Tom McConnell.
12088 1992-11-13 François Pinard <pinard@iro.umontreal.ca>
12090 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
12091 39.cleardiv, which were describing missing or spurious newlines.
12092 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
12093 do not depend on machine word size, `/bin/false' implementation,
12094 or `wc' output format. `make check' is more dependable, now.
12096 * checks/check_them: Summarize the failed tests by listing their
12097 name, at end. If none, issue `All checks successful'. Output
12098 `Checking' instead of `Input file:'.
12100 * checks/get_them, checks/check_them: Reindented.
12102 * Makefile.in (dist): chmod a+r before making the tar file.
12104 1992-11-12 François Pinard <pinard@iro.umontreal.ca>
12106 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
12108 * input.c (next_token): Reinitialize token_buttom just after using
12109 it as a watermark with obstack_free. Or else, a future token, big
12110 enough for triggering reallocation of the obstack chunk, could
12111 void the initialized value of token_buttom, later causing panic in
12112 obstack_free. Rename token_buttom to token_bottom everywhere.
12114 * m4.h: Before declaring errno, first include <errno.h> and
12115 ensure that it does not define errno.
12116 Reported by Richard Stallman.
12118 1992-11-11 François Pinard <pinard@iro.umontreal.ca>
12120 * builtin.c: Define and use DECLARE macro for builtins.
12122 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
12123 argument, this is a common idiom for introducing long comments.
12125 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
12126 arguments. The last argument was silently ignored.
12128 * m4.c (cmd_error): Add a missing semicolon before va_end().
12130 1992-11-10 François Pinard <pinard@iro.umontreal.ca>
12132 * Makefile.in: Now handle protoized sources. Define and use U.
12133 Compile and use ansi2knr with old compilers. Update DISTFILES.
12134 Add `aclocal.m4' to `configure' dependencies.
12135 * ansi2knr.c: New, from Ghostscript distribution.
12136 * configure.in: Define U through FP_PROTOTYPES for old compilers.
12137 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
12138 * aclocal.m4: New, provide FP_PROTOTYPES.
12139 * m4.h: Conditionnaly protoized through Args, save for varags.
12140 * builtin.c: Protoized. Then:
12141 Include <sys/types.h> if size_t is not defined, before "regex.h".
12142 (m4_ifelse): Fetch built-in name properly for diagnostic.
12143 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
12144 (m4_regexp): Add const to `msg' declaration.
12145 (m4_patsubst): Add const to `msg' declaration.
12146 * debug.c: Protoized, save for varargs.
12147 * eval.c: Protoized.
12148 * format.c: Protoized.
12149 * input.c: Protoized.
12150 * m4.c: Protoized, save for varargs. Then:
12151 (xfree): Accept void * instead of char *.
12152 (xmalloc): Return void * instead of char *.
12153 (xrealloc): Accept and return void * instead of char *.
12154 * macro.c: Protoized.
12155 * output.c: Protoized.
12156 * path.c: Protoized. Then cast some (char *) over xmalloc's.
12157 * symtab.c: Protoized.
12159 1992-11-06 François Pinard <pinard@iro.umontreal.ca>
12161 * m4.texinfo: Remove directory from diagnostics in 30.include,
12162 51.eval, 56.errprint and 57.m4exit tests.
12164 * m4.h: Remove declarations for int or void system functions, they
12165 cause more conflicting trouble than they make good.
12167 * configure.in: Avoid configuration header file. Add some tests.
12168 * m4.h: Remove #include "config.h".
12169 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
12170 Then, rewritten for better compliance with GNU standards.
12172 1992-11-05 François Pinard <pinard@iro.umontreal.ca>
12174 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
12175 because of a misplaced #endif.
12177 * Many *.[hc] files: Correct intra-line spacing here and there,
12178 according to GNU indent 1.6 advice.
12180 * configure.in: New, using Autoconf 1.2.
12181 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
12182 * Delete old configure.in, configure, etc/configure.in,
12183 etc/configure, lib/configure.in, lib/configure and config/*.
12184 Reported by Jason Merrill.
12186 * symtab.c (hash): Change (char) NULL to '\0'.
12187 Reported by Jason Merrill.
12189 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
12190 etc/nextvers.sh. Release numbers will be edited `by hand'.
12191 * version.h: De-automatize, force value in.
12193 * m4.c: Changes in order to use a newer getopt.h.
12194 Reported by David MacKenzie.
12196 * checks/: New name for examples/.
12197 * checks/get_them: New location for etc/get_examples.
12198 * checks/check_them: New location for etc/check_examples.
12199 * Makefile.in, checks/get_them, checks/check_them: Adjust.
12200 * lib/vfprintf.c: New location for etc/vfprintf.c.
12201 * Delete empty etc/.
12202 * examples/: New name for test/.
12204 1992-03-10 François Pinard <pinard@iro.umontreal.ca>
12206 * Makefile.in (check): Add m4 as dependency.
12208 * m4.c: Accept --no-warnings instead of --no_warnings, and
12209 --no-gnu-extensions instead of --no_gnu_extensions. Make the
12210 usage message more informative.
12211 Reported by David MacKenzie.
12213 1992-03-09 François Pinard <pinard@iro.umontreal.ca>
12215 * etc/check_examples: New name for check_examples.sh.
12216 * etc/get_examples: New name for get_examples.sh.
12217 * Makefile.in, etc/Makefile.in: Use new names.
12219 * Makefile.in: Transmit $(CC) while making in lib.
12221 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
12222 code disposition by hand.
12224 1992-03-08 François Pinard <pinard@iro.umontreal.ca>
12226 * m4.h: Delete definitions for abort() and exit().
12227 Reported by Richard Stallman.
12229 * config/hmake-unicos, config/s-unicos.h: New files.
12230 Reported by Hal Peterson.
12232 * eval.c (exp_term): Have N^0 return 1.
12233 Reported by Michael Fetterman.
12235 * eval.c, input.c, m4.h: Remove last comma in enums.
12236 Reported by Mike Lijewski.
12238 * Transfer of maintenance duties from René to François.
12240 1991-10-24 René Seindal <seindal@diku.dk>
12242 * Release 1.0. Many thanks to those, who provided me with bug
12243 reports and feedback.
12245 * Uses GNU configure, taken from the gdb distribution.
12247 * Uses GNU getopt(), with long option names.
12249 * The -Q/+quiet option is added, which suppresses warnings about
12250 missing or superflous arguments to built-in macros.
12252 * Added default options via the M4OPTS environment variable.
12254 * The built-in format can now be configured to use sprintf as
12255 the formatting engine, for systems without [efg]cvt(3).
12257 * GNU library code is moved to the ./lib subdirectory; other
12258 utility files are now in ./etc.
12260 * Several minor bugs have been fixed.
12262 1991-07-26 René Seindal <seindal@diku.dk>
12264 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
12265 François Pinard and Roland H. Pesch for providing me with reports.
12267 * The builtins incr and decr are now implemented without use of
12270 * The builtin indir is added, to allow for indirect macro calls
12271 (allows use of "illegal" macro names).
12273 * The debugging and tracing facilities has been enhanced
12274 considerably. See the manual for details.
12276 * The -tMACRO option is added, marks MACRO for tracing as soon
12279 * Builtins are traced after renaming iff they were before.
12281 * Named files can now be undiverted.
12283 * The -Nnum option can be used to increase the number of
12284 divertions available.
12286 * Calling changecom without arguments now disables all comment
12289 * The function m4_patsubst() is now consistently declared
12292 * A bug in dnl is fixed.
12294 * A bug in the multi-character quoting code is fixed.
12296 * Several typos in the manual has been corrected. More probably
12299 * The m4.info file is now installed along with the program.
12301 1990-11-15 René Seindal <seindal@diku.dk>
12303 * Updated and enhanced version. Release 0.75, manual 0.07.
12305 * Implemented search path for include files (-I option and
12306 M4PATH envronment variable).
12308 * Implemented builtin "format" for printf-like formatting.
12310 * Implemented builtin "regexp" for searching for regular
12313 * Implemented builtin "patsubst" for substitution with regular
12316 * Implemented builtin "esyscmd", which expands to a shell
12319 * Implemented "__file__" and "__line__" for use in error
12322 * Implemented character ranges in "translit".
12324 * Implemented control over debugging output.
12326 * Implemented multi-character quotes.
12328 * Implemented multi-character comment delimiters.
12330 * Changed predefined macro "gnu" to "__gnu__".
12332 * Changed predefined macro "unix" to "__unix__", when the -G
12333 option is not used. With -G, "unix" is still defined.
12335 * Changed "shift", "$@" and "$*" to not insert spaces afters
12338 * Added program name to error messages.
12340 * Fixed two missing null bytes bugs.
12342 1990-01-22 René Seindal <seindal@diku.dk>
12344 * Initial beta release. Release 0.50, manual 0.05.
12353 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
12354 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
12356 Copying and distribution of this file, with or without
12357 modification, are permitted provided the copyright notice
12358 and this notice are preserved.