1 2006-10-27 Eric Blake <ebb9@byu.net>
3 * bootstrap (gnulib): No longer a need to patch after gnulib-tool
5 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
6 0.16, since 0.15 is incompatible with our automake requirement.
8 * m4/macro.c (expand_argument): Fix missing initialization.
9 * m4/m4private.h (struct m4_symbol_value): Store entire
10 m4_builtin, not just the func.
11 (m4_get_symbol_value_func): Update.
12 (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
14 * m4/m4module.h (m4_get_symbol_value_builtin)
15 (m4_get_symbol_builtin): New prototypes.
16 (m4_set_symbol_value_func): Delete, replace with...
17 (m4_set_symbol_value_builtin): New function.
18 (m4_builtin_find_by_name): Change signature.
19 * m4/symtab.c (m4_symbol_value_print): Simplify.
20 (m4_get_symbol_value_func): Update.
21 (m4_get_symbol_value_builtin): New function.
22 (m4_set_symbol_value_func): Delete, replace with...
23 (m4_set_symbol_value_builtin): New function.
24 (dump_symbol_CB) [DEBUG_SYM]: Simplify.
25 * m4/builtin.c (m4_builtin_find_by_name): Change signature.
26 * m4/input.c (struct m4_input_block): Remove unused trace member.
27 (m4_push_builtin, builtin_print, init_builtin_token): Update
29 * m4/module.c (install_builtin_table): Likewise.
30 * src/freeze.c (reload_frozen_state): Likewise.
31 * modules/gnu.c (builtin): Make it possible to retrieve a builtin
32 token, even after the builtin has been undefined.
33 * doc/m4.texinfo (Builtin): Document new capability.
36 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
38 * modules/m4.c (m4_make_temp): Use it.
39 * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
41 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
43 * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
46 2006-10-26 Eric Blake <ebb9@byu.net>
48 Silence -O2 -Wall -Wwrite-strings warnings.
49 * m4/m4private.h (m4_symbol_value): Const-ify text.
50 * m4/m4module.h (m4_get_symbol_value_text)
51 (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
52 (m4_set_symbol_value_placeholder): Likewise.
53 * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
55 * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
56 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
57 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
59 * modules/format.c (format): Likewise.
60 * src/main.c (main): Likewise.
61 * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
62 * modules/shadow.c (shadow, test): Likewise.
63 * m4/output.c (m4_make_diversion): Don't hold on to empty
65 (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
66 (m4_freeze_diversions): Likewise. Don't use uninitialized
69 Convert diversions to list instead of sparse array, part 2.
70 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
72 * m4/output.c (m4_diversion): Add next pointer and divnum members.
73 (diversion_table): Convert to a list instead of a sparse array.
74 (free_list): Maintain free list of reclaimed diversions.
75 (equal_diversion_CB, cmp_diversion_CB): New functions.
76 (m4_output_init): Set up list.
77 (m4_output_exit): Tear down list.
78 (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
80 (m4_make_diversion): Change creation of new diversions.
81 (m4_insert_diversion_helper): New function, to avoid list
83 * tests/builtins.at (divert): The test now passes.
84 * NEWS: Document this improvement.
86 Convert diversions to list instead of sparse array, part 1.
87 * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
89 * m4/output.c (diversion, total_buffer_size, output_unused):
90 Track size in size_t. All users changed.
91 (struct diversion): Reduce size now, to compensate for part 2.
92 (m4_make_diversion, make_room_for): Avoid malloc overflow.
93 (m4_output_exit): Fix typo in assert.
94 (m4_output_init, make_room_for, m4_make_diversion)
95 (m4_insert_diversion, m4_freeze_diversions): Adjust users of
96 struct m4_diversion to disambiguate the new union.
97 * tests/builtins.at (divert): Detect this failure.
99 2006-10-25 Eric Blake <ebb9@byu.net>
101 * m4/m4module.h (m4_push_builtin): Add parameter.
102 * modules/m4.c (defn): Update caller.
103 * m4/input.c (file_read_init, string_read_init): No longer
105 (input_funcs): Change signature of read_func, all callers
107 (composite_peek, composite_read, composite_unget),
108 (composite_print, composite_funcs): New input type. Not yet
109 fully utilized, but one step closer to fixing defn.
110 (m4_input_block): Make every input block track current file and
111 line. Rename some members. Remove unused out_line. Add support
112 for composite input block.
113 (input_change): New flag.
114 (file_peek, file_read, file_clean, file_unget, file_print):
116 (m4_push_file, m4_push_builtin, m4_push_string_init)
117 (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
118 (m4_skip_line, pop_input): Track input block changes.
119 (m4_pop_wrapup): Avoid overflow.
120 (init_builtin_token): Handle composite input.
121 (next_char): Handle input block changes.
122 * doc/m4.texinfo (Location): Remerge from branch.
124 * src/m4.h (includes): Need <locale.h> after all; fixes
125 regression from yesterday.
127 * m4/system_.h (obstack_regrow): New macro. Hopefully glibc will
129 * m4/macro.c (expand_macro): Avoid referencing invalid memory.
130 Handle nesting the argc obstack.
131 (expand_token): Avoid unnecessary malloc.
132 (collect_arguments): Copy name before invalidating it.
133 (argc_stack, argv_stack): New variables.
134 (m4_macro_expand_input): Initialize argc and argv stacks once per
135 file, instead of once per macro.
137 2006-10-24 Eric Blake <ebb9@byu.net>
139 * src/m4.h (includes): Add gettext.h, for N_. Assume setlocale.
141 2006-10-23 Eric Blake <ebb9@byu.net>
143 * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
144 from branch regarding stripped leading whitespace.
146 * modules/m4.c (includes): Use safe headers even when configured
147 with --enable-assert.
148 (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
149 #defined as mkstemp_safer.
151 2006-10-21 Eric Blake <ebb9@byu.net>
153 * modules/m4.c (m4_make_temp): Change signature.
154 (maketemp, mkstemp): Update callers.
155 * modules/m4.h (m4_make_temp_func): New export.
156 * modules/gnu.c (mkdtemp): New macro.
157 * doc/m4.texinfo (Operation modes): Document interaction with
160 * tests/builtins.at (mkdtemp): New test.
161 (mkstemp): Check for umask effect.
162 * NEWS: Document new builtin.
164 * tests/generate.awk (normalize): Update recognition of trailing
166 * doc/m4.texinfo: Minor formatting fixes from branch.
167 (Foreach, Improved foreach): Merge from branch.
168 * examples/foreach.m4: Merge from branch.
169 * examples/foreachq.m4: New file from branch.
170 * examples/foreach2.m4: Likewise.
171 * examples/foreachq2.m4: Likewise.
173 * doc/m4.texinfo (titlepage): Add myself as author.
174 * src/main.c (AUTHORS): Likewise.
176 2006-10-19 Eric Blake <ebb9@byu.net>
178 * modules/m4.c (m4_make_temp, mkstemp): New functions.
179 (maketemp): Add POSIX behavior and a warning.
180 * tests/others.at (maketemp): Move this test...
181 * tests/builtins.at (mkstemp): ...to here, and beef up.
182 * tests/options.at (--safer): Update to new warning message.
183 * doc/m4.texinfo (Mkstemp): Sync from branch.
184 (Extensions): Update maketemp behavior.
185 * NEWS: Document that maketemp now always warns.
187 * tests/generate.awk: For ease of doc-writing, simplify selection
188 of '-Ipath/to/examples' to '@comment examples'.
189 * examples/forloop.m4: Simplify.
190 * examples/forloop2.m4: New file.
191 * examples/quote.m4: New file.
192 * doc/m4.texinfo (Improved forloop): New node.
193 (Manual): Clarify use of examples directory.
194 (Shift, Forloop): Resync from branch.
195 (Include, Location): Update to new usage of examples directory.
197 * m4/system_.h (includes): Pick up <unistd.h> before checking for
199 (gettext_noop): Don't define here, let gettext.h do it instead.
200 * po/POTFILES.in: Update entries to reflect gnulib imports.
202 2006-10-16 Eric Blake <ebb9@byu.net>
204 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
206 * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
207 pkglibexecdir support.
208 * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
209 worry about pathconf.h, now that gnulib does it for us.
210 (pkgmodincludedir): Simplify.
211 (pkglibexecdir): Delete, now that automake does this.
212 * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
213 * src/main.c (usage): Likewise.
214 * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
216 * doc/m4.texinfo: Port some changes from the branch.
217 (Invoking m4): Promote to a chapter, instead of a section of
219 (Operation modes, Dynamic loading features, Preprocessor features)
220 (Limits control Frozen state, Debugging options)
221 (Command line files): Subdivide into new sections.
222 (Cleardivert): Rename from cleardiv.
224 2006-10-14 Eric Blake <ebb9@byu.net>
226 * tests/others.at (stdin closed): Update to match previous patch.
228 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
230 Reported by Ralf Wildenhues.
232 * modules/m4.c (undivert): Merge from branch.
233 * doc/m4.texinfo (Improved fatal_error): Fix typo.
234 (Improved exch): New node, copied from branch.
235 (Improved cleardivert): Update from branch.
238 2006-10-13 Eric Blake <ebb9@byu.net>
240 * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
242 * modules/gnu.c (builtin, indir): Transparently handle builtin
244 * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
245 * m4/input.c (m4_pop_wrapup): Display debug message when switching
247 (m4_input_init): No need to use empty file any more.
248 (file_print): Display correct file name.
249 * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
250 dereference a NULL file name.
251 * m4/m4module.h (m4_pop_wrapup): New parameter.
252 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
254 * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
255 * m4/symtab.c (m4_symbol_value_groks_macro): New method.
256 * src/main.c (main): Adjust caller.
257 * tests/options.at (--debugmode): Test more output from -dV.
259 2006-10-12 Eric Blake <ebb9@byu.net>
261 * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
263 * m4/m4private.h (m4__next_token_is_open): New prototype.
264 * m4/m4module.h (m4_push_single): Delete; push_string is an
265 adequate interface, and removing support for this simplifies the
267 (m4_push_wrapup): New parameter.
268 (m4_is_syntax): Delete; m4_has_syntax is sufficient.
269 (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
270 start-quote and start-comment exclusive from other syntax
272 * m4/syntax.c: Likewise.
273 * m4/input.c (input_funcs): Make polymorphic without requiring
274 clients to know whether they are located at isp. All users
276 (file_names): New variable.
277 (m4_input_init): Initialize it.
278 (m4_push_file): Use it.
279 (m4_input_exit): Free it after use.
280 (m4__next_token): Simplify slightly.
281 (m4__peek_token): Rename and simplify...
282 (m4__next_token_is_open): ... to this. In particular, this
283 allows us to avoid a double ungetc, which POSIX doesn't
285 (struct m4_input_block, m4_push_single, single_peek, single_read):
286 Remove support for single characters, as the input engine now
287 guarantees we don't need it.
288 (file_unget, string_unget, m4_input_print, unget_input):
289 Strengthen assertions.
290 (file_init_funcs, file_read_init): New for file reading.
291 (string_init_funcs, string_read_init): New for wrapped text.
292 (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
293 Support wrapped text with locations.
294 (m4_skip_line): Support dnl across include file boundary.
295 (peek_char): Don't pop input when peeking.
296 (file_peek): Peek can be called at the end of the file.
297 (string_read): Don't read beyond string bounds.
298 * m4/macro.c (expand_token, collect_arguments): Update callers.
299 (expand_macro): Report errors at location of open parenthesis.
300 (expand_token, expand_argument, process_macro): Avoid negative
301 array dereferences with m4_has_syntax.
302 * m4/utility.c (skip_space): Likewise.
303 * modules/m4.c (m4wrap): Update caller.
304 * tests/builtins.at (__file__, __line__, dnl): New tests.
305 * tests/options.at (--debugmode): Normalize the output.
306 * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
307 Remerge recent changes from branch.
308 (Improved fatal_error): New node from branch.
310 2006-10-11 Eric Blake <ebb9@byu.net>
312 * src/main.c (usage, long_options): Add --debugmode as an alias
313 for --debug, to match macro name.
314 * tests/options.at (--debugmode): Rename from --debug, and test
316 (--discard-comments): Augment test.
317 * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
320 2006-10-10 Eric Blake <ebb9@byu.net>
322 Trace improvements: debugmode(c) was always printing the last two
323 lines paired, combine them; and show non-text expansions.
324 * m4/macro.c (trace_prepre): Update to show what the macro will
326 (trace_pre): No need to special-case on debugmode(c).
327 (trace_post): Likewise. Also, show non-text expansions.
328 (expand_macro): Update caller. Collecting arguments can change
329 debug mode, so cache values beforehand.
330 (trace_format): Remove support for unused %l%S%r, and fix support
331 for %z to match gcc's attribute((printf)).
332 (trace_header): Update caller.
333 * m4/input.c (struct m4_input_block): Rename from input_block.
334 (struct input_funcs): Add print_func member.
335 (file_print, builtin_unget, builtin_print, string_print)
336 (m4_input_print): New functions.
337 (m4_push_string_finish): Change return type.
338 (m4_push_file): Fix missing use of close parameter.
339 * m4/debug.c (m4_debug_decode): Don't clear pending traces.
340 * m4/m4module.h (m4_input_print): New prototype.
341 * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
342 to match behavior change.
343 * tests/options.at (--debug): Likewise.
344 * tests/macros.at (Propagation of traceon)
345 (Propagation of --trace): Likewise.
346 * tests/others.at (stderr closed, stdout closed, stdin closed):
348 * doc/m4.texinfo (Forloop): Simplify.
349 (Trace): Update to changed behavior.
350 (Debugmode): Document this change.
351 * src/main.c (usage): Likewise.
354 2006-10-09 Eric Blake <ebb9@byu.net>
356 * m4/path.c (m4_include_env_init): Don't alter result of getenv.
357 Reported by Ralf Wildenhues.
359 * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
361 2006-10-07 Eric Blake <ebb9@byu.net>
363 * m4/m4module.h (m4_set_exit_failure): New prototype.
364 * m4/utility.c (m4_set_exit_failure): New function.
365 * modules/m4.c (m4exit): Use it to avoid yet another global
366 variable export in libm4.
368 2006-10-06 Eric Blake <ebb9@byu.net>
370 * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
372 * tests/others.at (stdout closed): Fix final check.
374 Replace uses of tmpfile with clean-temp, since tmpfile is
375 incompatible with closeout.
376 * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
378 * tests/others.at (stderr closed): Likewise.
379 * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
380 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
382 * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
383 (m4_tmpfile, cleanup_tmpfile): New functions.
384 (make_room_for, m4_insert_diversion): Use clean-temp module.
385 * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
387 * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
389 * m4/utility.c (m4_numeric_arg): Merge from branch.
390 * modules/gnu.c (debuglen): New builtin.
391 * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
392 Rename --arglength to --debuglen.
393 * tests/options.at (--arglength): Rename to --debuglen.
394 (deprecated options): Augment test.
395 * doc/m4.texinfo (Invoking m4): Document the name change.
396 (Debugmode): Rename from Debug Levels.
397 (Debugfile): Rename from Debug Output.
398 (Debuglen): New node.
399 * NEWS: Document these changes.
401 * modules/m4.c (m4exit): Fix typo. Ensure desired exit status in
402 case closing a module exits.
404 * modules/m4.c (m4exit): Merge from branch.
405 * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
407 2006-10-05 Eric Blake <ebb9@byu.net>
409 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
411 * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
412 * src/main.c (main): Close stdout on exit.
413 * m4/debug.c (set_debug_file): Check for write failure.
414 * m4/m4.c (m4_delete): Don't mask write failure.
415 * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
416 macros before calling AT_CHECK.
417 (M4_ONE_MEG_DEFN): New helper macro.
418 * tests/others.at (stdout full): New test.
419 (stderr closed, stdin closed, stdout closed): Augment.
420 * tests/builtins.at (syscmd): New test.
423 2006-10-04 Eric Blake <ebb9@byu.net>
425 * tests/builtins.at: Alphabetize tests.
426 * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
427 * tests/generate.awk (new_test): Fix underquoting.
428 * tests/others.at (maketemp): Rename from misc.
429 (stdin closed, stdout closed, stderr closed): New tests.
431 2006-10-03 Eric Blake <ebb9@byu.net>
433 Avoid all global variables in modules, so that --disable-static
435 * examples/incl.m4: New file, from branch.
436 * Makefile.am (dist_pkgdata_DATA): Distribute it.
437 * doc/m4.texinfo (Location): Merge this section from branch.
438 (Include): Update the test.
439 * tests/generate.awk (new_test): Allow for VPATH build
440 pre-processing of expected __program__ output.
441 * m4/m4module.h (m4_current_diversion, m4_output_current_line):
442 Avoid global variables.
443 (m4_context_field_table): Add current_diversion, output_line.
444 (m4_output_init, m4_make_diversion): Add parameter.
445 (m4_get_program_name, m4_set_program_name): New accessors.
446 * m4/m4private.h (m4_get_current_diversion),
447 (m4_set_current_diversion, m4_get_output_line)
448 (m4_set_output_line): New accessors.
449 * m4/utility.c (m4_get_program_name, m4_set_program_name): New
451 * modules/m4.c (divnum, divert): Adjust callers.
452 * modules/gnu.c (__program__): Likewise.
453 * m4/output.c (m4_output_init, m4_make_diversion)
454 (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
455 (m4_insert_diversion): Likewise.
456 * m4/input.c (file_clean, m4_push_file): Likewise.
457 * src/freeze.c (reload_frozen_state): Likewise.
458 * src/main.c (main, usage): Likewise.
460 Partially plug memory leak when unloading gnu module.
461 * tests/modules.at (unload gnu module): New test.
462 * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
463 (m4_regexp_compile): Move static storage to module visibility.
464 * tests/options.at (--debug): Adjust to new output.
466 2006-09-29 Eric Blake <ebb9@byu.net>
468 Even when not the first option, --help can't have side effects.
469 * tests/options.at (--debugfile): Detect bugs in this area.
470 * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
472 * src/main.c (main): Fix it by deferring debugfile change. Also,
473 defer closing streams until after module tracing is done.
474 * modules/gnu.c (debugfile): Make message consistent with command
476 * doc/m4.texinfo (Invoking m4): Touch up the documentation.
477 * NEWS: Document this fix.
479 * modules/m4.c (dnl): Include macro name in warning message.
480 * m4/input.c (m4_skip_line): Add parameter.
481 * m4/m4module.h (m4_skip_line): Likewise.
482 * src/main.c (usage): Update wording.
483 * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
484 issue of blind macros vs. POSIX is resolved.
485 (Dnl): Merge another node from branch.
487 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
489 * m4/system_.h (N_): Define.
490 * src/main.c (main): Validate numeric arguments.
491 (size_opt): New function, idea borrowed from coreutils.
492 * m4/macro.c (expand_macro): -L0 implies no limit.
493 * doc/m4.texinfo (Invoking m4): Document this change.
495 * tests/options.at: (--arglength, --nesting-limit)
496 (--regexp-syntax): New tests of argument validation.
498 2006-09-28 Eric Blake <ebb9@byu.net>
500 * tests/options.at: Alphabetize the tests.
502 2006-09-27 Eric Blake <ebb9@byu.net>
504 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
505 another parameter to print module info.
506 * m4/macro.c (trace_pre): Adjust caller.
507 * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
508 * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
509 * NEWS: Document this.
511 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
513 * m4/symtab.c (symbol_value_print): Rename to...
514 (m4_symbol_value_print): ...this, and...
515 (m4_symbol_print): Update to allow -L length truncation. Now
516 truncation also affects dumpdef output and builtin names.
517 * m4/m4private.h (nesting_limit, max_debug_argument_length):
519 * m4/m4module.h (m4_symbol_print): Add parameter.
520 (m4_symbol_value_print): New function.
521 * modules/m4.c (dumpdef): Allow length truncation.
522 * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
524 * doc/m4.texinfo (Invoking m4): Document -l better.
525 (Dumpdef, Debug Levels): Document the effect of -l.
526 * NEWS: Document this change.
528 * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
529 (m4_expand_ranges): Ensure we aren't picking up partial object on
531 * modules/stdlib.c (setenv): Allow extra arguments.
532 * modules/time.c (ctime): Avoid side effect in call to
534 * modules/gnu.c (m4_regexp_substitute): Likewise.
535 (renamesyms): Avoid extra obstack_init.
536 * src/freeze.c (reload_frozen_state): Remove debug comment.
537 (produce_frozen_state): Simplify fprintf to puts where possible.
538 * modules/modtest.c (modtest_init, modtest_finish): Likewise.
539 * modules/import.c (import, symbol_fail, modules_fail): Likewise.
540 * m4/macro.c (trace_flush): Likewise.
541 * m4/debug.c (m4_debug_message_prefix): Likewise.
542 * m4/path.c (include_dump): Likewise.
543 * m4/module.c (module_remove): Likewise.
544 (install_builtin_table): Simplify malloc and string
547 2006-09-26 Eric Blake <ebb9@byu.net>
549 * m4/m4module.h (m4_symbol_print): New prototype.
550 (M4_DEBUG_TRACE_STACK): New enumerator.
551 (m4_is_debug_bit): Allow use without requiring m4private.h.
552 * m4/symtab.c (symbol_value_print, m4_symbol_print): New
554 * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
556 (dumpdef): Allow printing pushdef'd stacks.
557 * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
558 * src/main.c (usage): Document it.
559 * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
562 * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
564 * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
565 of lines during make.
566 (AM_CPPFLAGS): Remove unneeded include path.
567 (src_m4_CPPFLAGS): Remove redundant include path.
568 * m4/system_.h Make preprocessor indentation consistent.
569 (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
571 (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
573 (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
574 (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
575 (bool, true, false): Don't undefine here; stdbool takes care of
577 * src/m4.h (includes): Assume config.h, and several standard
579 (__CYGWIN__, WIN32): Don't define here; let system.h do it.
580 * m4/m4private.h: Assume config.h.
581 * m4/output.c: Likewise.
582 * m4/path.c: Likewise.
583 * m4/resyntax.c: Likewise.
584 * m4/utility.c: Likewise.
585 * modules/gnu.c: Likewise.
586 * modules/import.c: Likewise.
587 * modules/load.c: Likewise.
588 * modules/m4.c: Likewise.
589 * modules/modtest.c: Likewise.
590 * modules/mpeval.c: Likewise.
591 * modules/perl.c: Likewise.
592 * modules/shadow.c: Likewise.
593 * modules/stdlib.c: Likewise.
594 * modules/time.c: Likewise.
595 * modules/traditional.c: Likewise.
597 2006-09-21 Eric Blake <ebb9@byu.net>
599 * doc/m4.texinfo (Invoking m4): Add clarification on option
601 * tests/options.at (option grouping): Test this.
603 Reported by Mikhail Teterin.
605 * bootstrap: Add --force option, based on idea from coreutils.
606 * README: Document that ./bootstrap and autoreconf are for
607 developers, and not lightly done in tarballs.
609 2006-09-20 Eric Blake <ebb9@byu.net>
611 * src/main.c (usage, OPTSTRING, main): Rename -e to -i. Make
613 (long_options, HASHSIZE_OPTION): Warn on -H.
614 * doc/m4.texinfo (Invoking m4): Document this.
615 * tests/options.at (deprecated options): Update.
617 Change the default of interactive sessions to match sh.
618 * src/main.c (usage): Document this.
619 (enum interactive_choice): New enum.
620 (main): Use it to defer decision of interactive until after
622 * doc/m4.texinfo (Invoking m4): Document this.
623 * NEWS: Likewise, plus add missing mention of -b.
624 Reported by Stepan Kasal.
626 2006-09-19 Eric Blake <ebb9@byu.net>
628 * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
629 well as --error-output; the goal is to add -o/--output in some
630 future version with semantics like gcc or autom4te.
631 * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
632 (Extensions): Reflect this update.
633 (Renamesyms): Add another test.
634 (Defn): Xfail for now, so that `make check' is happy.
635 * NEWS: Document this change.
636 * tests/generate.awk: Mark dynamic loading tests as such. Allow
638 * tests/macros.at (Renamesyms collisions): New test, exposing
639 renamesyms' coredump.
640 * tests/options.at (--debugfile, --safer): Update to match
643 * m4/debug.c (set_debug_file): Fix regression in -o when stdout
644 and stderr are same file, introduced 2003-07-23.
645 * tests/options.at (--debugfile): New test, to catch the bug.
646 (deprecated options): Test --error-output.
647 * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
648 Deprecate --error-output, and replace it with --debugfile.
649 * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
650 Document this change.
653 2006-09-18 Eric Blake <ebb9@byu.net>
655 * modules/load.c (modules): Rename to...
656 (m4modules): ...this, since it is an English word with 0
658 * modules/gnu.c (symbols, m4symbols): Likewise.
659 * doc/m4.texinfo (Listing Modules): Rename to...
660 (M4modules): ...this.
661 (Symbols): Rename to...
662 (M4symbols): ...this.
663 (Load, Foreach, Trace, Answers): Update to new spellings.
664 * NEWS: Document this.
666 * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
667 such that without arguments, the global trace flag is changed
668 rather than walking the table of all currently-defined macros.
669 (set_trace_CB): No longer needed.
670 * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
671 (m4_set_symbol_traced): Delete.
672 (m4_symtab_create): Nuke the nuke parameter.
673 * m4/m4private.h (m4_get_symbol_value): Delete.
674 * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
675 (m4_set_symbol_name_traced): Free undefined entries that are no
677 (symbol_destroy_CB): Update caller.
678 * m4/m4.c (m4_create): Update caller.
679 * src/main.c (main): Likewise.
680 (usage): Fix typo in last commit.
681 * doc/m4.texinfo: Minor cleanups throughout.
682 (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
683 more nodes from branch.
684 (Trace): Document new semantics, and how to simulate the old.
685 * tests/builtins.at (multiquotes): Adjust to new semantics.
686 * NEWS: Update somewhat.
688 2006-09-14 Eric Blake <ebb9@byu.net>
690 Add --safer option, per debian bug 5898.
691 * src/main.c (usage): Document new option.
692 (SAFER_OPTION): New enumerator.
693 (main): Set the option bit.
694 * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
696 * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
697 (m4_get_safer_opt): New accessor.
698 * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
699 * modules/m4.c (syscmd, maketemp): Likewise.
700 * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
701 (Sysval, Maketemp): Add tests of this.
702 * tests/options.at (--safer): Likewise.
704 2006-09-13 Eric Blake <ebb9@byu.net>
706 * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
708 Reported by Ralf Wildenhues.
711 * Makefile.am (check_LTLIBRARIES): Build test libraries in the
712 tests directory, so we can be sure an installed build is not
713 picking up uninstalled non-test libraries.
714 (check-local, installcheck-local): Depend on test libraries.
715 * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
716 after file name. Fix quoting. Remove skipping the test, now
717 that makefile guarantees test modules will exist.
718 (Freezing modules, modules: shadow, modules: unload)
719 (modules: trace): Always put test modules in module path.
720 (modules: importing): Likewise, and rely on AT_CHECK_M4 for
722 * src/main.c (usage): Document default module search path.
723 (import_environment, frozen_file_to_read, frozen_file_to_write):
726 * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
727 * tests/m4.in: ...not here.
728 Reported by Ralf Wildenhues.
730 2006-09-08 Eric Blake <ebb9@byu.net>
732 * bootstrap: Kill unrelated copy-n-paste code from argument
733 parsing. Let Makefile generate testsuite.
734 * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
736 2006-09-07 Eric Blake <ebb9@byu.net>
738 * m4/m4module.h (m4_peek_input): No longer export.
739 (m4_error_at_line, m4_warn_at_line): New prototypes.
740 (m4_is_symbol_void): New macro.
741 (m4_push_file): Update prototype.
742 * m4/m4private.h (m4__peek_token): New prototype.
743 (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
744 * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
745 * src/main.c (main): Allow reading from stdin twice.
746 * modules/m4.c (include): Adjust to new prototype.
747 * m4/input.c: General comment cleanup.
748 (file_peek, file_read, file_unget, push_file): Set end flag on
749 EOF, so that we don't call getc twice.
750 (push_file, file_clean): Port fix from branch to avoid closing
752 (pop_input): Port fix from branch to avoid reading free'd memory
753 when input ends mid-string.
754 (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
755 (string_peek, string_read): Always use unsigned char.
756 (m4_skip_line): Warn when dnl cut short by EOF.
757 (peek_input): Rename from m4_peek_input.
758 (match_input): Update signature, to distinguish between `(' token
759 and multi-char quote or comment beginning with `('.
760 (m4_input_exit): Cleanup now done in m4_pop_wrapup.
761 (m4__peek_token): New function, ported from branch.
762 (m4__next_token): Update to new token types.
763 * m4/macro.c (expand_token, expand_argument): Use peek_token.
764 * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
765 (Invoking m4): Remerge from branch.
767 * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
768 (check-local): and put dependency here.
769 Reported by Ralf Wildenhues.
771 2006-09-05 Eric Blake <ebb9@byu.net>
773 * m4/m4module.h (m4_debug_message): New prototype.
774 (M4_DEBUG_TRACE_MODULE): New debug bit.
775 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
776 (M4_DEBUG_MESSAGE2): Delete these macros.
777 * m4/debug.c (m4_debug_message): New method.
778 (m4_debug_decode): Add module tracing as flag `m'.
779 * m4/input.c (m4_push_file, file_clean): Use new method.
780 * m4/path.c (m4_path_search): Likewise.
781 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
782 * m4/module.c (install_builtin_table, install_macro_table)
783 (m4__module_open, module_close, module_remove): Promote several
784 module debug messages outside of DEBUG_MODULES.
785 (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
786 DEBUG_MODULES with normal trace output.
787 * src/main.c (usage): Document new flag.
788 * doc/m4.texinfo (Debug Levels): Likewise.
789 * Makefile.am ($(TESTSUITE)): Add missing dependency.
790 * tests/m4.in: Neutralize platform-dependent module filenames.
791 * tests/options.at (--debug): Update expected output.
793 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
795 * doc/m4.texinfo: Fix some typos.
796 * tests/others.at: Likewise.
798 2006-09-05 Eric Blake <ebb9@byu.net>
800 * m4/input.c (lex_debug): Remove dead code that broke compilation
802 * m4/module.c (install_builtin_table, install_macro_table)
803 (m4__module_init, m4__module_open, module_close)
804 (module_remove): Fix compilation when --enable-debug.
805 * m4/output.c (m4_shipout_text): Likewise.
806 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
807 libraries when --enable-debug.
808 * configure.ac (DYNAMIC_MODULES): New variable, to pass
809 information to testsuite.
810 (modules to preload): Determine modules after we know whether
811 shared libraries are supported.
812 * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
814 * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
815 * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
816 (modules: shadow, modules: unload, modules: importing)
817 (modules: trace): Use new macro.
818 * tests/builtins.at (gmp): Likewise.
820 * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
822 (expand_token): Avoid assertion just added to docs.
823 (expand_macro): Track pending expansions, for when a symbol's
824 definition changes during argument collection.
825 (m4_macro_call, process_macro): Operate on symbol value, not
826 symbol, since symbol may have changed during argument collection.
827 * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
828 (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
829 (m4_get_symbol_value): Add fast macro version.
830 * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
831 (m4_macro_call): Adjust prototype.
832 * m4/module.c (install_builtin_table): Check that flags are valid
833 when creating builtin.
834 * m4/symtab.c (m4__symtab_remove_module_references): Use
835 m4_symbol_value_delete, rather than inlining it.
836 (m4_symbol_value_copy): Copy placeholder text.
837 (symbol_popval): Use m4_symbol_value_delete.
838 (m4_symbol_value_delete): Implementation was missing when NDEBUG.
839 Handle pending expansions.
840 * modules/gnu.c (indir): Update to new prototype.
841 * doc/m4.texinfo: Fix menus to be consistent with section names.
842 (Defn): Add test that macro tokens flatten to empty string;
843 triggered an assert before this patch.
844 (Ifelse): Merge another node.
845 (Loops): Split into...
846 (Forloop, Foreach): New nodes; work is still underway on them.
847 (Answers): Add more info on foreach macro; work is still underway.
848 (Indir): Add test that indir collects arguments before looking up
850 * TODO: Update based on this patch.
852 2006-09-01 Eric Blake <ebb9@byu.net>
854 * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
855 * m4/hash.h (m4_free_hash_iterator): New prototype.
856 * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
857 ensure we don't do unsafe things while iterating.
858 (HASH_ITER, ITER_CHAIN): New accessor macros.
859 (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
860 (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
861 (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
862 (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
863 to catch unsafe actions.
864 (m4_free_hash_iterator): New function, to avoid memory leaks, and
865 when debugging, to track safe actions.
866 (m4_hash_apply): Avoid memory leak.
867 * m4/symtab.c (m4_symtab_apply): Likewise.
868 * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
869 in manually to src/ for now.
870 * tests/builtins.at (gmp): Add keyword module.
871 * tests/modules.at (Freezing modules, modules: shadow)
872 (modules: unload, modules: importing, modules: trace): Likewise.
874 2006-08-30 Eric Blake <ebb9@byu.net>
876 * m4/utility.c (m4_warn): Factor "Warning" out of messages into
878 (m4_bad_argc, m4_numeric_arg): Update all callers.
879 * m4/macro.c (m4_macro_call): Likewise.
880 * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
881 (Indir, Builtin, Ifdef): More doc merges.
882 (Loops): Mention that documenting foreach would be nice.
883 (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
884 (Include, Eval, Location, M4exit): s/input.m4/stdin/.
885 * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
886 (substitute, syncoutput): Update all m4_warn callers.
887 * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
888 (traceon, traceoff): Make warning message consistent.
889 (define, pushdef): Update all m4_warn callers.
890 * tests/generate.awk: Choose file name so that documentation can
891 show command-line behavior.
892 * tests/builtins.at (define): Update to new wording.
893 * tests/macros.at (pushdef/popdef): Likewise.
894 * tests/freeze.at (loading format 1): Likewise.
895 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
897 * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
899 (Defn): Add failing test case for mixing text and builtin.
900 (Renamesyms): Improve wording, and identify core dump that needs
903 2006-08-29 Eric Blake <ebb9@byu.net>
905 * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
906 (Arguments, Pseudo Arguments): More doc merges from the branch.
907 (Macro expansion): Turn example into test.
908 (Pseudo Arguments): Add example of avoiding argument.
909 * modules/m4.c (undefine, popdef): Accept multiple arguments.
910 (define, pushdef): Warn on non-text macro name.
911 (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
912 warning/error messages.
913 (ifdef): Ignore extra arguments.
914 * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
915 (m4__symtab_remove_module_references): Check that there is no leak.
916 * tests/macros.at (pushdef/popdef): Update to new message.
917 * tests/builtins.at (define): Likewise.
918 * tests/freeze.at (loading format 1): Likewise.
919 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
921 * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
922 (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
923 as accessor function, to avoid compiler warning.
924 * m4/module.c (m4__module_open): Move declaration of variable to
925 avoid compiler warning.
926 * src/main.c (main): Avoid shadowing a global variable.
927 * src/freeze.c (produce_symbol_dump): Avoid unused variable
929 * tests/options.at (--discard-comments, --import-environment)
930 (--debug, --prepend-include, --help and --version): Rename tests
931 to name option tested.
933 2006-08-28 Eric Blake <ebb9@byu.net>
935 * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
936 * m4/module.c (install_builtin_table): ...to here, and add
937 assertion that blind macros require arguments.
938 * m4/m4module.h (struct m4_builtin): Document restrictions that
939 must be met during module loading.
940 * modules/gnu.c (changeresyntax, changesyntax): These are blind,
941 so require an argument to avoid triggering assertion.
942 (debugfile): Tweak error message.
944 2006-08-25 Eric Blake <ebb9@byu.net>
946 * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
947 (M4_BUILTIN_SIDE_EFFECT): New enumerators.
948 (struct m4_builtin): New member flags replaces groks_macro_args,
949 blind_if_no_args. min_args and max_args are now 0-based.
950 Rearrange members to reduce size on platforms where function
951 pointers are 64 bits but regular pointers are 32.
952 (m4_bad_argc): Add argument.
953 * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
954 * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
956 * m4/module.c (install_builtin_table): Adjust all users affected
958 * m4/macro.c (m4_macro_call): Likewise.
959 * src/freeze.c (reload_frozen_state): Likewise.
960 * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
961 * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
962 * modules/import.c (builtin_functions): Likewise.
963 * modules/load.c (builtin_functions): Likewise.
964 * modules/modtest.c (builtin_functions): Likewise.
965 * modules/mpeval.c (builtin_functions): Likewise.
966 * modules/perl.c (builtin_functions): Likewise.
967 * modules/shadow.c (builtin_functions): Likewise.
968 * modules/stdlib.c (builtin_functions): Likewise.
969 * modules/time.c (builtin_functions, mktime_functions)
970 (strftime_functions): Likewise.
971 * doc/m4.texinfo (Loops): Update test now that shift is blind.
972 (Macro Arguments): Fix typo in test.
973 (Patsubst): Fix typo in test.
974 * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
975 end of string. Fix return value when ignore_duplicates.
976 * tests/builtins.at (patsubst): Fix typo in test.
978 * tests/options.at (debug-flags): Update to reflect new message.
979 (deprecated options, prepend-include, help and version): New
981 * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
982 test omits an input file name.
983 * src/main.c (long_options, main): Add -B/--prepend-include.
984 (usage): Document it.
985 (main): `m4 --help --version' now displays help, not version.
986 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
988 * m4/m4module.h (m4_add_include_directory): Add parameter.
989 * m4/m4private.h (m4__include_init): New prototype.
990 * m4/m4.c (m4_create): Put `.' on path before options are
992 * m4/path.c (includes): Assume C89. Use gnulib for file name
994 (m4__include_init): New function.
995 (search_path_add): Allow prepending.
996 (m4_add_include_directory, search_path_env_init): Adjust callers.
997 (m4_path_search): Relative names now invoke path search, since
998 `.' might not be first.
999 * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
1001 2006-08-25 Bruno Haible <bruno@clisp.org> (tiny change)
1002 and Eric Blake <ebb9@byu.net>
1004 * bootstrap: Run autopoint before gnulib-tool, since autopoint
1005 0.15 installs macros obsoleted by current gnulib.
1007 2006-08-25 Eric Blake <ebb9@byu.net>
1009 * doc/m4.texinfo (Macro Arguments): Another section merged;
1010 testsuite failures now exposed.
1012 2006-08-23 Eric Blake <ebb9@byu.net>
1014 * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
1015 (Input processing): More doc merges from the branch.
1016 (Regular expression syntax): Add introductory text.
1017 (Inhibiting Invocation): More doc merges from the branch.
1018 (Other tokens): Reorder after comments.
1019 * tests/generate.awk: Allow passing options to doc examples.
1021 2006-08-22 Eric Blake <ebb9@byu.net>
1023 * tests/options.at (debug-flags): New test.
1024 * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
1025 not negative, to distinguish failure in m4_debug_decode.
1026 (m4_debug_decode): Add new parameter.
1027 * modules/gnu.c (regexp): Slight cleanup.
1028 (renamesyms): Ignore excess arguments.
1029 (syncoutput): Make case-insensitive, warn on bad argument.
1030 (debugmode): Factor -+ handling out to...
1031 * m4/debug.c (m4_debug_decode): ...here.
1032 (m4_debug_message_prefix): Fix spacing.
1033 * src/main.c (main): Let -d option adjust flags.
1034 * m4/input.c (file_clean): Avoid printing empty file name.
1035 * doc/m4.texinfo (Syncoutput): Document new range of input.
1036 (Invoking m4): Document use of multiple -d flags.
1038 Start porting various fixes from the branch that use gnulib.
1039 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
1040 binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
1041 regexprops-generic stdlib-safer unlocked-io.
1042 * m4/debug.c (m4_debug_set_output): Close debug file on exec.
1043 * m4/path.c (m4_path_search): Close input file on exec, reject
1044 empty file name, fix parameter naming.
1045 * m4/output.c (make_room_for): Close diversion file on exec.
1046 (includes): Assume C89 headers.
1047 (tmpfile): For now, we don't want tmpfile-safer, because we want
1049 * m4/m4private.h (includes): Use various gnulib headers.
1050 * doc/regexprops-generic.texi: Use gnulib's copy.
1052 * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
1053 * AUTHORS: Add copyright.
1054 * ChangeLog: Likewise.
1055 * README: Likewise. Require automake 1.9b or later.
1056 * HACKING: New file.
1057 * README-alpha: Add copyright.
1058 * THANKS: Likewise. Update.
1059 * doc/STYLE: Add copyright, and tweak for changed directories.
1060 * modules/README: Add copyright, and tweak for libtool version.
1061 * examples/COPYING: New file.
1062 * examples/WWW/COPYING: Likewise.
1063 * examples/WWW/m4lib/COPYING: Likewise.
1064 * modules/shadow.m4: Add copyright.
1065 * modules/perl.m4: Likewise.
1066 * modules/modtest.m4: Likewise.
1067 * modules/stdlib.m4: Likewise.
1068 * modules/time.m4: Likewise.
1069 * modules/time2.m4: Likewise.
1070 * po/Makevars: Likewise.
1071 * tests/iso8859.m4: Likewise.
1072 * tests/m4.in: Likewise.
1073 * NEWS: Add (C) to copyright.
1075 * m4/system_.h: Likewise.
1076 * tests/atlocal.in: Likewise.
1077 * tests/builtins.at: Likewise.
1078 * tests/freeze.at: Likewise.
1079 * tests/generate.awk: Likewise.
1080 * tests/macros.at: Likewise.
1081 * tests/modules.at: Likewise.
1082 * tests/options.at: Likewise.
1083 * tests/others.at: Likewise.
1084 * tests/testsuite.at: Likewise.
1085 * m4/utility.c: Spell out copyright years.
1086 * src/main.c: Likewise.
1088 * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
1090 2006-08-21 Eric Blake <ebb9@byu.net>
1092 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
1093 * modules/gnu.c (esyscmd): Use -1 for failure. Set sysval to 0
1094 when no arguments are given, but without losing warning about 0
1096 * modules/m4.c (syscmd): Likewise.
1097 (includes): Assume C89.
1098 (m4_sysval): Make static.
1099 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
1100 (sysval): Port calculation from branch.
1102 2006-08-20 Eric Blake <ebb9@byu.net>
1104 * m4/macro.c (expand_macro): Move argument check...
1105 (m4_macro_call): ...to here, so indir will warn.
1106 * modules/gnu.c (__program__): New macro, ported from branch.
1107 (builtin): Perform argument check.
1108 (changesyntax): Avoid out-of-bounds read.
1110 * modules/gnu.c (includes): Assume stdlib.h, errno.
1111 (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
1112 (substitute): Add caller parameter, avoid out-of-bounds memory
1114 (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
1117 2006-08-16 Eric Blake <ebb9@byu.net>
1119 * po/POTFILES.in: Add more files that contain translatable
1121 * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
1122 information to translators.
1123 (USE_MSGCTXT): New var for gettext 0.15.
1124 * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
1125 debug/trace messages in lower case.
1126 * m4/macro.c (expand_argument): Likewise.
1127 * m4/path.c (m4_path_search): Likewise.
1128 * src/main.c (main): Likewise.
1130 2006-08-14 Eric Blake <ebb9@byu.net>
1132 * src/main.c (usage): Document --import-environment.
1133 * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
1135 2006-08-11 Eric Blake <ebb9@byu.net>
1137 * bootstrap (func_get_translations): Only remove files when doing
1139 (func_update_po): Avoid CDPATH problems.
1141 2006-08-10 Eric Blake <ebb9@byu.net>
1143 * bootstrap (func_get_translations): New function.
1144 (func_update_po): Borrow ideas from tar to correctly pull in
1145 translations from newer location.
1147 2006-08-09 Eric Blake <ebb9@byu.net>
1149 * bootstrap: Recent gnulib no longer has jm_* macros to worry
1151 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
1153 * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
1154 (m4_error, m4_warn): ... these new prototypes.
1155 (m4_current_file, m4_current_line): Move into context, rather
1156 than leaving as globals.
1157 (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
1158 (m4_undivert_all, m4_input_init): Now takes context.
1159 * m4/utility.c (m4_error, m4_warn): New functions.
1160 * m4/m4private.h: Assume errno exists.
1161 (struct m4): Move warning_status to a bit flag,
1162 and add exit_status. Adjust accessors accordingly.
1163 * src/main.c (print_program_name_CB): No longer needed.
1164 (main): Use new m4_get_fatal_warnings_opt.
1165 * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
1166 instead of issuing "INTERNAL ERROR". Pass context when needed,
1167 and use new accessors.
1168 * m4/input.c: Likewise.
1169 * m4/macro.c: Likewise.
1170 * m4/output.c: Likewise.
1171 * m4/utility.c: Likewise.
1172 * modules/evalparse.c: Likewise.
1173 * modules/gnu.c: Likewise.
1174 * modules/load.c: Likewise.
1175 * modules/m4.c: Likewise.
1176 * modules/mpeval.c: Likewise.
1177 * src/freeze.c: Likewise.
1178 * src/main.c: Likewise.
1179 * tests/macros.at: Adjust to new message format.
1180 * tests/builtins.at: Likewise.
1181 * tests/freeze.at: Likewise.
1182 * tests/modules.at: Likewise.
1183 * doc/m4.texinfo: Likewise.
1185 * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
1188 2006-08-03 Eric Blake <ebb9@byu.net>
1190 * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
1191 gracefully handle ENOSYS.
1195 2006-07-28 Eric Blake <ebb9@byu.net>
1197 * src/freeze.c (reload_frozen_state): Copy string when creating
1198 placeholder, to avoid memory corruption.
1199 * m4/symtab.c (symbol_popval): Avoid memory leak.
1200 (m4_symbol_rename): Avoid shadowing rename function.
1201 (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
1202 * tests/freeze.at (reloading unknown builtin): Add test.
1203 * tests/generate.awk: Capture m4.texinfo line number in
1204 testsuite.log, not just generated.at.
1206 Port idea from branch that a frozen file can request an unknown
1207 builtin without producing a warning unless the builtin is
1209 * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
1210 (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
1211 (m4_set_symbol_value_placeholder): New accessors.
1212 * m4/m4module.h (m4_is_symbol_placeholder),
1213 (m4_get_symbol_value_placeholder),
1214 (m4_set_symbol_value_placeholder),
1215 (m4_get_symbol_placeholder): Likewise.
1216 * m4/symtab.c (m4_is_symbol_value_placeholder),
1217 (m4_get_symbol_value_placeholder),
1218 (m4_set_symbol_value_placeholder): Likewise.
1219 (dump_symbol_CB): Handle new symbol type.
1220 * m4/macro.c (trace_pre): Likewise.
1221 (m4_macro_call): Warn when invoking a placeholder.
1222 * modules/m4.c (dumpdef): Handle dumping a placeholder.
1223 (defn): Warn when referencing a placeholder.
1224 * src/freeze.c (dump_symbol_CB): Ignore placeholder when
1226 (reload_frozen_state): When reloading unknown builtin, install a
1227 placeholder instead of warning.
1228 * tests/freeze.at (loading format 1): Allow warning when
1229 popdef'ing undefined function.
1231 2006-07-27 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
1233 * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
1234 function. Shift by 7, not 3, for consistency with
1235 gnulib/lib/hash.c. Don't assume hash word is 32 bits.
1237 2006-07-27 Eric Blake <ebb9@byu.net>
1239 * src/main.c (usage): Update to match branch.
1240 (main): Update --version info to distinguish between program name
1241 `m4' and package name `GNU M4'.
1242 (AUTHORS): Translate René Seindal's name.
1243 * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
1244 * Makefile.am (doc/m4.1): Update to match branch.
1245 * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
1248 * m4/system_.h (EXIT_MISMATCH): Define.
1249 * src/main.c (main): Don't clear syntax table for version 1.
1250 (usage): Document exit status.
1251 * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
1252 branch, and require V directive to appear first in file. Fix
1253 broken logic for detecting F and T in version 1 files.
1255 2006-07-22 Eric Blake <ebb9@byu.net>
1257 * src/main.c (stackovf_handler): Document the problems in our
1259 * src/stackovf.c: Forward port changes in branch to use POSIX
1260 sa_sigaction when available.
1261 (process_sigsegv): Avoid buffer overrun when error string is
1262 translated, although the fact that we translate in a signal
1263 handler is still a bug.
1264 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
1265 from branch to modernize checks.
1267 * modules/format.c (format): Avoid compiler warning that str may
1268 be used uninitialized.
1270 * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
1272 (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
1273 (DEBUG_MACRO): Remove unused macro.
1274 * src/stackovf.c: Avoid compiler warnings.
1275 * m4/input.c: Likewise.
1276 * m4/module.c: Likewise.
1277 * m4/output.c: Likewise.
1278 * m4/path.c: Likewise.
1279 * m4/symtab.c: Likewise.
1280 * m4/syntax.c: Likewise.
1282 2006-07-20 Eric Blake <ebb9@byu.net>
1284 * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
1285 Regenerate to explicitly ask for --assume-autoconf=2.60.
1287 2006-07-19 Eric Blake <ebb9@byu.net>
1289 * po/ChangeLog: Merge into main ChangeLog, then delete file.
1292 * doc/m4.texinfo (copying): Relax restriction on front-cover and
1295 2006-07-17 Eric Blake <ebb9@byu.net>
1297 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
1300 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
1302 * modules/format.c (includes): Use xvasprintf.h.
1303 (format): Make static. Avoid buffer overflow, that can lead to
1304 arbitrary code execution exploit. Only pass unsigned char to
1305 is*(). Support F, g, and G specifiers.
1306 * doc/m4.texinfo (Format): Expose buffer overrun bug. Document
1309 2006-07-17 Gary V. Vaughan <gary@gnu.org>
1311 Ensure M4 compiles correctly with -DDEBUG, and use a single
1312 consistent definition of various /DEBUG_[A-Z]+/ symbols:
1314 * m4/input.c: Have commented out out DEBUG_INPUT only by default.
1315 (m4_print_token): Use m4_get_symbol_value_text and
1316 m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
1317 and VALUE_FUNC respectively.
1318 (m4__next_token): Use m4_print_token call instead of obsolescent
1320 * m4/module.c: Have commented out out DEBUG_MODULE only by default.
1321 * m4/output.c: Similarly for DEBUG_OUTPUT.
1322 * m4/path.c: Similarly for DEBUG_INCL.
1323 * m4/symtax.c: Similarly for DEBUG_SYM.
1324 * m4/syntax.c: Similarly for DEBUG_SYNTAX.
1325 * src/stackovf.c: Similarly for DEBUG_STACKOVF.
1326 * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
1327 preprocessor macros defined with -DDEBUG compiles.
1329 2006-07-17 Gary V. Vaughan <gary@gnu.org> (tiny change)
1331 * bootstrap: Correct typo in --download-po argument parsing.
1333 2006-07-15 Eric Blake <ebb9@byu.net>
1335 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
1337 * tests/generate.awk (normalize): Recognize @tabchar.
1338 * doc/m4.texinfo (Top): Start merging from branch. Remove tabs.
1339 Fix menus. Upgrade FDL license from 1.1 to 1.2. Fix overfull
1341 (Index macro, Shell commands, Incompatiblities): Rename nodes
1342 from Index, UNIX commands, Other incompat.
1343 (Platform macros, Using frozen files, Frozen file format 1)
1344 (Frozen file format 2, Copying This Manual, Indices): New nodes.
1345 * Makefile.am (EXTRA_DIST): Distribute gendocs.
1346 (MAINTAINERCLEANFILES): Clean up files from gnulib.
1347 (doc_m4_TEXINFOS): Depend on fdl.texi.
1348 (web-manual): New maintainer target.
1350 2006-07-14 Gary V. Vaughan <gary@gnu.org>
1352 * doc/m4.texinfo (Modules): RMS asked me for an explanation of
1353 the modular architecture of M4. The result is paraphrased here
1354 for the benefit of future readers of the manual.
1356 2006-07-14 Gary V. Vaughan <gary@gnu.org> (tiny change)
1358 * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
1360 2006-07-14 Eric Blake <ebb9@byu.net>
1362 * src/main.c (main): Avoid compiler warning.
1363 * modules/gnu.c (renamesyms): Remove unused variable.
1365 2006-07-14 Gary V. Vaughan <gary@gnu.org>
1367 * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
1368 (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
1369 new functions for managing regexp syntax options.
1370 * m4/m4private.h (m4): Add regexp_syntax field.
1371 * m4/resyntax.c: New file implements the above.
1372 * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
1373 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
1374 (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
1375 (m4_patsubst_do, m4_renamesyms_do): Removed.
1376 (builtin_changeresyntax): New builtin to change regular expression
1378 (m4_resyntax_encode_safe): Factor out diagnostics code.
1379 * src/freeze.c (produce_resyntax_dump): New function to dump
1380 default regexp syntax specifier to frozen file.
1381 (reload_frozen_state): Updated to action 'R' directive.
1382 * src/main.c (usage): Describe new -r option.
1383 (long_options, OPTSTRING): Declare it.
1384 (main): Encode and store cli regexp syntax option argument.
1385 * tests/freeze.at (regexp syntax): New test that regexp syntax
1387 * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
1388 * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
1389 (Epatsubst and Patsubst): Renamed to...
1390 (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
1391 documentation and added new examples.
1392 (Changeresyntax): New section describing changeresyntax builtin,
1393 and regexp syntax names.
1394 (Regular expression syntax): New section describing differences
1395 between various regular expression syntaxes.
1396 (Frozen files): Document 'R' directive.
1399 2006-07-13 Gary V. Vaughan <gary@gnu.org>
1401 * bootstrap: Enhanced to work more like our other scripts:
1402 Add a copyright statement; support --version and --help; accept a
1403 --download-po option with argument as a substitute for DOWNLOAD_PO
1406 2006-07-11 Eric Blake <ebb9@byu.net>
1408 * Makefile.am (doc/m4.1): Port patch from branch that avoids
1410 * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
1413 2006-07-10 Gary V. Vaughan <gary@gnu.org> (tiny change)
1415 * tests/builtin.at (patsubst, regexp): Adjust these tests, now
1416 that `\0' is no longer accepted.
1418 * src/main.c (usage): Alphabetize options within their sections.
1420 * modules/gnu.c (m4_regexp_search, regsub, substitute)
1421 (esyscmd): Improve comments.
1423 * modules/gnu.c (substitute): Remove old warning for \0.
1424 (substitute_warned): No longer required. Removed.
1426 * modules/gnu.c: Put macro definitions into alphabetical order.
1428 2006-07-07 Eric Blake <ebb9@byu.net>
1430 * tests/freeze.at (loading format 1): New file, with new test.
1431 * tests/testsuite.at: Include it.
1432 * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
1433 * tests/modules.at (Freezing modules): Likewise.
1435 * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
1436 (AC_CHECK_HEADERS): Assume signal.h.
1437 (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
1438 (AC_CHECK_FUNCS_ONCE): Likewise.
1439 * src/m4.h (includes): Assume signal.h.
1441 2006-07-05 Eric Blake <ebb9@byu.net>
1443 Fix all testsuite failures on cygwin.
1444 * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
1445 branch-1_4. Solves testsuite failure when uninstalled m4 is
1446 shadowed by redefinition of PATH in libtool wrapper.
1447 * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
1448 contains the -no-undefined required by cygwin.
1449 (TESTS_ENVIRONMENT): Export abs_top_builddir.
1450 * tests/others.at (misc): Port to platforms where /etc/passwd
1451 does not exist or does not contain user named root.
1452 * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
1454 * tests/builtins.at (define, divert): Avoid overquoting.
1455 * tests/generate.awk (new_group): Likewise.
1457 2006-07-05 Gary V. Vaughan <gary@gnu.org>
1459 The regs_allocated field in a struct re_pattern_buffer refers
1460 to the state of a particular re_registers struct when used in
1461 successive matches using the same compiled pattern. Avoid a
1462 SEGV in `renamesyms' resulting from using a new re_registers
1463 with an existing re_pattern_buffer:
1465 * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
1466 pattern buffer and registers.
1467 (m4_regexp_search): New function to call re_regexp_search with
1468 correctly matched pattern buffer and register instantiations.
1469 (m4_regexp_compile): Return an m4_pattern_buffer. Adust all
1472 2006-07-04 Gary V. Vaughan <gary@gnu.org>
1474 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
1475 changes to gnulib getopt.m4 since last build.
1476 * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
1477 if the system getopt fails M4_GETOPT tests.
1479 2006-06-22 Eric Blake <ebb9@byu.net>
1481 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
1482 Reported by Bruno Haible.
1484 2006-06-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1486 * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
1488 2006-06-19 Eric Blake <ebb9@byu.net>
1492 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1494 * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
1495 (clean-local): Split into and depend upon...
1496 (clean-local-tests, clean-local-src): ...these two. The latter
1497 removes the libtool object directory below `src', to work around
1498 a buglet in Automake, failing to list it.
1499 (EXTRA_DIST): Distribute modules/perl.c.
1501 2006-06-19 Eric Blake <ebb9@byu.net>
1503 * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
1504 right side of dependency; VPATH does that.
1505 (stamp-vcl): Update to use libtool's algorithm.
1506 (EXTRA_DIST): Distribute stamp-vcl.
1507 Reported by Ralf Wildenhues.
1508 (TESTSUITE): Revert earlier change that used absolute path, as
1509 that broke 'make dist' in VPATH. Stick with $(srcdir) instead.
1510 (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
1511 (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
1512 atlocal takes care of it instead.
1513 (check-local, installcheck-local, clean-local): Inline absolute
1514 path to testsuite here, rather than relative path to testsuite
1517 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1519 * m4/m4private.h (DELETE): Cast away const here...
1520 * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
1521 * src/freeze.c (reload_frozen_state): Avoid uninitialized
1524 2006-06-19 Eric Blake <ebb9@byu.net>
1526 * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
1527 .info pages are built.
1528 Reported by Ralf Wildenhues.
1529 (EXTRA_DIST): Inline definition of testsuite, so that make dist
1532 2006-06-16 Eric Blake <ebb9@byu.net>
1534 Follow recommendations from autoconf manual for autotest.
1535 * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
1536 turn it into an absolute path until autotest provides an option
1537 that allows us to avoid changing directories. Properly quote
1539 (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
1540 (check-recursive): Delete unused target.
1541 ($(TESTSUITE)): Atomically update testsuite.
1542 (CD_TESTDIR): Simplify.
1543 (m4__cd): Delete unused macro.
1544 (check-local): Let TESTSUITEFLAGS influence the run.
1545 (installcheck-local): Let TESTSUITEFLAGS override
1546 AUTOTEST_PATH. Add dependencies.
1547 (clean-local): Clean up.
1548 (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
1549 * README: Document how to use the testsuite.
1551 2006-06-15 Eric Blake <ebb9@byu.net>
1553 * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
1555 * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
1556 clashes with m4sugar.
1557 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
1558 * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
1559 * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
1560 * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
1561 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
1562 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
1563 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
1564 * configure.ac: Likewise.
1565 (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
1566 * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
1568 * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
1570 Reduce compiler warnings. Inside GMP, mpq_t is an array type, so
1571 const mpq_t is not assignable from plain mpq_t. Avoid
1572 type-punning warnings caused trying to mix these types.
1573 * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
1574 (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
1575 * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
1576 (mult_term, exp_term): Remove type-punning casts.
1577 (numb_pow): Remove const qualifier.
1578 * src/freeze.c (reload_frozen_state): Fix typo in messages.
1579 Fix variables that can be used uninitialized, which fixes
1580 security hole where malicious frozen file can execute arbitrary
1583 2006-06-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1585 * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
1587 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1588 Eric Blake <ebb9@byu.net>
1590 Allow `make dist' to work again.
1591 * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
1592 (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
1593 (cvs-dist): Fix typo.
1594 * NEWS: Match current version number.
1596 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1598 * Makefile.am (AM_CPPFLAGS): Add $(LTDLINCL), so the right
1601 * bootstrap: Do not run libtoolize manually, this is done
1602 correctly by autoreconf. Invoke autoreconf with --no-recursive
1603 to avoid unnecessary rerunning of autotools for libltdl.
1605 2006-06-13 Eric Blake <ebb9@byu.net>
1609 2006-06-12 Eric Blake <ebb9@byu.net>
1611 * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
1613 * src/m4.h: Don't declare mktemp.
1614 * m4/input.c (m4__next_token): Avoid bzero.
1615 * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
1616 * Makefile.am (doc/m4.1): Depend on installed help2man, rather
1617 than distributing outdated helptoman.pl.
1618 * doc/helptoman.pl: Delete.
1620 2006-06-10 Eric Blake <ebb9@byu.net>
1622 * README (Patches): Document the current dependence on CVS
1623 builds of autotools.
1624 * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
1625 * configure.ac: Use consistent quoting throughout.
1626 (AC_PREREQ): Bump to 2.59d.
1627 (AC_INIT): Package name begins with uppercase.
1628 (AC_ARG_WITH): Use AS_HELP_STRING.
1629 (AM_INIT_AUTOMAKE): Enable gnits mode.
1630 (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
1631 (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
1632 (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
1633 done by gnulib or automake, or which autoconf has declared
1635 * m4/m4private.h (Includes): Assume C89 or better, and use errno
1637 * m4/output.c (Includes): Likewise.
1638 * modules/gnu.c (Includes): Likewise.
1639 * modules/m4.c (Includes): Likewise.
1640 * src/m4.h (Includes): Likewise.
1642 * README-alpha: Update web address.
1643 * README: Likewise. Change encoding to ASCII. Remove old advice
1644 about cygwin. Document bootstrapping dependency.
1645 * AUTHORS: Update from branch-1_4.
1646 * THANKS: Likewise. Change encoding to UTF-8.
1647 * BACKLOG: Delete. This file is too old and unmaintained to be
1649 * ChangeLog: Change encoding to UTF-8.
1651 Avoid compiler warnings.
1652 * m4/macro.c (trace_format): Don't mark this as a printf format,
1653 since we don't accept the same set of modifiers as printf. It
1654 would be nice if gcc let us specify a custom format archetype.
1655 * src/main.c (main): Cast away const.
1657 2006-06-10 Andreas Schwab <schwab@suse.de> (tiny change)
1658 Eric Blake <ebb9@byu.net>
1660 * modules/time.c (ctime): Pass correctly typed variable to
1663 (localtime): Likewise.
1664 (strftime): Likewise.
1665 * m4/utility.c (m4_numeric_arg): For now, document arbitrary
1666 limit inherent in this interface.
1668 2006-05-08 Bruno Haible <bruno@clisp.org> (tiny change)
1670 * modules/m4.c (WEXITSTATUS): Provide fallback definition.
1671 (sysval): Use WEXITSTATUS.
1672 * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
1673 big-endian and little-endian wait status definitions.
1675 2006-05-06 Eric Blake <ebb9@byu.net>
1677 * po/Makevars (MSGID_BUGS_ADDRESS): Add.
1678 * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
1681 2006-05-06 Eric Blake <ebb9@byu.net>
1683 * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
1684 subdirectory to use.
1685 (support for -pipe): Move after LT_INIT, since it relies on
1688 2006-05-05 Eric Blake <ebb9@byu.net>
1690 * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
1694 2006-05-05 Bruno Haible <bruno@clisp.org>
1695 Eric Blake <ebb9@byu.net>
1697 * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
1698 * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
1700 * bootstrap: Update usage of gnulib-tool.
1702 2006-05-04 Eric Blake <ebb9@byu.net>
1704 * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
1707 2005-12-05 Gary V. Vaughan <gary@gnu.org>
1709 * bootstrap (func_update_po): Synch with CVS GNU tar. wget 1.9.x
1710 and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
1711 Reported by Eric Blake <ebb9@byu.net>
1713 2005-12-04 Gary V. Vaughan <gary@gnu.org>
1715 * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
1716 http caching as -C is no longer supported by wget 1.10.x.
1717 Reported by Eric Blake <ebb9@byu.net>
1719 2005-10-20 Gary V. Vaughan <gary@gnu.org>
1721 * m4/module.c (caller_id): To match libtool-2.0 interface, changed
1723 (iface_id): ...an lt_dlinterface_id type.
1724 (m4__module_find): New abstraction for lt_dlhandle_fetch. Use
1725 throughout, instead of calling obsolete lt_dlhandle_find directly.
1726 (m4__module_next): Use multiloader-safe lt_dlhandle_iterate. Use
1727 throughout, instead of calling obsolete lt_dlhandle_next.
1728 * m4/m4private.h (m4__module_find): Declare it.
1729 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
1730 Use m4__module_next instead of obsolete lt_dlhandle_next.
1732 2005-10-20 Gary V. Vaughan <gary@gnu.org>
1734 * bootstrap (func_update_po): Update pofiles directly from the
1735 translation project.
1736 * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
1737 po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
1738 these files under source control anymore.
1739 Suggested by Eric Blake <ebb9@byu.net>
1741 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
1743 * ltdl/m4/m4-gnulib.m4: Update FSF contact address. Somehow this
1744 file escaped the address updates on 2005-05-01.
1746 2005-07-07 Gary V. Vaughan <gary@gnu.org>
1748 * bootstrap: Allow user overriding of gnulib-tool location, and
1749 correctly determine module source directories whether gnulib-tool
1750 is given as a relative or absolute path, or is found by searching
1752 Reported by Eric Blake <ebb9@byu.net>
1754 2005-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1756 * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
1757 and $RM are defined for various versions of
1758 AC_LIBTOOL_COMPILER_OPTION.
1760 * bootstrap (AUTORECONF): New variable to allow user overriding of
1763 2005-07-07 Gary V. Vaughan <gary@gnu.org>
1765 * doc/m4.texinfo (History): Add better notes on the ancestory of
1766 GNU m4, and other historical interest.
1768 2005-05-08 Gary V. Vaughan <gary@gnu.org>
1770 * m4/symtab.c (m4_symbol_rename): New function that performs a low
1771 level symbol rename.
1772 * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
1773 * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
1774 (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
1776 (erenamesyms, renamesyms): ...builtins that use these to implement
1777 macro renaming by regular expression.
1778 * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
1779 * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
1780 to stop the new generated tests from choking.
1782 2005-05-07 Gary V. Vaughan <gary@gnu.org>
1784 Since most of the build is handled from a single Makefile.am now,
1785 we can teach make about the dependencies between the m4 binary and
1786 the preopened modules it is built against:
1788 * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
1790 * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
1791 of the preopened modules have changed.
1793 2005-05-07 Gary V. Vaughan <gary@gnu.org>
1795 * configure.ac (gl_MODULES): Add mkstemp for machines that don't
1796 have a native implementation.
1798 2005-05-06 Gary V. Vaughan <gary@gnu.org>
1800 * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed. These are
1801 handled already by gnu/exit.h.
1803 * configure.ac (gl_MODULES): Add assert to support a
1804 --disable-assert configure time option for NDEBUG setting.
1806 * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
1807 * bootstrap (src_modules): Add version-etc-fsf.
1808 * src/main.c (version_etc_copyright): Removed.
1810 * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
1812 2005-05-04 Gary V. Vaughan <gary@gnu.org>
1814 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
1816 * src/freeze.c (produce_frozen_state): Use \n line-endings even
1817 on Windows, so that the frozen file reader will work.
1818 Reported by Josef T. Burger <bolo@bolo.com>
1820 2005-05-04 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
1822 Forward port of a patch that allowed m4-1.4.2 to compile on
1825 * configure.ac (AC_CHECK_HEADERS): Add signal.h,
1827 * src/m4.h: And include them as appropriate.
1828 * src/main.c, src/stackovf.h: Don't include signal.h literally;
1829 m4.h will include the correct file.
1831 2005-05-04 Gary V. Vaughan <gary@gnu.org>
1833 * m4/m4private.h: Make errno visible for the sources patched
1836 2005-05-04 Paul Eggert <eggert@twinsun.com>
1838 * src/main.c (print_program_name_CB): Preserve errno, since
1839 M4ERROR relies on this.
1840 * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
1841 * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
1842 * m4/path.c (m4_path_search): Don't let "free" trash errno when
1845 * m4/output.c (m4_insert_file): Don't assume errno has a valid
1846 value simply because fread returns zero. This fixes a
1847 portability bug reported by Marion Hakanson in
1848 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
1850 2005-05-04 Santiago Vila <sanvila@debian.org>
1852 * tests/stackovf.test: Use tempfile if available.
1854 2005-05-04 Robert Bihlmeyer <robbe@orcus.priv.at> (tiny change)
1856 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
1857 * m4/output.c (m4_insert_file): Do not mix buffered and
1858 unbuffered I/O, as this breaks on the Hurd.
1860 2005-05-04 Gary V. Vaughan <gary@gnu.org>
1862 Gnulib has changed again. Reimport. Adjust. Rinse. Repeat.
1863 Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
1864 and libtoolize does a better job of ltdl importing now too, so
1865 take advantage of that while updating the tree:
1867 * acm4, config: Moved from here...
1868 * ltdl/m4, ltdl/config: ...to here.
1869 * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
1870 src/Makefile.am, tests/Makefile.am: Removed...
1871 * Makefile.am: ...and migrated to here, with adjustments to
1872 compensate for relative path differences.
1873 * commit: Adjust relative paths.
1874 * configure.ac: Adjust relative paths.
1875 (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
1877 (LT_PREREQ): 2.0 isn't released yet, but will work when it is! In
1878 the meanwhile, CVS HEAD libtool is needed.
1879 (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
1880 stricly new enough, we also need a patch.
1881 (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
1882 (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
1883 (gl_MODULES): Don't list getopt and version-etc, as they don't
1885 * bootstrap: After running gnulib-tool to import the listed
1886 modules, fetch getopt and version-etc into src manually.
1887 (ltdldir): Change to ltdl.
1888 * src/main.c: Adjust for changes in version-etc API.
1889 * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
1890 but works when the getopt module isn't to be included in the lib.
1891 * README: Add note about patching autoconf and automake to
1894 2005-05-02 Matt Kraai <kraai@debian.org> (tiny change)
1896 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
1897 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
1898 empty file rather than to a nonexistent file. This closes a
1899 common security hole.
1900 * modules/m4.c (m4_maketemp): Implement the above, by using
1901 mkstemp rather than mktemp.
1903 2005-05-01 Gary V. Vaughan <gary@gnu.org>
1905 The FSF are moving offices today. Changed their contact address
1906 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
1907 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
1909 2005-03-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1911 * tests/Makefile (clean-local): Ignore testsuite cleanup
1914 2005-03-11 Per Bothner <per@bothner.com> (tiny change)
1916 * tests/Makefile (clean-local): Only run the testsuite cleanup
1917 if the testsuite has been generated.
1919 2005-02-11 Stepan Kasal <kasal@ucw.cz>
1921 * TODO: slight clarification of the example of qindir usage.
1923 2005-02-08 Gary V. Vaughan <gary@gnu.org>
1925 * TODO: Add qindir requirement, and defn bug.
1926 From Stepan Kasal <kasal@ucw.cz>
1928 2005-02-08 Stepan Kasal <kasal@ucw.cz>
1930 * TODO: Add ``execution stack'', fix a typo.
1931 * doc/m4.texinfo: Typos.
1933 2004-12-24 Eric Blake <ebb9@byu.net>
1935 * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
1936 to the gnu subdirectory.
1937 * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
1938 * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
1939 * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
1940 * m4/system_.h: Likewise, in non-configured includes.
1942 2004-10-14 Noah Misch <noah@cs.caltech.edu>,
1943 Gary V. Vaughan <gary@gnu.org>
1945 * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
1946 Protect definitions from macro expansion under -DNDEBUG by
1947 parenthesising the expanded function names.
1948 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
1949 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
1950 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
1951 (m4_is_syntax_macro_escaped): Similarly protect function
1952 definitions from macro expansion under -DNDEBUG by #undefing the
1953 matching macro names before each definition. Also, move all the
1954 function definitions to the end of the file so that any
1955 invocations in the rest of the file pick up the fast macro
1957 * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
1958 (m4_set_debug_file, m4_set_trace_messages)
1959 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
1960 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
1961 (m4_set_max_debug_arg_length_opt): New fast macro versions of the
1962 option setter functions.
1964 2004-09-23 Gary V. Vaughan <gary@gnu.org>
1966 * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
1969 2004-09-23 Gary V. Vaughan <gary@gnu.org>
1971 * src/main.c: Include gnulib files from the correct directory.
1973 * gnulib/*: Don't store any of the gnulib files in arch, as they
1974 generate spurious changes.
1975 * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
1976 gnulib macros now share our macro directory.
1977 (SUBDIRS): Descend into `gnu' rather than `gnulib'.
1978 * bootstrap: Call gnulib-tool to import from the gnulib tree.
1979 (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
1980 gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
1981 the gettext macros from autopoint that overwrite the gnulib-tool
1982 imported versions. Import sources and Makefile.am into the `gnu'
1983 directory. Changed all callers.
1984 * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
1985 gl_INIT): Call these gnulib-tool macros instead of the hardcoded
1986 for imported modules.
1987 * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
1988 acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
1989 hardcoding the gnulib macros they wrap.
1991 2004-07-15 Gary V. Vaughan <gary@gnu.org>
1993 Latest CVS libtool can preload modules in libraries, including
1994 its own module loaders! Tweak m4 so that it doesn't try to treat
1995 libltdl's module loaders as m4 modules when freezing and on exit:
1997 * gnulib/acm4/*.m4: Don't store these files in arch since they
1998 generate spurious changes.
1999 * bootstrap: Simplify initial libtoolize call, since CVS
2000 libtoolize is smarter these days.
2001 * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
2003 * m4/module.h (m4__module_exit): Missing declaration.
2004 * m4/m4private.h (m4__module_next): New function declaration.
2005 * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
2006 encapsulation. Changed all callers.
2007 (m4__module_interface): New function to verify m4 loadable module
2009 (m4__module_init): Register the interface validator.
2010 (m4__module_exit): Only close my own modules.
2011 * modules/m4.c (unistd.h): Provide missing declaration.
2012 (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
2013 (m4_expand_ranges): More missing declarations.
2014 * modules/modtest.c (export_test): Ditto.
2015 * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
2016 * src/main.c (main): Bump copyright year.
2017 * tests/modules.at: Fix sed syntax error.
2020 2004-06-17 Gary V. Vaughan <gary@gnu.org>
2022 Tweaking to enable compilation with latest CVS libtool and
2023 libltdl. We can't just dump the library files directly into the
2024 m4 directory anymore now that libltdl is built from pieces itself:
2026 * bootstrap: Rewritten to use latest libtoolize sanely, and to
2027 set up libltdl subdirectory.
2028 * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
2029 gnulib subdirectory's config.
2030 (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
2031 (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
2033 (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
2034 configure.ac, so use AC_WITH_LTDL instead.
2035 * Makefile.am (SUBDIRS): Add libltdl.
2036 * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated. gnulib now uses
2038 * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
2039 (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
2040 (libm4_la_LIBADD): Add LIBLTDL.
2041 * m4/ltdl.c, m4/ltdl.h: Removed.
2042 * m4/m4module.h: Include canonical ltdl.h.
2045 2004-06-14 Gary V. Vaughan <gary@gnu.org>
2047 * gnulib/import: Now updates makefile fragments, and configure.ac.
2048 * gnulib/m4/gnulib.am: New file. Generated makefile fragments.
2049 * gnulib/m4/Makefile.am: include it.
2050 * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
2051 gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
2052 gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
2053 gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
2054 gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
2055 * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
2056 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
2057 gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
2058 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
2059 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
2060 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
2061 gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
2062 gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
2064 * gnulib/m4/getopt_int.h: New source file from latest gnulib
2066 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
2067 gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
2068 gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
2069 gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
2070 Updated source files from latest gnulib.
2072 2004-02-29 Gary V. Vaughan <gary@gnu.org>
2074 * config/mailnotify: New file for mailing commit notifications,
2075 imported from cvs-utils.
2076 * commit: Updated from cvs-utils and tweaked for m4.
2078 2003-12-01 Gary V. Vaughan <gary@gnu.org>
2080 * config/mkstamp: Updated from CVS libtool.
2081 * configure.ac: Generate a gnu coding standards compliant version
2082 number, and use it for the banner.
2083 * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
2084 mhen the TIMESTAMP changes in ChangeLog, but the file modification
2085 time doesn't (e.g. in cvs commit). Otherwise dist tarballs will
2086 contain the previous version number.
2087 * src/main.c: Make --version output conform to the GNU standard.
2089 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
2090 * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
2091 m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
2092 shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
2093 time_la_SOURCES): ...so that these are defaulted correctly, and
2094 can be removed from this file.
2095 (AM_LDFLAGS): Add -module...
2096 (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
2097 traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
2098 import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
2099 the individual settings can be removed.
2100 * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
2101 * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
2102 m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
2103 shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
2104 time_la_LIBADD): ...so that these are picked up as a deplib of
2105 libm4 and don't need to be set explicitly.
2107 2003-11-18 Gary V. Vaughan <gary@gnu.org>
2109 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
2110 from the standard build. It is too fragile.
2112 * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
2113 CVS libtool after merging m4 changes across to libtool.
2115 * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
2116 * m4/path.c (search_path_add): Ditto.
2118 2003-11-13 Gary V. Vaughan <gary@gnu.org>
2120 * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
2121 libtool tags we don't use in configure. This reduces the size
2122 of the script from over 1Mb to under 700Kb.
2124 2003-11-13 Gary V. Vaughan <gary@gnu.org>
2126 The import script was not written properly, and the last gnulib
2127 import was incomplete. Fixed that problem, and reimport our
2128 gnulib dependencies, which picks up the address calculation
2129 overflow checks described by Paul below. Also tweak the clients
2130 of the gnulib xalloc module not to use deprecated macros:
2132 * gnulib/import: Recurse through module dependencies rather than
2133 naively descending only one level.
2134 * configure.ac: Add calls to gnulib's strnlen and extension module
2136 * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
2138 * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
2139 gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
2140 gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
2141 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
2143 * gnulib/acm4/libtool.m4: Updated from CVS libtool.
2144 * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
2145 place of `xcalloc (1, S)'.
2146 * m4/m4.c (m4_create): Likewise.
2147 * m4/m4private.h (m4_symbol_value_create): Likewise.
2148 * m4/symtab.c (symtab_fetch): Likewise.
2149 * m4/syntax.c (m4_syntax_create): Likewise.
2150 * src/freeze.c (reload_frozen_state): Likewise.
2151 * m4/path.c (search_path_add): Eliminate use of deprecated NEW
2153 * m4/symtab.c (m4_symtab_create): Likewise.
2155 2003-11-13 Gary V. Vaughan <gary@gnu.org>
2157 * tests/module.at: Comment typo.
2159 2003-10-10 Gary V. Vaughan <gary@gnu.org>
2161 * tests/modules.at (modules: importing): Apply some lateral
2162 thinking, and use AT_CHECK to compare the output of a sed pass
2163 over stderr against the canonical strerror string.
2165 * tests/modules.at (modules: importing): Edit the generated stderr
2166 output to canonicalize strerror output, before a comparison.
2168 2003-10-10 Gary V. Vaughan <gary@gnu.org>
2170 Tru64UNIX perl is sloppy with namespace pollution. This patch is
2171 careful not to trip over the mess:
2173 * modules/perl.c: Some builds of perl install headers that contain
2174 `#define try __builtin_try'. Be sure to undefine that macro
2175 before `m4/hash.h' gets included, which uses the `try' symbol.
2176 * m4/system_.h: Similarly for `bool'. Undefine `bool', `true' and
2177 `false' before including `stdbool.h'.
2178 (DELETE): This symbol is not in m4's namespace, and is in any
2179 case only used internally...
2180 * m4/m4private.h (DELETE): ...so move it to here.
2181 Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
2183 2003-10-08 Paul Eggert <eggert@twinsun.com>
2185 Don't use XMALLOC and XCALLOC. Once we install the
2186 corresponding patch into gnulib, this will fix some
2187 address-calculation overflow bugs on hosts where calloc (A, B)
2188 returns garbage when A*B overflows.
2190 * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
2191 maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
2192 xmalloc, XCALLOC with xcalloc.
2193 * m4/m4.c (m4_create): Likewise.
2194 * m4/m4private.h (m4_symbol_value_create): Likewise.
2195 * m4/output.c (m4_output_init): Likewise.
2196 * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
2197 * m4/syntax.c (remove_syntax_attribute): Likewise.
2198 * src/freeze.c (reload_frozen_state): Likewise.
2199 * src/main.c (main): Likewise.
2201 2003-10-07 Gary V. Vaughan <gary@gnu.org>
2203 * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
2204 gnulib/acm4 directories for aclocal m4 macros.
2205 * gnulib/Makefile.am (EXTRA_DIST): Removed.
2206 (MAINTAINERCLEANFILES): Add Makefile.in.
2207 * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
2209 * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
2210 * gnulib/import: New file. Temporary script for updating gnulib
2211 imported files, until gnulib-tool is working.
2212 * gnulib/config/codeset.m4, gnulib/config/error.m4,
2213 gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
2214 gnulib/config/getopt.m4, gnulib/config/gettext.m4,
2215 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
2216 gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
2217 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
2218 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
2219 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
2220 gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
2221 gnulib/config/nls.m4, gnulib/config/obstack.m4,
2222 gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
2223 gnulib/config/progtest.m4, gnulib/config/realloc.m4,
2224 gnulib/config/regex.m4, gnulib/config/restrict.m4.
2225 gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
2226 gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
2227 gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
2228 gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
2229 gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
2230 gnulib/config/xstrndup.m4: Removed.
2231 * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
2232 gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
2233 gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
2234 gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
2235 gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
2236 gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
2237 gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
2238 gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
2239 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
2240 gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
2241 gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
2242 gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
2243 gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
2244 gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
2245 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
2246 gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
2247 gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
2248 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
2249 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
2250 gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
2251 gnulib/import script.
2252 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
2253 gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
2254 gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
2255 gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
2256 gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
2257 gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
2258 gnulib with gnulib/import script.
2259 * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
2260 guards ready for gnulib-tool to autoupdate on import.
2261 * config/debug.m4, config/gmp.m4, config/m4-error.m4,
2262 config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
2263 config/stackovf.m4: Moved from here...
2264 * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
2265 acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
2266 acm4/stackovf.m4: ...to here, to separate aclocal macros from
2267 configure time helper scripts.
2268 * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
2269 * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
2270 m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
2271 src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
2273 * src/main.c (version_etc_copyright): Only output the current
2275 (version_etc): Call with new variadic API.
2277 2003-09-16 Gary V. Vaughan <gary@gnu.org>
2279 * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
2280 version-etc module from CVS gnulib.
2281 * po/POTFILES.in: Add gnulib/m4/version-etc.c.
2282 * src/Makefile.am: Build it.
2283 * src/main.c: Use it.
2285 * gnulib/m4/exit.h: Import exit module from CVS gnulib.
2286 * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
2287 * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
2290 2003-09-15 Charles Wilson <cygwin@cwilson.fastmail.fm>,
2291 Gary V. Vaughan <gary@gnu.org>
2293 * bootstrap: Separate options.
2294 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
2295 * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
2297 * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
2298 (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
2299 (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
2300 (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
2301 $(LTLIBINTL) for gettext support on cygwin.
2302 * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
2303 have $(LTLIBINTL) from the preloaded module la files.
2304 * README: Remove the warning about using --disable-nls on Windows
2307 2003-09-15 Gary V. Vaughan <gary@gnu.org>
2309 * gnulib/m4/regex.c: s/<regex.h>/"regex.h"/ or else the compiler
2310 picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
2313 2003-09-12 Gary V. Vaughan <gary@gnu.org>
2315 * doc/STYLE: Document the gnulib header naming conventions, and
2317 * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
2318 gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
2319 gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
2321 * gnulib/m4/Makefile.am: Remove the rules to build these headers.
2323 * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
2324 module from CVS gnulib.
2325 * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
2326 (gl_FUNC_STRTOL): In favour of the module macro.
2328 2003-09-12 Gary V. Vaughan <gary@gnu.org>
2330 Replace the getopt code with CVS gnulib getopt. The source files
2331 detect whether they are in a glibc environment and preprocess away
2332 all of the code if there is a system getopt, so we can compile
2333 them into the m4 executable unconditionally:
2335 * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
2336 gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
2337 * configure.ac (gl_GETOPT): Use this instead of homebrew inline
2339 * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
2341 * src/Makefile.am: Adjust.
2342 * src/main.c: Always include our shipped getopt.h.
2343 * po/POTFILES.in: Use new location of getopt.c.
2345 2003-09-12 Gary V. Vaughan <gary@gnu.org>
2347 * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
2348 * config/Makefile.am: Removed. Automake 1.8 distributes the files
2349 in this directory automatically.
2350 * Makefile.am (EXTRA_DIST): Except config/mkstamp.
2352 * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
2354 * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
2356 * modules/Makefile.am (pkglibexecdir): Set it here.
2357 (pkgmodincdir): Renamed to pkgmodincludedir). Changed all clients.
2359 * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
2360 Import regex module from CVS gnulib.
2361 * gnulib/config/restrict.m4: Ditto for dependee module restrict.
2362 * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
2363 do extra substitutions for Makefile.
2364 * configure.ac: Use it.
2365 * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
2366 from regex_.h if necessary.
2367 * m4/system_.h: Include the correct version of regex.h.
2368 * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
2370 * po/POTFILES.in: Use new location of regex.c.
2372 * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
2373 realloc.c: automake distributes these files already.
2375 2003-09-12 Gary V. Vaughan <gary@gnu.org>
2377 Replace the xstrzdup code by importing the xstrndup module from
2378 CVS gnulib, along with its dependencies: strndup and strnlen:
2380 * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
2381 gnulib/config/xstrndup.m4: Import xstrndup module from CVS
2383 * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
2384 gnulib/config/strndup.m4: Ditto wrt strndup.
2385 * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
2387 * gnulib/m4/Makefile.am: Add rules from newly imported modules.
2388 However, contrary to gnulib, we install xstrndup.h.
2389 * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
2390 * gnulib/lib/xstrzdup.c: Delete. This was never a gnulib file, it
2391 is an artifact of the old m4 portability layer.
2392 * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
2393 * m4/system_.h: Include xstrndup.h.
2394 * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
2396 2003-09-11 Gary V. Vaughan <gary@gnu.org>
2398 Reimport the latest xalloc module from CVS gnulib, and adjust the
2399 m4 sources to take advantage of xalloc xfree. Also create a new
2400 macro DELETE with the same semantics as the old m4 XFREE macro,
2401 and carefully tweak callers:
2403 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
2405 * m4/utility.c (xfree): Removed. This function is now supplied by
2407 * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
2408 * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
2409 * m4/symtab.c (m4_symtab_create): Ditto.
2410 * m4/system_.h: Removed XFREE redefine.
2411 (DELETE): New macro with same functionality as the original m4
2412 XFREE macro, but based on xalloc.h now. Changed all callers.
2413 * src/main.c (main): Use XMALLOC macro.
2414 * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
2416 * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
2418 2003-09-10 Gary V. Vaughan <gary@gnu.org>
2420 Import the xalloc module from CVS gnulib, along with its
2421 dependencies: exitfail, malloc and realloc. We had different
2422 semantics for our XFREE and a function xfree() not supplied by
2423 gnulib, so also a bit of work to keep everything running
2426 * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
2427 (gl_XALLOC): Use gnulib equivalents.
2428 * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
2429 gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
2430 * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
2431 * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
2433 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
2434 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
2435 * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
2437 (pkgincdir): Removed. Use pkgincludedir instead.
2438 * m4/m4private.h (XFREE): xfree already checks for NULL.
2439 * m4/system_.h: Use xalloc module, and remove macros already
2440 supplied by xalloc.h.
2441 * m4/utility.c (xfree): xalloc does not yet implement xfree, so
2442 moved the old definition from m4/xmalloc.c to here for now.
2444 2003-09-09 Gary V. Vaughan <gary@gnu.org>
2446 Import the error and progname modules from CVS gnulib. Our old
2447 error.c subsumed the functionality of both, so a little adjustment
2448 was required to accomodate the split in sources. Also added more
2449 wrapper macros to choose between a system installed error.h or our
2450 shipped gnulib error module:
2452 * m4/error.c, m4/error.h: Removed.
2453 * m4/Makefile.am: Adjust.
2454 (pkgincdir): Removed. Use pkgincludedir instead.
2455 * m4/module.h, src/main.c: Don't include `m4/error.h'.
2456 * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
2458 * gnulib/m4/progname.c: Imported from CVS gnulib.
2459 * gnulib/m4/progname.h: Ditto.
2460 * src/main.c: Adjust to use progname module.
2461 * gnulib/m4/error.c: Imported from CVS gnulib.
2462 * gnulib/m4/error_.h: Ditto.
2463 * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
2464 if appropriate, and link a local error.h if the system version is
2466 (libgnu_la_SOURCES) Add progname module sources.
2467 * gnulib/config/error.m4: Imported from CVS gnulib.
2468 * gnulib/config/strerror_r.m4: Ditto.
2469 * config/m4-error.c: New file. Wrap gnulib error.m4 but arrange
2470 to have ERROR_H for Makefile substitutions and tell system.h
2471 whether the system error.h should be used, or a locally installed
2473 * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
2475 2003-09-09 Gary V. Vaughan <gary@gnu.org>
2477 * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
2478 s/gettext_.h/gettext.h/.
2480 * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
2481 automake have been fixed.
2483 * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
2484 gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
2485 of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
2486 rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
2488 2003-09-09 Gary V. Vaughan <gary@gnu.org>
2490 The gnulib obstack module requires the gnulib gettext module for
2491 systems that do not have GNU gettext installed. Because we use
2492 -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
2493 that directory incase it clashes with the system gettext.h. This
2494 delta uses gettext_.h and extra rules in the Makefile to make a
2495 link to gettext.h when needed:
2497 * Makefile.am (auxdir): Removed. No longer used.
2498 * configure.ac (ac_aux_dir): Removed AC_SUBST. No longer used.
2499 (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
2501 (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
2502 Makefile based build.
2503 (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
2504 of the macros are kept.
2505 * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
2506 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
2507 * config/Makefile (ACLOCAL_MACROS): Removed. Automake 1.7a
2508 distributes these automatically.
2509 * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
2510 warning from automake-1.7a.
2511 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
2512 m4_CHECK_DEBUGGING for consistency with gnulib prefixes. Changed
2514 * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
2515 wrt. m4_FUNC_OBSTACK.
2516 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
2517 wrt. m4_sys_STACKOVF.
2518 * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
2519 wrt. _m4_LIB_GMP, m4_LIB_GMP.
2520 (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
2521 namespace. Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
2523 * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
2524 * gnulib/m4/Makefile.am: Added a new block to make an appropriate
2525 gettext.h link on deficient systems.
2526 (pkginc_HEADERS): Mention $(GETTEXT_H).
2527 (EXTRA_HEADERS): Mention gettext.h.
2528 * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
2529 * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
2530 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
2531 gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
2532 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
2533 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
2534 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
2535 gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
2536 gnulib/config/po.m4, gnulib/config/progtest.m4,
2537 gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
2538 gnulib/config/ulonglong.m4: Imported from CVS gnulib.
2540 2003-09-05 Gary V. Vaughan <gary@gnu.org>
2542 We can't mirror the gnulib directory structure here, since we need
2543 to be able to eg. `#include <m4/obstack.h>' from our source files,
2544 which is much easier if the local obstack.h is created in a
2545 directory named m4. Rather than trying to symlink everything into
2546 the m4 directory, now we build a libtool convenience library from
2547 the sources we get from gnulib and link that with libm4.la:
2549 * gnulib/config/extensions.m4: Imported from CVS gnulib.
2550 * gnulib/config/unlocked-io.m4: Ditto.
2551 * gnulib/m4/unlocked-io.h: Ditto.
2552 * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
2553 gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
2554 * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
2555 gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
2556 * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
2557 * m4/Makefile.am: Adjust.
2558 * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
2559 macros we redistribute.
2560 * gnulib/m4/Makefile.am: New file. Build libgnu.la convenience
2561 library among others.
2562 (GNULIB_SRCS, GNULIB_MACROS): Removed.
2563 * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
2564 * config/m4-obstack.m4: Adjust.
2565 * po/POTFILES.in: Adjust.
2566 * configure.ac: Reformatting. Call newly imported gnulib macros.
2567 * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
2568 bogus calls of `#include "m4.h"'.
2569 * Makefile.am: INCLUDES has been deprecated in favour of
2571 * m4/Makefile.am: Ditto.
2572 * modules/Makefile.am: Ditto.
2573 * src/Makefile.am: Ditto.
2575 2003-09-05 Gary V. Vaughan <gary@gnu.org>
2577 * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
2579 2003-09-04 Gary V. Vaughan <gary@gnu.org>
2581 Migrate the obstack support into the gnulib directories for easy
2582 synchronisation with upstream files in gnulib:
2584 * config/gnu-obstack.m4: Moved from here...
2585 * config/m4-obstack.m4: ...to here.
2586 * config/Makefile.am (SPECIFIC_MACROS): Adjust.
2587 * m4/obstack.c, m4/obstack_.h: Moved from here...
2588 * gnulib/obstack.c, gnulib/obstack.h: ...to here.
2589 * po/POTFILES.in: Adjust.
2590 * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
2591 * m4/Makefile.am: Add a whole new section to link the obstack
2592 sources from the gnulib tree if necessary.
2593 * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
2595 * config/m4-obstack.m4: Rewrite as a wrapper for
2596 gnulib/m4/obstack.m4.
2598 2003-09-04 Gary V. Vaughan <gary@gnu.org>
2600 GNU M4 currently builds with a number of files adapted from
2601 upstream sources. Recently the gnulib project on savannah.gnu.org
2602 has pulled together a great many of these externally maintained
2603 files. This delta is the beginnings of isolating those files
2604 maintained in gnulib to make it easy to synchronise M4 with the
2605 upstream files prior to releases.
2607 * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
2609 (SUBDIRS): Added new gnulib subdirectory.
2610 * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
2611 * config/stdbool.m4: Moved from here...
2612 * gnulib/m4/stdbool.m4: ...to here.
2613 * m4/stdbool_.h: Moved from here...
2614 * gnulib/lib/stdbool_.h: ...to here.
2615 * gnulib/Makefile.am: New file. Make sure the gnulib tree is
2617 * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
2618 code to work with new stdbool_.h location.
2619 (gnulib_srcdir): New.
2621 2003-09-04 Gary V. Vaughan <gary@gnu.org>
2623 * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
2624 (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
2626 (SPECIFIC_TOOLS): New variable. Moved mkstamp to here.
2627 (EXTRA_DIST): Use it.
2629 * bootstrap: CVS autoreconf leaves file droppings. Remove
2630 aclocal.m4t incase autoreconf doesn't.
2632 2003-08-29 Gary V. Vaughan <gary@gnu.org>
2634 * m4/gnu-obstack.h: Updated from CVS gnulib. For consistency with
2635 the other gnulib imports, renamed to m4/obstack_.h.
2636 * m4/obstack.c: Updated from CVS gnulib.
2637 * m4/Makefile.am (EXTRA_HEADERS): Adjust.
2638 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
2639 header tests from gnulib obstack module. AC_CONFIG_LINKS knows
2640 about vpath already, and $top_srcdir upsets CVS Automake, so the
2641 $top_srcdir reference was removed.
2643 * m4/system-h.in: For consistency with the gnulib imports, renamed
2645 * m4/Makefile (EXTRA_HEADERS): Adjust.
2646 * configure.ac (AC_CONFIG_FILES): Adjust.
2648 * m4/stdbool_.h: New file from gnulib for systems without their
2650 * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
2651 * config/stdbool.m4: New file. Macros from gnulib for same.
2652 * configure.ac: Use it.
2654 2003-08-27 Gary V. Vaughan <gary@gnu.org>
2656 * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
2657 * config/gmp.m4: Ditto.
2658 * config/gnu-obstack.m4: Ditto.
2659 * config/stackovf.m4: Ditto.
2660 * m4/builtin.c: Ditto.
2661 * m4/debug.c: Ditto.
2662 * m4/error.c: Ditto.
2663 * m4/error.h: Ditto.
2664 * m4/gnu-obstack.h: Ditto.
2667 * m4/input.c: Ditto.
2669 * m4/m4module.h: Ditto.
2670 * m4/m4private.h: Ditto.
2671 * m4/macro.c: Ditto.
2672 * m4/module.c: Ditto.
2673 * m4/obstack.c: Ditto.
2674 * m4/output.c: Ditto.
2676 * m4/regex.c: Ditto.
2677 * m4/regex.h: Ditto.
2678 * m4/strtol.c: Ditto.
2679 * m4/symtab.c: Ditto.
2680 * m4/syntax.c: Ditto.
2681 * m4/utility.c: Ditto.
2682 * m4/xmalloc.c: Ditto.
2683 * m4/xstrdup.c: Ditto.
2684 * m4/xstrzdup.c: Ditto.
2685 * modules/evalparse.c: Ditto.
2686 * modules/format.c: Ditto.
2687 * modules/gnu.c: Ditto.
2688 * modules/import.c: Ditto.
2689 * modules/load.c: Ditto.
2690 * modules/m4.c: Ditto.
2691 * modules/m4.h: Ditto.
2692 * modules/modtest.c: Ditto.
2693 * modules/mpeval.c: Ditto.
2694 * modules/perl.c: Ditto.
2695 * modules/shadow.c: Ditto.
2696 * modules/stdlib.c: Ditto.
2697 * modules/time.c: Ditto.
2698 * modules/traditional.c: Ditto.
2699 * src/freeze.c: Ditto.
2700 * src/getopt.c: Ditto.
2701 * src/getopt1.c: Ditto.
2703 * src/main.c: Ditto.
2704 * src/stackovf.c: Ditto.
2706 * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
2707 ac_default_headers is an autoconf internal variable.
2708 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
2709 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
2711 * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
2712 * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
2715 2003-08-15 Gary V. Vaughan <gary@gnu.org>
2717 * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
2719 * system-h.in (m4_boolean): Removed in favour of using C99 bool if
2720 possible or faking one with a typedef. Changed all callers.
2722 2003-08-15 Gary V. Vaughan <gary@gnu.org>
2724 Still cleaning up the users' module API, by taking out the stuff
2725 that isn't used by any existing modules, and moving specialised
2726 functions out of libm4 and into the module they are used by.
2728 * m4/m4module.h (m4_skip_space): No need to export this. Moved...
2729 * m4/utility.c (m4_skip_space): ...to here the home of its only
2730 use, made static and renamed to `skip_space'. Changed all
2732 * m4/m4module.h (m4_expand_ranges): Removed prototype.
2733 * m4/utility.c (m4_expand_ranges): Moved definition from here...
2734 * modules/m4.c (m4_expand_ranges): ...to here, and exported using
2736 * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
2738 * modules/gnu.c (builtin_syntax): Import and use in this
2739 builtin implementation.
2740 * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
2742 * m4/macro.c (trace_flush): Except here where the macro is now
2744 * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
2745 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
2747 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
2748 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
2750 2003-08-14 Gary V. Vaughan <gary@gnu.org>
2752 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
2753 compiler based AC_CHECK_HEADER that was introduced in
2755 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
2756 * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
2757 * configure.ac: Use renamed M4_AC_LIB_GMP.
2759 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
2760 macro that requires arguments! This stops the shell's bad
2761 substitution error at configure time.
2763 * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
2764 variables to the testsuite shell. Set the value of USE_GMP so
2765 that the gmp test will run!
2766 (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
2768 2003-08-11 Gary V. Vaughan <gary@gnu.org>
2770 Libltdl already has an excellent mechanism for accessing C symbols
2771 in modules. Lets use that! Remove all the exporting cruft and
2772 just use lt_dlsym in conjunction with a few conventions to
2773 simplify module writers' jobs. Also removed the table address
2774 caching code and otherwise simplified the module loader quite a
2775 bit. To access exported symbols in other modules, first the
2776 exporting module must name the symbols <modname>_LTX_<symname>,
2777 and the importing module must define a function type called
2778 <symname>_func. The importer then adds
2779 M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
2780 that wishes to call out to the exported functions. Care must be
2781 taken that <symname> is non-NULL in the importing module incase
2782 M4_MODULE_IMPORT fails, but otherwise it can be called as if the
2783 definition was in the importers source. Study
2784 `modules/{gnu.c,m4.{c,h}' for a model example. At the moment,
2785 m4_module_import will attempt to automatically load a module
2786 required for symbol access if it is not loaded already.
2788 * TODO: Removed the items fixed in this delta.
2789 * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
2791 * m4/ltdl.h (lt_dlhandle_find): Declare it.
2792 * m4/module.c (m4_module_unload): Use it.
2793 * src/freeze.c (reload_frozen_state): Ditto.
2794 * m4/m4module.h (m4_export): Deleted. Removed all references.
2795 (M4_MODULE_IMPORT): New user convenience macro for importing
2796 arbitrary symbols from other modules.
2797 * m4/module.c (m4_module_import): New function to service
2798 M4_MODULE_IMPORT macro.
2799 (module_data): Removed. Looking up the tables on demand with
2800 lt_dlsym, rather than caching their addresses here simplifies the
2802 (m4_get_module_builtin_table, m4_get_module_macro_table):
2803 Removed. Changed all callers.
2804 (set_module_macro_table, set_module_builtin_table): Renamed to
2805 install_macro_table and install_builtin_table respectively, and
2806 simplified now that the cache is no more.
2807 * modules/gnu.c (builtin_symbols): Use this new mechanism to
2808 import m4_dump_symbols from the m4 module.
2809 (builtin_esyscmd): Likewise for m4_set_sysval and
2811 * modules/m4.c (m4_export_table): Removed. Functions are
2812 addressed with the new mechanism which doesn't need this.
2813 (m4_set_sysval): New exported accessor function to prevent
2814 problems with variable access on inferior architectures.
2815 * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
2816 (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
2817 that we can have some type safety.
2818 * modules/modtest.c (export_test): C level exported function for
2819 testing the new import mechanism.
2820 * modules/import.c: New file for the import end of the test.
2821 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
2822 * tests/modules.at: New test cases for intermodule symbol
2825 2003-08-07 Gary V. Vaughan <gary@gnu.org>
2827 * m4/m4module.c (m4_string): Moved from here...
2828 * m4/m4private.c (m4_string): ...to here.
2830 * m4/utility.c (dumpdef_cmp): Removed stale declaration.
2832 2003-07-29 Gary V. Vaughan <gary@gnu.org>
2834 * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
2835 already available to module writers through
2836 m4_{get,set}_nesting_limit_opt(), so moved from here...
2837 * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
2838 (m4_create): Use it.
2840 2003-07-28 Gary V. Vaughan <gary@gnu.org>
2842 Aside from auditing path.c for m4module.h api obfuscation, this
2843 delta introduces the concept of private struct members in opaque
2844 data types to GNU m4: See the STYLE file for details.
2846 * TODO: Remind ourselves that a rewrite of path.c is needed.
2847 * m4/m4module.h (m4_search_path, struct m4_search_path_info):
2849 * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
2850 here and renamed. These type definitions are for internal api use
2851 only. Changed all callers.
2852 * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
2854 * m4/path.c (search_path_env_init, search_path_add): ...to here
2855 and renamed. These calls were never used outside this file.
2856 Changed all callers.
2857 (dirpath): Moved functionality of this static declaration...
2858 * m4/m4private.h (struct m4): ...to this new internal only
2859 search_path field. Changed all callers.
2860 (m4__get_search_path): Added new internal api accessor.
2861 * m4/path.c (m4_search_path_info_new): Removed. Not used.
2862 (m4_include_init): Removed...
2863 * m4/m4.c (m4_create): ...because the new m4 field is now
2865 (m4_delete): Recycle search_path memory.
2866 * src/main.c (main): Don't call m4_include_init now that it's
2868 * doc/STYLE: Document convention for private fields in opaque
2871 2003-07-24 Gary V. Vaughan <gary@gnu.org>
2873 Sometimes exporting the address of a symbol from a module isn't
2874 enough for other modules to call that symbol correctly. If
2875 custom data types are used for function parameters, they need to
2876 be known to the caller. This change introduces the concept of
2877 $(prefix)/include/modules/$(modulename).h to declare those
2878 structures. Also we move m4_dump_symbols from libm4 to the m4
2879 module to show this concept in action.
2881 * m4/m4module.h (m4_dump_symbol_data): Moved from here...
2882 * modules/m4.h (m4_dump_symbol_data): ...to this new file for
2883 exporting data structures from modules/m4.c.
2884 * modules/m4.c, modules/gnu.c: Include it.
2885 * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
2886 * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
2888 * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
2890 * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
2891 ...to here, with slight renaming.
2892 (m4_export_table): Prototype and add m4_dump_symbols.
2893 * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
2894 definition of m4_dump_symbols.
2895 * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
2896 * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
2898 2003-07-24 Gary V. Vaughan <gary@gnu.org>
2900 Create an export table in modules/m4.c in readiness for beefing up
2901 the module loader to track module exports and imports.
2903 * m4/m4module.h (m4_debug_flush_files): Removed prototype.
2904 * m4/debug.c (m4_debug_flush_files): Moved...
2905 * modules/m4.c (m4_sysval_flush): ...to here and renamed.
2906 * modules/gnu.c (builtin_esysval): Use it.
2907 * m4/m4module.h (m4_export): New type for declaring module symbols
2909 * modules/m4.c (m4_export_table): List symbols exported from this
2910 module for use by other modules.
2912 2003-07-24 Gary V. Vaughan <gary@gnu.org>
2914 An experiment: There is loads of code in libm4 which should be in
2915 the m4 module, but is also used by another module. Just because
2916 some linkers won't cope with calls across dynamic runtime loaded
2917 objects I initially left the code in libm4. It will tidy the
2918 module api immensely if this code moves to the right place, I just
2919 need to remember to invent a suitable calling mechanism at some
2920 point. For now, only modules that are statically linked and
2921 preloaded will get this treatment, so the only platforms that will
2922 break are those that require all symbols to be resolved at link
2925 * TODO: Reminder that what I am doing could reduce portability
2926 unless I do something more robust later.
2927 * m4/m4module.h (m4_sysval): No longer exported from libm4.
2928 * m4/utility.c (m4_sysval): No longer declared in libm4.
2929 * modules/Makefile.am: Reformatting.
2930 * modules/m4.c (m4_sysval): Declare it at place of use.
2931 * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
2933 2003-07-23 Gary V. Vaughan <gary@gnu.org>
2935 * m4/m4module.h: Reformatting and rearranging lines a bit.
2936 (m4_obstack): Save typing by typedefing `struct obstack'. Changed
2938 (m4_call_macro, m4_expand_input): Renamed...
2939 (m4_macro_call, m4_macro_expand_input): ...to these. Changed all
2941 (m4_expansion_level, m4_process_macro): Moved...
2942 * m4/macro.c (expansion_level, process_macro): ...to here, and
2945 * m4/m4module.h (program_name): Not used by modules at all, so
2947 * src/main.c (program_name): ...to here.
2948 (print_program_name): Renamed...
2949 (print_program_name_CB): ...to conform to the STYLE guide.
2951 2003-07-23 Gary V. Vaughan <gary@gnu.org>
2953 More refactoring of the m4module.h API. Replace #defines with an
2954 enum, and move non-public functions out of the public API.
2956 * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
2958 * m4/macro.c (stdarg.h): Add ANSI C variadic header.
2959 * m4/debug.c (m4_debug, trace): Moved...
2960 * m4/m4private.h (struct m4): ...to fields of this struct.
2961 (m4_get_debug_file, m4_get_trace_messages): New fast access macros
2963 * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
2964 * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
2965 * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
2966 * m4/m4module.h (m4_context_field_table): Add entries for new
2967 debug_file and trace_messages fields.
2968 (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
2969 (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
2970 (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
2971 (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
2972 (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
2973 (m4_is_debug_bit): New macro to simplfy checks against the debug
2975 (m4_trace_format, m4_trace_header, m4_trace_flush)
2976 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
2978 * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
2979 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
2980 * m4/macro.c (trace_format, trace_header, trace_flush)
2981 (trace_prepre, trace_pre, trace_post): ...to these newly static
2982 functions, since they are only ever used from this file. Changed
2985 2003-07-17 Gary V. Vaughan <gary@gnu.org>
2987 Change the macros for checking syntax so that matching against
2988 multiple possible syntax classes can be done with a single
2989 comparison some of the time. The various classes are now bits of
2990 an int that can be checked with bitwise logic operators.
2992 * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
2993 (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
2994 (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
2995 (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
2996 (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
2997 (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
2998 (M4_SYNTAX_ALNUM): Removed. Changed all callers.
2999 (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
3000 (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
3001 (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
3002 (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
3003 Replace all calls with invocations of these...
3004 (m4_is_syntax, m4_has_syntax): ...New macros.
3005 * src/freeze.c (produce_syntax_dump): Remove mask argument, which
3006 is no longer required with new macros. Changed all callers.
3008 2003-07-15 Gary V. Vaughan <gary@gnu.org>
3010 * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
3011 values are returned as part of the internal interface, so they
3013 * m4/private.h: ...to here.
3014 * m4/macro.c (expand_token): Check for out of range
3015 m4_peek_input() results before looking up in the syntax table.
3016 (collect_arguments): Ditto.
3018 * NEWS: Note `$' syntax class.
3020 2003-07-08 Paul Eggert <eggert@twinsun.com> and
3021 Gary V. Vaughan <gary@gnu.org>
3023 Conform to POSIX if the POSIXLY_CORRECT environment is set.
3024 --traditional `define' now smashes all the definitions.
3026 * NEWS: Explain this.
3027 * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
3028 (Extensions): Explain that extensions that are incompatible with
3029 POSIX are disabled if POSIXLY_CORRECT is set.
3030 (Incompatibilities): Remove.
3031 (Define, Other Incompat): Explain difference
3032 between GNU and POSIX behavior of define, pushdef, popdef.
3033 * m4/m4.c (m4_get_posixly_correct_opt): New undef.
3034 * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
3035 * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
3036 (m4_get_posixly_correct_opt): New macro.
3037 * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
3039 * modules/m4.c (builtin_functions): defn now takes any number of args.
3040 (builtin_define): Smash all the definitions if
3042 (builtin_defn)): Allow any number of arguments.
3043 (builtin_undivert): Do not allow nonnumeric arguments
3045 * src/main.c (main): Set posixly-correct behavior if either
3046 POSIXLY_CORRECT is set, or if -G is given.
3047 * tests/builtins.at: New test for smashed definitions.
3049 2003-06-27 Gary V. Vaughan <gary@gnu.org>
3051 * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
3052 * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
3053 not to slow the parser down.
3054 (M4__IS_STRING): New macro to test string syntax class membership.
3055 * m4/syntax.c: Adjust docucomment.
3056 (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
3057 (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
3058 * m4/input.c (init_builtin_token): Comment typo.
3059 (m4__next_token): Comment typo.
3060 Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
3061 by using the new M4__IS_STRING macro.
3062 * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
3063 variable references in macro expansions.
3065 * doc/m4.texinfo (Eregexp and Regexp): Typo.
3066 (Epatsubst and Patsubst): Typo.
3069 2003-06-26 Gary V. Vaughan <gary@gnu.org>
3071 Move the global variables that pertain to syntax to a new `struct
3072 m4_syntax_table', and then add one of these to `struct m4'. The
3073 ripple effect through the code to both change formerly global
3074 references, and make sure a suitable context is available in
3075 lexical scope is disproportionately large compared to the size of
3076 the change proper. This change is a large part of decoupling
3077 syntax.c from the rest of the code that uses it.
3079 * m4/m4private.h (struct m4): Add a syntax field.
3080 * m4/m4.c (m4_create): Initialise it,
3081 (m4_delete): Recycle it.
3082 (m4_get_symtab): Remove hand coded version...
3083 (m4_get_symbol_table): ...and generate this with cpp. Changed all
3085 * m4/m4module.h (m4_context_field_table): Add an extra field so we
3086 can generate m4_get_symbol_table. Add a new row for
3087 m4_get_syntax_table.
3088 (M4SYNTAX): Syntactic sugar for module writers.
3089 (m4_symtab): Renamed to m4_symbol_table. Changed all callers.
3090 (m4_syntax_table): New home for syntax related formerly global
3092 * m4/m4private.h (struct m4_syntax_table): Define it.
3093 * m4/input.c (m4_input_init): Initialisation of these formerly
3094 global variables moved...
3095 * m4/syntax.c (m4_syntax_create): ...to here.
3096 * m4/input.c (m4_input_exit): And similarly, recycling of the
3097 memory used by those values moved...
3098 * m4/syntax.c (m4_syntax_delete): ...to here.
3099 * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
3100 Moved to m4/m4private.h.
3101 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
3102 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
3103 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
3104 (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
3105 objects. Changed all callers that used to directly access the
3107 (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
3108 Removed and incorporated into m4_syntax_table structure.
3109 * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
3110 * m4/syntax.c (m4_set_syntax): Now returns an error status,
3111 instead of requiring a `struct m4' to generate its own errors.
3112 Changed all callers.
3113 * src/main.c (main): Now that the syntax table is initialised as
3114 part of m4_create, we have to manually wipe the syntax entries if
3115 we are about to read a frozen file.
3117 2003-06-26 Gary V. Vaughan <gary@gnu.org>
3119 * doc/STYLE: Added notes on callback naming schemes.
3121 * m4/module.c (m4_set_module_macro_table)
3122 (m4_set_module_builtin_table): Declarations weren't changed when
3123 definitions were renamed on 2003-06-19.
3125 * m4/hash.c (m4_hash_resize): ifdefed out. This function is
3126 neither used nor particularly appropriate since it exposes the
3127 internal workings of the hash module. I haven't yet decided
3128 whether to remove it entirely.
3130 2003-06-20 Gary V. Vaughan <gary@gnu.org>
3132 Two related changes, and a huge knockon effect throughout the
3133 source: Moved the option variables out of global space and into
3134 `struct m4'; made `m4_symtab' a real datatype, so that its api
3135 is not marred passing `struct m4' around just so it can decide
3136 whether to keep traced symbol names or not. Added setters and
3137 getters for the formerly global option variables, and obviously
3138 changed a vast number of functions to take a `struct m4' and use
3139 the getter funcs to find option values.
3141 * m4/utility.c (interactive, sync_output, debug_level)
3142 (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
3143 (max_debug_argument_length, warning_status, nesting_limit)
3144 (discard_comments): Removed.
3145 * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
3146 (debug_level, max_debug_argument_length, prefix_all_builtins)
3147 (suppress_warnings, discard_comments, interactive, sync_output):
3148 Removed from here...
3149 * m4/m4private.h (struct m4): ...and equivalent fields added to
3151 (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
3152 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
3153 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
3154 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
3155 (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
3156 macros for the new fields.
3157 * m4/m4module.h (m4_context_field_table)
3158 (m4_context_opt_bit_table): Helper macros used to generate
3159 prototypes, setters and getters for new option fields
3161 * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
3162 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
3163 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
3164 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
3165 (m4_get_interactive_opt, m4_get_sync_output_opt)
3166 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
3167 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
3168 (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
3169 (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
3170 (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
3171 setter and getter functions generated by cpp from
3172 m4_context_field_table and m4_context_opt_bit_table, exported as
3173 part of the module api. Changed all callers.
3174 * m4/symtab (struct m4_symtab): Used as the concrete type for
3176 (m4_symtab_create): Allocate and initialise a new struct.
3177 (m4_symtab_apply): New function that works like m4_hash_apply, but
3178 with different callbacks specific to symbol tables. Changed all
3180 (symbol_destroy, arg_destroy, arg_copy): Renamed
3181 symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
3182 they have unused parameters for a reason!
3183 (dump_symbol_CB): New callback to dump the contents of a single
3185 (symtob_dump): Rewritten in terms of dump_symbol_CB.
3186 * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
3187 Changed all callers.
3188 * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
3189 of the contained `m4_symtab' at the `no_gnu_extensions' field.
3190 Although I'm not convinced these semantics are correct, they are
3191 at least consistent with how things were before this delta. Also
3192 set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
3194 2003-06-19 Gary V. Vaughan <gary@gnu.org>
3196 Tie down the interface to libm4 some more. Make more structures
3197 opaque to modules by moving them to m4private.h, and writing
3198 setters and getters. To win back the speed penalty for doing this
3199 also wrote macroized versions that do know about structure layout
3200 in m4private.h and #include that file into modules when NDEBUG is
3201 defined at compile time. There are still some accessor macros in
3202 m4private.h that need to go, but that is not necessary to clean
3205 * m4/m4module.h (m4_symbol_type): Moved...
3206 * m4/m4private.h (m4__symbol_type): ...to here.
3207 * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
3208 (m4_set_symbol_traced, m4_set_symbol_name_traced)
3209 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
3210 (m4_get_symbol_func, m4_symbol_value_create)
3211 (m4_symbol_value_delete, m4_set_symbol_value_text)
3212 (m4_set_symbol_value_func): New exported api to symbols.
3213 (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
3214 and m4_is_symbol_value_func.
3215 * m4/m4module.h: Prototype these guys.
3216 * m4/module.c (m4_set_module_macro_table)
3217 (m4_set_module_builtin_table): Make these static, there is no
3218 reason to pollute the api with them.
3219 * m4/m4private.h: Reformatting.
3220 (m4_get_symtab): Only define when NDEBUG is defined.
3221 (m4_get_symbol_value, m4_get_symbol_traced)
3222 (m4_set_symbol_traced, m4_set_symbol_name_traced)
3223 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
3224 (m4_get_symbol_func, m4_symbol_value_create)
3225 (m4_symbol_value_delete, m4_set_symbol_value_text)
3226 (m4_set_symbol_value_func): Macro implementations of the new
3227 functions when NDEBUG is defined.
3228 (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
3229 (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
3230 Superceded by the above. All callers changed.
3231 (M4ARG): Removed. This is no longer different to the
3232 m4/m4module.h definition.
3233 * modules/gnu.c, modules/m4.c: Only include m4private.h when
3234 NDEBUG is defined. That way we exercise the same (albeit slower)
3235 api that external modules must use.
3237 2003-06-18 Gary V. Vaughan <gary@gnu.org>
3239 Renamed some of the types and their accessors to make more sense.
3240 Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
3241 has a stack of SYMBOL_VALUEs.
3243 * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
3244 (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
3245 m4_get_symbol_value_type, m4_get_symbol_value_text,
3246 m4_get_symbol_value_func and m4_symbol_value_copy respectively.
3247 Changed all callers.
3248 (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
3249 (m4_get_token_type): Renamed
3250 * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
3251 to the internal api.
3252 * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
3254 (m4__symtab_init, m4__symtab_exit): Removed prototypes.
3255 (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
3256 (m4__token_type): Moved here from m4module.h.
3257 (m4__next_token): Renamed from m4_next_token.
3258 * m4/symtab.c: Removed some of the parameterised macro support
3259 functions for modularisation later.
3260 (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
3261 m4_hash_dup to perform a true deep copy of the SRC.
3262 (arg_copy): Callback for m4_symbol_value_copy.
3263 * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
3264 Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
3265 m4_get_symbol_value_func. Changed all callers.
3267 2003-06-18 Gary V. Vaughan <gary@gnu.org>
3269 Tidy up style of hash.[ch] in accordance with doc/STYLE.
3271 * m4/hash.c: Internal symbol renaming and formatting.
3272 (m4_hash_dup): New function to facilitate deep copies of hash
3274 (m4_hash_apply_func): Returns a void* now, which is a richer type
3275 for returning exceptions (NULL means keep going).
3276 (m4_hash_apply): Ditto.
3277 * m4/hash.h: Declare exported symbols with an explicit extern.
3280 2003-06-17 Gary V. Vaughan <gary@gnu.org>
3282 Still refactoring furiously. This delta represents a change in
3283 semantics to symtab.c. Instead of building temporary m4_tokens
3284 in the caller, and copying fields in the methods, we now create
3285 the actual m4_token for hashing in the caller so the methods just
3286 slot them in directly. Also, this means that we don't lookup a
3287 symbol and get back an allocated but VOID token to copy fields
3288 into, we create the token we want to push and pass that to
3289 m4_symbol_define or m4_symbol_pushdef. And that's it. There are
3290 a few other small changes to stop knowledge of the implementation
3291 of symtab.c leaking out into other files.
3293 * m4/macro.c (expand_argument): Comment typo corrected.
3294 * m4/symtab.c (symtab_fetch): New function to fetch the address of
3296 (m4_symbol_pushdef): Take an extra value parameter and use this
3297 directly as the new top of the value stack. All callers changed
3298 to build a token and pass responsibility for memory in, rather
3299 than copying as we used to.
3300 (m4_symbol_define): Also use the new value parameter directly as a
3301 replacement for the top of the value stack. All callers changed
3302 to build a token as above.
3303 (m4_set_symbol_traced): New function to set the traced bit on the
3304 named symbol, creating it if necessary.
3305 (symbol_popval): The guts of the old m4_symbol_popdef.
3306 (m4_symbol_popdef): Use it.
3307 * m4/builtin.c (m4_symbol_set_token): Removed,
3308 (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
3310 * m4/module.c (m4_set_module_builtin_table)
3311 (m4_set_module_macro_table): ...with these more orthogonal
3313 * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
3314 (m4_builtin_pushdef, m4_builtin_define): Removed. No longer
3316 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
3317 (m4_arg_signature_parse): Moved...
3318 * m4/symtab.c: ...to here.
3319 * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
3320 screw something up. Moved...
3321 * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
3322 actually does a proper deep copy of source to dest.
3324 2003-06-16 Gary V. Vaughan <gary@gnu.org>
3326 Further refactoring to stabilise the module API. Renaming some
3327 functions for orthogonality, and judicious definition migration to
3328 move things out of the set of exported symbols.
3330 * doc/STYLE: New file. Notes on coding style.
3331 * m4/m4module.c: Updated bitrotted docucomment at the top of the
3333 (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
3334 m4_get_module_name, m4_get_module_builtin_table,
3335 m4_get_module_macro_table which are verb phrases. Changed all
3337 * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
3339 * m4/module.c (m4_set_module_builtin_table)
3340 (m4_set_module_macro_table): ...here, and renamed. Changed all
3342 * m4/m4module.c (m4_module_data): This...
3343 * m4/m4private.c (struct m4_module_data): ...and this...
3344 * m4/module.c (module_data) ...consolidated here and no longer
3345 exported. Changed all callers.
3347 2003-06-16 Gary V. Vaughan <gary@gnu.org>
3349 Begin work on lifting the curse of the global variables. To start
3350 with create a `struct m4' context container, and replace
3351 `m4__symtab' with `context->symtab' throughout. This means
3352 initialising a context container in main, and adjusting many
3353 functions between main and the module entry points so that the
3354 container gets passed through. It would have been nice to
3355 defer this until after 1.5, but it has a major effect on the
3356 user's module writing ABI, so it needs to be addressed now - at
3357 least in the areas that impact the ABI. An interrelated change
3358 in the symtab API removes the dependency on a global symbol table,
3359 and instead focuses on a passed table (from the context
3362 * TODO: Reminders for finishing context functionality.
3363 * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
3364 * m4/m4.c: New file. Manage new struct m4 objects to eliminate
3365 global variables and eventually allow m4 to be reentrant.
3366 * m4/m4private.h (m4): Define the new structure here...
3367 (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
3368 don't carry the overhead of a function call.
3369 * m4/m4module.h: Prototype extern functions from m4/m4.c.
3370 (m4): Declare type for new struct m4 objects.
3371 (M4SYMTAB): User macro to ease finding the symbol table for the
3372 current context for module developers.
3373 (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
3375 (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
3376 (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
3377 (m4_call_macro, m4_dump_symbols, m4_expand_input)
3378 (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
3379 (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
3380 (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
3381 m4* context parameter. Changed definitions and all callers.
3382 (m4_symtab): Alias for m4_hash to decouple the
3383 m4_symtab api from m4_hash.
3384 (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
3386 (m4_symtab_create): New function to return an initialised
3388 (m4_symtab_delete): New function to delete an m4_symtab's memory.
3389 (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
3390 (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
3391 instead of simply using the global m4__symtab. Changed
3392 definitions and all callers.
3393 * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
3394 * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
3395 * src/main.c (main): Create a context and use that instead of the
3396 former global m4__symtab.
3398 2003-06-13 Gary V. Vaughan <gary@gnu.org>
3400 * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
3401 to the callback. Callbacks should not need to hardcode the
3402 hashtable they are working from, nor should we have to waste the
3403 userdata parameter to pass the table in.
3404 * m4/hash.h (m4_hash_apply_func): Require the initial table
3406 * m4/symtab.c (symtab_destroy): Use the passed table instead
3407 of hardcoding m4__symtab.
3408 (m4_symbol_popdef): Don't use the userdata parameter to pass the
3409 table to arg_destroy.
3410 (arg_destroy): Use the hash parameter, ignore userdata.
3411 * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
3413 (traceon, traceoff): Call set_trace with the extra initial
3416 2003-06-13 Gary V. Vaughan <gary@gnu.org>
3418 More refactoring to stabilise the module api, this time for
3419 symtab.c. Additionally, start to pay attention to function names
3420 that don't contain a verb like they should.
3422 * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
3423 wrapper for m4_hash_apply to decouple the symtab module from the
3425 (m4_symbol_builtin, m4_symbol_macro): Renamed to
3426 m4__symbol_set_builtin and m4__symbol_set_macro. Changed all
3428 (m4_symbol_delete): Create a macro version to save a function
3430 (m4_token_t, m4_data_t): These violate the POSIX reserved
3431 namespace. Renamed to m4_token_type and m4_symbol_type. Changed
3433 (m4_token_type): Renamed to m4_token_get_type.
3434 (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
3435 (m4_symtab_exit): Removed from the exported module
3437 * m4/m4private.h (m4__symtab, m4__symtab_init)
3438 (m4__symtab_remove_module_references, m4__symtab_exit): ...and
3439 renamed and added to the internal api. Changed all callers.
3440 (m4_symtab_apply): A faster macro version of the function for
3441 users of the internal api.
3442 * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
3443 symbol_destroy and arg_destroy.
3444 (symtab_debug): Added a prototype.
3445 (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
3446 so that callers in this file get the faster macro versions from
3449 2003-06-12 Gary V. Vaughan <gary@gnu.org>
3451 Refactoring modules to rationalise the API into an external
3452 documented (eventually!) API for use by modules in the `m4_'
3453 namespace declared in m4/m4module.h, an internal API between the
3454 source files we ship (including our shipped modules) in the `m4__'
3455 namespace declared in m4/m4private.h and making the rest as
3456 cohesive as possible with liberal use of the `static' keyword.
3457 This change represents an audit to m4/module.c along these
3460 * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
3461 Removed. No longer used.
3462 (m4_module_close): Removed prototypes.
3463 (m4_module_init, m4_module_open, m4_module_unload_all): Removed
3464 from the exported module api...
3465 * m4/m4private.h (m4__module_init, m4__module_open)
3466 (m4__module_exit): ...and renamed and added to the internal api.
3467 Changed all callers.
3468 (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
3469 Centralised definitions after renaming...
3470 * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
3471 (M4_FINISH_SYMBOL): ...and removing from here.
3472 (m4_module_dlerror, m4_module_remove, m4_module_close)
3473 (m4_caller_id): Not exported at all, so renamed to module_dlerror,
3474 module_remove, module_close and caller_id.
3475 (MODULE_SELF_NAME): New macro to make reporting self errors
3477 (m4_module_load, module_close, module_remove): Use it.
3478 * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
3480 * src/main.c (main): Use it.
3482 2003-06-12 Gary V. Vaughan <gary@gnu.org>
3484 * README: Remove references to --enable-changeword, which has been
3485 removed from the code.
3487 2003-06-11 Gary V. Vaughan <gary@gnu.org>
3489 Getting rid of the annoying bug with configure --enable-debug,
3490 which spewed -e: command not found errors. This was an interaction
3491 between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
3492 You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
3493 branch-1-5) to get the full fix.
3495 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
3496 of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
3497 and then use the probed value of $SED.
3498 (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
3499 this, it messes up the AC_REQUIRE stack.
3501 2003-06-10 Gary V. Vaughan <gary@gnu.org>
3503 * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
3504 the destroy callback.
3505 (m4_arg_destroy): Use the hash address to free the hash node key
3508 2003-06-06 Gary V. Vaughan <gary@gnu.org>
3510 First cut at formal parameters in macros.
3512 * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
3513 * m4/xstrzdup.c: New file.
3514 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
3515 associative array of parameter names to details.
3516 (m4_symbol_token): Capture macro names with parameter lists.
3517 (m4_arg_signature_parse): And build an associative array to hang
3518 from the symbol structure to map names to details.
3519 * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
3520 m4_hash_resize idiom. Now that we potentially add a little hash
3521 table to many of the entries in the symbol table, added an extra
3522 arg to set the initial size. Changed all callers.
3523 (m4_hash_apply): New function that is basically a generalised
3525 * m4/symtab.c (m4_symbol_apply): ...this. Now deleted. Adjusted
3526 all callers to call m4_hash_apply instead.
3527 (m4_arg_destroy): Recycle memory used by an m4_token_arg.
3528 (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
3529 m4_arg_signature association that might be attached to the symbol,
3530 * m4/hash.h (m4_hash_apply_func): Replacement type for...
3531 * m4/m4module.h (m4_symtab_apply_func): ...this. Now deleted.
3532 (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
3534 (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
3535 (M4_IS_IDENT): Detect characters that can be safely used in
3537 * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
3538 * m4/macro.c: Corrected grammar in some comments. Use `token'
3539 rather than `td' for m4_token variables.
3540 (m4_process_macro): If we find a dollar followed by some
3541 M4_IS_IDENT characters, replace that with the contents of the argv
3542 entry with offset stored in the m4_token_arg associated with the
3543 collected identifier.
3545 2003-06-05 Gary V. Vaughan <gary@gnu.org>
3547 Begin preparations for supporting formal parameters in m4 macros.
3549 * m4/m4private.h (struct m4_token_arg): Placeholder for holding
3550 the details of a formal parameter.
3551 (m4_token): Add an arg_signature member to hold a hash table for
3552 looking up formal parameters.
3553 * m4/input.c: Update more bitrotted comments.
3554 (m4_push_builtin): Initialise arg_signature member.
3555 (init_builtin_token): Copy arg_signature member.
3556 * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
3557 (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
3559 * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
3560 (m4_macro_pushdef, m4_macro_define): ...these, And...
3561 (m4_symbol_token): ...wrapped around this new function, which
3562 vastly simplifies the arguments required by the functions it
3564 Changed all callers.
3566 2003-06-05 Gary V. Vaughan <gary@gnu.org>
3568 * m4/macro.c: Format changes.
3570 2003-06-04 Gary V. Vaughan <gary@gnu.org>
3572 * m4/input.c: Updated various bitrotted comments.
3573 (m4_push_builtin): Just pass the whole m4_token, rather than
3574 extracting all the fields in the caller. This also allows us to
3575 check the token type for consistency.
3576 (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
3577 Renamed to builtin_funcs, builtin_peek, builtin_read,
3578 m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
3579 the code. Changed all callers.
3580 (struct input_block): Similarly renamed u_m member to u_b, and
3581 changed all callers.
3582 (m4_next_token): Use bzero to initialise the data fields.
3583 * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
3585 2003-05-29 Gary V. Vaughan <gary@gnu.org>
3587 These changes were necessary to get m4 to build on my iBook
3588 running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
3589 (GCC) 3.1 20020420 (prerelease)":
3591 * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
3592 inclusion of module loader headers.
3593 * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
3594 * m4/Makefile.am: Ditto.
3595 (libm4_la_LIBADD): Added $(LTLIBINTL).
3596 * m4/utility.c (program_name): Removed declaration in favour of
3597 the one already in error.c!
3598 * m4/m4module.h (program_name): Define to program_invocation_name
3599 when using GNU C library. Use an explicit extern declaration.
3600 (interactive, sync_output, debug_level, hash_table_size)
3601 (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
3602 (suppress_warnings, warning_status, nesting_limit, discard_comments)
3603 (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
3604 (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
3605 (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
3606 (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
3607 (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
3608 (m4_expansion_level, m4_expand_ranges, m4_expand_input)
3609 (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
3610 (m4_current_line, m4_current_diversion, m4_output_current_line):
3611 Don't rely on default, use an explicit extern.
3612 * m4/error.h (error, error_at_line, error_print_progname)
3613 (error_message_count, error_one_per_line): Ditto.
3614 * m4/ltdl.c: Update from CVS libtool.
3616 * commit: Update from CVS cvs-utils.
3618 2002-11-04 gettextize <bug-gnu-gettext@gnu.org>
3620 * po/Makefile.in.in: Upgrade to gettext-0.11.5.
3621 * po/boldquot.sed: New file, from gettext-0.11.5.
3622 * po/en@boldquot.header: New file, from gettext-0.11.5.
3623 * po/en@quot.header: New file, from gettext-0.11.5.
3624 * po/insert-header.sin: New file, from gettext-0.11.5.
3625 * po/quot.sed: New file, from gettext-0.11.5.
3626 * po/remove-potcdate.sin: New file, from gettext-0.11.5.
3627 * po/Rules-quot: New file, from gettext-0.11.5.
3629 2002-11-04 Akim Demaille <akim@epita.fr>
3631 * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
3633 * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
3635 2002-11-04 Akim Demaille <akim@epita.fr>
3637 * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
3639 2002-11-04 Akim Demaille <akim@epita.fr>
3641 * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
3642 used as `external', and Libtool 1.4.3.
3644 (LTLIBOBJS): Don't play with it.
3646 * Makefile.am (SUBDIRS): Remove intl.
3647 (ACLOCAL_AMFLAGS): Add -I config.
3648 (EXTRA_DIST): Add config/config.rpath.
3651 * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
3653 2002-05-29 Gary V. Vaughan <gary@gnu.org>
3655 Preparations for refactoring syntax tables to allow reverse
3656 lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
3657 speed of normal lookups in an array of unsigned short.
3659 * m4/input.c (single_quotes, single_comments, use_macro_escape):
3661 * m4/m4private.h (m4__single_quotes, m4__single_comments,
3662 m4__use_macro_escape): ...to here, and renamed. The `m4__' prefix
3663 is for internal symbols which unavoidably pollute the global
3664 namespace, but are not published APIs.
3665 Adjusted all callers.
3666 * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
3667 m4_set_comment, m4_set_syntax, set_syntax_internal,
3668 unset_syntax_attribute): Moved from this file...
3669 * m4/syntax.c: New. ...to this file.
3670 Also added an m4_syntax_exit stub for orthogonality.
3671 * src/main.c (main): Use it.
3672 * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
3673 * m4/m4module.h: Reformatting. New prototypes.
3675 2002-05-29 Gary V. Vaughan <gary@gnu.org>
3677 * bootstrap (aclocal_apiversion): The aclocal apiversion is
3678 distinct from the automake release number (in that the apiversion
3679 apparently has no micro-version-component).
3680 (aclocal_apilibdir): Use it.
3682 2002-05-28 Gary V. Vaughan <gary@gnu.org>
3684 * m4/hash.c (m4_hash_resize): New function.
3685 * m4/hash.h: Add prototype.
3686 * m4/symtab.c (m4_symtab_init): Use it. This could do with some
3687 benchmarking to find a good value for, say, autoconf. This is
3688 already a little quicker than before for me.
3690 * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
3691 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
3693 * m4/hash.h: Adjust prototypes.
3695 2002-01-22 Akim Demaille <akim@epita.fr>
3697 * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
3699 * tests/Makefile.am (package.m4): New.
3700 * tests/atlocal.in: Adjust to CVS Autotest.
3701 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
3702 * configure.ac: LIBOBJ is a forbidden string.
3703 Simplify AM_INIT_AUTOMAKE invocation.
3704 * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
3707 2002-01-21 gettextize <bug-gnu-utils@gnu.org>
3709 * po/Makefile.in.in: Upgrade to gettext-0.10.40.
3711 2001-10-19 Akim Demaille <akim@epita.fr>
3713 * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
3715 2001-10-19 Akim Demaille <akim@epita.fr>
3717 * m4/input.c (m4_next_token): Display where was opened what is
3720 2001-10-19 Akim Demaille <akim@epita.fr>
3722 * m4/macro.c (expand_argument): Display where was opened what is
3725 2001-10-18 Akim Demaille <akim@epita.fr>
3727 * m4/input.c, modules/m4.c: Formatting changes.
3729 2001-10-17 Gary V. Vaughan <gary@gnu.org>
3731 * bootstrap: s/configure.in/configure.ac/
3733 2001-10-16 Gary V. Vaughan <gary@gnu.org>
3735 * m4/symtab.c (m4_symbol_destroy): This function calls
3736 m4_symbol_popdef, which recycles a symbols memory when the last
3737 definition is popped. Since we were passing the address of the
3738 symbol name found in the symbol table, and it was being removed
3739 partway through m4_symbol_destroy() we were referencing freed
3740 memory for the balance of the function. Now we take a copy of the
3741 symbol name tring and use that as a key into the symbol
3742 table... that way if the original symbol name is freed, the copy
3745 2001-10-13 Akim Demaille <akim@epita.fr>
3747 * m4/ltdl.c: Update.
3749 2001-10-13 Akim Demaille <akim@epita.fr>
3751 * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
3752 Don't gettextize internal error messages.
3754 2001-10-13 Akim Demaille <akim@epita.fr>
3756 * tests/macros.at (Arity and defn): New failing test.
3757 (Arity, defn, and freeze): New.
3759 Fix `Arity and defn'.
3761 * m4/input.c (m4_push_macro): Don't forget the arity.
3762 * modules/m4.c (defn): Likewise.
3764 2001-10-13 Akim Demaille <akim@epita.fr>
3766 * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
3768 * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
3769 (Propagation of traceon, Propagation of --trace): this new file.
3771 2001-10-13 Akim Demaille <akim@epita.fr>
3773 * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
3774 interface instead of (name, argc...).
3775 Upon failure, specify which argument was guilty.
3778 2001-10-13 Akim Demaille <akim@epita.fr>
3780 * modules/evalparse.c: Save translators' time: don't translate
3781 internal error messages.
3782 (m4_evaluate): Simplify/normalize error messages.
3783 * doc/m4.texinfo (Eval): Adjust.
3785 2001-10-13 Akim Demaille <akim@epita.fr>
3787 * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
3788 where no checking is needed.
3789 * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
3790 interface instead of (name, argc...).
3792 * modules/gnu.c (m4_patsubst_do): Don't check argc, done
3795 2001-10-13 Akim Demaille <akim@epita.fr>
3797 * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
3798 exclude the builtin name from the count.
3799 * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
3800 calling ifelse with a single argument is valid.
3801 * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
3802 with 1 and 2 args, mostly to strengthen the test suite.
3804 2001-10-13 Akim Demaille <akim@epita.fr>
3806 * m4/output.c (m4_make_diversion, m4_insert_file)
3807 (m4_insert_diversion, +m4_freeze_diversions): Ansify.
3809 2001-10-12 Gary V. Vaughan <gary@gnu.org>
3811 * m4/input.c (init_builtin_token): Renamed from init_macro_token,
3812 since we call these things builtins in the rest of the code!
3814 * modules/gnu.c (m4_regexp_compile): s/%0/%s/
3816 2001-10-12 Gary V. Vaughan <gary@gnu.org>
3818 Rather than forcing each builtin definition to manage its own
3819 argument range checking, tabulate the maxima and minima for all
3820 builtins in each module. This forces us to consider what the
3821 valid ranges for each builtin should be, and moves the checking
3822 code out of each builtin implementation and into the builtin
3823 caller infrastructure.
3825 * m4/m4module.h (struct m4_builtin): Add argument minima and
3827 * m4/m4private.h (struct m4_token): Reflect them here too.
3828 * m4/input.c (struct input_block): ...and here.
3829 (m4_token_copy): New function for token copying.
3830 (init_macro_token): Copy them from a token to the input stack.
3831 (m4_next_token): Don't forget to initialise them for text
3833 * m4/macro.c (expand_argument): Use m4_token_copy, and also
3834 check argument counts before calling the builtin handler.
3835 * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
3836 (m4_symbol_macro): Likewise.
3837 * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
3838 parameters. Updated all callers.
3839 (m4_builtin_define): Ditto.
3840 (m4_macro_pushdef, m4_macro_define): Ditto.
3841 * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
3842 * modules/evalparse.c: Declare argument counts for defined
3843 builtins and remove explicit calls to m4_bad_argc().
3844 * modules/gnu.c: Ditto.
3845 * modules/load.c: Ditto.
3846 * modules/m4.c: Ditto.
3847 * modules/modtest.c: Ditto.
3848 * modules/mpeval.c: Ditto.
3849 * modules/perl.c: Ditto.
3850 * modules/shadow.c: Ditto.
3851 * modules/stdlib.c: Ditto.
3852 * modules/time.c: Ditto.
3855 2001-10-10 Gary V. Vaughan <gary@gnu.org>
3857 The trace semantics now attach the trace bit to a symbol name.
3858 For as long as a traceon(`foo') is active, calls to foo will be
3859 traced regardless of intervening undefines or module unloads.
3860 Fixed the flag propogation issues differently to the fixes
3861 reverted with the last attempt at nailing down trace:
3863 * m4/m4private.h: This file is not visible outside of the m4
3864 source tree, so I removed all the `M4_' and `m4_' prefixes to save
3865 on typing. Updated all clients.
3866 (m4_token): New typedef contains the fields that need to be passed
3867 around with the low level tokeniser.
3868 (m4_token_data): Removed.
3869 (m4_symbol): Now contains the traced flag again.
3870 * m4/symtab.c: Rewritten again. Now we don't remove symbols with
3871 the trace bit set. This change is contained entirely within this
3872 module and doesn't leak out into the callers. Updated all
3874 (m4_symbol_builtin, m4_symbol_macro): Adjusted to make use of the
3875 new fields in m4_token. Updated all clients.
3876 * m4/builtin.c (m4_builtin_pushdef): Needs a flags argument so
3877 that `groks_macro_args' and `blind_if_no_args' flags are retained
3878 when defn() results are passed around in m4 code. Updated all
3880 (m4_builtin_define): Ditto.
3881 (m4_macro_pushdef, m4_macro_define): Ditto.
3882 * m4/input.c (struct input_block): Add a flags field to facilitate
3884 (m4_push_macro): ...use it.
3885 (init_macro_token): Retrieve it.
3886 (m4_next_token): Initialise it.
3887 * m4/macro.c (expand_argument): Copy it.
3888 * m4/m4module.h: Adjust.
3889 * tests/builtins.at: Adjust the expected output of the trace
3890 tests to reflect the change in semantics.
3891 * tests/modules.at (modules: trace): Check that unloading a
3892 module which supplies a traced symbol definition doesn't lose te
3895 2001-10-07 Gary V. Vaughan <gary@gnu.org>
3897 * modules/gnu.c (m4_macro_table): Display the timetamp when
3898 expanding __m4_version__.
3900 * configure.ac (--with-modules): Forgot a comma in the
3901 AC_HELP_STRING parameter list.
3903 2001-10-05 Gary V. Vaughan <gary@gnu.org>
3905 * bootstrap: Remove aclocal.m4t when it is no longer required.
3907 2001-10-05 Akim Demaille <akim@epita.fr>
3909 * tests/Makefile.am: Adjust for gnuprog2.
3910 * tests/m4.in: There can be a leading path.
3911 * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
3912 * tests/testsuite.at: Adjust to the most recent Autotest.
3913 (AT_CHECK_M4_FILTER): Fix and rename as...
3915 * tests/others.at: Use it.
3917 * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
3918 variable in shell scripts, one uses `$'...
3920 2001-10-04 Gary V. Vaughan <gary@gnu.org>
3922 * configure.ac: `rm -f $m4_getopt_h' was lost.
3924 2001-10-04 Gary V. Vaughan <gary@gnu.org>
3926 * configure.ac (TIMESTAMP): Display with AS_BOX at configure
3927 time. Define it for config.h in order to...
3928 * src/main.c (main): ...display the timestamp for --version.
3930 2001-10-04 Akim Demaille <akim@epita.fr>
3932 * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
3933 previous builtins `regexp' and `patsubst'.
3934 (regexp, patsubst): Use them.
3935 (eregexp, epatsubst): New builtins.
3936 * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
3937 (Epatsubst and Patsubst, Eregexp and Regexp): these.
3938 (Extensions): More info on REs.
3940 2001-10-04 Akim Demaille <akim@epita.fr>
3942 * modules/modtest.c (init_handler): Consistently output to stderr.
3943 (finish_handler): New.
3944 (test): The `if' is an `assert'.
3945 * tests/modules.at: Adjust.
3947 2001-10-04 Akim Demaille <akim@epita.fr>
3949 * m4/utility.c (m4_bad_argc): Detail the mismatches.
3951 2001-10-01 Akim Demaille <akim@epita.fr>
3953 * tests/generate.awk: Tag the tests with `documentation'.
3954 * tests/modules.at (AT_CHECK_M4_MODTEST): New.
3955 Use the make the existing modtest tests more uniform, and complete
3956 the set of possibilities.
3958 2001-10-01 Akim Demaille <akim@epita.fr>
3960 * config/gmp.m4: Consult the user before using GMP: use
3962 * configure.ac: Adjust.
3963 * modules/gmp.c: No protection needed as the module is not built
3966 2001-10-01 Akim Demaille <akim@epita.fr>
3968 * tests/generate.awk: Remove debugging code.
3969 (fatal): Specify the current location.
3971 * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
3972 * modules/gnu.c, modules/m4.c: Use M4ARG.
3974 2001-10-01 Akim Demaille <akim@epita.fr>
3976 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
3977 (m4_regexp_compile): New.
3978 (regexp, patsubst): Use it.
3980 2001-09-30 Gary V. Vaughan <gary@gnu.org>
3982 Reinstate the memory handling improvements from the patch I just
3983 reverted. Relevant ChangeLog entries repeated here:
3985 * m4/module.c (m4_module_remove): New function that holds the core
3986 of the old m4_module_unload.
3987 (m4_module_unload): Use it.
3988 (m4_module_unload_all): When we know the modules will never be
3989 used again (i.e. on exit), free up as much module memory as
3990 possible. There are still some artifacts from resident modules
3991 living inside ltdl.c, but everything else is freed.
3992 * m4/debug.c (m4_debug_exit): Free memory allocated in
3994 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
3995 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
3996 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
3997 * m4/m4module.h: Updated prototypes.
3998 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
3999 * m4/hash.h: Updated prototypes.
4000 * src/main.c (main): Use all these new functions to clean up as
4001 much memory as possible before exit.
4003 2001-09-30 Gary V. Vaughan <gary@gnu.org>
4005 Reverted my large patch for removing the old m4_symbol
4006 structure on 2001-09-20. We are still not happy about the way
4007 trace works in conjunction with defn and undefine, and leaving
4008 the reverted patch active prevents us from moving the traced
4009 bit from the definition back to the symbol.
4011 2001-09-30 Gary V. Vaughan <gary@gnu.org>
4013 * configure.in: Moved to...
4014 * configure.ac: ...here. Added a libtool like timestamped
4015 banner, and tidied up the libltdl cruft.
4016 * config/mkstamp: Script to extract a timestamp from ChangeLog.
4017 * modules/Makefile.am (INCLTDL): Removed. This is required
4018 only when libltdl is configured in a subdirectory.
4019 * src/Makefile.am: Ditto.
4020 (LIBADD_DL): No need to add this again, libtool already knows
4021 that libm4.la depends on it.
4022 * m4/Makefile.am: Automake sets variables from AC_SUBST. Use
4025 * TODO: stackovf.c is basically broken.
4026 Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
4028 2001-09-28 Akim Demaille <akim@epita.fr>
4030 * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
4032 2001-09-27 Akim Demaille <akim@epita.fr>
4034 * tests/m4.in: Don't use short options.
4035 Simplify the stderr signature normalization.
4037 2001-09-27 Akim Demaille <akim@epita.fr>
4039 tests/m4 shall be position independent.
4043 * tests/testsuite.at: No args to AT_INIT.
4044 * configure.in, tests/Makefile.am: Adjust.
4046 2001-09-22 Akim Demaille <akim@epita.fr>
4048 Autotest has changed again.
4050 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
4051 (package.m4): Remove.
4052 * configure.in: Adjust to LIBADD_GMP.
4054 2001-09-21 Gary V. Vaughan <gary@gnu.org>
4056 * config/gmp.m4 (AC_ARG_WITH): Removed.
4057 (GMP_LIB): Renamed to LIBADD_GMP for consistency.
4058 (AC_LIB_GMP): When performing a test compile against libgmp,
4059 include the header gmp.h if possible, and link against -lgmp. If
4060 they both work define USE_GMP.
4061 * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
4062 (mpeval_LTX_init_func): Complain on load that there was no libgmp
4065 2001-09-20 Gary V. Vaughan <gary@gnu.org>
4067 * m4/evalparse.c: Moved to...
4068 * modules/evalparse.c: ...here. This code is shared between
4069 modules/mpeval.c and modules/m4.c, so there is no need to pollute
4070 the libm4 API with its details. Moderately rewritten to interface
4071 into its clients more simply.
4072 * m4/eval.c: Deleted. Migrated functionality to...
4073 * modules/m4.c: ...here.
4074 (builtin_eval): Implemented in terms of the new interface style.
4075 * modules/mpeval.c (builtin_mpeval): Ditto.
4076 * m4/m4module.h: Removed references to the former m4/eval.c.
4077 * m4/Makefile.am (libm4_la_SOURCES): Removed eval.c.
4078 (EXTRA_libm4_la_SOURCES): Deleted.
4079 * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
4080 (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
4082 2001-09-20 Akim Demaille <akim@epita.fr>
4084 * config/gmp.m4 (AM_WITH_GMP): Rename as...
4086 By default, use gmp.
4088 * configure.in: Adjust.
4089 Use Automake conditionals for USE_GMP.
4090 Always compute sizeof (long long int).
4091 This was a bug BTW, as `eval' (not `mpeval') depends on it:
4092 before, it was used _only_ if mpeval was not activated.
4093 * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
4094 (mpeval_la_LIBADD): New macros.
4095 * modules/mpeval.c: No longer be conditioned by WITH_GMP.
4097 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
4098 * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
4101 2001-09-20 Akim Demaille <akim@epita.fr>
4103 * tests/Makefile.am (package.m4): New.
4104 * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
4106 2001-09-20 Gary V. Vaughan <gary@gnu.org>
4108 More cleanup. After the last patch, m4_symbol holds nothing but
4109 the head of a chain of m4_token_data. So I have removed the old
4110 m4_symbol, so that m4_token_data chains are stored directly in the
4111 value cell of a hash table node. But there's more... m4_symbol
4112 was a more natural name for the symbol value cell, and now that it
4113 is gone I have renamed the former m4_token_data structure to
4114 m4_symbol. This change turned out to be a pig to get right, since
4115 the original code didn't need to modify the value cell itself,
4116 since changing the chain happened inside the m4_symbol that used
4117 to be returned -- I had to pass the address of the value cell
4118 across various function calls, incase the head value changed. I
4119 also tightened up the memory management to help me find a nasty
4120 memory corruption bug that took me all night to track down...
4122 * m4/m4private.h (struct m4_symbol): Removed.
4123 (struct m4_token_data): Renamed to `struct m4_symbol'. Updated
4125 * m4/hash.c (m4_hash_iterator_value): Return the address of the
4126 value cell. Updated all callers.
4127 * m4/symtab.c: Took advantage of the simplification in the data
4128 structures to rewrite a lot of this file more simply. There is
4129 still some room for optimisation here, but we should tackle that
4130 systematically closer to the release.
4132 * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
4133 revealed. This version is ahead of CVS libtool until I get chance
4134 to flush my changes.
4135 * m4/module.c (m4_module_remove): New function that holds the core
4136 of the old m4_module_unload.
4137 (m4_module_unload): Use it.
4138 (m4_module_unload_all): When we know the modules will never be
4139 used again (i.e. on exit), free up as much module memory as
4140 possible. There are still some artifacts from resident modules
4141 living inside ltdl.c, but everything else is freed.
4142 * m4/debug.c (m4_debug_exit): Free memory allocated in
4144 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
4145 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
4146 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
4147 * m4/m4module.h: Updated prototypes.
4148 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
4149 * m4/hash.h: Updated prototypes.
4150 * src/main.c (main): Use all these new functions to clean up as
4151 much memory as possible before exit.
4153 2001-09-18 Gary V. Vaughan <gary@gnu.org>
4155 The `traced' flag needs to be attached to the definition of a
4156 symbol rather than the current symbol containing the definition.
4157 Implementing this showed up some long standing post 1.4 bugs in
4158 flag propogation which I also fixed.
4160 * m4/m4private.h (struct m4_symbol): Remove the traced flag.
4161 (struct m4_token_data): And add it back in here.
4162 * m4/input.c (init_macro_token): Propogate the traced flag
4164 * m4/macro.c (expand_argument): Ditto.
4165 * tests/builtins.at (trace2, trace3): New tests based on Akim's
4168 2001-09-08 Gary V. Vaughan <gary@gnu.org>
4170 * m4/m4private.h (struct m4_token_data): Simplified by removing
4171 the redundant `traced' flag, and one level of structure nesting.
4172 (M4_TOKEN_DATA_FUNC_TRACED): Removed.
4173 * m4/input.c (init_macro_token): No need to initialise removed
4175 * m4/macro.c (expand_argument): No need to copy it either.
4176 * m4/utility.c (m4_token_data_func_traced): Or provide an access
4179 * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
4180 dependant on multiple symbols with the same key, so preserving
4181 relative symbol order in each bucket during resizing is no longer
4182 required. The resize function is considerably faster as a result.
4184 * m4/m4module.h, m4/builtin.c, m4/symtab.c:
4185 s/m4_symbol_insert/m4_symbol_define/g;
4186 s/m4_builtin_insert/m4_builtin_define/g;
4187 s/m4_macro_insert/m4_macro_define/g. Updated all callers.
4189 2001-09-08 Gary V. Vaughan <gary@gnu.org>
4191 Get rid of m4_symbol_lookup_t entirely. With Akim's earlier
4192 commits, the m4_lookup_symbol dispatch function is split into
4193 specialised functions that must be called directly.
4195 * m4/m4module.h (m4_symbol_lookup_t): Removed.
4196 * m4/symtab.c (m4_lookup_symbol): Removed.
4197 (m4_symbol_builtin, m4_symbol_macro): New functions.
4198 * m4/builtin.c (m4_builtin_define): Split into...
4199 (m4_builtin_pushdef, m4_builtin_insert): ...these.
4200 (m4_macro_define): Split into...
4201 (m4_macro_pushdef, m4_macro_insert): ...these.
4202 * src/main.c (main): Set command line macros from `-D' parameters
4203 using `m4_macro_define'.
4205 2001-09-08 Gary V. Vaughan <gary@gnu.org>
4207 * m4/symtab.c (m4_symtab_remove_module_references): Renamed as
4208 this from m4_remove_table_reference_symbols().
4209 * m4/m4module.h, m4/module.c: Updated all references.
4211 2001-09-07 Akim Demaille <akim@epita.fr>
4213 * modules/stdlib.c, modules/times.c: Misc cleanups.
4215 2001-09-07 Akim Demaille <akim@epita.fr>
4217 * configure.in: We now need Autoconf 2.52e.
4218 * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
4219 and `M4_SYMBOL_DELETE'.
4220 * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
4221 * src/main.c (main): Adjust.
4223 2001-09-06 Gary V. Vaughan <gary@gnu.org>
4225 Fix the obstack.h problem once and for all! At configure time we
4226 can test for a system supplied obstack.h: depending on the
4227 result, we now generate system.h with an #include of the correct
4228 header. As a bonus, I've also added a --with-included-obstack,
4229 incase the user doesn't like the system obstack for some
4230 reason... and also we can test the shipped obstack on a system
4231 that has oe of its own. We also now need to be careful to add
4232 build directories to the include search path, since the generated
4233 system.h will be in the build tree.
4235 * configure.in (AC_CONFIG_FILES): Generate system.h from
4237 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
4238 include the system obstack header or the copy shipped with M4.
4239 Allow the user to override configure and force the build to use
4240 the shipped version.
4241 * m4/system-h.in: New file, template for...
4242 * m4/system.h: ...this. Now deleted.
4243 * m4/m4module.h: Include system.h before everything else.
4244 * src/freeze.c: Ditto.
4245 * m4/Makefile.am (dist-hook): Remove generated system.h.
4246 (INCLUDES): Check builddir for generated headers before checking
4248 * modules/Makefile.am (INCLUDES): Ditto.
4249 * src/Makefile.am (INCLUDES): Ditto.
4251 2001-09-05 Gary V. Vaughan <gary@gnu.org>
4253 * TODO: Remove the items that have been addressed already.
4255 2001-09-05 Akim Demaille <akim@epita.fr>
4257 * src/main.c (main): Standardize --version.
4259 2001-09-05 Akim Demaille <akim@epita.fr>
4261 * modules/format.c (format): Have a bigger `str'.
4263 2001-09-05 Akim Demaille <akim@epita.fr>
4265 Rationalize warnings, reporting the macro name as if it were a
4266 program name, and assertions.
4268 * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
4270 * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
4272 Use assert for internal errors.
4273 * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
4275 * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
4277 * tests/builtins.at (pushpop): Adjust.
4279 2001-09-05 Akim Demaille <akim@epita.fr>
4281 * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
4284 2001-09-05 Akim Demaille <akim@epita.fr>
4286 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
4287 * m4/macro.c, m4/symtab.c: Adjust.
4289 2001-09-05 Akim Demaille <akim@epita.fr>
4291 * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
4292 (m4_symbol_pop, m4_symbol_del): this.
4293 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
4294 (m4_symbol_popdef, m4_symbol_delete): New.
4295 (m4_lookup_symbol): Adjust.
4296 * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
4298 2001-09-05 Akim Demaille <akim@epita.fr>
4300 * m4/m4module.h (m4_symbol_lookup): Rename as...
4301 (m4_symbol_lookup_t): this.
4303 2001-09-05 Akim Demaille <akim@epita.fr>
4305 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
4307 * m4/symtab.c (m4_lookup_symbol): Adjust.
4309 2001-09-03 Gary V. Vaughan <gary@gnu.org>
4311 Bootstrap will now work with Libtool 1.4.1 or higher:
4312 * bootstrap: Remove stale autom4te.cache files when
4314 * config/Makefile.am (ACLOCAL_MACROS): Add ltdl.m4 and
4316 * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
4317 libtool.m4 directly.
4318 Run libtoolize to refresh ltmain.sh.
4319 * config/ltmain.sh: Deleted.
4320 * acinclude.m4: Deleted.
4321 * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
4323 * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
4324 implementation for the cvs impaired libtool user.
4326 2001-09-03 Akim Demaille <akim@epita.fr>
4328 * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
4330 Avoid using `default' in switch, as it hides useful compiler
4331 warnings when a case is forgotten.
4333 2001-09-03 Akim Demaille <akim@epita.fr>
4335 * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
4336 is no such thing as `WITH_MODULES'.
4338 2001-09-03 Akim Demaille <akim@epita.fr>
4340 Improve the test suite's selfcontainedness.
4342 * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
4343 (Include, Undivert): Tag the other input files.
4344 * tests/generate.awk: Catch `@comment file:'.
4345 `-I $src' is no longer needed.
4346 `next' is really like `return': the rest is skipped.
4347 Adjust to `input.m4'.
4348 (fatal): New function.
4349 * tests/foo, tests/incl.m4: Remove.
4351 2001-09-01 Gary V. Vaughan <gary@gnu.org>
4353 The shadowing mechanism and, infact, the whole symbol table
4354 implementation was creaking under the weight of the features piled
4355 on top of it. We now have a separate hash table module which will
4356 dynamically resize to keep symbol density withing good performace
4357 limits, and a new symtab module layered above it. Symbol lookups
4358 are now marginally more efficient (since the shadowed flag is no
4359 longer required) and symbol removal, such as on module unload, is
4360 considerably faster due to a reorganisation of the data structures
4363 * src/main.c (main): Don't mention `-H'.
4364 * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
4367 * m4/hash.c: New generalised dynamic hash table data structure
4369 * m4/hash.h: Public interface.
4370 * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
4371 (libm4_la_SOURCES): Add hash.c.
4372 * m4/symtab.c: More or less rewritten from scratch, within the
4373 bounds of the previous API.
4374 (m4_symtab_apply): A cleaner version of the old hack_all_symbols
4375 call. Updated all callers.
4376 * m4/m4module.c: #include <m4/hash.h>, and changed all affected
4377 declarations to reflect API changes.
4378 (M4INIT): Generate a declaration too, to avoid the warning with
4379 --enable-debug builds.
4382 * m4/utility.c (hash_table_size): Removed.
4383 (m4_dump_symbols): Rewritten to build and qsort an array of symbol
4384 names, which are then looked up by builtin_dumpdef() as necessary.
4385 This implies a small speedup in builtin_symbols(), which discarded
4386 all of the symbol info under the old call.
4387 * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
4388 shadowing is implicit in respect to the new data structures.
4389 symbol names are no longer duplicated here, they are stored in the
4390 key field of the hash table.
4391 Moved macro_args and blind_no_args...
4392 (m4_token_data): ...to here.
4393 m4/macro.c (expand_macro): Added a name argument since the symbol
4394 name is no longer copied into each struct m4_symbol. Modified all
4396 (collect_arguments): Ditto.
4397 * modules/m4.c (set_trace): Ditto.
4398 * modules/gnu.c (builtin_symbols): Updated.
4399 * src/freeze.c (produce_symbol_dump): Much improved in light of
4400 the improved symbol table layout.
4402 2001-09-01 Gary V. Vaughan <gary@gnu.org>
4404 * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
4406 (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
4407 (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
4408 SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
4409 SYMBOL_HANDLE): Ditto.
4410 * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
4411 modules/gnu.c, modules/m4.c, src/freeze.c,
4412 src/main.c: Updated all references.
4414 * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
4415 Automake 1.5 chokes on dynamic source file lists, Besides, it is
4416 already listed in m4_LDADD... how did that ever used to work?
4417 * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
4419 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
4420 Suggested by Tim Van Holder <tim.van.holder@pandora.be>
4422 * tests/m4: Don't call the m4 wrapper script with libtool, it
4423 works fine all by itself.
4425 2001-08-30 Gary V. Vaughan <gary@gnu.org>
4427 The experimental `changeword' feature never took off, and has
4428 no obvious advantages over `changesyntax' to compensate the
4429 enormous speed penalty it carries:
4430 * configure.in (ENABLE_CHANGEWORD): Removed.
4431 * m4/m4module.h (m4_set_word_regexp): Removed.
4432 * m4/m4private.h (m4_token_data): Removed original_text field.
4433 * m4/utility.c (m4_token_data_orig_text): Removed.
4434 * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
4435 * m4/macro.c: Ditto.
4436 * src/main.c: Ditto.
4437 * modules/Makefile.am (changeword.la): Removed.
4438 * modules/changeword.c: File removed.
4439 * doc/m4.texinfo: References to changeword and --word-regexp
4441 * po/POTFILES.in: modules/changeword.c removed.
4442 * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
4443 * tests/builtins.at (changeword): Test removed.
4445 2001-08-30 Akim Demaille <akim@epita.fr>
4447 * bootstrap.sh: Create aclocal.m4 instead of modifying it.
4448 This also help having a single list of m4 files: in
4450 * config/Makefile.am (STANDARD_MACROS): Rename as...
4451 (ACLOCAL_MACROS): this.
4452 (list-standard-macros): Remove.
4455 2001-08-29 Gary V. Vaughan <gary@gnu.org>
4457 In an attempt to moderate my egomania...
4458 * tests/modules.at: Remove attributions.
4460 * tests/generate.awk: When making substitutions to "@&t@", either
4461 "&" or "\&" in the substitution string argument to gsub refer back
4462 to the matched text. "@\\&t@" seems to work though, Tests 43 and
4465 2001-08-29 Akim Demaille <akim@epita.fr>
4467 * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
4468 (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
4469 (sync-lines, trace, translit, undivert, wrap): Move to...
4470 * tests/builtins.at: this new file.
4471 * tests/others.at (Discard comments, import-environment): Move to...
4472 * tests/options.at: this new file.
4474 2001-08-29 Akim Demaille <akim@epita.fr>
4476 * tests/others.at (Freezing modules)
4477 (--module-directory: absolute path, modpath2, modpath3)
4478 (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
4479 * tests/modules.at: here, new file.
4480 * tests/others.at, tests/generate.awk: Add a banner.
4481 * tests/testsuite.at: Adjust.
4482 (AT_CHECK_M4_FILTER): New, but unused.
4484 2001-08-29 Akim Demaille <akim@epita.fr>
4486 * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
4488 * tests/others.at (wrap): Inline wrap.m4.
4489 (shadow): Inline shadow.m4.
4490 (iso8859): Don't specify the path from top_srcdir, but from srcdir.
4491 * tests/m4: Simplify.
4493 2001-08-29 Akim Demaille <akim@epita.fr>
4495 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
4498 2001-08-29 Akim Demaille <akim@epita.fr>
4500 * tests/generate.awk (normalize): s/@__@/@&t@/.
4502 2001-08-28 Akim Demaille <akim@epita.fr>
4504 * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
4506 2001-08-28 Gary V. Vaughan <gary@gnu.org>
4508 * bootstrap (generate.awk): Generate test cases with new script.
4510 2001-08-27 Akim Demaille <akim@epita.fr>
4512 * tests/Makefile.am (installcheck-local): Don't use
4513 `dc_install_base' which is not visible here, but `exec_prefix'
4514 which is clearly the RT anyway.
4515 * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
4516 related to testing a now installed m4.
4517 * tests/m4: Do it here.
4519 2001-08-27 Akim Demaille <akim@epita.fr>
4521 * tests/others.at (indir): Formatting change.
4523 2001-08-27 Akim Demaille <akim@epita.fr>
4525 * tests/Makefile.am (installcheck-local): New.
4526 * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
4528 Prefer options over envvars.
4529 * src/main.c (main): First bug caught by the test suite (yeah!):
4530 --batch lacked a `break' which resulted in an accidental
4531 invocation of --discard-comments.
4533 2001-08-27 Akim Demaille <akim@epita.fr>
4535 * tests/others.at (capitalize, changeword, comments, ddivert)
4536 (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
4537 (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
4538 (sysv-args, trace, translit, undivert): Don't rely on files in
4539 examples/: AT_DATA them.
4541 2001-08-27 Akim Demaille <akim@epita.fr>
4543 Let the test suite use a wrapper around the not installed m4 to
4544 pretend it is (installed).
4546 * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
4547 such a way that m4 does not process them.
4548 * configure.in: The package name seems to be `m4', not `M4'.
4550 * tests/atlocal.in (at_package, M4): Remove.
4551 * tests/testsuite.at, tests/others.at: Use m4, not $M4.
4553 2001-08-27 Akim Demaille <akim@epita.fr>
4555 * tests/Makefile.am (CLEANFILES): Remove.
4556 (DISTCLEANFILES, clean-local): New.
4557 * examples/mktests.sh: Remove.
4559 2001-08-27 Akim Demaille <akim@epita.fr>
4561 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
4562 Don't use aclocal: it's written by hand.
4563 * aclocal.m4: m4_include all the files instead of being built by
4565 * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
4566 until it reads the traces by itself.
4567 * configure.in: Require Autoconf 2.42c as we are now using
4568 AC_CONFIG_TESTDIR instead of AT_CONFIG.
4569 Catch unexpanded `jm_' macros.
4570 * config/atconfig.m4: Remove.
4571 * config/error.m4: new.
4572 * config/Makefile.am: Ship the files included by aclocal.m4.
4573 * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
4574 (TESTSUITE_AT): this, to please Automake.
4575 (TESTSUITE): This target uses autotest/autotest.m4, not
4576 autotest/general.m4.
4577 * tests/testsuite.at: Prereq Autotest 2.52c.
4578 * examples/Makefile.am (pkgdata_DATA): Rename as...
4579 (dist_pkgdata_DATA): this.
4580 * doc/Makefile.am (man_MANS): Rename as...
4581 (dist_man_mans): this.
4583 2001-08-20 Gary V. Vaughan <gary@gnu.org>
4585 * m4/system.h [cygwin*]: Thanks to Paul Sokolovsky and
4586 Robert Collins, building on Cygwin no longer requires Windows
4587 import and export symbol decorations.
4588 * m4/m4module.h (M4_SCOPE) [cygwin*]: Deleted all occurences.
4589 * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
4590 * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
4591 * m4/error.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
4592 * m4/input.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
4593 * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
4594 * m4/output.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
4595 * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
4596 * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
4597 * configure.in (LIBM4_DLL_IMPORT) [cygwin*]: Don't set this
4599 * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
4600 * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
4602 2001-08-20 Gary V. Vaughan <gary@gnu.org>
4604 Ansify the source. Previously we had a mix, where my code was
4605 in a K&R compatible style, and the preexisting code was in ANSI
4606 style. Nothing is lost wrt release 1.4 by reverting to ANSI,
4607 and now the code base is much cleaner.
4609 * m4/system.h: Remove M4_PARAMS macro and all users. Remove
4610 VOID macro and all users.
4611 * m4/m4module.h: Ansify function prototypes and headers.
4612 * m4/builtin.c: Ditto.
4613 * m4/evalparse.c: Ditto.
4614 * m4/input.c: Ditto.
4615 * m4/macro.c: Ditto.
4616 * m4/module.c: Ditto.
4617 * m4/output.c: Ditto.
4619 * m4/symtab.c: Ditto.
4620 * m4/utility.c: Ditto.
4621 * modules/format.c: Ditto.
4622 * modules/gnu.c: Ditto.
4623 * modules/m4.c: Ditto.
4624 * modules/mpeval.c: Ditto.
4625 * src/freeze.c: Ditto.
4627 * src/main.c: Ditto.
4629 2001-08-20 Akim Demaille <akim@epita.fr>
4631 * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
4632 generated with stock 2.52.
4634 2001-08-20 Akim Demaille <akim@epita.fr>
4636 * config/atconfig.m4: New, until part of Autoconf per se.
4637 * configure.in (AT_CONFIG): Use it.
4639 * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
4640 * tests/atlocal.in: New.
4641 * tests/generate.awk: For the time being, the empty quadrigraph is
4643 * tests/others.at (changeword, gmp): Check the configuration
4644 variable against `yes'.
4645 * tests/testsuite.at (dnl): Allow it, as it's used all over the
4648 2001-08-20 Akim Demaille <akim@epita.fr>
4650 * m4/utility.c (m4_numeric_arg): Spell out the culprit.
4651 * modules/m4.c (undivert): Disable the possibility of undiverting
4652 several files at once: it is not documented, it is inconsistent
4653 with the other macros, it can be straightforwardly mocked by
4654 several invocations, and most importantly, it prevents the
4655 possibility of other kinds of extension.
4656 Use `m4_numeric_arg'.
4658 2001-08-20 Akim Demaille <akim@epita.fr>
4660 * examples/include.m4: Typo.
4661 * tests/generate.awk: Really add it.
4662 * tests/Makefile.am: Adjust.
4663 * tests/others.at (Discard comments): It sure fails without `-c'.
4664 (include, undivert): Add -I examples/.
4666 2001-08-20 Akim Demaille <akim@epita.fr>
4668 Use sprintf, not ecft and friends since it is standard, portable,
4669 simplifies the code, and since the latter is even deprecated
4670 according to the GNU libc documentation.
4672 * modules/format.c: Drop evct support.
4674 2001-08-19 Gary V. Vaughan <gary@gnu.org>
4676 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up. Don't test
4678 * configure.in: ...do it here instead.
4680 * c-boxes.el: Deleted.
4681 * m4/builtin.c: Reformat box comments to be closer to GNU
4683 * m4/debug.c: Ditto.
4685 * m4/evalparse.c: Ditto.
4686 * m4/input.c: Ditto.
4687 * m4/m4module.h: Ditto.
4688 * m4/macro.c: Ditto.
4689 * m4/output.c: Ditto.
4690 * m4/symtab.c: Ditto.
4691 * m4/utility.c: Ditto.
4692 * modules/changeword.c: Ditto.
4693 * modules/format.c: Ditto.
4694 * modules/gnu.c: Ditto.
4695 * modules/load.c: Ditto.
4696 * modules/m4.c: Ditto.
4697 * modules/modtest.c: Ditto.
4698 * modules/mpeval.c: Ditto.
4699 * modules/perl.c: Ditto.
4700 * modules/shadow.c: Ditto.
4701 * modules/stdlib.c: Ditto.
4702 * modules/time.c: Ditto.
4703 * src/freeze.c: Ditto.
4704 * src/main.c: Ditto.
4706 2001-08-17 Gary V. Vaughan <gary@gnu.org>
4708 * m4/module.c: Fixup some errors in the description comment.
4710 2001-08-17 Akim Demaille <akim@epita.fr>
4712 * tests/others.at (iso8859): Specify the path to the M4 test file.
4713 * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
4714 files in error messages.
4716 2001-08-17 Akim Demaille <akim@epita.fr>
4718 * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
4719 * tests/others.at: Adjust input files paths.
4720 * tests/atconfig.in: Set top_builddir.
4721 * tests/Makefile.am: Adjust.
4722 `testsuite' is in src, not build.
4724 2001-08-17 Akim Demaille <akim@epita.fr>
4726 * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
4727 (generate.at): Install a temporary hack until the actual
4728 generate.awk is added to the repository.
4729 * tests/atconfig.in: New.
4731 2001-08-17 Akim Demaille <akim@epita.fr>
4733 Really apply the patch ``Drop Autoconf 2.13 compatibility.''
4735 2001-08-17 Akim Demaille <akim@epita.fr>
4737 * doc/m4.texinfo: Promote proper quotation.
4739 2001-08-17 Akim Demaille <akim@epita.fr>
4741 Remove the non Autotest tests.
4743 * tests/other-tests/capitalize.test,
4744 * tests/other-tests/changeword.test,
4745 * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
4746 * tests/other-tests/debug.test,
4747 * tests/other-tests/discard-comments.m4,
4748 * tests/other-tests/discard-comments.test,
4749 * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
4750 * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
4751 * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
4752 * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
4753 * tests/other-tests/hanoi.test,
4754 * tests/other-tests/import-environment.m4,
4755 * tests/other-tests/import-environment.test,
4756 * tests/other-tests/include.test, tests/other-tests/indir.test,
4757 * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
4758 * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
4759 * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
4760 * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
4761 * tests/other-tests/modtest.test,
4762 * tests/other-tests/multiquotes.test,
4763 * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
4764 * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
4765 * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
4766 * tests/other-tests/sync-lines.m4,
4767 * tests/other-tests/sync-lines.test,
4768 * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
4769 * tests/other-tests/translit.test, tests/other-tests/undivert.test,
4770 * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
4771 * tests/other-tests/wrap.test: Remove.
4773 * tests/run-test, tests/get-them: Remove.
4774 * tests/Makefile.am: Adjust.
4776 2001-08-17 Akim Demaille <akim@epita.fr>
4778 others.at no longer depends on other-tests/.
4780 * tests/others.at (stackovf): You're actually...
4782 (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
4783 (unload.test): Keep their authorship.
4784 (discard-comments, gmp, import-environment, modfreeze)
4785 (sync-lines): Embed the input files.
4786 * tests/stackovf.test: Copy from other-tests/stackovf.test.
4787 * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
4789 2001-08-17 Akim Demaille <akim@epita.fr>
4791 * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
4792 (M4exit): Tag the exit status of the example.
4793 * tests/get-them: Adjust.
4794 * tests/generate.awk: New, based on get-them.
4795 * tests/Makefile.am: Adjust to generate `generated.at'.
4796 * tests/testsuite.at: Adjust.
4797 (AT_CHECK_M4): Don't overquote. Blush...
4799 2001-08-17 Akim Demaille <akim@epita.fr>
4801 Start using Autotest. atconfig creation is still lacking.
4803 * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
4804 * examples/reverse.m4, tests/other-tests/import-environment.m4,
4805 * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
4806 * tests/other-tests/import-environment.test: Don't check LANGUAGE
4807 as it might be `unset', or set to `C'.
4808 * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
4809 * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
4810 * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
4811 * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
4812 * tests/other-tests/shadow.test: Adjust.
4813 * tests/testsuite.at, tests/others.at: New.
4814 * tests/Makefile.am: Adjust.
4816 2001-08-17 Akim Demaille <akim@epita.fr>
4818 Drop Autoconf 2.13 compatibility.
4820 * configure.in (changeword): No need to undefine it, as anyway if
4821 it's defined, M4sugar moved it as m4_changeword.
4822 And anyway, proper quotation is enough.
4823 (m4_pattern_allow): As it exists in 2.50, just use it.
4824 (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
4825 Don't handle Gettext's duties, let it handle them.
4826 * config/gnu-obstack.m4: Use m4_pattern_allow directly.
4828 2001-08-17 Akim Demaille <akim@epita.fr>
4830 * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
4831 (m4_errprint): Use fputs.
4832 * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
4833 dumpdef are not concerned.
4834 (Dumpdef, Errprint): Emphasize their insensitivity to
4836 * doc/Makefile.am: Add `TAGS' support.
4837 (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
4839 * config/Makefile.am (MAINTAINERCLEANFILES): New.
4841 2001-08-17 Akim Demaille <akim@epita.fr>
4843 * modules/Makefile.am (ETAGS_ARGS): New.
4845 2001-08-17 Akim Demaille <akim@epita.fr>
4847 * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
4850 2001-08-17 Akim Demaille <akim@epita.fr>
4852 * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
4854 2001-08-17 Akim Demaille <akim@epita.fr>
4856 * m4/m4module.h (m4/list.h): Don't include it.
4858 2001-08-16 Gary V. Vaughan <gary@gnu.org>
4860 m4_modules are no more, we use lt_dlhandles directly and let
4861 latest libltdl features manage the list of loaded modules.
4862 * acinclude.m4: Regenerated.
4863 * m4/ltdl.c: Updated from master copy.
4864 * m4/module.c: Reimplemented to take advantage of advances in
4866 * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
4867 list with lt_dlhandle_next.
4868 (m4_builtin_find_by_func): Ditto.
4869 (m4_builtin_table_install): Use lt_dlhandle.
4870 (m4_macro_define): Ditto.
4871 (m4_macro_table_install): Ditto.
4872 m4/module.h: Prototype new module management API.
4873 (m4_modules): No longer required.
4874 (m4_module_init_t, m4_module_finish_t): POSIX namespace
4875 violations, renamed to...
4876 (m4_module_init_func, m4_module_finish_func): ...these,
4878 (M4INIT_HANDLER): Clean way to declare init functions in modules.
4879 (M4FINISH_HANDLER): And similarly for finish functions.
4880 * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
4881 -- Add indirection to the CONC macro so that arguments are
4883 * modules/modtest.c (m4_init_module): Replaced with M4INIT_HANDLER.
4884 * modules/shadow.c (m4_init_module): Ditto.
4885 Due to new init function semantics, be careful to perform the
4886 initialisation only on first load.
4887 * modules/perl.c (m4_init_module): Ditto. And Ditto.
4888 (m4_finish_module): Replaced with M4FINISH_HANDLER.
4889 Due to new finish function semantics, be careful to perform the
4890 finalisation only on first load.
4891 * m4/m4private.h (m4_module): Removed in favour of...
4892 (m4_module_data): ...structure without all the wrapper fields.
4893 Instances of this new structure are stored associated lt_dlhandles
4894 with lt_dlcaller_data_set().
4895 * m4/builtin.c (m4_builtin_define): Takes a handle argument
4896 instead of the old module argument.
4897 (m4_builtin_table_install): Ditto.
4898 * modules/load.c (m4_resident_module): Removed. This is no
4899 longer implemented as a magic symbol...
4900 * modules/m4.c (m4_resident_module): Ditto.
4901 * modules/load.c (M4INIT_HANDLER): ...the module init function now
4902 uses the ltdl api to make the module resident.
4903 * modules/m4.c (M4INIT_HANDLER): Ditto.
4904 * modules/load.c (builtin_modules): Traverse the loaded module
4905 list with lt_dlhandle_next.
4906 (builtin_load): Much simplified in light of the reimplemented
4908 * src/freeze.c (produce_module_dump): Cleaned up and optimised in
4909 light of the m4/module.c rewrite.
4910 (produce_symbol_dump): Ditto.
4911 (reload_frozen_state): Ditto.
4912 * m4/list.c, m4/list.h: Files deleted. No longer required.
4913 * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
4914 (libm4_la_SOURCES): Delete list.c reference.
4915 * m4/m4private.h (m4_token_data): Add a handle field. This
4916 eliminates many of the searches to find the handle associated with
4917 various tokens that are passed between functions.
4918 (struct m4_symbol): Removed the module field. The
4919 module association does not belong with the symbol...
4920 * m4/input.c (struct m4_builtin): ...it belongs with the builtin
4921 that the module implementation code is from. Added a handle
4923 (m4_push_macro): Add a `handle' argument. Changed all callers.
4924 (init_macro_token): Set the `handle' field for the
4926 * m4/macro.c (expand_argument): Copy the new handle field during
4928 * modules/m4.c (macro_install): Use the new handle field to
4929 optimise the search for the correct builtin structure, and pass
4930 the handle details to m4_builtin_define.
4932 2001-08-15 Akim Demaille <akim@epita.fr>
4934 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
4935 when creating `m4/obstack.h'.
4936 * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
4938 * tests/defs: Make them absolute.
4939 (CDPATH) Neutralize.
4940 * tests/gethem: Use them.
4942 2001-08-14 Gary V. Vaughan <gary@gnu.org>
4944 * config/ltmain.sh: Doh! Import again for a quoting fix that
4945 prevented any regression test from passing.
4947 * m4/m4module.h (obstack.h): Choose between installed version
4948 and shipped version based on configure tests.
4949 * src/freeze.c (obstack.h): Ditto.
4951 * acconfig.h: Removed. No longer required.
4953 * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
4954 * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
4955 them to AC_INIT and AM_INIT_AUTOMAKE.
4956 * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
4957 disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
4958 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
4959 shell variable m4_cv_func_obstack_h.
4960 * tests/defs (M4): Be more careful about relative path to libtool
4961 script and m4 binary by using $srcdir.
4963 * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
4964 optargs to the existing libltdl search path.
4965 * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
4966 * m4/ltdl.c: Updated.
4968 * config/ltmain.sh: Ditto.
4970 2001-08-11 Gary V. Vaughan <gary@gnu.org>
4972 * src/main.c (main): Add `-b' (for `batch') mode switch to force
4973 interactive mode off.
4975 2001-08-10 Akim Demaille <akim@epita.fr>
4977 * configure.in: Require Autoconf 2.52.
4978 (AC_ARG_PROGRAM): Remove, handled by Automake.
4979 (m4_getopt): Rename as...
4980 (m4_getopt_h): this.
4981 Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
4982 Undefine `changeword' only if defined.
4983 * config/gnu-obstack.m4: Require Autoconf 2.52.
4984 (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
4987 2001-08-09 Yuji Minejima <ggb01164@nifty.ne.jp>
4989 * doc/m4.texinfo: Fix some typos, and apply some small
4992 2001-08-09 Andreas Schwab <schwab@suse.de>
4994 * src/main.c (main): Fix improper uses of error (missing format
4997 2001-08-07 Akim Demaille <akim@epita.fr>
4999 Improve `make distcheck'.
5001 * configure.in: Be sure to be able to run `mkconfig.sh' when src
5003 * Makefile.am (dist-hook): Remove, as it is no longer needed.
5004 * doc/m4.texinfo (Include): Add missing blank.
5005 * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
5008 2001-08-07 Akim Demaille <akim@epita.fr>
5010 * m4/evalparse.c: A better introductory comment.
5011 * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
5012 * m4/macro.c: Adjust old comments.
5013 * modules/README: Typo.
5015 2001-08-07 Akim Demaille <akim@epita.fr>
5017 * config/gnu-obstack.m4: New.
5019 2001-08-07 Akim Demaille <akim@epita.fr>
5021 * config/Makefile.am, config/stackovf.m4: New.
5022 * configure.in, Makefile.am: Adjust.
5024 2001-08-05 gettextize <bug-gnu-utils@gnu.org>
5026 * po/Makefile.in.in: Upgrade to gettext-0.10.39.
5027 * po/cat-id-tbl.c: Remove file.
5028 * po/stamp-cat-id: Remove file.
5030 2001-04-08 Roderick Koehle <Roderick.Koehle@infineon.com>
5032 * modules/format.c (format): Formatting for %f was not
5033 interpreting the position of the decimal point correctly for
5036 2000-12-01 Gary V. Vaughan <gary@gnu.org>
5038 * TODO: Removed m4exit bug.
5039 * modules/load.c (m4_resident_module): Make this module resident.
5040 * module/m4.c (m4_resident_module): Ditto.
5041 * m4/modules.c (m4_module_load): Use new ltdl resident modules
5042 feature to mark modules as resident if they export
5043 `m4_resident_module' as TRUE.
5044 (m4_module_unload): Do not remove resident modules, and take care
5045 with symbol insertion and deletion with resident modules.
5046 * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
5047 use resident modules feature.
5049 2000-11-30 Gary V. Vaughan <gary@gnu.org>
5051 * TODO: Updated. Removed some cruft that has since been fixed
5052 or implemented. Added some more entries.
5055 * modules/README: Updated.
5056 * doc/m4.texinfo: Updated.
5058 * modules/gnu.c (builtin_functions): Make indir orthogonal to
5059 builtin, in that each is recognised as a macro only with parameters
5060 (builtin_indir): Passing 0 arguments is now an error, as with
5063 * src/main.c (usage): Added missing description of `-c' option.
5065 2000-11-29 Gary V. Vaughan <gary@gnu.org>
5067 Consolidate the myriad of dispersed test scripts into the
5068 tests subdirectory. I think I now have all the file where I
5069 want them, so there shouldn't be anymore upheaval =)O|
5071 * tests/Makefile.am: Updated to run the new tests added below.
5072 * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
5073 tests/other-tests/ddivert.test, tests/other-tests/debug.test,
5074 tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
5075 tests/other-tests/foreach.test, tests/other-tests/forloop.test,
5076 tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
5077 tests/other-tests/hanoi.test, tests/other-tests/include.test,
5078 tests/other-tests/indir.test, tests/other-tests/misc.test,
5079 tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
5080 tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
5081 tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
5082 tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
5083 tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
5084 tests/other-tests/reverse.test, tests/other-tests/shadow.test,
5085 tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
5086 tests/other-tests/translit.test, tests/other-tests/undivert.test,
5087 tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
5088 tests/other-tests/wrap.test: New tests based on the contents
5089 of the tests removed below.
5090 * examples/Makefile.am, modules/Makefile.am: Updated to
5091 reflect removed tests.
5092 * examples/defs,modules/defs: Removed.
5093 * examples/capitalize.test, examples/comments.test,
5094 examples/ddivert.test, examples/debug.test,
5095 examples/esyscmd.test, examples/exp.test,
5096 examples/foreach.test, examples/forloop.test,
5097 examples/fstab.test, examples/hanoi.test,
5098 examples/include.test, examples/indir.test,
5099 examples/misc.test, examples/multiquotes.test,
5100 examples/patsubst.test, examples/pushpop.test,
5101 examples/regexp.test, examples/reverse.test,
5102 examples/sysv-args.test, examples/trace.test,
5103 examples/translit.test, examples/undivert.test,
5104 examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
5105 modules/modpath1.test, modules/modpath2.test,
5106 modules/modpath3.test, modules/modpath4.test,
5107 modules/modtest.test, modules/shadow.test,
5108 modules/unfrozen.m4, modules/unload.test: Removed.
5110 Move the implementation of GMP support for the mpeval() builtin
5111 into a loadable module that depends on libgmp. mpeval() and
5112 eval() share a common parser, now in m4/evalparser.c; the code
5113 in m4/numb.c and m4/numb.h is now physically split between
5114 m4/eval.c (the eval() backend) and modules/mpeval.c (the
5115 mpeval() backend), rather than being differentiated by cpp
5116 macros and multiple inclusion. The mpeval module is always
5117 built but will generate an diagnostic if it is used from an
5118 installation that didn't link in the gmp library.
5119 * modules/Makefile.am: build and install the new mpeval module.
5120 * modules/mpeval.c: Now contains the former parts of m4/numb.c
5121 and m4/numb.h that are required for gmp support in mpeval().
5122 * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
5123 * m4/evalmp.c: Removed.
5124 * m4/m4module.h: Removed conditional prototype for
5126 * m4/eval.c: Rewritten. Contains the former parts of m4/numb.c
5127 and m4/numb.h that do not rely on gmp.
5128 * m4/evalparse.c: New file, contains the shared parts of the
5129 eval() and evalmp() parser implementations, and is no longer
5130 unencumbered by cpp magic to uncover the right parts.
5131 * m4/numb.h: Removed. It's former contents are split between
5132 m4/eval.c and modules/mpeval.c.
5135 * tests/other-tests/changeword.test: New test. Rudimentary
5136 testing of changeword builtin runs only if --wnable-changeword
5137 was used at configure time.
5138 * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
5139 alternation correctly. Split into two expressions to compensate.
5140 * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
5141 * modules/Makefile.am: Build changeword module.
5142 * modules/changeword.c (m4_macro_table): Define __m4_changeword__
5143 only when --enable-changeword was passed to configure.
5144 (builtin_changeword): If --enable-changeword was not used, then
5145 report that changeword() builtin has no support in m4 binary.
5147 2000-11-28 Gary V. Vaughan <gary@gnu.org>
5149 * src/main.c (main): Fixed a particularly nasty bug is
5150 user_search_path setting -- the -M flag processing must be
5151 extremely careful with search path ordering, or else the default
5152 installed module directory (possibly containing modules from a
5153 previous release) is placed earlier in the search path than any -M
5154 arguments (which are relied upon to load uninstalled modules with
5155 most of the tests in the regresion suite).
5157 * modules/load.c (builtin_load): Nasty hack to prevent adding
5158 symbols to symtab again if a module is loaded more than once.
5159 * modules/m4.c (builtin_ifelse): removed unused variable argv0.
5161 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed a
5162 possible NULL pointer dereference.
5164 * m4/module.c (m4_module_find_by_modname): Renamed from
5165 m4_module_modname_find. Fixed all references.
5166 (m4_module_find_by_builtin): New function.
5168 * modules/modfreeze.test: load the `load' module with each
5170 * src/freeze.c (produce_frozen_state): Simplified in light of
5171 module field in m4_symbol. Allow a third argument for text macros
5172 to name the originating module.
5173 (reload_frozen_state): ditto.
5174 * m4/m4module.h: Fixup prototypes.
5175 * m4/builtin.h (m4_builtin_define): Add a module argument so
5176 that symbols can be registered against the defining module.
5177 (m4_macro_define): ditto.
5178 * m4/m4private.h (m4_symbol): Make the module field const to save
5179 on casting in the rest of the code.
5180 (SYMBOL_MODULE): New macro.
5182 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
5183 symbol reference maintenance bugs when removing a symbol from the
5186 * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
5188 2000-11-27 Gary V. Vaughan <gary@gnu.org>
5190 * configure.in (m4_cv_func_obstack): A better check for whether
5191 libc has an obstack implementation.
5192 * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
5194 * configure.in (--with-modules): Changed semantics. This
5195 option is now used to list modules to be preopened.
5196 * src/m4.h: #include "ltdl.h" unconditionally.
5197 * src/main.c: Removed all dependencies on WITH_MODULES.
5198 * src/freeze.c: ditto.
5199 * modules/Makefile.am: ditto.
5200 * m4/m4.c (builtin_m4exit): ditto.
5201 * modules/modpath1.test: ditto.
5202 * modules/modpath2.test: ditto.
5203 * modules/modpath3.test: ditto.
5204 * modules/modpath4.test: ditto.
5205 * modules/modtest.test: ditto.
5206 * modules/shadow.test: ditto.
5207 * modules/unload.test: ditto.
5209 * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
5210 comes up on demand in LTLIBOBJS now.
5211 * configure.in (getopt_long): Creating and relying on a link for
5212 getopt.h on hosts with no getopt_long() of thier own works
5213 correctly now. This is necessary so that callers of getopt_long()
5214 can simply `#include <getopt.h>': the naive way of doing this
5215 would end up using our own getopt.h and the installed
5216 getopt_long(), which is asking for trouble!
5217 (obstack_init): A similar argument applies to obstack.h and
5220 * m4/ltdl.c: Upgraded to latest bleeding edge version again.
5221 On Solaris-2.5 (at least) the native dlopen implementation
5222 gets confused about m4.o when looking for module "m4". This
5223 version always looks for .la an .$lib_ext suffixed names first
5224 to work around the problem. Sigh.
5226 * po/POTFILES.in: Take account of these file movements.
5227 * src/Makefile.am (m4_SOURCES): removed eval.c.
5228 (EXTRA_m4_SOURCES): removed numb.c and numb.h.
5229 * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
5230 (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
5231 * modules/m4.c (builtin_eval): Use m4_evaluate().
5232 * m4/eval.c: Moved here from src/eval.c to facilitate
5233 implementation of eval() builtin as part of the `m4' loadable
5235 (m4_evaluate): renamed from evaluate for namespace cleanliness.
5236 * m4/numb.c: Moved here from src/numb.c, since it is #included
5237 into eval.c at compile time.
5238 * m4/m4module.h (m4_evaluate): Added prototype.
5239 * src/m4.h (evaluate): Removed prototype.
5241 2000-11-25 Gary V. Vaughan <gary@gnu.org>
5243 * modules/perl.c (builtin_perleval): Use PL_na for
5244 compatibility with perl-5.6.
5246 * src/main.c (main): It is now safe to
5247 ``m4_module_install("m4")'', without tripping over the m4
5249 * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
5250 versions having fixed the insidious module search order bug.
5252 * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
5253 supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
5255 * configure.in: Figure out whether to use the installed
5256 getopt.h or the supplied one.
5257 * src/Makefile.am: ditto.
5259 * po/POTFILES.in: List files in their new positions.
5261 * config/ltmain.sh: This needs to be checked in to match the
5262 libtool macros copied to acinclude.m4 (until a released
5263 libtool copes with m4's needs).
5264 * bootstrap: Run gettextize.
5266 2000-11-24 Gary V. Vaughan <gary@gnu.org>
5268 * AUTHORS: Added my details.
5271 * bootstrap: temporary update until released libtool catches up.
5273 * All files: Use new GNU GPL copyright blurb with current contact
5276 * configure.in (LTLIBOBJS): Use canonical code for calculation of
5279 * config: renamed acm4 directory to config to be more like
5280 other autoconfiscated packages.
5282 * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
5283 * config/debug.m4: New file implementing configure macros to add
5284 suitable debug flags to the compiler invocation.
5286 * modules/load.c: New file implementing the ``load'' and
5287 ``unload'' builtins.
5288 * tests/get-them: Set the module search directory to the modules
5289 build directory in generated tests.
5290 * modules/shadow.test: ditto.
5291 * modules/modtest.test: ditto.
5292 * modules/modpath1.test: ditto.
5293 * modules/modpath2.test: ditto.
5294 * modules/modpath3.test: ditto.
5295 * modules/modpath4.test: ditto.
5296 * modules/modtest.test: ditto.
5297 * modules/modfreeze.test: ditto.
5298 * modules/unload.test: ditto.
5300 * modules/changeword.c: New file implementing the ``changeword''
5301 builtin as a loadable module.
5302 * modules/mpeval.c: New file implementing the ``mpeval'' builtin
5303 as a loadable module.
5305 * src/main.c (main): Load the gnu module if m4 was started
5306 normally -- i.e. without the -G option.
5307 * modules/gnu.c: New file implementing a new loadable module wuth
5308 definitions for all the gnu extension builtins.
5309 * modules/format.c: Moved here from src/format.c. Now included
5312 * src/main.c (main): Load the traditional module if m4 was
5313 started in `no_gnu_extensions' mode.
5314 * modules/traditional.c: New file implementing the ``unix'' macro,
5315 required when m4 is executed in traditional mode, as a loadable
5318 * src/main.c: Renamed from m4.c to avoid confusion with
5320 (main): Always load the m4 module.
5321 * modules/m4.c: New file implementing a new loadable module with
5322 definitions for all m4 builtins that are not gnu extensions.
5324 * m4/Makefile.am: Adjusted to take new files below into account.
5325 * m4/m4module.h: Prototypes for exported functions and types moved
5326 to this directory from the src directory.
5327 * m4/m4private.h: Moved here from src/m4private.h to facilitate
5328 the migration of all builtin implementations to loadable modules.
5329 * m4/macro.c: Moved this file here from the src directory,
5330 renaming all exported symbols to use the prefix ``m4_''.
5331 * m4/builtin.c: ditto.
5332 * m4/module.c: ditto.
5333 * m4/symtab.c: ditto.
5334 * m4/debug.c: ditto.
5335 * m4/input.c: ditto.
5336 * m4/output.c: ditto.
5338 * m4/ltdl.h, m4/ltdl.c: ditto.
5339 * m4/utility.c: Odd functions moved here from files in the src
5340 directory to facilitate builtin migration.
5342 2000-08-12 Gary V. Vaughan <gary@gnu.org>
5344 * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
5345 error message, to make translators' jobs a little easier.
5346 (builtin_builtin): ditto.
5347 (builtin_traceon): ditto.
5348 (builtin_traceoff): ditto.
5349 Reported by Akim Demaille <akim@epita.fr>
5351 * m4/Makefile.am (pkgincdir): Deleted. Use automake's built in
5352 pkgincludedir instead.
5354 * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
5355 it is exported globally. Fixed all references.
5359 (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
5360 globally. Fixed all references.
5361 (DEF_LQUOTE): ditto.
5365 2000-07-28 Gary V. Vaughan <gary@gnu.org>
5370 * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
5371 (AC_OUTPUT): touch stamp-h.in, not stamp-h.
5373 * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
5374 Removed `Prev', `Next' and `Up' fields of all @nodes now that
5375 makeinfo calculates them for us, and to make any future
5376 reorganisation easier.
5377 (Frozen files): Document format version 2.
5378 `V' now takes argument `2'.
5379 `F' can take a single argument if symbol and builtin names
5380 are the same, or 3 arguments if the builtin is from a module.
5381 New `S' specification for saving syntax table contents.
5382 New `M' specification for saving loaded module names.
5383 * src/freeze.c: Implement them.
5384 * src/input.c (syntax_code): For interpreting frozen syntax
5387 * examples/Makefile.am: Add the contents of the WWW directory to
5389 * examples/WWW/Makefile: ditto,
5390 (%.htm): Compares file contents (not just sizes) to determine
5391 whether a change has occured.
5392 * examples/WWW/_header.htm: Bumped version number.
5393 * examples/WWW: Regenerated content.
5395 * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
5396 compilers comes much easier without ansi2knr.
5397 * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
5399 * m4/list.c: New generic list container type.
5400 * m4/list.h: Interface to new container type.
5401 * m4/Makefile.am (pkginc_HEADERS): Install list.h.
5402 (libm4_la_SOURCES): compile and link list.c.
5403 * src/builtin.c (builtin_tables): Use list container.
5404 * src/module.c (symtab): ditto.
5405 * src/symtab.c (symtab): ditto.
5407 * m4/system.h: New file for common preprocessor definitions.
5408 * m4/Makefile.am (pkginc_HEADERS): install system.h.
5409 * m4/error.c: Use system.h in place of inline preprocessor.
5410 * m4/error.h: ditto.
5411 * m4/module.c: ditto.
5412 * m4/module.h: ditto.
5413 * m4/xmalloc.c: ditto.
5415 * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
5417 * m4/xmalloc.c (xmalloc_exit_failure): ditto.
5419 * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
5420 it is exported globally. Fixed all references.
5422 (module_init_t): ditto.
5423 (module_finish_t): ditto.
5424 (token_data): ditto.
5425 (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
5426 it is exported globally. Fixed all references.
5427 (SYNTAX_IGNORE): ditto.
5428 (SYNTAX_SPACE): ditto.
5429 (SYNTAX_OPEN): ditto.
5430 (SYNTAX_CLOSE): ditto.
5431 (SYNTAX_COMMA): ditto.
5432 (SYNTAX_DOLLAR): ditto.
5433 (SYNTAX_ACTIVE): ditto.
5434 (SYNTAX_ESCAPE): ditto.
5435 (SYNTAX_ALPHA): ditto.
5436 (SYNTAX_NUM): ditto.
5437 (SYNTAX_ALNUM): ditto.
5438 (SYNTAX_LQUOTE): ditto.
5439 (SYNTAX_RQUOTE): ditto.
5440 (SYNTAX_BCOMM): ditto.
5441 (SYNTAX_ECOMM): ditto.
5442 (SYNTAX_VALUE): ditto.
5443 (SYNTAX_MASKS): ditto.
5461 (TOKEN_NONE): ditto.
5462 (TOKEN_STRING): ditto.
5463 (TOKEN_SPACE): ditto.
5464 (TOKEN_WORD): ditto.
5465 (TOKEN_SIMPLE): ditto.
5466 (TOKEN_MACDEF): ditto.
5468 * m4/m4module.h (voidstar): Removed in favour of `VOID' for
5469 consistency. Fixed all references.
5470 (STRING): Renamed to `m4_string' for consistency, and because if
5471 is exported globally. Fixed all references.
5472 (token_type): Renamed to `m4_token_t' for the same reasons.
5473 (token_data_type): Renamed to `m4_token_data_t' for the same
5476 * m4/m4module.h (XCALLOC): Wrapper macro which handles type
5480 (XFREE): Wrapper macro which avoids freeing NULL pointers.
5482 * m4/m4module.h (m4_macro): New type for module defined user
5484 * modules/modtest.c (m4_macro_table): Define module user macros.
5485 * modules/shadow.c (m4_macro_table): ditto.
5487 * m4/m4module.h (M4BUILTIN_HANDLER): For defining handlers
5488 declared with M4BUILTIN.
5490 * m4/xmalloc.c: Use memset if bzero is not available when
5491 emulating calloc with malloc.
5492 (xcalloc): Fallback to malloc/bzero if calloc is not available.
5493 (xfree): Added for consistency. Will not try to free NULL
5495 * src/m4.c (xfree): Deleted in favour of the above.
5496 * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
5497 linking with libdmalloc.
5498 * m4/xstrdup.c (WITH_DMALLOC): ditto.
5500 * modules/frozen.m4: New test case.
5501 * modules/unfrozen.m4: ditto.
5502 * modules/modfreeze.test: New test.
5503 * modules/unload.test: ditto.
5504 * modules/Makefile.am (EXTRA_DIST): Distribute them.
5506 * modules/modpath1.test: Don't try this test if module support is
5508 * modules/modpath2.test: ditto.
5509 * modules/modpath3.test: ditto.
5510 * modules/modpath4.test: ditto.
5511 * modules/modtest.test: ditto.
5512 * modules/shadow.test: ditto.
5514 * modules/perl.c: New module.
5515 * modules/perl.m4: Example of using it.
5516 * modules/Makefile.am (perl_la_SOURCES): Build new perl module.
5518 * src/m4.c (main): Assume interactive mode if STDIN is connected
5520 Changed startup sequence slightly so that syntax is not
5521 initialised from here when loading a frozen file.
5523 * src/builtin.c: Much improved macro definition style.
5524 * src/m4private.h: Internal structures for m4_builtin and
5525 m4_macro instances. These are not exposed to module writers.
5526 * src/module.c (module_modname_find): Find a module structure
5528 (make_macro_table): Build an internal macro table from a external
5530 (make_builtin_table): Build an internal builtin table from an
5531 external definition.
5533 * src/module.c (module_unload): Be extremely careful to remove
5534 builtins and macros that match the module being unloaded -- no
5535 longer assume that the top element can be removed incase another
5536 odule defines an identical name.
5537 * src/symtab.c (remove_table_reference_symbols): remove all symbol
5538 table entries which refer to a given builtin table.
5539 * src/builtin.c (remove_tables): Use it!
5541 2000-07-13 Thomas Tanner <tanner@ffii.org>
5543 * Makefile.am (SUBDIRS): we need modules/ for "make dist"
5544 * acm4/modules.m4: deleted
5545 * bootstrap: don't libtoolize libltdl!
5546 * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
5547 if set, enable WITH_MODULES and add modules to DLPREOPEN
5548 * examples/misc.test: redirect standard output
5549 * lib/Makefile.am: don't use DLLDFLAGS
5550 * lib/m4module.c: include necessary headers to silence GCC -Wall
5551 * lib/m4regex.c: fixes to silence GCC -Wall
5552 * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
5553 build modules conditionally
5554 * modules/shadow.c: define symbol aliases before using them
5555 * modules/test.c: define symbol aliases before using them
5556 * po/de.po: update translation
5557 * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
5558 pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
5560 * src/m4.c: initialize libltdl's preloaded symbols via
5561 LTDL_SET_PRELOADED_SYMBOLS
5562 * src/module.c: libltdl's memory management must be initialized
5563 before calling lt_dlinit!, fix warnings
5565 2000-01-18 Gary V. Vaughan <gary@gnu.org>
5567 * README: Caveat about nls not supported by dll architecture on
5570 * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
5572 * tests/Makefile.am (stamp-TESTS): now works with VPATH.
5573 * src/Makefile.am (m4_LDADD): use $(builddir) for VPATH.
5574 * modules/Makefile.am (LIBS): ditto.
5575 (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
5576 $(top_srcdir)/m4 (for only <m4module.h>).
5577 * modules/shadow.test: fixed for VPATH.
5578 * modules/modtest.test: ditto.
5579 * modules/modpath4.test: ditto.
5580 * modules/modpath3.test: ditto.
5581 * modules/modpath2.test: ditto.
5582 * modules/modpath1.test: ditto.
5584 * modules/time.test: Removed due to timezone dependence,
5585 * modules/Makefile.am (TESTS): Removed time.test.
5587 * configure.in: Use $3 of AC_DEFINE so that we can,,,
5588 * acconfig.h: Remove everything except the gettext parameters.
5589 * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
5591 * acm4/ltdl.m4: Updated to latest from libtool cvs.
5592 * acm4/modules.m4: Remove code which duplicates ltdl.m4 and
5593 increment serial number.
5595 * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
5596 src dir and immediately after libm4 is built for confidence that
5597 it doesn't rely on the src directory.
5598 (SUBDIRS): Moved doc dir to the end since helptoman.pl and
5599 makeinfo stop the build on cygwin (because they don't work).
5601 * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
5603 * m4/m4private.h: ...is not a public header, so moved to src.
5604 Add `#include <config.h>', `#define _COMPILING_M4' and
5606 * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
5607 * src/Makefile.am (noinst_HEADERS): add m4private.h.
5608 * src/builtin.c: `#include "m4private.h"' now takes care of the
5609 above. Duplicates removed.
5610 * src/debug.c: ditto.
5611 * src/eval.c: ditto.
5612 * src/evalmp.c: ditto.
5613 * src/format.c: ditto.
5614 * src/freeze.c: ditto.
5615 * src/input.c: ditto.
5617 * src/macro.c: ditto.
5618 * src/module.c: ditto.
5619 * src/numb.h: ditto.
5620 * src/output.c: ditto.
5621 * src/path.c: ditto.
5622 * stackovf.c: ditto.
5625 * po/POTFILES.in: compensate for renaming of lib/*.
5626 * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
5627 (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
5628 and then in $(top_srcdir)/lib (for eg. "m4private.h").
5629 * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
5631 * m4/m4error.h: Renamed error.h, for installation to
5632 $prefix/include/m4..
5633 * m4/m4obstack.h: Renamed obstack.h, for same reason.
5634 * m4/m4regex.h: Renamed regex.h, for same reason.
5635 * m4/m4error.c: Renamed error.c, and use #include "error.h".
5636 * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
5637 * m4/m4regex.c: Renamed regex.c, and fix #includes.
5639 * lib: moved to m4 to easily support header installation to
5641 * Makefile.am (SUBDIRS): renamed lib dir to m4.
5642 * configure.in (AC_OUTPUT): reference m4/Makefile.in.
5643 * acm4/regex.m4: Point to m4/regex.c.
5645 * examples/foreach.m4: Sanitise quoting.
5646 * examples/foreach.test: New torture test.
5647 From Akim Demaille <akim@epita.fr>
5649 2000-01-17 Gary V. Vaughan <gary@gnu.org>
5651 * src/ltdl.c: Use access() to abort doomed module load attempts
5652 if module file does not exist.
5654 * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
5655 getopt1.o will already be used if appropriate, so I moved getopt.c
5656 and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
5658 * modules/modpath1.test: Use correct filename in header line.
5659 * modules/modpath2.test: ditto.
5660 * modules/modpath3.test: ditto.
5661 * modules/modpath4.test: ditto.
5663 Without these changes lt_dlopen("test") attempts to
5664 LoadLibrary("/bin/test") on Windows, which although harmless
5665 generates a spurious error message which spoils most of the tests:
5666 * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
5667 (TESTS): s/test.test /modtest.test /
5668 (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
5669 (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
5670 * modules/modpath1.test: s/test.m4 /modtest.m4 /
5671 * modules/modpath2.test: ditto.
5672 * modules/modpath4.test: ditto.
5673 * modules/modpath3.test: s/-m test /-m modtest /
5674 * modules/shadow.m4: use {un,}loadmodule(`modtest').
5676 2000-01-16 Gary V. Vaughan <gary@gnu.org>
5678 * src/ltdl.c (find_file): Updated to new version with fixed memory
5679 allocation bug in `next'.
5680 * src/ltdl.h: updated to match.
5682 * modules/Makefile.am: Cleaned up and reordered.
5684 2000-01-16 René Seindal <rene@seindal.dk>
5686 * modules/Makefile.am (TESTS): New tests for the module system.
5688 * modules/*.test: New files.
5690 * src/m4.c (main): Added call to module_init().
5691 Treats -M and -m as the arguments -D -U and -t, ie deferred.
5693 * src/m4.h: Added declaration of module_init().
5695 * src/module.c (module_init): No longer static
5697 * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
5698 Added to shut up automake about non standard libtool library
5701 * src/module.c: Disabled DEBUG by default.
5703 * modules/README: Changed example from unload.m4 to shadow.m4
5705 * modules/shadow.m4: Renamed from unload.m4
5707 * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
5709 * src/m4.c (main): Functionality for -m and -M were reversed.
5712 2000-01-12 Gary V. Vaughan <gary@gnu.org>
5714 * doc/help2man.pl: updated to version 1.020.
5716 * lib/COPYING.LIB: updated to version 2.1.
5718 * lib/m4module.h: restructure the M4_SCOPE code to work when
5719 creating a dll which links with libm4.la and both DLL_EXPORT
5720 (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
5723 2000-01-11 Gary V. Vaughan <gary@gnu.org>
5725 Merged the following changes from my tree:
5727 1999-06-15 Gary V. Vaughan <gary@gnu.org>
5729 * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
5730 ported to compile shared libs.
5732 * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
5733 use `__declspec(dllimport)' when linking libm4.la on win32.
5734 * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
5736 * configure.in (M4OBJS): Discover whether we need the shipped
5737 implementation of getopt_long.
5738 * src/Makefile.am (m4_LDADD): Link the getopt objects into the
5739 main binary here, as opposed to the module library in lib/libm4.la.
5741 1999-06-14 Gary V. Vaughan <gary@gnu.org>
5743 * modules/README: Updated to describe the improved libltdl based
5745 * README (cygwin): Added some compilation notes for building m4
5746 correctly under cygwin.
5747 * TODO: Cleaned out the entries for the module system since they
5748 are now implemented.
5750 * *.[ch]: __P is in the compiler's reserved namespace, so replaced
5751 all instances of __P with M4_PARAMS.
5753 * lib/getdate.h: removed unreferenced file.
5755 * lib/m4private.h: New file to define the private interface to the
5756 token_data struct, which must be shared between m4module.c, and
5757 builtin.c but not exported to modules built from the installed
5758 m4module.h since it's size changes depending on compile time
5761 * src/m4.h: Lots of stuff moved to lib/m4module.h.
5763 * lib/m4module.h: New file to define the interface available when
5764 compiling m4 modules.
5765 * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
5766 necessary for module compilation into this new file.
5768 * lib/Makefile.am (include_HEADERS): install headers (renamed to
5769 avoid nameclash with other system headers) necessary for compiling
5771 (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
5772 so that modules can include the (renamed) installed headers and
5773 be guaranteed a matching implementation.
5774 * lib/m4error.h: renamed from error.h.
5775 * lib/m4obstack.h: renamed from obstack.h.
5776 * lib/m4regex.h: renamed from regex.h.
5777 * configure.in (AC_REPLACE_FUNCS): Don't look for a system
5778 implementation, simply include the shipped version
5779 unconditionally, otherwise it is hard for a module to know
5780 whether the m4obstack.h header it is using matches the
5781 implementation it ends up linking against.
5782 (jm_WITH_REGEX): Include regex into libm4 unconditionally for
5785 1999-05-18 Gary V. Vaughan <gary@gnu.org>
5787 * examples/misc.test: Don't run this test on machines which don't
5788 have a root user in /etc/passwd (e.g. cygwin).
5790 * tests/get-them (/^@example$/): Error messages might have a
5791 ``.exe'' suffix to the program name, or else use the libtool
5792 ``.libs/lt-m4'' binary, or generally have an unexpected path. All
5793 of these cases are now catered for when comparing error messages
5795 * tests/other-tests/*.test: ditto.
5796 * examples/*.test: ditto.
5798 * tests/defs (M4): use libtool execute mode.
5799 * examples/defs (M4): ditto.
5801 * tests/get-them (END): explicitly close any open file.
5802 (printthem): In a regular expression, '{' is the start of a repeat
5803 count! Use `[{]' for a literal open brace.
5804 (/^@node /): Don't use substr on a string shorter than the trim
5807 1999-05-17 Gary V. Vaughan <gary@gnu.org>
5809 * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
5811 (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
5813 2000-01-10 Andreas Schwab <schwab@suse.de>
5815 * tests/other-tests/gmp.test: Find config.sh in build directory.
5817 * configure.in: Find tests/mkconfig.sh in $srcdir.
5819 * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
5820 <signal.h> (for SUS2 compliant systems).
5822 * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
5825 2000-01-10 René Seindal <rene@seindal.dk>
5829 * TODO, NEWS: Cleaned up and updated.
5831 * src/m4.c (main): New variable exit_status for exit status in
5832 case of unreadable files. Now m4 will exit with EXIT_FAILURE if a
5833 file cannot be read instead of EXIT_SUCCESS.
5835 * src/builtin.c (m4_indir): Changed error message to help
5836 translators (from Akim Demaille <demaille@inf.enst.fr>).
5838 * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
5841 * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
5844 * src/input.c (match_input): Reordering of code, to avoid multiple
5845 calls to push_string_init() from obstack_grow(), which can happen
5846 with some compilers (found and fixed by James Bonfield
5847 <jkb@mrc-lmb.cam.ac.uk>).
5849 * src/stackovf.c: Added prototypes for ultrix.
5850 (setup_stackovf_trap): Added __P to cast.
5851 (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
5853 2000-01-09 René Seindal <rene@seindal.dk>
5855 * doc/m4.texinfo (Changequote): Added comment about changing
5856 quotes when the old quote is a part of the new.
5858 * src/builtin.c (expand_ranges): Added break after trailing dash.
5859 This caused misbehavious on some systems (found and fixed by Akim
5860 Demaille <demaille@inf.enst.fr>).
5862 * AUTHORS: Thomas Tanner included
5864 * acconfig.h: Added entry for ss_sp (see below).
5866 * configure.in (use_stackovf): Added check for stack_t with member
5867 ss_base instead of ss_sp (BSDI notably). (Reported by Paul Eggert
5868 <eggert@twinsun.com>).
5870 * doc/m4.texinfo (Frozen files): Added a simpler example for
5871 generating frozen files from several input files.
5873 1999-11-14 Paul Eggert <eggert@twinsun.com>
5875 * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
5876 lib/regex.c, lib/xmalloc.c.
5878 1999-11-10 René Seindal <rene@seindal.dk>
5880 * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
5882 * src/module.c: reindented.
5883 (module_load): return if this is a repeated load of same module.
5884 (module_init): slight change of logic to avoid repeated
5885 initialisation debug messages.
5887 * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
5888 in the distribution.
5890 * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
5891 automake warnings about missing lib prefix.
5892 (time_la_LDFLAGS): ditto
5893 (stdlib_la_LDFLAGS): ditto
5895 1999-11-10 Paul Eggert <eggert@twinsun.com>
5897 * src/m4.h: Include error.h, since our macros use error.
5898 * src/m4.c: Don't need to include error.h.
5900 1999-11-09 Paul Eggert <eggert@twinsun.com>
5902 * src/m4.h (voidstar): Define to void * if __STDC__ is defined
5903 and zero, as Solaris 7 cc does.
5904 (bcopy): Remove macro; no longer needed with new obstack.h.
5906 * src/output.c (freeze_diversions): Don't assume that a
5907 diversion size can fit in `int'. Check for diversion file
5908 size too large to be printed with `unsigned long'.
5910 * src/Makefile.am (CFLAGS): Omit -Wall.
5912 * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
5914 * src/debug.c (trace_format):
5915 Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
5917 * src/freeze.c (produce_frozen_state):
5918 Don't assume string lengths fit in int.
5920 1999-10-13 René Seindal <rene@seindal.dk>
5922 * po/cs.po: Czech translation added.
5924 * po/sv.po: Updated Swedish translation.
5926 * po/ru.po: Updated Russian translation.
5928 * po/pl.po: Updated Polish translation.
5930 * po/el.po: Greek translation added.
5932 1999-10-13 René Seindal <rene@seindal.dk>
5934 * configure.in (ALL_LINGUAS): Added Greek translation (el).
5935 (ALL_LINGUAS): Added Czech translation (cs).
5937 1999-03-30 Gary V. Vaughan <gary@gnu.org>
5939 * src/builtin.c: moved module loading functions into...
5940 * src/module.c: entirely new implementation using libltdl.
5941 * po/POTFILES.in: added src/module.c.
5942 * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
5943 are modules, not linktime libraries.
5944 (LDFLAGS): added -no-undefined -module and -avoid-version flags.
5945 * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
5946 avoidance on exported symbols.
5947 * modules/test.c (m4_macro_table, m4_init_module,
5948 m4_finish_module): ditto.
5949 * modules/time.c (m4_macro_table): ditto.
5951 * modules/time2.m4: new file which requires command line loading
5953 * src/m4.c (--load-module): dynamically load named runtime module
5954 into running executable before reading the source.
5955 (--module-directory): prepend a directory to the module search
5957 (module_init()): Do this the first time we load a module instead;
5958 if the module subsystem is broken normal m4 scripts can still run.
5959 * src/m4.h (install_builtin_table): is now exported.
5961 1999-03-26 Gary V. Vaughan <gary@gnu.org>
5963 * src/module.c: removed. No longer required.
5964 * po/POTFILES.in: removed src/module.c.
5966 * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
5967 the bootstrap script can recreate.
5968 * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
5969 * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
5970 * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
5971 * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
5972 (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
5973 * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
5974 * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
5975 * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
5977 * acinclude.m4: removed. `aclocal -I acm4' handles this much
5979 * acm4/Makefile.am (ACINCLUDE_M4): ditto.
5980 * acm4/gettext.m4: removed. It causes a multiple definition vs.
5981 the installed gettext.m4 file when running aclocal.
5983 1999-03-25 Gary V. Vaughan <gary@gnu.org>
5985 * configure.in (AM_INIT_AUTOMAKE): bumped version number to
5986 distinguish this from the last prerelease.
5987 (AC_LIBLTDL_CONVENIENCE): build libltdl as a convenience library
5988 in its own subdirectory.
5990 * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
5991 lib prefix on a module" feature.
5992 (LDFLAGS): Added `-module -avoid-version' flags to build
5993 versionless module libraries.
5994 * src/builtin.c (m4_load_module): use libltdl.
5995 (module_unload_all): use libltdl.
5996 * src/m4.c (module_init): initialise module loading on demand for
5997 better diagnostics, and so that m4 will still work even if
5998 the module code is broken.
5999 * src/m4.h (module_init): removed. No longer relevant.
6000 * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
6001 exported symbols for compatibility with dlpreopening.
6002 * modules/test.c (m4_macro_table, m4_init_module,
6003 m4_finish_module): ditto.
6004 * modules/time.c (m4_macro_table): ditto.
6006 * bootstrap: New file. Runs all the autoutils in the right order
6007 after a fresh checkout, or a make maintainer-clean.
6009 1999-02-18 Akim Demaille <demaille@inf.enst.fr>
6011 * src/builtin.c (dump_symbols): New function, factoring common
6012 content of m4_dumpdef and m4_symbols.
6013 (m4_dumpdef): Use it.
6014 (m4_symbols): New function, implementing `symbols'. Use it.
6015 * doc/m4.texinfo: Fixed missing commas after @xref, so that the
6016 file compile with modern makeinfo.
6017 (Symbols): New node, documenting symbols.
6018 (direntry): Modernize.
6020 1998-12-11 René Seindal <rene@seindal.dk>
6022 * src/builtin.c (predefined_tab): New predefined macros
6023 __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
6024 configure time options.
6026 1998-12-01 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
6028 * src/module.c (module_try_load): Don't try to be clever and
6029 overwrite argument string. Instead allocate all constructed
6030 strings locally, since they can have arbitrary lengths. Make
6031 arguments pointers to const.
6032 (module_search): Simplify due to above change.
6034 1998-11-29 René Seindal <rene@seindal.dk>
6038 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
6040 * tests/other-tests/import-environment.{m4,test}: New test.
6042 * tests/other-tests/discard-comments.{m4,test}: New test.
6044 * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
6046 * src/m4.c (main): New option -c --discard-comments.
6047 New global variable discard_comments.
6049 * src/m4.h (token_type): New TOKEN_NONE for tokens to be
6050 discarded, ie never returned from next_token().
6051 Added declaration of discard_comments.
6053 * src/input.c (next_token): Now loops until token type is not
6054 TOKEN_NONE. Comments are now given this type when comments should
6057 * doc/m4.texinfo (Invoking m4): Updated for --import-environment
6060 1998-11-28 René Seindal <rene@seindal.dk>
6062 * src/m4.c (main): New option --import-environment (no single
6065 * When configured with --with-gmp both the normal (fast) eval()
6066 and the gmp aware mpeval() are defined. To restore previous
6067 bahaviour use "define(`eval', defn(`mpeval'))".
6069 * tests/other-tests/gmp.m4: Changed to use mpeval().
6071 * src/evalmp.c: New file for compiling eval.c as gmp aware.
6072 Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
6074 * src/eval.c: Now includes "numb.c" directly. Everything in this
6075 file must by static, except evaluate(), which is changed to
6076 mp_evaluate() if USE_GMP in force.
6078 * src/numb.c: Changed to be included by eval.c instead of being
6079 compiled separately. Everything is declared static.
6081 * src/numb.h: Removed declarations of functions, as numb.c is now
6084 * src/builtin.c: Declaration of m4_mpeval() added.
6085 Inserted `mpeval' in builtin table.
6086 (do_eval): New function with common code for m4_eval and m4_mpeval.
6087 (m4_mpeval): New function for gmp version of eval.
6089 * src/m4.h: Declaration of mp_evaluate().
6091 * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
6092 (EXTRA_m4_SOURCES): Now has numb.c and numb.h
6094 * src/m4.c (main): m4 --version also shows which options were used
6095 for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
6097 1998-11-27 René Seindal <rene@seindal.dk>
6099 * Error messages now always print program name before input file
6100 name as specified by GNU coding standards. Reported by Akim
6101 Demaille <demaille@inf.enst.fr>.
6103 * doc/m4.texinfo (Include): Change due to changed error message
6107 * tests/get-them: Minor change to sed script due to changed error
6110 * src/m4.c (print_program_name): New func used to print program
6111 name, input file and line number in error (). Used as an
6112 error_print_progname handler.
6113 (reference_error): Removed.
6114 (main): Assigns error_print_progname.
6116 * src/m4.h (M4ERROR): Removed reference_error ().
6118 1998-11-25 René Seindal <rene@seindal.dk>
6120 * Updated to libtool 1.2b.
6122 * src/builtin.c (install_builtin_table): Added braces to avoid
6123 warning of ambiguous 'else'.
6125 * src/module.c: Inserted search path code from path.c modified to
6127 (module_init): Configured default path used only if M4MODPATH is
6129 (module_try_load): Now reads libMODULE.la as generated by libtool
6130 for actual module name.
6131 (module_load): Gives better error messages on failure.
6133 * src/m4.h: Added declarations of structures and functions for
6134 generic search path handling.
6136 * src/path.c: Removed all module specific code and introduced new
6137 functions of more generic search path handling.
6139 1998-11-24 René Seindal <rene@seindal.dk>
6141 * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
6142 included gettext, as <libintl.h> might not be found
6143 otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
6145 1998-11-22 René Seindal <rene@seindal.dk>
6147 * src/output.c (insert_diversion): Fixed bug that might cause m4
6148 to read from standard output! Triggered by input
6149 'divert(1)undivert(0)'. Test for divnum>0 changed to divnum>=0,
6150 so now 'undivert(0)' does nothing.
6152 1998-11-18 René Seindal <rene@seindal.dk>
6156 * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
6157 could be changed when compiling a illegal regexp, causing later
6158 use of the regexp to dump core.
6160 * src/module.c (module_load): Changed error message to conform to
6163 * src/m4.c (usage): Added message about reporting bugs.
6165 * doc/m4.texinfo (Changeword): Corrected a wrong example.
6166 (Changeword): Added note about the type of regexps used.
6168 * ltconfig, ltmain.sh: New files from Libtool 1.2.
6170 * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
6171 and AM_PROG_LIBTOOL.
6173 * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
6176 * modules/Makefile.am: Changed completely to compile modules using
6177 libtool. The modules are compiled as shared libraries, and are
6178 renamed when installed.
6180 * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
6181 USE_SHL_LOAD to HAVE_SHL_LOAD
6183 * src/builtin.c (shipout_string): Now tests for a NULL string.
6185 * src/module.c: New level of indirection around non-portable
6186 functions to load shared objects. Intended to encapsulate the non
6187 portable parts better and to reduce the number of #ifdefs in the
6190 * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
6191 directory modules/ to the distribution.
6193 1998-11-15 René Seindal <rene@seindal.dk>
6197 * modules/stdlib.c: New module `stdlib' defining some standard
6198 functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
6199 getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
6201 * src/builtin.c (shipout_string): New convenience function for
6202 builtins and modules.
6204 * src/module.c (module_load): Tentative support for
6205 shl_load/shl_findsym, but I cannot test it. Copied from MetaHTML.
6207 * Makefile.am (SUBDIRS): Directory modules added if configured.
6209 * modules/Makefile.am: Now correctly compiles and installs
6210 modules in pkglibexecdir.
6212 * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
6213 These two are now initialised by autoconf macros.
6215 * src/path.c (module_env_init): MODULE_PATH is always on the
6218 * src/Makefile.am: Now generated pathconf.h which defined the
6219 default MODULE_PATH.
6221 * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
6222 where modules are installed.
6224 * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
6225 by Brian J. Fox <bfox@datawave.net>. This change allow modules to
6226 build and install automatically, and it is prepared for other
6227 interfacec than dlopen().
6229 * src/builtin.c (predefined_tab): Added __m4_version__ for the
6230 current version of GNU m4. It is a GNU extension.
6232 1998-11-14 René Seindal <rene@seindal.dk>
6234 * tests/Makefile.am (GENERATED_TESTS): Added new
6235 generated-tests/changesy.8.test
6237 * doc/m4.texinfo (Changesyntax): Documentation for escape
6240 * src/macro.c (expand_token): Check for escaped macro call before
6241 symbol table lookup.
6243 * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
6246 * src/input.c: New static variable use_macro_escape, which is TRUE
6247 iff some character has code SYNTAX_ESCAPE
6248 (input_init): Added initialisation of use_macro_escape.
6249 (check_use_macro_escape): New function to synchronise
6250 use_macro_escape with the syntax table.
6251 (set_quotes): Added call to check_use_macro_escape()
6254 (next_token): Added new case for IS_ESCAPE.
6256 * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
6258 1998-10-13 René Seindal <rene@seindal.dk>
6262 * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
6265 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
6266 maintained tests in tests/other-tests. These currently tests for
6267 8-bit transparency, multiple precision arithmetic and sync-line
6268 output. Test for stackoverflow detection does not work.
6270 * examples/Makefile.am (TESTS): Added tests for all example files.
6272 * examples/mktests.sh: New file. Help program for creating test
6275 * tests/mkconfig.sh: New file to generate tests/config.m4 and
6276 tests/config.sh. This is for tests of configure selectable
6277 features. Picks up all set WITH_ and ENABLE_ veriables from
6280 * src/path.c (path_search): Added argument 'char **expanded_name'
6281 to return the expanded name.
6283 * src/m4.h: Added 2nd argument to declaration of path_search().
6285 * src/m4.c (main): Added 2nd argument to path_search().
6287 * src/freeze.c (reload_frozen_state): Do.
6289 * src/builtin.c (m4_undivert): Do.
6292 1998-10-11 René Seindal <rene@seindal.dk>
6294 * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
6296 * acm4/modules.m4: New file. Defines AM_WITH_MODULES.
6298 * acm4/gmp.m4: New file. Defines AM_WITH_GMP.
6300 * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
6302 * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
6304 * intl/: Updated to GNU gettext 0.10.35.
6306 * doc/m4.texinfo (Format): Documented that format is blind.
6308 * src/builtin.c (builtin_tab): Builtin format marked as blind.
6310 1998-10-07 René Seindal <rene@seindal.dk>
6314 * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
6315 .test, as the files are no longer just m4 input.
6317 * tests/get-them (FILE): Changed .m4 extension to .test.
6319 * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
6320 Otherwise quoted strings with leading whitespace first in a macro
6321 argument would be eliminated.
6323 * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
6324 (expand_argument): Do.
6326 * src/input.c (next_token): SPACE and NUM/OTHER characters are only
6327 grouped together iff both quote and comment strings are single
6328 character. Otherwise they might include a comment/quote leader.
6329 (next_token): Returns new token type TOKEN_SPACE.
6331 * src/builtin.c (push_builtin_table): New function to push a
6332 builtin_table on the stack without installing its contents.
6333 (find_builtin_by_name): Added call to push_builtin_table() if
6334 reading frozen files. Otherwise the builtins named in the frozen
6335 files could not be found.
6336 (install_builtin_table): Changed to use push_builtin_table()
6338 1998-10-04 René Seindal <rene@seindal.dk>
6340 * po/pl.po: Polish translation added.
6342 * po/POTFILES.in: src/module.c added.
6344 1998-10-04 René Seindal <rene@seindal.dk>
6348 * configure.in (ALL_LINGUAS): Added Polish pl.po
6350 1998-10-03 René Seindal <rene@seindal.dk>
6352 * Many files: Incorporated changes to implement dynamic modules.
6353 Detailed comments in src/modules.c and modules/README
6355 * src/module.c: New file, implements the OS dependant parts of
6356 dynamic module loading.
6358 * src/Makefile.am (m4_SOURCES): Added module.c
6360 * src/builtin.h: New file, declares some functions from builtin.c
6361 that are of use for other modules (shipout_int, numeric_arg,
6362 skip_space, bad_argc), and the macros ARG() and DECLARE().
6364 * src/builtin.c (install_builtin_table): New function. Each
6365 module brings in a builtin_table, which is pushed on a stack.
6366 (struct builtin_table): New struct for list of builtin_tables.
6367 (m4_loadmodule): New function to implement builtin "loadmodule".
6368 (shipout_int): No longer static, to be used by modules.
6372 (builtin_init): changed to call install_builtin_table()
6373 (find_builtin_by_name): Now searches all builtin_tables
6374 (find_builtin_by_addr): do.
6376 * src/path.c: Reorganised to allow for two search paths, one for
6377 include files and one for modules.
6379 * src/m4.h: Added declarations for new functions in module.c and
6382 * src/m4.c (main): Added call to module_init().
6384 * modules: New directory with a few demo modules.
6386 * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
6389 * configure.in: Added modules/Makefile to AC_OUTPUT.
6391 * configure.in: Added code to implement --with-modules. Tests for
6394 * acconfig.h: Added WITH_MODULES
6396 1998-10-02 René Seindal <rene@seindal.dk>
6398 * examples/Makefile.am (pkgdata_DATA): Removed special target for
6399 check and variables TESTS. These tests are now run from the
6402 * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
6403 directory. The files stay there but the tests are run from the
6406 * tests/Makefile.am (EXTRA_DIST): Added run-test.
6408 * tests/run-test: New file. Run a test manually
6410 * tests/Makefile.am, tests/get_them: Moved automatically generated
6411 tests (from the manual) to sub directory tests/gentest/. The
6412 tests/ directory had gotten a bit messy.
6414 1998-09-06 Erick Branderhorst <Erick.Branderhorst@asml.nl>
6416 * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
6417 wrap}.test: Added a few testcases.
6419 1998-08-21 Erick Branderhorst <Erick.Branderhorst@asml.nl>
6423 * lib/Makefile.am (noinst_HEADERS): regex.h added
6425 * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
6426 acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
6428 * acm4/Makefile.am: created providing rules to create
6429 $(top_srcdir)/acinclude.m4 to be used by aclocal.
6431 * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
6432 `C'. Reported by Ulrich Drepper.
6434 * Makefile.am (SUBDIRS): Removed checks directory
6435 * configure.in (AC_OUTPUT): Removed checks/Makefile
6437 * doc/m4.texinfo (Patsubst,example): @comment added to preserve
6438 the space when m4.texinfo is edited and whitespace.el is active.
6439 (Defn,example): idem.
6441 1998-08-20 Erick Branderhorst <Erick.Branderhorst@asml.nl>
6443 * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
6444 ../COPYING. ../Makefile is a file which is certainly present when
6445 test is executed in testSubDir. One can't be sure that the COPYING
6446 file is in .. or ../.. in all situations, the ../Makefile is
6449 * doc/m4.texinfo (Include): adjusted expected test output
6450 according to new tests, i.e. the input will always come from the
6451 file `in' created by the test.
6453 * tests/Makefile.am: Added three lines at the top to get
6454 esyscmd.1.test working.
6456 * tests/get-them: modified to generate clearer tests who will need
6457 less maintenance when new test examples are created in
6458 `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
6459 need the generic file `defs') shell scripts creating `in', `ok',
6460 `out' and when apropriate `okerr' and `err' in the directory
6461 `testSubDir' when executed. The compare of `ok' and `out'
6462 (and of `okerr' and `err') will be the exit status of the test.
6463 `out' must match `ok' (and `okerr' must match `err') for the test
6466 * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
6467 the tests generated by tests/get-them getting it input normally
6468 from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
6469 (dot) before the numeric part) is reserved for all other (hand
6470 written) tests. The `+' means one or more times.
6472 1998-08-12 Erick Branderhorst <Erick.Branderhorst@asml.nl>
6474 * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
6475 supported short man page to refer to info documentation
6476 * helptoman.pl: added
6477 * configure.in: AC_PATH_PROG(PERL,perl)
6478 * Makefile.am (SUBDIRS): doc after src
6480 * libitized with libit 0.5 from
6481 ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
6483 * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
6484 * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
6485 replacement functions, (libm4_a_LIBADD): @LIBOBJS@
6486 * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
6488 * configure.in (AC_CHECK_FUNC): getopt_long
6490 * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
6492 * TODO: added entry about dependencies
6494 1998-08-10 René Seindal <rene@seindal.dk>
6498 * doc/m4.texinfo (Changesyntax): Added documentation for the macro
6501 * src/builtin.c (m4_changesyntax): Added builtin macro
6502 "changesyntax" to modify the syntax table.
6504 * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
6505 table. All categories are assigned a syntax code and tokens are
6506 read according to this table.
6508 1998-08-09 René Seindal <rene@seindal.dk>
6510 * src/numb.{c,h}: New files, implements multiple precision eval
6511 using GNU gmp. Originally submitted by John Gerard Makecki
6512 (johnm@vlibs.com), later modified. Tested with GNU gmp 2.0.2.
6514 * doc/m4.texinfo (Eval): Added documentation for multiple
6515 precision arithmetic library support.
6517 * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
6518 to accommodate multiple precision eval.
6520 1998-08-07 René Seindal <rene@seindal.dk>
6522 * src/input.c (MATCH, match_input), src/m4.h: changed definition
6523 of comment and quote strings to `unsigned int' to allow eight bit
6524 chars (reported by andrewb@zip.com.au (Andrew Bettison)).
6526 * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
6527 patch from Mike Howard <mike@clove.com>
6529 1998-08-06 René Seindal <rene@seindal.dk>
6531 * gettext.m4: corrected AM_WITH_NLS to handle use of installed
6534 1998-08-03 René Seindal <rene@seindal.dk>
6538 * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
6539 and _ macro. M4 now builds with --disable-nls.
6541 * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
6542 to look for right message catalogs. Call indef'ed by ENABLE_NLS.
6544 * configure.in (ALL_LINGUAS): Added complete list of translations:
6545 de fr it ja nl ru sv.
6547 1998-05-23 Erick Branderhorst <Erick.Branderhorst@asml.nl>
6549 * po/nl.po: Dutch translation by Erick Branderhorst.
6551 * po/fr.po: French translation by Erick Branderhorst, based on the
6552 translations by François Pinard in fr.msg and m4.cod.
6554 1998-05-22 Erick Branderhorst <Erick.Branderhorst@asml.nl>
6558 * src/m4.c: #include <signal.h> not <sys/signal.h>.
6560 * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
6562 * checks/Makefile.am: explicit list tests in CHECKS.
6564 * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
6565 src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
6566 mkinstalldirs, install-sh: Added automake (1.3) support.
6568 * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
6569 obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
6570 Used libitize (0.4) to update.
6572 * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
6573 (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
6576 * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
6577 stack overflow functionality.
6579 1994-12-03 François Pinard <pinard@iro.umontreal.ca>
6583 * Makefile.in (realclean-local): Delete stamp-h.in.
6585 * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
6586 Localize, adapting from how it is done in sharutils.
6588 * fr.tt: New file, for French.
6590 * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
6591 src/freeze.c: Rename PRODUCT to PACKAGE.
6593 1994-11-26 François Pinard <pinard@iro.umontreal.ca>
6595 * configure.in: Check for <libintl.h> and <locale.h>.
6596 * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
6597 src/stackovf.c: Rename _ to __P.
6598 * src/m4.h: Declare _ as a macro returning its argument, or else,
6599 include <libintl.h> and declare _ as gettext.
6600 * src/m4.c: Possibly include <locale.h> and call setlocale.
6601 * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
6602 src/input.c, src/macro.c, src/output.c, src/path.c,
6603 src/stackovf.c, src/symtab.c: Use _ macro over all localizable
6606 1994-11-07 François Pinard <pinard@iro.umontreal.ca>
6608 * doc/Makefile.in (stamp-vti): Use new -r option to date.
6610 * configure.in: Put --with-gmp in place, in prevision for John
6612 * acconfig.h: Document WITH_GMP.
6614 1994-11-05 François Pinard <pinard@iro.umontreal.ca>
6618 * doc/Makefile.in (realclean): Also remove stamp-vti.
6619 Reported by Eric Backus.
6621 1994-11-02 François Pinard <pinard@iro.umontreal.ca>
6623 * src/freeze.c (produce_frozen_state): If the frozen file cannot
6624 be opened, return immediately after producing the error message.
6625 Reported by Andreas Schwab.
6627 * configure.in: Check for const only after having found possible
6628 ANSIfying compiler flags, this is of no use to check it before.
6629 Reported by Alexander Lehmann.
6631 1994-11-01 François Pinard <pinard@iro.umontreal.ca>
6633 * src/macro.c (collect_arguments): Cast obstack arguments to
6634 (voidstar), so avoiding compiler warnings.
6635 Reported by Joseph E. Sacco.
6637 * src/freeze.c (produce_frozen_state): Cast printed lengths to
6638 (int) so they correspond to %d format items.
6639 Reported by Joseph E. Sacco.
6641 * src/m4.c (main): Cast the argument to xfree to (voidstar).
6642 * src/symtab.c (free_symbol): Idem.
6643 Reported by Karl Vogel.
6645 1994-10-31 François Pinard <pinard@iro.umontreal.ca>
6647 * Makefile.in (DISTFILES): Distribute BACKLOG.
6649 * configure.in: Define PRODUCT and VERSION.
6650 * acconfig.h: Document PRODUCT and VERSION.
6651 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
6652 constant string m4 and variable or parameter named version.
6654 1994-10-30 François Pinard <pinard@iro.umontreal.ca>
6656 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
6657 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
6658 defines __STDC__ to 0, for indicating it is *not* ANSI!
6659 Reported by Kaveh R. Ghazi.
6661 * configure.in: Added obsolescent tests for AIX and Minix.
6663 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
6664 which texclean does not exist anymore.
6665 Reported by Eric Backus, Jim Meyering, John David Anglin and
6668 1994-10-29 François Pinard <pinard@iro.umontreal.ca>
6670 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
6671 Reported by John David Anglin.
6673 * src/ansi2knr.c: New version, sent by Peter Deutsch.
6674 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
6675 ANSI2KNR, depending on the fact the compiler is ANSI or not.
6676 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
6677 Remove the sed filter after ansi2knr for debug.c. Use $O instead
6678 of $U, put underline in extensions rather than in basenames. Use
6679 implicit rules, now that regularity makes this possible.
6680 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
6681 of ansi2knr whenever it is needed.
6682 * configure.in: Adjusted for correct STACKOVF substitution.
6683 * src/debug.c (trace_format): When not __STDC__, use (...) as a
6684 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
6685 Reported by David MacKenzie.
6687 * Makefile.in: Remove binprefix. Use transform_name instead.
6688 Reported by David MacKenzie.
6690 * doc/Makefile.in: Create version.texi, use it, clean it.
6691 Reported by Jim Meyering.
6693 1994-10-28 François Pinard <pinard@iro.umontreal.ca>
6695 * Makefile.in (all, install, uninstall): Depend on Makefile.
6697 * Makefile.in: For actions invoking $(MAKE) from within compound
6698 sh statements, exit non-zero if the sub-make fails. Otherwise,
6699 the top-level make may exit successfully when it should fail.
6700 Reported by Jim Kingdon.
6702 * {,/*}Makefile.in: Use && after all cd, in case they fail.
6704 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
6705 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
6706 * configure.in: Substitute PRODUCT and VERSION.
6708 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
6710 1994-10-27 François Pinard <pinard@iro.umontreal.ca>
6712 * Makefile.in (mostlyclean-local): Do not remove *~.
6713 * */Makefile.in (mostlyclean): Idem.
6714 Reported by Robert E. Brown and Richard Stallman.
6716 1994-10-09 François Pinard <pinard@iro.umontreal.ca>
6718 * src/m4.h: Get rid of CONFIG_BROKETS.
6720 1994-10-02 François Pinard <pinard@iro.umontreal.ca>
6722 * configure.in: Use AC_ARG_PROGRAM.
6723 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
6724 Reported by David MacKenzie.
6726 1994-10-01 François Pinard <pinard@iro.umontreal.ca>
6728 * configure.in: Do not add -O to CFLAGS for GNU C, now that
6729 configure does it automatically.
6730 Reported by Jim Meyering.
6732 1994-09-23 François Pinard <pinard@iro.umontreal.ca>
6734 * src/stackovf.c: Declare the handler_t typedef earlier in the
6735 code, use it for stackovf_handler.
6736 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
6737 casting sigsegv_handler.
6738 Reported by Robert Bernstein.
6740 * src/m4.c (main): Initialize program_name to argv[0] without
6742 Reported by Karl Berry.
6744 1994-09-18 François Pinard <pinard@iro.umontreal.ca>
6746 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
6747 Reported by Karl Berry.
6749 1994-09-14 François Pinard <pinard@iro.umontreal.ca>
6751 * lib/Makefile.in (mostlyclean): Added.
6752 (TAGS): Make in $(srcdir).
6754 * configure.in: Use `choke me' in test, like everywhere!
6756 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
6757 unreacheable and useless.
6759 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
6761 * lib/Makefile.in (DISTFILES): Distribute TAGS.
6762 (distclean): Do not remove TAGS.
6763 (realclean): Remove it.
6764 * Makefile.in: Make TAGS in lib also, not just in src.
6765 Reported by Karl Berry.
6767 * Makefile.in (distclean, realclean): Instead of recursively
6768 calling $(MAKE) for the -local part, allow parallel execution of
6769 -recursive and -local, only delay the removal of config.status,
6770 which is repeated in both goals.
6772 1994-09-13 François Pinard <pinard@iro.umontreal.ca>
6776 * Makefile.in: Group all *clean-recursive goals in one, using sed
6777 to remove `-recursive' while calling make recursively. Also, use
6778 a subshell for each recursive $(MAKE).
6779 Reported by Jim Meyering.
6781 * src/m4.h (memcpy): Define with bcopy for BSD systems.
6782 Reported by Kaveh R. Ghazi.
6784 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
6785 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
6788 * configure.in: Use date instead of touch for stamp-h.
6789 * Makefile.in (stamp-h.in): Idem.
6791 * Makefile.in (distclean, realclean): Force serial execution of
6792 both goals, in case parallel makes are being used.
6793 Reported by Jim Meyering.
6795 * src/Makefile.in (DISTFILES): Distribute TAGS.
6796 (distclean): Do not remove TAGS.
6797 (realclean): Remove it.
6798 Reported by Karl Berry.
6800 1994-09-10 François Pinard <pinard@iro.umontreal.ca>
6802 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
6803 to old names, for following Autoconf.
6805 1994-09-08 François Pinard <pinard@iro.umontreal.ca>
6807 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
6808 ./install.sh will not be correctly referred to in sub-Makefiles.
6809 Reported by John David Anglin.
6811 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
6812 Reported by Eric Backus.
6814 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
6815 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
6816 config.status into remaking this directory's Makefile only.
6817 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
6818 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
6819 Reported by Jim Meyering.
6821 1994-09-06 François Pinard <pinard@iro.umontreal.ca>
6823 * configure.in: Correct stack overflow detection logic, taking
6824 care of systems having only incomplete implementations (like for
6825 Pyramid 9820 OSx 5.0d).
6826 Reported by Kaveh R. Ghazi.
6828 * src/Makefile.in (TAGS): Remote -t from etags call.
6830 1994-09-02 François Pinard <pinard@iro.umontreal.ca>
6832 * lib/Makefile.in (install): Depend on all.
6834 1994-08-31 François Pinard <pinard@iro.umontreal.ca>
6836 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
6837 Reported by Jim Meyering and John David Anglin.
6839 * Makefile.in (distclean-local): Delete config.log.
6840 Reported by Jim Meyering.
6842 Solidify frozen files with respect to -P:
6843 * src/m4.c: Have -P set prefix_all_buitins variable instead of
6844 calling a function by that name. Declare the variable.
6845 * src/m4.h: Adjust declaration for prefix_all_buitins.
6846 * src/builtin.c (builtin_init): Merge in functionality from
6847 previous prefix_all_buitins function, while making entries in the
6848 symbol table, but not modifying the builtin description itself.
6850 * src/freeze.c (reload_frozen_state): Add a useless `break;',
6851 because *many* compilers do not accept an empty `default:'.
6852 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
6853 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
6855 * configure.in: Use AC_TYPE_SIGNAL.
6856 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
6857 Reported by Robert Bernstein.
6859 * checks/Makefile.in (check): Modify PATH so check-them will find
6860 m4 in the src directory.
6861 * Makefile.in (check): Don't.
6862 Reported by Akiko Matsushita and Jim Meyering.
6864 * src/output.c (make_room_for, output_character_helper): New
6865 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
6866 a per buffer MAXIMUM_BUFFER_SIZE.
6868 * src/output.c (output_text): New function, for optimizing the
6869 output of strings of characters. Use it.
6871 1994-08-30 François Pinard <pinard@iro.umontreal.ca>
6873 * doc, src: New directories reorganizing the distribution.
6874 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
6876 * Makefile.in: Adjusted.
6877 * configure.in: Configure new Makefiles.
6879 * m4.h: Declare STRING typedef. Use it for comment and quote
6880 strings, adjusting all references. (This is the rudiments of a
6881 beginning for the eventual withdrawal of NUL terminated strings.)
6882 * output.c (shipout_text): Accept a length parameter, and use it.
6883 All callers adjusted.
6885 1994-08-29 François Pinard <pinard@iro.umontreal.ca>
6887 * m4.h: Include <unistd.h> if it exists.
6888 * stackovf.c: Don't.
6890 Clean up for current_diversion variable:
6891 * output.c: Move current_diversion from builtin.c.
6892 * m4.h: Declare current_diversion so builtin.c can access it.
6893 * output.c (output_init, make_diversion): Initialize or update
6895 * builtin.c (builtin_init, m4_divert): Leave current_diversion
6898 Remove limit on number of diversions:
6899 * output.c: Replace ndiversion by diversions, declare it.
6900 (output_init): Allocate only diversion 0.
6901 (make_diversion): Allocate new diversions as needed.
6902 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
6903 * m4.c: Still accept -N, but do nothing with it.
6904 Reported by David MacKenzie.
6907 * output.c (freeze_diversions): New function.
6908 * m4.h: Declare freeze_diversions.
6909 * freeze.c: Document frozen file format, revise it, call
6910 freeze_diversions to add diversions to frozen format, and code to
6911 reload them properly.
6912 * m4.c: Do not undivert automatically at end when status being
6913 frozen. Do not call builtin_init when reloading frozen state.
6915 Speed up diversion processing:
6916 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
6917 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
6918 structure and variables, cached variables out of output_diversion,
6919 reallocate_diversion_for and OUTPUT_CHARACTER.
6920 (shipout_text, make_diversion, insert_diversion): Adapted to new
6922 (insert_file): Use better buffering.
6923 Reported by David MacKenzie.
6925 1994-08-28 François Pinard <pinard@iro.umontreal.ca>
6927 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
6928 dist works from another build directory.
6930 1994-08-27 François Pinard <pinard@iro.umontreal.ca>
6932 * symtab.c (hack_all_symbols): Use hash_table_size instead of
6933 constant HASHMAX, for -H option to work better.
6935 * builtin.c (DECLARE): Simplify by using _ ().
6937 * freeze.c: New file.
6938 * Makefile.in: Compile it, distribute it.
6939 * m4.c: Recognize, document and process --freeze-state (-F) and
6940 --reload-state (-R) options. Pass a true flag to builtin_init
6941 only if no reloading some state.
6942 * builtin.c (define_builtin): Remove static specifier.
6943 (find_builtin_by_name): Remove static specifier.
6944 (builtin_init): Accept and obey a flag argument.
6945 * m4.h: Add declarations for freeze.c, changes for builtin.c.
6947 1994-08-24 François Pinard <pinard@iro.umontreal.ca>
6949 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
6952 * configure.in: Implement --with-dmalloc.
6953 * acconfig.h: Document WITH_DMALLOC.
6954 * m4.h: Add code for when WITH_DMALLOC.
6956 1994-08-15 François Pinard <pinard@iro.umontreal.ca>
6958 * m4.c (long_options): Use "error-output", the dash was missing.
6959 Reported by Akiko Matsushita.
6961 1994-08-12 François Pinard <pinard@iro.umontreal.ca>
6963 * m4.h: Include <sys/types.h>.
6964 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
6965 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
6967 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
6969 * builtin.c (dump_args): Declare len as size_t, not int.
6971 * debug.c: Prototype the forward declaration of debug_set_file.
6973 * builtin.c (m4_undivert): Replace div by file, for avoiding the
6974 shadowing of this variable.
6975 * output.c (insert_diversion): Idem.
6977 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
6978 (input_init): Duplicate default quote and comment strings.
6979 (set_quotes): Free previous quote strings in all cases. Duplicate
6980 even default quote strings.
6981 (set_comment): Free previous comment strings in all cases.
6982 Duplicate even default comment strings.
6984 * configure.in: Updated for Autoconf 2.0.
6985 * Makefile.in (distclean-local): Also delete config.cache.
6987 * m4.c (usage): Reorganize the --help output by topic. Include a
6988 description for debugging flags.
6990 1994-07-29 François Pinard <pinard@iro.umontreal.ca>
6992 * configure.in: If sigaction is available and SA_ONSTACK defined,
6993 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
6994 defined, use sigvec. Else don't compile stackovf.c.
6995 * stackovf.c (setup_stackovf_trap): Idem.
6996 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
6999 1994-07-21 François Pinard <pinard@iro.umontreal.ca>
7001 * m4.c (usage): Replace printf par fputs.
7003 1994-07-18 François Pinard <pinard@iro.umontreal.ca>
7007 1994-07-17 François Pinard <pinard@iro.umontreal.ca>
7009 * configure.in: Check for sigaction and sigvec. Add a new delayed
7010 check for RLIMIT_STACK, combine in the checking for getrlimit.
7011 All those things are not universally available.
7012 * stackovf.c: Split setting up the trap handler and catching
7013 signals, for better taking care of various configure outcomes.
7014 * examples/stackovf.sh: Correct a typo.
7015 Reported by Eric Backus, Jim Avera and Jim Meyering.
7017 1994-07-16 François Pinard <pinard@iro.umontreal.ca>
7019 * ansi2knr.c: New version sent by its author, Peter Deutsch.
7021 1994-07-15 François Pinard <pinard@iro.umontreal.ca>
7023 * Makefile.in: Modify so parallel make will not try making
7024 lib/libm4.a twice simultaneously.
7025 Reported by Jim Meyering.
7027 1994-07-14 François Pinard <pinard@iro.umontreal.ca>
7029 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
7030 error message, for when no code possibility exists. Even if this
7031 line is completely #ifdef'ed out, it brings a syntax error.
7032 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
7034 * Makefile.in (install): Have install depend on all too, for lib
7035 to be remade as needed.
7037 * examples/stackovf.sh: Try ksh, bsh and bash for shells
7038 providing ulimit, instead of using only ksh.
7039 Reported by Jim Avera and Joseph E. Sacco.
7041 1994-07-12 François Pinard <pinard@iro.umontreal.ca>
7043 * Makefile.in (check): Have it depend on all instead of m4. In
7044 this way, a change in lib will be detected and processed.
7046 * builtin.c (numeric_arg): Use strtol and verify the conversion,
7047 instead of using sscanf which stops as soon as there is a
7048 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
7049 and divert(1xyzzy) were all accepted without any warning or error
7051 * m4.h: Declare strtol as long if not including stdlib.h.
7052 * configure.in: Check for limits.h, and replace strtol if missing.
7053 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
7054 * lib/strtol.c: New file, from elsewhere.
7055 Reported by Andreas Schwab.
7057 1994-07-07 François Pinard <pinard@iro.umontreal.ca>
7059 * macro.c (expand_macro): Cast value to (boolean) prior to
7060 assigning it to traced.
7061 Reported by Tom McConnell.
7063 * Makefile.in (m4): Always make all in lib first.
7064 Reported by Jim Meyering.
7066 1994-07-06 Jim Avera <jima@netcom.com>
7068 * stackovf.c: Isolated OS-dependent sections; Improved portability,
7069 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
7070 handlers), and a default error message if the fault address is not
7071 available (when neither siginfo.h nor BSD sigcontext are supported).
7072 * configure.in: Changes for stackovf.h: Check for sigcontext,
7073 sigaction, sigstack, and define rlim_t as int if necessary.
7074 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
7075 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
7076 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
7078 1994-07-05 François Pinard <pinard@iro.umontreal.ca>
7080 * configure.in: Use AC_SET_MAKE.
7081 * Makefile.in: Use @SET_MAKE@.
7082 Reported by Jim Meyering.
7084 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
7085 Reported by Ian Taylor.
7087 1994-07-02 François Pinard <pinard@iro.umontreal.ca>
7089 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
7090 because siginfo.h is unrelated to standard headers, and siginfo.h
7091 is already checked for.
7092 Reported by Joseph E. Sacco.
7094 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
7096 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
7099 1994-06-29 François Pinard <pinard@iro.umontreal.ca>
7101 * builtin.c (substitute): Use \& to represent this part of the
7102 string which was matched by the whole regexp, instead of
7103 representing the whole string. Any usage of \0 issues a warning
7104 and acts like \&, it will disappear in some subsequent release.
7106 1994-06-27 François Pinard <pinard@iro.umontreal.ca>
7108 * m4.c: Complete prototype for forwarded declaration of usage.
7110 * input.c (init_macro_token): Correct own reference in error
7111 message. Previous name get_macro_func was referred to instead.
7112 (next_char): Correct own reference in error message. Previous
7113 name advance_input was referred to instead.
7115 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
7116 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
7117 and_term, not_term, logical_not_term, cmp_term, shift_term,
7118 add_term, mult_term, exp_term, unary_term, simple_term): Add
7119 prototype to forwarded declarations. Declare parameter v1 as
7120 eval_t * instead of int *. Same for local variable v2 in dyadic
7121 functions. Same for result in exp_term.
7122 * builtin.c (m4_eval): Declare value as eval_t instead of int.
7123 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
7124 unsigned_eval_t instead of unsigned int. Change casts accordingly.
7125 (shipout_int): Cast first argument of ntoa to eval_t.
7126 Reported by Thorsten Ohl.
7128 * macro.c: Complete the prototypes of forwarded expand_macro and
7130 Reported by Thorsten Ohl.
7132 * m4.h: Define voidstar as void * or char * depending on __STDC__.
7133 The Ultrix 3.1 compiler cannot do much with void pointers.
7135 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
7136 * m4.c (xfree): Replace void * by voidstar.
7137 Reported by Tom McConnell.
7139 * ansi2knr.1: New, from elsewhere.
7140 * Makefile.in (DISTFILES): Distribute ansi2knr.1
7142 * Makefile.in (stamp-h.in): Avoid running ./config.status if
7143 stamp-h does not exist yet. This avoids running it a second time
7144 just after the initial ./configure.
7145 Reported by David MacKenzie and Tom McConnell.
7147 * m4.h: Replace the enum debug_info declaration with a series of
7148 #define's. The Ultrix 3.1 compiler would otherwise need casting
7149 (int) to most references, when used in expressions.
7150 Reported by Tom McConnell.
7152 1994-06-25 François Pinard <pinard@iro.umontreal.ca>
7154 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
7155 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
7156 calls the compiler. Previously, FP_PROTOTYPES was only calling
7157 the preprocessor; by not being subject to CFLAGS, this was
7158 discouraging those flags asking for ANSI compilation.
7159 * acconfig.h: Document HAVE_PROTOTYPES.
7160 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
7161 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
7162 Reported by Eric Backus.
7164 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
7165 from the environment. Default CFLAGS to -g if not set.
7166 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
7167 * lib/Makefile.in: Have CFLAGS substituted from configure.
7168 Reported by Eric Backus and Tom McConnell.
7170 * configure.in: m4_undefine changeword before using AC_ENABLE.
7172 * m4.h: Declare prototypes for error (for ANSI compilers only),
7173 prefix_all_builtins and reference_error.
7174 Reported by Tom McConnell.
7176 * input.c (set_word_regexp): Do not try to initialize the array
7177 test from a string, this does not work with non-ANSI compilers.
7178 Reported by Eric Backus.
7180 * Makefile.in (dist): Clean examples/ before saving it.
7181 (distclean-local): Also remove stamp-h.
7182 Reported by Eric Backus.
7184 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
7186 Reported by Tom McConnell.
7188 * checks/Makefile.in (clean): Depends on mostlyclean.
7189 (mostlyclean): New goal.
7191 1994-06-24 François Pinard <pinard@iro.umontreal.ca>
7193 * Makefile.in (DISTFILES): Distribute install.sh.
7194 * install.sh: New file, copied from elsewhere.
7195 Reported by Assar Westerlund and Kaveh R. Ghazi.
7197 1994-06-23 François Pinard <pinard@iro.umontreal.ca>
7199 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
7200 * acconfig.h: Explain ENABLE_CHANGEWORD.
7202 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
7203 from code provided by Pete Chown]
7204 * m4.h: Add original_text field to u_t variant of union u.
7205 Declare TOKEN_DATA_FUNC macro.
7206 * builtin.c: Declare changeword.
7207 (m4_changeword): New function.
7208 * input.c: Include "regex.h", define variables with word regexps.
7209 (input_init): Initialize the word regexp.
7210 (set_word_regexp): New.
7211 (next_token): Declare local variables, use the previous code if
7212 default_word_regexp is true. Else, match using a new code. Save
7214 * macro.c (expand_token): Ship out original text if not a macro
7216 Reported by Krste Asanovic and Pete Chown.
7218 [These modifs all depend upon ENABLE_CHANGEWORD]
7219 * m4.h: Declare external user_word_regexp.
7220 * m4.c: Declare user_word_regexp, and initialize it from
7221 --word-regexp or -W, or NULL if not specified.
7222 * input.c: Use user_word_regexp if specified, instead of
7223 DEFAULT_WORD_REGEXP.
7225 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
7228 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
7229 * checks/Makefile.in: Empty the suffix list.
7230 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
7232 * m4.c: Declare nesting_limit and initialize it to 250.
7233 Implement -LNUMBER or --nesting-limit=NUMBER to change its
7235 * m4.h: Declare nesting_limit as external.
7236 * macro.c (expand_macro): Stop execution whenever nesting limit
7238 Reported by Bengt Mertensson.
7240 * eval.c (evaluate): Diagnose excess characters in eval input.
7241 Things like `eval(08)' used to return 0 with no diagnostic.
7243 * m4.h: Capitalize first letter of all macro arguments in
7246 * m4.c: Declare warning_status, initialize it to 0. Add new
7247 option -E, or --fatal-warnings, which sets warning_status to
7248 EXIT_FAILURE instead.
7249 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
7250 EXIT_FAILURE if not otherwise done by header files.
7251 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
7252 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
7253 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
7254 argument of all M4ERROR calls.
7255 Reported by Noah Friedman.
7257 * examples/incl-test.m4: Renamed from incl_test.m4.
7258 * examples/include.m4: Include incl-test.m4 instead of
7260 * examples/multiquotes.m4: Renamed from multi-quotes.m.
7262 1994-06-22 François Pinard <pinard@iro.umontreal.ca>
7264 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
7265 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
7266 also tested it on a Sun Sparc workstation running SunOS 4.x.
7268 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
7269 49.format check, abusing a `union values' argument with sprintf
7270 without selecting the proper field. Now, save the formatting type
7271 first, delaying the fetch of the corresponding argument.
7272 Reported by Joseph E. Sacco and Tom Quinn.
7274 * format.c (format): Remove const from char *fmt declaration when
7275 not HAVE_EFGCVT, because a NUL may be forced into it.
7277 * m4.h: Declare atof() when not STDC_HEADERS.
7278 Reported by Joseph E. Sacco.
7280 * Regenerate configure using Autoconf 1.11, this corrects a
7281 problem about an incorrect cpp seting on NeXT 3.1.
7282 Reported by Alexander Lehmann.
7284 1994-06-05 François Pinard <pinard@iro.umontreal.ca>
7286 * m4.h (_): Change argument from `x' to `Args'.
7288 1994-04-22 François Pinard <pinard@iro.umontreal.ca>
7290 * m4.h: Rename Args() to _().
7291 * m4.h: Remove extern specifier from all function declarations.
7293 1994-04-22 Jim Avera <jima@netcom.com>
7295 * stackovf.c: New file implementing stack-overflow detection.
7296 * configure.in: Check for getrlimit, sigaction. If all of
7297 standard headers, getrlimit and sigaction, define USE_STACKOVF and
7298 substitute ${U}stackovf.o for STACKOVF.
7299 * acconfig.h: Declare USE_STACKOVF.
7300 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
7301 * m4.h: Declare setup_stackovf_trap().
7302 * m4.c: Call setup_stackovf_trap().
7303 * tests/stackovf_test.sh: New file.
7305 1994-04-13 François Pinard <pinard@iro.umontreal.ca>
7307 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
7309 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
7311 1994-01-30 François Pinard <pinard@iro.umontreal.ca>
7313 * m4.h: Remove definition of volatile, not used anymore.
7314 Reported by Jim Meyering and Joseph E. Sacco.
7316 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
7317 of `if ... else /* nothing */' for if macros.
7318 Reported by Jim Meyering.
7320 * builtin.c (m4_regexp): Reorganize the code for avoiding a
7321 warning from gcc about `repl' possibly used before defined.
7322 Reported by Jim Meyering.
7324 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
7325 Reported by Jim Meyering.
7327 1994-01-25 François Pinard <pinard@iro.umontreal.ca>
7329 * m4.h: Move the conditional definition of volatile after the
7330 inclusion of system files, because they may define it first.
7332 1994-01-04 François Pinard <pinard@iro.umontreal.ca>
7334 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
7335 get around a problem with Alpha make seeing a syntax error, there.
7336 Reported by Vern Paxson.
7338 1994-01-03 François Pinard <pinard@iro.umontreal.ca>
7340 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
7341 Reported by Richard Stallman.
7343 1993-12-25 François Pinard <pinard@iro.umontreal.ca>
7345 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
7346 instead of AC_HAVE_FUNCS.
7347 Reported by Noah Friedman.
7349 1993-12-01 François Pinard <pinard@iro.umontreal.ca>
7351 * m4.c: Initialize show_help and show_version to zero.
7353 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
7354 Use them in exit() and usage() calls.
7356 1993-11-27 François Pinard <pinard@iro.umontreal.ca>
7358 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
7359 syserr() macro. Delete errref, add reference_error and M4ERROR.
7360 * m4.c: Replace errref, which was returning an input reference
7361 string, with reference_error, which prints it on standard error.
7362 * builtin.c, output.c: Use errno as second parameter to error,
7363 instead of using syserr() with %s.
7364 * *.c: Use M4ERROR instead of error: no more errref() with %s.
7365 Doing so, the program name appears after the input reference
7366 instead of before, which eases M-x next-error processing.
7368 1993-11-24 François Pinard <pinard@iro.umontreal.ca>
7370 * checks/get-them: Escape braces with backslashes in patterns,
7371 because HPUX-9.01 awk needs this.
7372 Reported by Jim Meyering.
7374 1993-11-22 François Pinard <pinard@iro.umontreal.ca>
7376 * builtin.c: Declare "FILE *popen ();".
7378 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
7379 macros, replace error_message_prefix() declaration by errref()'s.
7380 Declare xrealloc, for use in errref().
7381 * m4.c: Delete error_message_prefix() function, add errref().
7382 * *.c: Use error() systematically in place of all error macros,
7383 now that error() flushes stdout first. Make needed adjustments.
7385 * m4.h: Remove const in sys_errlist[] declaration, it creates
7386 conflicts on SGI and Alpha.
7387 Reported by Kaveh R. Ghazi.
7389 1993-11-20 François Pinard <pinard@iro.umontreal.ca>
7391 * m4.c: Include <getopt.h> instead of "getopt.h".
7393 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
7394 * acconfig.h: New, for documenting HAVE_EFGCVT.
7395 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
7396 use them wherever appropriate. Also use -I. for compilations.
7397 * lib/Makefile.in: Use -I.. for compilations.
7398 * *.c: Include <config.h> or "config.h".
7400 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
7401 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
7403 1993-11-17 François Pinard <pinard@iro.umontreal.ca>
7405 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
7407 * input.c (input_init): Initialize quote and comment strings
7408 explicitely instead of calling set_quotes and set_comment: by
7409 doing so, we ensure we do not free uninitialized variables.
7411 * checks/check-them: Reverse arguments to both diff, so the
7412 expected is on the left and the obtained on the right.
7414 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
7415 macros. Delete declarations for m4error, warning, fatal and
7416 internal_error, add declaration for error_message_prefix.
7417 * m4.c: Delete m4error, warning, fatal and internal_error
7418 routines, add error_message_prefix routine.
7419 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
7420 warning with WARNING*, fatal with FATAL* and internal_error with
7422 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
7423 this is not needed anymore.
7425 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
7426 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
7427 and debug_message, add declaration for debug_message_prefix.
7428 * debug.c: Remove static specifier for FILE *debug declaration.
7429 Delete debug_print and debug_message routines, add
7430 debug_message_prefix routine.
7431 * builtin.c, debug.c: Replace debug_print routine calls with
7432 DEBUG_PRINT* macro calls.
7433 * input.c, path.c: Replace debug_message routine calls with
7434 DEBUG_MESSAGE* macro calls.
7436 * m4.h: Remove inclusion of <varargs.h>.
7437 * debug.c: Include <stdarg.h> or <varargs.h>.
7438 (trace_format): Use stdarg instead of varargs if __STDC__.
7440 * configure.in: Remove checks for vfprintf and _doprnt. These
7441 implementations use varargs tricks which are not portable enough.
7442 * lib/vfprintf.c: Deleted.
7443 * lib/_doprnt.c: Deleted.
7444 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
7445 Reported by Joel Sherrill.
7447 * path.c (add_include_directory): Use xstrdup.
7449 * builtin.c (find_builtin_by_name): Declare static.
7451 * *.[ch]: Add const to a few "char *" declarations.
7453 * configure.in: Remove commented tests for fileno() and fstat().
7454 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
7456 * debug.c (debug_flush_files): New.
7457 * m4.h: Declares it.
7458 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
7459 Reported by Nicolas Pioch.
7461 1993-11-12 François Pinard <pinard@iro.umontreal.ca>
7463 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
7464 Reported by Joel Sherrill.
7466 * builtin.c (prefix_all_builtins): Instead of the table size, use
7467 the null entry at end for stopping the loop. It was overwritten.
7468 Reported by Andreas Schwab and Jim Meyering.
7470 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
7471 Reported by Kaveh R. Ghazi.
7473 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
7474 Reported by Karl Vogel.
7476 1993-11-09 François Pinard <pinard@iro.umontreal.ca>
7478 * m4.h: Do not define volatile if already defined.
7479 Reported by René Seindal.
7481 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
7483 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
7484 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
7486 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
7488 * m4.h: Define strchr and strrchr in terms of index and rindex,
7489 instead of the other way around.
7490 * builtin.c, m4.c, path.c: Use strchr instead of index.
7492 * input.c (next_char): Remove a "break;" after a "return ...;".
7493 Reported by Tom McConnell.
7495 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
7499 * configure.in: Do not copy check files in the build hierarchy.
7500 * checks/check-them: Identify the m4 version being checked. For
7501 finding m4, look in $PATH instead of in the parent directory.
7502 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
7503 * checks/Makefile.in (.all-stamp): Always create check files in
7504 the source hierarchy, not anymore in the build hierarchy.
7505 (check): cd to the source hierarchy before performing checks.
7506 Do not copy nor clean COPYING anymore, take it from `..'.
7507 Reported by Tom McConnell.
7509 * Makefile.in (Makefile): Use $(SHELL).
7510 (config.status): Use $(SHELL). Use "config.status --recheck"
7511 instead of "configure --no-create", which is obsolete.
7512 Reported by Tom McConnell.
7514 1993-11-05 François Pinard <pinard@iro.umontreal.ca>
7516 * m4.c (usage): Use "%s" instead of "m4" in format string.
7517 Reported by Jim Meyering.
7519 * Makefile.in: Distribute mkinstalldirs.
7520 Reported by Pierre Gaumond.
7521 Reported by Jim Meyering.
7522 Reported by Tom McConnell.
7523 Reported by Andreas Gustafsson.
7525 * checks/check-them: Renamed from checks/check_them.
7526 * checks/get-them: Renamed from checks/get_them.
7527 * checks/.all-stamp: Renamed from checks/.all_stamp.
7528 * checks/Makefile.in: Changed accordingly.
7529 Reported by Jim Meyering.
7531 1993-11-04 François Pinard <pinard@iro.umontreal.ca>
7533 * lib/Makefile.in (dist): Correct permissions on files.
7535 * output.c: Declare tmpfile, some systems don't.
7537 1993-11-03 François Pinard <pinard@iro.umontreal.ca>
7539 * checks/Makefile.in (dist): Correct permissions on files.
7541 * Makefile.in (dist): Ensure recursive linking for subdirectory
7542 `examples', also set read/write permissions on all its files.
7544 * mkinstalldirs: New, from elsewhere.
7545 * Makefile.in: Use it.
7547 * debug.c: Synchronize debug messages and regular output when
7548 the debug file and stdout are redirected to the same file.
7549 * configure.in: Add (commented) checks for fileno and fstat.
7550 Reported by Jim Avera.
7552 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
7553 etc., arguments, then ignore the superfluous one. m4 used to
7554 diagnose missing arguments and return the empty string.
7555 Reported by Nick S. Kanakakorn.
7557 1993-11-02 François Pinard <pinard@iro.umontreal.ca>
7559 * m4.c (main): At end of all input, ensure all undiverted text
7560 goes to the main output stream.
7561 Reported by Andreas Gustafsson.
7563 * m4.c (main): exit (0), instead of return 0.
7565 * m4.c: Implement -P and --prefix-builtins.
7566 * builtin.c: Delete const specifier on builtin_tab.
7567 (prefix_all_builtins): New.
7568 Reported by Noah Friedman.
7569 Reported by Scott Bartram.
7571 * c-boxes.el: New, from elsewhere.
7572 * Makefile.in: Distribute it.
7574 * m4.h: Do not define bcopy if <string.h> defines it.
7575 Reported by Stephen Perkins.
7577 * builtin.c (define_macro): Allow a missing second argument, in
7578 which case it is implied empty. Affects define and pushdef.
7579 Reported by Eric Allman.
7581 1993-11-01 François Pinard <pinard@iro.umontreal.ca>
7583 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
7584 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
7585 * builtin.c: Initialize all the blindness fields in builtin_tab.
7586 (define_builtin): Copy the blindness of a builtin into its symbol.
7587 * macro.c (expand_token): Avoid processing a blind builtin if the
7588 next character is not an opening parenthesis.
7589 Reported by David MacKenzie.
7590 Reported by Noah Friedman.
7592 * configure.in: Ensure an exit status of 0 on completion.
7593 Reported by Vivek P. Singhal.
7595 * eval.c (eval_lex): Admit both lower and upper case letters for
7596 bases greater than 10. Only lower case letters were accepted.
7598 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
7599 Reported by Krste Asanovic.
7601 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
7602 * eval.c (logical_not_term): New name for not_term.
7603 * eval.c (xor_term): New, between or_term and and_term.
7604 * eval.c (not_term): New, between and_term and logical_not_term.
7605 * eval.c (shift_term): New, between cmp_term and add_term.
7606 Reported by Krste Asanovic: ~, ^, <<, >>.
7607 Reported by Ben A. Mesander: ** vs ^.
7609 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
7610 * m4.h: Delete xrealloc.c.
7611 * lib/xmalloc.c: New, from elsewhere.
7612 * lib/xstrdup.c: New, from elsewhere.
7613 * lib/Makefile.in: Distribute and compile them.
7615 * m4.c: Change progname to program_name.
7616 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
7617 * lib/error.c: New, from elsewhere.
7618 * lib/Makefile.in: Distribute and compile error.c.
7619 * configure.in: Check AC_VPRINTF and for strerror.
7620 * m4.c: Delete cmd_error. Use error instead.
7621 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
7623 * m4.h: Delete #define const, let Autoconf takes care of this.
7625 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
7626 Merge parse_args into main. Declare argv to be `char *const *',
7627 then remove superfluous casts.
7629 * m4.c: Rename --no-gnu-extensions to --traditional.
7630 Reported by Ben A. Mesander.
7632 * m4.c (usage): Add a status parameter. Supply one in various
7633 calls. Add --help processing. Remove -V for --version.
7635 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
7637 * lib/Makefile.in: Have an AR=ar declaration.
7638 Reported by Eric Backus.
7639 Reported by Bjorn R. Bjornsson.
7640 Reported by Tom Tromey.
7641 Reported by Kristine Lund.
7642 Reported by Marion Hakanson.
7644 1993-10-30 François Pinard <pinard@iro.umontreal.ca>
7646 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
7647 Reported by Noah Friedman.
7649 1993-10-25 François Pinard <pinard@iro.umontreal.ca>
7651 * Makefile.in: Remove MDEFINES and cleanup.
7653 1993-06-09 François Pinard <pinard@iro.umontreal.ca>
7655 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
7658 1993-02-06 François Pinard <pinard@iro.umontreal.ca>
7660 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
7661 ensure 777 mode for directories, so older tar's will restore file
7664 1993-01-17 François Pinard <pinard@iro.umontreal.ca>
7666 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
7667 so the installer can override automatically configured choices.
7668 Reported by Karl Berry.
7670 1993-01-15 François Pinard <pinard@iro.umontreal.ca>
7672 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
7673 previous version was not working properly on m68k-hp-bsd4.3.
7674 Reported by Roland McGrath.
7676 * lib/_doprnt.c: Stolen from Oleo distribution.
7677 * configure.in: Check for _doprnt.c if vfprintf.c selected.
7678 * lib/Makefile.in: Distribute _doprnt.c.
7679 Do not distribute regex.[ch].old anymore.
7681 1993-01-01 François Pinard <pinard@iro.umontreal.ca>
7683 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
7684 Richard wants it there.
7686 1992-12-27 François Pinard <pinard@iro.umontreal.ca>
7688 * Makefile.in: Add DEFS to MDEFINES.
7689 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
7690 (libm4.a): Remove the library before creating it.
7691 (distclean): Remove tags and TAGS too.
7693 1992-12-23 François Pinard <pinard@iro.umontreal.ca>
7695 * Makefile.in (dvi, m4.dvi): New goals.
7697 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
7698 macro.c, output.c, path.c, symtab.c: Change Copyright from
7699 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
7701 * examples/divert.m4: Deleted, this bug has been corrected.
7703 * Makefile.in (texclean, mostlyclean): New goals.
7705 * Makefile.in (clean): Remove clutter from ansi2knr.
7706 Reported by Pierre Gaumond.
7708 1992-12-20 François Pinard <pinard@iro.umontreal.ca>
7710 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
7711 might well use CFLAGS is s/he needs it.
7713 * Makefile.in: Allow installation of info files from a separate
7715 Reported by Jason Merrill.
7716 Reported by David MacKenzie.
7717 Reported by Skip Montanaro.
7718 Reported by Erez Zadok.
7719 Reported by Assar Westerlund.
7721 1992-12-19 François Pinard <pinard@iro.umontreal.ca>
7724 This is still a beta release for the future GNU m4 version 1.1.
7726 * lib/alloca.c: New, from elsewhere.
7727 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
7729 * m4.h: Do not define index/rindex if already defined. If
7730 FALSE/TRUE are already defined, do not redefine them, but merely
7731 define boolean typedef to int.
7733 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
7734 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
7735 because some C compilers do not like connectives with #ifdef.
7736 * m4.h: Define `volatile' only if __GNUC__, instead of once for
7737 __GNUC__ and once for __STDC__.
7738 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
7740 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
7741 Makefile dependencies. Without it, make keeps destroying and
7742 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
7744 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
7745 to diversion/DIVERSION, this was a spelling error.
7747 * m4.c: Declare version[], remove #include "version.h".
7748 * version.h: Deleted.
7749 * Makefile.in: Remove references to version.h.
7751 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
7752 production, by using a simpler and more robust algorithm. This
7753 solves the problem of synclines sometimes written in the middle of
7754 an output line. Delete sync_line() and output_lines variable.
7755 * m4.h: Remove sync_line prototype and output_lines declaration.
7756 * input.c (next_char), output.c (shipout_text): Remove references
7758 * input.c (push_file, pop_file): Merely put the value -1 in
7759 output_current_line instead of calling sync_line, for delaying a
7760 single `#line NUM FILE' before next output line. Do not test
7761 for sync_output, because this is unnecessary clutter.
7762 * output.c (make_divertion, insert_divertion): Idem.
7763 * input.c: Rename must_advance_line to start_of_input_line, for
7766 * debug.c (trace_header): Select a new debug line format, which
7767 better complies with GNU standards for formatting error messages.
7768 With option `-dfl', M-x next-error might be used on the output.
7769 * m4.c (vmesg): Adjust format of error output to GNU standards.
7770 * m4.texinfo: Adjust examples for `make check' to work.
7772 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
7773 case for enum debug_info constants, which were all lower case.
7775 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
7777 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
7778 collected patches. I tried a few times using newer regex.[ch], it
7779 mysteriously stopped aborting with this one. Insecure feeling...
7780 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
7782 1992-12-18 François Pinard <pinard@iro.umontreal.ca>
7784 * m4.c: Change `--no-warnings' to `--silent'.
7785 Reported by David MacKenzie.
7787 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
7788 leave it off for now. See comment in m4.c for justification.
7789 Reported by David MacKenzie.
7791 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
7792 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
7794 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
7796 * Makefile.in: Ensure recursive cleaning is done before local
7797 cleaning for all clean goals.
7799 * builtin.c (ntoa): Ensure the value is always interpreted as a
7800 signed quantity, whatever the radix is.
7802 1992-11-18 Jim Meyering <meyering@idefix>
7804 * builtin.c, format.c, input.c: Split long lines.
7805 * m4.c: Use typedef macro_definition instead of struct
7807 * symtab.c: Use typedef symbol instead of struct symbol.
7809 1992-11-17 François Pinard <pinard@iro.umontreal.ca>
7811 * *.[ch]: Remove all trailing whitespace, in code and comments.
7813 * configure.in: Find some awk.
7814 * Makefile.in: Add $(AWK) to MDEFINES.
7815 * checks/Makefile.in: Transmit $(AWK) to get_them.
7816 * checks/get_them: Use $AWK instead of gawk. Add a close in the
7817 awk script when switching files, because without this, mawk runs
7818 out of file descriptors.
7820 1992-11-16 François Pinard <pinard@iro.umontreal.ca>
7822 * Makefile.in (realclean): Delete m4.info*.
7823 Reported by Jim Meyering.
7825 * Makefile.in: Adjust and link with checks/Makefile.
7826 * checks/Makefile.in: New.
7827 * configure.in: Output checks/Makefile.
7829 * checks/get_them: Have the dnl header of each test more
7830 recognizable by next-error, also use a better message.
7832 1992-11-16 Jim Meyering <meyering@idefix>
7834 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
7835 And use that only if __GNUC__ since we're using it's GCC-specific
7836 semantics that tell the compiler the associated function doesn't
7839 * builtin.c (substitute): Don't use character as an array index.
7840 (dumpdef_cmp): Make formal arguments `const void *' to avoid
7841 warnings with gcc -W -Wall on systems with qsort prototype.
7842 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
7845 * eval.c (most functions): Add parentheses to assignments used
7846 as truth values go avoid warnings from gcc -Wall.
7848 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
7849 any functions that don't need external scope.
7851 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
7852 (many functions and arrays): Declare `const'.
7854 1992-11-15 François Pinard <pinard@iro.umontreal.ca>
7856 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
7857 removing the declaration from m4.h. Also rename false to FALSE
7860 * lib/Makefile.in (Makefile): New goal.
7862 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
7863 so heavily loaded. It gets more easily overridable, calling make.
7864 Reported by Jim Meyering.
7866 * Makefile.in (dist): Get .fname from the current directory name,
7867 instead of from version.h. I need updating many files manually,
7868 when the version changes, version.h is just one of them.
7870 1992-11-14 François Pinard <pinard@iro.umontreal.ca>
7872 * m4.h: Remove the tag `boolean' on the enum introducing typedef
7873 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
7874 Reported by Tom McConnell.
7876 1992-11-13 François Pinard <pinard@iro.umontreal.ca>
7878 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
7879 39.cleardiv, which were describing missing or spurious newlines.
7880 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
7881 do not depend on machine word size, `/bin/false' implementation,
7882 or `wc' output format. `make check' is more dependable, now.
7884 * checks/check_them: Summarize the failed tests by listing their
7885 name, at end. If none, issue `All checks successful'. Output
7886 `Checking' instead of `Input file:'.
7888 * checks/get_them, checks/check_them: Reindented.
7890 * Makefile.in (dist): chmod a+r before making the tar file.
7892 1992-11-12 François Pinard <pinard@iro.umontreal.ca>
7894 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
7896 * input.c (next_token): Reinitialize token_buttom just after using
7897 it as a watermark with obstack_free. Or else, a future token, big
7898 enough for triggering reallocation of the obstack chunk, could
7899 void the initialized value of token_buttom, later causing panic in
7900 obstack_free. Rename token_buttom to token_bottom everywhere.
7902 * m4.h: Before declaring errno, first include <errno.h> and
7903 ensure that it does not define errno.
7904 Reported by Richard Stallman.
7906 1992-11-11 François Pinard <pinard@iro.umontreal.ca>
7908 * builtin.c: Define and use DECLARE macro for builtins.
7910 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
7911 argument, this is a common idiom for introducing long comments.
7913 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
7914 arguments. The last argument was silently ignored.
7916 * m4.c (cmd_error): Add a missing semicolon before va_end().
7918 1992-11-10 François Pinard <pinard@iro.umontreal.ca>
7920 * Makefile.in: Now handle protoized sources. Define and use U.
7921 Compile and use ansi2knr with old compilers. Update DISTFILES.
7922 Add `aclocal.m4' to `configure' dependencies.
7923 * ansi2knr.c: New, from Ghostscript distribution.
7924 * configure.in: Define U through FP_PROTOTYPES for old compilers.
7925 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
7926 * aclocal.m4: New, provide FP_PROTOTYPES.
7927 * m4.h: Conditionnaly protoized through Args, save for varags.
7928 * builtin.c: Protoized. Then:
7929 Include <sys/types.h> if size_t is not defined, before "regex.h".
7930 (m4_ifelse): Fetch built-in name properly for diagnostic.
7931 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
7932 (m4_regexp): Add const to `msg' declaration.
7933 (m4_patsubst): Add const to `msg' declaration.
7934 * debug.c: Protoized, save for varargs.
7935 * eval.c: Protoized.
7936 * format.c: Protoized.
7937 * input.c: Protoized.
7938 * m4.c: Protoized, save for varargs. Then:
7939 (xfree): Accept void * instead of char *.
7940 (xmalloc): Return void * instead of char *.
7941 (xrealloc): Accept and return void * instead of char *.
7942 * macro.c: Protoized.
7943 * output.c: Protoized.
7944 * path.c: Protoized. Then cast some (char *) over xmalloc's.
7945 * symtab.c: Protoized.
7947 1992-11-06 François Pinard <pinard@iro.umontreal.ca>
7949 * m4.texinfo: Remove directory from diagnostics in 30.include,
7950 51.eval, 56.errprint and 57.m4exit tests.
7952 * m4.h: Remove declarations for int or void system functions, they
7953 cause more conflicting trouble than they make good.
7955 * configure.in: Avoid configuration header file. Add some tests.
7956 * m4.h: Remove #include "config.h".
7957 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
7958 Then, rewritten for better compliance with GNU standards.
7960 1992-11-05 François Pinard <pinard@iro.umontreal.ca>
7962 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
7963 because of a misplaced #endif.
7965 * Many *.[hc] files: Correct intra-line spacing here and there,
7966 according to GNU indent 1.6 advice.
7968 * configure.in: New, using Autoconf 1.2.
7969 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
7970 * Delete old configure.in, configure, etc/configure.in,
7971 etc/configure, lib/configure.in, lib/configure and config/*.
7972 Reported by Jason Merrill.
7974 * symtab.c (hash): Change (char) NULL to '\0'.
7975 Reported by Jason Merrill.
7977 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
7978 etc/nextvers.sh. Release numbers will be edited `by hand'.
7979 * version.h: De-automatize, force value in.
7981 * m4.c: Changes in order to use a newer getopt.h.
7982 Reported by David MacKenzie.
7984 * checks/: New name for examples/.
7985 * checks/get_them: New location for etc/get_examples.
7986 * checks/check_them: New location for etc/check_examples.
7987 * Makefile.in, checks/get_them, checks/check_them: Adjust.
7988 * lib/vfprintf.c: New location for etc/vfprintf.c.
7989 * Delete empty etc/.
7990 * examples/: New name for test/.
7992 1992-03-10 François Pinard <pinard@iro.umontreal.ca>
7994 * Makefile.in (check): Add m4 as dependency.
7996 * m4.c: Accept --no-warnings instead of --no_warnings, and
7997 --no-gnu-extensions instead of --no_gnu_extensions. Make the
7998 usage message more informative.
7999 Reported by David MacKenzie.
8001 1992-03-09 François Pinard <pinard@iro.umontreal.ca>
8003 * etc/check_examples: New name for check_examples.sh.
8004 * etc/get_examples: New name for get_examples.sh.
8005 * Makefile.in, etc/Makefile.in: Use new names.
8007 * Makefile.in: Transmit $(CC) while making in lib.
8009 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
8010 code disposition by hand.
8012 1992-03-08 François Pinard <pinard@iro.umontreal.ca>
8014 * m4.h: Delete definitions for abort() and exit().
8015 Reported by Richard Stallman.
8017 * config/hmake-unicos, config/s-unicos.h: New files.
8018 Reported by Hal Peterson.
8020 * eval.c (exp_term): Have N^0 return 1.
8021 Reported by Michael Fetterman.
8023 * eval.c, input.c, m4.h: Remove last comma in enums.
8024 Reported by Mike Lijewski.
8026 * Transfer of maintenance duties from René to François.
8028 1991-10-24 René Seindal <seindal@diku.dk>
8030 * Release 1.0. Many thanks to those, who provided me with bug
8031 reports and feedback.
8033 * Uses GNU configure, taken from the gdb distribution.
8035 * Uses GNU getopt(), with long option names.
8037 * The -Q/+quiet option is added, which suppresses warnings about
8038 missing or superflous arguments to built-in macros.
8040 * Added default options via the M4OPTS environment variable.
8042 * The built-in format can now be configured to use sprintf as
8043 the formatting engine, for systems without [efg]cvt(3).
8045 * GNU library code is moved to the ./lib subdirectory; other
8046 utility files are now in ./etc.
8048 * Several minor bugs have been fixed.
8050 1991-07-26 René Seindal <seindal@diku.dk>
8052 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
8053 François Pinard and Roland H. Pesch for providing me with reports.
8055 * The builtins incr and decr are now implemented without use of
8058 * The builtin indir is added, to allow for indirect macro calls
8059 (allows use of "illegal" macro names).
8061 * The debugging and tracing facilities has been enhanced
8062 considerably. See the manual for details.
8064 * The -tMACRO option is added, marks MACRO for tracing as soon
8067 * Builtins are traced after renaming iff they were before.
8069 * Named files can now be undiverted.
8071 * The -Nnum option can be used to increase the number of
8072 divertions available.
8074 * Calling changecom without arguments now disables all comment
8077 * The function m4_patsubst() is now consistently declared
8080 * A bug in dnl is fixed.
8082 * A bug in the multi-character quoting code is fixed.
8084 * Several typos in the manual has been corrected. More probably
8087 * The m4.info file is now installed along with the program.
8089 1990-11-15 René Seindal <seindal@diku.dk>
8091 * Updated and enhanced version. Release 0.75, manual 0.07.
8093 * Implemented search path for include files (-I option and
8094 M4PATH envronment variable).
8096 * Implemented builtin "format" for printf-like formatting.
8098 * Implemented builtin "regexp" for searching for regular
8101 * Implemented builtin "patsubst" for substitution with regular
8104 * Implemented builtin "esyscmd", which expands to a shell
8107 * Implemented "__file__" and "__line__" for use in error
8110 * Implemented character ranges in "translit".
8112 * Implemented control over debugging output.
8114 * Implemented multi-character quotes.
8116 * Implemented multi-character comment delimiters.
8118 * Changed predefined macro "gnu" to "__gnu__".
8120 * Changed predefined macro "unix" to "__unix__", when the -G
8121 option is not used. With -G, "unix" is still defined.
8123 * Changed "shift", "$@" and "$*" to not insert spaces afters
8126 * Added program name to error messages.
8128 * Fixed two missing null bytes bugs.
8130 1990-01-22 René Seindal <seindal@diku.dk>
8132 * Initial beta release. Release 0.50, manual 0.05.
8143 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
8144 2005, 2006 Free Software Foundation, Inc.
8146 Copying and distribution of this file, with or without
8147 modification, are permitted provided the copyright notice
8148 and this notice are preserved.