1 2007-01-23 Eric Blake <ebb9@byu.net>
3 * m4/m4module.h (M4_SYNTAX_ASSIGN): Delete this unused
4 extension to make enough room.
5 (M4_SYNTAX_IGNORE): Change value to zero, since the (commented)
6 code in input.c special cases this category.
7 (M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): New values in preparation
8 for define(eleventh,${11}) extension.
9 * m4/syntax.c: Update comments accordingly.
10 (m4_syntax_create, m4_syntax_code): Handle { and }.
11 * m4/input.c (m4__next_token): Likewise.
12 * src/freeze.c (produce_frozen_state): Support new categories.
13 (reload_frozen_state): When loading version 1, disable syntax
14 features not present in 1.4.x.
15 * tests/freeze.at: Sort and rename existing tests.
16 (loading format 1): Ensure we don't break v1 frozen files that
18 (loading format 2, reloading changecom, reloading changesyntax):
20 * doc/m4.texinfo (Changesyntax, Frozen file format 1): Document
21 the new syntax categories.
22 (Arguments): Update the FIXME comment.
23 (M4wrap): Merge examples from branch, before worrying about fixing
25 (Using frozen files): Start merging from branch.
28 2007-01-20 Eric Blake <ebb9@byu.net>
30 * src/freeze.c (produce_char_dump): Delete. Replace with...
31 (produce_mem_dump): ...this new function, to encode more strings.
32 Also make the coding easier to read and slightly more compact.
33 (produce_syntax_dump): Only dump non-default syntax codes.
34 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
35 Encode non-ASCII characters in user-supplied strings.
36 (GET_STRING): Accept escape sequences in version 2.
37 * NEWS: Document this change.
40 2007-01-16 Eric Blake <ebb9@byu.net>
42 Port patch from branch for stack overflow detection on BSD/OS.
43 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Check for stack_t.ss_sp.
44 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
45 ! HAVE_STACK_T_SS_SP]: Use this check.
46 Reported by Chris McGuire.
48 2007-01-15 Eric Blake <ebb9@byu.net>
50 * tests/builtins.at (__m4_version__): New test.
51 * modules/traditional.c (m4_macro_table): Provide windows and os2
52 macros, as appropriate. Add __traditional__ macro.
53 * modules/mpeval.c (m4_macro_table): Name the macro __mpeval__,
54 not __gmp__, to match module name.
55 * modules/load.c (m4_macro_table): Name the macro __load__, not
56 __modules__, to match module name.
57 * doc/m4.texinfo (History, Shell commands, Platform macros): Merge
59 (Standard Modules): Improve wording.
60 (Incompatibilities): Move platform macros into their own node.
61 (Load, Unload): Use actual examples.
62 * NEWS: Document this change.
65 2007-01-13 Eric Blake <ebb9@byu.net>
67 * doc/m4.texinfo (Mpeval): Add tests.
68 * tests/testsuite.at (AT_CHECK_GMP): New filter, factored from...
69 * tests/builtins.at (gmp): ...here. Rename test to...
71 * tests/generate.awk (new_test): Filter out mpeval tests when gmp
73 * m4/m4module.h (m4_get_no_gnu_extensions_opt): Merge
74 no_gnu_extensions with posixly_correct_opt, since they were set in
76 * m4/m4private.h (struct m4): Remove no_gnu_extensions.
77 * src/main.c (main): Update caller.
78 * src/freeze.c (reload_frozen_state): Likewise.
79 * modules/m4.c (m4wrap): Likewise.
81 2007-01-12 Eric Blake <ebb9@byu.net>
83 * m4/syntax.c (m4_set_comment): XCU ERN 131 was approved by
84 POSIX, so update the comment.
85 * doc/m4.texinfo (Inhibiting Invocation): XCU ERN 130 was
86 approved by POSIX, so we can always have blind macros, even when
88 (Ifelse): Mention the term `blind builtin'.
90 2007-01-08 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
92 * doc/m4.texinfo: Fix a couple of typos.
94 2007-01-08 Eric Blake <ebb9@byu.net>
96 * ltdl/m4/gnulib-cache.m4: Update for new year.
97 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Cover all error cases.
98 Reported by Ralf Wildenhues.
100 2007-01-06 Eric Blake <ebb9@byu.net>
102 * m4/m4private.h (to_uchar): Move...
103 * m4/m4module.h: here, so modules can use it.
104 * src/main.c (usage, long_options): Support --posix as a synonym
106 * modules/m4.c (numb_invert): Detect unsupported x**-y.
107 (numb_incr, numb_urshift, numb_extension): New macros.
108 (numb_obstack): Port patch from branch to support radix 1 output.
109 * modules/mpeval.c (numb_obstack): Use \ for ratios.
110 (numb_incr, numb_urshift, numb_extension): New macros.
111 (mpq2mpz): Warn rather than error.
112 * modules/evalparse.c (URSHIFT, NEGATIVE_EXPONENT): New
114 (eval_error): Rearrange, so that all ignorable errors are less
116 (eval_text, last_text): Obey C++ type safety rules.
117 (numb_pow): Change return type.
118 (exp_term): Adjust caller.
119 (m4_evaluate): Fail on bad exponent.
120 (logical_or_term, logical_and_term): Ignore failed ** in short
122 (eval_lex): Fix typos when detecting <<= and >>=. Use \ instead
123 of : for ratio. Support >>>, ,, and ?:. Port patch from branch
124 to parse radix 1 numbers.
125 (condition_term, comma_term): New parse functions.
126 (shift_term): Support >>>.
127 (m4_evaluate): Port patch from branch to output radix 1 numbers.
128 Warn instead of error for most parse problems.
129 * doc/m4.texinfo (Limits control, Eval): Document these changes.
130 * NEWS: Document new operators and new command line option.
132 2007-01-04 Eric Blake <ebb9@byu.net>
134 * configure.ac (AC_SYS_LARGEFILE): Guarantee large file support.
136 2007-01-03 Eric Blake <ebb9@byu.net>
138 * doc/m4.texinfo (Format, Incr): More merges.
139 (Eval): Ensure C precedence rules are met.
140 * modules/evalparse.c (BADOP, INVALID_OPERATOR): New enumerators.
141 (not_term, logical_not_term): Delete; these are same precedence
142 as other unary operators.
143 (equality_term): New; these are lower precedence than relational
145 (eval_lex, simple_term, m4_evaluate): Recognize forbidden C
146 operators for better error messages.
147 (logical_or_term, logical_and_term): Short-circuit out the error
149 (unary_term): Allow consecutive unary operators.
150 * modules/m4.c (int2numb, numb2int): Delete; these potentially
152 (numb_not, numb_eor, numb_ior, numb_and): Update callers.
153 * modules/mpeval.c (reduce1, reduce2): Protect macros better.
154 * NEWS: Document this change.
156 2006-12-27 Eric Blake <ebb9@byu.net>
158 * doc/m4.texinfo (Substr, Patsubst): Merge more sections from the
160 * modules/m4.c (substr): Merge from branch.
162 2006-12-26 Eric Blake <ebb9@byu.net>
164 * doc/m4.texinfo (Changesyntax): Check for regressions with
167 2006-12-22 Eric Blake <ebb9@byu.net>
169 * m4/m4module.h (m4_set_syntax): Change signature.
170 * modules/gnu.c (m4_resyntax_encode_safe): Reduce error to
172 (changesyntax): Likewise, and update caller.
173 * m4/m4private.h (m4_syntax_table): Add orig member.
174 * m4/syntax.c (m4_set_quotes, m4_set_comment): Merge from branch.
175 Don't set is_single_quotes and is_single_comments when the begin
176 character is shadowed by another syntax type.
177 (m4_syntax_create): Populate default syntax table.
178 (add_syntax_attribute): Don't lose quote assignment.
179 (remove_syntax_attribute): Only allow removing rquote or ecomm.
180 (add_syntax_set, subtract_syntax_set, set_syntax_set)
181 (reset_syntax_set): New helper routines.
182 (m4_set_syntax): Alter semantics - NUL key reverts entire syntax
183 to default, and empty chars reverts that key to default.
184 (check_is_single_quotes, check_is_single_comments): New helper
186 * modules/m4.c (changecom): Merge from branch.
187 * m4/input.c (m4__next_token): Rearrange token recognition order
188 to macro, quote, comment, in order to match traditional
190 * src/freeze.c (reload_frozen_state): Update caller.
191 * doc/m4.texinfo (Changequote, Changecom): Merge from branch, with
193 (Changeresyntax): Revise to match style of surrounding sections
194 and add more examples.
195 (Changesyntax): Likewise, and update to new semantics.
196 * NEWS: Document this change.
198 * doc/m4.texinfo (Operation modes): Avoid underfull hbox.
199 (M4wrap, Eval, Errprint): Fix typos.
200 (Divnum): Not necessary to redivert in example.
202 2006-12-21 Eric Blake <ebb9@byu.net>
204 * doc/m4.texinfo (Len, Index macro, Regexp): More section merging
207 2006-12-19 Eric Blake <ebb9@byu.net>
209 * modules/m4.h (m4_sysval_flush_func): Adjust prototype.
210 * modules/m4.c (m4_sysval_flush): Add parameter, so that m4exit
211 can track write errors without all other callers warning multiple
213 (sysval_flush_helper): New function.
214 (dumpdef, syscmd, errprint, m4exit): Adjust callers.
215 * modules/gnu.c (esyscmd): Likewise.
216 * tests/others.at (stdout closed, stdout full): Error message
219 2006-12-16 Eric Blake <ebb9@byu.net>
221 * src/main.c: Fix missing include.
223 * src/main.c (main): Check for errors when closing stdin.
224 * modules/m4.c (m4exit): Missed part of previous patch: flush
225 stdin before a successful exit.
226 Reported by Ralf Wildenhues.
228 2006-12-14 Eric Blake <ebb9@byu.net>
230 * modules/m4.c (m4_sysval_flush): Flush stdin before exiting, as
232 * tests/others.at (stdin seekable): New test.
234 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
236 * doc/m4.texinfo: Fix some typos.
238 2006-12-04 Eric Blake <ebb9@byu.net>
240 * doc/m4.texinfo (Undivert, Divnum, Cleardivert): Merge more doc
242 (Modules): Make style consistent.
244 2006-11-16 Eric Blake <ebb9@byu.net>
246 * bootstrap: Relax m4 requirement, thanks to...
247 * configure.ac (Gettext support): ...this workaround to the 1.4.4
248 bug. Undoes restriction added on 2006-11-09.
250 * tests/builtins.at (esyscmd, syscmd): Redo, since spilled
251 diversions are now closed when not active.
252 (divert): Remove check now in the manual.
253 * tests/others.at (stderr closed): Likewise.
254 (stdout closed): Add a check.
255 * doc/m4.texinfo (Include, Search Path, Diversions, Divert): Sync
256 more docs with branch.
258 2006-11-14 Eric Blake <ebb9@byu.net>
260 Remerge sparse diversion handling from branch.
261 * ltdl/m4/gnulib-cache.m4: Replace avltree-list with
263 * m4/output.c (diversion_table): Change type to gl_oset_t.
264 (m4_output_init, m4_output_exit, cleanup_tmpfile, make_room_for)
265 (m4_make_diversion, insert_diversion_helper, m4_insert_diversion)
266 (m4_undivert_all, m4_freeze_diversions): Adjust all callers.
267 (div0, diversion_storage): New variables.
268 (diversions, equal_diversion_CB): Deleted.
269 (threshold_diversion_CB): New callback.
270 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
272 (m4_tmpfile): Move cloexec action here.
274 * m4/resyntax.c (m4_regexp_syntax_encode): Avoid bug with signed
277 2006-11-13 Eric Blake <ebb9@byu.net>
279 Add several new command line options.
280 * src/main.c (usage): Update.
281 (OPTSTRING, long_options): Add --pushdef, --popdef, --gnu,
282 --traceon, --traceoff, --syncoutput, --warnings, --unload-module.
283 Make --regexp-syntax argument optional.
284 (main): Support new options. Fix regression in interactive
286 * m4/m4private.h (M4_OPT_SYNCOUTPUT_BIT): Rename from
287 M4_OPT_SYNC_OUTPUT_BIT.
288 * m4/m4module.h (m4_context_opt_bit_table): Rename sync_output to
289 syncoutput, to match option.
290 (m4_parse_truth_arg): New prototype.
291 * m4/utility.c (m4_parse_truth_arg): Implement it.
292 * m4/output.c (m4_shipout_text): Adjust sync_output caller.
293 * modules/gnu.c (syncoutput): Adjust sync_output caller, and use
295 * doc/m4.texinfo (Operation modes, Dynamic loading features)
296 (Preprocessor features, Limits control, Debugging options)
297 (Command line files): Update documentation.
298 * tests/builtins.at (mkstemp): Simplify.
299 * tests/macros.at (Command line pushdef): New test.
300 (Command line define): Improve.
301 * tests/options.at (--traceon and --traceoff, --syncoutput): New
303 (POSIXLY_CORRECT): Likewise.
304 (deprecated options): Augment.
305 (--regexp-syntax): Update, now that -r takes optional arg.
306 * NEWS: Reformat. Document new options.
308 2006-11-11 Eric Blake <ebb9@byu.net>
310 One step closer to allowing C++ compilation - don't blindly
311 convert between char* and unsigned char*.
312 * m4/m4module.h (m4_set_syntax): Change signature.
313 * m4/m4private.h (m4_string): Use signed char.
314 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
315 (m4_get_syntax_ecomm): No longer a need to cast.
316 * m4/syntax.c (m4_set_syntax, m4_syntax_create, m4_set_quotes):
318 * m4/macro.c (expand_argument): Simplify.
319 (expand_token): Use proper type.
320 * src/freeze.c (reload_frozen_state): Likewise.
321 * m4/input.c (MATCH, match_input): Likewise.
322 * modules/m4.c (translit): Likewise.
323 * modules/gnu.c (substitute): Simplify.
325 * m4/macro.c (trace_format): Use canonical type name.
326 * m4/output.c (m4_freeze_diversions): Likewise.
327 * src/freeze.c (produce_module_dump, dump_symbol_CB)
328 (produce_frozen_state): Likewise.
329 * m4/m4private.h (to_uchar): Grab from branch.
330 * m4/input.c (string_peek, string_read): Use it.
331 * m4/utility.c (skip_space): Likewise.
332 * src/main.c (main): Likewise.
333 * doc/m4.texinfo (Translit): Remerge from branch.
334 * tests/builtins.at (translit): Test 8-bit range.
335 * modules/m4.c (m4_expand_ranges): Merge from branch.
337 2006-11-09 Eric Blake <ebb9@byu.net>
339 * bootstrap: Validate that installed M4 is powerful enough.
340 Reported by Gary V. Vaughan, analyzed by Stepan Kasal.
342 2006-11-08 Eric Blake <ebb9@byu.net>
344 Merge deferred handling of -D option from branch.
345 * doc/m4.texinfo (Debugging options, Preprocessor features)
346 (Dynamic loading features, Operation modes, Invoking m4):
347 Document this change.
348 * src/main.c (OPTSTRING): Specify in-order processing.
349 (process_file): New function.
350 (main): Use it to interleave files and deferred options.
351 * tests/macros.at (Command line define): New test.
352 * tests/generate.awk: Allow '@comment file' as first example
354 * tests/options.at (option grouping): Update to reflect actual
356 (file names): New test.
358 2006-11-07 Eric Blake <ebb9@byu.net>
360 * m4/output.c (cleanup_tmpfile, m4_insert_diversion_helper): Check
363 * tests/builtins.at (m4exit): New test; failed on cygwin before
365 * m4/output.c (cleanup_tmpfile): Close files before removing
367 (make_room_for, m4_output_exit): Ensure that atexit handler
368 invoked from m4_error sees consistent state.
370 * doc/m4.texinfo (Errprint): Merge another doc node.
371 * tests/builtins.at (dumpdef, errprint): New tests.
372 * modules/m4.c (errprint): Merge from branch: flush before
375 2006-11-02 Eric Blake <ebb9@byu.net>
377 * bootstrap: Update bootstrap requirement wording.
378 Reported by Bruno Haible.
380 2006-10-31 Eric Blake <ebb9@byu.net>
382 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
384 * doc/m4.texinfo (Translit): Merge from branch.
385 * modules/m4.c (divert, substr): Ignore excess arguments.
386 (index, translit): Merge from branch.
387 * tests/builtins.at (translit): Add a test.
389 2006-10-30 Eric Blake <ebb9@byu.net>
391 * m4/m4private.h (m4_get_symbol_value_module): Delete accidental
393 * m4/symtab.c (m4_get_symbol_value_module): Likewise.
395 * modules/m4.c (m4_make_temp): Make safe across libtool.
396 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Avoid warnings.
397 * configure.ac (--with-modules): Accomodate changed module
398 location when doing './configure --enable-debug'.
400 2006-10-28 Eric Blake <ebb9@byu.net>
402 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
405 2006-10-27 Eric Blake <ebb9@byu.net>
407 * bootstrap (gnulib): No longer a need to patch after gnulib-tool
409 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
410 0.16, since 0.15 is incompatible with our automake requirement.
412 * m4/macro.c (expand_argument): Fix missing initialization.
413 * m4/m4private.h (struct m4_symbol_value): Store entire
414 m4_builtin, not just the func.
415 (m4_get_symbol_value_func): Update.
416 (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
418 * m4/m4module.h (m4_get_symbol_value_builtin)
419 (m4_get_symbol_builtin): New prototypes.
420 (m4_set_symbol_value_func): Delete, replace with...
421 (m4_set_symbol_value_builtin): New function.
422 (m4_builtin_find_by_name): Change signature.
423 * m4/symtab.c (m4_symbol_value_print): Simplify.
424 (m4_get_symbol_value_func): Update.
425 (m4_get_symbol_value_builtin): New function.
426 (m4_set_symbol_value_func): Delete, replace with...
427 (m4_set_symbol_value_builtin): New function.
428 (dump_symbol_CB) [DEBUG_SYM]: Simplify.
429 * m4/builtin.c (m4_builtin_find_by_name): Change signature.
430 * m4/input.c (struct m4_input_block): Remove unused trace member.
431 (m4_push_builtin, builtin_print, init_builtin_token): Update
433 * m4/module.c (install_builtin_table): Likewise.
434 * src/freeze.c (reload_frozen_state): Likewise.
435 * modules/gnu.c (builtin): Make it possible to retrieve a builtin
436 token, even after the builtin has been undefined.
437 * doc/m4.texinfo (Builtin): Document new capability.
440 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
442 * modules/m4.c (m4_make_temp): Use it.
443 * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
445 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
447 * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
450 2006-10-26 Eric Blake <ebb9@byu.net>
452 Silence -O2 -Wall -Wwrite-strings warnings.
453 * m4/m4private.h (m4_symbol_value): Const-ify text.
454 * m4/m4module.h (m4_get_symbol_value_text)
455 (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
456 (m4_set_symbol_value_placeholder): Likewise.
457 * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
459 * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
460 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
461 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
463 * modules/format.c (format): Likewise.
464 * src/main.c (main): Likewise.
465 * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
466 * modules/shadow.c (shadow, test): Likewise.
467 * m4/output.c (m4_make_diversion): Don't hold on to empty
469 (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
470 (m4_freeze_diversions): Likewise. Don't use uninitialized
473 Convert diversions to list instead of sparse array, part 2.
474 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
476 * m4/output.c (m4_diversion): Add next pointer and divnum members.
477 (diversion_table): Convert to a list instead of a sparse array.
478 (free_list): Maintain free list of reclaimed diversions.
479 (equal_diversion_CB, cmp_diversion_CB): New functions.
480 (m4_output_init): Set up list.
481 (m4_output_exit): Tear down list.
482 (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
484 (m4_make_diversion): Change creation of new diversions.
485 (m4_insert_diversion_helper): New function, to avoid list
487 * tests/builtins.at (divert): The test now passes.
488 * NEWS: Document this improvement.
490 Convert diversions to list instead of sparse array, part 1.
491 * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
493 * m4/output.c (diversion, total_buffer_size, output_unused):
494 Track size in size_t. All users changed.
495 (struct diversion): Reduce size now, to compensate for part 2.
496 (m4_make_diversion, make_room_for): Avoid malloc overflow.
497 (m4_output_exit): Fix typo in assert.
498 (m4_output_init, make_room_for, m4_make_diversion)
499 (m4_insert_diversion, m4_freeze_diversions): Adjust users of
500 struct m4_diversion to disambiguate the new union.
501 * tests/builtins.at (divert): Detect this failure.
503 2006-10-25 Eric Blake <ebb9@byu.net>
505 * m4/m4module.h (m4_push_builtin): Add parameter.
506 * modules/m4.c (defn): Update caller.
507 * m4/input.c (file_read_init, string_read_init): No longer
509 (input_funcs): Change signature of read_func, all callers
511 (composite_peek, composite_read, composite_unget),
512 (composite_print, composite_funcs): New input type. Not yet
513 fully utilized, but one step closer to fixing defn.
514 (m4_input_block): Make every input block track current file and
515 line. Rename some members. Remove unused out_line. Add support
516 for composite input block.
517 (input_change): New flag.
518 (file_peek, file_read, file_clean, file_unget, file_print):
520 (m4_push_file, m4_push_builtin, m4_push_string_init)
521 (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
522 (m4_skip_line, pop_input): Track input block changes.
523 (m4_pop_wrapup): Avoid overflow.
524 (init_builtin_token): Handle composite input.
525 (next_char): Handle input block changes.
526 * doc/m4.texinfo (Location): Remerge from branch.
528 * src/m4.h (includes): Need <locale.h> after all; fixes
529 regression from yesterday.
531 * m4/system_.h (obstack_regrow): New macro. Hopefully glibc will
533 * m4/macro.c (expand_macro): Avoid referencing invalid memory.
534 Handle nesting the argc obstack.
535 (expand_token): Avoid unnecessary malloc.
536 (collect_arguments): Copy name before invalidating it.
537 (argc_stack, argv_stack): New variables.
538 (m4_macro_expand_input): Initialize argc and argv stacks once per
539 file, instead of once per macro.
541 2006-10-24 Eric Blake <ebb9@byu.net>
543 * src/m4.h (includes): Add gettext.h, for N_. Assume setlocale.
545 2006-10-23 Eric Blake <ebb9@byu.net>
547 * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
548 from branch regarding stripped leading whitespace.
550 * modules/m4.c (includes): Use safe headers even when configured
551 with --enable-assert.
552 (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
553 #defined as mkstemp_safer.
555 2006-10-21 Eric Blake <ebb9@byu.net>
557 * modules/m4.c (m4_make_temp): Change signature.
558 (maketemp, mkstemp): Update callers.
559 * modules/m4.h (m4_make_temp_func): New export.
560 * modules/gnu.c (mkdtemp): New macro.
561 * doc/m4.texinfo (Operation modes): Document interaction with
564 * tests/builtins.at (mkdtemp): New test.
565 (mkstemp): Check for umask effect.
566 * NEWS: Document new builtin.
568 * tests/generate.awk (normalize): Update recognition of trailing
570 * doc/m4.texinfo: Minor formatting fixes from branch.
571 (Foreach, Improved foreach): Merge from branch.
572 * examples/foreach.m4: Merge from branch.
573 * examples/foreachq.m4: New file from branch.
574 * examples/foreach2.m4: Likewise.
575 * examples/foreachq2.m4: Likewise.
577 * doc/m4.texinfo (titlepage): Add myself as author.
578 * src/main.c (AUTHORS): Likewise.
580 2006-10-19 Eric Blake <ebb9@byu.net>
582 * modules/m4.c (m4_make_temp, mkstemp): New functions.
583 (maketemp): Add POSIX behavior and a warning.
584 * tests/others.at (maketemp): Move this test...
585 * tests/builtins.at (mkstemp): ...to here, and beef up.
586 * tests/options.at (--safer): Update to new warning message.
587 * doc/m4.texinfo (Mkstemp): Sync from branch.
588 (Extensions): Update maketemp behavior.
589 * NEWS: Document that maketemp now always warns.
591 * tests/generate.awk: For ease of doc-writing, simplify selection
592 of '-Ipath/to/examples' to '@comment examples'.
593 * examples/forloop.m4: Simplify.
594 * examples/forloop2.m4: New file.
595 * examples/quote.m4: New file.
596 * doc/m4.texinfo (Improved forloop): New node.
597 (Manual): Clarify use of examples directory.
598 (Shift, Forloop): Resync from branch.
599 (Include, Location): Update to new usage of examples directory.
601 * m4/system_.h (includes): Pick up <unistd.h> before checking for
603 (gettext_noop): Don't define here, let gettext.h do it instead.
604 * po/POTFILES.in: Update entries to reflect gnulib imports.
606 2006-10-16 Eric Blake <ebb9@byu.net>
608 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
610 * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
611 pkglibexecdir support.
612 * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
613 worry about pathconf.h, now that gnulib does it for us.
614 (pkgmodincludedir): Simplify.
615 (pkglibexecdir): Delete, now that automake does this.
616 * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
617 * src/main.c (usage): Likewise.
618 * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
620 * doc/m4.texinfo: Port some changes from the branch.
621 (Invoking m4): Promote to a chapter, instead of a section of
623 (Operation modes, Dynamic loading features, Preprocessor features)
624 (Limits control Frozen state, Debugging options)
625 (Command line files): Subdivide into new sections.
626 (Cleardivert): Rename from cleardiv.
628 2006-10-14 Eric Blake <ebb9@byu.net>
630 * tests/others.at (stdin closed): Update to match previous patch.
632 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
634 Reported by Ralf Wildenhues.
636 * modules/m4.c (undivert): Merge from branch.
637 * doc/m4.texinfo (Improved fatal_error): Fix typo.
638 (Improved exch): New node, copied from branch.
639 (Improved cleardivert): Update from branch.
642 2006-10-13 Eric Blake <ebb9@byu.net>
644 * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
646 * modules/gnu.c (builtin, indir): Transparently handle builtin
648 * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
649 * m4/input.c (m4_pop_wrapup): Display debug message when switching
651 (m4_input_init): No need to use empty file any more.
652 (file_print): Display correct file name.
653 * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
654 dereference a NULL file name.
655 * m4/m4module.h (m4_pop_wrapup): New parameter.
656 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
658 * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
659 * m4/symtab.c (m4_symbol_value_groks_macro): New method.
660 * src/main.c (main): Adjust caller.
661 * tests/options.at (--debugmode): Test more output from -dV.
663 2006-10-12 Eric Blake <ebb9@byu.net>
665 * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
667 * m4/m4private.h (m4__next_token_is_open): New prototype.
668 * m4/m4module.h (m4_push_single): Delete; push_string is an
669 adequate interface, and removing support for this simplifies the
671 (m4_push_wrapup): New parameter.
672 (m4_is_syntax): Delete; m4_has_syntax is sufficient.
673 (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
674 start-quote and start-comment exclusive from other syntax
676 * m4/syntax.c: Likewise.
677 * m4/input.c (input_funcs): Make polymorphic without requiring
678 clients to know whether they are located at isp. All users
680 (file_names): New variable.
681 (m4_input_init): Initialize it.
682 (m4_push_file): Use it.
683 (m4_input_exit): Free it after use.
684 (m4__next_token): Simplify slightly.
685 (m4__peek_token): Rename and simplify...
686 (m4__next_token_is_open): ... to this. In particular, this
687 allows us to avoid a double ungetc, which POSIX doesn't
689 (struct m4_input_block, m4_push_single, single_peek, single_read):
690 Remove support for single characters, as the input engine now
691 guarantees we don't need it.
692 (file_unget, string_unget, m4_input_print, unget_input):
693 Strengthen assertions.
694 (file_init_funcs, file_read_init): New for file reading.
695 (string_init_funcs, string_read_init): New for wrapped text.
696 (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
697 Support wrapped text with locations.
698 (m4_skip_line): Support dnl across include file boundary.
699 (peek_char): Don't pop input when peeking.
700 (file_peek): Peek can be called at the end of the file.
701 (string_read): Don't read beyond string bounds.
702 * m4/macro.c (expand_token, collect_arguments): Update callers.
703 (expand_macro): Report errors at location of open parenthesis.
704 (expand_token, expand_argument, process_macro): Avoid negative
705 array dereferences with m4_has_syntax.
706 * m4/utility.c (skip_space): Likewise.
707 * modules/m4.c (m4wrap): Update caller.
708 * tests/builtins.at (__file__, __line__, dnl): New tests.
709 * tests/options.at (--debugmode): Normalize the output.
710 * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
711 Remerge recent changes from branch.
712 (Improved fatal_error): New node from branch.
714 2006-10-11 Eric Blake <ebb9@byu.net>
716 * src/main.c (usage, long_options): Add --debugmode as an alias
717 for --debug, to match macro name.
718 * tests/options.at (--debugmode): Rename from --debug, and test
720 (--discard-comments): Augment test.
721 * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
724 2006-10-10 Eric Blake <ebb9@byu.net>
726 Trace improvements: debugmode(c) was always printing the last two
727 lines paired, combine them; and show non-text expansions.
728 * m4/macro.c (trace_prepre): Update to show what the macro will
730 (trace_pre): No need to special-case on debugmode(c).
731 (trace_post): Likewise. Also, show non-text expansions.
732 (expand_macro): Update caller. Collecting arguments can change
733 debug mode, so cache values beforehand.
734 (trace_format): Remove support for unused %l%S%r, and fix support
735 for %z to match gcc's attribute((printf)).
736 (trace_header): Update caller.
737 * m4/input.c (struct m4_input_block): Rename from input_block.
738 (struct input_funcs): Add print_func member.
739 (file_print, builtin_unget, builtin_print, string_print)
740 (m4_input_print): New functions.
741 (m4_push_string_finish): Change return type.
742 (m4_push_file): Fix missing use of close parameter.
743 * m4/debug.c (m4_debug_decode): Don't clear pending traces.
744 * m4/m4module.h (m4_input_print): New prototype.
745 * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
746 to match behavior change.
747 * tests/options.at (--debug): Likewise.
748 * tests/macros.at (Propagation of traceon)
749 (Propagation of --trace): Likewise.
750 * tests/others.at (stderr closed, stdout closed, stdin closed):
752 * doc/m4.texinfo (Forloop): Simplify.
753 (Trace): Update to changed behavior.
754 (Debugmode): Document this change.
755 * src/main.c (usage): Likewise.
758 2006-10-09 Eric Blake <ebb9@byu.net>
760 * m4/path.c (m4_include_env_init): Don't alter result of getenv.
761 Reported by Ralf Wildenhues.
763 * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
765 2006-10-07 Eric Blake <ebb9@byu.net>
767 * m4/m4module.h (m4_set_exit_failure): New prototype.
768 * m4/utility.c (m4_set_exit_failure): New function.
769 * modules/m4.c (m4exit): Use it to avoid yet another global
770 variable export in libm4.
772 2006-10-06 Eric Blake <ebb9@byu.net>
774 * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
776 * tests/others.at (stdout closed): Fix final check.
778 Replace uses of tmpfile with clean-temp, since tmpfile is
779 incompatible with closeout.
780 * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
782 * tests/others.at (stderr closed): Likewise.
783 * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
784 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
786 * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
787 (m4_tmpfile, cleanup_tmpfile): New functions.
788 (make_room_for, m4_insert_diversion): Use clean-temp module.
789 * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
791 * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
793 * m4/utility.c (m4_numeric_arg): Merge from branch.
794 * modules/gnu.c (debuglen): New builtin.
795 * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
796 Rename --arglength to --debuglen.
797 * tests/options.at (--arglength): Rename to --debuglen.
798 (deprecated options): Augment test.
799 * doc/m4.texinfo (Invoking m4): Document the name change.
800 (Debugmode): Rename from Debug Levels.
801 (Debugfile): Rename from Debug Output.
802 (Debuglen): New node.
803 * NEWS: Document these changes.
805 * modules/m4.c (m4exit): Fix typo. Ensure desired exit status in
806 case closing a module exits.
808 * modules/m4.c (m4exit): Merge from branch.
809 * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
811 2006-10-05 Eric Blake <ebb9@byu.net>
813 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
815 * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
816 * src/main.c (main): Close stdout on exit.
817 * m4/debug.c (set_debug_file): Check for write failure.
818 * m4/m4.c (m4_delete): Don't mask write failure.
819 * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
820 macros before calling AT_CHECK.
821 (M4_ONE_MEG_DEFN): New helper macro.
822 * tests/others.at (stdout full): New test.
823 (stderr closed, stdin closed, stdout closed): Augment.
824 * tests/builtins.at (syscmd): New test.
827 2006-10-04 Eric Blake <ebb9@byu.net>
829 * tests/builtins.at: Alphabetize tests.
830 * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
831 * tests/generate.awk (new_test): Fix underquoting.
832 * tests/others.at (maketemp): Rename from misc.
833 (stdin closed, stdout closed, stderr closed): New tests.
835 2006-10-03 Eric Blake <ebb9@byu.net>
837 Avoid all global variables in modules, so that --disable-static
839 * examples/incl.m4: New file, from branch.
840 * Makefile.am (dist_pkgdata_DATA): Distribute it.
841 * doc/m4.texinfo (Location): Merge this section from branch.
842 (Include): Update the test.
843 * tests/generate.awk (new_test): Allow for VPATH build
844 pre-processing of expected __program__ output.
845 * m4/m4module.h (m4_current_diversion, m4_output_current_line):
846 Avoid global variables.
847 (m4_context_field_table): Add current_diversion, output_line.
848 (m4_output_init, m4_make_diversion): Add parameter.
849 (m4_get_program_name, m4_set_program_name): New accessors.
850 * m4/m4private.h (m4_get_current_diversion),
851 (m4_set_current_diversion, m4_get_output_line)
852 (m4_set_output_line): New accessors.
853 * m4/utility.c (m4_get_program_name, m4_set_program_name): New
855 * modules/m4.c (divnum, divert): Adjust callers.
856 * modules/gnu.c (__program__): Likewise.
857 * m4/output.c (m4_output_init, m4_make_diversion)
858 (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
859 (m4_insert_diversion): Likewise.
860 * m4/input.c (file_clean, m4_push_file): Likewise.
861 * src/freeze.c (reload_frozen_state): Likewise.
862 * src/main.c (main, usage): Likewise.
864 Partially plug memory leak when unloading gnu module.
865 * tests/modules.at (unload gnu module): New test.
866 * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
867 (m4_regexp_compile): Move static storage to module visibility.
868 * tests/options.at (--debug): Adjust to new output.
870 2006-09-29 Eric Blake <ebb9@byu.net>
872 Even when not the first option, --help can't have side effects.
873 * tests/options.at (--debugfile): Detect bugs in this area.
874 * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
876 * src/main.c (main): Fix it by deferring debugfile change. Also,
877 defer closing streams until after module tracing is done.
878 * modules/gnu.c (debugfile): Make message consistent with command
880 * doc/m4.texinfo (Invoking m4): Touch up the documentation.
881 * NEWS: Document this fix.
883 * modules/m4.c (dnl): Include macro name in warning message.
884 * m4/input.c (m4_skip_line): Add parameter.
885 * m4/m4module.h (m4_skip_line): Likewise.
886 * src/main.c (usage): Update wording.
887 * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
888 issue of blind macros vs. POSIX is resolved.
889 (Dnl): Merge another node from branch.
891 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
893 * m4/system_.h (N_): Define.
894 * src/main.c (main): Validate numeric arguments.
895 (size_opt): New function, idea borrowed from coreutils.
896 * m4/macro.c (expand_macro): -L0 implies no limit.
897 * doc/m4.texinfo (Invoking m4): Document this change.
899 * tests/options.at: (--arglength, --nesting-limit)
900 (--regexp-syntax): New tests of argument validation.
902 2006-09-28 Eric Blake <ebb9@byu.net>
904 * tests/options.at: Alphabetize the tests.
906 2006-09-27 Eric Blake <ebb9@byu.net>
908 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
909 another parameter to print module info.
910 * m4/macro.c (trace_pre): Adjust caller.
911 * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
912 * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
913 * NEWS: Document this.
915 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
917 * m4/symtab.c (symbol_value_print): Rename to...
918 (m4_symbol_value_print): ...this, and...
919 (m4_symbol_print): Update to allow -L length truncation. Now
920 truncation also affects dumpdef output and builtin names.
921 * m4/m4private.h (nesting_limit, max_debug_argument_length):
923 * m4/m4module.h (m4_symbol_print): Add parameter.
924 (m4_symbol_value_print): New function.
925 * modules/m4.c (dumpdef): Allow length truncation.
926 * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
928 * doc/m4.texinfo (Invoking m4): Document -l better.
929 (Dumpdef, Debug Levels): Document the effect of -l.
930 * NEWS: Document this change.
932 * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
933 (m4_expand_ranges): Ensure we aren't picking up partial object on
935 * modules/stdlib.c (setenv): Allow extra arguments.
936 * modules/time.c (ctime): Avoid side effect in call to
938 * modules/gnu.c (m4_regexp_substitute): Likewise.
939 (renamesyms): Avoid extra obstack_init.
940 * src/freeze.c (reload_frozen_state): Remove debug comment.
941 (produce_frozen_state): Simplify fprintf to puts where possible.
942 * modules/modtest.c (modtest_init, modtest_finish): Likewise.
943 * modules/import.c (import, symbol_fail, modules_fail): Likewise.
944 * m4/macro.c (trace_flush): Likewise.
945 * m4/debug.c (m4_debug_message_prefix): Likewise.
946 * m4/path.c (include_dump): Likewise.
947 * m4/module.c (module_remove): Likewise.
948 (install_builtin_table): Simplify malloc and string
951 2006-09-26 Eric Blake <ebb9@byu.net>
953 * m4/m4module.h (m4_symbol_print): New prototype.
954 (M4_DEBUG_TRACE_STACK): New enumerator.
955 (m4_is_debug_bit): Allow use without requiring m4private.h.
956 * m4/symtab.c (symbol_value_print, m4_symbol_print): New
958 * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
960 (dumpdef): Allow printing pushdef'd stacks.
961 * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
962 * src/main.c (usage): Document it.
963 * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
966 * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
968 * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
969 of lines during make.
970 (AM_CPPFLAGS): Remove unneeded include path.
971 (src_m4_CPPFLAGS): Remove redundant include path.
972 * m4/system_.h Make preprocessor indentation consistent.
973 (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
975 (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
977 (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
978 (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
979 (bool, true, false): Don't undefine here; stdbool takes care of
981 * src/m4.h (includes): Assume config.h, and several standard
983 (__CYGWIN__, WIN32): Don't define here; let system.h do it.
984 * m4/m4private.h: Assume config.h.
985 * m4/output.c: Likewise.
986 * m4/path.c: Likewise.
987 * m4/resyntax.c: Likewise.
988 * m4/utility.c: Likewise.
989 * modules/gnu.c: Likewise.
990 * modules/import.c: Likewise.
991 * modules/load.c: Likewise.
992 * modules/m4.c: Likewise.
993 * modules/modtest.c: Likewise.
994 * modules/mpeval.c: Likewise.
995 * modules/perl.c: Likewise.
996 * modules/shadow.c: Likewise.
997 * modules/stdlib.c: Likewise.
998 * modules/time.c: Likewise.
999 * modules/traditional.c: Likewise.
1001 2006-09-21 Eric Blake <ebb9@byu.net>
1003 * doc/m4.texinfo (Invoking m4): Add clarification on option
1004 processing behavior.
1005 * tests/options.at (option grouping): Test this.
1007 Reported by Mikhail Teterin.
1009 * bootstrap: Add --force option, based on idea from coreutils.
1010 * README: Document that ./bootstrap and autoreconf are for
1011 developers, and not lightly done in tarballs.
1013 2006-09-20 Eric Blake <ebb9@byu.net>
1015 * src/main.c (usage, OPTSTRING, main): Rename -e to -i. Make
1016 warnings consistent.
1017 (long_options, HASHSIZE_OPTION): Warn on -H.
1018 * doc/m4.texinfo (Invoking m4): Document this.
1019 * tests/options.at (deprecated options): Update.
1021 Change the default of interactive sessions to match sh.
1022 * src/main.c (usage): Document this.
1023 (enum interactive_choice): New enum.
1024 (main): Use it to defer decision of interactive until after
1025 argument processing.
1026 * doc/m4.texinfo (Invoking m4): Document this.
1027 * NEWS: Likewise, plus add missing mention of -b.
1028 Reported by Stepan Kasal.
1030 2006-09-19 Eric Blake <ebb9@byu.net>
1032 * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
1033 well as --error-output; the goal is to add -o/--output in some
1034 future version with semantics like gcc or autom4te.
1035 * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
1036 (Extensions): Reflect this update.
1037 (Renamesyms): Add another test.
1038 (Defn): Xfail for now, so that `make check' is happy.
1039 * NEWS: Document this change.
1040 * tests/generate.awk: Mark dynamic loading tests as such. Allow
1042 * tests/macros.at (Renamesyms collisions): New test, exposing
1043 renamesyms' coredump.
1044 * tests/options.at (--debugfile, --safer): Update to match
1047 * m4/debug.c (set_debug_file): Fix regression in -o when stdout
1048 and stderr are same file, introduced 2003-07-23.
1049 * tests/options.at (--debugfile): New test, to catch the bug.
1050 (deprecated options): Test --error-output.
1051 * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
1052 Deprecate --error-output, and replace it with --debugfile.
1053 * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
1054 Document this change.
1057 2006-09-18 Eric Blake <ebb9@byu.net>
1059 * modules/load.c (modules): Rename to...
1060 (m4modules): ...this, since it is an English word with 0
1062 * modules/gnu.c (symbols, m4symbols): Likewise.
1063 * doc/m4.texinfo (Listing Modules): Rename to...
1064 (M4modules): ...this.
1065 (Symbols): Rename to...
1066 (M4symbols): ...this.
1067 (Load, Foreach, Trace, Answers): Update to new spellings.
1068 * NEWS: Document this.
1070 * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
1071 such that without arguments, the global trace flag is changed
1072 rather than walking the table of all currently-defined macros.
1073 (set_trace_CB): No longer needed.
1074 * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
1075 (m4_set_symbol_traced): Delete.
1076 (m4_symtab_create): Nuke the nuke parameter.
1077 * m4/m4private.h (m4_get_symbol_value): Delete.
1078 * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
1079 (m4_set_symbol_name_traced): Free undefined entries that are no
1081 (symbol_destroy_CB): Update caller.
1082 * m4/m4.c (m4_create): Update caller.
1083 * src/main.c (main): Likewise.
1084 (usage): Fix typo in last commit.
1085 * doc/m4.texinfo: Minor cleanups throughout.
1086 (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
1087 more nodes from branch.
1088 (Trace): Document new semantics, and how to simulate the old.
1089 * tests/builtins.at (multiquotes): Adjust to new semantics.
1090 * NEWS: Update somewhat.
1092 2006-09-14 Eric Blake <ebb9@byu.net>
1094 Add --safer option, per debian bug 5898.
1095 * src/main.c (usage): Document new option.
1096 (SAFER_OPTION): New enumerator.
1097 (main): Set the option bit.
1098 * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
1100 * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
1101 (m4_get_safer_opt): New accessor.
1102 * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
1103 * modules/m4.c (syscmd, maketemp): Likewise.
1104 * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
1105 (Sysval, Maketemp): Add tests of this.
1106 * tests/options.at (--safer): Likewise.
1108 2006-09-13 Eric Blake <ebb9@byu.net>
1110 * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
1112 Reported by Ralf Wildenhues.
1115 * Makefile.am (check_LTLIBRARIES): Build test libraries in the
1116 tests directory, so we can be sure an installed build is not
1117 picking up uninstalled non-test libraries.
1118 (check-local, installcheck-local): Depend on test libraries.
1119 * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
1120 after file name. Fix quoting. Remove skipping the test, now
1121 that makefile guarantees test modules will exist.
1122 (Freezing modules, modules: shadow, modules: unload)
1123 (modules: trace): Always put test modules in module path.
1124 (modules: importing): Likewise, and rely on AT_CHECK_M4 for
1126 * src/main.c (usage): Document default module search path.
1127 (import_environment, frozen_file_to_read, frozen_file_to_write):
1130 * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
1131 * tests/m4.in: ...not here.
1132 Reported by Ralf Wildenhues.
1134 2006-09-08 Eric Blake <ebb9@byu.net>
1136 * bootstrap: Kill unrelated copy-n-paste code from argument
1137 parsing. Let Makefile generate testsuite.
1138 * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
1140 2006-09-07 Eric Blake <ebb9@byu.net>
1142 * m4/m4module.h (m4_peek_input): No longer export.
1143 (m4_error_at_line, m4_warn_at_line): New prototypes.
1144 (m4_is_symbol_void): New macro.
1145 (m4_push_file): Update prototype.
1146 * m4/m4private.h (m4__peek_token): New prototype.
1147 (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
1148 * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
1149 * src/main.c (main): Allow reading from stdin twice.
1150 * modules/m4.c (include): Adjust to new prototype.
1151 * m4/input.c: General comment cleanup.
1152 (file_peek, file_read, file_unget, push_file): Set end flag on
1153 EOF, so that we don't call getc twice.
1154 (push_file, file_clean): Port fix from branch to avoid closing
1156 (pop_input): Port fix from branch to avoid reading free'd memory
1157 when input ends mid-string.
1158 (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
1159 (string_peek, string_read): Always use unsigned char.
1160 (m4_skip_line): Warn when dnl cut short by EOF.
1161 (peek_input): Rename from m4_peek_input.
1162 (match_input): Update signature, to distinguish between `(' token
1163 and multi-char quote or comment beginning with `('.
1164 (m4_input_exit): Cleanup now done in m4_pop_wrapup.
1165 (m4__peek_token): New function, ported from branch.
1166 (m4__next_token): Update to new token types.
1167 * m4/macro.c (expand_token, expand_argument): Use peek_token.
1168 * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
1169 (Invoking m4): Remerge from branch.
1171 * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
1172 (check-local): and put dependency here.
1173 Reported by Ralf Wildenhues.
1175 2006-09-05 Eric Blake <ebb9@byu.net>
1177 * m4/m4module.h (m4_debug_message): New prototype.
1178 (M4_DEBUG_TRACE_MODULE): New debug bit.
1179 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
1180 (M4_DEBUG_MESSAGE2): Delete these macros.
1181 * m4/debug.c (m4_debug_message): New method.
1182 (m4_debug_decode): Add module tracing as flag `m'.
1183 * m4/input.c (m4_push_file, file_clean): Use new method.
1184 * m4/path.c (m4_path_search): Likewise.
1185 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
1186 * m4/module.c (install_builtin_table, install_macro_table)
1187 (m4__module_open, module_close, module_remove): Promote several
1188 module debug messages outside of DEBUG_MODULES.
1189 (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
1190 DEBUG_MODULES with normal trace output.
1191 * src/main.c (usage): Document new flag.
1192 * doc/m4.texinfo (Debug Levels): Likewise.
1193 * Makefile.am ($(TESTSUITE)): Add missing dependency.
1194 * tests/m4.in: Neutralize platform-dependent module filenames.
1195 * tests/options.at (--debug): Update expected output.
1197 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1199 * doc/m4.texinfo: Fix some typos.
1200 * tests/others.at: Likewise.
1202 2006-09-05 Eric Blake <ebb9@byu.net>
1204 * m4/input.c (lex_debug): Remove dead code that broke compilation
1205 with --enable-debug.
1206 * m4/module.c (install_builtin_table, install_macro_table)
1207 (m4__module_init, m4__module_open, module_close)
1208 (module_remove): Fix compilation when --enable-debug.
1209 * m4/output.c (m4_shipout_text): Likewise.
1210 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
1211 libraries when --enable-debug.
1212 * configure.ac (DYNAMIC_MODULES): New variable, to pass
1213 information to testsuite.
1214 (modules to preload): Determine modules after we know whether
1215 shared libraries are supported.
1216 * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
1218 * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
1219 * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
1220 (modules: shadow, modules: unload, modules: importing)
1221 (modules: trace): Use new macro.
1222 * tests/builtins.at (gmp): Likewise.
1224 * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
1226 (expand_token): Avoid assertion just added to docs.
1227 (expand_macro): Track pending expansions, for when a symbol's
1228 definition changes during argument collection.
1229 (m4_macro_call, process_macro): Operate on symbol value, not
1230 symbol, since symbol may have changed during argument collection.
1231 * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
1232 (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
1233 (m4_get_symbol_value): Add fast macro version.
1234 * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
1235 (m4_macro_call): Adjust prototype.
1236 * m4/module.c (install_builtin_table): Check that flags are valid
1237 when creating builtin.
1238 * m4/symtab.c (m4__symtab_remove_module_references): Use
1239 m4_symbol_value_delete, rather than inlining it.
1240 (m4_symbol_value_copy): Copy placeholder text.
1241 (symbol_popval): Use m4_symbol_value_delete.
1242 (m4_symbol_value_delete): Implementation was missing when NDEBUG.
1243 Handle pending expansions.
1244 * modules/gnu.c (indir): Update to new prototype.
1245 * doc/m4.texinfo: Fix menus to be consistent with section names.
1246 (Defn): Add test that macro tokens flatten to empty string;
1247 triggered an assert before this patch.
1248 (Ifelse): Merge another node.
1249 (Loops): Split into...
1250 (Forloop, Foreach): New nodes; work is still underway on them.
1251 (Answers): Add more info on foreach macro; work is still underway.
1252 (Indir): Add test that indir collects arguments before looking up
1254 * TODO: Update based on this patch.
1256 2006-09-01 Eric Blake <ebb9@byu.net>
1258 * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
1259 * m4/hash.h (m4_free_hash_iterator): New prototype.
1260 * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
1261 ensure we don't do unsafe things while iterating.
1262 (HASH_ITER, ITER_CHAIN): New accessor macros.
1263 (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
1264 (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
1265 (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
1266 (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
1267 to catch unsafe actions.
1268 (m4_free_hash_iterator): New function, to avoid memory leaks, and
1269 when debugging, to track safe actions.
1270 (m4_hash_apply): Avoid memory leak.
1271 * m4/symtab.c (m4_symtab_apply): Likewise.
1272 * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
1273 in manually to src/ for now.
1274 * tests/builtins.at (gmp): Add keyword module.
1275 * tests/modules.at (Freezing modules, modules: shadow)
1276 (modules: unload, modules: importing, modules: trace): Likewise.
1278 2006-08-30 Eric Blake <ebb9@byu.net>
1280 * m4/utility.c (m4_warn): Factor "Warning" out of messages into
1282 (m4_bad_argc, m4_numeric_arg): Update all callers.
1283 * m4/macro.c (m4_macro_call): Likewise.
1284 * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
1285 (Indir, Builtin, Ifdef): More doc merges.
1286 (Loops): Mention that documenting foreach would be nice.
1287 (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
1288 (Include, Eval, Location, M4exit): s/input.m4/stdin/.
1289 * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
1290 (substitute, syncoutput): Update all m4_warn callers.
1291 * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
1292 (traceon, traceoff): Make warning message consistent.
1293 (define, pushdef): Update all m4_warn callers.
1294 * tests/generate.awk: Choose file name so that documentation can
1295 show command-line behavior.
1296 * tests/builtins.at (define): Update to new wording.
1297 * tests/macros.at (pushdef/popdef): Likewise.
1298 * tests/freeze.at (loading format 1): Likewise.
1299 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
1301 * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
1303 (Defn): Add failing test case for mixing text and builtin.
1304 (Renamesyms): Improve wording, and identify core dump that needs
1307 2006-08-29 Eric Blake <ebb9@byu.net>
1309 * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
1310 (Arguments, Pseudo Arguments): More doc merges from the branch.
1311 (Macro expansion): Turn example into test.
1312 (Pseudo Arguments): Add example of avoiding argument.
1313 * modules/m4.c (undefine, popdef): Accept multiple arguments.
1314 (define, pushdef): Warn on non-text macro name.
1315 (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
1316 warning/error messages.
1317 (ifdef): Ignore extra arguments.
1318 * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
1319 (m4__symtab_remove_module_references): Check that there is no leak.
1320 * tests/macros.at (pushdef/popdef): Update to new message.
1321 * tests/builtins.at (define): Likewise.
1322 * tests/freeze.at (loading format 1): Likewise.
1323 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
1325 * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
1326 (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
1327 as accessor function, to avoid compiler warning.
1328 * m4/module.c (m4__module_open): Move declaration of variable to
1329 avoid compiler warning.
1330 * src/main.c (main): Avoid shadowing a global variable.
1331 * src/freeze.c (produce_symbol_dump): Avoid unused variable
1332 warning when NDEBUG.
1333 * tests/options.at (--discard-comments, --import-environment)
1334 (--debug, --prepend-include, --help and --version): Rename tests
1335 to name option tested.
1337 2006-08-28 Eric Blake <ebb9@byu.net>
1339 * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
1340 * m4/module.c (install_builtin_table): ...to here, and add
1341 assertion that blind macros require arguments.
1342 * m4/m4module.h (struct m4_builtin): Document restrictions that
1343 must be met during module loading.
1344 * modules/gnu.c (changeresyntax, changesyntax): These are blind,
1345 so require an argument to avoid triggering assertion.
1346 (debugfile): Tweak error message.
1348 2006-08-25 Eric Blake <ebb9@byu.net>
1350 * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
1351 (M4_BUILTIN_SIDE_EFFECT): New enumerators.
1352 (struct m4_builtin): New member flags replaces groks_macro_args,
1353 blind_if_no_args. min_args and max_args are now 0-based.
1354 Rearrange members to reduce size on platforms where function
1355 pointers are 64 bits but regular pointers are 32.
1356 (m4_bad_argc): Add argument.
1357 * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
1358 * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
1359 effect into account.
1360 * m4/module.c (install_builtin_table): Adjust all users affected
1362 * m4/macro.c (m4_macro_call): Likewise.
1363 * src/freeze.c (reload_frozen_state): Likewise.
1364 * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
1365 * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
1366 * modules/import.c (builtin_functions): Likewise.
1367 * modules/load.c (builtin_functions): Likewise.
1368 * modules/modtest.c (builtin_functions): Likewise.
1369 * modules/mpeval.c (builtin_functions): Likewise.
1370 * modules/perl.c (builtin_functions): Likewise.
1371 * modules/shadow.c (builtin_functions): Likewise.
1372 * modules/stdlib.c (builtin_functions): Likewise.
1373 * modules/time.c (builtin_functions, mktime_functions)
1374 (strftime_functions): Likewise.
1375 * doc/m4.texinfo (Loops): Update test now that shift is blind.
1376 (Macro Arguments): Fix typo in test.
1377 (Patsubst): Fix typo in test.
1378 * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
1379 end of string. Fix return value when ignore_duplicates.
1380 * tests/builtins.at (patsubst): Fix typo in test.
1382 * tests/options.at (debug-flags): Update to reflect new message.
1383 (deprecated options, prepend-include, help and version): New
1385 * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
1386 test omits an input file name.
1387 * src/main.c (long_options, main): Add -B/--prepend-include.
1388 (usage): Document it.
1389 (main): `m4 --help --version' now displays help, not version.
1390 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
1391 dirname filenamecat.
1392 * m4/m4module.h (m4_add_include_directory): Add parameter.
1393 * m4/m4private.h (m4__include_init): New prototype.
1394 * m4/m4.c (m4_create): Put `.' on path before options are
1396 * m4/path.c (includes): Assume C89. Use gnulib for file name
1398 (m4__include_init): New function.
1399 (search_path_add): Allow prepending.
1400 (m4_add_include_directory, search_path_env_init): Adjust callers.
1401 (m4_path_search): Relative names now invoke path search, since
1402 `.' might not be first.
1403 * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
1405 2006-08-25 Bruno Haible <bruno@clisp.org> (tiny change)
1406 and Eric Blake <ebb9@byu.net>
1408 * bootstrap: Run autopoint before gnulib-tool, since autopoint
1409 0.15 installs macros obsoleted by current gnulib.
1411 2006-08-25 Eric Blake <ebb9@byu.net>
1413 * doc/m4.texinfo (Macro Arguments): Another section merged;
1414 testsuite failures now exposed.
1416 2006-08-23 Eric Blake <ebb9@byu.net>
1418 * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
1419 (Input processing): More doc merges from the branch.
1420 (Regular expression syntax): Add introductory text.
1421 (Inhibiting Invocation): More doc merges from the branch.
1422 (Other tokens): Reorder after comments.
1423 * tests/generate.awk: Allow passing options to doc examples.
1425 2006-08-22 Eric Blake <ebb9@byu.net>
1427 * tests/options.at (debug-flags): New test.
1428 * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
1429 not negative, to distinguish failure in m4_debug_decode.
1430 (m4_debug_decode): Add new parameter.
1431 * modules/gnu.c (regexp): Slight cleanup.
1432 (renamesyms): Ignore excess arguments.
1433 (syncoutput): Make case-insensitive, warn on bad argument.
1434 (debugmode): Factor -+ handling out to...
1435 * m4/debug.c (m4_debug_decode): ...here.
1436 (m4_debug_message_prefix): Fix spacing.
1437 * src/main.c (main): Let -d option adjust flags.
1438 * m4/input.c (file_clean): Avoid printing empty file name.
1439 * doc/m4.texinfo (Syncoutput): Document new range of input.
1440 (Invoking m4): Document use of multiple -d flags.
1442 Start porting various fixes from the branch that use gnulib.
1443 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
1444 binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
1445 regexprops-generic stdlib-safer unlocked-io.
1446 * m4/debug.c (m4_debug_set_output): Close debug file on exec.
1447 * m4/path.c (m4_path_search): Close input file on exec, reject
1448 empty file name, fix parameter naming.
1449 * m4/output.c (make_room_for): Close diversion file on exec.
1450 (includes): Assume C89 headers.
1451 (tmpfile): For now, we don't want tmpfile-safer, because we want
1453 * m4/m4private.h (includes): Use various gnulib headers.
1454 * doc/regexprops-generic.texi: Use gnulib's copy.
1456 * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
1457 * AUTHORS: Add copyright.
1458 * ChangeLog: Likewise.
1459 * README: Likewise. Require automake 1.9b or later.
1460 * HACKING: New file.
1461 * README-alpha: Add copyright.
1462 * THANKS: Likewise. Update.
1463 * doc/STYLE: Add copyright, and tweak for changed directories.
1464 * modules/README: Add copyright, and tweak for libtool version.
1465 * examples/COPYING: New file.
1466 * examples/WWW/COPYING: Likewise.
1467 * examples/WWW/m4lib/COPYING: Likewise.
1468 * modules/shadow.m4: Add copyright.
1469 * modules/perl.m4: Likewise.
1470 * modules/modtest.m4: Likewise.
1471 * modules/stdlib.m4: Likewise.
1472 * modules/time.m4: Likewise.
1473 * modules/time2.m4: Likewise.
1474 * po/Makevars: Likewise.
1475 * tests/iso8859.m4: Likewise.
1476 * tests/m4.in: Likewise.
1477 * NEWS: Add (C) to copyright.
1479 * m4/system_.h: Likewise.
1480 * tests/atlocal.in: Likewise.
1481 * tests/builtins.at: Likewise.
1482 * tests/freeze.at: Likewise.
1483 * tests/generate.awk: Likewise.
1484 * tests/macros.at: Likewise.
1485 * tests/modules.at: Likewise.
1486 * tests/options.at: Likewise.
1487 * tests/others.at: Likewise.
1488 * tests/testsuite.at: Likewise.
1489 * m4/utility.c: Spell out copyright years.
1490 * src/main.c: Likewise.
1492 * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
1494 2006-08-21 Eric Blake <ebb9@byu.net>
1496 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
1497 * modules/gnu.c (esyscmd): Use -1 for failure. Set sysval to 0
1498 when no arguments are given, but without losing warning about 0
1500 * modules/m4.c (syscmd): Likewise.
1501 (includes): Assume C89.
1502 (m4_sysval): Make static.
1503 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
1504 (sysval): Port calculation from branch.
1506 2006-08-20 Eric Blake <ebb9@byu.net>
1508 * m4/macro.c (expand_macro): Move argument check...
1509 (m4_macro_call): ...to here, so indir will warn.
1510 * modules/gnu.c (__program__): New macro, ported from branch.
1511 (builtin): Perform argument check.
1512 (changesyntax): Avoid out-of-bounds read.
1514 * modules/gnu.c (includes): Assume stdlib.h, errno.
1515 (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
1516 (substitute): Add caller parameter, avoid out-of-bounds memory
1518 (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
1521 2006-08-16 Eric Blake <ebb9@byu.net>
1523 * po/POTFILES.in: Add more files that contain translatable
1525 * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
1526 information to translators.
1527 (USE_MSGCTXT): New var for gettext 0.15.
1528 * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
1529 debug/trace messages in lower case.
1530 * m4/macro.c (expand_argument): Likewise.
1531 * m4/path.c (m4_path_search): Likewise.
1532 * src/main.c (main): Likewise.
1534 2006-08-14 Eric Blake <ebb9@byu.net>
1536 * src/main.c (usage): Document --import-environment.
1537 * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
1539 2006-08-11 Eric Blake <ebb9@byu.net>
1541 * bootstrap (func_get_translations): Only remove files when doing
1543 (func_update_po): Avoid CDPATH problems.
1545 2006-08-10 Eric Blake <ebb9@byu.net>
1547 * bootstrap (func_get_translations): New function.
1548 (func_update_po): Borrow ideas from tar to correctly pull in
1549 translations from newer location.
1551 2006-08-09 Eric Blake <ebb9@byu.net>
1553 * bootstrap: Recent gnulib no longer has jm_* macros to worry
1555 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
1557 * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
1558 (m4_error, m4_warn): ... these new prototypes.
1559 (m4_current_file, m4_current_line): Move into context, rather
1560 than leaving as globals.
1561 (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
1562 (m4_undivert_all, m4_input_init): Now takes context.
1563 * m4/utility.c (m4_error, m4_warn): New functions.
1564 * m4/m4private.h: Assume errno exists.
1565 (struct m4): Move warning_status to a bit flag,
1566 and add exit_status. Adjust accessors accordingly.
1567 * src/main.c (print_program_name_CB): No longer needed.
1568 (main): Use new m4_get_fatal_warnings_opt.
1569 * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
1570 instead of issuing "INTERNAL ERROR". Pass context when needed,
1571 and use new accessors.
1572 * m4/input.c: Likewise.
1573 * m4/macro.c: Likewise.
1574 * m4/output.c: Likewise.
1575 * m4/utility.c: Likewise.
1576 * modules/evalparse.c: Likewise.
1577 * modules/gnu.c: Likewise.
1578 * modules/load.c: Likewise.
1579 * modules/m4.c: Likewise.
1580 * modules/mpeval.c: Likewise.
1581 * src/freeze.c: Likewise.
1582 * src/main.c: Likewise.
1583 * tests/macros.at: Adjust to new message format.
1584 * tests/builtins.at: Likewise.
1585 * tests/freeze.at: Likewise.
1586 * tests/modules.at: Likewise.
1587 * doc/m4.texinfo: Likewise.
1589 * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
1592 2006-08-03 Eric Blake <ebb9@byu.net>
1594 * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
1595 gracefully handle ENOSYS.
1599 2006-07-28 Eric Blake <ebb9@byu.net>
1601 * src/freeze.c (reload_frozen_state): Copy string when creating
1602 placeholder, to avoid memory corruption.
1603 * m4/symtab.c (symbol_popval): Avoid memory leak.
1604 (m4_symbol_rename): Avoid shadowing rename function.
1605 (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
1606 * tests/freeze.at (reloading unknown builtin): Add test.
1607 * tests/generate.awk: Capture m4.texinfo line number in
1608 testsuite.log, not just generated.at.
1610 Port idea from branch that a frozen file can request an unknown
1611 builtin without producing a warning unless the builtin is
1613 * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
1614 (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
1615 (m4_set_symbol_value_placeholder): New accessors.
1616 * m4/m4module.h (m4_is_symbol_placeholder),
1617 (m4_get_symbol_value_placeholder),
1618 (m4_set_symbol_value_placeholder),
1619 (m4_get_symbol_placeholder): Likewise.
1620 * m4/symtab.c (m4_is_symbol_value_placeholder),
1621 (m4_get_symbol_value_placeholder),
1622 (m4_set_symbol_value_placeholder): Likewise.
1623 (dump_symbol_CB): Handle new symbol type.
1624 * m4/macro.c (trace_pre): Likewise.
1625 (m4_macro_call): Warn when invoking a placeholder.
1626 * modules/m4.c (dumpdef): Handle dumping a placeholder.
1627 (defn): Warn when referencing a placeholder.
1628 * src/freeze.c (dump_symbol_CB): Ignore placeholder when
1630 (reload_frozen_state): When reloading unknown builtin, install a
1631 placeholder instead of warning.
1632 * tests/freeze.at (loading format 1): Allow warning when
1633 popdef'ing undefined function.
1635 2006-07-27 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
1637 * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
1638 function. Shift by 7, not 3, for consistency with
1639 gnulib/lib/hash.c. Don't assume hash word is 32 bits.
1641 2006-07-27 Eric Blake <ebb9@byu.net>
1643 * src/main.c (usage): Update to match branch.
1644 (main): Update --version info to distinguish between program name
1645 `m4' and package name `GNU M4'.
1646 (AUTHORS): Translate René Seindal's name.
1647 * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
1648 * Makefile.am (doc/m4.1): Update to match branch.
1649 * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
1652 * m4/system_.h (EXIT_MISMATCH): Define.
1653 * src/main.c (main): Don't clear syntax table for version 1.
1654 (usage): Document exit status.
1655 * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
1656 branch, and require V directive to appear first in file. Fix
1657 broken logic for detecting F and T in version 1 files.
1659 2006-07-22 Eric Blake <ebb9@byu.net>
1661 * src/main.c (stackovf_handler): Document the problems in our
1663 * src/stackovf.c: Forward port changes in branch to use POSIX
1664 sa_sigaction when available.
1665 (process_sigsegv): Avoid buffer overrun when error string is
1666 translated, although the fact that we translate in a signal
1667 handler is still a bug.
1668 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
1669 from branch to modernize checks.
1671 * modules/format.c (format): Avoid compiler warning that str may
1672 be used uninitialized.
1674 * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
1676 (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
1677 (DEBUG_MACRO): Remove unused macro.
1678 * src/stackovf.c: Avoid compiler warnings.
1679 * m4/input.c: Likewise.
1680 * m4/module.c: Likewise.
1681 * m4/output.c: Likewise.
1682 * m4/path.c: Likewise.
1683 * m4/symtab.c: Likewise.
1684 * m4/syntax.c: Likewise.
1686 2006-07-20 Eric Blake <ebb9@byu.net>
1688 * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
1689 Regenerate to explicitly ask for --assume-autoconf=2.60.
1691 2006-07-19 Eric Blake <ebb9@byu.net>
1693 * po/ChangeLog: Merge into main ChangeLog, then delete file.
1696 * doc/m4.texinfo (copying): Relax restriction on front-cover and
1699 2006-07-17 Eric Blake <ebb9@byu.net>
1701 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
1704 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
1706 * modules/format.c (includes): Use xvasprintf.h.
1707 (format): Make static. Avoid buffer overflow, that can lead to
1708 arbitrary code execution exploit. Only pass unsigned char to
1709 is*(). Support F, g, and G specifiers.
1710 * doc/m4.texinfo (Format): Expose buffer overrun bug. Document
1713 2006-07-17 Gary V. Vaughan <gary@gnu.org>
1715 Ensure M4 compiles correctly with -DDEBUG, and use a single
1716 consistent definition of various /DEBUG_[A-Z]+/ symbols:
1718 * m4/input.c: Have commented out out DEBUG_INPUT only by default.
1719 (m4_print_token): Use m4_get_symbol_value_text and
1720 m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
1721 and VALUE_FUNC respectively.
1722 (m4__next_token): Use m4_print_token call instead of obsolescent
1724 * m4/module.c: Have commented out out DEBUG_MODULE only by default.
1725 * m4/output.c: Similarly for DEBUG_OUTPUT.
1726 * m4/path.c: Similarly for DEBUG_INCL.
1727 * m4/symtax.c: Similarly for DEBUG_SYM.
1728 * m4/syntax.c: Similarly for DEBUG_SYNTAX.
1729 * src/stackovf.c: Similarly for DEBUG_STACKOVF.
1730 * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
1731 preprocessor macros defined with -DDEBUG compiles.
1733 2006-07-17 Gary V. Vaughan <gary@gnu.org> (tiny change)
1735 * bootstrap: Correct typo in --download-po argument parsing.
1737 2006-07-15 Eric Blake <ebb9@byu.net>
1739 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
1741 * tests/generate.awk (normalize): Recognize @tabchar.
1742 * doc/m4.texinfo (Top): Start merging from branch. Remove tabs.
1743 Fix menus. Upgrade FDL license from 1.1 to 1.2. Fix overfull
1745 (Index macro, Shell commands, Incompatiblities): Rename nodes
1746 from Index, UNIX commands, Other incompat.
1747 (Platform macros, Using frozen files, Frozen file format 1)
1748 (Frozen file format 2, Copying This Manual, Indices): New nodes.
1749 * Makefile.am (EXTRA_DIST): Distribute gendocs.
1750 (MAINTAINERCLEANFILES): Clean up files from gnulib.
1751 (doc_m4_TEXINFOS): Depend on fdl.texi.
1752 (web-manual): New maintainer target.
1754 2006-07-14 Gary V. Vaughan <gary@gnu.org>
1756 * doc/m4.texinfo (Modules): RMS asked me for an explanation of
1757 the modular architecture of M4. The result is paraphrased here
1758 for the benefit of future readers of the manual.
1760 2006-07-14 Gary V. Vaughan <gary@gnu.org> (tiny change)
1762 * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
1764 2006-07-14 Eric Blake <ebb9@byu.net>
1766 * src/main.c (main): Avoid compiler warning.
1767 * modules/gnu.c (renamesyms): Remove unused variable.
1769 2006-07-14 Gary V. Vaughan <gary@gnu.org>
1771 * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
1772 (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
1773 new functions for managing regexp syntax options.
1774 * m4/m4private.h (m4): Add regexp_syntax field.
1775 * m4/resyntax.c: New file implements the above.
1776 * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
1777 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
1778 (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
1779 (m4_patsubst_do, m4_renamesyms_do): Removed.
1780 (builtin_changeresyntax): New builtin to change regular expression
1782 (m4_resyntax_encode_safe): Factor out diagnostics code.
1783 * src/freeze.c (produce_resyntax_dump): New function to dump
1784 default regexp syntax specifier to frozen file.
1785 (reload_frozen_state): Updated to action 'R' directive.
1786 * src/main.c (usage): Describe new -r option.
1787 (long_options, OPTSTRING): Declare it.
1788 (main): Encode and store cli regexp syntax option argument.
1789 * tests/freeze.at (regexp syntax): New test that regexp syntax
1791 * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
1792 * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
1793 (Epatsubst and Patsubst): Renamed to...
1794 (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
1795 documentation and added new examples.
1796 (Changeresyntax): New section describing changeresyntax builtin,
1797 and regexp syntax names.
1798 (Regular expression syntax): New section describing differences
1799 between various regular expression syntaxes.
1800 (Frozen files): Document 'R' directive.
1803 2006-07-13 Gary V. Vaughan <gary@gnu.org>
1805 * bootstrap: Enhanced to work more like our other scripts:
1806 Add a copyright statement; support --version and --help; accept a
1807 --download-po option with argument as a substitute for DOWNLOAD_PO
1810 2006-07-11 Eric Blake <ebb9@byu.net>
1812 * Makefile.am (doc/m4.1): Port patch from branch that avoids
1814 * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
1817 2006-07-10 Gary V. Vaughan <gary@gnu.org> (tiny change)
1819 * tests/builtin.at (patsubst, regexp): Adjust these tests, now
1820 that `\0' is no longer accepted.
1822 * src/main.c (usage): Alphabetize options within their sections.
1824 * modules/gnu.c (m4_regexp_search, regsub, substitute)
1825 (esyscmd): Improve comments.
1827 * modules/gnu.c (substitute): Remove old warning for \0.
1828 (substitute_warned): No longer required. Removed.
1830 * modules/gnu.c: Put macro definitions into alphabetical order.
1832 2006-07-07 Eric Blake <ebb9@byu.net>
1834 * tests/freeze.at (loading format 1): New file, with new test.
1835 * tests/testsuite.at: Include it.
1836 * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
1837 * tests/modules.at (Freezing modules): Likewise.
1839 * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
1840 (AC_CHECK_HEADERS): Assume signal.h.
1841 (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
1842 (AC_CHECK_FUNCS_ONCE): Likewise.
1843 * src/m4.h (includes): Assume signal.h.
1845 2006-07-05 Eric Blake <ebb9@byu.net>
1847 Fix all testsuite failures on cygwin.
1848 * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
1849 branch-1_4. Solves testsuite failure when uninstalled m4 is
1850 shadowed by redefinition of PATH in libtool wrapper.
1851 * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
1852 contains the -no-undefined required by cygwin.
1853 (TESTS_ENVIRONMENT): Export abs_top_builddir.
1854 * tests/others.at (misc): Port to platforms where /etc/passwd
1855 does not exist or does not contain user named root.
1856 * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
1858 * tests/builtins.at (define, divert): Avoid overquoting.
1859 * tests/generate.awk (new_group): Likewise.
1861 2006-07-05 Gary V. Vaughan <gary@gnu.org>
1863 The regs_allocated field in a struct re_pattern_buffer refers
1864 to the state of a particular re_registers struct when used in
1865 successive matches using the same compiled pattern. Avoid a
1866 SEGV in `renamesyms' resulting from using a new re_registers
1867 with an existing re_pattern_buffer:
1869 * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
1870 pattern buffer and registers.
1871 (m4_regexp_search): New function to call re_regexp_search with
1872 correctly matched pattern buffer and register instantiations.
1873 (m4_regexp_compile): Return an m4_pattern_buffer. Adust all
1876 2006-07-04 Gary V. Vaughan <gary@gnu.org>
1878 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
1879 changes to gnulib getopt.m4 since last build.
1880 * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
1881 if the system getopt fails M4_GETOPT tests.
1883 2006-06-22 Eric Blake <ebb9@byu.net>
1885 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
1886 Reported by Bruno Haible.
1888 2006-06-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1890 * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
1892 2006-06-19 Eric Blake <ebb9@byu.net>
1896 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1898 * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
1899 (clean-local): Split into and depend upon...
1900 (clean-local-tests, clean-local-src): ...these two. The latter
1901 removes the libtool object directory below `src', to work around
1902 a buglet in Automake, failing to list it.
1903 (EXTRA_DIST): Distribute modules/perl.c.
1905 2006-06-19 Eric Blake <ebb9@byu.net>
1907 * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
1908 right side of dependency; VPATH does that.
1909 (stamp-vcl): Update to use libtool's algorithm.
1910 (EXTRA_DIST): Distribute stamp-vcl.
1911 Reported by Ralf Wildenhues.
1912 (TESTSUITE): Revert earlier change that used absolute path, as
1913 that broke 'make dist' in VPATH. Stick with $(srcdir) instead.
1914 (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
1915 (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
1916 atlocal takes care of it instead.
1917 (check-local, installcheck-local, clean-local): Inline absolute
1918 path to testsuite here, rather than relative path to testsuite
1921 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1923 * m4/m4private.h (DELETE): Cast away const here...
1924 * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
1925 * src/freeze.c (reload_frozen_state): Avoid uninitialized
1928 2006-06-19 Eric Blake <ebb9@byu.net>
1930 * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
1931 .info pages are built.
1932 Reported by Ralf Wildenhues.
1933 (EXTRA_DIST): Inline definition of testsuite, so that make dist
1936 2006-06-16 Eric Blake <ebb9@byu.net>
1938 Follow recommendations from autoconf manual for autotest.
1939 * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
1940 turn it into an absolute path until autotest provides an option
1941 that allows us to avoid changing directories. Properly quote
1943 (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
1944 (check-recursive): Delete unused target.
1945 ($(TESTSUITE)): Atomically update testsuite.
1946 (CD_TESTDIR): Simplify.
1947 (m4__cd): Delete unused macro.
1948 (check-local): Let TESTSUITEFLAGS influence the run.
1949 (installcheck-local): Let TESTSUITEFLAGS override
1950 AUTOTEST_PATH. Add dependencies.
1951 (clean-local): Clean up.
1952 (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
1953 * README: Document how to use the testsuite.
1955 2006-06-15 Eric Blake <ebb9@byu.net>
1957 * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
1959 * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
1960 clashes with m4sugar.
1961 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
1962 * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
1963 * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
1964 * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
1965 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
1966 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
1967 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
1968 * configure.ac: Likewise.
1969 (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
1970 * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
1972 * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
1974 Reduce compiler warnings. Inside GMP, mpq_t is an array type, so
1975 const mpq_t is not assignable from plain mpq_t. Avoid
1976 type-punning warnings caused trying to mix these types.
1977 * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
1978 (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
1979 * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
1980 (mult_term, exp_term): Remove type-punning casts.
1981 (numb_pow): Remove const qualifier.
1982 * src/freeze.c (reload_frozen_state): Fix typo in messages.
1983 Fix variables that can be used uninitialized, which fixes
1984 security hole where malicious frozen file can execute arbitrary
1987 2006-06-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1989 * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
1991 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1992 Eric Blake <ebb9@byu.net>
1994 Allow `make dist' to work again.
1995 * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
1996 (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
1997 (cvs-dist): Fix typo.
1998 * NEWS: Match current version number.
2000 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2002 * Makefile.am (AM_CPPFLAGS): Add $(LTDLINCL), so the right
2005 * bootstrap: Do not run libtoolize manually, this is done
2006 correctly by autoreconf. Invoke autoreconf with --no-recursive
2007 to avoid unnecessary rerunning of autotools for libltdl.
2009 2006-06-13 Eric Blake <ebb9@byu.net>
2013 2006-06-12 Eric Blake <ebb9@byu.net>
2015 * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
2017 * src/m4.h: Don't declare mktemp.
2018 * m4/input.c (m4__next_token): Avoid bzero.
2019 * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
2020 * Makefile.am (doc/m4.1): Depend on installed help2man, rather
2021 than distributing outdated helptoman.pl.
2022 * doc/helptoman.pl: Delete.
2024 2006-06-10 Eric Blake <ebb9@byu.net>
2026 * README (Patches): Document the current dependence on CVS
2027 builds of autotools.
2028 * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
2029 * configure.ac: Use consistent quoting throughout.
2030 (AC_PREREQ): Bump to 2.59d.
2031 (AC_INIT): Package name begins with uppercase.
2032 (AC_ARG_WITH): Use AS_HELP_STRING.
2033 (AM_INIT_AUTOMAKE): Enable gnits mode.
2034 (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
2035 (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
2036 (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
2037 done by gnulib or automake, or which autoconf has declared
2039 * m4/m4private.h (Includes): Assume C89 or better, and use errno
2041 * m4/output.c (Includes): Likewise.
2042 * modules/gnu.c (Includes): Likewise.
2043 * modules/m4.c (Includes): Likewise.
2044 * src/m4.h (Includes): Likewise.
2046 * README-alpha: Update web address.
2047 * README: Likewise. Change encoding to ASCII. Remove old advice
2048 about cygwin. Document bootstrapping dependency.
2049 * AUTHORS: Update from branch-1_4.
2050 * THANKS: Likewise. Change encoding to UTF-8.
2051 * BACKLOG: Delete. This file is too old and unmaintained to be
2053 * ChangeLog: Change encoding to UTF-8.
2055 Avoid compiler warnings.
2056 * m4/macro.c (trace_format): Don't mark this as a printf format,
2057 since we don't accept the same set of modifiers as printf. It
2058 would be nice if gcc let us specify a custom format archetype.
2059 * src/main.c (main): Cast away const.
2061 2006-06-10 Andreas Schwab <schwab@suse.de> (tiny change)
2062 Eric Blake <ebb9@byu.net>
2064 * modules/time.c (ctime): Pass correctly typed variable to
2067 (localtime): Likewise.
2068 (strftime): Likewise.
2069 * m4/utility.c (m4_numeric_arg): For now, document arbitrary
2070 limit inherent in this interface.
2072 2006-05-08 Bruno Haible <bruno@clisp.org> (tiny change)
2074 * modules/m4.c (WEXITSTATUS): Provide fallback definition.
2075 (sysval): Use WEXITSTATUS.
2076 * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
2077 big-endian and little-endian wait status definitions.
2079 2006-05-06 Eric Blake <ebb9@byu.net>
2081 * po/Makevars (MSGID_BUGS_ADDRESS): Add.
2082 * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
2085 2006-05-06 Eric Blake <ebb9@byu.net>
2087 * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
2088 subdirectory to use.
2089 (support for -pipe): Move after LT_INIT, since it relies on
2092 2006-05-05 Eric Blake <ebb9@byu.net>
2094 * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
2098 2006-05-05 Bruno Haible <bruno@clisp.org>
2099 Eric Blake <ebb9@byu.net>
2101 * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
2102 * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
2104 * bootstrap: Update usage of gnulib-tool.
2106 2006-05-04 Eric Blake <ebb9@byu.net>
2108 * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
2111 2005-12-05 Gary V. Vaughan <gary@gnu.org>
2113 * bootstrap (func_update_po): Synch with CVS GNU tar. wget 1.9.x
2114 and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
2115 Reported by Eric Blake <ebb9@byu.net>
2117 2005-12-04 Gary V. Vaughan <gary@gnu.org>
2119 * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
2120 http caching as -C is no longer supported by wget 1.10.x.
2121 Reported by Eric Blake <ebb9@byu.net>
2123 2005-10-20 Gary V. Vaughan <gary@gnu.org>
2125 * m4/module.c (caller_id): To match libtool-2.0 interface, changed
2127 (iface_id): ...an lt_dlinterface_id type.
2128 (m4__module_find): New abstraction for lt_dlhandle_fetch. Use
2129 throughout, instead of calling obsolete lt_dlhandle_find directly.
2130 (m4__module_next): Use multiloader-safe lt_dlhandle_iterate. Use
2131 throughout, instead of calling obsolete lt_dlhandle_next.
2132 * m4/m4private.h (m4__module_find): Declare it.
2133 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
2134 Use m4__module_next instead of obsolete lt_dlhandle_next.
2136 2005-10-20 Gary V. Vaughan <gary@gnu.org>
2138 * bootstrap (func_update_po): Update pofiles directly from the
2139 translation project.
2140 * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
2141 po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
2142 these files under source control anymore.
2143 Suggested by Eric Blake <ebb9@byu.net>
2145 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
2147 * ltdl/m4/m4-gnulib.m4: Update FSF contact address. Somehow this
2148 file escaped the address updates on 2005-05-01.
2150 2005-07-07 Gary V. Vaughan <gary@gnu.org>
2152 * bootstrap: Allow user overriding of gnulib-tool location, and
2153 correctly determine module source directories whether gnulib-tool
2154 is given as a relative or absolute path, or is found by searching
2156 Reported by Eric Blake <ebb9@byu.net>
2158 2005-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2160 * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
2161 and $RM are defined for various versions of
2162 AC_LIBTOOL_COMPILER_OPTION.
2164 * bootstrap (AUTORECONF): New variable to allow user overriding of
2167 2005-07-07 Gary V. Vaughan <gary@gnu.org>
2169 * doc/m4.texinfo (History): Add better notes on the ancestory of
2170 GNU m4, and other historical interest.
2172 2005-05-08 Gary V. Vaughan <gary@gnu.org>
2174 * m4/symtab.c (m4_symbol_rename): New function that performs a low
2175 level symbol rename.
2176 * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
2177 * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
2178 (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
2180 (erenamesyms, renamesyms): ...builtins that use these to implement
2181 macro renaming by regular expression.
2182 * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
2183 * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
2184 to stop the new generated tests from choking.
2186 2005-05-07 Gary V. Vaughan <gary@gnu.org>
2188 Since most of the build is handled from a single Makefile.am now,
2189 we can teach make about the dependencies between the m4 binary and
2190 the preopened modules it is built against:
2192 * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
2194 * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
2195 of the preopened modules have changed.
2197 2005-05-07 Gary V. Vaughan <gary@gnu.org>
2199 * configure.ac (gl_MODULES): Add mkstemp for machines that don't
2200 have a native implementation.
2202 2005-05-06 Gary V. Vaughan <gary@gnu.org>
2204 * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed. These are
2205 handled already by gnu/exit.h.
2207 * configure.ac (gl_MODULES): Add assert to support a
2208 --disable-assert configure time option for NDEBUG setting.
2210 * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
2211 * bootstrap (src_modules): Add version-etc-fsf.
2212 * src/main.c (version_etc_copyright): Removed.
2214 * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
2216 2005-05-04 Gary V. Vaughan <gary@gnu.org>
2218 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
2220 * src/freeze.c (produce_frozen_state): Use \n line-endings even
2221 on Windows, so that the frozen file reader will work.
2222 Reported by Josef T. Burger <bolo@bolo.com>
2224 2005-05-04 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
2226 Forward port of a patch that allowed m4-1.4.2 to compile on
2229 * configure.ac (AC_CHECK_HEADERS): Add signal.h,
2231 * src/m4.h: And include them as appropriate.
2232 * src/main.c, src/stackovf.h: Don't include signal.h literally;
2233 m4.h will include the correct file.
2235 2005-05-04 Gary V. Vaughan <gary@gnu.org>
2237 * m4/m4private.h: Make errno visible for the sources patched
2240 2005-05-04 Paul Eggert <eggert@twinsun.com>
2242 * src/main.c (print_program_name_CB): Preserve errno, since
2243 M4ERROR relies on this.
2244 * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
2245 * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
2246 * m4/path.c (m4_path_search): Don't let "free" trash errno when
2249 * m4/output.c (m4_insert_file): Don't assume errno has a valid
2250 value simply because fread returns zero. This fixes a
2251 portability bug reported by Marion Hakanson in
2252 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
2254 2005-05-04 Santiago Vila <sanvila@debian.org>
2256 * tests/stackovf.test: Use tempfile if available.
2258 2005-05-04 Robert Bihlmeyer <robbe@orcus.priv.at> (tiny change)
2260 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
2261 * m4/output.c (m4_insert_file): Do not mix buffered and
2262 unbuffered I/O, as this breaks on the Hurd.
2264 2005-05-04 Gary V. Vaughan <gary@gnu.org>
2266 Gnulib has changed again. Reimport. Adjust. Rinse. Repeat.
2267 Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
2268 and libtoolize does a better job of ltdl importing now too, so
2269 take advantage of that while updating the tree:
2271 * acm4, config: Moved from here...
2272 * ltdl/m4, ltdl/config: ...to here.
2273 * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
2274 src/Makefile.am, tests/Makefile.am: Removed...
2275 * Makefile.am: ...and migrated to here, with adjustments to
2276 compensate for relative path differences.
2277 * commit: Adjust relative paths.
2278 * configure.ac: Adjust relative paths.
2279 (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
2281 (LT_PREREQ): 2.0 isn't released yet, but will work when it is! In
2282 the meanwhile, CVS HEAD libtool is needed.
2283 (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
2284 stricly new enough, we also need a patch.
2285 (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
2286 (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
2287 (gl_MODULES): Don't list getopt and version-etc, as they don't
2289 * bootstrap: After running gnulib-tool to import the listed
2290 modules, fetch getopt and version-etc into src manually.
2291 (ltdldir): Change to ltdl.
2292 * src/main.c: Adjust for changes in version-etc API.
2293 * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
2294 but works when the getopt module isn't to be included in the lib.
2295 * README: Add note about patching autoconf and automake to
2298 2005-05-02 Matt Kraai <kraai@debian.org> (tiny change)
2300 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
2301 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
2302 empty file rather than to a nonexistent file. This closes a
2303 common security hole.
2304 * modules/m4.c (m4_maketemp): Implement the above, by using
2305 mkstemp rather than mktemp.
2307 2005-05-01 Gary V. Vaughan <gary@gnu.org>
2309 The FSF are moving offices today. Changed their contact address
2310 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
2311 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
2313 2005-03-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
2315 * tests/Makefile (clean-local): Ignore testsuite cleanup
2318 2005-03-11 Per Bothner <per@bothner.com> (tiny change)
2320 * tests/Makefile (clean-local): Only run the testsuite cleanup
2321 if the testsuite has been generated.
2323 2005-02-11 Stepan Kasal <kasal@ucw.cz>
2325 * TODO: slight clarification of the example of qindir usage.
2327 2005-02-08 Gary V. Vaughan <gary@gnu.org>
2329 * TODO: Add qindir requirement, and defn bug.
2330 From Stepan Kasal <kasal@ucw.cz>
2332 2005-02-08 Stepan Kasal <kasal@ucw.cz>
2334 * TODO: Add ``execution stack'', fix a typo.
2335 * doc/m4.texinfo: Typos.
2337 2004-12-24 Eric Blake <ebb9@byu.net>
2339 * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
2340 to the gnu subdirectory.
2341 * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
2342 * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
2343 * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
2344 * m4/system_.h: Likewise, in non-configured includes.
2346 2004-10-14 Noah Misch <noah@cs.caltech.edu>,
2347 Gary V. Vaughan <gary@gnu.org>
2349 * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
2350 Protect definitions from macro expansion under -DNDEBUG by
2351 parenthesising the expanded function names.
2352 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
2353 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
2354 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
2355 (m4_is_syntax_macro_escaped): Similarly protect function
2356 definitions from macro expansion under -DNDEBUG by #undefing the
2357 matching macro names before each definition. Also, move all the
2358 function definitions to the end of the file so that any
2359 invocations in the rest of the file pick up the fast macro
2361 * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
2362 (m4_set_debug_file, m4_set_trace_messages)
2363 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
2364 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
2365 (m4_set_max_debug_arg_length_opt): New fast macro versions of the
2366 option setter functions.
2368 2004-09-23 Gary V. Vaughan <gary@gnu.org>
2370 * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
2373 2004-09-23 Gary V. Vaughan <gary@gnu.org>
2375 * src/main.c: Include gnulib files from the correct directory.
2377 * gnulib/*: Don't store any of the gnulib files in arch, as they
2378 generate spurious changes.
2379 * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
2380 gnulib macros now share our macro directory.
2381 (SUBDIRS): Descend into `gnu' rather than `gnulib'.
2382 * bootstrap: Call gnulib-tool to import from the gnulib tree.
2383 (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
2384 gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
2385 the gettext macros from autopoint that overwrite the gnulib-tool
2386 imported versions. Import sources and Makefile.am into the `gnu'
2387 directory. Changed all callers.
2388 * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
2389 gl_INIT): Call these gnulib-tool macros instead of the hardcoded
2390 for imported modules.
2391 * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
2392 acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
2393 hardcoding the gnulib macros they wrap.
2395 2004-07-15 Gary V. Vaughan <gary@gnu.org>
2397 Latest CVS libtool can preload modules in libraries, including
2398 its own module loaders! Tweak m4 so that it doesn't try to treat
2399 libltdl's module loaders as m4 modules when freezing and on exit:
2401 * gnulib/acm4/*.m4: Don't store these files in arch since they
2402 generate spurious changes.
2403 * bootstrap: Simplify initial libtoolize call, since CVS
2404 libtoolize is smarter these days.
2405 * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
2407 * m4/module.h (m4__module_exit): Missing declaration.
2408 * m4/m4private.h (m4__module_next): New function declaration.
2409 * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
2410 encapsulation. Changed all callers.
2411 (m4__module_interface): New function to verify m4 loadable module
2413 (m4__module_init): Register the interface validator.
2414 (m4__module_exit): Only close my own modules.
2415 * modules/m4.c (unistd.h): Provide missing declaration.
2416 (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
2417 (m4_expand_ranges): More missing declarations.
2418 * modules/modtest.c (export_test): Ditto.
2419 * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
2420 * src/main.c (main): Bump copyright year.
2421 * tests/modules.at: Fix sed syntax error.
2424 2004-06-17 Gary V. Vaughan <gary@gnu.org>
2426 Tweaking to enable compilation with latest CVS libtool and
2427 libltdl. We can't just dump the library files directly into the
2428 m4 directory anymore now that libltdl is built from pieces itself:
2430 * bootstrap: Rewritten to use latest libtoolize sanely, and to
2431 set up libltdl subdirectory.
2432 * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
2433 gnulib subdirectory's config.
2434 (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
2435 (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
2437 (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
2438 configure.ac, so use AC_WITH_LTDL instead.
2439 * Makefile.am (SUBDIRS): Add libltdl.
2440 * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated. gnulib now uses
2442 * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
2443 (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
2444 (libm4_la_LIBADD): Add LIBLTDL.
2445 * m4/ltdl.c, m4/ltdl.h: Removed.
2446 * m4/m4module.h: Include canonical ltdl.h.
2449 2004-06-14 Gary V. Vaughan <gary@gnu.org>
2451 * gnulib/import: Now updates makefile fragments, and configure.ac.
2452 * gnulib/m4/gnulib.am: New file. Generated makefile fragments.
2453 * gnulib/m4/Makefile.am: include it.
2454 * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
2455 gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
2456 gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
2457 gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
2458 gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
2459 * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
2460 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
2461 gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
2462 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
2463 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
2464 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
2465 gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
2466 gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
2468 * gnulib/m4/getopt_int.h: New source file from latest gnulib
2470 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
2471 gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
2472 gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
2473 gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
2474 Updated source files from latest gnulib.
2476 2004-02-29 Gary V. Vaughan <gary@gnu.org>
2478 * config/mailnotify: New file for mailing commit notifications,
2479 imported from cvs-utils.
2480 * commit: Updated from cvs-utils and tweaked for m4.
2482 2003-12-01 Gary V. Vaughan <gary@gnu.org>
2484 * config/mkstamp: Updated from CVS libtool.
2485 * configure.ac: Generate a gnu coding standards compliant version
2486 number, and use it for the banner.
2487 * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
2488 mhen the TIMESTAMP changes in ChangeLog, but the file modification
2489 time doesn't (e.g. in cvs commit). Otherwise dist tarballs will
2490 contain the previous version number.
2491 * src/main.c: Make --version output conform to the GNU standard.
2493 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
2494 * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
2495 m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
2496 shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
2497 time_la_SOURCES): ...so that these are defaulted correctly, and
2498 can be removed from this file.
2499 (AM_LDFLAGS): Add -module...
2500 (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
2501 traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
2502 import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
2503 the individual settings can be removed.
2504 * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
2505 * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
2506 m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
2507 shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
2508 time_la_LIBADD): ...so that these are picked up as a deplib of
2509 libm4 and don't need to be set explicitly.
2511 2003-11-18 Gary V. Vaughan <gary@gnu.org>
2513 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
2514 from the standard build. It is too fragile.
2516 * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
2517 CVS libtool after merging m4 changes across to libtool.
2519 * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
2520 * m4/path.c (search_path_add): Ditto.
2522 2003-11-13 Gary V. Vaughan <gary@gnu.org>
2524 * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
2525 libtool tags we don't use in configure. This reduces the size
2526 of the script from over 1Mb to under 700Kb.
2528 2003-11-13 Gary V. Vaughan <gary@gnu.org>
2530 The import script was not written properly, and the last gnulib
2531 import was incomplete. Fixed that problem, and reimport our
2532 gnulib dependencies, which picks up the address calculation
2533 overflow checks described by Paul below. Also tweak the clients
2534 of the gnulib xalloc module not to use deprecated macros:
2536 * gnulib/import: Recurse through module dependencies rather than
2537 naively descending only one level.
2538 * configure.ac: Add calls to gnulib's strnlen and extension module
2540 * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
2542 * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
2543 gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
2544 gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
2545 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
2547 * gnulib/acm4/libtool.m4: Updated from CVS libtool.
2548 * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
2549 place of `xcalloc (1, S)'.
2550 * m4/m4.c (m4_create): Likewise.
2551 * m4/m4private.h (m4_symbol_value_create): Likewise.
2552 * m4/symtab.c (symtab_fetch): Likewise.
2553 * m4/syntax.c (m4_syntax_create): Likewise.
2554 * src/freeze.c (reload_frozen_state): Likewise.
2555 * m4/path.c (search_path_add): Eliminate use of deprecated NEW
2557 * m4/symtab.c (m4_symtab_create): Likewise.
2559 2003-11-13 Gary V. Vaughan <gary@gnu.org>
2561 * tests/module.at: Comment typo.
2563 2003-10-10 Gary V. Vaughan <gary@gnu.org>
2565 * tests/modules.at (modules: importing): Apply some lateral
2566 thinking, and use AT_CHECK to compare the output of a sed pass
2567 over stderr against the canonical strerror string.
2569 * tests/modules.at (modules: importing): Edit the generated stderr
2570 output to canonicalize strerror output, before a comparison.
2572 2003-10-10 Gary V. Vaughan <gary@gnu.org>
2574 Tru64UNIX perl is sloppy with namespace pollution. This patch is
2575 careful not to trip over the mess:
2577 * modules/perl.c: Some builds of perl install headers that contain
2578 `#define try __builtin_try'. Be sure to undefine that macro
2579 before `m4/hash.h' gets included, which uses the `try' symbol.
2580 * m4/system_.h: Similarly for `bool'. Undefine `bool', `true' and
2581 `false' before including `stdbool.h'.
2582 (DELETE): This symbol is not in m4's namespace, and is in any
2583 case only used internally...
2584 * m4/m4private.h (DELETE): ...so move it to here.
2585 Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
2587 2003-10-08 Paul Eggert <eggert@twinsun.com>
2589 Don't use XMALLOC and XCALLOC. Once we install the
2590 corresponding patch into gnulib, this will fix some
2591 address-calculation overflow bugs on hosts where calloc (A, B)
2592 returns garbage when A*B overflows.
2594 * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
2595 maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
2596 xmalloc, XCALLOC with xcalloc.
2597 * m4/m4.c (m4_create): Likewise.
2598 * m4/m4private.h (m4_symbol_value_create): Likewise.
2599 * m4/output.c (m4_output_init): Likewise.
2600 * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
2601 * m4/syntax.c (remove_syntax_attribute): Likewise.
2602 * src/freeze.c (reload_frozen_state): Likewise.
2603 * src/main.c (main): Likewise.
2605 2003-10-07 Gary V. Vaughan <gary@gnu.org>
2607 * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
2608 gnulib/acm4 directories for aclocal m4 macros.
2609 * gnulib/Makefile.am (EXTRA_DIST): Removed.
2610 (MAINTAINERCLEANFILES): Add Makefile.in.
2611 * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
2613 * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
2614 * gnulib/import: New file. Temporary script for updating gnulib
2615 imported files, until gnulib-tool is working.
2616 * gnulib/config/codeset.m4, gnulib/config/error.m4,
2617 gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
2618 gnulib/config/getopt.m4, gnulib/config/gettext.m4,
2619 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
2620 gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
2621 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
2622 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
2623 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
2624 gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
2625 gnulib/config/nls.m4, gnulib/config/obstack.m4,
2626 gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
2627 gnulib/config/progtest.m4, gnulib/config/realloc.m4,
2628 gnulib/config/regex.m4, gnulib/config/restrict.m4.
2629 gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
2630 gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
2631 gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
2632 gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
2633 gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
2634 gnulib/config/xstrndup.m4: Removed.
2635 * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
2636 gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
2637 gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
2638 gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
2639 gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
2640 gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
2641 gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
2642 gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
2643 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
2644 gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
2645 gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
2646 gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
2647 gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
2648 gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
2649 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
2650 gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
2651 gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
2652 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
2653 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
2654 gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
2655 gnulib/import script.
2656 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
2657 gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
2658 gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
2659 gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
2660 gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
2661 gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
2662 gnulib with gnulib/import script.
2663 * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
2664 guards ready for gnulib-tool to autoupdate on import.
2665 * config/debug.m4, config/gmp.m4, config/m4-error.m4,
2666 config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
2667 config/stackovf.m4: Moved from here...
2668 * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
2669 acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
2670 acm4/stackovf.m4: ...to here, to separate aclocal macros from
2671 configure time helper scripts.
2672 * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
2673 * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
2674 m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
2675 src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
2677 * src/main.c (version_etc_copyright): Only output the current
2679 (version_etc): Call with new variadic API.
2681 2003-09-16 Gary V. Vaughan <gary@gnu.org>
2683 * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
2684 version-etc module from CVS gnulib.
2685 * po/POTFILES.in: Add gnulib/m4/version-etc.c.
2686 * src/Makefile.am: Build it.
2687 * src/main.c: Use it.
2689 * gnulib/m4/exit.h: Import exit module from CVS gnulib.
2690 * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
2691 * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
2694 2003-09-15 Charles Wilson <cygwin@cwilson.fastmail.fm>,
2695 Gary V. Vaughan <gary@gnu.org>
2697 * bootstrap: Separate options.
2698 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
2699 * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
2701 * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
2702 (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
2703 (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
2704 (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
2705 $(LTLIBINTL) for gettext support on cygwin.
2706 * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
2707 have $(LTLIBINTL) from the preloaded module la files.
2708 * README: Remove the warning about using --disable-nls on Windows
2711 2003-09-15 Gary V. Vaughan <gary@gnu.org>
2713 * gnulib/m4/regex.c: s/<regex.h>/"regex.h"/ or else the compiler
2714 picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
2717 2003-09-12 Gary V. Vaughan <gary@gnu.org>
2719 * doc/STYLE: Document the gnulib header naming conventions, and
2721 * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
2722 gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
2723 gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
2725 * gnulib/m4/Makefile.am: Remove the rules to build these headers.
2727 * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
2728 module from CVS gnulib.
2729 * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
2730 (gl_FUNC_STRTOL): In favour of the module macro.
2732 2003-09-12 Gary V. Vaughan <gary@gnu.org>
2734 Replace the getopt code with CVS gnulib getopt. The source files
2735 detect whether they are in a glibc environment and preprocess away
2736 all of the code if there is a system getopt, so we can compile
2737 them into the m4 executable unconditionally:
2739 * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
2740 gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
2741 * configure.ac (gl_GETOPT): Use this instead of homebrew inline
2743 * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
2745 * src/Makefile.am: Adjust.
2746 * src/main.c: Always include our shipped getopt.h.
2747 * po/POTFILES.in: Use new location of getopt.c.
2749 2003-09-12 Gary V. Vaughan <gary@gnu.org>
2751 * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
2752 * config/Makefile.am: Removed. Automake 1.8 distributes the files
2753 in this directory automatically.
2754 * Makefile.am (EXTRA_DIST): Except config/mkstamp.
2756 * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
2758 * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
2760 * modules/Makefile.am (pkglibexecdir): Set it here.
2761 (pkgmodincdir): Renamed to pkgmodincludedir). Changed all clients.
2763 * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
2764 Import regex module from CVS gnulib.
2765 * gnulib/config/restrict.m4: Ditto for dependee module restrict.
2766 * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
2767 do extra substitutions for Makefile.
2768 * configure.ac: Use it.
2769 * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
2770 from regex_.h if necessary.
2771 * m4/system_.h: Include the correct version of regex.h.
2772 * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
2774 * po/POTFILES.in: Use new location of regex.c.
2776 * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
2777 realloc.c: automake distributes these files already.
2779 2003-09-12 Gary V. Vaughan <gary@gnu.org>
2781 Replace the xstrzdup code by importing the xstrndup module from
2782 CVS gnulib, along with its dependencies: strndup and strnlen:
2784 * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
2785 gnulib/config/xstrndup.m4: Import xstrndup module from CVS
2787 * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
2788 gnulib/config/strndup.m4: Ditto wrt strndup.
2789 * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
2791 * gnulib/m4/Makefile.am: Add rules from newly imported modules.
2792 However, contrary to gnulib, we install xstrndup.h.
2793 * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
2794 * gnulib/lib/xstrzdup.c: Delete. This was never a gnulib file, it
2795 is an artifact of the old m4 portability layer.
2796 * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
2797 * m4/system_.h: Include xstrndup.h.
2798 * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
2800 2003-09-11 Gary V. Vaughan <gary@gnu.org>
2802 Reimport the latest xalloc module from CVS gnulib, and adjust the
2803 m4 sources to take advantage of xalloc xfree. Also create a new
2804 macro DELETE with the same semantics as the old m4 XFREE macro,
2805 and carefully tweak callers:
2807 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
2809 * m4/utility.c (xfree): Removed. This function is now supplied by
2811 * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
2812 * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
2813 * m4/symtab.c (m4_symtab_create): Ditto.
2814 * m4/system_.h: Removed XFREE redefine.
2815 (DELETE): New macro with same functionality as the original m4
2816 XFREE macro, but based on xalloc.h now. Changed all callers.
2817 * src/main.c (main): Use XMALLOC macro.
2818 * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
2820 * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
2822 2003-09-10 Gary V. Vaughan <gary@gnu.org>
2824 Import the xalloc module from CVS gnulib, along with its
2825 dependencies: exitfail, malloc and realloc. We had different
2826 semantics for our XFREE and a function xfree() not supplied by
2827 gnulib, so also a bit of work to keep everything running
2830 * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
2831 (gl_XALLOC): Use gnulib equivalents.
2832 * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
2833 gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
2834 * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
2835 * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
2837 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
2838 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
2839 * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
2841 (pkgincdir): Removed. Use pkgincludedir instead.
2842 * m4/m4private.h (XFREE): xfree already checks for NULL.
2843 * m4/system_.h: Use xalloc module, and remove macros already
2844 supplied by xalloc.h.
2845 * m4/utility.c (xfree): xalloc does not yet implement xfree, so
2846 moved the old definition from m4/xmalloc.c to here for now.
2848 2003-09-09 Gary V. Vaughan <gary@gnu.org>
2850 Import the error and progname modules from CVS gnulib. Our old
2851 error.c subsumed the functionality of both, so a little adjustment
2852 was required to accomodate the split in sources. Also added more
2853 wrapper macros to choose between a system installed error.h or our
2854 shipped gnulib error module:
2856 * m4/error.c, m4/error.h: Removed.
2857 * m4/Makefile.am: Adjust.
2858 (pkgincdir): Removed. Use pkgincludedir instead.
2859 * m4/module.h, src/main.c: Don't include `m4/error.h'.
2860 * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
2862 * gnulib/m4/progname.c: Imported from CVS gnulib.
2863 * gnulib/m4/progname.h: Ditto.
2864 * src/main.c: Adjust to use progname module.
2865 * gnulib/m4/error.c: Imported from CVS gnulib.
2866 * gnulib/m4/error_.h: Ditto.
2867 * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
2868 if appropriate, and link a local error.h if the system version is
2870 (libgnu_la_SOURCES) Add progname module sources.
2871 * gnulib/config/error.m4: Imported from CVS gnulib.
2872 * gnulib/config/strerror_r.m4: Ditto.
2873 * config/m4-error.c: New file. Wrap gnulib error.m4 but arrange
2874 to have ERROR_H for Makefile substitutions and tell system.h
2875 whether the system error.h should be used, or a locally installed
2877 * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
2879 2003-09-09 Gary V. Vaughan <gary@gnu.org>
2881 * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
2882 s/gettext_.h/gettext.h/.
2884 * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
2885 automake have been fixed.
2887 * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
2888 gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
2889 of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
2890 rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
2892 2003-09-09 Gary V. Vaughan <gary@gnu.org>
2894 The gnulib obstack module requires the gnulib gettext module for
2895 systems that do not have GNU gettext installed. Because we use
2896 -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
2897 that directory incase it clashes with the system gettext.h. This
2898 delta uses gettext_.h and extra rules in the Makefile to make a
2899 link to gettext.h when needed:
2901 * Makefile.am (auxdir): Removed. No longer used.
2902 * configure.ac (ac_aux_dir): Removed AC_SUBST. No longer used.
2903 (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
2905 (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
2906 Makefile based build.
2907 (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
2908 of the macros are kept.
2909 * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
2910 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
2911 * config/Makefile (ACLOCAL_MACROS): Removed. Automake 1.7a
2912 distributes these automatically.
2913 * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
2914 warning from automake-1.7a.
2915 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
2916 m4_CHECK_DEBUGGING for consistency with gnulib prefixes. Changed
2918 * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
2919 wrt. m4_FUNC_OBSTACK.
2920 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
2921 wrt. m4_sys_STACKOVF.
2922 * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
2923 wrt. _m4_LIB_GMP, m4_LIB_GMP.
2924 (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
2925 namespace. Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
2927 * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
2928 * gnulib/m4/Makefile.am: Added a new block to make an appropriate
2929 gettext.h link on deficient systems.
2930 (pkginc_HEADERS): Mention $(GETTEXT_H).
2931 (EXTRA_HEADERS): Mention gettext.h.
2932 * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
2933 * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
2934 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
2935 gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
2936 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
2937 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
2938 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
2939 gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
2940 gnulib/config/po.m4, gnulib/config/progtest.m4,
2941 gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
2942 gnulib/config/ulonglong.m4: Imported from CVS gnulib.
2944 2003-09-05 Gary V. Vaughan <gary@gnu.org>
2946 We can't mirror the gnulib directory structure here, since we need
2947 to be able to eg. `#include <m4/obstack.h>' from our source files,
2948 which is much easier if the local obstack.h is created in a
2949 directory named m4. Rather than trying to symlink everything into
2950 the m4 directory, now we build a libtool convenience library from
2951 the sources we get from gnulib and link that with libm4.la:
2953 * gnulib/config/extensions.m4: Imported from CVS gnulib.
2954 * gnulib/config/unlocked-io.m4: Ditto.
2955 * gnulib/m4/unlocked-io.h: Ditto.
2956 * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
2957 gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
2958 * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
2959 gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
2960 * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
2961 * m4/Makefile.am: Adjust.
2962 * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
2963 macros we redistribute.
2964 * gnulib/m4/Makefile.am: New file. Build libgnu.la convenience
2965 library among others.
2966 (GNULIB_SRCS, GNULIB_MACROS): Removed.
2967 * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
2968 * config/m4-obstack.m4: Adjust.
2969 * po/POTFILES.in: Adjust.
2970 * configure.ac: Reformatting. Call newly imported gnulib macros.
2971 * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
2972 bogus calls of `#include "m4.h"'.
2973 * Makefile.am: INCLUDES has been deprecated in favour of
2975 * m4/Makefile.am: Ditto.
2976 * modules/Makefile.am: Ditto.
2977 * src/Makefile.am: Ditto.
2979 2003-09-05 Gary V. Vaughan <gary@gnu.org>
2981 * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
2983 2003-09-04 Gary V. Vaughan <gary@gnu.org>
2985 Migrate the obstack support into the gnulib directories for easy
2986 synchronisation with upstream files in gnulib:
2988 * config/gnu-obstack.m4: Moved from here...
2989 * config/m4-obstack.m4: ...to here.
2990 * config/Makefile.am (SPECIFIC_MACROS): Adjust.
2991 * m4/obstack.c, m4/obstack_.h: Moved from here...
2992 * gnulib/obstack.c, gnulib/obstack.h: ...to here.
2993 * po/POTFILES.in: Adjust.
2994 * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
2995 * m4/Makefile.am: Add a whole new section to link the obstack
2996 sources from the gnulib tree if necessary.
2997 * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
2999 * config/m4-obstack.m4: Rewrite as a wrapper for
3000 gnulib/m4/obstack.m4.
3002 2003-09-04 Gary V. Vaughan <gary@gnu.org>
3004 GNU M4 currently builds with a number of files adapted from
3005 upstream sources. Recently the gnulib project on savannah.gnu.org
3006 has pulled together a great many of these externally maintained
3007 files. This delta is the beginnings of isolating those files
3008 maintained in gnulib to make it easy to synchronise M4 with the
3009 upstream files prior to releases.
3011 * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
3013 (SUBDIRS): Added new gnulib subdirectory.
3014 * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
3015 * config/stdbool.m4: Moved from here...
3016 * gnulib/m4/stdbool.m4: ...to here.
3017 * m4/stdbool_.h: Moved from here...
3018 * gnulib/lib/stdbool_.h: ...to here.
3019 * gnulib/Makefile.am: New file. Make sure the gnulib tree is
3021 * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
3022 code to work with new stdbool_.h location.
3023 (gnulib_srcdir): New.
3025 2003-09-04 Gary V. Vaughan <gary@gnu.org>
3027 * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
3028 (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
3030 (SPECIFIC_TOOLS): New variable. Moved mkstamp to here.
3031 (EXTRA_DIST): Use it.
3033 * bootstrap: CVS autoreconf leaves file droppings. Remove
3034 aclocal.m4t incase autoreconf doesn't.
3036 2003-08-29 Gary V. Vaughan <gary@gnu.org>
3038 * m4/gnu-obstack.h: Updated from CVS gnulib. For consistency with
3039 the other gnulib imports, renamed to m4/obstack_.h.
3040 * m4/obstack.c: Updated from CVS gnulib.
3041 * m4/Makefile.am (EXTRA_HEADERS): Adjust.
3042 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
3043 header tests from gnulib obstack module. AC_CONFIG_LINKS knows
3044 about vpath already, and $top_srcdir upsets CVS Automake, so the
3045 $top_srcdir reference was removed.
3047 * m4/system-h.in: For consistency with the gnulib imports, renamed
3049 * m4/Makefile (EXTRA_HEADERS): Adjust.
3050 * configure.ac (AC_CONFIG_FILES): Adjust.
3052 * m4/stdbool_.h: New file from gnulib for systems without their
3054 * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
3055 * config/stdbool.m4: New file. Macros from gnulib for same.
3056 * configure.ac: Use it.
3058 2003-08-27 Gary V. Vaughan <gary@gnu.org>
3060 * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
3061 * config/gmp.m4: Ditto.
3062 * config/gnu-obstack.m4: Ditto.
3063 * config/stackovf.m4: Ditto.
3064 * m4/builtin.c: Ditto.
3065 * m4/debug.c: Ditto.
3066 * m4/error.c: Ditto.
3067 * m4/error.h: Ditto.
3068 * m4/gnu-obstack.h: Ditto.
3071 * m4/input.c: Ditto.
3073 * m4/m4module.h: Ditto.
3074 * m4/m4private.h: Ditto.
3075 * m4/macro.c: Ditto.
3076 * m4/module.c: Ditto.
3077 * m4/obstack.c: Ditto.
3078 * m4/output.c: Ditto.
3080 * m4/regex.c: Ditto.
3081 * m4/regex.h: Ditto.
3082 * m4/strtol.c: Ditto.
3083 * m4/symtab.c: Ditto.
3084 * m4/syntax.c: Ditto.
3085 * m4/utility.c: Ditto.
3086 * m4/xmalloc.c: Ditto.
3087 * m4/xstrdup.c: Ditto.
3088 * m4/xstrzdup.c: Ditto.
3089 * modules/evalparse.c: Ditto.
3090 * modules/format.c: Ditto.
3091 * modules/gnu.c: Ditto.
3092 * modules/import.c: Ditto.
3093 * modules/load.c: Ditto.
3094 * modules/m4.c: Ditto.
3095 * modules/m4.h: Ditto.
3096 * modules/modtest.c: Ditto.
3097 * modules/mpeval.c: Ditto.
3098 * modules/perl.c: Ditto.
3099 * modules/shadow.c: Ditto.
3100 * modules/stdlib.c: Ditto.
3101 * modules/time.c: Ditto.
3102 * modules/traditional.c: Ditto.
3103 * src/freeze.c: Ditto.
3104 * src/getopt.c: Ditto.
3105 * src/getopt1.c: Ditto.
3107 * src/main.c: Ditto.
3108 * src/stackovf.c: Ditto.
3110 * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
3111 ac_default_headers is an autoconf internal variable.
3112 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
3113 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
3115 * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
3116 * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
3119 2003-08-15 Gary V. Vaughan <gary@gnu.org>
3121 * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
3123 * system-h.in (m4_boolean): Removed in favour of using C99 bool if
3124 possible or faking one with a typedef. Changed all callers.
3126 2003-08-15 Gary V. Vaughan <gary@gnu.org>
3128 Still cleaning up the users' module API, by taking out the stuff
3129 that isn't used by any existing modules, and moving specialised
3130 functions out of libm4 and into the module they are used by.
3132 * m4/m4module.h (m4_skip_space): No need to export this. Moved...
3133 * m4/utility.c (m4_skip_space): ...to here the home of its only
3134 use, made static and renamed to `skip_space'. Changed all
3136 * m4/m4module.h (m4_expand_ranges): Removed prototype.
3137 * m4/utility.c (m4_expand_ranges): Moved definition from here...
3138 * modules/m4.c (m4_expand_ranges): ...to here, and exported using
3140 * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
3142 * modules/gnu.c (builtin_syntax): Import and use in this
3143 builtin implementation.
3144 * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
3146 * m4/macro.c (trace_flush): Except here where the macro is now
3148 * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
3149 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
3151 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
3152 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
3154 2003-08-14 Gary V. Vaughan <gary@gnu.org>
3156 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
3157 compiler based AC_CHECK_HEADER that was introduced in
3159 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
3160 * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
3161 * configure.ac: Use renamed M4_AC_LIB_GMP.
3163 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
3164 macro that requires arguments! This stops the shell's bad
3165 substitution error at configure time.
3167 * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
3168 variables to the testsuite shell. Set the value of USE_GMP so
3169 that the gmp test will run!
3170 (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
3172 2003-08-11 Gary V. Vaughan <gary@gnu.org>
3174 Libltdl already has an excellent mechanism for accessing C symbols
3175 in modules. Lets use that! Remove all the exporting cruft and
3176 just use lt_dlsym in conjunction with a few conventions to
3177 simplify module writers' jobs. Also removed the table address
3178 caching code and otherwise simplified the module loader quite a
3179 bit. To access exported symbols in other modules, first the
3180 exporting module must name the symbols <modname>_LTX_<symname>,
3181 and the importing module must define a function type called
3182 <symname>_func. The importer then adds
3183 M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
3184 that wishes to call out to the exported functions. Care must be
3185 taken that <symname> is non-NULL in the importing module incase
3186 M4_MODULE_IMPORT fails, but otherwise it can be called as if the
3187 definition was in the importers source. Study
3188 `modules/{gnu.c,m4.{c,h}' for a model example. At the moment,
3189 m4_module_import will attempt to automatically load a module
3190 required for symbol access if it is not loaded already.
3192 * TODO: Removed the items fixed in this delta.
3193 * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
3195 * m4/ltdl.h (lt_dlhandle_find): Declare it.
3196 * m4/module.c (m4_module_unload): Use it.
3197 * src/freeze.c (reload_frozen_state): Ditto.
3198 * m4/m4module.h (m4_export): Deleted. Removed all references.
3199 (M4_MODULE_IMPORT): New user convenience macro for importing
3200 arbitrary symbols from other modules.
3201 * m4/module.c (m4_module_import): New function to service
3202 M4_MODULE_IMPORT macro.
3203 (module_data): Removed. Looking up the tables on demand with
3204 lt_dlsym, rather than caching their addresses here simplifies the
3206 (m4_get_module_builtin_table, m4_get_module_macro_table):
3207 Removed. Changed all callers.
3208 (set_module_macro_table, set_module_builtin_table): Renamed to
3209 install_macro_table and install_builtin_table respectively, and
3210 simplified now that the cache is no more.
3211 * modules/gnu.c (builtin_symbols): Use this new mechanism to
3212 import m4_dump_symbols from the m4 module.
3213 (builtin_esyscmd): Likewise for m4_set_sysval and
3215 * modules/m4.c (m4_export_table): Removed. Functions are
3216 addressed with the new mechanism which doesn't need this.
3217 (m4_set_sysval): New exported accessor function to prevent
3218 problems with variable access on inferior architectures.
3219 * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
3220 (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
3221 that we can have some type safety.
3222 * modules/modtest.c (export_test): C level exported function for
3223 testing the new import mechanism.
3224 * modules/import.c: New file for the import end of the test.
3225 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
3226 * tests/modules.at: New test cases for intermodule symbol
3229 2003-08-07 Gary V. Vaughan <gary@gnu.org>
3231 * m4/m4module.c (m4_string): Moved from here...
3232 * m4/m4private.c (m4_string): ...to here.
3234 * m4/utility.c (dumpdef_cmp): Removed stale declaration.
3236 2003-07-29 Gary V. Vaughan <gary@gnu.org>
3238 * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
3239 already available to module writers through
3240 m4_{get,set}_nesting_limit_opt(), so moved from here...
3241 * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
3242 (m4_create): Use it.
3244 2003-07-28 Gary V. Vaughan <gary@gnu.org>
3246 Aside from auditing path.c for m4module.h api obfuscation, this
3247 delta introduces the concept of private struct members in opaque
3248 data types to GNU m4: See the STYLE file for details.
3250 * TODO: Remind ourselves that a rewrite of path.c is needed.
3251 * m4/m4module.h (m4_search_path, struct m4_search_path_info):
3253 * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
3254 here and renamed. These type definitions are for internal api use
3255 only. Changed all callers.
3256 * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
3258 * m4/path.c (search_path_env_init, search_path_add): ...to here
3259 and renamed. These calls were never used outside this file.
3260 Changed all callers.
3261 (dirpath): Moved functionality of this static declaration...
3262 * m4/m4private.h (struct m4): ...to this new internal only
3263 search_path field. Changed all callers.
3264 (m4__get_search_path): Added new internal api accessor.
3265 * m4/path.c (m4_search_path_info_new): Removed. Not used.
3266 (m4_include_init): Removed...
3267 * m4/m4.c (m4_create): ...because the new m4 field is now
3269 (m4_delete): Recycle search_path memory.
3270 * src/main.c (main): Don't call m4_include_init now that it's
3272 * doc/STYLE: Document convention for private fields in opaque
3275 2003-07-24 Gary V. Vaughan <gary@gnu.org>
3277 Sometimes exporting the address of a symbol from a module isn't
3278 enough for other modules to call that symbol correctly. If
3279 custom data types are used for function parameters, they need to
3280 be known to the caller. This change introduces the concept of
3281 $(prefix)/include/modules/$(modulename).h to declare those
3282 structures. Also we move m4_dump_symbols from libm4 to the m4
3283 module to show this concept in action.
3285 * m4/m4module.h (m4_dump_symbol_data): Moved from here...
3286 * modules/m4.h (m4_dump_symbol_data): ...to this new file for
3287 exporting data structures from modules/m4.c.
3288 * modules/m4.c, modules/gnu.c: Include it.
3289 * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
3290 * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
3292 * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
3294 * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
3295 ...to here, with slight renaming.
3296 (m4_export_table): Prototype and add m4_dump_symbols.
3297 * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
3298 definition of m4_dump_symbols.
3299 * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
3300 * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
3302 2003-07-24 Gary V. Vaughan <gary@gnu.org>
3304 Create an export table in modules/m4.c in readiness for beefing up
3305 the module loader to track module exports and imports.
3307 * m4/m4module.h (m4_debug_flush_files): Removed prototype.
3308 * m4/debug.c (m4_debug_flush_files): Moved...
3309 * modules/m4.c (m4_sysval_flush): ...to here and renamed.
3310 * modules/gnu.c (builtin_esysval): Use it.
3311 * m4/m4module.h (m4_export): New type for declaring module symbols
3313 * modules/m4.c (m4_export_table): List symbols exported from this
3314 module for use by other modules.
3316 2003-07-24 Gary V. Vaughan <gary@gnu.org>
3318 An experiment: There is loads of code in libm4 which should be in
3319 the m4 module, but is also used by another module. Just because
3320 some linkers won't cope with calls across dynamic runtime loaded
3321 objects I initially left the code in libm4. It will tidy the
3322 module api immensely if this code moves to the right place, I just
3323 need to remember to invent a suitable calling mechanism at some
3324 point. For now, only modules that are statically linked and
3325 preloaded will get this treatment, so the only platforms that will
3326 break are those that require all symbols to be resolved at link
3329 * TODO: Reminder that what I am doing could reduce portability
3330 unless I do something more robust later.
3331 * m4/m4module.h (m4_sysval): No longer exported from libm4.
3332 * m4/utility.c (m4_sysval): No longer declared in libm4.
3333 * modules/Makefile.am: Reformatting.
3334 * modules/m4.c (m4_sysval): Declare it at place of use.
3335 * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
3337 2003-07-23 Gary V. Vaughan <gary@gnu.org>
3339 * m4/m4module.h: Reformatting and rearranging lines a bit.
3340 (m4_obstack): Save typing by typedefing `struct obstack'. Changed
3342 (m4_call_macro, m4_expand_input): Renamed...
3343 (m4_macro_call, m4_macro_expand_input): ...to these. Changed all
3345 (m4_expansion_level, m4_process_macro): Moved...
3346 * m4/macro.c (expansion_level, process_macro): ...to here, and
3349 * m4/m4module.h (program_name): Not used by modules at all, so
3351 * src/main.c (program_name): ...to here.
3352 (print_program_name): Renamed...
3353 (print_program_name_CB): ...to conform to the STYLE guide.
3355 2003-07-23 Gary V. Vaughan <gary@gnu.org>
3357 More refactoring of the m4module.h API. Replace #defines with an
3358 enum, and move non-public functions out of the public API.
3360 * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
3362 * m4/macro.c (stdarg.h): Add ANSI C variadic header.
3363 * m4/debug.c (m4_debug, trace): Moved...
3364 * m4/m4private.h (struct m4): ...to fields of this struct.
3365 (m4_get_debug_file, m4_get_trace_messages): New fast access macros
3367 * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
3368 * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
3369 * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
3370 * m4/m4module.h (m4_context_field_table): Add entries for new
3371 debug_file and trace_messages fields.
3372 (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
3373 (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
3374 (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
3375 (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
3376 (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
3377 (m4_is_debug_bit): New macro to simplfy checks against the debug
3379 (m4_trace_format, m4_trace_header, m4_trace_flush)
3380 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
3382 * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
3383 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
3384 * m4/macro.c (trace_format, trace_header, trace_flush)
3385 (trace_prepre, trace_pre, trace_post): ...to these newly static
3386 functions, since they are only ever used from this file. Changed
3389 2003-07-17 Gary V. Vaughan <gary@gnu.org>
3391 Change the macros for checking syntax so that matching against
3392 multiple possible syntax classes can be done with a single
3393 comparison some of the time. The various classes are now bits of
3394 an int that can be checked with bitwise logic operators.
3396 * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
3397 (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
3398 (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
3399 (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
3400 (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
3401 (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
3402 (M4_SYNTAX_ALNUM): Removed. Changed all callers.
3403 (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
3404 (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
3405 (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
3406 (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
3407 Replace all calls with invocations of these...
3408 (m4_is_syntax, m4_has_syntax): ...New macros.
3409 * src/freeze.c (produce_syntax_dump): Remove mask argument, which
3410 is no longer required with new macros. Changed all callers.
3412 2003-07-15 Gary V. Vaughan <gary@gnu.org>
3414 * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
3415 values are returned as part of the internal interface, so they
3417 * m4/private.h: ...to here.
3418 * m4/macro.c (expand_token): Check for out of range
3419 m4_peek_input() results before looking up in the syntax table.
3420 (collect_arguments): Ditto.
3422 * NEWS: Note `$' syntax class.
3424 2003-07-08 Paul Eggert <eggert@twinsun.com> and
3425 Gary V. Vaughan <gary@gnu.org>
3427 Conform to POSIX if the POSIXLY_CORRECT environment is set.
3428 --traditional `define' now smashes all the definitions.
3430 * NEWS: Explain this.
3431 * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
3432 (Extensions): Explain that extensions that are incompatible with
3433 POSIX are disabled if POSIXLY_CORRECT is set.
3434 (Incompatibilities): Remove.
3435 (Define, Other Incompat): Explain difference
3436 between GNU and POSIX behavior of define, pushdef, popdef.
3437 * m4/m4.c (m4_get_posixly_correct_opt): New undef.
3438 * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
3439 * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
3440 (m4_get_posixly_correct_opt): New macro.
3441 * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
3443 * modules/m4.c (builtin_functions): defn now takes any number of args.
3444 (builtin_define): Smash all the definitions if
3446 (builtin_defn)): Allow any number of arguments.
3447 (builtin_undivert): Do not allow nonnumeric arguments
3449 * src/main.c (main): Set posixly-correct behavior if either
3450 POSIXLY_CORRECT is set, or if -G is given.
3451 * tests/builtins.at: New test for smashed definitions.
3453 2003-06-27 Gary V. Vaughan <gary@gnu.org>
3455 * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
3456 * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
3457 not to slow the parser down.
3458 (M4__IS_STRING): New macro to test string syntax class membership.
3459 * m4/syntax.c: Adjust docucomment.
3460 (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
3461 (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
3462 * m4/input.c (init_builtin_token): Comment typo.
3463 (m4__next_token): Comment typo.
3464 Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
3465 by using the new M4__IS_STRING macro.
3466 * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
3467 variable references in macro expansions.
3469 * doc/m4.texinfo (Eregexp and Regexp): Typo.
3470 (Epatsubst and Patsubst): Typo.
3473 2003-06-26 Gary V. Vaughan <gary@gnu.org>
3475 Move the global variables that pertain to syntax to a new `struct
3476 m4_syntax_table', and then add one of these to `struct m4'. The
3477 ripple effect through the code to both change formerly global
3478 references, and make sure a suitable context is available in
3479 lexical scope is disproportionately large compared to the size of
3480 the change proper. This change is a large part of decoupling
3481 syntax.c from the rest of the code that uses it.
3483 * m4/m4private.h (struct m4): Add a syntax field.
3484 * m4/m4.c (m4_create): Initialise it,
3485 (m4_delete): Recycle it.
3486 (m4_get_symtab): Remove hand coded version...
3487 (m4_get_symbol_table): ...and generate this with cpp. Changed all
3489 * m4/m4module.h (m4_context_field_table): Add an extra field so we
3490 can generate m4_get_symbol_table. Add a new row for
3491 m4_get_syntax_table.
3492 (M4SYNTAX): Syntactic sugar for module writers.
3493 (m4_symtab): Renamed to m4_symbol_table. Changed all callers.
3494 (m4_syntax_table): New home for syntax related formerly global
3496 * m4/m4private.h (struct m4_syntax_table): Define it.
3497 * m4/input.c (m4_input_init): Initialisation of these formerly
3498 global variables moved...
3499 * m4/syntax.c (m4_syntax_create): ...to here.
3500 * m4/input.c (m4_input_exit): And similarly, recycling of the
3501 memory used by those values moved...
3502 * m4/syntax.c (m4_syntax_delete): ...to here.
3503 * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
3504 Moved to m4/m4private.h.
3505 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
3506 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
3507 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
3508 (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
3509 objects. Changed all callers that used to directly access the
3511 (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
3512 Removed and incorporated into m4_syntax_table structure.
3513 * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
3514 * m4/syntax.c (m4_set_syntax): Now returns an error status,
3515 instead of requiring a `struct m4' to generate its own errors.
3516 Changed all callers.
3517 * src/main.c (main): Now that the syntax table is initialised as
3518 part of m4_create, we have to manually wipe the syntax entries if
3519 we are about to read a frozen file.
3521 2003-06-26 Gary V. Vaughan <gary@gnu.org>
3523 * doc/STYLE: Added notes on callback naming schemes.
3525 * m4/module.c (m4_set_module_macro_table)
3526 (m4_set_module_builtin_table): Declarations weren't changed when
3527 definitions were renamed on 2003-06-19.
3529 * m4/hash.c (m4_hash_resize): ifdefed out. This function is
3530 neither used nor particularly appropriate since it exposes the
3531 internal workings of the hash module. I haven't yet decided
3532 whether to remove it entirely.
3534 2003-06-20 Gary V. Vaughan <gary@gnu.org>
3536 Two related changes, and a huge knockon effect throughout the
3537 source: Moved the option variables out of global space and into
3538 `struct m4'; made `m4_symtab' a real datatype, so that its api
3539 is not marred passing `struct m4' around just so it can decide
3540 whether to keep traced symbol names or not. Added setters and
3541 getters for the formerly global option variables, and obviously
3542 changed a vast number of functions to take a `struct m4' and use
3543 the getter funcs to find option values.
3545 * m4/utility.c (interactive, sync_output, debug_level)
3546 (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
3547 (max_debug_argument_length, warning_status, nesting_limit)
3548 (discard_comments): Removed.
3549 * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
3550 (debug_level, max_debug_argument_length, prefix_all_builtins)
3551 (suppress_warnings, discard_comments, interactive, sync_output):
3552 Removed from here...
3553 * m4/m4private.h (struct m4): ...and equivalent fields added to
3555 (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
3556 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
3557 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
3558 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
3559 (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
3560 macros for the new fields.
3561 * m4/m4module.h (m4_context_field_table)
3562 (m4_context_opt_bit_table): Helper macros used to generate
3563 prototypes, setters and getters for new option fields
3565 * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
3566 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
3567 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
3568 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
3569 (m4_get_interactive_opt, m4_get_sync_output_opt)
3570 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
3571 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
3572 (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
3573 (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
3574 (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
3575 setter and getter functions generated by cpp from
3576 m4_context_field_table and m4_context_opt_bit_table, exported as
3577 part of the module api. Changed all callers.
3578 * m4/symtab (struct m4_symtab): Used as the concrete type for
3580 (m4_symtab_create): Allocate and initialise a new struct.
3581 (m4_symtab_apply): New function that works like m4_hash_apply, but
3582 with different callbacks specific to symbol tables. Changed all
3584 (symbol_destroy, arg_destroy, arg_copy): Renamed
3585 symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
3586 they have unused parameters for a reason!
3587 (dump_symbol_CB): New callback to dump the contents of a single
3589 (symtob_dump): Rewritten in terms of dump_symbol_CB.
3590 * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
3591 Changed all callers.
3592 * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
3593 of the contained `m4_symtab' at the `no_gnu_extensions' field.
3594 Although I'm not convinced these semantics are correct, they are
3595 at least consistent with how things were before this delta. Also
3596 set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
3598 2003-06-19 Gary V. Vaughan <gary@gnu.org>
3600 Tie down the interface to libm4 some more. Make more structures
3601 opaque to modules by moving them to m4private.h, and writing
3602 setters and getters. To win back the speed penalty for doing this
3603 also wrote macroized versions that do know about structure layout
3604 in m4private.h and #include that file into modules when NDEBUG is
3605 defined at compile time. There are still some accessor macros in
3606 m4private.h that need to go, but that is not necessary to clean
3609 * m4/m4module.h (m4_symbol_type): Moved...
3610 * m4/m4private.h (m4__symbol_type): ...to here.
3611 * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
3612 (m4_set_symbol_traced, m4_set_symbol_name_traced)
3613 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
3614 (m4_get_symbol_func, m4_symbol_value_create)
3615 (m4_symbol_value_delete, m4_set_symbol_value_text)
3616 (m4_set_symbol_value_func): New exported api to symbols.
3617 (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
3618 and m4_is_symbol_value_func.
3619 * m4/m4module.h: Prototype these guys.
3620 * m4/module.c (m4_set_module_macro_table)
3621 (m4_set_module_builtin_table): Make these static, there is no
3622 reason to pollute the api with them.
3623 * m4/m4private.h: Reformatting.
3624 (m4_get_symtab): Only define when NDEBUG is defined.
3625 (m4_get_symbol_value, m4_get_symbol_traced)
3626 (m4_set_symbol_traced, m4_set_symbol_name_traced)
3627 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
3628 (m4_get_symbol_func, m4_symbol_value_create)
3629 (m4_symbol_value_delete, m4_set_symbol_value_text)
3630 (m4_set_symbol_value_func): Macro implementations of the new
3631 functions when NDEBUG is defined.
3632 (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
3633 (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
3634 Superceded by the above. All callers changed.
3635 (M4ARG): Removed. This is no longer different to the
3636 m4/m4module.h definition.
3637 * modules/gnu.c, modules/m4.c: Only include m4private.h when
3638 NDEBUG is defined. That way we exercise the same (albeit slower)
3639 api that external modules must use.
3641 2003-06-18 Gary V. Vaughan <gary@gnu.org>
3643 Renamed some of the types and their accessors to make more sense.
3644 Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
3645 has a stack of SYMBOL_VALUEs.
3647 * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
3648 (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
3649 m4_get_symbol_value_type, m4_get_symbol_value_text,
3650 m4_get_symbol_value_func and m4_symbol_value_copy respectively.
3651 Changed all callers.
3652 (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
3653 (m4_get_token_type): Renamed
3654 * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
3655 to the internal api.
3656 * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
3658 (m4__symtab_init, m4__symtab_exit): Removed prototypes.
3659 (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
3660 (m4__token_type): Moved here from m4module.h.
3661 (m4__next_token): Renamed from m4_next_token.
3662 * m4/symtab.c: Removed some of the parameterised macro support
3663 functions for modularisation later.
3664 (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
3665 m4_hash_dup to perform a true deep copy of the SRC.
3666 (arg_copy): Callback for m4_symbol_value_copy.
3667 * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
3668 Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
3669 m4_get_symbol_value_func. Changed all callers.
3671 2003-06-18 Gary V. Vaughan <gary@gnu.org>
3673 Tidy up style of hash.[ch] in accordance with doc/STYLE.
3675 * m4/hash.c: Internal symbol renaming and formatting.
3676 (m4_hash_dup): New function to facilitate deep copies of hash
3678 (m4_hash_apply_func): Returns a void* now, which is a richer type
3679 for returning exceptions (NULL means keep going).
3680 (m4_hash_apply): Ditto.
3681 * m4/hash.h: Declare exported symbols with an explicit extern.
3684 2003-06-17 Gary V. Vaughan <gary@gnu.org>
3686 Still refactoring furiously. This delta represents a change in
3687 semantics to symtab.c. Instead of building temporary m4_tokens
3688 in the caller, and copying fields in the methods, we now create
3689 the actual m4_token for hashing in the caller so the methods just
3690 slot them in directly. Also, this means that we don't lookup a
3691 symbol and get back an allocated but VOID token to copy fields
3692 into, we create the token we want to push and pass that to
3693 m4_symbol_define or m4_symbol_pushdef. And that's it. There are
3694 a few other small changes to stop knowledge of the implementation
3695 of symtab.c leaking out into other files.
3697 * m4/macro.c (expand_argument): Comment typo corrected.
3698 * m4/symtab.c (symtab_fetch): New function to fetch the address of
3700 (m4_symbol_pushdef): Take an extra value parameter and use this
3701 directly as the new top of the value stack. All callers changed
3702 to build a token and pass responsibility for memory in, rather
3703 than copying as we used to.
3704 (m4_symbol_define): Also use the new value parameter directly as a
3705 replacement for the top of the value stack. All callers changed
3706 to build a token as above.
3707 (m4_set_symbol_traced): New function to set the traced bit on the
3708 named symbol, creating it if necessary.
3709 (symbol_popval): The guts of the old m4_symbol_popdef.
3710 (m4_symbol_popdef): Use it.
3711 * m4/builtin.c (m4_symbol_set_token): Removed,
3712 (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
3714 * m4/module.c (m4_set_module_builtin_table)
3715 (m4_set_module_macro_table): ...with these more orthogonal
3717 * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
3718 (m4_builtin_pushdef, m4_builtin_define): Removed. No longer
3720 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
3721 (m4_arg_signature_parse): Moved...
3722 * m4/symtab.c: ...to here.
3723 * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
3724 screw something up. Moved...
3725 * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
3726 actually does a proper deep copy of source to dest.
3728 2003-06-16 Gary V. Vaughan <gary@gnu.org>
3730 Further refactoring to stabilise the module API. Renaming some
3731 functions for orthogonality, and judicious definition migration to
3732 move things out of the set of exported symbols.
3734 * doc/STYLE: New file. Notes on coding style.
3735 * m4/m4module.c: Updated bitrotted docucomment at the top of the
3737 (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
3738 m4_get_module_name, m4_get_module_builtin_table,
3739 m4_get_module_macro_table which are verb phrases. Changed all
3741 * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
3743 * m4/module.c (m4_set_module_builtin_table)
3744 (m4_set_module_macro_table): ...here, and renamed. Changed all
3746 * m4/m4module.c (m4_module_data): This...
3747 * m4/m4private.c (struct m4_module_data): ...and this...
3748 * m4/module.c (module_data) ...consolidated here and no longer
3749 exported. Changed all callers.
3751 2003-06-16 Gary V. Vaughan <gary@gnu.org>
3753 Begin work on lifting the curse of the global variables. To start
3754 with create a `struct m4' context container, and replace
3755 `m4__symtab' with `context->symtab' throughout. This means
3756 initialising a context container in main, and adjusting many
3757 functions between main and the module entry points so that the
3758 container gets passed through. It would have been nice to
3759 defer this until after 1.5, but it has a major effect on the
3760 user's module writing ABI, so it needs to be addressed now - at
3761 least in the areas that impact the ABI. An interrelated change
3762 in the symtab API removes the dependency on a global symbol table,
3763 and instead focuses on a passed table (from the context
3766 * TODO: Reminders for finishing context functionality.
3767 * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
3768 * m4/m4.c: New file. Manage new struct m4 objects to eliminate
3769 global variables and eventually allow m4 to be reentrant.
3770 * m4/m4private.h (m4): Define the new structure here...
3771 (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
3772 don't carry the overhead of a function call.
3773 * m4/m4module.h: Prototype extern functions from m4/m4.c.
3774 (m4): Declare type for new struct m4 objects.
3775 (M4SYMTAB): User macro to ease finding the symbol table for the
3776 current context for module developers.
3777 (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
3779 (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
3780 (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
3781 (m4_call_macro, m4_dump_symbols, m4_expand_input)
3782 (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
3783 (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
3784 (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
3785 m4* context parameter. Changed definitions and all callers.
3786 (m4_symtab): Alias for m4_hash to decouple the
3787 m4_symtab api from m4_hash.
3788 (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
3790 (m4_symtab_create): New function to return an initialised
3792 (m4_symtab_delete): New function to delete an m4_symtab's memory.
3793 (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
3794 (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
3795 instead of simply using the global m4__symtab. Changed
3796 definitions and all callers.
3797 * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
3798 * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
3799 * src/main.c (main): Create a context and use that instead of the
3800 former global m4__symtab.
3802 2003-06-13 Gary V. Vaughan <gary@gnu.org>
3804 * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
3805 to the callback. Callbacks should not need to hardcode the
3806 hashtable they are working from, nor should we have to waste the
3807 userdata parameter to pass the table in.
3808 * m4/hash.h (m4_hash_apply_func): Require the initial table
3810 * m4/symtab.c (symtab_destroy): Use the passed table instead
3811 of hardcoding m4__symtab.
3812 (m4_symbol_popdef): Don't use the userdata parameter to pass the
3813 table to arg_destroy.
3814 (arg_destroy): Use the hash parameter, ignore userdata.
3815 * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
3817 (traceon, traceoff): Call set_trace with the extra initial
3820 2003-06-13 Gary V. Vaughan <gary@gnu.org>
3822 More refactoring to stabilise the module api, this time for
3823 symtab.c. Additionally, start to pay attention to function names
3824 that don't contain a verb like they should.
3826 * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
3827 wrapper for m4_hash_apply to decouple the symtab module from the
3829 (m4_symbol_builtin, m4_symbol_macro): Renamed to
3830 m4__symbol_set_builtin and m4__symbol_set_macro. Changed all
3832 (m4_symbol_delete): Create a macro version to save a function
3834 (m4_token_t, m4_data_t): These violate the POSIX reserved
3835 namespace. Renamed to m4_token_type and m4_symbol_type. Changed
3837 (m4_token_type): Renamed to m4_token_get_type.
3838 (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
3839 (m4_symtab_exit): Removed from the exported module
3841 * m4/m4private.h (m4__symtab, m4__symtab_init)
3842 (m4__symtab_remove_module_references, m4__symtab_exit): ...and
3843 renamed and added to the internal api. Changed all callers.
3844 (m4_symtab_apply): A faster macro version of the function for
3845 users of the internal api.
3846 * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
3847 symbol_destroy and arg_destroy.
3848 (symtab_debug): Added a prototype.
3849 (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
3850 so that callers in this file get the faster macro versions from
3853 2003-06-12 Gary V. Vaughan <gary@gnu.org>
3855 Refactoring modules to rationalise the API into an external
3856 documented (eventually!) API for use by modules in the `m4_'
3857 namespace declared in m4/m4module.h, an internal API between the
3858 source files we ship (including our shipped modules) in the `m4__'
3859 namespace declared in m4/m4private.h and making the rest as
3860 cohesive as possible with liberal use of the `static' keyword.
3861 This change represents an audit to m4/module.c along these
3864 * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
3865 Removed. No longer used.
3866 (m4_module_close): Removed prototypes.
3867 (m4_module_init, m4_module_open, m4_module_unload_all): Removed
3868 from the exported module api...
3869 * m4/m4private.h (m4__module_init, m4__module_open)
3870 (m4__module_exit): ...and renamed and added to the internal api.
3871 Changed all callers.
3872 (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
3873 Centralised definitions after renaming...
3874 * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
3875 (M4_FINISH_SYMBOL): ...and removing from here.
3876 (m4_module_dlerror, m4_module_remove, m4_module_close)
3877 (m4_caller_id): Not exported at all, so renamed to module_dlerror,
3878 module_remove, module_close and caller_id.
3879 (MODULE_SELF_NAME): New macro to make reporting self errors
3881 (m4_module_load, module_close, module_remove): Use it.
3882 * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
3884 * src/main.c (main): Use it.
3886 2003-06-12 Gary V. Vaughan <gary@gnu.org>
3888 * README: Remove references to --enable-changeword, which has been
3889 removed from the code.
3891 2003-06-11 Gary V. Vaughan <gary@gnu.org>
3893 Getting rid of the annoying bug with configure --enable-debug,
3894 which spewed -e: command not found errors. This was an interaction
3895 between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
3896 You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
3897 branch-1-5) to get the full fix.
3899 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
3900 of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
3901 and then use the probed value of $SED.
3902 (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
3903 this, it messes up the AC_REQUIRE stack.
3905 2003-06-10 Gary V. Vaughan <gary@gnu.org>
3907 * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
3908 the destroy callback.
3909 (m4_arg_destroy): Use the hash address to free the hash node key
3912 2003-06-06 Gary V. Vaughan <gary@gnu.org>
3914 First cut at formal parameters in macros.
3916 * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
3917 * m4/xstrzdup.c: New file.
3918 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
3919 associative array of parameter names to details.
3920 (m4_symbol_token): Capture macro names with parameter lists.
3921 (m4_arg_signature_parse): And build an associative array to hang
3922 from the symbol structure to map names to details.
3923 * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
3924 m4_hash_resize idiom. Now that we potentially add a little hash
3925 table to many of the entries in the symbol table, added an extra
3926 arg to set the initial size. Changed all callers.
3927 (m4_hash_apply): New function that is basically a generalised
3929 * m4/symtab.c (m4_symbol_apply): ...this. Now deleted. Adjusted
3930 all callers to call m4_hash_apply instead.
3931 (m4_arg_destroy): Recycle memory used by an m4_token_arg.
3932 (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
3933 m4_arg_signature association that might be attached to the symbol,
3934 * m4/hash.h (m4_hash_apply_func): Replacement type for...
3935 * m4/m4module.h (m4_symtab_apply_func): ...this. Now deleted.
3936 (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
3938 (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
3939 (M4_IS_IDENT): Detect characters that can be safely used in
3941 * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
3942 * m4/macro.c: Corrected grammar in some comments. Use `token'
3943 rather than `td' for m4_token variables.
3944 (m4_process_macro): If we find a dollar followed by some
3945 M4_IS_IDENT characters, replace that with the contents of the argv
3946 entry with offset stored in the m4_token_arg associated with the
3947 collected identifier.
3949 2003-06-05 Gary V. Vaughan <gary@gnu.org>
3951 Begin preparations for supporting formal parameters in m4 macros.
3953 * m4/m4private.h (struct m4_token_arg): Placeholder for holding
3954 the details of a formal parameter.
3955 (m4_token): Add an arg_signature member to hold a hash table for
3956 looking up formal parameters.
3957 * m4/input.c: Update more bitrotted comments.
3958 (m4_push_builtin): Initialise arg_signature member.
3959 (init_builtin_token): Copy arg_signature member.
3960 * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
3961 (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
3963 * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
3964 (m4_macro_pushdef, m4_macro_define): ...these, And...
3965 (m4_symbol_token): ...wrapped around this new function, which
3966 vastly simplifies the arguments required by the functions it
3968 Changed all callers.
3970 2003-06-05 Gary V. Vaughan <gary@gnu.org>
3972 * m4/macro.c: Format changes.
3974 2003-06-04 Gary V. Vaughan <gary@gnu.org>
3976 * m4/input.c: Updated various bitrotted comments.
3977 (m4_push_builtin): Just pass the whole m4_token, rather than
3978 extracting all the fields in the caller. This also allows us to
3979 check the token type for consistency.
3980 (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
3981 Renamed to builtin_funcs, builtin_peek, builtin_read,
3982 m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
3983 the code. Changed all callers.
3984 (struct input_block): Similarly renamed u_m member to u_b, and
3985 changed all callers.
3986 (m4_next_token): Use bzero to initialise the data fields.
3987 * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
3989 2003-05-29 Gary V. Vaughan <gary@gnu.org>
3991 These changes were necessary to get m4 to build on my iBook
3992 running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
3993 (GCC) 3.1 20020420 (prerelease)":
3995 * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
3996 inclusion of module loader headers.
3997 * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
3998 * m4/Makefile.am: Ditto.
3999 (libm4_la_LIBADD): Added $(LTLIBINTL).
4000 * m4/utility.c (program_name): Removed declaration in favour of
4001 the one already in error.c!
4002 * m4/m4module.h (program_name): Define to program_invocation_name
4003 when using GNU C library. Use an explicit extern declaration.
4004 (interactive, sync_output, debug_level, hash_table_size)
4005 (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
4006 (suppress_warnings, warning_status, nesting_limit, discard_comments)
4007 (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
4008 (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
4009 (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
4010 (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
4011 (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
4012 (m4_expansion_level, m4_expand_ranges, m4_expand_input)
4013 (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
4014 (m4_current_line, m4_current_diversion, m4_output_current_line):
4015 Don't rely on default, use an explicit extern.
4016 * m4/error.h (error, error_at_line, error_print_progname)
4017 (error_message_count, error_one_per_line): Ditto.
4018 * m4/ltdl.c: Update from CVS libtool.
4020 * commit: Update from CVS cvs-utils.
4022 2002-11-04 gettextize <bug-gnu-gettext@gnu.org>
4024 * po/Makefile.in.in: Upgrade to gettext-0.11.5.
4025 * po/boldquot.sed: New file, from gettext-0.11.5.
4026 * po/en@boldquot.header: New file, from gettext-0.11.5.
4027 * po/en@quot.header: New file, from gettext-0.11.5.
4028 * po/insert-header.sin: New file, from gettext-0.11.5.
4029 * po/quot.sed: New file, from gettext-0.11.5.
4030 * po/remove-potcdate.sin: New file, from gettext-0.11.5.
4031 * po/Rules-quot: New file, from gettext-0.11.5.
4033 2002-11-04 Akim Demaille <akim@epita.fr>
4035 * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
4037 * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
4039 2002-11-04 Akim Demaille <akim@epita.fr>
4041 * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
4043 2002-11-04 Akim Demaille <akim@epita.fr>
4045 * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
4046 used as `external', and Libtool 1.4.3.
4048 (LTLIBOBJS): Don't play with it.
4050 * Makefile.am (SUBDIRS): Remove intl.
4051 (ACLOCAL_AMFLAGS): Add -I config.
4052 (EXTRA_DIST): Add config/config.rpath.
4055 * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
4057 2002-05-29 Gary V. Vaughan <gary@gnu.org>
4059 Preparations for refactoring syntax tables to allow reverse
4060 lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
4061 speed of normal lookups in an array of unsigned short.
4063 * m4/input.c (single_quotes, single_comments, use_macro_escape):
4065 * m4/m4private.h (m4__single_quotes, m4__single_comments,
4066 m4__use_macro_escape): ...to here, and renamed. The `m4__' prefix
4067 is for internal symbols which unavoidably pollute the global
4068 namespace, but are not published APIs.
4069 Adjusted all callers.
4070 * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
4071 m4_set_comment, m4_set_syntax, set_syntax_internal,
4072 unset_syntax_attribute): Moved from this file...
4073 * m4/syntax.c: New. ...to this file.
4074 Also added an m4_syntax_exit stub for orthogonality.
4075 * src/main.c (main): Use it.
4076 * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
4077 * m4/m4module.h: Reformatting. New prototypes.
4079 2002-05-29 Gary V. Vaughan <gary@gnu.org>
4081 * bootstrap (aclocal_apiversion): The aclocal apiversion is
4082 distinct from the automake release number (in that the apiversion
4083 apparently has no micro-version-component).
4084 (aclocal_apilibdir): Use it.
4086 2002-05-28 Gary V. Vaughan <gary@gnu.org>
4088 * m4/hash.c (m4_hash_resize): New function.
4089 * m4/hash.h: Add prototype.
4090 * m4/symtab.c (m4_symtab_init): Use it. This could do with some
4091 benchmarking to find a good value for, say, autoconf. This is
4092 already a little quicker than before for me.
4094 * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
4095 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
4097 * m4/hash.h: Adjust prototypes.
4099 2002-01-22 Akim Demaille <akim@epita.fr>
4101 * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
4103 * tests/Makefile.am (package.m4): New.
4104 * tests/atlocal.in: Adjust to CVS Autotest.
4105 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
4106 * configure.ac: LIBOBJ is a forbidden string.
4107 Simplify AM_INIT_AUTOMAKE invocation.
4108 * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
4111 2002-01-21 gettextize <bug-gnu-utils@gnu.org>
4113 * po/Makefile.in.in: Upgrade to gettext-0.10.40.
4115 2001-10-19 Akim Demaille <akim@epita.fr>
4117 * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
4119 2001-10-19 Akim Demaille <akim@epita.fr>
4121 * m4/input.c (m4_next_token): Display where was opened what is
4124 2001-10-19 Akim Demaille <akim@epita.fr>
4126 * m4/macro.c (expand_argument): Display where was opened what is
4129 2001-10-18 Akim Demaille <akim@epita.fr>
4131 * m4/input.c, modules/m4.c: Formatting changes.
4133 2001-10-17 Gary V. Vaughan <gary@gnu.org>
4135 * bootstrap: s/configure.in/configure.ac/
4137 2001-10-16 Gary V. Vaughan <gary@gnu.org>
4139 * m4/symtab.c (m4_symbol_destroy): This function calls
4140 m4_symbol_popdef, which recycles a symbols memory when the last
4141 definition is popped. Since we were passing the address of the
4142 symbol name found in the symbol table, and it was being removed
4143 partway through m4_symbol_destroy() we were referencing freed
4144 memory for the balance of the function. Now we take a copy of the
4145 symbol name tring and use that as a key into the symbol
4146 table... that way if the original symbol name is freed, the copy
4149 2001-10-13 Akim Demaille <akim@epita.fr>
4151 * m4/ltdl.c: Update.
4153 2001-10-13 Akim Demaille <akim@epita.fr>
4155 * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
4156 Don't gettextize internal error messages.
4158 2001-10-13 Akim Demaille <akim@epita.fr>
4160 * tests/macros.at (Arity and defn): New failing test.
4161 (Arity, defn, and freeze): New.
4163 Fix `Arity and defn'.
4165 * m4/input.c (m4_push_macro): Don't forget the arity.
4166 * modules/m4.c (defn): Likewise.
4168 2001-10-13 Akim Demaille <akim@epita.fr>
4170 * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
4172 * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
4173 (Propagation of traceon, Propagation of --trace): this new file.
4175 2001-10-13 Akim Demaille <akim@epita.fr>
4177 * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
4178 interface instead of (name, argc...).
4179 Upon failure, specify which argument was guilty.
4182 2001-10-13 Akim Demaille <akim@epita.fr>
4184 * modules/evalparse.c: Save translators' time: don't translate
4185 internal error messages.
4186 (m4_evaluate): Simplify/normalize error messages.
4187 * doc/m4.texinfo (Eval): Adjust.
4189 2001-10-13 Akim Demaille <akim@epita.fr>
4191 * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
4192 where no checking is needed.
4193 * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
4194 interface instead of (name, argc...).
4196 * modules/gnu.c (m4_patsubst_do): Don't check argc, done
4199 2001-10-13 Akim Demaille <akim@epita.fr>
4201 * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
4202 exclude the builtin name from the count.
4203 * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
4204 calling ifelse with a single argument is valid.
4205 * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
4206 with 1 and 2 args, mostly to strengthen the test suite.
4208 2001-10-13 Akim Demaille <akim@epita.fr>
4210 * m4/output.c (m4_make_diversion, m4_insert_file)
4211 (m4_insert_diversion, +m4_freeze_diversions): Ansify.
4213 2001-10-12 Gary V. Vaughan <gary@gnu.org>
4215 * m4/input.c (init_builtin_token): Renamed from init_macro_token,
4216 since we call these things builtins in the rest of the code!
4218 * modules/gnu.c (m4_regexp_compile): s/%0/%s/
4220 2001-10-12 Gary V. Vaughan <gary@gnu.org>
4222 Rather than forcing each builtin definition to manage its own
4223 argument range checking, tabulate the maxima and minima for all
4224 builtins in each module. This forces us to consider what the
4225 valid ranges for each builtin should be, and moves the checking
4226 code out of each builtin implementation and into the builtin
4227 caller infrastructure.
4229 * m4/m4module.h (struct m4_builtin): Add argument minima and
4231 * m4/m4private.h (struct m4_token): Reflect them here too.
4232 * m4/input.c (struct input_block): ...and here.
4233 (m4_token_copy): New function for token copying.
4234 (init_macro_token): Copy them from a token to the input stack.
4235 (m4_next_token): Don't forget to initialise them for text
4237 * m4/macro.c (expand_argument): Use m4_token_copy, and also
4238 check argument counts before calling the builtin handler.
4239 * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
4240 (m4_symbol_macro): Likewise.
4241 * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
4242 parameters. Updated all callers.
4243 (m4_builtin_define): Ditto.
4244 (m4_macro_pushdef, m4_macro_define): Ditto.
4245 * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
4246 * modules/evalparse.c: Declare argument counts for defined
4247 builtins and remove explicit calls to m4_bad_argc().
4248 * modules/gnu.c: Ditto.
4249 * modules/load.c: Ditto.
4250 * modules/m4.c: Ditto.
4251 * modules/modtest.c: Ditto.
4252 * modules/mpeval.c: Ditto.
4253 * modules/perl.c: Ditto.
4254 * modules/shadow.c: Ditto.
4255 * modules/stdlib.c: Ditto.
4256 * modules/time.c: Ditto.
4259 2001-10-10 Gary V. Vaughan <gary@gnu.org>
4261 The trace semantics now attach the trace bit to a symbol name.
4262 For as long as a traceon(`foo') is active, calls to foo will be
4263 traced regardless of intervening undefines or module unloads.
4264 Fixed the flag propogation issues differently to the fixes
4265 reverted with the last attempt at nailing down trace:
4267 * m4/m4private.h: This file is not visible outside of the m4
4268 source tree, so I removed all the `M4_' and `m4_' prefixes to save
4269 on typing. Updated all clients.
4270 (m4_token): New typedef contains the fields that need to be passed
4271 around with the low level tokeniser.
4272 (m4_token_data): Removed.
4273 (m4_symbol): Now contains the traced flag again.
4274 * m4/symtab.c: Rewritten again. Now we don't remove symbols with
4275 the trace bit set. This change is contained entirely within this
4276 module and doesn't leak out into the callers. Updated all
4278 (m4_symbol_builtin, m4_symbol_macro): Adjusted to make use of the
4279 new fields in m4_token. Updated all clients.
4280 * m4/builtin.c (m4_builtin_pushdef): Needs a flags argument so
4281 that `groks_macro_args' and `blind_if_no_args' flags are retained
4282 when defn() results are passed around in m4 code. Updated all
4284 (m4_builtin_define): Ditto.
4285 (m4_macro_pushdef, m4_macro_define): Ditto.
4286 * m4/input.c (struct input_block): Add a flags field to facilitate
4288 (m4_push_macro): ...use it.
4289 (init_macro_token): Retrieve it.
4290 (m4_next_token): Initialise it.
4291 * m4/macro.c (expand_argument): Copy it.
4292 * m4/m4module.h: Adjust.
4293 * tests/builtins.at: Adjust the expected output of the trace
4294 tests to reflect the change in semantics.
4295 * tests/modules.at (modules: trace): Check that unloading a
4296 module which supplies a traced symbol definition doesn't lose te
4299 2001-10-07 Gary V. Vaughan <gary@gnu.org>
4301 * modules/gnu.c (m4_macro_table): Display the timetamp when
4302 expanding __m4_version__.
4304 * configure.ac (--with-modules): Forgot a comma in the
4305 AC_HELP_STRING parameter list.
4307 2001-10-05 Gary V. Vaughan <gary@gnu.org>
4309 * bootstrap: Remove aclocal.m4t when it is no longer required.
4311 2001-10-05 Akim Demaille <akim@epita.fr>
4313 * tests/Makefile.am: Adjust for gnuprog2.
4314 * tests/m4.in: There can be a leading path.
4315 * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
4316 * tests/testsuite.at: Adjust to the most recent Autotest.
4317 (AT_CHECK_M4_FILTER): Fix and rename as...
4319 * tests/others.at: Use it.
4321 * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
4322 variable in shell scripts, one uses `$'...
4324 2001-10-04 Gary V. Vaughan <gary@gnu.org>
4326 * configure.ac: `rm -f $m4_getopt_h' was lost.
4328 2001-10-04 Gary V. Vaughan <gary@gnu.org>
4330 * configure.ac (TIMESTAMP): Display with AS_BOX at configure
4331 time. Define it for config.h in order to...
4332 * src/main.c (main): ...display the timestamp for --version.
4334 2001-10-04 Akim Demaille <akim@epita.fr>
4336 * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
4337 previous builtins `regexp' and `patsubst'.
4338 (regexp, patsubst): Use them.
4339 (eregexp, epatsubst): New builtins.
4340 * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
4341 (Epatsubst and Patsubst, Eregexp and Regexp): these.
4342 (Extensions): More info on REs.
4344 2001-10-04 Akim Demaille <akim@epita.fr>
4346 * modules/modtest.c (init_handler): Consistently output to stderr.
4347 (finish_handler): New.
4348 (test): The `if' is an `assert'.
4349 * tests/modules.at: Adjust.
4351 2001-10-04 Akim Demaille <akim@epita.fr>
4353 * m4/utility.c (m4_bad_argc): Detail the mismatches.
4355 2001-10-01 Akim Demaille <akim@epita.fr>
4357 * tests/generate.awk: Tag the tests with `documentation'.
4358 * tests/modules.at (AT_CHECK_M4_MODTEST): New.
4359 Use the make the existing modtest tests more uniform, and complete
4360 the set of possibilities.
4362 2001-10-01 Akim Demaille <akim@epita.fr>
4364 * config/gmp.m4: Consult the user before using GMP: use
4366 * configure.ac: Adjust.
4367 * modules/gmp.c: No protection needed as the module is not built
4370 2001-10-01 Akim Demaille <akim@epita.fr>
4372 * tests/generate.awk: Remove debugging code.
4373 (fatal): Specify the current location.
4375 * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
4376 * modules/gnu.c, modules/m4.c: Use M4ARG.
4378 2001-10-01 Akim Demaille <akim@epita.fr>
4380 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
4381 (m4_regexp_compile): New.
4382 (regexp, patsubst): Use it.
4384 2001-09-30 Gary V. Vaughan <gary@gnu.org>
4386 Reinstate the memory handling improvements from the patch I just
4387 reverted. Relevant ChangeLog entries repeated here:
4389 * m4/module.c (m4_module_remove): New function that holds the core
4390 of the old m4_module_unload.
4391 (m4_module_unload): Use it.
4392 (m4_module_unload_all): When we know the modules will never be
4393 used again (i.e. on exit), free up as much module memory as
4394 possible. There are still some artifacts from resident modules
4395 living inside ltdl.c, but everything else is freed.
4396 * m4/debug.c (m4_debug_exit): Free memory allocated in
4398 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
4399 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
4400 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
4401 * m4/m4module.h: Updated prototypes.
4402 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
4403 * m4/hash.h: Updated prototypes.
4404 * src/main.c (main): Use all these new functions to clean up as
4405 much memory as possible before exit.
4407 2001-09-30 Gary V. Vaughan <gary@gnu.org>
4409 Reverted my large patch for removing the old m4_symbol
4410 structure on 2001-09-20. We are still not happy about the way
4411 trace works in conjunction with defn and undefine, and leaving
4412 the reverted patch active prevents us from moving the traced
4413 bit from the definition back to the symbol.
4415 2001-09-30 Gary V. Vaughan <gary@gnu.org>
4417 * configure.in: Moved to...
4418 * configure.ac: ...here. Added a libtool like timestamped
4419 banner, and tidied up the libltdl cruft.
4420 * config/mkstamp: Script to extract a timestamp from ChangeLog.
4421 * modules/Makefile.am (INCLTDL): Removed. This is required
4422 only when libltdl is configured in a subdirectory.
4423 * src/Makefile.am: Ditto.
4424 (LIBADD_DL): No need to add this again, libtool already knows
4425 that libm4.la depends on it.
4426 * m4/Makefile.am: Automake sets variables from AC_SUBST. Use
4429 * TODO: stackovf.c is basically broken.
4430 Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
4432 2001-09-28 Akim Demaille <akim@epita.fr>
4434 * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
4436 2001-09-27 Akim Demaille <akim@epita.fr>
4438 * tests/m4.in: Don't use short options.
4439 Simplify the stderr signature normalization.
4441 2001-09-27 Akim Demaille <akim@epita.fr>
4443 tests/m4 shall be position independent.
4447 * tests/testsuite.at: No args to AT_INIT.
4448 * configure.in, tests/Makefile.am: Adjust.
4450 2001-09-22 Akim Demaille <akim@epita.fr>
4452 Autotest has changed again.
4454 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
4455 (package.m4): Remove.
4456 * configure.in: Adjust to LIBADD_GMP.
4458 2001-09-21 Gary V. Vaughan <gary@gnu.org>
4460 * config/gmp.m4 (AC_ARG_WITH): Removed.
4461 (GMP_LIB): Renamed to LIBADD_GMP for consistency.
4462 (AC_LIB_GMP): When performing a test compile against libgmp,
4463 include the header gmp.h if possible, and link against -lgmp. If
4464 they both work define USE_GMP.
4465 * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
4466 (mpeval_LTX_init_func): Complain on load that there was no libgmp
4469 2001-09-20 Gary V. Vaughan <gary@gnu.org>
4471 * m4/evalparse.c: Moved to...
4472 * modules/evalparse.c: ...here. This code is shared between
4473 modules/mpeval.c and modules/m4.c, so there is no need to pollute
4474 the libm4 API with its details. Moderately rewritten to interface
4475 into its clients more simply.
4476 * m4/eval.c: Deleted. Migrated functionality to...
4477 * modules/m4.c: ...here.
4478 (builtin_eval): Implemented in terms of the new interface style.
4479 * modules/mpeval.c (builtin_mpeval): Ditto.
4480 * m4/m4module.h: Removed references to the former m4/eval.c.
4481 * m4/Makefile.am (libm4_la_SOURCES): Removed eval.c.
4482 (EXTRA_libm4_la_SOURCES): Deleted.
4483 * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
4484 (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
4486 2001-09-20 Akim Demaille <akim@epita.fr>
4488 * config/gmp.m4 (AM_WITH_GMP): Rename as...
4490 By default, use gmp.
4492 * configure.in: Adjust.
4493 Use Automake conditionals for USE_GMP.
4494 Always compute sizeof (long long int).
4495 This was a bug BTW, as `eval' (not `mpeval') depends on it:
4496 before, it was used _only_ if mpeval was not activated.
4497 * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
4498 (mpeval_la_LIBADD): New macros.
4499 * modules/mpeval.c: No longer be conditioned by WITH_GMP.
4501 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
4502 * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
4505 2001-09-20 Akim Demaille <akim@epita.fr>
4507 * tests/Makefile.am (package.m4): New.
4508 * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
4510 2001-09-20 Gary V. Vaughan <gary@gnu.org>
4512 More cleanup. After the last patch, m4_symbol holds nothing but
4513 the head of a chain of m4_token_data. So I have removed the old
4514 m4_symbol, so that m4_token_data chains are stored directly in the
4515 value cell of a hash table node. But there's more... m4_symbol
4516 was a more natural name for the symbol value cell, and now that it
4517 is gone I have renamed the former m4_token_data structure to
4518 m4_symbol. This change turned out to be a pig to get right, since
4519 the original code didn't need to modify the value cell itself,
4520 since changing the chain happened inside the m4_symbol that used
4521 to be returned -- I had to pass the address of the value cell
4522 across various function calls, incase the head value changed. I
4523 also tightened up the memory management to help me find a nasty
4524 memory corruption bug that took me all night to track down...
4526 * m4/m4private.h (struct m4_symbol): Removed.
4527 (struct m4_token_data): Renamed to `struct m4_symbol'. Updated
4529 * m4/hash.c (m4_hash_iterator_value): Return the address of the
4530 value cell. Updated all callers.
4531 * m4/symtab.c: Took advantage of the simplification in the data
4532 structures to rewrite a lot of this file more simply. There is
4533 still some room for optimisation here, but we should tackle that
4534 systematically closer to the release.
4536 * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
4537 revealed. This version is ahead of CVS libtool until I get chance
4538 to flush my changes.
4539 * m4/module.c (m4_module_remove): New function that holds the core
4540 of the old m4_module_unload.
4541 (m4_module_unload): Use it.
4542 (m4_module_unload_all): When we know the modules will never be
4543 used again (i.e. on exit), free up as much module memory as
4544 possible. There are still some artifacts from resident modules
4545 living inside ltdl.c, but everything else is freed.
4546 * m4/debug.c (m4_debug_exit): Free memory allocated in
4548 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
4549 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
4550 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
4551 * m4/m4module.h: Updated prototypes.
4552 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
4553 * m4/hash.h: Updated prototypes.
4554 * src/main.c (main): Use all these new functions to clean up as
4555 much memory as possible before exit.
4557 2001-09-18 Gary V. Vaughan <gary@gnu.org>
4559 The `traced' flag needs to be attached to the definition of a
4560 symbol rather than the current symbol containing the definition.
4561 Implementing this showed up some long standing post 1.4 bugs in
4562 flag propogation which I also fixed.
4564 * m4/m4private.h (struct m4_symbol): Remove the traced flag.
4565 (struct m4_token_data): And add it back in here.
4566 * m4/input.c (init_macro_token): Propogate the traced flag
4568 * m4/macro.c (expand_argument): Ditto.
4569 * tests/builtins.at (trace2, trace3): New tests based on Akim's
4572 2001-09-08 Gary V. Vaughan <gary@gnu.org>
4574 * m4/m4private.h (struct m4_token_data): Simplified by removing
4575 the redundant `traced' flag, and one level of structure nesting.
4576 (M4_TOKEN_DATA_FUNC_TRACED): Removed.
4577 * m4/input.c (init_macro_token): No need to initialise removed
4579 * m4/macro.c (expand_argument): No need to copy it either.
4580 * m4/utility.c (m4_token_data_func_traced): Or provide an access
4583 * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
4584 dependant on multiple symbols with the same key, so preserving
4585 relative symbol order in each bucket during resizing is no longer
4586 required. The resize function is considerably faster as a result.
4588 * m4/m4module.h, m4/builtin.c, m4/symtab.c:
4589 s/m4_symbol_insert/m4_symbol_define/g;
4590 s/m4_builtin_insert/m4_builtin_define/g;
4591 s/m4_macro_insert/m4_macro_define/g. Updated all callers.
4593 2001-09-08 Gary V. Vaughan <gary@gnu.org>
4595 Get rid of m4_symbol_lookup_t entirely. With Akim's earlier
4596 commits, the m4_lookup_symbol dispatch function is split into
4597 specialised functions that must be called directly.
4599 * m4/m4module.h (m4_symbol_lookup_t): Removed.
4600 * m4/symtab.c (m4_lookup_symbol): Removed.
4601 (m4_symbol_builtin, m4_symbol_macro): New functions.
4602 * m4/builtin.c (m4_builtin_define): Split into...
4603 (m4_builtin_pushdef, m4_builtin_insert): ...these.
4604 (m4_macro_define): Split into...
4605 (m4_macro_pushdef, m4_macro_insert): ...these.
4606 * src/main.c (main): Set command line macros from `-D' parameters
4607 using `m4_macro_define'.
4609 2001-09-08 Gary V. Vaughan <gary@gnu.org>
4611 * m4/symtab.c (m4_symtab_remove_module_references): Renamed as
4612 this from m4_remove_table_reference_symbols().
4613 * m4/m4module.h, m4/module.c: Updated all references.
4615 2001-09-07 Akim Demaille <akim@epita.fr>
4617 * modules/stdlib.c, modules/times.c: Misc cleanups.
4619 2001-09-07 Akim Demaille <akim@epita.fr>
4621 * configure.in: We now need Autoconf 2.52e.
4622 * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
4623 and `M4_SYMBOL_DELETE'.
4624 * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
4625 * src/main.c (main): Adjust.
4627 2001-09-06 Gary V. Vaughan <gary@gnu.org>
4629 Fix the obstack.h problem once and for all! At configure time we
4630 can test for a system supplied obstack.h: depending on the
4631 result, we now generate system.h with an #include of the correct
4632 header. As a bonus, I've also added a --with-included-obstack,
4633 incase the user doesn't like the system obstack for some
4634 reason... and also we can test the shipped obstack on a system
4635 that has oe of its own. We also now need to be careful to add
4636 build directories to the include search path, since the generated
4637 system.h will be in the build tree.
4639 * configure.in (AC_CONFIG_FILES): Generate system.h from
4641 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
4642 include the system obstack header or the copy shipped with M4.
4643 Allow the user to override configure and force the build to use
4644 the shipped version.
4645 * m4/system-h.in: New file, template for...
4646 * m4/system.h: ...this. Now deleted.
4647 * m4/m4module.h: Include system.h before everything else.
4648 * src/freeze.c: Ditto.
4649 * m4/Makefile.am (dist-hook): Remove generated system.h.
4650 (INCLUDES): Check builddir for generated headers before checking
4652 * modules/Makefile.am (INCLUDES): Ditto.
4653 * src/Makefile.am (INCLUDES): Ditto.
4655 2001-09-05 Gary V. Vaughan <gary@gnu.org>
4657 * TODO: Remove the items that have been addressed already.
4659 2001-09-05 Akim Demaille <akim@epita.fr>
4661 * src/main.c (main): Standardize --version.
4663 2001-09-05 Akim Demaille <akim@epita.fr>
4665 * modules/format.c (format): Have a bigger `str'.
4667 2001-09-05 Akim Demaille <akim@epita.fr>
4669 Rationalize warnings, reporting the macro name as if it were a
4670 program name, and assertions.
4672 * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
4674 * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
4676 Use assert for internal errors.
4677 * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
4679 * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
4681 * tests/builtins.at (pushpop): Adjust.
4683 2001-09-05 Akim Demaille <akim@epita.fr>
4685 * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
4688 2001-09-05 Akim Demaille <akim@epita.fr>
4690 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
4691 * m4/macro.c, m4/symtab.c: Adjust.
4693 2001-09-05 Akim Demaille <akim@epita.fr>
4695 * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
4696 (m4_symbol_pop, m4_symbol_del): this.
4697 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
4698 (m4_symbol_popdef, m4_symbol_delete): New.
4699 (m4_lookup_symbol): Adjust.
4700 * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
4702 2001-09-05 Akim Demaille <akim@epita.fr>
4704 * m4/m4module.h (m4_symbol_lookup): Rename as...
4705 (m4_symbol_lookup_t): this.
4707 2001-09-05 Akim Demaille <akim@epita.fr>
4709 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
4711 * m4/symtab.c (m4_lookup_symbol): Adjust.
4713 2001-09-03 Gary V. Vaughan <gary@gnu.org>
4715 Bootstrap will now work with Libtool 1.4.1 or higher:
4716 * bootstrap: Remove stale autom4te.cache files when
4718 * config/Makefile.am (ACLOCAL_MACROS): Add ltdl.m4 and
4720 * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
4721 libtool.m4 directly.
4722 Run libtoolize to refresh ltmain.sh.
4723 * config/ltmain.sh: Deleted.
4724 * acinclude.m4: Deleted.
4725 * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
4727 * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
4728 implementation for the cvs impaired libtool user.
4730 2001-09-03 Akim Demaille <akim@epita.fr>
4732 * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
4734 Avoid using `default' in switch, as it hides useful compiler
4735 warnings when a case is forgotten.
4737 2001-09-03 Akim Demaille <akim@epita.fr>
4739 * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
4740 is no such thing as `WITH_MODULES'.
4742 2001-09-03 Akim Demaille <akim@epita.fr>
4744 Improve the test suite's selfcontainedness.
4746 * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
4747 (Include, Undivert): Tag the other input files.
4748 * tests/generate.awk: Catch `@comment file:'.
4749 `-I $src' is no longer needed.
4750 `next' is really like `return': the rest is skipped.
4751 Adjust to `input.m4'.
4752 (fatal): New function.
4753 * tests/foo, tests/incl.m4: Remove.
4755 2001-09-01 Gary V. Vaughan <gary@gnu.org>
4757 The shadowing mechanism and, infact, the whole symbol table
4758 implementation was creaking under the weight of the features piled
4759 on top of it. We now have a separate hash table module which will
4760 dynamically resize to keep symbol density withing good performace
4761 limits, and a new symtab module layered above it. Symbol lookups
4762 are now marginally more efficient (since the shadowed flag is no
4763 longer required) and symbol removal, such as on module unload, is
4764 considerably faster due to a reorganisation of the data structures
4767 * src/main.c (main): Don't mention `-H'.
4768 * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
4771 * m4/hash.c: New generalised dynamic hash table data structure
4773 * m4/hash.h: Public interface.
4774 * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
4775 (libm4_la_SOURCES): Add hash.c.
4776 * m4/symtab.c: More or less rewritten from scratch, within the
4777 bounds of the previous API.
4778 (m4_symtab_apply): A cleaner version of the old hack_all_symbols
4779 call. Updated all callers.
4780 * m4/m4module.c: #include <m4/hash.h>, and changed all affected
4781 declarations to reflect API changes.
4782 (M4INIT): Generate a declaration too, to avoid the warning with
4783 --enable-debug builds.
4786 * m4/utility.c (hash_table_size): Removed.
4787 (m4_dump_symbols): Rewritten to build and qsort an array of symbol
4788 names, which are then looked up by builtin_dumpdef() as necessary.
4789 This implies a small speedup in builtin_symbols(), which discarded
4790 all of the symbol info under the old call.
4791 * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
4792 shadowing is implicit in respect to the new data structures.
4793 symbol names are no longer duplicated here, they are stored in the
4794 key field of the hash table.
4795 Moved macro_args and blind_no_args...
4796 (m4_token_data): ...to here.
4797 m4/macro.c (expand_macro): Added a name argument since the symbol
4798 name is no longer copied into each struct m4_symbol. Modified all
4800 (collect_arguments): Ditto.
4801 * modules/m4.c (set_trace): Ditto.
4802 * modules/gnu.c (builtin_symbols): Updated.
4803 * src/freeze.c (produce_symbol_dump): Much improved in light of
4804 the improved symbol table layout.
4806 2001-09-01 Gary V. Vaughan <gary@gnu.org>
4808 * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
4810 (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
4811 (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
4812 SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
4813 SYMBOL_HANDLE): Ditto.
4814 * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
4815 modules/gnu.c, modules/m4.c, src/freeze.c,
4816 src/main.c: Updated all references.
4818 * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
4819 Automake 1.5 chokes on dynamic source file lists, Besides, it is
4820 already listed in m4_LDADD... how did that ever used to work?
4821 * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
4823 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
4824 Suggested by Tim Van Holder <tim.van.holder@pandora.be>
4826 * tests/m4: Don't call the m4 wrapper script with libtool, it
4827 works fine all by itself.
4829 2001-08-30 Gary V. Vaughan <gary@gnu.org>
4831 The experimental `changeword' feature never took off, and has
4832 no obvious advantages over `changesyntax' to compensate the
4833 enormous speed penalty it carries:
4834 * configure.in (ENABLE_CHANGEWORD): Removed.
4835 * m4/m4module.h (m4_set_word_regexp): Removed.
4836 * m4/m4private.h (m4_token_data): Removed original_text field.
4837 * m4/utility.c (m4_token_data_orig_text): Removed.
4838 * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
4839 * m4/macro.c: Ditto.
4840 * src/main.c: Ditto.
4841 * modules/Makefile.am (changeword.la): Removed.
4842 * modules/changeword.c: File removed.
4843 * doc/m4.texinfo: References to changeword and --word-regexp
4845 * po/POTFILES.in: modules/changeword.c removed.
4846 * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
4847 * tests/builtins.at (changeword): Test removed.
4849 2001-08-30 Akim Demaille <akim@epita.fr>
4851 * bootstrap.sh: Create aclocal.m4 instead of modifying it.
4852 This also help having a single list of m4 files: in
4854 * config/Makefile.am (STANDARD_MACROS): Rename as...
4855 (ACLOCAL_MACROS): this.
4856 (list-standard-macros): Remove.
4859 2001-08-29 Gary V. Vaughan <gary@gnu.org>
4861 In an attempt to moderate my egomania...
4862 * tests/modules.at: Remove attributions.
4864 * tests/generate.awk: When making substitutions to "@&t@", either
4865 "&" or "\&" in the substitution string argument to gsub refer back
4866 to the matched text. "@\\&t@" seems to work though, Tests 43 and
4869 2001-08-29 Akim Demaille <akim@epita.fr>
4871 * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
4872 (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
4873 (sync-lines, trace, translit, undivert, wrap): Move to...
4874 * tests/builtins.at: this new file.
4875 * tests/others.at (Discard comments, import-environment): Move to...
4876 * tests/options.at: this new file.
4878 2001-08-29 Akim Demaille <akim@epita.fr>
4880 * tests/others.at (Freezing modules)
4881 (--module-directory: absolute path, modpath2, modpath3)
4882 (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
4883 * tests/modules.at: here, new file.
4884 * tests/others.at, tests/generate.awk: Add a banner.
4885 * tests/testsuite.at: Adjust.
4886 (AT_CHECK_M4_FILTER): New, but unused.
4888 2001-08-29 Akim Demaille <akim@epita.fr>
4890 * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
4892 * tests/others.at (wrap): Inline wrap.m4.
4893 (shadow): Inline shadow.m4.
4894 (iso8859): Don't specify the path from top_srcdir, but from srcdir.
4895 * tests/m4: Simplify.
4897 2001-08-29 Akim Demaille <akim@epita.fr>
4899 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
4902 2001-08-29 Akim Demaille <akim@epita.fr>
4904 * tests/generate.awk (normalize): s/@__@/@&t@/.
4906 2001-08-28 Akim Demaille <akim@epita.fr>
4908 * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
4910 2001-08-28 Gary V. Vaughan <gary@gnu.org>
4912 * bootstrap (generate.awk): Generate test cases with new script.
4914 2001-08-27 Akim Demaille <akim@epita.fr>
4916 * tests/Makefile.am (installcheck-local): Don't use
4917 `dc_install_base' which is not visible here, but `exec_prefix'
4918 which is clearly the RT anyway.
4919 * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
4920 related to testing a now installed m4.
4921 * tests/m4: Do it here.
4923 2001-08-27 Akim Demaille <akim@epita.fr>
4925 * tests/others.at (indir): Formatting change.
4927 2001-08-27 Akim Demaille <akim@epita.fr>
4929 * tests/Makefile.am (installcheck-local): New.
4930 * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
4932 Prefer options over envvars.
4933 * src/main.c (main): First bug caught by the test suite (yeah!):
4934 --batch lacked a `break' which resulted in an accidental
4935 invocation of --discard-comments.
4937 2001-08-27 Akim Demaille <akim@epita.fr>
4939 * tests/others.at (capitalize, changeword, comments, ddivert)
4940 (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
4941 (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
4942 (sysv-args, trace, translit, undivert): Don't rely on files in
4943 examples/: AT_DATA them.
4945 2001-08-27 Akim Demaille <akim@epita.fr>
4947 Let the test suite use a wrapper around the not installed m4 to
4948 pretend it is (installed).
4950 * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
4951 such a way that m4 does not process them.
4952 * configure.in: The package name seems to be `m4', not `M4'.
4954 * tests/atlocal.in (at_package, M4): Remove.
4955 * tests/testsuite.at, tests/others.at: Use m4, not $M4.
4957 2001-08-27 Akim Demaille <akim@epita.fr>
4959 * tests/Makefile.am (CLEANFILES): Remove.
4960 (DISTCLEANFILES, clean-local): New.
4961 * examples/mktests.sh: Remove.
4963 2001-08-27 Akim Demaille <akim@epita.fr>
4965 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
4966 Don't use aclocal: it's written by hand.
4967 * aclocal.m4: m4_include all the files instead of being built by
4969 * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
4970 until it reads the traces by itself.
4971 * configure.in: Require Autoconf 2.42c as we are now using
4972 AC_CONFIG_TESTDIR instead of AT_CONFIG.
4973 Catch unexpanded `jm_' macros.
4974 * config/atconfig.m4: Remove.
4975 * config/error.m4: new.
4976 * config/Makefile.am: Ship the files included by aclocal.m4.
4977 * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
4978 (TESTSUITE_AT): this, to please Automake.
4979 (TESTSUITE): This target uses autotest/autotest.m4, not
4980 autotest/general.m4.
4981 * tests/testsuite.at: Prereq Autotest 2.52c.
4982 * examples/Makefile.am (pkgdata_DATA): Rename as...
4983 (dist_pkgdata_DATA): this.
4984 * doc/Makefile.am (man_MANS): Rename as...
4985 (dist_man_mans): this.
4987 2001-08-20 Gary V. Vaughan <gary@gnu.org>
4989 * m4/system.h [cygwin*]: Thanks to Paul Sokolovsky and
4990 Robert Collins, building on Cygwin no longer requires Windows
4991 import and export symbol decorations.
4992 * m4/m4module.h (M4_SCOPE) [cygwin*]: Deleted all occurences.
4993 * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
4994 * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
4995 * m4/error.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
4996 * m4/input.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
4997 * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
4998 * m4/output.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
4999 * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
5000 * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
5001 * configure.in (LIBM4_DLL_IMPORT) [cygwin*]: Don't set this
5003 * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
5004 * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
5006 2001-08-20 Gary V. Vaughan <gary@gnu.org>
5008 Ansify the source. Previously we had a mix, where my code was
5009 in a K&R compatible style, and the preexisting code was in ANSI
5010 style. Nothing is lost wrt release 1.4 by reverting to ANSI,
5011 and now the code base is much cleaner.
5013 * m4/system.h: Remove M4_PARAMS macro and all users. Remove
5014 VOID macro and all users.
5015 * m4/m4module.h: Ansify function prototypes and headers.
5016 * m4/builtin.c: Ditto.
5017 * m4/evalparse.c: Ditto.
5018 * m4/input.c: Ditto.
5019 * m4/macro.c: Ditto.
5020 * m4/module.c: Ditto.
5021 * m4/output.c: Ditto.
5023 * m4/symtab.c: Ditto.
5024 * m4/utility.c: Ditto.
5025 * modules/format.c: Ditto.
5026 * modules/gnu.c: Ditto.
5027 * modules/m4.c: Ditto.
5028 * modules/mpeval.c: Ditto.
5029 * src/freeze.c: Ditto.
5031 * src/main.c: Ditto.
5033 2001-08-20 Akim Demaille <akim@epita.fr>
5035 * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
5036 generated with stock 2.52.
5038 2001-08-20 Akim Demaille <akim@epita.fr>
5040 * config/atconfig.m4: New, until part of Autoconf per se.
5041 * configure.in (AT_CONFIG): Use it.
5043 * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
5044 * tests/atlocal.in: New.
5045 * tests/generate.awk: For the time being, the empty quadrigraph is
5047 * tests/others.at (changeword, gmp): Check the configuration
5048 variable against `yes'.
5049 * tests/testsuite.at (dnl): Allow it, as it's used all over the
5052 2001-08-20 Akim Demaille <akim@epita.fr>
5054 * m4/utility.c (m4_numeric_arg): Spell out the culprit.
5055 * modules/m4.c (undivert): Disable the possibility of undiverting
5056 several files at once: it is not documented, it is inconsistent
5057 with the other macros, it can be straightforwardly mocked by
5058 several invocations, and most importantly, it prevents the
5059 possibility of other kinds of extension.
5060 Use `m4_numeric_arg'.
5062 2001-08-20 Akim Demaille <akim@epita.fr>
5064 * examples/include.m4: Typo.
5065 * tests/generate.awk: Really add it.
5066 * tests/Makefile.am: Adjust.
5067 * tests/others.at (Discard comments): It sure fails without `-c'.
5068 (include, undivert): Add -I examples/.
5070 2001-08-20 Akim Demaille <akim@epita.fr>
5072 Use sprintf, not ecft and friends since it is standard, portable,
5073 simplifies the code, and since the latter is even deprecated
5074 according to the GNU libc documentation.
5076 * modules/format.c: Drop evct support.
5078 2001-08-19 Gary V. Vaughan <gary@gnu.org>
5080 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up. Don't test
5082 * configure.in: ...do it here instead.
5084 * c-boxes.el: Deleted.
5085 * m4/builtin.c: Reformat box comments to be closer to GNU
5087 * m4/debug.c: Ditto.
5089 * m4/evalparse.c: Ditto.
5090 * m4/input.c: Ditto.
5091 * m4/m4module.h: Ditto.
5092 * m4/macro.c: Ditto.
5093 * m4/output.c: Ditto.
5094 * m4/symtab.c: Ditto.
5095 * m4/utility.c: Ditto.
5096 * modules/changeword.c: Ditto.
5097 * modules/format.c: Ditto.
5098 * modules/gnu.c: Ditto.
5099 * modules/load.c: Ditto.
5100 * modules/m4.c: Ditto.
5101 * modules/modtest.c: Ditto.
5102 * modules/mpeval.c: Ditto.
5103 * modules/perl.c: Ditto.
5104 * modules/shadow.c: Ditto.
5105 * modules/stdlib.c: Ditto.
5106 * modules/time.c: Ditto.
5107 * src/freeze.c: Ditto.
5108 * src/main.c: Ditto.
5110 2001-08-17 Gary V. Vaughan <gary@gnu.org>
5112 * m4/module.c: Fixup some errors in the description comment.
5114 2001-08-17 Akim Demaille <akim@epita.fr>
5116 * tests/others.at (iso8859): Specify the path to the M4 test file.
5117 * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
5118 files in error messages.
5120 2001-08-17 Akim Demaille <akim@epita.fr>
5122 * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
5123 * tests/others.at: Adjust input files paths.
5124 * tests/atconfig.in: Set top_builddir.
5125 * tests/Makefile.am: Adjust.
5126 `testsuite' is in src, not build.
5128 2001-08-17 Akim Demaille <akim@epita.fr>
5130 * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
5131 (generate.at): Install a temporary hack until the actual
5132 generate.awk is added to the repository.
5133 * tests/atconfig.in: New.
5135 2001-08-17 Akim Demaille <akim@epita.fr>
5137 Really apply the patch ``Drop Autoconf 2.13 compatibility.''
5139 2001-08-17 Akim Demaille <akim@epita.fr>
5141 * doc/m4.texinfo: Promote proper quotation.
5143 2001-08-17 Akim Demaille <akim@epita.fr>
5145 Remove the non Autotest tests.
5147 * tests/other-tests/capitalize.test,
5148 * tests/other-tests/changeword.test,
5149 * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
5150 * tests/other-tests/debug.test,
5151 * tests/other-tests/discard-comments.m4,
5152 * tests/other-tests/discard-comments.test,
5153 * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
5154 * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
5155 * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
5156 * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
5157 * tests/other-tests/hanoi.test,
5158 * tests/other-tests/import-environment.m4,
5159 * tests/other-tests/import-environment.test,
5160 * tests/other-tests/include.test, tests/other-tests/indir.test,
5161 * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
5162 * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
5163 * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
5164 * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
5165 * tests/other-tests/modtest.test,
5166 * tests/other-tests/multiquotes.test,
5167 * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
5168 * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
5169 * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
5170 * tests/other-tests/sync-lines.m4,
5171 * tests/other-tests/sync-lines.test,
5172 * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
5173 * tests/other-tests/translit.test, tests/other-tests/undivert.test,
5174 * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
5175 * tests/other-tests/wrap.test: Remove.
5177 * tests/run-test, tests/get-them: Remove.
5178 * tests/Makefile.am: Adjust.
5180 2001-08-17 Akim Demaille <akim@epita.fr>
5182 others.at no longer depends on other-tests/.
5184 * tests/others.at (stackovf): You're actually...
5186 (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
5187 (unload.test): Keep their authorship.
5188 (discard-comments, gmp, import-environment, modfreeze)
5189 (sync-lines): Embed the input files.
5190 * tests/stackovf.test: Copy from other-tests/stackovf.test.
5191 * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
5193 2001-08-17 Akim Demaille <akim@epita.fr>
5195 * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
5196 (M4exit): Tag the exit status of the example.
5197 * tests/get-them: Adjust.
5198 * tests/generate.awk: New, based on get-them.
5199 * tests/Makefile.am: Adjust to generate `generated.at'.
5200 * tests/testsuite.at: Adjust.
5201 (AT_CHECK_M4): Don't overquote. Blush...
5203 2001-08-17 Akim Demaille <akim@epita.fr>
5205 Start using Autotest. atconfig creation is still lacking.
5207 * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
5208 * examples/reverse.m4, tests/other-tests/import-environment.m4,
5209 * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
5210 * tests/other-tests/import-environment.test: Don't check LANGUAGE
5211 as it might be `unset', or set to `C'.
5212 * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
5213 * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
5214 * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
5215 * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
5216 * tests/other-tests/shadow.test: Adjust.
5217 * tests/testsuite.at, tests/others.at: New.
5218 * tests/Makefile.am: Adjust.
5220 2001-08-17 Akim Demaille <akim@epita.fr>
5222 Drop Autoconf 2.13 compatibility.
5224 * configure.in (changeword): No need to undefine it, as anyway if
5225 it's defined, M4sugar moved it as m4_changeword.
5226 And anyway, proper quotation is enough.
5227 (m4_pattern_allow): As it exists in 2.50, just use it.
5228 (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
5229 Don't handle Gettext's duties, let it handle them.
5230 * config/gnu-obstack.m4: Use m4_pattern_allow directly.
5232 2001-08-17 Akim Demaille <akim@epita.fr>
5234 * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
5235 (m4_errprint): Use fputs.
5236 * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
5237 dumpdef are not concerned.
5238 (Dumpdef, Errprint): Emphasize their insensitivity to
5240 * doc/Makefile.am: Add `TAGS' support.
5241 (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
5243 * config/Makefile.am (MAINTAINERCLEANFILES): New.
5245 2001-08-17 Akim Demaille <akim@epita.fr>
5247 * modules/Makefile.am (ETAGS_ARGS): New.
5249 2001-08-17 Akim Demaille <akim@epita.fr>
5251 * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
5254 2001-08-17 Akim Demaille <akim@epita.fr>
5256 * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
5258 2001-08-17 Akim Demaille <akim@epita.fr>
5260 * m4/m4module.h (m4/list.h): Don't include it.
5262 2001-08-16 Gary V. Vaughan <gary@gnu.org>
5264 m4_modules are no more, we use lt_dlhandles directly and let
5265 latest libltdl features manage the list of loaded modules.
5266 * acinclude.m4: Regenerated.
5267 * m4/ltdl.c: Updated from master copy.
5268 * m4/module.c: Reimplemented to take advantage of advances in
5270 * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
5271 list with lt_dlhandle_next.
5272 (m4_builtin_find_by_func): Ditto.
5273 (m4_builtin_table_install): Use lt_dlhandle.
5274 (m4_macro_define): Ditto.
5275 (m4_macro_table_install): Ditto.
5276 m4/module.h: Prototype new module management API.
5277 (m4_modules): No longer required.
5278 (m4_module_init_t, m4_module_finish_t): POSIX namespace
5279 violations, renamed to...
5280 (m4_module_init_func, m4_module_finish_func): ...these,
5282 (M4INIT_HANDLER): Clean way to declare init functions in modules.
5283 (M4FINISH_HANDLER): And similarly for finish functions.
5284 * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
5285 -- Add indirection to the CONC macro so that arguments are
5287 * modules/modtest.c (m4_init_module): Replaced with M4INIT_HANDLER.
5288 * modules/shadow.c (m4_init_module): Ditto.
5289 Due to new init function semantics, be careful to perform the
5290 initialisation only on first load.
5291 * modules/perl.c (m4_init_module): Ditto. And Ditto.
5292 (m4_finish_module): Replaced with M4FINISH_HANDLER.
5293 Due to new finish function semantics, be careful to perform the
5294 finalisation only on first load.
5295 * m4/m4private.h (m4_module): Removed in favour of...
5296 (m4_module_data): ...structure without all the wrapper fields.
5297 Instances of this new structure are stored associated lt_dlhandles
5298 with lt_dlcaller_data_set().
5299 * m4/builtin.c (m4_builtin_define): Takes a handle argument
5300 instead of the old module argument.
5301 (m4_builtin_table_install): Ditto.
5302 * modules/load.c (m4_resident_module): Removed. This is no
5303 longer implemented as a magic symbol...
5304 * modules/m4.c (m4_resident_module): Ditto.
5305 * modules/load.c (M4INIT_HANDLER): ...the module init function now
5306 uses the ltdl api to make the module resident.
5307 * modules/m4.c (M4INIT_HANDLER): Ditto.
5308 * modules/load.c (builtin_modules): Traverse the loaded module
5309 list with lt_dlhandle_next.
5310 (builtin_load): Much simplified in light of the reimplemented
5312 * src/freeze.c (produce_module_dump): Cleaned up and optimised in
5313 light of the m4/module.c rewrite.
5314 (produce_symbol_dump): Ditto.
5315 (reload_frozen_state): Ditto.
5316 * m4/list.c, m4/list.h: Files deleted. No longer required.
5317 * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
5318 (libm4_la_SOURCES): Delete list.c reference.
5319 * m4/m4private.h (m4_token_data): Add a handle field. This
5320 eliminates many of the searches to find the handle associated with
5321 various tokens that are passed between functions.
5322 (struct m4_symbol): Removed the module field. The
5323 module association does not belong with the symbol...
5324 * m4/input.c (struct m4_builtin): ...it belongs with the builtin
5325 that the module implementation code is from. Added a handle
5327 (m4_push_macro): Add a `handle' argument. Changed all callers.
5328 (init_macro_token): Set the `handle' field for the
5330 * m4/macro.c (expand_argument): Copy the new handle field during
5332 * modules/m4.c (macro_install): Use the new handle field to
5333 optimise the search for the correct builtin structure, and pass
5334 the handle details to m4_builtin_define.
5336 2001-08-15 Akim Demaille <akim@epita.fr>
5338 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
5339 when creating `m4/obstack.h'.
5340 * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
5342 * tests/defs: Make them absolute.
5343 (CDPATH) Neutralize.
5344 * tests/gethem: Use them.
5346 2001-08-14 Gary V. Vaughan <gary@gnu.org>
5348 * config/ltmain.sh: Doh! Import again for a quoting fix that
5349 prevented any regression test from passing.
5351 * m4/m4module.h (obstack.h): Choose between installed version
5352 and shipped version based on configure tests.
5353 * src/freeze.c (obstack.h): Ditto.
5355 * acconfig.h: Removed. No longer required.
5357 * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
5358 * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
5359 them to AC_INIT and AM_INIT_AUTOMAKE.
5360 * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
5361 disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
5362 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
5363 shell variable m4_cv_func_obstack_h.
5364 * tests/defs (M4): Be more careful about relative path to libtool
5365 script and m4 binary by using $srcdir.
5367 * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
5368 optargs to the existing libltdl search path.
5369 * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
5370 * m4/ltdl.c: Updated.
5372 * config/ltmain.sh: Ditto.
5374 2001-08-11 Gary V. Vaughan <gary@gnu.org>
5376 * src/main.c (main): Add `-b' (for `batch') mode switch to force
5377 interactive mode off.
5379 2001-08-10 Akim Demaille <akim@epita.fr>
5381 * configure.in: Require Autoconf 2.52.
5382 (AC_ARG_PROGRAM): Remove, handled by Automake.
5383 (m4_getopt): Rename as...
5384 (m4_getopt_h): this.
5385 Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
5386 Undefine `changeword' only if defined.
5387 * config/gnu-obstack.m4: Require Autoconf 2.52.
5388 (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
5391 2001-08-09 Yuji Minejima <ggb01164@nifty.ne.jp>
5393 * doc/m4.texinfo: Fix some typos, and apply some small
5396 2001-08-09 Andreas Schwab <schwab@suse.de>
5398 * src/main.c (main): Fix improper uses of error (missing format
5401 2001-08-07 Akim Demaille <akim@epita.fr>
5403 Improve `make distcheck'.
5405 * configure.in: Be sure to be able to run `mkconfig.sh' when src
5407 * Makefile.am (dist-hook): Remove, as it is no longer needed.
5408 * doc/m4.texinfo (Include): Add missing blank.
5409 * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
5412 2001-08-07 Akim Demaille <akim@epita.fr>
5414 * m4/evalparse.c: A better introductory comment.
5415 * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
5416 * m4/macro.c: Adjust old comments.
5417 * modules/README: Typo.
5419 2001-08-07 Akim Demaille <akim@epita.fr>
5421 * config/gnu-obstack.m4: New.
5423 2001-08-07 Akim Demaille <akim@epita.fr>
5425 * config/Makefile.am, config/stackovf.m4: New.
5426 * configure.in, Makefile.am: Adjust.
5428 2001-08-05 gettextize <bug-gnu-utils@gnu.org>
5430 * po/Makefile.in.in: Upgrade to gettext-0.10.39.
5431 * po/cat-id-tbl.c: Remove file.
5432 * po/stamp-cat-id: Remove file.
5434 2001-04-08 Roderick Koehle <Roderick.Koehle@infineon.com>
5436 * modules/format.c (format): Formatting for %f was not
5437 interpreting the position of the decimal point correctly for
5440 2000-12-01 Gary V. Vaughan <gary@gnu.org>
5442 * TODO: Removed m4exit bug.
5443 * modules/load.c (m4_resident_module): Make this module resident.
5444 * module/m4.c (m4_resident_module): Ditto.
5445 * m4/modules.c (m4_module_load): Use new ltdl resident modules
5446 feature to mark modules as resident if they export
5447 `m4_resident_module' as TRUE.
5448 (m4_module_unload): Do not remove resident modules, and take care
5449 with symbol insertion and deletion with resident modules.
5450 * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
5451 use resident modules feature.
5453 2000-11-30 Gary V. Vaughan <gary@gnu.org>
5455 * TODO: Updated. Removed some cruft that has since been fixed
5456 or implemented. Added some more entries.
5459 * modules/README: Updated.
5460 * doc/m4.texinfo: Updated.
5462 * modules/gnu.c (builtin_functions): Make indir orthogonal to
5463 builtin, in that each is recognised as a macro only with parameters
5464 (builtin_indir): Passing 0 arguments is now an error, as with
5467 * src/main.c (usage): Added missing description of `-c' option.
5469 2000-11-29 Gary V. Vaughan <gary@gnu.org>
5471 Consolidate the myriad of dispersed test scripts into the
5472 tests subdirectory. I think I now have all the file where I
5473 want them, so there shouldn't be anymore upheaval =)O|
5475 * tests/Makefile.am: Updated to run the new tests added below.
5476 * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
5477 tests/other-tests/ddivert.test, tests/other-tests/debug.test,
5478 tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
5479 tests/other-tests/foreach.test, tests/other-tests/forloop.test,
5480 tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
5481 tests/other-tests/hanoi.test, tests/other-tests/include.test,
5482 tests/other-tests/indir.test, tests/other-tests/misc.test,
5483 tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
5484 tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
5485 tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
5486 tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
5487 tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
5488 tests/other-tests/reverse.test, tests/other-tests/shadow.test,
5489 tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
5490 tests/other-tests/translit.test, tests/other-tests/undivert.test,
5491 tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
5492 tests/other-tests/wrap.test: New tests based on the contents
5493 of the tests removed below.
5494 * examples/Makefile.am, modules/Makefile.am: Updated to
5495 reflect removed tests.
5496 * examples/defs,modules/defs: Removed.
5497 * examples/capitalize.test, examples/comments.test,
5498 examples/ddivert.test, examples/debug.test,
5499 examples/esyscmd.test, examples/exp.test,
5500 examples/foreach.test, examples/forloop.test,
5501 examples/fstab.test, examples/hanoi.test,
5502 examples/include.test, examples/indir.test,
5503 examples/misc.test, examples/multiquotes.test,
5504 examples/patsubst.test, examples/pushpop.test,
5505 examples/regexp.test, examples/reverse.test,
5506 examples/sysv-args.test, examples/trace.test,
5507 examples/translit.test, examples/undivert.test,
5508 examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
5509 modules/modpath1.test, modules/modpath2.test,
5510 modules/modpath3.test, modules/modpath4.test,
5511 modules/modtest.test, modules/shadow.test,
5512 modules/unfrozen.m4, modules/unload.test: Removed.
5514 Move the implementation of GMP support for the mpeval() builtin
5515 into a loadable module that depends on libgmp. mpeval() and
5516 eval() share a common parser, now in m4/evalparser.c; the code
5517 in m4/numb.c and m4/numb.h is now physically split between
5518 m4/eval.c (the eval() backend) and modules/mpeval.c (the
5519 mpeval() backend), rather than being differentiated by cpp
5520 macros and multiple inclusion. The mpeval module is always
5521 built but will generate an diagnostic if it is used from an
5522 installation that didn't link in the gmp library.
5523 * modules/Makefile.am: build and install the new mpeval module.
5524 * modules/mpeval.c: Now contains the former parts of m4/numb.c
5525 and m4/numb.h that are required for gmp support in mpeval().
5526 * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
5527 * m4/evalmp.c: Removed.
5528 * m4/m4module.h: Removed conditional prototype for
5530 * m4/eval.c: Rewritten. Contains the former parts of m4/numb.c
5531 and m4/numb.h that do not rely on gmp.
5532 * m4/evalparse.c: New file, contains the shared parts of the
5533 eval() and evalmp() parser implementations, and is no longer
5534 unencumbered by cpp magic to uncover the right parts.
5535 * m4/numb.h: Removed. It's former contents are split between
5536 m4/eval.c and modules/mpeval.c.
5539 * tests/other-tests/changeword.test: New test. Rudimentary
5540 testing of changeword builtin runs only if --wnable-changeword
5541 was used at configure time.
5542 * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
5543 alternation correctly. Split into two expressions to compensate.
5544 * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
5545 * modules/Makefile.am: Build changeword module.
5546 * modules/changeword.c (m4_macro_table): Define __m4_changeword__
5547 only when --enable-changeword was passed to configure.
5548 (builtin_changeword): If --enable-changeword was not used, then
5549 report that changeword() builtin has no support in m4 binary.
5551 2000-11-28 Gary V. Vaughan <gary@gnu.org>
5553 * src/main.c (main): Fixed a particularly nasty bug is
5554 user_search_path setting -- the -M flag processing must be
5555 extremely careful with search path ordering, or else the default
5556 installed module directory (possibly containing modules from a
5557 previous release) is placed earlier in the search path than any -M
5558 arguments (which are relied upon to load uninstalled modules with
5559 most of the tests in the regresion suite).
5561 * modules/load.c (builtin_load): Nasty hack to prevent adding
5562 symbols to symtab again if a module is loaded more than once.
5563 * modules/m4.c (builtin_ifelse): removed unused variable argv0.
5565 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed a
5566 possible NULL pointer dereference.
5568 * m4/module.c (m4_module_find_by_modname): Renamed from
5569 m4_module_modname_find. Fixed all references.
5570 (m4_module_find_by_builtin): New function.
5572 * modules/modfreeze.test: load the `load' module with each
5574 * src/freeze.c (produce_frozen_state): Simplified in light of
5575 module field in m4_symbol. Allow a third argument for text macros
5576 to name the originating module.
5577 (reload_frozen_state): ditto.
5578 * m4/m4module.h: Fixup prototypes.
5579 * m4/builtin.h (m4_builtin_define): Add a module argument so
5580 that symbols can be registered against the defining module.
5581 (m4_macro_define): ditto.
5582 * m4/m4private.h (m4_symbol): Make the module field const to save
5583 on casting in the rest of the code.
5584 (SYMBOL_MODULE): New macro.
5586 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
5587 symbol reference maintenance bugs when removing a symbol from the
5590 * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
5592 2000-11-27 Gary V. Vaughan <gary@gnu.org>
5594 * configure.in (m4_cv_func_obstack): A better check for whether
5595 libc has an obstack implementation.
5596 * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
5598 * configure.in (--with-modules): Changed semantics. This
5599 option is now used to list modules to be preopened.
5600 * src/m4.h: #include "ltdl.h" unconditionally.
5601 * src/main.c: Removed all dependencies on WITH_MODULES.
5602 * src/freeze.c: ditto.
5603 * modules/Makefile.am: ditto.
5604 * m4/m4.c (builtin_m4exit): ditto.
5605 * modules/modpath1.test: ditto.
5606 * modules/modpath2.test: ditto.
5607 * modules/modpath3.test: ditto.
5608 * modules/modpath4.test: ditto.
5609 * modules/modtest.test: ditto.
5610 * modules/shadow.test: ditto.
5611 * modules/unload.test: ditto.
5613 * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
5614 comes up on demand in LTLIBOBJS now.
5615 * configure.in (getopt_long): Creating and relying on a link for
5616 getopt.h on hosts with no getopt_long() of thier own works
5617 correctly now. This is necessary so that callers of getopt_long()
5618 can simply `#include <getopt.h>': the naive way of doing this
5619 would end up using our own getopt.h and the installed
5620 getopt_long(), which is asking for trouble!
5621 (obstack_init): A similar argument applies to obstack.h and
5624 * m4/ltdl.c: Upgraded to latest bleeding edge version again.
5625 On Solaris-2.5 (at least) the native dlopen implementation
5626 gets confused about m4.o when looking for module "m4". This
5627 version always looks for .la an .$lib_ext suffixed names first
5628 to work around the problem. Sigh.
5630 * po/POTFILES.in: Take account of these file movements.
5631 * src/Makefile.am (m4_SOURCES): removed eval.c.
5632 (EXTRA_m4_SOURCES): removed numb.c and numb.h.
5633 * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
5634 (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
5635 * modules/m4.c (builtin_eval): Use m4_evaluate().
5636 * m4/eval.c: Moved here from src/eval.c to facilitate
5637 implementation of eval() builtin as part of the `m4' loadable
5639 (m4_evaluate): renamed from evaluate for namespace cleanliness.
5640 * m4/numb.c: Moved here from src/numb.c, since it is #included
5641 into eval.c at compile time.
5642 * m4/m4module.h (m4_evaluate): Added prototype.
5643 * src/m4.h (evaluate): Removed prototype.
5645 2000-11-25 Gary V. Vaughan <gary@gnu.org>
5647 * modules/perl.c (builtin_perleval): Use PL_na for
5648 compatibility with perl-5.6.
5650 * src/main.c (main): It is now safe to
5651 ``m4_module_install("m4")'', without tripping over the m4
5653 * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
5654 versions having fixed the insidious module search order bug.
5656 * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
5657 supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
5659 * configure.in: Figure out whether to use the installed
5660 getopt.h or the supplied one.
5661 * src/Makefile.am: ditto.
5663 * po/POTFILES.in: List files in their new positions.
5665 * config/ltmain.sh: This needs to be checked in to match the
5666 libtool macros copied to acinclude.m4 (until a released
5667 libtool copes with m4's needs).
5668 * bootstrap: Run gettextize.
5670 2000-11-24 Gary V. Vaughan <gary@gnu.org>
5672 * AUTHORS: Added my details.
5675 * bootstrap: temporary update until released libtool catches up.
5677 * All files: Use new GNU GPL copyright blurb with current contact
5680 * configure.in (LTLIBOBJS): Use canonical code for calculation of
5683 * config: renamed acm4 directory to config to be more like
5684 other autoconfiscated packages.
5686 * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
5687 * config/debug.m4: New file implementing configure macros to add
5688 suitable debug flags to the compiler invocation.
5690 * modules/load.c: New file implementing the ``load'' and
5691 ``unload'' builtins.
5692 * tests/get-them: Set the module search directory to the modules
5693 build directory in generated tests.
5694 * modules/shadow.test: ditto.
5695 * modules/modtest.test: ditto.
5696 * modules/modpath1.test: ditto.
5697 * modules/modpath2.test: ditto.
5698 * modules/modpath3.test: ditto.
5699 * modules/modpath4.test: ditto.
5700 * modules/modtest.test: ditto.
5701 * modules/modfreeze.test: ditto.
5702 * modules/unload.test: ditto.
5704 * modules/changeword.c: New file implementing the ``changeword''
5705 builtin as a loadable module.
5706 * modules/mpeval.c: New file implementing the ``mpeval'' builtin
5707 as a loadable module.
5709 * src/main.c (main): Load the gnu module if m4 was started
5710 normally -- i.e. without the -G option.
5711 * modules/gnu.c: New file implementing a new loadable module wuth
5712 definitions for all the gnu extension builtins.
5713 * modules/format.c: Moved here from src/format.c. Now included
5716 * src/main.c (main): Load the traditional module if m4 was
5717 started in `no_gnu_extensions' mode.
5718 * modules/traditional.c: New file implementing the ``unix'' macro,
5719 required when m4 is executed in traditional mode, as a loadable
5722 * src/main.c: Renamed from m4.c to avoid confusion with
5724 (main): Always load the m4 module.
5725 * modules/m4.c: New file implementing a new loadable module with
5726 definitions for all m4 builtins that are not gnu extensions.
5728 * m4/Makefile.am: Adjusted to take new files below into account.
5729 * m4/m4module.h: Prototypes for exported functions and types moved
5730 to this directory from the src directory.
5731 * m4/m4private.h: Moved here from src/m4private.h to facilitate
5732 the migration of all builtin implementations to loadable modules.
5733 * m4/macro.c: Moved this file here from the src directory,
5734 renaming all exported symbols to use the prefix ``m4_''.
5735 * m4/builtin.c: ditto.
5736 * m4/module.c: ditto.
5737 * m4/symtab.c: ditto.
5738 * m4/debug.c: ditto.
5739 * m4/input.c: ditto.
5740 * m4/output.c: ditto.
5742 * m4/ltdl.h, m4/ltdl.c: ditto.
5743 * m4/utility.c: Odd functions moved here from files in the src
5744 directory to facilitate builtin migration.
5746 2000-08-12 Gary V. Vaughan <gary@gnu.org>
5748 * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
5749 error message, to make translators' jobs a little easier.
5750 (builtin_builtin): ditto.
5751 (builtin_traceon): ditto.
5752 (builtin_traceoff): ditto.
5753 Reported by Akim Demaille <akim@epita.fr>
5755 * m4/Makefile.am (pkgincdir): Deleted. Use automake's built in
5756 pkgincludedir instead.
5758 * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
5759 it is exported globally. Fixed all references.
5763 (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
5764 globally. Fixed all references.
5765 (DEF_LQUOTE): ditto.
5769 2000-07-28 Gary V. Vaughan <gary@gnu.org>
5774 * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
5775 (AC_OUTPUT): touch stamp-h.in, not stamp-h.
5777 * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
5778 Removed `Prev', `Next' and `Up' fields of all @nodes now that
5779 makeinfo calculates them for us, and to make any future
5780 reorganisation easier.
5781 (Frozen files): Document format version 2.
5782 `V' now takes argument `2'.
5783 `F' can take a single argument if symbol and builtin names
5784 are the same, or 3 arguments if the builtin is from a module.
5785 New `S' specification for saving syntax table contents.
5786 New `M' specification for saving loaded module names.
5787 * src/freeze.c: Implement them.
5788 * src/input.c (syntax_code): For interpreting frozen syntax
5791 * examples/Makefile.am: Add the contents of the WWW directory to
5793 * examples/WWW/Makefile: ditto,
5794 (%.htm): Compares file contents (not just sizes) to determine
5795 whether a change has occured.
5796 * examples/WWW/_header.htm: Bumped version number.
5797 * examples/WWW: Regenerated content.
5799 * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
5800 compilers comes much easier without ansi2knr.
5801 * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
5803 * m4/list.c: New generic list container type.
5804 * m4/list.h: Interface to new container type.
5805 * m4/Makefile.am (pkginc_HEADERS): Install list.h.
5806 (libm4_la_SOURCES): compile and link list.c.
5807 * src/builtin.c (builtin_tables): Use list container.
5808 * src/module.c (symtab): ditto.
5809 * src/symtab.c (symtab): ditto.
5811 * m4/system.h: New file for common preprocessor definitions.
5812 * m4/Makefile.am (pkginc_HEADERS): install system.h.
5813 * m4/error.c: Use system.h in place of inline preprocessor.
5814 * m4/error.h: ditto.
5815 * m4/module.c: ditto.
5816 * m4/module.h: ditto.
5817 * m4/xmalloc.c: ditto.
5819 * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
5821 * m4/xmalloc.c (xmalloc_exit_failure): ditto.
5823 * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
5824 it is exported globally. Fixed all references.
5826 (module_init_t): ditto.
5827 (module_finish_t): ditto.
5828 (token_data): ditto.
5829 (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
5830 it is exported globally. Fixed all references.
5831 (SYNTAX_IGNORE): ditto.
5832 (SYNTAX_SPACE): ditto.
5833 (SYNTAX_OPEN): ditto.
5834 (SYNTAX_CLOSE): ditto.
5835 (SYNTAX_COMMA): ditto.
5836 (SYNTAX_DOLLAR): ditto.
5837 (SYNTAX_ACTIVE): ditto.
5838 (SYNTAX_ESCAPE): ditto.
5839 (SYNTAX_ALPHA): ditto.
5840 (SYNTAX_NUM): ditto.
5841 (SYNTAX_ALNUM): ditto.
5842 (SYNTAX_LQUOTE): ditto.
5843 (SYNTAX_RQUOTE): ditto.
5844 (SYNTAX_BCOMM): ditto.
5845 (SYNTAX_ECOMM): ditto.
5846 (SYNTAX_VALUE): ditto.
5847 (SYNTAX_MASKS): ditto.
5865 (TOKEN_NONE): ditto.
5866 (TOKEN_STRING): ditto.
5867 (TOKEN_SPACE): ditto.
5868 (TOKEN_WORD): ditto.
5869 (TOKEN_SIMPLE): ditto.
5870 (TOKEN_MACDEF): ditto.
5872 * m4/m4module.h (voidstar): Removed in favour of `VOID' for
5873 consistency. Fixed all references.
5874 (STRING): Renamed to `m4_string' for consistency, and because if
5875 is exported globally. Fixed all references.
5876 (token_type): Renamed to `m4_token_t' for the same reasons.
5877 (token_data_type): Renamed to `m4_token_data_t' for the same
5880 * m4/m4module.h (XCALLOC): Wrapper macro which handles type
5884 (XFREE): Wrapper macro which avoids freeing NULL pointers.
5886 * m4/m4module.h (m4_macro): New type for module defined user
5888 * modules/modtest.c (m4_macro_table): Define module user macros.
5889 * modules/shadow.c (m4_macro_table): ditto.
5891 * m4/m4module.h (M4BUILTIN_HANDLER): For defining handlers
5892 declared with M4BUILTIN.
5894 * m4/xmalloc.c: Use memset if bzero is not available when
5895 emulating calloc with malloc.
5896 (xcalloc): Fallback to malloc/bzero if calloc is not available.
5897 (xfree): Added for consistency. Will not try to free NULL
5899 * src/m4.c (xfree): Deleted in favour of the above.
5900 * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
5901 linking with libdmalloc.
5902 * m4/xstrdup.c (WITH_DMALLOC): ditto.
5904 * modules/frozen.m4: New test case.
5905 * modules/unfrozen.m4: ditto.
5906 * modules/modfreeze.test: New test.
5907 * modules/unload.test: ditto.
5908 * modules/Makefile.am (EXTRA_DIST): Distribute them.
5910 * modules/modpath1.test: Don't try this test if module support is
5912 * modules/modpath2.test: ditto.
5913 * modules/modpath3.test: ditto.
5914 * modules/modpath4.test: ditto.
5915 * modules/modtest.test: ditto.
5916 * modules/shadow.test: ditto.
5918 * modules/perl.c: New module.
5919 * modules/perl.m4: Example of using it.
5920 * modules/Makefile.am (perl_la_SOURCES): Build new perl module.
5922 * src/m4.c (main): Assume interactive mode if STDIN is connected
5924 Changed startup sequence slightly so that syntax is not
5925 initialised from here when loading a frozen file.
5927 * src/builtin.c: Much improved macro definition style.
5928 * src/m4private.h: Internal structures for m4_builtin and
5929 m4_macro instances. These are not exposed to module writers.
5930 * src/module.c (module_modname_find): Find a module structure
5932 (make_macro_table): Build an internal macro table from a external
5934 (make_builtin_table): Build an internal builtin table from an
5935 external definition.
5937 * src/module.c (module_unload): Be extremely careful to remove
5938 builtins and macros that match the module being unloaded -- no
5939 longer assume that the top element can be removed incase another
5940 odule defines an identical name.
5941 * src/symtab.c (remove_table_reference_symbols): remove all symbol
5942 table entries which refer to a given builtin table.
5943 * src/builtin.c (remove_tables): Use it!
5945 2000-07-13 Thomas Tanner <tanner@ffii.org>
5947 * Makefile.am (SUBDIRS): we need modules/ for "make dist"
5948 * acm4/modules.m4: deleted
5949 * bootstrap: don't libtoolize libltdl!
5950 * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
5951 if set, enable WITH_MODULES and add modules to DLPREOPEN
5952 * examples/misc.test: redirect standard output
5953 * lib/Makefile.am: don't use DLLDFLAGS
5954 * lib/m4module.c: include necessary headers to silence GCC -Wall
5955 * lib/m4regex.c: fixes to silence GCC -Wall
5956 * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
5957 build modules conditionally
5958 * modules/shadow.c: define symbol aliases before using them
5959 * modules/test.c: define symbol aliases before using them
5960 * po/de.po: update translation
5961 * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
5962 pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
5964 * src/m4.c: initialize libltdl's preloaded symbols via
5965 LTDL_SET_PRELOADED_SYMBOLS
5966 * src/module.c: libltdl's memory management must be initialized
5967 before calling lt_dlinit!, fix warnings
5969 2000-01-18 Gary V. Vaughan <gary@gnu.org>
5971 * README: Caveat about nls not supported by dll architecture on
5974 * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
5976 * tests/Makefile.am (stamp-TESTS): now works with VPATH.
5977 * src/Makefile.am (m4_LDADD): use $(builddir) for VPATH.
5978 * modules/Makefile.am (LIBS): ditto.
5979 (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
5980 $(top_srcdir)/m4 (for only <m4module.h>).
5981 * modules/shadow.test: fixed for VPATH.
5982 * modules/modtest.test: ditto.
5983 * modules/modpath4.test: ditto.
5984 * modules/modpath3.test: ditto.
5985 * modules/modpath2.test: ditto.
5986 * modules/modpath1.test: ditto.
5988 * modules/time.test: Removed due to timezone dependence,
5989 * modules/Makefile.am (TESTS): Removed time.test.
5991 * configure.in: Use $3 of AC_DEFINE so that we can,,,
5992 * acconfig.h: Remove everything except the gettext parameters.
5993 * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
5995 * acm4/ltdl.m4: Updated to latest from libtool cvs.
5996 * acm4/modules.m4: Remove code which duplicates ltdl.m4 and
5997 increment serial number.
5999 * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
6000 src dir and immediately after libm4 is built for confidence that
6001 it doesn't rely on the src directory.
6002 (SUBDIRS): Moved doc dir to the end since helptoman.pl and
6003 makeinfo stop the build on cygwin (because they don't work).
6005 * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
6007 * m4/m4private.h: ...is not a public header, so moved to src.
6008 Add `#include <config.h>', `#define _COMPILING_M4' and
6010 * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
6011 * src/Makefile.am (noinst_HEADERS): add m4private.h.
6012 * src/builtin.c: `#include "m4private.h"' now takes care of the
6013 above. Duplicates removed.
6014 * src/debug.c: ditto.
6015 * src/eval.c: ditto.
6016 * src/evalmp.c: ditto.
6017 * src/format.c: ditto.
6018 * src/freeze.c: ditto.
6019 * src/input.c: ditto.
6021 * src/macro.c: ditto.
6022 * src/module.c: ditto.
6023 * src/numb.h: ditto.
6024 * src/output.c: ditto.
6025 * src/path.c: ditto.
6026 * stackovf.c: ditto.
6029 * po/POTFILES.in: compensate for renaming of lib/*.
6030 * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
6031 (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
6032 and then in $(top_srcdir)/lib (for eg. "m4private.h").
6033 * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
6035 * m4/m4error.h: Renamed error.h, for installation to
6036 $prefix/include/m4..
6037 * m4/m4obstack.h: Renamed obstack.h, for same reason.
6038 * m4/m4regex.h: Renamed regex.h, for same reason.
6039 * m4/m4error.c: Renamed error.c, and use #include "error.h".
6040 * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
6041 * m4/m4regex.c: Renamed regex.c, and fix #includes.
6043 * lib: moved to m4 to easily support header installation to
6045 * Makefile.am (SUBDIRS): renamed lib dir to m4.
6046 * configure.in (AC_OUTPUT): reference m4/Makefile.in.
6047 * acm4/regex.m4: Point to m4/regex.c.
6049 * examples/foreach.m4: Sanitise quoting.
6050 * examples/foreach.test: New torture test.
6051 From Akim Demaille <akim@epita.fr>
6053 2000-01-17 Gary V. Vaughan <gary@gnu.org>
6055 * src/ltdl.c: Use access() to abort doomed module load attempts
6056 if module file does not exist.
6058 * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
6059 getopt1.o will already be used if appropriate, so I moved getopt.c
6060 and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
6062 * modules/modpath1.test: Use correct filename in header line.
6063 * modules/modpath2.test: ditto.
6064 * modules/modpath3.test: ditto.
6065 * modules/modpath4.test: ditto.
6067 Without these changes lt_dlopen("test") attempts to
6068 LoadLibrary("/bin/test") on Windows, which although harmless
6069 generates a spurious error message which spoils most of the tests:
6070 * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
6071 (TESTS): s/test.test /modtest.test /
6072 (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
6073 (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
6074 * modules/modpath1.test: s/test.m4 /modtest.m4 /
6075 * modules/modpath2.test: ditto.
6076 * modules/modpath4.test: ditto.
6077 * modules/modpath3.test: s/-m test /-m modtest /
6078 * modules/shadow.m4: use {un,}loadmodule(`modtest').
6080 2000-01-16 Gary V. Vaughan <gary@gnu.org>
6082 * src/ltdl.c (find_file): Updated to new version with fixed memory
6083 allocation bug in `next'.
6084 * src/ltdl.h: updated to match.
6086 * modules/Makefile.am: Cleaned up and reordered.
6088 2000-01-16 René Seindal <rene@seindal.dk>
6090 * modules/Makefile.am (TESTS): New tests for the module system.
6092 * modules/*.test: New files.
6094 * src/m4.c (main): Added call to module_init().
6095 Treats -M and -m as the arguments -D -U and -t, ie deferred.
6097 * src/m4.h: Added declaration of module_init().
6099 * src/module.c (module_init): No longer static
6101 * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
6102 Added to shut up automake about non standard libtool library
6105 * src/module.c: Disabled DEBUG by default.
6107 * modules/README: Changed example from unload.m4 to shadow.m4
6109 * modules/shadow.m4: Renamed from unload.m4
6111 * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
6113 * src/m4.c (main): Functionality for -m and -M were reversed.
6116 2000-01-12 Gary V. Vaughan <gary@gnu.org>
6118 * doc/help2man.pl: updated to version 1.020.
6120 * lib/COPYING.LIB: updated to version 2.1.
6122 * lib/m4module.h: restructure the M4_SCOPE code to work when
6123 creating a dll which links with libm4.la and both DLL_EXPORT
6124 (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
6127 2000-01-11 Gary V. Vaughan <gary@gnu.org>
6129 Merged the following changes from my tree:
6131 1999-06-15 Gary V. Vaughan <gary@gnu.org>
6133 * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
6134 ported to compile shared libs.
6136 * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
6137 use `__declspec(dllimport)' when linking libm4.la on win32.
6138 * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
6140 * configure.in (M4OBJS): Discover whether we need the shipped
6141 implementation of getopt_long.
6142 * src/Makefile.am (m4_LDADD): Link the getopt objects into the
6143 main binary here, as opposed to the module library in lib/libm4.la.
6145 1999-06-14 Gary V. Vaughan <gary@gnu.org>
6147 * modules/README: Updated to describe the improved libltdl based
6149 * README (cygwin): Added some compilation notes for building m4
6150 correctly under cygwin.
6151 * TODO: Cleaned out the entries for the module system since they
6152 are now implemented.
6154 * *.[ch]: __P is in the compiler's reserved namespace, so replaced
6155 all instances of __P with M4_PARAMS.
6157 * lib/getdate.h: removed unreferenced file.
6159 * lib/m4private.h: New file to define the private interface to the
6160 token_data struct, which must be shared between m4module.c, and
6161 builtin.c but not exported to modules built from the installed
6162 m4module.h since it's size changes depending on compile time
6165 * src/m4.h: Lots of stuff moved to lib/m4module.h.
6167 * lib/m4module.h: New file to define the interface available when
6168 compiling m4 modules.
6169 * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
6170 necessary for module compilation into this new file.
6172 * lib/Makefile.am (include_HEADERS): install headers (renamed to
6173 avoid nameclash with other system headers) necessary for compiling
6175 (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
6176 so that modules can include the (renamed) installed headers and
6177 be guaranteed a matching implementation.
6178 * lib/m4error.h: renamed from error.h.
6179 * lib/m4obstack.h: renamed from obstack.h.
6180 * lib/m4regex.h: renamed from regex.h.
6181 * configure.in (AC_REPLACE_FUNCS): Don't look for a system
6182 implementation, simply include the shipped version
6183 unconditionally, otherwise it is hard for a module to know
6184 whether the m4obstack.h header it is using matches the
6185 implementation it ends up linking against.
6186 (jm_WITH_REGEX): Include regex into libm4 unconditionally for
6189 1999-05-18 Gary V. Vaughan <gary@gnu.org>
6191 * examples/misc.test: Don't run this test on machines which don't
6192 have a root user in /etc/passwd (e.g. cygwin).
6194 * tests/get-them (/^@example$/): Error messages might have a
6195 ``.exe'' suffix to the program name, or else use the libtool
6196 ``.libs/lt-m4'' binary, or generally have an unexpected path. All
6197 of these cases are now catered for when comparing error messages
6199 * tests/other-tests/*.test: ditto.
6200 * examples/*.test: ditto.
6202 * tests/defs (M4): use libtool execute mode.
6203 * examples/defs (M4): ditto.
6205 * tests/get-them (END): explicitly close any open file.
6206 (printthem): In a regular expression, '{' is the start of a repeat
6207 count! Use `[{]' for a literal open brace.
6208 (/^@node /): Don't use substr on a string shorter than the trim
6211 1999-05-17 Gary V. Vaughan <gary@gnu.org>
6213 * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
6215 (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
6217 2000-01-10 Andreas Schwab <schwab@suse.de>
6219 * tests/other-tests/gmp.test: Find config.sh in build directory.
6221 * configure.in: Find tests/mkconfig.sh in $srcdir.
6223 * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
6224 <signal.h> (for SUS2 compliant systems).
6226 * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
6229 2000-01-10 René Seindal <rene@seindal.dk>
6233 * TODO, NEWS: Cleaned up and updated.
6235 * src/m4.c (main): New variable exit_status for exit status in
6236 case of unreadable files. Now m4 will exit with EXIT_FAILURE if a
6237 file cannot be read instead of EXIT_SUCCESS.
6239 * src/builtin.c (m4_indir): Changed error message to help
6240 translators (from Akim Demaille <demaille@inf.enst.fr>).
6242 * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
6245 * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
6248 * src/input.c (match_input): Reordering of code, to avoid multiple
6249 calls to push_string_init() from obstack_grow(), which can happen
6250 with some compilers (found and fixed by James Bonfield
6251 <jkb@mrc-lmb.cam.ac.uk>).
6253 * src/stackovf.c: Added prototypes for ultrix.
6254 (setup_stackovf_trap): Added __P to cast.
6255 (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
6257 2000-01-09 René Seindal <rene@seindal.dk>
6259 * doc/m4.texinfo (Changequote): Added comment about changing
6260 quotes when the old quote is a part of the new.
6262 * src/builtin.c (expand_ranges): Added break after trailing dash.
6263 This caused misbehavious on some systems (found and fixed by Akim
6264 Demaille <demaille@inf.enst.fr>).
6266 * AUTHORS: Thomas Tanner included
6268 * acconfig.h: Added entry for ss_sp (see below).
6270 * configure.in (use_stackovf): Added check for stack_t with member
6271 ss_base instead of ss_sp (BSDI notably). (Reported by Paul Eggert
6272 <eggert@twinsun.com>).
6274 * doc/m4.texinfo (Frozen files): Added a simpler example for
6275 generating frozen files from several input files.
6277 1999-11-14 Paul Eggert <eggert@twinsun.com>
6279 * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
6280 lib/regex.c, lib/xmalloc.c.
6282 1999-11-10 René Seindal <rene@seindal.dk>
6284 * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
6286 * src/module.c: reindented.
6287 (module_load): return if this is a repeated load of same module.
6288 (module_init): slight change of logic to avoid repeated
6289 initialisation debug messages.
6291 * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
6292 in the distribution.
6294 * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
6295 automake warnings about missing lib prefix.
6296 (time_la_LDFLAGS): ditto
6297 (stdlib_la_LDFLAGS): ditto
6299 1999-11-10 Paul Eggert <eggert@twinsun.com>
6301 * src/m4.h: Include error.h, since our macros use error.
6302 * src/m4.c: Don't need to include error.h.
6304 1999-11-09 Paul Eggert <eggert@twinsun.com>
6306 * src/m4.h (voidstar): Define to void * if __STDC__ is defined
6307 and zero, as Solaris 7 cc does.
6308 (bcopy): Remove macro; no longer needed with new obstack.h.
6310 * src/output.c (freeze_diversions): Don't assume that a
6311 diversion size can fit in `int'. Check for diversion file
6312 size too large to be printed with `unsigned long'.
6314 * src/Makefile.am (CFLAGS): Omit -Wall.
6316 * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
6318 * src/debug.c (trace_format):
6319 Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
6321 * src/freeze.c (produce_frozen_state):
6322 Don't assume string lengths fit in int.
6324 1999-10-13 René Seindal <rene@seindal.dk>
6326 * po/cs.po: Czech translation added.
6328 * po/sv.po: Updated Swedish translation.
6330 * po/ru.po: Updated Russian translation.
6332 * po/pl.po: Updated Polish translation.
6334 * po/el.po: Greek translation added.
6336 1999-10-13 René Seindal <rene@seindal.dk>
6338 * configure.in (ALL_LINGUAS): Added Greek translation (el).
6339 (ALL_LINGUAS): Added Czech translation (cs).
6341 1999-03-30 Gary V. Vaughan <gary@gnu.org>
6343 * src/builtin.c: moved module loading functions into...
6344 * src/module.c: entirely new implementation using libltdl.
6345 * po/POTFILES.in: added src/module.c.
6346 * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
6347 are modules, not linktime libraries.
6348 (LDFLAGS): added -no-undefined -module and -avoid-version flags.
6349 * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
6350 avoidance on exported symbols.
6351 * modules/test.c (m4_macro_table, m4_init_module,
6352 m4_finish_module): ditto.
6353 * modules/time.c (m4_macro_table): ditto.
6355 * modules/time2.m4: new file which requires command line loading
6357 * src/m4.c (--load-module): dynamically load named runtime module
6358 into running executable before reading the source.
6359 (--module-directory): prepend a directory to the module search
6361 (module_init()): Do this the first time we load a module instead;
6362 if the module subsystem is broken normal m4 scripts can still run.
6363 * src/m4.h (install_builtin_table): is now exported.
6365 1999-03-26 Gary V. Vaughan <gary@gnu.org>
6367 * src/module.c: removed. No longer required.
6368 * po/POTFILES.in: removed src/module.c.
6370 * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
6371 the bootstrap script can recreate.
6372 * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
6373 * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
6374 * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
6375 * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
6376 (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
6377 * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
6378 * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
6379 * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
6381 * acinclude.m4: removed. `aclocal -I acm4' handles this much
6383 * acm4/Makefile.am (ACINCLUDE_M4): ditto.
6384 * acm4/gettext.m4: removed. It causes a multiple definition vs.
6385 the installed gettext.m4 file when running aclocal.
6387 1999-03-25 Gary V. Vaughan <gary@gnu.org>
6389 * configure.in (AM_INIT_AUTOMAKE): bumped version number to
6390 distinguish this from the last prerelease.
6391 (AC_LIBLTDL_CONVENIENCE): build libltdl as a convenience library
6392 in its own subdirectory.
6394 * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
6395 lib prefix on a module" feature.
6396 (LDFLAGS): Added `-module -avoid-version' flags to build
6397 versionless module libraries.
6398 * src/builtin.c (m4_load_module): use libltdl.
6399 (module_unload_all): use libltdl.
6400 * src/m4.c (module_init): initialise module loading on demand for
6401 better diagnostics, and so that m4 will still work even if
6402 the module code is broken.
6403 * src/m4.h (module_init): removed. No longer relevant.
6404 * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
6405 exported symbols for compatibility with dlpreopening.
6406 * modules/test.c (m4_macro_table, m4_init_module,
6407 m4_finish_module): ditto.
6408 * modules/time.c (m4_macro_table): ditto.
6410 * bootstrap: New file. Runs all the autoutils in the right order
6411 after a fresh checkout, or a make maintainer-clean.
6413 1999-02-18 Akim Demaille <demaille@inf.enst.fr>
6415 * src/builtin.c (dump_symbols): New function, factoring common
6416 content of m4_dumpdef and m4_symbols.
6417 (m4_dumpdef): Use it.
6418 (m4_symbols): New function, implementing `symbols'. Use it.
6419 * doc/m4.texinfo: Fixed missing commas after @xref, so that the
6420 file compile with modern makeinfo.
6421 (Symbols): New node, documenting symbols.
6422 (direntry): Modernize.
6424 1998-12-11 René Seindal <rene@seindal.dk>
6426 * src/builtin.c (predefined_tab): New predefined macros
6427 __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
6428 configure time options.
6430 1998-12-01 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
6432 * src/module.c (module_try_load): Don't try to be clever and
6433 overwrite argument string. Instead allocate all constructed
6434 strings locally, since they can have arbitrary lengths. Make
6435 arguments pointers to const.
6436 (module_search): Simplify due to above change.
6438 1998-11-29 René Seindal <rene@seindal.dk>
6442 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
6444 * tests/other-tests/import-environment.{m4,test}: New test.
6446 * tests/other-tests/discard-comments.{m4,test}: New test.
6448 * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
6450 * src/m4.c (main): New option -c --discard-comments.
6451 New global variable discard_comments.
6453 * src/m4.h (token_type): New TOKEN_NONE for tokens to be
6454 discarded, ie never returned from next_token().
6455 Added declaration of discard_comments.
6457 * src/input.c (next_token): Now loops until token type is not
6458 TOKEN_NONE. Comments are now given this type when comments should
6461 * doc/m4.texinfo (Invoking m4): Updated for --import-environment
6464 1998-11-28 René Seindal <rene@seindal.dk>
6466 * src/m4.c (main): New option --import-environment (no single
6469 * When configured with --with-gmp both the normal (fast) eval()
6470 and the gmp aware mpeval() are defined. To restore previous
6471 bahaviour use "define(`eval', defn(`mpeval'))".
6473 * tests/other-tests/gmp.m4: Changed to use mpeval().
6475 * src/evalmp.c: New file for compiling eval.c as gmp aware.
6476 Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
6478 * src/eval.c: Now includes "numb.c" directly. Everything in this
6479 file must by static, except evaluate(), which is changed to
6480 mp_evaluate() if USE_GMP in force.
6482 * src/numb.c: Changed to be included by eval.c instead of being
6483 compiled separately. Everything is declared static.
6485 * src/numb.h: Removed declarations of functions, as numb.c is now
6488 * src/builtin.c: Declaration of m4_mpeval() added.
6489 Inserted `mpeval' in builtin table.
6490 (do_eval): New function with common code for m4_eval and m4_mpeval.
6491 (m4_mpeval): New function for gmp version of eval.
6493 * src/m4.h: Declaration of mp_evaluate().
6495 * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
6496 (EXTRA_m4_SOURCES): Now has numb.c and numb.h
6498 * src/m4.c (main): m4 --version also shows which options were used
6499 for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
6501 1998-11-27 René Seindal <rene@seindal.dk>
6503 * Error messages now always print program name before input file
6504 name as specified by GNU coding standards. Reported by Akim
6505 Demaille <demaille@inf.enst.fr>.
6507 * doc/m4.texinfo (Include): Change due to changed error message
6511 * tests/get-them: Minor change to sed script due to changed error
6514 * src/m4.c (print_program_name): New func used to print program
6515 name, input file and line number in error (). Used as an
6516 error_print_progname handler.
6517 (reference_error): Removed.
6518 (main): Assigns error_print_progname.
6520 * src/m4.h (M4ERROR): Removed reference_error ().
6522 1998-11-25 René Seindal <rene@seindal.dk>
6524 * Updated to libtool 1.2b.
6526 * src/builtin.c (install_builtin_table): Added braces to avoid
6527 warning of ambiguous 'else'.
6529 * src/module.c: Inserted search path code from path.c modified to
6531 (module_init): Configured default path used only if M4MODPATH is
6533 (module_try_load): Now reads libMODULE.la as generated by libtool
6534 for actual module name.
6535 (module_load): Gives better error messages on failure.
6537 * src/m4.h: Added declarations of structures and functions for
6538 generic search path handling.
6540 * src/path.c: Removed all module specific code and introduced new
6541 functions of more generic search path handling.
6543 1998-11-24 René Seindal <rene@seindal.dk>
6545 * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
6546 included gettext, as <libintl.h> might not be found
6547 otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
6549 1998-11-22 René Seindal <rene@seindal.dk>
6551 * src/output.c (insert_diversion): Fixed bug that might cause m4
6552 to read from standard output! Triggered by input
6553 'divert(1)undivert(0)'. Test for divnum>0 changed to divnum>=0,
6554 so now 'undivert(0)' does nothing.
6556 1998-11-18 René Seindal <rene@seindal.dk>
6560 * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
6561 could be changed when compiling a illegal regexp, causing later
6562 use of the regexp to dump core.
6564 * src/module.c (module_load): Changed error message to conform to
6567 * src/m4.c (usage): Added message about reporting bugs.
6569 * doc/m4.texinfo (Changeword): Corrected a wrong example.
6570 (Changeword): Added note about the type of regexps used.
6572 * ltconfig, ltmain.sh: New files from Libtool 1.2.
6574 * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
6575 and AM_PROG_LIBTOOL.
6577 * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
6580 * modules/Makefile.am: Changed completely to compile modules using
6581 libtool. The modules are compiled as shared libraries, and are
6582 renamed when installed.
6584 * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
6585 USE_SHL_LOAD to HAVE_SHL_LOAD
6587 * src/builtin.c (shipout_string): Now tests for a NULL string.
6589 * src/module.c: New level of indirection around non-portable
6590 functions to load shared objects. Intended to encapsulate the non
6591 portable parts better and to reduce the number of #ifdefs in the
6594 * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
6595 directory modules/ to the distribution.
6597 1998-11-15 René Seindal <rene@seindal.dk>
6601 * modules/stdlib.c: New module `stdlib' defining some standard
6602 functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
6603 getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
6605 * src/builtin.c (shipout_string): New convenience function for
6606 builtins and modules.
6608 * src/module.c (module_load): Tentative support for
6609 shl_load/shl_findsym, but I cannot test it. Copied from MetaHTML.
6611 * Makefile.am (SUBDIRS): Directory modules added if configured.
6613 * modules/Makefile.am: Now correctly compiles and installs
6614 modules in pkglibexecdir.
6616 * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
6617 These two are now initialised by autoconf macros.
6619 * src/path.c (module_env_init): MODULE_PATH is always on the
6622 * src/Makefile.am: Now generated pathconf.h which defined the
6623 default MODULE_PATH.
6625 * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
6626 where modules are installed.
6628 * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
6629 by Brian J. Fox <bfox@datawave.net>. This change allow modules to
6630 build and install automatically, and it is prepared for other
6631 interfacec than dlopen().
6633 * src/builtin.c (predefined_tab): Added __m4_version__ for the
6634 current version of GNU m4. It is a GNU extension.
6636 1998-11-14 René Seindal <rene@seindal.dk>
6638 * tests/Makefile.am (GENERATED_TESTS): Added new
6639 generated-tests/changesy.8.test
6641 * doc/m4.texinfo (Changesyntax): Documentation for escape
6644 * src/macro.c (expand_token): Check for escaped macro call before
6645 symbol table lookup.
6647 * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
6650 * src/input.c: New static variable use_macro_escape, which is TRUE
6651 iff some character has code SYNTAX_ESCAPE
6652 (input_init): Added initialisation of use_macro_escape.
6653 (check_use_macro_escape): New function to synchronise
6654 use_macro_escape with the syntax table.
6655 (set_quotes): Added call to check_use_macro_escape()
6658 (next_token): Added new case for IS_ESCAPE.
6660 * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
6662 1998-10-13 René Seindal <rene@seindal.dk>
6666 * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
6669 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
6670 maintained tests in tests/other-tests. These currently tests for
6671 8-bit transparency, multiple precision arithmetic and sync-line
6672 output. Test for stackoverflow detection does not work.
6674 * examples/Makefile.am (TESTS): Added tests for all example files.
6676 * examples/mktests.sh: New file. Help program for creating test
6679 * tests/mkconfig.sh: New file to generate tests/config.m4 and
6680 tests/config.sh. This is for tests of configure selectable
6681 features. Picks up all set WITH_ and ENABLE_ veriables from
6684 * src/path.c (path_search): Added argument 'char **expanded_name'
6685 to return the expanded name.
6687 * src/m4.h: Added 2nd argument to declaration of path_search().
6689 * src/m4.c (main): Added 2nd argument to path_search().
6691 * src/freeze.c (reload_frozen_state): Do.
6693 * src/builtin.c (m4_undivert): Do.
6696 1998-10-11 René Seindal <rene@seindal.dk>
6698 * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
6700 * acm4/modules.m4: New file. Defines AM_WITH_MODULES.
6702 * acm4/gmp.m4: New file. Defines AM_WITH_GMP.
6704 * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
6706 * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
6708 * intl/: Updated to GNU gettext 0.10.35.
6710 * doc/m4.texinfo (Format): Documented that format is blind.
6712 * src/builtin.c (builtin_tab): Builtin format marked as blind.
6714 1998-10-07 René Seindal <rene@seindal.dk>
6718 * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
6719 .test, as the files are no longer just m4 input.
6721 * tests/get-them (FILE): Changed .m4 extension to .test.
6723 * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
6724 Otherwise quoted strings with leading whitespace first in a macro
6725 argument would be eliminated.
6727 * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
6728 (expand_argument): Do.
6730 * src/input.c (next_token): SPACE and NUM/OTHER characters are only
6731 grouped together iff both quote and comment strings are single
6732 character. Otherwise they might include a comment/quote leader.
6733 (next_token): Returns new token type TOKEN_SPACE.
6735 * src/builtin.c (push_builtin_table): New function to push a
6736 builtin_table on the stack without installing its contents.
6737 (find_builtin_by_name): Added call to push_builtin_table() if
6738 reading frozen files. Otherwise the builtins named in the frozen
6739 files could not be found.
6740 (install_builtin_table): Changed to use push_builtin_table()
6742 1998-10-04 René Seindal <rene@seindal.dk>
6744 * po/pl.po: Polish translation added.
6746 * po/POTFILES.in: src/module.c added.
6748 1998-10-04 René Seindal <rene@seindal.dk>
6752 * configure.in (ALL_LINGUAS): Added Polish pl.po
6754 1998-10-03 René Seindal <rene@seindal.dk>
6756 * Many files: Incorporated changes to implement dynamic modules.
6757 Detailed comments in src/modules.c and modules/README
6759 * src/module.c: New file, implements the OS dependant parts of
6760 dynamic module loading.
6762 * src/Makefile.am (m4_SOURCES): Added module.c
6764 * src/builtin.h: New file, declares some functions from builtin.c
6765 that are of use for other modules (shipout_int, numeric_arg,
6766 skip_space, bad_argc), and the macros ARG() and DECLARE().
6768 * src/builtin.c (install_builtin_table): New function. Each
6769 module brings in a builtin_table, which is pushed on a stack.
6770 (struct builtin_table): New struct for list of builtin_tables.
6771 (m4_loadmodule): New function to implement builtin "loadmodule".
6772 (shipout_int): No longer static, to be used by modules.
6776 (builtin_init): changed to call install_builtin_table()
6777 (find_builtin_by_name): Now searches all builtin_tables
6778 (find_builtin_by_addr): do.
6780 * src/path.c: Reorganised to allow for two search paths, one for
6781 include files and one for modules.
6783 * src/m4.h: Added declarations for new functions in module.c and
6786 * src/m4.c (main): Added call to module_init().
6788 * modules: New directory with a few demo modules.
6790 * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
6793 * configure.in: Added modules/Makefile to AC_OUTPUT.
6795 * configure.in: Added code to implement --with-modules. Tests for
6798 * acconfig.h: Added WITH_MODULES
6800 1998-10-02 René Seindal <rene@seindal.dk>
6802 * examples/Makefile.am (pkgdata_DATA): Removed special target for
6803 check and variables TESTS. These tests are now run from the
6806 * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
6807 directory. The files stay there but the tests are run from the
6810 * tests/Makefile.am (EXTRA_DIST): Added run-test.
6812 * tests/run-test: New file. Run a test manually
6814 * tests/Makefile.am, tests/get_them: Moved automatically generated
6815 tests (from the manual) to sub directory tests/gentest/. The
6816 tests/ directory had gotten a bit messy.
6818 1998-09-06 Erick Branderhorst <Erick.Branderhorst@asml.nl>
6820 * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
6821 wrap}.test: Added a few testcases.
6823 1998-08-21 Erick Branderhorst <Erick.Branderhorst@asml.nl>
6827 * lib/Makefile.am (noinst_HEADERS): regex.h added
6829 * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
6830 acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
6832 * acm4/Makefile.am: created providing rules to create
6833 $(top_srcdir)/acinclude.m4 to be used by aclocal.
6835 * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
6836 `C'. Reported by Ulrich Drepper.
6838 * Makefile.am (SUBDIRS): Removed checks directory
6839 * configure.in (AC_OUTPUT): Removed checks/Makefile
6841 * doc/m4.texinfo (Patsubst,example): @comment added to preserve
6842 the space when m4.texinfo is edited and whitespace.el is active.
6843 (Defn,example): idem.
6845 1998-08-20 Erick Branderhorst <Erick.Branderhorst@asml.nl>
6847 * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
6848 ../COPYING. ../Makefile is a file which is certainly present when
6849 test is executed in testSubDir. One can't be sure that the COPYING
6850 file is in .. or ../.. in all situations, the ../Makefile is
6853 * doc/m4.texinfo (Include): adjusted expected test output
6854 according to new tests, i.e. the input will always come from the
6855 file `in' created by the test.
6857 * tests/Makefile.am: Added three lines at the top to get
6858 esyscmd.1.test working.
6860 * tests/get-them: modified to generate clearer tests who will need
6861 less maintenance when new test examples are created in
6862 `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
6863 need the generic file `defs') shell scripts creating `in', `ok',
6864 `out' and when apropriate `okerr' and `err' in the directory
6865 `testSubDir' when executed. The compare of `ok' and `out'
6866 (and of `okerr' and `err') will be the exit status of the test.
6867 `out' must match `ok' (and `okerr' must match `err') for the test
6870 * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
6871 the tests generated by tests/get-them getting it input normally
6872 from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
6873 (dot) before the numeric part) is reserved for all other (hand
6874 written) tests. The `+' means one or more times.
6876 1998-08-12 Erick Branderhorst <Erick.Branderhorst@asml.nl>
6878 * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
6879 supported short man page to refer to info documentation
6880 * helptoman.pl: added
6881 * configure.in: AC_PATH_PROG(PERL,perl)
6882 * Makefile.am (SUBDIRS): doc after src
6884 * libitized with libit 0.5 from
6885 ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
6887 * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
6888 * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
6889 replacement functions, (libm4_a_LIBADD): @LIBOBJS@
6890 * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
6892 * configure.in (AC_CHECK_FUNC): getopt_long
6894 * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
6896 * TODO: added entry about dependencies
6898 1998-08-10 René Seindal <rene@seindal.dk>
6902 * doc/m4.texinfo (Changesyntax): Added documentation for the macro
6905 * src/builtin.c (m4_changesyntax): Added builtin macro
6906 "changesyntax" to modify the syntax table.
6908 * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
6909 table. All categories are assigned a syntax code and tokens are
6910 read according to this table.
6912 1998-08-09 René Seindal <rene@seindal.dk>
6914 * src/numb.{c,h}: New files, implements multiple precision eval
6915 using GNU gmp. Originally submitted by John Gerard Makecki
6916 (johnm@vlibs.com), later modified. Tested with GNU gmp 2.0.2.
6918 * doc/m4.texinfo (Eval): Added documentation for multiple
6919 precision arithmetic library support.
6921 * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
6922 to accommodate multiple precision eval.
6924 1998-08-07 René Seindal <rene@seindal.dk>
6926 * src/input.c (MATCH, match_input), src/m4.h: changed definition
6927 of comment and quote strings to `unsigned int' to allow eight bit
6928 chars (reported by andrewb@zip.com.au (Andrew Bettison)).
6930 * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
6931 patch from Mike Howard <mike@clove.com>
6933 1998-08-06 René Seindal <rene@seindal.dk>
6935 * gettext.m4: corrected AM_WITH_NLS to handle use of installed
6938 1998-08-03 René Seindal <rene@seindal.dk>
6942 * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
6943 and _ macro. M4 now builds with --disable-nls.
6945 * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
6946 to look for right message catalogs. Call indef'ed by ENABLE_NLS.
6948 * configure.in (ALL_LINGUAS): Added complete list of translations:
6949 de fr it ja nl ru sv.
6951 1998-05-23 Erick Branderhorst <Erick.Branderhorst@asml.nl>
6953 * po/nl.po: Dutch translation by Erick Branderhorst.
6955 * po/fr.po: French translation by Erick Branderhorst, based on the
6956 translations by François Pinard in fr.msg and m4.cod.
6958 1998-05-22 Erick Branderhorst <Erick.Branderhorst@asml.nl>
6962 * src/m4.c: #include <signal.h> not <sys/signal.h>.
6964 * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
6966 * checks/Makefile.am: explicit list tests in CHECKS.
6968 * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
6969 src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
6970 mkinstalldirs, install-sh: Added automake (1.3) support.
6972 * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
6973 obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
6974 Used libitize (0.4) to update.
6976 * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
6977 (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
6980 * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
6981 stack overflow functionality.
6983 1994-12-03 François Pinard <pinard@iro.umontreal.ca>
6987 * Makefile.in (realclean-local): Delete stamp-h.in.
6989 * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
6990 Localize, adapting from how it is done in sharutils.
6992 * fr.tt: New file, for French.
6994 * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
6995 src/freeze.c: Rename PRODUCT to PACKAGE.
6997 1994-11-26 François Pinard <pinard@iro.umontreal.ca>
6999 * configure.in: Check for <libintl.h> and <locale.h>.
7000 * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
7001 src/stackovf.c: Rename _ to __P.
7002 * src/m4.h: Declare _ as a macro returning its argument, or else,
7003 include <libintl.h> and declare _ as gettext.
7004 * src/m4.c: Possibly include <locale.h> and call setlocale.
7005 * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
7006 src/input.c, src/macro.c, src/output.c, src/path.c,
7007 src/stackovf.c, src/symtab.c: Use _ macro over all localizable
7010 1994-11-07 François Pinard <pinard@iro.umontreal.ca>
7012 * doc/Makefile.in (stamp-vti): Use new -r option to date.
7014 * configure.in: Put --with-gmp in place, in prevision for John
7016 * acconfig.h: Document WITH_GMP.
7018 1994-11-05 François Pinard <pinard@iro.umontreal.ca>
7022 * doc/Makefile.in (realclean): Also remove stamp-vti.
7023 Reported by Eric Backus.
7025 1994-11-02 François Pinard <pinard@iro.umontreal.ca>
7027 * src/freeze.c (produce_frozen_state): If the frozen file cannot
7028 be opened, return immediately after producing the error message.
7029 Reported by Andreas Schwab.
7031 * configure.in: Check for const only after having found possible
7032 ANSIfying compiler flags, this is of no use to check it before.
7033 Reported by Alexander Lehmann.
7035 1994-11-01 François Pinard <pinard@iro.umontreal.ca>
7037 * src/macro.c (collect_arguments): Cast obstack arguments to
7038 (voidstar), so avoiding compiler warnings.
7039 Reported by Joseph E. Sacco.
7041 * src/freeze.c (produce_frozen_state): Cast printed lengths to
7042 (int) so they correspond to %d format items.
7043 Reported by Joseph E. Sacco.
7045 * src/m4.c (main): Cast the argument to xfree to (voidstar).
7046 * src/symtab.c (free_symbol): Idem.
7047 Reported by Karl Vogel.
7049 1994-10-31 François Pinard <pinard@iro.umontreal.ca>
7051 * Makefile.in (DISTFILES): Distribute BACKLOG.
7053 * configure.in: Define PRODUCT and VERSION.
7054 * acconfig.h: Document PRODUCT and VERSION.
7055 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
7056 constant string m4 and variable or parameter named version.
7058 1994-10-30 François Pinard <pinard@iro.umontreal.ca>
7060 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
7061 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
7062 defines __STDC__ to 0, for indicating it is *not* ANSI!
7063 Reported by Kaveh R. Ghazi.
7065 * configure.in: Added obsolescent tests for AIX and Minix.
7067 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
7068 which texclean does not exist anymore.
7069 Reported by Eric Backus, Jim Meyering, John David Anglin and
7072 1994-10-29 François Pinard <pinard@iro.umontreal.ca>
7074 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
7075 Reported by John David Anglin.
7077 * src/ansi2knr.c: New version, sent by Peter Deutsch.
7078 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
7079 ANSI2KNR, depending on the fact the compiler is ANSI or not.
7080 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
7081 Remove the sed filter after ansi2knr for debug.c. Use $O instead
7082 of $U, put underline in extensions rather than in basenames. Use
7083 implicit rules, now that regularity makes this possible.
7084 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
7085 of ansi2knr whenever it is needed.
7086 * configure.in: Adjusted for correct STACKOVF substitution.
7087 * src/debug.c (trace_format): When not __STDC__, use (...) as a
7088 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
7089 Reported by David MacKenzie.
7091 * Makefile.in: Remove binprefix. Use transform_name instead.
7092 Reported by David MacKenzie.
7094 * doc/Makefile.in: Create version.texi, use it, clean it.
7095 Reported by Jim Meyering.
7097 1994-10-28 François Pinard <pinard@iro.umontreal.ca>
7099 * Makefile.in (all, install, uninstall): Depend on Makefile.
7101 * Makefile.in: For actions invoking $(MAKE) from within compound
7102 sh statements, exit non-zero if the sub-make fails. Otherwise,
7103 the top-level make may exit successfully when it should fail.
7104 Reported by Jim Kingdon.
7106 * {,/*}Makefile.in: Use && after all cd, in case they fail.
7108 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
7109 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
7110 * configure.in: Substitute PRODUCT and VERSION.
7112 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
7114 1994-10-27 François Pinard <pinard@iro.umontreal.ca>
7116 * Makefile.in (mostlyclean-local): Do not remove *~.
7117 * */Makefile.in (mostlyclean): Idem.
7118 Reported by Robert E. Brown and Richard Stallman.
7120 1994-10-09 François Pinard <pinard@iro.umontreal.ca>
7122 * src/m4.h: Get rid of CONFIG_BROKETS.
7124 1994-10-02 François Pinard <pinard@iro.umontreal.ca>
7126 * configure.in: Use AC_ARG_PROGRAM.
7127 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
7128 Reported by David MacKenzie.
7130 1994-10-01 François Pinard <pinard@iro.umontreal.ca>
7132 * configure.in: Do not add -O to CFLAGS for GNU C, now that
7133 configure does it automatically.
7134 Reported by Jim Meyering.
7136 1994-09-23 François Pinard <pinard@iro.umontreal.ca>
7138 * src/stackovf.c: Declare the handler_t typedef earlier in the
7139 code, use it for stackovf_handler.
7140 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
7141 casting sigsegv_handler.
7142 Reported by Robert Bernstein.
7144 * src/m4.c (main): Initialize program_name to argv[0] without
7146 Reported by Karl Berry.
7148 1994-09-18 François Pinard <pinard@iro.umontreal.ca>
7150 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
7151 Reported by Karl Berry.
7153 1994-09-14 François Pinard <pinard@iro.umontreal.ca>
7155 * lib/Makefile.in (mostlyclean): Added.
7156 (TAGS): Make in $(srcdir).
7158 * configure.in: Use `choke me' in test, like everywhere!
7160 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
7161 unreacheable and useless.
7163 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
7165 * lib/Makefile.in (DISTFILES): Distribute TAGS.
7166 (distclean): Do not remove TAGS.
7167 (realclean): Remove it.
7168 * Makefile.in: Make TAGS in lib also, not just in src.
7169 Reported by Karl Berry.
7171 * Makefile.in (distclean, realclean): Instead of recursively
7172 calling $(MAKE) for the -local part, allow parallel execution of
7173 -recursive and -local, only delay the removal of config.status,
7174 which is repeated in both goals.
7176 1994-09-13 François Pinard <pinard@iro.umontreal.ca>
7180 * Makefile.in: Group all *clean-recursive goals in one, using sed
7181 to remove `-recursive' while calling make recursively. Also, use
7182 a subshell for each recursive $(MAKE).
7183 Reported by Jim Meyering.
7185 * src/m4.h (memcpy): Define with bcopy for BSD systems.
7186 Reported by Kaveh R. Ghazi.
7188 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
7189 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
7192 * configure.in: Use date instead of touch for stamp-h.
7193 * Makefile.in (stamp-h.in): Idem.
7195 * Makefile.in (distclean, realclean): Force serial execution of
7196 both goals, in case parallel makes are being used.
7197 Reported by Jim Meyering.
7199 * src/Makefile.in (DISTFILES): Distribute TAGS.
7200 (distclean): Do not remove TAGS.
7201 (realclean): Remove it.
7202 Reported by Karl Berry.
7204 1994-09-10 François Pinard <pinard@iro.umontreal.ca>
7206 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
7207 to old names, for following Autoconf.
7209 1994-09-08 François Pinard <pinard@iro.umontreal.ca>
7211 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
7212 ./install.sh will not be correctly referred to in sub-Makefiles.
7213 Reported by John David Anglin.
7215 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
7216 Reported by Eric Backus.
7218 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
7219 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
7220 config.status into remaking this directory's Makefile only.
7221 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
7222 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
7223 Reported by Jim Meyering.
7225 1994-09-06 François Pinard <pinard@iro.umontreal.ca>
7227 * configure.in: Correct stack overflow detection logic, taking
7228 care of systems having only incomplete implementations (like for
7229 Pyramid 9820 OSx 5.0d).
7230 Reported by Kaveh R. Ghazi.
7232 * src/Makefile.in (TAGS): Remote -t from etags call.
7234 1994-09-02 François Pinard <pinard@iro.umontreal.ca>
7236 * lib/Makefile.in (install): Depend on all.
7238 1994-08-31 François Pinard <pinard@iro.umontreal.ca>
7240 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
7241 Reported by Jim Meyering and John David Anglin.
7243 * Makefile.in (distclean-local): Delete config.log.
7244 Reported by Jim Meyering.
7246 Solidify frozen files with respect to -P:
7247 * src/m4.c: Have -P set prefix_all_buitins variable instead of
7248 calling a function by that name. Declare the variable.
7249 * src/m4.h: Adjust declaration for prefix_all_buitins.
7250 * src/builtin.c (builtin_init): Merge in functionality from
7251 previous prefix_all_buitins function, while making entries in the
7252 symbol table, but not modifying the builtin description itself.
7254 * src/freeze.c (reload_frozen_state): Add a useless `break;',
7255 because *many* compilers do not accept an empty `default:'.
7256 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
7257 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
7259 * configure.in: Use AC_TYPE_SIGNAL.
7260 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
7261 Reported by Robert Bernstein.
7263 * checks/Makefile.in (check): Modify PATH so check-them will find
7264 m4 in the src directory.
7265 * Makefile.in (check): Don't.
7266 Reported by Akiko Matsushita and Jim Meyering.
7268 * src/output.c (make_room_for, output_character_helper): New
7269 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
7270 a per buffer MAXIMUM_BUFFER_SIZE.
7272 * src/output.c (output_text): New function, for optimizing the
7273 output of strings of characters. Use it.
7275 1994-08-30 François Pinard <pinard@iro.umontreal.ca>
7277 * doc, src: New directories reorganizing the distribution.
7278 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
7280 * Makefile.in: Adjusted.
7281 * configure.in: Configure new Makefiles.
7283 * m4.h: Declare STRING typedef. Use it for comment and quote
7284 strings, adjusting all references. (This is the rudiments of a
7285 beginning for the eventual withdrawal of NUL terminated strings.)
7286 * output.c (shipout_text): Accept a length parameter, and use it.
7287 All callers adjusted.
7289 1994-08-29 François Pinard <pinard@iro.umontreal.ca>
7291 * m4.h: Include <unistd.h> if it exists.
7292 * stackovf.c: Don't.
7294 Clean up for current_diversion variable:
7295 * output.c: Move current_diversion from builtin.c.
7296 * m4.h: Declare current_diversion so builtin.c can access it.
7297 * output.c (output_init, make_diversion): Initialize or update
7299 * builtin.c (builtin_init, m4_divert): Leave current_diversion
7302 Remove limit on number of diversions:
7303 * output.c: Replace ndiversion by diversions, declare it.
7304 (output_init): Allocate only diversion 0.
7305 (make_diversion): Allocate new diversions as needed.
7306 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
7307 * m4.c: Still accept -N, but do nothing with it.
7308 Reported by David MacKenzie.
7311 * output.c (freeze_diversions): New function.
7312 * m4.h: Declare freeze_diversions.
7313 * freeze.c: Document frozen file format, revise it, call
7314 freeze_diversions to add diversions to frozen format, and code to
7315 reload them properly.
7316 * m4.c: Do not undivert automatically at end when status being
7317 frozen. Do not call builtin_init when reloading frozen state.
7319 Speed up diversion processing:
7320 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
7321 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
7322 structure and variables, cached variables out of output_diversion,
7323 reallocate_diversion_for and OUTPUT_CHARACTER.
7324 (shipout_text, make_diversion, insert_diversion): Adapted to new
7326 (insert_file): Use better buffering.
7327 Reported by David MacKenzie.
7329 1994-08-28 François Pinard <pinard@iro.umontreal.ca>
7331 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
7332 dist works from another build directory.
7334 1994-08-27 François Pinard <pinard@iro.umontreal.ca>
7336 * symtab.c (hack_all_symbols): Use hash_table_size instead of
7337 constant HASHMAX, for -H option to work better.
7339 * builtin.c (DECLARE): Simplify by using _ ().
7341 * freeze.c: New file.
7342 * Makefile.in: Compile it, distribute it.
7343 * m4.c: Recognize, document and process --freeze-state (-F) and
7344 --reload-state (-R) options. Pass a true flag to builtin_init
7345 only if no reloading some state.
7346 * builtin.c (define_builtin): Remove static specifier.
7347 (find_builtin_by_name): Remove static specifier.
7348 (builtin_init): Accept and obey a flag argument.
7349 * m4.h: Add declarations for freeze.c, changes for builtin.c.
7351 1994-08-24 François Pinard <pinard@iro.umontreal.ca>
7353 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
7356 * configure.in: Implement --with-dmalloc.
7357 * acconfig.h: Document WITH_DMALLOC.
7358 * m4.h: Add code for when WITH_DMALLOC.
7360 1994-08-15 François Pinard <pinard@iro.umontreal.ca>
7362 * m4.c (long_options): Use "error-output", the dash was missing.
7363 Reported by Akiko Matsushita.
7365 1994-08-12 François Pinard <pinard@iro.umontreal.ca>
7367 * m4.h: Include <sys/types.h>.
7368 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
7369 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
7371 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
7373 * builtin.c (dump_args): Declare len as size_t, not int.
7375 * debug.c: Prototype the forward declaration of debug_set_file.
7377 * builtin.c (m4_undivert): Replace div by file, for avoiding the
7378 shadowing of this variable.
7379 * output.c (insert_diversion): Idem.
7381 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
7382 (input_init): Duplicate default quote and comment strings.
7383 (set_quotes): Free previous quote strings in all cases. Duplicate
7384 even default quote strings.
7385 (set_comment): Free previous comment strings in all cases.
7386 Duplicate even default comment strings.
7388 * configure.in: Updated for Autoconf 2.0.
7389 * Makefile.in (distclean-local): Also delete config.cache.
7391 * m4.c (usage): Reorganize the --help output by topic. Include a
7392 description for debugging flags.
7394 1994-07-29 François Pinard <pinard@iro.umontreal.ca>
7396 * configure.in: If sigaction is available and SA_ONSTACK defined,
7397 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
7398 defined, use sigvec. Else don't compile stackovf.c.
7399 * stackovf.c (setup_stackovf_trap): Idem.
7400 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
7403 1994-07-21 François Pinard <pinard@iro.umontreal.ca>
7405 * m4.c (usage): Replace printf par fputs.
7407 1994-07-18 François Pinard <pinard@iro.umontreal.ca>
7411 1994-07-17 François Pinard <pinard@iro.umontreal.ca>
7413 * configure.in: Check for sigaction and sigvec. Add a new delayed
7414 check for RLIMIT_STACK, combine in the checking for getrlimit.
7415 All those things are not universally available.
7416 * stackovf.c: Split setting up the trap handler and catching
7417 signals, for better taking care of various configure outcomes.
7418 * examples/stackovf.sh: Correct a typo.
7419 Reported by Eric Backus, Jim Avera and Jim Meyering.
7421 1994-07-16 François Pinard <pinard@iro.umontreal.ca>
7423 * ansi2knr.c: New version sent by its author, Peter Deutsch.
7425 1994-07-15 François Pinard <pinard@iro.umontreal.ca>
7427 * Makefile.in: Modify so parallel make will not try making
7428 lib/libm4.a twice simultaneously.
7429 Reported by Jim Meyering.
7431 1994-07-14 François Pinard <pinard@iro.umontreal.ca>
7433 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
7434 error message, for when no code possibility exists. Even if this
7435 line is completely #ifdef'ed out, it brings a syntax error.
7436 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
7438 * Makefile.in (install): Have install depend on all too, for lib
7439 to be remade as needed.
7441 * examples/stackovf.sh: Try ksh, bsh and bash for shells
7442 providing ulimit, instead of using only ksh.
7443 Reported by Jim Avera and Joseph E. Sacco.
7445 1994-07-12 François Pinard <pinard@iro.umontreal.ca>
7447 * Makefile.in (check): Have it depend on all instead of m4. In
7448 this way, a change in lib will be detected and processed.
7450 * builtin.c (numeric_arg): Use strtol and verify the conversion,
7451 instead of using sscanf which stops as soon as there is a
7452 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
7453 and divert(1xyzzy) were all accepted without any warning or error
7455 * m4.h: Declare strtol as long if not including stdlib.h.
7456 * configure.in: Check for limits.h, and replace strtol if missing.
7457 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
7458 * lib/strtol.c: New file, from elsewhere.
7459 Reported by Andreas Schwab.
7461 1994-07-07 François Pinard <pinard@iro.umontreal.ca>
7463 * macro.c (expand_macro): Cast value to (boolean) prior to
7464 assigning it to traced.
7465 Reported by Tom McConnell.
7467 * Makefile.in (m4): Always make all in lib first.
7468 Reported by Jim Meyering.
7470 1994-07-06 Jim Avera <jima@netcom.com>
7472 * stackovf.c: Isolated OS-dependent sections; Improved portability,
7473 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
7474 handlers), and a default error message if the fault address is not
7475 available (when neither siginfo.h nor BSD sigcontext are supported).
7476 * configure.in: Changes for stackovf.h: Check for sigcontext,
7477 sigaction, sigstack, and define rlim_t as int if necessary.
7478 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
7479 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
7480 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
7482 1994-07-05 François Pinard <pinard@iro.umontreal.ca>
7484 * configure.in: Use AC_SET_MAKE.
7485 * Makefile.in: Use @SET_MAKE@.
7486 Reported by Jim Meyering.
7488 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
7489 Reported by Ian Taylor.
7491 1994-07-02 François Pinard <pinard@iro.umontreal.ca>
7493 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
7494 because siginfo.h is unrelated to standard headers, and siginfo.h
7495 is already checked for.
7496 Reported by Joseph E. Sacco.
7498 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
7500 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
7503 1994-06-29 François Pinard <pinard@iro.umontreal.ca>
7505 * builtin.c (substitute): Use \& to represent this part of the
7506 string which was matched by the whole regexp, instead of
7507 representing the whole string. Any usage of \0 issues a warning
7508 and acts like \&, it will disappear in some subsequent release.
7510 1994-06-27 François Pinard <pinard@iro.umontreal.ca>
7512 * m4.c: Complete prototype for forwarded declaration of usage.
7514 * input.c (init_macro_token): Correct own reference in error
7515 message. Previous name get_macro_func was referred to instead.
7516 (next_char): Correct own reference in error message. Previous
7517 name advance_input was referred to instead.
7519 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
7520 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
7521 and_term, not_term, logical_not_term, cmp_term, shift_term,
7522 add_term, mult_term, exp_term, unary_term, simple_term): Add
7523 prototype to forwarded declarations. Declare parameter v1 as
7524 eval_t * instead of int *. Same for local variable v2 in dyadic
7525 functions. Same for result in exp_term.
7526 * builtin.c (m4_eval): Declare value as eval_t instead of int.
7527 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
7528 unsigned_eval_t instead of unsigned int. Change casts accordingly.
7529 (shipout_int): Cast first argument of ntoa to eval_t.
7530 Reported by Thorsten Ohl.
7532 * macro.c: Complete the prototypes of forwarded expand_macro and
7534 Reported by Thorsten Ohl.
7536 * m4.h: Define voidstar as void * or char * depending on __STDC__.
7537 The Ultrix 3.1 compiler cannot do much with void pointers.
7539 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
7540 * m4.c (xfree): Replace void * by voidstar.
7541 Reported by Tom McConnell.
7543 * ansi2knr.1: New, from elsewhere.
7544 * Makefile.in (DISTFILES): Distribute ansi2knr.1
7546 * Makefile.in (stamp-h.in): Avoid running ./config.status if
7547 stamp-h does not exist yet. This avoids running it a second time
7548 just after the initial ./configure.
7549 Reported by David MacKenzie and Tom McConnell.
7551 * m4.h: Replace the enum debug_info declaration with a series of
7552 #define's. The Ultrix 3.1 compiler would otherwise need casting
7553 (int) to most references, when used in expressions.
7554 Reported by Tom McConnell.
7556 1994-06-25 François Pinard <pinard@iro.umontreal.ca>
7558 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
7559 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
7560 calls the compiler. Previously, FP_PROTOTYPES was only calling
7561 the preprocessor; by not being subject to CFLAGS, this was
7562 discouraging those flags asking for ANSI compilation.
7563 * acconfig.h: Document HAVE_PROTOTYPES.
7564 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
7565 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
7566 Reported by Eric Backus.
7568 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
7569 from the environment. Default CFLAGS to -g if not set.
7570 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
7571 * lib/Makefile.in: Have CFLAGS substituted from configure.
7572 Reported by Eric Backus and Tom McConnell.
7574 * configure.in: m4_undefine changeword before using AC_ENABLE.
7576 * m4.h: Declare prototypes for error (for ANSI compilers only),
7577 prefix_all_builtins and reference_error.
7578 Reported by Tom McConnell.
7580 * input.c (set_word_regexp): Do not try to initialize the array
7581 test from a string, this does not work with non-ANSI compilers.
7582 Reported by Eric Backus.
7584 * Makefile.in (dist): Clean examples/ before saving it.
7585 (distclean-local): Also remove stamp-h.
7586 Reported by Eric Backus.
7588 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
7590 Reported by Tom McConnell.
7592 * checks/Makefile.in (clean): Depends on mostlyclean.
7593 (mostlyclean): New goal.
7595 1994-06-24 François Pinard <pinard@iro.umontreal.ca>
7597 * Makefile.in (DISTFILES): Distribute install.sh.
7598 * install.sh: New file, copied from elsewhere.
7599 Reported by Assar Westerlund and Kaveh R. Ghazi.
7601 1994-06-23 François Pinard <pinard@iro.umontreal.ca>
7603 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
7604 * acconfig.h: Explain ENABLE_CHANGEWORD.
7606 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
7607 from code provided by Pete Chown]
7608 * m4.h: Add original_text field to u_t variant of union u.
7609 Declare TOKEN_DATA_FUNC macro.
7610 * builtin.c: Declare changeword.
7611 (m4_changeword): New function.
7612 * input.c: Include "regex.h", define variables with word regexps.
7613 (input_init): Initialize the word regexp.
7614 (set_word_regexp): New.
7615 (next_token): Declare local variables, use the previous code if
7616 default_word_regexp is true. Else, match using a new code. Save
7618 * macro.c (expand_token): Ship out original text if not a macro
7620 Reported by Krste Asanovic and Pete Chown.
7622 [These modifs all depend upon ENABLE_CHANGEWORD]
7623 * m4.h: Declare external user_word_regexp.
7624 * m4.c: Declare user_word_regexp, and initialize it from
7625 --word-regexp or -W, or NULL if not specified.
7626 * input.c: Use user_word_regexp if specified, instead of
7627 DEFAULT_WORD_REGEXP.
7629 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
7632 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
7633 * checks/Makefile.in: Empty the suffix list.
7634 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
7636 * m4.c: Declare nesting_limit and initialize it to 250.
7637 Implement -LNUMBER or --nesting-limit=NUMBER to change its
7639 * m4.h: Declare nesting_limit as external.
7640 * macro.c (expand_macro): Stop execution whenever nesting limit
7642 Reported by Bengt Mertensson.
7644 * eval.c (evaluate): Diagnose excess characters in eval input.
7645 Things like `eval(08)' used to return 0 with no diagnostic.
7647 * m4.h: Capitalize first letter of all macro arguments in
7650 * m4.c: Declare warning_status, initialize it to 0. Add new
7651 option -E, or --fatal-warnings, which sets warning_status to
7652 EXIT_FAILURE instead.
7653 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
7654 EXIT_FAILURE if not otherwise done by header files.
7655 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
7656 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
7657 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
7658 argument of all M4ERROR calls.
7659 Reported by Noah Friedman.
7661 * examples/incl-test.m4: Renamed from incl_test.m4.
7662 * examples/include.m4: Include incl-test.m4 instead of
7664 * examples/multiquotes.m4: Renamed from multi-quotes.m.
7666 1994-06-22 François Pinard <pinard@iro.umontreal.ca>
7668 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
7669 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
7670 also tested it on a Sun Sparc workstation running SunOS 4.x.
7672 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
7673 49.format check, abusing a `union values' argument with sprintf
7674 without selecting the proper field. Now, save the formatting type
7675 first, delaying the fetch of the corresponding argument.
7676 Reported by Joseph E. Sacco and Tom Quinn.
7678 * format.c (format): Remove const from char *fmt declaration when
7679 not HAVE_EFGCVT, because a NUL may be forced into it.
7681 * m4.h: Declare atof() when not STDC_HEADERS.
7682 Reported by Joseph E. Sacco.
7684 * Regenerate configure using Autoconf 1.11, this corrects a
7685 problem about an incorrect cpp seting on NeXT 3.1.
7686 Reported by Alexander Lehmann.
7688 1994-06-05 François Pinard <pinard@iro.umontreal.ca>
7690 * m4.h (_): Change argument from `x' to `Args'.
7692 1994-04-22 François Pinard <pinard@iro.umontreal.ca>
7694 * m4.h: Rename Args() to _().
7695 * m4.h: Remove extern specifier from all function declarations.
7697 1994-04-22 Jim Avera <jima@netcom.com>
7699 * stackovf.c: New file implementing stack-overflow detection.
7700 * configure.in: Check for getrlimit, sigaction. If all of
7701 standard headers, getrlimit and sigaction, define USE_STACKOVF and
7702 substitute ${U}stackovf.o for STACKOVF.
7703 * acconfig.h: Declare USE_STACKOVF.
7704 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
7705 * m4.h: Declare setup_stackovf_trap().
7706 * m4.c: Call setup_stackovf_trap().
7707 * tests/stackovf_test.sh: New file.
7709 1994-04-13 François Pinard <pinard@iro.umontreal.ca>
7711 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
7713 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
7715 1994-01-30 François Pinard <pinard@iro.umontreal.ca>
7717 * m4.h: Remove definition of volatile, not used anymore.
7718 Reported by Jim Meyering and Joseph E. Sacco.
7720 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
7721 of `if ... else /* nothing */' for if macros.
7722 Reported by Jim Meyering.
7724 * builtin.c (m4_regexp): Reorganize the code for avoiding a
7725 warning from gcc about `repl' possibly used before defined.
7726 Reported by Jim Meyering.
7728 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
7729 Reported by Jim Meyering.
7731 1994-01-25 François Pinard <pinard@iro.umontreal.ca>
7733 * m4.h: Move the conditional definition of volatile after the
7734 inclusion of system files, because they may define it first.
7736 1994-01-04 François Pinard <pinard@iro.umontreal.ca>
7738 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
7739 get around a problem with Alpha make seeing a syntax error, there.
7740 Reported by Vern Paxson.
7742 1994-01-03 François Pinard <pinard@iro.umontreal.ca>
7744 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
7745 Reported by Richard Stallman.
7747 1993-12-25 François Pinard <pinard@iro.umontreal.ca>
7749 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
7750 instead of AC_HAVE_FUNCS.
7751 Reported by Noah Friedman.
7753 1993-12-01 François Pinard <pinard@iro.umontreal.ca>
7755 * m4.c: Initialize show_help and show_version to zero.
7757 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
7758 Use them in exit() and usage() calls.
7760 1993-11-27 François Pinard <pinard@iro.umontreal.ca>
7762 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
7763 syserr() macro. Delete errref, add reference_error and M4ERROR.
7764 * m4.c: Replace errref, which was returning an input reference
7765 string, with reference_error, which prints it on standard error.
7766 * builtin.c, output.c: Use errno as second parameter to error,
7767 instead of using syserr() with %s.
7768 * *.c: Use M4ERROR instead of error: no more errref() with %s.
7769 Doing so, the program name appears after the input reference
7770 instead of before, which eases M-x next-error processing.
7772 1993-11-24 François Pinard <pinard@iro.umontreal.ca>
7774 * checks/get-them: Escape braces with backslashes in patterns,
7775 because HPUX-9.01 awk needs this.
7776 Reported by Jim Meyering.
7778 1993-11-22 François Pinard <pinard@iro.umontreal.ca>
7780 * builtin.c: Declare "FILE *popen ();".
7782 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
7783 macros, replace error_message_prefix() declaration by errref()'s.
7784 Declare xrealloc, for use in errref().
7785 * m4.c: Delete error_message_prefix() function, add errref().
7786 * *.c: Use error() systematically in place of all error macros,
7787 now that error() flushes stdout first. Make needed adjustments.
7789 * m4.h: Remove const in sys_errlist[] declaration, it creates
7790 conflicts on SGI and Alpha.
7791 Reported by Kaveh R. Ghazi.
7793 1993-11-20 François Pinard <pinard@iro.umontreal.ca>
7795 * m4.c: Include <getopt.h> instead of "getopt.h".
7797 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
7798 * acconfig.h: New, for documenting HAVE_EFGCVT.
7799 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
7800 use them wherever appropriate. Also use -I. for compilations.
7801 * lib/Makefile.in: Use -I.. for compilations.
7802 * *.c: Include <config.h> or "config.h".
7804 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
7805 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
7807 1993-11-17 François Pinard <pinard@iro.umontreal.ca>
7809 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
7811 * input.c (input_init): Initialize quote and comment strings
7812 explicitely instead of calling set_quotes and set_comment: by
7813 doing so, we ensure we do not free uninitialized variables.
7815 * checks/check-them: Reverse arguments to both diff, so the
7816 expected is on the left and the obtained on the right.
7818 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
7819 macros. Delete declarations for m4error, warning, fatal and
7820 internal_error, add declaration for error_message_prefix.
7821 * m4.c: Delete m4error, warning, fatal and internal_error
7822 routines, add error_message_prefix routine.
7823 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
7824 warning with WARNING*, fatal with FATAL* and internal_error with
7826 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
7827 this is not needed anymore.
7829 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
7830 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
7831 and debug_message, add declaration for debug_message_prefix.
7832 * debug.c: Remove static specifier for FILE *debug declaration.
7833 Delete debug_print and debug_message routines, add
7834 debug_message_prefix routine.
7835 * builtin.c, debug.c: Replace debug_print routine calls with
7836 DEBUG_PRINT* macro calls.
7837 * input.c, path.c: Replace debug_message routine calls with
7838 DEBUG_MESSAGE* macro calls.
7840 * m4.h: Remove inclusion of <varargs.h>.
7841 * debug.c: Include <stdarg.h> or <varargs.h>.
7842 (trace_format): Use stdarg instead of varargs if __STDC__.
7844 * configure.in: Remove checks for vfprintf and _doprnt. These
7845 implementations use varargs tricks which are not portable enough.
7846 * lib/vfprintf.c: Deleted.
7847 * lib/_doprnt.c: Deleted.
7848 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
7849 Reported by Joel Sherrill.
7851 * path.c (add_include_directory): Use xstrdup.
7853 * builtin.c (find_builtin_by_name): Declare static.
7855 * *.[ch]: Add const to a few "char *" declarations.
7857 * configure.in: Remove commented tests for fileno() and fstat().
7858 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
7860 * debug.c (debug_flush_files): New.
7861 * m4.h: Declares it.
7862 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
7863 Reported by Nicolas Pioch.
7865 1993-11-12 François Pinard <pinard@iro.umontreal.ca>
7867 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
7868 Reported by Joel Sherrill.
7870 * builtin.c (prefix_all_builtins): Instead of the table size, use
7871 the null entry at end for stopping the loop. It was overwritten.
7872 Reported by Andreas Schwab and Jim Meyering.
7874 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
7875 Reported by Kaveh R. Ghazi.
7877 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
7878 Reported by Karl Vogel.
7880 1993-11-09 François Pinard <pinard@iro.umontreal.ca>
7882 * m4.h: Do not define volatile if already defined.
7883 Reported by René Seindal.
7885 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
7887 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
7888 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
7890 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
7892 * m4.h: Define strchr and strrchr in terms of index and rindex,
7893 instead of the other way around.
7894 * builtin.c, m4.c, path.c: Use strchr instead of index.
7896 * input.c (next_char): Remove a "break;" after a "return ...;".
7897 Reported by Tom McConnell.
7899 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
7903 * configure.in: Do not copy check files in the build hierarchy.
7904 * checks/check-them: Identify the m4 version being checked. For
7905 finding m4, look in $PATH instead of in the parent directory.
7906 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
7907 * checks/Makefile.in (.all-stamp): Always create check files in
7908 the source hierarchy, not anymore in the build hierarchy.
7909 (check): cd to the source hierarchy before performing checks.
7910 Do not copy nor clean COPYING anymore, take it from `..'.
7911 Reported by Tom McConnell.
7913 * Makefile.in (Makefile): Use $(SHELL).
7914 (config.status): Use $(SHELL). Use "config.status --recheck"
7915 instead of "configure --no-create", which is obsolete.
7916 Reported by Tom McConnell.
7918 1993-11-05 François Pinard <pinard@iro.umontreal.ca>
7920 * m4.c (usage): Use "%s" instead of "m4" in format string.
7921 Reported by Jim Meyering.
7923 * Makefile.in: Distribute mkinstalldirs.
7924 Reported by Pierre Gaumond.
7925 Reported by Jim Meyering.
7926 Reported by Tom McConnell.
7927 Reported by Andreas Gustafsson.
7929 * checks/check-them: Renamed from checks/check_them.
7930 * checks/get-them: Renamed from checks/get_them.
7931 * checks/.all-stamp: Renamed from checks/.all_stamp.
7932 * checks/Makefile.in: Changed accordingly.
7933 Reported by Jim Meyering.
7935 1993-11-04 François Pinard <pinard@iro.umontreal.ca>
7937 * lib/Makefile.in (dist): Correct permissions on files.
7939 * output.c: Declare tmpfile, some systems don't.
7941 1993-11-03 François Pinard <pinard@iro.umontreal.ca>
7943 * checks/Makefile.in (dist): Correct permissions on files.
7945 * Makefile.in (dist): Ensure recursive linking for subdirectory
7946 `examples', also set read/write permissions on all its files.
7948 * mkinstalldirs: New, from elsewhere.
7949 * Makefile.in: Use it.
7951 * debug.c: Synchronize debug messages and regular output when
7952 the debug file and stdout are redirected to the same file.
7953 * configure.in: Add (commented) checks for fileno and fstat.
7954 Reported by Jim Avera.
7956 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
7957 etc., arguments, then ignore the superfluous one. m4 used to
7958 diagnose missing arguments and return the empty string.
7959 Reported by Nick S. Kanakakorn.
7961 1993-11-02 François Pinard <pinard@iro.umontreal.ca>
7963 * m4.c (main): At end of all input, ensure all undiverted text
7964 goes to the main output stream.
7965 Reported by Andreas Gustafsson.
7967 * m4.c (main): exit (0), instead of return 0.
7969 * m4.c: Implement -P and --prefix-builtins.
7970 * builtin.c: Delete const specifier on builtin_tab.
7971 (prefix_all_builtins): New.
7972 Reported by Noah Friedman.
7973 Reported by Scott Bartram.
7975 * c-boxes.el: New, from elsewhere.
7976 * Makefile.in: Distribute it.
7978 * m4.h: Do not define bcopy if <string.h> defines it.
7979 Reported by Stephen Perkins.
7981 * builtin.c (define_macro): Allow a missing second argument, in
7982 which case it is implied empty. Affects define and pushdef.
7983 Reported by Eric Allman.
7985 1993-11-01 François Pinard <pinard@iro.umontreal.ca>
7987 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
7988 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
7989 * builtin.c: Initialize all the blindness fields in builtin_tab.
7990 (define_builtin): Copy the blindness of a builtin into its symbol.
7991 * macro.c (expand_token): Avoid processing a blind builtin if the
7992 next character is not an opening parenthesis.
7993 Reported by David MacKenzie.
7994 Reported by Noah Friedman.
7996 * configure.in: Ensure an exit status of 0 on completion.
7997 Reported by Vivek P. Singhal.
7999 * eval.c (eval_lex): Admit both lower and upper case letters for
8000 bases greater than 10. Only lower case letters were accepted.
8002 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
8003 Reported by Krste Asanovic.
8005 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
8006 * eval.c (logical_not_term): New name for not_term.
8007 * eval.c (xor_term): New, between or_term and and_term.
8008 * eval.c (not_term): New, between and_term and logical_not_term.
8009 * eval.c (shift_term): New, between cmp_term and add_term.
8010 Reported by Krste Asanovic: ~, ^, <<, >>.
8011 Reported by Ben A. Mesander: ** vs ^.
8013 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
8014 * m4.h: Delete xrealloc.c.
8015 * lib/xmalloc.c: New, from elsewhere.
8016 * lib/xstrdup.c: New, from elsewhere.
8017 * lib/Makefile.in: Distribute and compile them.
8019 * m4.c: Change progname to program_name.
8020 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
8021 * lib/error.c: New, from elsewhere.
8022 * lib/Makefile.in: Distribute and compile error.c.
8023 * configure.in: Check AC_VPRINTF and for strerror.
8024 * m4.c: Delete cmd_error. Use error instead.
8025 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
8027 * m4.h: Delete #define const, let Autoconf takes care of this.
8029 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
8030 Merge parse_args into main. Declare argv to be `char *const *',
8031 then remove superfluous casts.
8033 * m4.c: Rename --no-gnu-extensions to --traditional.
8034 Reported by Ben A. Mesander.
8036 * m4.c (usage): Add a status parameter. Supply one in various
8037 calls. Add --help processing. Remove -V for --version.
8039 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
8041 * lib/Makefile.in: Have an AR=ar declaration.
8042 Reported by Eric Backus.
8043 Reported by Bjorn R. Bjornsson.
8044 Reported by Tom Tromey.
8045 Reported by Kristine Lund.
8046 Reported by Marion Hakanson.
8048 1993-10-30 François Pinard <pinard@iro.umontreal.ca>
8050 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
8051 Reported by Noah Friedman.
8053 1993-10-25 François Pinard <pinard@iro.umontreal.ca>
8055 * Makefile.in: Remove MDEFINES and cleanup.
8057 1993-06-09 François Pinard <pinard@iro.umontreal.ca>
8059 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
8062 1993-02-06 François Pinard <pinard@iro.umontreal.ca>
8064 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
8065 ensure 777 mode for directories, so older tar's will restore file
8068 1993-01-17 François Pinard <pinard@iro.umontreal.ca>
8070 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
8071 so the installer can override automatically configured choices.
8072 Reported by Karl Berry.
8074 1993-01-15 François Pinard <pinard@iro.umontreal.ca>
8076 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
8077 previous version was not working properly on m68k-hp-bsd4.3.
8078 Reported by Roland McGrath.
8080 * lib/_doprnt.c: Stolen from Oleo distribution.
8081 * configure.in: Check for _doprnt.c if vfprintf.c selected.
8082 * lib/Makefile.in: Distribute _doprnt.c.
8083 Do not distribute regex.[ch].old anymore.
8085 1993-01-01 François Pinard <pinard@iro.umontreal.ca>
8087 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
8088 Richard wants it there.
8090 1992-12-27 François Pinard <pinard@iro.umontreal.ca>
8092 * Makefile.in: Add DEFS to MDEFINES.
8093 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
8094 (libm4.a): Remove the library before creating it.
8095 (distclean): Remove tags and TAGS too.
8097 1992-12-23 François Pinard <pinard@iro.umontreal.ca>
8099 * Makefile.in (dvi, m4.dvi): New goals.
8101 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
8102 macro.c, output.c, path.c, symtab.c: Change Copyright from
8103 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
8105 * examples/divert.m4: Deleted, this bug has been corrected.
8107 * Makefile.in (texclean, mostlyclean): New goals.
8109 * Makefile.in (clean): Remove clutter from ansi2knr.
8110 Reported by Pierre Gaumond.
8112 1992-12-20 François Pinard <pinard@iro.umontreal.ca>
8114 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
8115 might well use CFLAGS is s/he needs it.
8117 * Makefile.in: Allow installation of info files from a separate
8119 Reported by Jason Merrill.
8120 Reported by David MacKenzie.
8121 Reported by Skip Montanaro.
8122 Reported by Erez Zadok.
8123 Reported by Assar Westerlund.
8125 1992-12-19 François Pinard <pinard@iro.umontreal.ca>
8128 This is still a beta release for the future GNU m4 version 1.1.
8130 * lib/alloca.c: New, from elsewhere.
8131 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
8133 * m4.h: Do not define index/rindex if already defined. If
8134 FALSE/TRUE are already defined, do not redefine them, but merely
8135 define boolean typedef to int.
8137 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
8138 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
8139 because some C compilers do not like connectives with #ifdef.
8140 * m4.h: Define `volatile' only if __GNUC__, instead of once for
8141 __GNUC__ and once for __STDC__.
8142 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
8144 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
8145 Makefile dependencies. Without it, make keeps destroying and
8146 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
8148 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
8149 to diversion/DIVERSION, this was a spelling error.
8151 * m4.c: Declare version[], remove #include "version.h".
8152 * version.h: Deleted.
8153 * Makefile.in: Remove references to version.h.
8155 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
8156 production, by using a simpler and more robust algorithm. This
8157 solves the problem of synclines sometimes written in the middle of
8158 an output line. Delete sync_line() and output_lines variable.
8159 * m4.h: Remove sync_line prototype and output_lines declaration.
8160 * input.c (next_char), output.c (shipout_text): Remove references
8162 * input.c (push_file, pop_file): Merely put the value -1 in
8163 output_current_line instead of calling sync_line, for delaying a
8164 single `#line NUM FILE' before next output line. Do not test
8165 for sync_output, because this is unnecessary clutter.
8166 * output.c (make_divertion, insert_divertion): Idem.
8167 * input.c: Rename must_advance_line to start_of_input_line, for
8170 * debug.c (trace_header): Select a new debug line format, which
8171 better complies with GNU standards for formatting error messages.
8172 With option `-dfl', M-x next-error might be used on the output.
8173 * m4.c (vmesg): Adjust format of error output to GNU standards.
8174 * m4.texinfo: Adjust examples for `make check' to work.
8176 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
8177 case for enum debug_info constants, which were all lower case.
8179 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
8181 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
8182 collected patches. I tried a few times using newer regex.[ch], it
8183 mysteriously stopped aborting with this one. Insecure feeling...
8184 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
8186 1992-12-18 François Pinard <pinard@iro.umontreal.ca>
8188 * m4.c: Change `--no-warnings' to `--silent'.
8189 Reported by David MacKenzie.
8191 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
8192 leave it off for now. See comment in m4.c for justification.
8193 Reported by David MacKenzie.
8195 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
8196 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
8198 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
8200 * Makefile.in: Ensure recursive cleaning is done before local
8201 cleaning for all clean goals.
8203 * builtin.c (ntoa): Ensure the value is always interpreted as a
8204 signed quantity, whatever the radix is.
8206 1992-11-18 Jim Meyering <meyering@idefix>
8208 * builtin.c, format.c, input.c: Split long lines.
8209 * m4.c: Use typedef macro_definition instead of struct
8211 * symtab.c: Use typedef symbol instead of struct symbol.
8213 1992-11-17 François Pinard <pinard@iro.umontreal.ca>
8215 * *.[ch]: Remove all trailing whitespace, in code and comments.
8217 * configure.in: Find some awk.
8218 * Makefile.in: Add $(AWK) to MDEFINES.
8219 * checks/Makefile.in: Transmit $(AWK) to get_them.
8220 * checks/get_them: Use $AWK instead of gawk. Add a close in the
8221 awk script when switching files, because without this, mawk runs
8222 out of file descriptors.
8224 1992-11-16 François Pinard <pinard@iro.umontreal.ca>
8226 * Makefile.in (realclean): Delete m4.info*.
8227 Reported by Jim Meyering.
8229 * Makefile.in: Adjust and link with checks/Makefile.
8230 * checks/Makefile.in: New.
8231 * configure.in: Output checks/Makefile.
8233 * checks/get_them: Have the dnl header of each test more
8234 recognizable by next-error, also use a better message.
8236 1992-11-16 Jim Meyering <meyering@idefix>
8238 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
8239 And use that only if __GNUC__ since we're using it's GCC-specific
8240 semantics that tell the compiler the associated function doesn't
8243 * builtin.c (substitute): Don't use character as an array index.
8244 (dumpdef_cmp): Make formal arguments `const void *' to avoid
8245 warnings with gcc -W -Wall on systems with qsort prototype.
8246 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
8249 * eval.c (most functions): Add parentheses to assignments used
8250 as truth values go avoid warnings from gcc -Wall.
8252 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
8253 any functions that don't need external scope.
8255 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
8256 (many functions and arrays): Declare `const'.
8258 1992-11-15 François Pinard <pinard@iro.umontreal.ca>
8260 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
8261 removing the declaration from m4.h. Also rename false to FALSE
8264 * lib/Makefile.in (Makefile): New goal.
8266 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
8267 so heavily loaded. It gets more easily overridable, calling make.
8268 Reported by Jim Meyering.
8270 * Makefile.in (dist): Get .fname from the current directory name,
8271 instead of from version.h. I need updating many files manually,
8272 when the version changes, version.h is just one of them.
8274 1992-11-14 François Pinard <pinard@iro.umontreal.ca>
8276 * m4.h: Remove the tag `boolean' on the enum introducing typedef
8277 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
8278 Reported by Tom McConnell.
8280 1992-11-13 François Pinard <pinard@iro.umontreal.ca>
8282 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
8283 39.cleardiv, which were describing missing or spurious newlines.
8284 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
8285 do not depend on machine word size, `/bin/false' implementation,
8286 or `wc' output format. `make check' is more dependable, now.
8288 * checks/check_them: Summarize the failed tests by listing their
8289 name, at end. If none, issue `All checks successful'. Output
8290 `Checking' instead of `Input file:'.
8292 * checks/get_them, checks/check_them: Reindented.
8294 * Makefile.in (dist): chmod a+r before making the tar file.
8296 1992-11-12 François Pinard <pinard@iro.umontreal.ca>
8298 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
8300 * input.c (next_token): Reinitialize token_buttom just after using
8301 it as a watermark with obstack_free. Or else, a future token, big
8302 enough for triggering reallocation of the obstack chunk, could
8303 void the initialized value of token_buttom, later causing panic in
8304 obstack_free. Rename token_buttom to token_bottom everywhere.
8306 * m4.h: Before declaring errno, first include <errno.h> and
8307 ensure that it does not define errno.
8308 Reported by Richard Stallman.
8310 1992-11-11 François Pinard <pinard@iro.umontreal.ca>
8312 * builtin.c: Define and use DECLARE macro for builtins.
8314 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
8315 argument, this is a common idiom for introducing long comments.
8317 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
8318 arguments. The last argument was silently ignored.
8320 * m4.c (cmd_error): Add a missing semicolon before va_end().
8322 1992-11-10 François Pinard <pinard@iro.umontreal.ca>
8324 * Makefile.in: Now handle protoized sources. Define and use U.
8325 Compile and use ansi2knr with old compilers. Update DISTFILES.
8326 Add `aclocal.m4' to `configure' dependencies.
8327 * ansi2knr.c: New, from Ghostscript distribution.
8328 * configure.in: Define U through FP_PROTOTYPES for old compilers.
8329 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
8330 * aclocal.m4: New, provide FP_PROTOTYPES.
8331 * m4.h: Conditionnaly protoized through Args, save for varags.
8332 * builtin.c: Protoized. Then:
8333 Include <sys/types.h> if size_t is not defined, before "regex.h".
8334 (m4_ifelse): Fetch built-in name properly for diagnostic.
8335 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
8336 (m4_regexp): Add const to `msg' declaration.
8337 (m4_patsubst): Add const to `msg' declaration.
8338 * debug.c: Protoized, save for varargs.
8339 * eval.c: Protoized.
8340 * format.c: Protoized.
8341 * input.c: Protoized.
8342 * m4.c: Protoized, save for varargs. Then:
8343 (xfree): Accept void * instead of char *.
8344 (xmalloc): Return void * instead of char *.
8345 (xrealloc): Accept and return void * instead of char *.
8346 * macro.c: Protoized.
8347 * output.c: Protoized.
8348 * path.c: Protoized. Then cast some (char *) over xmalloc's.
8349 * symtab.c: Protoized.
8351 1992-11-06 François Pinard <pinard@iro.umontreal.ca>
8353 * m4.texinfo: Remove directory from diagnostics in 30.include,
8354 51.eval, 56.errprint and 57.m4exit tests.
8356 * m4.h: Remove declarations for int or void system functions, they
8357 cause more conflicting trouble than they make good.
8359 * configure.in: Avoid configuration header file. Add some tests.
8360 * m4.h: Remove #include "config.h".
8361 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
8362 Then, rewritten for better compliance with GNU standards.
8364 1992-11-05 François Pinard <pinard@iro.umontreal.ca>
8366 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
8367 because of a misplaced #endif.
8369 * Many *.[hc] files: Correct intra-line spacing here and there,
8370 according to GNU indent 1.6 advice.
8372 * configure.in: New, using Autoconf 1.2.
8373 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
8374 * Delete old configure.in, configure, etc/configure.in,
8375 etc/configure, lib/configure.in, lib/configure and config/*.
8376 Reported by Jason Merrill.
8378 * symtab.c (hash): Change (char) NULL to '\0'.
8379 Reported by Jason Merrill.
8381 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
8382 etc/nextvers.sh. Release numbers will be edited `by hand'.
8383 * version.h: De-automatize, force value in.
8385 * m4.c: Changes in order to use a newer getopt.h.
8386 Reported by David MacKenzie.
8388 * checks/: New name for examples/.
8389 * checks/get_them: New location for etc/get_examples.
8390 * checks/check_them: New location for etc/check_examples.
8391 * Makefile.in, checks/get_them, checks/check_them: Adjust.
8392 * lib/vfprintf.c: New location for etc/vfprintf.c.
8393 * Delete empty etc/.
8394 * examples/: New name for test/.
8396 1992-03-10 François Pinard <pinard@iro.umontreal.ca>
8398 * Makefile.in (check): Add m4 as dependency.
8400 * m4.c: Accept --no-warnings instead of --no_warnings, and
8401 --no-gnu-extensions instead of --no_gnu_extensions. Make the
8402 usage message more informative.
8403 Reported by David MacKenzie.
8405 1992-03-09 François Pinard <pinard@iro.umontreal.ca>
8407 * etc/check_examples: New name for check_examples.sh.
8408 * etc/get_examples: New name for get_examples.sh.
8409 * Makefile.in, etc/Makefile.in: Use new names.
8411 * Makefile.in: Transmit $(CC) while making in lib.
8413 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
8414 code disposition by hand.
8416 1992-03-08 François Pinard <pinard@iro.umontreal.ca>
8418 * m4.h: Delete definitions for abort() and exit().
8419 Reported by Richard Stallman.
8421 * config/hmake-unicos, config/s-unicos.h: New files.
8422 Reported by Hal Peterson.
8424 * eval.c (exp_term): Have N^0 return 1.
8425 Reported by Michael Fetterman.
8427 * eval.c, input.c, m4.h: Remove last comma in enums.
8428 Reported by Mike Lijewski.
8430 * Transfer of maintenance duties from René to François.
8432 1991-10-24 René Seindal <seindal@diku.dk>
8434 * Release 1.0. Many thanks to those, who provided me with bug
8435 reports and feedback.
8437 * Uses GNU configure, taken from the gdb distribution.
8439 * Uses GNU getopt(), with long option names.
8441 * The -Q/+quiet option is added, which suppresses warnings about
8442 missing or superflous arguments to built-in macros.
8444 * Added default options via the M4OPTS environment variable.
8446 * The built-in format can now be configured to use sprintf as
8447 the formatting engine, for systems without [efg]cvt(3).
8449 * GNU library code is moved to the ./lib subdirectory; other
8450 utility files are now in ./etc.
8452 * Several minor bugs have been fixed.
8454 1991-07-26 René Seindal <seindal@diku.dk>
8456 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
8457 François Pinard and Roland H. Pesch for providing me with reports.
8459 * The builtins incr and decr are now implemented without use of
8462 * The builtin indir is added, to allow for indirect macro calls
8463 (allows use of "illegal" macro names).
8465 * The debugging and tracing facilities has been enhanced
8466 considerably. See the manual for details.
8468 * The -tMACRO option is added, marks MACRO for tracing as soon
8471 * Builtins are traced after renaming iff they were before.
8473 * Named files can now be undiverted.
8475 * The -Nnum option can be used to increase the number of
8476 divertions available.
8478 * Calling changecom without arguments now disables all comment
8481 * The function m4_patsubst() is now consistently declared
8484 * A bug in dnl is fixed.
8486 * A bug in the multi-character quoting code is fixed.
8488 * Several typos in the manual has been corrected. More probably
8491 * The m4.info file is now installed along with the program.
8493 1990-11-15 René Seindal <seindal@diku.dk>
8495 * Updated and enhanced version. Release 0.75, manual 0.07.
8497 * Implemented search path for include files (-I option and
8498 M4PATH envronment variable).
8500 * Implemented builtin "format" for printf-like formatting.
8502 * Implemented builtin "regexp" for searching for regular
8505 * Implemented builtin "patsubst" for substitution with regular
8508 * Implemented builtin "esyscmd", which expands to a shell
8511 * Implemented "__file__" and "__line__" for use in error
8514 * Implemented character ranges in "translit".
8516 * Implemented control over debugging output.
8518 * Implemented multi-character quotes.
8520 * Implemented multi-character comment delimiters.
8522 * Changed predefined macro "gnu" to "__gnu__".
8524 * Changed predefined macro "unix" to "__unix__", when the -G
8525 option is not used. With -G, "unix" is still defined.
8527 * Changed "shift", "$@" and "$*" to not insert spaces afters
8530 * Added program name to error messages.
8532 * Fixed two missing null bytes bugs.
8534 1990-01-22 René Seindal <seindal@diku.dk>
8536 * Initial beta release. Release 0.50, manual 0.05.
8547 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
8548 2005, 2006, 2007 Free Software Foundation, Inc.
8550 Copying and distribution of this file, with or without
8551 modification, are permitted provided the copyright notice
8552 and this notice are preserved.