1 2013-09-15 Gary V. Vaughan <gary@gnu.org>
3 bootstrap: set copyright_holder explicitly.
4 * bootstrap.conf (copyright_holder): Explicitly set to the FSF.
6 configury: don't check in generated files.
7 * COPYING: Install explicitly to avoid confusion over M4
9 * INSTALL, build-aux/compile, bulid-aux/config.guess,
10 build-aux/config.sub, build-aux/depcomp, build-aux/install-sh,
11 build-aux/mdate-sh, build-aux/missing, build-aux/texinfo.tex:
14 configury: don't install modules to pkglibexecdir.
15 Modern Automake (correctly) oerrors out when trying to install
16 modules to pkglibexecdir; we should be using pkglibdir here.
17 * Makefile.am (pkglibexec_LTLIBRARIES): Rename from this...
18 (pkglib_LTLIBRARIES): ...to this.
20 bootstrap: sync with upstream.
21 * bootstrap.conf: New file.
22 * gl/build-aux/bootstrap.in, gl/build-aux/extract-trace,
23 gl/build-aux/funclib.sh, gl/build-aux/options-parser: Update
24 from upstream to pick up recent improvements.
25 * bootstrap: Regenerate.
26 * ltdl/m3/gnulib-cache.m4: Regenerate.
28 2010-03-02 Giuseppe Scrivano <gscrivano@gnu.org> (tiny change)
30 Support bootstrap --gnulib-srcdir=DIR.
31 * bootstrap: Add --gnulib-srcdir option, which overrides
32 GNULIB_SRCDIR, for consistency with gnulib bootstrap.
34 2010-03-01 Eric Blake <eblake@redhat.com>
36 Mention release of version 1.4.14.
37 * gnulib: Update to latest.
38 * README: Drop CVS mention.
39 * HACKING: Tweak release instructions.
40 * NEWS: Mention the release.
41 * .prev-version: Record previous version.
42 * cfg.mk (old_NEWS_hash): Auto-update.
44 2010-02-24 Eric Blake <eblake@redhat.com>
46 Improve parsing example.
47 * doc/m4.texinfo (Input processing): Double-quote argument to
48 translit, for robustness.
50 Reported by Chris Penev.
52 2010-01-29 Eric Blake <ebb9@byu.net>
54 Document upcoming release.
55 * gnulib: Update to latest.
56 * doc/m4.texinfo (History): Mention 1.4.14.
57 * Makefile.am (src/getopt.h): Drop dependence on now-obsolete
60 2010-01-08 Eric Blake <ebb9@byu.net>
62 Address remaining 'make syntax-check' findings.
63 * gnulib: Update to latest.
64 * Makefile.am (tests/package.m4): Avoid @@ substitution.
65 (src_m4_LDADD): Link with libiconv.
66 * m4/m4private.h (STREQ): New macro.
67 * m4/resyntax.c (m4_regexp_syntax_encode): Use it.
68 * src/main.c (process_file): Likewise.
69 (includes): Drop unused header.
70 * m4/macro.c (m4_arg_equal): Adjust comment.
71 * m4/syntax.c: Likewise.
72 * m4/system_.h: Avoid useless preprocessor parenthesis.
73 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
74 * src/stackovf.c: Likewise.
75 (setup_stackovf_trap): Mark diagnostics.
76 * modules/mpeval.c (includes): Move quotearg.h inclusion...
77 * modules/evalparse.c (includes): ...to where it is used.
78 * cfg.mk (local-checks-to-skip): Exempt tests that cause spurious
79 failures, but first fix what they were intended to detect.
80 (_makefile_at_at_check_exceptions): Allow an exception.
82 2010-01-07 Eric Blake <ebb9@byu.net>
84 Use correct license on auxiliary documentation.
85 * gnulib: Update to latest.
86 * AUTHORS: Use GFDL 1.3, not 1.2.
87 * README-alpha: Likewise.
90 * doc/STYLE: Likewise.
91 * modules/README: Likewise.
92 * NEWS: Place under GFDL.
94 * cfg.mk (old_NEWS_hash): Update.
96 Address 'make sc_error_message_uppercase' failures.
97 * m4/output.c (m4_freeze_diversions): Silence false positive.
98 * src/main.c (main): Use 'warning', not 'Warning', in messages.
99 * m4/utility.c (m4_verror_at_line): Likewise.
100 * doc/m4.texinfo (Operation modes, Macro Arguments, Undefine)
101 (Defn, Pushdef, Indir, Builtin, Ifdef, Ifelse, Dumpdef, Trace)
102 (Debuglen, Debugfile, Dnl, Changeresyntax, Standard Modules)
103 (Index macro, Regexp, Substr, Translit, Patsubst, Format, Incr)
104 (Eval, Mkstemp, Syncoutput, Improved forloop)
105 (Improved fatal_error): Adjust expected output.
106 * tests/builtins.at (define, mkdtemp, mkstemp): Likewise.
107 * tests/freeze.at (loading format 1, reloading unknown builtin):
109 * tests/macros.at (Arity and defn, 'Arity, defn, and freeze')
110 (pushdef/popdef): Likewise.
111 * tests/null.err: Likewise.
112 * tests/options.at (deprecated options, POSIXLY_CORRECT)
113 (--fatal-warnings, --regexp-syntax, --syncoutput): Likewise.
114 * tests/others.at (nul character, stdin seekable): Likewise.
115 * tests/modules.at (AT_CHECK_M4_MODTEST, modules: text):
118 Address 'make sc_cast_of_argument_to_free' failures.
119 * m4/m4private.h (DELETE): Adjust comment and fix parentheses.
120 * m4/m4.c (m4_delete): Use it to avoid warning.
121 * m4/module.c (install_builtin_table, module_remove): Likewise.
122 * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy):
124 * .x-sc_cast_of_argument_to_free: New file.
125 * Makefile.am (syntax_check_exceptions): Distribute exceptions.
127 More whitespace cleanup.
128 * HACKING: Nuke trailing whitespace.
129 * examples/WWW/Makefile: Likewise.
130 * examples/WWW/_footer.htm: Likewise.
131 * examples/WWW/_header.htm: Likewise.
132 * examples/WWW/m4lib/bugs.m4: Likewise.
133 * examples/WWW/m4lib/html.m4: Likewise.
134 * examples/WWW/m4lib/menu.m4: Likewise.
135 * examples/WWW/m4lib/visions.m4: Likewise.
136 * examples/esyscmd.m4: Likewise.
137 * examples/fstab.m4: Avoid space-tab.
138 * examples/patsubst.m4: Likewise.
139 * NEWS: Prefer space over tab for alignment.
142 * bootstrap: Likewise.
143 * configure.ac: Likewise.
144 * ltdl/m4/stackovf.m4: Likewise.
145 * m4/hash.c: Likewise.
146 * m4/hash.h: Likewise.
147 * m4/input.c: Likewise.
149 * m4/m4module.h: Likewise.
150 * m4/m4private.h: Likewise.
151 * m4/macro.c: Likewise.
152 * m4/module.c: Likewise.
153 * m4/output.c: Likewise.
154 * m4/path.c: Likewise.
155 * m4/resyntax.c: Likewise.
156 * m4/symtab.c: Likewise.
157 * m4/syntax.c: Likewise.
158 * m4/system_.h: Likewise.
159 * modules/evalparse.c: Likewise.
160 * modules/format.c: Likewise.
161 * modules/gnu.c: Likewise.
162 * modules/import.c: Likewise.
163 * modules/load.c: Likewise.
164 * modules/m4.c: Likewise.
165 * modules/m4.h: Likewise.
166 * modules/modtest.c: Likewise.
167 * modules/mpeval.c: Likewise.
168 * modules/perl.c: Likewise.
169 * modules/shadow.c: Likewise.
170 * modules/stdlib.c: Likewise.
171 * modules/time.c: Likewise.
172 * modules/traditional.c: Likewise.
173 * src/freeze.c: Likewise.
174 * src/main.c: Likewise.
175 * src/stackovf.c: Likewise.
176 * tests/stackovf.test: Likewise.
177 * doc/STYLE: Mention the change.
179 2010-01-05 Eric Blake <ebb9@byu.net>
181 Document new indentation policy.
182 * HACKING: Document indentation policy.
183 * .x-sc_prohibit_tab_based_indentation: New file.
184 * cfg.mk (sc_prohibit_tab_based_indentation): New rule.
185 * Makefile.am (syntax_check_exceptions): Ship exception.
187 Switch to indentation by space, not tab.
188 * .gitmodules: Convert leading tabs to spaces.
190 * bootstrap: Likewise.
191 * configure.ac: Likewise.
192 * examples/WWW/m4lib/html.m4: Likewise.
193 * examples/WWW/m4lib/layout.m4: Likewise.
194 * examples/WWW/m4lib/menu.m4: Likewise.
195 * ltdl/m4/debug.m4: Likewise.
196 * ltdl/m4/gmp.m4: Likewise.
197 * ltdl/m4/m4-obstack.m4: Likewise.
198 * ltdl/m4/stackovf.m4: Likewise.
199 * m4/builtin.c: Likewise.
200 * m4/debug.c: Likewise.
201 * m4/hash.c: Likewise.
202 * m4/hash.h: Likewise.
203 * m4/input.c: Likewise.
205 * m4/m4module.h: Likewise.
206 * m4/m4private.h: Likewise.
207 * m4/macro.c: Likewise.
208 * m4/module.c: Likewise.
209 * m4/output.c: Likewise.
210 * m4/path.c: Likewise.
211 * m4/resyntax.c: Likewise.
212 * m4/symtab.c: Likewise.
213 * m4/syntax.c: Likewise.
214 * m4/utility.c: Likewise.
215 * modules/evalparse.c: Likewise.
216 * modules/format.c: Likewise.
217 * modules/gnu.c: Likewise.
218 * modules/load.c: Likewise.
219 * modules/m4.c: Likewise.
220 * modules/m4.h: Likewise.
221 * modules/mpeval.c: Likewise.
222 * modules/perl.c: Likewise.
223 * modules/stdlib.c: Likewise.
224 * modules/time.c: Likewise.
225 * src/freeze.c: Likewise.
226 * src/m4.h: Likewise.
227 * src/main.c: Likewise.
228 * src/stackovf.c: Likewise.
229 * tests/builtins.at: Likewise.
230 * tests/freeze.at: Likewise.
231 * tests/generate.awk: Likewise.
232 * tests/modules.at: Likewise.
233 * tests/others.at: Likewise.
234 * tests/stackovf.test: Likewise.
235 * tests/testsuite.at: Likewise.
237 Update copyright year.
238 All files impacted, via 'make update-copyright'. Additionally:
239 * .gitignore: Ignore backup files.
241 Prepare to bulk update copyright year.
243 * ltdl/m4/gnulib-cache.m4: Import update-copyright module.
244 * cfg.mk (update-copyright-env): Enforce longhand behavior.
245 * .x-update-copyright: New file.
246 * Makefile.am (syntax_check_exceptions): Distribute exception.
247 * ltdl/m4/debug.m4: Add FSF copyright.
248 * ltdl/m4/m4-error.m4: Fix FSF name in copyright.
249 * ltdl/m4/m4-getopt.m4: Likewise.
250 * ltdl/m4/m4-gettext.m4: Likewise.
251 * ltdl/m4/m4-obstack.m4: Likewise.
252 * ltdl/m4/m4-regex.m4: Likewise.
253 * ltdl/m4/m4-rename.m4: Likewise.
254 * ltdl/m4/m4-syscmd.m4: Likewise.
255 * modules/modtest.m4: Likewise.
256 * modules/perl.m4: Likewise.
257 * modules/shadow.m4: Likewise.
258 * modules/stdlib.m4: Likewise.
259 * modules/time.m4: Likewise.
260 * modules/time2.m4: Likewise.
261 * tests/iso8859.m4: Likewise.
263 Use gnulib maintainer-makefile module.
264 * ltdl/m4/gnulib-cache.m4: Import maintainer-makefile module.
265 * cfg.mk (local-checks-to-skip): Drop changelog-check; add
266 sc_cast_of_x_alloc_return_value.
267 (gnu_ftp_host-alpha, gnu_ftp_host-beta, gnu_ftp_host-major)
268 (gnu_rel_host): Delete; provided by maint.mk.
269 (old_NEWS_hash): New macro.
270 * .prev-version: New file.
271 * .x-sc_require_config_h: Likewise.
272 * .x-sc_require_config_h_first: Likewise.
273 * Makefile.am (syntax_check_exceptions, EXTRA_DIST): Ship new
275 * maint.mk: Remove from version control; use gnulib instead.
276 * .gitignore: Update.
278 Update to latest gnulib.
280 * ltdl/m4/gnulib-cache.m4: Import xoset.
281 * m4/output.c (includes): Ensure that gnulib oset usage will
282 call xalloc_die on memory failure.
283 * Makefile.am (src/getopt.h): Update snippet from gnulib.
284 (LINK_WARNING_H, ARG_NONNULL_H): New macros.
286 Fix testsuite failure on newer glibc.
287 * tests/testsuite.at (AT_CHECK_M4): Tolerate alternate getopt
289 * tests/options.at (deprecated options, unknown option)
290 (--debugmode): Adjust expected output accordingly.
291 Reported by Ralf Wildenhues.
293 2009-11-26 Eric Blake <ebb9@byu.net>
295 Update to newer gnulib.
297 * ltdl/m4/gnulib-cache.m4: Import inttypes, setenv, and unsetenv
299 * modules/m4.c (m4_make_temp): Adjust gen_tempname client.
300 * bootstrap (src_modules): Pick up getopt-gnu and its
302 * configure.ac (gl_VERSION_ETC): Support ./configure
304 (AC_CHECK_FUNCS_ONCE): Rely on gnulib for setenv, unsetenv.
305 * ltdl/m4/m4-getopt.m4: Rewrite to match current gnulib.
306 * Makefile.am (src/getopt.h): Likewise.
307 * modules/stdlib.c (setenv, unsetenv): Rely on gnulib.
309 2009-08-24 Eric Blake <ebb9@byu.net>
311 Pick up gnulib fixes for sub-process execution.
313 * tests/others.at (stdin and stdout closed): New test, to avoid
314 regression introduced on 1.4 branch on 2008-07-17.
315 * NEWS: Document the change.
317 A status of 127 does not always imply esyscmd failure.
318 * modules/gnu.c (esyscmd): Silence gnulib message; regression
319 introduced 2009-03-13.
320 * doc/m4.texinfo (Sysval): Test this.
321 * NEWS: Document the change.
323 2009-06-26 Eric Blake <ebb9@byu.net>
325 Use bitrotate for hashing.
326 * gnulib: Update to latest.
327 * ltdl/m4/gnulib-cache.m4: Import bitrotate module.
328 * m4/hash.c (m4_hash_string_hash): Use it.
330 Fix description of limits on diversions.
331 * doc/m4.texinfo (Diversions): Fix grammar. Be less pessimistic
334 Reported by Elias Benali.
336 2009-06-17 Eric Blake <ebb9@byu.net>
338 Stress test for hash resizing.
339 * tests/builtins.at (define): Enhance test.
341 2009-06-15 Eric Blake <ebb9@byu.net>
343 Document why bootstrap might touch state of tree.
344 * bootstrap: Fix typos. Add comment.
345 * HACKING: Add notes about this scenario.
346 * gnulib: Update to latest version.
347 * .gitignore: Track gnulib changes.
349 Drop .cvsignore and redundant .gitignore files.
350 * .cvsignore: Delete. We are moving further away from CVS.
351 * build-aux/.cvsignore: Likewise.
352 * doc/.cvsignore: Likewise.
353 * examples/.cvsignore: Likewise.
354 * ltdl/.cvsignore: Likewise.
355 * m4/.cvsignore: Likewise.
356 * modules/.cvsignore: Likewise.
357 * po/.cvsignore: Likewise.
358 * src/.cvsignore: Likewise.
359 * tests/.cvsignore: Likewise.
360 * .gitignore: Consolidate from other files.
361 * build-aux/.gitignore: Delete, now that it is consolidated.
362 * doc/.gitignore: Likewise.
363 * examples/.gitignore: Likewise.
364 * ltdl/.gitignore: Likewise.
365 * m4/.gitignore: Likewise.
366 * modules/.gitignore: Likewise.
367 * po/.gitignore: Likewise.
368 * src/.gitignore: Likewise.
369 * tests/.gitignore: Likewise.
370 * bootstrap: Simplify accordingly. Sync gnulib tree prior to
371 libtoolize, to avoid libtool overwriting config.guess.
373 Avoid compiler warning.
374 * m4/macro.c (process_macro): Use correct type for isdigit.
376 2009-06-13 Eric Blake <ebb9@byu.net>
378 Avoid snprintf link failures.
379 * ltdl/m4/gnulib-cache.m4: Import snprintf-posix module.
380 Reported by Ralf Wildenhues.
382 2009-06-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
384 Avoid pointer arithmetic on `void *'.
385 * modules/m4.c (dump_symbol_CB): Cast obstack_base return value
386 to `char *' before using it.
388 2009-05-04 Eric Blake <ebb9@byu.net>
390 Silence verbose testsuite runs.
391 * tests/testsuite.at (m4_version_prereq): Bump to recent
392 autoconf.git version where stdout-nolog was added.
393 * tests/builtins.at (esyscmd, syscmd): Use new stdout-nolog.
394 * tests/freeze.at (AT_TEST_FREEZE): Likewise.
395 * tests/others.at (stderr closed): Likewise.
396 * HACKING: Mention new requirement.
397 * bootstrap: Likewise.
398 Reported by Ralf Wildenhues.
400 2009-04-21 Eric Blake <ebb9@byu.net>
402 Be more explicit about default quoting characters.
403 * doc/m4.texinfo (Quoted strings): Call out characters by name.
405 Suggested by Mehul Sanghvi.
407 2009-04-16 Eric Blake <ebb9@byu.net>
409 Use gnulib rename module.
410 * ltdl/m4/gnulib-cache.m4: Import rename module. At the moment,
411 we don't tickle either of the platform bugs that it fixes, but it
412 is better to be safe than sorry.
414 Require newer automake features.
415 * configure.ac (AM_INIT_AUTOMAKE): Add dist-xz, color-tests,
416 parallel-tests, and silent-rules. Drop dist-lzma.
417 * HACKING: Update minimum requirements.
418 * gnulib: Update to latest version.
420 Mention release of 1.4.13.
421 * NEWS: Update to match release on branch-1.4.
422 * doc/m4.texinfo (History): Update release history.
423 (copying): Finish conversion to GFDL 1.3, started 2008-11-04.
425 2009-03-23 Eric Blake <ebb9@byu.net>
427 Exploit git submodule by adding appropriate symlinks.
428 * bootstrap: No longer copy files from gnulib.
429 * COPYING: Change to symlink pointing into gnulib.
431 * build-aux/compile: Likewise.
432 * build-aux/config.guess: Likewise.
433 * build-aux/config.sub: Likewise.
434 * build-aux/depcomp: Likewise.
435 * build-aux/install-sh: Likewise.
436 * build-aux/mdate-sh: Likewise.
437 * build-aux/missing: Likewise.
438 * build-aux/texinfo.tex: Likewise.
439 * .cvsignore: Reflect these changes.
440 * .gitignore: Likewise.
441 * build-aux/.cvsignore: New file.
442 * build-aux/.gitignore: Likewise.
444 Make gnulib a git submodule.
445 * .gitmodules: New file.
446 * gnulib: Record which version of gnulib has been tested.
447 * bootstrap: Aid in submodule usage.
448 * cfg.mk (gnulib_dir): Alter default location of gnulib.
449 * HACKING: Mention how to use submodule.
451 2009-03-21 Eric Blake <ebb9@byu.net>
453 Use memcmp2 to simplify lexicographic comparisons.
454 * ltdl/m4/gnulib-cache.m4: Import memcmp2.
455 * modules/m4.c (dumpdef_cmp_CB): Use it.
457 2009-03-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
459 Fix m4.1 build race, exposed by parallelism through GNUmakefile.
460 * Makefile.am (SUBDIRS): Add doc.
461 (Documentation rules): Move ...
462 * doc/Makefile.am: ... to this new file.
463 * configure.ac (AC_CONFIG_FILES): Generate doc/Makefile.
465 2009-03-13 Eric Blake <ebb9@byu.net>
467 Try to tolerate spaces in directory names in testsuite.
468 * tests/null.m4: Provide shell quoting, in case __program__
471 Fix awk script portability.
472 * checks/get-them: In gsub, properly escape {.
473 Reported by Gary V. Vaughan.
475 Make bootstrap easier on Solaris.
476 * bootstrap: Add GNULIB_SRCDIR. Useful when a wrapper script
477 gnulib-tool exists earlier on the path to work around /bin/sh
478 failure in parsing $GNULIB_SRCDIR/gnulib-tool.
480 2009-03-13 Eric Blake <ebb9@byu.net>
482 Allow configuration choice in syscmd shell.
483 * ltdl/m4/m4-syscmd.m4: New file.
484 * configure.ac (M4_SYSCMD): Use it to provide
486 (AC_CHECK_HEADERS_ONCE): No longer need to worry about
488 * modules/m4.c (syscmd): Use it to avoid hard-coding the shell
490 * modules/gnu.c (esyscmd): Likewise.
491 * doc/m4.texinfo (Syscmd, Esyscmd): Document this.
492 * README: Document new configure option.
495 Use gnulib pipe module instead of popen(3).
496 * ltdl/m4/gnulib-cache.m4: Import pipe and wait-process modules.
497 * modules/gnu.c (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS):
499 (esyscmd): Rewrite with pipe module.
500 Resolves a failure on AIX, reported by Gary V. Vaughan.
502 Use gnulib execute module instead of system(3).
503 * ltdl/m4/gnulib-cache.m4: Import execute module.
504 * m4/utility.c (m4_info_name): New function.
505 * m4/m4module.h (m4_info_name): New prototype.
506 * modules/m4.c (syscmd): Rewrite with execute module.
507 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS, m4_sysval): Move
509 * modules/gnu.c (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS)
511 Resolves a failure on AIX, reported by Gary V. Vaughan.
513 2009-03-05 Eric Blake <ebb9@byu.net>
515 Improve web-manual maintainer rule.
516 * maint.mk (web-manual): Factor package-specific detail...
517 * cfg.mk (manual_title): ...to new variable.
519 2009-02-23 Eric Blake <ebb9@byu.net>
521 Speed up translit when from argument is short.
522 * modules/m4.c (translit): Use memchr2 when possible.
523 * tests/builtins.at (translit): Add tests.
524 * NEWS: Document this.
526 2009-02-18 Eric Blake <ebb9@byu.net>
528 Prefer buffer over byte operations.
529 * modules/format.c (format): Use memchr for speed.
530 * modules/gnu.c (substitute): Likewise.
531 * m4/macro.c (locate_dollar): Inline into only caller...
532 (process_macro): ...and rearrange for readability.
533 * m4/input.c (consume_buffer): Allow C++ compilation.
534 * doc/m4.texinfo (Changesyntax): Enhance test.
536 Speed up esyscmd with buffer reads.
537 * modules/gnu.c (esyscmd): Read blocks directly into obstack,
538 rather than repeatedly reading bytes. Detect read errors.
540 Avoid risk of stack overflow.
541 * m4/output.c (insert_file): Avoid stack allocation of large
544 Synchronize THANKS with branch.
545 * THANKS: Import more names.
547 Improve handling of $ in syntax table.
548 * m4/m4module.h (m4_is_syntax_single_dollar): New function.
549 (M4_SYNTAX_DOLLAR, M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): Change to
550 be context rather than basic syntax categories.
551 (M4_SYNTAX_MASKS): Adjust macro.
552 * m4/m4private.h (struct m4_syntax_table): Add dollar and
553 is_single_dollar members.
554 (m4_is_syntax_single_dollar): Add fast alternative.
555 * m4/syntax.c (m4_syntax_create, reset_syntax_set): Adjust to
556 account for change to context categories.
557 (m4_set_syntax): Manage is_single_dollar.
558 (m4_is_syntax_single_dollar): New function.
559 * m4/macro.c (locate_dollar): New helper function.
560 (process_macro): Use it to speed up macro expansion.
561 * m4/input.c (m4__next_token): Adjust client.
562 * doc/m4.texinfo (Changesyntax): Document this.
564 2009-02-17 Eric Blake <ebb9@byu.net>
566 Sync changecom documentation with branch.
567 * doc/m4.texinfo (Changecom): Tweak wording.
568 * NEWS: Import changes from the branch.
570 Stage 29b: Process quotes and comments by buffer, not bytes.
571 Search for quote and comment delimiters by buffer when possible.
573 Speed impact: noticeable improvement, from fewer function calls.
574 * ltdl/m4/gnulib-cache.m4: Import memchr2 module.
575 * m4/input.c (m4__next_token): Add buffer reads to quote and
577 * NEWS: Document this.
579 2009-02-16 Eric Blake <ebb9@byu.net>
581 Stage 29a: Process dnl and macro names by buffer, not bytes.
582 Enhance input engine to provide lookahead buffer, rather than
583 forcing clients to call next_char for every byte. Utilize this
584 for the simplest clients.
586 Speed impact: noticeable improvement, from fewer function calls.
587 * ltdl/m4/gnulib-cache.m4: Import freadptr and freadseek modules.
588 * m4/input.c (struct input_funcs): Add virtual functions
589 buffer_func and consume_func.
590 (file_buffer, file_consume, string_buffer, string_consume)
591 (composite_buffer, composite_consume, eof_buffer): Implement
593 (file_funcs, string_funcs, composite_funcs, eof_funcs): Update
595 (buffer_retry): New sentinel.
596 (next_buffer, consume_buffer): New functions.
597 (m4_skip_line, match_input, consume_syntax): Use them for faster
599 Suggested by Bruno Haible.
601 Unify single and multi-character delimiter handling.
602 * m4/input.c (MATCH): Add a parameter.
603 (m4__next_token): Simplify logic and reduce redundancy.
604 (m4__next_token_is_open): Adjust caller.
605 * m4/syntax.c (m4_set_comment, m4_set_quotes): Handle delimiters
606 of differing lengths.
607 (m4_set_syntax): Recognize restoration of single delimiters.
609 Revamp changesyntax vs. changequote interactions.
610 * m4/m4module.h (M4_SYNTAX_VALUE): Delete unused macro.
611 (M4_SYNTAX_SUSPECT): New macro.
612 * m4/m4private.h (struct m4_syntax_table): Add suspect field.
613 * m4/syntax.c (check_is_single_quotes, check_is_single_comments)
614 (check_is_macro_escaped): Delete, by inlining body...
615 (m4_set_syntax): ...into here. Improves handling between
616 changesyntax and changequote/changecom.
617 (add_syntax_set, subtract_syntax_set, set_syntax_set): Simplify,
618 and let suspect field track needed cleanup.
619 (m4_set_quotes, m4_set_comment): Adjust meaning of
620 is_single_quotes and is_single_comment flags to always be true if
621 only one delimiter exists, regardless of its length. Ensure that
622 the syntax categories M4_SYNTAX_LQUOTE and M4_SYNTAX_BCOMM are
623 only used on 1-byte delimiters.
624 (add_syntax_attribute, remove_syntax_attribute): Change signature
625 to allow the use of fewer casts. Adjust the suspect field when
627 (m4_reset_syntax, set_quote_age): Adjust callers.
628 * m4/input.c (m4__next_token, m4__next_token_is_open): Simplify
630 * doc/m4.texinfo (Changesyntax): Update documentation and tests.
632 Improve changesyntax documentation.
633 * doc/m4.texinfo (Changesyntax): Merge two tables into one
636 Fix regression in multicharacter quotes, from 2008-01-26.
637 * m4/input.c (m4__next_token): Fix typo.
638 * tests/builtins.at (changequote): Enhance test.
640 2009-02-13 Eric Blake <ebb9@byu.net>
642 Speed up parsing when detecting input file change.
643 * m4/input.c (next_char): Clear input_change flag. Bug introduced
646 2009-02-12 Eric Blake <ebb9@byu.net>
648 Avoid quadratic code when walking definition stack.
649 * examples/stack_sep.m4: Use linear, not quadratic
651 * doc/m4.texinfo (Improved copy): Fix documentation, based on
652 recent autoconf bug fix.
653 * tests/others.at (recursion): Enhance test.
655 2009-02-11 Eric Blake <ebb9@byu.net>
657 Stage 28c: Warn on embedded NUL in remaining cases.
658 Ensure all remaining warnings can handle embedded NUL.
660 Speed impact: none noticed.
661 * m4/m4module.h (m4_debug_decode, m4_parse_truth_arg): Add
663 * m4/macro.c (m4_macro_call): Improve diagnostic.
664 * modules/m4.c (defn): Likewise.
665 * m4/debug.c (m4_debug_decode): Handle embedded NUL.
666 * m4/utility.c (m4_parse_truth_arg): Likewise.
667 * modules/format.c (arg_int, arg_long, arg_double): Likewise.
668 (arg_string): New function.
669 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Update callers.
670 * src/main.c (main): Likewise.
671 * src/freeze.c (reload_frozen_state): Likewise.
672 * modules/gnu.c (debugmode, syncoutput): Likewise.
673 * tests/options.at (--regexp-syntax): Adjust test.
674 * tests/freeze.at (reloading nul): Likewise.
675 * tests/null.m4: Likewise.
676 * tests/null.out: Likewise.
677 * tests/null.err: Likewise.
679 Stage 28b: Warn on embedded NUL in file arguments.
680 Quote warning messages related to file and other NUL-terminated
683 Speed impact: none noticed.
684 * m4/path.c (m4_path_search): Quote file names in message.
685 * modules/m4.c (syscmd, include, m4_make_temp): Handle embedded
687 * modules/gnu.c (debugfile, esyscmd): Likewise.
688 * tests/others.at (nul character): Adjust test.
689 * tests/builtins.at (mkdtemp, mkstemp): Likewise.
690 * tests/null.m4: Likewise.
691 * tests/null.out: Likewise.
692 * tests/null.err: Likewise.
694 Stage 28a: Warn on embedded NUL in numeric arguments.
695 Quote warning messages related to numeric parsing in order to
698 Speed impact: none noticed.
699 * m4/m4module.h (m4_numeric_arg): Adjust prototype.
700 * m4/utility.c (m4_numeric_arg): Add parameter.
701 * modules/gnu.c (debuglen): Adjust callers.
702 * modules/m4.c (incr, decr, divert, undivert, m4exit, substr)
704 * modules/evalparse.c (m4_evaluate): Likewise.
705 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
706 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
708 * doc/m4.texinfo (Changesyntax): Fix typo.
709 * tests/others.at (nul character): Adjust test.
710 * tests/null.m4: Likewise.
711 * tests/null.out: Likewise.
712 * tests/null.err: Likewise.
714 2009-02-11 Eric Blake <ebb9@byu.net>
716 Avoid regression in popdef(undef).
717 * doc/m4.texinfo (Trace): Enhance test, to cover regression
718 recently fixed on the branch.
720 2009-02-09 Eric Blake <ebb9@byu.net>
722 Enhance index to support starting offset.
723 * modules/m4.c (index): Add optional third argument.
724 * NEWS: Document this.
725 * doc/m4.texinfo (Index macro): Likewise.
726 (Macro Arguments): Adjust tests.
728 2009-01-24 Eric Blake <ebb9@byu.net>
730 Add URLs to --help output.
731 * src/main.c (usage): Use enhanced version-etc features.
733 2009-01-07 Eric Blake <ebb9@byu.net>
735 Enhance substr to support replacement text.
736 * doc/m4.texinfo (Substr): Document new semantics.
737 * modules/m4.c (substr): Support optional fourth argument.
738 * NEWS: Document this.
740 Enhance substr to support negative values.
741 * doc/m4.texinfo (Substr): Document new semantics, and how to
743 * modules/m4.c (substr): Support negative values.
744 * NEWS: Document this.
746 2009-01-05 Eric Blake <ebb9@byu.net>
749 * HACKING: Remove mention of xdelta.
750 * Makefile.am (EXTRA_DIST, MAINTAINERCLEANFILES): Let gnulib take
751 care of distributing gendocs.sh.
752 * maint.mk (web-manual): Use new feature of gendocs.
753 * ltdl/m4/gnulib-cache.m4: Regenerate.
755 2008-12-24 Eric Blake <ebb9@byu.net>
757 Relax eval as allowed by POSIX 2008.
758 * modules/evalparse.c (m4_evaluate): Warn, not error, on invalid
759 operator. Quote expression in warning.
760 * modules/mpeval.c (includes): Add quotearg.h.
761 * doc/m4.texinfo (Eval, Improved forloop): Update tests.
762 * NEWS: Update to reflect 1.6 support for `?:'.
764 2008-12-23 Eric Blake <ebb9@byu.net>
766 Add debugmode(o) to control dumpdef output location.
767 * m4/m4module.h (M4_DEBUG_TRACE_OUTPUT_DUMPDEF): New enumerator.
768 (M4_DEBUG_TRACE_VERBOSE): Update.
769 * m4/debug.c (m4_debug_decode): Support new debug option.
770 * src/freeze.c (produce_debugmode_state): Likewise.
771 * modules/m4.c (dumpdef): When set, force dumpdef to stderr rather
773 * src/main.c (usage): Document it.
774 * doc/m4.texinfo (Debugmode, Dumpdef, Debugging options)
775 (Debugfile): Likewise.
777 Based on an autoconf bug report by Paolo Bonzini.
779 Make --debugfile argument optional.
780 * src/main.c (long_options): Make the argument optional, to allow
781 setting debug file back to stderr.
782 (main): Make --debugfile order-dependent.
783 (usage): Document this.
784 * doc/m4.texinfo (Debugging options): Likewise.
786 * tests/options.at (--debugfile): Enhance test.
787 (--safer): Adjust to new semantics.
789 2008-12-22 Eric Blake <ebb9@byu.net>
792 * doc/m4.texinfo (Operation modes, Preprocessor features)
793 (Limits control, Frozen state, Debugging options)
794 (Dynamic loading features): Use lower case names in @var.
795 (Improved copy): Use @code, not @var, as appropriate.
797 2008-12-18 Eric Blake <ebb9@byu.net>
799 Deal with M4 1.4.x limitation on builtin tokens.
800 * doc/m4.texinfo (Composition): Mention limitation on curry.
801 (Improved copy): New node.
803 * examples/stack.m4: Likewise.
804 * examples/stack_sep.m4: New file.
805 * Makefile.am (dist_pkgdata_DATA): Distribute it.
807 2008-12-15 Eric Blake <ebb9@byu.net>
809 Double size of temp file cache.
810 * m4/output.c (tmp_file, tmp_file_owner): Split...
811 (tmp_file1, tmp_file2, tmp_file1_owner, tmp_file2_owner): ...into
813 (tmp_file2_recent): New variable.
814 (m4_tmpopen, m4_tmpclose, m4_tmpremove, m4_tmprename)
815 (m4_output_exit): Adjust callers.
817 Use fewer seeks on cached files.
818 * m4/output.c (m4_tmpfile): Use write, not append mode.
819 (m4_tmpopen): Add parameter to decide when to skip seeks.
820 (m4_tmprename, m4_make_diversion, insert_diversion_helper)
821 (m4_freeze_diversions): Adjust callers.
823 Cache most recently spilled diversion.
824 * m4/output.c (tmp_file, tmp_file_owner): New variables, for
825 1-deep cache of spilled diversions.
826 (m4_tmpfile): Open in append mode, since we might revisit
827 diversion without closing it now.
828 (m4_tmpopen): Check cache first.
829 (m4_tmpclose): Update cache, rather than closing. Add parameter.
830 (m4_tmpremove): Close cache before removing.
831 (m4_tmprename): Deal with open files when renaming.
832 (m4_output_exit): Close cache before exiting.
833 (make_room_for, m4_make_diversion, insert_diversion_helper):
835 * ltdl/m4/m4-rename.m4 (M4_RENAME): New file.
836 * configure.ac (M4_RENAME): Invoke it.
838 Correctly track size of in-memory diversions.
839 * m4/output.c (insert_diversion_helper): Correctly track total
840 in-memory diversion size after undivert.
842 Avoid quadratic behavior for some cases of divert/undivert.
843 * m4/output.c (struct m4_diversion): Improve comments.
844 (m4_tmpname, m4_make_diversion): Strengthen preconditions.
845 (m4_tmprename): New function.
846 (m4_output_init, m4_output_exit): Move after internal functions.
847 (make_room_for): Don't bother copying uninitialized bytes.
848 (insert_diversion_helper): Transfer metadata, rather than copying
849 contents, when undiverting into a previously unused diversion.
850 * tests/builtins.at (divert): Add a check to the test.
851 * doc/m4.texinfo (Undivert): Enhance test.
852 * NEWS: Document the speedup.
854 2008-12-02 Eric Blake <ebb9@byu.net>
856 Stage 27: Allow embedded NUL in text processing macros.
857 Pass NUL through regular expressions, format, and translit, and
858 diagnose it in eval and changeresyntax. Improve warning
859 capabilities of format.
861 Speed impact: none noticed.
862 * modules/m4.c (m4_expand_ranges): Don't append extra bytes.
863 (translit): Manage NUL bytes.
864 * modules/format.c (format): Likewise.
865 * modules/gnu.c (substitute, regexp_substitute): Likewise.
866 (m4_resyntax_encode_safe): Add parameter.
867 (regexp, patsubst, renamesyms): Update callers.
868 (regexp_compile): Adjust error message.
869 * modules/evalparse.c (m4_evaluate): Use consistent message.
870 (end_text): New variable.
871 (eval_init_lex): Add parameter.
872 (eval_lex): Detect embedded NUL.
873 * src/freeze.c (reload_frozen_state): Likewise.
874 * doc/m4.texinfo (Format): Update to cover new behavior.
875 (Eval): Mention that result is unquoted.
876 * tests/freeze.at (reloading nul): Enhance test.
877 * tests/null.m4: Likewise.
878 * tests/null.err: Update expected output.
879 * tests/null.out: Likewise.
880 * tests/options.at (--regexp-syntax): Likewise.
882 2008-11-28 Eric Blake <ebb9@byu.net>
884 Resync NEWS with branches.
885 * NEWS: Mention 1.4.12, update state of 1.6.
887 2008-11-26 Eric Blake <ebb9@byu.net>
889 Keep COPYING in repository.
890 * Makefile.am (MAINTAINERCLEANFILES): Don't remove COPYING.
891 * .cvsignore: Don't ignore it.
892 * .gitignore: Likewise.
893 * COPYING: Store in repository, per automake 1.10.2
896 2008-11-26 Eric Blake <ebb9@byu.net>
898 Document optimized forloop.
899 * doc/m4.texinfo (Improved forloop): Mention alternate style that
900 avoids define overhead.
901 * examples/forloop3.m4: New file.
902 * Makefile.am (dist_pkgdata_DATA): Distribute it.
904 Document copy composite using stack_foreach and curry.
905 * doc/m4.texinfo (Stacks): New node, to document pushdef stack
907 (Ifelse): Move define_blind...
908 (Composition): ...to this new node. Document currying, then use
909 it to implement copy and rename.
910 * examples/curry.m4: New file.
911 * examples/stack.m4: Likewise.
912 * Makefile.am (dist_pkgdata_DATA): Distribute them.
914 2008-11-04 Eric Blake <ebb9@byu.net>
917 * ltdl/m4/gnulib-cache.m4: Replace fdl module with fdl-1.3.
918 * Makefile.am (doc_m4_TEXINFOS, MAINTAINERCLEANFILES): Reflect
920 * doc/m4.texinfo (GNU Free Documentation License): Likewise.
922 2008-10-22 Eric Blake <ebb9@byu.net>
924 Give nicer error if user modifies testsuite but lacks autoconf.
925 * Makefile.am (AUTOM4TE): Use missing in the definition.
927 2008-10-09 Eric Blake <ebb9@byu.net>
929 Allow user to choose which sed to use in testsuite.
930 * tests/atlocal.in (SED): Inherit from configure results.
931 * tests/builtins.at (__m4_@&t@version__, divert, esyscmd)
932 (mkstemp, syscmd): Use $SED.
933 * tests/generate.awk (new_test): Likewise.
934 * tests/options.at (deprecated options, unknown option)
935 (--debugmode, --help and --version): Likewise.
936 * tests/testsuite.at (AT_CHECK_M4): Likewise.
937 * tests/others.at (directory, stderr closed, stdin seekable)
938 (stdout closed): Likewise.
939 (nul character): Likewise. Also, skip test if sed can't handle
942 Clean up testsuite invocation.
943 * tests/atlocal.in: Fix copyright notice.
944 * Makefile.am (TESTS_ENVIRONMENT): Delete; it wasn't being used.
945 (check-local, installcheck-local): Adjust clients. Add missing
948 2008-09-25 Eric Blake <ebb9@byu.net>
950 Tweak error message on command line failure.
951 * m4/m4private.h (includes): Use "quotearg.h".
952 * src/main.c (process_file, main): Use nicer quotes for file name
954 * m4/input.c (file_clean, m4_push_file): Likewise.
955 * m4/module.c (m4__module_open): Likewise.
956 * src/freeze.c (produce_frozen_state, reload_frozen_state):
958 * modules/gnu.c (debugfile): Likewise.
959 * modules/m4.c (undivert, include): Likewise.
960 * tests/others.at (directory, stdin closed): Update tests.
961 * tests/options.at (file names, --debugmode): Likewise.
962 * doc/m4.texinfo (Debugmode): Likewise.
964 Unify error handling for reading directories.
965 * m4/path.c (m4_path_search): Factor open attempts...
966 (m4_fopen): ...into new function, to reject directories.
967 * tests/others.at (directory): Enhance test.
968 * doc/m4.texinfo (Include): Document that directories cannot be
971 Avoid bugs on platforms that mishandle trailing /.
972 * ltdl/m4/gnulib-cache.m4: Import fopen module.
973 * tests/others.at (directory): New test.
975 2008-09-16 Eric Blake <ebb9@byu.net>
977 Fix bootstrap for Solaris /bin/sh.
978 * bootstrap: Avoid shell quoting pitfall.
980 2008-09-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
982 Typos in source code comments.
983 * modules/m4.c: Fix typos in comments.
984 * m4/input.c: Likewise.
985 * src/main.c: Likewise.
987 2008-08-29 Eric Blake <ebb9@byu.net>
989 Fix manual date information.
990 * doc/m4.texinfo: UPDATED refers to the day the manual was built,
991 not the release date of M4.
992 Based on a bison patch by Akim Demaille.
994 2008-08-27 Eric Blake <ebb9@byu.net>
997 * doc/m4.texinfo (Invoking m4): Fix example, since order of -d
1001 2008-08-23 Eric Blake <ebb9@byu.net>
1003 Allow debugmode control over whether defn(undef) warns.
1004 * ltdl/m4/gnulib-cache.m4: Import verify module.
1005 * m4/m4module.h (M4_DEBUG_TRACE_DEREF, M4_DEBUG_TRACE_INITIAL):
1007 (M4_DEBUG_TRACE_VERBOSE, M4_DEBUG_TRACE_DEFAULT): Adjust.
1008 * m4/m4.c (m4_create): Start with debugmode = d.
1009 * src/main.c (usage): Mention this.
1010 (main): Let -E impact debug mode.
1011 * m4/utility.c (m4_symbol_value_lookup): Squelch undefined warning
1013 * modules/gnu.c (builtin, inder): Likewise.
1014 * m4/debug.c (m4_debug_decode): Parse new mode.
1015 * src/freeze.c (produce_debugmode_state): Accomodate new mode.
1016 * doc/m4.texinfo (Debugging options): Mention change in the
1018 (Debugmode): Mention new flag d.
1019 (Operation modes): Mention interaction with -E.
1020 (Undefine, Defn, Pushdef, Indir, Builtin, Dumpdef): Document and
1022 * tests/options.at (--debugmode): Update tests.
1023 * tests/freeze.at (reloading debugmode): Likewise.
1024 * NEWS: Document this.
1025 Reported by Ralf Wildenhues; without this patch, M4 1.6+ would be
1026 incompatible with Autoconf 2.62.
1028 2008-08-22 Eric Blake <ebb9@byu.net>
1030 Improve --debugmode behavior.
1031 * m4/m4module.h (m4_debug_decode): Simplify interface.
1032 * m4/debug.c (m4_debug_decode): Remove parameter, and handle
1033 setting the new value.
1034 * modules/gnu.c (debugmode): Adjust caller.
1035 * src/freeze.c (reload_frozen_state): Likewise.
1036 * src/main.c (main): Likewise.
1037 (usage): Fix default for --debug.
1038 * doc/m4.texinfo (Debugging options): Add an example.
1040 2008-08-21 Eric Blake <ebb9@byu.net>
1042 Avoid regression in defn(undef).
1043 * doc/m4.texinfo (Trace): Enhance test, to cover regression
1044 recently fixed on the branch.
1046 2008-08-18 Eric Blake <ebb9@byu.net>
1048 Remove deprecated -N option; fixes a regression from 2006-09-14.
1049 * src/main.c (DIVERSIONS_OPTION): Delete.
1050 (long_options, OPTSTRING, main): Remove -N/--diversions option.
1051 * doc/m4.texinfo (Limits control): Remove it from the manual.
1052 * NEWS: Mention that it is gone.
1053 * tests/options.at (deprecated options): Update test.
1055 Improve 'git diff' of manual source.
1056 * .gitattributes (*.texi*): Add diff attribute.
1057 * bootstrap: Tell git how to use it.
1058 Inspired by Jim Meyering's similar patch for coreutils.
1060 2008-08-07 Bruno Haible <bruno@clisp.org> (tiny change)
1062 Run m4 tests prior to gnulib unit tests.
1063 * Makefile.am (SUBDIRS): Swap order of directories.
1065 2008-08-03 Eric Blake <ebb9@byu.net>
1067 Stage 26: Allow embedded NUL in macro definitions.
1068 Clean up final few locations that did not track macro definitions
1069 by length, to allow embedded NUL. Make m4_arg_len callers aware
1070 of issue of flattening builtins when determining length.
1071 Memory impact: none.
1072 Speed impact: none noticed.
1073 * m4/m4module.h (m4_arg_len): Add parameter.
1074 (M4ARGLEN): Provide default for the parameter.
1075 * m4/m4private.h (includes): Share xmemdup0.h among all libm4
1077 * m4/macro.c (m4_arg_len): Fail if builtins are not flattened.
1078 * m4/syntax.c (includes): Rely on m4private.h for xmemdup0.
1079 * m4/symtab.c (includes): Likewise.
1080 (m4_symbol_value_copy): Use xmemdup0.
1081 * m4/module.c (install_macro_table): Likewise.
1082 * src/freeze.c (reload_frozen_state): Likewise.
1083 * tests/freeze.at (reloading nul): Enhance test.
1084 * tests/null.m4: Likewise.
1085 * tests/null.err: Update expected output.
1086 * tests/null.out: Likewise.
1088 Fix regression in commenting unbalanced quotes, from 2008-02-16.
1089 * m4/m4private.h (m4__token_type): Add M4_TOKEN_COMMENT.
1090 * m4/input.c (m4__next_token, m4_print_token): Supply new token
1092 * m4/macro.c (expand_token): Penalize comments, as they can
1093 contain unbalanced quotes; latent bug since 2007-12-07, exposed by
1094 passing $@ references built from comments.
1095 (expand_argument): Adjust caller.
1096 * tests/others.at (Comments): Enhance test to catch it.
1097 * NEWS: Mention the fix.
1099 2008-07-30 Eric Blake <ebb9@byu.net>
1101 Fix regression in trace output, introduced 2008-05-08.
1102 * m4/input.c (m4__push_symbol): When cloning chains, break pointer
1103 back to original chain; latent bug from 2008-02-02 that did not
1104 cause misbehavior until trace output read unfinished chain.
1105 * tests/builtins.at (debug): Add test for this.
1107 2008-07-28 Eric Blake <ebb9@byu.net>
1109 Optimize iteration examples.
1110 * examples/forloop2.m4: Avoid excess indir, by passing current
1111 counter value as parameter.
1112 * examples/foreachq3.m4: Avoid unneeded ifelse, by injecting an
1114 * doc/m4.texinfo (Improved forloop, Improved foreach): Update the
1115 documentation to match.
1117 2008-07-26 Eric Blake <ebb9@byu.net>
1119 Give example for O(n) foreach on m4 1.4.x.
1120 * examples/foreachq4.m4: New file.
1121 * Makefile.am (dist_pkgdata_DATA): Distribute it.
1122 * tests/others.at (recursion): Test it.
1123 * doc/m4.texinfo (Improved foreach): Document linear foreach with
1124 m4 1.4.5 and greater.
1126 2008-07-19 Eric Blake <ebb9@byu.net>
1128 Resynchronize docs from branch.
1129 * doc/m4.texinfo (Undefine, Pushdef): Mention warning on undefined
1130 name, particularly since the old documentation didn't match code.
1131 (Standard Modules): Add caveat about using __m4_version__.
1133 2008-07-11 Eric Blake <ebb9@byu.net>
1135 Bump required automake to 1.10a; regression introduced 2008-01-22.
1136 * configure.ac (AM_INIT_AUTOMAKE): Undo requirement downgrade to
1137 1.10.1, since we also rely on pkglibexecdir.
1138 * HACKING: Fix minimum requirement.
1139 * bootstrap: Likewise.
1141 Reported by Joel E. Denny.
1143 Avoid bogus whitespace in @ovar, @dvar.
1144 * doc/m4.texinfo (ovar, dvar): Add @c.
1145 Based on patch by Ralf Wildenhues to Autoconf manual.
1147 2008-06-23 Eric Blake <ebb9@byu.net>
1149 Adjust to new gnulib-tool layout.
1150 * ltdl/m4/gnulib-cache.m4: Reformat.
1152 Fix bootstrap comment.
1153 * bootstrap: DOWNLOAD_PO was previously removed.
1155 2008-06-19 Eric Blake <ebb9@byu.net>
1157 Revert speed regression from 2008-06-16.
1158 * m4/output.c (m4_shipout_int): Avoid obstack_printf in hot path.
1159 * modules/m4.c (numb_obstack): Likewise.
1160 * m4/input.c (MATCH): Use fewer conditionals, and factor
1162 (match_input): ...here for smaller code size.
1163 * m4/syntax.c (m4_reset_syntax, m4_set_quotes, m4_set_comment):
1164 Supply trailing NUL to delimiters, to meet contract of faster
1167 2008-06-18 Eric Blake <ebb9@byu.net>
1170 * m4/m4module.h: Use consistent spacing for pointer parameters.
1171 * m4/m4private.h: Likewise.
1173 Stage 25b: Handle embedded NUL in changesyntax and friends.
1174 Track quote and comment delimiters by length, to allow embedded
1175 NUL. Improve changesyntax to support assigning syntax to NUL.
1176 Memory impact: none.
1177 Speed impact: none noticed.
1178 * m4/m4module.h (m4_set_quotes, m4_set_comment, m4_set_syntax):
1180 (m4_reset_syntax): New prototype.
1181 * m4/syntax.c (add_syntax_set, subtract_syntax_set)
1182 (set_syntax_set, m4_set_quotes, m4_set_comment): Add parameter, to
1183 handle embedded NUL.
1184 (m4_set_syntax): Likewise. Also, split code to reset the table...
1185 (m4_reset_syntax): ...into a new function.
1186 (m4_syntax_create): Adjust callers.
1187 * m4/input.c (match_input, MATCH): Add parameter.
1188 (m4__next_token, m4__next_token_is_open): Adjust callers.
1189 * modules/m4.h (m4_expand_ranges_func): Add parameter.
1190 * modules/m4.c (dumpdef): Handle NUL in dumped quotes.
1191 (changequote, changecom, translit, m4_expand_ranges): Track
1193 * modules/gnu.c (changesyntax): Handle embedded NUL.
1194 * src/freeze.c (reload_frozen_state): Adjust callers.
1195 * tests/freeze.at (reloading nul): Enhance test.
1196 * tests/null.m4: Likewise.
1197 * tests/null.out: Update expected output.
1198 * tests/null.err: Likewise.
1200 2008-06-16 Eric Blake <ebb9@byu.net>
1202 Stage 25a: Use obstack_printf for easier output.
1203 Convert macro tracing and other locations to use obstack_printf
1204 rather than hand-rolled equivalents. Ensure that embedded NUL in
1205 trace output does not truncate the trace string.
1206 Memory impact: none.
1207 Speed impact: noticeable penalty, from obstack_printf overhead.
1208 * ltdl/m4/gnulib-cache.m4: Import obstack-printf-posix module.
1209 * m4/macro.c (trace_format): Delete; use obstack_printf instead.
1210 (trace_header, trace_pre, trace_post): All callers updated.
1211 * m4/output.c (m4_shipout_int, m4_tmpname): Use obstack_printf.
1212 (m4_divert_text): Speed up syncline output.
1213 * modules/m4.c (dumpdef): Handle embedded NUL.
1214 (numb_obstack): Speed up eval output.
1215 (maketemp): Use obstack_printf.
1216 * modules/format.c (format): Likewise.
1218 Add missing const qualifications.
1219 * m4/resyntax.c (m4_resyntax_map): Declare array elements as
1221 * modules/gnu.c (m4_builtin_table, m4_macro_table): Likewise.
1222 * modules/import.c (m4_builtin_table): Likewise.
1223 * modules/load.c (m4_builtin_table, m4_macro_table): Likewise.
1224 * modules/m4.c (m4_builtin_table): Likewise.
1225 * modules/modtest.c (m4_builtin_table, m4_macro_table): Likewise.
1226 * modules/mpeval.c (m4_builtin_table, m4_macro_table): Likewise.
1227 * modules/perl.c (m4_builtin_table, m4_macro_table): Likewise.
1228 * modules/shadow.c (m4_builtin_table, m4_macro_table): Likewise.
1229 * modules/stdlib.c (m4_builtin_table): Likewise.
1230 * modules/time.c (m4_builtin_table): Likewise.
1231 * modules/traditional.c (m4_macro_table): Likewise.
1233 2008-06-10 Eric Blake <ebb9@byu.net>
1235 Avoid corrupted frozen file if NUL appears on block boundary.
1236 * m4/output.c (insert_file): Separate consecutive quotearg blocks
1237 with \<newline>, in case last byte of first block was NUL.
1239 2008-06-03 Eric Blake <ebb9@byu.net>
1241 Fix printf type mismatches.
1242 * m4/m4module.h (m4_bad_argc): Alter parameter type.
1243 * m4/m4private.h (struct m4_call_info): Alter call_id type.
1244 * m4/macro.c (expand_macro, m4__adjust_refcount): Use correct
1246 * m4/utility.c (m4_bad_argc): Likewise.
1248 Borrow bootstrap ideas from gnulib.
1249 * bootstrap (options, DOWNLOAD_PO): Remove --download-po; the
1250 advertized subset of languages didn't work. Use --skip-po
1251 instead, for consistency with gnulib bootstrap.
1252 (func_get_translations): Use rsync, not wget.
1253 (func_update_po): Use a reference directory, to avoid changing
1254 timestamps on unchanged .po files.
1255 * TODO: Update accordingly.
1257 Fix fallout from previous patch.
1258 * doc/m4.texinfo (Builtin): Adjust expected output.
1260 2008-06-02 Eric Blake <ebb9@byu.net>
1262 Stage 24c: Improve display of macro names with embedded NUL.
1263 Quote instances of problematic characters in macro names when
1264 presented to user. Track location via call_info rather than
1265 munging context for every expansion.
1266 Memory impact: none.
1267 Speed impact: slight penalty, due to more bookkeeping.
1268 * m4/m4module.h (m4_push_string_init): Add parameters.
1269 * m4/m4private.h (struct m4_macro_args): Remove argv0 and
1270 argv0_len, now redundant with info.
1271 (m4__push_wrapup_init): Add parameter.
1272 * m4/input.c (m4_push_string_init, m4__push_wrapup_init): Track
1273 location from caller, rather than context.
1274 (composite_peek, composite_read, match_input): Adjust callers.
1275 * m4/utility.c (m4_symbol_value_lookup): Quote macro name.
1276 (m4_verror_at_line): Allow NUL in macro name.
1277 * m4/macro.c (trace_flush, m4_trace_prepare, trace_pre): Allow NUL
1279 (expand_macro): No longer munge context location.
1280 (collect_arguments, m4_arg_text, m4_arg_empty, m4_arg_len)
1281 (m4_make_argv_ref, m4_push_arg, m4_wrap_args): Adjust callers.
1282 * modules/gnu.c (builtin, indir): Likewise.
1283 * tests/null.m4: Enhance test.
1284 * tests/null.err: Adjust expected output.
1285 * tests/null.out: Likewise.
1287 Stage 24b: Allow embedded NUL in macro names.
1288 Use length rather than NUL-termination when tracking macro names.
1289 All APIs dealing with symbol table changed.
1290 Memory impact: none.
1291 Speed impact: slight penalty, due to more bookkeeping.
1292 * m4/m4module.h (m4_symtab_apply_func, m4_symbol_lookup)
1293 (m4_symbol_pushdef, m4_symbol_define, m4_symbol_popdef)
1294 (m4_symbol_rename, m4_symbol_delete): Add length parameter.
1295 (m4_string): New type.
1296 * ltdl/m4/gnulib-cache.m4: Import xmemdup0 module.
1297 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): Account for
1299 * m4/symtab.c (m4_symtab_delete, m4_symtab_apply, symtab_fetch)
1300 (m4__symtab_remove_module_references, symbol_destroy_CB)
1301 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_define)
1302 (m4_symbol_popdef, m4_symbol_rename, m4_set_symbol_name_traced)
1303 (m4_symbol_delete): Likewise.
1304 * modules/m4.h (struct m4_dump_symbol_data): Adjust type to allow
1306 * m4/macro.c (expand_token): Adjust all callers.
1307 * m4/module.c (install_builtin_table, install_macro_table):
1309 * m4/utility.c (m4_symbol_value_lookup): Likewise.
1310 * modules/gnu.c (indir, renamesyms, m4symbols): Likewise.
1311 * modules/m4.c (define, undefine, pushdef, popdef)
1312 (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols, dumpdef)
1313 (traceon, traceoff): Likewise.
1314 * src/main.c (main): Likewise.
1315 * src/freeze.c (dump_symbol_CB, reload_frozen_state): Likewise.
1316 * tests/freeze.at (reloading nul): Augment test.
1317 * tests/null.out: Adjust expected output.
1319 Stage 24a: Use full call context in error reporting.
1320 Replace const char *macro_name with const m4_call_info *call, so
1321 that the next patch can pass the length of macro_name with
1322 embedded NUL. Simplifies handling of global state.
1323 Memory impact: none.
1324 Speed impact: none noticed.
1325 * m4/m4module.h (m4_error, m4_warn): Change parameter type.
1326 (m4_error_at_line, m4_warn_at_line): Delete.
1327 (m4_debug_set_output, m4_skip_line, m4_bad_argc, m4_numeric_arg)
1328 (m4_parse_truth_arg, m4_symbol_value_lookup): Adjust all clients.
1329 * m4/m4private.h (m4__next_token): Likewise.
1330 * m4/utility.c (m4_verror_at_line): Alter parameter, and use
1331 caller's location if caller is provided.
1332 (m4_error, m4_warn): Change parameter type.
1333 (m4_error_at_line, m4_warn_at_line): Delete.
1334 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg)
1335 (m4_symbol_value_lookup): Adjust all callers.
1336 * m4/debug.c (set_debug_file, m4_debug_set_output): Likewise.
1337 * m4/input.c (m4_skip_line, m4__next_token): Likewise.
1338 * m4/macro.c (expand_argument, collect_arguments, m4_macro_call)
1339 (process_macro): Likewise.
1340 * modules/m4.h (m4_make_temp_func): Likewise.
1341 * modules/evalparse.c (m4_evaluate): Likewise.
1342 * modules/format.c (arg_int, arg_long, arg_double, format):
1344 * modules/gnu.c (builtin, changeresyntax, changesyntax, debugfile)
1345 (debuglen, debugmode, esyscmd, indir, mkdtemp, patsubst, regexp)
1346 (renamesyms, syncoutput, regexp_compile, substitute)
1347 (regexp_substitute, m4_resyntax_encode_safe): Likewise.
1348 * modules/m4.c (define, undefine, pushdef, popdef, ifdef, ifelse)
1349 (m4_dump_symbols, defn, syscmd, incr, decr, divert, undivert, dnl)
1350 (include, maketemp, mkstemp, m4exit, traceon, traceoff, substr):
1352 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
1353 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
1355 * tests/options.at (--syncoutput): Add test for invalid
1356 command-line argument. Split xfailed portion...
1357 (--syncoutput and diversions): ...into new test.
1358 (unknown option): New test.
1359 * tests/freeze.at (reloading unknown builtin): Update expected
1362 Adjust to recent gnulib change.
1363 * configure.ac (AB_INIT): Delete, now that gnulib does this.
1365 2008-05-28 Eric Blake <ebb9@byu.net>
1367 Improve frozen debugmode behavior.
1368 * m4/debug.c (m4_debug_decode): Make empty debugmode additive.
1369 * src/main.c (main): Interleave -d with files.
1370 * tests/options.at (--debugmode): Update test.
1371 * tests/freeze.at (reloading debugmode): New test.
1372 * doc/m4.texinfo (Debugging options, Debugmode): Document the
1376 2008-05-27 Eric Blake <ebb9@byu.net>
1378 Fix some testsuite failures on Solaris 8.
1379 * tests/builtins.at (esyscmd, syscmd): Skip tests if system(2) is
1381 * tests/others.at (stderr closed): Likewise. Also support Solaris
1383 (stdin closed): Skip test if closed stdin gets reopened.
1384 (stdout closed): Support Solaris wording for EBADF.
1385 * tests/testsuite.at (AT_CHECK_M4): Likewise.
1387 Fix configure message nesting, broken since 2001-09-20.
1388 * ltdl/m4/gmp.m4 (M4_LIB_GMP): Don't cache result; the test is
1389 not expensive, and AC_MSG_WARN doesn't work in AC_CACHE_CHECK.
1391 Support 'make dist' with BSD make.
1392 * Makefile.am (TESTSUITE_AT, MAINTAINERCLEANFILES): Qualify uses
1393 of the generated file tests/generated.at.
1394 (EXTRA_DIST, $(TESTSUITE)): Likewise for tests/package.m4.
1395 * tests/others.at (stdout closed): Accomodate OpenBSD /bin/sh.
1397 2008-05-24 Eric Blake <ebb9@byu.net>
1399 Test NUL in frozen files.
1400 * tests/testsuite.at (AT_CHECK_M4): Add parameter.
1401 * tests/freeze.at (reloading nul): New test.
1402 (AT_TEST_FREEZE): Inhibit -d when reloading frozen file.
1403 (reloading unknown builtin): Likewise.
1405 2008-05-23 Eric Blake <ebb9@byu.net>
1407 Improve handling of frozen file errors.
1408 * src/freeze.c (produce_frozen_state): Detect write failures.
1409 (reload_frozen_state): Use close_stream.
1410 * tests/freeze.at (freezing failure): New test.
1412 Reported by Jean-Charles Longuet.
1414 2008-05-19 Eric Blake <ebb9@byu.net>
1416 In frozen file, split consecutive strings with newline.
1417 * src/freeze.c (dump_symbol_CB): Add newline to 'T', 'F'.
1418 (produce_frozen_state): Likewise for 'Q', 'C'.
1419 (reload_frozen_state): Parse the new layout.
1420 [GET_DIRECTIVE]: Fix format 1 regression from 2008-05-13.
1421 * tests/freeze.at (loading format 2): Rewrite to new format.
1422 (reloading unknown builtin): Likewise.
1423 (loading format 1): Make sure backslash-newline is not
1425 * doc/m4.texinfo (Frozen file format 2): Document the format.
1426 * NEWS: Document this change.
1428 Fix xgettext options.
1429 * po/Makevars (XGETTEXT_OPTIONS): The " must be passed to
1432 Fix spelling of René Seindal's name in --version output.
1433 * ltdl/m4/gnulib-cache.m4: Import propername module.
1434 * src/main.c (AUTHORS): Rewrite in terms of proper_name.
1435 * po/Makevars (XGETTEXT_OPTIONS): Detect new functions.
1436 * HACKING: Mention new prerequisite of gperf.
1438 2008-05-18 Eric Blake <ebb9@byu.net>
1440 Allow freezing the trace status of macros.
1441 * src/freeze.c (produce_symbol_dump): Let undefined traced macros
1443 (dump_symbol_CB): Also freeze trace state.
1444 * tests/freeze.at (reloading traced macros): New test.
1445 * doc/m4.texinfo (Using frozen files): Update documentation to
1447 (Frozen file format 1): Improve synchronization with branch.
1448 (Frozen file format 2): Reorder directives, and add `d', `t'.
1449 * NEWS: Document this change.
1451 2008-05-15 Eric Blake <ebb9@byu.net>
1453 Fix frozen file regression in pushdef stacks from 2001-09-01.
1454 * src/freeze.c (dump_symbol_CB): Push all values on the stack, not
1455 just the current definition.
1456 (reverse_symbol_value_stack): New helper method.
1457 * tests/freeze.at (AT_TEST_FREEZE): New helper macro.
1458 (reloading pushdef stack): New test.
1459 (reloading unknown builtin): Enhance test.
1461 2008-05-13 Eric Blake <ebb9@byu.net>
1463 Fix frozen file regression in diversions from 2007-01-21.
1464 * m4/output.c (insert_diversion_helper): Add parameter.
1465 (m4_insert_file): Move contents...
1466 (insert_file): ...to this new helper, with added parameter.
1467 (m4_insert_diversion, m4_undivert_all, m4_freeze_diversions):
1469 * src/freeze.c (produce_mem_dump): Simplify.
1470 * tests/freeze.at (large diversion): Test for this.
1472 Improve error message when frozen file is invalid.
1473 * src/freeze.c (decode_char): Add parameter. Allow \<newline>
1475 (reload_frozen_state): Track current line.
1476 * tests/freeze.at (loading format 1, loading format 2): Update to
1479 2008-05-10 Eric Blake <ebb9@byu.net>
1481 Detect integer overflow when loading frozen file.
1482 * src/freeze.c (reload_frozen_state) [GET_NUMBER]: Rewrite to fail
1483 immediately on overflow.
1484 * tests/freeze.at (loading format 2): Test this.
1485 Reported by Jim Meyering.
1487 2008-05-08 Eric Blake <ebb9@byu.net>
1489 Stage 23: allow tracing of indirect macro calls.
1490 Track all trace information as part of the argv struct, rather
1491 than temporarily resetting global state. Teach indir to trace
1492 macros that it invokes.
1493 Memory impact: slight penalty, due to larger argv struct.
1494 Speed impact: none noticed.
1495 * m4/m4module.h (m4_input_block): Remove.
1496 (m4_call_info): New opaque type.
1497 (m4_trace_prepare, m4_arg_info): New prototypes.
1498 (m4_macro_call, m4_push_string_finish, m4_input_print): Change
1500 * m4/m4private.h (struct m4_macro_args): Add info field.
1501 (struct m4_call_info): New structure.
1502 (m4_arg_info): New accessor.
1503 * m4/input.c (m4_input_block): Make typedef local.
1504 (m4_push_string_init): Initialize length.
1505 (m4_push_string_finish, m4_input_print): Change signature, so that
1506 printing can be done before finalization.
1507 (struct input_funcs): Add parameter to print_func.
1508 (file_print, string_print, composite_print): Adjust accordingly.
1509 * m4/macro.c (trace_header, trace_flush, trace_pre, trace_post):
1510 Change signatures for stacked trace messages, and for using call
1512 (trace_prepre): Export and rename...
1513 (m4_trace_prepare): ...to this, for use by indir. Alter signature
1514 to use call context.
1515 (collect_arguments): Alter signature, to manage new field.
1516 (expand_macro): Change call context management. Move tracing...
1517 (m4_macro_call): ...here. Remove redundant parameter.
1518 (m4_arg_argc): New function.
1519 (m4_make_argv_ref): Replace unused skip parameter with new trace
1520 parameter; manage new field.
1521 * modules/gnu.c (builtin, indir): Adjust callers.
1522 * src/main.c (usage): Update debugmode flag summary.
1523 * tests/null.m4: Enhance test.
1524 * tests/null.err: Update expected output.
1525 * tests/macros.at (Tracing Hanoi Towers): Likewise.
1526 * doc/m4.texinfo (Trace): Mention more about trace formatting.
1527 (Debugmode): Enhance description of 'c' and 'x'. Enhance test to
1528 cover line numbering details in traces.
1529 (Debuglen): Enhance test to cover indir tracing.
1530 * NEWS: Mention these changes.
1531 Reported by Akim Demaille in the autoconf TODO file in 2000.
1533 2008-05-07 Eric Blake <ebb9@byu.net>
1535 Test for traceon regression just fixed in branch-1.6.
1536 * doc/m4.texinfo (Trace): Enhance test.
1537 * NEWS: Port news item from branch.
1539 2008-05-05 Eric Blake <ebb9@byu.net>
1541 Stage 22: allow builtin token concatenation outside $@.
1542 Adjust the input and argument parsing engines to append builtins
1543 alongside text. Make define warn when builtins must be
1545 Memory impact: slight penalty, with fewer builtins flattened.
1546 Speed impact: slight penalty, from more bookkeeping.
1547 * m4/m4module.h (m4_is_arg_composite): New prototype.
1548 (m4_symbol_value_copy): Change return type.
1549 (m4_arg_text): Add parameter.
1550 (M4ARG): Adjust callers.
1551 * m4/m4private.h: Adjust comments.
1552 * m4/symtab.c (m4_symbol_value_copy): Detect when builtins are
1554 * m4/input.c (init_builtin_token): Add parameter, and allow
1555 concatenating builtins.
1556 (m4__next_token): Adjust caller.
1557 * m4/macro.c (m4_is_arg_composite): New function.
1558 (expand_argument): Allow builtin concatenation.
1559 (m4_arg_text): Add parameter.
1560 (m4__arg_adjust_refcount, m4__arg_print): Adjust callers.
1561 (m4_arg_equal): Fix comparison of builtin tokens.
1562 * modules/m4.c (define, pushdef): Warn when flattening builtins.
1563 * doc/m4.texinfo (Define): Remove dead comment.
1564 (Defn): Update to reflect code changes.
1565 * tests/builtins.at (defn): Remove xfail.
1566 * NEWS: Document this change.
1568 2008-05-03 Eric Blake <ebb9@byu.net>
1570 Document define_blind.
1571 * doc/m4.texinfo (Ifelse): Add a new composite macro.
1573 Suggested by Mike R.
1575 2008-05-01 Eric Blake <ebb9@byu.net>
1577 Avoid -Wshadow compiler warnings.
1578 * m4/output.c (threshold_diversion_CB): s/div/diversion/.
1579 * m4/macro.c (make_argv_ref, arg_symbol, m4_arg_symbol)
1580 (m4_is_arg_text, m4_is_arg_func, m4_arg_text, m4_arg_empty)
1581 (m4_arg_len, m4_arg_func, m4__arg_print, m4_make_argv_ref)
1582 (m4_push_arg, m4__push_arg_quote): s/index/arg/.
1583 * modules/format.c (format): Likewise.
1584 * modules/m4.c (ifelse): Likewise.
1586 Improve debugmode testing, based on recent branch-1.6 regressions.
1587 * doc/m4.texinfo (Debugmode): Enhance tests.
1588 * tests/generate.awk: Run tests from stdin, not input.m4. Support
1589 stderr munging when using -I examples.
1591 Fix regression in define from 2008-02-22.
1592 * m4/m4module.h (m4_symbol_value_copy): Add parameter.
1593 * m4/symtab.c (m4_symbol_value_copy): Support copying $@
1595 * m4/macro.c (expand_argument): Update callers.
1596 * modules/m4.c (define, pushdef): Likewise.
1597 * tests/builtins.at (define): Enhance test to catch this.
1599 2008-04-21 Eric Blake <ebb9@byu.net>
1601 Simplify previous patch.
1602 * tests/m4.in: Compress assignment.
1603 Suggested by Gary V. Vaughan.
1605 Fix --disable-shared testsuite regression from previous patch.
1606 * tests/m4.in: Export M4MODPATH, so that recursive m4 invocations
1609 Fix spelling of attribution to Christopher Strachey.
1610 * doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
1612 Reported by Fernando Carrijo.
1614 2008-04-17 Eric Blake <ebb9@byu.net>
1616 Fix testsuite bug when SIGPIPE is ignored.
1617 * tests/builtins.at (divert): Consume all of m4's output, to avoid
1618 spurious write failure.
1619 * src/main.c (main): In batch mode, restore default handling of
1621 * doc/m4.texinfo (Operation modes): Document SIGPIPE behavior.
1623 Reported by Bob Proulx, via his autobuilder.
1625 2008-04-15 Eric Blake <ebb9@byu.net>
1627 Fix 'make installcheck' after './configure --prefix-progname'.
1628 * tests/testsuite.at (AT_CHECK_M4): Allow overriding the m4
1630 (HELP_OTHER, PREPARE_TESTS): Document and use $M4.
1631 * tests/builtins.at (patsubst): Avoid space-tab.
1632 (divert, mkdtemp, mkstemp): Adjust tests to use $M4.
1633 * tests/options.at (--debugfile): Likewise.
1634 * tests/others.at (stdin seekable): Likewise.
1635 (fstab): Avoid space-tab.
1636 * Makefile.am (installcheck-local): Accomodate transformed name.
1637 (DISTCHECK_CONFIGURE_FLAGS): Ensure no regressions, by using gm4
1638 during 'make distcheck'.
1639 * cfg.mk: New file, borrowed from branch.
1641 Update prerequisite tools to match recent releases.
1642 * configure.ac (AC_PREREQ): Rely on released autoconf.
1643 (LT_PREREQ): Rely on released libtool.
1644 * tests/testsuite.at (m4_version_prereq): Update dependence.
1645 * bootstrap: Mention prerequisites.
1647 Work around OS/2 limitation of printf(1).
1648 * tests/null.m4: Use m4, not printf, to generate NUL byte.
1649 * tests/null.out: Check for esyscmd failure.
1650 Reported by Elbert Pol.
1652 2008-04-14 Eric Blake <ebb9@byu.net>
1654 Stage 21b: $@ concatenates builtins, m4wrap takes builtins.
1655 Improve arg_print to handle builtin tokens when printing to a
1656 known chain, rather than always flattening builtins. This allows
1657 m4wrap and $@ back-references to handle embedded builtin tokens.
1658 Memory impact: none.
1659 Speed impact: slight penalty, from more bookkeeping.
1660 * m4/m4module.h (m4_push_builtin): Add parameter.
1661 (m4_builtin_print, m4_push_wrapup_init, m4_push_wrapup_finish)
1662 (m4_arg_print, m4_symbol_value_print): Rename and reduce scope...
1663 * m4/m4private.h (m4__builtin_print, m4__push_wrapup_init)
1664 (m4__push_wrapup_finish, m4__arg_print, m4__symbol_value_print):
1665 ...to these, in some cases adding a parameter.
1666 (m4__append_builtin): New prototype.
1667 * m4/builtin.c (m4_builtin_print): Alter signature to print
1668 builtin to a growing symbol chain.
1669 * m4/symtab.c (m4__symbol_value_print): Alter signature.
1670 (m4_symbol_print, dump_symbol_CB): Adjust callers.
1671 * m4/input.c (builtin_peek, builtin_read, builtin_unget)
1672 (builtin_print, builtin_funcs): Delete, handled via composite
1674 (struct m4_input_block): Delete u.builtin member.
1675 (init_builtin_token): Only use composite block.
1676 (m4__append_builtin): New function.
1677 (m4_push_builtin, m4__push_wrapup_init): Alter signature.
1678 (m4__push_symbol): Allow builtin tokens.
1679 (m4__push_wrapup_finish): Rename.
1680 (composite_print, m4_print_token): Adjust callers.
1681 * m4/macro.c (m4_wrap_args, collect_arguments): Allow builtin
1683 (m4__arg_print): Alter signature.
1684 (trace_prepre, trace_pre, m4_arg_text, m4_arg_equal): Adjust
1686 * modules/m4.c (m4wrap): Allow builtin tokens.
1687 (defn, errprint): Adjust callers.
1688 * modules/gnu.c (builtin): Likewise.
1689 * doc/m4.texinfo (M4wrap): New test.
1690 (Debuglen): Adjust expected output.
1692 Stage 21a: Optimize checks for end of input.
1693 Create a new polymorphic input block type, which always fails with
1694 CHAR_EOF, so that remaining input routines no longer have to check
1695 for NULL input block.
1696 Memory impact: none.
1697 Speed impact: noticeable improvement, from fewer conditionals.
1698 * m4/input.c (eof_funcs, input_eof): New objects.
1699 (eof_peek, eof_read, eof_unget): New functions.
1700 (file_clean, m4_push_string_init, pop_input, m4_push_wrapup_init)
1701 (m4_pop_wrapup, next_char, peek_char, unget_input, m4_input_init)
1702 (m4_input_exit): Use placeholder to guarantee non-NULL isp and
1704 (next_char): Rename retry to allow_unget, and change sense for
1705 easier manipulation. All callers changed.
1707 Improve OS/2 detection.
1708 * modules/gnu.c (m4_macro_table): Ensure all possible identifiers
1709 are defined, not just the first. The testsuite ensures that
1710 exactly one gets defined.
1711 * m4/system_.h [__EMX__]: OS/2 is not Unix-compatible, no matter
1712 what other pre-defined macros it has.
1714 Reported by Elbert Pol.
1716 Ensure __m4_version__ is unquoted.
1717 * tests/builtins.at (__m4_@&t@version__): Augment test.
1719 Avoid GNU make failure on tarball.
1720 * Makefile.am (EXTRA_DIST): Distribute cfg.mk and maint.mk.
1722 2008-04-10 Eric Blake <ebb9@byu.net>
1724 Allow back-referenced macro names; fixes 2008-03-13 regression.
1725 * m4/m4module.h (m4_symbol_value_lookup): Change prototype.
1726 * m4/utility.c (m4_symbol_value_lookup): Change signature.
1727 * modules/m4.c (undefine, popdef, ifdef, m4_dump_symbols, defn):
1729 * tests/others.at (ifndef): New test.
1731 Be namespace clean for M4 version; fixes 2008-04-08 regression.
1732 * configure.ac (version): Rename...
1733 (M4_VERSION): ...to this, since using 'version' broke po.m4.
1735 2008-04-09 Eric Blake <ebb9@byu.net>
1737 Mention 1.4.11 release.
1738 * doc/m4.texinfo (History, Defn, Ifdef, Ifelse, M4wrap)
1739 (Extensions, Improved foreach): Distinguish 1.4.11 and 1.6.
1740 (Format): Add test of C99 hex-float parsing.
1741 * NEWS: Mention 1.4.11 release.
1742 * tests/builtins.at (divert): Add additional test.
1744 2008-04-08 Eric Blake <ebb9@byu.net>
1746 Overhaul inter-version releases to work with git.
1747 * configure.ac (version): New variable, which has nicer version
1748 contents when using git 1.5.5+, hardcoded to 1.9a otherwise.
1749 (TIMESTAMP): Delete, since CVS id expansion died with transition
1751 (AM_INIT_AUTOMAKE): Use version to decide gnu vs. gnits.
1752 * build-aux/mkstamp: Delete, no longer used.
1753 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Kill, to speed up
1754 rebuilds when timestamps don't matter.
1755 (MKSTAMP): Delete, no longer used.
1756 (EXTRA_DIST): No longer worry about mkstamp.
1757 (.version): New rule and distributed file.
1758 (doc/m4.1, tests/package.m4): Depend on .version, not
1759 configure.ac, for timestamp.
1760 * ltdl/m4/gnulib-cache.m4: Import git-version-gen module.
1761 * modules/gnu.c (__m4_version__): TIMESTAMP no longer exists.
1762 * src/main.c (main): Likewise.
1764 2008-03-28 Eric Blake <ebb9@byu.net>
1766 Use GNUmakefile module.
1767 * ltdl/m4/gnulib-cache.m4: Import gnumakefile module.
1768 * Makefile.am: Split off maintainer rules...
1769 * maint.mk: ...into this new file.
1771 2008-03-18 Eric Blake <ebb9@byu.net>
1773 Stage 20b: make m4wrap obey POSIX fifo ordering.
1774 Improve input engine to support location changes within symbol
1775 chains, then convert m4wrap to always build symbol chain.
1776 Memory impact: none.
1777 Speed impact: slight penalty, from more m4wrap bookkeeping.
1778 * m4/m4module.h (m4_wrap_args): Add prototype.
1779 * m4/m4private.h (enum m4__symbol_chain_type): Add M4__CHAIN_LOC.
1780 (struct m4__symbol_chain): Add struct u_l.
1781 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Use
1783 (composite_peek, composite_read, composite_clean): Handle location
1785 * m4/macro.c (m4_wrap_args): New function.
1786 * modules/m4.c (m4wrap): Use it.
1787 * doc/m4.texinfo (M4wrap): Sync with branch and POSIX.
1788 (Extensions): Document extension of multiple arguments.
1789 (Location, Improved m4wrap): Adjust example to match FIFO order.
1790 * tests/builtins.at (wrap): Likewise.
1791 * NEWS: Document this change.
1793 2008-03-17 Eric Blake <ebb9@byu.net>
1795 Stage 20a: reduce unget's in input engine.
1796 Now that out-of-range input placeholders like CHAR_BUILTIN are
1797 consumed outside of next_char, next_token should always consume
1798 rather than peek at the first character. Fewer peeks results in
1799 less ungetc overhead.
1800 Memory impact: none.
1801 Speed impact: noticeable improvement, from fewer function calls.
1802 * m4/input.c (struct input_funcs): Alter read_func prototype.
1803 (next_char, file_read, buildin_read, string_read, composite_read):
1804 Add allow_argv parameter.
1805 (init_builtin_token, init_argv_symbol): Require all prior input to
1807 (m4_skip_line, match_input, consume_syntax): Adjust callers.
1808 (m4__next_token): Consume first byte without peek.
1810 Update for fresh bootstrap.
1811 * ltdl/m4/gnulib-cache.m4: Updated copyright from upstream.
1813 2008-03-15 Eric Blake <ebb9@byu.net>
1815 Document join, in order to fix bug in m4wrap example.
1816 * examples/join.m4: New file.
1817 * examples/wraplifo2.m4: Likewise.
1818 * Makefile.am (EXTRA_DIST): Add new files.
1819 * doc/m4.texinfo (Improved m4wrap): New node.
1820 (Defn, Location): Enhance tests.
1821 (Shift): Document the composite macro join.
1822 (Incompatibilities): Move documentation of LIFO vs. FIFO...
1823 (M4wrap): ...here, to match improved example.
1825 2008-03-13 Eric Blake <ebb9@byu.net>
1827 Stage 19c: allow builtin tokens in more macros.
1828 Allow builtin tokens inside symbol chains, although for now, they
1829 are not allowed inside comments or quotes. Enable builtin token
1830 handling in more macros, if only to consistently diagnose invalid
1832 Memory impact: none.
1833 Speed impact: slight impact, due to more bookkeeping.
1834 * m4/m4module.h (m4_symbol_value_lookup, m4_builtin_print): New
1836 * m4/m4private.h (enum m4__symbol_chain_type): Add
1838 (struct m4__symbol_chain): Add builtin member.
1839 * m4/utility.c (m4_symbol_value_lookup): New method.
1840 * m4/builtin.c (m4_builtin_print): New function.
1841 * m4/symtab.c (m4_symbol_value_print): Use it.
1842 * m4/input.c (builtin_print): Likewise.
1843 (m4__push_symbol): Allow pushing builtin tokens.
1844 (composite_peek, composite_read, composite_unget, composite_clean)
1845 (composite_print): Handle builtin tokens.
1846 (init_builtin_token): Allow builtin tokens from composite input.
1847 (m4__next_token): Flatten builtins inside comment or string.
1848 * m4/macro.c (expand_argument): Strengthen assertion.
1849 (collect_arguments, m4_arg_equal, m4_arg_print, m4_push_args):
1850 Handle builtin tokens.
1851 (arg_symbol): Add parameter, and allow NULL level.
1852 (m4_arg_symbol, m4__push_arg_quote): Adjust callers.
1853 (m4_arg_text): Ensure all builtins have been flattened.
1854 * modules/m4.c (defn, dumpdef, popdef, traceoff, traceon)
1855 (undefine, m4_dump_symbols): Warn on invalid macro names.
1856 (ifdef, ifelse, shift): Handle builtin tokens.
1857 * modules/gnu.c (m4symbols): Likewise.
1858 * doc/m4.texinfo (Defn, Ifdef, Ifelse): Document and test the new
1860 (Debuglen): Likewise, and remove xfail.
1861 * NEWS: Mention the change.
1863 Stage 19b: invert sense of bit for handling builtin tokens.
1864 Pass builtin tokens by default, rather than as the exception, so
1865 that the logic can consistently refer to flattening arguments.
1866 Memory impact: none.
1868 * m4/m4module.h (M4BUILTIN_ENTRY): New convenience macro.
1869 (M4_BUILTIN_GROKS_MACRO): Rename...
1870 (M4_BUILTIN_FLATTEN_ARGS): ...and invert sense.
1871 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): Likewise...
1872 (m4_symbol_value_flatten_args, m4_symbol_flatten_args): ...to
1874 * m4/m4private.h (VALUE_MACRO_ARGS_BIT)
1875 (m4_symbol_value_groks_macro): Likewise...
1876 (VALUE_FLATTEN_ARGS_BIT, m4_symbol_value_flatten_args): ...to
1878 * m4/symtab.c (m4_symbol_value_groks_macro): Likewise...
1879 (m4_symbol_value_flatten_args): ...to this.
1880 * m4/macro.c (collect_arguments): Accomodate changed sense.
1881 * m4/module.c (m4__module_open): Require arguments if flattening
1883 * m4/input.c (m4_push_string_finish): For now, flatten all
1884 builtins pushed as back-references.
1885 * modules/gnu.c (m4_builtin_table, builtin): Adjust all clients.
1886 * modules/import.c (m4_builtin_table): Likewise.
1887 * modules/load.c (m4_builtin_table): Likewise.
1888 * modules/modtest.c (m4_builtin_table): Likewise.
1889 * modules/mpeval.c (m4_builtin_table): Likewise.
1890 * modules/perl.c (m4_builtin_table): Likewise.
1891 * modules/shadow.c (m4_builtin_table): Likewise.
1892 * modules/stdlib.c (m4_builtin_table): Likewise.
1893 * modules/time.c (m4_builtin_table): Likewise.
1894 * modules/m4.c (m4_builtin_table): Likewise.
1895 (mkstemp): Undo #undef hack from 2006-10-23, now that macro names
1896 are stringized without preprocessor expansion.
1897 * doc/m4.texinfo (Defn): Update comments to match reality.
1898 (Debuglen): Update test now that user macros pass builtin tokens.
1900 Stage 19a: sort and cache builtins loaded by a module.
1901 Rather than repeatedly using dlsym to browse the builtin table,
1902 copy off the table at module load time. Then, the input engine
1903 merely refers to the copy instead of duplicating information.
1904 Memory impact: slight penalty, due to more memory per module, but
1905 offset by less memory in input engine.
1906 Speed impact: slight improvement, due to faster builtin lookups.
1907 * m4/m4module.h (m4_set_symbol_value_builtin): Delete. Use
1908 m4_builtin_find_by_* instead.
1909 (m4_builtin_find_by_func): Change return type.
1910 * m4/m4private.h (m4__builtin): New struct.
1911 (m4_module): Add sorted list of loaded builtins.
1912 (struct m4_symbol_value): Change type of builtin value.
1913 (m4__set_symbol_value_builtin): New prototype and fast accessor.
1914 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1916 * m4/symtab.c (m4_set_symbol_value_builtin): Rename...
1917 (m4__set_symbol_value_builtin): ...and populate additional fields,
1919 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1921 * m4/module.c (install_builtin_table): Use cached table.
1922 (compare_builtin_CB): New helper function.
1923 (m4__module_open): Populate table.
1924 (module_remove): Free table.
1925 * m4/builtin.c (compare_builtin_name_CB): New helper function.
1926 (m4_builtin_find_by_name): Rewrite to use sorted table.
1927 (m4_builtin_find_by_func): Change return type.
1928 * m4/input.c (struct m4_input_block): Simplify u_b, since most
1929 fields can be determined from builtin.
1930 (builtin_peek, builtin_read, builtin_unget, init_builtin_token)
1931 (m4__next_token): Alter parsing so that only init_builtin_token
1933 (builtin_print, m4_push_builtin): Adjust all users.
1934 * tests/macros.at (Arity, defn, and freeze): Fix typo.
1936 Consistently cast malloc results, for C++ compilation.
1937 * m4/builtin.c (m4_builtin_find_by_name): Add cast.
1938 * m4/hash.c (m4_hash_new, m4_get_hash_iterator_next, node_new)
1939 (m4_hash_resize, maybe_grow): Likewise.
1940 * m4/m4.c (m4_create): Likewise.
1941 * m4/macro.c (expand_macro): Likewise.
1942 * m4/output.c (m4_tmpname): Likewise.
1943 * m4/path.c (search_path_add): Likewise.
1944 * m4/symtab.c (m4_symtab_create, m4_symbol_value_create)
1945 (symtab_fetch): Likewise.
1946 * m4/syntax.c (m4_syntax_create): Likewise.
1947 * modules/gnu.c (regexp_compile): Likewise.
1948 * src/main.c (main): Likewise.
1949 * src/freeze.c (reload_frozen_state): Likewise.
1951 2008-03-06 Eric Blake <ebb9@byu.net>
1953 Fix nested builtin(`shift',$@) regression from 2008-02-23.
1954 * m4/macro.c (make_argv_ref): Don't output expansion text when
1955 making wrapper for builtin or indir.
1956 * tests/builtins.at (builtin): New test.
1957 * NEWS: Document the fix.
1958 Reported by Andreas Schwab.
1960 2008-03-04 Eric Blake <ebb9@byu.net>
1962 The gnulib module free was deprecated.
1963 * ltdl/m4/gnulib-cache.m4: Remove free module.
1965 2008-02-29 Eric Blake <ebb9@byu.net>
1967 Import news from 1.4.10b.
1968 * NEWS: Update from branch.
1970 2008-02-23 Eric Blake <ebb9@byu.net>
1972 Stage 18: try harder to reuse argv in recursion.
1973 When pushing arguments that contain an existing $@ ref, reuse the
1974 ref rather than creating another layer of wrappers.
1975 Memory impact: noticeable improvement, due to better $@ reuse.
1976 Speed impact: noticeable improvement, due to O(n^2) to O(n)
1977 reduction in unboxed recursion.
1978 * m4/macro.c (make_argv_ref): Avoid wrapping $@ when possible.
1979 (m4_push_args): Let make_argv_ref take care of pending data.
1980 * doc/m4.texinfo (Improved foreach): Tweak wording to match new
1981 performance capability.
1982 * tests/others.at (recursion): Add tests to avoid performance
1985 2008-02-22 Eric Blake <ebb9@byu.net>
1988 * NEWS: Document change to __gnu__ on 2008-02-11.
1990 Stage 17: pass argv through quoted strings.
1991 Allow the concatenation of $@ references with other text input
1992 inside quoted contexts, which requires distinguishing between a
1993 wrapper around many arguments vs. a reference serving as part of a
1994 single argument. Also optimize based on whether argv contains
1995 builtin tokens that might need flattening to the empty string.
1996 Memory impact: noticeable improvement, due to O(n^2) to O(n)
1997 reduction from total reuse of $@ references.
1998 Speed impact: noticeable improvement, due to O(n^2) to O(n)
1999 reduction in boxed recursion.
2000 * m4/m4module.h (m4_arg_equal, m4_arg_len): Add parameter.
2001 (M4ARGLEN): Adjust definition.
2002 * m4/m4private.h (struct m4__symbol_chain): Add has_func member.
2003 (struct m4_symbol_value): Add wrapper and has_func members.
2004 (struct m4_macro_args): Add flatten and has_func members.
2005 * m4/input.c (append_quote_token): Return argv refs inside quoted
2007 (init_argv_symbol): Populate new fields.
2008 * m4/macro.c (expand_argument, collect_arguments, make_argv_ref)
2009 (m4_make_argv_ref): Likewise.
2010 (arg_symbol, arg_mark, m4_is_arg_text, m4_is_arg_func): Use new
2012 (m4_arg_equal, m4_arg_len): Handle quoted argv references, and add
2014 * modules/m4.c (ifelse): Adjust caller.
2016 2008-02-22 Gary V. Vaughan <gary@gnu.org>
2018 Fix regression in argument collection, from 2008-01-21.
2019 * m4/input.c (m4__next_token): When DEBUG_INPUT is defined,
2020 undo argument collection optimisation for strings, so that
2021 m4_print_token doesn't abort when it otherwise receives an
2022 unprintable M4_SYMBOL_VOID type token.
2024 2008-02-20 Eric Blake <ebb9@byu.net>
2026 Stage 16: cache quotes and improve m4_arg_print.
2027 Cache rather than always copying quotes when pushing $@ refs; in
2028 particular, reconstruct single-byte quotes on the fly. Allow NUL
2029 through m4wrap. Improve sharing of code that prints arguments.
2030 Memory impact: slight improvement, due to cached quotes.
2031 Speed impact: slight improvement, due to less copying.
2032 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print)
2033 (m4_arg_print): Adjust prototypes.
2034 (m4_dump_args): Delete.
2035 (m4_push_wrapup): Split...
2036 (m4_push_wrapup_init, m4_push_wrapup_finish): ...into these
2038 * m4/m4private.h (struct m4_syntax_table): Add cached_quote
2040 (m4__quote_cache, m4__quote_uncache): New prototypes.
2041 * m4/syntax.c (m4_syntax_create): Initialize the cache.
2042 (m4__quote_cache): New function.
2043 (m4_set_syntax): Update caller.
2044 * m4/symtab.c (m4_symbol_value_print): Add parameter.
2045 (m4_symbol_print, dump_symbol_CB): Adjust all callers.
2046 * m4/utility.c (m4_dump_args): Delete; callers should use
2047 m4_arg_print instead.
2048 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Split
2049 implementation, and allow embedded NUL.
2050 (m4_print_token, pop_input, composite_print, composite_peek):
2051 (composite_read, append_quote_token): Adjust all callers.
2052 * m4/macro.c (trace_prepre, m4_arg_text, make_argv_ref):
2054 (m4_arg_print): Add parameters.
2055 (trace_pre): Rewrite in terms of m4_arg_print.
2056 * modules/m4.c (errprint): Likewise.
2057 (m4wrap): Rewrite to allow embedded NUL.
2058 (dumpdef): Adjust caller.
2059 * doc/m4.texinfo (Debuglen): Enhance debuglen test.
2060 * tests/null.m4: Test for NUL in m4wrap.
2061 * tests/null.out: Update expected output.
2063 Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
2064 * m4/utility.c (m4_verror_at_line): Properly terminate the string.
2065 Reported by Ralf Wildenhues.
2067 * doc/m4.texinfo (Debuglen, Changesyntax): Fix typos.
2069 2008-02-19 Eric Blake <ebb9@byu.net>
2071 Clean up example on filtering defined symbols.
2072 * doc/m4.texinfo (Foreach, Improved foreach): Document another
2073 shortcoming in foreach.m4, and improve filter example by using
2076 * src/main.c (usage): Fix typo.
2078 2008-02-18 Eric Blake <ebb9@byu.net>
2080 Avoid some magic numbers.
2081 * m4/m4private.h (CHAR_EOF, CHAR_BUILTIN, CHAR_QUOTE, CHAR_ARGV)
2082 (CHAR_RETRY): Define in terms of UCHAR_MAX.
2083 * m4/syntax.c (m4_syntax_create, set_syntax_set)
2084 (reset_syntax_set, check_is_single_quotes)
2085 (check_is_single_comments, check_is_macro_escaped)
2086 (m4_set_quotes, m4_set_comment): Likewise.
2087 * modules/gnu.c (regexp_compile): Likewise.
2088 * modules/m4.c (translit): Likewise.
2089 * src/freeze.c (produce_syntax_dump): Likewise.
2090 Reported by Ralf Wildenhues.
2092 2008-02-16 Eric Blake <ebb9@byu.net>
2094 Add regression test for multi-character quote recursion.
2095 * examples/foreach2.m4: Use $0 rather than spelling out name.
2096 * examples/foreachq2.m4: Likewise.
2097 * examples/forloop2.m4: Likewise.
2098 * examples/hanoi.m4: Likewise.
2099 * examples/trace.m4: Likewise.
2100 * doc/m4.texinfo (Improved forloop): Document advantage of $0.
2101 (Improved foreach): Adjust dump from file.
2103 Stage 15: return argv refs back to collect_arguments.
2104 Collect an entire $@ reference at once rather than one argument at
2105 a time, outside of quotes (but inside quotes, $@ is still
2106 flattened for now). The skip_last field allows concatenation of
2107 $@ with other text when collecting arguments.
2108 Memory impact: noticeable improvement, due to better reuse of $@.
2109 Speed impact: noticeable improvement, due to less parsing.
2110 * m4/m4private.h (CHAR_ARGV): New input engine sentinel.
2111 (enum m4__token_type): Add M4_TOKEN_ARGV.
2112 (struct m4__symbol_chain): Add skip_last member to argv link.
2113 (m4__next_token): Add parameter.
2114 * m4/input.c (peek_char, file_peek, builtin_peek, string_peek)
2115 (composite_peek, m4__next_token): Add new parameter.
2116 (composite_read, append_quote_token): Support argv in quotes.
2117 (init_argv_symbol): New function.
2118 (m4__push_symbol, match_input, consume_syntax)
2119 (m4__next_token_is_open, m4_print_token): Adjust callers.
2120 * m4/macro.c (m4_macro_expand_input, m4__arg_adjust_refcount)
2121 (arg_mark, m4_arg_text, make_argv_ref): Likewise.
2122 (expand_argument, collect_arguments): Handle new token.
2123 (arg_symbol): Drill through $@ reference.
2124 * m4/syntax.c (set_quote_age): Detect disabled comments.
2125 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Fix debug code.
2127 2008-02-15 Eric Blake <ebb9@byu.net>
2129 * modules/gnu.c (regexp_compile): Use a fastmap for regex speed.
2131 2008-02-13 Eric Blake <ebb9@byu.net>
2133 Fix texinfo grammar.
2134 * doc/m4.texinfo (Eval, Incompatibilities): Use @. after capital.
2135 (History): Use @: after abbreviations.
2136 (M4exit): Use correct Latin abbreviation.
2137 (Dumpdef, Debugmode, Frozen file format 2): Use correct spacing
2140 2008-02-11 Eric Blake <ebb9@byu.net>
2142 Allow builtin text macros to specify number of arguments.
2143 * m4/m4module.h (struct m4_macro): Add argument limits to builtin
2145 * m4/module.c (install_macro_table): Allow text macros to warn on
2147 * modules/gnu.c (m4_macro_table): Update all clients.
2148 * modules/load.c (m4_macro_table): Likewise.
2149 * modules/mpeval.c (m4_macro_table): Likewise.
2150 * modules/perl.c (m4_macro_table): Likewise.
2151 * modules/shadow.c (m4_macro_table): Likewise.
2152 * modules/traditional.c (m4_macro_table): Likewise.
2153 * modules/modtest.c (m4_macro_table): Likewise. Also add text
2154 macros, for testing this.
2155 * doc/m4.texinfo (Standard Modules): Update text, and enhance
2157 * tests/modules.at (modules: text): New test.
2159 Fix regression in command line -D option, from 2006-08-25.
2160 * m4/m4private.h (m4_symbol_value_create): Delete fast accessor.
2161 * m4/m4module.h: Fix typo.
2162 * m4/symtab.c (m4_symbol_value_create): Prime the maximum number
2164 * tests/macros.at (Command line define): Enhance test.
2165 * tests/others.at (nul character): Enhance test.
2166 * tests/null.m4: Likewise.
2167 * tests/null.out: Likewise.
2169 Use gnulib's git-merge-changelog driver when available.
2170 * .gitattributes: Add merge attributes for ChangeLog.
2171 * bootstrap: Install driver, if not already present.
2173 2008-02-06 Eric Blake <ebb9@byu.net>
2175 Fix security hole introduced 2007-11-23.
2176 * m4/utility.c (m4_verror_at_line): Properly escape macro names.
2177 * src/main.c (main): Manage quoteargs defaults.
2178 * doc/m4.texinfo (Indir): Document and test this.
2180 Using raw strtod is not portable.
2181 * ltdl/m4/gnulib-cache.m4: Import the strtod module.
2183 2008-02-02 Eric Blake <ebb9@byu.net>
2185 Consistently use size_t for number of arguments.
2186 * m4/m4module.h (m4_builtin_func): Alter prototype.
2187 (struct m4_builtin): Adjust type of min_args, max_args.
2188 (M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
2189 (m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
2190 (m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
2191 (m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
2192 (m4_arg_print, m4_push_arg): Adjust all clients.
2193 * m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
2194 (m4_macro_args): Adjust type of various fields.
2195 (m4__push_arg_quote): Adjust all clients.
2196 * m4/input.c (m4_pop_wrapup): Likewise.
2197 * m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
2198 (arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
2199 (m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
2200 (m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
2201 (m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
2202 * m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
2203 * modules/evalparse.c (m4_evaluate): Likewise.
2204 * modules/gnu.c (changesyntax): Likewise.
2205 * modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
2206 (undivert, traceon, traceoff): Likewise.
2207 * modules/m4.h (m4_dump_symbols_func): Likewise.
2208 * modules/perl.c (perleval): Likewise.
2210 Stage 14b: allow pushing argv references.
2211 Push a $@ reference to the input engine in one go, rather than
2212 pushing each element. For now, argument collection still gets one
2213 argument of a $@ at a time; but the penalties of this patch make
2214 it easier to manage $@ efficiently in future patches.
2215 Memory impact: noticeable penalty, due to larger struct and O(n)
2216 to O(n^2) on unboxed recursion.
2217 Speed impact: noticeable penalty, due to more bookkeeping.
2218 * m4/m4private.h (struct m4__symbol_chain): Add comma and quotes
2220 (struct m4_macro_args): Add level field.
2221 (m4__arg_adjust_refcount, m4__push_arg_quote): New prototypes.
2222 * m4/input.c (m4__push_symbol, composite_peek, composite_read)
2223 (composite_unget, composite_clean, composite_print): Support $@
2225 * m4/macro.c (collect_arguments): Populate new field.
2226 (expand_macro): Move argv cleanup...
2227 (m4__arg_adjust_refcount): ...to this new function.
2228 (m4_arg_symbol, m4_make_argv_ref, m4_push_arg): Factor...
2229 (arg_symbol, make_argv_ref, m4__push_arg_quote): ...to these new
2230 helper functions, to add parameters.
2231 (m4_push_args): Adjust caller.
2232 * m4/symtab.c (m4_symbol_value_print): Likewise.
2234 Stage 14a: allow printing argv references.
2235 Refactor symbol-value printing code for better sharing, and to
2236 allow printing a contiguous text representation of a $@ ref.
2237 Memory impact: none.
2239 * m4/m4module.h (m4_arg_print): New prototype.
2240 (m4_symbol_value_print): Alter prototype.
2241 * m4/input.c (struct input_funcs): Add parameter to peek_func.
2242 (file_peek, builtin_peek, string_peek): Ignore new parameter.
2243 (composite_peek): Ignore new parameter, for now.
2244 (composite_clean, pop_input): Rework to minimize indirection, and
2245 to avoid infinite recursion in next patch.
2246 * m4/macro.c (trace_prepre, trace_pre): Adjust callers.
2247 (m4_arg_print): New function.
2248 * m4/symtab.c (m4_symbol_value_print): Update signature.
2249 (m4_symbol_print): Update caller.
2250 * m4/output.c (m4_shipout_string_trunc): Update comments.
2251 * m4/syntax.c (set_quote_age): Require comma as argument separator
2252 when dealing with $@ as a unit.
2253 * tests/builtins.at (ifelse): Augment test.
2254 * doc/m4.texinfo (Changesyntax): Document changesyntax deficiency.
2256 2008-01-31 Eric Blake <ebb9@byu.net>
2258 Kill hack for M4 1.4.4.
2259 * configure.ac (AM_GNU_GETTEXT_INTL_SUBDIR): Delete, now that
2260 we require new enough autoconf which in turn requires M4 1.4.5.
2262 2008-01-31 Gary V. Vaughan <gary@gnu.org>
2263 and Eric Blake <ebb9@byu.net>
2265 Depend on new libtool to use non-recursive build.
2266 * configure.ac (LT_PREREQ): Bump to alpha release version.
2267 (LTDL_INIT): Choose nonrecursive mode. Perform sanity check that
2268 installed libtool has correct symbols.
2269 * Makefile.am (SUBDIRS): Drop ltdl, now that it is built from the
2271 (AM_CPPFLAGS): Drop directories covered by libtool.
2272 (AM_LDFLAGS): Drop -no-undefined, covered by libtool.
2273 (include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
2274 macros, used by libtool.
2275 (lib_LTLIBRARIES): Also used by libtool.
2276 (ltdl/libltdlc.la): Delete, now that libtool does this.
2277 * bootstrap: Mention new requirements.
2278 (LIBTOOLIZE): Provide default program, and run libtoolize prior to
2280 (autoreconf): Also neutralize libtoolize, since it is run early.
2281 * HACKING: Mention updated prerequisites.
2283 2008-01-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2285 Fix build failure if installed libltdl is used.
2286 * Makefile.am (m4_libm4_la_DEPENDENCIES): Use $(LTDLDEPS).
2288 2008-01-28 Eric Blake <ebb9@byu.net>
2290 Depend on newer autoconf, for testsuite -C dir.
2291 * Makefile.am (CD_TESTDIR): Delete, no longer required.
2292 (check-local, installcheck-local, clean-local-tests): Use new -C
2293 option from autotest.
2294 * configure.ac (AC_PREREQ): Bump to 2.61a.347.
2295 * bootstrap: Mention new dependency.
2296 * HACKING: Likewise.
2298 2008-01-27 Eric Blake <ebb9@byu.net>
2300 Stage 13: push composite text tokens.
2301 Support pushing composite tokens, allowing back-references to be
2302 reused through multiple macro expansions. Add hueristic that
2303 avoids creating new reference when pushing existing references.
2304 Memory impact: noticeable improvement due to better reference
2305 reuse, except for O(n) to O(n^2) copying in boxed recursion.
2306 Speed impact: slight penalty, due to more bookkeeping.
2307 * m4/m4private.h (m4__push_symbol): Adjust prototype.
2308 * m4/input.c (m4__push_symbol): Add parameter, and support
2310 (append_quote_token): Add parameter, and support inlining of short
2312 (m4__next_token): Adjust caller.
2313 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
2315 2008-01-26 Eric Blake <ebb9@byu.net>
2317 Stage 12c: add macro for m4_arg_len.
2318 Make a common action easier to type.
2319 Memory impact: none.
2321 * m4/m4module.h (M4ARGLEN): New macro.
2322 * m4/macro.c (process_macro): Adjust all callers.
2323 * m4/utility.c (m4_dump_args): Likewise.
2324 * modules/m4.c (divert, maketemp, mkstemp, m4wrap, len, index)
2326 * modules/gnu.c (builtin, indir, mkdtemp, patsubst, regexp)
2327 (renamesyms): Likewise.
2328 * modules/stdlib.c (setenv): Likewise.
2330 Stage 12b: add m4_string_pair.
2331 Make passing quote delimiters around more efficient.
2332 Memory impact: none.
2333 Speed impact: slight penalty, due to more bookkeeping.
2334 * m4/m4module.h (m4_string_pair): New type.
2335 (m4_get_syntax_quotes, m4_get_syntax_comments): New prototypes.
2336 (m4_symbol_value_print, m4_symbol_print, m4_shipout_string_trunc):
2338 * m4/m4private.h (struct m4_string): Delete.
2339 (struct m4_syntax_table): Combine quote and comment members.
2340 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
2341 (m4_get_syntax_ecomm): Adjust accessors.
2342 (m4_get_syntax_quotes, m4_get_syntax_comments): New fast
2344 * m4/symtab.c (m4_symbol_value_print, m4_symbol_print):
2346 * m4/input.c (string_print, composite_print, m4_input_print):
2347 All callers updated.
2348 * m4/syntax.c (m4_syntax_delete, m4_set_syntax)
2349 (check_is_single_quotes, m4_set_quotes, set_quote_age)
2350 (m4_get_syntax_lquote, m4_get_syntax_rquote)
2351 (m4_get_syntax_quotes, check_is_single_comments, m4_set_comment)
2352 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
2353 (m4_get_syntax_comments): Likewise.
2354 * m4/macro.c (trace_prepre, trace_pre, m4_push_args): Likewise.
2355 * m4/output.c (m4_shipout_string, m4_shipout_string_trunc):
2357 * modules/m4.c (dumpdef, m4_make_temp): Likewise.
2358 * src/freeze.c (produce_frozen_state): Likewise.
2359 * tests/freeze.at (reloading unknown builtin): Update test.
2361 Stage 12a: make m4_symbol_chain a union.
2362 Shrink size of symbol chains by using a union.
2363 Memory impact: slight improvement, due to smaller struct.
2364 Speed impact: slight improvement, due to less bookkeeping.
2365 * m4/m4private.h (enum m4__symbol_chain_type): New enum.
2366 (struct m4_symbol_chain): Rename...
2367 (struct m4__symbol_chain): ...to this, since it is internal.
2368 * m4/symtab.c (m4_symbol_value_copy, m4_symbol_value_print): All
2370 * m4/input.c (struct m4_input_block, m4__push_symbol)
2371 (composite_peek, composite_read, composite_unget)
2372 (composite_clean, composite_print, m4__make_text_link)
2373 (append_quote_token): Likewise.
2374 * m4/macro.c (expand_macro, arg_mark, m4_arg_symbol, m4_arg_text)
2375 (m4_arg_equal, m4_arg_len, m4_make_argv_ref, m4_push_arg)
2376 (m4_push_args): Likewise.
2378 2008-01-23 Eric Blake <ebb9@byu.net>
2380 Adjust to recent libtool interface change.
2381 * configure.ac (LT_PREREQ): Require bleeding-edge libtool.
2382 (LT_WITH_LTDL): Delete, now that it is obsolete.
2383 (LTDL_INIT): Use new libtool macro.
2385 2008-01-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2386 and Eric Blake <ebb9@byu.net>
2388 Rely on newer automake.
2389 * configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1, and add lzma
2391 * bootstrap: Update automake requirement.
2392 (func_version): Fix --version output, broken since 2007-08-06.
2393 * HACKING: Likewise. Add lzma requirement.
2394 * Makefile.am (clean-local-src): Not needed any more with newest
2396 (clean-local): Adjust.
2397 * TODO: Remove completed item.
2399 2008-01-22 Eric Blake <ebb9@byu.net>
2402 * doc/m4.texinfo (Renamesyms): Avoid underfull hbox, and improve
2405 2008-01-21 Eric Blake <ebb9@byu.net>
2407 Stage 11: full circle for single argument references.
2408 Pass quoted strings through to argument collection in a single
2409 action, so that an argument can be reused throughout macro
2410 recursion if it remains unchanged.
2411 Memory impact: noticeable improvement, due to more reuse in
2412 argument collection stacks; O(n^2) to O(n) on boxed recursion.
2413 Speed impact: noticeable improvement, due to less copying.
2414 * m4/m4module.h (m4_arg_text): Add parameter.
2416 * m4/m4private.h (CHAR_QUOTE): New input engine sentinel.
2417 (m4__make_text_link): New prototype.
2418 (struct m4_symbol_chain): Add quote_age member.
2419 (struct m4_symbol_value): Add end member to chained symbol.
2420 (struct m4_macro_args): Add wrapper member.
2421 * m4/symtab.c (m4_symbol_value_print): Print composite tokens.
2422 (m4_symbol_value_copy, m4_symbol_value_delete): Recognize
2424 * m4/input.c (make_text_link): Rename...
2425 (m4__make_text_link): ...to this, and export.
2426 (m4_push_string_finish): Adjust caller.
2427 (make_text_link, m4__push_symbol): Update new field.
2428 (file_read, builtin_read, string_read, composite_read, next_char):
2430 (m4_skip_line, match_input, consume_syntax): Adjust callers.
2431 (append_quote_token): New function.
2432 (m4__next_token): Pass quoted strings onto argument collection.
2433 (m4_print_token) [DEBUG_INPUT]: Update.
2434 * m4/macro.c (expand_argument): Collect composite arguments.
2435 (collect_arguments): Update new field.
2436 (expand_macro): Reduce ref-count of back-references after use.
2437 (arg_mark, m4_arg_symbol, m4_make_argv_ref): Adjust to new member
2439 (m4_is_arg_text): Also recognize composite symbols as text.
2440 (m4_arg_text, m4_arg_len): Merge composite symbols as needed.
2441 (m4_arg_equal): Compare composite symbols.
2442 (m4_push_arg, m4_push_args): Handle composite symbols.
2443 (m4_arg_symbol): Relax assertion.
2444 (process_macro): Use single-argument references.
2445 * m4/output.c (m4_shipout_string_trunc): Update comment.
2446 * tests/macros.at (Rescanning macros): Augment test.
2448 2008-01-16 Eric Blake <ebb9@byu.net>
2450 Stage 10: avoid extra copying of strings and comments.
2451 When collecting tokens that are immune to further expansion, avoid
2452 copying data from one obstack to another by outputting it into the
2453 destination obstack to begin with. Also reduce copying done in
2455 Memory impact: slight improvement, due to better obstack usage.
2456 Speed impact: noticeable improvement, due less data copying.
2457 * ltdl/m4/gnulib-cache.m4: Import intprops and vasnprintf-posix
2459 * m4/m4private.h (m4__token_type): Adjust prototype.
2460 * m4/input.c (m4__next_token): Support new parameter.
2461 * m4/macro.c (m4_macro_expand_input, expand_token)
2462 (expand_argument, collect_arguments): Adjust callers.
2463 * modules/m4.c (ntoa): Tighten buffer size.
2464 * m4/output.c (m4_tmpname): Guarantee no buffer overflow.
2465 * modules/format.c (arg_int, arg_long, arg_double): New helper
2466 functions, to detect overflow or unparsed characters.
2467 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Adjust to check for
2468 missing or excess arguments.
2469 (format): Likewise, and also output directly into obstack if there
2471 * doc/m4.texinfo (History): Update for new year.
2472 (Format): Test for new warnings.
2474 2008-01-15 Eric Blake <ebb9@byu.net>
2476 * TODO: Update with some newer URLs.
2478 Verify linear `index'.
2479 * tests/builtins.at (index): New test.
2480 (translit): Make test take longer, to make quadratic algorithms
2483 2007-12-20 Eric Blake <ebb9@byu.net>
2485 Stage 9: share rather than copy single-arg refs.
2486 Use hooks of previous patch to create back-references to arguments
2487 in the input engine, and inline short text rather than always
2488 creating a FIFO link. Also start testing embedded NUL behavior.
2489 Until the argument collection engine also shares references, the
2490 memory usage increases.
2491 Memory impact: noticeable penalty, due to longer life of argv
2492 changing O(n) to O(n^2) on boxed recursion.
2493 Speed impact: slight improvement, due less data copying.
2494 * ltdl/m4/gnulib-cache.m4: Import memmem and quote modules.
2495 * m4/m4module.h (m4_arg_scratch): New prototype.
2496 * m4/m4private.h (m4__push_symbol): Add parameter.
2497 (m4_arg_scratch): Add fast accessor.
2498 (struct m4): Add expansion_level member, taken...
2499 * m4/macro.c (expansion_level): ...from here. Adjust all users.
2500 (expand_argument): Minor cleanup.
2501 (expand_macro): Track scratch space per macro call.
2502 (m4_arg_scratch): New function.
2503 (m4_make_argv_ref): Call new function.
2504 (m4_push_arg): Push reference to $0.
2505 (m4_push_args): Rework separator usage, since separators will
2507 (process_macro): Allow embedded NUL.
2508 * m4/input.c (INPUT_INLINE_THRESHOLD): New define.
2509 (m4__push_symbol): Add parameter. Inline short strings, and save
2510 references through rescanning.
2511 * m4/symtab.c (m4_set_symbol_value_text): Weaken assertion.
2512 * modules/m4.c (errprint, index): Handle NUL transparently.
2513 (dumpdef, translit): Use scratch space, rather than expansion
2515 * modules/gnu.c (renamesyms, m4symbols): Likewise.
2516 * tests/others.at (nul character): New test.
2517 (iso8859): Quote absolute file name, remove XFAIL.
2518 * tests/iso8859.m4: Avoid raw NUL in output.
2519 * tests/null.m4: New file.
2520 * tests/null.out: Likewise.
2521 * tests/null.err: Likewise.
2522 * Makefile.am (OTHER_FILES): Distribute new files.
2523 * .gitattributes: Treat new files as text.
2525 2007-12-17 Eric Blake <ebb9@byu.net>
2527 Stage 8: extend life of references into argv.
2528 Add hooks to lengthen the lifetime of arguments reused in a macro
2529 expansion, rather than always discarding arguments at the end of
2530 expand_macro. Rework the expand_macro obstacks to handle longer
2531 lifetimes. For now, the hooks remain unused.
2532 Memory impact: slight penalty, due to larger structs.
2533 Speed impact: slight penalty, due to more bookkeeping.
2534 * m4/system_.h (obstack_regrow): Delete.
2535 * m4/m4private.h (struct m4_symbol_chain): Add level field.
2536 (m4__push_symbol): Adjust prototype.
2537 (m4__adjust_refcount): New prototype.
2538 (DEBUG_MACRO) [DEBUG]: New debug control.
2539 (struct m4__macro_arg_stacks): New structure.
2540 (struct m4): Add arg_stacks, stacks_count fields.
2541 * m4/m4module.h (m4_make_argv_ref): Add parameter.
2542 * m4/macro.c (argc_stack, argv_stack): Delete, replaced by
2543 context->arg_stacks.
2544 (m4_macro_expand_input) [DEBUG_MACRO]: Add debug hooks,
2545 conditional on M4_DEBUG_MACRO envvar.
2546 (collect_arguments): Adjust signature.
2547 (expand_macro): Rework obstack handling.
2548 (m4__adjust_refcount, arg_mark): New functions.
2549 (m4_make_argv_ref): Populate new field.
2550 (m4_push_arg, m4_push_args): Track inuse.
2551 (process_macro): One less cast.
2552 * m4/m4.c (m4_delete): Clean up arg_stacks.
2553 * m4/input.c (make_text_link): Use new field.
2554 (m4__push_symbol, file_clean): Update signature.
2555 (composite_read): Bump refcount when done with reference.
2556 (composite_clean): New function.
2557 (pop_input): Adjust caller.
2558 * m4/debug.c (m4_debug_message): Make assertion match comment.
2559 * modules/gnu.c (builtin, indir): Adjust callers.
2560 * tests/builtins.at (ifelse): New test.
2561 (exp): Move and rename...
2562 * tests/others.at (countdown): ...to this.
2563 * doc/m4.texinfo (Improved foreach): Fix tracing usage in
2566 2007-12-13 Eric Blake <ebb9@byu.net>
2569 * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
2574 2007-12-13 Paolo Bonzini <bonzini@gnu.org> (tiny change)
2576 * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
2578 Reported by Giovanni Toffetti.
2580 2007-12-11 Eric Blake <ebb9@byu.net>
2582 Stage 7: use chained input support in input parser.
2583 Allow the LIFO input engine to rescan a macro expansion composed
2584 of smaller chunks of FIFO data, rather than the old approach of a
2585 monolithic string. For now, all chunks are still copied.
2586 Memory impact: slight penalty, due to FIFO chain overhead.
2587 Speed impact: slight penalty, due to extra bookkeeping.
2588 * m4/m4private.h (m4__push_symbol): New prototype.
2589 (struct m4_symbol_chain): Add const-safety.
2590 * m4/symtab.c (m4_symbol_value_print): Simplify.
2591 (dump_symbol_CB): Update caller.
2592 * m4/input.c (struct m4_input_block): Alter u_c member, first
2593 introduced 2006-10-25, but unused until now.
2594 (composite_peek, composite_read, composite_unget)
2595 (composite_print, init_builtin_token): Rewrite accordingly.
2596 (m4_push_wrapup): No longer need trailing NUL.
2597 (m4__push_symbol, make_text_link): New functions.
2598 (m4_push_string_finish): Use them.
2599 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
2600 (expand_macro): Simplify logic of nesting_limit.
2601 * src/main.c (main): Likewise.
2602 * doc/m4.texinfo (Dumpdef): Augment test.
2604 2007-12-08 Eric Blake <ebb9@byu.net>
2606 Stage 6: convert builtins to push arg at a time.
2607 Add new methods to factor all builtins whose expansion includes an
2608 argument, making back-reference creation easier in future patches.
2609 Factor out length-limited printing to obstacks, and use -1 rather
2610 than 0 for unlimited length.
2611 Memory impact: none.
2612 Speed impact: slight improvement, due to better code sharing.
2613 * m4/m4module.h (m4_shipout_text): Rename...
2614 (m4_divert_text): ...to this, to avoid confusion with m4_shipout_*
2615 that does not worry about sync lines.
2616 (m4_shipout_string_trunc): New prototype.
2617 * m4/output.c (m4_shipout_text): Rename...
2618 (m4_divert_text): ...to this.
2619 (m4_shipout_string): Move guts...
2620 (m4_shipout_string_trunc): ...to this new function.
2621 * m4/macro.c (m4_push_arg, m4_push_args): New functions.
2622 (expand_token, process_macro): Update callers.
2623 * m4/input.c (string_print): Likewise.
2624 * modules/m4.c (ifdef, ifelse, shift, substr, translit, divert):
2626 * modules/gnu.c (patsubst): Likewise.
2627 (debuglen): Use SIZE_MAX for unlimited debug length.
2628 * src/main.c (main): Likewise.
2629 * m4/m4.c (m4_create): Default max_debug_length to SIZE_MAX, not
2632 2007-12-07 Eric Blake <ebb9@byu.net>
2634 Minor security fix: Quote output of mkstemp.
2635 * modules/m4.c (m4_make_temp): Produce quoted output.
2636 * doc/m4.texinfo (Mkstemp, Mkdtemp): Update the documentation and
2639 Stage 5: add notion of quote age.
2640 Cache the quoting rules that were in effect when a string was
2641 parsed, to avoid reparsing that string if no changequote or other
2642 quote age change took place in the meantime. A quote_age of 0 is
2643 always safe, but does not benefit from caching.
2644 Memory impact: slight improvement, due to smaller struct in input
2646 Speed impact: slight penalty, due to more bookkeeping.
2647 * m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
2648 (m4_set_symbol_value_text): Adjust prototype.
2649 (m4_has_syntax): Factor out the unsigned char cast.
2650 * m4/m4private.h (struct m4_syntax_table): Add syntax_age and
2652 (m4__quote_age, m4__safe_quotes): New accessor macros, no need for
2653 functions at this point.
2654 (struct m4_symbol_value, struct m4_macro_args): Add quote_age
2656 (m4_set_symbol_value_text): Adjust fast accessor.
2657 (m4_get_symbol_value_quote_age): New fast accessor.
2658 * m4/symtab.c (m4_set_symbol_value_text): Add parameter.
2659 (m4_get_symbol_value_quote_age): New function.
2660 (m4_symbol_value_copy): Adjust callers.
2661 * m4/macro.c (expand_token): Add parameter, and track quote age.
2662 (expand_argument, collect_arguments): Track quote age.
2663 (m4_macro_expand_input, process_macro, m4_make_argv_ref)
2664 (m4_macro_expand_input): Update callers.
2665 (m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
2666 * m4/input.c: Comment cleanups.
2667 (struct m4_input_block): Reduce size.
2668 (m4__next_token): Report quote age.
2669 (m4_push_builtin, init_builtin_token): Update callers.
2670 * m4/utility.c (skip_space): Adjust callers.
2671 * m4/module.c (install_macro_table): Likewise.
2672 * m4/syntax.c (m4_set_syntax): Initialize and update quote age.
2673 (m4_set_quotes, m4_set_comment): Detect no-op changes, and update
2675 (set_quote_age): New helper function.
2676 (check_is_single_quotes, check_is_single_comments): Adjust
2678 * src/freeze.c (reload_frozen_state): Likewise.
2679 * src/main.c (main): Likewise.
2680 * modules/m4.c (define, pushdef): No need to set macro text.
2681 * tests/builtins.at (changequote, defn): New tests.
2682 * examples/wrapfifo.m4: New file.
2683 * examples/wraplifo.m4: New file.
2684 * Makefile.am (dist_pkgdata_DATA): Distribute new examples.
2686 2007-12-04 Eric Blake <ebb9@byu.net>
2688 Fix builds with OpenBSD make.
2689 * Makefile.am (HELP2MAN): New macro.
2690 (dist_man_MANS, doc/m4.1): Fix rules for building m4.1 into
2692 * README: Update copyright.
2693 * HACKING: Mention help2man and makeinfo dependencies.
2695 2007-11-29 Eric Blake <ebb9@byu.net>
2697 Stage 4: route indir, builtin through ref; make argv opaque.
2698 Finish making struct opaque to all but the input engine, by
2699 reworking obstack usage in expand_macro to better support creation
2700 of a $@ reference. Canonicalize the empty argument, to allow
2701 pointer comparison optimizations.
2702 Memory impact: slight penalty, due to larger struct.
2703 Speed impact: slight improvement, due to fewer function calls.
2704 * m4/system_.h (obstack_regrow): Fix precedence.
2705 * m4/m4module.h (m4_arg_equal, m4_arg_empty, m4_make_argv_ref):
2707 (struct m4_macro_args): Move...
2708 * m4/m4private.h (struct m4_macro_args): ...here, making it opaque
2709 to modules. Add has_ref member.
2710 (bool_bitfield): New helper typedef.
2711 (struct m4_symbol_chain): Add flatten and len members.
2712 * m4/macro.c (empty_symbol): New placeholder, for optimizing
2713 comparison with empty string.
2714 (m4_macro_expand_input): Initialize it.
2715 (collect_arguments): Alter signature, and populate new fields.
2716 (trace_pre, trace_post): Remove redundant parameter.
2717 (expand_macro): Alter handling of obstacks.
2718 (m4_arg_symbol): Account for wrapped argv.
2719 (m4_arg_equal, m4_arg_empty, m4_make_argv_ref): New methods.
2720 (m4_arg_text, m4_arg_len, m4_arg_func): Use new methods.
2721 * modules/m4.c (ifelse, syscmd): Likewise.
2722 * modules/evalparse.c (m4_evaluate): Likewise.
2723 (undefine, popdef, m4_dump_symbols): Optimize.
2724 * modules/gnu.c (builtin, indir, esyscmd, debugfile): Use new
2726 (changesyntax, regexp): Optimize.
2727 * m4/output.c (diversion_storage): Use typedef.
2729 Stage 3b: cache length, rather than computing it, in modules.
2730 Use cached token length in builtins and output engine.
2731 Memory impact: none.
2732 Speed impact: noticeable improvement, due to fewer function calls.
2733 * m4/hash.c (m4_hash_remove): Avoid double free on remove
2735 * m4/output.c (m4_shipout_string): Change semantics of len param.
2736 (m4_shipout_int): Use cached length.
2737 * m4/input.c (m4_push_string_finish): Likewise.
2738 * modules/m4.h (m4_make_temp_func): Add parameter.
2739 * m4/macro.c (expand_token, m4_arg_len): Use cached length.
2740 (collect_arguments, expand_macro): Alter signature.
2741 (trace_format): Don't use out-of-scope buffer.
2742 (process_macro): All callers changed.
2743 * m4/utility.c (m4_dump_args): Likewise.
2744 * m4/symtab.c (m4_symbol_value_print): Likewise.
2745 * modules/gnu.c (__file__, __program__, builtin, indir)
2746 (m4symbols, mkdtemp, regexp_compile, regexp_substitute,
2747 renamesyms, patsubst, regexp, regexp_compile): Likewise.
2748 * modules/load.c (m4modules): Likewise.
2749 * modules/m4.c (defn, m4wrap, maketemp, m4_make_temp)
2750 (numb_obstack, ifdef, ifelse, divert, len, substr): Likewise.
2751 * modules/perl.c (perleval): Likewise.
2752 * modules/stdlib.c (getcwd, getenv, getlogin, getpwnam, getpwuid)
2753 (hostname, uname, setenv): Likewise.
2754 * modules/mpeval.c (numb_obstack): Likewise.
2755 * src/freeze.c (dump_symbol_CB): Likewise.
2756 * doc/m4.texinfo (Renamesyms, Dumpdef, Changesyntax): Adjust test.
2757 * tests/builtins.at (mkstemp): Likewise.
2758 * tests/others.at (iso8859): XFAIL this test, now that
2759 length-based handling allows NUL through part but not all of M4.
2761 2007-11-28 Eric Blake <ebb9@byu.net>
2763 Stage 3a: cache length, rather than computing it, in libm4.
2764 Cache the length of a token in the input engine and symbol table,
2765 to avoid repeating lots of strlen calls. Additionally, by using
2766 obstack length rather than strlen, the input engine can now
2767 support embedded NUL.
2768 Memory impact: slight penalty, due to larger struct.
2769 Speed impact: slight improvement, due to fewer function calls.
2770 * m4/m4module.h (struct m4_macro_args): Cache length.
2771 (m4_get_symbol_len, m4_get_symbol_value_len): New accessors.
2772 (m4_set_symbol_value_text): Change signature.
2773 * m4/m4private.h (struct m4_symbol_value): Store string length.
2774 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2775 (m4_set_symbol_value_placeholder): Update accordingly.
2776 (m4_set_symbol_value_text): Change signature.
2777 (m4_get_symbol_value_len): New accessor.
2778 * m4/input.c (struct m4_input_block, string_peek, string_read)
2779 (string_unget, string_print, m4_push_string_finish)
2780 (m4_push_wrapup): Track length of string input.
2781 (m4__next_token): Adjust all users of symbol text to track length,
2783 * m4/macro.c (expand_argument, collect_arguments): Likewise.
2784 * m4/module.c (install_macro_table): Likewise.
2785 * modules/gnu.c (builtin, indir): Likewise.
2786 * modules/m4.c (define, pushdef): Likewise.
2787 * src/main.c (main): Likewise.
2788 * src/freeze.c (reload_frozen_state): Likewise.
2789 * m4/symtab.c (m4_symbol_value_copy): Likewise.
2790 (m4_get_symbol_value_len): New function.
2791 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2792 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
2793 Adjust implementation.
2795 2007-11-27 Eric Blake <ebb9@byu.net>
2797 Stage 2: use accessors, not direct reference, into argv.
2798 Outside of macro.c, use accessor methods rather than direct access
2799 into the argv struct.
2800 Memory impact: none.
2801 Speed impact: slight penalty, due to increased function calls.
2802 * m4/m4private.h (m4_arg_argc): New fast accessor.
2803 * m4/m4module.h (m4_arg_argc, m4_arg_symbol, m4_is_arg_text)
2804 (m4_is_arg_func, m4_arg_text, m4_arg_len, m4_arg_func): New
2806 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2807 (m4_macro_call): Make argc unsigned.
2808 (M4ARG): Use new accessors.
2809 * modules/m4.c (define, pushdef): Likewise.
2810 (undefine, popdef, ifelse, m4_dump_symbols, defn, undivert)
2811 (traceon, traceoff): Make argc unsigned.
2812 * modules/m4.h (m4_dump_symbols_func): Likewise.
2813 * modules/evalparse.c (m4_evaluate): Likewise.
2814 * modules/gnu.c (builtin, indir): Use new accessors.
2815 (changesyntax): Make argc unsigned.
2816 * modules/perl.c (perleval): Likewise.
2817 * m4/utility.c (m4_dump_args): Use new accessors.
2818 * m4/macro.c (trace_pre): Likewise.
2819 (m4_arg_symbol, m4_arg_argc, m4_is_arg_text, m4_is_arg_func)
2820 (m4_arg_text, m4_arg_len, m4_arg_func): New functions.
2821 (expand_macro, trace_pre, trace_post, m4_macro_call): Update argc
2824 2007-11-24 Eric Blake <ebb9@byu.net>
2826 Stage 1: convert m4_symbol_value** into new object.
2827 Pass a variable-size wrapper structure instead of an array to
2828 builtins, so that subsequent optimizations in the structure need
2829 not impact every builtin client.
2830 Memory impact: slight penalty, since struct is larger than array.
2831 Speed impact: slight penalty, due to increased bookkeeping.
2832 * ltdl/m4/gnulib-cache.m4: Import flexmember module.
2833 * m4/m4module.h (m4_macro_args): New type, will be opaque to
2835 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2836 (m4_macro_call): Alter signature to use m4_macro_args object.
2837 (M4ARG): Redefine to access new struct.
2838 * m4/m4private.h (M4_SYMBOL_COMP): New enumerator.
2839 (struct m4_symbol_chain): New type.
2840 (struct m4_symbol_value): Add chain alternative.
2841 * m4/macro.c (collect_arguments): Build new struct.
2842 (expand_macro, m4_macro_call, process_macro, trace_pre)
2843 (trace_post): Adjust implementation to use it.
2844 * m4/utility.c (m4_dump_args): Likewise.
2845 * modules/gnu.c (builtin, indir): Likewise.
2846 * modules/format.c (format): Likewise.
2847 * modules/m4.h (m4_dump_symbols_func): Likewise.
2848 * modules/m4.c (m4_dump_symbols, define, pushdef, defn, ifelse)
2849 (shift, include, errprint, m4wrap): Likewise.
2850 * modules/evalparse.c (m4_evaluate): Likewise.
2852 Pass only macro name to utility functions.
2853 * m4/m4module.h (m4_bad_argc, m4_numeric_arg): Adjust signature.
2854 * m4/utility.c (m4_bad_argc, m4_numeric_arg): Adjust
2856 * m4/macro.c (m4_macro_call): Adjust callers.
2857 * modules/gnu.c (builtin, debuglen): Likewise.
2858 * modules/m4.c (ifelse, incr, decr, divert, undivert, m4exit)
2860 * modules/evalparse.c (m4_evaluate): Likewise.
2861 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
2862 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
2865 2007-11-23 Eric Blake <ebb9@byu.net>
2867 Add macro name to debugfile messages.
2868 * m4/m4module.h (m4_debug_set_output): Add parameter.
2869 * m4/debug.c (m4_debug_set_output, set_debug_file): Pass macro
2871 * modules/gnu.c (debugfile): Adjust caller.
2872 * modules/m4.c (m4exit): Likewise.
2873 * src/main.c (main): Likewise.
2875 Factor out handling of macro name in error messages.
2876 * m4/m4module.h (m4_error, m4_error_at_line, m4_warn)
2877 (m4_warn_at_line): Add new parameter.
2878 * m4/utility.c (m4_verror_at_line): New helper method.
2879 (m4_error, m4_error_at_line, m4_warn, m4_warn_at_line): Add new
2881 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg): All callers
2883 * m4/debug.c: Likewise.
2884 * m4/input.c: Likewise.
2885 * m4/macro.c: Likewise.
2886 * m4/module.c: Likewise.
2887 * m4/output.c: Likewise.
2888 * m4/path.c: Likewise.
2889 * modules/evalparse.c: Likewise.
2890 * modules/format.c: Likewise.
2891 * modules/gnu.c: Likewise.
2892 * modules/load.c: Likewise.
2893 * modules/m4.c: Likewise.
2894 * modules/mpeval.c: Likewise.
2895 * src/freeze.c: Likewise.
2896 * src/main.c: Likewise.
2898 2007-11-14 Eric Blake <ebb9@byu.net>
2900 Handle some defn corner cases differently.
2901 * doc/m4.texinfo (Defn): Update documentation; although this still
2902 doesn't match the branch, since it may be changed before 2.0.
2903 * m4/macro.c (expand_argument): Consistently ignore builtins in
2904 concatenation contexts.
2905 * m4/m4private.h (m4__symbol_type): Fix C89 compliance bug.
2907 2007-11-13 Eric Blake <ebb9@byu.net>
2909 Note: Patches titled Stage 0 through N form a series of patches
2910 which decreases the algorithmic complexity of tail recursion in
2911 macro expansions from O(n^2) to O(n) in both time and memory, then
2912 performs cleanups, such as handling of embedded NUL, made easier
2913 by the code refactoring.
2915 Stage 0: Fix memory leak in tail recursion.
2916 Free expansion text in the input engine as soon as it is parsed,
2917 rather than when the recursive expansion completes.
2918 Memory impact: noticeable improvement, due to reduction from
2919 O(n^2) to O(n) on recursion.
2920 Speed impact: minor improvement, due to better memory usage.
2921 * m4/input.c (pop_input): Add flag parameter and return type.
2922 (next_char): Adjust caller.
2923 (m4_push_string_init): Let go of memory earlier.
2925 2007-11-07 Eric Blake <ebb9@byu.net>
2927 * tests/macros.at (Rescanning macros): Test more corner cases.
2929 2007-11-06 Eric Blake <ebb9@byu.net>
2931 * build-aux/mkstamp: Rename from ltdl/config/mkstamp.
2933 * Makefile.am (tests/package.m4): Work around bash bug.
2934 Reported by Ralf Wildenhues.
2936 2007-11-05 Eric Blake <ebb9@byu.net>
2938 For consistency with other GNU projects, use build-aux directory.
2939 * configure.ac (AC_CONFIG_AUX_DIR): Change ltdl/config to
2941 * bootstrap (config_aux_dir): Likewise.
2942 * Makefile.am (config_aux_dir): Likewise.
2943 * ltdl/m4/gnulib-cache.m4: Use --aux-dir option.
2945 2007-11-02 Eric Blake <ebb9@byu.net>
2947 Update some documentation about version control.
2948 * NEWS: M4 is now stored in git.
2949 * HACKING: Likewise.
2951 * bootstrap: Likewise.
2952 * commit: Delete, now that CVS commits are no longer necessary.
2953 * ltdl/config/mailnotify: No longer necessary; git's patch
2954 generation and mail capability is more powerful.
2956 Update to recent gnulib changes.
2957 * ltdl/m4/gnulib-cache.m4: Replace fprintf-posix, vasprintf-posix,
2958 xprintf, and xvasprintf with xprintf-posix and xvasprintf-posix.
2960 2007-11-01 Eric Blake <ebb9@byu.net>
2962 Improve error message when early end of file occurs.
2963 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
2964 (M4wrap): Adjust to new messages.
2965 (Improved capitalize): Enhance test.
2966 * m4/m4private.h (m4__next_token): Adjust prototype.
2967 * m4/input.c (m4__next_token): Add new parameter, and improve
2969 * m4/macro.c (m4_macro_expand_input, collect_arguments): Adjust
2971 (expand_argument): Likewise, and add parameter.
2973 2007-10-31 Eric Blake <ebb9@byu.net>
2975 Test more corner cases.
2976 * tests/macros.at (Rescanning macros): Beef up test.
2977 * doc/m4.texinfo (Changecom): Beef up test.
2978 (Improved foreach): Document alternate foreachq style.
2979 * examples/foreachq3.m4: New file.
2980 * examples/loop.m4: New file.
2981 * Makefile.am (dist_pkgdata_DATA): Distribute them.
2983 2007-10-28 Eric Blake <ebb9@byu.net>
2985 More test coverage for autoconf usage patterns.
2986 * doc/m4.texinfo (Shift): Document cond macro, and add new test.
2987 * tests/macros.at (Rescanning macros): New test.
2988 * tests/builtins.at (include): Augment test.
2990 2007-10-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2992 * Makefile.am: Adjust getopt handling to latest gnulib layout.
2994 2007-10-27 Eric Blake <ebb9@byu.net>
2996 Document one use of changequote(`(',`)').
2997 * doc/m4.texinfo (Changequote): Add new test, based on recent
2998 autoconf addition of m4_expand.
3000 2007-10-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3002 * Makefile.am (dist_pkgdata_DATA): Add examples/capitalize2.m4.
3004 2007-10-22 Eric Blake <ebb9@byu.net>
3006 Never let printf failures go undetected.
3007 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3009 * m4/system_.h: Include xprintf.h.
3010 * m4/debug.c (m4_debug_message_prefix, m4_debug_message): Wrap all
3011 use of printf, xprintf.
3012 * m4/input.c [DEBUG_INPUT]: Likewise.
3013 * m4/module.c [DEBUG_MODULES]: Likewise.
3014 * m4/output.c (m4_shipout_text, m4_shipout_int)
3015 (m4_freeze_diversions): Likewise.
3016 * m4/path.c [DEBUG_INCL]: Likewise.
3017 * m4/symtab.c [DEBUG_SYM]: Likewise.
3018 * m4/syntax.c [DEBUG_SYNTAX]: Likewise.
3019 * modules/modtest.c (export_test): Likewise.
3020 * src/freeze.c (produce_resyntax_dump, produce_syntax_dump)
3021 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
3023 * src/main.c (usage): Likewise.
3024 * po/POTFILES.in: Adjust to new file.
3025 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
3027 2007-10-18 Eric Blake <ebb9@byu.net>
3029 Fix 'm4 -F file -t undefined'.
3030 * src/freeze.c (produce_symbol_dump): Skip trace placeholders.
3031 * src/freeze.c (dump_symbol_CB): Also skip void symbols.
3032 * tests/freeze.at (reloading unknown builtin): Test for this bug.
3033 * m4/m4module.h (m4_symtab_apply): Add parameter.
3034 * m4/symtab.c (m4_symtab_apply): Ignore trace placeholders when
3036 (m4_symtab_delete, symtab_dump): Adjust callers.
3037 * modules/m4.c (m4_dump_symbols): Likewise.
3039 2007-10-09 Eric Blake <ebb9@byu.net>
3041 Fix regexp regression of 2007-09-29.
3042 * modules/gnu.c (substitute): Allow NULL buf when no
3043 subexpressions were present.
3044 (regexp): Handle \ escapes even with empty regex.
3045 * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
3047 Cache regex compilation for another autoconf speedup.
3048 * modules/gnu.c (gnu_buf): Replace...
3049 (REGEX_CACHE_SIZE, regex_cache): ...with new declarations.
3050 (m4_pattern_buffer): Add fields.
3051 (m4_regexp_compile): Rename...
3052 (regexp_compile): ...to this, and drop no_sub parameter.
3054 (M4FINISH_HANDLER): Clean up entire cache.
3055 (m4_regexp_search): Rename...
3056 (regex_search): ...to this, adjust to new struct contents, and add
3058 (m4_regexp_substitute): Rename...
3059 (regexp_substitute): ...to this.
3060 (substitute, patsubst, regexp, renamesyms): Adjust callers.
3062 2007-10-02 Eric Blake <ebb9@byu.net>
3064 Document quoting pitfalls in capitalize.
3065 * doc/m4.texinfo (Patsubst): Use the examples directory. Also
3067 (Improved capitalize): New node.
3068 * examples/capitalize.m4: Update to match manual.
3069 * examples/capitalize2.m4: New file.
3071 2007-10-01 Eric Blake <ebb9@byu.net>
3073 Another Autoconf usage pattern optimization.
3074 * modules/m4.c (m4_index): Optimize search for one byte.
3075 * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
3078 2007-09-29 Eric Blake <ebb9@byu.net>
3080 Optimize for Autoconf usage pattern.
3081 * modules/gnu.c (regexp, patsubst): Handle empty regex faster.
3083 * tests/testsuite.at (AT_CHECK_M4): Slight optimization.
3085 2007-09-24 Eric Blake <ebb9@byu.net>
3087 Create .gitignore alongside .cvsignore.
3088 * bootstrap (version control): Update to reflect git usage.
3090 2007-09-13 Eric Blake <ebb9@byu.net>
3092 * AUTHORS: Fix typo.
3094 2007-09-12 Gary V. Vaughan <gary@gnu.org>
3096 Be consistent about using 'module' for m4_module types and
3097 'handle' for lt_dlhandle types:
3099 * m4/m4private.h (m4_symbol_value): Rename handle element to
3100 method. Changed all references.
3101 (VALUE_MODULE, SYMBOL_MODULE): Renamed from VALUE_HANDLE and
3102 SYMBOL_HANDLE respectively. Changed all references.
3103 * m4/m4module.h (M4INIT_HANDLER, M4FINISH_HANDLER): Ditto.
3104 * m4/builtin.c (m4_builtin_find_by_name)
3105 (m4_builtin_find_by_func): Use module as the parameter name for
3106 pointers of type 'm4_module'.
3107 * m4/module.c (module_remove, m4_get_module_name)
3108 (install_builtin_table, install_macro_table)
3109 (m4_module_make_resident, m4__module_next, m4_module_refcount):
3111 * src/freeze.c (produce_module_dump): Ditto.
3112 * m4/input.c (m4_input_block): Rename handle element to method.
3113 Changed all references.
3114 * m4/symtab.c (m4__symtab_remove_module_references): Ditto.
3115 * modules/load.c: Use module as the variable name for pointers
3116 of type 'm4_module'.
3117 * modules/m4.c: Ditto.
3118 * modules/perl.c: Ditto.
3119 * modules/shadow.c: Ditto.
3121 2007-09-07 Eric Blake <ebb9@byu.net>
3123 Add refcount builtin.
3124 * modules/load.c (refcount): New builtin.
3125 (m4modules): Use correct type.
3126 * doc/m4.texinfo (Refcount): New section.
3127 * m4/m4private.h (struct m4_module): Add refcount member.
3128 (m4_module_refcount) [NDEBUG]: Add faster accessor macro.
3129 * m4/module.c (m4_module_load): Add symbols to table on first
3130 load by m4, regardless of other libltdl loads of same module.
3131 (m4_module_refcount): Use new struct member, rather than relying
3132 on libltdl count which might be inflated by unrelated loads.
3133 (m4__module_interface): Optimize.
3134 (m4__module_next, m4__module_find): Avoid assertions that could
3135 trigger with unrelated libltdl loads.
3136 (m4__module_open): Track m4 load count.
3137 (m4__module_exit): Only unload what m4 loaded.
3138 (module_remove): Track m4 unloads.
3139 * NEWS: Document new builtin.
3141 More conversion to m4_module*.
3142 * src/freeze.c (produce_module_dump, dump_symbol_CB)
3143 (reload_frozen_state): Use correct type.
3144 * m4/input.c (struct m4_input_block): Likewise.
3145 * m4/symtab.c (dump_symbol_CB): Likewise.
3147 * AUTHORS: Simplify, to match libtool and autoconf layout.
3148 * THANKS: Sync with branch.
3150 2007-09-06 Eric Blake <ebb9@byu.net>
3152 Wrap lt_dlhandle in struct m4_module.
3153 * m4/m4module.h (includes): No longer require clients to know
3155 (m4_module): New opaque declaration.
3156 (m4_export): Delete unused type.
3157 (M4INIT_HANDLER, M4FINISH_HANDLER, m4_module_init_func)
3158 (m4_module_finish_func, m4_module_load, m4_get_module_name)
3159 (m4_builtin_find_by_name, m4_builtin_find_by_func): Use new
3161 (m4_module_makeresident, m4_module_refcount): New declarations.
3162 * m4/m4private.h (includes): Move <ltdl.h> here.
3163 (m4_module): New declaration. Simple for now, but intended for
3165 (m4__module_open, m4__module_next, m4__module_find)
3166 (m4__symtab_remove_module_references): Use new wrapper.
3167 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
3169 * m4/module.c (m4_get_module_name, m4_module_import)
3170 (m4_module_load): Likewise.
3171 (install_builtin_table, install_macro_table): Likewise. Also,
3172 change return type since these always returned NULL and no one
3174 (m4_module_makeresident, m4_module_refcount): New functions.
3175 (m4_module_unload, m4__module_next, m4__module_find): Use new
3177 (m4__module_open): Populate new wrapper, and associate it with the
3179 (m4__module_exit): Use new wrapper.
3180 (module_remove): Likewise. Reclaim storage on last use.
3181 (module_close): Delete, and inline into module_remove.
3182 * m4/symtab.c (m4__symtab_remove_module_references): Use new
3184 * modules/load.c (load_init): Use new API.
3185 * modules/m4.c (m4_export_table): Kill unused declaration.
3186 (m4_init): Use new API.
3187 * modules/shadow.c (shadow_init): Use new API.
3188 * src/main.c (main): Adjust callers.
3189 * src/freeze.c (reload_frozen_state): Likewise.
3190 * tests/modules.at (unload load module): New test.
3192 2007-09-03 Gary V. Vaughan <gary@gnu.org>
3194 * bootstrap (ltdl/m4/.cvsignore): Add xstrtol module macros.
3195 * src/m4/.cvsignore: Add xstrtol module sources.
3197 2007-09-03 Gary V. Vaughan <gary@gnu.org>
3199 Work around a bug in darwin's awk:
3201 * bootstrap (func_get_translations): Use $AWK instead of raw
3202 `awk' so that the user can use an alternative implementation
3203 if the first awk in PATH doesn't behave as expected.
3204 (func_get_translations): The first awk script mangles the last
3205 entry passed to it for at least the awk implementation shipped
3206 with Darwin 8.10.1. Capture $3 into a variable too to work-
3207 around that problem.
3209 2007-08-29 Gary V. Vaughan <gary@gnu.org>
3211 As gnulib xstrtol is only used by main, and unconditionally pulls
3212 in a copy of getopt, undo bootstrap change from 2007-08-11 below,
3213 and copy the xstrtol code into src/ so that main() can use it
3214 without pushing the extra code into libm4:
3216 * bootstrap (src_modules): Add getopt and xstrtol modules.
3217 * Makefile.am (src_m4_SOURCES): Add xstrtol sources.
3218 * po/POTFILES.in: Move gnu/xstrtol-error.c to src/xstrtol-error.c.
3220 2007-08-11 Eric Blake <ebb9@byu.net>
3222 Another upstream xstrtol change.
3223 * po/POTFILES.in: Track changes in files containing messages.
3224 * bootstrap (src_modules): getopt is now pulled into libgnu.a, no
3225 need to grab it separately.
3226 * src/main.c (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
3228 (size_opt): Adjust to latest xstrtol interface.
3230 2007-08-10 Eric Blake <ebb9@byu.net>
3232 Documentation improvements.
3233 * doc/m4.texinfo (Defn): Resync with branch.
3234 (Compatibility, Extensions): Sync with branch.
3236 2007-08-07 Eric Blake <ebb9@byu.net>
3238 Adjust to gnulib xstrtol changes.
3239 * src/main.c (size_opt): Adjust signature, so that error strings
3240 are easier to translate.
3241 (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): New macros
3242 for tracking long options.
3243 (main): Track which long option was used.
3244 * tests/options.at (--debuglen, --nesting-limit): Adjust to change
3246 (deprecated options): Test that --arglength spelling shows up in
3249 2007-08-06 Eric Blake <ebb9@byu.net>
3251 Normalize all GPL license notices.
3252 * m4/COPYING.LIB: Delete - libm4 is not distributed under LGPLv2
3254 * Makefile.am: Update license wording.
3255 * bootstrap: Likewise.
3257 * configure.ac: Likewise.
3258 * ltdl/config/mailnotify: Likewise.
3259 * ltdl/config/mkstamp: Likewise.
3260 * ltdl/m4/debug.m4: Likewise.
3261 * ltdl/m4/gmp.m4: Likewise.
3262 * ltdl/m4/m4-error.m4: Likewise.
3263 * ltdl/m4/m4-getopt.m4: Likewise.
3264 * ltdl/m4/m4-gettext.m4: Likewise.
3265 * ltdl/m4/m4-obstack.m4: Likewise.
3266 * ltdl/m4/m4-regex.m4: Likewise.
3267 * ltdl/m4/stackovf.m4: Likewise.
3268 * m4/builtin.c: Likewise.
3269 * m4/debug.c: Likewise.
3270 * m4/hash.c: Likewise.
3271 * m4/hash.h: Likewise.
3272 * m4/input.c: Likewise.
3273 * m4/m4.c: Likewise.
3274 * m4/m4module.h: Likewise.
3275 * m4/m4private.h: Likewise.
3276 * m4/macro.c: Likewise.
3277 * m4/module.c: Likewise.
3278 * m4/output.c: Likewise.
3279 * m4/path.c: Likewise.
3280 * m4/resyntax.c: Likewise.
3281 * m4/symtab.c: Likewise.
3282 * m4/syntax.c: Likewise.
3283 * m4/system_.h: Likewise.
3284 * m4/utility.c: Likewise.
3285 * modules/evalparse.c: Likewise.
3286 * modules/format.c: Likewise.
3287 * modules/gnu.c: Likewise.
3288 * modules/import.c: Likewise.
3289 * modules/load.c: Likewise.
3290 * modules/m4.c: Likewise.
3291 * modules/m4.h: Likewise.
3292 * modules/modtest.c: Likewise.
3293 * modules/mpeval.c: Likewise.
3294 * modules/perl.c: Likewise.
3295 * modules/shadow.c: Likewise.
3296 * modules/stdlib.c: Likewise.
3297 * modules/time.c: Likewise.
3298 * modules/traditional.c: Likewise.
3299 * po/Makevars: Likewise.
3300 * src/freeze.c: Likewise.
3301 * src/m4.h: Likewise.
3302 * src/main.c: Likewise.
3303 * src/stackovf.c: Likewise.
3304 * tests/builtins.at: Likewise.
3305 * tests/freeze.at: Likewise.
3306 * tests/generate.awk: Likewise.
3307 * tests/m4.in: Likewise.
3308 * tests/macros.at: Likewise.
3309 * tests/modules.at: Likewise.
3310 * tests/options.at: Likewise.
3311 * tests/others.at: Likewise.
3312 * tests/stackovf.test: Likewise.
3313 * tests/testsuite.at: Likewise.
3315 2007-07-22 Eric Blake <ebb9@byu.net>
3317 Fix diversions on NetBSD, when fopen(name,"a+") seeks to end.
3318 * m4/output.c (m4_tmpopen): Explicitly seek to beginning.
3319 * tests/builtins.at (divert): Enhance test to cover this.
3321 Reported by Thomas Klausner.
3323 2007-07-20 Eric Blake <ebb9@byu.net>
3325 Fix 'make distcheck' issues.
3326 * bootstrap: Add more files that might be more up-to-date in
3328 * Makefile.am (EXTRA_DIST): No longer distribute removed diff.
3329 * config/m4/gnulib-cache.m4: Update to latest gnulib.
3331 2007-07-16 Eric Blake <ebb9@byu.net>
3333 * po/POTFILES.in: Track recent translation additions from gnulib
3336 2007-07-14 Eric Blake <ebb9@byu.net>
3338 Reflect upstream license .texi changes.
3339 * doc/m4.texinfo (Copying): Rename node...
3340 (GNU General Public License): ...to this.
3341 (GNU Free Documentation License): Adjust node location.
3342 * local/doc/gpl-3.0.texi.diff: Remove file.
3344 2007-07-10 Eric Blake <ebb9@byu.net>
3346 Upgrade to GPLv3, and document 1.4.10.
3347 * bootstrap: Adjust to GPLv3.
3348 (func_update): Port from branch.
3349 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
3350 --local-dir=local --import gpl-3.0'.
3351 * doc/m4.texinfo (History): Mention 1.4.11.
3352 (Copying This Package): New appendix.
3353 * NEWS: Document 1.4.10.
3354 * local/doc/gpl-3.0.texi.diff: New file.
3355 * Makefile.am: Update license.
3356 (doc_m4_TEXINFOS, EXTRA_DIST): Distribute additions.
3357 * commit: Update license.
3358 * configure.ac: Likewise.
3359 * ltdl/config/mailnotify: Likewise.
3360 * ltdl/config/mkstamp: Likewise.
3361 * ltdl/m4/debug.m4: Likewise.
3362 * ltdl/m4/gmp.m4: Likewise.
3363 * ltdl/m4/m4-error.m4: Likewise.
3364 * ltdl/m4/m4-getopt.m4: Likewise.
3365 * ltdl/m4/m4-gettext.m4: Likewise.
3366 * ltdl/m4/m4-obstack.m4: Likewise.
3367 * ltdl/m4/m4-regex.m4: Likewise.
3368 * ltdl/m4/stackovf.m4: Likewise.
3369 * m4/builtin.c: Likewise.
3370 * m4/debug.c: Likewise.
3371 * m4/hash.c: Likewise.
3372 * m4/hash.h: Likewise.
3373 * m4/input.c: Likewise.
3374 * m4/m4.c: Likewise.
3375 * m4/m4module.h: Likewise.
3376 * m4/m4private.h: Likewise.
3377 * m4/macro.c: Likewise.
3378 * m4/module.c: Likewise.
3379 * m4/output.c: Likewise.
3380 * m4/path.c: Likewise.
3381 * m4/resyntax.c: Likewise.
3382 * m4/symtab.c: Likewise.
3383 * m4/syntax.c: Likewise.
3384 * m4/system_.h: Likewise.
3385 * m4/utility.c: Likewise.
3386 * modules/evalparse.c: Likewise.
3387 * modules/format.c: Likewise.
3388 * modules/gnu.c: Likewise.
3389 * modules/import.c: Likewise.
3390 * modules/load.c: Likewise.
3391 * modules/m4.c: Likewise.
3392 * modules/m4.h: Likewise.
3393 * modules/modtest.c: Likewise.
3394 * modules/mpeval.c: Likewise.
3395 * modules/perl.c: Likewise.
3396 * modules/shadow.c: Likewise.
3397 * modules/stdlib.c: Likewise.
3398 * modules/time.c: Likewise.
3399 * modules/traditional.c: Likewise.
3400 * po/Makevars: Likewise.
3401 * src/freeze.c: Likewise.
3402 * src/m4.h: Likewise.
3403 * src/main.c: Likewise.
3404 * src/stackovf.c: Likewise.
3405 * tests/builtins.at: Likewise.
3406 * tests/freeze.at: Likewise.
3407 * tests/generate.awk: Likewise.
3408 * tests/m4.in: Likewise.
3409 * tests/macros.at: Likewise.
3410 * tests/modules.at: Likewise.
3411 * tests/options.at: Likewise.
3412 * tests/others.at: Likewise.
3413 * tests/stackovf.test: Likewise.
3414 * tests/testsuite.at: Likewise.
3416 2007-07-09 Eric Blake <ebb9@byu.net>
3418 * modules/format.c (format): Avoid undefined behavior with %c.
3420 2007-07-01 Gary V. Vaughan <gary@gnu.org>
3422 The translation project has moved.
3423 * bootstrap (func_get_translations): Use the new translation
3427 2007-06-26 Karl Berry <karl@freefriends.org> (tiny change)
3429 Match Free Software Directory categories.
3430 * doc/m4.texinfo (dircategory): Update.
3432 2007-05-31 Eric Blake <ebb9@byu.net>
3434 Add extension to divert builtin.
3435 * modules/m4.c (builtin_divert): Immediately divert second
3437 * m4/output.c (m4_output_text): Allow 0 length. Fixes regression
3439 (m4_shipout_text): Short-circuit on zero length.
3440 * tests/freeze.at (loading format 2): Expand test to catch
3441 regression. Also check out-of-range version.
3442 * tests/builtins.at (divert): Expand test to check corner cases
3444 * doc/m4.texinfo (Divert): Document the extension.
3446 Reported by Daniel Richard G.
3448 2007-05-30 Eric Blake <ebb9@byu.net>
3450 Port format improvements from branch.
3451 * doc/m4.texinfo (History): Mention upcoming 1.4.10 release.
3452 (Format): Enhance section.
3453 * modules/format.c (format): Accept %'hhd, and issue warnings on
3454 unrecognized specifiers.
3455 * modules/gnu.c (builtin_format): Adjust how format is called.
3457 2007-05-28 Eric Blake <ebb9@byu.net>
3459 * tests/options.at (--syncoutput): Add xfailed test.
3461 Fix sync line interaction with multiline comments.
3462 * doc/m4.texinfo (Preprocessor features): Improve documentation.
3463 (Syncoutput): Improve testsuite.
3464 (Incompatibilities): Add testcase, and document bug.
3465 * src/freeze.c (reload_frozen_state): Don't interfere with
3466 synclines when reloading state.
3467 * m4/input.c (m4__next_token): Report line where multiline tokens
3469 * m4/m4private.h (m4__token_type): Add parameter.
3470 * m4/m4module.h (m4_output_text): Export.
3471 (m4_shipout_text): Add parameter.
3472 * src/macro.c (m4_macro_expand_input, expand_token)
3473 (expand_argument): Adjust callers so that line is passed from
3475 * m4/output.c (output_text): Rename...
3476 (m4_output_text): ...to this, and export.
3477 (m4_insert_file, insert_diversion_helper): Update callers.
3478 (m4_shipout_text): Take new parameter for start line of token.
3479 Output at most one syncline per token.
3480 Reported by Sergey Poznyakoff.
3482 Fix large diversion corner cases.
3483 * tests/freeze.at (large diversion): New test.
3484 * m4/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
3485 (make_room_for): Use NULL, not 0, for pointers.
3486 (m4_freeze_diversions): Allow freezing large diversions.
3487 (insert_diversion_helper): Avoid using rewind.
3489 Also run gnulib unit tests during make check.
3490 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
3491 --tests-base=tests/gnu --with-tests'.
3492 * configure.ac (AC_CONFIG_FILES): Build tests/gnu testdir.
3493 * Makefile.am (SUBDIRS): Run gnulib tests before ours.
3495 2007-05-25 Eric Blake <ebb9@byu.net>
3497 * m4/system_.h: Include <stdint.h>, for intmax_t.
3499 Reported by Daniel Richard G.
3501 2007-05-24 Eric Blake <ebb9@byu.net>
3503 Provide consistent shift semantics regardless of hardware.
3504 * modules/m4.c (numb_lshift, numb_rshift, numb_urshift): Mask
3506 (number, unumber): Always use [u]intmax_t.
3507 Reported by Gary V. Vaughan.
3509 Support POSIX flush semantics on all platforms.
3510 * modules/m4.c (m4_sysval_flush): Rely on gnulib.
3511 * ltdl/m4/gnulib-cache.m4: Fix typo in previous commit.
3513 Work around cygwin and mingw fseeko bugs.
3514 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3516 * modules/m4.c (m4_sysval_flush): Prefer fseeko over fseek.
3518 2007-04-25 Eric Blake <ebb9@byu.net>
3520 Test that regression in 1.4.9's eval doesn't recur.
3521 * doc/m4.texinfo (Eval): Check negative division.
3524 2007-04-12 Eric Blake <ebb9@byu.net>
3526 Allow for running test in sticky or setgid directory.
3527 * tests/builtins.at (mkdtemp): Adjust test.
3529 Don't test for broken sed too soon.
3530 * tests/others.at (stdin seekable): Rearrange subtests.
3532 Work around 'stdin seekable' shortcoming on glibc.
3533 * ltdl/m4/gnulib-cache.m4: Use closein instead of closeout.
3534 * tests/others.at (stdin closed): Adjust to new output.
3535 * src/main.c (process_file): No need to return anything.
3536 (main): Use close_stdin instead of close_stdout.
3537 Reported by Ralf Wildenhues.
3539 Enable autobuild usage.
3540 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3542 * configure.ac (AB_INIT): Output autobuild information.
3544 2007-04-11 Eric Blake <ebb9@byu.net>
3546 Address testsuite shortcoming in 'stdout full' on glibc.
3547 * tests/others.at (stdout full): Adjust expected output when more
3548 than 1k text is printed to /dev/full.
3549 Reported by Ralf Wildenhues.
3551 2007-04-10 Eric Blake <ebb9@byu.net>
3553 * tests/macros.at (Arity and defn): Fix quoting.
3555 2007-04-09 Eric Blake <ebb9@byu.net>
3557 Address failure of 'seekable stdin' on Mac OS X.
3558 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3561 2007-04-07 Eric Blake <ebb9@byu.net>
3563 Include <config.h> first in all C files, and not in headers.
3564 Fixes regression for --disable-assert builds from 2007-04-02.
3565 * src/m4.h (includes): Don't include config.h here.
3566 * m4/m4private.h (includes): Likewise.
3567 * m4/builtin.c: Include config.h before anything else.
3568 * m4/debug.c: Likewise.
3569 * m4/hash.c: Likewise.
3570 * m4/input.c: Likewise.
3571 * m4/m4.c: Likewise.
3572 * m4/macro.c: Likewise.
3573 * m4/module.c: Likewise.
3574 * m4/symtab.c: Likewise.
3575 * m4/syntax.c: Likewise.
3576 * m4/utility.c: Likewise.
3577 * src/freeze.c: Likewise.
3578 * src/stackovf.c: Likewise.
3580 2007-04-03 Eric Blake <ebb9@byu.net>
3582 * modules/m4.c (numb_ratio, numb_divide, numb_modulo): Avoid
3583 SIGFPE on x86 architectures.
3584 Reported by Ralf Wildenhues.
3586 2007-04-02 Eric Blake <ebb9@byu.net>
3588 Fix warnings from last commit.
3589 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3590 fprintf-posix sprintf-posix'.
3591 * m4/macro.c (expand_macro, trace_format): Use correct specifier
3593 (process_macro): Avoid negative array index.
3594 * src/freeze.c (produce_resyntax_dump, produce_module_dump)
3595 (dump_symbol_CB, produce_frozen_state): Use correct specifier for
3598 2007-04-02 Gary V. Vaughan <gary@gnu.org>
3600 Get rid of the last 'differs in signedness' compiler warnings:
3602 * m4/macro.c (process_macro): m4_get_symbol_value_text() returns
3603 a regular 'char *', so variables to store the return address,
3604 and iterate through it should be regular 'char *' too.
3605 * m4/input.c (m4_input_block): The start and current members of
3606 the string part of this union store regular 'char *' types, so
3607 they should be regular 'char *' types too.
3609 2007-04-02 Gary V. Vaughan <gary@gnu.org>
3611 M4 was designed to have a small number of header files defining
3612 the interfaces to several source files each. Keeping this in
3613 mind allows us to tidy things up considerably. Having done this,
3614 it becomes clear that some of the installed headers reference
3615 other headers which are not installed (but that's another patch):
3617 * m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from
3619 * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
3620 ...to here, so client modules can benefit too.
3621 (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
3622 lowest level to save doing it multiple times elsewhere.
3623 * m4/debug.c (stdio.h): Removed. The portable <gnu/stdio--.h>
3624 is already included via m4private.h.
3625 * modules/time.c (stdio.h): Ditto.
3626 * modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>.
3627 * modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h>
3628 and <gnu/unistd--.h>,
3629 * m4/m4private.h (m4module.h): Use angle brackets for an installed
3631 * m4/hash.h (system.h): Ditto.
3632 * modules/gnu.c (progname.h): Removed.
3633 * src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h.
3634 * m4/m4private.h (assert.h, errno.h): Already included via
3636 * m4/input.c (ctype.h): Ditto.
3637 * m4/module.c (ltdl.h): Ditto.
3638 * m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h)
3640 * m4/path.c (config.h, stdlib.h): Ditto.
3641 * m4/utility.c (config.h): Ditto.
3642 * modules/evalparse.c (assert.h, ctype.h): Ditto.
3643 * modules/gnu.c (assert.h, ctype.h, errno.h): Ditto.
3644 * modules/import.c (assert.h): Ditto.
3645 * modules/m4.c (assert.h, errno.h): Ditto.
3646 * modules/modtest.c (assert.h): Ditto.
3647 * modules/stdlib.c (sys/types.h): DittAo.
3648 * src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h):
3650 * src/stackovf.c (assert.h): Ditto.
3651 * modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster
3652 private interfaces when NDEBUG is defined.
3653 * modules/import.c (m4/m4module.h, m4private.h): Ditto.
3654 * modules/load.c (m4/m4module.h, m4private.h): Ditto.
3655 * modules/m4.c (m4/m4module.h, m4private.h): Ditto.
3656 * modules/modtest.c (m4/m4module.h, m4private.h): Ditto.
3657 * modules/mpeval.c (m4/m4module.h, m4private.h): Ditto.
3658 * modules/perl.c (m4/m4module.h, m4private.h): Ditto.
3659 * modules/shadow.c (m4/m4module.h, m4private.h): Ditto.
3660 * modules/time.c (m4/m4module.h, m4private.h): Ditto.
3661 * modules/traditional.c (m4/m4module.h, m4private.h): Ditto.
3662 * src/m4.h (locale.h): Moved from here...
3663 * src/main.h: ...to here.
3664 (m4private.h): Already included via m4.h.
3665 * src/stackovf.c (m4private.h): Ditto.
3667 2007-03-28 Gary V. Vaughan <gary@gnu.org>
3669 * Makefile.am (stamp-vcl): Removed.
3670 (CONFIG_STATUS_DEPENDENCIES): Depend directly on ChangeLog.
3672 2007-03-28 Eric Blake <ebb9@byu.net>
3674 * src/main.c (usage): Improve note to TRANSLATORS.
3675 * m4/system_.h (EXIT_FAILURE): Reflect gnulib changes.
3677 * tests/builtins.at (__m4_version__): Fix bug when TIMESTAMP is
3680 2007-03-24 Eric Blake <ebb9@byu.net>
3682 * m4/output.c (m4_output_init): Update to latest gnulib.
3683 * bootstrap (ltdl/m4/.cvsignore): No longer track generated
3685 * NEWS: Reflect release of 1.4.9.
3688 2007-03-07 Eric Blake <ebb9@byu.net>
3692 Exercise gnulib's new POSIX *printf modules.
3693 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3695 * modules/format.c (format): Support %a and %A.
3696 * doc/m4.texinfo (Format): Test this addition.
3697 * NEWS: Document this addition.
3699 2007-03-03 Eric Blake <ebb9@byu.net>
3701 * m4/input.c (m4__next_token): Fix synclines when in batch mode.
3702 * doc/m4.texinfo (M4exit): Synch another section.
3703 (Syncoutput): Make similar to other sections.
3705 2007-03-01 Eric Blake <ebb9@byu.net>
3707 * doc/m4.texinfo: Improve the indices.
3708 (Concept index): Rearrange to be last.
3709 (Sysval): Merge from branch.
3711 * doc/m4.texinfo (Syscmd, Esyscmd): Merge more doc sections.
3713 2007-02-28 Eric Blake <ebb9@byu.net>
3715 POSIX XCU ERN 137 was approved.
3716 * modules/mpeval.c (numb_extension): Delete.
3717 * modules/m4.c (numb_extension): Likewise.
3718 * modules/evalparse.c (comma_term, condition_term): Always
3719 implement ?: and , operators.
3720 * m4/symtab.c: Update comment to match reality.
3721 * src/freeze.c (produce_frozen_state, reload_frozen_state): Avoid
3722 dereferencing context directly when accessor exists.
3723 * src/main.c (usage): Prefer GNU_M4 over EMACS.
3724 (struct macro_definition): Rename...
3725 (struct deferred): ...to match usage. All uses changed.
3726 * doc/m4.texinfo (Eval): Document this change.
3727 (Operation modes, Changeresyntax): Fix wording to prefer GNU_M4
3729 (Preprocessor features, Changesyntax): Fix inaccuracies.
3730 * NEWS: Import branch NEWS items for 1.4.x series. Document
3733 POSIX XCU ERN 118 was approved.
3734 * modules/m4.c (define): Kill posixly_correct distinction in
3735 define behavior, since POSIX says GNU behavior complies.
3736 * tests/builtins.at (define): Restore original semantics.
3737 * doc/m4.texinfo (Pushdef): Document portability issues with
3739 (Incompatibilities): Clean up wording of what POSIX requires.
3740 * NEWS: Document this.
3742 2007-02-26 Eric Blake <ebb9@byu.net>
3744 Re-enable clean bootstrap on cygwin.
3745 * Makefile.am (AM_LDFLAGS): For now, export all symbols from
3746 modules, since otherwise we run afoul of current libtool
3747 limitations on cygwin and mingw.
3749 2007-02-25 M. Levinson <levinsm@users.sourceforge.net> (tiny change)
3751 * src/freeze.c (reload_frozen_state): Avoid dereferencing freed
3752 memory. Fixes regression introduced 2007-01-20.
3754 2007-02-25 Eric Blake <ebb9@byu.net>
3756 * tests/freeze.at (loading format 2): Augment test to catch
3757 regression introduced on 2007-01-20.
3759 Reported by M. Levinson.
3761 * m4/system_.h (includes, EXIT_SUCCESS, EXIT_FAILURE): Adjust to
3764 2007-02-05 Eric Blake <ebb9@byu.net>
3766 * tests/options.at (--fatal-warnings): New test.
3767 * tests/others.at (stdin seekable): Exit on error.
3768 * m4/m4private.h (M4_OPT_WARN_EXIT_BIT): New bit.
3769 (m4_get_warnings_exit_opt): Access it.
3770 * m4/m4module.h (m4_context_opt_bit_table): Access it.
3771 * m4/utility.c (m4_error, m4_error_at_line): Only force an exit
3773 (m4_warn, m4_warn_at_line): Change exit status on -E, and force
3775 * src/m4.c (usage): Document new -E behavior.
3776 (main): Make -E an additive option.
3777 * doc/m4.texinfo (Operation modes): Document the change.
3778 Reported by Ralf Wildenhues.
3780 * tests/others.at (stdin seekable): Fix bug in test.
3781 * ltdl/m4/gnulib-cache.m4: Gnulib module strstr no longer exists.
3783 * m4/input.c (struct m4_input_block): Remove unused field traced.
3785 2007-02-03 Eric Blake <ebb9@byu.net>
3786 and Bruno Haible <bruno@clisp.org> (tiny change)
3788 * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
3790 Reported by Bruno Haible.
3792 2007-01-31 Eric Blake <ebb9@byu.net>
3794 * m4/resyntax.c (m4_regexp_syntax_encode): Detect allocation
3797 2007-01-26 Eric Blake <ebb9@byu.net>
3799 * m4/symtab.c (includes): Adjust to latest gnulib.
3800 * modules/m4.c (includes): Likewise.
3802 2007-01-23 Eric Blake <ebb9@byu.net>
3804 * m4/m4module.h (M4_SYNTAX_ASSIGN): Delete this unused
3805 extension to make enough room.
3806 (M4_SYNTAX_IGNORE): Change value to zero, since the (commented)
3807 code in input.c special cases this category.
3808 (M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): New values in preparation
3809 for define(eleventh,${11}) extension.
3810 * m4/syntax.c: Update comments accordingly.
3811 (m4_syntax_create, m4_syntax_code): Handle { and }.
3812 * m4/input.c (m4__next_token): Likewise.
3813 * src/freeze.c (produce_frozen_state): Support new categories.
3814 (reload_frozen_state): When loading version 1, disable syntax
3815 features not present in 1.4.x.
3816 * tests/freeze.at: Sort and rename existing tests.
3817 (loading format 1): Ensure we don't break v1 frozen files that
3819 (loading format 2, reloading changecom, reloading changesyntax):
3821 * doc/m4.texinfo (Changesyntax, Frozen file format 1): Document
3822 the new syntax categories.
3823 (Arguments): Update the FIXME comment.
3824 (M4wrap): Merge examples from branch, before worrying about fixing
3825 m4wrap to obey POSIX.
3826 (Using frozen files): Start merging from branch.
3829 2007-01-20 Eric Blake <ebb9@byu.net>
3831 * src/freeze.c (produce_char_dump): Delete. Replace with...
3832 (produce_mem_dump): ...this new function, to encode more strings.
3833 Also make the coding easier to read and slightly more compact.
3834 (produce_syntax_dump): Only dump non-default syntax codes.
3835 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
3836 Encode non-ASCII characters in user-supplied strings.
3837 (GET_STRING): Accept escape sequences in version 2.
3838 * NEWS: Document this change.
3841 2007-01-16 Eric Blake <ebb9@byu.net>
3843 Port patch from branch for stack overflow detection on BSD/OS.
3844 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Check for stack_t.ss_sp.
3845 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
3846 ! HAVE_STACK_T_SS_SP]: Use this check.
3847 Reported by Chris McGuire.
3849 2007-01-15 Eric Blake <ebb9@byu.net>
3851 * tests/builtins.at (__m4_version__): New test.
3852 * modules/traditional.c (m4_macro_table): Provide windows and os2
3853 macros, as appropriate. Add __traditional__ macro.
3854 * modules/mpeval.c (m4_macro_table): Name the macro __mpeval__,
3855 not __gmp__, to match module name.
3856 * modules/load.c (m4_macro_table): Name the macro __load__, not
3857 __modules__, to match module name.
3858 * doc/m4.texinfo (History, Shell commands, Platform macros): Merge
3860 (Standard Modules): Improve wording.
3861 (Incompatibilities): Move platform macros into their own node.
3862 (Load, Unload): Use actual examples.
3863 * NEWS: Document this change.
3866 2007-01-13 Eric Blake <ebb9@byu.net>
3868 * doc/m4.texinfo (Mpeval): Add tests.
3869 * tests/testsuite.at (AT_CHECK_GMP): New filter, factored from...
3870 * tests/builtins.at (gmp): ...here. Rename test to...
3872 * tests/generate.awk (new_test): Filter out mpeval tests when gmp
3874 * m4/m4module.h (m4_get_no_gnu_extensions_opt): Merge
3875 no_gnu_extensions with posixly_correct_opt, since they were set in
3877 * m4/m4private.h (struct m4): Remove no_gnu_extensions.
3878 * src/main.c (main): Update caller.
3879 * src/freeze.c (reload_frozen_state): Likewise.
3880 * modules/m4.c (m4wrap): Likewise.
3882 2007-01-12 Eric Blake <ebb9@byu.net>
3884 * m4/syntax.c (m4_set_comment): XCU ERN 131 was approved by
3885 POSIX, so update the comment.
3886 * doc/m4.texinfo (Inhibiting Invocation): XCU ERN 130 was
3887 approved by POSIX, so we can always have blind macros, even when
3889 (Ifelse): Mention the term `blind builtin'.
3891 2007-01-08 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3893 * doc/m4.texinfo: Fix a couple of typos.
3895 2007-01-08 Eric Blake <ebb9@byu.net>
3897 * ltdl/m4/gnulib-cache.m4: Update for new year.
3898 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Cover all error cases.
3899 Reported by Ralf Wildenhues.
3901 2007-01-06 Eric Blake <ebb9@byu.net>
3903 * m4/m4private.h (to_uchar): Move...
3904 * m4/m4module.h: here, so modules can use it.
3905 * src/main.c (usage, long_options): Support --posix as a synonym
3907 * modules/m4.c (numb_invert): Detect unsupported x**-y.
3908 (numb_incr, numb_urshift, numb_extension): New macros.
3909 (numb_obstack): Port patch from branch to support radix 1 output.
3910 * modules/mpeval.c (numb_obstack): Use \ for ratios.
3911 (numb_incr, numb_urshift, numb_extension): New macros.
3912 (mpq2mpz): Warn rather than error.
3913 * modules/evalparse.c (URSHIFT, NEGATIVE_EXPONENT): New
3915 (eval_error): Rearrange, so that all ignorable errors are less
3917 (eval_text, last_text): Obey C++ type safety rules.
3918 (numb_pow): Change return type.
3919 (exp_term): Adjust caller.
3920 (m4_evaluate): Fail on bad exponent.
3921 (logical_or_term, logical_and_term): Ignore failed ** in short
3923 (eval_lex): Fix typos when detecting <<= and >>=. Use \ instead
3924 of : for ratio. Support >>>, ,, and ?:. Port patch from branch
3925 to parse radix 1 numbers.
3926 (condition_term, comma_term): New parse functions.
3927 (shift_term): Support >>>.
3928 (m4_evaluate): Port patch from branch to output radix 1 numbers.
3929 Warn instead of error for most parse problems.
3930 * doc/m4.texinfo (Limits control, Eval): Document these changes.
3931 * NEWS: Document new operators and new command line option.
3933 2007-01-04 Eric Blake <ebb9@byu.net>
3935 * configure.ac (AC_SYS_LARGEFILE): Guarantee large file support.
3937 2007-01-03 Eric Blake <ebb9@byu.net>
3939 * doc/m4.texinfo (Format, Incr): More merges.
3940 (Eval): Ensure C precedence rules are met.
3941 * modules/evalparse.c (BADOP, INVALID_OPERATOR): New enumerators.
3942 (not_term, logical_not_term): Delete; these are same precedence
3943 as other unary operators.
3944 (equality_term): New; these are lower precedence than relational
3946 (eval_lex, simple_term, m4_evaluate): Recognize forbidden C
3947 operators for better error messages.
3948 (logical_or_term, logical_and_term): Short-circuit out the error
3949 of division by zero.
3950 (unary_term): Allow consecutive unary operators.
3951 * modules/m4.c (int2numb, numb2int): Delete; these potentially
3953 (numb_not, numb_eor, numb_ior, numb_and): Update callers.
3954 * modules/mpeval.c (reduce1, reduce2): Protect macros better.
3955 * NEWS: Document this change.
3957 2006-12-27 Eric Blake <ebb9@byu.net>
3959 * doc/m4.texinfo (Substr, Patsubst): Merge more sections from the
3961 * modules/m4.c (substr): Merge from branch.
3963 2006-12-26 Eric Blake <ebb9@byu.net>
3965 * doc/m4.texinfo (Changesyntax): Check for regressions with
3966 changesyntax(W=...).
3968 2006-12-22 Eric Blake <ebb9@byu.net>
3970 * m4/m4module.h (m4_set_syntax): Change signature.
3971 * modules/gnu.c (m4_resyntax_encode_safe): Reduce error to
3973 (changesyntax): Likewise, and update caller.
3974 * m4/m4private.h (m4_syntax_table): Add orig member.
3975 * m4/syntax.c (m4_set_quotes, m4_set_comment): Merge from branch.
3976 Don't set is_single_quotes and is_single_comments when the begin
3977 character is shadowed by another syntax type.
3978 (m4_syntax_create): Populate default syntax table.
3979 (add_syntax_attribute): Don't lose quote assignment.
3980 (remove_syntax_attribute): Only allow removing rquote or ecomm.
3981 (add_syntax_set, subtract_syntax_set, set_syntax_set)
3982 (reset_syntax_set): New helper routines.
3983 (m4_set_syntax): Alter semantics - NUL key reverts entire syntax
3984 to default, and empty chars reverts that key to default.
3985 (check_is_single_quotes, check_is_single_comments): New helper
3987 * modules/m4.c (changecom): Merge from branch.
3988 * m4/input.c (m4__next_token): Rearrange token recognition order
3989 to macro, quote, comment, in order to match traditional
3991 * src/freeze.c (reload_frozen_state): Update caller.
3992 * doc/m4.texinfo (Changequote, Changecom): Merge from branch, with
3994 (Changeresyntax): Revise to match style of surrounding sections
3995 and add more examples.
3996 (Changesyntax): Likewise, and update to new semantics.
3997 * NEWS: Document this change.
3999 * doc/m4.texinfo (Operation modes): Avoid underfull hbox.
4000 (M4wrap, Eval, Errprint): Fix typos.
4001 (Divnum): Not necessary to redivert in example.
4003 2006-12-21 Eric Blake <ebb9@byu.net>
4005 * doc/m4.texinfo (Len, Index macro, Regexp): More section merging
4008 2006-12-19 Eric Blake <ebb9@byu.net>
4010 * modules/m4.h (m4_sysval_flush_func): Adjust prototype.
4011 * modules/m4.c (m4_sysval_flush): Add parameter, so that m4exit
4012 can track write errors without all other callers warning multiple
4014 (sysval_flush_helper): New function.
4015 (dumpdef, syscmd, errprint, m4exit): Adjust callers.
4016 * modules/gnu.c (esyscmd): Likewise.
4017 * tests/others.at (stdout closed, stdout full): Error message
4020 2006-12-16 Eric Blake <ebb9@byu.net>
4022 * src/main.c: Fix missing include.
4024 * src/main.c (main): Check for errors when closing stdin.
4025 * modules/m4.c (m4exit): Missed part of previous patch: flush
4026 stdin before a successful exit.
4027 Reported by Ralf Wildenhues.
4029 2006-12-14 Eric Blake <ebb9@byu.net>
4031 * modules/m4.c (m4_sysval_flush): Flush stdin before exiting, as
4033 * tests/others.at (stdin seekable): New test.
4035 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4037 * doc/m4.texinfo: Fix some typos.
4039 2006-12-04 Eric Blake <ebb9@byu.net>
4041 * doc/m4.texinfo (Undivert, Divnum, Cleardivert): Merge more doc
4043 (Modules): Make style consistent.
4045 2006-11-16 Eric Blake <ebb9@byu.net>
4047 * bootstrap: Relax m4 requirement, thanks to...
4048 * configure.ac (Gettext support): ...this workaround to the 1.4.4
4049 bug. Undoes restriction added on 2006-11-09.
4051 * tests/builtins.at (esyscmd, syscmd): Redo, since spilled
4052 diversions are now closed when not active.
4053 (divert): Remove check now in the manual.
4054 * tests/others.at (stderr closed): Likewise.
4055 (stdout closed): Add a check.
4056 * doc/m4.texinfo (Include, Search Path, Diversions, Divert): Sync
4057 more docs with branch.
4059 2006-11-14 Eric Blake <ebb9@byu.net>
4061 Remerge sparse diversion handling from branch.
4062 * ltdl/m4/gnulib-cache.m4: Replace avltree-list with
4064 * m4/output.c (diversion_table): Change type to gl_oset_t.
4065 (m4_output_init, m4_output_exit, cleanup_tmpfile, make_room_for)
4066 (m4_make_diversion, insert_diversion_helper, m4_insert_diversion)
4067 (m4_undivert_all, m4_freeze_diversions): Adjust all callers.
4068 (div0, diversion_storage): New variables.
4069 (diversions, equal_diversion_CB): Deleted.
4070 (threshold_diversion_CB): New callback.
4071 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
4073 (m4_tmpfile): Move cloexec action here.
4075 * m4/resyntax.c (m4_regexp_syntax_encode): Avoid bug with signed
4078 2006-11-13 Eric Blake <ebb9@byu.net>
4080 Add several new command line options.
4081 * src/main.c (usage): Update.
4082 (OPTSTRING, long_options): Add --pushdef, --popdef, --gnu,
4083 --traceon, --traceoff, --syncoutput, --warnings, --unload-module.
4084 Make --regexp-syntax argument optional.
4085 (main): Support new options. Fix regression in interactive
4086 behavior from Nov 8.
4087 * m4/m4private.h (M4_OPT_SYNCOUTPUT_BIT): Rename from
4088 M4_OPT_SYNC_OUTPUT_BIT.
4089 * m4/m4module.h (m4_context_opt_bit_table): Rename sync_output to
4090 syncoutput, to match option.
4091 (m4_parse_truth_arg): New prototype.
4092 * m4/utility.c (m4_parse_truth_arg): Implement it.
4093 * m4/output.c (m4_shipout_text): Adjust sync_output caller.
4094 * modules/gnu.c (syncoutput): Adjust sync_output caller, and use
4096 * doc/m4.texinfo (Operation modes, Dynamic loading features)
4097 (Preprocessor features, Limits control, Debugging options)
4098 (Command line files): Update documentation.
4099 * tests/builtins.at (mkstemp): Simplify.
4100 * tests/macros.at (Command line pushdef): New test.
4101 (Command line define): Improve.
4102 * tests/options.at (--traceon and --traceoff, --syncoutput): New
4104 (POSIXLY_CORRECT): Likewise.
4105 (deprecated options): Augment.
4106 (--regexp-syntax): Update, now that -r takes optional arg.
4107 * NEWS: Reformat. Document new options.
4109 2006-11-11 Eric Blake <ebb9@byu.net>
4111 One step closer to allowing C++ compilation - don't blindly
4112 convert between char* and unsigned char*.
4113 * m4/m4module.h (m4_set_syntax): Change signature.
4114 * m4/m4private.h (m4_string): Use signed char.
4115 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
4116 (m4_get_syntax_ecomm): No longer a need to cast.
4117 * m4/syntax.c (m4_set_syntax, m4_syntax_create, m4_set_quotes):
4118 Reflect this change.
4119 * m4/macro.c (expand_argument): Simplify.
4120 (expand_token): Use proper type.
4121 * src/freeze.c (reload_frozen_state): Likewise.
4122 * m4/input.c (MATCH, match_input): Likewise.
4123 * modules/m4.c (translit): Likewise.
4124 * modules/gnu.c (substitute): Simplify.
4126 * m4/macro.c (trace_format): Use canonical type name.
4127 * m4/output.c (m4_freeze_diversions): Likewise.
4128 * src/freeze.c (produce_module_dump, dump_symbol_CB)
4129 (produce_frozen_state): Likewise.
4130 * m4/m4private.h (to_uchar): Grab from branch.
4131 * m4/input.c (string_peek, string_read): Use it.
4132 * m4/utility.c (skip_space): Likewise.
4133 * src/main.c (main): Likewise.
4134 * doc/m4.texinfo (Translit): Remerge from branch.
4135 * tests/builtins.at (translit): Test 8-bit range.
4136 * modules/m4.c (m4_expand_ranges): Merge from branch.
4138 2006-11-09 Eric Blake <ebb9@byu.net>
4140 * bootstrap: Validate that installed M4 is powerful enough.
4141 Reported by Gary V. Vaughan, analyzed by Stepan Kasal.
4143 2006-11-08 Eric Blake <ebb9@byu.net>
4145 Merge deferred handling of -D option from branch.
4146 * doc/m4.texinfo (Debugging options, Preprocessor features)
4147 (Dynamic loading features, Operation modes, Invoking m4):
4148 Document this change.
4149 * src/main.c (OPTSTRING): Specify in-order processing.
4150 (process_file): New function.
4151 (main): Use it to interleave files and deferred options.
4152 * tests/macros.at (Command line define): New test.
4153 * tests/generate.awk: Allow '@comment file' as first example
4155 * tests/options.at (option grouping): Update to reflect actual
4157 (file names): New test.
4159 2006-11-07 Eric Blake <ebb9@byu.net>
4161 * m4/output.c (cleanup_tmpfile, m4_insert_diversion_helper): Check
4164 * tests/builtins.at (m4exit): New test; failed on cygwin before
4166 * m4/output.c (cleanup_tmpfile): Close files before removing
4168 (make_room_for, m4_output_exit): Ensure that atexit handler
4169 invoked from m4_error sees consistent state.
4171 * doc/m4.texinfo (Errprint): Merge another doc node.
4172 * tests/builtins.at (dumpdef, errprint): New tests.
4173 * modules/m4.c (errprint): Merge from branch: flush before
4176 2006-11-02 Eric Blake <ebb9@byu.net>
4178 * bootstrap: Update bootstrap requirement wording.
4179 Reported by Bruno Haible.
4181 2006-10-31 Eric Blake <ebb9@byu.net>
4183 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
4185 * doc/m4.texinfo (Translit): Merge from branch.
4186 * modules/m4.c (divert, substr): Ignore excess arguments.
4187 (index, translit): Merge from branch.
4188 * tests/builtins.at (translit): Add a test.
4190 2006-10-30 Eric Blake <ebb9@byu.net>
4192 * m4/m4private.h (m4_get_symbol_value_module): Delete accidental
4194 * m4/symtab.c (m4_get_symbol_value_module): Likewise.
4196 * modules/m4.c (m4_make_temp): Make safe across libtool.
4197 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Avoid warnings.
4198 * configure.ac (--with-modules): Accomodate changed module
4199 location when doing './configure --enable-debug'.
4201 2006-10-28 Eric Blake <ebb9@byu.net>
4203 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
4206 2006-10-27 Eric Blake <ebb9@byu.net>
4208 * bootstrap (gnulib): No longer a need to patch after gnulib-tool
4210 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
4211 0.16, since 0.15 is incompatible with our automake requirement.
4213 * m4/macro.c (expand_argument): Fix missing initialization.
4214 * m4/m4private.h (struct m4_symbol_value): Store entire
4215 m4_builtin, not just the func.
4216 (m4_get_symbol_value_func): Update.
4217 (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
4219 * m4/m4module.h (m4_get_symbol_value_builtin)
4220 (m4_get_symbol_builtin): New prototypes.
4221 (m4_set_symbol_value_func): Delete, replace with...
4222 (m4_set_symbol_value_builtin): New function.
4223 (m4_builtin_find_by_name): Change signature.
4224 * m4/symtab.c (m4_symbol_value_print): Simplify.
4225 (m4_get_symbol_value_func): Update.
4226 (m4_get_symbol_value_builtin): New function.
4227 (m4_set_symbol_value_func): Delete, replace with...
4228 (m4_set_symbol_value_builtin): New function.
4229 (dump_symbol_CB) [DEBUG_SYM]: Simplify.
4230 * m4/builtin.c (m4_builtin_find_by_name): Change signature.
4231 * m4/input.c (struct m4_input_block): Remove unused trace member.
4232 (m4_push_builtin, builtin_print, init_builtin_token): Update
4234 * m4/module.c (install_builtin_table): Likewise.
4235 * src/freeze.c (reload_frozen_state): Likewise.
4236 * modules/gnu.c (builtin): Make it possible to retrieve a builtin
4237 token, even after the builtin has been undefined.
4238 * doc/m4.texinfo (Builtin): Document new capability.
4241 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
4243 * modules/m4.c (m4_make_temp): Use it.
4244 * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
4246 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4248 * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
4251 2006-10-26 Eric Blake <ebb9@byu.net>
4253 Silence -O2 -Wall -Wwrite-strings warnings.
4254 * m4/m4private.h (m4_symbol_value): Const-ify text.
4255 * m4/m4module.h (m4_get_symbol_value_text)
4256 (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
4257 (m4_set_symbol_value_placeholder): Likewise.
4258 * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
4260 * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
4261 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
4262 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
4264 * modules/format.c (format): Likewise.
4265 * src/main.c (main): Likewise.
4266 * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
4267 * modules/shadow.c (shadow, test): Likewise.
4268 * m4/output.c (m4_make_diversion): Don't hold on to empty
4270 (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
4271 (m4_freeze_diversions): Likewise. Don't use uninitialized
4274 Convert diversions to list instead of sparse array, part 2.
4275 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
4277 * m4/output.c (m4_diversion): Add next pointer and divnum members.
4278 (diversion_table): Convert to a list instead of a sparse array.
4279 (free_list): Maintain free list of reclaimed diversions.
4280 (equal_diversion_CB, cmp_diversion_CB): New functions.
4281 (m4_output_init): Set up list.
4282 (m4_output_exit): Tear down list.
4283 (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
4285 (m4_make_diversion): Change creation of new diversions.
4286 (m4_insert_diversion_helper): New function, to avoid list
4288 * tests/builtins.at (divert): The test now passes.
4289 * NEWS: Document this improvement.
4291 Convert diversions to list instead of sparse array, part 1.
4292 * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
4294 * m4/output.c (diversion, total_buffer_size, output_unused):
4295 Track size in size_t. All users changed.
4296 (struct diversion): Reduce size now, to compensate for part 2.
4297 (m4_make_diversion, make_room_for): Avoid malloc overflow.
4298 (m4_output_exit): Fix typo in assert.
4299 (m4_output_init, make_room_for, m4_make_diversion)
4300 (m4_insert_diversion, m4_freeze_diversions): Adjust users of
4301 struct m4_diversion to disambiguate the new union.
4302 * tests/builtins.at (divert): Detect this failure.
4304 2006-10-25 Eric Blake <ebb9@byu.net>
4306 * m4/m4module.h (m4_push_builtin): Add parameter.
4307 * modules/m4.c (defn): Update caller.
4308 * m4/input.c (file_read_init, string_read_init): No longer
4310 (input_funcs): Change signature of read_func, all callers
4312 (composite_peek, composite_read, composite_unget),
4313 (composite_print, composite_funcs): New input type. Not yet
4314 fully utilized, but one step closer to fixing defn.
4315 (m4_input_block): Make every input block track current file and
4316 line. Rename some members. Remove unused out_line. Add support
4317 for composite input block.
4318 (input_change): New flag.
4319 (file_peek, file_read, file_clean, file_unget, file_print):
4321 (m4_push_file, m4_push_builtin, m4_push_string_init)
4322 (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
4323 (m4_skip_line, pop_input): Track input block changes.
4324 (m4_pop_wrapup): Avoid overflow.
4325 (init_builtin_token): Handle composite input.
4326 (next_char): Handle input block changes.
4327 * doc/m4.texinfo (Location): Remerge from branch.
4329 * src/m4.h (includes): Need <locale.h> after all; fixes
4330 regression from yesterday.
4332 * m4/system_.h (obstack_regrow): New macro. Hopefully glibc will
4334 * m4/macro.c (expand_macro): Avoid referencing invalid memory.
4335 Handle nesting the argc obstack.
4336 (expand_token): Avoid unnecessary malloc.
4337 (collect_arguments): Copy name before invalidating it.
4338 (argc_stack, argv_stack): New variables.
4339 (m4_macro_expand_input): Initialize argc and argv stacks once per
4340 file, instead of once per macro.
4342 2006-10-24 Eric Blake <ebb9@byu.net>
4344 * src/m4.h (includes): Add gettext.h, for N_. Assume setlocale.
4346 2006-10-23 Eric Blake <ebb9@byu.net>
4348 * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
4349 from branch regarding stripped leading whitespace.
4351 * modules/m4.c (includes): Use safe headers even when configured
4352 with --enable-assert.
4353 (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
4354 #defined as mkstemp_safer.
4356 2006-10-21 Eric Blake <ebb9@byu.net>
4358 * modules/m4.c (m4_make_temp): Change signature.
4359 (maketemp, mkstemp): Update callers.
4360 * modules/m4.h (m4_make_temp_func): New export.
4361 * modules/gnu.c (mkdtemp): New macro.
4362 * doc/m4.texinfo (Operation modes): Document interaction with
4364 (Mkdtemp): New node.
4365 * tests/builtins.at (mkdtemp): New test.
4366 (mkstemp): Check for umask effect.
4367 * NEWS: Document new builtin.
4369 * tests/generate.awk (normalize): Update recognition of trailing
4371 * doc/m4.texinfo: Minor formatting fixes from branch.
4372 (Foreach, Improved foreach): Merge from branch.
4373 * examples/foreach.m4: Merge from branch.
4374 * examples/foreachq.m4: New file from branch.
4375 * examples/foreach2.m4: Likewise.
4376 * examples/foreachq2.m4: Likewise.
4378 * doc/m4.texinfo (titlepage): Add myself as author.
4379 * src/main.c (AUTHORS): Likewise.
4381 2006-10-19 Eric Blake <ebb9@byu.net>
4383 * modules/m4.c (m4_make_temp, mkstemp): New functions.
4384 (maketemp): Add POSIX behavior and a warning.
4385 * tests/others.at (maketemp): Move this test...
4386 * tests/builtins.at (mkstemp): ...to here, and beef up.
4387 * tests/options.at (--safer): Update to new warning message.
4388 * doc/m4.texinfo (Mkstemp): Sync from branch.
4389 (Extensions): Update maketemp behavior.
4390 * NEWS: Document that maketemp now always warns.
4392 * tests/generate.awk: For ease of doc-writing, simplify selection
4393 of '-Ipath/to/examples' to '@comment examples'.
4394 * examples/forloop.m4: Simplify.
4395 * examples/forloop2.m4: New file.
4396 * examples/quote.m4: New file.
4397 * doc/m4.texinfo (Improved forloop): New node.
4398 (Manual): Clarify use of examples directory.
4399 (Shift, Forloop): Resync from branch.
4400 (Include, Location): Update to new usage of examples directory.
4402 * m4/system_.h (includes): Pick up <unistd.h> before checking for
4404 (gettext_noop): Don't define here, let gettext.h do it instead.
4405 * po/POTFILES.in: Update entries to reflect gnulib imports.
4407 2006-10-16 Eric Blake <ebb9@byu.net>
4409 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
4411 * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
4412 pkglibexecdir support.
4413 * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
4414 worry about pathconf.h, now that gnulib does it for us.
4415 (pkgmodincludedir): Simplify.
4416 (pkglibexecdir): Delete, now that automake does this.
4417 * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
4418 * src/main.c (usage): Likewise.
4419 * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
4421 * doc/m4.texinfo: Port some changes from the branch.
4422 (Invoking m4): Promote to a chapter, instead of a section of
4424 (Operation modes, Dynamic loading features, Preprocessor features)
4425 (Limits control Frozen state, Debugging options)
4426 (Command line files): Subdivide into new sections.
4427 (Cleardivert): Rename from cleardiv.
4429 2006-10-14 Eric Blake <ebb9@byu.net>
4431 * tests/others.at (stdin closed): Update to match previous patch.
4433 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
4435 Reported by Ralf Wildenhues.
4437 * modules/m4.c (undivert): Merge from branch.
4438 * doc/m4.texinfo (Improved fatal_error): Fix typo.
4439 (Improved exch): New node, copied from branch.
4440 (Improved cleardivert): Update from branch.
4443 2006-10-13 Eric Blake <ebb9@byu.net>
4445 * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
4447 * modules/gnu.c (builtin, indir): Transparently handle builtin
4449 * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
4450 * m4/input.c (m4_pop_wrapup): Display debug message when switching
4452 (m4_input_init): No need to use empty file any more.
4453 (file_print): Display correct file name.
4454 * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
4455 dereference a NULL file name.
4456 * m4/m4module.h (m4_pop_wrapup): New parameter.
4457 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
4459 * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
4460 * m4/symtab.c (m4_symbol_value_groks_macro): New method.
4461 * src/main.c (main): Adjust caller.
4462 * tests/options.at (--debugmode): Test more output from -dV.
4464 2006-10-12 Eric Blake <ebb9@byu.net>
4466 * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
4468 * m4/m4private.h (m4__next_token_is_open): New prototype.
4469 * m4/m4module.h (m4_push_single): Delete; push_string is an
4470 adequate interface, and removing support for this simplifies the
4472 (m4_push_wrapup): New parameter.
4473 (m4_is_syntax): Delete; m4_has_syntax is sufficient.
4474 (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
4475 start-quote and start-comment exclusive from other syntax
4477 * m4/syntax.c: Likewise.
4478 * m4/input.c (input_funcs): Make polymorphic without requiring
4479 clients to know whether they are located at isp. All users
4481 (file_names): New variable.
4482 (m4_input_init): Initialize it.
4483 (m4_push_file): Use it.
4484 (m4_input_exit): Free it after use.
4485 (m4__next_token): Simplify slightly.
4486 (m4__peek_token): Rename and simplify...
4487 (m4__next_token_is_open): ... to this. In particular, this
4488 allows us to avoid a double ungetc, which POSIX doesn't
4490 (struct m4_input_block, m4_push_single, single_peek, single_read):
4491 Remove support for single characters, as the input engine now
4492 guarantees we don't need it.
4493 (file_unget, string_unget, m4_input_print, unget_input):
4494 Strengthen assertions.
4495 (file_init_funcs, file_read_init): New for file reading.
4496 (string_init_funcs, string_read_init): New for wrapped text.
4497 (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
4498 Support wrapped text with locations.
4499 (m4_skip_line): Support dnl across include file boundary.
4500 (peek_char): Don't pop input when peeking.
4501 (file_peek): Peek can be called at the end of the file.
4502 (string_read): Don't read beyond string bounds.
4503 * m4/macro.c (expand_token, collect_arguments): Update callers.
4504 (expand_macro): Report errors at location of open parenthesis.
4505 (expand_token, expand_argument, process_macro): Avoid negative
4506 array dereferences with m4_has_syntax.
4507 * m4/utility.c (skip_space): Likewise.
4508 * modules/m4.c (m4wrap): Update caller.
4509 * tests/builtins.at (__file__, __line__, dnl): New tests.
4510 * tests/options.at (--debugmode): Normalize the output.
4511 * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
4512 Remerge recent changes from branch.
4513 (Improved fatal_error): New node from branch.
4515 2006-10-11 Eric Blake <ebb9@byu.net>
4517 * src/main.c (usage, long_options): Add --debugmode as an alias
4518 for --debug, to match macro name.
4519 * tests/options.at (--debugmode): Rename from --debug, and test
4521 (--discard-comments): Augment test.
4522 * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
4525 2006-10-10 Eric Blake <ebb9@byu.net>
4527 Trace improvements: debugmode(c) was always printing the last two
4528 lines paired, combine them; and show non-text expansions.
4529 * m4/macro.c (trace_prepre): Update to show what the macro will
4531 (trace_pre): No need to special-case on debugmode(c).
4532 (trace_post): Likewise. Also, show non-text expansions.
4533 (expand_macro): Update caller. Collecting arguments can change
4534 debug mode, so cache values beforehand.
4535 (trace_format): Remove support for unused %l%S%r, and fix support
4536 for %z to match gcc's attribute((printf)).
4537 (trace_header): Update caller.
4538 * m4/input.c (struct m4_input_block): Rename from input_block.
4539 (struct input_funcs): Add print_func member.
4540 (file_print, builtin_unget, builtin_print, string_print)
4541 (m4_input_print): New functions.
4542 (m4_push_string_finish): Change return type.
4543 (m4_push_file): Fix missing use of close parameter.
4544 * m4/debug.c (m4_debug_decode): Don't clear pending traces.
4545 * m4/m4module.h (m4_input_print): New prototype.
4546 * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
4547 to match behavior change.
4548 * tests/options.at (--debug): Likewise.
4549 * tests/macros.at (Propagation of traceon)
4550 (Propagation of --trace): Likewise.
4551 * tests/others.at (stderr closed, stdout closed, stdin closed):
4553 * doc/m4.texinfo (Forloop): Simplify.
4554 (Trace): Update to changed behavior.
4555 (Debugmode): Document this change.
4556 * src/main.c (usage): Likewise.
4559 2006-10-09 Eric Blake <ebb9@byu.net>
4561 * m4/path.c (m4_include_env_init): Don't alter result of getenv.
4562 Reported by Ralf Wildenhues.
4564 * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
4566 2006-10-07 Eric Blake <ebb9@byu.net>
4568 * m4/m4module.h (m4_set_exit_failure): New prototype.
4569 * m4/utility.c (m4_set_exit_failure): New function.
4570 * modules/m4.c (m4exit): Use it to avoid yet another global
4571 variable export in libm4.
4573 2006-10-06 Eric Blake <ebb9@byu.net>
4575 * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
4577 * tests/others.at (stdout closed): Fix final check.
4579 Replace uses of tmpfile with clean-temp, since tmpfile is
4580 incompatible with closeout.
4581 * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
4583 * tests/others.at (stderr closed): Likewise.
4584 * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
4585 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4587 * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
4588 (m4_tmpfile, cleanup_tmpfile): New functions.
4589 (make_room_for, m4_insert_diversion): Use clean-temp module.
4590 * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
4592 * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
4594 * m4/utility.c (m4_numeric_arg): Merge from branch.
4595 * modules/gnu.c (debuglen): New builtin.
4596 * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
4597 Rename --arglength to --debuglen.
4598 * tests/options.at (--arglength): Rename to --debuglen.
4599 (deprecated options): Augment test.
4600 * doc/m4.texinfo (Invoking m4): Document the name change.
4601 (Debugmode): Rename from Debug Levels.
4602 (Debugfile): Rename from Debug Output.
4603 (Debuglen): New node.
4604 * NEWS: Document these changes.
4606 * modules/m4.c (m4exit): Fix typo. Ensure desired exit status in
4607 case closing a module exits.
4609 * modules/m4.c (m4exit): Merge from branch.
4610 * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
4612 2006-10-05 Eric Blake <ebb9@byu.net>
4614 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4616 * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
4617 * src/main.c (main): Close stdout on exit.
4618 * m4/debug.c (set_debug_file): Check for write failure.
4619 * m4/m4.c (m4_delete): Don't mask write failure.
4620 * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
4621 macros before calling AT_CHECK.
4622 (M4_ONE_MEG_DEFN): New helper macro.
4623 * tests/others.at (stdout full): New test.
4624 (stderr closed, stdin closed, stdout closed): Augment.
4625 * tests/builtins.at (syscmd): New test.
4628 2006-10-04 Eric Blake <ebb9@byu.net>
4630 * tests/builtins.at: Alphabetize tests.
4631 * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
4632 * tests/generate.awk (new_test): Fix underquoting.
4633 * tests/others.at (maketemp): Rename from misc.
4634 (stdin closed, stdout closed, stderr closed): New tests.
4636 2006-10-03 Eric Blake <ebb9@byu.net>
4638 Avoid all global variables in modules, so that --disable-static
4640 * examples/incl.m4: New file, from branch.
4641 * Makefile.am (dist_pkgdata_DATA): Distribute it.
4642 * doc/m4.texinfo (Location): Merge this section from branch.
4643 (Include): Update the test.
4644 * tests/generate.awk (new_test): Allow for VPATH build
4645 pre-processing of expected __program__ output.
4646 * m4/m4module.h (m4_current_diversion, m4_output_current_line):
4647 Avoid global variables.
4648 (m4_context_field_table): Add current_diversion, output_line.
4649 (m4_output_init, m4_make_diversion): Add parameter.
4650 (m4_get_program_name, m4_set_program_name): New accessors.
4651 * m4/m4private.h (m4_get_current_diversion),
4652 (m4_set_current_diversion, m4_get_output_line)
4653 (m4_set_output_line): New accessors.
4654 * m4/utility.c (m4_get_program_name, m4_set_program_name): New
4656 * modules/m4.c (divnum, divert): Adjust callers.
4657 * modules/gnu.c (__program__): Likewise.
4658 * m4/output.c (m4_output_init, m4_make_diversion)
4659 (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
4660 (m4_insert_diversion): Likewise.
4661 * m4/input.c (file_clean, m4_push_file): Likewise.
4662 * src/freeze.c (reload_frozen_state): Likewise.
4663 * src/main.c (main, usage): Likewise.
4665 Partially plug memory leak when unloading gnu module.
4666 * tests/modules.at (unload gnu module): New test.
4667 * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
4668 (m4_regexp_compile): Move static storage to module visibility.
4669 * tests/options.at (--debug): Adjust to new output.
4671 2006-09-29 Eric Blake <ebb9@byu.net>
4673 Even when not the first option, --help can't have side effects.
4674 * tests/options.at (--debugfile): Detect bugs in this area.
4675 * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
4677 * src/main.c (main): Fix it by deferring debugfile change. Also,
4678 defer closing streams until after module tracing is done.
4679 * modules/gnu.c (debugfile): Make message consistent with command
4681 * doc/m4.texinfo (Invoking m4): Touch up the documentation.
4682 * NEWS: Document this fix.
4684 * modules/m4.c (dnl): Include macro name in warning message.
4685 * m4/input.c (m4_skip_line): Add parameter.
4686 * m4/m4module.h (m4_skip_line): Likewise.
4687 * src/main.c (usage): Update wording.
4688 * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
4689 issue of blind macros vs. POSIX is resolved.
4690 (Dnl): Merge another node from branch.
4692 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4694 * m4/system_.h (N_): Define.
4695 * src/main.c (main): Validate numeric arguments.
4696 (size_opt): New function, idea borrowed from coreutils.
4697 * m4/macro.c (expand_macro): -L0 implies no limit.
4698 * doc/m4.texinfo (Invoking m4): Document this change.
4700 * tests/options.at: (--arglength, --nesting-limit)
4701 (--regexp-syntax): New tests of argument validation.
4703 2006-09-28 Eric Blake <ebb9@byu.net>
4705 * tests/options.at: Alphabetize the tests.
4707 2006-09-27 Eric Blake <ebb9@byu.net>
4709 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
4710 another parameter to print module info.
4711 * m4/macro.c (trace_pre): Adjust caller.
4712 * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
4713 * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
4714 * NEWS: Document this.
4716 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4718 * m4/symtab.c (symbol_value_print): Rename to...
4719 (m4_symbol_value_print): ...this, and...
4720 (m4_symbol_print): Update to allow -L length truncation. Now
4721 truncation also affects dumpdef output and builtin names.
4722 * m4/m4private.h (nesting_limit, max_debug_argument_length):
4724 * m4/m4module.h (m4_symbol_print): Add parameter.
4725 (m4_symbol_value_print): New function.
4726 * modules/m4.c (dumpdef): Allow length truncation.
4727 * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
4729 * doc/m4.texinfo (Invoking m4): Document -l better.
4730 (Dumpdef, Debug Levels): Document the effect of -l.
4731 * NEWS: Document this change.
4733 * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
4734 (m4_expand_ranges): Ensure we aren't picking up partial object on
4736 * modules/stdlib.c (setenv): Allow extra arguments.
4737 * modules/time.c (ctime): Avoid side effect in call to
4739 * modules/gnu.c (m4_regexp_substitute): Likewise.
4740 (renamesyms): Avoid extra obstack_init.
4741 * src/freeze.c (reload_frozen_state): Remove debug comment.
4742 (produce_frozen_state): Simplify fprintf to puts where possible.
4743 * modules/modtest.c (modtest_init, modtest_finish): Likewise.
4744 * modules/import.c (import, symbol_fail, modules_fail): Likewise.
4745 * m4/macro.c (trace_flush): Likewise.
4746 * m4/debug.c (m4_debug_message_prefix): Likewise.
4747 * m4/path.c (include_dump): Likewise.
4748 * m4/module.c (module_remove): Likewise.
4749 (install_builtin_table): Simplify malloc and string
4752 2006-09-26 Eric Blake <ebb9@byu.net>
4754 * m4/m4module.h (m4_symbol_print): New prototype.
4755 (M4_DEBUG_TRACE_STACK): New enumerator.
4756 (m4_is_debug_bit): Allow use without requiring m4private.h.
4757 * m4/symtab.c (symbol_value_print, m4_symbol_print): New
4759 * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
4761 (dumpdef): Allow printing pushdef'd stacks.
4762 * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
4763 * src/main.c (usage): Document it.
4764 * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
4767 * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
4769 * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
4770 of lines during make.
4771 (AM_CPPFLAGS): Remove unneeded include path.
4772 (src_m4_CPPFLAGS): Remove redundant include path.
4773 * m4/system_.h Make preprocessor indentation consistent.
4774 (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
4776 (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
4778 (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
4779 (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
4780 (bool, true, false): Don't undefine here; stdbool takes care of
4782 * src/m4.h (includes): Assume config.h, and several standard
4784 (__CYGWIN__, WIN32): Don't define here; let system.h do it.
4785 * m4/m4private.h: Assume config.h.
4786 * m4/output.c: Likewise.
4787 * m4/path.c: Likewise.
4788 * m4/resyntax.c: Likewise.
4789 * m4/utility.c: Likewise.
4790 * modules/gnu.c: Likewise.
4791 * modules/import.c: Likewise.
4792 * modules/load.c: Likewise.
4793 * modules/m4.c: Likewise.
4794 * modules/modtest.c: Likewise.
4795 * modules/mpeval.c: Likewise.
4796 * modules/perl.c: Likewise.
4797 * modules/shadow.c: Likewise.
4798 * modules/stdlib.c: Likewise.
4799 * modules/time.c: Likewise.
4800 * modules/traditional.c: Likewise.
4802 2006-09-21 Eric Blake <ebb9@byu.net>
4804 * doc/m4.texinfo (Invoking m4): Add clarification on option
4805 processing behavior.
4806 * tests/options.at (option grouping): Test this.
4808 Reported by Mikhail Teterin.
4810 * bootstrap: Add --force option, based on idea from coreutils.
4811 * README: Document that ./bootstrap and autoreconf are for
4812 developers, and not lightly done in tarballs.
4814 2006-09-20 Eric Blake <ebb9@byu.net>
4816 * src/main.c (usage, OPTSTRING, main): Rename -e to -i. Make
4817 warnings consistent.
4818 (long_options, HASHSIZE_OPTION): Warn on -H.
4819 * doc/m4.texinfo (Invoking m4): Document this.
4820 * tests/options.at (deprecated options): Update.
4822 Change the default of interactive sessions to match sh.
4823 * src/main.c (usage): Document this.
4824 (enum interactive_choice): New enum.
4825 (main): Use it to defer decision of interactive until after
4826 argument processing.
4827 * doc/m4.texinfo (Invoking m4): Document this.
4828 * NEWS: Likewise, plus add missing mention of -b.
4829 Reported by Stepan Kasal.
4831 2006-09-19 Eric Blake <ebb9@byu.net>
4833 * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
4834 well as --error-output; the goal is to add -o/--output in some
4835 future version with semantics like gcc or autom4te.
4836 * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
4837 (Extensions): Reflect this update.
4838 (Renamesyms): Add another test.
4839 (Defn): Xfail for now, so that `make check' is happy.
4840 * NEWS: Document this change.
4841 * tests/generate.awk: Mark dynamic loading tests as such. Allow
4843 * tests/macros.at (Renamesyms collisions): New test, exposing
4844 renamesyms' coredump.
4845 * tests/options.at (--debugfile, --safer): Update to match
4848 * m4/debug.c (set_debug_file): Fix regression in -o when stdout
4849 and stderr are same file, introduced 2003-07-23.
4850 * tests/options.at (--debugfile): New test, to catch the bug.
4851 (deprecated options): Test --error-output.
4852 * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
4853 Deprecate --error-output, and replace it with --debugfile.
4854 * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
4855 Document this change.
4858 2006-09-18 Eric Blake <ebb9@byu.net>
4860 * modules/load.c (modules): Rename to...
4861 (m4modules): ...this, since it is an English word with 0
4863 * modules/gnu.c (symbols, m4symbols): Likewise.
4864 * doc/m4.texinfo (Listing Modules): Rename to...
4865 (M4modules): ...this.
4866 (Symbols): Rename to...
4867 (M4symbols): ...this.
4868 (Load, Foreach, Trace, Answers): Update to new spellings.
4869 * NEWS: Document this.
4871 * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
4872 such that without arguments, the global trace flag is changed
4873 rather than walking the table of all currently-defined macros.
4874 (set_trace_CB): No longer needed.
4875 * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
4876 (m4_set_symbol_traced): Delete.
4877 (m4_symtab_create): Nuke the nuke parameter.
4878 * m4/m4private.h (m4_get_symbol_value): Delete.
4879 * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
4880 (m4_set_symbol_name_traced): Free undefined entries that are no
4882 (symbol_destroy_CB): Update caller.
4883 * m4/m4.c (m4_create): Update caller.
4884 * src/main.c (main): Likewise.
4885 (usage): Fix typo in last commit.
4886 * doc/m4.texinfo: Minor cleanups throughout.
4887 (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
4888 more nodes from branch.
4889 (Trace): Document new semantics, and how to simulate the old.
4890 * tests/builtins.at (multiquotes): Adjust to new semantics.
4891 * NEWS: Update somewhat.
4893 2006-09-14 Eric Blake <ebb9@byu.net>
4895 Add --safer option, per debian bug 5898.
4896 * src/main.c (usage): Document new option.
4897 (SAFER_OPTION): New enumerator.
4898 (main): Set the option bit.
4899 * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
4901 * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
4902 (m4_get_safer_opt): New accessor.
4903 * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
4904 * modules/m4.c (syscmd, maketemp): Likewise.
4905 * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
4906 (Sysval, Maketemp): Add tests of this.
4907 * tests/options.at (--safer): Likewise.
4909 2006-09-13 Eric Blake <ebb9@byu.net>
4911 * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
4913 Reported by Ralf Wildenhues.
4916 * Makefile.am (check_LTLIBRARIES): Build test libraries in the
4917 tests directory, so we can be sure an installed build is not
4918 picking up uninstalled non-test libraries.
4919 (check-local, installcheck-local): Depend on test libraries.
4920 * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
4921 after file name. Fix quoting. Remove skipping the test, now
4922 that makefile guarantees test modules will exist.
4923 (Freezing modules, modules: shadow, modules: unload)
4924 (modules: trace): Always put test modules in module path.
4925 (modules: importing): Likewise, and rely on AT_CHECK_M4 for
4927 * src/main.c (usage): Document default module search path.
4928 (import_environment, frozen_file_to_read, frozen_file_to_write):
4931 * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
4932 * tests/m4.in: ...not here.
4933 Reported by Ralf Wildenhues.
4935 2006-09-08 Eric Blake <ebb9@byu.net>
4937 * bootstrap: Kill unrelated copy-n-paste code from argument
4938 parsing. Let Makefile generate testsuite.
4939 * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
4941 2006-09-07 Eric Blake <ebb9@byu.net>
4943 * m4/m4module.h (m4_peek_input): No longer export.
4944 (m4_error_at_line, m4_warn_at_line): New prototypes.
4945 (m4_is_symbol_void): New macro.
4946 (m4_push_file): Update prototype.
4947 * m4/m4private.h (m4__peek_token): New prototype.
4948 (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
4949 * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
4950 * src/main.c (main): Allow reading from stdin twice.
4951 * modules/m4.c (include): Adjust to new prototype.
4952 * m4/input.c: General comment cleanup.
4953 (file_peek, file_read, file_unget, push_file): Set end flag on
4954 EOF, so that we don't call getc twice.
4955 (push_file, file_clean): Port fix from branch to avoid closing
4957 (pop_input): Port fix from branch to avoid reading free'd memory
4958 when input ends mid-string.
4959 (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
4960 (string_peek, string_read): Always use unsigned char.
4961 (m4_skip_line): Warn when dnl cut short by EOF.
4962 (peek_input): Rename from m4_peek_input.
4963 (match_input): Update signature, to distinguish between `(' token
4964 and multi-char quote or comment beginning with `('.
4965 (m4_input_exit): Cleanup now done in m4_pop_wrapup.
4966 (m4__peek_token): New function, ported from branch.
4967 (m4__next_token): Update to new token types.
4968 * m4/macro.c (expand_token, expand_argument): Use peek_token.
4969 * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
4970 (Invoking m4): Remerge from branch.
4972 * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
4973 (check-local): and put dependency here.
4974 Reported by Ralf Wildenhues.
4976 2006-09-05 Eric Blake <ebb9@byu.net>
4978 * m4/m4module.h (m4_debug_message): New prototype.
4979 (M4_DEBUG_TRACE_MODULE): New debug bit.
4980 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
4981 (M4_DEBUG_MESSAGE2): Delete these macros.
4982 * m4/debug.c (m4_debug_message): New method.
4983 (m4_debug_decode): Add module tracing as flag `m'.
4984 * m4/input.c (m4_push_file, file_clean): Use new method.
4985 * m4/path.c (m4_path_search): Likewise.
4986 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
4987 * m4/module.c (install_builtin_table, install_macro_table)
4988 (m4__module_open, module_close, module_remove): Promote several
4989 module debug messages outside of DEBUG_MODULES.
4990 (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
4991 DEBUG_MODULES with normal trace output.
4992 * src/main.c (usage): Document new flag.
4993 * doc/m4.texinfo (Debug Levels): Likewise.
4994 * Makefile.am ($(TESTSUITE)): Add missing dependency.
4995 * tests/m4.in: Neutralize platform-dependent module filenames.
4996 * tests/options.at (--debug): Update expected output.
4998 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5000 * doc/m4.texinfo: Fix some typos.
5001 * tests/others.at: Likewise.
5003 2006-09-05 Eric Blake <ebb9@byu.net>
5005 * m4/input.c (lex_debug): Remove dead code that broke compilation
5006 with --enable-debug.
5007 * m4/module.c (install_builtin_table, install_macro_table)
5008 (m4__module_init, m4__module_open, module_close)
5009 (module_remove): Fix compilation when --enable-debug.
5010 * m4/output.c (m4_shipout_text): Likewise.
5011 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
5012 libraries when --enable-debug.
5013 * configure.ac (DYNAMIC_MODULES): New variable, to pass
5014 information to testsuite.
5015 (modules to preload): Determine modules after we know whether
5016 shared libraries are supported.
5017 * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
5019 * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
5020 * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
5021 (modules: shadow, modules: unload, modules: importing)
5022 (modules: trace): Use new macro.
5023 * tests/builtins.at (gmp): Likewise.
5025 * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
5027 (expand_token): Avoid assertion just added to docs.
5028 (expand_macro): Track pending expansions, for when a symbol's
5029 definition changes during argument collection.
5030 (m4_macro_call, process_macro): Operate on symbol value, not
5031 symbol, since symbol may have changed during argument collection.
5032 * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
5033 (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
5034 (m4_get_symbol_value): Add fast macro version.
5035 * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
5036 (m4_macro_call): Adjust prototype.
5037 * m4/module.c (install_builtin_table): Check that flags are valid
5038 when creating builtin.
5039 * m4/symtab.c (m4__symtab_remove_module_references): Use
5040 m4_symbol_value_delete, rather than inlining it.
5041 (m4_symbol_value_copy): Copy placeholder text.
5042 (symbol_popval): Use m4_symbol_value_delete.
5043 (m4_symbol_value_delete): Implementation was missing when NDEBUG.
5044 Handle pending expansions.
5045 * modules/gnu.c (indir): Update to new prototype.
5046 * doc/m4.texinfo: Fix menus to be consistent with section names.
5047 (Defn): Add test that macro tokens flatten to empty string;
5048 triggered an assert before this patch.
5049 (Ifelse): Merge another node.
5050 (Loops): Split into...
5051 (Forloop, Foreach): New nodes; work is still underway on them.
5052 (Answers): Add more info on foreach macro; work is still underway.
5053 (Indir): Add test that indir collects arguments before looking up
5055 * TODO: Update based on this patch.
5057 2006-09-01 Eric Blake <ebb9@byu.net>
5059 * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
5060 * m4/hash.h (m4_free_hash_iterator): New prototype.
5061 * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
5062 ensure we don't do unsafe things while iterating.
5063 (HASH_ITER, ITER_CHAIN): New accessor macros.
5064 (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
5065 (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
5066 (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
5067 (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
5068 to catch unsafe actions.
5069 (m4_free_hash_iterator): New function, to avoid memory leaks, and
5070 when debugging, to track safe actions.
5071 (m4_hash_apply): Avoid memory leak.
5072 * m4/symtab.c (m4_symtab_apply): Likewise.
5073 * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
5074 in manually to src/ for now.
5075 * tests/builtins.at (gmp): Add keyword module.
5076 * tests/modules.at (Freezing modules, modules: shadow)
5077 (modules: unload, modules: importing, modules: trace): Likewise.
5079 2006-08-30 Eric Blake <ebb9@byu.net>
5081 * m4/utility.c (m4_warn): Factor "Warning" out of messages into
5083 (m4_bad_argc, m4_numeric_arg): Update all callers.
5084 * m4/macro.c (m4_macro_call): Likewise.
5085 * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
5086 (Indir, Builtin, Ifdef): More doc merges.
5087 (Loops): Mention that documenting foreach would be nice.
5088 (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
5089 (Include, Eval, Location, M4exit): s/input.m4/stdin/.
5090 * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
5091 (substitute, syncoutput): Update all m4_warn callers.
5092 * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
5093 (traceon, traceoff): Make warning message consistent.
5094 (define, pushdef): Update all m4_warn callers.
5095 * tests/generate.awk: Choose file name so that documentation can
5096 show command-line behavior.
5097 * tests/builtins.at (define): Update to new wording.
5098 * tests/macros.at (pushdef/popdef): Likewise.
5099 * tests/freeze.at (loading format 1): Likewise.
5100 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
5102 * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
5104 (Defn): Add failing test case for mixing text and builtin.
5105 (Renamesyms): Improve wording, and identify core dump that needs
5108 2006-08-29 Eric Blake <ebb9@byu.net>
5110 * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
5111 (Arguments, Pseudo Arguments): More doc merges from the branch.
5112 (Macro expansion): Turn example into test.
5113 (Pseudo Arguments): Add example of avoiding argument.
5114 * modules/m4.c (undefine, popdef): Accept multiple arguments.
5115 (define, pushdef): Warn on non-text macro name.
5116 (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
5117 warning/error messages.
5118 (ifdef): Ignore extra arguments.
5119 * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
5120 (m4__symtab_remove_module_references): Check that there is no leak.
5121 * tests/macros.at (pushdef/popdef): Update to new message.
5122 * tests/builtins.at (define): Likewise.
5123 * tests/freeze.at (loading format 1): Likewise.
5124 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
5126 * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
5127 (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
5128 as accessor function, to avoid compiler warning.
5129 * m4/module.c (m4__module_open): Move declaration of variable to
5130 avoid compiler warning.
5131 * src/main.c (main): Avoid shadowing a global variable.
5132 * src/freeze.c (produce_symbol_dump): Avoid unused variable
5133 warning when NDEBUG.
5134 * tests/options.at (--discard-comments, --import-environment)
5135 (--debug, --prepend-include, --help and --version): Rename tests
5136 to name option tested.
5138 2006-08-28 Eric Blake <ebb9@byu.net>
5140 * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
5141 * m4/module.c (install_builtin_table): ...to here, and add
5142 assertion that blind macros require arguments.
5143 * m4/m4module.h (struct m4_builtin): Document restrictions that
5144 must be met during module loading.
5145 * modules/gnu.c (changeresyntax, changesyntax): These are blind,
5146 so require an argument to avoid triggering assertion.
5147 (debugfile): Tweak error message.
5149 2006-08-25 Eric Blake <ebb9@byu.net>
5151 * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
5152 (M4_BUILTIN_SIDE_EFFECT): New enumerators.
5153 (struct m4_builtin): New member flags replaces groks_macro_args,
5154 blind_if_no_args. min_args and max_args are now 0-based.
5155 Rearrange members to reduce size on platforms where function
5156 pointers are 64 bits but regular pointers are 32.
5157 (m4_bad_argc): Add argument.
5158 * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
5159 * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
5160 effect into account.
5161 * m4/module.c (install_builtin_table): Adjust all users affected
5163 * m4/macro.c (m4_macro_call): Likewise.
5164 * src/freeze.c (reload_frozen_state): Likewise.
5165 * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
5166 * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
5167 * modules/import.c (builtin_functions): Likewise.
5168 * modules/load.c (builtin_functions): Likewise.
5169 * modules/modtest.c (builtin_functions): Likewise.
5170 * modules/mpeval.c (builtin_functions): Likewise.
5171 * modules/perl.c (builtin_functions): Likewise.
5172 * modules/shadow.c (builtin_functions): Likewise.
5173 * modules/stdlib.c (builtin_functions): Likewise.
5174 * modules/time.c (builtin_functions, mktime_functions)
5175 (strftime_functions): Likewise.
5176 * doc/m4.texinfo (Loops): Update test now that shift is blind.
5177 (Macro Arguments): Fix typo in test.
5178 (Patsubst): Fix typo in test.
5179 * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
5180 end of string. Fix return value when ignore_duplicates.
5181 * tests/builtins.at (patsubst): Fix typo in test.
5183 * tests/options.at (debug-flags): Update to reflect new message.
5184 (deprecated options, prepend-include, help and version): New
5186 * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
5187 test omits an input file name.
5188 * src/main.c (long_options, main): Add -B/--prepend-include.
5189 (usage): Document it.
5190 (main): `m4 --help --version' now displays help, not version.
5191 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
5192 dirname filenamecat.
5193 * m4/m4module.h (m4_add_include_directory): Add parameter.
5194 * m4/m4private.h (m4__include_init): New prototype.
5195 * m4/m4.c (m4_create): Put `.' on path before options are
5197 * m4/path.c (includes): Assume C89. Use gnulib for file name
5199 (m4__include_init): New function.
5200 (search_path_add): Allow prepending.
5201 (m4_add_include_directory, search_path_env_init): Adjust callers.
5202 (m4_path_search): Relative names now invoke path search, since
5203 `.' might not be first.
5204 * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
5206 2006-08-25 Bruno Haible <bruno@clisp.org> (tiny change)
5207 and Eric Blake <ebb9@byu.net>
5209 * bootstrap: Run autopoint before gnulib-tool, since autopoint
5210 0.15 installs macros obsoleted by current gnulib.
5212 2006-08-25 Eric Blake <ebb9@byu.net>
5214 * doc/m4.texinfo (Macro Arguments): Another section merged;
5215 testsuite failures now exposed.
5217 2006-08-23 Eric Blake <ebb9@byu.net>
5219 * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
5220 (Input processing): More doc merges from the branch.
5221 (Regular expression syntax): Add introductory text.
5222 (Inhibiting Invocation): More doc merges from the branch.
5223 (Other tokens): Reorder after comments.
5224 * tests/generate.awk: Allow passing options to doc examples.
5226 2006-08-22 Eric Blake <ebb9@byu.net>
5228 * tests/options.at (debug-flags): New test.
5229 * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
5230 not negative, to distinguish failure in m4_debug_decode.
5231 (m4_debug_decode): Add new parameter.
5232 * modules/gnu.c (regexp): Slight cleanup.
5233 (renamesyms): Ignore excess arguments.
5234 (syncoutput): Make case-insensitive, warn on bad argument.
5235 (debugmode): Factor -+ handling out to...
5236 * m4/debug.c (m4_debug_decode): ...here.
5237 (m4_debug_message_prefix): Fix spacing.
5238 * src/main.c (main): Let -d option adjust flags.
5239 * m4/input.c (file_clean): Avoid printing empty file name.
5240 * doc/m4.texinfo (Syncoutput): Document new range of input.
5241 (Invoking m4): Document use of multiple -d flags.
5243 Start porting various fixes from the branch that use gnulib.
5244 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
5245 binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
5246 regexprops-generic stdlib-safer unlocked-io.
5247 * m4/debug.c (m4_debug_set_output): Close debug file on exec.
5248 * m4/path.c (m4_path_search): Close input file on exec, reject
5249 empty file name, fix parameter naming.
5250 * m4/output.c (make_room_for): Close diversion file on exec.
5251 (includes): Assume C89 headers.
5252 (tmpfile): For now, we don't want tmpfile-safer, because we want
5254 * m4/m4private.h (includes): Use various gnulib headers.
5255 * doc/regexprops-generic.texi: Use gnulib's copy.
5257 * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
5258 * AUTHORS: Add copyright.
5259 * ChangeLog: Likewise.
5260 * README: Likewise. Require automake 1.9b or later.
5261 * HACKING: New file.
5262 * README-alpha: Add copyright.
5263 * THANKS: Likewise. Update.
5264 * doc/STYLE: Add copyright, and tweak for changed directories.
5265 * modules/README: Add copyright, and tweak for libtool version.
5266 * examples/COPYING: New file.
5267 * examples/WWW/COPYING: Likewise.
5268 * examples/WWW/m4lib/COPYING: Likewise.
5269 * modules/shadow.m4: Add copyright.
5270 * modules/perl.m4: Likewise.
5271 * modules/modtest.m4: Likewise.
5272 * modules/stdlib.m4: Likewise.
5273 * modules/time.m4: Likewise.
5274 * modules/time2.m4: Likewise.
5275 * po/Makevars: Likewise.
5276 * tests/iso8859.m4: Likewise.
5277 * tests/m4.in: Likewise.
5278 * NEWS: Add (C) to copyright.
5280 * m4/system_.h: Likewise.
5281 * tests/atlocal.in: Likewise.
5282 * tests/builtins.at: Likewise.
5283 * tests/freeze.at: Likewise.
5284 * tests/generate.awk: Likewise.
5285 * tests/macros.at: Likewise.
5286 * tests/modules.at: Likewise.
5287 * tests/options.at: Likewise.
5288 * tests/others.at: Likewise.
5289 * tests/testsuite.at: Likewise.
5290 * m4/utility.c: Spell out copyright years.
5291 * src/main.c: Likewise.
5293 * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
5295 2006-08-21 Eric Blake <ebb9@byu.net>
5297 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
5298 * modules/gnu.c (esyscmd): Use -1 for failure. Set sysval to 0
5299 when no arguments are given, but without losing warning about 0
5301 * modules/m4.c (syscmd): Likewise.
5302 (includes): Assume C89.
5303 (m4_sysval): Make static.
5304 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
5305 (sysval): Port calculation from branch.
5307 2006-08-20 Eric Blake <ebb9@byu.net>
5309 * m4/macro.c (expand_macro): Move argument check...
5310 (m4_macro_call): ...to here, so indir will warn.
5311 * modules/gnu.c (__program__): New macro, ported from branch.
5312 (builtin): Perform argument check.
5313 (changesyntax): Avoid out-of-bounds read.
5315 * modules/gnu.c (includes): Assume stdlib.h, errno.
5316 (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
5317 (substitute): Add caller parameter, avoid out-of-bounds memory
5319 (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
5322 2006-08-16 Eric Blake <ebb9@byu.net>
5324 * po/POTFILES.in: Add more files that contain translatable
5326 * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
5327 information to translators.
5328 (USE_MSGCTXT): New var for gettext 0.15.
5329 * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
5330 debug/trace messages in lower case.
5331 * m4/macro.c (expand_argument): Likewise.
5332 * m4/path.c (m4_path_search): Likewise.
5333 * src/main.c (main): Likewise.
5335 2006-08-14 Eric Blake <ebb9@byu.net>
5337 * src/main.c (usage): Document --import-environment.
5338 * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
5340 2006-08-11 Eric Blake <ebb9@byu.net>
5342 * bootstrap (func_get_translations): Only remove files when doing
5344 (func_update_po): Avoid CDPATH problems.
5346 2006-08-10 Eric Blake <ebb9@byu.net>
5348 * bootstrap (func_get_translations): New function.
5349 (func_update_po): Borrow ideas from tar to correctly pull in
5350 translations from newer location.
5352 2006-08-09 Eric Blake <ebb9@byu.net>
5354 * bootstrap: Recent gnulib no longer has jm_* macros to worry
5356 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
5358 * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
5359 (m4_error, m4_warn): ... these new prototypes.
5360 (m4_current_file, m4_current_line): Move into context, rather
5361 than leaving as globals.
5362 (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
5363 (m4_undivert_all, m4_input_init): Now takes context.
5364 * m4/utility.c (m4_error, m4_warn): New functions.
5365 * m4/m4private.h: Assume errno exists.
5366 (struct m4): Move warning_status to a bit flag,
5367 and add exit_status. Adjust accessors accordingly.
5368 * src/main.c (print_program_name_CB): No longer needed.
5369 (main): Use new m4_get_fatal_warnings_opt.
5370 * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
5371 instead of issuing "INTERNAL ERROR". Pass context when needed,
5372 and use new accessors.
5373 * m4/input.c: Likewise.
5374 * m4/macro.c: Likewise.
5375 * m4/output.c: Likewise.
5376 * m4/utility.c: Likewise.
5377 * modules/evalparse.c: Likewise.
5378 * modules/gnu.c: Likewise.
5379 * modules/load.c: Likewise.
5380 * modules/m4.c: Likewise.
5381 * modules/mpeval.c: Likewise.
5382 * src/freeze.c: Likewise.
5383 * src/main.c: Likewise.
5384 * tests/macros.at: Adjust to new message format.
5385 * tests/builtins.at: Likewise.
5386 * tests/freeze.at: Likewise.
5387 * tests/modules.at: Likewise.
5388 * doc/m4.texinfo: Likewise.
5390 * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
5393 2006-08-03 Eric Blake <ebb9@byu.net>
5395 * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
5396 gracefully handle ENOSYS.
5400 2006-07-28 Eric Blake <ebb9@byu.net>
5402 * src/freeze.c (reload_frozen_state): Copy string when creating
5403 placeholder, to avoid memory corruption.
5404 * m4/symtab.c (symbol_popval): Avoid memory leak.
5405 (m4_symbol_rename): Avoid shadowing rename function.
5406 (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
5407 * tests/freeze.at (reloading unknown builtin): Add test.
5408 * tests/generate.awk: Capture m4.texinfo line number in
5409 testsuite.log, not just generated.at.
5411 Port idea from branch that a frozen file can request an unknown
5412 builtin without producing a warning unless the builtin is
5414 * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
5415 (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
5416 (m4_set_symbol_value_placeholder): New accessors.
5417 * m4/m4module.h (m4_is_symbol_placeholder),
5418 (m4_get_symbol_value_placeholder),
5419 (m4_set_symbol_value_placeholder),
5420 (m4_get_symbol_placeholder): Likewise.
5421 * m4/symtab.c (m4_is_symbol_value_placeholder),
5422 (m4_get_symbol_value_placeholder),
5423 (m4_set_symbol_value_placeholder): Likewise.
5424 (dump_symbol_CB): Handle new symbol type.
5425 * m4/macro.c (trace_pre): Likewise.
5426 (m4_macro_call): Warn when invoking a placeholder.
5427 * modules/m4.c (dumpdef): Handle dumping a placeholder.
5428 (defn): Warn when referencing a placeholder.
5429 * src/freeze.c (dump_symbol_CB): Ignore placeholder when
5431 (reload_frozen_state): When reloading unknown builtin, install a
5432 placeholder instead of warning.
5433 * tests/freeze.at (loading format 1): Allow warning when
5434 popdef'ing undefined function.
5436 2006-07-27 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
5438 * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
5439 function. Shift by 7, not 3, for consistency with
5440 gnulib/lib/hash.c. Don't assume hash word is 32 bits.
5442 2006-07-27 Eric Blake <ebb9@byu.net>
5444 * src/main.c (usage): Update to match branch.
5445 (main): Update --version info to distinguish between program name
5446 `m4' and package name `GNU M4'.
5447 (AUTHORS): Translate René Seindal's name.
5448 * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
5449 * Makefile.am (doc/m4.1): Update to match branch.
5450 * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
5453 * m4/system_.h (EXIT_MISMATCH): Define.
5454 * src/main.c (main): Don't clear syntax table for version 1.
5455 (usage): Document exit status.
5456 * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
5457 branch, and require V directive to appear first in file. Fix
5458 broken logic for detecting F and T in version 1 files.
5460 2006-07-22 Eric Blake <ebb9@byu.net>
5462 * src/main.c (stackovf_handler): Document the problems in our
5464 * src/stackovf.c: Forward port changes in branch to use POSIX
5465 sa_sigaction when available.
5466 (process_sigsegv): Avoid buffer overrun when error string is
5467 translated, although the fact that we translate in a signal
5468 handler is still a bug.
5469 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
5470 from branch to modernize checks.
5472 * modules/format.c (format): Avoid compiler warning that str may
5473 be used uninitialized.
5475 * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
5477 (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
5478 (DEBUG_MACRO): Remove unused macro.
5479 * src/stackovf.c: Avoid compiler warnings.
5480 * m4/input.c: Likewise.
5481 * m4/module.c: Likewise.
5482 * m4/output.c: Likewise.
5483 * m4/path.c: Likewise.
5484 * m4/symtab.c: Likewise.
5485 * m4/syntax.c: Likewise.
5487 2006-07-20 Eric Blake <ebb9@byu.net>
5489 * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
5490 Regenerate to explicitly ask for --assume-autoconf=2.60.
5492 2006-07-19 Eric Blake <ebb9@byu.net>
5494 * po/ChangeLog: Merge into main ChangeLog, then delete file.
5497 * doc/m4.texinfo (copying): Relax restriction on front-cover and
5500 2006-07-17 Eric Blake <ebb9@byu.net>
5502 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
5505 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
5507 * modules/format.c (includes): Use xvasprintf.h.
5508 (format): Make static. Avoid buffer overflow, that can lead to
5509 arbitrary code execution exploit. Only pass unsigned char to
5510 is*(). Support F, g, and G specifiers.
5511 * doc/m4.texinfo (Format): Expose buffer overrun bug. Document
5514 2006-07-17 Gary V. Vaughan <gary@gnu.org>
5516 Ensure M4 compiles correctly with -DDEBUG, and use a single
5517 consistent definition of various /DEBUG_[A-Z]+/ symbols:
5519 * m4/input.c: Have commented out out DEBUG_INPUT only by default.
5520 (m4_print_token): Use m4_get_symbol_value_text and
5521 m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
5522 and VALUE_FUNC respectively.
5523 (m4__next_token): Use m4_print_token call instead of obsolescent
5525 * m4/module.c: Have commented out out DEBUG_MODULE only by default.
5526 * m4/output.c: Similarly for DEBUG_OUTPUT.
5527 * m4/path.c: Similarly for DEBUG_INCL.
5528 * m4/symtax.c: Similarly for DEBUG_SYM.
5529 * m4/syntax.c: Similarly for DEBUG_SYNTAX.
5530 * src/stackovf.c: Similarly for DEBUG_STACKOVF.
5531 * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
5532 preprocessor macros defined with -DDEBUG compiles.
5534 2006-07-17 Gary V. Vaughan <gary@gnu.org> (tiny change)
5536 * bootstrap: Correct typo in --download-po argument parsing.
5538 2006-07-15 Eric Blake <ebb9@byu.net>
5540 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
5542 * tests/generate.awk (normalize): Recognize @tabchar.
5543 * doc/m4.texinfo (Top): Start merging from branch. Remove tabs.
5544 Fix menus. Upgrade FDL license from 1.1 to 1.2. Fix overfull
5546 (Index macro, Shell commands, Incompatiblities): Rename nodes
5547 from Index, UNIX commands, Other incompat.
5548 (Platform macros, Using frozen files, Frozen file format 1)
5549 (Frozen file format 2, Copying This Manual, Indices): New nodes.
5550 * Makefile.am (EXTRA_DIST): Distribute gendocs.
5551 (MAINTAINERCLEANFILES): Clean up files from gnulib.
5552 (doc_m4_TEXINFOS): Depend on fdl.texi.
5553 (web-manual): New maintainer target.
5555 2006-07-14 Gary V. Vaughan <gary@gnu.org>
5557 * doc/m4.texinfo (Modules): RMS asked me for an explanation of
5558 the modular architecture of M4. The result is paraphrased here
5559 for the benefit of future readers of the manual.
5561 2006-07-14 Gary V. Vaughan <gary@gnu.org> (tiny change)
5563 * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
5565 2006-07-14 Eric Blake <ebb9@byu.net>
5567 * src/main.c (main): Avoid compiler warning.
5568 * modules/gnu.c (renamesyms): Remove unused variable.
5570 2006-07-14 Gary V. Vaughan <gary@gnu.org>
5572 * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
5573 (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
5574 new functions for managing regexp syntax options.
5575 * m4/m4private.h (m4): Add regexp_syntax field.
5576 * m4/resyntax.c: New file implements the above.
5577 * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
5578 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
5579 (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
5580 (m4_patsubst_do, m4_renamesyms_do): Removed.
5581 (builtin_changeresyntax): New builtin to change regular expression
5583 (m4_resyntax_encode_safe): Factor out diagnostics code.
5584 * src/freeze.c (produce_resyntax_dump): New function to dump
5585 default regexp syntax specifier to frozen file.
5586 (reload_frozen_state): Updated to action 'R' directive.
5587 * src/main.c (usage): Describe new -r option.
5588 (long_options, OPTSTRING): Declare it.
5589 (main): Encode and store cli regexp syntax option argument.
5590 * tests/freeze.at (regexp syntax): New test that regexp syntax
5592 * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
5593 * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
5594 (Epatsubst and Patsubst): Renamed to...
5595 (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
5596 documentation and added new examples.
5597 (Changeresyntax): New section describing changeresyntax builtin,
5598 and regexp syntax names.
5599 (Regular expression syntax): New section describing differences
5600 between various regular expression syntaxes.
5601 (Frozen files): Document 'R' directive.
5604 2006-07-13 Gary V. Vaughan <gary@gnu.org>
5606 * bootstrap: Enhanced to work more like our other scripts:
5607 Add a copyright statement; support --version and --help; accept a
5608 --download-po option with argument as a substitute for DOWNLOAD_PO
5611 2006-07-11 Eric Blake <ebb9@byu.net>
5613 * Makefile.am (doc/m4.1): Port patch from branch that avoids
5615 * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
5618 2006-07-10 Gary V. Vaughan <gary@gnu.org> (tiny change)
5620 * tests/builtin.at (patsubst, regexp): Adjust these tests, now
5621 that `\0' is no longer accepted.
5623 * src/main.c (usage): Alphabetize options within their sections.
5625 * modules/gnu.c (m4_regexp_search, regsub, substitute)
5626 (esyscmd): Improve comments.
5628 * modules/gnu.c (substitute): Remove old warning for \0.
5629 (substitute_warned): No longer required. Removed.
5631 * modules/gnu.c: Put macro definitions into alphabetical order.
5633 2006-07-07 Eric Blake <ebb9@byu.net>
5635 * tests/freeze.at (loading format 1): New file, with new test.
5636 * tests/testsuite.at: Include it.
5637 * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
5638 * tests/modules.at (Freezing modules): Likewise.
5640 * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
5641 (AC_CHECK_HEADERS): Assume signal.h.
5642 (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
5643 (AC_CHECK_FUNCS_ONCE): Likewise.
5644 * src/m4.h (includes): Assume signal.h.
5646 2006-07-05 Eric Blake <ebb9@byu.net>
5648 Fix all testsuite failures on cygwin.
5649 * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
5650 branch-1_4. Solves testsuite failure when uninstalled m4 is
5651 shadowed by redefinition of PATH in libtool wrapper.
5652 * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
5653 contains the -no-undefined required by cygwin.
5654 (TESTS_ENVIRONMENT): Export abs_top_builddir.
5655 * tests/others.at (misc): Port to platforms where /etc/passwd
5656 does not exist or does not contain user named root.
5657 * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
5659 * tests/builtins.at (define, divert): Avoid overquoting.
5660 * tests/generate.awk (new_group): Likewise.
5662 2006-07-05 Gary V. Vaughan <gary@gnu.org>
5664 The regs_allocated field in a struct re_pattern_buffer refers
5665 to the state of a particular re_registers struct when used in
5666 successive matches using the same compiled pattern. Avoid a
5667 SEGV in `renamesyms' resulting from using a new re_registers
5668 with an existing re_pattern_buffer:
5670 * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
5671 pattern buffer and registers.
5672 (m4_regexp_search): New function to call re_regexp_search with
5673 correctly matched pattern buffer and register instantiations.
5674 (m4_regexp_compile): Return an m4_pattern_buffer. Adust all
5677 2006-07-04 Gary V. Vaughan <gary@gnu.org>
5679 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
5680 changes to gnulib getopt.m4 since last build.
5681 * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
5682 if the system getopt fails M4_GETOPT tests.
5684 2006-06-22 Eric Blake <ebb9@byu.net>
5686 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
5687 Reported by Bruno Haible.
5689 2006-06-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5691 * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
5693 2006-06-19 Eric Blake <ebb9@byu.net>
5697 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5699 * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
5700 (clean-local): Split into and depend upon...
5701 (clean-local-tests, clean-local-src): ...these two. The latter
5702 removes the libtool object directory below `src', to work around
5703 a buglet in Automake, failing to list it.
5704 (EXTRA_DIST): Distribute modules/perl.c.
5706 2006-06-19 Eric Blake <ebb9@byu.net>
5708 * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
5709 right side of dependency; VPATH does that.
5710 (stamp-vcl): Update to use libtool's algorithm.
5711 (EXTRA_DIST): Distribute stamp-vcl.
5712 Reported by Ralf Wildenhues.
5713 (TESTSUITE): Revert earlier change that used absolute path, as
5714 that broke 'make dist' in VPATH. Stick with $(srcdir) instead.
5715 (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
5716 (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
5717 atlocal takes care of it instead.
5718 (check-local, installcheck-local, clean-local): Inline absolute
5719 path to testsuite here, rather than relative path to testsuite
5722 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5724 * m4/m4private.h (DELETE): Cast away const here...
5725 * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
5726 * src/freeze.c (reload_frozen_state): Avoid uninitialized
5729 2006-06-19 Eric Blake <ebb9@byu.net>
5731 * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
5732 .info pages are built.
5733 Reported by Ralf Wildenhues.
5734 (EXTRA_DIST): Inline definition of testsuite, so that make dist
5737 2006-06-16 Eric Blake <ebb9@byu.net>
5739 Follow recommendations from autoconf manual for autotest.
5740 * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
5741 turn it into an absolute path until autotest provides an option
5742 that allows us to avoid changing directories. Properly quote
5744 (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
5745 (check-recursive): Delete unused target.
5746 ($(TESTSUITE)): Atomically update testsuite.
5747 (CD_TESTDIR): Simplify.
5748 (m4__cd): Delete unused macro.
5749 (check-local): Let TESTSUITEFLAGS influence the run.
5750 (installcheck-local): Let TESTSUITEFLAGS override
5751 AUTOTEST_PATH. Add dependencies.
5752 (clean-local): Clean up.
5753 (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
5754 * README: Document how to use the testsuite.
5756 2006-06-15 Eric Blake <ebb9@byu.net>
5758 * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
5760 * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
5761 clashes with m4sugar.
5762 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
5763 * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
5764 * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
5765 * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
5766 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
5767 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
5768 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
5769 * configure.ac: Likewise.
5770 (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
5771 * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
5773 * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
5775 Reduce compiler warnings. Inside GMP, mpq_t is an array type, so
5776 const mpq_t is not assignable from plain mpq_t. Avoid
5777 type-punning warnings caused trying to mix these types.
5778 * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
5779 (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
5780 * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
5781 (mult_term, exp_term): Remove type-punning casts.
5782 (numb_pow): Remove const qualifier.
5783 * src/freeze.c (reload_frozen_state): Fix typo in messages.
5784 Fix variables that can be used uninitialized, which fixes
5785 security hole where malicious frozen file can execute arbitrary
5788 2006-06-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5790 * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
5792 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5793 and Eric Blake <ebb9@byu.net>
5795 Allow `make dist' to work again.
5796 * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
5797 (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
5798 (cvs-dist): Fix typo.
5799 * NEWS: Match current version number.
5801 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5803 * Makefile.am (AM_CPPFLAGS): Add $(LTDLINCL), so the right
5806 * bootstrap: Do not run libtoolize manually, this is done
5807 correctly by autoreconf. Invoke autoreconf with --no-recursive
5808 to avoid unnecessary rerunning of autotools for libltdl.
5810 2006-06-13 Eric Blake <ebb9@byu.net>
5814 2006-06-12 Eric Blake <ebb9@byu.net>
5816 * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
5818 * src/m4.h: Don't declare mktemp.
5819 * m4/input.c (m4__next_token): Avoid bzero.
5820 * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
5821 * Makefile.am (doc/m4.1): Depend on installed help2man, rather
5822 than distributing outdated helptoman.pl.
5823 * doc/helptoman.pl: Delete.
5825 2006-06-10 Eric Blake <ebb9@byu.net>
5827 * README (Patches): Document the current dependence on CVS
5828 builds of autotools.
5829 * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
5830 * configure.ac: Use consistent quoting throughout.
5831 (AC_PREREQ): Bump to 2.59d.
5832 (AC_INIT): Package name begins with uppercase.
5833 (AC_ARG_WITH): Use AS_HELP_STRING.
5834 (AM_INIT_AUTOMAKE): Enable gnits mode.
5835 (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
5836 (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
5837 (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
5838 done by gnulib or automake, or which autoconf has declared
5840 * m4/m4private.h (Includes): Assume C89 or better, and use errno
5842 * m4/output.c (Includes): Likewise.
5843 * modules/gnu.c (Includes): Likewise.
5844 * modules/m4.c (Includes): Likewise.
5845 * src/m4.h (Includes): Likewise.
5847 * README-alpha: Update web address.
5848 * README: Likewise. Change encoding to ASCII. Remove old advice
5849 about cygwin. Document bootstrapping dependency.
5850 * AUTHORS: Update from branch-1_4.
5851 * THANKS: Likewise. Change encoding to UTF-8.
5852 * BACKLOG: Delete. This file is too old and unmaintained to be
5854 * ChangeLog: Change encoding to UTF-8.
5856 Avoid compiler warnings.
5857 * m4/macro.c (trace_format): Don't mark this as a printf format,
5858 since we don't accept the same set of modifiers as printf. It
5859 would be nice if gcc let us specify a custom format archetype.
5860 * src/main.c (main): Cast away const.
5862 2006-06-10 Andreas Schwab <schwab@suse.de> (tiny change)
5863 Eric Blake <ebb9@byu.net>
5865 * modules/time.c (ctime): Pass correctly typed variable to
5868 (localtime): Likewise.
5869 (strftime): Likewise.
5870 * m4/utility.c (m4_numeric_arg): For now, document arbitrary
5871 limit inherent in this interface.
5873 2006-05-08 Bruno Haible <bruno@clisp.org> (tiny change)
5875 * modules/m4.c (WEXITSTATUS): Provide fallback definition.
5876 (sysval): Use WEXITSTATUS.
5877 * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
5878 big-endian and little-endian wait status definitions.
5880 2006-05-06 Eric Blake <ebb9@byu.net>
5882 * po/Makevars (MSGID_BUGS_ADDRESS): Add.
5883 * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
5886 2006-05-06 Eric Blake <ebb9@byu.net>
5888 * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
5889 subdirectory to use.
5890 (support for -pipe): Move after LT_INIT, since it relies on
5893 2006-05-05 Eric Blake <ebb9@byu.net>
5895 * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
5899 2006-05-05 Bruno Haible <bruno@clisp.org>
5900 and Eric Blake <ebb9@byu.net>
5902 * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
5903 * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
5905 * bootstrap: Update usage of gnulib-tool.
5907 2006-05-04 Eric Blake <ebb9@byu.net>
5909 * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
5912 2005-12-05 Gary V. Vaughan <gary@gnu.org>
5914 * bootstrap (func_update_po): Synch with CVS GNU tar. wget 1.9.x
5915 and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
5916 Reported by Eric Blake <ebb9@byu.net>
5918 2005-12-04 Gary V. Vaughan <gary@gnu.org>
5920 * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
5921 http caching as -C is no longer supported by wget 1.10.x.
5922 Reported by Eric Blake <ebb9@byu.net>
5924 2005-10-20 Gary V. Vaughan <gary@gnu.org>
5926 * m4/module.c (caller_id): To match libtool-2.0 interface, changed
5928 (iface_id): ...an lt_dlinterface_id type.
5929 (m4__module_find): New abstraction for lt_dlhandle_fetch. Use
5930 throughout, instead of calling obsolete lt_dlhandle_find directly.
5931 (m4__module_next): Use multiloader-safe lt_dlhandle_iterate. Use
5932 throughout, instead of calling obsolete lt_dlhandle_next.
5933 * m4/m4private.h (m4__module_find): Declare it.
5934 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
5935 Use m4__module_next instead of obsolete lt_dlhandle_next.
5937 2005-10-20 Gary V. Vaughan <gary@gnu.org>
5939 * bootstrap (func_update_po): Update pofiles directly from the
5940 translation project.
5941 * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
5942 po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
5943 these files under source control anymore.
5944 Suggested by Eric Blake <ebb9@byu.net>
5946 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
5948 * ltdl/m4/m4-gnulib.m4: Update FSF contact address. Somehow this
5949 file escaped the address updates on 2005-05-01.
5951 2005-07-07 Gary V. Vaughan <gary@gnu.org>
5953 * bootstrap: Allow user overriding of gnulib-tool location, and
5954 correctly determine module source directories whether gnulib-tool
5955 is given as a relative or absolute path, or is found by searching
5957 Reported by Eric Blake <ebb9@byu.net>
5959 2005-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5961 * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
5962 and $RM are defined for various versions of
5963 AC_LIBTOOL_COMPILER_OPTION.
5965 * bootstrap (AUTORECONF): New variable to allow user overriding of
5968 2005-07-07 Gary V. Vaughan <gary@gnu.org>
5970 * doc/m4.texinfo (History): Add better notes on the ancestory of
5971 GNU m4, and other historical interest.
5973 2005-05-08 Gary V. Vaughan <gary@gnu.org>
5975 * m4/symtab.c (m4_symbol_rename): New function that performs a low
5976 level symbol rename.
5977 * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
5978 * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
5979 (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
5981 (erenamesyms, renamesyms): ...builtins that use these to implement
5982 macro renaming by regular expression.
5983 * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
5984 * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
5985 to stop the new generated tests from choking.
5987 2005-05-07 Gary V. Vaughan <gary@gnu.org>
5989 Since most of the build is handled from a single Makefile.am now,
5990 we can teach make about the dependencies between the m4 binary and
5991 the preopened modules it is built against:
5993 * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
5995 * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
5996 of the preopened modules have changed.
5998 2005-05-07 Gary V. Vaughan <gary@gnu.org>
6000 * configure.ac (gl_MODULES): Add mkstemp for machines that don't
6001 have a native implementation.
6003 2005-05-06 Gary V. Vaughan <gary@gnu.org>
6005 * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed. These are
6006 handled already by gnu/exit.h.
6008 * configure.ac (gl_MODULES): Add assert to support a
6009 --disable-assert configure time option for NDEBUG setting.
6011 * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
6012 * bootstrap (src_modules): Add version-etc-fsf.
6013 * src/main.c (version_etc_copyright): Removed.
6015 * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
6017 2005-05-04 Gary V. Vaughan <gary@gnu.org>
6019 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
6021 * src/freeze.c (produce_frozen_state): Use \n line-endings even
6022 on Windows, so that the frozen file reader will work.
6023 Reported by Josef T. Burger <bolo@bolo.com>
6025 2005-05-04 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
6027 Forward port of a patch that allowed m4-1.4.2 to compile on
6030 * configure.ac (AC_CHECK_HEADERS): Add signal.h,
6032 * src/m4.h: And include them as appropriate.
6033 * src/main.c, src/stackovf.h: Don't include signal.h literally;
6034 m4.h will include the correct file.
6036 2005-05-04 Gary V. Vaughan <gary@gnu.org>
6038 * m4/m4private.h: Make errno visible for the sources patched
6041 2005-05-04 Paul Eggert <eggert@twinsun.com>
6043 * src/main.c (print_program_name_CB): Preserve errno, since
6044 M4ERROR relies on this.
6045 * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
6046 * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
6047 * m4/path.c (m4_path_search): Don't let "free" trash errno when
6050 * m4/output.c (m4_insert_file): Don't assume errno has a valid
6051 value simply because fread returns zero. This fixes a
6052 portability bug reported by Marion Hakanson in
6053 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
6055 2005-05-04 Santiago Vila <sanvila@debian.org>
6057 * tests/stackovf.test: Use tempfile if available.
6059 2005-05-04 Robert Bihlmeyer <robbe@orcus.priv.at> (tiny change)
6061 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
6062 * m4/output.c (m4_insert_file): Do not mix buffered and
6063 unbuffered I/O, as this breaks on the Hurd.
6065 2005-05-04 Gary V. Vaughan <gary@gnu.org>
6067 Gnulib has changed again. Reimport. Adjust. Rinse. Repeat.
6068 Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
6069 and libtoolize does a better job of ltdl importing now too, so
6070 take advantage of that while updating the tree:
6072 * acm4, config: Moved from here...
6073 * ltdl/m4, ltdl/config: ...to here.
6074 * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
6075 src/Makefile.am, tests/Makefile.am: Removed...
6076 * Makefile.am: ...and migrated to here, with adjustments to
6077 compensate for relative path differences.
6078 * commit: Adjust relative paths.
6079 * configure.ac: Adjust relative paths.
6080 (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
6082 (LT_PREREQ): 2.0 isn't released yet, but will work when it is! In
6083 the meanwhile, CVS HEAD libtool is needed.
6084 (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
6085 stricly new enough, we also need a patch.
6086 (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
6087 (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
6088 (gl_MODULES): Don't list getopt and version-etc, as they don't
6090 * bootstrap: After running gnulib-tool to import the listed
6091 modules, fetch getopt and version-etc into src manually.
6092 (ltdldir): Change to ltdl.
6093 * src/main.c: Adjust for changes in version-etc API.
6094 * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
6095 but works when the getopt module isn't to be included in the lib.
6096 * README: Add note about patching autoconf and automake to
6099 2005-05-02 Matt Kraai <kraai@debian.org> (tiny change)
6101 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
6102 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
6103 empty file rather than to a nonexistent file. This closes a
6104 common security hole.
6105 * modules/m4.c (m4_maketemp): Implement the above, by using
6106 mkstemp rather than mktemp.
6108 2005-05-01 Gary V. Vaughan <gary@gnu.org>
6110 The FSF are moving offices today. Changed their contact address
6111 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
6112 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
6114 2005-03-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
6116 * tests/Makefile (clean-local): Ignore testsuite cleanup
6119 2005-03-11 Per Bothner <per@bothner.com> (tiny change)
6121 * tests/Makefile (clean-local): Only run the testsuite cleanup
6122 if the testsuite has been generated.
6124 2005-02-11 Stepan Kasal <kasal@ucw.cz>
6126 * TODO: slight clarification of the example of qindir usage.
6128 2005-02-08 Gary V. Vaughan <gary@gnu.org>
6130 * TODO: Add qindir requirement, and defn bug.
6131 From Stepan Kasal <kasal@ucw.cz>
6133 2005-02-08 Stepan Kasal <kasal@ucw.cz>
6135 * TODO: Add ``execution stack'', fix a typo.
6136 * doc/m4.texinfo: Typos.
6138 2004-12-24 Eric Blake <ebb9@byu.net>
6140 * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
6141 to the gnu subdirectory.
6142 * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
6143 * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
6144 * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
6145 * m4/system_.h: Likewise, in non-configured includes.
6147 2004-10-14 Noah Misch <noah@cs.caltech.edu>,
6148 Gary V. Vaughan <gary@gnu.org>
6150 * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
6151 Protect definitions from macro expansion under -DNDEBUG by
6152 parenthesising the expanded function names.
6153 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
6154 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
6155 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
6156 (m4_is_syntax_macro_escaped): Similarly protect function
6157 definitions from macro expansion under -DNDEBUG by #undefing the
6158 matching macro names before each definition. Also, move all the
6159 function definitions to the end of the file so that any
6160 invocations in the rest of the file pick up the fast macro
6162 * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
6163 (m4_set_debug_file, m4_set_trace_messages)
6164 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
6165 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
6166 (m4_set_max_debug_arg_length_opt): New fast macro versions of the
6167 option setter functions.
6169 2004-09-23 Gary V. Vaughan <gary@gnu.org>
6171 * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
6174 2004-09-23 Gary V. Vaughan <gary@gnu.org>
6176 * src/main.c: Include gnulib files from the correct directory.
6178 * gnulib/*: Don't store any of the gnulib files in arch, as they
6179 generate spurious changes.
6180 * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
6181 gnulib macros now share our macro directory.
6182 (SUBDIRS): Descend into `gnu' rather than `gnulib'.
6183 * bootstrap: Call gnulib-tool to import from the gnulib tree.
6184 (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
6185 gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
6186 the gettext macros from autopoint that overwrite the gnulib-tool
6187 imported versions. Import sources and Makefile.am into the `gnu'
6188 directory. Changed all callers.
6189 * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
6190 gl_INIT): Call these gnulib-tool macros instead of the hardcoded
6191 for imported modules.
6192 * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
6193 acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
6194 hardcoding the gnulib macros they wrap.
6196 2004-07-15 Gary V. Vaughan <gary@gnu.org>
6198 Latest CVS libtool can preload modules in libraries, including
6199 its own module loaders! Tweak m4 so that it doesn't try to treat
6200 libltdl's module loaders as m4 modules when freezing and on exit:
6202 * gnulib/acm4/*.m4: Don't store these files in arch since they
6203 generate spurious changes.
6204 * bootstrap: Simplify initial libtoolize call, since CVS
6205 libtoolize is smarter these days.
6206 * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
6208 * m4/module.h (m4__module_exit): Missing declaration.
6209 * m4/m4private.h (m4__module_next): New function declaration.
6210 * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
6211 encapsulation. Changed all callers.
6212 (m4__module_interface): New function to verify m4 loadable module
6214 (m4__module_init): Register the interface validator.
6215 (m4__module_exit): Only close my own modules.
6216 * modules/m4.c (unistd.h): Provide missing declaration.
6217 (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
6218 (m4_expand_ranges): More missing declarations.
6219 * modules/modtest.c (export_test): Ditto.
6220 * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
6221 * src/main.c (main): Bump copyright year.
6222 * tests/modules.at: Fix sed syntax error.
6225 2004-06-17 Gary V. Vaughan <gary@gnu.org>
6227 Tweaking to enable compilation with latest CVS libtool and
6228 libltdl. We can't just dump the library files directly into the
6229 m4 directory anymore now that libltdl is built from pieces itself:
6231 * bootstrap: Rewritten to use latest libtoolize sanely, and to
6232 set up libltdl subdirectory.
6233 * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
6234 gnulib subdirectory's config.
6235 (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
6236 (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
6238 (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
6239 configure.ac, so use AC_WITH_LTDL instead.
6240 * Makefile.am (SUBDIRS): Add libltdl.
6241 * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated. gnulib now uses
6243 * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
6244 (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
6245 (libm4_la_LIBADD): Add LIBLTDL.
6246 * m4/ltdl.c, m4/ltdl.h: Removed.
6247 * m4/m4module.h: Include canonical ltdl.h.
6250 2004-06-14 Gary V. Vaughan <gary@gnu.org>
6252 * gnulib/import: Now updates makefile fragments, and configure.ac.
6253 * gnulib/m4/gnulib.am: New file. Generated makefile fragments.
6254 * gnulib/m4/Makefile.am: include it.
6255 * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
6256 gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
6257 gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
6258 gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
6259 gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
6260 * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
6261 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
6262 gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
6263 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
6264 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
6265 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
6266 gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
6267 gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
6269 * gnulib/m4/getopt_int.h: New source file from latest gnulib
6271 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
6272 gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
6273 gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
6274 gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
6275 Updated source files from latest gnulib.
6277 2004-02-29 Gary V. Vaughan <gary@gnu.org>
6279 * config/mailnotify: New file for mailing commit notifications,
6280 imported from cvs-utils.
6281 * commit: Updated from cvs-utils and tweaked for m4.
6283 2003-12-01 Gary V. Vaughan <gary@gnu.org>
6285 * config/mkstamp: Updated from CVS libtool.
6286 * configure.ac: Generate a gnu coding standards compliant version
6287 number, and use it for the banner.
6288 * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
6289 mhen the TIMESTAMP changes in ChangeLog, but the file modification
6290 time doesn't (e.g. in cvs commit). Otherwise dist tarballs will
6291 contain the previous version number.
6292 * src/main.c: Make --version output conform to the GNU standard.
6294 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
6295 * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
6296 m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
6297 shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
6298 time_la_SOURCES): ...so that these are defaulted correctly, and
6299 can be removed from this file.
6300 (AM_LDFLAGS): Add -module...
6301 (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
6302 traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
6303 import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
6304 the individual settings can be removed.
6305 * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
6306 * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
6307 m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
6308 shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
6309 time_la_LIBADD): ...so that these are picked up as a deplib of
6310 libm4 and don't need to be set explicitly.
6312 2003-11-18 Gary V. Vaughan <gary@gnu.org>
6314 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
6315 from the standard build. It is too fragile.
6317 * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
6318 CVS libtool after merging m4 changes across to libtool.
6320 * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
6321 * m4/path.c (search_path_add): Ditto.
6323 2003-11-13 Gary V. Vaughan <gary@gnu.org>
6325 * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
6326 libtool tags we don't use in configure. This reduces the size
6327 of the script from over 1Mb to under 700Kb.
6329 2003-11-13 Gary V. Vaughan <gary@gnu.org>
6331 The import script was not written properly, and the last gnulib
6332 import was incomplete. Fixed that problem, and reimport our
6333 gnulib dependencies, which picks up the address calculation
6334 overflow checks described by Paul below. Also tweak the clients
6335 of the gnulib xalloc module not to use deprecated macros:
6337 * gnulib/import: Recurse through module dependencies rather than
6338 naively descending only one level.
6339 * configure.ac: Add calls to gnulib's strnlen and extension module
6341 * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
6343 * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
6344 gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
6345 gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
6346 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
6348 * gnulib/acm4/libtool.m4: Updated from CVS libtool.
6349 * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
6350 place of `xcalloc (1, S)'.
6351 * m4/m4.c (m4_create): Likewise.
6352 * m4/m4private.h (m4_symbol_value_create): Likewise.
6353 * m4/symtab.c (symtab_fetch): Likewise.
6354 * m4/syntax.c (m4_syntax_create): Likewise.
6355 * src/freeze.c (reload_frozen_state): Likewise.
6356 * m4/path.c (search_path_add): Eliminate use of deprecated NEW
6358 * m4/symtab.c (m4_symtab_create): Likewise.
6360 2003-11-13 Gary V. Vaughan <gary@gnu.org>
6362 * tests/module.at: Comment typo.
6364 2003-10-10 Gary V. Vaughan <gary@gnu.org>
6366 * tests/modules.at (modules: importing): Apply some lateral
6367 thinking, and use AT_CHECK to compare the output of a sed pass
6368 over stderr against the canonical strerror string.
6370 * tests/modules.at (modules: importing): Edit the generated stderr
6371 output to canonicalize strerror output, before a comparison.
6373 2003-10-10 Gary V. Vaughan <gary@gnu.org>
6375 Tru64UNIX perl is sloppy with namespace pollution. This patch is
6376 careful not to trip over the mess:
6378 * modules/perl.c: Some builds of perl install headers that contain
6379 `#define try __builtin_try'. Be sure to undefine that macro
6380 before `m4/hash.h' gets included, which uses the `try' symbol.
6381 * m4/system_.h: Similarly for `bool'. Undefine `bool', `true' and
6382 `false' before including `stdbool.h'.
6383 (DELETE): This symbol is not in m4's namespace, and is in any
6384 case only used internally...
6385 * m4/m4private.h (DELETE): ...so move it to here.
6386 Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
6388 2003-10-08 Paul Eggert <eggert@twinsun.com>
6390 Don't use XMALLOC and XCALLOC. Once we install the
6391 corresponding patch into gnulib, this will fix some
6392 address-calculation overflow bugs on hosts where calloc (A, B)
6393 returns garbage when A*B overflows.
6395 * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
6396 maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
6397 xmalloc, XCALLOC with xcalloc.
6398 * m4/m4.c (m4_create): Likewise.
6399 * m4/m4private.h (m4_symbol_value_create): Likewise.
6400 * m4/output.c (m4_output_init): Likewise.
6401 * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
6402 * m4/syntax.c (remove_syntax_attribute): Likewise.
6403 * src/freeze.c (reload_frozen_state): Likewise.
6404 * src/main.c (main): Likewise.
6406 2003-10-07 Gary V. Vaughan <gary@gnu.org>
6408 * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
6409 gnulib/acm4 directories for aclocal m4 macros.
6410 * gnulib/Makefile.am (EXTRA_DIST): Removed.
6411 (MAINTAINERCLEANFILES): Add Makefile.in.
6412 * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
6414 * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
6415 * gnulib/import: New file. Temporary script for updating gnulib
6416 imported files, until gnulib-tool is working.
6417 * gnulib/config/codeset.m4, gnulib/config/error.m4,
6418 gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
6419 gnulib/config/getopt.m4, gnulib/config/gettext.m4,
6420 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
6421 gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
6422 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
6423 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
6424 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
6425 gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
6426 gnulib/config/nls.m4, gnulib/config/obstack.m4,
6427 gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
6428 gnulib/config/progtest.m4, gnulib/config/realloc.m4,
6429 gnulib/config/regex.m4, gnulib/config/restrict.m4.
6430 gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
6431 gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
6432 gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
6433 gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
6434 gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
6435 gnulib/config/xstrndup.m4: Removed.
6436 * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
6437 gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
6438 gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
6439 gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
6440 gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
6441 gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
6442 gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
6443 gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
6444 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
6445 gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
6446 gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
6447 gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
6448 gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
6449 gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
6450 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
6451 gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
6452 gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
6453 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
6454 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
6455 gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
6456 gnulib/import script.
6457 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
6458 gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
6459 gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
6460 gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
6461 gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
6462 gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
6463 gnulib with gnulib/import script.
6464 * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
6465 guards ready for gnulib-tool to autoupdate on import.
6466 * config/debug.m4, config/gmp.m4, config/m4-error.m4,
6467 config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
6468 config/stackovf.m4: Moved from here...
6469 * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
6470 acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
6471 acm4/stackovf.m4: ...to here, to separate aclocal macros from
6472 configure time helper scripts.
6473 * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
6474 * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
6475 m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
6476 src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
6478 * src/main.c (version_etc_copyright): Only output the current
6480 (version_etc): Call with new variadic API.
6482 2003-09-16 Gary V. Vaughan <gary@gnu.org>
6484 * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
6485 version-etc module from CVS gnulib.
6486 * po/POTFILES.in: Add gnulib/m4/version-etc.c.
6487 * src/Makefile.am: Build it.
6488 * src/main.c: Use it.
6490 * gnulib/m4/exit.h: Import exit module from CVS gnulib.
6491 * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
6492 * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
6495 2003-09-15 Charles Wilson <cygwin@cwilson.fastmail.fm>,
6496 Gary V. Vaughan <gary@gnu.org>
6498 * bootstrap: Separate options.
6499 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
6500 * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
6502 * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
6503 (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
6504 (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
6505 (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
6506 $(LTLIBINTL) for gettext support on cygwin.
6507 * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
6508 have $(LTLIBINTL) from the preloaded module la files.
6509 * README: Remove the warning about using --disable-nls on Windows
6512 2003-09-15 Gary V. Vaughan <gary@gnu.org>
6514 * gnulib/m4/regex.c: s/<regex.h>/"regex.h"/ or else the compiler
6515 picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
6518 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6520 * doc/STYLE: Document the gnulib header naming conventions, and
6522 * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
6523 gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
6524 gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
6526 * gnulib/m4/Makefile.am: Remove the rules to build these headers.
6528 * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
6529 module from CVS gnulib.
6530 * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
6531 (gl_FUNC_STRTOL): In favour of the module macro.
6533 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6535 Replace the getopt code with CVS gnulib getopt. The source files
6536 detect whether they are in a glibc environment and preprocess away
6537 all of the code if there is a system getopt, so we can compile
6538 them into the m4 executable unconditionally:
6540 * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
6541 gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
6542 * configure.ac (gl_GETOPT): Use this instead of homebrew inline
6544 * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
6546 * src/Makefile.am: Adjust.
6547 * src/main.c: Always include our shipped getopt.h.
6548 * po/POTFILES.in: Use new location of getopt.c.
6550 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6552 * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
6553 * config/Makefile.am: Removed. Automake 1.8 distributes the files
6554 in this directory automatically.
6555 * Makefile.am (EXTRA_DIST): Except config/mkstamp.
6557 * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
6559 * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
6561 * modules/Makefile.am (pkglibexecdir): Set it here.
6562 (pkgmodincdir): Renamed to pkgmodincludedir). Changed all clients.
6564 * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
6565 Import regex module from CVS gnulib.
6566 * gnulib/config/restrict.m4: Ditto for dependee module restrict.
6567 * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
6568 do extra substitutions for Makefile.
6569 * configure.ac: Use it.
6570 * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
6571 from regex_.h if necessary.
6572 * m4/system_.h: Include the correct version of regex.h.
6573 * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
6575 * po/POTFILES.in: Use new location of regex.c.
6577 * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
6578 realloc.c: automake distributes these files already.
6580 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6582 Replace the xstrzdup code by importing the xstrndup module from
6583 CVS gnulib, along with its dependencies: strndup and strnlen:
6585 * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
6586 gnulib/config/xstrndup.m4: Import xstrndup module from CVS
6588 * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
6589 gnulib/config/strndup.m4: Ditto wrt strndup.
6590 * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
6592 * gnulib/m4/Makefile.am: Add rules from newly imported modules.
6593 However, contrary to gnulib, we install xstrndup.h.
6594 * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
6595 * gnulib/lib/xstrzdup.c: Delete. This was never a gnulib file, it
6596 is an artifact of the old m4 portability layer.
6597 * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
6598 * m4/system_.h: Include xstrndup.h.
6599 * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
6601 2003-09-11 Gary V. Vaughan <gary@gnu.org>
6603 Reimport the latest xalloc module from CVS gnulib, and adjust the
6604 m4 sources to take advantage of xalloc xfree. Also create a new
6605 macro DELETE with the same semantics as the old m4 XFREE macro,
6606 and carefully tweak callers:
6608 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
6610 * m4/utility.c (xfree): Removed. This function is now supplied by
6612 * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
6613 * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
6614 * m4/symtab.c (m4_symtab_create): Ditto.
6615 * m4/system_.h: Removed XFREE redefine.
6616 (DELETE): New macro with same functionality as the original m4
6617 XFREE macro, but based on xalloc.h now. Changed all callers.
6618 * src/main.c (main): Use XMALLOC macro.
6619 * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
6621 * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
6623 2003-09-10 Gary V. Vaughan <gary@gnu.org>
6625 Import the xalloc module from CVS gnulib, along with its
6626 dependencies: exitfail, malloc and realloc. We had different
6627 semantics for our XFREE and a function xfree() not supplied by
6628 gnulib, so also a bit of work to keep everything running
6631 * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
6632 (gl_XALLOC): Use gnulib equivalents.
6633 * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
6634 gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
6635 * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
6636 * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
6638 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
6639 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
6640 * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
6642 (pkgincdir): Removed. Use pkgincludedir instead.
6643 * m4/m4private.h (XFREE): xfree already checks for NULL.
6644 * m4/system_.h: Use xalloc module, and remove macros already
6645 supplied by xalloc.h.
6646 * m4/utility.c (xfree): xalloc does not yet implement xfree, so
6647 moved the old definition from m4/xmalloc.c to here for now.
6649 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6651 Import the error and progname modules from CVS gnulib. Our old
6652 error.c subsumed the functionality of both, so a little adjustment
6653 was required to accomodate the split in sources. Also added more
6654 wrapper macros to choose between a system installed error.h or our
6655 shipped gnulib error module:
6657 * m4/error.c, m4/error.h: Removed.
6658 * m4/Makefile.am: Adjust.
6659 (pkgincdir): Removed. Use pkgincludedir instead.
6660 * m4/module.h, src/main.c: Don't include `m4/error.h'.
6661 * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
6663 * gnulib/m4/progname.c: Imported from CVS gnulib.
6664 * gnulib/m4/progname.h: Ditto.
6665 * src/main.c: Adjust to use progname module.
6666 * gnulib/m4/error.c: Imported from CVS gnulib.
6667 * gnulib/m4/error_.h: Ditto.
6668 * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
6669 if appropriate, and link a local error.h if the system version is
6671 (libgnu_la_SOURCES) Add progname module sources.
6672 * gnulib/config/error.m4: Imported from CVS gnulib.
6673 * gnulib/config/strerror_r.m4: Ditto.
6674 * config/m4-error.c: New file. Wrap gnulib error.m4 but arrange
6675 to have ERROR_H for Makefile substitutions and tell system.h
6676 whether the system error.h should be used, or a locally installed
6678 * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
6680 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6682 * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
6683 s/gettext_.h/gettext.h/.
6685 * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
6686 automake have been fixed.
6688 * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
6689 gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
6690 of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
6691 rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
6693 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6695 The gnulib obstack module requires the gnulib gettext module for
6696 systems that do not have GNU gettext installed. Because we use
6697 -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
6698 that directory incase it clashes with the system gettext.h. This
6699 delta uses gettext_.h and extra rules in the Makefile to make a
6700 link to gettext.h when needed:
6702 * Makefile.am (auxdir): Removed. No longer used.
6703 * configure.ac (ac_aux_dir): Removed AC_SUBST. No longer used.
6704 (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
6706 (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
6707 Makefile based build.
6708 (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
6709 of the macros are kept.
6710 * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
6711 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
6712 * config/Makefile (ACLOCAL_MACROS): Removed. Automake 1.7a
6713 distributes these automatically.
6714 * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
6715 warning from automake-1.7a.
6716 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
6717 m4_CHECK_DEBUGGING for consistency with gnulib prefixes. Changed
6719 * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
6720 wrt. m4_FUNC_OBSTACK.
6721 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
6722 wrt. m4_sys_STACKOVF.
6723 * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
6724 wrt. _m4_LIB_GMP, m4_LIB_GMP.
6725 (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
6726 namespace. Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
6728 * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
6729 * gnulib/m4/Makefile.am: Added a new block to make an appropriate
6730 gettext.h link on deficient systems.
6731 (pkginc_HEADERS): Mention $(GETTEXT_H).
6732 (EXTRA_HEADERS): Mention gettext.h.
6733 * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
6734 * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
6735 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
6736 gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
6737 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
6738 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
6739 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
6740 gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
6741 gnulib/config/po.m4, gnulib/config/progtest.m4,
6742 gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
6743 gnulib/config/ulonglong.m4: Imported from CVS gnulib.
6745 2003-09-05 Gary V. Vaughan <gary@gnu.org>
6747 We can't mirror the gnulib directory structure here, since we need
6748 to be able to eg. `#include <m4/obstack.h>' from our source files,
6749 which is much easier if the local obstack.h is created in a
6750 directory named m4. Rather than trying to symlink everything into
6751 the m4 directory, now we build a libtool convenience library from
6752 the sources we get from gnulib and link that with libm4.la:
6754 * gnulib/config/extensions.m4: Imported from CVS gnulib.
6755 * gnulib/config/unlocked-io.m4: Ditto.
6756 * gnulib/m4/unlocked-io.h: Ditto.
6757 * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
6758 gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
6759 * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
6760 gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
6761 * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
6762 * m4/Makefile.am: Adjust.
6763 * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
6764 macros we redistribute.
6765 * gnulib/m4/Makefile.am: New file. Build libgnu.la convenience
6766 library among others.
6767 (GNULIB_SRCS, GNULIB_MACROS): Removed.
6768 * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
6769 * config/m4-obstack.m4: Adjust.
6770 * po/POTFILES.in: Adjust.
6771 * configure.ac: Reformatting. Call newly imported gnulib macros.
6772 * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
6773 bogus calls of `#include "m4.h"'.
6774 * Makefile.am: INCLUDES has been deprecated in favour of
6776 * m4/Makefile.am: Ditto.
6777 * modules/Makefile.am: Ditto.
6778 * src/Makefile.am: Ditto.
6780 2003-09-05 Gary V. Vaughan <gary@gnu.org>
6782 * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
6784 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6786 Migrate the obstack support into the gnulib directories for easy
6787 synchronisation with upstream files in gnulib:
6789 * config/gnu-obstack.m4: Moved from here...
6790 * config/m4-obstack.m4: ...to here.
6791 * config/Makefile.am (SPECIFIC_MACROS): Adjust.
6792 * m4/obstack.c, m4/obstack_.h: Moved from here...
6793 * gnulib/obstack.c, gnulib/obstack.h: ...to here.
6794 * po/POTFILES.in: Adjust.
6795 * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
6796 * m4/Makefile.am: Add a whole new section to link the obstack
6797 sources from the gnulib tree if necessary.
6798 * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
6800 * config/m4-obstack.m4: Rewrite as a wrapper for
6801 gnulib/m4/obstack.m4.
6803 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6805 GNU M4 currently builds with a number of files adapted from
6806 upstream sources. Recently the gnulib project on savannah.gnu.org
6807 has pulled together a great many of these externally maintained
6808 files. This delta is the beginnings of isolating those files
6809 maintained in gnulib to make it easy to synchronise M4 with the
6810 upstream files prior to releases.
6812 * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
6814 (SUBDIRS): Added new gnulib subdirectory.
6815 * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
6816 * config/stdbool.m4: Moved from here...
6817 * gnulib/m4/stdbool.m4: ...to here.
6818 * m4/stdbool_.h: Moved from here...
6819 * gnulib/lib/stdbool_.h: ...to here.
6820 * gnulib/Makefile.am: New file. Make sure the gnulib tree is
6822 * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
6823 code to work with new stdbool_.h location.
6824 (gnulib_srcdir): New.
6826 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6828 * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
6829 (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
6831 (SPECIFIC_TOOLS): New variable. Moved mkstamp to here.
6832 (EXTRA_DIST): Use it.
6834 * bootstrap: CVS autoreconf leaves file droppings. Remove
6835 aclocal.m4t incase autoreconf doesn't.
6837 2003-08-29 Gary V. Vaughan <gary@gnu.org>
6839 * m4/gnu-obstack.h: Updated from CVS gnulib. For consistency with
6840 the other gnulib imports, renamed to m4/obstack_.h.
6841 * m4/obstack.c: Updated from CVS gnulib.
6842 * m4/Makefile.am (EXTRA_HEADERS): Adjust.
6843 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
6844 header tests from gnulib obstack module. AC_CONFIG_LINKS knows
6845 about vpath already, and $top_srcdir upsets CVS Automake, so the
6846 $top_srcdir reference was removed.
6848 * m4/system-h.in: For consistency with the gnulib imports, renamed
6850 * m4/Makefile (EXTRA_HEADERS): Adjust.
6851 * configure.ac (AC_CONFIG_FILES): Adjust.
6853 * m4/stdbool_.h: New file from gnulib for systems without their
6855 * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
6856 * config/stdbool.m4: New file. Macros from gnulib for same.
6857 * configure.ac: Use it.
6859 2003-08-27 Gary V. Vaughan <gary@gnu.org>
6861 * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
6862 * config/gmp.m4: Ditto.
6863 * config/gnu-obstack.m4: Ditto.
6864 * config/stackovf.m4: Ditto.
6865 * m4/builtin.c: Ditto.
6866 * m4/debug.c: Ditto.
6867 * m4/error.c: Ditto.
6868 * m4/error.h: Ditto.
6869 * m4/gnu-obstack.h: Ditto.
6872 * m4/input.c: Ditto.
6874 * m4/m4module.h: Ditto.
6875 * m4/m4private.h: Ditto.
6876 * m4/macro.c: Ditto.
6877 * m4/module.c: Ditto.
6878 * m4/obstack.c: Ditto.
6879 * m4/output.c: Ditto.
6881 * m4/regex.c: Ditto.
6882 * m4/regex.h: Ditto.
6883 * m4/strtol.c: Ditto.
6884 * m4/symtab.c: Ditto.
6885 * m4/syntax.c: Ditto.
6886 * m4/utility.c: Ditto.
6887 * m4/xmalloc.c: Ditto.
6888 * m4/xstrdup.c: Ditto.
6889 * m4/xstrzdup.c: Ditto.
6890 * modules/evalparse.c: Ditto.
6891 * modules/format.c: Ditto.
6892 * modules/gnu.c: Ditto.
6893 * modules/import.c: Ditto.
6894 * modules/load.c: Ditto.
6895 * modules/m4.c: Ditto.
6896 * modules/m4.h: Ditto.
6897 * modules/modtest.c: Ditto.
6898 * modules/mpeval.c: Ditto.
6899 * modules/perl.c: Ditto.
6900 * modules/shadow.c: Ditto.
6901 * modules/stdlib.c: Ditto.
6902 * modules/time.c: Ditto.
6903 * modules/traditional.c: Ditto.
6904 * src/freeze.c: Ditto.
6905 * src/getopt.c: Ditto.
6906 * src/getopt1.c: Ditto.
6908 * src/main.c: Ditto.
6909 * src/stackovf.c: Ditto.
6911 * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
6912 ac_default_headers is an autoconf internal variable.
6913 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
6914 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6916 * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
6917 * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
6920 2003-08-15 Gary V. Vaughan <gary@gnu.org>
6922 * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
6924 * system-h.in (m4_boolean): Removed in favour of using C99 bool if
6925 possible or faking one with a typedef. Changed all callers.
6927 2003-08-15 Gary V. Vaughan <gary@gnu.org>
6929 Still cleaning up the users' module API, by taking out the stuff
6930 that isn't used by any existing modules, and moving specialised
6931 functions out of libm4 and into the module they are used by.
6933 * m4/m4module.h (m4_skip_space): No need to export this. Moved...
6934 * m4/utility.c (m4_skip_space): ...to here the home of its only
6935 use, made static and renamed to `skip_space'. Changed all
6937 * m4/m4module.h (m4_expand_ranges): Removed prototype.
6938 * m4/utility.c (m4_expand_ranges): Moved definition from here...
6939 * modules/m4.c (m4_expand_ranges): ...to here, and exported using
6941 * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
6943 * modules/gnu.c (builtin_syntax): Import and use in this
6944 builtin implementation.
6945 * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
6947 * m4/macro.c (trace_flush): Except here where the macro is now
6949 * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6950 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
6952 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6953 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
6955 2003-08-14 Gary V. Vaughan <gary@gnu.org>
6957 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
6958 compiler based AC_CHECK_HEADER that was introduced in
6960 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6961 * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
6962 * configure.ac: Use renamed M4_AC_LIB_GMP.
6964 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
6965 macro that requires arguments! This stops the shell's bad
6966 substitution error at configure time.
6968 * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
6969 variables to the testsuite shell. Set the value of USE_GMP so
6970 that the gmp test will run!
6971 (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
6973 2003-08-11 Gary V. Vaughan <gary@gnu.org>
6975 Libltdl already has an excellent mechanism for accessing C symbols
6976 in modules. Lets use that! Remove all the exporting cruft and
6977 just use lt_dlsym in conjunction with a few conventions to
6978 simplify module writers' jobs. Also removed the table address
6979 caching code and otherwise simplified the module loader quite a
6980 bit. To access exported symbols in other modules, first the
6981 exporting module must name the symbols <modname>_LTX_<symname>,
6982 and the importing module must define a function type called
6983 <symname>_func. The importer then adds
6984 M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
6985 that wishes to call out to the exported functions. Care must be
6986 taken that <symname> is non-NULL in the importing module incase
6987 M4_MODULE_IMPORT fails, but otherwise it can be called as if the
6988 definition was in the importers source. Study
6989 `modules/{gnu.c,m4.{c,h}' for a model example. At the moment,
6990 m4_module_import will attempt to automatically load a module
6991 required for symbol access if it is not loaded already.
6993 * TODO: Removed the items fixed in this delta.
6994 * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
6996 * m4/ltdl.h (lt_dlhandle_find): Declare it.
6997 * m4/module.c (m4_module_unload): Use it.
6998 * src/freeze.c (reload_frozen_state): Ditto.
6999 * m4/m4module.h (m4_export): Deleted. Removed all references.
7000 (M4_MODULE_IMPORT): New user convenience macro for importing
7001 arbitrary symbols from other modules.
7002 * m4/module.c (m4_module_import): New function to service
7003 M4_MODULE_IMPORT macro.
7004 (module_data): Removed. Looking up the tables on demand with
7005 lt_dlsym, rather than caching their addresses here simplifies the
7007 (m4_get_module_builtin_table, m4_get_module_macro_table):
7008 Removed. Changed all callers.
7009 (set_module_macro_table, set_module_builtin_table): Renamed to
7010 install_macro_table and install_builtin_table respectively, and
7011 simplified now that the cache is no more.
7012 * modules/gnu.c (builtin_symbols): Use this new mechanism to
7013 import m4_dump_symbols from the m4 module.
7014 (builtin_esyscmd): Likewise for m4_set_sysval and
7016 * modules/m4.c (m4_export_table): Removed. Functions are
7017 addressed with the new mechanism which doesn't need this.
7018 (m4_set_sysval): New exported accessor function to prevent
7019 problems with variable access on inferior architectures.
7020 * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
7021 (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
7022 that we can have some type safety.
7023 * modules/modtest.c (export_test): C level exported function for
7024 testing the new import mechanism.
7025 * modules/import.c: New file for the import end of the test.
7026 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
7027 * tests/modules.at: New test cases for intermodule symbol
7030 2003-08-07 Gary V. Vaughan <gary@gnu.org>
7032 * m4/m4module.c (m4_string): Moved from here...
7033 * m4/m4private.c (m4_string): ...to here.
7035 * m4/utility.c (dumpdef_cmp): Removed stale declaration.
7037 2003-07-29 Gary V. Vaughan <gary@gnu.org>
7039 * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
7040 already available to module writers through
7041 m4_{get,set}_nesting_limit_opt(), so moved from here...
7042 * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
7043 (m4_create): Use it.
7045 2003-07-28 Gary V. Vaughan <gary@gnu.org>
7047 Aside from auditing path.c for m4module.h api obfuscation, this
7048 delta introduces the concept of private struct members in opaque
7049 data types to GNU m4: See the STYLE file for details.
7051 * TODO: Remind ourselves that a rewrite of path.c is needed.
7052 * m4/m4module.h (m4_search_path, struct m4_search_path_info):
7054 * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
7055 here and renamed. These type definitions are for internal api use
7056 only. Changed all callers.
7057 * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
7059 * m4/path.c (search_path_env_init, search_path_add): ...to here
7060 and renamed. These calls were never used outside this file.
7061 Changed all callers.
7062 (dirpath): Moved functionality of this static declaration...
7063 * m4/m4private.h (struct m4): ...to this new internal only
7064 search_path field. Changed all callers.
7065 (m4__get_search_path): Added new internal api accessor.
7066 * m4/path.c (m4_search_path_info_new): Removed. Not used.
7067 (m4_include_init): Removed...
7068 * m4/m4.c (m4_create): ...because the new m4 field is now
7070 (m4_delete): Recycle search_path memory.
7071 * src/main.c (main): Don't call m4_include_init now that it's
7073 * doc/STYLE: Document convention for private fields in opaque
7076 2003-07-24 Gary V. Vaughan <gary@gnu.org>
7078 Sometimes exporting the address of a symbol from a module isn't
7079 enough for other modules to call that symbol correctly. If
7080 custom data types are used for function parameters, they need to
7081 be known to the caller. This change introduces the concept of
7082 $(prefix)/include/modules/$(modulename).h to declare those
7083 structures. Also we move m4_dump_symbols from libm4 to the m4
7084 module to show this concept in action.
7086 * m4/m4module.h (m4_dump_symbol_data): Moved from here...
7087 * modules/m4.h (m4_dump_symbol_data): ...to this new file for
7088 exporting data structures from modules/m4.c.
7089 * modules/m4.c, modules/gnu.c: Include it.
7090 * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
7091 * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
7093 * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
7095 * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
7096 ...to here, with slight renaming.
7097 (m4_export_table): Prototype and add m4_dump_symbols.
7098 * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
7099 definition of m4_dump_symbols.
7100 * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
7101 * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
7103 2003-07-24 Gary V. Vaughan <gary@gnu.org>
7105 Create an export table in modules/m4.c in readiness for beefing up
7106 the module loader to track module exports and imports.
7108 * m4/m4module.h (m4_debug_flush_files): Removed prototype.
7109 * m4/debug.c (m4_debug_flush_files): Moved...
7110 * modules/m4.c (m4_sysval_flush): ...to here and renamed.
7111 * modules/gnu.c (builtin_esysval): Use it.
7112 * m4/m4module.h (m4_export): New type for declaring module symbols
7114 * modules/m4.c (m4_export_table): List symbols exported from this
7115 module for use by other modules.
7117 2003-07-24 Gary V. Vaughan <gary@gnu.org>
7119 An experiment: There is loads of code in libm4 which should be in
7120 the m4 module, but is also used by another module. Just because
7121 some linkers won't cope with calls across dynamic runtime loaded
7122 objects I initially left the code in libm4. It will tidy the
7123 module api immensely if this code moves to the right place, I just
7124 need to remember to invent a suitable calling mechanism at some
7125 point. For now, only modules that are statically linked and
7126 preloaded will get this treatment, so the only platforms that will
7127 break are those that require all symbols to be resolved at link
7130 * TODO: Reminder that what I am doing could reduce portability
7131 unless I do something more robust later.
7132 * m4/m4module.h (m4_sysval): No longer exported from libm4.
7133 * m4/utility.c (m4_sysval): No longer declared in libm4.
7134 * modules/Makefile.am: Reformatting.
7135 * modules/m4.c (m4_sysval): Declare it at place of use.
7136 * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
7138 2003-07-23 Gary V. Vaughan <gary@gnu.org>
7140 * m4/m4module.h: Reformatting and rearranging lines a bit.
7141 (m4_obstack): Save typing by typedefing `struct obstack'. Changed
7143 (m4_call_macro, m4_expand_input): Renamed...
7144 (m4_macro_call, m4_macro_expand_input): ...to these. Changed all
7146 (m4_expansion_level, m4_process_macro): Moved...
7147 * m4/macro.c (expansion_level, process_macro): ...to here, and
7150 * m4/m4module.h (program_name): Not used by modules at all, so
7152 * src/main.c (program_name): ...to here.
7153 (print_program_name): Renamed...
7154 (print_program_name_CB): ...to conform to the STYLE guide.
7156 2003-07-23 Gary V. Vaughan <gary@gnu.org>
7158 More refactoring of the m4module.h API. Replace #defines with an
7159 enum, and move non-public functions out of the public API.
7161 * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
7163 * m4/macro.c (stdarg.h): Add ANSI C variadic header.
7164 * m4/debug.c (m4_debug, trace): Moved...
7165 * m4/m4private.h (struct m4): ...to fields of this struct.
7166 (m4_get_debug_file, m4_get_trace_messages): New fast access macros
7168 * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
7169 * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
7170 * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
7171 * m4/m4module.h (m4_context_field_table): Add entries for new
7172 debug_file and trace_messages fields.
7173 (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
7174 (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
7175 (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
7176 (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
7177 (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
7178 (m4_is_debug_bit): New macro to simplfy checks against the debug
7180 (m4_trace_format, m4_trace_header, m4_trace_flush)
7181 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
7183 * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
7184 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
7185 * m4/macro.c (trace_format, trace_header, trace_flush)
7186 (trace_prepre, trace_pre, trace_post): ...to these newly static
7187 functions, since they are only ever used from this file. Changed
7190 2003-07-17 Gary V. Vaughan <gary@gnu.org>
7192 Change the macros for checking syntax so that matching against
7193 multiple possible syntax classes can be done with a single
7194 comparison some of the time. The various classes are now bits of
7195 an int that can be checked with bitwise logic operators.
7197 * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
7198 (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
7199 (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
7200 (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
7201 (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
7202 (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
7203 (M4_SYNTAX_ALNUM): Removed. Changed all callers.
7204 (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
7205 (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
7206 (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
7207 (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
7208 Replace all calls with invocations of these...
7209 (m4_is_syntax, m4_has_syntax): ...New macros.
7210 * src/freeze.c (produce_syntax_dump): Remove mask argument, which
7211 is no longer required with new macros. Changed all callers.
7213 2003-07-15 Gary V. Vaughan <gary@gnu.org>
7215 * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
7216 values are returned as part of the internal interface, so they
7218 * m4/private.h: ...to here.
7219 * m4/macro.c (expand_token): Check for out of range
7220 m4_peek_input() results before looking up in the syntax table.
7221 (collect_arguments): Ditto.
7223 * NEWS: Note `$' syntax class.
7225 2003-07-08 Paul Eggert <eggert@twinsun.com> and
7226 Gary V. Vaughan <gary@gnu.org>
7228 Conform to POSIX if the POSIXLY_CORRECT environment is set.
7229 --traditional `define' now smashes all the definitions.
7231 * NEWS: Explain this.
7232 * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
7233 (Extensions): Explain that extensions that are incompatible with
7234 POSIX are disabled if POSIXLY_CORRECT is set.
7235 (Incompatibilities): Remove.
7236 (Define, Other Incompat): Explain difference
7237 between GNU and POSIX behavior of define, pushdef, popdef.
7238 * m4/m4.c (m4_get_posixly_correct_opt): New undef.
7239 * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
7240 * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
7241 (m4_get_posixly_correct_opt): New macro.
7242 * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
7244 * modules/m4.c (builtin_functions): defn now takes any number of args.
7245 (builtin_define): Smash all the definitions if
7247 (builtin_defn)): Allow any number of arguments.
7248 (builtin_undivert): Do not allow nonnumeric arguments
7250 * src/main.c (main): Set posixly-correct behavior if either
7251 POSIXLY_CORRECT is set, or if -G is given.
7252 * tests/builtins.at: New test for smashed definitions.
7254 2003-06-27 Gary V. Vaughan <gary@gnu.org>
7256 * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
7257 * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
7258 not to slow the parser down.
7259 (M4__IS_STRING): New macro to test string syntax class membership.
7260 * m4/syntax.c: Adjust docucomment.
7261 (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
7262 (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
7263 * m4/input.c (init_builtin_token): Comment typo.
7264 (m4__next_token): Comment typo.
7265 Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
7266 by using the new M4__IS_STRING macro.
7267 * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
7268 variable references in macro expansions.
7270 * doc/m4.texinfo (Eregexp and Regexp): Typo.
7271 (Epatsubst and Patsubst): Typo.
7274 2003-06-26 Gary V. Vaughan <gary@gnu.org>
7276 Move the global variables that pertain to syntax to a new `struct
7277 m4_syntax_table', and then add one of these to `struct m4'. The
7278 ripple effect through the code to both change formerly global
7279 references, and make sure a suitable context is available in
7280 lexical scope is disproportionately large compared to the size of
7281 the change proper. This change is a large part of decoupling
7282 syntax.c from the rest of the code that uses it.
7284 * m4/m4private.h (struct m4): Add a syntax field.
7285 * m4/m4.c (m4_create): Initialise it,
7286 (m4_delete): Recycle it.
7287 (m4_get_symtab): Remove hand coded version...
7288 (m4_get_symbol_table): ...and generate this with cpp. Changed all
7290 * m4/m4module.h (m4_context_field_table): Add an extra field so we
7291 can generate m4_get_symbol_table. Add a new row for
7292 m4_get_syntax_table.
7293 (M4SYNTAX): Syntactic sugar for module writers.
7294 (m4_symtab): Renamed to m4_symbol_table. Changed all callers.
7295 (m4_syntax_table): New home for syntax related formerly global
7297 * m4/m4private.h (struct m4_syntax_table): Define it.
7298 * m4/input.c (m4_input_init): Initialisation of these formerly
7299 global variables moved...
7300 * m4/syntax.c (m4_syntax_create): ...to here.
7301 * m4/input.c (m4_input_exit): And similarly, recycling of the
7302 memory used by those values moved...
7303 * m4/syntax.c (m4_syntax_delete): ...to here.
7304 * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
7305 Moved to m4/m4private.h.
7306 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
7307 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
7308 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
7309 (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
7310 objects. Changed all callers that used to directly access the
7312 (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
7313 Removed and incorporated into m4_syntax_table structure.
7314 * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
7315 * m4/syntax.c (m4_set_syntax): Now returns an error status,
7316 instead of requiring a `struct m4' to generate its own errors.
7317 Changed all callers.
7318 * src/main.c (main): Now that the syntax table is initialised as
7319 part of m4_create, we have to manually wipe the syntax entries if
7320 we are about to read a frozen file.
7322 2003-06-26 Gary V. Vaughan <gary@gnu.org>
7324 * doc/STYLE: Added notes on callback naming schemes.
7326 * m4/module.c (m4_set_module_macro_table)
7327 (m4_set_module_builtin_table): Declarations weren't changed when
7328 definitions were renamed on 2003-06-19.
7330 * m4/hash.c (m4_hash_resize): ifdefed out. This function is
7331 neither used nor particularly appropriate since it exposes the
7332 internal workings of the hash module. I haven't yet decided
7333 whether to remove it entirely.
7335 2003-06-20 Gary V. Vaughan <gary@gnu.org>
7337 Two related changes, and a huge knockon effect throughout the
7338 source: Moved the option variables out of global space and into
7339 `struct m4'; made `m4_symtab' a real datatype, so that its api
7340 is not marred passing `struct m4' around just so it can decide
7341 whether to keep traced symbol names or not. Added setters and
7342 getters for the formerly global option variables, and obviously
7343 changed a vast number of functions to take a `struct m4' and use
7344 the getter funcs to find option values.
7346 * m4/utility.c (interactive, sync_output, debug_level)
7347 (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
7348 (max_debug_argument_length, warning_status, nesting_limit)
7349 (discard_comments): Removed.
7350 * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
7351 (debug_level, max_debug_argument_length, prefix_all_builtins)
7352 (suppress_warnings, discard_comments, interactive, sync_output):
7353 Removed from here...
7354 * m4/m4private.h (struct m4): ...and equivalent fields added to
7356 (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
7357 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
7358 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
7359 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
7360 (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
7361 macros for the new fields.
7362 * m4/m4module.h (m4_context_field_table)
7363 (m4_context_opt_bit_table): Helper macros used to generate
7364 prototypes, setters and getters for new option fields
7366 * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
7367 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
7368 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
7369 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
7370 (m4_get_interactive_opt, m4_get_sync_output_opt)
7371 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
7372 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
7373 (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
7374 (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
7375 (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
7376 setter and getter functions generated by cpp from
7377 m4_context_field_table and m4_context_opt_bit_table, exported as
7378 part of the module api. Changed all callers.
7379 * m4/symtab (struct m4_symtab): Used as the concrete type for
7381 (m4_symtab_create): Allocate and initialise a new struct.
7382 (m4_symtab_apply): New function that works like m4_hash_apply, but
7383 with different callbacks specific to symbol tables. Changed all
7385 (symbol_destroy, arg_destroy, arg_copy): Renamed
7386 symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
7387 they have unused parameters for a reason!
7388 (dump_symbol_CB): New callback to dump the contents of a single
7390 (symtob_dump): Rewritten in terms of dump_symbol_CB.
7391 * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
7392 Changed all callers.
7393 * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
7394 of the contained `m4_symtab' at the `no_gnu_extensions' field.
7395 Although I'm not convinced these semantics are correct, they are
7396 at least consistent with how things were before this delta. Also
7397 set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
7399 2003-06-19 Gary V. Vaughan <gary@gnu.org>
7401 Tie down the interface to libm4 some more. Make more structures
7402 opaque to modules by moving them to m4private.h, and writing
7403 setters and getters. To win back the speed penalty for doing this
7404 also wrote macroized versions that do know about structure layout
7405 in m4private.h and #include that file into modules when NDEBUG is
7406 defined at compile time. There are still some accessor macros in
7407 m4private.h that need to go, but that is not necessary to clean
7410 * m4/m4module.h (m4_symbol_type): Moved...
7411 * m4/m4private.h (m4__symbol_type): ...to here.
7412 * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
7413 (m4_set_symbol_traced, m4_set_symbol_name_traced)
7414 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
7415 (m4_get_symbol_func, m4_symbol_value_create)
7416 (m4_symbol_value_delete, m4_set_symbol_value_text)
7417 (m4_set_symbol_value_func): New exported api to symbols.
7418 (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
7419 and m4_is_symbol_value_func.
7420 * m4/m4module.h: Prototype these guys.
7421 * m4/module.c (m4_set_module_macro_table)
7422 (m4_set_module_builtin_table): Make these static, there is no
7423 reason to pollute the api with them.
7424 * m4/m4private.h: Reformatting.
7425 (m4_get_symtab): Only define when NDEBUG is defined.
7426 (m4_get_symbol_value, m4_get_symbol_traced)
7427 (m4_set_symbol_traced, m4_set_symbol_name_traced)
7428 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
7429 (m4_get_symbol_func, m4_symbol_value_create)
7430 (m4_symbol_value_delete, m4_set_symbol_value_text)
7431 (m4_set_symbol_value_func): Macro implementations of the new
7432 functions when NDEBUG is defined.
7433 (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
7434 (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
7435 Superceded by the above. All callers changed.
7436 (M4ARG): Removed. This is no longer different to the
7437 m4/m4module.h definition.
7438 * modules/gnu.c, modules/m4.c: Only include m4private.h when
7439 NDEBUG is defined. That way we exercise the same (albeit slower)
7440 api that external modules must use.
7442 2003-06-18 Gary V. Vaughan <gary@gnu.org>
7444 Renamed some of the types and their accessors to make more sense.
7445 Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
7446 has a stack of SYMBOL_VALUEs.
7448 * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
7449 (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
7450 m4_get_symbol_value_type, m4_get_symbol_value_text,
7451 m4_get_symbol_value_func and m4_symbol_value_copy respectively.
7452 Changed all callers.
7453 (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
7454 (m4_get_token_type): Renamed
7455 * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
7456 to the internal api.
7457 * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
7459 (m4__symtab_init, m4__symtab_exit): Removed prototypes.
7460 (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
7461 (m4__token_type): Moved here from m4module.h.
7462 (m4__next_token): Renamed from m4_next_token.
7463 * m4/symtab.c: Removed some of the parameterised macro support
7464 functions for modularisation later.
7465 (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
7466 m4_hash_dup to perform a true deep copy of the SRC.
7467 (arg_copy): Callback for m4_symbol_value_copy.
7468 * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
7469 Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
7470 m4_get_symbol_value_func. Changed all callers.
7472 2003-06-18 Gary V. Vaughan <gary@gnu.org>
7474 Tidy up style of hash.[ch] in accordance with doc/STYLE.
7476 * m4/hash.c: Internal symbol renaming and formatting.
7477 (m4_hash_dup): New function to facilitate deep copies of hash
7479 (m4_hash_apply_func): Returns a void* now, which is a richer type
7480 for returning exceptions (NULL means keep going).
7481 (m4_hash_apply): Ditto.
7482 * m4/hash.h: Declare exported symbols with an explicit extern.
7485 2003-06-17 Gary V. Vaughan <gary@gnu.org>
7487 Still refactoring furiously. This delta represents a change in
7488 semantics to symtab.c. Instead of building temporary m4_tokens
7489 in the caller, and copying fields in the methods, we now create
7490 the actual m4_token for hashing in the caller so the methods just
7491 slot them in directly. Also, this means that we don't lookup a
7492 symbol and get back an allocated but VOID token to copy fields
7493 into, we create the token we want to push and pass that to
7494 m4_symbol_define or m4_symbol_pushdef. And that's it. There are
7495 a few other small changes to stop knowledge of the implementation
7496 of symtab.c leaking out into other files.
7498 * m4/macro.c (expand_argument): Comment typo corrected.
7499 * m4/symtab.c (symtab_fetch): New function to fetch the address of
7501 (m4_symbol_pushdef): Take an extra value parameter and use this
7502 directly as the new top of the value stack. All callers changed
7503 to build a token and pass responsibility for memory in, rather
7504 than copying as we used to.
7505 (m4_symbol_define): Also use the new value parameter directly as a
7506 replacement for the top of the value stack. All callers changed
7507 to build a token as above.
7508 (m4_set_symbol_traced): New function to set the traced bit on the
7509 named symbol, creating it if necessary.
7510 (symbol_popval): The guts of the old m4_symbol_popdef.
7511 (m4_symbol_popdef): Use it.
7512 * m4/builtin.c (m4_symbol_set_token): Removed,
7513 (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
7515 * m4/module.c (m4_set_module_builtin_table)
7516 (m4_set_module_macro_table): ...with these more orthogonal
7518 * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
7519 (m4_builtin_pushdef, m4_builtin_define): Removed. No longer
7521 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
7522 (m4_arg_signature_parse): Moved...
7523 * m4/symtab.c: ...to here.
7524 * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
7525 screw something up. Moved...
7526 * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
7527 actually does a proper deep copy of source to dest.
7529 2003-06-16 Gary V. Vaughan <gary@gnu.org>
7531 Further refactoring to stabilise the module API. Renaming some
7532 functions for orthogonality, and judicious definition migration to
7533 move things out of the set of exported symbols.
7535 * doc/STYLE: New file. Notes on coding style.
7536 * m4/m4module.c: Updated bitrotted docucomment at the top of the
7538 (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
7539 m4_get_module_name, m4_get_module_builtin_table,
7540 m4_get_module_macro_table which are verb phrases. Changed all
7542 * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
7544 * m4/module.c (m4_set_module_builtin_table)
7545 (m4_set_module_macro_table): ...here, and renamed. Changed all
7547 * m4/m4module.c (m4_module_data): This...
7548 * m4/m4private.c (struct m4_module_data): ...and this...
7549 * m4/module.c (module_data) ...consolidated here and no longer
7550 exported. Changed all callers.
7552 2003-06-16 Gary V. Vaughan <gary@gnu.org>
7554 Begin work on lifting the curse of the global variables. To start
7555 with create a `struct m4' context container, and replace
7556 `m4__symtab' with `context->symtab' throughout. This means
7557 initialising a context container in main, and adjusting many
7558 functions between main and the module entry points so that the
7559 container gets passed through. It would have been nice to
7560 defer this until after 1.5, but it has a major effect on the
7561 user's module writing ABI, so it needs to be addressed now - at
7562 least in the areas that impact the ABI. An interrelated change
7563 in the symtab API removes the dependency on a global symbol table,
7564 and instead focuses on a passed table (from the context
7567 * TODO: Reminders for finishing context functionality.
7568 * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
7569 * m4/m4.c: New file. Manage new struct m4 objects to eliminate
7570 global variables and eventually allow m4 to be reentrant.
7571 * m4/m4private.h (m4): Define the new structure here...
7572 (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
7573 don't carry the overhead of a function call.
7574 * m4/m4module.h: Prototype extern functions from m4/m4.c.
7575 (m4): Declare type for new struct m4 objects.
7576 (M4SYMTAB): User macro to ease finding the symbol table for the
7577 current context for module developers.
7578 (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
7580 (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
7581 (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
7582 (m4_call_macro, m4_dump_symbols, m4_expand_input)
7583 (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
7584 (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
7585 (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
7586 m4* context parameter. Changed definitions and all callers.
7587 (m4_symtab): Alias for m4_hash to decouple the
7588 m4_symtab api from m4_hash.
7589 (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
7591 (m4_symtab_create): New function to return an initialised
7593 (m4_symtab_delete): New function to delete an m4_symtab's memory.
7594 (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
7595 (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
7596 instead of simply using the global m4__symtab. Changed
7597 definitions and all callers.
7598 * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
7599 * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
7600 * src/main.c (main): Create a context and use that instead of the
7601 former global m4__symtab.
7603 2003-06-13 Gary V. Vaughan <gary@gnu.org>
7605 * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
7606 to the callback. Callbacks should not need to hardcode the
7607 hashtable they are working from, nor should we have to waste the
7608 userdata parameter to pass the table in.
7609 * m4/hash.h (m4_hash_apply_func): Require the initial table
7611 * m4/symtab.c (symtab_destroy): Use the passed table instead
7612 of hardcoding m4__symtab.
7613 (m4_symbol_popdef): Don't use the userdata parameter to pass the
7614 table to arg_destroy.
7615 (arg_destroy): Use the hash parameter, ignore userdata.
7616 * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
7618 (traceon, traceoff): Call set_trace with the extra initial
7621 2003-06-13 Gary V. Vaughan <gary@gnu.org>
7623 More refactoring to stabilise the module api, this time for
7624 symtab.c. Additionally, start to pay attention to function names
7625 that don't contain a verb like they should.
7627 * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
7628 wrapper for m4_hash_apply to decouple the symtab module from the
7630 (m4_symbol_builtin, m4_symbol_macro): Renamed to
7631 m4__symbol_set_builtin and m4__symbol_set_macro. Changed all
7633 (m4_symbol_delete): Create a macro version to save a function
7635 (m4_token_t, m4_data_t): These violate the POSIX reserved
7636 namespace. Renamed to m4_token_type and m4_symbol_type. Changed
7638 (m4_token_type): Renamed to m4_token_get_type.
7639 (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
7640 (m4_symtab_exit): Removed from the exported module
7642 * m4/m4private.h (m4__symtab, m4__symtab_init)
7643 (m4__symtab_remove_module_references, m4__symtab_exit): ...and
7644 renamed and added to the internal api. Changed all callers.
7645 (m4_symtab_apply): A faster macro version of the function for
7646 users of the internal api.
7647 * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
7648 symbol_destroy and arg_destroy.
7649 (symtab_debug): Added a prototype.
7650 (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
7651 so that callers in this file get the faster macro versions from
7654 2003-06-12 Gary V. Vaughan <gary@gnu.org>
7656 Refactoring modules to rationalise the API into an external
7657 documented (eventually!) API for use by modules in the `m4_'
7658 namespace declared in m4/m4module.h, an internal API between the
7659 source files we ship (including our shipped modules) in the `m4__'
7660 namespace declared in m4/m4private.h and making the rest as
7661 cohesive as possible with liberal use of the `static' keyword.
7662 This change represents an audit to m4/module.c along these
7665 * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
7666 Removed. No longer used.
7667 (m4_module_close): Removed prototypes.
7668 (m4_module_init, m4_module_open, m4_module_unload_all): Removed
7669 from the exported module api...
7670 * m4/m4private.h (m4__module_init, m4__module_open)
7671 (m4__module_exit): ...and renamed and added to the internal api.
7672 Changed all callers.
7673 (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
7674 Centralised definitions after renaming...
7675 * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
7676 (M4_FINISH_SYMBOL): ...and removing from here.
7677 (m4_module_dlerror, m4_module_remove, m4_module_close)
7678 (m4_caller_id): Not exported at all, so renamed to module_dlerror,
7679 module_remove, module_close and caller_id.
7680 (MODULE_SELF_NAME): New macro to make reporting self errors
7682 (m4_module_load, module_close, module_remove): Use it.
7683 * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
7685 * src/main.c (main): Use it.
7687 2003-06-12 Gary V. Vaughan <gary@gnu.org>
7689 * README: Remove references to --enable-changeword, which has been
7690 removed from the code.
7692 2003-06-11 Gary V. Vaughan <gary@gnu.org>
7694 Getting rid of the annoying bug with configure --enable-debug,
7695 which spewed -e: command not found errors. This was an interaction
7696 between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
7697 You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
7698 branch-1-5) to get the full fix.
7700 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
7701 of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
7702 and then use the probed value of $SED.
7703 (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
7704 this, it messes up the AC_REQUIRE stack.
7706 2003-06-10 Gary V. Vaughan <gary@gnu.org>
7708 * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
7709 the destroy callback.
7710 (m4_arg_destroy): Use the hash address to free the hash node key
7713 2003-06-06 Gary V. Vaughan <gary@gnu.org>
7715 First cut at formal parameters in macros.
7717 * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
7718 * m4/xstrzdup.c: New file.
7719 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
7720 associative array of parameter names to details.
7721 (m4_symbol_token): Capture macro names with parameter lists.
7722 (m4_arg_signature_parse): And build an associative array to hang
7723 from the symbol structure to map names to details.
7724 * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
7725 m4_hash_resize idiom. Now that we potentially add a little hash
7726 table to many of the entries in the symbol table, added an extra
7727 arg to set the initial size. Changed all callers.
7728 (m4_hash_apply): New function that is basically a generalised
7730 * m4/symtab.c (m4_symbol_apply): ...this. Now deleted. Adjusted
7731 all callers to call m4_hash_apply instead.
7732 (m4_arg_destroy): Recycle memory used by an m4_token_arg.
7733 (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
7734 m4_arg_signature association that might be attached to the symbol,
7735 * m4/hash.h (m4_hash_apply_func): Replacement type for...
7736 * m4/m4module.h (m4_symtab_apply_func): ...this. Now deleted.
7737 (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
7739 (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
7740 (M4_IS_IDENT): Detect characters that can be safely used in
7742 * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
7743 * m4/macro.c: Corrected grammar in some comments. Use `token'
7744 rather than `td' for m4_token variables.
7745 (m4_process_macro): If we find a dollar followed by some
7746 M4_IS_IDENT characters, replace that with the contents of the argv
7747 entry with offset stored in the m4_token_arg associated with the
7748 collected identifier.
7750 2003-06-05 Gary V. Vaughan <gary@gnu.org>
7752 Begin preparations for supporting formal parameters in m4 macros.
7754 * m4/m4private.h (struct m4_token_arg): Placeholder for holding
7755 the details of a formal parameter.
7756 (m4_token): Add an arg_signature member to hold a hash table for
7757 looking up formal parameters.
7758 * m4/input.c: Update more bitrotted comments.
7759 (m4_push_builtin): Initialise arg_signature member.
7760 (init_builtin_token): Copy arg_signature member.
7761 * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
7762 (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
7764 * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
7765 (m4_macro_pushdef, m4_macro_define): ...these, And...
7766 (m4_symbol_token): ...wrapped around this new function, which
7767 vastly simplifies the arguments required by the functions it
7769 Changed all callers.
7771 2003-06-05 Gary V. Vaughan <gary@gnu.org>
7773 * m4/macro.c: Format changes.
7775 2003-06-04 Gary V. Vaughan <gary@gnu.org>
7777 * m4/input.c: Updated various bitrotted comments.
7778 (m4_push_builtin): Just pass the whole m4_token, rather than
7779 extracting all the fields in the caller. This also allows us to
7780 check the token type for consistency.
7781 (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
7782 Renamed to builtin_funcs, builtin_peek, builtin_read,
7783 m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
7784 the code. Changed all callers.
7785 (struct input_block): Similarly renamed u_m member to u_b, and
7786 changed all callers.
7787 (m4_next_token): Use bzero to initialise the data fields.
7788 * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
7790 2003-05-29 Gary V. Vaughan <gary@gnu.org>
7792 These changes were necessary to get m4 to build on my iBook
7793 running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
7794 (GCC) 3.1 20020420 (prerelease)":
7796 * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
7797 inclusion of module loader headers.
7798 * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
7799 * m4/Makefile.am: Ditto.
7800 (libm4_la_LIBADD): Added $(LTLIBINTL).
7801 * m4/utility.c (program_name): Removed declaration in favour of
7802 the one already in error.c!
7803 * m4/m4module.h (program_name): Define to program_invocation_name
7804 when using GNU C library. Use an explicit extern declaration.
7805 (interactive, sync_output, debug_level, hash_table_size)
7806 (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
7807 (suppress_warnings, warning_status, nesting_limit, discard_comments)
7808 (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
7809 (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
7810 (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
7811 (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
7812 (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
7813 (m4_expansion_level, m4_expand_ranges, m4_expand_input)
7814 (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
7815 (m4_current_line, m4_current_diversion, m4_output_current_line):
7816 Don't rely on default, use an explicit extern.
7817 * m4/error.h (error, error_at_line, error_print_progname)
7818 (error_message_count, error_one_per_line): Ditto.
7819 * m4/ltdl.c: Update from CVS libtool.
7821 * commit: Update from CVS cvs-utils.
7823 2002-11-04 gettextize <bug-gnu-gettext@gnu.org>
7825 * po/Makefile.in.in: Upgrade to gettext-0.11.5.
7826 * po/boldquot.sed: New file, from gettext-0.11.5.
7827 * po/en@boldquot.header: New file, from gettext-0.11.5.
7828 * po/en@quot.header: New file, from gettext-0.11.5.
7829 * po/insert-header.sin: New file, from gettext-0.11.5.
7830 * po/quot.sed: New file, from gettext-0.11.5.
7831 * po/remove-potcdate.sin: New file, from gettext-0.11.5.
7832 * po/Rules-quot: New file, from gettext-0.11.5.
7834 2002-11-04 Akim Demaille <akim@epita.fr>
7836 * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
7838 * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
7840 2002-11-04 Akim Demaille <akim@epita.fr>
7842 * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
7844 2002-11-04 Akim Demaille <akim@epita.fr>
7846 * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
7847 used as `external', and Libtool 1.4.3.
7849 (LTLIBOBJS): Don't play with it.
7851 * Makefile.am (SUBDIRS): Remove intl.
7852 (ACLOCAL_AMFLAGS): Add -I config.
7853 (EXTRA_DIST): Add config/config.rpath.
7856 * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
7858 2002-05-29 Gary V. Vaughan <gary@gnu.org>
7860 Preparations for refactoring syntax tables to allow reverse
7861 lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
7862 speed of normal lookups in an array of unsigned short.
7864 * m4/input.c (single_quotes, single_comments, use_macro_escape):
7866 * m4/m4private.h (m4__single_quotes, m4__single_comments,
7867 m4__use_macro_escape): ...to here, and renamed. The `m4__' prefix
7868 is for internal symbols which unavoidably pollute the global
7869 namespace, but are not published APIs.
7870 Adjusted all callers.
7871 * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
7872 m4_set_comment, m4_set_syntax, set_syntax_internal,
7873 unset_syntax_attribute): Moved from this file...
7874 * m4/syntax.c: New. ...to this file.
7875 Also added an m4_syntax_exit stub for orthogonality.
7876 * src/main.c (main): Use it.
7877 * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
7878 * m4/m4module.h: Reformatting. New prototypes.
7880 2002-05-29 Gary V. Vaughan <gary@gnu.org>
7882 * bootstrap (aclocal_apiversion): The aclocal apiversion is
7883 distinct from the automake release number (in that the apiversion
7884 apparently has no micro-version-component).
7885 (aclocal_apilibdir): Use it.
7887 2002-05-28 Gary V. Vaughan <gary@gnu.org>
7889 * m4/hash.c (m4_hash_resize): New function.
7890 * m4/hash.h: Add prototype.
7891 * m4/symtab.c (m4_symtab_init): Use it. This could do with some
7892 benchmarking to find a good value for, say, autoconf. This is
7893 already a little quicker than before for me.
7895 * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
7896 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
7898 * m4/hash.h: Adjust prototypes.
7900 2002-01-22 Akim Demaille <akim@epita.fr>
7902 * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
7904 * tests/Makefile.am (package.m4): New.
7905 * tests/atlocal.in: Adjust to CVS Autotest.
7906 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
7907 * configure.ac: LIBOBJ is a forbidden string.
7908 Simplify AM_INIT_AUTOMAKE invocation.
7909 * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
7912 2002-01-21 gettextize <bug-gnu-utils@gnu.org>
7914 * po/Makefile.in.in: Upgrade to gettext-0.10.40.
7916 2001-10-19 Akim Demaille <akim@epita.fr>
7918 * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
7920 2001-10-19 Akim Demaille <akim@epita.fr>
7922 * m4/input.c (m4_next_token): Display where was opened what is
7925 2001-10-19 Akim Demaille <akim@epita.fr>
7927 * m4/macro.c (expand_argument): Display where was opened what is
7930 2001-10-18 Akim Demaille <akim@epita.fr>
7932 * m4/input.c, modules/m4.c: Formatting changes.
7934 2001-10-17 Gary V. Vaughan <gary@gnu.org>
7936 * bootstrap: s/configure.in/configure.ac/
7938 2001-10-16 Gary V. Vaughan <gary@gnu.org>
7940 * m4/symtab.c (m4_symbol_destroy): This function calls
7941 m4_symbol_popdef, which recycles a symbols memory when the last
7942 definition is popped. Since we were passing the address of the
7943 symbol name found in the symbol table, and it was being removed
7944 partway through m4_symbol_destroy() we were referencing freed
7945 memory for the balance of the function. Now we take a copy of the
7946 symbol name tring and use that as a key into the symbol
7947 table... that way if the original symbol name is freed, the copy
7950 2001-10-13 Akim Demaille <akim@epita.fr>
7952 * m4/ltdl.c: Update.
7954 2001-10-13 Akim Demaille <akim@epita.fr>
7956 * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
7957 Don't gettextize internal error messages.
7959 2001-10-13 Akim Demaille <akim@epita.fr>
7961 * tests/macros.at (Arity and defn): New failing test.
7962 (Arity, defn, and freeze): New.
7964 Fix `Arity and defn'.
7966 * m4/input.c (m4_push_macro): Don't forget the arity.
7967 * modules/m4.c (defn): Likewise.
7969 2001-10-13 Akim Demaille <akim@epita.fr>
7971 * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
7973 * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
7974 (Propagation of traceon, Propagation of --trace): this new file.
7976 2001-10-13 Akim Demaille <akim@epita.fr>
7978 * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
7979 interface instead of (name, argc...).
7980 Upon failure, specify which argument was guilty.
7983 2001-10-13 Akim Demaille <akim@epita.fr>
7985 * modules/evalparse.c: Save translators' time: don't translate
7986 internal error messages.
7987 (m4_evaluate): Simplify/normalize error messages.
7988 * doc/m4.texinfo (Eval): Adjust.
7990 2001-10-13 Akim Demaille <akim@epita.fr>
7992 * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
7993 where no checking is needed.
7994 * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
7995 interface instead of (name, argc...).
7997 * modules/gnu.c (m4_patsubst_do): Don't check argc, done
8000 2001-10-13 Akim Demaille <akim@epita.fr>
8002 * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
8003 exclude the builtin name from the count.
8004 * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
8005 calling ifelse with a single argument is valid.
8006 * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
8007 with 1 and 2 args, mostly to strengthen the test suite.
8009 2001-10-13 Akim Demaille <akim@epita.fr>
8011 * m4/output.c (m4_make_diversion, m4_insert_file)
8012 (m4_insert_diversion, +m4_freeze_diversions): Ansify.
8014 2001-10-12 Gary V. Vaughan <gary@gnu.org>
8016 * m4/input.c (init_builtin_token): Renamed from init_macro_token,
8017 since we call these things builtins in the rest of the code!
8019 * modules/gnu.c (m4_regexp_compile): s/%0/%s/
8021 2001-10-12 Gary V. Vaughan <gary@gnu.org>
8023 Rather than forcing each builtin definition to manage its own
8024 argument range checking, tabulate the maxima and minima for all
8025 builtins in each module. This forces us to consider what the
8026 valid ranges for each builtin should be, and moves the checking
8027 code out of each builtin implementation and into the builtin
8028 caller infrastructure.
8030 * m4/m4module.h (struct m4_builtin): Add argument minima and
8032 * m4/m4private.h (struct m4_token): Reflect them here too.
8033 * m4/input.c (struct input_block): ...and here.
8034 (m4_token_copy): New function for token copying.
8035 (init_macro_token): Copy them from a token to the input stack.
8036 (m4_next_token): Don't forget to initialise them for text
8038 * m4/macro.c (expand_argument): Use m4_token_copy, and also
8039 check argument counts before calling the builtin handler.
8040 * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
8041 (m4_symbol_macro): Likewise.
8042 * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
8043 parameters. Updated all callers.
8044 (m4_builtin_define): Ditto.
8045 (m4_macro_pushdef, m4_macro_define): Ditto.
8046 * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
8047 * modules/evalparse.c: Declare argument counts for defined
8048 builtins and remove explicit calls to m4_bad_argc().
8049 * modules/gnu.c: Ditto.
8050 * modules/load.c: Ditto.
8051 * modules/m4.c: Ditto.
8052 * modules/modtest.c: Ditto.
8053 * modules/mpeval.c: Ditto.
8054 * modules/perl.c: Ditto.
8055 * modules/shadow.c: Ditto.
8056 * modules/stdlib.c: Ditto.
8057 * modules/time.c: Ditto.
8060 2001-10-10 Gary V. Vaughan <gary@gnu.org>
8062 The trace semantics now attach the trace bit to a symbol name.
8063 For as long as a traceon(`foo') is active, calls to foo will be
8064 traced regardless of intervening undefines or module unloads.
8065 Fixed the flag propogation issues differently to the fixes
8066 reverted with the last attempt at nailing down trace:
8068 * m4/m4private.h: This file is not visible outside of the m4
8069 source tree, so I removed all the `M4_' and `m4_' prefixes to save
8070 on typing. Updated all clients.
8071 (m4_token): New typedef contains the fields that need to be passed
8072 around with the low level tokeniser.
8073 (m4_token_data): Removed.
8074 (m4_symbol): Now contains the traced flag again.
8075 * m4/symtab.c: Rewritten again. Now we don't remove symbols with
8076 the trace bit set. This change is contained entirely within this
8077 module and doesn't leak out into the callers. Updated all
8079 (m4_symbol_builtin, m4_symbol_macro): Adjusted to make use of the
8080 new fields in m4_token. Updated all clients.
8081 * m4/builtin.c (m4_builtin_pushdef): Needs a flags argument so
8082 that `groks_macro_args' and `blind_if_no_args' flags are retained
8083 when defn() results are passed around in m4 code. Updated all
8085 (m4_builtin_define): Ditto.
8086 (m4_macro_pushdef, m4_macro_define): Ditto.
8087 * m4/input.c (struct input_block): Add a flags field to facilitate
8089 (m4_push_macro): ...use it.
8090 (init_macro_token): Retrieve it.
8091 (m4_next_token): Initialise it.
8092 * m4/macro.c (expand_argument): Copy it.
8093 * m4/m4module.h: Adjust.
8094 * tests/builtins.at: Adjust the expected output of the trace
8095 tests to reflect the change in semantics.
8096 * tests/modules.at (modules: trace): Check that unloading a
8097 module which supplies a traced symbol definition doesn't lose te
8100 2001-10-07 Gary V. Vaughan <gary@gnu.org>
8102 * modules/gnu.c (m4_macro_table): Display the timetamp when
8103 expanding __m4_version__.
8105 * configure.ac (--with-modules): Forgot a comma in the
8106 AC_HELP_STRING parameter list.
8108 2001-10-05 Gary V. Vaughan <gary@gnu.org>
8110 * bootstrap: Remove aclocal.m4t when it is no longer required.
8112 2001-10-05 Akim Demaille <akim@epita.fr>
8114 * tests/Makefile.am: Adjust for gnuprog2.
8115 * tests/m4.in: There can be a leading path.
8116 * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
8117 * tests/testsuite.at: Adjust to the most recent Autotest.
8118 (AT_CHECK_M4_FILTER): Fix and rename as...
8120 * tests/others.at: Use it.
8122 * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
8123 variable in shell scripts, one uses `$'...
8125 2001-10-04 Gary V. Vaughan <gary@gnu.org>
8127 * configure.ac: `rm -f $m4_getopt_h' was lost.
8129 2001-10-04 Gary V. Vaughan <gary@gnu.org>
8131 * configure.ac (TIMESTAMP): Display with AS_BOX at configure
8132 time. Define it for config.h in order to...
8133 * src/main.c (main): ...display the timestamp for --version.
8135 2001-10-04 Akim Demaille <akim@epita.fr>
8137 * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
8138 previous builtins `regexp' and `patsubst'.
8139 (regexp, patsubst): Use them.
8140 (eregexp, epatsubst): New builtins.
8141 * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
8142 (Epatsubst and Patsubst, Eregexp and Regexp): these.
8143 (Extensions): More info on REs.
8145 2001-10-04 Akim Demaille <akim@epita.fr>
8147 * modules/modtest.c (init_handler): Consistently output to stderr.
8148 (finish_handler): New.
8149 (test): The `if' is an `assert'.
8150 * tests/modules.at: Adjust.
8152 2001-10-04 Akim Demaille <akim@epita.fr>
8154 * m4/utility.c (m4_bad_argc): Detail the mismatches.
8156 2001-10-01 Akim Demaille <akim@epita.fr>
8158 * tests/generate.awk: Tag the tests with `documentation'.
8159 * tests/modules.at (AT_CHECK_M4_MODTEST): New.
8160 Use the make the existing modtest tests more uniform, and complete
8161 the set of possibilities.
8163 2001-10-01 Akim Demaille <akim@epita.fr>
8165 * config/gmp.m4: Consult the user before using GMP: use
8167 * configure.ac: Adjust.
8168 * modules/gmp.c: No protection needed as the module is not built
8171 2001-10-01 Akim Demaille <akim@epita.fr>
8173 * tests/generate.awk: Remove debugging code.
8174 (fatal): Specify the current location.
8176 * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
8177 * modules/gnu.c, modules/m4.c: Use M4ARG.
8179 2001-10-01 Akim Demaille <akim@epita.fr>
8181 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
8182 (m4_regexp_compile): New.
8183 (regexp, patsubst): Use it.
8185 2001-09-30 Gary V. Vaughan <gary@gnu.org>
8187 Reinstate the memory handling improvements from the patch I just
8188 reverted. Relevant ChangeLog entries repeated here:
8190 * m4/module.c (m4_module_remove): New function that holds the core
8191 of the old m4_module_unload.
8192 (m4_module_unload): Use it.
8193 (m4_module_unload_all): When we know the modules will never be
8194 used again (i.e. on exit), free up as much module memory as
8195 possible. There are still some artifacts from resident modules
8196 living inside ltdl.c, but everything else is freed.
8197 * m4/debug.c (m4_debug_exit): Free memory allocated in
8199 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
8200 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
8201 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
8202 * m4/m4module.h: Updated prototypes.
8203 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
8204 * m4/hash.h: Updated prototypes.
8205 * src/main.c (main): Use all these new functions to clean up as
8206 much memory as possible before exit.
8208 2001-09-30 Gary V. Vaughan <gary@gnu.org>
8210 Reverted my large patch for removing the old m4_symbol
8211 structure on 2001-09-20. We are still not happy about the way
8212 trace works in conjunction with defn and undefine, and leaving
8213 the reverted patch active prevents us from moving the traced
8214 bit from the definition back to the symbol.
8216 2001-09-30 Gary V. Vaughan <gary@gnu.org>
8218 * configure.in: Moved to...
8219 * configure.ac: ...here. Added a libtool like timestamped
8220 banner, and tidied up the libltdl cruft.
8221 * config/mkstamp: Script to extract a timestamp from ChangeLog.
8222 * modules/Makefile.am (INCLTDL): Removed. This is required
8223 only when libltdl is configured in a subdirectory.
8224 * src/Makefile.am: Ditto.
8225 (LIBADD_DL): No need to add this again, libtool already knows
8226 that libm4.la depends on it.
8227 * m4/Makefile.am: Automake sets variables from AC_SUBST. Use
8230 * TODO: stackovf.c is basically broken.
8231 Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
8233 2001-09-28 Akim Demaille <akim@epita.fr>
8235 * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
8237 2001-09-27 Akim Demaille <akim@epita.fr>
8239 * tests/m4.in: Don't use short options.
8240 Simplify the stderr signature normalization.
8242 2001-09-27 Akim Demaille <akim@epita.fr>
8244 tests/m4 shall be position independent.
8248 * tests/testsuite.at: No args to AT_INIT.
8249 * configure.in, tests/Makefile.am: Adjust.
8251 2001-09-22 Akim Demaille <akim@epita.fr>
8253 Autotest has changed again.
8255 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
8256 (package.m4): Remove.
8257 * configure.in: Adjust to LIBADD_GMP.
8259 2001-09-21 Gary V. Vaughan <gary@gnu.org>
8261 * config/gmp.m4 (AC_ARG_WITH): Removed.
8262 (GMP_LIB): Renamed to LIBADD_GMP for consistency.
8263 (AC_LIB_GMP): When performing a test compile against libgmp,
8264 include the header gmp.h if possible, and link against -lgmp. If
8265 they both work define USE_GMP.
8266 * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
8267 (mpeval_LTX_init_func): Complain on load that there was no libgmp
8270 2001-09-20 Gary V. Vaughan <gary@gnu.org>
8272 * m4/evalparse.c: Moved to...
8273 * modules/evalparse.c: ...here. This code is shared between
8274 modules/mpeval.c and modules/m4.c, so there is no need to pollute
8275 the libm4 API with its details. Moderately rewritten to interface
8276 into its clients more simply.
8277 * m4/eval.c: Deleted. Migrated functionality to...
8278 * modules/m4.c: ...here.
8279 (builtin_eval): Implemented in terms of the new interface style.
8280 * modules/mpeval.c (builtin_mpeval): Ditto.
8281 * m4/m4module.h: Removed references to the former m4/eval.c.
8282 * m4/Makefile.am (libm4_la_SOURCES): Removed eval.c.
8283 (EXTRA_libm4_la_SOURCES): Deleted.
8284 * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
8285 (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
8287 2001-09-20 Akim Demaille <akim@epita.fr>
8289 * config/gmp.m4 (AM_WITH_GMP): Rename as...
8291 By default, use gmp.
8293 * configure.in: Adjust.
8294 Use Automake conditionals for USE_GMP.
8295 Always compute sizeof (long long int).
8296 This was a bug BTW, as `eval' (not `mpeval') depends on it:
8297 before, it was used _only_ if mpeval was not activated.
8298 * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
8299 (mpeval_la_LIBADD): New macros.
8300 * modules/mpeval.c: No longer be conditioned by WITH_GMP.
8302 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
8303 * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
8306 2001-09-20 Akim Demaille <akim@epita.fr>
8308 * tests/Makefile.am (package.m4): New.
8309 * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
8311 2001-09-20 Gary V. Vaughan <gary@gnu.org>
8313 More cleanup. After the last patch, m4_symbol holds nothing but
8314 the head of a chain of m4_token_data. So I have removed the old
8315 m4_symbol, so that m4_token_data chains are stored directly in the
8316 value cell of a hash table node. But there's more... m4_symbol
8317 was a more natural name for the symbol value cell, and now that it
8318 is gone I have renamed the former m4_token_data structure to
8319 m4_symbol. This change turned out to be a pig to get right, since
8320 the original code didn't need to modify the value cell itself,
8321 since changing the chain happened inside the m4_symbol that used
8322 to be returned -- I had to pass the address of the value cell
8323 across various function calls, incase the head value changed. I
8324 also tightened up the memory management to help me find a nasty
8325 memory corruption bug that took me all night to track down...
8327 * m4/m4private.h (struct m4_symbol): Removed.
8328 (struct m4_token_data): Renamed to `struct m4_symbol'. Updated
8330 * m4/hash.c (m4_hash_iterator_value): Return the address of the
8331 value cell. Updated all callers.
8332 * m4/symtab.c: Took advantage of the simplification in the data
8333 structures to rewrite a lot of this file more simply. There is
8334 still some room for optimisation here, but we should tackle that
8335 systematically closer to the release.
8337 * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
8338 revealed. This version is ahead of CVS libtool until I get chance
8339 to flush my changes.
8340 * m4/module.c (m4_module_remove): New function that holds the core
8341 of the old m4_module_unload.
8342 (m4_module_unload): Use it.
8343 (m4_module_unload_all): When we know the modules will never be
8344 used again (i.e. on exit), free up as much module memory as
8345 possible. There are still some artifacts from resident modules
8346 living inside ltdl.c, but everything else is freed.
8347 * m4/debug.c (m4_debug_exit): Free memory allocated in
8349 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
8350 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
8351 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
8352 * m4/m4module.h: Updated prototypes.
8353 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
8354 * m4/hash.h: Updated prototypes.
8355 * src/main.c (main): Use all these new functions to clean up as
8356 much memory as possible before exit.
8358 2001-09-18 Gary V. Vaughan <gary@gnu.org>
8360 The `traced' flag needs to be attached to the definition of a
8361 symbol rather than the current symbol containing the definition.
8362 Implementing this showed up some long standing post 1.4 bugs in
8363 flag propogation which I also fixed.
8365 * m4/m4private.h (struct m4_symbol): Remove the traced flag.
8366 (struct m4_token_data): And add it back in here.
8367 * m4/input.c (init_macro_token): Propogate the traced flag
8369 * m4/macro.c (expand_argument): Ditto.
8370 * tests/builtins.at (trace2, trace3): New tests based on Akim's
8373 2001-09-08 Gary V. Vaughan <gary@gnu.org>
8375 * m4/m4private.h (struct m4_token_data): Simplified by removing
8376 the redundant `traced' flag, and one level of structure nesting.
8377 (M4_TOKEN_DATA_FUNC_TRACED): Removed.
8378 * m4/input.c (init_macro_token): No need to initialise removed
8380 * m4/macro.c (expand_argument): No need to copy it either.
8381 * m4/utility.c (m4_token_data_func_traced): Or provide an access
8384 * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
8385 dependant on multiple symbols with the same key, so preserving
8386 relative symbol order in each bucket during resizing is no longer
8387 required. The resize function is considerably faster as a result.
8389 * m4/m4module.h, m4/builtin.c, m4/symtab.c:
8390 s/m4_symbol_insert/m4_symbol_define/g;
8391 s/m4_builtin_insert/m4_builtin_define/g;
8392 s/m4_macro_insert/m4_macro_define/g. Updated all callers.
8394 2001-09-08 Gary V. Vaughan <gary@gnu.org>
8396 Get rid of m4_symbol_lookup_t entirely. With Akim's earlier
8397 commits, the m4_lookup_symbol dispatch function is split into
8398 specialised functions that must be called directly.
8400 * m4/m4module.h (m4_symbol_lookup_t): Removed.
8401 * m4/symtab.c (m4_lookup_symbol): Removed.
8402 (m4_symbol_builtin, m4_symbol_macro): New functions.
8403 * m4/builtin.c (m4_builtin_define): Split into...
8404 (m4_builtin_pushdef, m4_builtin_insert): ...these.
8405 (m4_macro_define): Split into...
8406 (m4_macro_pushdef, m4_macro_insert): ...these.
8407 * src/main.c (main): Set command line macros from `-D' parameters
8408 using `m4_macro_define'.
8410 2001-09-08 Gary V. Vaughan <gary@gnu.org>
8412 * m4/symtab.c (m4_symtab_remove_module_references): Renamed as
8413 this from m4_remove_table_reference_symbols().
8414 * m4/m4module.h, m4/module.c: Updated all references.
8416 2001-09-07 Akim Demaille <akim@epita.fr>
8418 * modules/stdlib.c, modules/times.c: Misc cleanups.
8420 2001-09-07 Akim Demaille <akim@epita.fr>
8422 * configure.in: We now need Autoconf 2.52e.
8423 * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
8424 and `M4_SYMBOL_DELETE'.
8425 * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
8426 * src/main.c (main): Adjust.
8428 2001-09-06 Gary V. Vaughan <gary@gnu.org>
8430 Fix the obstack.h problem once and for all! At configure time we
8431 can test for a system supplied obstack.h: depending on the
8432 result, we now generate system.h with an #include of the correct
8433 header. As a bonus, I've also added a --with-included-obstack,
8434 incase the user doesn't like the system obstack for some
8435 reason... and also we can test the shipped obstack on a system
8436 that has oe of its own. We also now need to be careful to add
8437 build directories to the include search path, since the generated
8438 system.h will be in the build tree.
8440 * configure.in (AC_CONFIG_FILES): Generate system.h from
8442 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
8443 include the system obstack header or the copy shipped with M4.
8444 Allow the user to override configure and force the build to use
8445 the shipped version.
8446 * m4/system-h.in: New file, template for...
8447 * m4/system.h: ...this. Now deleted.
8448 * m4/m4module.h: Include system.h before everything else.
8449 * src/freeze.c: Ditto.
8450 * m4/Makefile.am (dist-hook): Remove generated system.h.
8451 (INCLUDES): Check builddir for generated headers before checking
8453 * modules/Makefile.am (INCLUDES): Ditto.
8454 * src/Makefile.am (INCLUDES): Ditto.
8456 2001-09-05 Gary V. Vaughan <gary@gnu.org>
8458 * TODO: Remove the items that have been addressed already.
8460 2001-09-05 Akim Demaille <akim@epita.fr>
8462 * src/main.c (main): Standardize --version.
8464 2001-09-05 Akim Demaille <akim@epita.fr>
8466 * modules/format.c (format): Have a bigger `str'.
8468 2001-09-05 Akim Demaille <akim@epita.fr>
8470 Rationalize warnings, reporting the macro name as if it were a
8471 program name, and assertions.
8473 * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
8475 * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
8477 Use assert for internal errors.
8478 * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
8480 * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
8482 * tests/builtins.at (pushpop): Adjust.
8484 2001-09-05 Akim Demaille <akim@epita.fr>
8486 * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
8489 2001-09-05 Akim Demaille <akim@epita.fr>
8491 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
8492 * m4/macro.c, m4/symtab.c: Adjust.
8494 2001-09-05 Akim Demaille <akim@epita.fr>
8496 * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
8497 (m4_symbol_pop, m4_symbol_del): this.
8498 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
8499 (m4_symbol_popdef, m4_symbol_delete): New.
8500 (m4_lookup_symbol): Adjust.
8501 * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
8503 2001-09-05 Akim Demaille <akim@epita.fr>
8505 * m4/m4module.h (m4_symbol_lookup): Rename as...
8506 (m4_symbol_lookup_t): this.
8508 2001-09-05 Akim Demaille <akim@epita.fr>
8510 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
8512 * m4/symtab.c (m4_lookup_symbol): Adjust.
8514 2001-09-03 Gary V. Vaughan <gary@gnu.org>
8516 Bootstrap will now work with Libtool 1.4.1 or higher:
8517 * bootstrap: Remove stale autom4te.cache files when
8519 * config/Makefile.am (ACLOCAL_MACROS): Add ltdl.m4 and
8521 * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
8522 libtool.m4 directly.
8523 Run libtoolize to refresh ltmain.sh.
8524 * config/ltmain.sh: Deleted.
8525 * acinclude.m4: Deleted.
8526 * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
8528 * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
8529 implementation for the cvs impaired libtool user.
8531 2001-09-03 Akim Demaille <akim@epita.fr>
8533 * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
8535 Avoid using `default' in switch, as it hides useful compiler
8536 warnings when a case is forgotten.
8538 2001-09-03 Akim Demaille <akim@epita.fr>
8540 * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
8541 is no such thing as `WITH_MODULES'.
8543 2001-09-03 Akim Demaille <akim@epita.fr>
8545 Improve the test suite's selfcontainedness.
8547 * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
8548 (Include, Undivert): Tag the other input files.
8549 * tests/generate.awk: Catch `@comment file:'.
8550 `-I $src' is no longer needed.
8551 `next' is really like `return': the rest is skipped.
8552 Adjust to `input.m4'.
8553 (fatal): New function.
8554 * tests/foo, tests/incl.m4: Remove.
8556 2001-09-01 Gary V. Vaughan <gary@gnu.org>
8558 The shadowing mechanism and, infact, the whole symbol table
8559 implementation was creaking under the weight of the features piled
8560 on top of it. We now have a separate hash table module which will
8561 dynamically resize to keep symbol density withing good performace
8562 limits, and a new symtab module layered above it. Symbol lookups
8563 are now marginally more efficient (since the shadowed flag is no
8564 longer required) and symbol removal, such as on module unload, is
8565 considerably faster due to a reorganisation of the data structures
8568 * src/main.c (main): Don't mention `-H'.
8569 * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
8572 * m4/hash.c: New generalised dynamic hash table data structure
8574 * m4/hash.h: Public interface.
8575 * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
8576 (libm4_la_SOURCES): Add hash.c.
8577 * m4/symtab.c: More or less rewritten from scratch, within the
8578 bounds of the previous API.
8579 (m4_symtab_apply): A cleaner version of the old hack_all_symbols
8580 call. Updated all callers.
8581 * m4/m4module.c: #include <m4/hash.h>, and changed all affected
8582 declarations to reflect API changes.
8583 (M4INIT): Generate a declaration too, to avoid the warning with
8584 --enable-debug builds.
8587 * m4/utility.c (hash_table_size): Removed.
8588 (m4_dump_symbols): Rewritten to build and qsort an array of symbol
8589 names, which are then looked up by builtin_dumpdef() as necessary.
8590 This implies a small speedup in builtin_symbols(), which discarded
8591 all of the symbol info under the old call.
8592 * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
8593 shadowing is implicit in respect to the new data structures.
8594 symbol names are no longer duplicated here, they are stored in the
8595 key field of the hash table.
8596 Moved macro_args and blind_no_args...
8597 (m4_token_data): ...to here.
8598 m4/macro.c (expand_macro): Added a name argument since the symbol
8599 name is no longer copied into each struct m4_symbol. Modified all
8601 (collect_arguments): Ditto.
8602 * modules/m4.c (set_trace): Ditto.
8603 * modules/gnu.c (builtin_symbols): Updated.
8604 * src/freeze.c (produce_symbol_dump): Much improved in light of
8605 the improved symbol table layout.
8607 2001-09-01 Gary V. Vaughan <gary@gnu.org>
8609 * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
8611 (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
8612 (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
8613 SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
8614 SYMBOL_HANDLE): Ditto.
8615 * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
8616 modules/gnu.c, modules/m4.c, src/freeze.c,
8617 src/main.c: Updated all references.
8619 * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
8620 Automake 1.5 chokes on dynamic source file lists, Besides, it is
8621 already listed in m4_LDADD... how did that ever used to work?
8622 * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
8624 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
8625 Suggested by Tim Van Holder <tim.van.holder@pandora.be>
8627 * tests/m4: Don't call the m4 wrapper script with libtool, it
8628 works fine all by itself.
8630 2001-08-30 Gary V. Vaughan <gary@gnu.org>
8632 The experimental `changeword' feature never took off, and has
8633 no obvious advantages over `changesyntax' to compensate the
8634 enormous speed penalty it carries:
8635 * configure.in (ENABLE_CHANGEWORD): Removed.
8636 * m4/m4module.h (m4_set_word_regexp): Removed.
8637 * m4/m4private.h (m4_token_data): Removed original_text field.
8638 * m4/utility.c (m4_token_data_orig_text): Removed.
8639 * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
8640 * m4/macro.c: Ditto.
8641 * src/main.c: Ditto.
8642 * modules/Makefile.am (changeword.la): Removed.
8643 * modules/changeword.c: File removed.
8644 * doc/m4.texinfo: References to changeword and --word-regexp
8646 * po/POTFILES.in: modules/changeword.c removed.
8647 * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
8648 * tests/builtins.at (changeword): Test removed.
8650 2001-08-30 Akim Demaille <akim@epita.fr>
8652 * bootstrap.sh: Create aclocal.m4 instead of modifying it.
8653 This also help having a single list of m4 files: in
8655 * config/Makefile.am (STANDARD_MACROS): Rename as...
8656 (ACLOCAL_MACROS): this.
8657 (list-standard-macros): Remove.
8660 2001-08-29 Gary V. Vaughan <gary@gnu.org>
8662 In an attempt to moderate my egomania...
8663 * tests/modules.at: Remove attributions.
8665 * tests/generate.awk: When making substitutions to "@&t@", either
8666 "&" or "\&" in the substitution string argument to gsub refer back
8667 to the matched text. "@\\&t@" seems to work though, Tests 43 and
8670 2001-08-29 Akim Demaille <akim@epita.fr>
8672 * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
8673 (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
8674 (sync-lines, trace, translit, undivert, wrap): Move to...
8675 * tests/builtins.at: this new file.
8676 * tests/others.at (Discard comments, import-environment): Move to...
8677 * tests/options.at: this new file.
8679 2001-08-29 Akim Demaille <akim@epita.fr>
8681 * tests/others.at (Freezing modules)
8682 (--module-directory: absolute path, modpath2, modpath3)
8683 (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
8684 * tests/modules.at: here, new file.
8685 * tests/others.at, tests/generate.awk: Add a banner.
8686 * tests/testsuite.at: Adjust.
8687 (AT_CHECK_M4_FILTER): New, but unused.
8689 2001-08-29 Akim Demaille <akim@epita.fr>
8691 * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
8693 * tests/others.at (wrap): Inline wrap.m4.
8694 (shadow): Inline shadow.m4.
8695 (iso8859): Don't specify the path from top_srcdir, but from srcdir.
8696 * tests/m4: Simplify.
8698 2001-08-29 Akim Demaille <akim@epita.fr>
8700 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
8703 2001-08-29 Akim Demaille <akim@epita.fr>
8705 * tests/generate.awk (normalize): s/@__@/@&t@/.
8707 2001-08-28 Akim Demaille <akim@epita.fr>
8709 * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
8711 2001-08-28 Gary V. Vaughan <gary@gnu.org>
8713 * bootstrap (generate.awk): Generate test cases with new script.
8715 2001-08-27 Akim Demaille <akim@epita.fr>
8717 * tests/Makefile.am (installcheck-local): Don't use
8718 `dc_install_base' which is not visible here, but `exec_prefix'
8719 which is clearly the RT anyway.
8720 * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
8721 related to testing a now installed m4.
8722 * tests/m4: Do it here.
8724 2001-08-27 Akim Demaille <akim@epita.fr>
8726 * tests/others.at (indir): Formatting change.
8728 2001-08-27 Akim Demaille <akim@epita.fr>
8730 * tests/Makefile.am (installcheck-local): New.
8731 * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
8733 Prefer options over envvars.
8734 * src/main.c (main): First bug caught by the test suite (yeah!):
8735 --batch lacked a `break' which resulted in an accidental
8736 invocation of --discard-comments.
8738 2001-08-27 Akim Demaille <akim@epita.fr>
8740 * tests/others.at (capitalize, changeword, comments, ddivert)
8741 (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
8742 (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
8743 (sysv-args, trace, translit, undivert): Don't rely on files in
8744 examples/: AT_DATA them.
8746 2001-08-27 Akim Demaille <akim@epita.fr>
8748 Let the test suite use a wrapper around the not installed m4 to
8749 pretend it is (installed).
8751 * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
8752 such a way that m4 does not process them.
8753 * configure.in: The package name seems to be `m4', not `M4'.
8755 * tests/atlocal.in (at_package, M4): Remove.
8756 * tests/testsuite.at, tests/others.at: Use m4, not $M4.
8758 2001-08-27 Akim Demaille <akim@epita.fr>
8760 * tests/Makefile.am (CLEANFILES): Remove.
8761 (DISTCLEANFILES, clean-local): New.
8762 * examples/mktests.sh: Remove.
8764 2001-08-27 Akim Demaille <akim@epita.fr>
8766 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
8767 Don't use aclocal: it's written by hand.
8768 * aclocal.m4: m4_include all the files instead of being built by
8770 * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
8771 until it reads the traces by itself.
8772 * configure.in: Require Autoconf 2.42c as we are now using
8773 AC_CONFIG_TESTDIR instead of AT_CONFIG.
8774 Catch unexpanded `jm_' macros.
8775 * config/atconfig.m4: Remove.
8776 * config/error.m4: new.
8777 * config/Makefile.am: Ship the files included by aclocal.m4.
8778 * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
8779 (TESTSUITE_AT): this, to please Automake.
8780 (TESTSUITE): This target uses autotest/autotest.m4, not
8781 autotest/general.m4.
8782 * tests/testsuite.at: Prereq Autotest 2.52c.
8783 * examples/Makefile.am (pkgdata_DATA): Rename as...
8784 (dist_pkgdata_DATA): this.
8785 * doc/Makefile.am (man_MANS): Rename as...
8786 (dist_man_mans): this.
8788 2001-08-20 Gary V. Vaughan <gary@gnu.org>
8790 * m4/system.h [cygwin*]: Thanks to Paul Sokolovsky and
8791 Robert Collins, building on Cygwin no longer requires Windows
8792 import and export symbol decorations.
8793 * m4/m4module.h (M4_SCOPE) [cygwin*]: Deleted all occurences.
8794 * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
8795 * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8796 * m4/error.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8797 * m4/input.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8798 * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8799 * m4/output.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8800 * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8801 * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8802 * configure.in (LIBM4_DLL_IMPORT) [cygwin*]: Don't set this
8804 * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
8805 * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
8807 2001-08-20 Gary V. Vaughan <gary@gnu.org>
8809 Ansify the source. Previously we had a mix, where my code was
8810 in a K&R compatible style, and the preexisting code was in ANSI
8811 style. Nothing is lost wrt release 1.4 by reverting to ANSI,
8812 and now the code base is much cleaner.
8814 * m4/system.h: Remove M4_PARAMS macro and all users. Remove
8815 VOID macro and all users.
8816 * m4/m4module.h: Ansify function prototypes and headers.
8817 * m4/builtin.c: Ditto.
8818 * m4/evalparse.c: Ditto.
8819 * m4/input.c: Ditto.
8820 * m4/macro.c: Ditto.
8821 * m4/module.c: Ditto.
8822 * m4/output.c: Ditto.
8824 * m4/symtab.c: Ditto.
8825 * m4/utility.c: Ditto.
8826 * modules/format.c: Ditto.
8827 * modules/gnu.c: Ditto.
8828 * modules/m4.c: Ditto.
8829 * modules/mpeval.c: Ditto.
8830 * src/freeze.c: Ditto.
8832 * src/main.c: Ditto.
8834 2001-08-20 Akim Demaille <akim@epita.fr>
8836 * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
8837 generated with stock 2.52.
8839 2001-08-20 Akim Demaille <akim@epita.fr>
8841 * config/atconfig.m4: New, until part of Autoconf per se.
8842 * configure.in (AT_CONFIG): Use it.
8844 * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
8845 * tests/atlocal.in: New.
8846 * tests/generate.awk: For the time being, the empty quadrigraph is
8848 * tests/others.at (changeword, gmp): Check the configuration
8849 variable against `yes'.
8850 * tests/testsuite.at (dnl): Allow it, as it's used all over the
8853 2001-08-20 Akim Demaille <akim@epita.fr>
8855 * m4/utility.c (m4_numeric_arg): Spell out the culprit.
8856 * modules/m4.c (undivert): Disable the possibility of undiverting
8857 several files at once: it is not documented, it is inconsistent
8858 with the other macros, it can be straightforwardly mocked by
8859 several invocations, and most importantly, it prevents the
8860 possibility of other kinds of extension.
8861 Use `m4_numeric_arg'.
8863 2001-08-20 Akim Demaille <akim@epita.fr>
8865 * examples/include.m4: Typo.
8866 * tests/generate.awk: Really add it.
8867 * tests/Makefile.am: Adjust.
8868 * tests/others.at (Discard comments): It sure fails without `-c'.
8869 (include, undivert): Add -I examples/.
8871 2001-08-20 Akim Demaille <akim@epita.fr>
8873 Use sprintf, not ecft and friends since it is standard, portable,
8874 simplifies the code, and since the latter is even deprecated
8875 according to the GNU libc documentation.
8877 * modules/format.c: Drop evct support.
8879 2001-08-19 Gary V. Vaughan <gary@gnu.org>
8881 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up. Don't test
8883 * configure.in: ...do it here instead.
8885 * c-boxes.el: Deleted.
8886 * m4/builtin.c: Reformat box comments to be closer to GNU
8888 * m4/debug.c: Ditto.
8890 * m4/evalparse.c: Ditto.
8891 * m4/input.c: Ditto.
8892 * m4/m4module.h: Ditto.
8893 * m4/macro.c: Ditto.
8894 * m4/output.c: Ditto.
8895 * m4/symtab.c: Ditto.
8896 * m4/utility.c: Ditto.
8897 * modules/changeword.c: Ditto.
8898 * modules/format.c: Ditto.
8899 * modules/gnu.c: Ditto.
8900 * modules/load.c: Ditto.
8901 * modules/m4.c: Ditto.
8902 * modules/modtest.c: Ditto.
8903 * modules/mpeval.c: Ditto.
8904 * modules/perl.c: Ditto.
8905 * modules/shadow.c: Ditto.
8906 * modules/stdlib.c: Ditto.
8907 * modules/time.c: Ditto.
8908 * src/freeze.c: Ditto.
8909 * src/main.c: Ditto.
8911 2001-08-17 Gary V. Vaughan <gary@gnu.org>
8913 * m4/module.c: Fixup some errors in the description comment.
8915 2001-08-17 Akim Demaille <akim@epita.fr>
8917 * tests/others.at (iso8859): Specify the path to the M4 test file.
8918 * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
8919 files in error messages.
8921 2001-08-17 Akim Demaille <akim@epita.fr>
8923 * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
8924 * tests/others.at: Adjust input files paths.
8925 * tests/atconfig.in: Set top_builddir.
8926 * tests/Makefile.am: Adjust.
8927 `testsuite' is in src, not build.
8929 2001-08-17 Akim Demaille <akim@epita.fr>
8931 * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
8932 (generate.at): Install a temporary hack until the actual
8933 generate.awk is added to the repository.
8934 * tests/atconfig.in: New.
8936 2001-08-17 Akim Demaille <akim@epita.fr>
8938 Really apply the patch ``Drop Autoconf 2.13 compatibility.''
8940 2001-08-17 Akim Demaille <akim@epita.fr>
8942 * doc/m4.texinfo: Promote proper quotation.
8944 2001-08-17 Akim Demaille <akim@epita.fr>
8946 Remove the non Autotest tests.
8948 * tests/other-tests/capitalize.test,
8949 * tests/other-tests/changeword.test,
8950 * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
8951 * tests/other-tests/debug.test,
8952 * tests/other-tests/discard-comments.m4,
8953 * tests/other-tests/discard-comments.test,
8954 * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8955 * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8956 * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8957 * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
8958 * tests/other-tests/hanoi.test,
8959 * tests/other-tests/import-environment.m4,
8960 * tests/other-tests/import-environment.test,
8961 * tests/other-tests/include.test, tests/other-tests/indir.test,
8962 * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
8963 * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
8964 * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
8965 * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
8966 * tests/other-tests/modtest.test,
8967 * tests/other-tests/multiquotes.test,
8968 * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
8969 * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
8970 * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
8971 * tests/other-tests/sync-lines.m4,
8972 * tests/other-tests/sync-lines.test,
8973 * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8974 * tests/other-tests/translit.test, tests/other-tests/undivert.test,
8975 * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8976 * tests/other-tests/wrap.test: Remove.
8978 * tests/run-test, tests/get-them: Remove.
8979 * tests/Makefile.am: Adjust.
8981 2001-08-17 Akim Demaille <akim@epita.fr>
8983 others.at no longer depends on other-tests/.
8985 * tests/others.at (stackovf): You're actually...
8987 (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
8988 (unload.test): Keep their authorship.
8989 (discard-comments, gmp, import-environment, modfreeze)
8990 (sync-lines): Embed the input files.
8991 * tests/stackovf.test: Copy from other-tests/stackovf.test.
8992 * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
8994 2001-08-17 Akim Demaille <akim@epita.fr>
8996 * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
8997 (M4exit): Tag the exit status of the example.
8998 * tests/get-them: Adjust.
8999 * tests/generate.awk: New, based on get-them.
9000 * tests/Makefile.am: Adjust to generate `generated.at'.
9001 * tests/testsuite.at: Adjust.
9002 (AT_CHECK_M4): Don't overquote. Blush...
9004 2001-08-17 Akim Demaille <akim@epita.fr>
9006 Start using Autotest. atconfig creation is still lacking.
9008 * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
9009 * examples/reverse.m4, tests/other-tests/import-environment.m4,
9010 * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
9011 * tests/other-tests/import-environment.test: Don't check LANGUAGE
9012 as it might be `unset', or set to `C'.
9013 * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
9014 * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
9015 * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
9016 * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
9017 * tests/other-tests/shadow.test: Adjust.
9018 * tests/testsuite.at, tests/others.at: New.
9019 * tests/Makefile.am: Adjust.
9021 2001-08-17 Akim Demaille <akim@epita.fr>
9023 Drop Autoconf 2.13 compatibility.
9025 * configure.in (changeword): No need to undefine it, as anyway if
9026 it's defined, M4sugar moved it as m4_changeword.
9027 And anyway, proper quotation is enough.
9028 (m4_pattern_allow): As it exists in 2.50, just use it.
9029 (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
9030 Don't handle Gettext's duties, let it handle them.
9031 * config/gnu-obstack.m4: Use m4_pattern_allow directly.
9033 2001-08-17 Akim Demaille <akim@epita.fr>
9035 * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
9036 (m4_errprint): Use fputs.
9037 * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
9038 dumpdef are not concerned.
9039 (Dumpdef, Errprint): Emphasize their insensitivity to
9041 * doc/Makefile.am: Add `TAGS' support.
9042 (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
9044 * config/Makefile.am (MAINTAINERCLEANFILES): New.
9046 2001-08-17 Akim Demaille <akim@epita.fr>
9048 * modules/Makefile.am (ETAGS_ARGS): New.
9050 2001-08-17 Akim Demaille <akim@epita.fr>
9052 * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
9055 2001-08-17 Akim Demaille <akim@epita.fr>
9057 * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
9059 2001-08-17 Akim Demaille <akim@epita.fr>
9061 * m4/m4module.h (m4/list.h): Don't include it.
9063 2001-08-16 Gary V. Vaughan <gary@gnu.org>
9065 m4_modules are no more, we use lt_dlhandles directly and let
9066 latest libltdl features manage the list of loaded modules.
9067 * acinclude.m4: Regenerated.
9068 * m4/ltdl.c: Updated from master copy.
9069 * m4/module.c: Reimplemented to take advantage of advances in
9071 * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
9072 list with lt_dlhandle_next.
9073 (m4_builtin_find_by_func): Ditto.
9074 (m4_builtin_table_install): Use lt_dlhandle.
9075 (m4_macro_define): Ditto.
9076 (m4_macro_table_install): Ditto.
9077 m4/module.h: Prototype new module management API.
9078 (m4_modules): No longer required.
9079 (m4_module_init_t, m4_module_finish_t): POSIX namespace
9080 violations, renamed to...
9081 (m4_module_init_func, m4_module_finish_func): ...these,
9083 (M4INIT_HANDLER): Clean way to declare init functions in modules.
9084 (M4FINISH_HANDLER): And similarly for finish functions.
9085 * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
9086 -- Add indirection to the CONC macro so that arguments are
9088 * modules/modtest.c (m4_init_module): Replaced with M4INIT_HANDLER.
9089 * modules/shadow.c (m4_init_module): Ditto.
9090 Due to new init function semantics, be careful to perform the
9091 initialisation only on first load.
9092 * modules/perl.c (m4_init_module): Ditto. And Ditto.
9093 (m4_finish_module): Replaced with M4FINISH_HANDLER.
9094 Due to new finish function semantics, be careful to perform the
9095 finalisation only on first load.
9096 * m4/m4private.h (m4_module): Removed in favour of...
9097 (m4_module_data): ...structure without all the wrapper fields.
9098 Instances of this new structure are stored associated lt_dlhandles
9099 with lt_dlcaller_data_set().
9100 * m4/builtin.c (m4_builtin_define): Takes a handle argument
9101 instead of the old module argument.
9102 (m4_builtin_table_install): Ditto.
9103 * modules/load.c (m4_resident_module): Removed. This is no
9104 longer implemented as a magic symbol...
9105 * modules/m4.c (m4_resident_module): Ditto.
9106 * modules/load.c (M4INIT_HANDLER): ...the module init function now
9107 uses the ltdl api to make the module resident.
9108 * modules/m4.c (M4INIT_HANDLER): Ditto.
9109 * modules/load.c (builtin_modules): Traverse the loaded module
9110 list with lt_dlhandle_next.
9111 (builtin_load): Much simplified in light of the reimplemented
9113 * src/freeze.c (produce_module_dump): Cleaned up and optimised in
9114 light of the m4/module.c rewrite.
9115 (produce_symbol_dump): Ditto.
9116 (reload_frozen_state): Ditto.
9117 * m4/list.c, m4/list.h: Files deleted. No longer required.
9118 * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
9119 (libm4_la_SOURCES): Delete list.c reference.
9120 * m4/m4private.h (m4_token_data): Add a handle field. This
9121 eliminates many of the searches to find the handle associated with
9122 various tokens that are passed between functions.
9123 (struct m4_symbol): Removed the module field. The
9124 module association does not belong with the symbol...
9125 * m4/input.c (struct m4_builtin): ...it belongs with the builtin
9126 that the module implementation code is from. Added a handle
9128 (m4_push_macro): Add a `handle' argument. Changed all callers.
9129 (init_macro_token): Set the `handle' field for the
9131 * m4/macro.c (expand_argument): Copy the new handle field during
9133 * modules/m4.c (macro_install): Use the new handle field to
9134 optimise the search for the correct builtin structure, and pass
9135 the handle details to m4_builtin_define.
9137 2001-08-15 Akim Demaille <akim@epita.fr>
9139 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
9140 when creating `m4/obstack.h'.
9141 * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
9143 * tests/defs: Make them absolute.
9144 (CDPATH) Neutralize.
9145 * tests/gethem: Use them.
9147 2001-08-14 Gary V. Vaughan <gary@gnu.org>
9149 * config/ltmain.sh: Doh! Import again for a quoting fix that
9150 prevented any regression test from passing.
9152 * m4/m4module.h (obstack.h): Choose between installed version
9153 and shipped version based on configure tests.
9154 * src/freeze.c (obstack.h): Ditto.
9156 * acconfig.h: Removed. No longer required.
9158 * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
9159 * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
9160 them to AC_INIT and AM_INIT_AUTOMAKE.
9161 * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
9162 disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
9163 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
9164 shell variable m4_cv_func_obstack_h.
9165 * tests/defs (M4): Be more careful about relative path to libtool
9166 script and m4 binary by using $srcdir.
9168 * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
9169 optargs to the existing libltdl search path.
9170 * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
9171 * m4/ltdl.c: Updated.
9173 * config/ltmain.sh: Ditto.
9175 2001-08-11 Gary V. Vaughan <gary@gnu.org>
9177 * src/main.c (main): Add `-b' (for `batch') mode switch to force
9178 interactive mode off.
9180 2001-08-10 Akim Demaille <akim@epita.fr>
9182 * configure.in: Require Autoconf 2.52.
9183 (AC_ARG_PROGRAM): Remove, handled by Automake.
9184 (m4_getopt): Rename as...
9185 (m4_getopt_h): this.
9186 Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
9187 Undefine `changeword' only if defined.
9188 * config/gnu-obstack.m4: Require Autoconf 2.52.
9189 (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
9192 2001-08-09 Yuji Minejima <ggb01164@nifty.ne.jp>
9194 * doc/m4.texinfo: Fix some typos, and apply some small
9197 2001-08-09 Andreas Schwab <schwab@suse.de>
9199 * src/main.c (main): Fix improper uses of error (missing format
9202 2001-08-07 Akim Demaille <akim@epita.fr>
9204 Improve `make distcheck'.
9206 * configure.in: Be sure to be able to run `mkconfig.sh' when src
9208 * Makefile.am (dist-hook): Remove, as it is no longer needed.
9209 * doc/m4.texinfo (Include): Add missing blank.
9210 * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
9213 2001-08-07 Akim Demaille <akim@epita.fr>
9215 * m4/evalparse.c: A better introductory comment.
9216 * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
9217 * m4/macro.c: Adjust old comments.
9218 * modules/README: Typo.
9220 2001-08-07 Akim Demaille <akim@epita.fr>
9222 * config/gnu-obstack.m4: New.
9224 2001-08-07 Akim Demaille <akim@epita.fr>
9226 * config/Makefile.am, config/stackovf.m4: New.
9227 * configure.in, Makefile.am: Adjust.
9229 2001-08-05 gettextize <bug-gnu-utils@gnu.org>
9231 * po/Makefile.in.in: Upgrade to gettext-0.10.39.
9232 * po/cat-id-tbl.c: Remove file.
9233 * po/stamp-cat-id: Remove file.
9235 2001-04-08 Roderick Koehle <Roderick.Koehle@infineon.com>
9237 * modules/format.c (format): Formatting for %f was not
9238 interpreting the position of the decimal point correctly for
9241 2000-12-01 Gary V. Vaughan <gary@gnu.org>
9243 * TODO: Removed m4exit bug.
9244 * modules/load.c (m4_resident_module): Make this module resident.
9245 * module/m4.c (m4_resident_module): Ditto.
9246 * m4/modules.c (m4_module_load): Use new ltdl resident modules
9247 feature to mark modules as resident if they export
9248 `m4_resident_module' as TRUE.
9249 (m4_module_unload): Do not remove resident modules, and take care
9250 with symbol insertion and deletion with resident modules.
9251 * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
9252 use resident modules feature.
9254 2000-11-30 Gary V. Vaughan <gary@gnu.org>
9256 * TODO: Updated. Removed some cruft that has since been fixed
9257 or implemented. Added some more entries.
9260 * modules/README: Updated.
9261 * doc/m4.texinfo: Updated.
9263 * modules/gnu.c (builtin_functions): Make indir orthogonal to
9264 builtin, in that each is recognised as a macro only with parameters
9265 (builtin_indir): Passing 0 arguments is now an error, as with
9268 * src/main.c (usage): Added missing description of `-c' option.
9270 2000-11-29 Gary V. Vaughan <gary@gnu.org>
9272 Consolidate the myriad of dispersed test scripts into the
9273 tests subdirectory. I think I now have all the file where I
9274 want them, so there shouldn't be anymore upheaval =)O|
9276 * tests/Makefile.am: Updated to run the new tests added below.
9277 * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
9278 tests/other-tests/ddivert.test, tests/other-tests/debug.test,
9279 tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
9280 tests/other-tests/foreach.test, tests/other-tests/forloop.test,
9281 tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
9282 tests/other-tests/hanoi.test, tests/other-tests/include.test,
9283 tests/other-tests/indir.test, tests/other-tests/misc.test,
9284 tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
9285 tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
9286 tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
9287 tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
9288 tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
9289 tests/other-tests/reverse.test, tests/other-tests/shadow.test,
9290 tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
9291 tests/other-tests/translit.test, tests/other-tests/undivert.test,
9292 tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
9293 tests/other-tests/wrap.test: New tests based on the contents
9294 of the tests removed below.
9295 * examples/Makefile.am, modules/Makefile.am: Updated to
9296 reflect removed tests.
9297 * examples/defs,modules/defs: Removed.
9298 * examples/capitalize.test, examples/comments.test,
9299 examples/ddivert.test, examples/debug.test,
9300 examples/esyscmd.test, examples/exp.test,
9301 examples/foreach.test, examples/forloop.test,
9302 examples/fstab.test, examples/hanoi.test,
9303 examples/include.test, examples/indir.test,
9304 examples/misc.test, examples/multiquotes.test,
9305 examples/patsubst.test, examples/pushpop.test,
9306 examples/regexp.test, examples/reverse.test,
9307 examples/sysv-args.test, examples/trace.test,
9308 examples/translit.test, examples/undivert.test,
9309 examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
9310 modules/modpath1.test, modules/modpath2.test,
9311 modules/modpath3.test, modules/modpath4.test,
9312 modules/modtest.test, modules/shadow.test,
9313 modules/unfrozen.m4, modules/unload.test: Removed.
9315 Move the implementation of GMP support for the mpeval() builtin
9316 into a loadable module that depends on libgmp. mpeval() and
9317 eval() share a common parser, now in m4/evalparser.c; the code
9318 in m4/numb.c and m4/numb.h is now physically split between
9319 m4/eval.c (the eval() backend) and modules/mpeval.c (the
9320 mpeval() backend), rather than being differentiated by cpp
9321 macros and multiple inclusion. The mpeval module is always
9322 built but will generate an diagnostic if it is used from an
9323 installation that didn't link in the gmp library.
9324 * modules/Makefile.am: build and install the new mpeval module.
9325 * modules/mpeval.c: Now contains the former parts of m4/numb.c
9326 and m4/numb.h that are required for gmp support in mpeval().
9327 * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
9328 * m4/evalmp.c: Removed.
9329 * m4/m4module.h: Removed conditional prototype for
9331 * m4/eval.c: Rewritten. Contains the former parts of m4/numb.c
9332 and m4/numb.h that do not rely on gmp.
9333 * m4/evalparse.c: New file, contains the shared parts of the
9334 eval() and evalmp() parser implementations, and is no longer
9335 unencumbered by cpp magic to uncover the right parts.
9336 * m4/numb.h: Removed. It's former contents are split between
9337 m4/eval.c and modules/mpeval.c.
9340 * tests/other-tests/changeword.test: New test. Rudimentary
9341 testing of changeword builtin runs only if --wnable-changeword
9342 was used at configure time.
9343 * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
9344 alternation correctly. Split into two expressions to compensate.
9345 * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
9346 * modules/Makefile.am: Build changeword module.
9347 * modules/changeword.c (m4_macro_table): Define __m4_changeword__
9348 only when --enable-changeword was passed to configure.
9349 (builtin_changeword): If --enable-changeword was not used, then
9350 report that changeword() builtin has no support in m4 binary.
9352 2000-11-28 Gary V. Vaughan <gary@gnu.org>
9354 * src/main.c (main): Fixed a particularly nasty bug is
9355 user_search_path setting -- the -M flag processing must be
9356 extremely careful with search path ordering, or else the default
9357 installed module directory (possibly containing modules from a
9358 previous release) is placed earlier in the search path than any -M
9359 arguments (which are relied upon to load uninstalled modules with
9360 most of the tests in the regresion suite).
9362 * modules/load.c (builtin_load): Nasty hack to prevent adding
9363 symbols to symtab again if a module is loaded more than once.
9364 * modules/m4.c (builtin_ifelse): removed unused variable argv0.
9366 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed a
9367 possible NULL pointer dereference.
9369 * m4/module.c (m4_module_find_by_modname): Renamed from
9370 m4_module_modname_find. Fixed all references.
9371 (m4_module_find_by_builtin): New function.
9373 * modules/modfreeze.test: load the `load' module with each
9375 * src/freeze.c (produce_frozen_state): Simplified in light of
9376 module field in m4_symbol. Allow a third argument for text macros
9377 to name the originating module.
9378 (reload_frozen_state): ditto.
9379 * m4/m4module.h: Fixup prototypes.
9380 * m4/builtin.h (m4_builtin_define): Add a module argument so
9381 that symbols can be registered against the defining module.
9382 (m4_macro_define): ditto.
9383 * m4/m4private.h (m4_symbol): Make the module field const to save
9384 on casting in the rest of the code.
9385 (SYMBOL_MODULE): New macro.
9387 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
9388 symbol reference maintenance bugs when removing a symbol from the
9391 * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
9393 2000-11-27 Gary V. Vaughan <gary@gnu.org>
9395 * configure.in (m4_cv_func_obstack): A better check for whether
9396 libc has an obstack implementation.
9397 * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
9399 * configure.in (--with-modules): Changed semantics. This
9400 option is now used to list modules to be preopened.
9401 * src/m4.h: #include "ltdl.h" unconditionally.
9402 * src/main.c: Removed all dependencies on WITH_MODULES.
9403 * src/freeze.c: ditto.
9404 * modules/Makefile.am: ditto.
9405 * m4/m4.c (builtin_m4exit): ditto.
9406 * modules/modpath1.test: ditto.
9407 * modules/modpath2.test: ditto.
9408 * modules/modpath3.test: ditto.
9409 * modules/modpath4.test: ditto.
9410 * modules/modtest.test: ditto.
9411 * modules/shadow.test: ditto.
9412 * modules/unload.test: ditto.
9414 * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
9415 comes up on demand in LTLIBOBJS now.
9416 * configure.in (getopt_long): Creating and relying on a link for
9417 getopt.h on hosts with no getopt_long() of thier own works
9418 correctly now. This is necessary so that callers of getopt_long()
9419 can simply `#include <getopt.h>': the naive way of doing this
9420 would end up using our own getopt.h and the installed
9421 getopt_long(), which is asking for trouble!
9422 (obstack_init): A similar argument applies to obstack.h and
9425 * m4/ltdl.c: Upgraded to latest bleeding edge version again.
9426 On Solaris-2.5 (at least) the native dlopen implementation
9427 gets confused about m4.o when looking for module "m4". This
9428 version always looks for .la an .$lib_ext suffixed names first
9429 to work around the problem. Sigh.
9431 * po/POTFILES.in: Take account of these file movements.
9432 * src/Makefile.am (m4_SOURCES): removed eval.c.
9433 (EXTRA_m4_SOURCES): removed numb.c and numb.h.
9434 * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
9435 (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
9436 * modules/m4.c (builtin_eval): Use m4_evaluate().
9437 * m4/eval.c: Moved here from src/eval.c to facilitate
9438 implementation of eval() builtin as part of the `m4' loadable
9440 (m4_evaluate): renamed from evaluate for namespace cleanliness.
9441 * m4/numb.c: Moved here from src/numb.c, since it is #included
9442 into eval.c at compile time.
9443 * m4/m4module.h (m4_evaluate): Added prototype.
9444 * src/m4.h (evaluate): Removed prototype.
9446 2000-11-25 Gary V. Vaughan <gary@gnu.org>
9448 * modules/perl.c (builtin_perleval): Use PL_na for
9449 compatibility with perl-5.6.
9451 * src/main.c (main): It is now safe to
9452 ``m4_module_install("m4")'', without tripping over the m4
9454 * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
9455 versions having fixed the insidious module search order bug.
9457 * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
9458 supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
9460 * configure.in: Figure out whether to use the installed
9461 getopt.h or the supplied one.
9462 * src/Makefile.am: ditto.
9464 * po/POTFILES.in: List files in their new positions.
9466 * config/ltmain.sh: This needs to be checked in to match the
9467 libtool macros copied to acinclude.m4 (until a released
9468 libtool copes with m4's needs).
9469 * bootstrap: Run gettextize.
9471 2000-11-24 Gary V. Vaughan <gary@gnu.org>
9473 * AUTHORS: Added my details.
9476 * bootstrap: temporary update until released libtool catches up.
9478 * All files: Use new GNU GPL copyright blurb with current contact
9481 * configure.in (LTLIBOBJS): Use canonical code for calculation of
9484 * config: renamed acm4 directory to config to be more like
9485 other autoconfiscated packages.
9487 * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
9488 * config/debug.m4: New file implementing configure macros to add
9489 suitable debug flags to the compiler invocation.
9491 * modules/load.c: New file implementing the ``load'' and
9492 ``unload'' builtins.
9493 * tests/get-them: Set the module search directory to the modules
9494 build directory in generated tests.
9495 * modules/shadow.test: ditto.
9496 * modules/modtest.test: ditto.
9497 * modules/modpath1.test: ditto.
9498 * modules/modpath2.test: ditto.
9499 * modules/modpath3.test: ditto.
9500 * modules/modpath4.test: ditto.
9501 * modules/modtest.test: ditto.
9502 * modules/modfreeze.test: ditto.
9503 * modules/unload.test: ditto.
9505 * modules/changeword.c: New file implementing the ``changeword''
9506 builtin as a loadable module.
9507 * modules/mpeval.c: New file implementing the ``mpeval'' builtin
9508 as a loadable module.
9510 * src/main.c (main): Load the gnu module if m4 was started
9511 normally -- i.e. without the -G option.
9512 * modules/gnu.c: New file implementing a new loadable module wuth
9513 definitions for all the gnu extension builtins.
9514 * modules/format.c: Moved here from src/format.c. Now included
9517 * src/main.c (main): Load the traditional module if m4 was
9518 started in `no_gnu_extensions' mode.
9519 * modules/traditional.c: New file implementing the ``unix'' macro,
9520 required when m4 is executed in traditional mode, as a loadable
9523 * src/main.c: Renamed from m4.c to avoid confusion with
9525 (main): Always load the m4 module.
9526 * modules/m4.c: New file implementing a new loadable module with
9527 definitions for all m4 builtins that are not gnu extensions.
9529 * m4/Makefile.am: Adjusted to take new files below into account.
9530 * m4/m4module.h: Prototypes for exported functions and types moved
9531 to this directory from the src directory.
9532 * m4/m4private.h: Moved here from src/m4private.h to facilitate
9533 the migration of all builtin implementations to loadable modules.
9534 * m4/macro.c: Moved this file here from the src directory,
9535 renaming all exported symbols to use the prefix ``m4_''.
9536 * m4/builtin.c: ditto.
9537 * m4/module.c: ditto.
9538 * m4/symtab.c: ditto.
9539 * m4/debug.c: ditto.
9540 * m4/input.c: ditto.
9541 * m4/output.c: ditto.
9543 * m4/ltdl.h, m4/ltdl.c: ditto.
9544 * m4/utility.c: Odd functions moved here from files in the src
9545 directory to facilitate builtin migration.
9547 2000-08-12 Gary V. Vaughan <gary@gnu.org>
9549 * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
9550 error message, to make translators' jobs a little easier.
9551 (builtin_builtin): ditto.
9552 (builtin_traceon): ditto.
9553 (builtin_traceoff): ditto.
9554 Reported by Akim Demaille <akim@epita.fr>
9556 * m4/Makefile.am (pkgincdir): Deleted. Use automake's built in
9557 pkgincludedir instead.
9559 * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
9560 it is exported globally. Fixed all references.
9564 (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
9565 globally. Fixed all references.
9566 (DEF_LQUOTE): ditto.
9570 2000-07-28 Gary V. Vaughan <gary@gnu.org>
9575 * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
9576 (AC_OUTPUT): touch stamp-h.in, not stamp-h.
9578 * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
9579 Removed `Prev', `Next' and `Up' fields of all @nodes now that
9580 makeinfo calculates them for us, and to make any future
9581 reorganisation easier.
9582 (Frozen files): Document format version 2.
9583 `V' now takes argument `2'.
9584 `F' can take a single argument if symbol and builtin names
9585 are the same, or 3 arguments if the builtin is from a module.
9586 New `S' specification for saving syntax table contents.
9587 New `M' specification for saving loaded module names.
9588 * src/freeze.c: Implement them.
9589 * src/input.c (syntax_code): For interpreting frozen syntax
9592 * examples/Makefile.am: Add the contents of the WWW directory to
9594 * examples/WWW/Makefile: ditto,
9595 (%.htm): Compares file contents (not just sizes) to determine
9596 whether a change has occured.
9597 * examples/WWW/_header.htm: Bumped version number.
9598 * examples/WWW: Regenerated content.
9600 * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
9601 compilers comes much easier without ansi2knr.
9602 * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
9604 * m4/list.c: New generic list container type.
9605 * m4/list.h: Interface to new container type.
9606 * m4/Makefile.am (pkginc_HEADERS): Install list.h.
9607 (libm4_la_SOURCES): compile and link list.c.
9608 * src/builtin.c (builtin_tables): Use list container.
9609 * src/module.c (symtab): ditto.
9610 * src/symtab.c (symtab): ditto.
9612 * m4/system.h: New file for common preprocessor definitions.
9613 * m4/Makefile.am (pkginc_HEADERS): install system.h.
9614 * m4/error.c: Use system.h in place of inline preprocessor.
9615 * m4/error.h: ditto.
9616 * m4/module.c: ditto.
9617 * m4/module.h: ditto.
9618 * m4/xmalloc.c: ditto.
9620 * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
9622 * m4/xmalloc.c (xmalloc_exit_failure): ditto.
9624 * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
9625 it is exported globally. Fixed all references.
9627 (module_init_t): ditto.
9628 (module_finish_t): ditto.
9629 (token_data): ditto.
9630 (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
9631 it is exported globally. Fixed all references.
9632 (SYNTAX_IGNORE): ditto.
9633 (SYNTAX_SPACE): ditto.
9634 (SYNTAX_OPEN): ditto.
9635 (SYNTAX_CLOSE): ditto.
9636 (SYNTAX_COMMA): ditto.
9637 (SYNTAX_DOLLAR): ditto.
9638 (SYNTAX_ACTIVE): ditto.
9639 (SYNTAX_ESCAPE): ditto.
9640 (SYNTAX_ALPHA): ditto.
9641 (SYNTAX_NUM): ditto.
9642 (SYNTAX_ALNUM): ditto.
9643 (SYNTAX_LQUOTE): ditto.
9644 (SYNTAX_RQUOTE): ditto.
9645 (SYNTAX_BCOMM): ditto.
9646 (SYNTAX_ECOMM): ditto.
9647 (SYNTAX_VALUE): ditto.
9648 (SYNTAX_MASKS): ditto.
9666 (TOKEN_NONE): ditto.
9667 (TOKEN_STRING): ditto.
9668 (TOKEN_SPACE): ditto.
9669 (TOKEN_WORD): ditto.
9670 (TOKEN_SIMPLE): ditto.
9671 (TOKEN_MACDEF): ditto.
9673 * m4/m4module.h (voidstar): Removed in favour of `VOID' for
9674 consistency. Fixed all references.
9675 (STRING): Renamed to `m4_string' for consistency, and because if
9676 is exported globally. Fixed all references.
9677 (token_type): Renamed to `m4_token_t' for the same reasons.
9678 (token_data_type): Renamed to `m4_token_data_t' for the same
9681 * m4/m4module.h (XCALLOC): Wrapper macro which handles type
9685 (XFREE): Wrapper macro which avoids freeing NULL pointers.
9687 * m4/m4module.h (m4_macro): New type for module defined user
9689 * modules/modtest.c (m4_macro_table): Define module user macros.
9690 * modules/shadow.c (m4_macro_table): ditto.
9692 * m4/m4module.h (M4BUILTIN_HANDLER): For defining handlers
9693 declared with M4BUILTIN.
9695 * m4/xmalloc.c: Use memset if bzero is not available when
9696 emulating calloc with malloc.
9697 (xcalloc): Fallback to malloc/bzero if calloc is not available.
9698 (xfree): Added for consistency. Will not try to free NULL
9700 * src/m4.c (xfree): Deleted in favour of the above.
9701 * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
9702 linking with libdmalloc.
9703 * m4/xstrdup.c (WITH_DMALLOC): ditto.
9705 * modules/frozen.m4: New test case.
9706 * modules/unfrozen.m4: ditto.
9707 * modules/modfreeze.test: New test.
9708 * modules/unload.test: ditto.
9709 * modules/Makefile.am (EXTRA_DIST): Distribute them.
9711 * modules/modpath1.test: Don't try this test if module support is
9713 * modules/modpath2.test: ditto.
9714 * modules/modpath3.test: ditto.
9715 * modules/modpath4.test: ditto.
9716 * modules/modtest.test: ditto.
9717 * modules/shadow.test: ditto.
9719 * modules/perl.c: New module.
9720 * modules/perl.m4: Example of using it.
9721 * modules/Makefile.am (perl_la_SOURCES): Build new perl module.
9723 * src/m4.c (main): Assume interactive mode if STDIN is connected
9725 Changed startup sequence slightly so that syntax is not
9726 initialised from here when loading a frozen file.
9728 * src/builtin.c: Much improved macro definition style.
9729 * src/m4private.h: Internal structures for m4_builtin and
9730 m4_macro instances. These are not exposed to module writers.
9731 * src/module.c (module_modname_find): Find a module structure
9733 (make_macro_table): Build an internal macro table from a external
9735 (make_builtin_table): Build an internal builtin table from an
9736 external definition.
9738 * src/module.c (module_unload): Be extremely careful to remove
9739 builtins and macros that match the module being unloaded -- no
9740 longer assume that the top element can be removed incase another
9741 odule defines an identical name.
9742 * src/symtab.c (remove_table_reference_symbols): remove all symbol
9743 table entries which refer to a given builtin table.
9744 * src/builtin.c (remove_tables): Use it!
9746 2000-07-13 Thomas Tanner <tanner@ffii.org>
9748 * Makefile.am (SUBDIRS): we need modules/ for "make dist"
9749 * acm4/modules.m4: deleted
9750 * bootstrap: don't libtoolize libltdl!
9751 * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
9752 if set, enable WITH_MODULES and add modules to DLPREOPEN
9753 * examples/misc.test: redirect standard output
9754 * lib/Makefile.am: don't use DLLDFLAGS
9755 * lib/m4module.c: include necessary headers to silence GCC -Wall
9756 * lib/m4regex.c: fixes to silence GCC -Wall
9757 * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
9758 build modules conditionally
9759 * modules/shadow.c: define symbol aliases before using them
9760 * modules/test.c: define symbol aliases before using them
9761 * po/de.po: update translation
9762 * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
9763 pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
9765 * src/m4.c: initialize libltdl's preloaded symbols via
9766 LTDL_SET_PRELOADED_SYMBOLS
9767 * src/module.c: libltdl's memory management must be initialized
9768 before calling lt_dlinit!, fix warnings
9770 2000-01-18 Gary V. Vaughan <gary@gnu.org>
9772 * README: Caveat about nls not supported by dll architecture on
9775 * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
9777 * tests/Makefile.am (stamp-TESTS): now works with VPATH.
9778 * src/Makefile.am (m4_LDADD): use $(builddir) for VPATH.
9779 * modules/Makefile.am (LIBS): ditto.
9780 (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
9781 $(top_srcdir)/m4 (for only <m4module.h>).
9782 * modules/shadow.test: fixed for VPATH.
9783 * modules/modtest.test: ditto.
9784 * modules/modpath4.test: ditto.
9785 * modules/modpath3.test: ditto.
9786 * modules/modpath2.test: ditto.
9787 * modules/modpath1.test: ditto.
9789 * modules/time.test: Removed due to timezone dependence,
9790 * modules/Makefile.am (TESTS): Removed time.test.
9792 * configure.in: Use $3 of AC_DEFINE so that we can,,,
9793 * acconfig.h: Remove everything except the gettext parameters.
9794 * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
9796 * acm4/ltdl.m4: Updated to latest from libtool cvs.
9797 * acm4/modules.m4: Remove code which duplicates ltdl.m4 and
9798 increment serial number.
9800 * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
9801 src dir and immediately after libm4 is built for confidence that
9802 it doesn't rely on the src directory.
9803 (SUBDIRS): Moved doc dir to the end since helptoman.pl and
9804 makeinfo stop the build on cygwin (because they don't work).
9806 * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
9808 * m4/m4private.h: ...is not a public header, so moved to src.
9809 Add `#include <config.h>', `#define _COMPILING_M4' and
9811 * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
9812 * src/Makefile.am (noinst_HEADERS): add m4private.h.
9813 * src/builtin.c: `#include "m4private.h"' now takes care of the
9814 above. Duplicates removed.
9815 * src/debug.c: ditto.
9816 * src/eval.c: ditto.
9817 * src/evalmp.c: ditto.
9818 * src/format.c: ditto.
9819 * src/freeze.c: ditto.
9820 * src/input.c: ditto.
9822 * src/macro.c: ditto.
9823 * src/module.c: ditto.
9824 * src/numb.h: ditto.
9825 * src/output.c: ditto.
9826 * src/path.c: ditto.
9827 * stackovf.c: ditto.
9830 * po/POTFILES.in: compensate for renaming of lib/*.
9831 * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
9832 (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
9833 and then in $(top_srcdir)/lib (for eg. "m4private.h").
9834 * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
9836 * m4/m4error.h: Renamed error.h, for installation to
9837 $prefix/include/m4..
9838 * m4/m4obstack.h: Renamed obstack.h, for same reason.
9839 * m4/m4regex.h: Renamed regex.h, for same reason.
9840 * m4/m4error.c: Renamed error.c, and use #include "error.h".
9841 * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
9842 * m4/m4regex.c: Renamed regex.c, and fix #includes.
9844 * lib: moved to m4 to easily support header installation to
9846 * Makefile.am (SUBDIRS): renamed lib dir to m4.
9847 * configure.in (AC_OUTPUT): reference m4/Makefile.in.
9848 * acm4/regex.m4: Point to m4/regex.c.
9850 * examples/foreach.m4: Sanitise quoting.
9851 * examples/foreach.test: New torture test.
9852 From Akim Demaille <akim@epita.fr>
9854 2000-01-17 Gary V. Vaughan <gary@gnu.org>
9856 * src/ltdl.c: Use access() to abort doomed module load attempts
9857 if module file does not exist.
9859 * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
9860 getopt1.o will already be used if appropriate, so I moved getopt.c
9861 and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
9863 * modules/modpath1.test: Use correct filename in header line.
9864 * modules/modpath2.test: ditto.
9865 * modules/modpath3.test: ditto.
9866 * modules/modpath4.test: ditto.
9868 Without these changes lt_dlopen("test") attempts to
9869 LoadLibrary("/bin/test") on Windows, which although harmless
9870 generates a spurious error message which spoils most of the tests:
9871 * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
9872 (TESTS): s/test.test /modtest.test /
9873 (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
9874 (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
9875 * modules/modpath1.test: s/test.m4 /modtest.m4 /
9876 * modules/modpath2.test: ditto.
9877 * modules/modpath4.test: ditto.
9878 * modules/modpath3.test: s/-m test /-m modtest /
9879 * modules/shadow.m4: use {un,}loadmodule(`modtest').
9881 2000-01-16 Gary V. Vaughan <gary@gnu.org>
9883 * src/ltdl.c (find_file): Updated to new version with fixed memory
9884 allocation bug in `next'.
9885 * src/ltdl.h: updated to match.
9887 * modules/Makefile.am: Cleaned up and reordered.
9889 2000-01-16 René Seindal <rene@seindal.dk>
9891 * modules/Makefile.am (TESTS): New tests for the module system.
9893 * modules/*.test: New files.
9895 * src/m4.c (main): Added call to module_init().
9896 Treats -M and -m as the arguments -D -U and -t, ie deferred.
9898 * src/m4.h: Added declaration of module_init().
9900 * src/module.c (module_init): No longer static
9902 * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
9903 Added to shut up automake about non standard libtool library
9906 * src/module.c: Disabled DEBUG by default.
9908 * modules/README: Changed example from unload.m4 to shadow.m4
9910 * modules/shadow.m4: Renamed from unload.m4
9912 * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
9914 * src/m4.c (main): Functionality for -m and -M were reversed.
9917 2000-01-12 Gary V. Vaughan <gary@gnu.org>
9919 * doc/help2man.pl: updated to version 1.020.
9921 * lib/COPYING.LIB: updated to version 2.1.
9923 * lib/m4module.h: restructure the M4_SCOPE code to work when
9924 creating a dll which links with libm4.la and both DLL_EXPORT
9925 (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
9928 2000-01-11 Gary V. Vaughan <gary@gnu.org>
9930 Merged the following changes from my tree:
9932 1999-06-15 Gary V. Vaughan <gary@gnu.org>
9934 * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
9935 ported to compile shared libs.
9937 * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
9938 use `__declspec(dllimport)' when linking libm4.la on win32.
9939 * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
9941 * configure.in (M4OBJS): Discover whether we need the shipped
9942 implementation of getopt_long.
9943 * src/Makefile.am (m4_LDADD): Link the getopt objects into the
9944 main binary here, as opposed to the module library in lib/libm4.la.
9946 1999-06-14 Gary V. Vaughan <gary@gnu.org>
9948 * modules/README: Updated to describe the improved libltdl based
9950 * README (cygwin): Added some compilation notes for building m4
9951 correctly under cygwin.
9952 * TODO: Cleaned out the entries for the module system since they
9953 are now implemented.
9955 * *.[ch]: __P is in the compiler's reserved namespace, so replaced
9956 all instances of __P with M4_PARAMS.
9958 * lib/getdate.h: removed unreferenced file.
9960 * lib/m4private.h: New file to define the private interface to the
9961 token_data struct, which must be shared between m4module.c, and
9962 builtin.c but not exported to modules built from the installed
9963 m4module.h since it's size changes depending on compile time
9966 * src/m4.h: Lots of stuff moved to lib/m4module.h.
9968 * lib/m4module.h: New file to define the interface available when
9969 compiling m4 modules.
9970 * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
9971 necessary for module compilation into this new file.
9973 * lib/Makefile.am (include_HEADERS): install headers (renamed to
9974 avoid nameclash with other system headers) necessary for compiling
9976 (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
9977 so that modules can include the (renamed) installed headers and
9978 be guaranteed a matching implementation.
9979 * lib/m4error.h: renamed from error.h.
9980 * lib/m4obstack.h: renamed from obstack.h.
9981 * lib/m4regex.h: renamed from regex.h.
9982 * configure.in (AC_REPLACE_FUNCS): Don't look for a system
9983 implementation, simply include the shipped version
9984 unconditionally, otherwise it is hard for a module to know
9985 whether the m4obstack.h header it is using matches the
9986 implementation it ends up linking against.
9987 (jm_WITH_REGEX): Include regex into libm4 unconditionally for
9990 1999-05-18 Gary V. Vaughan <gary@gnu.org>
9992 * examples/misc.test: Don't run this test on machines which don't
9993 have a root user in /etc/passwd (e.g. cygwin).
9995 * tests/get-them (/^@example$/): Error messages might have a
9996 ``.exe'' suffix to the program name, or else use the libtool
9997 ``.libs/lt-m4'' binary, or generally have an unexpected path. All
9998 of these cases are now catered for when comparing error messages
10000 * tests/other-tests/*.test: ditto.
10001 * examples/*.test: ditto.
10003 * tests/defs (M4): use libtool execute mode.
10004 * examples/defs (M4): ditto.
10006 * tests/get-them (END): explicitly close any open file.
10007 (printthem): In a regular expression, '{' is the start of a repeat
10008 count! Use `[{]' for a literal open brace.
10009 (/^@node /): Don't use substr on a string shorter than the trim
10012 1999-05-17 Gary V. Vaughan <gary@gnu.org>
10014 * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
10016 (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
10018 2000-01-10 Andreas Schwab <schwab@suse.de>
10020 * tests/other-tests/gmp.test: Find config.sh in build directory.
10022 * configure.in: Find tests/mkconfig.sh in $srcdir.
10024 * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
10025 <signal.h> (for SUS2 compliant systems).
10027 * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
10030 2000-01-10 René Seindal <rene@seindal.dk>
10034 * TODO, NEWS: Cleaned up and updated.
10036 * src/m4.c (main): New variable exit_status for exit status in
10037 case of unreadable files. Now m4 will exit with EXIT_FAILURE if a
10038 file cannot be read instead of EXIT_SUCCESS.
10040 * src/builtin.c (m4_indir): Changed error message to help
10041 translators (from Akim Demaille <demaille@inf.enst.fr>).
10043 * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
10046 * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
10049 * src/input.c (match_input): Reordering of code, to avoid multiple
10050 calls to push_string_init() from obstack_grow(), which can happen
10051 with some compilers (found and fixed by James Bonfield
10052 <jkb@mrc-lmb.cam.ac.uk>).
10054 * src/stackovf.c: Added prototypes for ultrix.
10055 (setup_stackovf_trap): Added __P to cast.
10056 (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
10058 2000-01-09 René Seindal <rene@seindal.dk>
10060 * doc/m4.texinfo (Changequote): Added comment about changing
10061 quotes when the old quote is a part of the new.
10063 * src/builtin.c (expand_ranges): Added break after trailing dash.
10064 This caused misbehavious on some systems (found and fixed by Akim
10065 Demaille <demaille@inf.enst.fr>).
10067 * AUTHORS: Thomas Tanner included
10069 * acconfig.h: Added entry for ss_sp (see below).
10071 * configure.in (use_stackovf): Added check for stack_t with member
10072 ss_base instead of ss_sp (BSDI notably). (Reported by Paul Eggert
10073 <eggert@twinsun.com>).
10075 * doc/m4.texinfo (Frozen files): Added a simpler example for
10076 generating frozen files from several input files.
10078 1999-11-14 Paul Eggert <eggert@twinsun.com>
10080 * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
10081 lib/regex.c, lib/xmalloc.c.
10083 1999-11-10 René Seindal <rene@seindal.dk>
10085 * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
10087 * src/module.c: reindented.
10088 (module_load): return if this is a repeated load of same module.
10089 (module_init): slight change of logic to avoid repeated
10090 initialisation debug messages.
10092 * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
10093 in the distribution.
10095 * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
10096 automake warnings about missing lib prefix.
10097 (time_la_LDFLAGS): ditto
10098 (stdlib_la_LDFLAGS): ditto
10100 1999-11-10 Paul Eggert <eggert@twinsun.com>
10102 * src/m4.h: Include error.h, since our macros use error.
10103 * src/m4.c: Don't need to include error.h.
10105 1999-11-09 Paul Eggert <eggert@twinsun.com>
10107 * src/m4.h (voidstar): Define to void * if __STDC__ is defined
10108 and zero, as Solaris 7 cc does.
10109 (bcopy): Remove macro; no longer needed with new obstack.h.
10111 * src/output.c (freeze_diversions): Don't assume that a
10112 diversion size can fit in `int'. Check for diversion file
10113 size too large to be printed with `unsigned long'.
10115 * src/Makefile.am (CFLAGS): Omit -Wall.
10117 * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
10119 * src/debug.c (trace_format):
10120 Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
10122 * src/freeze.c (produce_frozen_state):
10123 Don't assume string lengths fit in int.
10125 1999-10-13 René Seindal <rene@seindal.dk>
10127 * po/cs.po: Czech translation added.
10129 * po/sv.po: Updated Swedish translation.
10131 * po/ru.po: Updated Russian translation.
10133 * po/pl.po: Updated Polish translation.
10135 * po/el.po: Greek translation added.
10137 1999-10-13 René Seindal <rene@seindal.dk>
10139 * configure.in (ALL_LINGUAS): Added Greek translation (el).
10140 (ALL_LINGUAS): Added Czech translation (cs).
10142 1999-03-30 Gary V. Vaughan <gary@gnu.org>
10144 * src/builtin.c: moved module loading functions into...
10145 * src/module.c: entirely new implementation using libltdl.
10146 * po/POTFILES.in: added src/module.c.
10147 * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
10148 are modules, not linktime libraries.
10149 (LDFLAGS): added -no-undefined -module and -avoid-version flags.
10150 * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
10151 avoidance on exported symbols.
10152 * modules/test.c (m4_macro_table, m4_init_module,
10153 m4_finish_module): ditto.
10154 * modules/time.c (m4_macro_table): ditto.
10156 * modules/time2.m4: new file which requires command line loading
10158 * src/m4.c (--load-module): dynamically load named runtime module
10159 into running executable before reading the source.
10160 (--module-directory): prepend a directory to the module search
10162 (module_init()): Do this the first time we load a module instead;
10163 if the module subsystem is broken normal m4 scripts can still run.
10164 * src/m4.h (install_builtin_table): is now exported.
10166 1999-03-26 Gary V. Vaughan <gary@gnu.org>
10168 * src/module.c: removed. No longer required.
10169 * po/POTFILES.in: removed src/module.c.
10171 * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
10172 the bootstrap script can recreate.
10173 * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
10174 * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
10175 * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
10176 * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
10177 (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
10178 * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
10179 * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
10180 * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
10182 * acinclude.m4: removed. `aclocal -I acm4' handles this much
10184 * acm4/Makefile.am (ACINCLUDE_M4): ditto.
10185 * acm4/gettext.m4: removed. It causes a multiple definition vs.
10186 the installed gettext.m4 file when running aclocal.
10188 1999-03-25 Gary V. Vaughan <gary@gnu.org>
10190 * configure.in (AM_INIT_AUTOMAKE): bumped version number to
10191 distinguish this from the last prerelease.
10192 (AC_LIBLTDL_CONVENIENCE): build libltdl as a convenience library
10193 in its own subdirectory.
10195 * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
10196 lib prefix on a module" feature.
10197 (LDFLAGS): Added `-module -avoid-version' flags to build
10198 versionless module libraries.
10199 * src/builtin.c (m4_load_module): use libltdl.
10200 (module_unload_all): use libltdl.
10201 * src/m4.c (module_init): initialise module loading on demand for
10202 better diagnostics, and so that m4 will still work even if
10203 the module code is broken.
10204 * src/m4.h (module_init): removed. No longer relevant.
10205 * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
10206 exported symbols for compatibility with dlpreopening.
10207 * modules/test.c (m4_macro_table, m4_init_module,
10208 m4_finish_module): ditto.
10209 * modules/time.c (m4_macro_table): ditto.
10211 * bootstrap: New file. Runs all the autoutils in the right order
10212 after a fresh checkout, or a make maintainer-clean.
10214 1999-02-18 Akim Demaille <demaille@inf.enst.fr>
10216 * src/builtin.c (dump_symbols): New function, factoring common
10217 content of m4_dumpdef and m4_symbols.
10218 (m4_dumpdef): Use it.
10219 (m4_symbols): New function, implementing `symbols'. Use it.
10220 * doc/m4.texinfo: Fixed missing commas after @xref, so that the
10221 file compile with modern makeinfo.
10222 (Symbols): New node, documenting symbols.
10223 (direntry): Modernize.
10225 1998-12-11 René Seindal <rene@seindal.dk>
10227 * src/builtin.c (predefined_tab): New predefined macros
10228 __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
10229 configure time options.
10231 1998-12-01 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
10233 * src/module.c (module_try_load): Don't try to be clever and
10234 overwrite argument string. Instead allocate all constructed
10235 strings locally, since they can have arbitrary lengths. Make
10236 arguments pointers to const.
10237 (module_search): Simplify due to above change.
10239 1998-11-29 René Seindal <rene@seindal.dk>
10243 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
10245 * tests/other-tests/import-environment.{m4,test}: New test.
10247 * tests/other-tests/discard-comments.{m4,test}: New test.
10249 * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
10251 * src/m4.c (main): New option -c --discard-comments.
10252 New global variable discard_comments.
10254 * src/m4.h (token_type): New TOKEN_NONE for tokens to be
10255 discarded, ie never returned from next_token().
10256 Added declaration of discard_comments.
10258 * src/input.c (next_token): Now loops until token type is not
10259 TOKEN_NONE. Comments are now given this type when comments should
10262 * doc/m4.texinfo (Invoking m4): Updated for --import-environment
10265 1998-11-28 René Seindal <rene@seindal.dk>
10267 * src/m4.c (main): New option --import-environment (no single
10270 * When configured with --with-gmp both the normal (fast) eval()
10271 and the gmp aware mpeval() are defined. To restore previous
10272 bahaviour use "define(`eval', defn(`mpeval'))".
10274 * tests/other-tests/gmp.m4: Changed to use mpeval().
10276 * src/evalmp.c: New file for compiling eval.c as gmp aware.
10277 Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
10279 * src/eval.c: Now includes "numb.c" directly. Everything in this
10280 file must by static, except evaluate(), which is changed to
10281 mp_evaluate() if USE_GMP in force.
10283 * src/numb.c: Changed to be included by eval.c instead of being
10284 compiled separately. Everything is declared static.
10286 * src/numb.h: Removed declarations of functions, as numb.c is now
10287 included by eval.c.
10289 * src/builtin.c: Declaration of m4_mpeval() added.
10290 Inserted `mpeval' in builtin table.
10291 (do_eval): New function with common code for m4_eval and m4_mpeval.
10292 (m4_mpeval): New function for gmp version of eval.
10294 * src/m4.h: Declaration of mp_evaluate().
10296 * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
10297 (EXTRA_m4_SOURCES): Now has numb.c and numb.h
10299 * src/m4.c (main): m4 --version also shows which options were used
10300 for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
10302 1998-11-27 René Seindal <rene@seindal.dk>
10304 * Error messages now always print program name before input file
10305 name as specified by GNU coding standards. Reported by Akim
10306 Demaille <demaille@inf.enst.fr>.
10308 * doc/m4.texinfo (Include): Change due to changed error message
10312 * tests/get-them: Minor change to sed script due to changed error
10315 * src/m4.c (print_program_name): New func used to print program
10316 name, input file and line number in error (). Used as an
10317 error_print_progname handler.
10318 (reference_error): Removed.
10319 (main): Assigns error_print_progname.
10321 * src/m4.h (M4ERROR): Removed reference_error ().
10323 1998-11-25 René Seindal <rene@seindal.dk>
10325 * Updated to libtool 1.2b.
10327 * src/builtin.c (install_builtin_table): Added braces to avoid
10328 warning of ambiguous 'else'.
10330 * src/module.c: Inserted search path code from path.c modified to
10332 (module_init): Configured default path used only if M4MODPATH is
10334 (module_try_load): Now reads libMODULE.la as generated by libtool
10335 for actual module name.
10336 (module_load): Gives better error messages on failure.
10338 * src/m4.h: Added declarations of structures and functions for
10339 generic search path handling.
10341 * src/path.c: Removed all module specific code and introduced new
10342 functions of more generic search path handling.
10344 1998-11-24 René Seindal <rene@seindal.dk>
10346 * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
10347 included gettext, as <libintl.h> might not be found
10348 otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
10350 1998-11-22 René Seindal <rene@seindal.dk>
10352 * src/output.c (insert_diversion): Fixed bug that might cause m4
10353 to read from standard output! Triggered by input
10354 'divert(1)undivert(0)'. Test for divnum>0 changed to divnum>=0,
10355 so now 'undivert(0)' does nothing.
10357 1998-11-18 René Seindal <rene@seindal.dk>
10361 * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
10362 could be changed when compiling a illegal regexp, causing later
10363 use of the regexp to dump core.
10365 * src/module.c (module_load): Changed error message to conform to
10368 * src/m4.c (usage): Added message about reporting bugs.
10370 * doc/m4.texinfo (Changeword): Corrected a wrong example.
10371 (Changeword): Added note about the type of regexps used.
10373 * ltconfig, ltmain.sh: New files from Libtool 1.2.
10375 * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
10376 and AM_PROG_LIBTOOL.
10378 * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
10381 * modules/Makefile.am: Changed completely to compile modules using
10382 libtool. The modules are compiled as shared libraries, and are
10383 renamed when installed.
10385 * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
10386 USE_SHL_LOAD to HAVE_SHL_LOAD
10388 * src/builtin.c (shipout_string): Now tests for a NULL string.
10390 * src/module.c: New level of indirection around non-portable
10391 functions to load shared objects. Intended to encapsulate the non
10392 portable parts better and to reduce the number of #ifdefs in the
10395 * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
10396 directory modules/ to the distribution.
10398 1998-11-15 René Seindal <rene@seindal.dk>
10402 * modules/stdlib.c: New module `stdlib' defining some standard
10403 functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
10404 getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
10406 * src/builtin.c (shipout_string): New convenience function for
10407 builtins and modules.
10409 * src/module.c (module_load): Tentative support for
10410 shl_load/shl_findsym, but I cannot test it. Copied from MetaHTML.
10412 * Makefile.am (SUBDIRS): Directory modules added if configured.
10414 * modules/Makefile.am: Now correctly compiles and installs
10415 modules in pkglibexecdir.
10417 * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
10418 These two are now initialised by autoconf macros.
10420 * src/path.c (module_env_init): MODULE_PATH is always on the
10423 * src/Makefile.am: Now generated pathconf.h which defined the
10424 default MODULE_PATH.
10426 * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
10427 where modules are installed.
10429 * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
10430 by Brian J. Fox <bfox@datawave.net>. This change allow modules to
10431 build and install automatically, and it is prepared for other
10432 interfacec than dlopen().
10434 * src/builtin.c (predefined_tab): Added __m4_version__ for the
10435 current version of GNU m4. It is a GNU extension.
10437 1998-11-14 René Seindal <rene@seindal.dk>
10439 * tests/Makefile.am (GENERATED_TESTS): Added new
10440 generated-tests/changesy.8.test
10442 * doc/m4.texinfo (Changesyntax): Documentation for escape
10445 * src/macro.c (expand_token): Check for escaped macro call before
10446 symbol table lookup.
10448 * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
10451 * src/input.c: New static variable use_macro_escape, which is TRUE
10452 iff some character has code SYNTAX_ESCAPE
10453 (input_init): Added initialisation of use_macro_escape.
10454 (check_use_macro_escape): New function to synchronise
10455 use_macro_escape with the syntax table.
10456 (set_quotes): Added call to check_use_macro_escape()
10459 (next_token): Added new case for IS_ESCAPE.
10461 * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
10463 1998-10-13 René Seindal <rene@seindal.dk>
10467 * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
10470 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
10471 maintained tests in tests/other-tests. These currently tests for
10472 8-bit transparency, multiple precision arithmetic and sync-line
10473 output. Test for stackoverflow detection does not work.
10475 * examples/Makefile.am (TESTS): Added tests for all example files.
10477 * examples/mktests.sh: New file. Help program for creating test
10480 * tests/mkconfig.sh: New file to generate tests/config.m4 and
10481 tests/config.sh. This is for tests of configure selectable
10482 features. Picks up all set WITH_ and ENABLE_ veriables from
10485 * src/path.c (path_search): Added argument 'char **expanded_name'
10486 to return the expanded name.
10488 * src/m4.h: Added 2nd argument to declaration of path_search().
10490 * src/m4.c (main): Added 2nd argument to path_search().
10492 * src/freeze.c (reload_frozen_state): Do.
10494 * src/builtin.c (m4_undivert): Do.
10497 1998-10-11 René Seindal <rene@seindal.dk>
10499 * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
10501 * acm4/modules.m4: New file. Defines AM_WITH_MODULES.
10503 * acm4/gmp.m4: New file. Defines AM_WITH_GMP.
10505 * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
10507 * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
10509 * intl/: Updated to GNU gettext 0.10.35.
10511 * doc/m4.texinfo (Format): Documented that format is blind.
10513 * src/builtin.c (builtin_tab): Builtin format marked as blind.
10515 1998-10-07 René Seindal <rene@seindal.dk>
10519 * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
10520 .test, as the files are no longer just m4 input.
10522 * tests/get-them (FILE): Changed .m4 extension to .test.
10524 * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
10525 Otherwise quoted strings with leading whitespace first in a macro
10526 argument would be eliminated.
10528 * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
10529 (expand_argument): Do.
10531 * src/input.c (next_token): SPACE and NUM/OTHER characters are only
10532 grouped together iff both quote and comment strings are single
10533 character. Otherwise they might include a comment/quote leader.
10534 (next_token): Returns new token type TOKEN_SPACE.
10536 * src/builtin.c (push_builtin_table): New function to push a
10537 builtin_table on the stack without installing its contents.
10538 (find_builtin_by_name): Added call to push_builtin_table() if
10539 reading frozen files. Otherwise the builtins named in the frozen
10540 files could not be found.
10541 (install_builtin_table): Changed to use push_builtin_table()
10543 1998-10-04 René Seindal <rene@seindal.dk>
10545 * po/pl.po: Polish translation added.
10547 * po/POTFILES.in: src/module.c added.
10549 1998-10-04 René Seindal <rene@seindal.dk>
10553 * configure.in (ALL_LINGUAS): Added Polish pl.po
10555 1998-10-03 René Seindal <rene@seindal.dk>
10557 * Many files: Incorporated changes to implement dynamic modules.
10558 Detailed comments in src/modules.c and modules/README
10560 * src/module.c: New file, implements the OS dependant parts of
10561 dynamic module loading.
10563 * src/Makefile.am (m4_SOURCES): Added module.c
10565 * src/builtin.h: New file, declares some functions from builtin.c
10566 that are of use for other modules (shipout_int, numeric_arg,
10567 skip_space, bad_argc), and the macros ARG() and DECLARE().
10569 * src/builtin.c (install_builtin_table): New function. Each
10570 module brings in a builtin_table, which is pushed on a stack.
10571 (struct builtin_table): New struct for list of builtin_tables.
10572 (m4_loadmodule): New function to implement builtin "loadmodule".
10573 (shipout_int): No longer static, to be used by modules.
10577 (builtin_init): changed to call install_builtin_table()
10578 (find_builtin_by_name): Now searches all builtin_tables
10579 (find_builtin_by_addr): do.
10581 * src/path.c: Reorganised to allow for two search paths, one for
10582 include files and one for modules.
10584 * src/m4.h: Added declarations for new functions in module.c and
10587 * src/m4.c (main): Added call to module_init().
10589 * modules: New directory with a few demo modules.
10591 * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
10594 * configure.in: Added modules/Makefile to AC_OUTPUT.
10596 * configure.in: Added code to implement --with-modules. Tests for
10597 <dlfcn.h> and -ldl.
10599 * acconfig.h: Added WITH_MODULES
10601 1998-10-02 René Seindal <rene@seindal.dk>
10603 * examples/Makefile.am (pkgdata_DATA): Removed special target for
10604 check and variables TESTS. These tests are now run from the
10607 * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
10608 directory. The files stay there but the tests are run from the
10611 * tests/Makefile.am (EXTRA_DIST): Added run-test.
10613 * tests/run-test: New file. Run a test manually
10615 * tests/Makefile.am, tests/get_them: Moved automatically generated
10616 tests (from the manual) to sub directory tests/gentest/. The
10617 tests/ directory had gotten a bit messy.
10619 1998-09-06 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10621 * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
10622 wrap}.test: Added a few testcases.
10624 1998-08-21 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10628 * lib/Makefile.am (noinst_HEADERS): regex.h added
10630 * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
10631 acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
10633 * acm4/Makefile.am: created providing rules to create
10634 $(top_srcdir)/acinclude.m4 to be used by aclocal.
10636 * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
10637 `C'. Reported by Ulrich Drepper.
10639 * Makefile.am (SUBDIRS): Removed checks directory
10640 * configure.in (AC_OUTPUT): Removed checks/Makefile
10642 * doc/m4.texinfo (Patsubst,example): @comment added to preserve
10643 the space when m4.texinfo is edited and whitespace.el is active.
10644 (Defn,example): idem.
10646 1998-08-20 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10648 * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
10649 ../COPYING. ../Makefile is a file which is certainly present when
10650 test is executed in testSubDir. One can't be sure that the COPYING
10651 file is in .. or ../.. in all situations, the ../Makefile is
10654 * doc/m4.texinfo (Include): adjusted expected test output
10655 according to new tests, i.e. the input will always come from the
10656 file `in' created by the test.
10658 * tests/Makefile.am: Added three lines at the top to get
10659 esyscmd.1.test working.
10661 * tests/get-them: modified to generate clearer tests who will need
10662 less maintenance when new test examples are created in
10663 `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
10664 need the generic file `defs') shell scripts creating `in', `ok',
10665 `out' and when apropriate `okerr' and `err' in the directory
10666 `testSubDir' when executed. The compare of `ok' and `out'
10667 (and of `okerr' and `err') will be the exit status of the test.
10668 `out' must match `ok' (and `okerr' must match `err') for the test
10671 * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
10672 the tests generated by tests/get-them getting it input normally
10673 from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
10674 (dot) before the numeric part) is reserved for all other (hand
10675 written) tests. The `+' means one or more times.
10677 1998-08-12 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10679 * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
10680 supported short man page to refer to info documentation
10681 * helptoman.pl: added
10682 * configure.in: AC_PATH_PROG(PERL,perl)
10683 * Makefile.am (SUBDIRS): doc after src
10685 * libitized with libit 0.5 from
10686 ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
10688 * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
10689 * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
10690 replacement functions, (libm4_a_LIBADD): @LIBOBJS@
10691 * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
10692 lib/rx.{c,h}: added
10693 * configure.in (AC_CHECK_FUNC): getopt_long
10695 * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
10697 * TODO: added entry about dependencies
10699 1998-08-10 René Seindal <rene@seindal.dk>
10703 * doc/m4.texinfo (Changesyntax): Added documentation for the macro
10706 * src/builtin.c (m4_changesyntax): Added builtin macro
10707 "changesyntax" to modify the syntax table.
10709 * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
10710 table. All categories are assigned a syntax code and tokens are
10711 read according to this table.
10713 1998-08-09 René Seindal <rene@seindal.dk>
10715 * src/numb.{c,h}: New files, implements multiple precision eval
10716 using GNU gmp. Originally submitted by John Gerard Makecki
10717 (johnm@vlibs.com), later modified. Tested with GNU gmp 2.0.2.
10719 * doc/m4.texinfo (Eval): Added documentation for multiple
10720 precision arithmetic library support.
10722 * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
10723 to accommodate multiple precision eval.
10725 1998-08-07 René Seindal <rene@seindal.dk>
10727 * src/input.c (MATCH, match_input), src/m4.h: changed definition
10728 of comment and quote strings to `unsigned int' to allow eight bit
10729 chars (reported by andrewb@zip.com.au (Andrew Bettison)).
10731 * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
10732 patch from Mike Howard <mike@clove.com>
10734 1998-08-06 René Seindal <rene@seindal.dk>
10736 * gettext.m4: corrected AM_WITH_NLS to handle use of installed
10739 1998-08-03 René Seindal <rene@seindal.dk>
10743 * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
10744 and _ macro. M4 now builds with --disable-nls.
10746 * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
10747 to look for right message catalogs. Call indef'ed by ENABLE_NLS.
10749 * configure.in (ALL_LINGUAS): Added complete list of translations:
10750 de fr it ja nl ru sv.
10752 1998-05-23 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10754 * po/nl.po: Dutch translation by Erick Branderhorst.
10756 * po/fr.po: French translation by Erick Branderhorst, based on the
10757 translations by François Pinard in fr.msg and m4.cod.
10759 1998-05-22 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10763 * src/m4.c: #include <signal.h> not <sys/signal.h>.
10765 * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
10767 * checks/Makefile.am: explicit list tests in CHECKS.
10769 * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
10770 src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
10771 mkinstalldirs, install-sh: Added automake (1.3) support.
10773 * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
10774 obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
10775 Used libitize (0.4) to update.
10777 * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
10778 (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
10779 README accordingly.
10781 * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
10782 stack overflow functionality.
10784 1994-12-03 François Pinard <pinard@iro.umontreal.ca>
10786 * Prerelease 1.4.1.
10788 * Makefile.in (realclean-local): Delete stamp-h.in.
10790 * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
10791 Localize, adapting from how it is done in sharutils.
10793 * fr.tt: New file, for French.
10795 * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
10796 src/freeze.c: Rename PRODUCT to PACKAGE.
10798 1994-11-26 François Pinard <pinard@iro.umontreal.ca>
10800 * configure.in: Check for <libintl.h> and <locale.h>.
10801 * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
10802 src/stackovf.c: Rename _ to __P.
10803 * src/m4.h: Declare _ as a macro returning its argument, or else,
10804 include <libintl.h> and declare _ as gettext.
10805 * src/m4.c: Possibly include <locale.h> and call setlocale.
10806 * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
10807 src/input.c, src/macro.c, src/output.c, src/path.c,
10808 src/stackovf.c, src/symtab.c: Use _ macro over all localizable
10811 1994-11-07 François Pinard <pinard@iro.umontreal.ca>
10813 * doc/Makefile.in (stamp-vti): Use new -r option to date.
10815 * configure.in: Put --with-gmp in place, in prevision for John
10817 * acconfig.h: Document WITH_GMP.
10819 1994-11-05 François Pinard <pinard@iro.umontreal.ca>
10823 * doc/Makefile.in (realclean): Also remove stamp-vti.
10824 Reported by Eric Backus.
10826 1994-11-02 François Pinard <pinard@iro.umontreal.ca>
10828 * src/freeze.c (produce_frozen_state): If the frozen file cannot
10829 be opened, return immediately after producing the error message.
10830 Reported by Andreas Schwab.
10832 * configure.in: Check for const only after having found possible
10833 ANSIfying compiler flags, this is of no use to check it before.
10834 Reported by Alexander Lehmann.
10836 1994-11-01 François Pinard <pinard@iro.umontreal.ca>
10838 * src/macro.c (collect_arguments): Cast obstack arguments to
10839 (voidstar), so avoiding compiler warnings.
10840 Reported by Joseph E. Sacco.
10842 * src/freeze.c (produce_frozen_state): Cast printed lengths to
10843 (int) so they correspond to %d format items.
10844 Reported by Joseph E. Sacco.
10846 * src/m4.c (main): Cast the argument to xfree to (voidstar).
10847 * src/symtab.c (free_symbol): Idem.
10848 Reported by Karl Vogel.
10850 1994-10-31 François Pinard <pinard@iro.umontreal.ca>
10852 * Makefile.in (DISTFILES): Distribute BACKLOG.
10854 * configure.in: Define PRODUCT and VERSION.
10855 * acconfig.h: Document PRODUCT and VERSION.
10856 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
10857 constant string m4 and variable or parameter named version.
10859 1994-10-30 François Pinard <pinard@iro.umontreal.ca>
10861 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
10862 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
10863 defines __STDC__ to 0, for indicating it is *not* ANSI!
10864 Reported by Kaveh R. Ghazi.
10866 * configure.in: Added obsolescent tests for AIX and Minix.
10868 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
10869 which texclean does not exist anymore.
10870 Reported by Eric Backus, Jim Meyering, John David Anglin and
10873 1994-10-29 François Pinard <pinard@iro.umontreal.ca>
10875 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
10876 Reported by John David Anglin.
10878 * src/ansi2knr.c: New version, sent by Peter Deutsch.
10879 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
10880 ANSI2KNR, depending on the fact the compiler is ANSI or not.
10881 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
10882 Remove the sed filter after ansi2knr for debug.c. Use $O instead
10883 of $U, put underline in extensions rather than in basenames. Use
10884 implicit rules, now that regularity makes this possible.
10885 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
10886 of ansi2knr whenever it is needed.
10887 * configure.in: Adjusted for correct STACKOVF substitution.
10888 * src/debug.c (trace_format): When not __STDC__, use (...) as a
10889 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
10890 Reported by David MacKenzie.
10892 * Makefile.in: Remove binprefix. Use transform_name instead.
10893 Reported by David MacKenzie.
10895 * doc/Makefile.in: Create version.texi, use it, clean it.
10896 Reported by Jim Meyering.
10898 1994-10-28 François Pinard <pinard@iro.umontreal.ca>
10900 * Makefile.in (all, install, uninstall): Depend on Makefile.
10902 * Makefile.in: For actions invoking $(MAKE) from within compound
10903 sh statements, exit non-zero if the sub-make fails. Otherwise,
10904 the top-level make may exit successfully when it should fail.
10905 Reported by Jim Kingdon.
10907 * {,/*}Makefile.in: Use && after all cd, in case they fail.
10909 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
10910 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
10911 * configure.in: Substitute PRODUCT and VERSION.
10913 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
10915 1994-10-27 François Pinard <pinard@iro.umontreal.ca>
10917 * Makefile.in (mostlyclean-local): Do not remove *~.
10918 * */Makefile.in (mostlyclean): Idem.
10919 Reported by Robert E. Brown and Richard Stallman.
10921 1994-10-09 François Pinard <pinard@iro.umontreal.ca>
10923 * src/m4.h: Get rid of CONFIG_BROKETS.
10925 1994-10-02 François Pinard <pinard@iro.umontreal.ca>
10927 * configure.in: Use AC_ARG_PROGRAM.
10928 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
10929 Reported by David MacKenzie.
10931 1994-10-01 François Pinard <pinard@iro.umontreal.ca>
10933 * configure.in: Do not add -O to CFLAGS for GNU C, now that
10934 configure does it automatically.
10935 Reported by Jim Meyering.
10937 1994-09-23 François Pinard <pinard@iro.umontreal.ca>
10939 * src/stackovf.c: Declare the handler_t typedef earlier in the
10940 code, use it for stackovf_handler.
10941 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
10942 casting sigsegv_handler.
10943 Reported by Robert Bernstein.
10945 * src/m4.c (main): Initialize program_name to argv[0] without
10947 Reported by Karl Berry.
10949 1994-09-18 François Pinard <pinard@iro.umontreal.ca>
10951 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
10952 Reported by Karl Berry.
10954 1994-09-14 François Pinard <pinard@iro.umontreal.ca>
10956 * lib/Makefile.in (mostlyclean): Added.
10957 (TAGS): Make in $(srcdir).
10959 * configure.in: Use `choke me' in test, like everywhere!
10961 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
10962 unreacheable and useless.
10964 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
10966 * lib/Makefile.in (DISTFILES): Distribute TAGS.
10967 (distclean): Do not remove TAGS.
10968 (realclean): Remove it.
10969 * Makefile.in: Make TAGS in lib also, not just in src.
10970 Reported by Karl Berry.
10972 * Makefile.in (distclean, realclean): Instead of recursively
10973 calling $(MAKE) for the -local part, allow parallel execution of
10974 -recursive and -local, only delay the removal of config.status,
10975 which is repeated in both goals.
10977 1994-09-13 François Pinard <pinard@iro.umontreal.ca>
10981 * Makefile.in: Group all *clean-recursive goals in one, using sed
10982 to remove `-recursive' while calling make recursively. Also, use
10983 a subshell for each recursive $(MAKE).
10984 Reported by Jim Meyering.
10986 * src/m4.h (memcpy): Define with bcopy for BSD systems.
10987 Reported by Kaveh R. Ghazi.
10989 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
10990 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
10993 * configure.in: Use date instead of touch for stamp-h.
10994 * Makefile.in (stamp-h.in): Idem.
10996 * Makefile.in (distclean, realclean): Force serial execution of
10997 both goals, in case parallel makes are being used.
10998 Reported by Jim Meyering.
11000 * src/Makefile.in (DISTFILES): Distribute TAGS.
11001 (distclean): Do not remove TAGS.
11002 (realclean): Remove it.
11003 Reported by Karl Berry.
11005 1994-09-10 François Pinard <pinard@iro.umontreal.ca>
11007 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
11008 to old names, for following Autoconf.
11010 1994-09-08 François Pinard <pinard@iro.umontreal.ca>
11012 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
11013 ./install.sh will not be correctly referred to in sub-Makefiles.
11014 Reported by John David Anglin.
11016 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
11017 Reported by Eric Backus.
11019 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
11020 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
11021 config.status into remaking this directory's Makefile only.
11022 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
11023 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
11024 Reported by Jim Meyering.
11026 1994-09-06 François Pinard <pinard@iro.umontreal.ca>
11028 * configure.in: Correct stack overflow detection logic, taking
11029 care of systems having only incomplete implementations (like for
11030 Pyramid 9820 OSx 5.0d).
11031 Reported by Kaveh R. Ghazi.
11033 * src/Makefile.in (TAGS): Remote -t from etags call.
11035 1994-09-02 François Pinard <pinard@iro.umontreal.ca>
11037 * lib/Makefile.in (install): Depend on all.
11039 1994-08-31 François Pinard <pinard@iro.umontreal.ca>
11041 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
11042 Reported by Jim Meyering and John David Anglin.
11044 * Makefile.in (distclean-local): Delete config.log.
11045 Reported by Jim Meyering.
11047 Solidify frozen files with respect to -P:
11048 * src/m4.c: Have -P set prefix_all_buitins variable instead of
11049 calling a function by that name. Declare the variable.
11050 * src/m4.h: Adjust declaration for prefix_all_buitins.
11051 * src/builtin.c (builtin_init): Merge in functionality from
11052 previous prefix_all_buitins function, while making entries in the
11053 symbol table, but not modifying the builtin description itself.
11055 * src/freeze.c (reload_frozen_state): Add a useless `break;',
11056 because *many* compilers do not accept an empty `default:'.
11057 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
11058 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
11060 * configure.in: Use AC_TYPE_SIGNAL.
11061 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
11062 Reported by Robert Bernstein.
11064 * checks/Makefile.in (check): Modify PATH so check-them will find
11065 m4 in the src directory.
11066 * Makefile.in (check): Don't.
11067 Reported by Akiko Matsushita and Jim Meyering.
11069 * src/output.c (make_room_for, output_character_helper): New
11070 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
11071 a per buffer MAXIMUM_BUFFER_SIZE.
11073 * src/output.c (output_text): New function, for optimizing the
11074 output of strings of characters. Use it.
11076 1994-08-30 François Pinard <pinard@iro.umontreal.ca>
11078 * doc, src: New directories reorganizing the distribution.
11079 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
11081 * Makefile.in: Adjusted.
11082 * configure.in: Configure new Makefiles.
11084 * m4.h: Declare STRING typedef. Use it for comment and quote
11085 strings, adjusting all references. (This is the rudiments of a
11086 beginning for the eventual withdrawal of NUL terminated strings.)
11087 * output.c (shipout_text): Accept a length parameter, and use it.
11088 All callers adjusted.
11090 1994-08-29 François Pinard <pinard@iro.umontreal.ca>
11092 * m4.h: Include <unistd.h> if it exists.
11093 * stackovf.c: Don't.
11095 Clean up for current_diversion variable:
11096 * output.c: Move current_diversion from builtin.c.
11097 * m4.h: Declare current_diversion so builtin.c can access it.
11098 * output.c (output_init, make_diversion): Initialize or update
11100 * builtin.c (builtin_init, m4_divert): Leave current_diversion
11103 Remove limit on number of diversions:
11104 * output.c: Replace ndiversion by diversions, declare it.
11105 (output_init): Allocate only diversion 0.
11106 (make_diversion): Allocate new diversions as needed.
11107 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
11108 * m4.c: Still accept -N, but do nothing with it.
11109 Reported by David MacKenzie.
11112 * output.c (freeze_diversions): New function.
11113 * m4.h: Declare freeze_diversions.
11114 * freeze.c: Document frozen file format, revise it, call
11115 freeze_diversions to add diversions to frozen format, and code to
11116 reload them properly.
11117 * m4.c: Do not undivert automatically at end when status being
11118 frozen. Do not call builtin_init when reloading frozen state.
11120 Speed up diversion processing:
11121 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
11122 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
11123 structure and variables, cached variables out of output_diversion,
11124 reallocate_diversion_for and OUTPUT_CHARACTER.
11125 (shipout_text, make_diversion, insert_diversion): Adapted to new
11127 (insert_file): Use better buffering.
11128 Reported by David MacKenzie.
11130 1994-08-28 François Pinard <pinard@iro.umontreal.ca>
11132 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
11133 dist works from another build directory.
11135 1994-08-27 François Pinard <pinard@iro.umontreal.ca>
11137 * symtab.c (hack_all_symbols): Use hash_table_size instead of
11138 constant HASHMAX, for -H option to work better.
11140 * builtin.c (DECLARE): Simplify by using _ ().
11142 * freeze.c: New file.
11143 * Makefile.in: Compile it, distribute it.
11144 * m4.c: Recognize, document and process --freeze-state (-F) and
11145 --reload-state (-R) options. Pass a true flag to builtin_init
11146 only if no reloading some state.
11147 * builtin.c (define_builtin): Remove static specifier.
11148 (find_builtin_by_name): Remove static specifier.
11149 (builtin_init): Accept and obey a flag argument.
11150 * m4.h: Add declarations for freeze.c, changes for builtin.c.
11152 1994-08-24 François Pinard <pinard@iro.umontreal.ca>
11154 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
11157 * configure.in: Implement --with-dmalloc.
11158 * acconfig.h: Document WITH_DMALLOC.
11159 * m4.h: Add code for when WITH_DMALLOC.
11161 1994-08-15 François Pinard <pinard@iro.umontreal.ca>
11163 * m4.c (long_options): Use "error-output", the dash was missing.
11164 Reported by Akiko Matsushita.
11166 1994-08-12 François Pinard <pinard@iro.umontreal.ca>
11168 * m4.h: Include <sys/types.h>.
11169 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
11170 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
11172 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
11173 as size_t, not int.
11174 * builtin.c (dump_args): Declare len as size_t, not int.
11176 * debug.c: Prototype the forward declaration of debug_set_file.
11178 * builtin.c (m4_undivert): Replace div by file, for avoiding the
11179 shadowing of this variable.
11180 * output.c (insert_diversion): Idem.
11182 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
11183 (input_init): Duplicate default quote and comment strings.
11184 (set_quotes): Free previous quote strings in all cases. Duplicate
11185 even default quote strings.
11186 (set_comment): Free previous comment strings in all cases.
11187 Duplicate even default comment strings.
11189 * configure.in: Updated for Autoconf 2.0.
11190 * Makefile.in (distclean-local): Also delete config.cache.
11192 * m4.c (usage): Reorganize the --help output by topic. Include a
11193 description for debugging flags.
11195 1994-07-29 François Pinard <pinard@iro.umontreal.ca>
11197 * configure.in: If sigaction is available and SA_ONSTACK defined,
11198 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
11199 defined, use sigvec. Else don't compile stackovf.c.
11200 * stackovf.c (setup_stackovf_trap): Idem.
11201 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
11204 1994-07-21 François Pinard <pinard@iro.umontreal.ca>
11206 * m4.c (usage): Replace printf par fputs.
11208 1994-07-18 François Pinard <pinard@iro.umontreal.ca>
11212 1994-07-17 François Pinard <pinard@iro.umontreal.ca>
11214 * configure.in: Check for sigaction and sigvec. Add a new delayed
11215 check for RLIMIT_STACK, combine in the checking for getrlimit.
11216 All those things are not universally available.
11217 * stackovf.c: Split setting up the trap handler and catching
11218 signals, for better taking care of various configure outcomes.
11219 * examples/stackovf.sh: Correct a typo.
11220 Reported by Eric Backus, Jim Avera and Jim Meyering.
11222 1994-07-16 François Pinard <pinard@iro.umontreal.ca>
11224 * ansi2knr.c: New version sent by its author, Peter Deutsch.
11226 1994-07-15 François Pinard <pinard@iro.umontreal.ca>
11228 * Makefile.in: Modify so parallel make will not try making
11229 lib/libm4.a twice simultaneously.
11230 Reported by Jim Meyering.
11232 1994-07-14 François Pinard <pinard@iro.umontreal.ca>
11234 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
11235 error message, for when no code possibility exists. Even if this
11236 line is completely #ifdef'ed out, it brings a syntax error.
11237 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
11239 * Makefile.in (install): Have install depend on all too, for lib
11240 to be remade as needed.
11242 * examples/stackovf.sh: Try ksh, bsh and bash for shells
11243 providing ulimit, instead of using only ksh.
11244 Reported by Jim Avera and Joseph E. Sacco.
11246 1994-07-12 François Pinard <pinard@iro.umontreal.ca>
11248 * Makefile.in (check): Have it depend on all instead of m4. In
11249 this way, a change in lib will be detected and processed.
11251 * builtin.c (numeric_arg): Use strtol and verify the conversion,
11252 instead of using sscanf which stops as soon as there is a
11253 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
11254 and divert(1xyzzy) were all accepted without any warning or error
11256 * m4.h: Declare strtol as long if not including stdlib.h.
11257 * configure.in: Check for limits.h, and replace strtol if missing.
11258 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
11259 * lib/strtol.c: New file, from elsewhere.
11260 Reported by Andreas Schwab.
11262 1994-07-07 François Pinard <pinard@iro.umontreal.ca>
11264 * macro.c (expand_macro): Cast value to (boolean) prior to
11265 assigning it to traced.
11266 Reported by Tom McConnell.
11268 * Makefile.in (m4): Always make all in lib first.
11269 Reported by Jim Meyering.
11271 1994-07-06 Jim Avera <jima@netcom.com>
11273 * stackovf.c: Isolated OS-dependent sections; Improved portability,
11274 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
11275 handlers), and a default error message if the fault address is not
11276 available (when neither siginfo.h nor BSD sigcontext are supported).
11277 * configure.in: Changes for stackovf.h: Check for sigcontext,
11278 sigaction, sigstack, and define rlim_t as int if necessary.
11279 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
11280 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
11281 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
11283 1994-07-05 François Pinard <pinard@iro.umontreal.ca>
11285 * configure.in: Use AC_SET_MAKE.
11286 * Makefile.in: Use @SET_MAKE@.
11287 Reported by Jim Meyering.
11289 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
11290 Reported by Ian Taylor.
11292 1994-07-02 François Pinard <pinard@iro.umontreal.ca>
11294 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
11295 because siginfo.h is unrelated to standard headers, and siginfo.h
11296 is already checked for.
11297 Reported by Joseph E. Sacco.
11299 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
11301 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
11304 1994-06-29 François Pinard <pinard@iro.umontreal.ca>
11306 * builtin.c (substitute): Use \& to represent this part of the
11307 string which was matched by the whole regexp, instead of
11308 representing the whole string. Any usage of \0 issues a warning
11309 and acts like \&, it will disappear in some subsequent release.
11311 1994-06-27 François Pinard <pinard@iro.umontreal.ca>
11313 * m4.c: Complete prototype for forwarded declaration of usage.
11315 * input.c (init_macro_token): Correct own reference in error
11316 message. Previous name get_macro_func was referred to instead.
11317 (next_char): Correct own reference in error message. Previous
11318 name advance_input was referred to instead.
11320 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
11321 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
11322 and_term, not_term, logical_not_term, cmp_term, shift_term,
11323 add_term, mult_term, exp_term, unary_term, simple_term): Add
11324 prototype to forwarded declarations. Declare parameter v1 as
11325 eval_t * instead of int *. Same for local variable v2 in dyadic
11326 functions. Same for result in exp_term.
11327 * builtin.c (m4_eval): Declare value as eval_t instead of int.
11328 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
11329 unsigned_eval_t instead of unsigned int. Change casts accordingly.
11330 (shipout_int): Cast first argument of ntoa to eval_t.
11331 Reported by Thorsten Ohl.
11333 * macro.c: Complete the prototypes of forwarded expand_macro and
11335 Reported by Thorsten Ohl.
11337 * m4.h: Define voidstar as void * or char * depending on __STDC__.
11338 The Ultrix 3.1 compiler cannot do much with void pointers.
11340 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
11341 * m4.c (xfree): Replace void * by voidstar.
11342 Reported by Tom McConnell.
11344 * ansi2knr.1: New, from elsewhere.
11345 * Makefile.in (DISTFILES): Distribute ansi2knr.1
11347 * Makefile.in (stamp-h.in): Avoid running ./config.status if
11348 stamp-h does not exist yet. This avoids running it a second time
11349 just after the initial ./configure.
11350 Reported by David MacKenzie and Tom McConnell.
11352 * m4.h: Replace the enum debug_info declaration with a series of
11353 #define's. The Ultrix 3.1 compiler would otherwise need casting
11354 (int) to most references, when used in expressions.
11355 Reported by Tom McConnell.
11357 1994-06-25 François Pinard <pinard@iro.umontreal.ca>
11359 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
11360 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
11361 calls the compiler. Previously, FP_PROTOTYPES was only calling
11362 the preprocessor; by not being subject to CFLAGS, this was
11363 discouraging those flags asking for ANSI compilation.
11364 * acconfig.h: Document HAVE_PROTOTYPES.
11365 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
11366 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
11367 Reported by Eric Backus.
11369 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
11370 from the environment. Default CFLAGS to -g if not set.
11371 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
11372 * lib/Makefile.in: Have CFLAGS substituted from configure.
11373 Reported by Eric Backus and Tom McConnell.
11375 * configure.in: m4_undefine changeword before using AC_ENABLE.
11377 * m4.h: Declare prototypes for error (for ANSI compilers only),
11378 prefix_all_builtins and reference_error.
11379 Reported by Tom McConnell.
11381 * input.c (set_word_regexp): Do not try to initialize the array
11382 test from a string, this does not work with non-ANSI compilers.
11383 Reported by Eric Backus.
11385 * Makefile.in (dist): Clean examples/ before saving it.
11386 (distclean-local): Also remove stamp-h.
11387 Reported by Eric Backus.
11389 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
11390 non ANSI compilers.
11391 Reported by Tom McConnell.
11393 * checks/Makefile.in (clean): Depends on mostlyclean.
11394 (mostlyclean): New goal.
11396 1994-06-24 François Pinard <pinard@iro.umontreal.ca>
11398 * Makefile.in (DISTFILES): Distribute install.sh.
11399 * install.sh: New file, copied from elsewhere.
11400 Reported by Assar Westerlund and Kaveh R. Ghazi.
11402 1994-06-23 François Pinard <pinard@iro.umontreal.ca>
11404 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
11405 * acconfig.h: Explain ENABLE_CHANGEWORD.
11407 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
11408 from code provided by Pete Chown]
11409 * m4.h: Add original_text field to u_t variant of union u.
11410 Declare TOKEN_DATA_FUNC macro.
11411 * builtin.c: Declare changeword.
11412 (m4_changeword): New function.
11413 * input.c: Include "regex.h", define variables with word regexps.
11414 (input_init): Initialize the word regexp.
11415 (set_word_regexp): New.
11416 (next_token): Declare local variables, use the previous code if
11417 default_word_regexp is true. Else, match using a new code. Save
11419 * macro.c (expand_token): Ship out original text if not a macro
11421 Reported by Krste Asanovic and Pete Chown.
11423 [These modifs all depend upon ENABLE_CHANGEWORD]
11424 * m4.h: Declare external user_word_regexp.
11425 * m4.c: Declare user_word_regexp, and initialize it from
11426 --word-regexp or -W, or NULL if not specified.
11427 * input.c: Use user_word_regexp if specified, instead of
11428 DEFAULT_WORD_REGEXP.
11430 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
11433 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
11434 * checks/Makefile.in: Empty the suffix list.
11435 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
11437 * m4.c: Declare nesting_limit and initialize it to 250.
11438 Implement -LNUMBER or --nesting-limit=NUMBER to change its
11440 * m4.h: Declare nesting_limit as external.
11441 * macro.c (expand_macro): Stop execution whenever nesting limit
11443 Reported by Bengt Mertensson.
11445 * eval.c (evaluate): Diagnose excess characters in eval input.
11446 Things like `eval(08)' used to return 0 with no diagnostic.
11448 * m4.h: Capitalize first letter of all macro arguments in
11451 * m4.c: Declare warning_status, initialize it to 0. Add new
11452 option -E, or --fatal-warnings, which sets warning_status to
11453 EXIT_FAILURE instead.
11454 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
11455 EXIT_FAILURE if not otherwise done by header files.
11456 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
11457 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
11458 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
11459 argument of all M4ERROR calls.
11460 Reported by Noah Friedman.
11462 * examples/incl-test.m4: Renamed from incl_test.m4.
11463 * examples/include.m4: Include incl-test.m4 instead of
11465 * examples/multiquotes.m4: Renamed from multi-quotes.m.
11467 1994-06-22 François Pinard <pinard@iro.umontreal.ca>
11469 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
11470 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
11471 also tested it on a Sun Sparc workstation running SunOS 4.x.
11473 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
11474 49.format check, abusing a `union values' argument with sprintf
11475 without selecting the proper field. Now, save the formatting type
11476 first, delaying the fetch of the corresponding argument.
11477 Reported by Joseph E. Sacco and Tom Quinn.
11479 * format.c (format): Remove const from char *fmt declaration when
11480 not HAVE_EFGCVT, because a NUL may be forced into it.
11482 * m4.h: Declare atof() when not STDC_HEADERS.
11483 Reported by Joseph E. Sacco.
11485 * Regenerate configure using Autoconf 1.11, this corrects a
11486 problem about an incorrect cpp seting on NeXT 3.1.
11487 Reported by Alexander Lehmann.
11489 1994-06-05 François Pinard <pinard@iro.umontreal.ca>
11491 * m4.h (_): Change argument from `x' to `Args'.
11493 1994-04-22 François Pinard <pinard@iro.umontreal.ca>
11495 * m4.h: Rename Args() to _().
11496 * m4.h: Remove extern specifier from all function declarations.
11498 1994-04-22 Jim Avera <jima@netcom.com>
11500 * stackovf.c: New file implementing stack-overflow detection.
11501 * configure.in: Check for getrlimit, sigaction. If all of
11502 standard headers, getrlimit and sigaction, define USE_STACKOVF and
11503 substitute ${U}stackovf.o for STACKOVF.
11504 * acconfig.h: Declare USE_STACKOVF.
11505 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
11506 * m4.h: Declare setup_stackovf_trap().
11507 * m4.c: Call setup_stackovf_trap().
11508 * tests/stackovf_test.sh: New file.
11510 1994-04-13 François Pinard <pinard@iro.umontreal.ca>
11512 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
11514 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
11516 1994-01-30 François Pinard <pinard@iro.umontreal.ca>
11518 * m4.h: Remove definition of volatile, not used anymore.
11519 Reported by Jim Meyering and Joseph E. Sacco.
11521 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
11522 of `if ... else /* nothing */' for if macros.
11523 Reported by Jim Meyering.
11525 * builtin.c (m4_regexp): Reorganize the code for avoiding a
11526 warning from gcc about `repl' possibly used before defined.
11527 Reported by Jim Meyering.
11529 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
11530 Reported by Jim Meyering.
11532 1994-01-25 François Pinard <pinard@iro.umontreal.ca>
11534 * m4.h: Move the conditional definition of volatile after the
11535 inclusion of system files, because they may define it first.
11537 1994-01-04 François Pinard <pinard@iro.umontreal.ca>
11539 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
11540 get around a problem with Alpha make seeing a syntax error, there.
11541 Reported by Vern Paxson.
11543 1994-01-03 François Pinard <pinard@iro.umontreal.ca>
11545 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
11546 Reported by Richard Stallman.
11548 1993-12-25 François Pinard <pinard@iro.umontreal.ca>
11550 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
11551 instead of AC_HAVE_FUNCS.
11552 Reported by Noah Friedman.
11554 1993-12-01 François Pinard <pinard@iro.umontreal.ca>
11556 * m4.c: Initialize show_help and show_version to zero.
11558 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
11559 Use them in exit() and usage() calls.
11561 1993-11-27 François Pinard <pinard@iro.umontreal.ca>
11563 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
11564 syserr() macro. Delete errref, add reference_error and M4ERROR.
11565 * m4.c: Replace errref, which was returning an input reference
11566 string, with reference_error, which prints it on standard error.
11567 * builtin.c, output.c: Use errno as second parameter to error,
11568 instead of using syserr() with %s.
11569 * *.c: Use M4ERROR instead of error: no more errref() with %s.
11570 Doing so, the program name appears after the input reference
11571 instead of before, which eases M-x next-error processing.
11573 1993-11-24 François Pinard <pinard@iro.umontreal.ca>
11575 * checks/get-them: Escape braces with backslashes in patterns,
11576 because HPUX-9.01 awk needs this.
11577 Reported by Jim Meyering.
11579 1993-11-22 François Pinard <pinard@iro.umontreal.ca>
11581 * builtin.c: Declare "FILE *popen ();".
11583 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
11584 macros, replace error_message_prefix() declaration by errref()'s.
11585 Declare xrealloc, for use in errref().
11586 * m4.c: Delete error_message_prefix() function, add errref().
11587 * *.c: Use error() systematically in place of all error macros,
11588 now that error() flushes stdout first. Make needed adjustments.
11590 * m4.h: Remove const in sys_errlist[] declaration, it creates
11591 conflicts on SGI and Alpha.
11592 Reported by Kaveh R. Ghazi.
11594 1993-11-20 François Pinard <pinard@iro.umontreal.ca>
11596 * m4.c: Include <getopt.h> instead of "getopt.h".
11598 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
11599 * acconfig.h: New, for documenting HAVE_EFGCVT.
11600 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
11601 use them wherever appropriate. Also use -I. for compilations.
11602 * lib/Makefile.in: Use -I.. for compilations.
11603 * *.c: Include <config.h> or "config.h".
11605 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
11606 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
11608 1993-11-17 François Pinard <pinard@iro.umontreal.ca>
11610 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
11612 * input.c (input_init): Initialize quote and comment strings
11613 explicitely instead of calling set_quotes and set_comment: by
11614 doing so, we ensure we do not free uninitialized variables.
11616 * checks/check-them: Reverse arguments to both diff, so the
11617 expected is on the left and the obtained on the right.
11619 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
11620 macros. Delete declarations for m4error, warning, fatal and
11621 internal_error, add declaration for error_message_prefix.
11622 * m4.c: Delete m4error, warning, fatal and internal_error
11623 routines, add error_message_prefix routine.
11624 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
11625 warning with WARNING*, fatal with FATAL* and internal_error with
11627 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
11628 this is not needed anymore.
11630 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
11631 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
11632 and debug_message, add declaration for debug_message_prefix.
11633 * debug.c: Remove static specifier for FILE *debug declaration.
11634 Delete debug_print and debug_message routines, add
11635 debug_message_prefix routine.
11636 * builtin.c, debug.c: Replace debug_print routine calls with
11637 DEBUG_PRINT* macro calls.
11638 * input.c, path.c: Replace debug_message routine calls with
11639 DEBUG_MESSAGE* macro calls.
11641 * m4.h: Remove inclusion of <varargs.h>.
11642 * debug.c: Include <stdarg.h> or <varargs.h>.
11643 (trace_format): Use stdarg instead of varargs if __STDC__.
11645 * configure.in: Remove checks for vfprintf and _doprnt. These
11646 implementations use varargs tricks which are not portable enough.
11647 * lib/vfprintf.c: Deleted.
11648 * lib/_doprnt.c: Deleted.
11649 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
11650 Reported by Joel Sherrill.
11652 * path.c (add_include_directory): Use xstrdup.
11654 * builtin.c (find_builtin_by_name): Declare static.
11656 * *.[ch]: Add const to a few "char *" declarations.
11658 * configure.in: Remove commented tests for fileno() and fstat().
11659 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
11661 * debug.c (debug_flush_files): New.
11662 * m4.h: Declares it.
11663 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
11664 Reported by Nicolas Pioch.
11666 1993-11-12 François Pinard <pinard@iro.umontreal.ca>
11668 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
11669 Reported by Joel Sherrill.
11671 * builtin.c (prefix_all_builtins): Instead of the table size, use
11672 the null entry at end for stopping the loop. It was overwritten.
11673 Reported by Andreas Schwab and Jim Meyering.
11675 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
11676 Reported by Kaveh R. Ghazi.
11678 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
11679 Reported by Karl Vogel.
11681 1993-11-09 François Pinard <pinard@iro.umontreal.ca>
11683 * m4.h: Do not define volatile if already defined.
11684 Reported by René Seindal.
11686 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
11688 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
11689 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
11691 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
11693 * m4.h: Define strchr and strrchr in terms of index and rindex,
11694 instead of the other way around.
11695 * builtin.c, m4.c, path.c: Use strchr instead of index.
11697 * input.c (next_char): Remove a "break;" after a "return ...;".
11698 Reported by Tom McConnell.
11700 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
11704 * configure.in: Do not copy check files in the build hierarchy.
11705 * checks/check-them: Identify the m4 version being checked. For
11706 finding m4, look in $PATH instead of in the parent directory.
11707 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
11708 * checks/Makefile.in (.all-stamp): Always create check files in
11709 the source hierarchy, not anymore in the build hierarchy.
11710 (check): cd to the source hierarchy before performing checks.
11711 Do not copy nor clean COPYING anymore, take it from `..'.
11712 Reported by Tom McConnell.
11714 * Makefile.in (Makefile): Use $(SHELL).
11715 (config.status): Use $(SHELL). Use "config.status --recheck"
11716 instead of "configure --no-create", which is obsolete.
11717 Reported by Tom McConnell.
11719 1993-11-05 François Pinard <pinard@iro.umontreal.ca>
11721 * m4.c (usage): Use "%s" instead of "m4" in format string.
11722 Reported by Jim Meyering.
11724 * Makefile.in: Distribute mkinstalldirs.
11725 Reported by Pierre Gaumond.
11726 Reported by Jim Meyering.
11727 Reported by Tom McConnell.
11728 Reported by Andreas Gustafsson.
11730 * checks/check-them: Renamed from checks/check_them.
11731 * checks/get-them: Renamed from checks/get_them.
11732 * checks/.all-stamp: Renamed from checks/.all_stamp.
11733 * checks/Makefile.in: Changed accordingly.
11734 Reported by Jim Meyering.
11736 1993-11-04 François Pinard <pinard@iro.umontreal.ca>
11738 * lib/Makefile.in (dist): Correct permissions on files.
11740 * output.c: Declare tmpfile, some systems don't.
11742 1993-11-03 François Pinard <pinard@iro.umontreal.ca>
11744 * checks/Makefile.in (dist): Correct permissions on files.
11746 * Makefile.in (dist): Ensure recursive linking for subdirectory
11747 `examples', also set read/write permissions on all its files.
11749 * mkinstalldirs: New, from elsewhere.
11750 * Makefile.in: Use it.
11752 * debug.c: Synchronize debug messages and regular output when
11753 the debug file and stdout are redirected to the same file.
11754 * configure.in: Add (commented) checks for fileno and fstat.
11755 Reported by Jim Avera.
11757 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
11758 etc., arguments, then ignore the superfluous one. m4 used to
11759 diagnose missing arguments and return the empty string.
11760 Reported by Nick S. Kanakakorn.
11762 1993-11-02 François Pinard <pinard@iro.umontreal.ca>
11764 * m4.c (main): At end of all input, ensure all undiverted text
11765 goes to the main output stream.
11766 Reported by Andreas Gustafsson.
11768 * m4.c (main): exit (0), instead of return 0.
11770 * m4.c: Implement -P and --prefix-builtins.
11771 * builtin.c: Delete const specifier on builtin_tab.
11772 (prefix_all_builtins): New.
11773 Reported by Noah Friedman.
11774 Reported by Scott Bartram.
11776 * c-boxes.el: New, from elsewhere.
11777 * Makefile.in: Distribute it.
11779 * m4.h: Do not define bcopy if <string.h> defines it.
11780 Reported by Stephen Perkins.
11782 * builtin.c (define_macro): Allow a missing second argument, in
11783 which case it is implied empty. Affects define and pushdef.
11784 Reported by Eric Allman.
11786 1993-11-01 François Pinard <pinard@iro.umontreal.ca>
11788 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
11789 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
11790 * builtin.c: Initialize all the blindness fields in builtin_tab.
11791 (define_builtin): Copy the blindness of a builtin into its symbol.
11792 * macro.c (expand_token): Avoid processing a blind builtin if the
11793 next character is not an opening parenthesis.
11794 Reported by David MacKenzie.
11795 Reported by Noah Friedman.
11797 * configure.in: Ensure an exit status of 0 on completion.
11798 Reported by Vivek P. Singhal.
11800 * eval.c (eval_lex): Admit both lower and upper case letters for
11801 bases greater than 10. Only lower case letters were accepted.
11803 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
11804 Reported by Krste Asanovic.
11806 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
11807 * eval.c (logical_not_term): New name for not_term.
11808 * eval.c (xor_term): New, between or_term and and_term.
11809 * eval.c (not_term): New, between and_term and logical_not_term.
11810 * eval.c (shift_term): New, between cmp_term and add_term.
11811 Reported by Krste Asanovic: ~, ^, <<, >>.
11812 Reported by Ben A. Mesander: ** vs ^.
11814 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
11815 * m4.h: Delete xrealloc.c.
11816 * lib/xmalloc.c: New, from elsewhere.
11817 * lib/xstrdup.c: New, from elsewhere.
11818 * lib/Makefile.in: Distribute and compile them.
11820 * m4.c: Change progname to program_name.
11821 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
11822 * lib/error.c: New, from elsewhere.
11823 * lib/Makefile.in: Distribute and compile error.c.
11824 * configure.in: Check AC_VPRINTF and for strerror.
11825 * m4.c: Delete cmd_error. Use error instead.
11826 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
11828 * m4.h: Delete #define const, let Autoconf takes care of this.
11830 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
11831 Merge parse_args into main. Declare argv to be `char *const *',
11832 then remove superfluous casts.
11834 * m4.c: Rename --no-gnu-extensions to --traditional.
11835 Reported by Ben A. Mesander.
11837 * m4.c (usage): Add a status parameter. Supply one in various
11838 calls. Add --help processing. Remove -V for --version.
11840 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
11842 * lib/Makefile.in: Have an AR=ar declaration.
11843 Reported by Eric Backus.
11844 Reported by Bjorn R. Bjornsson.
11845 Reported by Tom Tromey.
11846 Reported by Kristine Lund.
11847 Reported by Marion Hakanson.
11849 1993-10-30 François Pinard <pinard@iro.umontreal.ca>
11851 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
11852 Reported by Noah Friedman.
11854 1993-10-25 François Pinard <pinard@iro.umontreal.ca>
11856 * Makefile.in: Remove MDEFINES and cleanup.
11858 1993-06-09 François Pinard <pinard@iro.umontreal.ca>
11860 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
11861 Create a gzip file.
11863 1993-02-06 François Pinard <pinard@iro.umontreal.ca>
11865 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
11866 ensure 777 mode for directories, so older tar's will restore file
11869 1993-01-17 François Pinard <pinard@iro.umontreal.ca>
11871 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
11872 so the installer can override automatically configured choices.
11873 Reported by Karl Berry.
11875 1993-01-15 François Pinard <pinard@iro.umontreal.ca>
11877 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
11878 previous version was not working properly on m68k-hp-bsd4.3.
11879 Reported by Roland McGrath.
11881 * lib/_doprnt.c: Stolen from Oleo distribution.
11882 * configure.in: Check for _doprnt.c if vfprintf.c selected.
11883 * lib/Makefile.in: Distribute _doprnt.c.
11884 Do not distribute regex.[ch].old anymore.
11886 1993-01-01 François Pinard <pinard@iro.umontreal.ca>
11888 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
11889 Richard wants it there.
11891 1992-12-27 François Pinard <pinard@iro.umontreal.ca>
11893 * Makefile.in: Add DEFS to MDEFINES.
11894 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
11895 (libm4.a): Remove the library before creating it.
11896 (distclean): Remove tags and TAGS too.
11898 1992-12-23 François Pinard <pinard@iro.umontreal.ca>
11900 * Makefile.in (dvi, m4.dvi): New goals.
11902 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
11903 macro.c, output.c, path.c, symtab.c: Change Copyright from
11904 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
11906 * examples/divert.m4: Deleted, this bug has been corrected.
11908 * Makefile.in (texclean, mostlyclean): New goals.
11910 * Makefile.in (clean): Remove clutter from ansi2knr.
11911 Reported by Pierre Gaumond.
11913 1992-12-20 François Pinard <pinard@iro.umontreal.ca>
11915 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
11916 might well use CFLAGS is s/he needs it.
11918 * Makefile.in: Allow installation of info files from a separate
11920 Reported by Jason Merrill.
11921 Reported by David MacKenzie.
11922 Reported by Skip Montanaro.
11923 Reported by Erez Zadok.
11924 Reported by Assar Westerlund.
11926 1992-12-19 François Pinard <pinard@iro.umontreal.ca>
11929 This is still a beta release for the future GNU m4 version 1.1.
11931 * lib/alloca.c: New, from elsewhere.
11932 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
11934 * m4.h: Do not define index/rindex if already defined. If
11935 FALSE/TRUE are already defined, do not redefine them, but merely
11936 define boolean typedef to int.
11938 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
11939 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
11940 because some C compilers do not like connectives with #ifdef.
11941 * m4.h: Define `volatile' only if __GNUC__, instead of once for
11942 __GNUC__ and once for __STDC__.
11943 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
11945 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
11946 Makefile dependencies. Without it, make keeps destroying and
11947 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
11949 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
11950 to diversion/DIVERSION, this was a spelling error.
11952 * m4.c: Declare version[], remove #include "version.h".
11953 * version.h: Deleted.
11954 * Makefile.in: Remove references to version.h.
11956 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
11957 production, by using a simpler and more robust algorithm. This
11958 solves the problem of synclines sometimes written in the middle of
11959 an output line. Delete sync_line() and output_lines variable.
11960 * m4.h: Remove sync_line prototype and output_lines declaration.
11961 * input.c (next_char), output.c (shipout_text): Remove references
11963 * input.c (push_file, pop_file): Merely put the value -1 in
11964 output_current_line instead of calling sync_line, for delaying a
11965 single `#line NUM FILE' before next output line. Do not test
11966 for sync_output, because this is unnecessary clutter.
11967 * output.c (make_divertion, insert_divertion): Idem.
11968 * input.c: Rename must_advance_line to start_of_input_line, for
11971 * debug.c (trace_header): Select a new debug line format, which
11972 better complies with GNU standards for formatting error messages.
11973 With option `-dfl', M-x next-error might be used on the output.
11974 * m4.c (vmesg): Adjust format of error output to GNU standards.
11975 * m4.texinfo: Adjust examples for `make check' to work.
11977 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
11978 case for enum debug_info constants, which were all lower case.
11980 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
11982 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
11983 collected patches. I tried a few times using newer regex.[ch], it
11984 mysteriously stopped aborting with this one. Insecure feeling...
11985 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
11987 1992-12-18 François Pinard <pinard@iro.umontreal.ca>
11989 * m4.c: Change `--no-warnings' to `--silent'.
11990 Reported by David MacKenzie.
11992 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
11993 leave it off for now. See comment in m4.c for justification.
11994 Reported by David MacKenzie.
11996 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
11997 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
11999 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
12001 * Makefile.in: Ensure recursive cleaning is done before local
12002 cleaning for all clean goals.
12004 * builtin.c (ntoa): Ensure the value is always interpreted as a
12005 signed quantity, whatever the radix is.
12007 1992-11-18 Jim Meyering <meyering@idefix>
12009 * builtin.c, format.c, input.c: Split long lines.
12010 * m4.c: Use typedef macro_definition instead of struct
12012 * symtab.c: Use typedef symbol instead of struct symbol.
12014 1992-11-17 François Pinard <pinard@iro.umontreal.ca>
12016 * *.[ch]: Remove all trailing whitespace, in code and comments.
12018 * configure.in: Find some awk.
12019 * Makefile.in: Add $(AWK) to MDEFINES.
12020 * checks/Makefile.in: Transmit $(AWK) to get_them.
12021 * checks/get_them: Use $AWK instead of gawk. Add a close in the
12022 awk script when switching files, because without this, mawk runs
12023 out of file descriptors.
12025 1992-11-16 François Pinard <pinard@iro.umontreal.ca>
12027 * Makefile.in (realclean): Delete m4.info*.
12028 Reported by Jim Meyering.
12030 * Makefile.in: Adjust and link with checks/Makefile.
12031 * checks/Makefile.in: New.
12032 * configure.in: Output checks/Makefile.
12034 * checks/get_them: Have the dnl header of each test more
12035 recognizable by next-error, also use a better message.
12037 1992-11-16 Jim Meyering <meyering@idefix>
12039 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
12040 And use that only if __GNUC__ since we're using it's GCC-specific
12041 semantics that tell the compiler the associated function doesn't
12044 * builtin.c (substitute): Don't use character as an array index.
12045 (dumpdef_cmp): Make formal arguments `const void *' to avoid
12046 warnings with gcc -W -Wall on systems with qsort prototype.
12047 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
12050 * eval.c (most functions): Add parentheses to assignments used
12051 as truth values go avoid warnings from gcc -Wall.
12053 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
12054 any functions that don't need external scope.
12056 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
12057 (many functions and arrays): Declare `const'.
12059 1992-11-15 François Pinard <pinard@iro.umontreal.ca>
12061 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
12062 removing the declaration from m4.h. Also rename false to FALSE
12065 * lib/Makefile.in (Makefile): New goal.
12067 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
12068 so heavily loaded. It gets more easily overridable, calling make.
12069 Reported by Jim Meyering.
12071 * Makefile.in (dist): Get .fname from the current directory name,
12072 instead of from version.h. I need updating many files manually,
12073 when the version changes, version.h is just one of them.
12075 1992-11-14 François Pinard <pinard@iro.umontreal.ca>
12077 * m4.h: Remove the tag `boolean' on the enum introducing typedef
12078 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
12079 Reported by Tom McConnell.
12081 1992-11-13 François Pinard <pinard@iro.umontreal.ca>
12083 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
12084 39.cleardiv, which were describing missing or spurious newlines.
12085 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
12086 do not depend on machine word size, `/bin/false' implementation,
12087 or `wc' output format. `make check' is more dependable, now.
12089 * checks/check_them: Summarize the failed tests by listing their
12090 name, at end. If none, issue `All checks successful'. Output
12091 `Checking' instead of `Input file:'.
12093 * checks/get_them, checks/check_them: Reindented.
12095 * Makefile.in (dist): chmod a+r before making the tar file.
12097 1992-11-12 François Pinard <pinard@iro.umontreal.ca>
12099 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
12101 * input.c (next_token): Reinitialize token_buttom just after using
12102 it as a watermark with obstack_free. Or else, a future token, big
12103 enough for triggering reallocation of the obstack chunk, could
12104 void the initialized value of token_buttom, later causing panic in
12105 obstack_free. Rename token_buttom to token_bottom everywhere.
12107 * m4.h: Before declaring errno, first include <errno.h> and
12108 ensure that it does not define errno.
12109 Reported by Richard Stallman.
12111 1992-11-11 François Pinard <pinard@iro.umontreal.ca>
12113 * builtin.c: Define and use DECLARE macro for builtins.
12115 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
12116 argument, this is a common idiom for introducing long comments.
12118 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
12119 arguments. The last argument was silently ignored.
12121 * m4.c (cmd_error): Add a missing semicolon before va_end().
12123 1992-11-10 François Pinard <pinard@iro.umontreal.ca>
12125 * Makefile.in: Now handle protoized sources. Define and use U.
12126 Compile and use ansi2knr with old compilers. Update DISTFILES.
12127 Add `aclocal.m4' to `configure' dependencies.
12128 * ansi2knr.c: New, from Ghostscript distribution.
12129 * configure.in: Define U through FP_PROTOTYPES for old compilers.
12130 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
12131 * aclocal.m4: New, provide FP_PROTOTYPES.
12132 * m4.h: Conditionnaly protoized through Args, save for varags.
12133 * builtin.c: Protoized. Then:
12134 Include <sys/types.h> if size_t is not defined, before "regex.h".
12135 (m4_ifelse): Fetch built-in name properly for diagnostic.
12136 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
12137 (m4_regexp): Add const to `msg' declaration.
12138 (m4_patsubst): Add const to `msg' declaration.
12139 * debug.c: Protoized, save for varargs.
12140 * eval.c: Protoized.
12141 * format.c: Protoized.
12142 * input.c: Protoized.
12143 * m4.c: Protoized, save for varargs. Then:
12144 (xfree): Accept void * instead of char *.
12145 (xmalloc): Return void * instead of char *.
12146 (xrealloc): Accept and return void * instead of char *.
12147 * macro.c: Protoized.
12148 * output.c: Protoized.
12149 * path.c: Protoized. Then cast some (char *) over xmalloc's.
12150 * symtab.c: Protoized.
12152 1992-11-06 François Pinard <pinard@iro.umontreal.ca>
12154 * m4.texinfo: Remove directory from diagnostics in 30.include,
12155 51.eval, 56.errprint and 57.m4exit tests.
12157 * m4.h: Remove declarations for int or void system functions, they
12158 cause more conflicting trouble than they make good.
12160 * configure.in: Avoid configuration header file. Add some tests.
12161 * m4.h: Remove #include "config.h".
12162 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
12163 Then, rewritten for better compliance with GNU standards.
12165 1992-11-05 François Pinard <pinard@iro.umontreal.ca>
12167 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
12168 because of a misplaced #endif.
12170 * Many *.[hc] files: Correct intra-line spacing here and there,
12171 according to GNU indent 1.6 advice.
12173 * configure.in: New, using Autoconf 1.2.
12174 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
12175 * Delete old configure.in, configure, etc/configure.in,
12176 etc/configure, lib/configure.in, lib/configure and config/*.
12177 Reported by Jason Merrill.
12179 * symtab.c (hash): Change (char) NULL to '\0'.
12180 Reported by Jason Merrill.
12182 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
12183 etc/nextvers.sh. Release numbers will be edited `by hand'.
12184 * version.h: De-automatize, force value in.
12186 * m4.c: Changes in order to use a newer getopt.h.
12187 Reported by David MacKenzie.
12189 * checks/: New name for examples/.
12190 * checks/get_them: New location for etc/get_examples.
12191 * checks/check_them: New location for etc/check_examples.
12192 * Makefile.in, checks/get_them, checks/check_them: Adjust.
12193 * lib/vfprintf.c: New location for etc/vfprintf.c.
12194 * Delete empty etc/.
12195 * examples/: New name for test/.
12197 1992-03-10 François Pinard <pinard@iro.umontreal.ca>
12199 * Makefile.in (check): Add m4 as dependency.
12201 * m4.c: Accept --no-warnings instead of --no_warnings, and
12202 --no-gnu-extensions instead of --no_gnu_extensions. Make the
12203 usage message more informative.
12204 Reported by David MacKenzie.
12206 1992-03-09 François Pinard <pinard@iro.umontreal.ca>
12208 * etc/check_examples: New name for check_examples.sh.
12209 * etc/get_examples: New name for get_examples.sh.
12210 * Makefile.in, etc/Makefile.in: Use new names.
12212 * Makefile.in: Transmit $(CC) while making in lib.
12214 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
12215 code disposition by hand.
12217 1992-03-08 François Pinard <pinard@iro.umontreal.ca>
12219 * m4.h: Delete definitions for abort() and exit().
12220 Reported by Richard Stallman.
12222 * config/hmake-unicos, config/s-unicos.h: New files.
12223 Reported by Hal Peterson.
12225 * eval.c (exp_term): Have N^0 return 1.
12226 Reported by Michael Fetterman.
12228 * eval.c, input.c, m4.h: Remove last comma in enums.
12229 Reported by Mike Lijewski.
12231 * Transfer of maintenance duties from René to François.
12233 1991-10-24 René Seindal <seindal@diku.dk>
12235 * Release 1.0. Many thanks to those, who provided me with bug
12236 reports and feedback.
12238 * Uses GNU configure, taken from the gdb distribution.
12240 * Uses GNU getopt(), with long option names.
12242 * The -Q/+quiet option is added, which suppresses warnings about
12243 missing or superflous arguments to built-in macros.
12245 * Added default options via the M4OPTS environment variable.
12247 * The built-in format can now be configured to use sprintf as
12248 the formatting engine, for systems without [efg]cvt(3).
12250 * GNU library code is moved to the ./lib subdirectory; other
12251 utility files are now in ./etc.
12253 * Several minor bugs have been fixed.
12255 1991-07-26 René Seindal <seindal@diku.dk>
12257 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
12258 François Pinard and Roland H. Pesch for providing me with reports.
12260 * The builtins incr and decr are now implemented without use of
12263 * The builtin indir is added, to allow for indirect macro calls
12264 (allows use of "illegal" macro names).
12266 * The debugging and tracing facilities has been enhanced
12267 considerably. See the manual for details.
12269 * The -tMACRO option is added, marks MACRO for tracing as soon
12272 * Builtins are traced after renaming iff they were before.
12274 * Named files can now be undiverted.
12276 * The -Nnum option can be used to increase the number of
12277 divertions available.
12279 * Calling changecom without arguments now disables all comment
12282 * The function m4_patsubst() is now consistently declared
12285 * A bug in dnl is fixed.
12287 * A bug in the multi-character quoting code is fixed.
12289 * Several typos in the manual has been corrected. More probably
12292 * The m4.info file is now installed along with the program.
12294 1990-11-15 René Seindal <seindal@diku.dk>
12296 * Updated and enhanced version. Release 0.75, manual 0.07.
12298 * Implemented search path for include files (-I option and
12299 M4PATH envronment variable).
12301 * Implemented builtin "format" for printf-like formatting.
12303 * Implemented builtin "regexp" for searching for regular
12306 * Implemented builtin "patsubst" for substitution with regular
12309 * Implemented builtin "esyscmd", which expands to a shell
12312 * Implemented "__file__" and "__line__" for use in error
12315 * Implemented character ranges in "translit".
12317 * Implemented control over debugging output.
12319 * Implemented multi-character quotes.
12321 * Implemented multi-character comment delimiters.
12323 * Changed predefined macro "gnu" to "__gnu__".
12325 * Changed predefined macro "unix" to "__unix__", when the -G
12326 option is not used. With -G, "unix" is still defined.
12328 * Changed "shift", "$@" and "$*" to not insert spaces afters
12331 * Added program name to error messages.
12333 * Fixed two missing null bytes bugs.
12335 1990-01-22 René Seindal <seindal@diku.dk>
12337 * Initial beta release. Release 0.50, manual 0.05.
12346 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
12347 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
12349 Copying and distribution of this file, with or without
12350 modification, are permitted provided the copyright notice
12351 and this notice are preserved.