1 2008-06-02 Eric Blake <ebb9@byu.net>
3 Stage 24a: Use full call context in error reporting.
4 Replace const char *macro_name with const m4_call_info *call, so
5 that the next patch can pass the length of macro_name with
6 embedded NUL. Simplifies handling of global state.
8 Speed impact: none noticed.
9 * m4/m4module.h (m4_error, m4_warn): Change parameter type.
10 (m4_error_at_line, m4_warn_at_line): Delete.
11 (m4_debug_set_output, m4_skip_line, m4_bad_argc, m4_numeric_arg)
12 (m4_parse_truth_arg, m4_symbol_value_lookup): Adjust all clients.
13 * m4/m4private.h (m4__next_token): Likewise.
14 * m4/utility.c (m4_verror_at_line): Alter parameter, and use
15 caller's location if caller is provided.
16 (m4_error, m4_warn): Change parameter type.
17 (m4_error_at_line, m4_warn_at_line): Delete.
18 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg)
19 (m4_symbol_value_lookup): Adjust all callers.
20 * m4/debug.c (set_debug_file, m4_debug_set_output): Likewise.
21 * m4/input.c (m4_skip_line, m4__next_token): Likewise.
22 * m4/macro.c (expand_argument, collect_arguments, m4_macro_call)
23 (process_macro): Likewise.
24 * modules/m4.h (m4_make_temp_func): Likewise.
25 * modules/evalparse.c (m4_evaluate): Likewise.
26 * modules/format.c (arg_int, arg_long, arg_double, format):
28 * modules/gnu.c (builtin, changeresyntax, changesyntax, debugfile)
29 (debuglen, debugmode, esyscmd, indir, mkdtemp, patsubst, regexp)
30 (renamesyms, syncoutput, regexp_compile, substitute)
31 (regexp_substitute, m4_resyntax_encode_safe): Likewise.
32 * modules/m4.c (define, undefine, pushdef, popdef, ifdef, ifelse)
33 (m4_dump_symbols, defn, syscmd, incr, decr, divert, undivert, dnl)
34 (include, maketemp, mkstemp, m4exit, traceon, traceoff, substr):
36 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
37 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
39 * tests/options.at (--syncoutput): Add test for invalid
40 command-line argument. Split xfailed portion...
41 (--syncoutput and diversions): ...into new test.
42 (unknown option): New test.
43 * tests/freeze.at (reloading unknown builtin): Update expected
46 Adjust to recent gnulib change.
47 * configure.ac (AB_INIT): Delete, now that gnulib does this.
49 2008-05-28 Eric Blake <ebb9@byu.net>
51 Improve frozen debugmode behavior.
52 * m4/debug.c (m4_debug_decode): Make empty debugmode additive.
53 * src/main.c (main): Interleave -d with files.
54 * tests/options.at (--debugmode): Update test.
55 * tests/freeze.at (reloading debugmode): New test.
56 * doc/m4.texinfo (Debugging options, Debugmode): Document the
60 2008-05-27 Eric Blake <ebb9@byu.net>
62 Fix some testsuite failures on Solaris 8.
63 * tests/builtins.at (esyscmd, syscmd): Skip tests if system(2) is
65 * tests/others.at (stderr closed): Likewise. Also support Solaris
67 (stdin closed): Skip test if closed stdin gets reopened.
68 (stdout closed): Support Solaris wording for EBADF.
69 * tests/testsuite.at (AT_CHECK_M4): Likewise.
71 Fix configure message nesting, broken since 2001-09-20.
72 * ltdl/m4/gmp.m4 (M4_LIB_GMP): Don't cache result; the test is
73 not expensive, and AC_MSG_WARN doesn't work in AC_CACHE_CHECK.
75 Support 'make dist' with BSD make.
76 * Makefile.am (TESTSUITE_AT, MAINTAINERCLEANFILES): Qualify uses
77 of the generated file tests/generated.at.
78 (EXTRA_DIST, $(TESTSUITE)): Likewise for tests/package.m4.
79 * tests/others.at (stdout closed): Accomodate OpenBSD /bin/sh.
81 2008-05-24 Eric Blake <ebb9@byu.net>
83 Test NUL in frozen files.
84 * tests/testsuite.at (AT_CHECK_M4): Add parameter.
85 * tests/freeze.at (reloading nul): New test.
86 (AT_TEST_FREEZE): Inhibit -d when reloading frozen file.
87 (reloading unknown builtin): Likewise.
89 2008-05-23 Eric Blake <ebb9@byu.net>
91 Improve handling of frozen file errors.
92 * src/freeze.c (produce_frozen_state): Detect write failures.
93 (reload_frozen_state): Use close_stream.
94 * tests/freeze.at (freezing failure): New test.
96 Reported by Jean-Charles Longuet.
98 2008-05-19 Eric Blake <ebb9@byu.net>
100 In frozen file, split consecutive strings with newline.
101 * src/freeze.c (dump_symbol_CB): Add newline to 'T', 'F'.
102 (produce_frozen_state): Likewise for 'Q', 'C'.
103 (reload_frozen_state): Parse the new layout.
104 [GET_DIRECTIVE]: Fix format 1 regression from 2008-05-13.
105 * tests/freeze.at (loading format 2): Rewrite to new format.
106 (reloading unknown builtin): Likewise.
107 (loading format 1): Make sure backslash-newline is not
109 * doc/m4.texinfo (Frozen file format 2): Document the format.
110 * NEWS: Document this change.
112 Fix xgettext options.
113 * po/Makevars (XGETTEXT_OPTIONS): The " must be passed to
116 Fix spelling of René Seindal's name in --version output.
117 * ltdl/m4/gnulib-cache.m4: Import propername module.
118 * src/main.c (AUTHORS): Rewrite in terms of proper_name.
119 * po/Makevars (XGETTEXT_OPTIONS): Detect new functions.
120 * HACKING: Mention new prerequisite of gperf.
122 2008-05-18 Eric Blake <ebb9@byu.net>
124 Allow freezing the trace status of macros.
125 * src/freeze.c (produce_symbol_dump): Let undefined traced macros
127 (dump_symbol_CB): Also freeze trace state.
128 * tests/freeze.at (reloading traced macros): New test.
129 * doc/m4.texinfo (Using frozen files): Update documentation to
131 (Frozen file format 1): Improve synchronization with branch.
132 (Frozen file format 2): Reorder directives, and add `d', `t'.
133 * NEWS: Document this change.
135 2008-05-15 Eric Blake <ebb9@byu.net>
137 Fix frozen file regression in pushdef stacks from 2001-09-01.
138 * src/freeze.c (dump_symbol_CB): Push all values on the stack, not
139 just the current definition.
140 (reverse_symbol_value_stack): New helper method.
141 * tests/freeze.at (AT_TEST_FREEZE): New helper macro.
142 (reloading pushdef stack): New test.
143 (reloading unknown builtin): Enhance test.
145 2008-05-13 Eric Blake <ebb9@byu.net>
147 Fix frozen file regression in diversions from 2007-01-21.
148 * m4/output.c (insert_diversion_helper): Add parameter.
149 (m4_insert_file): Move contents...
150 (insert_file): ...to this new helper, with added parameter.
151 (m4_insert_diversion, m4_undivert_all, m4_freeze_diversions):
153 * src/freeze.c (produce_mem_dump): Simplify.
154 * tests/freeze.at (large diversion): Test for this.
156 Improve error message when frozen file is invalid.
157 * src/freeze.c (decode_char): Add parameter. Allow \<newline>
159 (reload_frozen_state): Track current line.
160 * tests/freeze.at (loading format 1, loading format 2): Update to
163 2008-05-10 Eric Blake <ebb9@byu.net>
165 Detect integer overflow when loading frozen file.
166 * src/freeze.c (reload_frozen_state) [GET_NUMBER]: Rewrite to fail
167 immediately on overflow.
168 * tests/freeze.at (loading format 2): Test this.
169 Reported by Jim Meyering.
171 2008-05-08 Eric Blake <ebb9@byu.net>
173 Stage 23: allow tracing of indirect macro calls.
174 Track all trace information as part of the argv struct, rather
175 than temporarily resetting global state. Teach indir to trace
176 macros that it invokes.
177 Memory impact: slight penalty, due to larger argv struct.
178 Speed impact: none noticed.
179 * m4/m4module.h (m4_input_block): Remove.
180 (m4_call_info): New opaque type.
181 (m4_trace_prepare, m4_arg_info): New prototypes.
182 (m4_macro_call, m4_push_string_finish, m4_input_print): Change
184 * m4/m4private.h (struct m4_macro_args): Add info field.
185 (struct m4_call_info): New structure.
186 (m4_arg_info): New accessor.
187 * m4/input.c (m4_input_block): Make typedef local.
188 (m4_push_string_init): Initialize length.
189 (m4_push_string_finish, m4_input_print): Change signature, so that
190 printing can be done before finalization.
191 (struct input_funcs): Add parameter to print_func.
192 (file_print, string_print, composite_print): Adjust accordingly.
193 * m4/macro.c (trace_header, trace_flush, trace_pre, trace_post):
194 Change signatures for stacked trace messages, and for using call
196 (trace_prepre): Export and rename...
197 (m4_trace_prepare): ...to this, for use by indir. Alter signature
199 (collect_arguments): Alter signature, to manage new field.
200 (expand_macro): Change call context management. Move tracing...
201 (m4_macro_call): ...here. Remove redundant parameter.
202 (m4_arg_argc): New function.
203 (m4_make_argv_ref): Replace unused skip parameter with new trace
204 parameter; manage new field.
205 * modules/gnu.c (builtin, indir): Adjust callers.
206 * src/main.c (usage): Update debugmode flag summary.
207 * tests/null.m4: Enhance test.
208 * tests/null.err: Update expected output.
209 * tests/macros.at (Tracing Hanoi Towers): Likewise.
210 * doc/m4.texinfo (Trace): Mention more about trace formatting.
211 (Debugmode): Enhance description of 'c' and 'x'. Enhance test to
212 cover line numbering details in traces.
213 (Debuglen): Enhance test to cover indir tracing.
214 * NEWS: Mention these changes.
215 Reported by Akim Demaille in the autoconf TODO file in 2000.
217 2008-05-07 Eric Blake <ebb9@byu.net>
219 Test for traceon regression just fixed in branch-1.6.
220 * doc/m4.texinfo (Trace): Enhance test.
221 * NEWS: Port news item from branch.
223 2008-05-05 Eric Blake <ebb9@byu.net>
225 Stage 22: allow builtin token concatenation outside $@.
226 Adjust the input and argument parsing engines to append builtins
227 alongside text. Make define warn when builtins must be
229 Memory impact: slight penalty, with fewer builtins flattened.
230 Speed impact: slight penalty, from more bookkeeping.
231 * m4/m4module.h (m4_is_arg_composite): New prototype.
232 (m4_symbol_value_copy): Change return type.
233 (m4_arg_text): Add parameter.
234 (M4ARG): Adjust callers.
235 * m4/m4private.h: Adjust comments.
236 * m4/symtab.c (m4_symbol_value_copy): Detect when builtins are
238 * m4/input.c (init_builtin_token): Add parameter, and allow
239 concatenating builtins.
240 (m4__next_token): Adjust caller.
241 * m4/macro.c (m4_is_arg_composite): New function.
242 (expand_argument): Allow builtin concatenation.
243 (m4_arg_text): Add parameter.
244 (m4__arg_adjust_refcount, m4__arg_print): Adjust callers.
245 (m4_arg_equal): Fix comparison of builtin tokens.
246 * modules/m4.c (define, pushdef): Warn when flattening builtins.
247 * doc/m4.texinfo (Define): Remove dead comment.
248 (Defn): Update to reflect code changes.
249 * tests/builtins.at (defn): Remove xfail.
250 * NEWS: Document this change.
252 2008-05-03 Eric Blake <ebb9@byu.net>
254 Document define_blind.
255 * doc/m4.texinfo (Ifelse): Add a new composite macro.
259 2008-05-01 Eric Blake <ebb9@byu.net>
261 Avoid -Wshadow compiler warnings.
262 * m4/output.c (threshold_diversion_CB): s/div/diversion/.
263 * m4/macro.c (make_argv_ref, arg_symbol, m4_arg_symbol)
264 (m4_is_arg_text, m4_is_arg_func, m4_arg_text, m4_arg_empty)
265 (m4_arg_len, m4_arg_func, m4__arg_print, m4_make_argv_ref)
266 (m4_push_arg, m4__push_arg_quote): s/index/arg/.
267 * modules/format.c (format): Likewise.
268 * modules/m4.c (ifelse): Likewise.
270 Improve debugmode testing, based on recent branch-1.6 regressions.
271 * doc/m4.texinfo (Debugmode): Enhance tests.
272 * tests/generate.awk: Run tests from stdin, not input.m4. Support
273 stderr munging when using -I examples.
275 Fix regression in define from 2008-02-22.
276 * m4/m4module.h (m4_symbol_value_copy): Add parameter.
277 * m4/symtab.c (m4_symbol_value_copy): Support copying $@
279 * m4/macro.c (expand_argument): Update callers.
280 * modules/m4.c (define, pushdef): Likewise.
281 * tests/builtins.at (define): Enhance test to catch this.
283 2008-04-21 Eric Blake <ebb9@byu.net>
285 Simplify previous patch.
286 * tests/m4.in: Compress assignment.
287 Suggested by Gary V. Vaughan.
289 Fix --disable-shared testsuite regression from previous patch.
290 * tests/m4.in: Export M4MODPATH, so that recursive m4 invocations
293 Fix spelling of attribution to Christopher Strachey.
294 * doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
296 Reported by Fernando Carrijo.
298 2008-04-17 Eric Blake <ebb9@byu.net>
300 Fix testsuite bug when SIGPIPE is ignored.
301 * tests/builtins.at (divert): Consume all of m4's output, to avoid
302 spurious write failure.
303 * src/main.c (main): In batch mode, restore default handling of
305 * doc/m4.texinfo (Operation modes): Document SIGPIPE behavior.
307 Reported by Bob Proulx, via his autobuilder.
309 2008-04-15 Eric Blake <ebb9@byu.net>
311 Fix 'make installcheck' after './configure --prefix-progname'.
312 * tests/testsuite.at (AT_CHECK_M4): Allow overriding the m4
314 (HELP_OTHER, PREPARE_TESTS): Document and use $M4.
315 * tests/builtins.at (patsubst): Avoid space-tab.
316 (divert, mkdtemp, mkstemp): Adjust tests to use $M4.
317 * tests/options.at (--debugfile): Likewise.
318 * tests/others.at (stdin seekable): Likewise.
319 (fstab): Avoid space-tab.
320 * Makefile.am (installcheck-local): Accomodate transformed name.
321 (DISTCHECK_CONFIGURE_FLAGS): Ensure no regressions, by using gm4
322 during 'make distcheck'.
323 * cfg.mk: New file, borrowed from branch.
325 Update prerequisite tools to match recent releases.
326 * configure.ac (AC_PREREQ): Rely on released autoconf.
327 (LT_PREREQ): Rely on released libtool.
328 * tests/testsuite.at (m4_version_prereq): Update dependence.
329 * bootstrap: Mention prerequisites.
331 Work around OS/2 limitation of printf(1).
332 * tests/null.m4: Use m4, not printf, to generate NUL byte.
333 * tests/null.out: Check for esyscmd failure.
334 Reported by Elbert Pol.
336 2008-04-14 Eric Blake <ebb9@byu.net>
338 Stage 21b: $@ concatenates builtins, m4wrap takes builtins.
339 Improve arg_print to handle builtin tokens when printing to a
340 known chain, rather than always flattening builtins. This allows
341 m4wrap and $@ back-references to handle embedded builtin tokens.
343 Speed impact: slight penalty, from more bookkeeping.
344 * m4/m4module.h (m4_push_builtin): Add parameter.
345 (m4_builtin_print, m4_push_wrapup_init, m4_push_wrapup_finish)
346 (m4_arg_print, m4_symbol_value_print): Rename and reduce scope...
347 * m4/m4private.h (m4__builtin_print, m4__push_wrapup_init)
348 (m4__push_wrapup_finish, m4__arg_print, m4__symbol_value_print):
349 ...to these, in some cases adding a parameter.
350 (m4__append_builtin): New prototype.
351 * m4/builtin.c (m4_builtin_print): Alter signature to print
352 builtin to a growing symbol chain.
353 * m4/symtab.c (m4__symbol_value_print): Alter signature.
354 (m4_symbol_print, dump_symbol_CB): Adjust callers.
355 * m4/input.c (builtin_peek, builtin_read, builtin_unget)
356 (builtin_print, builtin_funcs): Delete, handled via composite
358 (struct m4_input_block): Delete u.builtin member.
359 (init_builtin_token): Only use composite block.
360 (m4__append_builtin): New function.
361 (m4_push_builtin, m4__push_wrapup_init): Alter signature.
362 (m4__push_symbol): Allow builtin tokens.
363 (m4__push_wrapup_finish): Rename.
364 (composite_print, m4_print_token): Adjust callers.
365 * m4/macro.c (m4_wrap_args, collect_arguments): Allow builtin
367 (m4__arg_print): Alter signature.
368 (trace_prepre, trace_pre, m4_arg_text, m4_arg_equal): Adjust
370 * modules/m4.c (m4wrap): Allow builtin tokens.
371 (defn, errprint): Adjust callers.
372 * modules/gnu.c (builtin): Likewise.
373 * doc/m4.texinfo (M4wrap): New test.
374 (Debuglen): Adjust expected output.
376 Stage 21a: Optimize checks for end of input.
377 Create a new polymorphic input block type, which always fails with
378 CHAR_EOF, so that remaining input routines no longer have to check
379 for NULL input block.
381 Speed impact: noticeable improvement, from fewer conditionals.
382 * m4/input.c (eof_funcs, input_eof): New objects.
383 (eof_peek, eof_read, eof_unget): New functions.
384 (file_clean, m4_push_string_init, pop_input, m4_push_wrapup_init)
385 (m4_pop_wrapup, next_char, peek_char, unget_input, m4_input_init)
386 (m4_input_exit): Use placeholder to guarantee non-NULL isp and
388 (next_char): Rename retry to allow_unget, and change sense for
389 easier manipulation. All callers changed.
391 Improve OS/2 detection.
392 * modules/gnu.c (m4_macro_table): Ensure all possible identifiers
393 are defined, not just the first. The testsuite ensures that
394 exactly one gets defined.
395 * m4/system_.h [__EMX__]: OS/2 is not Unix-compatible, no matter
396 what other pre-defined macros it has.
398 Reported by Elbert Pol.
400 Ensure __m4_version__ is unquoted.
401 * tests/builtins.at (__m4_@&t@version__): Augment test.
403 Avoid GNU make failure on tarball.
404 * Makefile.am (EXTRA_DIST): Distribute cfg.mk and maint.mk.
406 2008-04-10 Eric Blake <ebb9@byu.net>
408 Allow back-referenced macro names; fixes 2008-03-13 regression.
409 * m4/m4module.h (m4_symbol_value_lookup): Change prototype.
410 * m4/utility.c (m4_symbol_value_lookup): Change signature.
411 * modules/m4.c (undefine, popdef, ifdef, m4_dump_symbols, defn):
413 * tests/others.at (ifndef): New test.
415 Be namespace clean for M4 version; fixes 2008-04-08 regression.
416 * configure.ac (version): Rename...
417 (M4_VERSION): ...to this, since using 'version' broke po.m4.
419 2008-04-09 Eric Blake <ebb9@byu.net>
421 Mention 1.4.11 release.
422 * doc/m4.texinfo (History, Defn, Ifdef, Ifelse, M4wrap)
423 (Extensions, Improved foreach): Distinguish 1.4.11 and 1.6.
424 (Format): Add test of C99 hex-float parsing.
425 * NEWS: Mention 1.4.11 release.
426 * tests/builtins.at (divert): Add additional test.
428 2008-04-08 Eric Blake <ebb9@byu.net>
430 Overhaul inter-version releases to work with git.
431 * configure.ac (version): New variable, which has nicer version
432 contents when using git 1.5.5+, hardcoded to 1.9a otherwise.
433 (TIMESTAMP): Delete, since CVS id expansion died with transition
435 (AM_INIT_AUTOMAKE): Use version to decide gnu vs. gnits.
436 * build-aux/mkstamp: Delete, no longer used.
437 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Kill, to speed up
438 rebuilds when timestamps don't matter.
439 (MKSTAMP): Delete, no longer used.
440 (EXTRA_DIST): No longer worry about mkstamp.
441 (.version): New rule and distributed file.
442 (doc/m4.1, tests/package.m4): Depend on .version, not
443 configure.ac, for timestamp.
444 * ltdl/m4/gnulib-cache.m4: Import git-version-gen module.
445 * modules/gnu.c (__m4_version__): TIMESTAMP no longer exists.
446 * src/main.c (main): Likewise.
448 2008-03-28 Eric Blake <ebb9@byu.net>
450 Use GNUmakefile module.
451 * ltdl/m4/gnulib-cache.m4: Import gnumakefile module.
452 * Makefile.am: Split off maintainer rules...
453 * maint.mk: ...into this new file.
455 2008-03-18 Eric Blake <ebb9@byu.net>
457 Stage 20b: make m4wrap obey POSIX fifo ordering.
458 Improve input engine to support location changes within symbol
459 chains, then convert m4wrap to always build symbol chain.
461 Speed impact: slight penalty, from more m4wrap bookkeeping.
462 * m4/m4module.h (m4_wrap_args): Add prototype.
463 * m4/m4private.h (enum m4__symbol_chain_type): Add M4__CHAIN_LOC.
464 (struct m4__symbol_chain): Add struct u_l.
465 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Use
467 (composite_peek, composite_read, composite_clean): Handle location
469 * m4/macro.c (m4_wrap_args): New function.
470 * modules/m4.c (m4wrap): Use it.
471 * doc/m4.texinfo (M4wrap): Sync with branch and POSIX.
472 (Extensions): Document extension of multiple arguments.
473 (Location, Improved m4wrap): Adjust example to match FIFO order.
474 * tests/builtins.at (wrap): Likewise.
475 * NEWS: Document this change.
477 2008-03-17 Eric Blake <ebb9@byu.net>
479 Stage 20a: reduce unget's in input engine.
480 Now that out-of-range input placeholders like CHAR_BUILTIN are
481 consumed outside of next_char, next_token should always consume
482 rather than peek at the first character. Fewer peeks results in
483 less ungetc overhead.
485 Speed impact: noticeable improvement, from fewer function calls.
486 * m4/input.c (struct input_funcs): Alter read_func prototype.
487 (next_char, file_read, buildin_read, string_read, composite_read):
488 Add allow_argv parameter.
489 (init_builtin_token, init_argv_symbol): Require all prior input to
491 (m4_skip_line, match_input, consume_syntax): Adjust callers.
492 (m4__next_token): Consume first byte without peek.
494 Update for fresh bootstrap.
495 * ltdl/m4/gnulib-cache.m4: Updated copyright from upstream.
497 2008-03-15 Eric Blake <ebb9@byu.net>
499 Document join, in order to fix bug in m4wrap example.
500 * examples/join.m4: New file.
501 * examples/wraplifo2.m4: Likewise.
502 * Makefile.am (EXTRA_DIST): Add new files.
503 * doc/m4.texinfo (Improved m4wrap): New node.
504 (Defn, Location): Enhance tests.
505 (Shift): Document the composite macro join.
506 (Incompatibilities): Move documentation of LIFO vs. FIFO...
507 (M4wrap): ...here, to match improved example.
509 2008-03-13 Eric Blake <ebb9@byu.net>
511 Stage 19c: allow builtin tokens in more macros.
512 Allow builtin tokens inside symbol chains, although for now, they
513 are not allowed inside comments or quotes. Enable builtin token
514 handling in more macros, if only to consistently diagnose invalid
517 Speed impact: slight impact, due to more bookkeeping.
518 * m4/m4module.h (m4_symbol_value_lookup, m4_builtin_print): New
520 * m4/m4private.h (enum m4__symbol_chain_type): Add
522 (struct m4__symbol_chain): Add builtin member.
523 * m4/utility.c (m4_symbol_value_lookup): New method.
524 * m4/builtin.c (m4_builtin_print): New function.
525 * m4/symtab.c (m4_symbol_value_print): Use it.
526 * m4/input.c (builtin_print): Likewise.
527 (m4__push_symbol): Allow pushing builtin tokens.
528 (composite_peek, composite_read, composite_unget, composite_clean)
529 (composite_print): Handle builtin tokens.
530 (init_builtin_token): Allow builtin tokens from composite input.
531 (m4__next_token): Flatten builtins inside comment or string.
532 * m4/macro.c (expand_argument): Strengthen assertion.
533 (collect_arguments, m4_arg_equal, m4_arg_print, m4_push_args):
534 Handle builtin tokens.
535 (arg_symbol): Add parameter, and allow NULL level.
536 (m4_arg_symbol, m4__push_arg_quote): Adjust callers.
537 (m4_arg_text): Ensure all builtins have been flattened.
538 * modules/m4.c (defn, dumpdef, popdef, traceoff, traceon)
539 (undefine, m4_dump_symbols): Warn on invalid macro names.
540 (ifdef, ifelse, shift): Handle builtin tokens.
541 * modules/gnu.c (m4symbols): Likewise.
542 * doc/m4.texinfo (Defn, Ifdef, Ifelse): Document and test the new
544 (Debuglen): Likewise, and remove xfail.
545 * NEWS: Mention the change.
547 Stage 19b: invert sense of bit for handling builtin tokens.
548 Pass builtin tokens by default, rather than as the exception, so
549 that the logic can consistently refer to flattening arguments.
552 * m4/m4module.h (M4BUILTIN_ENTRY): New convenience macro.
553 (M4_BUILTIN_GROKS_MACRO): Rename...
554 (M4_BUILTIN_FLATTEN_ARGS): ...and invert sense.
555 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): Likewise...
556 (m4_symbol_value_flatten_args, m4_symbol_flatten_args): ...to
558 * m4/m4private.h (VALUE_MACRO_ARGS_BIT)
559 (m4_symbol_value_groks_macro): Likewise...
560 (VALUE_FLATTEN_ARGS_BIT, m4_symbol_value_flatten_args): ...to
562 * m4/symtab.c (m4_symbol_value_groks_macro): Likewise...
563 (m4_symbol_value_flatten_args): ...to this.
564 * m4/macro.c (collect_arguments): Accomodate changed sense.
565 * m4/module.c (m4__module_open): Require arguments if flattening
567 * m4/input.c (m4_push_string_finish): For now, flatten all
568 builtins pushed as back-references.
569 * modules/gnu.c (m4_builtin_table, builtin): Adjust all clients.
570 * modules/import.c (m4_builtin_table): Likewise.
571 * modules/load.c (m4_builtin_table): Likewise.
572 * modules/modtest.c (m4_builtin_table): Likewise.
573 * modules/mpeval.c (m4_builtin_table): Likewise.
574 * modules/perl.c (m4_builtin_table): Likewise.
575 * modules/shadow.c (m4_builtin_table): Likewise.
576 * modules/stdlib.c (m4_builtin_table): Likewise.
577 * modules/time.c (m4_builtin_table): Likewise.
578 * modules/m4.c (m4_builtin_table): Likewise.
579 (mkstemp): Undo #undef hack from 2006-10-23, now that macro names
580 are stringized without preprocessor expansion.
581 * doc/m4.texinfo (Defn): Update comments to match reality.
582 (Debuglen): Update test now that user macros pass builtin tokens.
584 Stage 19a: sort and cache builtins loaded by a module.
585 Rather than repeatedly using dlsym to browse the builtin table,
586 copy off the table at module load time. Then, the input engine
587 merely refers to the copy instead of duplicating information.
588 Memory impact: slight penalty, due to more memory per module, but
589 offset by less memory in input engine.
590 Speed impact: slight improvement, due to faster builtin lookups.
591 * m4/m4module.h (m4_set_symbol_value_builtin): Delete. Use
592 m4_builtin_find_by_* instead.
593 (m4_builtin_find_by_func): Change return type.
594 * m4/m4private.h (m4__builtin): New struct.
595 (m4_module): Add sorted list of loaded builtins.
596 (struct m4_symbol_value): Change type of builtin value.
597 (m4__set_symbol_value_builtin): New prototype and fast accessor.
598 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
600 * m4/symtab.c (m4_set_symbol_value_builtin): Rename...
601 (m4__set_symbol_value_builtin): ...and populate additional fields,
603 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
605 * m4/module.c (install_builtin_table): Use cached table.
606 (compare_builtin_CB): New helper function.
607 (m4__module_open): Populate table.
608 (module_remove): Free table.
609 * m4/builtin.c (compare_builtin_name_CB): New helper function.
610 (m4_builtin_find_by_name): Rewrite to use sorted table.
611 (m4_builtin_find_by_func): Change return type.
612 * m4/input.c (struct m4_input_block): Simplify u_b, since most
613 fields can be determined from builtin.
614 (builtin_peek, builtin_read, builtin_unget, init_builtin_token)
615 (m4__next_token): Alter parsing so that only init_builtin_token
617 (builtin_print, m4_push_builtin): Adjust all users.
618 * tests/macros.at (Arity, defn, and freeze): Fix typo.
620 Consistently cast malloc results, for C++ compilation.
621 * m4/builtin.c (m4_builtin_find_by_name): Add cast.
622 * m4/hash.c (m4_hash_new, m4_get_hash_iterator_next, node_new)
623 (m4_hash_resize, maybe_grow): Likewise.
624 * m4/m4.c (m4_create): Likewise.
625 * m4/macro.c (expand_macro): Likewise.
626 * m4/output.c (m4_tmpname): Likewise.
627 * m4/path.c (search_path_add): Likewise.
628 * m4/symtab.c (m4_symtab_create, m4_symbol_value_create)
629 (symtab_fetch): Likewise.
630 * m4/syntax.c (m4_syntax_create): Likewise.
631 * modules/gnu.c (regexp_compile): Likewise.
632 * src/main.c (main): Likewise.
633 * src/freeze.c (reload_frozen_state): Likewise.
635 2008-03-06 Eric Blake <ebb9@byu.net>
637 Fix nested builtin(`shift',$@) regression from 2008-02-23.
638 * m4/macro.c (make_argv_ref): Don't output expansion text when
639 making wrapper for builtin or indir.
640 * tests/builtins.at (builtin): New test.
641 * NEWS: Document the fix.
642 Reported by Andreas Schwab.
644 2008-03-04 Eric Blake <ebb9@byu.net>
646 The gnulib module free was deprecated.
647 * ltdl/m4/gnulib-cache.m4: Remove free module.
649 2008-02-29 Eric Blake <ebb9@byu.net>
651 Import news from 1.4.10b.
652 * NEWS: Update from branch.
654 2008-02-23 Eric Blake <ebb9@byu.net>
656 Stage 18: try harder to reuse argv in recursion.
657 When pushing arguments that contain an existing $@ ref, reuse the
658 ref rather than creating another layer of wrappers.
659 Memory impact: noticeable improvement, due to better $@ reuse.
660 Speed impact: noticeable improvement, due to O(n^2) to O(n)
661 reduction in unboxed recursion.
662 * m4/macro.c (make_argv_ref): Avoid wrapping $@ when possible.
663 (m4_push_args): Let make_argv_ref take care of pending data.
664 * doc/m4.texinfo (Improved foreach): Tweak wording to match new
665 performance capability.
666 * tests/others.at (recursion): Add tests to avoid performance
669 2008-02-22 Eric Blake <ebb9@byu.net>
672 * NEWS: Document change to __gnu__ on 2008-02-11.
674 Stage 17: pass argv through quoted strings.
675 Allow the concatenation of $@ references with other text input
676 inside quoted contexts, which requires distinguishing between a
677 wrapper around many arguments vs. a reference serving as part of a
678 single argument. Also optimize based on whether argv contains
679 builtin tokens that might need flattening to the empty string.
680 Memory impact: noticeable improvement, due to O(n^2) to O(n)
681 reduction from total reuse of $@ references.
682 Speed impact: noticeable improvement, due to O(n^2) to O(n)
683 reduction in boxed recursion.
684 * m4/m4module.h (m4_arg_equal, m4_arg_len): Add parameter.
685 (M4ARGLEN): Adjust definition.
686 * m4/m4private.h (struct m4__symbol_chain): Add has_func member.
687 (struct m4_symbol_value): Add wrapper and has_func members.
688 (struct m4_macro_args): Add flatten and has_func members.
689 * m4/input.c (append_quote_token): Return argv refs inside quoted
691 (init_argv_symbol): Populate new fields.
692 * m4/macro.c (expand_argument, collect_arguments, make_argv_ref)
693 (m4_make_argv_ref): Likewise.
694 (arg_symbol, arg_mark, m4_is_arg_text, m4_is_arg_func): Use new
696 (m4_arg_equal, m4_arg_len): Handle quoted argv references, and add
698 * modules/m4.c (ifelse): Adjust caller.
700 2008-02-22 Gary V. Vaughan <gary@gnu.org>
702 Fix regression in argument collection, from 2008-01-21.
703 * m4/input.c (m4__next_token): When DEBUG_INPUT is defined,
704 undo argument collection optimisation for strings, so that
705 m4_print_token doesn't abort when it otherwise receives an
706 unprintable M4_SYMBOL_VOID type token.
708 2008-02-20 Eric Blake <ebb9@byu.net>
710 Stage 16: cache quotes and improve m4_arg_print.
711 Cache rather than always copying quotes when pushing $@ refs; in
712 particular, reconstruct single-byte quotes on the fly. Allow NUL
713 through m4wrap. Improve sharing of code that prints arguments.
714 Memory impact: slight improvement, due to cached quotes.
715 Speed impact: slight improvement, due to less copying.
716 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print)
717 (m4_arg_print): Adjust prototypes.
718 (m4_dump_args): Delete.
719 (m4_push_wrapup): Split...
720 (m4_push_wrapup_init, m4_push_wrapup_finish): ...into these
722 * m4/m4private.h (struct m4_syntax_table): Add cached_quote
724 (m4__quote_cache, m4__quote_uncache): New prototypes.
725 * m4/syntax.c (m4_syntax_create): Initialize the cache.
726 (m4__quote_cache): New function.
727 (m4_set_syntax): Update caller.
728 * m4/symtab.c (m4_symbol_value_print): Add parameter.
729 (m4_symbol_print, dump_symbol_CB): Adjust all callers.
730 * m4/utility.c (m4_dump_args): Delete; callers should use
731 m4_arg_print instead.
732 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Split
733 implementation, and allow embedded NUL.
734 (m4_print_token, pop_input, composite_print, composite_peek):
735 (composite_read, append_quote_token): Adjust all callers.
736 * m4/macro.c (trace_prepre, m4_arg_text, make_argv_ref):
738 (m4_arg_print): Add parameters.
739 (trace_pre): Rewrite in terms of m4_arg_print.
740 * modules/m4.c (errprint): Likewise.
741 (m4wrap): Rewrite to allow embedded NUL.
742 (dumpdef): Adjust caller.
743 * doc/m4.texinfo (Debuglen): Enhance debuglen test.
744 * tests/null.m4: Test for NUL in m4wrap.
745 * tests/null.out: Update expected output.
747 Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
748 * m4/utility.c (m4_verror_at_line): Properly terminate the string.
749 Reported by Ralf Wildenhues.
751 * doc/m4.texinfo (Debuglen, Changesyntax): Fix typos.
753 2008-02-19 Eric Blake <ebb9@byu.net>
755 Clean up example on filtering defined symbols.
756 * doc/m4.texinfo (Foreach, Improved foreach): Document another
757 shortcoming in foreach.m4, and improve filter example by using
760 * src/main.c (usage): Fix typo.
762 2008-02-18 Eric Blake <ebb9@byu.net>
764 Avoid some magic numbers.
765 * m4/m4private.h (CHAR_EOF, CHAR_BUILTIN, CHAR_QUOTE, CHAR_ARGV)
766 (CHAR_RETRY): Define in terms of UCHAR_MAX.
767 * m4/syntax.c (m4_syntax_create, set_syntax_set)
768 (reset_syntax_set, check_is_single_quotes)
769 (check_is_single_comments, check_is_macro_escaped)
770 (m4_set_quotes, m4_set_comment): Likewise.
771 * modules/gnu.c (regexp_compile): Likewise.
772 * modules/m4.c (translit): Likewise.
773 * src/freeze.c (produce_syntax_dump): Likewise.
774 Reported by Ralf Wildenhues.
776 2008-02-16 Eric Blake <ebb9@byu.net>
778 Add regression test for multi-character quote recursion.
779 * examples/foreach2.m4: Use $0 rather than spelling out name.
780 * examples/foreachq2.m4: Likewise.
781 * examples/forloop2.m4: Likewise.
782 * examples/hanoi.m4: Likewise.
783 * examples/trace.m4: Likewise.
784 * doc/m4.texinfo (Improved forloop): Document advantage of $0.
785 (Improved foreach): Adjust dump from file.
787 Stage 15: return argv refs back to collect_arguments.
788 Collect an entire $@ reference at once rather than one argument at
789 a time, outside of quotes (but inside quotes, $@ is still
790 flattened for now). The skip_last field allows concatenation of
791 $@ with other text when collecting arguments.
792 Memory impact: noticeable improvement, due to better reuse of $@.
793 Speed impact: noticeable improvement, due to less parsing.
794 * m4/m4private.h (CHAR_ARGV): New input engine sentinel.
795 (enum m4__token_type): Add M4_TOKEN_ARGV.
796 (struct m4__symbol_chain): Add skip_last member to argv link.
797 (m4__next_token): Add parameter.
798 * m4/input.c (peek_char, file_peek, builtin_peek, string_peek)
799 (composite_peek, m4__next_token): Add new parameter.
800 (composite_read, append_quote_token): Support argv in quotes.
801 (init_argv_symbol): New function.
802 (m4__push_symbol, match_input, consume_syntax)
803 (m4__next_token_is_open, m4_print_token): Adjust callers.
804 * m4/macro.c (m4_macro_expand_input, m4__arg_adjust_refcount)
805 (arg_mark, m4_arg_text, make_argv_ref): Likewise.
806 (expand_argument, collect_arguments): Handle new token.
807 (arg_symbol): Drill through $@ reference.
808 * m4/syntax.c (set_quote_age): Detect disabled comments.
809 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Fix debug code.
811 2008-02-15 Eric Blake <ebb9@byu.net>
813 * modules/gnu.c (regexp_compile): Use a fastmap for regex speed.
815 2008-02-13 Eric Blake <ebb9@byu.net>
818 * doc/m4.texinfo (Eval, Incompatibilities): Use @. after capital.
819 (History): Use @: after abbreviations.
820 (M4exit): Use correct Latin abbreviation.
821 (Dumpdef, Debugmode, Frozen file format 2): Use correct spacing
824 2008-02-11 Eric Blake <ebb9@byu.net>
826 Allow builtin text macros to specify number of arguments.
827 * m4/m4module.h (struct m4_macro): Add argument limits to builtin
829 * m4/module.c (install_macro_table): Allow text macros to warn on
831 * modules/gnu.c (m4_macro_table): Update all clients.
832 * modules/load.c (m4_macro_table): Likewise.
833 * modules/mpeval.c (m4_macro_table): Likewise.
834 * modules/perl.c (m4_macro_table): Likewise.
835 * modules/shadow.c (m4_macro_table): Likewise.
836 * modules/traditional.c (m4_macro_table): Likewise.
837 * modules/modtest.c (m4_macro_table): Likewise. Also add text
838 macros, for testing this.
839 * doc/m4.texinfo (Standard Modules): Update text, and enhance
841 * tests/modules.at (modules: text): New test.
843 Fix regression in command line -D option, from 2006-08-25.
844 * m4/m4private.h (m4_symbol_value_create): Delete fast accessor.
845 * m4/m4module.h: Fix typo.
846 * m4/symtab.c (m4_symbol_value_create): Prime the maximum number
848 * tests/macros.at (Command line define): Enhance test.
849 * tests/others.at (nul character): Enhance test.
850 * tests/null.m4: Likewise.
851 * tests/null.out: Likewise.
853 Use gnulib's git-merge-changelog driver when available.
854 * .gitattributes: Add merge attributes for ChangeLog.
855 * bootstrap: Install driver, if not already present.
857 2008-02-06 Eric Blake <ebb9@byu.net>
859 Fix security hole introduced 2007-11-23.
860 * m4/utility.c (m4_verror_at_line): Properly escape macro names.
861 * src/main.c (main): Manage quoteargs defaults.
862 * doc/m4.texinfo (Indir): Document and test this.
864 Using raw strtod is not portable.
865 * ltdl/m4/gnulib-cache.m4: Import the strtod module.
867 2008-02-02 Eric Blake <ebb9@byu.net>
869 Consistently use size_t for number of arguments.
870 * m4/m4module.h (m4_builtin_func): Alter prototype.
871 (struct m4_builtin): Adjust type of min_args, max_args.
872 (M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
873 (m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
874 (m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
875 (m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
876 (m4_arg_print, m4_push_arg): Adjust all clients.
877 * m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
878 (m4_macro_args): Adjust type of various fields.
879 (m4__push_arg_quote): Adjust all clients.
880 * m4/input.c (m4_pop_wrapup): Likewise.
881 * m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
882 (arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
883 (m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
884 (m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
885 (m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
886 * m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
887 * modules/evalparse.c (m4_evaluate): Likewise.
888 * modules/gnu.c (changesyntax): Likewise.
889 * modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
890 (undivert, traceon, traceoff): Likewise.
891 * modules/m4.h (m4_dump_symbols_func): Likewise.
892 * modules/perl.c (perleval): Likewise.
894 Stage 14b: allow pushing argv references.
895 Push a $@ reference to the input engine in one go, rather than
896 pushing each element. For now, argument collection still gets one
897 argument of a $@ at a time; but the penalties of this patch make
898 it easier to manage $@ efficiently in future patches.
899 Memory impact: noticeable penalty, due to larger struct and O(n)
900 to O(n^2) on unboxed recursion.
901 Speed impact: noticeable penalty, due to more bookkeeping.
902 * m4/m4private.h (struct m4__symbol_chain): Add comma and quotes
904 (struct m4_macro_args): Add level field.
905 (m4__arg_adjust_refcount, m4__push_arg_quote): New prototypes.
906 * m4/input.c (m4__push_symbol, composite_peek, composite_read)
907 (composite_unget, composite_clean, composite_print): Support $@
909 * m4/macro.c (collect_arguments): Populate new field.
910 (expand_macro): Move argv cleanup...
911 (m4__arg_adjust_refcount): ...to this new function.
912 (m4_arg_symbol, m4_make_argv_ref, m4_push_arg): Factor...
913 (arg_symbol, make_argv_ref, m4__push_arg_quote): ...to these new
914 helper functions, to add parameters.
915 (m4_push_args): Adjust caller.
916 * m4/symtab.c (m4_symbol_value_print): Likewise.
918 Stage 14a: allow printing argv references.
919 Refactor symbol-value printing code for better sharing, and to
920 allow printing a contiguous text representation of a $@ ref.
923 * m4/m4module.h (m4_arg_print): New prototype.
924 (m4_symbol_value_print): Alter prototype.
925 * m4/input.c (struct input_funcs): Add parameter to peek_func.
926 (file_peek, builtin_peek, string_peek): Ignore new parameter.
927 (composite_peek): Ignore new parameter, for now.
928 (composite_clean, pop_input): Rework to minimize indirection, and
929 to avoid infinite recursion in next patch.
930 * m4/macro.c (trace_prepre, trace_pre): Adjust callers.
931 (m4_arg_print): New function.
932 * m4/symtab.c (m4_symbol_value_print): Update signature.
933 (m4_symbol_print): Update caller.
934 * m4/output.c (m4_shipout_string_trunc): Update comments.
935 * m4/syntax.c (set_quote_age): Require comma as argument separator
936 when dealing with $@ as a unit.
937 * tests/builtins.at (ifelse): Augment test.
938 * doc/m4.texinfo (Changesyntax): Document changesyntax deficiency.
940 2008-01-31 Eric Blake <ebb9@byu.net>
942 Kill hack for M4 1.4.4.
943 * configure.ac (AM_GNU_GETTEXT_INTL_SUBDIR): Delete, now that
944 we require new enough autoconf which in turn requires M4 1.4.5.
946 2008-01-31 Gary V. Vaughan <gary@gnu.org>
947 and Eric Blake <ebb9@byu.net>
949 Depend on new libtool to use non-recursive build.
950 * configure.ac (LT_PREREQ): Bump to alpha release version.
951 (LTDL_INIT): Choose nonrecursive mode. Perform sanity check that
952 installed libtool has correct symbols.
953 * Makefile.am (SUBDIRS): Drop ltdl, now that it is built from the
955 (AM_CPPFLAGS): Drop directories covered by libtool.
956 (AM_LDFLAGS): Drop -no-undefined, covered by libtool.
957 (include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
958 macros, used by libtool.
959 (lib_LTLIBRARIES): Also used by libtool.
960 (ltdl/libltdlc.la): Delete, now that libtool does this.
961 * bootstrap: Mention new requirements.
962 (LIBTOOLIZE): Provide default program, and run libtoolize prior to
964 (autoreconf): Also neutralize libtoolize, since it is run early.
965 * HACKING: Mention updated prerequisites.
967 2008-01-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
969 Fix build failure if installed libltdl is used.
970 * Makefile.am (m4_libm4_la_DEPENDENCIES): Use $(LTDLDEPS).
972 2008-01-28 Eric Blake <ebb9@byu.net>
974 Depend on newer autoconf, for testsuite -C dir.
975 * Makefile.am (CD_TESTDIR): Delete, no longer required.
976 (check-local, installcheck-local, clean-local-tests): Use new -C
977 option from autotest.
978 * configure.ac (AC_PREREQ): Bump to 2.61a.347.
979 * bootstrap: Mention new dependency.
982 2008-01-27 Eric Blake <ebb9@byu.net>
984 Stage 13: push composite text tokens.
985 Support pushing composite tokens, allowing back-references to be
986 reused through multiple macro expansions. Add hueristic that
987 avoids creating new reference when pushing existing references.
988 Memory impact: noticeable improvement due to better reference
989 reuse, except for O(n) to O(n^2) copying in boxed recursion.
990 Speed impact: slight penalty, due to more bookkeeping.
991 * m4/m4private.h (m4__push_symbol): Adjust prototype.
992 * m4/input.c (m4__push_symbol): Add parameter, and support
994 (append_quote_token): Add parameter, and support inlining of short
996 (m4__next_token): Adjust caller.
997 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
999 2008-01-26 Eric Blake <ebb9@byu.net>
1001 Stage 12c: add macro for m4_arg_len.
1002 Make a common action easier to type.
1003 Memory impact: none.
1005 * m4/m4module.h (M4ARGLEN): New macro.
1006 * m4/macro.c (process_macro): Adjust all callers.
1007 * m4/utility.c (m4_dump_args): Likewise.
1008 * modules/m4.c (divert, maketemp, mkstemp, m4wrap, len, index)
1010 * modules/gnu.c (builtin, indir, mkdtemp, patsubst, regexp)
1011 (renamesyms): Likewise.
1012 * modules/stdlib.c (setenv): Likewise.
1014 Stage 12b: add m4_string_pair.
1015 Make passing quote delimiters around more efficient.
1016 Memory impact: none.
1017 Speed impact: slight penalty, due to more bookkeeping.
1018 * m4/m4module.h (m4_string_pair): New type.
1019 (m4_get_syntax_quotes, m4_get_syntax_comments): New prototypes.
1020 (m4_symbol_value_print, m4_symbol_print, m4_shipout_string_trunc):
1022 * m4/m4private.h (struct m4_string): Delete.
1023 (struct m4_syntax_table): Combine quote and comment members.
1024 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
1025 (m4_get_syntax_ecomm): Adjust accessors.
1026 (m4_get_syntax_quotes, m4_get_syntax_comments): New fast
1028 * m4/symtab.c (m4_symbol_value_print, m4_symbol_print):
1030 * m4/input.c (string_print, composite_print, m4_input_print):
1031 All callers updated.
1032 * m4/syntax.c (m4_syntax_delete, m4_set_syntax)
1033 (check_is_single_quotes, m4_set_quotes, set_quote_age)
1034 (m4_get_syntax_lquote, m4_get_syntax_rquote)
1035 (m4_get_syntax_quotes, check_is_single_comments, m4_set_comment)
1036 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
1037 (m4_get_syntax_comments): Likewise.
1038 * m4/macro.c (trace_prepre, trace_pre, m4_push_args): Likewise.
1039 * m4/output.c (m4_shipout_string, m4_shipout_string_trunc):
1041 * modules/m4.c (dumpdef, m4_make_temp): Likewise.
1042 * src/freeze.c (produce_frozen_state): Likewise.
1043 * tests/freeze.at (reloading unknown builtin): Update test.
1045 Stage 12a: make m4_symbol_chain a union.
1046 Shrink size of symbol chains by using a union.
1047 Memory impact: slight improvement, due to smaller struct.
1048 Speed impact: slight improvement, due to less bookkeeping.
1049 * m4/m4private.h (enum m4__symbol_chain_type): New enum.
1050 (struct m4_symbol_chain): Rename...
1051 (struct m4__symbol_chain): ...to this, since it is internal.
1052 * m4/symtab.c (m4_symbol_value_copy, m4_symbol_value_print): All
1054 * m4/input.c (struct m4_input_block, m4__push_symbol)
1055 (composite_peek, composite_read, composite_unget)
1056 (composite_clean, composite_print, m4__make_text_link)
1057 (append_quote_token): Likewise.
1058 * m4/macro.c (expand_macro, arg_mark, m4_arg_symbol, m4_arg_text)
1059 (m4_arg_equal, m4_arg_len, m4_make_argv_ref, m4_push_arg)
1060 (m4_push_args): Likewise.
1062 2008-01-23 Eric Blake <ebb9@byu.net>
1064 Adjust to recent libtool interface change.
1065 * configure.ac (LT_PREREQ): Require bleeding-edge libtool.
1066 (LT_WITH_LTDL): Delete, now that it is obsolete.
1067 (LTDL_INIT): Use new libtool macro.
1069 2008-01-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1070 and Eric Blake <ebb9@byu.net>
1072 Rely on newer automake.
1073 * configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1, and add lzma
1075 * bootstrap: Update automake requirement.
1076 (func_version): Fix --version output, broken since 2007-08-06.
1077 * HACKING: Likewise. Add lzma requirement.
1078 * Makefile.am (clean-local-src): Not needed any more with newest
1080 (clean-local): Adjust.
1081 * TODO: Remove completed item.
1083 2008-01-22 Eric Blake <ebb9@byu.net>
1086 * doc/m4.texinfo (Renamesyms): Avoid underfull hbox, and improve
1089 2008-01-21 Eric Blake <ebb9@byu.net>
1091 Stage 11: full circle for single argument references.
1092 Pass quoted strings through to argument collection in a single
1093 action, so that an argument can be reused throughout macro
1094 recursion if it remains unchanged.
1095 Memory impact: noticeable improvement, due to more reuse in
1096 argument collection stacks; O(n^2) to O(n) on boxed recursion.
1097 Speed impact: noticeable improvement, due to less copying.
1098 * m4/m4module.h (m4_arg_text): Add parameter.
1100 * m4/m4private.h (CHAR_QUOTE): New input engine sentinel.
1101 (m4__make_text_link): New prototype.
1102 (struct m4_symbol_chain): Add quote_age member.
1103 (struct m4_symbol_value): Add end member to chained symbol.
1104 (struct m4_macro_args): Add wrapper member.
1105 * m4/symtab.c (m4_symbol_value_print): Print composite tokens.
1106 (m4_symbol_value_copy, m4_symbol_value_delete): Recognize
1108 * m4/input.c (make_text_link): Rename...
1109 (m4__make_text_link): ...to this, and export.
1110 (m4_push_string_finish): Adjust caller.
1111 (make_text_link, m4__push_symbol): Update new field.
1112 (file_read, builtin_read, string_read, composite_read, next_char):
1114 (m4_skip_line, match_input, consume_syntax): Adjust callers.
1115 (append_quote_token): New function.
1116 (m4__next_token): Pass quoted strings onto argument collection.
1117 (m4_print_token) [DEBUG_INPUT]: Update.
1118 * m4/macro.c (expand_argument): Collect composite arguments.
1119 (collect_arguments): Update new field.
1120 (expand_macro): Reduce ref-count of back-references after use.
1121 (arg_mark, m4_arg_symbol, m4_make_argv_ref): Adjust to new member
1123 (m4_is_arg_text): Also recognize composite symbols as text.
1124 (m4_arg_text, m4_arg_len): Merge composite symbols as needed.
1125 (m4_arg_equal): Compare composite symbols.
1126 (m4_push_arg, m4_push_args): Handle composite symbols.
1127 (m4_arg_symbol): Relax assertion.
1128 (process_macro): Use single-argument references.
1129 * m4/output.c (m4_shipout_string_trunc): Update comment.
1130 * tests/macros.at (Rescanning macros): Augment test.
1132 2008-01-16 Eric Blake <ebb9@byu.net>
1134 Stage 10: avoid extra copying of strings and comments.
1135 When collecting tokens that are immune to further expansion, avoid
1136 copying data from one obstack to another by outputting it into the
1137 destination obstack to begin with. Also reduce copying done in
1139 Memory impact: slight improvement, due to better obstack usage.
1140 Speed impact: noticeable improvement, due less data copying.
1141 * ltdl/m4/gnulib-cache.m4: Import intprops and vasnprintf-posix
1143 * m4/m4private.h (m4__token_type): Adjust prototype.
1144 * m4/input.c (m4__next_token): Support new parameter.
1145 * m4/macro.c (m4_macro_expand_input, expand_token)
1146 (expand_argument, collect_arguments): Adjust callers.
1147 * modules/m4.c (ntoa): Tighten buffer size.
1148 * m4/output.c (m4_tmpname): Guarantee no buffer overflow.
1149 * modules/format.c (arg_int, arg_long, arg_double): New helper
1150 functions, to detect overflow or unparsed characters.
1151 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Adjust to check for
1152 missing or excess arguments.
1153 (format): Likewise, and also output directly into obstack if there
1155 * doc/m4.texinfo (History): Update for new year.
1156 (Format): Test for new warnings.
1158 2008-01-15 Eric Blake <ebb9@byu.net>
1160 * TODO: Update with some newer URLs.
1162 Verify linear `index'.
1163 * tests/builtins.at (index): New test.
1164 (translit): Make test take longer, to make quadratic algorithms
1167 2007-12-20 Eric Blake <ebb9@byu.net>
1169 Stage 9: share rather than copy single-arg refs.
1170 Use hooks of previous patch to create back-references to arguments
1171 in the input engine, and inline short text rather than always
1172 creating a FIFO link. Also start testing embedded NUL behavior.
1173 Until the argument collection engine also shares references, the
1174 memory usage increases.
1175 Memory impact: noticeable penalty, due to longer life of argv
1176 changing O(n) to O(n^2) on boxed recursion.
1177 Speed impact: slight improvement, due less data copying.
1178 * ltdl/m4/gnulib-cache.m4: Import memmem and quote modules.
1179 * m4/m4module.h (m4_arg_scratch): New prototype.
1180 * m4/m4private.h (m4__push_symbol): Add parameter.
1181 (m4_arg_scratch): Add fast accessor.
1182 (struct m4): Add expansion_level member, taken...
1183 * m4/macro.c (expansion_level): ...from here. Adjust all users.
1184 (expand_argument): Minor cleanup.
1185 (expand_macro): Track scratch space per macro call.
1186 (m4_arg_scratch): New function.
1187 (m4_make_argv_ref): Call new function.
1188 (m4_push_arg): Push reference to $0.
1189 (m4_push_args): Rework separator usage, since separators will
1191 (process_macro): Allow embedded NUL.
1192 * m4/input.c (INPUT_INLINE_THRESHOLD): New define.
1193 (m4__push_symbol): Add parameter. Inline short strings, and save
1194 references through rescanning.
1195 * m4/symtab.c (m4_set_symbol_value_text): Weaken assertion.
1196 * modules/m4.c (errprint, index): Handle NUL transparently.
1197 (dumpdef, translit): Use scratch space, rather than expansion
1199 * modules/gnu.c (renamesyms, m4symbols): Likewise.
1200 * tests/others.at (nul character): New test.
1201 (iso8859): Quote absolute file name, remove XFAIL.
1202 * tests/iso8859.m4: Avoid raw NUL in output.
1203 * tests/null.m4: New file.
1204 * tests/null.out: Likewise.
1205 * tests/null.err: Likewise.
1206 * Makefile.am (OTHER_FILES): Distribute new files.
1207 * .gitattributes: Treat new files as text.
1209 2007-12-17 Eric Blake <ebb9@byu.net>
1211 Stage 8: extend life of references into argv.
1212 Add hooks to lengthen the lifetime of arguments reused in a macro
1213 expansion, rather than always discarding arguments at the end of
1214 expand_macro. Rework the expand_macro obstacks to handle longer
1215 lifetimes. For now, the hooks remain unused.
1216 Memory impact: slight penalty, due to larger structs.
1217 Speed impact: slight penalty, due to more bookkeeping.
1218 * m4/system_.h (obstack_regrow): Delete.
1219 * m4/m4private.h (struct m4_symbol_chain): Add level field.
1220 (m4__push_symbol): Adjust prototype.
1221 (m4__adjust_refcount): New prototype.
1222 (DEBUG_MACRO) [DEBUG]: New debug control.
1223 (struct m4__macro_arg_stacks): New structure.
1224 (struct m4): Add arg_stacks, stacks_count fields.
1225 * m4/m4module.h (m4_make_argv_ref): Add parameter.
1226 * m4/macro.c (argc_stack, argv_stack): Delete, replaced by
1227 context->arg_stacks.
1228 (m4_macro_expand_input) [DEBUG_MACRO]: Add debug hooks,
1229 conditional on M4_DEBUG_MACRO envvar.
1230 (collect_arguments): Adjust signature.
1231 (expand_macro): Rework obstack handling.
1232 (m4__adjust_refcount, arg_mark): New functions.
1233 (m4_make_argv_ref): Populate new field.
1234 (m4_push_arg, m4_push_args): Track inuse.
1235 (process_macro): One less cast.
1236 * m4/m4.c (m4_delete): Clean up arg_stacks.
1237 * m4/input.c (make_text_link): Use new field.
1238 (m4__push_symbol, file_clean): Update signature.
1239 (composite_read): Bump refcount when done with reference.
1240 (composite_clean): New function.
1241 (pop_input): Adjust caller.
1242 * m4/debug.c (m4_debug_message): Make assertion match comment.
1243 * modules/gnu.c (builtin, indir): Adjust callers.
1244 * tests/builtins.at (ifelse): New test.
1245 (exp): Move and rename...
1246 * tests/others.at (countdown): ...to this.
1247 * doc/m4.texinfo (Improved foreach): Fix tracing usage in
1250 2007-12-13 Eric Blake <ebb9@byu.net>
1253 * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
1258 2007-12-13 Paolo Bonzini <bonzini@gnu.org> (tiny change)
1260 * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
1262 Reported by Giovanni Toffetti.
1264 2007-12-11 Eric Blake <ebb9@byu.net>
1266 Stage 7: use chained input support in input parser.
1267 Allow the LIFO input engine to rescan a macro expansion composed
1268 of smaller chunks of FIFO data, rather than the old approach of a
1269 monolithic string. For now, all chunks are still copied.
1270 Memory impact: slight penalty, due to FIFO chain overhead.
1271 Speed impact: slight penalty, due to extra bookkeeping.
1272 * m4/m4private.h (m4__push_symbol): New prototype.
1273 (struct m4_symbol_chain): Add const-safety.
1274 * m4/symtab.c (m4_symbol_value_print): Simplify.
1275 (dump_symbol_CB): Update caller.
1276 * m4/input.c (struct m4_input_block): Alter u_c member, first
1277 introduced 2006-10-25, but unused until now.
1278 (composite_peek, composite_read, composite_unget)
1279 (composite_print, init_builtin_token): Rewrite accordingly.
1280 (m4_push_wrapup): No longer need trailing NUL.
1281 (m4__push_symbol, make_text_link): New functions.
1282 (m4_push_string_finish): Use them.
1283 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
1284 (expand_macro): Simplify logic of nesting_limit.
1285 * src/main.c (main): Likewise.
1286 * doc/m4.texinfo (Dumpdef): Augment test.
1288 2007-12-08 Eric Blake <ebb9@byu.net>
1290 Stage 6: convert builtins to push arg at a time.
1291 Add new methods to factor all builtins whose expansion includes an
1292 argument, making back-reference creation easier in future patches.
1293 Factor out length-limited printing to obstacks, and use -1 rather
1294 than 0 for unlimited length.
1295 Memory impact: none.
1296 Speed impact: slight improvement, due to better code sharing.
1297 * m4/m4module.h (m4_shipout_text): Rename...
1298 (m4_divert_text): ...to this, to avoid confusion with m4_shipout_*
1299 that does not worry about sync lines.
1300 (m4_shipout_string_trunc): New prototype.
1301 * m4/output.c (m4_shipout_text): Rename...
1302 (m4_divert_text): ...to this.
1303 (m4_shipout_string): Move guts...
1304 (m4_shipout_string_trunc): ...to this new function.
1305 * m4/macro.c (m4_push_arg, m4_push_args): New functions.
1306 (expand_token, process_macro): Update callers.
1307 * m4/input.c (string_print): Likewise.
1308 * modules/m4.c (ifdef, ifelse, shift, substr, translit, divert):
1310 * modules/gnu.c (patsubst): Likewise.
1311 (debuglen): Use SIZE_MAX for unlimited debug length.
1312 * src/main.c (main): Likewise.
1313 * m4/m4.c (m4_create): Default max_debug_length to SIZE_MAX, not
1316 2007-12-07 Eric Blake <ebb9@byu.net>
1318 Minor security fix: Quote output of mkstemp.
1319 * modules/m4.c (m4_make_temp): Produce quoted output.
1320 * doc/m4.texinfo (Mkstemp, Mkdtemp): Update the documentation and
1323 Stage 5: add notion of quote age.
1324 Cache the quoting rules that were in effect when a string was
1325 parsed, to avoid reparsing that string if no changequote or other
1326 quote age change took place in the meantime. A quote_age of 0 is
1327 always safe, but does not benefit from caching.
1328 Memory impact: slight improvement, due to smaller struct in input
1330 Speed impact: slight penalty, due to more bookkeeping.
1331 * m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
1332 (m4_set_symbol_value_text): Adjust prototype.
1333 (m4_has_syntax): Factor out the unsigned char cast.
1334 * m4/m4private.h (struct m4_syntax_table): Add syntax_age and
1336 (m4__quote_age, m4__safe_quotes): New accessor macros, no need for
1337 functions at this point.
1338 (struct m4_symbol_value, struct m4_macro_args): Add quote_age
1340 (m4_set_symbol_value_text): Adjust fast accessor.
1341 (m4_get_symbol_value_quote_age): New fast accessor.
1342 * m4/symtab.c (m4_set_symbol_value_text): Add parameter.
1343 (m4_get_symbol_value_quote_age): New function.
1344 (m4_symbol_value_copy): Adjust callers.
1345 * m4/macro.c (expand_token): Add parameter, and track quote age.
1346 (expand_argument, collect_arguments): Track quote age.
1347 (m4_macro_expand_input, process_macro, m4_make_argv_ref)
1348 (m4_macro_expand_input): Update callers.
1349 (m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
1350 * m4/input.c: Comment cleanups.
1351 (struct m4_input_block): Reduce size.
1352 (m4__next_token): Report quote age.
1353 (m4_push_builtin, init_builtin_token): Update callers.
1354 * m4/utility.c (skip_space): Adjust callers.
1355 * m4/module.c (install_macro_table): Likewise.
1356 * m4/syntax.c (m4_set_syntax): Initialize and update quote age.
1357 (m4_set_quotes, m4_set_comment): Detect no-op changes, and update
1359 (set_quote_age): New helper function.
1360 (check_is_single_quotes, check_is_single_comments): Adjust
1362 * src/freeze.c (reload_frozen_state): Likewise.
1363 * src/main.c (main): Likewise.
1364 * modules/m4.c (define, pushdef): No need to set macro text.
1365 * tests/builtins.at (changequote, defn): New tests.
1366 * examples/wrapfifo.m4: New file.
1367 * examples/wraplifo.m4: New file.
1368 * Makefile.am (dist_pkgdata_DATA): Distribute new examples.
1370 2007-12-04 Eric Blake <ebb9@byu.net>
1372 Fix builds with OpenBSD make.
1373 * Makefile.am (HELP2MAN): New macro.
1374 (dist_man_MANS, doc/m4.1): Fix rules for building m4.1 into
1376 * README: Update copyright.
1377 * HACKING: Mention help2man and makeinfo dependencies.
1379 2007-11-29 Eric Blake <ebb9@byu.net>
1381 Stage 4: route indir, builtin through ref; make argv opaque.
1382 Finish making struct opaque to all but the input engine, by
1383 reworking obstack usage in expand_macro to better support creation
1384 of a $@ reference. Canonicalize the empty argument, to allow
1385 pointer comparison optimizations.
1386 Memory impact: slight penalty, due to larger struct.
1387 Speed impact: slight improvement, due to fewer function calls.
1388 * m4/system_.h (obstack_regrow): Fix precedence.
1389 * m4/m4module.h (m4_arg_equal, m4_arg_empty, m4_make_argv_ref):
1391 (struct m4_macro_args): Move...
1392 * m4/m4private.h (struct m4_macro_args): ...here, making it opaque
1393 to modules. Add has_ref member.
1394 (bool_bitfield): New helper typedef.
1395 (struct m4_symbol_chain): Add flatten and len members.
1396 * m4/macro.c (empty_symbol): New placeholder, for optimizing
1397 comparison with empty string.
1398 (m4_macro_expand_input): Initialize it.
1399 (collect_arguments): Alter signature, and populate new fields.
1400 (trace_pre, trace_post): Remove redundant parameter.
1401 (expand_macro): Alter handling of obstacks.
1402 (m4_arg_symbol): Account for wrapped argv.
1403 (m4_arg_equal, m4_arg_empty, m4_make_argv_ref): New methods.
1404 (m4_arg_text, m4_arg_len, m4_arg_func): Use new methods.
1405 * modules/m4.c (ifelse, syscmd): Likewise.
1406 * modules/evalparse.c (m4_evaluate): Likewise.
1407 (undefine, popdef, m4_dump_symbols): Optimize.
1408 * modules/gnu.c (builtin, indir, esyscmd, debugfile): Use new
1410 (changesyntax, regexp): Optimize.
1411 * m4/output.c (diversion_storage): Use typedef.
1413 Stage 3b: cache length, rather than computing it, in modules.
1414 Use cached token length in builtins and output engine.
1415 Memory impact: none.
1416 Speed impact: noticeable improvement, due to fewer function calls.
1417 * m4/hash.c (m4_hash_remove): Avoid double free on remove
1419 * m4/output.c (m4_shipout_string): Change semantics of len param.
1420 (m4_shipout_int): Use cached length.
1421 * m4/input.c (m4_push_string_finish): Likewise.
1422 * modules/m4.h (m4_make_temp_func): Add parameter.
1423 * m4/macro.c (expand_token, m4_arg_len): Use cached length.
1424 (collect_arguments, expand_macro): Alter signature.
1425 (trace_format): Don't use out-of-scope buffer.
1426 (process_macro): All callers changed.
1427 * m4/utility.c (m4_dump_args): Likewise.
1428 * m4/symtab.c (m4_symbol_value_print): Likewise.
1429 * modules/gnu.c (__file__, __program__, builtin, indir)
1430 (m4symbols, mkdtemp, regexp_compile, regexp_substitute,
1431 renamesyms, patsubst, regexp, regexp_compile): Likewise.
1432 * modules/load.c (m4modules): Likewise.
1433 * modules/m4.c (defn, m4wrap, maketemp, m4_make_temp)
1434 (numb_obstack, ifdef, ifelse, divert, len, substr): Likewise.
1435 * modules/perl.c (perleval): Likewise.
1436 * modules/stdlib.c (getcwd, getenv, getlogin, getpwnam, getpwuid)
1437 (hostname, uname, setenv): Likewise.
1438 * modules/mpeval.c (numb_obstack): Likewise.
1439 * src/freeze.c (dump_symbol_CB): Likewise.
1440 * doc/m4.texinfo (Renamesyms, Dumpdef, Changesyntax): Adjust test.
1441 * tests/builtins.at (mkstemp): Likewise.
1442 * tests/others.at (iso8859): XFAIL this test, now that
1443 length-based handling allows NUL through part but not all of M4.
1445 2007-11-28 Eric Blake <ebb9@byu.net>
1447 Stage 3a: cache length, rather than computing it, in libm4.
1448 Cache the length of a token in the input engine and symbol table,
1449 to avoid repeating lots of strlen calls. Additionally, by using
1450 obstack length rather than strlen, the input engine can now
1451 support embedded NUL.
1452 Memory impact: slight penalty, due to larger struct.
1453 Speed impact: slight improvement, due to fewer function calls.
1454 * m4/m4module.h (struct m4_macro_args): Cache length.
1455 (m4_get_symbol_len, m4_get_symbol_value_len): New accessors.
1456 (m4_set_symbol_value_text): Change signature.
1457 * m4/m4private.h (struct m4_symbol_value): Store string length.
1458 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
1459 (m4_set_symbol_value_placeholder): Update accordingly.
1460 (m4_set_symbol_value_text): Change signature.
1461 (m4_get_symbol_value_len): New accessor.
1462 * m4/input.c (struct m4_input_block, string_peek, string_read)
1463 (string_unget, string_print, m4_push_string_finish)
1464 (m4_push_wrapup): Track length of string input.
1465 (m4__next_token): Adjust all users of symbol text to track length,
1467 * m4/macro.c (expand_argument, collect_arguments): Likewise.
1468 * m4/module.c (install_macro_table): Likewise.
1469 * modules/gnu.c (builtin, indir): Likewise.
1470 * modules/m4.c (define, pushdef): Likewise.
1471 * src/main.c (main): Likewise.
1472 * src/freeze.c (reload_frozen_state): Likewise.
1473 * m4/symtab.c (m4_symbol_value_copy): Likewise.
1474 (m4_get_symbol_value_len): New function.
1475 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
1476 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
1477 Adjust implementation.
1479 2007-11-27 Eric Blake <ebb9@byu.net>
1481 Stage 2: use accessors, not direct reference, into argv.
1482 Outside of macro.c, use accessor methods rather than direct access
1483 into the argv struct.
1484 Memory impact: none.
1485 Speed impact: slight penalty, due to increased function calls.
1486 * m4/m4private.h (m4_arg_argc): New fast accessor.
1487 * m4/m4module.h (m4_arg_argc, m4_arg_symbol, m4_is_arg_text)
1488 (m4_is_arg_func, m4_arg_text, m4_arg_len, m4_arg_func): New
1490 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
1491 (m4_macro_call): Make argc unsigned.
1492 (M4ARG): Use new accessors.
1493 * modules/m4.c (define, pushdef): Likewise.
1494 (undefine, popdef, ifelse, m4_dump_symbols, defn, undivert)
1495 (traceon, traceoff): Make argc unsigned.
1496 * modules/m4.h (m4_dump_symbols_func): Likewise.
1497 * modules/evalparse.c (m4_evaluate): Likewise.
1498 * modules/gnu.c (builtin, indir): Use new accessors.
1499 (changesyntax): Make argc unsigned.
1500 * modules/perl.c (perleval): Likewise.
1501 * m4/utility.c (m4_dump_args): Use new accessors.
1502 * m4/macro.c (trace_pre): Likewise.
1503 (m4_arg_symbol, m4_arg_argc, m4_is_arg_text, m4_is_arg_func)
1504 (m4_arg_text, m4_arg_len, m4_arg_func): New functions.
1505 (expand_macro, trace_pre, trace_post, m4_macro_call): Update argc
1508 2007-11-24 Eric Blake <ebb9@byu.net>
1510 Stage 1: convert m4_symbol_value** into new object.
1511 Pass a variable-size wrapper structure instead of an array to
1512 builtins, so that subsequent optimizations in the structure need
1513 not impact every builtin client.
1514 Memory impact: slight penalty, since struct is larger than array.
1515 Speed impact: slight penalty, due to increased bookkeeping.
1516 * ltdl/m4/gnulib-cache.m4: Import flexmember module.
1517 * m4/m4module.h (m4_macro_args): New type, will be opaque to
1519 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
1520 (m4_macro_call): Alter signature to use m4_macro_args object.
1521 (M4ARG): Redefine to access new struct.
1522 * m4/m4private.h (M4_SYMBOL_COMP): New enumerator.
1523 (struct m4_symbol_chain): New type.
1524 (struct m4_symbol_value): Add chain alternative.
1525 * m4/macro.c (collect_arguments): Build new struct.
1526 (expand_macro, m4_macro_call, process_macro, trace_pre)
1527 (trace_post): Adjust implementation to use it.
1528 * m4/utility.c (m4_dump_args): Likewise.
1529 * modules/gnu.c (builtin, indir): Likewise.
1530 * modules/format.c (format): Likewise.
1531 * modules/m4.h (m4_dump_symbols_func): Likewise.
1532 * modules/m4.c (m4_dump_symbols, define, pushdef, defn, ifelse)
1533 (shift, include, errprint, m4wrap): Likewise.
1534 * modules/evalparse.c (m4_evaluate): Likewise.
1536 Pass only macro name to utility functions.
1537 * m4/m4module.h (m4_bad_argc, m4_numeric_arg): Adjust signature.
1538 * m4/utility.c (m4_bad_argc, m4_numeric_arg): Adjust
1540 * m4/macro.c (m4_macro_call): Adjust callers.
1541 * modules/gnu.c (builtin, debuglen): Likewise.
1542 * modules/m4.c (ifelse, incr, decr, divert, undivert, m4exit)
1544 * modules/evalparse.c (m4_evaluate): Likewise.
1545 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
1546 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
1549 2007-11-23 Eric Blake <ebb9@byu.net>
1551 Add macro name to debugfile messages.
1552 * m4/m4module.h (m4_debug_set_output): Add parameter.
1553 * m4/debug.c (m4_debug_set_output, set_debug_file): Pass macro
1555 * modules/gnu.c (debugfile): Adjust caller.
1556 * modules/m4.c (m4exit): Likewise.
1557 * src/main.c (main): Likewise.
1559 Factor out handling of macro name in error messages.
1560 * m4/m4module.h (m4_error, m4_error_at_line, m4_warn)
1561 (m4_warn_at_line): Add new parameter.
1562 * m4/utility.c (m4_verror_at_line): New helper method.
1563 (m4_error, m4_error_at_line, m4_warn, m4_warn_at_line): Add new
1565 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg): All callers
1567 * m4/debug.c: Likewise.
1568 * m4/input.c: Likewise.
1569 * m4/macro.c: Likewise.
1570 * m4/module.c: Likewise.
1571 * m4/output.c: Likewise.
1572 * m4/path.c: Likewise.
1573 * modules/evalparse.c: Likewise.
1574 * modules/format.c: Likewise.
1575 * modules/gnu.c: Likewise.
1576 * modules/load.c: Likewise.
1577 * modules/m4.c: Likewise.
1578 * modules/mpeval.c: Likewise.
1579 * src/freeze.c: Likewise.
1580 * src/main.c: Likewise.
1582 2007-11-14 Eric Blake <ebb9@byu.net>
1584 Handle some defn corner cases differently.
1585 * doc/m4.texinfo (Defn): Update documentation; although this still
1586 doesn't match the branch, since it may be changed before 2.0.
1587 * m4/macro.c (expand_argument): Consistently ignore builtins in
1588 concatenation contexts.
1589 * m4/m4private.h (m4__symbol_type): Fix C89 compliance bug.
1591 2007-11-13 Eric Blake <ebb9@byu.net>
1593 Note: Patches titled Stage 0 through N form a series of patches
1594 which decreases the algorithmic complexity of tail recursion in
1595 macro expansions from O(n^2) to O(n) in both time and memory, then
1596 performs cleanups, such as handling of embedded NUL, made easier
1597 by the code refactoring.
1599 Stage 0: Fix memory leak in tail recursion.
1600 Free expansion text in the input engine as soon as it is parsed,
1601 rather than when the recursive expansion completes.
1602 Memory impact: noticeable improvement, due to reduction from
1603 O(n^2) to O(n) on recursion.
1604 Speed impact: minor improvement, due to better memory usage.
1605 * m4/input.c (pop_input): Add flag parameter and return type.
1606 (next_char): Adjust caller.
1607 (m4_push_string_init): Let go of memory earlier.
1609 2007-11-07 Eric Blake <ebb9@byu.net>
1611 * tests/macros.at (Rescanning macros): Test more corner cases.
1613 2007-11-06 Eric Blake <ebb9@byu.net>
1615 * build-aux/mkstamp: Rename from ltdl/config/mkstamp.
1617 * Makefile.am (tests/package.m4): Work around bash bug.
1618 Reported by Ralf Wildenhues.
1620 2007-11-05 Eric Blake <ebb9@byu.net>
1622 For consistency with other GNU projects, use build-aux directory.
1623 * configure.ac (AC_CONFIG_AUX_DIR): Change ltdl/config to
1625 * bootstrap (config_aux_dir): Likewise.
1626 * Makefile.am (config_aux_dir): Likewise.
1627 * ltdl/m4/gnulib-cache.m4: Use --aux-dir option.
1629 2007-11-02 Eric Blake <ebb9@byu.net>
1631 Update some documentation about version control.
1632 * NEWS: M4 is now stored in git.
1633 * HACKING: Likewise.
1635 * bootstrap: Likewise.
1636 * commit: Delete, now that CVS commits are no longer necessary.
1637 * ltdl/config/mailnotify: No longer necessary; git's patch
1638 generation and mail capability is more powerful.
1640 Update to recent gnulib changes.
1641 * ltdl/m4/gnulib-cache.m4: Replace fprintf-posix, vasprintf-posix,
1642 xprintf, and xvasprintf with xprintf-posix and xvasprintf-posix.
1644 2007-11-01 Eric Blake <ebb9@byu.net>
1646 Improve error message when early end of file occurs.
1647 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
1648 (M4wrap): Adjust to new messages.
1649 (Improved capitalize): Enhance test.
1650 * m4/m4private.h (m4__next_token): Adjust prototype.
1651 * m4/input.c (m4__next_token): Add new parameter, and improve
1653 * m4/macro.c (m4_macro_expand_input, collect_arguments): Adjust
1655 (expand_argument): Likewise, and add parameter.
1657 2007-10-31 Eric Blake <ebb9@byu.net>
1659 Test more corner cases.
1660 * tests/macros.at (Rescanning macros): Beef up test.
1661 * doc/m4.texinfo (Changecom): Beef up test.
1662 (Improved foreach): Document alternate foreachq style.
1663 * examples/foreachq3.m4: New file.
1664 * examples/loop.m4: New file.
1665 * Makefile.am (dist_pkgdata_DATA): Distribute them.
1667 2007-10-28 Eric Blake <ebb9@byu.net>
1669 More test coverage for autoconf usage patterns.
1670 * doc/m4.texinfo (Shift): Document cond macro, and add new test.
1671 * tests/macros.at (Rescanning macros): New test.
1672 * tests/builtins.at (include): Augment test.
1674 2007-10-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1676 * Makefile.am: Adjust getopt handling to latest gnulib layout.
1678 2007-10-27 Eric Blake <ebb9@byu.net>
1680 Document one use of changequote(`(',`)').
1681 * doc/m4.texinfo (Changequote): Add new test, based on recent
1682 autoconf addition of m4_expand.
1684 2007-10-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1686 * Makefile.am (dist_pkgdata_DATA): Add examples/capitalize2.m4.
1688 2007-10-22 Eric Blake <ebb9@byu.net>
1690 Never let printf failures go undetected.
1691 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1693 * m4/system_.h: Include xprintf.h.
1694 * m4/debug.c (m4_debug_message_prefix, m4_debug_message): Wrap all
1695 use of printf, xprintf.
1696 * m4/input.c [DEBUG_INPUT]: Likewise.
1697 * m4/module.c [DEBUG_MODULES]: Likewise.
1698 * m4/output.c (m4_shipout_text, m4_shipout_int)
1699 (m4_freeze_diversions): Likewise.
1700 * m4/path.c [DEBUG_INCL]: Likewise.
1701 * m4/symtab.c [DEBUG_SYM]: Likewise.
1702 * m4/syntax.c [DEBUG_SYNTAX]: Likewise.
1703 * modules/modtest.c (export_test): Likewise.
1704 * src/freeze.c (produce_resyntax_dump, produce_syntax_dump)
1705 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
1707 * src/main.c (usage): Likewise.
1708 * po/POTFILES.in: Adjust to new file.
1709 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
1711 2007-10-18 Eric Blake <ebb9@byu.net>
1713 Fix 'm4 -F file -t undefined'.
1714 * src/freeze.c (produce_symbol_dump): Skip trace placeholders.
1715 * src/freeze.c (dump_symbol_CB): Also skip void symbols.
1716 * tests/freeze.at (reloading unknown builtin): Test for this bug.
1717 * m4/m4module.h (m4_symtab_apply): Add parameter.
1718 * m4/symtab.c (m4_symtab_apply): Ignore trace placeholders when
1720 (m4_symtab_delete, symtab_dump): Adjust callers.
1721 * modules/m4.c (m4_dump_symbols): Likewise.
1723 2007-10-09 Eric Blake <ebb9@byu.net>
1725 Fix regexp regression of 2007-09-29.
1726 * modules/gnu.c (substitute): Allow NULL buf when no
1727 subexpressions were present.
1728 (regexp): Handle \ escapes even with empty regex.
1729 * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
1731 Cache regex compilation for another autoconf speedup.
1732 * modules/gnu.c (gnu_buf): Replace...
1733 (REGEX_CACHE_SIZE, regex_cache): ...with new declarations.
1734 (m4_pattern_buffer): Add fields.
1735 (m4_regexp_compile): Rename...
1736 (regexp_compile): ...to this, and drop no_sub parameter.
1738 (M4FINISH_HANDLER): Clean up entire cache.
1739 (m4_regexp_search): Rename...
1740 (regex_search): ...to this, adjust to new struct contents, and add
1742 (m4_regexp_substitute): Rename...
1743 (regexp_substitute): ...to this.
1744 (substitute, patsubst, regexp, renamesyms): Adjust callers.
1746 2007-10-02 Eric Blake <ebb9@byu.net>
1748 Document quoting pitfalls in capitalize.
1749 * doc/m4.texinfo (Patsubst): Use the examples directory. Also
1751 (Improved capitalize): New node.
1752 * examples/capitalize.m4: Update to match manual.
1753 * examples/capitalize2.m4: New file.
1755 2007-10-01 Eric Blake <ebb9@byu.net>
1757 Another Autoconf usage pattern optimization.
1758 * modules/m4.c (m4_index): Optimize search for one byte.
1759 * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
1762 2007-09-29 Eric Blake <ebb9@byu.net>
1764 Optimize for Autoconf usage pattern.
1765 * modules/gnu.c (regexp, patsubst): Handle empty regex faster.
1767 * tests/testsuite.at (AT_CHECK_M4): Slight optimization.
1769 2007-09-24 Eric Blake <ebb9@byu.net>
1771 Create .gitignore alongside .cvsignore.
1772 * bootstrap (version control): Update to reflect git usage.
1774 2007-09-13 Eric Blake <ebb9@byu.net>
1776 * AUTHORS: Fix typo.
1778 2007-09-12 Gary V. Vaughan <gary@gnu.org>
1780 Be consistent about using 'module' for m4_module types and
1781 'handle' for lt_dlhandle types:
1783 * m4/m4private.h (m4_symbol_value): Rename handle element to
1784 method. Changed all references.
1785 (VALUE_MODULE, SYMBOL_MODULE): Renamed from VALUE_HANDLE and
1786 SYMBOL_HANDLE respectively. Changed all references.
1787 * m4/m4module.h (M4INIT_HANDLER, M4FINISH_HANDLER): Ditto.
1788 * m4/builtin.c (m4_builtin_find_by_name)
1789 (m4_builtin_find_by_func): Use module as the parameter name for
1790 pointers of type 'm4_module'.
1791 * m4/module.c (module_remove, m4_get_module_name)
1792 (install_builtin_table, install_macro_table)
1793 (m4_module_make_resident, m4__module_next, m4_module_refcount):
1795 * src/freeze.c (produce_module_dump): Ditto.
1796 * m4/input.c (m4_input_block): Rename handle element to method.
1797 Changed all references.
1798 * m4/symtab.c (m4__symtab_remove_module_references): Ditto.
1799 * modules/load.c: Use module as the variable name for pointers
1800 of type 'm4_module'.
1801 * modules/m4.c: Ditto.
1802 * modules/perl.c: Ditto.
1803 * modules/shadow.c: Ditto.
1805 2007-09-07 Eric Blake <ebb9@byu.net>
1807 Add refcount builtin.
1808 * modules/load.c (refcount): New builtin.
1809 (m4modules): Use correct type.
1810 * doc/m4.texinfo (Refcount): New section.
1811 * m4/m4private.h (struct m4_module): Add refcount member.
1812 (m4_module_refcount) [NDEBUG]: Add faster accessor macro.
1813 * m4/module.c (m4_module_load): Add symbols to table on first
1814 load by m4, regardless of other libltdl loads of same module.
1815 (m4_module_refcount): Use new struct member, rather than relying
1816 on libltdl count which might be inflated by unrelated loads.
1817 (m4__module_interface): Optimize.
1818 (m4__module_next, m4__module_find): Avoid assertions that could
1819 trigger with unrelated libltdl loads.
1820 (m4__module_open): Track m4 load count.
1821 (m4__module_exit): Only unload what m4 loaded.
1822 (module_remove): Track m4 unloads.
1823 * NEWS: Document new builtin.
1825 More conversion to m4_module*.
1826 * src/freeze.c (produce_module_dump, dump_symbol_CB)
1827 (reload_frozen_state): Use correct type.
1828 * m4/input.c (struct m4_input_block): Likewise.
1829 * m4/symtab.c (dump_symbol_CB): Likewise.
1831 * AUTHORS: Simplify, to match libtool and autoconf layout.
1832 * THANKS: Sync with branch.
1834 2007-09-06 Eric Blake <ebb9@byu.net>
1836 Wrap lt_dlhandle in struct m4_module.
1837 * m4/m4module.h (includes): No longer require clients to know
1839 (m4_module): New opaque declaration.
1840 (m4_export): Delete unused type.
1841 (M4INIT_HANDLER, M4FINISH_HANDLER, m4_module_init_func)
1842 (m4_module_finish_func, m4_module_load, m4_get_module_name)
1843 (m4_builtin_find_by_name, m4_builtin_find_by_func): Use new
1845 (m4_module_makeresident, m4_module_refcount): New declarations.
1846 * m4/m4private.h (includes): Move <ltdl.h> here.
1847 (m4_module): New declaration. Simple for now, but intended for
1849 (m4__module_open, m4__module_next, m4__module_find)
1850 (m4__symtab_remove_module_references): Use new wrapper.
1851 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
1853 * m4/module.c (m4_get_module_name, m4_module_import)
1854 (m4_module_load): Likewise.
1855 (install_builtin_table, install_macro_table): Likewise. Also,
1856 change return type since these always returned NULL and no one
1858 (m4_module_makeresident, m4_module_refcount): New functions.
1859 (m4_module_unload, m4__module_next, m4__module_find): Use new
1861 (m4__module_open): Populate new wrapper, and associate it with the
1863 (m4__module_exit): Use new wrapper.
1864 (module_remove): Likewise. Reclaim storage on last use.
1865 (module_close): Delete, and inline into module_remove.
1866 * m4/symtab.c (m4__symtab_remove_module_references): Use new
1868 * modules/load.c (load_init): Use new API.
1869 * modules/m4.c (m4_export_table): Kill unused declaration.
1870 (m4_init): Use new API.
1871 * modules/shadow.c (shadow_init): Use new API.
1872 * src/main.c (main): Adjust callers.
1873 * src/freeze.c (reload_frozen_state): Likewise.
1874 * tests/modules.at (unload load module): New test.
1876 2007-09-03 Gary V. Vaughan <gary@gnu.org>
1878 * bootstrap (ltdl/m4/.cvsignore): Add xstrtol module macros.
1879 * src/m4/.cvsignore: Add xstrtol module sources.
1881 2007-09-03 Gary V. Vaughan <gary@gnu.org>
1883 Work around a bug in darwin's awk:
1885 * bootstrap (func_get_translations): Use $AWK instead of raw
1886 `awk' so that the user can use an alternative implementation
1887 if the first awk in PATH doesn't behave as expected.
1888 (func_get_translations): The first awk script mangles the last
1889 entry passed to it for at least the awk implementation shipped
1890 with Darwin 8.10.1. Capture $3 into a variable too to work-
1891 around that problem.
1893 2007-08-29 Gary V. Vaughan <gary@gnu.org>
1895 As gnulib xstrtol is only used by main, and unconditionally pulls
1896 in a copy of getopt, undo bootstrap change from 2007-08-11 below,
1897 and copy the xstrtol code into src/ so that main() can use it
1898 without pushing the extra code into libm4:
1900 * bootstrap (src_modules): Add getopt and xstrtol modules.
1901 * Makefile.am (src_m4_SOURCES): Add xstrtol sources.
1902 * po/POTFILES.in: Move gnu/xstrtol-error.c to src/xstrtol-error.c.
1904 2007-08-11 Eric Blake <ebb9@byu.net>
1906 Another upstream xstrtol change.
1907 * po/POTFILES.in: Track changes in files containing messages.
1908 * bootstrap (src_modules): getopt is now pulled into libgnu.a, no
1909 need to grab it separately.
1910 * src/main.c (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
1912 (size_opt): Adjust to latest xstrtol interface.
1914 2007-08-10 Eric Blake <ebb9@byu.net>
1916 Documentation improvements.
1917 * doc/m4.texinfo (Defn): Resync with branch.
1918 (Compatibility, Extensions): Sync with branch.
1920 2007-08-07 Eric Blake <ebb9@byu.net>
1922 Adjust to gnulib xstrtol changes.
1923 * src/main.c (size_opt): Adjust signature, so that error strings
1924 are easier to translate.
1925 (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): New macros
1926 for tracking long options.
1927 (main): Track which long option was used.
1928 * tests/options.at (--debuglen, --nesting-limit): Adjust to change
1930 (deprecated options): Test that --arglength spelling shows up in
1933 2007-08-06 Eric Blake <ebb9@byu.net>
1935 Normalize all GPL license notices.
1936 * m4/COPYING.LIB: Delete - libm4 is not distributed under LGPLv2
1938 * Makefile.am: Update license wording.
1939 * bootstrap: Likewise.
1941 * configure.ac: Likewise.
1942 * ltdl/config/mailnotify: Likewise.
1943 * ltdl/config/mkstamp: Likewise.
1944 * ltdl/m4/debug.m4: Likewise.
1945 * ltdl/m4/gmp.m4: Likewise.
1946 * ltdl/m4/m4-error.m4: Likewise.
1947 * ltdl/m4/m4-getopt.m4: Likewise.
1948 * ltdl/m4/m4-gettext.m4: Likewise.
1949 * ltdl/m4/m4-obstack.m4: Likewise.
1950 * ltdl/m4/m4-regex.m4: Likewise.
1951 * ltdl/m4/stackovf.m4: Likewise.
1952 * m4/builtin.c: Likewise.
1953 * m4/debug.c: Likewise.
1954 * m4/hash.c: Likewise.
1955 * m4/hash.h: Likewise.
1956 * m4/input.c: Likewise.
1957 * m4/m4.c: Likewise.
1958 * m4/m4module.h: Likewise.
1959 * m4/m4private.h: Likewise.
1960 * m4/macro.c: Likewise.
1961 * m4/module.c: Likewise.
1962 * m4/output.c: Likewise.
1963 * m4/path.c: Likewise.
1964 * m4/resyntax.c: Likewise.
1965 * m4/symtab.c: Likewise.
1966 * m4/syntax.c: Likewise.
1967 * m4/system_.h: Likewise.
1968 * m4/utility.c: Likewise.
1969 * modules/evalparse.c: Likewise.
1970 * modules/format.c: Likewise.
1971 * modules/gnu.c: Likewise.
1972 * modules/import.c: Likewise.
1973 * modules/load.c: Likewise.
1974 * modules/m4.c: Likewise.
1975 * modules/m4.h: Likewise.
1976 * modules/modtest.c: Likewise.
1977 * modules/mpeval.c: Likewise.
1978 * modules/perl.c: Likewise.
1979 * modules/shadow.c: Likewise.
1980 * modules/stdlib.c: Likewise.
1981 * modules/time.c: Likewise.
1982 * modules/traditional.c: Likewise.
1983 * po/Makevars: Likewise.
1984 * src/freeze.c: Likewise.
1985 * src/m4.h: Likewise.
1986 * src/main.c: Likewise.
1987 * src/stackovf.c: Likewise.
1988 * tests/builtins.at: Likewise.
1989 * tests/freeze.at: Likewise.
1990 * tests/generate.awk: Likewise.
1991 * tests/m4.in: Likewise.
1992 * tests/macros.at: Likewise.
1993 * tests/modules.at: Likewise.
1994 * tests/options.at: Likewise.
1995 * tests/others.at: Likewise.
1996 * tests/stackovf.test: Likewise.
1997 * tests/testsuite.at: Likewise.
1999 2007-07-22 Eric Blake <ebb9@byu.net>
2001 Fix diversions on NetBSD, when fopen(name,"a+") seeks to end.
2002 * m4/output.c (m4_tmpopen): Explicitly seek to beginning.
2003 * tests/builtins.at (divert): Enhance test to cover this.
2005 Reported by Thomas Klausner.
2007 2007-07-20 Eric Blake <ebb9@byu.net>
2009 Fix 'make distcheck' issues.
2010 * bootstrap: Add more files that might be more up-to-date in
2012 * Makefile.am (EXTRA_DIST): No longer distribute removed diff.
2013 * config/m4/gnulib-cache.m4: Update to latest gnulib.
2015 2007-07-16 Eric Blake <ebb9@byu.net>
2017 * po/POTFILES.in: Track recent translation additions from gnulib
2020 2007-07-14 Eric Blake <ebb9@byu.net>
2022 Reflect upstream license .texi changes.
2023 * doc/m4.texinfo (Copying): Rename node...
2024 (GNU General Public License): ...to this.
2025 (GNU Free Documentation License): Adjust node location.
2026 * local/doc/gpl-3.0.texi.diff: Remove file.
2028 2007-07-10 Eric Blake <ebb9@byu.net>
2030 Upgrade to GPLv3, and document 1.4.10.
2031 * bootstrap: Adjust to GPLv3.
2032 (func_update): Port from branch.
2033 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
2034 --local-dir=local --import gpl-3.0'.
2035 * doc/m4.texinfo (History): Mention 1.4.11.
2036 (Copying This Package): New appendix.
2037 * NEWS: Document 1.4.10.
2038 * local/doc/gpl-3.0.texi.diff: New file.
2039 * Makefile.am: Update license.
2040 (doc_m4_TEXINFOS, EXTRA_DIST): Distribute additions.
2041 * commit: Update license.
2042 * configure.ac: Likewise.
2043 * ltdl/config/mailnotify: Likewise.
2044 * ltdl/config/mkstamp: Likewise.
2045 * ltdl/m4/debug.m4: Likewise.
2046 * ltdl/m4/gmp.m4: Likewise.
2047 * ltdl/m4/m4-error.m4: Likewise.
2048 * ltdl/m4/m4-getopt.m4: Likewise.
2049 * ltdl/m4/m4-gettext.m4: Likewise.
2050 * ltdl/m4/m4-obstack.m4: Likewise.
2051 * ltdl/m4/m4-regex.m4: Likewise.
2052 * ltdl/m4/stackovf.m4: Likewise.
2053 * m4/builtin.c: Likewise.
2054 * m4/debug.c: Likewise.
2055 * m4/hash.c: Likewise.
2056 * m4/hash.h: Likewise.
2057 * m4/input.c: Likewise.
2058 * m4/m4.c: Likewise.
2059 * m4/m4module.h: Likewise.
2060 * m4/m4private.h: Likewise.
2061 * m4/macro.c: Likewise.
2062 * m4/module.c: Likewise.
2063 * m4/output.c: Likewise.
2064 * m4/path.c: Likewise.
2065 * m4/resyntax.c: Likewise.
2066 * m4/symtab.c: Likewise.
2067 * m4/syntax.c: Likewise.
2068 * m4/system_.h: Likewise.
2069 * m4/utility.c: Likewise.
2070 * modules/evalparse.c: Likewise.
2071 * modules/format.c: Likewise.
2072 * modules/gnu.c: Likewise.
2073 * modules/import.c: Likewise.
2074 * modules/load.c: Likewise.
2075 * modules/m4.c: Likewise.
2076 * modules/m4.h: Likewise.
2077 * modules/modtest.c: Likewise.
2078 * modules/mpeval.c: Likewise.
2079 * modules/perl.c: Likewise.
2080 * modules/shadow.c: Likewise.
2081 * modules/stdlib.c: Likewise.
2082 * modules/time.c: Likewise.
2083 * modules/traditional.c: Likewise.
2084 * po/Makevars: Likewise.
2085 * src/freeze.c: Likewise.
2086 * src/m4.h: Likewise.
2087 * src/main.c: Likewise.
2088 * src/stackovf.c: Likewise.
2089 * tests/builtins.at: Likewise.
2090 * tests/freeze.at: Likewise.
2091 * tests/generate.awk: Likewise.
2092 * tests/m4.in: Likewise.
2093 * tests/macros.at: Likewise.
2094 * tests/modules.at: Likewise.
2095 * tests/options.at: Likewise.
2096 * tests/others.at: Likewise.
2097 * tests/stackovf.test: Likewise.
2098 * tests/testsuite.at: Likewise.
2100 2007-07-09 Eric Blake <ebb9@byu.net>
2102 * modules/format.c (format): Avoid undefined behavior with %c.
2104 2007-07-01 Gary V. Vaughan <gary@gnu.org>
2106 The translation project has moved.
2107 * bootstrap (func_get_translations): Use the new translation
2111 2007-06-26 Karl Berry <karl@freefriends.org> (tiny change)
2113 Match Free Software Directory categories.
2114 * doc/m4.texinfo (dircategory): Update.
2116 2007-05-31 Eric Blake <ebb9@byu.net>
2118 Add extension to divert builtin.
2119 * modules/m4.c (builtin_divert): Immediately divert second
2121 * m4/output.c (m4_output_text): Allow 0 length. Fixes regression
2123 (m4_shipout_text): Short-circuit on zero length.
2124 * tests/freeze.at (loading format 2): Expand test to catch
2125 regression. Also check out-of-range version.
2126 * tests/builtins.at (divert): Expand test to check corner cases
2128 * NEWS: Document the extension.
2129 Reported by Daniel Richard G.
2131 2007-05-30 Eric Blake <ebb9@byu.net>
2133 Port format improvements from branch.
2134 * doc/m4.texinfo (History): Mention upcoming 1.4.10 release.
2135 (Format): Enhance section.
2136 * modules/format.c (format): Accept %'hhd, and issue warnings on
2137 unrecognized specifiers.
2138 * modules/gnu.c (builtin_format): Adjust how format is called.
2140 2007-05-28 Eric Blake <ebb9@byu.net>
2142 * tests/options.at (--syncoutput): Add xfailed test.
2144 Fix sync line interaction with multiline comments.
2145 * doc/m4.texinfo (Preprocessor features): Improve documentation.
2146 (Syncoutput): Improve testsuite.
2147 (Incompatibilities): Add testcase, and document bug.
2148 * src/freeze.c (reload_frozen_state): Don't interfere with
2149 synclines when reloading state.
2150 * m4/input.c (m4__next_token): Report line where multiline tokens
2152 * m4/m4private.h (m4__token_type): Add parameter.
2153 * m4/m4module.h (m4_output_text): Export.
2154 (m4_shipout_text): Add parameter.
2155 * src/macro.c (m4_macro_expand_input, expand_token)
2156 (expand_argument): Adjust callers so that line is passed from
2158 * m4/output.c (output_text): Rename...
2159 (m4_output_text): ...to this, and export.
2160 (m4_insert_file, insert_diversion_helper): Update callers.
2161 (m4_shipout_text): Take new parameter for start line of token.
2162 Output at most one syncline per token.
2163 Reported by Sergey Poznyakoff.
2165 Fix large diversion corner cases.
2166 * tests/freeze.at (large diversion): New test.
2167 * m4/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
2168 (make_room_for): Use NULL, not 0, for pointers.
2169 (m4_freeze_diversions): Allow freezing large diversions.
2170 (insert_diversion_helper): Avoid using rewind.
2172 Also run gnulib unit tests during make check.
2173 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
2174 --tests-base=tests/gnu --with-tests'.
2175 * configure.ac (AC_CONFIG_FILES): Build tests/gnu testdir.
2176 * Makefile.am (SUBDIRS): Run gnulib tests before ours.
2178 2007-05-25 Eric Blake <ebb9@byu.net>
2180 * m4/system_.h: Include <stdint.h>, for intmax_t.
2182 Reported by Daniel Richard G.
2184 2007-05-24 Eric Blake <ebb9@byu.net>
2186 Provide consistent shift semantics regardless of hardware.
2187 * modules/m4.c (numb_lshift, numb_rshift, numb_urshift): Mask
2189 (number, unumber): Always use [u]intmax_t.
2190 Reported by Gary V. Vaughan.
2192 Support POSIX flush semantics on all platforms.
2193 * modules/m4.c (m4_sysval_flush): Rely on gnulib.
2194 * ltdl/m4/gnulib-cache.m4: Fix typo in previous commit.
2196 Work around cygwin and mingw fseeko bugs.
2197 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2199 * modules/m4.c (m4_sysval_flush): Prefer fseeko over fseek.
2201 2007-04-25 Eric Blake <ebb9@byu.net>
2203 Test that regression in 1.4.9's eval doesn't recur.
2204 * doc/m4.texinfo (Eval): Check negative division.
2207 2007-04-12 Eric Blake <ebb9@byu.net>
2209 Allow for running test in sticky or setgid directory.
2210 * tests/builtins.at (mkdtemp): Adjust test.
2212 Don't test for broken sed too soon.
2213 * tests/others.at (stdin seekable): Rearrange subtests.
2215 Work around 'stdin seekable' shortcoming on glibc.
2216 * ltdl/m4/gnulib-cache.m4: Use closein instead of closeout.
2217 * tests/others.at (stdin closed): Adjust to new output.
2218 * src/main.c (process_file): No need to return anything.
2219 (main): Use close_stdin instead of close_stdout.
2220 Reported by Ralf Wildenhues.
2222 Enable autobuild usage.
2223 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2225 * configure.ac (AB_INIT): Output autobuild information.
2227 2007-04-11 Eric Blake <ebb9@byu.net>
2229 Address testsuite shortcoming in 'stdout full' on glibc.
2230 * tests/others.at (stdout full): Adjust expected output when more
2231 than 1k text is printed to /dev/full.
2232 Reported by Ralf Wildenhues.
2234 2007-04-10 Eric Blake <ebb9@byu.net>
2236 * tests/macros.at (Arity and defn): Fix quoting.
2238 2007-04-09 Eric Blake <ebb9@byu.net>
2240 Address failure of 'seekable stdin' on Mac OS X.
2241 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2244 2007-04-07 Eric Blake <ebb9@byu.net>
2246 Include <config.h> first in all C files, and not in headers.
2247 Fixes regression for --disable-assert builds from 2007-04-02.
2248 * src/m4.h (includes): Don't include config.h here.
2249 * m4/m4private.h (includes): Likewise.
2250 * m4/builtin.c: Include config.h before anything else.
2251 * m4/debug.c: Likewise.
2252 * m4/hash.c: Likewise.
2253 * m4/input.c: Likewise.
2254 * m4/m4.c: Likewise.
2255 * m4/macro.c: Likewise.
2256 * m4/module.c: Likewise.
2257 * m4/symtab.c: Likewise.
2258 * m4/syntax.c: Likewise.
2259 * m4/utility.c: Likewise.
2260 * src/freeze.c: Likewise.
2261 * src/stackovf.c: Likewise.
2263 2007-04-03 Eric Blake <ebb9@byu.net>
2265 * modules/m4.c (numb_ratio, numb_divide, numb_modulo): Avoid
2266 SIGFPE on x86 architectures.
2267 Reported by Ralf Wildenhues.
2269 2007-04-02 Eric Blake <ebb9@byu.net>
2271 Fix warnings from last commit.
2272 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2273 fprintf-posix sprintf-posix'.
2274 * m4/macro.c (expand_macro, trace_format): Use correct specifier
2276 (process_macro): Avoid negative array index.
2277 * src/freeze.c (produce_resyntax_dump, produce_module_dump)
2278 (dump_symbol_CB, produce_frozen_state): Use correct specifier for
2281 2007-04-02 Gary V. Vaughan <gary@gnu.org>
2283 Get rid of the last 'differs in signedness' compiler warnings:
2285 * m4/macro.c (process_macro): m4_get_symbol_value_text() returns
2286 a regular 'char *', so variables to store the return address,
2287 and iterate through it should be regular 'char *' too.
2288 * m4/input.c (m4_input_block): The start and current members of
2289 the string part of this union store regular 'char *' types, so
2290 they should be regular 'char *' types too.
2292 2007-04-02 Gary V. Vaughan <gary@gnu.org>
2294 M4 was designed to have a small number of header files defining
2295 the interfaces to several source files each. Keeping this in
2296 mind allows us to tidy things up considerably. Having done this,
2297 it becomes clear that some of the installed headers reference
2298 other headers which are not installed (but that's another patch):
2300 * m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from
2302 * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
2303 ...to here, so client modules can benefit too.
2304 (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
2305 lowest level to save doing it multiple times elsewhere.
2306 * m4/debug.c (stdio.h): Removed. The portable <gnu/stdio--.h>
2307 is already included via m4private.h.
2308 * modules/time.c (stdio.h): Ditto.
2309 * modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>.
2310 * modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h>
2311 and <gnu/unistd--.h>,
2312 * m4/m4private.h (m4module.h): Use angle brackets for an installed
2314 * m4/hash.h (system.h): Ditto.
2315 * modules/gnu.c (progname.h): Removed.
2316 * src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h.
2317 * m4/m4private.h (assert.h, errno.h): Already included via
2319 * m4/input.c (ctype.h): Ditto.
2320 * m4/module.c (ltdl.h): Ditto.
2321 * m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h)
2323 * m4/path.c (config.h, stdlib.h): Ditto.
2324 * m4/utility.c (config.h): Ditto.
2325 * modules/evalparse.c (assert.h, ctype.h): Ditto.
2326 * modules/gnu.c (assert.h, ctype.h, errno.h): Ditto.
2327 * modules/import.c (assert.h): Ditto.
2328 * modules/m4.c (assert.h, errno.h): Ditto.
2329 * modules/modtest.c (assert.h): Ditto.
2330 * modules/stdlib.c (sys/types.h): DittAo.
2331 * src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h):
2333 * src/stackovf.c (assert.h): Ditto.
2334 * modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster
2335 private interfaces when NDEBUG is defined.
2336 * modules/import.c (m4/m4module.h, m4private.h): Ditto.
2337 * modules/load.c (m4/m4module.h, m4private.h): Ditto.
2338 * modules/m4.c (m4/m4module.h, m4private.h): Ditto.
2339 * modules/modtest.c (m4/m4module.h, m4private.h): Ditto.
2340 * modules/mpeval.c (m4/m4module.h, m4private.h): Ditto.
2341 * modules/perl.c (m4/m4module.h, m4private.h): Ditto.
2342 * modules/shadow.c (m4/m4module.h, m4private.h): Ditto.
2343 * modules/time.c (m4/m4module.h, m4private.h): Ditto.
2344 * modules/traditional.c (m4/m4module.h, m4private.h): Ditto.
2345 * src/m4.h (locale.h): Moved from here...
2346 * src/main.h: ...to here.
2347 (m4private.h): Already included via m4.h.
2348 * src/stackovf.c (m4private.h): Ditto.
2350 2007-03-28 Gary V. Vaughan <gary@gnu.org>
2352 * Makefile.am (stamp-vcl): Removed.
2353 (CONFIG_STATUS_DEPENDENCIES): Depend directly on ChangeLog.
2355 2007-03-28 Eric Blake <ebb9@byu.net>
2357 * src/main.c (usage): Improve note to TRANSLATORS.
2358 * m4/system_.h (EXIT_FAILURE): Reflect gnulib changes.
2360 * tests/builtins.at (__m4_version__): Fix bug when TIMESTAMP is
2363 2007-03-24 Eric Blake <ebb9@byu.net>
2365 * m4/output.c (m4_output_init): Update to latest gnulib.
2366 * bootstrap (ltdl/m4/.cvsignore): No longer track generated
2368 * NEWS: Reflect release of 1.4.9.
2371 2007-03-07 Eric Blake <ebb9@byu.net>
2375 Exercise gnulib's new POSIX *printf modules.
2376 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2378 * modules/format.c (format): Support %a and %A.
2379 * doc/m4.texinfo (Format): Test this addition.
2380 * NEWS: Document this addition.
2382 2007-03-03 Eric Blake <ebb9@byu.net>
2384 * m4/input.c (m4__next_token): Fix synclines when in batch mode.
2385 * doc/m4.texinfo (M4exit): Synch another section.
2386 (Syncoutput): Make similar to other sections.
2388 2007-03-01 Eric Blake <ebb9@byu.net>
2390 * doc/m4.texinfo: Improve the indices.
2391 (Concept index): Rearrange to be last.
2392 (Sysval): Merge from branch.
2394 * doc/m4.texinfo (Syscmd, Esyscmd): Merge more doc sections.
2396 2007-02-28 Eric Blake <ebb9@byu.net>
2398 POSIX XCU ERN 137 was approved.
2399 * modules/mpeval.c (numb_extension): Delete.
2400 * modules/m4.c (numb_extension): Likewise.
2401 * modules/evalparse.c (comma_term, condition_term): Always
2402 implement ?: and , operators.
2403 * m4/symtab.c: Update comment to match reality.
2404 * src/freeze.c (produce_frozen_state, reload_frozen_state): Avoid
2405 dereferencing context directly when accessor exists.
2406 * src/main.c (usage): Prefer GNU_M4 over EMACS.
2407 (struct macro_definition): Rename...
2408 (struct deferred): ...to match usage. All uses changed.
2409 * doc/m4.texinfo (Eval): Document this change.
2410 (Operation modes, Changeresyntax): Fix wording to prefer GNU_M4
2412 (Preprocessor features, Changesyntax): Fix inaccuracies.
2413 * NEWS: Import branch NEWS items for 1.4.x series. Document
2416 POSIX XCU ERN 118 was approved.
2417 * modules/m4.c (define): Kill posixly_correct distinction in
2418 define behavior, since POSIX says GNU behavior complies.
2419 * tests/builtins.at (define): Restore original semantics.
2420 * doc/m4.texinfo (Pushdef): Document portability issues with
2422 (Incompatibilities): Clean up wording of what POSIX requires.
2423 * NEWS: Document this.
2425 2007-02-26 Eric Blake <ebb9@byu.net>
2427 Re-enable clean bootstrap on cygwin.
2428 * Makefile.am (AM_LDFLAGS): For now, export all symbols from
2429 modules, since otherwise we run afoul of current libtool
2430 limitations on cygwin and mingw.
2432 2007-02-25 M. Levinson <levinsm@users.sourceforge.net> (tiny change)
2434 * src/freeze.c (reload_frozen_state): Avoid dereferencing freed
2435 memory. Fixes regression introduced 2007-01-20.
2437 2007-02-25 Eric Blake <ebb9@byu.net>
2439 * tests/freeze.at (loading format 2): Augment test to catch
2440 regression introduced on 2007-01-20.
2442 Reported by M. Levinson.
2444 * m4/system_.h (includes, EXIT_SUCCESS, EXIT_FAILURE): Adjust to
2447 2007-02-05 Eric Blake <ebb9@byu.net>
2449 * tests/options.at (--fatal-warnings): New test.
2450 * tests/others.at (stdin seekable): Exit on error.
2451 * m4/m4private.h (M4_OPT_WARN_EXIT_BIT): New bit.
2452 (m4_get_warnings_exit_opt): Access it.
2453 * m4/m4module.h (m4_context_opt_bit_table): Access it.
2454 * m4/utility.c (m4_error, m4_error_at_line): Only force an exit
2456 (m4_warn, m4_warn_at_line): Change exit status on -E, and force
2458 * src/m4.c (usage): Document new -E behavior.
2459 (main): Make -E an additive option.
2460 * doc/m4.texinfo (Operation modes): Document the change.
2461 Reported by Ralf Wildenhues.
2463 * tests/others.at (stdin seekable): Fix bug in test.
2464 * ltdl/m4/gnulib-cache.m4: Gnulib module strstr no longer exists.
2466 * m4/input.c (struct m4_input_block): Remove unused field traced.
2468 2007-02-03 Eric Blake <ebb9@byu.net>
2469 and Bruno Haible <bruno@clisp.org> (tiny change)
2471 * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
2473 Reported by Bruno Haible.
2475 2007-01-31 Eric Blake <ebb9@byu.net>
2477 * m4/resyntax.c (m4_regexp_syntax_encode): Detect allocation
2480 2007-01-26 Eric Blake <ebb9@byu.net>
2482 * m4/symtab.c (includes): Adjust to latest gnulib.
2483 * modules/m4.c (includes): Likewise.
2485 2007-01-23 Eric Blake <ebb9@byu.net>
2487 * m4/m4module.h (M4_SYNTAX_ASSIGN): Delete this unused
2488 extension to make enough room.
2489 (M4_SYNTAX_IGNORE): Change value to zero, since the (commented)
2490 code in input.c special cases this category.
2491 (M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): New values in preparation
2492 for define(eleventh,${11}) extension.
2493 * m4/syntax.c: Update comments accordingly.
2494 (m4_syntax_create, m4_syntax_code): Handle { and }.
2495 * m4/input.c (m4__next_token): Likewise.
2496 * src/freeze.c (produce_frozen_state): Support new categories.
2497 (reload_frozen_state): When loading version 1, disable syntax
2498 features not present in 1.4.x.
2499 * tests/freeze.at: Sort and rename existing tests.
2500 (loading format 1): Ensure we don't break v1 frozen files that
2502 (loading format 2, reloading changecom, reloading changesyntax):
2504 * doc/m4.texinfo (Changesyntax, Frozen file format 1): Document
2505 the new syntax categories.
2506 (Arguments): Update the FIXME comment.
2507 (M4wrap): Merge examples from branch, before worrying about fixing
2508 m4wrap to obey POSIX.
2509 (Using frozen files): Start merging from branch.
2512 2007-01-20 Eric Blake <ebb9@byu.net>
2514 * src/freeze.c (produce_char_dump): Delete. Replace with...
2515 (produce_mem_dump): ...this new function, to encode more strings.
2516 Also make the coding easier to read and slightly more compact.
2517 (produce_syntax_dump): Only dump non-default syntax codes.
2518 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
2519 Encode non-ASCII characters in user-supplied strings.
2520 (GET_STRING): Accept escape sequences in version 2.
2521 * NEWS: Document this change.
2524 2007-01-16 Eric Blake <ebb9@byu.net>
2526 Port patch from branch for stack overflow detection on BSD/OS.
2527 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Check for stack_t.ss_sp.
2528 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
2529 ! HAVE_STACK_T_SS_SP]: Use this check.
2530 Reported by Chris McGuire.
2532 2007-01-15 Eric Blake <ebb9@byu.net>
2534 * tests/builtins.at (__m4_version__): New test.
2535 * modules/traditional.c (m4_macro_table): Provide windows and os2
2536 macros, as appropriate. Add __traditional__ macro.
2537 * modules/mpeval.c (m4_macro_table): Name the macro __mpeval__,
2538 not __gmp__, to match module name.
2539 * modules/load.c (m4_macro_table): Name the macro __load__, not
2540 __modules__, to match module name.
2541 * doc/m4.texinfo (History, Shell commands, Platform macros): Merge
2543 (Standard Modules): Improve wording.
2544 (Incompatibilities): Move platform macros into their own node.
2545 (Load, Unload): Use actual examples.
2546 * NEWS: Document this change.
2549 2007-01-13 Eric Blake <ebb9@byu.net>
2551 * doc/m4.texinfo (Mpeval): Add tests.
2552 * tests/testsuite.at (AT_CHECK_GMP): New filter, factored from...
2553 * tests/builtins.at (gmp): ...here. Rename test to...
2555 * tests/generate.awk (new_test): Filter out mpeval tests when gmp
2557 * m4/m4module.h (m4_get_no_gnu_extensions_opt): Merge
2558 no_gnu_extensions with posixly_correct_opt, since they were set in
2560 * m4/m4private.h (struct m4): Remove no_gnu_extensions.
2561 * src/main.c (main): Update caller.
2562 * src/freeze.c (reload_frozen_state): Likewise.
2563 * modules/m4.c (m4wrap): Likewise.
2565 2007-01-12 Eric Blake <ebb9@byu.net>
2567 * m4/syntax.c (m4_set_comment): XCU ERN 131 was approved by
2568 POSIX, so update the comment.
2569 * doc/m4.texinfo (Inhibiting Invocation): XCU ERN 130 was
2570 approved by POSIX, so we can always have blind macros, even when
2572 (Ifelse): Mention the term `blind builtin'.
2574 2007-01-08 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2576 * doc/m4.texinfo: Fix a couple of typos.
2578 2007-01-08 Eric Blake <ebb9@byu.net>
2580 * ltdl/m4/gnulib-cache.m4: Update for new year.
2581 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Cover all error cases.
2582 Reported by Ralf Wildenhues.
2584 2007-01-06 Eric Blake <ebb9@byu.net>
2586 * m4/m4private.h (to_uchar): Move...
2587 * m4/m4module.h: here, so modules can use it.
2588 * src/main.c (usage, long_options): Support --posix as a synonym
2590 * modules/m4.c (numb_invert): Detect unsupported x**-y.
2591 (numb_incr, numb_urshift, numb_extension): New macros.
2592 (numb_obstack): Port patch from branch to support radix 1 output.
2593 * modules/mpeval.c (numb_obstack): Use \ for ratios.
2594 (numb_incr, numb_urshift, numb_extension): New macros.
2595 (mpq2mpz): Warn rather than error.
2596 * modules/evalparse.c (URSHIFT, NEGATIVE_EXPONENT): New
2598 (eval_error): Rearrange, so that all ignorable errors are less
2600 (eval_text, last_text): Obey C++ type safety rules.
2601 (numb_pow): Change return type.
2602 (exp_term): Adjust caller.
2603 (m4_evaluate): Fail on bad exponent.
2604 (logical_or_term, logical_and_term): Ignore failed ** in short
2606 (eval_lex): Fix typos when detecting <<= and >>=. Use \ instead
2607 of : for ratio. Support >>>, ,, and ?:. Port patch from branch
2608 to parse radix 1 numbers.
2609 (condition_term, comma_term): New parse functions.
2610 (shift_term): Support >>>.
2611 (m4_evaluate): Port patch from branch to output radix 1 numbers.
2612 Warn instead of error for most parse problems.
2613 * doc/m4.texinfo (Limits control, Eval): Document these changes.
2614 * NEWS: Document new operators and new command line option.
2616 2007-01-04 Eric Blake <ebb9@byu.net>
2618 * configure.ac (AC_SYS_LARGEFILE): Guarantee large file support.
2620 2007-01-03 Eric Blake <ebb9@byu.net>
2622 * doc/m4.texinfo (Format, Incr): More merges.
2623 (Eval): Ensure C precedence rules are met.
2624 * modules/evalparse.c (BADOP, INVALID_OPERATOR): New enumerators.
2625 (not_term, logical_not_term): Delete; these are same precedence
2626 as other unary operators.
2627 (equality_term): New; these are lower precedence than relational
2629 (eval_lex, simple_term, m4_evaluate): Recognize forbidden C
2630 operators for better error messages.
2631 (logical_or_term, logical_and_term): Short-circuit out the error
2632 of division by zero.
2633 (unary_term): Allow consecutive unary operators.
2634 * modules/m4.c (int2numb, numb2int): Delete; these potentially
2636 (numb_not, numb_eor, numb_ior, numb_and): Update callers.
2637 * modules/mpeval.c (reduce1, reduce2): Protect macros better.
2638 * NEWS: Document this change.
2640 2006-12-27 Eric Blake <ebb9@byu.net>
2642 * doc/m4.texinfo (Substr, Patsubst): Merge more sections from the
2644 * modules/m4.c (substr): Merge from branch.
2646 2006-12-26 Eric Blake <ebb9@byu.net>
2648 * doc/m4.texinfo (Changesyntax): Check for regressions with
2649 changesyntax(W=...).
2651 2006-12-22 Eric Blake <ebb9@byu.net>
2653 * m4/m4module.h (m4_set_syntax): Change signature.
2654 * modules/gnu.c (m4_resyntax_encode_safe): Reduce error to
2656 (changesyntax): Likewise, and update caller.
2657 * m4/m4private.h (m4_syntax_table): Add orig member.
2658 * m4/syntax.c (m4_set_quotes, m4_set_comment): Merge from branch.
2659 Don't set is_single_quotes and is_single_comments when the begin
2660 character is shadowed by another syntax type.
2661 (m4_syntax_create): Populate default syntax table.
2662 (add_syntax_attribute): Don't lose quote assignment.
2663 (remove_syntax_attribute): Only allow removing rquote or ecomm.
2664 (add_syntax_set, subtract_syntax_set, set_syntax_set)
2665 (reset_syntax_set): New helper routines.
2666 (m4_set_syntax): Alter semantics - NUL key reverts entire syntax
2667 to default, and empty chars reverts that key to default.
2668 (check_is_single_quotes, check_is_single_comments): New helper
2670 * modules/m4.c (changecom): Merge from branch.
2671 * m4/input.c (m4__next_token): Rearrange token recognition order
2672 to macro, quote, comment, in order to match traditional
2674 * src/freeze.c (reload_frozen_state): Update caller.
2675 * doc/m4.texinfo (Changequote, Changecom): Merge from branch, with
2677 (Changeresyntax): Revise to match style of surrounding sections
2678 and add more examples.
2679 (Changesyntax): Likewise, and update to new semantics.
2680 * NEWS: Document this change.
2682 * doc/m4.texinfo (Operation modes): Avoid underfull hbox.
2683 (M4wrap, Eval, Errprint): Fix typos.
2684 (Divnum): Not necessary to redivert in example.
2686 2006-12-21 Eric Blake <ebb9@byu.net>
2688 * doc/m4.texinfo (Len, Index macro, Regexp): More section merging
2691 2006-12-19 Eric Blake <ebb9@byu.net>
2693 * modules/m4.h (m4_sysval_flush_func): Adjust prototype.
2694 * modules/m4.c (m4_sysval_flush): Add parameter, so that m4exit
2695 can track write errors without all other callers warning multiple
2697 (sysval_flush_helper): New function.
2698 (dumpdef, syscmd, errprint, m4exit): Adjust callers.
2699 * modules/gnu.c (esyscmd): Likewise.
2700 * tests/others.at (stdout closed, stdout full): Error message
2703 2006-12-16 Eric Blake <ebb9@byu.net>
2705 * src/main.c: Fix missing include.
2707 * src/main.c (main): Check for errors when closing stdin.
2708 * modules/m4.c (m4exit): Missed part of previous patch: flush
2709 stdin before a successful exit.
2710 Reported by Ralf Wildenhues.
2712 2006-12-14 Eric Blake <ebb9@byu.net>
2714 * modules/m4.c (m4_sysval_flush): Flush stdin before exiting, as
2716 * tests/others.at (stdin seekable): New test.
2718 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2720 * doc/m4.texinfo: Fix some typos.
2722 2006-12-04 Eric Blake <ebb9@byu.net>
2724 * doc/m4.texinfo (Undivert, Divnum, Cleardivert): Merge more doc
2726 (Modules): Make style consistent.
2728 2006-11-16 Eric Blake <ebb9@byu.net>
2730 * bootstrap: Relax m4 requirement, thanks to...
2731 * configure.ac (Gettext support): ...this workaround to the 1.4.4
2732 bug. Undoes restriction added on 2006-11-09.
2734 * tests/builtins.at (esyscmd, syscmd): Redo, since spilled
2735 diversions are now closed when not active.
2736 (divert): Remove check now in the manual.
2737 * tests/others.at (stderr closed): Likewise.
2738 (stdout closed): Add a check.
2739 * doc/m4.texinfo (Include, Search Path, Diversions, Divert): Sync
2740 more docs with branch.
2742 2006-11-14 Eric Blake <ebb9@byu.net>
2744 Remerge sparse diversion handling from branch.
2745 * ltdl/m4/gnulib-cache.m4: Replace avltree-list with
2747 * m4/output.c (diversion_table): Change type to gl_oset_t.
2748 (m4_output_init, m4_output_exit, cleanup_tmpfile, make_room_for)
2749 (m4_make_diversion, insert_diversion_helper, m4_insert_diversion)
2750 (m4_undivert_all, m4_freeze_diversions): Adjust all callers.
2751 (div0, diversion_storage): New variables.
2752 (diversions, equal_diversion_CB): Deleted.
2753 (threshold_diversion_CB): New callback.
2754 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
2756 (m4_tmpfile): Move cloexec action here.
2758 * m4/resyntax.c (m4_regexp_syntax_encode): Avoid bug with signed
2761 2006-11-13 Eric Blake <ebb9@byu.net>
2763 Add several new command line options.
2764 * src/main.c (usage): Update.
2765 (OPTSTRING, long_options): Add --pushdef, --popdef, --gnu,
2766 --traceon, --traceoff, --syncoutput, --warnings, --unload-module.
2767 Make --regexp-syntax argument optional.
2768 (main): Support new options. Fix regression in interactive
2769 behavior from Nov 8.
2770 * m4/m4private.h (M4_OPT_SYNCOUTPUT_BIT): Rename from
2771 M4_OPT_SYNC_OUTPUT_BIT.
2772 * m4/m4module.h (m4_context_opt_bit_table): Rename sync_output to
2773 syncoutput, to match option.
2774 (m4_parse_truth_arg): New prototype.
2775 * m4/utility.c (m4_parse_truth_arg): Implement it.
2776 * m4/output.c (m4_shipout_text): Adjust sync_output caller.
2777 * modules/gnu.c (syncoutput): Adjust sync_output caller, and use
2779 * doc/m4.texinfo (Operation modes, Dynamic loading features)
2780 (Preprocessor features, Limits control, Debugging options)
2781 (Command line files): Update documentation.
2782 * tests/builtins.at (mkstemp): Simplify.
2783 * tests/macros.at (Command line pushdef): New test.
2784 (Command line define): Improve.
2785 * tests/options.at (--traceon and --traceoff, --syncoutput): New
2787 (POSIXLY_CORRECT): Likewise.
2788 (deprecated options): Augment.
2789 (--regexp-syntax): Update, now that -r takes optional arg.
2790 * NEWS: Reformat. Document new options.
2792 2006-11-11 Eric Blake <ebb9@byu.net>
2794 One step closer to allowing C++ compilation - don't blindly
2795 convert between char* and unsigned char*.
2796 * m4/m4module.h (m4_set_syntax): Change signature.
2797 * m4/m4private.h (m4_string): Use signed char.
2798 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
2799 (m4_get_syntax_ecomm): No longer a need to cast.
2800 * m4/syntax.c (m4_set_syntax, m4_syntax_create, m4_set_quotes):
2801 Reflect this change.
2802 * m4/macro.c (expand_argument): Simplify.
2803 (expand_token): Use proper type.
2804 * src/freeze.c (reload_frozen_state): Likewise.
2805 * m4/input.c (MATCH, match_input): Likewise.
2806 * modules/m4.c (translit): Likewise.
2807 * modules/gnu.c (substitute): Simplify.
2809 * m4/macro.c (trace_format): Use canonical type name.
2810 * m4/output.c (m4_freeze_diversions): Likewise.
2811 * src/freeze.c (produce_module_dump, dump_symbol_CB)
2812 (produce_frozen_state): Likewise.
2813 * m4/m4private.h (to_uchar): Grab from branch.
2814 * m4/input.c (string_peek, string_read): Use it.
2815 * m4/utility.c (skip_space): Likewise.
2816 * src/main.c (main): Likewise.
2817 * doc/m4.texinfo (Translit): Remerge from branch.
2818 * tests/builtins.at (translit): Test 8-bit range.
2819 * modules/m4.c (m4_expand_ranges): Merge from branch.
2821 2006-11-09 Eric Blake <ebb9@byu.net>
2823 * bootstrap: Validate that installed M4 is powerful enough.
2824 Reported by Gary V. Vaughan, analyzed by Stepan Kasal.
2826 2006-11-08 Eric Blake <ebb9@byu.net>
2828 Merge deferred handling of -D option from branch.
2829 * doc/m4.texinfo (Debugging options, Preprocessor features)
2830 (Dynamic loading features, Operation modes, Invoking m4):
2831 Document this change.
2832 * src/main.c (OPTSTRING): Specify in-order processing.
2833 (process_file): New function.
2834 (main): Use it to interleave files and deferred options.
2835 * tests/macros.at (Command line define): New test.
2836 * tests/generate.awk: Allow '@comment file' as first example
2838 * tests/options.at (option grouping): Update to reflect actual
2840 (file names): New test.
2842 2006-11-07 Eric Blake <ebb9@byu.net>
2844 * m4/output.c (cleanup_tmpfile, m4_insert_diversion_helper): Check
2847 * tests/builtins.at (m4exit): New test; failed on cygwin before
2849 * m4/output.c (cleanup_tmpfile): Close files before removing
2851 (make_room_for, m4_output_exit): Ensure that atexit handler
2852 invoked from m4_error sees consistent state.
2854 * doc/m4.texinfo (Errprint): Merge another doc node.
2855 * tests/builtins.at (dumpdef, errprint): New tests.
2856 * modules/m4.c (errprint): Merge from branch: flush before
2859 2006-11-02 Eric Blake <ebb9@byu.net>
2861 * bootstrap: Update bootstrap requirement wording.
2862 Reported by Bruno Haible.
2864 2006-10-31 Eric Blake <ebb9@byu.net>
2866 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2868 * doc/m4.texinfo (Translit): Merge from branch.
2869 * modules/m4.c (divert, substr): Ignore excess arguments.
2870 (index, translit): Merge from branch.
2871 * tests/builtins.at (translit): Add a test.
2873 2006-10-30 Eric Blake <ebb9@byu.net>
2875 * m4/m4private.h (m4_get_symbol_value_module): Delete accidental
2877 * m4/symtab.c (m4_get_symbol_value_module): Likewise.
2879 * modules/m4.c (m4_make_temp): Make safe across libtool.
2880 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Avoid warnings.
2881 * configure.ac (--with-modules): Accomodate changed module
2882 location when doing './configure --enable-debug'.
2884 2006-10-28 Eric Blake <ebb9@byu.net>
2886 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2889 2006-10-27 Eric Blake <ebb9@byu.net>
2891 * bootstrap (gnulib): No longer a need to patch after gnulib-tool
2893 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
2894 0.16, since 0.15 is incompatible with our automake requirement.
2896 * m4/macro.c (expand_argument): Fix missing initialization.
2897 * m4/m4private.h (struct m4_symbol_value): Store entire
2898 m4_builtin, not just the func.
2899 (m4_get_symbol_value_func): Update.
2900 (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
2902 * m4/m4module.h (m4_get_symbol_value_builtin)
2903 (m4_get_symbol_builtin): New prototypes.
2904 (m4_set_symbol_value_func): Delete, replace with...
2905 (m4_set_symbol_value_builtin): New function.
2906 (m4_builtin_find_by_name): Change signature.
2907 * m4/symtab.c (m4_symbol_value_print): Simplify.
2908 (m4_get_symbol_value_func): Update.
2909 (m4_get_symbol_value_builtin): New function.
2910 (m4_set_symbol_value_func): Delete, replace with...
2911 (m4_set_symbol_value_builtin): New function.
2912 (dump_symbol_CB) [DEBUG_SYM]: Simplify.
2913 * m4/builtin.c (m4_builtin_find_by_name): Change signature.
2914 * m4/input.c (struct m4_input_block): Remove unused trace member.
2915 (m4_push_builtin, builtin_print, init_builtin_token): Update
2917 * m4/module.c (install_builtin_table): Likewise.
2918 * src/freeze.c (reload_frozen_state): Likewise.
2919 * modules/gnu.c (builtin): Make it possible to retrieve a builtin
2920 token, even after the builtin has been undefined.
2921 * doc/m4.texinfo (Builtin): Document new capability.
2924 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2926 * modules/m4.c (m4_make_temp): Use it.
2927 * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
2929 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2931 * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
2934 2006-10-26 Eric Blake <ebb9@byu.net>
2936 Silence -O2 -Wall -Wwrite-strings warnings.
2937 * m4/m4private.h (m4_symbol_value): Const-ify text.
2938 * m4/m4module.h (m4_get_symbol_value_text)
2939 (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
2940 (m4_set_symbol_value_placeholder): Likewise.
2941 * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
2943 * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
2944 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2945 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
2947 * modules/format.c (format): Likewise.
2948 * src/main.c (main): Likewise.
2949 * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
2950 * modules/shadow.c (shadow, test): Likewise.
2951 * m4/output.c (m4_make_diversion): Don't hold on to empty
2953 (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
2954 (m4_freeze_diversions): Likewise. Don't use uninitialized
2957 Convert diversions to list instead of sparse array, part 2.
2958 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2960 * m4/output.c (m4_diversion): Add next pointer and divnum members.
2961 (diversion_table): Convert to a list instead of a sparse array.
2962 (free_list): Maintain free list of reclaimed diversions.
2963 (equal_diversion_CB, cmp_diversion_CB): New functions.
2964 (m4_output_init): Set up list.
2965 (m4_output_exit): Tear down list.
2966 (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
2968 (m4_make_diversion): Change creation of new diversions.
2969 (m4_insert_diversion_helper): New function, to avoid list
2971 * tests/builtins.at (divert): The test now passes.
2972 * NEWS: Document this improvement.
2974 Convert diversions to list instead of sparse array, part 1.
2975 * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
2977 * m4/output.c (diversion, total_buffer_size, output_unused):
2978 Track size in size_t. All users changed.
2979 (struct diversion): Reduce size now, to compensate for part 2.
2980 (m4_make_diversion, make_room_for): Avoid malloc overflow.
2981 (m4_output_exit): Fix typo in assert.
2982 (m4_output_init, make_room_for, m4_make_diversion)
2983 (m4_insert_diversion, m4_freeze_diversions): Adjust users of
2984 struct m4_diversion to disambiguate the new union.
2985 * tests/builtins.at (divert): Detect this failure.
2987 2006-10-25 Eric Blake <ebb9@byu.net>
2989 * m4/m4module.h (m4_push_builtin): Add parameter.
2990 * modules/m4.c (defn): Update caller.
2991 * m4/input.c (file_read_init, string_read_init): No longer
2993 (input_funcs): Change signature of read_func, all callers
2995 (composite_peek, composite_read, composite_unget),
2996 (composite_print, composite_funcs): New input type. Not yet
2997 fully utilized, but one step closer to fixing defn.
2998 (m4_input_block): Make every input block track current file and
2999 line. Rename some members. Remove unused out_line. Add support
3000 for composite input block.
3001 (input_change): New flag.
3002 (file_peek, file_read, file_clean, file_unget, file_print):
3004 (m4_push_file, m4_push_builtin, m4_push_string_init)
3005 (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
3006 (m4_skip_line, pop_input): Track input block changes.
3007 (m4_pop_wrapup): Avoid overflow.
3008 (init_builtin_token): Handle composite input.
3009 (next_char): Handle input block changes.
3010 * doc/m4.texinfo (Location): Remerge from branch.
3012 * src/m4.h (includes): Need <locale.h> after all; fixes
3013 regression from yesterday.
3015 * m4/system_.h (obstack_regrow): New macro. Hopefully glibc will
3017 * m4/macro.c (expand_macro): Avoid referencing invalid memory.
3018 Handle nesting the argc obstack.
3019 (expand_token): Avoid unnecessary malloc.
3020 (collect_arguments): Copy name before invalidating it.
3021 (argc_stack, argv_stack): New variables.
3022 (m4_macro_expand_input): Initialize argc and argv stacks once per
3023 file, instead of once per macro.
3025 2006-10-24 Eric Blake <ebb9@byu.net>
3027 * src/m4.h (includes): Add gettext.h, for N_. Assume setlocale.
3029 2006-10-23 Eric Blake <ebb9@byu.net>
3031 * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
3032 from branch regarding stripped leading whitespace.
3034 * modules/m4.c (includes): Use safe headers even when configured
3035 with --enable-assert.
3036 (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
3037 #defined as mkstemp_safer.
3039 2006-10-21 Eric Blake <ebb9@byu.net>
3041 * modules/m4.c (m4_make_temp): Change signature.
3042 (maketemp, mkstemp): Update callers.
3043 * modules/m4.h (m4_make_temp_func): New export.
3044 * modules/gnu.c (mkdtemp): New macro.
3045 * doc/m4.texinfo (Operation modes): Document interaction with
3047 (Mkdtemp): New node.
3048 * tests/builtins.at (mkdtemp): New test.
3049 (mkstemp): Check for umask effect.
3050 * NEWS: Document new builtin.
3052 * tests/generate.awk (normalize): Update recognition of trailing
3054 * doc/m4.texinfo: Minor formatting fixes from branch.
3055 (Foreach, Improved foreach): Merge from branch.
3056 * examples/foreach.m4: Merge from branch.
3057 * examples/foreachq.m4: New file from branch.
3058 * examples/foreach2.m4: Likewise.
3059 * examples/foreachq2.m4: Likewise.
3061 * doc/m4.texinfo (titlepage): Add myself as author.
3062 * src/main.c (AUTHORS): Likewise.
3064 2006-10-19 Eric Blake <ebb9@byu.net>
3066 * modules/m4.c (m4_make_temp, mkstemp): New functions.
3067 (maketemp): Add POSIX behavior and a warning.
3068 * tests/others.at (maketemp): Move this test...
3069 * tests/builtins.at (mkstemp): ...to here, and beef up.
3070 * tests/options.at (--safer): Update to new warning message.
3071 * doc/m4.texinfo (Mkstemp): Sync from branch.
3072 (Extensions): Update maketemp behavior.
3073 * NEWS: Document that maketemp now always warns.
3075 * tests/generate.awk: For ease of doc-writing, simplify selection
3076 of '-Ipath/to/examples' to '@comment examples'.
3077 * examples/forloop.m4: Simplify.
3078 * examples/forloop2.m4: New file.
3079 * examples/quote.m4: New file.
3080 * doc/m4.texinfo (Improved forloop): New node.
3081 (Manual): Clarify use of examples directory.
3082 (Shift, Forloop): Resync from branch.
3083 (Include, Location): Update to new usage of examples directory.
3085 * m4/system_.h (includes): Pick up <unistd.h> before checking for
3087 (gettext_noop): Don't define here, let gettext.h do it instead.
3088 * po/POTFILES.in: Update entries to reflect gnulib imports.
3090 2006-10-16 Eric Blake <ebb9@byu.net>
3092 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3094 * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
3095 pkglibexecdir support.
3096 * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
3097 worry about pathconf.h, now that gnulib does it for us.
3098 (pkgmodincludedir): Simplify.
3099 (pkglibexecdir): Delete, now that automake does this.
3100 * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
3101 * src/main.c (usage): Likewise.
3102 * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
3104 * doc/m4.texinfo: Port some changes from the branch.
3105 (Invoking m4): Promote to a chapter, instead of a section of
3107 (Operation modes, Dynamic loading features, Preprocessor features)
3108 (Limits control Frozen state, Debugging options)
3109 (Command line files): Subdivide into new sections.
3110 (Cleardivert): Rename from cleardiv.
3112 2006-10-14 Eric Blake <ebb9@byu.net>
3114 * tests/others.at (stdin closed): Update to match previous patch.
3116 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
3118 Reported by Ralf Wildenhues.
3120 * modules/m4.c (undivert): Merge from branch.
3121 * doc/m4.texinfo (Improved fatal_error): Fix typo.
3122 (Improved exch): New node, copied from branch.
3123 (Improved cleardivert): Update from branch.
3126 2006-10-13 Eric Blake <ebb9@byu.net>
3128 * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
3130 * modules/gnu.c (builtin, indir): Transparently handle builtin
3132 * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
3133 * m4/input.c (m4_pop_wrapup): Display debug message when switching
3135 (m4_input_init): No need to use empty file any more.
3136 (file_print): Display correct file name.
3137 * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
3138 dereference a NULL file name.
3139 * m4/m4module.h (m4_pop_wrapup): New parameter.
3140 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
3142 * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
3143 * m4/symtab.c (m4_symbol_value_groks_macro): New method.
3144 * src/main.c (main): Adjust caller.
3145 * tests/options.at (--debugmode): Test more output from -dV.
3147 2006-10-12 Eric Blake <ebb9@byu.net>
3149 * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
3151 * m4/m4private.h (m4__next_token_is_open): New prototype.
3152 * m4/m4module.h (m4_push_single): Delete; push_string is an
3153 adequate interface, and removing support for this simplifies the
3155 (m4_push_wrapup): New parameter.
3156 (m4_is_syntax): Delete; m4_has_syntax is sufficient.
3157 (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
3158 start-quote and start-comment exclusive from other syntax
3160 * m4/syntax.c: Likewise.
3161 * m4/input.c (input_funcs): Make polymorphic without requiring
3162 clients to know whether they are located at isp. All users
3164 (file_names): New variable.
3165 (m4_input_init): Initialize it.
3166 (m4_push_file): Use it.
3167 (m4_input_exit): Free it after use.
3168 (m4__next_token): Simplify slightly.
3169 (m4__peek_token): Rename and simplify...
3170 (m4__next_token_is_open): ... to this. In particular, this
3171 allows us to avoid a double ungetc, which POSIX doesn't
3173 (struct m4_input_block, m4_push_single, single_peek, single_read):
3174 Remove support for single characters, as the input engine now
3175 guarantees we don't need it.
3176 (file_unget, string_unget, m4_input_print, unget_input):
3177 Strengthen assertions.
3178 (file_init_funcs, file_read_init): New for file reading.
3179 (string_init_funcs, string_read_init): New for wrapped text.
3180 (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
3181 Support wrapped text with locations.
3182 (m4_skip_line): Support dnl across include file boundary.
3183 (peek_char): Don't pop input when peeking.
3184 (file_peek): Peek can be called at the end of the file.
3185 (string_read): Don't read beyond string bounds.
3186 * m4/macro.c (expand_token, collect_arguments): Update callers.
3187 (expand_macro): Report errors at location of open parenthesis.
3188 (expand_token, expand_argument, process_macro): Avoid negative
3189 array dereferences with m4_has_syntax.
3190 * m4/utility.c (skip_space): Likewise.
3191 * modules/m4.c (m4wrap): Update caller.
3192 * tests/builtins.at (__file__, __line__, dnl): New tests.
3193 * tests/options.at (--debugmode): Normalize the output.
3194 * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
3195 Remerge recent changes from branch.
3196 (Improved fatal_error): New node from branch.
3198 2006-10-11 Eric Blake <ebb9@byu.net>
3200 * src/main.c (usage, long_options): Add --debugmode as an alias
3201 for --debug, to match macro name.
3202 * tests/options.at (--debugmode): Rename from --debug, and test
3204 (--discard-comments): Augment test.
3205 * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
3208 2006-10-10 Eric Blake <ebb9@byu.net>
3210 Trace improvements: debugmode(c) was always printing the last two
3211 lines paired, combine them; and show non-text expansions.
3212 * m4/macro.c (trace_prepre): Update to show what the macro will
3214 (trace_pre): No need to special-case on debugmode(c).
3215 (trace_post): Likewise. Also, show non-text expansions.
3216 (expand_macro): Update caller. Collecting arguments can change
3217 debug mode, so cache values beforehand.
3218 (trace_format): Remove support for unused %l%S%r, and fix support
3219 for %z to match gcc's attribute((printf)).
3220 (trace_header): Update caller.
3221 * m4/input.c (struct m4_input_block): Rename from input_block.
3222 (struct input_funcs): Add print_func member.
3223 (file_print, builtin_unget, builtin_print, string_print)
3224 (m4_input_print): New functions.
3225 (m4_push_string_finish): Change return type.
3226 (m4_push_file): Fix missing use of close parameter.
3227 * m4/debug.c (m4_debug_decode): Don't clear pending traces.
3228 * m4/m4module.h (m4_input_print): New prototype.
3229 * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
3230 to match behavior change.
3231 * tests/options.at (--debug): Likewise.
3232 * tests/macros.at (Propagation of traceon)
3233 (Propagation of --trace): Likewise.
3234 * tests/others.at (stderr closed, stdout closed, stdin closed):
3236 * doc/m4.texinfo (Forloop): Simplify.
3237 (Trace): Update to changed behavior.
3238 (Debugmode): Document this change.
3239 * src/main.c (usage): Likewise.
3242 2006-10-09 Eric Blake <ebb9@byu.net>
3244 * m4/path.c (m4_include_env_init): Don't alter result of getenv.
3245 Reported by Ralf Wildenhues.
3247 * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
3249 2006-10-07 Eric Blake <ebb9@byu.net>
3251 * m4/m4module.h (m4_set_exit_failure): New prototype.
3252 * m4/utility.c (m4_set_exit_failure): New function.
3253 * modules/m4.c (m4exit): Use it to avoid yet another global
3254 variable export in libm4.
3256 2006-10-06 Eric Blake <ebb9@byu.net>
3258 * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
3260 * tests/others.at (stdout closed): Fix final check.
3262 Replace uses of tmpfile with clean-temp, since tmpfile is
3263 incompatible with closeout.
3264 * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
3266 * tests/others.at (stderr closed): Likewise.
3267 * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
3268 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3270 * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
3271 (m4_tmpfile, cleanup_tmpfile): New functions.
3272 (make_room_for, m4_insert_diversion): Use clean-temp module.
3273 * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
3275 * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
3277 * m4/utility.c (m4_numeric_arg): Merge from branch.
3278 * modules/gnu.c (debuglen): New builtin.
3279 * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
3280 Rename --arglength to --debuglen.
3281 * tests/options.at (--arglength): Rename to --debuglen.
3282 (deprecated options): Augment test.
3283 * doc/m4.texinfo (Invoking m4): Document the name change.
3284 (Debugmode): Rename from Debug Levels.
3285 (Debugfile): Rename from Debug Output.
3286 (Debuglen): New node.
3287 * NEWS: Document these changes.
3289 * modules/m4.c (m4exit): Fix typo. Ensure desired exit status in
3290 case closing a module exits.
3292 * modules/m4.c (m4exit): Merge from branch.
3293 * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
3295 2006-10-05 Eric Blake <ebb9@byu.net>
3297 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3299 * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
3300 * src/main.c (main): Close stdout on exit.
3301 * m4/debug.c (set_debug_file): Check for write failure.
3302 * m4/m4.c (m4_delete): Don't mask write failure.
3303 * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
3304 macros before calling AT_CHECK.
3305 (M4_ONE_MEG_DEFN): New helper macro.
3306 * tests/others.at (stdout full): New test.
3307 (stderr closed, stdin closed, stdout closed): Augment.
3308 * tests/builtins.at (syscmd): New test.
3311 2006-10-04 Eric Blake <ebb9@byu.net>
3313 * tests/builtins.at: Alphabetize tests.
3314 * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
3315 * tests/generate.awk (new_test): Fix underquoting.
3316 * tests/others.at (maketemp): Rename from misc.
3317 (stdin closed, stdout closed, stderr closed): New tests.
3319 2006-10-03 Eric Blake <ebb9@byu.net>
3321 Avoid all global variables in modules, so that --disable-static
3323 * examples/incl.m4: New file, from branch.
3324 * Makefile.am (dist_pkgdata_DATA): Distribute it.
3325 * doc/m4.texinfo (Location): Merge this section from branch.
3326 (Include): Update the test.
3327 * tests/generate.awk (new_test): Allow for VPATH build
3328 pre-processing of expected __program__ output.
3329 * m4/m4module.h (m4_current_diversion, m4_output_current_line):
3330 Avoid global variables.
3331 (m4_context_field_table): Add current_diversion, output_line.
3332 (m4_output_init, m4_make_diversion): Add parameter.
3333 (m4_get_program_name, m4_set_program_name): New accessors.
3334 * m4/m4private.h (m4_get_current_diversion),
3335 (m4_set_current_diversion, m4_get_output_line)
3336 (m4_set_output_line): New accessors.
3337 * m4/utility.c (m4_get_program_name, m4_set_program_name): New
3339 * modules/m4.c (divnum, divert): Adjust callers.
3340 * modules/gnu.c (__program__): Likewise.
3341 * m4/output.c (m4_output_init, m4_make_diversion)
3342 (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
3343 (m4_insert_diversion): Likewise.
3344 * m4/input.c (file_clean, m4_push_file): Likewise.
3345 * src/freeze.c (reload_frozen_state): Likewise.
3346 * src/main.c (main, usage): Likewise.
3348 Partially plug memory leak when unloading gnu module.
3349 * tests/modules.at (unload gnu module): New test.
3350 * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
3351 (m4_regexp_compile): Move static storage to module visibility.
3352 * tests/options.at (--debug): Adjust to new output.
3354 2006-09-29 Eric Blake <ebb9@byu.net>
3356 Even when not the first option, --help can't have side effects.
3357 * tests/options.at (--debugfile): Detect bugs in this area.
3358 * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
3360 * src/main.c (main): Fix it by deferring debugfile change. Also,
3361 defer closing streams until after module tracing is done.
3362 * modules/gnu.c (debugfile): Make message consistent with command
3364 * doc/m4.texinfo (Invoking m4): Touch up the documentation.
3365 * NEWS: Document this fix.
3367 * modules/m4.c (dnl): Include macro name in warning message.
3368 * m4/input.c (m4_skip_line): Add parameter.
3369 * m4/m4module.h (m4_skip_line): Likewise.
3370 * src/main.c (usage): Update wording.
3371 * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
3372 issue of blind macros vs. POSIX is resolved.
3373 (Dnl): Merge another node from branch.
3375 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3377 * m4/system_.h (N_): Define.
3378 * src/main.c (main): Validate numeric arguments.
3379 (size_opt): New function, idea borrowed from coreutils.
3380 * m4/macro.c (expand_macro): -L0 implies no limit.
3381 * doc/m4.texinfo (Invoking m4): Document this change.
3383 * tests/options.at: (--arglength, --nesting-limit)
3384 (--regexp-syntax): New tests of argument validation.
3386 2006-09-28 Eric Blake <ebb9@byu.net>
3388 * tests/options.at: Alphabetize the tests.
3390 2006-09-27 Eric Blake <ebb9@byu.net>
3392 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
3393 another parameter to print module info.
3394 * m4/macro.c (trace_pre): Adjust caller.
3395 * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
3396 * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
3397 * NEWS: Document this.
3399 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3401 * m4/symtab.c (symbol_value_print): Rename to...
3402 (m4_symbol_value_print): ...this, and...
3403 (m4_symbol_print): Update to allow -L length truncation. Now
3404 truncation also affects dumpdef output and builtin names.
3405 * m4/m4private.h (nesting_limit, max_debug_argument_length):
3407 * m4/m4module.h (m4_symbol_print): Add parameter.
3408 (m4_symbol_value_print): New function.
3409 * modules/m4.c (dumpdef): Allow length truncation.
3410 * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
3412 * doc/m4.texinfo (Invoking m4): Document -l better.
3413 (Dumpdef, Debug Levels): Document the effect of -l.
3414 * NEWS: Document this change.
3416 * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
3417 (m4_expand_ranges): Ensure we aren't picking up partial object on
3419 * modules/stdlib.c (setenv): Allow extra arguments.
3420 * modules/time.c (ctime): Avoid side effect in call to
3422 * modules/gnu.c (m4_regexp_substitute): Likewise.
3423 (renamesyms): Avoid extra obstack_init.
3424 * src/freeze.c (reload_frozen_state): Remove debug comment.
3425 (produce_frozen_state): Simplify fprintf to puts where possible.
3426 * modules/modtest.c (modtest_init, modtest_finish): Likewise.
3427 * modules/import.c (import, symbol_fail, modules_fail): Likewise.
3428 * m4/macro.c (trace_flush): Likewise.
3429 * m4/debug.c (m4_debug_message_prefix): Likewise.
3430 * m4/path.c (include_dump): Likewise.
3431 * m4/module.c (module_remove): Likewise.
3432 (install_builtin_table): Simplify malloc and string
3435 2006-09-26 Eric Blake <ebb9@byu.net>
3437 * m4/m4module.h (m4_symbol_print): New prototype.
3438 (M4_DEBUG_TRACE_STACK): New enumerator.
3439 (m4_is_debug_bit): Allow use without requiring m4private.h.
3440 * m4/symtab.c (symbol_value_print, m4_symbol_print): New
3442 * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
3444 (dumpdef): Allow printing pushdef'd stacks.
3445 * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
3446 * src/main.c (usage): Document it.
3447 * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
3450 * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
3452 * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
3453 of lines during make.
3454 (AM_CPPFLAGS): Remove unneeded include path.
3455 (src_m4_CPPFLAGS): Remove redundant include path.
3456 * m4/system_.h Make preprocessor indentation consistent.
3457 (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
3459 (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
3461 (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
3462 (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
3463 (bool, true, false): Don't undefine here; stdbool takes care of
3465 * src/m4.h (includes): Assume config.h, and several standard
3467 (__CYGWIN__, WIN32): Don't define here; let system.h do it.
3468 * m4/m4private.h: Assume config.h.
3469 * m4/output.c: Likewise.
3470 * m4/path.c: Likewise.
3471 * m4/resyntax.c: Likewise.
3472 * m4/utility.c: Likewise.
3473 * modules/gnu.c: Likewise.
3474 * modules/import.c: Likewise.
3475 * modules/load.c: Likewise.
3476 * modules/m4.c: Likewise.
3477 * modules/modtest.c: Likewise.
3478 * modules/mpeval.c: Likewise.
3479 * modules/perl.c: Likewise.
3480 * modules/shadow.c: Likewise.
3481 * modules/stdlib.c: Likewise.
3482 * modules/time.c: Likewise.
3483 * modules/traditional.c: Likewise.
3485 2006-09-21 Eric Blake <ebb9@byu.net>
3487 * doc/m4.texinfo (Invoking m4): Add clarification on option
3488 processing behavior.
3489 * tests/options.at (option grouping): Test this.
3491 Reported by Mikhail Teterin.
3493 * bootstrap: Add --force option, based on idea from coreutils.
3494 * README: Document that ./bootstrap and autoreconf are for
3495 developers, and not lightly done in tarballs.
3497 2006-09-20 Eric Blake <ebb9@byu.net>
3499 * src/main.c (usage, OPTSTRING, main): Rename -e to -i. Make
3500 warnings consistent.
3501 (long_options, HASHSIZE_OPTION): Warn on -H.
3502 * doc/m4.texinfo (Invoking m4): Document this.
3503 * tests/options.at (deprecated options): Update.
3505 Change the default of interactive sessions to match sh.
3506 * src/main.c (usage): Document this.
3507 (enum interactive_choice): New enum.
3508 (main): Use it to defer decision of interactive until after
3509 argument processing.
3510 * doc/m4.texinfo (Invoking m4): Document this.
3511 * NEWS: Likewise, plus add missing mention of -b.
3512 Reported by Stepan Kasal.
3514 2006-09-19 Eric Blake <ebb9@byu.net>
3516 * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
3517 well as --error-output; the goal is to add -o/--output in some
3518 future version with semantics like gcc or autom4te.
3519 * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
3520 (Extensions): Reflect this update.
3521 (Renamesyms): Add another test.
3522 (Defn): Xfail for now, so that `make check' is happy.
3523 * NEWS: Document this change.
3524 * tests/generate.awk: Mark dynamic loading tests as such. Allow
3526 * tests/macros.at (Renamesyms collisions): New test, exposing
3527 renamesyms' coredump.
3528 * tests/options.at (--debugfile, --safer): Update to match
3531 * m4/debug.c (set_debug_file): Fix regression in -o when stdout
3532 and stderr are same file, introduced 2003-07-23.
3533 * tests/options.at (--debugfile): New test, to catch the bug.
3534 (deprecated options): Test --error-output.
3535 * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
3536 Deprecate --error-output, and replace it with --debugfile.
3537 * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
3538 Document this change.
3541 2006-09-18 Eric Blake <ebb9@byu.net>
3543 * modules/load.c (modules): Rename to...
3544 (m4modules): ...this, since it is an English word with 0
3546 * modules/gnu.c (symbols, m4symbols): Likewise.
3547 * doc/m4.texinfo (Listing Modules): Rename to...
3548 (M4modules): ...this.
3549 (Symbols): Rename to...
3550 (M4symbols): ...this.
3551 (Load, Foreach, Trace, Answers): Update to new spellings.
3552 * NEWS: Document this.
3554 * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
3555 such that without arguments, the global trace flag is changed
3556 rather than walking the table of all currently-defined macros.
3557 (set_trace_CB): No longer needed.
3558 * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
3559 (m4_set_symbol_traced): Delete.
3560 (m4_symtab_create): Nuke the nuke parameter.
3561 * m4/m4private.h (m4_get_symbol_value): Delete.
3562 * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
3563 (m4_set_symbol_name_traced): Free undefined entries that are no
3565 (symbol_destroy_CB): Update caller.
3566 * m4/m4.c (m4_create): Update caller.
3567 * src/main.c (main): Likewise.
3568 (usage): Fix typo in last commit.
3569 * doc/m4.texinfo: Minor cleanups throughout.
3570 (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
3571 more nodes from branch.
3572 (Trace): Document new semantics, and how to simulate the old.
3573 * tests/builtins.at (multiquotes): Adjust to new semantics.
3574 * NEWS: Update somewhat.
3576 2006-09-14 Eric Blake <ebb9@byu.net>
3578 Add --safer option, per debian bug 5898.
3579 * src/main.c (usage): Document new option.
3580 (SAFER_OPTION): New enumerator.
3581 (main): Set the option bit.
3582 * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
3584 * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
3585 (m4_get_safer_opt): New accessor.
3586 * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
3587 * modules/m4.c (syscmd, maketemp): Likewise.
3588 * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
3589 (Sysval, Maketemp): Add tests of this.
3590 * tests/options.at (--safer): Likewise.
3592 2006-09-13 Eric Blake <ebb9@byu.net>
3594 * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
3596 Reported by Ralf Wildenhues.
3599 * Makefile.am (check_LTLIBRARIES): Build test libraries in the
3600 tests directory, so we can be sure an installed build is not
3601 picking up uninstalled non-test libraries.
3602 (check-local, installcheck-local): Depend on test libraries.
3603 * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
3604 after file name. Fix quoting. Remove skipping the test, now
3605 that makefile guarantees test modules will exist.
3606 (Freezing modules, modules: shadow, modules: unload)
3607 (modules: trace): Always put test modules in module path.
3608 (modules: importing): Likewise, and rely on AT_CHECK_M4 for
3610 * src/main.c (usage): Document default module search path.
3611 (import_environment, frozen_file_to_read, frozen_file_to_write):
3614 * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
3615 * tests/m4.in: ...not here.
3616 Reported by Ralf Wildenhues.
3618 2006-09-08 Eric Blake <ebb9@byu.net>
3620 * bootstrap: Kill unrelated copy-n-paste code from argument
3621 parsing. Let Makefile generate testsuite.
3622 * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
3624 2006-09-07 Eric Blake <ebb9@byu.net>
3626 * m4/m4module.h (m4_peek_input): No longer export.
3627 (m4_error_at_line, m4_warn_at_line): New prototypes.
3628 (m4_is_symbol_void): New macro.
3629 (m4_push_file): Update prototype.
3630 * m4/m4private.h (m4__peek_token): New prototype.
3631 (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
3632 * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
3633 * src/main.c (main): Allow reading from stdin twice.
3634 * modules/m4.c (include): Adjust to new prototype.
3635 * m4/input.c: General comment cleanup.
3636 (file_peek, file_read, file_unget, push_file): Set end flag on
3637 EOF, so that we don't call getc twice.
3638 (push_file, file_clean): Port fix from branch to avoid closing
3640 (pop_input): Port fix from branch to avoid reading free'd memory
3641 when input ends mid-string.
3642 (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
3643 (string_peek, string_read): Always use unsigned char.
3644 (m4_skip_line): Warn when dnl cut short by EOF.
3645 (peek_input): Rename from m4_peek_input.
3646 (match_input): Update signature, to distinguish between `(' token
3647 and multi-char quote or comment beginning with `('.
3648 (m4_input_exit): Cleanup now done in m4_pop_wrapup.
3649 (m4__peek_token): New function, ported from branch.
3650 (m4__next_token): Update to new token types.
3651 * m4/macro.c (expand_token, expand_argument): Use peek_token.
3652 * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
3653 (Invoking m4): Remerge from branch.
3655 * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
3656 (check-local): and put dependency here.
3657 Reported by Ralf Wildenhues.
3659 2006-09-05 Eric Blake <ebb9@byu.net>
3661 * m4/m4module.h (m4_debug_message): New prototype.
3662 (M4_DEBUG_TRACE_MODULE): New debug bit.
3663 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
3664 (M4_DEBUG_MESSAGE2): Delete these macros.
3665 * m4/debug.c (m4_debug_message): New method.
3666 (m4_debug_decode): Add module tracing as flag `m'.
3667 * m4/input.c (m4_push_file, file_clean): Use new method.
3668 * m4/path.c (m4_path_search): Likewise.
3669 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
3670 * m4/module.c (install_builtin_table, install_macro_table)
3671 (m4__module_open, module_close, module_remove): Promote several
3672 module debug messages outside of DEBUG_MODULES.
3673 (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
3674 DEBUG_MODULES with normal trace output.
3675 * src/main.c (usage): Document new flag.
3676 * doc/m4.texinfo (Debug Levels): Likewise.
3677 * Makefile.am ($(TESTSUITE)): Add missing dependency.
3678 * tests/m4.in: Neutralize platform-dependent module filenames.
3679 * tests/options.at (--debug): Update expected output.
3681 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3683 * doc/m4.texinfo: Fix some typos.
3684 * tests/others.at: Likewise.
3686 2006-09-05 Eric Blake <ebb9@byu.net>
3688 * m4/input.c (lex_debug): Remove dead code that broke compilation
3689 with --enable-debug.
3690 * m4/module.c (install_builtin_table, install_macro_table)
3691 (m4__module_init, m4__module_open, module_close)
3692 (module_remove): Fix compilation when --enable-debug.
3693 * m4/output.c (m4_shipout_text): Likewise.
3694 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
3695 libraries when --enable-debug.
3696 * configure.ac (DYNAMIC_MODULES): New variable, to pass
3697 information to testsuite.
3698 (modules to preload): Determine modules after we know whether
3699 shared libraries are supported.
3700 * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
3702 * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
3703 * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
3704 (modules: shadow, modules: unload, modules: importing)
3705 (modules: trace): Use new macro.
3706 * tests/builtins.at (gmp): Likewise.
3708 * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
3710 (expand_token): Avoid assertion just added to docs.
3711 (expand_macro): Track pending expansions, for when a symbol's
3712 definition changes during argument collection.
3713 (m4_macro_call, process_macro): Operate on symbol value, not
3714 symbol, since symbol may have changed during argument collection.
3715 * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
3716 (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
3717 (m4_get_symbol_value): Add fast macro version.
3718 * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
3719 (m4_macro_call): Adjust prototype.
3720 * m4/module.c (install_builtin_table): Check that flags are valid
3721 when creating builtin.
3722 * m4/symtab.c (m4__symtab_remove_module_references): Use
3723 m4_symbol_value_delete, rather than inlining it.
3724 (m4_symbol_value_copy): Copy placeholder text.
3725 (symbol_popval): Use m4_symbol_value_delete.
3726 (m4_symbol_value_delete): Implementation was missing when NDEBUG.
3727 Handle pending expansions.
3728 * modules/gnu.c (indir): Update to new prototype.
3729 * doc/m4.texinfo: Fix menus to be consistent with section names.
3730 (Defn): Add test that macro tokens flatten to empty string;
3731 triggered an assert before this patch.
3732 (Ifelse): Merge another node.
3733 (Loops): Split into...
3734 (Forloop, Foreach): New nodes; work is still underway on them.
3735 (Answers): Add more info on foreach macro; work is still underway.
3736 (Indir): Add test that indir collects arguments before looking up
3738 * TODO: Update based on this patch.
3740 2006-09-01 Eric Blake <ebb9@byu.net>
3742 * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
3743 * m4/hash.h (m4_free_hash_iterator): New prototype.
3744 * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
3745 ensure we don't do unsafe things while iterating.
3746 (HASH_ITER, ITER_CHAIN): New accessor macros.
3747 (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
3748 (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
3749 (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
3750 (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
3751 to catch unsafe actions.
3752 (m4_free_hash_iterator): New function, to avoid memory leaks, and
3753 when debugging, to track safe actions.
3754 (m4_hash_apply): Avoid memory leak.
3755 * m4/symtab.c (m4_symtab_apply): Likewise.
3756 * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
3757 in manually to src/ for now.
3758 * tests/builtins.at (gmp): Add keyword module.
3759 * tests/modules.at (Freezing modules, modules: shadow)
3760 (modules: unload, modules: importing, modules: trace): Likewise.
3762 2006-08-30 Eric Blake <ebb9@byu.net>
3764 * m4/utility.c (m4_warn): Factor "Warning" out of messages into
3766 (m4_bad_argc, m4_numeric_arg): Update all callers.
3767 * m4/macro.c (m4_macro_call): Likewise.
3768 * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
3769 (Indir, Builtin, Ifdef): More doc merges.
3770 (Loops): Mention that documenting foreach would be nice.
3771 (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
3772 (Include, Eval, Location, M4exit): s/input.m4/stdin/.
3773 * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
3774 (substitute, syncoutput): Update all m4_warn callers.
3775 * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
3776 (traceon, traceoff): Make warning message consistent.
3777 (define, pushdef): Update all m4_warn callers.
3778 * tests/generate.awk: Choose file name so that documentation can
3779 show command-line behavior.
3780 * tests/builtins.at (define): Update to new wording.
3781 * tests/macros.at (pushdef/popdef): Likewise.
3782 * tests/freeze.at (loading format 1): Likewise.
3783 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
3785 * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
3787 (Defn): Add failing test case for mixing text and builtin.
3788 (Renamesyms): Improve wording, and identify core dump that needs
3791 2006-08-29 Eric Blake <ebb9@byu.net>
3793 * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
3794 (Arguments, Pseudo Arguments): More doc merges from the branch.
3795 (Macro expansion): Turn example into test.
3796 (Pseudo Arguments): Add example of avoiding argument.
3797 * modules/m4.c (undefine, popdef): Accept multiple arguments.
3798 (define, pushdef): Warn on non-text macro name.
3799 (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
3800 warning/error messages.
3801 (ifdef): Ignore extra arguments.
3802 * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
3803 (m4__symtab_remove_module_references): Check that there is no leak.
3804 * tests/macros.at (pushdef/popdef): Update to new message.
3805 * tests/builtins.at (define): Likewise.
3806 * tests/freeze.at (loading format 1): Likewise.
3807 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
3809 * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
3810 (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
3811 as accessor function, to avoid compiler warning.
3812 * m4/module.c (m4__module_open): Move declaration of variable to
3813 avoid compiler warning.
3814 * src/main.c (main): Avoid shadowing a global variable.
3815 * src/freeze.c (produce_symbol_dump): Avoid unused variable
3816 warning when NDEBUG.
3817 * tests/options.at (--discard-comments, --import-environment)
3818 (--debug, --prepend-include, --help and --version): Rename tests
3819 to name option tested.
3821 2006-08-28 Eric Blake <ebb9@byu.net>
3823 * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
3824 * m4/module.c (install_builtin_table): ...to here, and add
3825 assertion that blind macros require arguments.
3826 * m4/m4module.h (struct m4_builtin): Document restrictions that
3827 must be met during module loading.
3828 * modules/gnu.c (changeresyntax, changesyntax): These are blind,
3829 so require an argument to avoid triggering assertion.
3830 (debugfile): Tweak error message.
3832 2006-08-25 Eric Blake <ebb9@byu.net>
3834 * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
3835 (M4_BUILTIN_SIDE_EFFECT): New enumerators.
3836 (struct m4_builtin): New member flags replaces groks_macro_args,
3837 blind_if_no_args. min_args and max_args are now 0-based.
3838 Rearrange members to reduce size on platforms where function
3839 pointers are 64 bits but regular pointers are 32.
3840 (m4_bad_argc): Add argument.
3841 * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
3842 * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
3843 effect into account.
3844 * m4/module.c (install_builtin_table): Adjust all users affected
3846 * m4/macro.c (m4_macro_call): Likewise.
3847 * src/freeze.c (reload_frozen_state): Likewise.
3848 * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
3849 * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
3850 * modules/import.c (builtin_functions): Likewise.
3851 * modules/load.c (builtin_functions): Likewise.
3852 * modules/modtest.c (builtin_functions): Likewise.
3853 * modules/mpeval.c (builtin_functions): Likewise.
3854 * modules/perl.c (builtin_functions): Likewise.
3855 * modules/shadow.c (builtin_functions): Likewise.
3856 * modules/stdlib.c (builtin_functions): Likewise.
3857 * modules/time.c (builtin_functions, mktime_functions)
3858 (strftime_functions): Likewise.
3859 * doc/m4.texinfo (Loops): Update test now that shift is blind.
3860 (Macro Arguments): Fix typo in test.
3861 (Patsubst): Fix typo in test.
3862 * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
3863 end of string. Fix return value when ignore_duplicates.
3864 * tests/builtins.at (patsubst): Fix typo in test.
3866 * tests/options.at (debug-flags): Update to reflect new message.
3867 (deprecated options, prepend-include, help and version): New
3869 * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
3870 test omits an input file name.
3871 * src/main.c (long_options, main): Add -B/--prepend-include.
3872 (usage): Document it.
3873 (main): `m4 --help --version' now displays help, not version.
3874 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3875 dirname filenamecat.
3876 * m4/m4module.h (m4_add_include_directory): Add parameter.
3877 * m4/m4private.h (m4__include_init): New prototype.
3878 * m4/m4.c (m4_create): Put `.' on path before options are
3880 * m4/path.c (includes): Assume C89. Use gnulib for file name
3882 (m4__include_init): New function.
3883 (search_path_add): Allow prepending.
3884 (m4_add_include_directory, search_path_env_init): Adjust callers.
3885 (m4_path_search): Relative names now invoke path search, since
3886 `.' might not be first.
3887 * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
3889 2006-08-25 Bruno Haible <bruno@clisp.org> (tiny change)
3890 and Eric Blake <ebb9@byu.net>
3892 * bootstrap: Run autopoint before gnulib-tool, since autopoint
3893 0.15 installs macros obsoleted by current gnulib.
3895 2006-08-25 Eric Blake <ebb9@byu.net>
3897 * doc/m4.texinfo (Macro Arguments): Another section merged;
3898 testsuite failures now exposed.
3900 2006-08-23 Eric Blake <ebb9@byu.net>
3902 * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
3903 (Input processing): More doc merges from the branch.
3904 (Regular expression syntax): Add introductory text.
3905 (Inhibiting Invocation): More doc merges from the branch.
3906 (Other tokens): Reorder after comments.
3907 * tests/generate.awk: Allow passing options to doc examples.
3909 2006-08-22 Eric Blake <ebb9@byu.net>
3911 * tests/options.at (debug-flags): New test.
3912 * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
3913 not negative, to distinguish failure in m4_debug_decode.
3914 (m4_debug_decode): Add new parameter.
3915 * modules/gnu.c (regexp): Slight cleanup.
3916 (renamesyms): Ignore excess arguments.
3917 (syncoutput): Make case-insensitive, warn on bad argument.
3918 (debugmode): Factor -+ handling out to...
3919 * m4/debug.c (m4_debug_decode): ...here.
3920 (m4_debug_message_prefix): Fix spacing.
3921 * src/main.c (main): Let -d option adjust flags.
3922 * m4/input.c (file_clean): Avoid printing empty file name.
3923 * doc/m4.texinfo (Syncoutput): Document new range of input.
3924 (Invoking m4): Document use of multiple -d flags.
3926 Start porting various fixes from the branch that use gnulib.
3927 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3928 binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
3929 regexprops-generic stdlib-safer unlocked-io.
3930 * m4/debug.c (m4_debug_set_output): Close debug file on exec.
3931 * m4/path.c (m4_path_search): Close input file on exec, reject
3932 empty file name, fix parameter naming.
3933 * m4/output.c (make_room_for): Close diversion file on exec.
3934 (includes): Assume C89 headers.
3935 (tmpfile): For now, we don't want tmpfile-safer, because we want
3937 * m4/m4private.h (includes): Use various gnulib headers.
3938 * doc/regexprops-generic.texi: Use gnulib's copy.
3940 * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
3941 * AUTHORS: Add copyright.
3942 * ChangeLog: Likewise.
3943 * README: Likewise. Require automake 1.9b or later.
3944 * HACKING: New file.
3945 * README-alpha: Add copyright.
3946 * THANKS: Likewise. Update.
3947 * doc/STYLE: Add copyright, and tweak for changed directories.
3948 * modules/README: Add copyright, and tweak for libtool version.
3949 * examples/COPYING: New file.
3950 * examples/WWW/COPYING: Likewise.
3951 * examples/WWW/m4lib/COPYING: Likewise.
3952 * modules/shadow.m4: Add copyright.
3953 * modules/perl.m4: Likewise.
3954 * modules/modtest.m4: Likewise.
3955 * modules/stdlib.m4: Likewise.
3956 * modules/time.m4: Likewise.
3957 * modules/time2.m4: Likewise.
3958 * po/Makevars: Likewise.
3959 * tests/iso8859.m4: Likewise.
3960 * tests/m4.in: Likewise.
3961 * NEWS: Add (C) to copyright.
3963 * m4/system_.h: Likewise.
3964 * tests/atlocal.in: Likewise.
3965 * tests/builtins.at: Likewise.
3966 * tests/freeze.at: Likewise.
3967 * tests/generate.awk: Likewise.
3968 * tests/macros.at: Likewise.
3969 * tests/modules.at: Likewise.
3970 * tests/options.at: Likewise.
3971 * tests/others.at: Likewise.
3972 * tests/testsuite.at: Likewise.
3973 * m4/utility.c: Spell out copyright years.
3974 * src/main.c: Likewise.
3976 * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
3978 2006-08-21 Eric Blake <ebb9@byu.net>
3980 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
3981 * modules/gnu.c (esyscmd): Use -1 for failure. Set sysval to 0
3982 when no arguments are given, but without losing warning about 0
3984 * modules/m4.c (syscmd): Likewise.
3985 (includes): Assume C89.
3986 (m4_sysval): Make static.
3987 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
3988 (sysval): Port calculation from branch.
3990 2006-08-20 Eric Blake <ebb9@byu.net>
3992 * m4/macro.c (expand_macro): Move argument check...
3993 (m4_macro_call): ...to here, so indir will warn.
3994 * modules/gnu.c (__program__): New macro, ported from branch.
3995 (builtin): Perform argument check.
3996 (changesyntax): Avoid out-of-bounds read.
3998 * modules/gnu.c (includes): Assume stdlib.h, errno.
3999 (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
4000 (substitute): Add caller parameter, avoid out-of-bounds memory
4002 (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
4005 2006-08-16 Eric Blake <ebb9@byu.net>
4007 * po/POTFILES.in: Add more files that contain translatable
4009 * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
4010 information to translators.
4011 (USE_MSGCTXT): New var for gettext 0.15.
4012 * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
4013 debug/trace messages in lower case.
4014 * m4/macro.c (expand_argument): Likewise.
4015 * m4/path.c (m4_path_search): Likewise.
4016 * src/main.c (main): Likewise.
4018 2006-08-14 Eric Blake <ebb9@byu.net>
4020 * src/main.c (usage): Document --import-environment.
4021 * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
4023 2006-08-11 Eric Blake <ebb9@byu.net>
4025 * bootstrap (func_get_translations): Only remove files when doing
4027 (func_update_po): Avoid CDPATH problems.
4029 2006-08-10 Eric Blake <ebb9@byu.net>
4031 * bootstrap (func_get_translations): New function.
4032 (func_update_po): Borrow ideas from tar to correctly pull in
4033 translations from newer location.
4035 2006-08-09 Eric Blake <ebb9@byu.net>
4037 * bootstrap: Recent gnulib no longer has jm_* macros to worry
4039 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4041 * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
4042 (m4_error, m4_warn): ... these new prototypes.
4043 (m4_current_file, m4_current_line): Move into context, rather
4044 than leaving as globals.
4045 (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
4046 (m4_undivert_all, m4_input_init): Now takes context.
4047 * m4/utility.c (m4_error, m4_warn): New functions.
4048 * m4/m4private.h: Assume errno exists.
4049 (struct m4): Move warning_status to a bit flag,
4050 and add exit_status. Adjust accessors accordingly.
4051 * src/main.c (print_program_name_CB): No longer needed.
4052 (main): Use new m4_get_fatal_warnings_opt.
4053 * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
4054 instead of issuing "INTERNAL ERROR". Pass context when needed,
4055 and use new accessors.
4056 * m4/input.c: Likewise.
4057 * m4/macro.c: Likewise.
4058 * m4/output.c: Likewise.
4059 * m4/utility.c: Likewise.
4060 * modules/evalparse.c: Likewise.
4061 * modules/gnu.c: Likewise.
4062 * modules/load.c: Likewise.
4063 * modules/m4.c: Likewise.
4064 * modules/mpeval.c: Likewise.
4065 * src/freeze.c: Likewise.
4066 * src/main.c: Likewise.
4067 * tests/macros.at: Adjust to new message format.
4068 * tests/builtins.at: Likewise.
4069 * tests/freeze.at: Likewise.
4070 * tests/modules.at: Likewise.
4071 * doc/m4.texinfo: Likewise.
4073 * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
4076 2006-08-03 Eric Blake <ebb9@byu.net>
4078 * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
4079 gracefully handle ENOSYS.
4083 2006-07-28 Eric Blake <ebb9@byu.net>
4085 * src/freeze.c (reload_frozen_state): Copy string when creating
4086 placeholder, to avoid memory corruption.
4087 * m4/symtab.c (symbol_popval): Avoid memory leak.
4088 (m4_symbol_rename): Avoid shadowing rename function.
4089 (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
4090 * tests/freeze.at (reloading unknown builtin): Add test.
4091 * tests/generate.awk: Capture m4.texinfo line number in
4092 testsuite.log, not just generated.at.
4094 Port idea from branch that a frozen file can request an unknown
4095 builtin without producing a warning unless the builtin is
4097 * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
4098 (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
4099 (m4_set_symbol_value_placeholder): New accessors.
4100 * m4/m4module.h (m4_is_symbol_placeholder),
4101 (m4_get_symbol_value_placeholder),
4102 (m4_set_symbol_value_placeholder),
4103 (m4_get_symbol_placeholder): Likewise.
4104 * m4/symtab.c (m4_is_symbol_value_placeholder),
4105 (m4_get_symbol_value_placeholder),
4106 (m4_set_symbol_value_placeholder): Likewise.
4107 (dump_symbol_CB): Handle new symbol type.
4108 * m4/macro.c (trace_pre): Likewise.
4109 (m4_macro_call): Warn when invoking a placeholder.
4110 * modules/m4.c (dumpdef): Handle dumping a placeholder.
4111 (defn): Warn when referencing a placeholder.
4112 * src/freeze.c (dump_symbol_CB): Ignore placeholder when
4114 (reload_frozen_state): When reloading unknown builtin, install a
4115 placeholder instead of warning.
4116 * tests/freeze.at (loading format 1): Allow warning when
4117 popdef'ing undefined function.
4119 2006-07-27 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
4121 * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
4122 function. Shift by 7, not 3, for consistency with
4123 gnulib/lib/hash.c. Don't assume hash word is 32 bits.
4125 2006-07-27 Eric Blake <ebb9@byu.net>
4127 * src/main.c (usage): Update to match branch.
4128 (main): Update --version info to distinguish between program name
4129 `m4' and package name `GNU M4'.
4130 (AUTHORS): Translate René Seindal's name.
4131 * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
4132 * Makefile.am (doc/m4.1): Update to match branch.
4133 * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
4136 * m4/system_.h (EXIT_MISMATCH): Define.
4137 * src/main.c (main): Don't clear syntax table for version 1.
4138 (usage): Document exit status.
4139 * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
4140 branch, and require V directive to appear first in file. Fix
4141 broken logic for detecting F and T in version 1 files.
4143 2006-07-22 Eric Blake <ebb9@byu.net>
4145 * src/main.c (stackovf_handler): Document the problems in our
4147 * src/stackovf.c: Forward port changes in branch to use POSIX
4148 sa_sigaction when available.
4149 (process_sigsegv): Avoid buffer overrun when error string is
4150 translated, although the fact that we translate in a signal
4151 handler is still a bug.
4152 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
4153 from branch to modernize checks.
4155 * modules/format.c (format): Avoid compiler warning that str may
4156 be used uninitialized.
4158 * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
4160 (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
4161 (DEBUG_MACRO): Remove unused macro.
4162 * src/stackovf.c: Avoid compiler warnings.
4163 * m4/input.c: Likewise.
4164 * m4/module.c: Likewise.
4165 * m4/output.c: Likewise.
4166 * m4/path.c: Likewise.
4167 * m4/symtab.c: Likewise.
4168 * m4/syntax.c: Likewise.
4170 2006-07-20 Eric Blake <ebb9@byu.net>
4172 * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
4173 Regenerate to explicitly ask for --assume-autoconf=2.60.
4175 2006-07-19 Eric Blake <ebb9@byu.net>
4177 * po/ChangeLog: Merge into main ChangeLog, then delete file.
4180 * doc/m4.texinfo (copying): Relax restriction on front-cover and
4183 2006-07-17 Eric Blake <ebb9@byu.net>
4185 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
4188 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
4190 * modules/format.c (includes): Use xvasprintf.h.
4191 (format): Make static. Avoid buffer overflow, that can lead to
4192 arbitrary code execution exploit. Only pass unsigned char to
4193 is*(). Support F, g, and G specifiers.
4194 * doc/m4.texinfo (Format): Expose buffer overrun bug. Document
4197 2006-07-17 Gary V. Vaughan <gary@gnu.org>
4199 Ensure M4 compiles correctly with -DDEBUG, and use a single
4200 consistent definition of various /DEBUG_[A-Z]+/ symbols:
4202 * m4/input.c: Have commented out out DEBUG_INPUT only by default.
4203 (m4_print_token): Use m4_get_symbol_value_text and
4204 m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
4205 and VALUE_FUNC respectively.
4206 (m4__next_token): Use m4_print_token call instead of obsolescent
4208 * m4/module.c: Have commented out out DEBUG_MODULE only by default.
4209 * m4/output.c: Similarly for DEBUG_OUTPUT.
4210 * m4/path.c: Similarly for DEBUG_INCL.
4211 * m4/symtax.c: Similarly for DEBUG_SYM.
4212 * m4/syntax.c: Similarly for DEBUG_SYNTAX.
4213 * src/stackovf.c: Similarly for DEBUG_STACKOVF.
4214 * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
4215 preprocessor macros defined with -DDEBUG compiles.
4217 2006-07-17 Gary V. Vaughan <gary@gnu.org> (tiny change)
4219 * bootstrap: Correct typo in --download-po argument parsing.
4221 2006-07-15 Eric Blake <ebb9@byu.net>
4223 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
4225 * tests/generate.awk (normalize): Recognize @tabchar.
4226 * doc/m4.texinfo (Top): Start merging from branch. Remove tabs.
4227 Fix menus. Upgrade FDL license from 1.1 to 1.2. Fix overfull
4229 (Index macro, Shell commands, Incompatiblities): Rename nodes
4230 from Index, UNIX commands, Other incompat.
4231 (Platform macros, Using frozen files, Frozen file format 1)
4232 (Frozen file format 2, Copying This Manual, Indices): New nodes.
4233 * Makefile.am (EXTRA_DIST): Distribute gendocs.
4234 (MAINTAINERCLEANFILES): Clean up files from gnulib.
4235 (doc_m4_TEXINFOS): Depend on fdl.texi.
4236 (web-manual): New maintainer target.
4238 2006-07-14 Gary V. Vaughan <gary@gnu.org>
4240 * doc/m4.texinfo (Modules): RMS asked me for an explanation of
4241 the modular architecture of M4. The result is paraphrased here
4242 for the benefit of future readers of the manual.
4244 2006-07-14 Gary V. Vaughan <gary@gnu.org> (tiny change)
4246 * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
4248 2006-07-14 Eric Blake <ebb9@byu.net>
4250 * src/main.c (main): Avoid compiler warning.
4251 * modules/gnu.c (renamesyms): Remove unused variable.
4253 2006-07-14 Gary V. Vaughan <gary@gnu.org>
4255 * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
4256 (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
4257 new functions for managing regexp syntax options.
4258 * m4/m4private.h (m4): Add regexp_syntax field.
4259 * m4/resyntax.c: New file implements the above.
4260 * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
4261 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
4262 (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
4263 (m4_patsubst_do, m4_renamesyms_do): Removed.
4264 (builtin_changeresyntax): New builtin to change regular expression
4266 (m4_resyntax_encode_safe): Factor out diagnostics code.
4267 * src/freeze.c (produce_resyntax_dump): New function to dump
4268 default regexp syntax specifier to frozen file.
4269 (reload_frozen_state): Updated to action 'R' directive.
4270 * src/main.c (usage): Describe new -r option.
4271 (long_options, OPTSTRING): Declare it.
4272 (main): Encode and store cli regexp syntax option argument.
4273 * tests/freeze.at (regexp syntax): New test that regexp syntax
4275 * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
4276 * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
4277 (Epatsubst and Patsubst): Renamed to...
4278 (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
4279 documentation and added new examples.
4280 (Changeresyntax): New section describing changeresyntax builtin,
4281 and regexp syntax names.
4282 (Regular expression syntax): New section describing differences
4283 between various regular expression syntaxes.
4284 (Frozen files): Document 'R' directive.
4287 2006-07-13 Gary V. Vaughan <gary@gnu.org>
4289 * bootstrap: Enhanced to work more like our other scripts:
4290 Add a copyright statement; support --version and --help; accept a
4291 --download-po option with argument as a substitute for DOWNLOAD_PO
4294 2006-07-11 Eric Blake <ebb9@byu.net>
4296 * Makefile.am (doc/m4.1): Port patch from branch that avoids
4298 * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
4301 2006-07-10 Gary V. Vaughan <gary@gnu.org> (tiny change)
4303 * tests/builtin.at (patsubst, regexp): Adjust these tests, now
4304 that `\0' is no longer accepted.
4306 * src/main.c (usage): Alphabetize options within their sections.
4308 * modules/gnu.c (m4_regexp_search, regsub, substitute)
4309 (esyscmd): Improve comments.
4311 * modules/gnu.c (substitute): Remove old warning for \0.
4312 (substitute_warned): No longer required. Removed.
4314 * modules/gnu.c: Put macro definitions into alphabetical order.
4316 2006-07-07 Eric Blake <ebb9@byu.net>
4318 * tests/freeze.at (loading format 1): New file, with new test.
4319 * tests/testsuite.at: Include it.
4320 * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
4321 * tests/modules.at (Freezing modules): Likewise.
4323 * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
4324 (AC_CHECK_HEADERS): Assume signal.h.
4325 (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
4326 (AC_CHECK_FUNCS_ONCE): Likewise.
4327 * src/m4.h (includes): Assume signal.h.
4329 2006-07-05 Eric Blake <ebb9@byu.net>
4331 Fix all testsuite failures on cygwin.
4332 * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
4333 branch-1_4. Solves testsuite failure when uninstalled m4 is
4334 shadowed by redefinition of PATH in libtool wrapper.
4335 * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
4336 contains the -no-undefined required by cygwin.
4337 (TESTS_ENVIRONMENT): Export abs_top_builddir.
4338 * tests/others.at (misc): Port to platforms where /etc/passwd
4339 does not exist or does not contain user named root.
4340 * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
4342 * tests/builtins.at (define, divert): Avoid overquoting.
4343 * tests/generate.awk (new_group): Likewise.
4345 2006-07-05 Gary V. Vaughan <gary@gnu.org>
4347 The regs_allocated field in a struct re_pattern_buffer refers
4348 to the state of a particular re_registers struct when used in
4349 successive matches using the same compiled pattern. Avoid a
4350 SEGV in `renamesyms' resulting from using a new re_registers
4351 with an existing re_pattern_buffer:
4353 * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
4354 pattern buffer and registers.
4355 (m4_regexp_search): New function to call re_regexp_search with
4356 correctly matched pattern buffer and register instantiations.
4357 (m4_regexp_compile): Return an m4_pattern_buffer. Adust all
4360 2006-07-04 Gary V. Vaughan <gary@gnu.org>
4362 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
4363 changes to gnulib getopt.m4 since last build.
4364 * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
4365 if the system getopt fails M4_GETOPT tests.
4367 2006-06-22 Eric Blake <ebb9@byu.net>
4369 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
4370 Reported by Bruno Haible.
4372 2006-06-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4374 * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
4376 2006-06-19 Eric Blake <ebb9@byu.net>
4380 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4382 * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
4383 (clean-local): Split into and depend upon...
4384 (clean-local-tests, clean-local-src): ...these two. The latter
4385 removes the libtool object directory below `src', to work around
4386 a buglet in Automake, failing to list it.
4387 (EXTRA_DIST): Distribute modules/perl.c.
4389 2006-06-19 Eric Blake <ebb9@byu.net>
4391 * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
4392 right side of dependency; VPATH does that.
4393 (stamp-vcl): Update to use libtool's algorithm.
4394 (EXTRA_DIST): Distribute stamp-vcl.
4395 Reported by Ralf Wildenhues.
4396 (TESTSUITE): Revert earlier change that used absolute path, as
4397 that broke 'make dist' in VPATH. Stick with $(srcdir) instead.
4398 (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
4399 (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
4400 atlocal takes care of it instead.
4401 (check-local, installcheck-local, clean-local): Inline absolute
4402 path to testsuite here, rather than relative path to testsuite
4405 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4407 * m4/m4private.h (DELETE): Cast away const here...
4408 * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
4409 * src/freeze.c (reload_frozen_state): Avoid uninitialized
4412 2006-06-19 Eric Blake <ebb9@byu.net>
4414 * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
4415 .info pages are built.
4416 Reported by Ralf Wildenhues.
4417 (EXTRA_DIST): Inline definition of testsuite, so that make dist
4420 2006-06-16 Eric Blake <ebb9@byu.net>
4422 Follow recommendations from autoconf manual for autotest.
4423 * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
4424 turn it into an absolute path until autotest provides an option
4425 that allows us to avoid changing directories. Properly quote
4427 (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
4428 (check-recursive): Delete unused target.
4429 ($(TESTSUITE)): Atomically update testsuite.
4430 (CD_TESTDIR): Simplify.
4431 (m4__cd): Delete unused macro.
4432 (check-local): Let TESTSUITEFLAGS influence the run.
4433 (installcheck-local): Let TESTSUITEFLAGS override
4434 AUTOTEST_PATH. Add dependencies.
4435 (clean-local): Clean up.
4436 (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
4437 * README: Document how to use the testsuite.
4439 2006-06-15 Eric Blake <ebb9@byu.net>
4441 * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
4443 * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
4444 clashes with m4sugar.
4445 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
4446 * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
4447 * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
4448 * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
4449 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
4450 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
4451 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
4452 * configure.ac: Likewise.
4453 (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
4454 * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
4456 * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
4458 Reduce compiler warnings. Inside GMP, mpq_t is an array type, so
4459 const mpq_t is not assignable from plain mpq_t. Avoid
4460 type-punning warnings caused trying to mix these types.
4461 * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
4462 (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
4463 * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
4464 (mult_term, exp_term): Remove type-punning casts.
4465 (numb_pow): Remove const qualifier.
4466 * src/freeze.c (reload_frozen_state): Fix typo in messages.
4467 Fix variables that can be used uninitialized, which fixes
4468 security hole where malicious frozen file can execute arbitrary
4471 2006-06-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4473 * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
4475 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4476 and Eric Blake <ebb9@byu.net>
4478 Allow `make dist' to work again.
4479 * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
4480 (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
4481 (cvs-dist): Fix typo.
4482 * NEWS: Match current version number.
4484 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4486 * Makefile.am (AM_CPPFLAGS): Add $(LTDLINCL), so the right
4489 * bootstrap: Do not run libtoolize manually, this is done
4490 correctly by autoreconf. Invoke autoreconf with --no-recursive
4491 to avoid unnecessary rerunning of autotools for libltdl.
4493 2006-06-13 Eric Blake <ebb9@byu.net>
4497 2006-06-12 Eric Blake <ebb9@byu.net>
4499 * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
4501 * src/m4.h: Don't declare mktemp.
4502 * m4/input.c (m4__next_token): Avoid bzero.
4503 * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
4504 * Makefile.am (doc/m4.1): Depend on installed help2man, rather
4505 than distributing outdated helptoman.pl.
4506 * doc/helptoman.pl: Delete.
4508 2006-06-10 Eric Blake <ebb9@byu.net>
4510 * README (Patches): Document the current dependence on CVS
4511 builds of autotools.
4512 * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
4513 * configure.ac: Use consistent quoting throughout.
4514 (AC_PREREQ): Bump to 2.59d.
4515 (AC_INIT): Package name begins with uppercase.
4516 (AC_ARG_WITH): Use AS_HELP_STRING.
4517 (AM_INIT_AUTOMAKE): Enable gnits mode.
4518 (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
4519 (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
4520 (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
4521 done by gnulib or automake, or which autoconf has declared
4523 * m4/m4private.h (Includes): Assume C89 or better, and use errno
4525 * m4/output.c (Includes): Likewise.
4526 * modules/gnu.c (Includes): Likewise.
4527 * modules/m4.c (Includes): Likewise.
4528 * src/m4.h (Includes): Likewise.
4530 * README-alpha: Update web address.
4531 * README: Likewise. Change encoding to ASCII. Remove old advice
4532 about cygwin. Document bootstrapping dependency.
4533 * AUTHORS: Update from branch-1_4.
4534 * THANKS: Likewise. Change encoding to UTF-8.
4535 * BACKLOG: Delete. This file is too old and unmaintained to be
4537 * ChangeLog: Change encoding to UTF-8.
4539 Avoid compiler warnings.
4540 * m4/macro.c (trace_format): Don't mark this as a printf format,
4541 since we don't accept the same set of modifiers as printf. It
4542 would be nice if gcc let us specify a custom format archetype.
4543 * src/main.c (main): Cast away const.
4545 2006-06-10 Andreas Schwab <schwab@suse.de> (tiny change)
4546 Eric Blake <ebb9@byu.net>
4548 * modules/time.c (ctime): Pass correctly typed variable to
4551 (localtime): Likewise.
4552 (strftime): Likewise.
4553 * m4/utility.c (m4_numeric_arg): For now, document arbitrary
4554 limit inherent in this interface.
4556 2006-05-08 Bruno Haible <bruno@clisp.org> (tiny change)
4558 * modules/m4.c (WEXITSTATUS): Provide fallback definition.
4559 (sysval): Use WEXITSTATUS.
4560 * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
4561 big-endian and little-endian wait status definitions.
4563 2006-05-06 Eric Blake <ebb9@byu.net>
4565 * po/Makevars (MSGID_BUGS_ADDRESS): Add.
4566 * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
4569 2006-05-06 Eric Blake <ebb9@byu.net>
4571 * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
4572 subdirectory to use.
4573 (support for -pipe): Move after LT_INIT, since it relies on
4576 2006-05-05 Eric Blake <ebb9@byu.net>
4578 * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
4582 2006-05-05 Bruno Haible <bruno@clisp.org>
4583 and Eric Blake <ebb9@byu.net>
4585 * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
4586 * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
4588 * bootstrap: Update usage of gnulib-tool.
4590 2006-05-04 Eric Blake <ebb9@byu.net>
4592 * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
4595 2005-12-05 Gary V. Vaughan <gary@gnu.org>
4597 * bootstrap (func_update_po): Synch with CVS GNU tar. wget 1.9.x
4598 and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
4599 Reported by Eric Blake <ebb9@byu.net>
4601 2005-12-04 Gary V. Vaughan <gary@gnu.org>
4603 * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
4604 http caching as -C is no longer supported by wget 1.10.x.
4605 Reported by Eric Blake <ebb9@byu.net>
4607 2005-10-20 Gary V. Vaughan <gary@gnu.org>
4609 * m4/module.c (caller_id): To match libtool-2.0 interface, changed
4611 (iface_id): ...an lt_dlinterface_id type.
4612 (m4__module_find): New abstraction for lt_dlhandle_fetch. Use
4613 throughout, instead of calling obsolete lt_dlhandle_find directly.
4614 (m4__module_next): Use multiloader-safe lt_dlhandle_iterate. Use
4615 throughout, instead of calling obsolete lt_dlhandle_next.
4616 * m4/m4private.h (m4__module_find): Declare it.
4617 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
4618 Use m4__module_next instead of obsolete lt_dlhandle_next.
4620 2005-10-20 Gary V. Vaughan <gary@gnu.org>
4622 * bootstrap (func_update_po): Update pofiles directly from the
4623 translation project.
4624 * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
4625 po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
4626 these files under source control anymore.
4627 Suggested by Eric Blake <ebb9@byu.net>
4629 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4631 * ltdl/m4/m4-gnulib.m4: Update FSF contact address. Somehow this
4632 file escaped the address updates on 2005-05-01.
4634 2005-07-07 Gary V. Vaughan <gary@gnu.org>
4636 * bootstrap: Allow user overriding of gnulib-tool location, and
4637 correctly determine module source directories whether gnulib-tool
4638 is given as a relative or absolute path, or is found by searching
4640 Reported by Eric Blake <ebb9@byu.net>
4642 2005-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4644 * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
4645 and $RM are defined for various versions of
4646 AC_LIBTOOL_COMPILER_OPTION.
4648 * bootstrap (AUTORECONF): New variable to allow user overriding of
4651 2005-07-07 Gary V. Vaughan <gary@gnu.org>
4653 * doc/m4.texinfo (History): Add better notes on the ancestory of
4654 GNU m4, and other historical interest.
4656 2005-05-08 Gary V. Vaughan <gary@gnu.org>
4658 * m4/symtab.c (m4_symbol_rename): New function that performs a low
4659 level symbol rename.
4660 * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
4661 * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
4662 (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
4664 (erenamesyms, renamesyms): ...builtins that use these to implement
4665 macro renaming by regular expression.
4666 * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
4667 * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
4668 to stop the new generated tests from choking.
4670 2005-05-07 Gary V. Vaughan <gary@gnu.org>
4672 Since most of the build is handled from a single Makefile.am now,
4673 we can teach make about the dependencies between the m4 binary and
4674 the preopened modules it is built against:
4676 * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
4678 * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
4679 of the preopened modules have changed.
4681 2005-05-07 Gary V. Vaughan <gary@gnu.org>
4683 * configure.ac (gl_MODULES): Add mkstemp for machines that don't
4684 have a native implementation.
4686 2005-05-06 Gary V. Vaughan <gary@gnu.org>
4688 * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed. These are
4689 handled already by gnu/exit.h.
4691 * configure.ac (gl_MODULES): Add assert to support a
4692 --disable-assert configure time option for NDEBUG setting.
4694 * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
4695 * bootstrap (src_modules): Add version-etc-fsf.
4696 * src/main.c (version_etc_copyright): Removed.
4698 * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
4700 2005-05-04 Gary V. Vaughan <gary@gnu.org>
4702 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
4704 * src/freeze.c (produce_frozen_state): Use \n line-endings even
4705 on Windows, so that the frozen file reader will work.
4706 Reported by Josef T. Burger <bolo@bolo.com>
4708 2005-05-04 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
4710 Forward port of a patch that allowed m4-1.4.2 to compile on
4713 * configure.ac (AC_CHECK_HEADERS): Add signal.h,
4715 * src/m4.h: And include them as appropriate.
4716 * src/main.c, src/stackovf.h: Don't include signal.h literally;
4717 m4.h will include the correct file.
4719 2005-05-04 Gary V. Vaughan <gary@gnu.org>
4721 * m4/m4private.h: Make errno visible for the sources patched
4724 2005-05-04 Paul Eggert <eggert@twinsun.com>
4726 * src/main.c (print_program_name_CB): Preserve errno, since
4727 M4ERROR relies on this.
4728 * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
4729 * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
4730 * m4/path.c (m4_path_search): Don't let "free" trash errno when
4733 * m4/output.c (m4_insert_file): Don't assume errno has a valid
4734 value simply because fread returns zero. This fixes a
4735 portability bug reported by Marion Hakanson in
4736 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
4738 2005-05-04 Santiago Vila <sanvila@debian.org>
4740 * tests/stackovf.test: Use tempfile if available.
4742 2005-05-04 Robert Bihlmeyer <robbe@orcus.priv.at> (tiny change)
4744 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
4745 * m4/output.c (m4_insert_file): Do not mix buffered and
4746 unbuffered I/O, as this breaks on the Hurd.
4748 2005-05-04 Gary V. Vaughan <gary@gnu.org>
4750 Gnulib has changed again. Reimport. Adjust. Rinse. Repeat.
4751 Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
4752 and libtoolize does a better job of ltdl importing now too, so
4753 take advantage of that while updating the tree:
4755 * acm4, config: Moved from here...
4756 * ltdl/m4, ltdl/config: ...to here.
4757 * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
4758 src/Makefile.am, tests/Makefile.am: Removed...
4759 * Makefile.am: ...and migrated to here, with adjustments to
4760 compensate for relative path differences.
4761 * commit: Adjust relative paths.
4762 * configure.ac: Adjust relative paths.
4763 (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
4765 (LT_PREREQ): 2.0 isn't released yet, but will work when it is! In
4766 the meanwhile, CVS HEAD libtool is needed.
4767 (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
4768 stricly new enough, we also need a patch.
4769 (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
4770 (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
4771 (gl_MODULES): Don't list getopt and version-etc, as they don't
4773 * bootstrap: After running gnulib-tool to import the listed
4774 modules, fetch getopt and version-etc into src manually.
4775 (ltdldir): Change to ltdl.
4776 * src/main.c: Adjust for changes in version-etc API.
4777 * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
4778 but works when the getopt module isn't to be included in the lib.
4779 * README: Add note about patching autoconf and automake to
4782 2005-05-02 Matt Kraai <kraai@debian.org> (tiny change)
4784 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
4785 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
4786 empty file rather than to a nonexistent file. This closes a
4787 common security hole.
4788 * modules/m4.c (m4_maketemp): Implement the above, by using
4789 mkstemp rather than mktemp.
4791 2005-05-01 Gary V. Vaughan <gary@gnu.org>
4793 The FSF are moving offices today. Changed their contact address
4794 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
4795 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
4797 2005-03-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
4799 * tests/Makefile (clean-local): Ignore testsuite cleanup
4802 2005-03-11 Per Bothner <per@bothner.com> (tiny change)
4804 * tests/Makefile (clean-local): Only run the testsuite cleanup
4805 if the testsuite has been generated.
4807 2005-02-11 Stepan Kasal <kasal@ucw.cz>
4809 * TODO: slight clarification of the example of qindir usage.
4811 2005-02-08 Gary V. Vaughan <gary@gnu.org>
4813 * TODO: Add qindir requirement, and defn bug.
4814 From Stepan Kasal <kasal@ucw.cz>
4816 2005-02-08 Stepan Kasal <kasal@ucw.cz>
4818 * TODO: Add ``execution stack'', fix a typo.
4819 * doc/m4.texinfo: Typos.
4821 2004-12-24 Eric Blake <ebb9@byu.net>
4823 * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
4824 to the gnu subdirectory.
4825 * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
4826 * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
4827 * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
4828 * m4/system_.h: Likewise, in non-configured includes.
4830 2004-10-14 Noah Misch <noah@cs.caltech.edu>,
4831 Gary V. Vaughan <gary@gnu.org>
4833 * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
4834 Protect definitions from macro expansion under -DNDEBUG by
4835 parenthesising the expanded function names.
4836 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
4837 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
4838 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
4839 (m4_is_syntax_macro_escaped): Similarly protect function
4840 definitions from macro expansion under -DNDEBUG by #undefing the
4841 matching macro names before each definition. Also, move all the
4842 function definitions to the end of the file so that any
4843 invocations in the rest of the file pick up the fast macro
4845 * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
4846 (m4_set_debug_file, m4_set_trace_messages)
4847 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
4848 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
4849 (m4_set_max_debug_arg_length_opt): New fast macro versions of the
4850 option setter functions.
4852 2004-09-23 Gary V. Vaughan <gary@gnu.org>
4854 * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
4857 2004-09-23 Gary V. Vaughan <gary@gnu.org>
4859 * src/main.c: Include gnulib files from the correct directory.
4861 * gnulib/*: Don't store any of the gnulib files in arch, as they
4862 generate spurious changes.
4863 * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
4864 gnulib macros now share our macro directory.
4865 (SUBDIRS): Descend into `gnu' rather than `gnulib'.
4866 * bootstrap: Call gnulib-tool to import from the gnulib tree.
4867 (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
4868 gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
4869 the gettext macros from autopoint that overwrite the gnulib-tool
4870 imported versions. Import sources and Makefile.am into the `gnu'
4871 directory. Changed all callers.
4872 * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
4873 gl_INIT): Call these gnulib-tool macros instead of the hardcoded
4874 for imported modules.
4875 * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
4876 acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
4877 hardcoding the gnulib macros they wrap.
4879 2004-07-15 Gary V. Vaughan <gary@gnu.org>
4881 Latest CVS libtool can preload modules in libraries, including
4882 its own module loaders! Tweak m4 so that it doesn't try to treat
4883 libltdl's module loaders as m4 modules when freezing and on exit:
4885 * gnulib/acm4/*.m4: Don't store these files in arch since they
4886 generate spurious changes.
4887 * bootstrap: Simplify initial libtoolize call, since CVS
4888 libtoolize is smarter these days.
4889 * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
4891 * m4/module.h (m4__module_exit): Missing declaration.
4892 * m4/m4private.h (m4__module_next): New function declaration.
4893 * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
4894 encapsulation. Changed all callers.
4895 (m4__module_interface): New function to verify m4 loadable module
4897 (m4__module_init): Register the interface validator.
4898 (m4__module_exit): Only close my own modules.
4899 * modules/m4.c (unistd.h): Provide missing declaration.
4900 (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
4901 (m4_expand_ranges): More missing declarations.
4902 * modules/modtest.c (export_test): Ditto.
4903 * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
4904 * src/main.c (main): Bump copyright year.
4905 * tests/modules.at: Fix sed syntax error.
4908 2004-06-17 Gary V. Vaughan <gary@gnu.org>
4910 Tweaking to enable compilation with latest CVS libtool and
4911 libltdl. We can't just dump the library files directly into the
4912 m4 directory anymore now that libltdl is built from pieces itself:
4914 * bootstrap: Rewritten to use latest libtoolize sanely, and to
4915 set up libltdl subdirectory.
4916 * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
4917 gnulib subdirectory's config.
4918 (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
4919 (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
4921 (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
4922 configure.ac, so use AC_WITH_LTDL instead.
4923 * Makefile.am (SUBDIRS): Add libltdl.
4924 * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated. gnulib now uses
4926 * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
4927 (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
4928 (libm4_la_LIBADD): Add LIBLTDL.
4929 * m4/ltdl.c, m4/ltdl.h: Removed.
4930 * m4/m4module.h: Include canonical ltdl.h.
4933 2004-06-14 Gary V. Vaughan <gary@gnu.org>
4935 * gnulib/import: Now updates makefile fragments, and configure.ac.
4936 * gnulib/m4/gnulib.am: New file. Generated makefile fragments.
4937 * gnulib/m4/Makefile.am: include it.
4938 * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
4939 gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
4940 gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
4941 gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
4942 gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
4943 * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
4944 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
4945 gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
4946 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
4947 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
4948 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
4949 gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
4950 gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
4952 * gnulib/m4/getopt_int.h: New source file from latest gnulib
4954 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
4955 gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
4956 gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
4957 gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
4958 Updated source files from latest gnulib.
4960 2004-02-29 Gary V. Vaughan <gary@gnu.org>
4962 * config/mailnotify: New file for mailing commit notifications,
4963 imported from cvs-utils.
4964 * commit: Updated from cvs-utils and tweaked for m4.
4966 2003-12-01 Gary V. Vaughan <gary@gnu.org>
4968 * config/mkstamp: Updated from CVS libtool.
4969 * configure.ac: Generate a gnu coding standards compliant version
4970 number, and use it for the banner.
4971 * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
4972 mhen the TIMESTAMP changes in ChangeLog, but the file modification
4973 time doesn't (e.g. in cvs commit). Otherwise dist tarballs will
4974 contain the previous version number.
4975 * src/main.c: Make --version output conform to the GNU standard.
4977 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
4978 * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
4979 m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
4980 shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
4981 time_la_SOURCES): ...so that these are defaulted correctly, and
4982 can be removed from this file.
4983 (AM_LDFLAGS): Add -module...
4984 (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
4985 traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
4986 import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
4987 the individual settings can be removed.
4988 * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
4989 * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
4990 m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
4991 shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
4992 time_la_LIBADD): ...so that these are picked up as a deplib of
4993 libm4 and don't need to be set explicitly.
4995 2003-11-18 Gary V. Vaughan <gary@gnu.org>
4997 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
4998 from the standard build. It is too fragile.
5000 * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
5001 CVS libtool after merging m4 changes across to libtool.
5003 * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
5004 * m4/path.c (search_path_add): Ditto.
5006 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5008 * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
5009 libtool tags we don't use in configure. This reduces the size
5010 of the script from over 1Mb to under 700Kb.
5012 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5014 The import script was not written properly, and the last gnulib
5015 import was incomplete. Fixed that problem, and reimport our
5016 gnulib dependencies, which picks up the address calculation
5017 overflow checks described by Paul below. Also tweak the clients
5018 of the gnulib xalloc module not to use deprecated macros:
5020 * gnulib/import: Recurse through module dependencies rather than
5021 naively descending only one level.
5022 * configure.ac: Add calls to gnulib's strnlen and extension module
5024 * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
5026 * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
5027 gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
5028 gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
5029 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
5031 * gnulib/acm4/libtool.m4: Updated from CVS libtool.
5032 * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
5033 place of `xcalloc (1, S)'.
5034 * m4/m4.c (m4_create): Likewise.
5035 * m4/m4private.h (m4_symbol_value_create): Likewise.
5036 * m4/symtab.c (symtab_fetch): Likewise.
5037 * m4/syntax.c (m4_syntax_create): Likewise.
5038 * src/freeze.c (reload_frozen_state): Likewise.
5039 * m4/path.c (search_path_add): Eliminate use of deprecated NEW
5041 * m4/symtab.c (m4_symtab_create): Likewise.
5043 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5045 * tests/module.at: Comment typo.
5047 2003-10-10 Gary V. Vaughan <gary@gnu.org>
5049 * tests/modules.at (modules: importing): Apply some lateral
5050 thinking, and use AT_CHECK to compare the output of a sed pass
5051 over stderr against the canonical strerror string.
5053 * tests/modules.at (modules: importing): Edit the generated stderr
5054 output to canonicalize strerror output, before a comparison.
5056 2003-10-10 Gary V. Vaughan <gary@gnu.org>
5058 Tru64UNIX perl is sloppy with namespace pollution. This patch is
5059 careful not to trip over the mess:
5061 * modules/perl.c: Some builds of perl install headers that contain
5062 `#define try __builtin_try'. Be sure to undefine that macro
5063 before `m4/hash.h' gets included, which uses the `try' symbol.
5064 * m4/system_.h: Similarly for `bool'. Undefine `bool', `true' and
5065 `false' before including `stdbool.h'.
5066 (DELETE): This symbol is not in m4's namespace, and is in any
5067 case only used internally...
5068 * m4/m4private.h (DELETE): ...so move it to here.
5069 Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
5071 2003-10-08 Paul Eggert <eggert@twinsun.com>
5073 Don't use XMALLOC and XCALLOC. Once we install the
5074 corresponding patch into gnulib, this will fix some
5075 address-calculation overflow bugs on hosts where calloc (A, B)
5076 returns garbage when A*B overflows.
5078 * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
5079 maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
5080 xmalloc, XCALLOC with xcalloc.
5081 * m4/m4.c (m4_create): Likewise.
5082 * m4/m4private.h (m4_symbol_value_create): Likewise.
5083 * m4/output.c (m4_output_init): Likewise.
5084 * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
5085 * m4/syntax.c (remove_syntax_attribute): Likewise.
5086 * src/freeze.c (reload_frozen_state): Likewise.
5087 * src/main.c (main): Likewise.
5089 2003-10-07 Gary V. Vaughan <gary@gnu.org>
5091 * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
5092 gnulib/acm4 directories for aclocal m4 macros.
5093 * gnulib/Makefile.am (EXTRA_DIST): Removed.
5094 (MAINTAINERCLEANFILES): Add Makefile.in.
5095 * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
5097 * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
5098 * gnulib/import: New file. Temporary script for updating gnulib
5099 imported files, until gnulib-tool is working.
5100 * gnulib/config/codeset.m4, gnulib/config/error.m4,
5101 gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
5102 gnulib/config/getopt.m4, gnulib/config/gettext.m4,
5103 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
5104 gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
5105 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
5106 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
5107 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
5108 gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
5109 gnulib/config/nls.m4, gnulib/config/obstack.m4,
5110 gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
5111 gnulib/config/progtest.m4, gnulib/config/realloc.m4,
5112 gnulib/config/regex.m4, gnulib/config/restrict.m4.
5113 gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
5114 gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
5115 gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
5116 gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
5117 gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
5118 gnulib/config/xstrndup.m4: Removed.
5119 * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
5120 gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
5121 gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
5122 gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
5123 gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
5124 gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
5125 gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
5126 gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
5127 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
5128 gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
5129 gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
5130 gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
5131 gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
5132 gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
5133 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
5134 gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
5135 gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
5136 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
5137 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
5138 gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
5139 gnulib/import script.
5140 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
5141 gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
5142 gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
5143 gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
5144 gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
5145 gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
5146 gnulib with gnulib/import script.
5147 * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
5148 guards ready for gnulib-tool to autoupdate on import.
5149 * config/debug.m4, config/gmp.m4, config/m4-error.m4,
5150 config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
5151 config/stackovf.m4: Moved from here...
5152 * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
5153 acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
5154 acm4/stackovf.m4: ...to here, to separate aclocal macros from
5155 configure time helper scripts.
5156 * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
5157 * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
5158 m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
5159 src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
5161 * src/main.c (version_etc_copyright): Only output the current
5163 (version_etc): Call with new variadic API.
5165 2003-09-16 Gary V. Vaughan <gary@gnu.org>
5167 * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
5168 version-etc module from CVS gnulib.
5169 * po/POTFILES.in: Add gnulib/m4/version-etc.c.
5170 * src/Makefile.am: Build it.
5171 * src/main.c: Use it.
5173 * gnulib/m4/exit.h: Import exit module from CVS gnulib.
5174 * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
5175 * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
5178 2003-09-15 Charles Wilson <cygwin@cwilson.fastmail.fm>,
5179 Gary V. Vaughan <gary@gnu.org>
5181 * bootstrap: Separate options.
5182 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
5183 * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
5185 * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
5186 (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
5187 (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
5188 (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
5189 $(LTLIBINTL) for gettext support on cygwin.
5190 * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
5191 have $(LTLIBINTL) from the preloaded module la files.
5192 * README: Remove the warning about using --disable-nls on Windows
5195 2003-09-15 Gary V. Vaughan <gary@gnu.org>
5197 * gnulib/m4/regex.c: s/<regex.h>/"regex.h"/ or else the compiler
5198 picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
5201 2003-09-12 Gary V. Vaughan <gary@gnu.org>
5203 * doc/STYLE: Document the gnulib header naming conventions, and
5205 * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
5206 gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
5207 gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
5209 * gnulib/m4/Makefile.am: Remove the rules to build these headers.
5211 * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
5212 module from CVS gnulib.
5213 * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
5214 (gl_FUNC_STRTOL): In favour of the module macro.
5216 2003-09-12 Gary V. Vaughan <gary@gnu.org>
5218 Replace the getopt code with CVS gnulib getopt. The source files
5219 detect whether they are in a glibc environment and preprocess away
5220 all of the code if there is a system getopt, so we can compile
5221 them into the m4 executable unconditionally:
5223 * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
5224 gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
5225 * configure.ac (gl_GETOPT): Use this instead of homebrew inline
5227 * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
5229 * src/Makefile.am: Adjust.
5230 * src/main.c: Always include our shipped getopt.h.
5231 * po/POTFILES.in: Use new location of getopt.c.
5233 2003-09-12 Gary V. Vaughan <gary@gnu.org>
5235 * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
5236 * config/Makefile.am: Removed. Automake 1.8 distributes the files
5237 in this directory automatically.
5238 * Makefile.am (EXTRA_DIST): Except config/mkstamp.
5240 * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
5242 * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
5244 * modules/Makefile.am (pkglibexecdir): Set it here.
5245 (pkgmodincdir): Renamed to pkgmodincludedir). Changed all clients.
5247 * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
5248 Import regex module from CVS gnulib.
5249 * gnulib/config/restrict.m4: Ditto for dependee module restrict.
5250 * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
5251 do extra substitutions for Makefile.
5252 * configure.ac: Use it.
5253 * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
5254 from regex_.h if necessary.
5255 * m4/system_.h: Include the correct version of regex.h.
5256 * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
5258 * po/POTFILES.in: Use new location of regex.c.
5260 * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
5261 realloc.c: automake distributes these files already.
5263 2003-09-12 Gary V. Vaughan <gary@gnu.org>
5265 Replace the xstrzdup code by importing the xstrndup module from
5266 CVS gnulib, along with its dependencies: strndup and strnlen:
5268 * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
5269 gnulib/config/xstrndup.m4: Import xstrndup module from CVS
5271 * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
5272 gnulib/config/strndup.m4: Ditto wrt strndup.
5273 * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
5275 * gnulib/m4/Makefile.am: Add rules from newly imported modules.
5276 However, contrary to gnulib, we install xstrndup.h.
5277 * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
5278 * gnulib/lib/xstrzdup.c: Delete. This was never a gnulib file, it
5279 is an artifact of the old m4 portability layer.
5280 * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
5281 * m4/system_.h: Include xstrndup.h.
5282 * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
5284 2003-09-11 Gary V. Vaughan <gary@gnu.org>
5286 Reimport the latest xalloc module from CVS gnulib, and adjust the
5287 m4 sources to take advantage of xalloc xfree. Also create a new
5288 macro DELETE with the same semantics as the old m4 XFREE macro,
5289 and carefully tweak callers:
5291 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
5293 * m4/utility.c (xfree): Removed. This function is now supplied by
5295 * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
5296 * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
5297 * m4/symtab.c (m4_symtab_create): Ditto.
5298 * m4/system_.h: Removed XFREE redefine.
5299 (DELETE): New macro with same functionality as the original m4
5300 XFREE macro, but based on xalloc.h now. Changed all callers.
5301 * src/main.c (main): Use XMALLOC macro.
5302 * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
5304 * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
5306 2003-09-10 Gary V. Vaughan <gary@gnu.org>
5308 Import the xalloc module from CVS gnulib, along with its
5309 dependencies: exitfail, malloc and realloc. We had different
5310 semantics for our XFREE and a function xfree() not supplied by
5311 gnulib, so also a bit of work to keep everything running
5314 * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
5315 (gl_XALLOC): Use gnulib equivalents.
5316 * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
5317 gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
5318 * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
5319 * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
5321 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
5322 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
5323 * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
5325 (pkgincdir): Removed. Use pkgincludedir instead.
5326 * m4/m4private.h (XFREE): xfree already checks for NULL.
5327 * m4/system_.h: Use xalloc module, and remove macros already
5328 supplied by xalloc.h.
5329 * m4/utility.c (xfree): xalloc does not yet implement xfree, so
5330 moved the old definition from m4/xmalloc.c to here for now.
5332 2003-09-09 Gary V. Vaughan <gary@gnu.org>
5334 Import the error and progname modules from CVS gnulib. Our old
5335 error.c subsumed the functionality of both, so a little adjustment
5336 was required to accomodate the split in sources. Also added more
5337 wrapper macros to choose between a system installed error.h or our
5338 shipped gnulib error module:
5340 * m4/error.c, m4/error.h: Removed.
5341 * m4/Makefile.am: Adjust.
5342 (pkgincdir): Removed. Use pkgincludedir instead.
5343 * m4/module.h, src/main.c: Don't include `m4/error.h'.
5344 * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
5346 * gnulib/m4/progname.c: Imported from CVS gnulib.
5347 * gnulib/m4/progname.h: Ditto.
5348 * src/main.c: Adjust to use progname module.
5349 * gnulib/m4/error.c: Imported from CVS gnulib.
5350 * gnulib/m4/error_.h: Ditto.
5351 * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
5352 if appropriate, and link a local error.h if the system version is
5354 (libgnu_la_SOURCES) Add progname module sources.
5355 * gnulib/config/error.m4: Imported from CVS gnulib.
5356 * gnulib/config/strerror_r.m4: Ditto.
5357 * config/m4-error.c: New file. Wrap gnulib error.m4 but arrange
5358 to have ERROR_H for Makefile substitutions and tell system.h
5359 whether the system error.h should be used, or a locally installed
5361 * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
5363 2003-09-09 Gary V. Vaughan <gary@gnu.org>
5365 * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
5366 s/gettext_.h/gettext.h/.
5368 * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
5369 automake have been fixed.
5371 * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
5372 gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
5373 of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
5374 rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
5376 2003-09-09 Gary V. Vaughan <gary@gnu.org>
5378 The gnulib obstack module requires the gnulib gettext module for
5379 systems that do not have GNU gettext installed. Because we use
5380 -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
5381 that directory incase it clashes with the system gettext.h. This
5382 delta uses gettext_.h and extra rules in the Makefile to make a
5383 link to gettext.h when needed:
5385 * Makefile.am (auxdir): Removed. No longer used.
5386 * configure.ac (ac_aux_dir): Removed AC_SUBST. No longer used.
5387 (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
5389 (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
5390 Makefile based build.
5391 (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
5392 of the macros are kept.
5393 * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
5394 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
5395 * config/Makefile (ACLOCAL_MACROS): Removed. Automake 1.7a
5396 distributes these automatically.
5397 * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
5398 warning from automake-1.7a.
5399 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
5400 m4_CHECK_DEBUGGING for consistency with gnulib prefixes. Changed
5402 * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
5403 wrt. m4_FUNC_OBSTACK.
5404 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
5405 wrt. m4_sys_STACKOVF.
5406 * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
5407 wrt. _m4_LIB_GMP, m4_LIB_GMP.
5408 (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
5409 namespace. Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
5411 * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
5412 * gnulib/m4/Makefile.am: Added a new block to make an appropriate
5413 gettext.h link on deficient systems.
5414 (pkginc_HEADERS): Mention $(GETTEXT_H).
5415 (EXTRA_HEADERS): Mention gettext.h.
5416 * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
5417 * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
5418 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
5419 gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
5420 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
5421 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
5422 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
5423 gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
5424 gnulib/config/po.m4, gnulib/config/progtest.m4,
5425 gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
5426 gnulib/config/ulonglong.m4: Imported from CVS gnulib.
5428 2003-09-05 Gary V. Vaughan <gary@gnu.org>
5430 We can't mirror the gnulib directory structure here, since we need
5431 to be able to eg. `#include <m4/obstack.h>' from our source files,
5432 which is much easier if the local obstack.h is created in a
5433 directory named m4. Rather than trying to symlink everything into
5434 the m4 directory, now we build a libtool convenience library from
5435 the sources we get from gnulib and link that with libm4.la:
5437 * gnulib/config/extensions.m4: Imported from CVS gnulib.
5438 * gnulib/config/unlocked-io.m4: Ditto.
5439 * gnulib/m4/unlocked-io.h: Ditto.
5440 * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
5441 gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
5442 * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
5443 gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
5444 * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
5445 * m4/Makefile.am: Adjust.
5446 * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
5447 macros we redistribute.
5448 * gnulib/m4/Makefile.am: New file. Build libgnu.la convenience
5449 library among others.
5450 (GNULIB_SRCS, GNULIB_MACROS): Removed.
5451 * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
5452 * config/m4-obstack.m4: Adjust.
5453 * po/POTFILES.in: Adjust.
5454 * configure.ac: Reformatting. Call newly imported gnulib macros.
5455 * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
5456 bogus calls of `#include "m4.h"'.
5457 * Makefile.am: INCLUDES has been deprecated in favour of
5459 * m4/Makefile.am: Ditto.
5460 * modules/Makefile.am: Ditto.
5461 * src/Makefile.am: Ditto.
5463 2003-09-05 Gary V. Vaughan <gary@gnu.org>
5465 * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
5467 2003-09-04 Gary V. Vaughan <gary@gnu.org>
5469 Migrate the obstack support into the gnulib directories for easy
5470 synchronisation with upstream files in gnulib:
5472 * config/gnu-obstack.m4: Moved from here...
5473 * config/m4-obstack.m4: ...to here.
5474 * config/Makefile.am (SPECIFIC_MACROS): Adjust.
5475 * m4/obstack.c, m4/obstack_.h: Moved from here...
5476 * gnulib/obstack.c, gnulib/obstack.h: ...to here.
5477 * po/POTFILES.in: Adjust.
5478 * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
5479 * m4/Makefile.am: Add a whole new section to link the obstack
5480 sources from the gnulib tree if necessary.
5481 * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
5483 * config/m4-obstack.m4: Rewrite as a wrapper for
5484 gnulib/m4/obstack.m4.
5486 2003-09-04 Gary V. Vaughan <gary@gnu.org>
5488 GNU M4 currently builds with a number of files adapted from
5489 upstream sources. Recently the gnulib project on savannah.gnu.org
5490 has pulled together a great many of these externally maintained
5491 files. This delta is the beginnings of isolating those files
5492 maintained in gnulib to make it easy to synchronise M4 with the
5493 upstream files prior to releases.
5495 * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
5497 (SUBDIRS): Added new gnulib subdirectory.
5498 * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
5499 * config/stdbool.m4: Moved from here...
5500 * gnulib/m4/stdbool.m4: ...to here.
5501 * m4/stdbool_.h: Moved from here...
5502 * gnulib/lib/stdbool_.h: ...to here.
5503 * gnulib/Makefile.am: New file. Make sure the gnulib tree is
5505 * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
5506 code to work with new stdbool_.h location.
5507 (gnulib_srcdir): New.
5509 2003-09-04 Gary V. Vaughan <gary@gnu.org>
5511 * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
5512 (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
5514 (SPECIFIC_TOOLS): New variable. Moved mkstamp to here.
5515 (EXTRA_DIST): Use it.
5517 * bootstrap: CVS autoreconf leaves file droppings. Remove
5518 aclocal.m4t incase autoreconf doesn't.
5520 2003-08-29 Gary V. Vaughan <gary@gnu.org>
5522 * m4/gnu-obstack.h: Updated from CVS gnulib. For consistency with
5523 the other gnulib imports, renamed to m4/obstack_.h.
5524 * m4/obstack.c: Updated from CVS gnulib.
5525 * m4/Makefile.am (EXTRA_HEADERS): Adjust.
5526 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
5527 header tests from gnulib obstack module. AC_CONFIG_LINKS knows
5528 about vpath already, and $top_srcdir upsets CVS Automake, so the
5529 $top_srcdir reference was removed.
5531 * m4/system-h.in: For consistency with the gnulib imports, renamed
5533 * m4/Makefile (EXTRA_HEADERS): Adjust.
5534 * configure.ac (AC_CONFIG_FILES): Adjust.
5536 * m4/stdbool_.h: New file from gnulib for systems without their
5538 * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
5539 * config/stdbool.m4: New file. Macros from gnulib for same.
5540 * configure.ac: Use it.
5542 2003-08-27 Gary V. Vaughan <gary@gnu.org>
5544 * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
5545 * config/gmp.m4: Ditto.
5546 * config/gnu-obstack.m4: Ditto.
5547 * config/stackovf.m4: Ditto.
5548 * m4/builtin.c: Ditto.
5549 * m4/debug.c: Ditto.
5550 * m4/error.c: Ditto.
5551 * m4/error.h: Ditto.
5552 * m4/gnu-obstack.h: Ditto.
5555 * m4/input.c: Ditto.
5557 * m4/m4module.h: Ditto.
5558 * m4/m4private.h: Ditto.
5559 * m4/macro.c: Ditto.
5560 * m4/module.c: Ditto.
5561 * m4/obstack.c: Ditto.
5562 * m4/output.c: Ditto.
5564 * m4/regex.c: Ditto.
5565 * m4/regex.h: Ditto.
5566 * m4/strtol.c: Ditto.
5567 * m4/symtab.c: Ditto.
5568 * m4/syntax.c: Ditto.
5569 * m4/utility.c: Ditto.
5570 * m4/xmalloc.c: Ditto.
5571 * m4/xstrdup.c: Ditto.
5572 * m4/xstrzdup.c: Ditto.
5573 * modules/evalparse.c: Ditto.
5574 * modules/format.c: Ditto.
5575 * modules/gnu.c: Ditto.
5576 * modules/import.c: Ditto.
5577 * modules/load.c: Ditto.
5578 * modules/m4.c: Ditto.
5579 * modules/m4.h: Ditto.
5580 * modules/modtest.c: Ditto.
5581 * modules/mpeval.c: Ditto.
5582 * modules/perl.c: Ditto.
5583 * modules/shadow.c: Ditto.
5584 * modules/stdlib.c: Ditto.
5585 * modules/time.c: Ditto.
5586 * modules/traditional.c: Ditto.
5587 * src/freeze.c: Ditto.
5588 * src/getopt.c: Ditto.
5589 * src/getopt1.c: Ditto.
5591 * src/main.c: Ditto.
5592 * src/stackovf.c: Ditto.
5594 * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
5595 ac_default_headers is an autoconf internal variable.
5596 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
5597 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
5599 * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
5600 * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
5603 2003-08-15 Gary V. Vaughan <gary@gnu.org>
5605 * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
5607 * system-h.in (m4_boolean): Removed in favour of using C99 bool if
5608 possible or faking one with a typedef. Changed all callers.
5610 2003-08-15 Gary V. Vaughan <gary@gnu.org>
5612 Still cleaning up the users' module API, by taking out the stuff
5613 that isn't used by any existing modules, and moving specialised
5614 functions out of libm4 and into the module they are used by.
5616 * m4/m4module.h (m4_skip_space): No need to export this. Moved...
5617 * m4/utility.c (m4_skip_space): ...to here the home of its only
5618 use, made static and renamed to `skip_space'. Changed all
5620 * m4/m4module.h (m4_expand_ranges): Removed prototype.
5621 * m4/utility.c (m4_expand_ranges): Moved definition from here...
5622 * modules/m4.c (m4_expand_ranges): ...to here, and exported using
5624 * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
5626 * modules/gnu.c (builtin_syntax): Import and use in this
5627 builtin implementation.
5628 * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
5630 * m4/macro.c (trace_flush): Except here where the macro is now
5632 * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
5633 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
5635 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
5636 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
5638 2003-08-14 Gary V. Vaughan <gary@gnu.org>
5640 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
5641 compiler based AC_CHECK_HEADER that was introduced in
5643 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
5644 * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
5645 * configure.ac: Use renamed M4_AC_LIB_GMP.
5647 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
5648 macro that requires arguments! This stops the shell's bad
5649 substitution error at configure time.
5651 * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
5652 variables to the testsuite shell. Set the value of USE_GMP so
5653 that the gmp test will run!
5654 (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
5656 2003-08-11 Gary V. Vaughan <gary@gnu.org>
5658 Libltdl already has an excellent mechanism for accessing C symbols
5659 in modules. Lets use that! Remove all the exporting cruft and
5660 just use lt_dlsym in conjunction with a few conventions to
5661 simplify module writers' jobs. Also removed the table address
5662 caching code and otherwise simplified the module loader quite a
5663 bit. To access exported symbols in other modules, first the
5664 exporting module must name the symbols <modname>_LTX_<symname>,
5665 and the importing module must define a function type called
5666 <symname>_func. The importer then adds
5667 M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
5668 that wishes to call out to the exported functions. Care must be
5669 taken that <symname> is non-NULL in the importing module incase
5670 M4_MODULE_IMPORT fails, but otherwise it can be called as if the
5671 definition was in the importers source. Study
5672 `modules/{gnu.c,m4.{c,h}' for a model example. At the moment,
5673 m4_module_import will attempt to automatically load a module
5674 required for symbol access if it is not loaded already.
5676 * TODO: Removed the items fixed in this delta.
5677 * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
5679 * m4/ltdl.h (lt_dlhandle_find): Declare it.
5680 * m4/module.c (m4_module_unload): Use it.
5681 * src/freeze.c (reload_frozen_state): Ditto.
5682 * m4/m4module.h (m4_export): Deleted. Removed all references.
5683 (M4_MODULE_IMPORT): New user convenience macro for importing
5684 arbitrary symbols from other modules.
5685 * m4/module.c (m4_module_import): New function to service
5686 M4_MODULE_IMPORT macro.
5687 (module_data): Removed. Looking up the tables on demand with
5688 lt_dlsym, rather than caching their addresses here simplifies the
5690 (m4_get_module_builtin_table, m4_get_module_macro_table):
5691 Removed. Changed all callers.
5692 (set_module_macro_table, set_module_builtin_table): Renamed to
5693 install_macro_table and install_builtin_table respectively, and
5694 simplified now that the cache is no more.
5695 * modules/gnu.c (builtin_symbols): Use this new mechanism to
5696 import m4_dump_symbols from the m4 module.
5697 (builtin_esyscmd): Likewise for m4_set_sysval and
5699 * modules/m4.c (m4_export_table): Removed. Functions are
5700 addressed with the new mechanism which doesn't need this.
5701 (m4_set_sysval): New exported accessor function to prevent
5702 problems with variable access on inferior architectures.
5703 * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
5704 (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
5705 that we can have some type safety.
5706 * modules/modtest.c (export_test): C level exported function for
5707 testing the new import mechanism.
5708 * modules/import.c: New file for the import end of the test.
5709 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
5710 * tests/modules.at: New test cases for intermodule symbol
5713 2003-08-07 Gary V. Vaughan <gary@gnu.org>
5715 * m4/m4module.c (m4_string): Moved from here...
5716 * m4/m4private.c (m4_string): ...to here.
5718 * m4/utility.c (dumpdef_cmp): Removed stale declaration.
5720 2003-07-29 Gary V. Vaughan <gary@gnu.org>
5722 * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
5723 already available to module writers through
5724 m4_{get,set}_nesting_limit_opt(), so moved from here...
5725 * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
5726 (m4_create): Use it.
5728 2003-07-28 Gary V. Vaughan <gary@gnu.org>
5730 Aside from auditing path.c for m4module.h api obfuscation, this
5731 delta introduces the concept of private struct members in opaque
5732 data types to GNU m4: See the STYLE file for details.
5734 * TODO: Remind ourselves that a rewrite of path.c is needed.
5735 * m4/m4module.h (m4_search_path, struct m4_search_path_info):
5737 * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
5738 here and renamed. These type definitions are for internal api use
5739 only. Changed all callers.
5740 * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
5742 * m4/path.c (search_path_env_init, search_path_add): ...to here
5743 and renamed. These calls were never used outside this file.
5744 Changed all callers.
5745 (dirpath): Moved functionality of this static declaration...
5746 * m4/m4private.h (struct m4): ...to this new internal only
5747 search_path field. Changed all callers.
5748 (m4__get_search_path): Added new internal api accessor.
5749 * m4/path.c (m4_search_path_info_new): Removed. Not used.
5750 (m4_include_init): Removed...
5751 * m4/m4.c (m4_create): ...because the new m4 field is now
5753 (m4_delete): Recycle search_path memory.
5754 * src/main.c (main): Don't call m4_include_init now that it's
5756 * doc/STYLE: Document convention for private fields in opaque
5759 2003-07-24 Gary V. Vaughan <gary@gnu.org>
5761 Sometimes exporting the address of a symbol from a module isn't
5762 enough for other modules to call that symbol correctly. If
5763 custom data types are used for function parameters, they need to
5764 be known to the caller. This change introduces the concept of
5765 $(prefix)/include/modules/$(modulename).h to declare those
5766 structures. Also we move m4_dump_symbols from libm4 to the m4
5767 module to show this concept in action.
5769 * m4/m4module.h (m4_dump_symbol_data): Moved from here...
5770 * modules/m4.h (m4_dump_symbol_data): ...to this new file for
5771 exporting data structures from modules/m4.c.
5772 * modules/m4.c, modules/gnu.c: Include it.
5773 * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
5774 * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
5776 * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
5778 * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
5779 ...to here, with slight renaming.
5780 (m4_export_table): Prototype and add m4_dump_symbols.
5781 * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
5782 definition of m4_dump_symbols.
5783 * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
5784 * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
5786 2003-07-24 Gary V. Vaughan <gary@gnu.org>
5788 Create an export table in modules/m4.c in readiness for beefing up
5789 the module loader to track module exports and imports.
5791 * m4/m4module.h (m4_debug_flush_files): Removed prototype.
5792 * m4/debug.c (m4_debug_flush_files): Moved...
5793 * modules/m4.c (m4_sysval_flush): ...to here and renamed.
5794 * modules/gnu.c (builtin_esysval): Use it.
5795 * m4/m4module.h (m4_export): New type for declaring module symbols
5797 * modules/m4.c (m4_export_table): List symbols exported from this
5798 module for use by other modules.
5800 2003-07-24 Gary V. Vaughan <gary@gnu.org>
5802 An experiment: There is loads of code in libm4 which should be in
5803 the m4 module, but is also used by another module. Just because
5804 some linkers won't cope with calls across dynamic runtime loaded
5805 objects I initially left the code in libm4. It will tidy the
5806 module api immensely if this code moves to the right place, I just
5807 need to remember to invent a suitable calling mechanism at some
5808 point. For now, only modules that are statically linked and
5809 preloaded will get this treatment, so the only platforms that will
5810 break are those that require all symbols to be resolved at link
5813 * TODO: Reminder that what I am doing could reduce portability
5814 unless I do something more robust later.
5815 * m4/m4module.h (m4_sysval): No longer exported from libm4.
5816 * m4/utility.c (m4_sysval): No longer declared in libm4.
5817 * modules/Makefile.am: Reformatting.
5818 * modules/m4.c (m4_sysval): Declare it at place of use.
5819 * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
5821 2003-07-23 Gary V. Vaughan <gary@gnu.org>
5823 * m4/m4module.h: Reformatting and rearranging lines a bit.
5824 (m4_obstack): Save typing by typedefing `struct obstack'. Changed
5826 (m4_call_macro, m4_expand_input): Renamed...
5827 (m4_macro_call, m4_macro_expand_input): ...to these. Changed all
5829 (m4_expansion_level, m4_process_macro): Moved...
5830 * m4/macro.c (expansion_level, process_macro): ...to here, and
5833 * m4/m4module.h (program_name): Not used by modules at all, so
5835 * src/main.c (program_name): ...to here.
5836 (print_program_name): Renamed...
5837 (print_program_name_CB): ...to conform to the STYLE guide.
5839 2003-07-23 Gary V. Vaughan <gary@gnu.org>
5841 More refactoring of the m4module.h API. Replace #defines with an
5842 enum, and move non-public functions out of the public API.
5844 * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
5846 * m4/macro.c (stdarg.h): Add ANSI C variadic header.
5847 * m4/debug.c (m4_debug, trace): Moved...
5848 * m4/m4private.h (struct m4): ...to fields of this struct.
5849 (m4_get_debug_file, m4_get_trace_messages): New fast access macros
5851 * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
5852 * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
5853 * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
5854 * m4/m4module.h (m4_context_field_table): Add entries for new
5855 debug_file and trace_messages fields.
5856 (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
5857 (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
5858 (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
5859 (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
5860 (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
5861 (m4_is_debug_bit): New macro to simplfy checks against the debug
5863 (m4_trace_format, m4_trace_header, m4_trace_flush)
5864 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
5866 * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
5867 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
5868 * m4/macro.c (trace_format, trace_header, trace_flush)
5869 (trace_prepre, trace_pre, trace_post): ...to these newly static
5870 functions, since they are only ever used from this file. Changed
5873 2003-07-17 Gary V. Vaughan <gary@gnu.org>
5875 Change the macros for checking syntax so that matching against
5876 multiple possible syntax classes can be done with a single
5877 comparison some of the time. The various classes are now bits of
5878 an int that can be checked with bitwise logic operators.
5880 * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
5881 (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
5882 (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
5883 (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
5884 (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
5885 (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
5886 (M4_SYNTAX_ALNUM): Removed. Changed all callers.
5887 (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
5888 (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
5889 (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
5890 (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
5891 Replace all calls with invocations of these...
5892 (m4_is_syntax, m4_has_syntax): ...New macros.
5893 * src/freeze.c (produce_syntax_dump): Remove mask argument, which
5894 is no longer required with new macros. Changed all callers.
5896 2003-07-15 Gary V. Vaughan <gary@gnu.org>
5898 * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
5899 values are returned as part of the internal interface, so they
5901 * m4/private.h: ...to here.
5902 * m4/macro.c (expand_token): Check for out of range
5903 m4_peek_input() results before looking up in the syntax table.
5904 (collect_arguments): Ditto.
5906 * NEWS: Note `$' syntax class.
5908 2003-07-08 Paul Eggert <eggert@twinsun.com> and
5909 Gary V. Vaughan <gary@gnu.org>
5911 Conform to POSIX if the POSIXLY_CORRECT environment is set.
5912 --traditional `define' now smashes all the definitions.
5914 * NEWS: Explain this.
5915 * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
5916 (Extensions): Explain that extensions that are incompatible with
5917 POSIX are disabled if POSIXLY_CORRECT is set.
5918 (Incompatibilities): Remove.
5919 (Define, Other Incompat): Explain difference
5920 between GNU and POSIX behavior of define, pushdef, popdef.
5921 * m4/m4.c (m4_get_posixly_correct_opt): New undef.
5922 * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
5923 * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
5924 (m4_get_posixly_correct_opt): New macro.
5925 * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
5927 * modules/m4.c (builtin_functions): defn now takes any number of args.
5928 (builtin_define): Smash all the definitions if
5930 (builtin_defn)): Allow any number of arguments.
5931 (builtin_undivert): Do not allow nonnumeric arguments
5933 * src/main.c (main): Set posixly-correct behavior if either
5934 POSIXLY_CORRECT is set, or if -G is given.
5935 * tests/builtins.at: New test for smashed definitions.
5937 2003-06-27 Gary V. Vaughan <gary@gnu.org>
5939 * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
5940 * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
5941 not to slow the parser down.
5942 (M4__IS_STRING): New macro to test string syntax class membership.
5943 * m4/syntax.c: Adjust docucomment.
5944 (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
5945 (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
5946 * m4/input.c (init_builtin_token): Comment typo.
5947 (m4__next_token): Comment typo.
5948 Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
5949 by using the new M4__IS_STRING macro.
5950 * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
5951 variable references in macro expansions.
5953 * doc/m4.texinfo (Eregexp and Regexp): Typo.
5954 (Epatsubst and Patsubst): Typo.
5957 2003-06-26 Gary V. Vaughan <gary@gnu.org>
5959 Move the global variables that pertain to syntax to a new `struct
5960 m4_syntax_table', and then add one of these to `struct m4'. The
5961 ripple effect through the code to both change formerly global
5962 references, and make sure a suitable context is available in
5963 lexical scope is disproportionately large compared to the size of
5964 the change proper. This change is a large part of decoupling
5965 syntax.c from the rest of the code that uses it.
5967 * m4/m4private.h (struct m4): Add a syntax field.
5968 * m4/m4.c (m4_create): Initialise it,
5969 (m4_delete): Recycle it.
5970 (m4_get_symtab): Remove hand coded version...
5971 (m4_get_symbol_table): ...and generate this with cpp. Changed all
5973 * m4/m4module.h (m4_context_field_table): Add an extra field so we
5974 can generate m4_get_symbol_table. Add a new row for
5975 m4_get_syntax_table.
5976 (M4SYNTAX): Syntactic sugar for module writers.
5977 (m4_symtab): Renamed to m4_symbol_table. Changed all callers.
5978 (m4_syntax_table): New home for syntax related formerly global
5980 * m4/m4private.h (struct m4_syntax_table): Define it.
5981 * m4/input.c (m4_input_init): Initialisation of these formerly
5982 global variables moved...
5983 * m4/syntax.c (m4_syntax_create): ...to here.
5984 * m4/input.c (m4_input_exit): And similarly, recycling of the
5985 memory used by those values moved...
5986 * m4/syntax.c (m4_syntax_delete): ...to here.
5987 * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
5988 Moved to m4/m4private.h.
5989 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
5990 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
5991 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
5992 (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
5993 objects. Changed all callers that used to directly access the
5995 (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
5996 Removed and incorporated into m4_syntax_table structure.
5997 * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
5998 * m4/syntax.c (m4_set_syntax): Now returns an error status,
5999 instead of requiring a `struct m4' to generate its own errors.
6000 Changed all callers.
6001 * src/main.c (main): Now that the syntax table is initialised as
6002 part of m4_create, we have to manually wipe the syntax entries if
6003 we are about to read a frozen file.
6005 2003-06-26 Gary V. Vaughan <gary@gnu.org>
6007 * doc/STYLE: Added notes on callback naming schemes.
6009 * m4/module.c (m4_set_module_macro_table)
6010 (m4_set_module_builtin_table): Declarations weren't changed when
6011 definitions were renamed on 2003-06-19.
6013 * m4/hash.c (m4_hash_resize): ifdefed out. This function is
6014 neither used nor particularly appropriate since it exposes the
6015 internal workings of the hash module. I haven't yet decided
6016 whether to remove it entirely.
6018 2003-06-20 Gary V. Vaughan <gary@gnu.org>
6020 Two related changes, and a huge knockon effect throughout the
6021 source: Moved the option variables out of global space and into
6022 `struct m4'; made `m4_symtab' a real datatype, so that its api
6023 is not marred passing `struct m4' around just so it can decide
6024 whether to keep traced symbol names or not. Added setters and
6025 getters for the formerly global option variables, and obviously
6026 changed a vast number of functions to take a `struct m4' and use
6027 the getter funcs to find option values.
6029 * m4/utility.c (interactive, sync_output, debug_level)
6030 (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
6031 (max_debug_argument_length, warning_status, nesting_limit)
6032 (discard_comments): Removed.
6033 * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
6034 (debug_level, max_debug_argument_length, prefix_all_builtins)
6035 (suppress_warnings, discard_comments, interactive, sync_output):
6036 Removed from here...
6037 * m4/m4private.h (struct m4): ...and equivalent fields added to
6039 (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6040 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6041 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6042 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6043 (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
6044 macros for the new fields.
6045 * m4/m4module.h (m4_context_field_table)
6046 (m4_context_opt_bit_table): Helper macros used to generate
6047 prototypes, setters and getters for new option fields
6049 * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6050 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6051 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6052 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6053 (m4_get_interactive_opt, m4_get_sync_output_opt)
6054 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
6055 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
6056 (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
6057 (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
6058 (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
6059 setter and getter functions generated by cpp from
6060 m4_context_field_table and m4_context_opt_bit_table, exported as
6061 part of the module api. Changed all callers.
6062 * m4/symtab (struct m4_symtab): Used as the concrete type for
6064 (m4_symtab_create): Allocate and initialise a new struct.
6065 (m4_symtab_apply): New function that works like m4_hash_apply, but
6066 with different callbacks specific to symbol tables. Changed all
6068 (symbol_destroy, arg_destroy, arg_copy): Renamed
6069 symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
6070 they have unused parameters for a reason!
6071 (dump_symbol_CB): New callback to dump the contents of a single
6073 (symtob_dump): Rewritten in terms of dump_symbol_CB.
6074 * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
6075 Changed all callers.
6076 * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
6077 of the contained `m4_symtab' at the `no_gnu_extensions' field.
6078 Although I'm not convinced these semantics are correct, they are
6079 at least consistent with how things were before this delta. Also
6080 set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
6082 2003-06-19 Gary V. Vaughan <gary@gnu.org>
6084 Tie down the interface to libm4 some more. Make more structures
6085 opaque to modules by moving them to m4private.h, and writing
6086 setters and getters. To win back the speed penalty for doing this
6087 also wrote macroized versions that do know about structure layout
6088 in m4private.h and #include that file into modules when NDEBUG is
6089 defined at compile time. There are still some accessor macros in
6090 m4private.h that need to go, but that is not necessary to clean
6093 * m4/m4module.h (m4_symbol_type): Moved...
6094 * m4/m4private.h (m4__symbol_type): ...to here.
6095 * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
6096 (m4_set_symbol_traced, m4_set_symbol_name_traced)
6097 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
6098 (m4_get_symbol_func, m4_symbol_value_create)
6099 (m4_symbol_value_delete, m4_set_symbol_value_text)
6100 (m4_set_symbol_value_func): New exported api to symbols.
6101 (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
6102 and m4_is_symbol_value_func.
6103 * m4/m4module.h: Prototype these guys.
6104 * m4/module.c (m4_set_module_macro_table)
6105 (m4_set_module_builtin_table): Make these static, there is no
6106 reason to pollute the api with them.
6107 * m4/m4private.h: Reformatting.
6108 (m4_get_symtab): Only define when NDEBUG is defined.
6109 (m4_get_symbol_value, m4_get_symbol_traced)
6110 (m4_set_symbol_traced, m4_set_symbol_name_traced)
6111 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
6112 (m4_get_symbol_func, m4_symbol_value_create)
6113 (m4_symbol_value_delete, m4_set_symbol_value_text)
6114 (m4_set_symbol_value_func): Macro implementations of the new
6115 functions when NDEBUG is defined.
6116 (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
6117 (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
6118 Superceded by the above. All callers changed.
6119 (M4ARG): Removed. This is no longer different to the
6120 m4/m4module.h definition.
6121 * modules/gnu.c, modules/m4.c: Only include m4private.h when
6122 NDEBUG is defined. That way we exercise the same (albeit slower)
6123 api that external modules must use.
6125 2003-06-18 Gary V. Vaughan <gary@gnu.org>
6127 Renamed some of the types and their accessors to make more sense.
6128 Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
6129 has a stack of SYMBOL_VALUEs.
6131 * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
6132 (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
6133 m4_get_symbol_value_type, m4_get_symbol_value_text,
6134 m4_get_symbol_value_func and m4_symbol_value_copy respectively.
6135 Changed all callers.
6136 (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
6137 (m4_get_token_type): Renamed
6138 * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
6139 to the internal api.
6140 * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
6142 (m4__symtab_init, m4__symtab_exit): Removed prototypes.
6143 (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
6144 (m4__token_type): Moved here from m4module.h.
6145 (m4__next_token): Renamed from m4_next_token.
6146 * m4/symtab.c: Removed some of the parameterised macro support
6147 functions for modularisation later.
6148 (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
6149 m4_hash_dup to perform a true deep copy of the SRC.
6150 (arg_copy): Callback for m4_symbol_value_copy.
6151 * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
6152 Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
6153 m4_get_symbol_value_func. Changed all callers.
6155 2003-06-18 Gary V. Vaughan <gary@gnu.org>
6157 Tidy up style of hash.[ch] in accordance with doc/STYLE.
6159 * m4/hash.c: Internal symbol renaming and formatting.
6160 (m4_hash_dup): New function to facilitate deep copies of hash
6162 (m4_hash_apply_func): Returns a void* now, which is a richer type
6163 for returning exceptions (NULL means keep going).
6164 (m4_hash_apply): Ditto.
6165 * m4/hash.h: Declare exported symbols with an explicit extern.
6168 2003-06-17 Gary V. Vaughan <gary@gnu.org>
6170 Still refactoring furiously. This delta represents a change in
6171 semantics to symtab.c. Instead of building temporary m4_tokens
6172 in the caller, and copying fields in the methods, we now create
6173 the actual m4_token for hashing in the caller so the methods just
6174 slot them in directly. Also, this means that we don't lookup a
6175 symbol and get back an allocated but VOID token to copy fields
6176 into, we create the token we want to push and pass that to
6177 m4_symbol_define or m4_symbol_pushdef. And that's it. There are
6178 a few other small changes to stop knowledge of the implementation
6179 of symtab.c leaking out into other files.
6181 * m4/macro.c (expand_argument): Comment typo corrected.
6182 * m4/symtab.c (symtab_fetch): New function to fetch the address of
6184 (m4_symbol_pushdef): Take an extra value parameter and use this
6185 directly as the new top of the value stack. All callers changed
6186 to build a token and pass responsibility for memory in, rather
6187 than copying as we used to.
6188 (m4_symbol_define): Also use the new value parameter directly as a
6189 replacement for the top of the value stack. All callers changed
6190 to build a token as above.
6191 (m4_set_symbol_traced): New function to set the traced bit on the
6192 named symbol, creating it if necessary.
6193 (symbol_popval): The guts of the old m4_symbol_popdef.
6194 (m4_symbol_popdef): Use it.
6195 * m4/builtin.c (m4_symbol_set_token): Removed,
6196 (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
6198 * m4/module.c (m4_set_module_builtin_table)
6199 (m4_set_module_macro_table): ...with these more orthogonal
6201 * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
6202 (m4_builtin_pushdef, m4_builtin_define): Removed. No longer
6204 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
6205 (m4_arg_signature_parse): Moved...
6206 * m4/symtab.c: ...to here.
6207 * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
6208 screw something up. Moved...
6209 * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
6210 actually does a proper deep copy of source to dest.
6212 2003-06-16 Gary V. Vaughan <gary@gnu.org>
6214 Further refactoring to stabilise the module API. Renaming some
6215 functions for orthogonality, and judicious definition migration to
6216 move things out of the set of exported symbols.
6218 * doc/STYLE: New file. Notes on coding style.
6219 * m4/m4module.c: Updated bitrotted docucomment at the top of the
6221 (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
6222 m4_get_module_name, m4_get_module_builtin_table,
6223 m4_get_module_macro_table which are verb phrases. Changed all
6225 * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
6227 * m4/module.c (m4_set_module_builtin_table)
6228 (m4_set_module_macro_table): ...here, and renamed. Changed all
6230 * m4/m4module.c (m4_module_data): This...
6231 * m4/m4private.c (struct m4_module_data): ...and this...
6232 * m4/module.c (module_data) ...consolidated here and no longer
6233 exported. Changed all callers.
6235 2003-06-16 Gary V. Vaughan <gary@gnu.org>
6237 Begin work on lifting the curse of the global variables. To start
6238 with create a `struct m4' context container, and replace
6239 `m4__symtab' with `context->symtab' throughout. This means
6240 initialising a context container in main, and adjusting many
6241 functions between main and the module entry points so that the
6242 container gets passed through. It would have been nice to
6243 defer this until after 1.5, but it has a major effect on the
6244 user's module writing ABI, so it needs to be addressed now - at
6245 least in the areas that impact the ABI. An interrelated change
6246 in the symtab API removes the dependency on a global symbol table,
6247 and instead focuses on a passed table (from the context
6250 * TODO: Reminders for finishing context functionality.
6251 * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
6252 * m4/m4.c: New file. Manage new struct m4 objects to eliminate
6253 global variables and eventually allow m4 to be reentrant.
6254 * m4/m4private.h (m4): Define the new structure here...
6255 (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
6256 don't carry the overhead of a function call.
6257 * m4/m4module.h: Prototype extern functions from m4/m4.c.
6258 (m4): Declare type for new struct m4 objects.
6259 (M4SYMTAB): User macro to ease finding the symbol table for the
6260 current context for module developers.
6261 (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
6263 (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
6264 (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
6265 (m4_call_macro, m4_dump_symbols, m4_expand_input)
6266 (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
6267 (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
6268 (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
6269 m4* context parameter. Changed definitions and all callers.
6270 (m4_symtab): Alias for m4_hash to decouple the
6271 m4_symtab api from m4_hash.
6272 (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
6274 (m4_symtab_create): New function to return an initialised
6276 (m4_symtab_delete): New function to delete an m4_symtab's memory.
6277 (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
6278 (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
6279 instead of simply using the global m4__symtab. Changed
6280 definitions and all callers.
6281 * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
6282 * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
6283 * src/main.c (main): Create a context and use that instead of the
6284 former global m4__symtab.
6286 2003-06-13 Gary V. Vaughan <gary@gnu.org>
6288 * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
6289 to the callback. Callbacks should not need to hardcode the
6290 hashtable they are working from, nor should we have to waste the
6291 userdata parameter to pass the table in.
6292 * m4/hash.h (m4_hash_apply_func): Require the initial table
6294 * m4/symtab.c (symtab_destroy): Use the passed table instead
6295 of hardcoding m4__symtab.
6296 (m4_symbol_popdef): Don't use the userdata parameter to pass the
6297 table to arg_destroy.
6298 (arg_destroy): Use the hash parameter, ignore userdata.
6299 * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
6301 (traceon, traceoff): Call set_trace with the extra initial
6304 2003-06-13 Gary V. Vaughan <gary@gnu.org>
6306 More refactoring to stabilise the module api, this time for
6307 symtab.c. Additionally, start to pay attention to function names
6308 that don't contain a verb like they should.
6310 * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
6311 wrapper for m4_hash_apply to decouple the symtab module from the
6313 (m4_symbol_builtin, m4_symbol_macro): Renamed to
6314 m4__symbol_set_builtin and m4__symbol_set_macro. Changed all
6316 (m4_symbol_delete): Create a macro version to save a function
6318 (m4_token_t, m4_data_t): These violate the POSIX reserved
6319 namespace. Renamed to m4_token_type and m4_symbol_type. Changed
6321 (m4_token_type): Renamed to m4_token_get_type.
6322 (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
6323 (m4_symtab_exit): Removed from the exported module
6325 * m4/m4private.h (m4__symtab, m4__symtab_init)
6326 (m4__symtab_remove_module_references, m4__symtab_exit): ...and
6327 renamed and added to the internal api. Changed all callers.
6328 (m4_symtab_apply): A faster macro version of the function for
6329 users of the internal api.
6330 * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
6331 symbol_destroy and arg_destroy.
6332 (symtab_debug): Added a prototype.
6333 (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
6334 so that callers in this file get the faster macro versions from
6337 2003-06-12 Gary V. Vaughan <gary@gnu.org>
6339 Refactoring modules to rationalise the API into an external
6340 documented (eventually!) API for use by modules in the `m4_'
6341 namespace declared in m4/m4module.h, an internal API between the
6342 source files we ship (including our shipped modules) in the `m4__'
6343 namespace declared in m4/m4private.h and making the rest as
6344 cohesive as possible with liberal use of the `static' keyword.
6345 This change represents an audit to m4/module.c along these
6348 * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
6349 Removed. No longer used.
6350 (m4_module_close): Removed prototypes.
6351 (m4_module_init, m4_module_open, m4_module_unload_all): Removed
6352 from the exported module api...
6353 * m4/m4private.h (m4__module_init, m4__module_open)
6354 (m4__module_exit): ...and renamed and added to the internal api.
6355 Changed all callers.
6356 (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
6357 Centralised definitions after renaming...
6358 * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
6359 (M4_FINISH_SYMBOL): ...and removing from here.
6360 (m4_module_dlerror, m4_module_remove, m4_module_close)
6361 (m4_caller_id): Not exported at all, so renamed to module_dlerror,
6362 module_remove, module_close and caller_id.
6363 (MODULE_SELF_NAME): New macro to make reporting self errors
6365 (m4_module_load, module_close, module_remove): Use it.
6366 * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
6368 * src/main.c (main): Use it.
6370 2003-06-12 Gary V. Vaughan <gary@gnu.org>
6372 * README: Remove references to --enable-changeword, which has been
6373 removed from the code.
6375 2003-06-11 Gary V. Vaughan <gary@gnu.org>
6377 Getting rid of the annoying bug with configure --enable-debug,
6378 which spewed -e: command not found errors. This was an interaction
6379 between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
6380 You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
6381 branch-1-5) to get the full fix.
6383 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
6384 of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
6385 and then use the probed value of $SED.
6386 (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
6387 this, it messes up the AC_REQUIRE stack.
6389 2003-06-10 Gary V. Vaughan <gary@gnu.org>
6391 * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
6392 the destroy callback.
6393 (m4_arg_destroy): Use the hash address to free the hash node key
6396 2003-06-06 Gary V. Vaughan <gary@gnu.org>
6398 First cut at formal parameters in macros.
6400 * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
6401 * m4/xstrzdup.c: New file.
6402 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
6403 associative array of parameter names to details.
6404 (m4_symbol_token): Capture macro names with parameter lists.
6405 (m4_arg_signature_parse): And build an associative array to hang
6406 from the symbol structure to map names to details.
6407 * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
6408 m4_hash_resize idiom. Now that we potentially add a little hash
6409 table to many of the entries in the symbol table, added an extra
6410 arg to set the initial size. Changed all callers.
6411 (m4_hash_apply): New function that is basically a generalised
6413 * m4/symtab.c (m4_symbol_apply): ...this. Now deleted. Adjusted
6414 all callers to call m4_hash_apply instead.
6415 (m4_arg_destroy): Recycle memory used by an m4_token_arg.
6416 (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
6417 m4_arg_signature association that might be attached to the symbol,
6418 * m4/hash.h (m4_hash_apply_func): Replacement type for...
6419 * m4/m4module.h (m4_symtab_apply_func): ...this. Now deleted.
6420 (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
6422 (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
6423 (M4_IS_IDENT): Detect characters that can be safely used in
6425 * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
6426 * m4/macro.c: Corrected grammar in some comments. Use `token'
6427 rather than `td' for m4_token variables.
6428 (m4_process_macro): If we find a dollar followed by some
6429 M4_IS_IDENT characters, replace that with the contents of the argv
6430 entry with offset stored in the m4_token_arg associated with the
6431 collected identifier.
6433 2003-06-05 Gary V. Vaughan <gary@gnu.org>
6435 Begin preparations for supporting formal parameters in m4 macros.
6437 * m4/m4private.h (struct m4_token_arg): Placeholder for holding
6438 the details of a formal parameter.
6439 (m4_token): Add an arg_signature member to hold a hash table for
6440 looking up formal parameters.
6441 * m4/input.c: Update more bitrotted comments.
6442 (m4_push_builtin): Initialise arg_signature member.
6443 (init_builtin_token): Copy arg_signature member.
6444 * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
6445 (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
6447 * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
6448 (m4_macro_pushdef, m4_macro_define): ...these, And...
6449 (m4_symbol_token): ...wrapped around this new function, which
6450 vastly simplifies the arguments required by the functions it
6452 Changed all callers.
6454 2003-06-05 Gary V. Vaughan <gary@gnu.org>
6456 * m4/macro.c: Format changes.
6458 2003-06-04 Gary V. Vaughan <gary@gnu.org>
6460 * m4/input.c: Updated various bitrotted comments.
6461 (m4_push_builtin): Just pass the whole m4_token, rather than
6462 extracting all the fields in the caller. This also allows us to
6463 check the token type for consistency.
6464 (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
6465 Renamed to builtin_funcs, builtin_peek, builtin_read,
6466 m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
6467 the code. Changed all callers.
6468 (struct input_block): Similarly renamed u_m member to u_b, and
6469 changed all callers.
6470 (m4_next_token): Use bzero to initialise the data fields.
6471 * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
6473 2003-05-29 Gary V. Vaughan <gary@gnu.org>
6475 These changes were necessary to get m4 to build on my iBook
6476 running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
6477 (GCC) 3.1 20020420 (prerelease)":
6479 * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
6480 inclusion of module loader headers.
6481 * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
6482 * m4/Makefile.am: Ditto.
6483 (libm4_la_LIBADD): Added $(LTLIBINTL).
6484 * m4/utility.c (program_name): Removed declaration in favour of
6485 the one already in error.c!
6486 * m4/m4module.h (program_name): Define to program_invocation_name
6487 when using GNU C library. Use an explicit extern declaration.
6488 (interactive, sync_output, debug_level, hash_table_size)
6489 (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
6490 (suppress_warnings, warning_status, nesting_limit, discard_comments)
6491 (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
6492 (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
6493 (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
6494 (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
6495 (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
6496 (m4_expansion_level, m4_expand_ranges, m4_expand_input)
6497 (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
6498 (m4_current_line, m4_current_diversion, m4_output_current_line):
6499 Don't rely on default, use an explicit extern.
6500 * m4/error.h (error, error_at_line, error_print_progname)
6501 (error_message_count, error_one_per_line): Ditto.
6502 * m4/ltdl.c: Update from CVS libtool.
6504 * commit: Update from CVS cvs-utils.
6506 2002-11-04 gettextize <bug-gnu-gettext@gnu.org>
6508 * po/Makefile.in.in: Upgrade to gettext-0.11.5.
6509 * po/boldquot.sed: New file, from gettext-0.11.5.
6510 * po/en@boldquot.header: New file, from gettext-0.11.5.
6511 * po/en@quot.header: New file, from gettext-0.11.5.
6512 * po/insert-header.sin: New file, from gettext-0.11.5.
6513 * po/quot.sed: New file, from gettext-0.11.5.
6514 * po/remove-potcdate.sin: New file, from gettext-0.11.5.
6515 * po/Rules-quot: New file, from gettext-0.11.5.
6517 2002-11-04 Akim Demaille <akim@epita.fr>
6519 * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
6521 * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
6523 2002-11-04 Akim Demaille <akim@epita.fr>
6525 * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
6527 2002-11-04 Akim Demaille <akim@epita.fr>
6529 * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
6530 used as `external', and Libtool 1.4.3.
6532 (LTLIBOBJS): Don't play with it.
6534 * Makefile.am (SUBDIRS): Remove intl.
6535 (ACLOCAL_AMFLAGS): Add -I config.
6536 (EXTRA_DIST): Add config/config.rpath.
6539 * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
6541 2002-05-29 Gary V. Vaughan <gary@gnu.org>
6543 Preparations for refactoring syntax tables to allow reverse
6544 lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
6545 speed of normal lookups in an array of unsigned short.
6547 * m4/input.c (single_quotes, single_comments, use_macro_escape):
6549 * m4/m4private.h (m4__single_quotes, m4__single_comments,
6550 m4__use_macro_escape): ...to here, and renamed. The `m4__' prefix
6551 is for internal symbols which unavoidably pollute the global
6552 namespace, but are not published APIs.
6553 Adjusted all callers.
6554 * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
6555 m4_set_comment, m4_set_syntax, set_syntax_internal,
6556 unset_syntax_attribute): Moved from this file...
6557 * m4/syntax.c: New. ...to this file.
6558 Also added an m4_syntax_exit stub for orthogonality.
6559 * src/main.c (main): Use it.
6560 * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
6561 * m4/m4module.h: Reformatting. New prototypes.
6563 2002-05-29 Gary V. Vaughan <gary@gnu.org>
6565 * bootstrap (aclocal_apiversion): The aclocal apiversion is
6566 distinct from the automake release number (in that the apiversion
6567 apparently has no micro-version-component).
6568 (aclocal_apilibdir): Use it.
6570 2002-05-28 Gary V. Vaughan <gary@gnu.org>
6572 * m4/hash.c (m4_hash_resize): New function.
6573 * m4/hash.h: Add prototype.
6574 * m4/symtab.c (m4_symtab_init): Use it. This could do with some
6575 benchmarking to find a good value for, say, autoconf. This is
6576 already a little quicker than before for me.
6578 * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
6579 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
6581 * m4/hash.h: Adjust prototypes.
6583 2002-01-22 Akim Demaille <akim@epita.fr>
6585 * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
6587 * tests/Makefile.am (package.m4): New.
6588 * tests/atlocal.in: Adjust to CVS Autotest.
6589 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
6590 * configure.ac: LIBOBJ is a forbidden string.
6591 Simplify AM_INIT_AUTOMAKE invocation.
6592 * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
6595 2002-01-21 gettextize <bug-gnu-utils@gnu.org>
6597 * po/Makefile.in.in: Upgrade to gettext-0.10.40.
6599 2001-10-19 Akim Demaille <akim@epita.fr>
6601 * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
6603 2001-10-19 Akim Demaille <akim@epita.fr>
6605 * m4/input.c (m4_next_token): Display where was opened what is
6608 2001-10-19 Akim Demaille <akim@epita.fr>
6610 * m4/macro.c (expand_argument): Display where was opened what is
6613 2001-10-18 Akim Demaille <akim@epita.fr>
6615 * m4/input.c, modules/m4.c: Formatting changes.
6617 2001-10-17 Gary V. Vaughan <gary@gnu.org>
6619 * bootstrap: s/configure.in/configure.ac/
6621 2001-10-16 Gary V. Vaughan <gary@gnu.org>
6623 * m4/symtab.c (m4_symbol_destroy): This function calls
6624 m4_symbol_popdef, which recycles a symbols memory when the last
6625 definition is popped. Since we were passing the address of the
6626 symbol name found in the symbol table, and it was being removed
6627 partway through m4_symbol_destroy() we were referencing freed
6628 memory for the balance of the function. Now we take a copy of the
6629 symbol name tring and use that as a key into the symbol
6630 table... that way if the original symbol name is freed, the copy
6633 2001-10-13 Akim Demaille <akim@epita.fr>
6635 * m4/ltdl.c: Update.
6637 2001-10-13 Akim Demaille <akim@epita.fr>
6639 * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
6640 Don't gettextize internal error messages.
6642 2001-10-13 Akim Demaille <akim@epita.fr>
6644 * tests/macros.at (Arity and defn): New failing test.
6645 (Arity, defn, and freeze): New.
6647 Fix `Arity and defn'.
6649 * m4/input.c (m4_push_macro): Don't forget the arity.
6650 * modules/m4.c (defn): Likewise.
6652 2001-10-13 Akim Demaille <akim@epita.fr>
6654 * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
6656 * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
6657 (Propagation of traceon, Propagation of --trace): this new file.
6659 2001-10-13 Akim Demaille <akim@epita.fr>
6661 * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
6662 interface instead of (name, argc...).
6663 Upon failure, specify which argument was guilty.
6666 2001-10-13 Akim Demaille <akim@epita.fr>
6668 * modules/evalparse.c: Save translators' time: don't translate
6669 internal error messages.
6670 (m4_evaluate): Simplify/normalize error messages.
6671 * doc/m4.texinfo (Eval): Adjust.
6673 2001-10-13 Akim Demaille <akim@epita.fr>
6675 * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
6676 where no checking is needed.
6677 * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
6678 interface instead of (name, argc...).
6680 * modules/gnu.c (m4_patsubst_do): Don't check argc, done
6683 2001-10-13 Akim Demaille <akim@epita.fr>
6685 * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
6686 exclude the builtin name from the count.
6687 * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
6688 calling ifelse with a single argument is valid.
6689 * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
6690 with 1 and 2 args, mostly to strengthen the test suite.
6692 2001-10-13 Akim Demaille <akim@epita.fr>
6694 * m4/output.c (m4_make_diversion, m4_insert_file)
6695 (m4_insert_diversion, +m4_freeze_diversions): Ansify.
6697 2001-10-12 Gary V. Vaughan <gary@gnu.org>
6699 * m4/input.c (init_builtin_token): Renamed from init_macro_token,
6700 since we call these things builtins in the rest of the code!
6702 * modules/gnu.c (m4_regexp_compile): s/%0/%s/
6704 2001-10-12 Gary V. Vaughan <gary@gnu.org>
6706 Rather than forcing each builtin definition to manage its own
6707 argument range checking, tabulate the maxima and minima for all
6708 builtins in each module. This forces us to consider what the
6709 valid ranges for each builtin should be, and moves the checking
6710 code out of each builtin implementation and into the builtin
6711 caller infrastructure.
6713 * m4/m4module.h (struct m4_builtin): Add argument minima and
6715 * m4/m4private.h (struct m4_token): Reflect them here too.
6716 * m4/input.c (struct input_block): ...and here.
6717 (m4_token_copy): New function for token copying.
6718 (init_macro_token): Copy them from a token to the input stack.
6719 (m4_next_token): Don't forget to initialise them for text
6721 * m4/macro.c (expand_argument): Use m4_token_copy, and also
6722 check argument counts before calling the builtin handler.
6723 * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
6724 (m4_symbol_macro): Likewise.
6725 * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
6726 parameters. Updated all callers.
6727 (m4_builtin_define): Ditto.
6728 (m4_macro_pushdef, m4_macro_define): Ditto.
6729 * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
6730 * modules/evalparse.c: Declare argument counts for defined
6731 builtins and remove explicit calls to m4_bad_argc().
6732 * modules/gnu.c: Ditto.
6733 * modules/load.c: Ditto.
6734 * modules/m4.c: Ditto.
6735 * modules/modtest.c: Ditto.
6736 * modules/mpeval.c: Ditto.
6737 * modules/perl.c: Ditto.
6738 * modules/shadow.c: Ditto.
6739 * modules/stdlib.c: Ditto.
6740 * modules/time.c: Ditto.
6743 2001-10-10 Gary V. Vaughan <gary@gnu.org>
6745 The trace semantics now attach the trace bit to a symbol name.
6746 For as long as a traceon(`foo') is active, calls to foo will be
6747 traced regardless of intervening undefines or module unloads.
6748 Fixed the flag propogation issues differently to the fixes
6749 reverted with the last attempt at nailing down trace:
6751 * m4/m4private.h: This file is not visible outside of the m4
6752 source tree, so I removed all the `M4_' and `m4_' prefixes to save
6753 on typing. Updated all clients.
6754 (m4_token): New typedef contains the fields that need to be passed
6755 around with the low level tokeniser.
6756 (m4_token_data): Removed.
6757 (m4_symbol): Now contains the traced flag again.
6758 * m4/symtab.c: Rewritten again. Now we don't remove symbols with
6759 the trace bit set. This change is contained entirely within this
6760 module and doesn't leak out into the callers. Updated all
6762 (m4_symbol_builtin, m4_symbol_macro): Adjusted to make use of the
6763 new fields in m4_token. Updated all clients.
6764 * m4/builtin.c (m4_builtin_pushdef): Needs a flags argument so
6765 that `groks_macro_args' and `blind_if_no_args' flags are retained
6766 when defn() results are passed around in m4 code. Updated all
6768 (m4_builtin_define): Ditto.
6769 (m4_macro_pushdef, m4_macro_define): Ditto.
6770 * m4/input.c (struct input_block): Add a flags field to facilitate
6772 (m4_push_macro): ...use it.
6773 (init_macro_token): Retrieve it.
6774 (m4_next_token): Initialise it.
6775 * m4/macro.c (expand_argument): Copy it.
6776 * m4/m4module.h: Adjust.
6777 * tests/builtins.at: Adjust the expected output of the trace
6778 tests to reflect the change in semantics.
6779 * tests/modules.at (modules: trace): Check that unloading a
6780 module which supplies a traced symbol definition doesn't lose te
6783 2001-10-07 Gary V. Vaughan <gary@gnu.org>
6785 * modules/gnu.c (m4_macro_table): Display the timetamp when
6786 expanding __m4_version__.
6788 * configure.ac (--with-modules): Forgot a comma in the
6789 AC_HELP_STRING parameter list.
6791 2001-10-05 Gary V. Vaughan <gary@gnu.org>
6793 * bootstrap: Remove aclocal.m4t when it is no longer required.
6795 2001-10-05 Akim Demaille <akim@epita.fr>
6797 * tests/Makefile.am: Adjust for gnuprog2.
6798 * tests/m4.in: There can be a leading path.
6799 * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
6800 * tests/testsuite.at: Adjust to the most recent Autotest.
6801 (AT_CHECK_M4_FILTER): Fix and rename as...
6803 * tests/others.at: Use it.
6805 * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
6806 variable in shell scripts, one uses `$'...
6808 2001-10-04 Gary V. Vaughan <gary@gnu.org>
6810 * configure.ac: `rm -f $m4_getopt_h' was lost.
6812 2001-10-04 Gary V. Vaughan <gary@gnu.org>
6814 * configure.ac (TIMESTAMP): Display with AS_BOX at configure
6815 time. Define it for config.h in order to...
6816 * src/main.c (main): ...display the timestamp for --version.
6818 2001-10-04 Akim Demaille <akim@epita.fr>
6820 * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
6821 previous builtins `regexp' and `patsubst'.
6822 (regexp, patsubst): Use them.
6823 (eregexp, epatsubst): New builtins.
6824 * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
6825 (Epatsubst and Patsubst, Eregexp and Regexp): these.
6826 (Extensions): More info on REs.
6828 2001-10-04 Akim Demaille <akim@epita.fr>
6830 * modules/modtest.c (init_handler): Consistently output to stderr.
6831 (finish_handler): New.
6832 (test): The `if' is an `assert'.
6833 * tests/modules.at: Adjust.
6835 2001-10-04 Akim Demaille <akim@epita.fr>
6837 * m4/utility.c (m4_bad_argc): Detail the mismatches.
6839 2001-10-01 Akim Demaille <akim@epita.fr>
6841 * tests/generate.awk: Tag the tests with `documentation'.
6842 * tests/modules.at (AT_CHECK_M4_MODTEST): New.
6843 Use the make the existing modtest tests more uniform, and complete
6844 the set of possibilities.
6846 2001-10-01 Akim Demaille <akim@epita.fr>
6848 * config/gmp.m4: Consult the user before using GMP: use
6850 * configure.ac: Adjust.
6851 * modules/gmp.c: No protection needed as the module is not built
6854 2001-10-01 Akim Demaille <akim@epita.fr>
6856 * tests/generate.awk: Remove debugging code.
6857 (fatal): Specify the current location.
6859 * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
6860 * modules/gnu.c, modules/m4.c: Use M4ARG.
6862 2001-10-01 Akim Demaille <akim@epita.fr>
6864 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
6865 (m4_regexp_compile): New.
6866 (regexp, patsubst): Use it.
6868 2001-09-30 Gary V. Vaughan <gary@gnu.org>
6870 Reinstate the memory handling improvements from the patch I just
6871 reverted. Relevant ChangeLog entries repeated here:
6873 * m4/module.c (m4_module_remove): New function that holds the core
6874 of the old m4_module_unload.
6875 (m4_module_unload): Use it.
6876 (m4_module_unload_all): When we know the modules will never be
6877 used again (i.e. on exit), free up as much module memory as
6878 possible. There are still some artifacts from resident modules
6879 living inside ltdl.c, but everything else is freed.
6880 * m4/debug.c (m4_debug_exit): Free memory allocated in
6882 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
6883 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
6884 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
6885 * m4/m4module.h: Updated prototypes.
6886 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
6887 * m4/hash.h: Updated prototypes.
6888 * src/main.c (main): Use all these new functions to clean up as
6889 much memory as possible before exit.
6891 2001-09-30 Gary V. Vaughan <gary@gnu.org>
6893 Reverted my large patch for removing the old m4_symbol
6894 structure on 2001-09-20. We are still not happy about the way
6895 trace works in conjunction with defn and undefine, and leaving
6896 the reverted patch active prevents us from moving the traced
6897 bit from the definition back to the symbol.
6899 2001-09-30 Gary V. Vaughan <gary@gnu.org>
6901 * configure.in: Moved to...
6902 * configure.ac: ...here. Added a libtool like timestamped
6903 banner, and tidied up the libltdl cruft.
6904 * config/mkstamp: Script to extract a timestamp from ChangeLog.
6905 * modules/Makefile.am (INCLTDL): Removed. This is required
6906 only when libltdl is configured in a subdirectory.
6907 * src/Makefile.am: Ditto.
6908 (LIBADD_DL): No need to add this again, libtool already knows
6909 that libm4.la depends on it.
6910 * m4/Makefile.am: Automake sets variables from AC_SUBST. Use
6913 * TODO: stackovf.c is basically broken.
6914 Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
6916 2001-09-28 Akim Demaille <akim@epita.fr>
6918 * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
6920 2001-09-27 Akim Demaille <akim@epita.fr>
6922 * tests/m4.in: Don't use short options.
6923 Simplify the stderr signature normalization.
6925 2001-09-27 Akim Demaille <akim@epita.fr>
6927 tests/m4 shall be position independent.
6931 * tests/testsuite.at: No args to AT_INIT.
6932 * configure.in, tests/Makefile.am: Adjust.
6934 2001-09-22 Akim Demaille <akim@epita.fr>
6936 Autotest has changed again.
6938 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
6939 (package.m4): Remove.
6940 * configure.in: Adjust to LIBADD_GMP.
6942 2001-09-21 Gary V. Vaughan <gary@gnu.org>
6944 * config/gmp.m4 (AC_ARG_WITH): Removed.
6945 (GMP_LIB): Renamed to LIBADD_GMP for consistency.
6946 (AC_LIB_GMP): When performing a test compile against libgmp,
6947 include the header gmp.h if possible, and link against -lgmp. If
6948 they both work define USE_GMP.
6949 * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
6950 (mpeval_LTX_init_func): Complain on load that there was no libgmp
6953 2001-09-20 Gary V. Vaughan <gary@gnu.org>
6955 * m4/evalparse.c: Moved to...
6956 * modules/evalparse.c: ...here. This code is shared between
6957 modules/mpeval.c and modules/m4.c, so there is no need to pollute
6958 the libm4 API with its details. Moderately rewritten to interface
6959 into its clients more simply.
6960 * m4/eval.c: Deleted. Migrated functionality to...
6961 * modules/m4.c: ...here.
6962 (builtin_eval): Implemented in terms of the new interface style.
6963 * modules/mpeval.c (builtin_mpeval): Ditto.
6964 * m4/m4module.h: Removed references to the former m4/eval.c.
6965 * m4/Makefile.am (libm4_la_SOURCES): Removed eval.c.
6966 (EXTRA_libm4_la_SOURCES): Deleted.
6967 * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
6968 (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
6970 2001-09-20 Akim Demaille <akim@epita.fr>
6972 * config/gmp.m4 (AM_WITH_GMP): Rename as...
6974 By default, use gmp.
6976 * configure.in: Adjust.
6977 Use Automake conditionals for USE_GMP.
6978 Always compute sizeof (long long int).
6979 This was a bug BTW, as `eval' (not `mpeval') depends on it:
6980 before, it was used _only_ if mpeval was not activated.
6981 * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
6982 (mpeval_la_LIBADD): New macros.
6983 * modules/mpeval.c: No longer be conditioned by WITH_GMP.
6985 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
6986 * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
6989 2001-09-20 Akim Demaille <akim@epita.fr>
6991 * tests/Makefile.am (package.m4): New.
6992 * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
6994 2001-09-20 Gary V. Vaughan <gary@gnu.org>
6996 More cleanup. After the last patch, m4_symbol holds nothing but
6997 the head of a chain of m4_token_data. So I have removed the old
6998 m4_symbol, so that m4_token_data chains are stored directly in the
6999 value cell of a hash table node. But there's more... m4_symbol
7000 was a more natural name for the symbol value cell, and now that it
7001 is gone I have renamed the former m4_token_data structure to
7002 m4_symbol. This change turned out to be a pig to get right, since
7003 the original code didn't need to modify the value cell itself,
7004 since changing the chain happened inside the m4_symbol that used
7005 to be returned -- I had to pass the address of the value cell
7006 across various function calls, incase the head value changed. I
7007 also tightened up the memory management to help me find a nasty
7008 memory corruption bug that took me all night to track down...
7010 * m4/m4private.h (struct m4_symbol): Removed.
7011 (struct m4_token_data): Renamed to `struct m4_symbol'. Updated
7013 * m4/hash.c (m4_hash_iterator_value): Return the address of the
7014 value cell. Updated all callers.
7015 * m4/symtab.c: Took advantage of the simplification in the data
7016 structures to rewrite a lot of this file more simply. There is
7017 still some room for optimisation here, but we should tackle that
7018 systematically closer to the release.
7020 * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
7021 revealed. This version is ahead of CVS libtool until I get chance
7022 to flush my changes.
7023 * m4/module.c (m4_module_remove): New function that holds the core
7024 of the old m4_module_unload.
7025 (m4_module_unload): Use it.
7026 (m4_module_unload_all): When we know the modules will never be
7027 used again (i.e. on exit), free up as much module memory as
7028 possible. There are still some artifacts from resident modules
7029 living inside ltdl.c, but everything else is freed.
7030 * m4/debug.c (m4_debug_exit): Free memory allocated in
7032 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7033 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7034 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7035 * m4/m4module.h: Updated prototypes.
7036 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7037 * m4/hash.h: Updated prototypes.
7038 * src/main.c (main): Use all these new functions to clean up as
7039 much memory as possible before exit.
7041 2001-09-18 Gary V. Vaughan <gary@gnu.org>
7043 The `traced' flag needs to be attached to the definition of a
7044 symbol rather than the current symbol containing the definition.
7045 Implementing this showed up some long standing post 1.4 bugs in
7046 flag propogation which I also fixed.
7048 * m4/m4private.h (struct m4_symbol): Remove the traced flag.
7049 (struct m4_token_data): And add it back in here.
7050 * m4/input.c (init_macro_token): Propogate the traced flag
7052 * m4/macro.c (expand_argument): Ditto.
7053 * tests/builtins.at (trace2, trace3): New tests based on Akim's
7056 2001-09-08 Gary V. Vaughan <gary@gnu.org>
7058 * m4/m4private.h (struct m4_token_data): Simplified by removing
7059 the redundant `traced' flag, and one level of structure nesting.
7060 (M4_TOKEN_DATA_FUNC_TRACED): Removed.
7061 * m4/input.c (init_macro_token): No need to initialise removed
7063 * m4/macro.c (expand_argument): No need to copy it either.
7064 * m4/utility.c (m4_token_data_func_traced): Or provide an access
7067 * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
7068 dependant on multiple symbols with the same key, so preserving
7069 relative symbol order in each bucket during resizing is no longer
7070 required. The resize function is considerably faster as a result.
7072 * m4/m4module.h, m4/builtin.c, m4/symtab.c:
7073 s/m4_symbol_insert/m4_symbol_define/g;
7074 s/m4_builtin_insert/m4_builtin_define/g;
7075 s/m4_macro_insert/m4_macro_define/g. Updated all callers.
7077 2001-09-08 Gary V. Vaughan <gary@gnu.org>
7079 Get rid of m4_symbol_lookup_t entirely. With Akim's earlier
7080 commits, the m4_lookup_symbol dispatch function is split into
7081 specialised functions that must be called directly.
7083 * m4/m4module.h (m4_symbol_lookup_t): Removed.
7084 * m4/symtab.c (m4_lookup_symbol): Removed.
7085 (m4_symbol_builtin, m4_symbol_macro): New functions.
7086 * m4/builtin.c (m4_builtin_define): Split into...
7087 (m4_builtin_pushdef, m4_builtin_insert): ...these.
7088 (m4_macro_define): Split into...
7089 (m4_macro_pushdef, m4_macro_insert): ...these.
7090 * src/main.c (main): Set command line macros from `-D' parameters
7091 using `m4_macro_define'.
7093 2001-09-08 Gary V. Vaughan <gary@gnu.org>
7095 * m4/symtab.c (m4_symtab_remove_module_references): Renamed as
7096 this from m4_remove_table_reference_symbols().
7097 * m4/m4module.h, m4/module.c: Updated all references.
7099 2001-09-07 Akim Demaille <akim@epita.fr>
7101 * modules/stdlib.c, modules/times.c: Misc cleanups.
7103 2001-09-07 Akim Demaille <akim@epita.fr>
7105 * configure.in: We now need Autoconf 2.52e.
7106 * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
7107 and `M4_SYMBOL_DELETE'.
7108 * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
7109 * src/main.c (main): Adjust.
7111 2001-09-06 Gary V. Vaughan <gary@gnu.org>
7113 Fix the obstack.h problem once and for all! At configure time we
7114 can test for a system supplied obstack.h: depending on the
7115 result, we now generate system.h with an #include of the correct
7116 header. As a bonus, I've also added a --with-included-obstack,
7117 incase the user doesn't like the system obstack for some
7118 reason... and also we can test the shipped obstack on a system
7119 that has oe of its own. We also now need to be careful to add
7120 build directories to the include search path, since the generated
7121 system.h will be in the build tree.
7123 * configure.in (AC_CONFIG_FILES): Generate system.h from
7125 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
7126 include the system obstack header or the copy shipped with M4.
7127 Allow the user to override configure and force the build to use
7128 the shipped version.
7129 * m4/system-h.in: New file, template for...
7130 * m4/system.h: ...this. Now deleted.
7131 * m4/m4module.h: Include system.h before everything else.
7132 * src/freeze.c: Ditto.
7133 * m4/Makefile.am (dist-hook): Remove generated system.h.
7134 (INCLUDES): Check builddir for generated headers before checking
7136 * modules/Makefile.am (INCLUDES): Ditto.
7137 * src/Makefile.am (INCLUDES): Ditto.
7139 2001-09-05 Gary V. Vaughan <gary@gnu.org>
7141 * TODO: Remove the items that have been addressed already.
7143 2001-09-05 Akim Demaille <akim@epita.fr>
7145 * src/main.c (main): Standardize --version.
7147 2001-09-05 Akim Demaille <akim@epita.fr>
7149 * modules/format.c (format): Have a bigger `str'.
7151 2001-09-05 Akim Demaille <akim@epita.fr>
7153 Rationalize warnings, reporting the macro name as if it were a
7154 program name, and assertions.
7156 * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
7158 * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
7160 Use assert for internal errors.
7161 * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
7163 * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
7165 * tests/builtins.at (pushpop): Adjust.
7167 2001-09-05 Akim Demaille <akim@epita.fr>
7169 * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
7172 2001-09-05 Akim Demaille <akim@epita.fr>
7174 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
7175 * m4/macro.c, m4/symtab.c: Adjust.
7177 2001-09-05 Akim Demaille <akim@epita.fr>
7179 * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
7180 (m4_symbol_pop, m4_symbol_del): this.
7181 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
7182 (m4_symbol_popdef, m4_symbol_delete): New.
7183 (m4_lookup_symbol): Adjust.
7184 * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
7186 2001-09-05 Akim Demaille <akim@epita.fr>
7188 * m4/m4module.h (m4_symbol_lookup): Rename as...
7189 (m4_symbol_lookup_t): this.
7191 2001-09-05 Akim Demaille <akim@epita.fr>
7193 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
7195 * m4/symtab.c (m4_lookup_symbol): Adjust.
7197 2001-09-03 Gary V. Vaughan <gary@gnu.org>
7199 Bootstrap will now work with Libtool 1.4.1 or higher:
7200 * bootstrap: Remove stale autom4te.cache files when
7202 * config/Makefile.am (ACLOCAL_MACROS): Add ltdl.m4 and
7204 * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
7205 libtool.m4 directly.
7206 Run libtoolize to refresh ltmain.sh.
7207 * config/ltmain.sh: Deleted.
7208 * acinclude.m4: Deleted.
7209 * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
7211 * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
7212 implementation for the cvs impaired libtool user.
7214 2001-09-03 Akim Demaille <akim@epita.fr>
7216 * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
7218 Avoid using `default' in switch, as it hides useful compiler
7219 warnings when a case is forgotten.
7221 2001-09-03 Akim Demaille <akim@epita.fr>
7223 * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
7224 is no such thing as `WITH_MODULES'.
7226 2001-09-03 Akim Demaille <akim@epita.fr>
7228 Improve the test suite's selfcontainedness.
7230 * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
7231 (Include, Undivert): Tag the other input files.
7232 * tests/generate.awk: Catch `@comment file:'.
7233 `-I $src' is no longer needed.
7234 `next' is really like `return': the rest is skipped.
7235 Adjust to `input.m4'.
7236 (fatal): New function.
7237 * tests/foo, tests/incl.m4: Remove.
7239 2001-09-01 Gary V. Vaughan <gary@gnu.org>
7241 The shadowing mechanism and, infact, the whole symbol table
7242 implementation was creaking under the weight of the features piled
7243 on top of it. We now have a separate hash table module which will
7244 dynamically resize to keep symbol density withing good performace
7245 limits, and a new symtab module layered above it. Symbol lookups
7246 are now marginally more efficient (since the shadowed flag is no
7247 longer required) and symbol removal, such as on module unload, is
7248 considerably faster due to a reorganisation of the data structures
7251 * src/main.c (main): Don't mention `-H'.
7252 * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
7255 * m4/hash.c: New generalised dynamic hash table data structure
7257 * m4/hash.h: Public interface.
7258 * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
7259 (libm4_la_SOURCES): Add hash.c.
7260 * m4/symtab.c: More or less rewritten from scratch, within the
7261 bounds of the previous API.
7262 (m4_symtab_apply): A cleaner version of the old hack_all_symbols
7263 call. Updated all callers.
7264 * m4/m4module.c: #include <m4/hash.h>, and changed all affected
7265 declarations to reflect API changes.
7266 (M4INIT): Generate a declaration too, to avoid the warning with
7267 --enable-debug builds.
7270 * m4/utility.c (hash_table_size): Removed.
7271 (m4_dump_symbols): Rewritten to build and qsort an array of symbol
7272 names, which are then looked up by builtin_dumpdef() as necessary.
7273 This implies a small speedup in builtin_symbols(), which discarded
7274 all of the symbol info under the old call.
7275 * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
7276 shadowing is implicit in respect to the new data structures.
7277 symbol names are no longer duplicated here, they are stored in the
7278 key field of the hash table.
7279 Moved macro_args and blind_no_args...
7280 (m4_token_data): ...to here.
7281 m4/macro.c (expand_macro): Added a name argument since the symbol
7282 name is no longer copied into each struct m4_symbol. Modified all
7284 (collect_arguments): Ditto.
7285 * modules/m4.c (set_trace): Ditto.
7286 * modules/gnu.c (builtin_symbols): Updated.
7287 * src/freeze.c (produce_symbol_dump): Much improved in light of
7288 the improved symbol table layout.
7290 2001-09-01 Gary V. Vaughan <gary@gnu.org>
7292 * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
7294 (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
7295 (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
7296 SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
7297 SYMBOL_HANDLE): Ditto.
7298 * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
7299 modules/gnu.c, modules/m4.c, src/freeze.c,
7300 src/main.c: Updated all references.
7302 * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
7303 Automake 1.5 chokes on dynamic source file lists, Besides, it is
7304 already listed in m4_LDADD... how did that ever used to work?
7305 * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
7307 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
7308 Suggested by Tim Van Holder <tim.van.holder@pandora.be>
7310 * tests/m4: Don't call the m4 wrapper script with libtool, it
7311 works fine all by itself.
7313 2001-08-30 Gary V. Vaughan <gary@gnu.org>
7315 The experimental `changeword' feature never took off, and has
7316 no obvious advantages over `changesyntax' to compensate the
7317 enormous speed penalty it carries:
7318 * configure.in (ENABLE_CHANGEWORD): Removed.
7319 * m4/m4module.h (m4_set_word_regexp): Removed.
7320 * m4/m4private.h (m4_token_data): Removed original_text field.
7321 * m4/utility.c (m4_token_data_orig_text): Removed.
7322 * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
7323 * m4/macro.c: Ditto.
7324 * src/main.c: Ditto.
7325 * modules/Makefile.am (changeword.la): Removed.
7326 * modules/changeword.c: File removed.
7327 * doc/m4.texinfo: References to changeword and --word-regexp
7329 * po/POTFILES.in: modules/changeword.c removed.
7330 * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
7331 * tests/builtins.at (changeword): Test removed.
7333 2001-08-30 Akim Demaille <akim@epita.fr>
7335 * bootstrap.sh: Create aclocal.m4 instead of modifying it.
7336 This also help having a single list of m4 files: in
7338 * config/Makefile.am (STANDARD_MACROS): Rename as...
7339 (ACLOCAL_MACROS): this.
7340 (list-standard-macros): Remove.
7343 2001-08-29 Gary V. Vaughan <gary@gnu.org>
7345 In an attempt to moderate my egomania...
7346 * tests/modules.at: Remove attributions.
7348 * tests/generate.awk: When making substitutions to "@&t@", either
7349 "&" or "\&" in the substitution string argument to gsub refer back
7350 to the matched text. "@\\&t@" seems to work though, Tests 43 and
7353 2001-08-29 Akim Demaille <akim@epita.fr>
7355 * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
7356 (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
7357 (sync-lines, trace, translit, undivert, wrap): Move to...
7358 * tests/builtins.at: this new file.
7359 * tests/others.at (Discard comments, import-environment): Move to...
7360 * tests/options.at: this new file.
7362 2001-08-29 Akim Demaille <akim@epita.fr>
7364 * tests/others.at (Freezing modules)
7365 (--module-directory: absolute path, modpath2, modpath3)
7366 (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
7367 * tests/modules.at: here, new file.
7368 * tests/others.at, tests/generate.awk: Add a banner.
7369 * tests/testsuite.at: Adjust.
7370 (AT_CHECK_M4_FILTER): New, but unused.
7372 2001-08-29 Akim Demaille <akim@epita.fr>
7374 * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
7376 * tests/others.at (wrap): Inline wrap.m4.
7377 (shadow): Inline shadow.m4.
7378 (iso8859): Don't specify the path from top_srcdir, but from srcdir.
7379 * tests/m4: Simplify.
7381 2001-08-29 Akim Demaille <akim@epita.fr>
7383 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
7386 2001-08-29 Akim Demaille <akim@epita.fr>
7388 * tests/generate.awk (normalize): s/@__@/@&t@/.
7390 2001-08-28 Akim Demaille <akim@epita.fr>
7392 * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
7394 2001-08-28 Gary V. Vaughan <gary@gnu.org>
7396 * bootstrap (generate.awk): Generate test cases with new script.
7398 2001-08-27 Akim Demaille <akim@epita.fr>
7400 * tests/Makefile.am (installcheck-local): Don't use
7401 `dc_install_base' which is not visible here, but `exec_prefix'
7402 which is clearly the RT anyway.
7403 * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
7404 related to testing a now installed m4.
7405 * tests/m4: Do it here.
7407 2001-08-27 Akim Demaille <akim@epita.fr>
7409 * tests/others.at (indir): Formatting change.
7411 2001-08-27 Akim Demaille <akim@epita.fr>
7413 * tests/Makefile.am (installcheck-local): New.
7414 * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
7416 Prefer options over envvars.
7417 * src/main.c (main): First bug caught by the test suite (yeah!):
7418 --batch lacked a `break' which resulted in an accidental
7419 invocation of --discard-comments.
7421 2001-08-27 Akim Demaille <akim@epita.fr>
7423 * tests/others.at (capitalize, changeword, comments, ddivert)
7424 (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
7425 (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
7426 (sysv-args, trace, translit, undivert): Don't rely on files in
7427 examples/: AT_DATA them.
7429 2001-08-27 Akim Demaille <akim@epita.fr>
7431 Let the test suite use a wrapper around the not installed m4 to
7432 pretend it is (installed).
7434 * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
7435 such a way that m4 does not process them.
7436 * configure.in: The package name seems to be `m4', not `M4'.
7438 * tests/atlocal.in (at_package, M4): Remove.
7439 * tests/testsuite.at, tests/others.at: Use m4, not $M4.
7441 2001-08-27 Akim Demaille <akim@epita.fr>
7443 * tests/Makefile.am (CLEANFILES): Remove.
7444 (DISTCLEANFILES, clean-local): New.
7445 * examples/mktests.sh: Remove.
7447 2001-08-27 Akim Demaille <akim@epita.fr>
7449 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
7450 Don't use aclocal: it's written by hand.
7451 * aclocal.m4: m4_include all the files instead of being built by
7453 * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
7454 until it reads the traces by itself.
7455 * configure.in: Require Autoconf 2.42c as we are now using
7456 AC_CONFIG_TESTDIR instead of AT_CONFIG.
7457 Catch unexpanded `jm_' macros.
7458 * config/atconfig.m4: Remove.
7459 * config/error.m4: new.
7460 * config/Makefile.am: Ship the files included by aclocal.m4.
7461 * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
7462 (TESTSUITE_AT): this, to please Automake.
7463 (TESTSUITE): This target uses autotest/autotest.m4, not
7464 autotest/general.m4.
7465 * tests/testsuite.at: Prereq Autotest 2.52c.
7466 * examples/Makefile.am (pkgdata_DATA): Rename as...
7467 (dist_pkgdata_DATA): this.
7468 * doc/Makefile.am (man_MANS): Rename as...
7469 (dist_man_mans): this.
7471 2001-08-20 Gary V. Vaughan <gary@gnu.org>
7473 * m4/system.h [cygwin*]: Thanks to Paul Sokolovsky and
7474 Robert Collins, building on Cygwin no longer requires Windows
7475 import and export symbol decorations.
7476 * m4/m4module.h (M4_SCOPE) [cygwin*]: Deleted all occurences.
7477 * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
7478 * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
7479 * m4/error.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
7480 * m4/input.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
7481 * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
7482 * m4/output.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
7483 * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
7484 * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
7485 * configure.in (LIBM4_DLL_IMPORT) [cygwin*]: Don't set this
7487 * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
7488 * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
7490 2001-08-20 Gary V. Vaughan <gary@gnu.org>
7492 Ansify the source. Previously we had a mix, where my code was
7493 in a K&R compatible style, and the preexisting code was in ANSI
7494 style. Nothing is lost wrt release 1.4 by reverting to ANSI,
7495 and now the code base is much cleaner.
7497 * m4/system.h: Remove M4_PARAMS macro and all users. Remove
7498 VOID macro and all users.
7499 * m4/m4module.h: Ansify function prototypes and headers.
7500 * m4/builtin.c: Ditto.
7501 * m4/evalparse.c: Ditto.
7502 * m4/input.c: Ditto.
7503 * m4/macro.c: Ditto.
7504 * m4/module.c: Ditto.
7505 * m4/output.c: Ditto.
7507 * m4/symtab.c: Ditto.
7508 * m4/utility.c: Ditto.
7509 * modules/format.c: Ditto.
7510 * modules/gnu.c: Ditto.
7511 * modules/m4.c: Ditto.
7512 * modules/mpeval.c: Ditto.
7513 * src/freeze.c: Ditto.
7515 * src/main.c: Ditto.
7517 2001-08-20 Akim Demaille <akim@epita.fr>
7519 * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
7520 generated with stock 2.52.
7522 2001-08-20 Akim Demaille <akim@epita.fr>
7524 * config/atconfig.m4: New, until part of Autoconf per se.
7525 * configure.in (AT_CONFIG): Use it.
7527 * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
7528 * tests/atlocal.in: New.
7529 * tests/generate.awk: For the time being, the empty quadrigraph is
7531 * tests/others.at (changeword, gmp): Check the configuration
7532 variable against `yes'.
7533 * tests/testsuite.at (dnl): Allow it, as it's used all over the
7536 2001-08-20 Akim Demaille <akim@epita.fr>
7538 * m4/utility.c (m4_numeric_arg): Spell out the culprit.
7539 * modules/m4.c (undivert): Disable the possibility of undiverting
7540 several files at once: it is not documented, it is inconsistent
7541 with the other macros, it can be straightforwardly mocked by
7542 several invocations, and most importantly, it prevents the
7543 possibility of other kinds of extension.
7544 Use `m4_numeric_arg'.
7546 2001-08-20 Akim Demaille <akim@epita.fr>
7548 * examples/include.m4: Typo.
7549 * tests/generate.awk: Really add it.
7550 * tests/Makefile.am: Adjust.
7551 * tests/others.at (Discard comments): It sure fails without `-c'.
7552 (include, undivert): Add -I examples/.
7554 2001-08-20 Akim Demaille <akim@epita.fr>
7556 Use sprintf, not ecft and friends since it is standard, portable,
7557 simplifies the code, and since the latter is even deprecated
7558 according to the GNU libc documentation.
7560 * modules/format.c: Drop evct support.
7562 2001-08-19 Gary V. Vaughan <gary@gnu.org>
7564 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up. Don't test
7566 * configure.in: ...do it here instead.
7568 * c-boxes.el: Deleted.
7569 * m4/builtin.c: Reformat box comments to be closer to GNU
7571 * m4/debug.c: Ditto.
7573 * m4/evalparse.c: Ditto.
7574 * m4/input.c: Ditto.
7575 * m4/m4module.h: Ditto.
7576 * m4/macro.c: Ditto.
7577 * m4/output.c: Ditto.
7578 * m4/symtab.c: Ditto.
7579 * m4/utility.c: Ditto.
7580 * modules/changeword.c: Ditto.
7581 * modules/format.c: Ditto.
7582 * modules/gnu.c: Ditto.
7583 * modules/load.c: Ditto.
7584 * modules/m4.c: Ditto.
7585 * modules/modtest.c: Ditto.
7586 * modules/mpeval.c: Ditto.
7587 * modules/perl.c: Ditto.
7588 * modules/shadow.c: Ditto.
7589 * modules/stdlib.c: Ditto.
7590 * modules/time.c: Ditto.
7591 * src/freeze.c: Ditto.
7592 * src/main.c: Ditto.
7594 2001-08-17 Gary V. Vaughan <gary@gnu.org>
7596 * m4/module.c: Fixup some errors in the description comment.
7598 2001-08-17 Akim Demaille <akim@epita.fr>
7600 * tests/others.at (iso8859): Specify the path to the M4 test file.
7601 * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
7602 files in error messages.
7604 2001-08-17 Akim Demaille <akim@epita.fr>
7606 * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
7607 * tests/others.at: Adjust input files paths.
7608 * tests/atconfig.in: Set top_builddir.
7609 * tests/Makefile.am: Adjust.
7610 `testsuite' is in src, not build.
7612 2001-08-17 Akim Demaille <akim@epita.fr>
7614 * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
7615 (generate.at): Install a temporary hack until the actual
7616 generate.awk is added to the repository.
7617 * tests/atconfig.in: New.
7619 2001-08-17 Akim Demaille <akim@epita.fr>
7621 Really apply the patch ``Drop Autoconf 2.13 compatibility.''
7623 2001-08-17 Akim Demaille <akim@epita.fr>
7625 * doc/m4.texinfo: Promote proper quotation.
7627 2001-08-17 Akim Demaille <akim@epita.fr>
7629 Remove the non Autotest tests.
7631 * tests/other-tests/capitalize.test,
7632 * tests/other-tests/changeword.test,
7633 * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
7634 * tests/other-tests/debug.test,
7635 * tests/other-tests/discard-comments.m4,
7636 * tests/other-tests/discard-comments.test,
7637 * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
7638 * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
7639 * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
7640 * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
7641 * tests/other-tests/hanoi.test,
7642 * tests/other-tests/import-environment.m4,
7643 * tests/other-tests/import-environment.test,
7644 * tests/other-tests/include.test, tests/other-tests/indir.test,
7645 * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
7646 * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
7647 * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
7648 * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
7649 * tests/other-tests/modtest.test,
7650 * tests/other-tests/multiquotes.test,
7651 * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
7652 * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
7653 * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
7654 * tests/other-tests/sync-lines.m4,
7655 * tests/other-tests/sync-lines.test,
7656 * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
7657 * tests/other-tests/translit.test, tests/other-tests/undivert.test,
7658 * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
7659 * tests/other-tests/wrap.test: Remove.
7661 * tests/run-test, tests/get-them: Remove.
7662 * tests/Makefile.am: Adjust.
7664 2001-08-17 Akim Demaille <akim@epita.fr>
7666 others.at no longer depends on other-tests/.
7668 * tests/others.at (stackovf): You're actually...
7670 (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
7671 (unload.test): Keep their authorship.
7672 (discard-comments, gmp, import-environment, modfreeze)
7673 (sync-lines): Embed the input files.
7674 * tests/stackovf.test: Copy from other-tests/stackovf.test.
7675 * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
7677 2001-08-17 Akim Demaille <akim@epita.fr>
7679 * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
7680 (M4exit): Tag the exit status of the example.
7681 * tests/get-them: Adjust.
7682 * tests/generate.awk: New, based on get-them.
7683 * tests/Makefile.am: Adjust to generate `generated.at'.
7684 * tests/testsuite.at: Adjust.
7685 (AT_CHECK_M4): Don't overquote. Blush...
7687 2001-08-17 Akim Demaille <akim@epita.fr>
7689 Start using Autotest. atconfig creation is still lacking.
7691 * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
7692 * examples/reverse.m4, tests/other-tests/import-environment.m4,
7693 * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
7694 * tests/other-tests/import-environment.test: Don't check LANGUAGE
7695 as it might be `unset', or set to `C'.
7696 * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
7697 * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
7698 * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
7699 * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
7700 * tests/other-tests/shadow.test: Adjust.
7701 * tests/testsuite.at, tests/others.at: New.
7702 * tests/Makefile.am: Adjust.
7704 2001-08-17 Akim Demaille <akim@epita.fr>
7706 Drop Autoconf 2.13 compatibility.
7708 * configure.in (changeword): No need to undefine it, as anyway if
7709 it's defined, M4sugar moved it as m4_changeword.
7710 And anyway, proper quotation is enough.
7711 (m4_pattern_allow): As it exists in 2.50, just use it.
7712 (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
7713 Don't handle Gettext's duties, let it handle them.
7714 * config/gnu-obstack.m4: Use m4_pattern_allow directly.
7716 2001-08-17 Akim Demaille <akim@epita.fr>
7718 * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
7719 (m4_errprint): Use fputs.
7720 * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
7721 dumpdef are not concerned.
7722 (Dumpdef, Errprint): Emphasize their insensitivity to
7724 * doc/Makefile.am: Add `TAGS' support.
7725 (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
7727 * config/Makefile.am (MAINTAINERCLEANFILES): New.
7729 2001-08-17 Akim Demaille <akim@epita.fr>
7731 * modules/Makefile.am (ETAGS_ARGS): New.
7733 2001-08-17 Akim Demaille <akim@epita.fr>
7735 * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
7738 2001-08-17 Akim Demaille <akim@epita.fr>
7740 * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
7742 2001-08-17 Akim Demaille <akim@epita.fr>
7744 * m4/m4module.h (m4/list.h): Don't include it.
7746 2001-08-16 Gary V. Vaughan <gary@gnu.org>
7748 m4_modules are no more, we use lt_dlhandles directly and let
7749 latest libltdl features manage the list of loaded modules.
7750 * acinclude.m4: Regenerated.
7751 * m4/ltdl.c: Updated from master copy.
7752 * m4/module.c: Reimplemented to take advantage of advances in
7754 * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
7755 list with lt_dlhandle_next.
7756 (m4_builtin_find_by_func): Ditto.
7757 (m4_builtin_table_install): Use lt_dlhandle.
7758 (m4_macro_define): Ditto.
7759 (m4_macro_table_install): Ditto.
7760 m4/module.h: Prototype new module management API.
7761 (m4_modules): No longer required.
7762 (m4_module_init_t, m4_module_finish_t): POSIX namespace
7763 violations, renamed to...
7764 (m4_module_init_func, m4_module_finish_func): ...these,
7766 (M4INIT_HANDLER): Clean way to declare init functions in modules.
7767 (M4FINISH_HANDLER): And similarly for finish functions.
7768 * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
7769 -- Add indirection to the CONC macro so that arguments are
7771 * modules/modtest.c (m4_init_module): Replaced with M4INIT_HANDLER.
7772 * modules/shadow.c (m4_init_module): Ditto.
7773 Due to new init function semantics, be careful to perform the
7774 initialisation only on first load.
7775 * modules/perl.c (m4_init_module): Ditto. And Ditto.
7776 (m4_finish_module): Replaced with M4FINISH_HANDLER.
7777 Due to new finish function semantics, be careful to perform the
7778 finalisation only on first load.
7779 * m4/m4private.h (m4_module): Removed in favour of...
7780 (m4_module_data): ...structure without all the wrapper fields.
7781 Instances of this new structure are stored associated lt_dlhandles
7782 with lt_dlcaller_data_set().
7783 * m4/builtin.c (m4_builtin_define): Takes a handle argument
7784 instead of the old module argument.
7785 (m4_builtin_table_install): Ditto.
7786 * modules/load.c (m4_resident_module): Removed. This is no
7787 longer implemented as a magic symbol...
7788 * modules/m4.c (m4_resident_module): Ditto.
7789 * modules/load.c (M4INIT_HANDLER): ...the module init function now
7790 uses the ltdl api to make the module resident.
7791 * modules/m4.c (M4INIT_HANDLER): Ditto.
7792 * modules/load.c (builtin_modules): Traverse the loaded module
7793 list with lt_dlhandle_next.
7794 (builtin_load): Much simplified in light of the reimplemented
7796 * src/freeze.c (produce_module_dump): Cleaned up and optimised in
7797 light of the m4/module.c rewrite.
7798 (produce_symbol_dump): Ditto.
7799 (reload_frozen_state): Ditto.
7800 * m4/list.c, m4/list.h: Files deleted. No longer required.
7801 * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
7802 (libm4_la_SOURCES): Delete list.c reference.
7803 * m4/m4private.h (m4_token_data): Add a handle field. This
7804 eliminates many of the searches to find the handle associated with
7805 various tokens that are passed between functions.
7806 (struct m4_symbol): Removed the module field. The
7807 module association does not belong with the symbol...
7808 * m4/input.c (struct m4_builtin): ...it belongs with the builtin
7809 that the module implementation code is from. Added a handle
7811 (m4_push_macro): Add a `handle' argument. Changed all callers.
7812 (init_macro_token): Set the `handle' field for the
7814 * m4/macro.c (expand_argument): Copy the new handle field during
7816 * modules/m4.c (macro_install): Use the new handle field to
7817 optimise the search for the correct builtin structure, and pass
7818 the handle details to m4_builtin_define.
7820 2001-08-15 Akim Demaille <akim@epita.fr>
7822 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
7823 when creating `m4/obstack.h'.
7824 * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
7826 * tests/defs: Make them absolute.
7827 (CDPATH) Neutralize.
7828 * tests/gethem: Use them.
7830 2001-08-14 Gary V. Vaughan <gary@gnu.org>
7832 * config/ltmain.sh: Doh! Import again for a quoting fix that
7833 prevented any regression test from passing.
7835 * m4/m4module.h (obstack.h): Choose between installed version
7836 and shipped version based on configure tests.
7837 * src/freeze.c (obstack.h): Ditto.
7839 * acconfig.h: Removed. No longer required.
7841 * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
7842 * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
7843 them to AC_INIT and AM_INIT_AUTOMAKE.
7844 * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
7845 disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
7846 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
7847 shell variable m4_cv_func_obstack_h.
7848 * tests/defs (M4): Be more careful about relative path to libtool
7849 script and m4 binary by using $srcdir.
7851 * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
7852 optargs to the existing libltdl search path.
7853 * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
7854 * m4/ltdl.c: Updated.
7856 * config/ltmain.sh: Ditto.
7858 2001-08-11 Gary V. Vaughan <gary@gnu.org>
7860 * src/main.c (main): Add `-b' (for `batch') mode switch to force
7861 interactive mode off.
7863 2001-08-10 Akim Demaille <akim@epita.fr>
7865 * configure.in: Require Autoconf 2.52.
7866 (AC_ARG_PROGRAM): Remove, handled by Automake.
7867 (m4_getopt): Rename as...
7868 (m4_getopt_h): this.
7869 Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
7870 Undefine `changeword' only if defined.
7871 * config/gnu-obstack.m4: Require Autoconf 2.52.
7872 (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
7875 2001-08-09 Yuji Minejima <ggb01164@nifty.ne.jp>
7877 * doc/m4.texinfo: Fix some typos, and apply some small
7880 2001-08-09 Andreas Schwab <schwab@suse.de>
7882 * src/main.c (main): Fix improper uses of error (missing format
7885 2001-08-07 Akim Demaille <akim@epita.fr>
7887 Improve `make distcheck'.
7889 * configure.in: Be sure to be able to run `mkconfig.sh' when src
7891 * Makefile.am (dist-hook): Remove, as it is no longer needed.
7892 * doc/m4.texinfo (Include): Add missing blank.
7893 * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
7896 2001-08-07 Akim Demaille <akim@epita.fr>
7898 * m4/evalparse.c: A better introductory comment.
7899 * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
7900 * m4/macro.c: Adjust old comments.
7901 * modules/README: Typo.
7903 2001-08-07 Akim Demaille <akim@epita.fr>
7905 * config/gnu-obstack.m4: New.
7907 2001-08-07 Akim Demaille <akim@epita.fr>
7909 * config/Makefile.am, config/stackovf.m4: New.
7910 * configure.in, Makefile.am: Adjust.
7912 2001-08-05 gettextize <bug-gnu-utils@gnu.org>
7914 * po/Makefile.in.in: Upgrade to gettext-0.10.39.
7915 * po/cat-id-tbl.c: Remove file.
7916 * po/stamp-cat-id: Remove file.
7918 2001-04-08 Roderick Koehle <Roderick.Koehle@infineon.com>
7920 * modules/format.c (format): Formatting for %f was not
7921 interpreting the position of the decimal point correctly for
7924 2000-12-01 Gary V. Vaughan <gary@gnu.org>
7926 * TODO: Removed m4exit bug.
7927 * modules/load.c (m4_resident_module): Make this module resident.
7928 * module/m4.c (m4_resident_module): Ditto.
7929 * m4/modules.c (m4_module_load): Use new ltdl resident modules
7930 feature to mark modules as resident if they export
7931 `m4_resident_module' as TRUE.
7932 (m4_module_unload): Do not remove resident modules, and take care
7933 with symbol insertion and deletion with resident modules.
7934 * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
7935 use resident modules feature.
7937 2000-11-30 Gary V. Vaughan <gary@gnu.org>
7939 * TODO: Updated. Removed some cruft that has since been fixed
7940 or implemented. Added some more entries.
7943 * modules/README: Updated.
7944 * doc/m4.texinfo: Updated.
7946 * modules/gnu.c (builtin_functions): Make indir orthogonal to
7947 builtin, in that each is recognised as a macro only with parameters
7948 (builtin_indir): Passing 0 arguments is now an error, as with
7951 * src/main.c (usage): Added missing description of `-c' option.
7953 2000-11-29 Gary V. Vaughan <gary@gnu.org>
7955 Consolidate the myriad of dispersed test scripts into the
7956 tests subdirectory. I think I now have all the file where I
7957 want them, so there shouldn't be anymore upheaval =)O|
7959 * tests/Makefile.am: Updated to run the new tests added below.
7960 * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
7961 tests/other-tests/ddivert.test, tests/other-tests/debug.test,
7962 tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
7963 tests/other-tests/foreach.test, tests/other-tests/forloop.test,
7964 tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
7965 tests/other-tests/hanoi.test, tests/other-tests/include.test,
7966 tests/other-tests/indir.test, tests/other-tests/misc.test,
7967 tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
7968 tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
7969 tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
7970 tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
7971 tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
7972 tests/other-tests/reverse.test, tests/other-tests/shadow.test,
7973 tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
7974 tests/other-tests/translit.test, tests/other-tests/undivert.test,
7975 tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
7976 tests/other-tests/wrap.test: New tests based on the contents
7977 of the tests removed below.
7978 * examples/Makefile.am, modules/Makefile.am: Updated to
7979 reflect removed tests.
7980 * examples/defs,modules/defs: Removed.
7981 * examples/capitalize.test, examples/comments.test,
7982 examples/ddivert.test, examples/debug.test,
7983 examples/esyscmd.test, examples/exp.test,
7984 examples/foreach.test, examples/forloop.test,
7985 examples/fstab.test, examples/hanoi.test,
7986 examples/include.test, examples/indir.test,
7987 examples/misc.test, examples/multiquotes.test,
7988 examples/patsubst.test, examples/pushpop.test,
7989 examples/regexp.test, examples/reverse.test,
7990 examples/sysv-args.test, examples/trace.test,
7991 examples/translit.test, examples/undivert.test,
7992 examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
7993 modules/modpath1.test, modules/modpath2.test,
7994 modules/modpath3.test, modules/modpath4.test,
7995 modules/modtest.test, modules/shadow.test,
7996 modules/unfrozen.m4, modules/unload.test: Removed.
7998 Move the implementation of GMP support for the mpeval() builtin
7999 into a loadable module that depends on libgmp. mpeval() and
8000 eval() share a common parser, now in m4/evalparser.c; the code
8001 in m4/numb.c and m4/numb.h is now physically split between
8002 m4/eval.c (the eval() backend) and modules/mpeval.c (the
8003 mpeval() backend), rather than being differentiated by cpp
8004 macros and multiple inclusion. The mpeval module is always
8005 built but will generate an diagnostic if it is used from an
8006 installation that didn't link in the gmp library.
8007 * modules/Makefile.am: build and install the new mpeval module.
8008 * modules/mpeval.c: Now contains the former parts of m4/numb.c
8009 and m4/numb.h that are required for gmp support in mpeval().
8010 * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
8011 * m4/evalmp.c: Removed.
8012 * m4/m4module.h: Removed conditional prototype for
8014 * m4/eval.c: Rewritten. Contains the former parts of m4/numb.c
8015 and m4/numb.h that do not rely on gmp.
8016 * m4/evalparse.c: New file, contains the shared parts of the
8017 eval() and evalmp() parser implementations, and is no longer
8018 unencumbered by cpp magic to uncover the right parts.
8019 * m4/numb.h: Removed. It's former contents are split between
8020 m4/eval.c and modules/mpeval.c.
8023 * tests/other-tests/changeword.test: New test. Rudimentary
8024 testing of changeword builtin runs only if --wnable-changeword
8025 was used at configure time.
8026 * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
8027 alternation correctly. Split into two expressions to compensate.
8028 * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
8029 * modules/Makefile.am: Build changeword module.
8030 * modules/changeword.c (m4_macro_table): Define __m4_changeword__
8031 only when --enable-changeword was passed to configure.
8032 (builtin_changeword): If --enable-changeword was not used, then
8033 report that changeword() builtin has no support in m4 binary.
8035 2000-11-28 Gary V. Vaughan <gary@gnu.org>
8037 * src/main.c (main): Fixed a particularly nasty bug is
8038 user_search_path setting -- the -M flag processing must be
8039 extremely careful with search path ordering, or else the default
8040 installed module directory (possibly containing modules from a
8041 previous release) is placed earlier in the search path than any -M
8042 arguments (which are relied upon to load uninstalled modules with
8043 most of the tests in the regresion suite).
8045 * modules/load.c (builtin_load): Nasty hack to prevent adding
8046 symbols to symtab again if a module is loaded more than once.
8047 * modules/m4.c (builtin_ifelse): removed unused variable argv0.
8049 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed a
8050 possible NULL pointer dereference.
8052 * m4/module.c (m4_module_find_by_modname): Renamed from
8053 m4_module_modname_find. Fixed all references.
8054 (m4_module_find_by_builtin): New function.
8056 * modules/modfreeze.test: load the `load' module with each
8058 * src/freeze.c (produce_frozen_state): Simplified in light of
8059 module field in m4_symbol. Allow a third argument for text macros
8060 to name the originating module.
8061 (reload_frozen_state): ditto.
8062 * m4/m4module.h: Fixup prototypes.
8063 * m4/builtin.h (m4_builtin_define): Add a module argument so
8064 that symbols can be registered against the defining module.
8065 (m4_macro_define): ditto.
8066 * m4/m4private.h (m4_symbol): Make the module field const to save
8067 on casting in the rest of the code.
8068 (SYMBOL_MODULE): New macro.
8070 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
8071 symbol reference maintenance bugs when removing a symbol from the
8074 * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
8076 2000-11-27 Gary V. Vaughan <gary@gnu.org>
8078 * configure.in (m4_cv_func_obstack): A better check for whether
8079 libc has an obstack implementation.
8080 * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
8082 * configure.in (--with-modules): Changed semantics. This
8083 option is now used to list modules to be preopened.
8084 * src/m4.h: #include "ltdl.h" unconditionally.
8085 * src/main.c: Removed all dependencies on WITH_MODULES.
8086 * src/freeze.c: ditto.
8087 * modules/Makefile.am: ditto.
8088 * m4/m4.c (builtin_m4exit): ditto.
8089 * modules/modpath1.test: ditto.
8090 * modules/modpath2.test: ditto.
8091 * modules/modpath3.test: ditto.
8092 * modules/modpath4.test: ditto.
8093 * modules/modtest.test: ditto.
8094 * modules/shadow.test: ditto.
8095 * modules/unload.test: ditto.
8097 * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
8098 comes up on demand in LTLIBOBJS now.
8099 * configure.in (getopt_long): Creating and relying on a link for
8100 getopt.h on hosts with no getopt_long() of thier own works
8101 correctly now. This is necessary so that callers of getopt_long()
8102 can simply `#include <getopt.h>': the naive way of doing this
8103 would end up using our own getopt.h and the installed
8104 getopt_long(), which is asking for trouble!
8105 (obstack_init): A similar argument applies to obstack.h and
8108 * m4/ltdl.c: Upgraded to latest bleeding edge version again.
8109 On Solaris-2.5 (at least) the native dlopen implementation
8110 gets confused about m4.o when looking for module "m4". This
8111 version always looks for .la an .$lib_ext suffixed names first
8112 to work around the problem. Sigh.
8114 * po/POTFILES.in: Take account of these file movements.
8115 * src/Makefile.am (m4_SOURCES): removed eval.c.
8116 (EXTRA_m4_SOURCES): removed numb.c and numb.h.
8117 * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
8118 (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
8119 * modules/m4.c (builtin_eval): Use m4_evaluate().
8120 * m4/eval.c: Moved here from src/eval.c to facilitate
8121 implementation of eval() builtin as part of the `m4' loadable
8123 (m4_evaluate): renamed from evaluate for namespace cleanliness.
8124 * m4/numb.c: Moved here from src/numb.c, since it is #included
8125 into eval.c at compile time.
8126 * m4/m4module.h (m4_evaluate): Added prototype.
8127 * src/m4.h (evaluate): Removed prototype.
8129 2000-11-25 Gary V. Vaughan <gary@gnu.org>
8131 * modules/perl.c (builtin_perleval): Use PL_na for
8132 compatibility with perl-5.6.
8134 * src/main.c (main): It is now safe to
8135 ``m4_module_install("m4")'', without tripping over the m4
8137 * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
8138 versions having fixed the insidious module search order bug.
8140 * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
8141 supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
8143 * configure.in: Figure out whether to use the installed
8144 getopt.h or the supplied one.
8145 * src/Makefile.am: ditto.
8147 * po/POTFILES.in: List files in their new positions.
8149 * config/ltmain.sh: This needs to be checked in to match the
8150 libtool macros copied to acinclude.m4 (until a released
8151 libtool copes with m4's needs).
8152 * bootstrap: Run gettextize.
8154 2000-11-24 Gary V. Vaughan <gary@gnu.org>
8156 * AUTHORS: Added my details.
8159 * bootstrap: temporary update until released libtool catches up.
8161 * All files: Use new GNU GPL copyright blurb with current contact
8164 * configure.in (LTLIBOBJS): Use canonical code for calculation of
8167 * config: renamed acm4 directory to config to be more like
8168 other autoconfiscated packages.
8170 * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
8171 * config/debug.m4: New file implementing configure macros to add
8172 suitable debug flags to the compiler invocation.
8174 * modules/load.c: New file implementing the ``load'' and
8175 ``unload'' builtins.
8176 * tests/get-them: Set the module search directory to the modules
8177 build directory in generated tests.
8178 * modules/shadow.test: ditto.
8179 * modules/modtest.test: ditto.
8180 * modules/modpath1.test: ditto.
8181 * modules/modpath2.test: ditto.
8182 * modules/modpath3.test: ditto.
8183 * modules/modpath4.test: ditto.
8184 * modules/modtest.test: ditto.
8185 * modules/modfreeze.test: ditto.
8186 * modules/unload.test: ditto.
8188 * modules/changeword.c: New file implementing the ``changeword''
8189 builtin as a loadable module.
8190 * modules/mpeval.c: New file implementing the ``mpeval'' builtin
8191 as a loadable module.
8193 * src/main.c (main): Load the gnu module if m4 was started
8194 normally -- i.e. without the -G option.
8195 * modules/gnu.c: New file implementing a new loadable module wuth
8196 definitions for all the gnu extension builtins.
8197 * modules/format.c: Moved here from src/format.c. Now included
8200 * src/main.c (main): Load the traditional module if m4 was
8201 started in `no_gnu_extensions' mode.
8202 * modules/traditional.c: New file implementing the ``unix'' macro,
8203 required when m4 is executed in traditional mode, as a loadable
8206 * src/main.c: Renamed from m4.c to avoid confusion with
8208 (main): Always load the m4 module.
8209 * modules/m4.c: New file implementing a new loadable module with
8210 definitions for all m4 builtins that are not gnu extensions.
8212 * m4/Makefile.am: Adjusted to take new files below into account.
8213 * m4/m4module.h: Prototypes for exported functions and types moved
8214 to this directory from the src directory.
8215 * m4/m4private.h: Moved here from src/m4private.h to facilitate
8216 the migration of all builtin implementations to loadable modules.
8217 * m4/macro.c: Moved this file here from the src directory,
8218 renaming all exported symbols to use the prefix ``m4_''.
8219 * m4/builtin.c: ditto.
8220 * m4/module.c: ditto.
8221 * m4/symtab.c: ditto.
8222 * m4/debug.c: ditto.
8223 * m4/input.c: ditto.
8224 * m4/output.c: ditto.
8226 * m4/ltdl.h, m4/ltdl.c: ditto.
8227 * m4/utility.c: Odd functions moved here from files in the src
8228 directory to facilitate builtin migration.
8230 2000-08-12 Gary V. Vaughan <gary@gnu.org>
8232 * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
8233 error message, to make translators' jobs a little easier.
8234 (builtin_builtin): ditto.
8235 (builtin_traceon): ditto.
8236 (builtin_traceoff): ditto.
8237 Reported by Akim Demaille <akim@epita.fr>
8239 * m4/Makefile.am (pkgincdir): Deleted. Use automake's built in
8240 pkgincludedir instead.
8242 * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
8243 it is exported globally. Fixed all references.
8247 (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
8248 globally. Fixed all references.
8249 (DEF_LQUOTE): ditto.
8253 2000-07-28 Gary V. Vaughan <gary@gnu.org>
8258 * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
8259 (AC_OUTPUT): touch stamp-h.in, not stamp-h.
8261 * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
8262 Removed `Prev', `Next' and `Up' fields of all @nodes now that
8263 makeinfo calculates them for us, and to make any future
8264 reorganisation easier.
8265 (Frozen files): Document format version 2.
8266 `V' now takes argument `2'.
8267 `F' can take a single argument if symbol and builtin names
8268 are the same, or 3 arguments if the builtin is from a module.
8269 New `S' specification for saving syntax table contents.
8270 New `M' specification for saving loaded module names.
8271 * src/freeze.c: Implement them.
8272 * src/input.c (syntax_code): For interpreting frozen syntax
8275 * examples/Makefile.am: Add the contents of the WWW directory to
8277 * examples/WWW/Makefile: ditto,
8278 (%.htm): Compares file contents (not just sizes) to determine
8279 whether a change has occured.
8280 * examples/WWW/_header.htm: Bumped version number.
8281 * examples/WWW: Regenerated content.
8283 * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
8284 compilers comes much easier without ansi2knr.
8285 * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
8287 * m4/list.c: New generic list container type.
8288 * m4/list.h: Interface to new container type.
8289 * m4/Makefile.am (pkginc_HEADERS): Install list.h.
8290 (libm4_la_SOURCES): compile and link list.c.
8291 * src/builtin.c (builtin_tables): Use list container.
8292 * src/module.c (symtab): ditto.
8293 * src/symtab.c (symtab): ditto.
8295 * m4/system.h: New file for common preprocessor definitions.
8296 * m4/Makefile.am (pkginc_HEADERS): install system.h.
8297 * m4/error.c: Use system.h in place of inline preprocessor.
8298 * m4/error.h: ditto.
8299 * m4/module.c: ditto.
8300 * m4/module.h: ditto.
8301 * m4/xmalloc.c: ditto.
8303 * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
8305 * m4/xmalloc.c (xmalloc_exit_failure): ditto.
8307 * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
8308 it is exported globally. Fixed all references.
8310 (module_init_t): ditto.
8311 (module_finish_t): ditto.
8312 (token_data): ditto.
8313 (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
8314 it is exported globally. Fixed all references.
8315 (SYNTAX_IGNORE): ditto.
8316 (SYNTAX_SPACE): ditto.
8317 (SYNTAX_OPEN): ditto.
8318 (SYNTAX_CLOSE): ditto.
8319 (SYNTAX_COMMA): ditto.
8320 (SYNTAX_DOLLAR): ditto.
8321 (SYNTAX_ACTIVE): ditto.
8322 (SYNTAX_ESCAPE): ditto.
8323 (SYNTAX_ALPHA): ditto.
8324 (SYNTAX_NUM): ditto.
8325 (SYNTAX_ALNUM): ditto.
8326 (SYNTAX_LQUOTE): ditto.
8327 (SYNTAX_RQUOTE): ditto.
8328 (SYNTAX_BCOMM): ditto.
8329 (SYNTAX_ECOMM): ditto.
8330 (SYNTAX_VALUE): ditto.
8331 (SYNTAX_MASKS): ditto.
8349 (TOKEN_NONE): ditto.
8350 (TOKEN_STRING): ditto.
8351 (TOKEN_SPACE): ditto.
8352 (TOKEN_WORD): ditto.
8353 (TOKEN_SIMPLE): ditto.
8354 (TOKEN_MACDEF): ditto.
8356 * m4/m4module.h (voidstar): Removed in favour of `VOID' for
8357 consistency. Fixed all references.
8358 (STRING): Renamed to `m4_string' for consistency, and because if
8359 is exported globally. Fixed all references.
8360 (token_type): Renamed to `m4_token_t' for the same reasons.
8361 (token_data_type): Renamed to `m4_token_data_t' for the same
8364 * m4/m4module.h (XCALLOC): Wrapper macro which handles type
8368 (XFREE): Wrapper macro which avoids freeing NULL pointers.
8370 * m4/m4module.h (m4_macro): New type for module defined user
8372 * modules/modtest.c (m4_macro_table): Define module user macros.
8373 * modules/shadow.c (m4_macro_table): ditto.
8375 * m4/m4module.h (M4BUILTIN_HANDLER): For defining handlers
8376 declared with M4BUILTIN.
8378 * m4/xmalloc.c: Use memset if bzero is not available when
8379 emulating calloc with malloc.
8380 (xcalloc): Fallback to malloc/bzero if calloc is not available.
8381 (xfree): Added for consistency. Will not try to free NULL
8383 * src/m4.c (xfree): Deleted in favour of the above.
8384 * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
8385 linking with libdmalloc.
8386 * m4/xstrdup.c (WITH_DMALLOC): ditto.
8388 * modules/frozen.m4: New test case.
8389 * modules/unfrozen.m4: ditto.
8390 * modules/modfreeze.test: New test.
8391 * modules/unload.test: ditto.
8392 * modules/Makefile.am (EXTRA_DIST): Distribute them.
8394 * modules/modpath1.test: Don't try this test if module support is
8396 * modules/modpath2.test: ditto.
8397 * modules/modpath3.test: ditto.
8398 * modules/modpath4.test: ditto.
8399 * modules/modtest.test: ditto.
8400 * modules/shadow.test: ditto.
8402 * modules/perl.c: New module.
8403 * modules/perl.m4: Example of using it.
8404 * modules/Makefile.am (perl_la_SOURCES): Build new perl module.
8406 * src/m4.c (main): Assume interactive mode if STDIN is connected
8408 Changed startup sequence slightly so that syntax is not
8409 initialised from here when loading a frozen file.
8411 * src/builtin.c: Much improved macro definition style.
8412 * src/m4private.h: Internal structures for m4_builtin and
8413 m4_macro instances. These are not exposed to module writers.
8414 * src/module.c (module_modname_find): Find a module structure
8416 (make_macro_table): Build an internal macro table from a external
8418 (make_builtin_table): Build an internal builtin table from an
8419 external definition.
8421 * src/module.c (module_unload): Be extremely careful to remove
8422 builtins and macros that match the module being unloaded -- no
8423 longer assume that the top element can be removed incase another
8424 odule defines an identical name.
8425 * src/symtab.c (remove_table_reference_symbols): remove all symbol
8426 table entries which refer to a given builtin table.
8427 * src/builtin.c (remove_tables): Use it!
8429 2000-07-13 Thomas Tanner <tanner@ffii.org>
8431 * Makefile.am (SUBDIRS): we need modules/ for "make dist"
8432 * acm4/modules.m4: deleted
8433 * bootstrap: don't libtoolize libltdl!
8434 * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
8435 if set, enable WITH_MODULES and add modules to DLPREOPEN
8436 * examples/misc.test: redirect standard output
8437 * lib/Makefile.am: don't use DLLDFLAGS
8438 * lib/m4module.c: include necessary headers to silence GCC -Wall
8439 * lib/m4regex.c: fixes to silence GCC -Wall
8440 * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
8441 build modules conditionally
8442 * modules/shadow.c: define symbol aliases before using them
8443 * modules/test.c: define symbol aliases before using them
8444 * po/de.po: update translation
8445 * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
8446 pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
8448 * src/m4.c: initialize libltdl's preloaded symbols via
8449 LTDL_SET_PRELOADED_SYMBOLS
8450 * src/module.c: libltdl's memory management must be initialized
8451 before calling lt_dlinit!, fix warnings
8453 2000-01-18 Gary V. Vaughan <gary@gnu.org>
8455 * README: Caveat about nls not supported by dll architecture on
8458 * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
8460 * tests/Makefile.am (stamp-TESTS): now works with VPATH.
8461 * src/Makefile.am (m4_LDADD): use $(builddir) for VPATH.
8462 * modules/Makefile.am (LIBS): ditto.
8463 (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
8464 $(top_srcdir)/m4 (for only <m4module.h>).
8465 * modules/shadow.test: fixed for VPATH.
8466 * modules/modtest.test: ditto.
8467 * modules/modpath4.test: ditto.
8468 * modules/modpath3.test: ditto.
8469 * modules/modpath2.test: ditto.
8470 * modules/modpath1.test: ditto.
8472 * modules/time.test: Removed due to timezone dependence,
8473 * modules/Makefile.am (TESTS): Removed time.test.
8475 * configure.in: Use $3 of AC_DEFINE so that we can,,,
8476 * acconfig.h: Remove everything except the gettext parameters.
8477 * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
8479 * acm4/ltdl.m4: Updated to latest from libtool cvs.
8480 * acm4/modules.m4: Remove code which duplicates ltdl.m4 and
8481 increment serial number.
8483 * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
8484 src dir and immediately after libm4 is built for confidence that
8485 it doesn't rely on the src directory.
8486 (SUBDIRS): Moved doc dir to the end since helptoman.pl and
8487 makeinfo stop the build on cygwin (because they don't work).
8489 * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
8491 * m4/m4private.h: ...is not a public header, so moved to src.
8492 Add `#include <config.h>', `#define _COMPILING_M4' and
8494 * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
8495 * src/Makefile.am (noinst_HEADERS): add m4private.h.
8496 * src/builtin.c: `#include "m4private.h"' now takes care of the
8497 above. Duplicates removed.
8498 * src/debug.c: ditto.
8499 * src/eval.c: ditto.
8500 * src/evalmp.c: ditto.
8501 * src/format.c: ditto.
8502 * src/freeze.c: ditto.
8503 * src/input.c: ditto.
8505 * src/macro.c: ditto.
8506 * src/module.c: ditto.
8507 * src/numb.h: ditto.
8508 * src/output.c: ditto.
8509 * src/path.c: ditto.
8510 * stackovf.c: ditto.
8513 * po/POTFILES.in: compensate for renaming of lib/*.
8514 * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
8515 (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
8516 and then in $(top_srcdir)/lib (for eg. "m4private.h").
8517 * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
8519 * m4/m4error.h: Renamed error.h, for installation to
8520 $prefix/include/m4..
8521 * m4/m4obstack.h: Renamed obstack.h, for same reason.
8522 * m4/m4regex.h: Renamed regex.h, for same reason.
8523 * m4/m4error.c: Renamed error.c, and use #include "error.h".
8524 * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
8525 * m4/m4regex.c: Renamed regex.c, and fix #includes.
8527 * lib: moved to m4 to easily support header installation to
8529 * Makefile.am (SUBDIRS): renamed lib dir to m4.
8530 * configure.in (AC_OUTPUT): reference m4/Makefile.in.
8531 * acm4/regex.m4: Point to m4/regex.c.
8533 * examples/foreach.m4: Sanitise quoting.
8534 * examples/foreach.test: New torture test.
8535 From Akim Demaille <akim@epita.fr>
8537 2000-01-17 Gary V. Vaughan <gary@gnu.org>
8539 * src/ltdl.c: Use access() to abort doomed module load attempts
8540 if module file does not exist.
8542 * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
8543 getopt1.o will already be used if appropriate, so I moved getopt.c
8544 and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
8546 * modules/modpath1.test: Use correct filename in header line.
8547 * modules/modpath2.test: ditto.
8548 * modules/modpath3.test: ditto.
8549 * modules/modpath4.test: ditto.
8551 Without these changes lt_dlopen("test") attempts to
8552 LoadLibrary("/bin/test") on Windows, which although harmless
8553 generates a spurious error message which spoils most of the tests:
8554 * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
8555 (TESTS): s/test.test /modtest.test /
8556 (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
8557 (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
8558 * modules/modpath1.test: s/test.m4 /modtest.m4 /
8559 * modules/modpath2.test: ditto.
8560 * modules/modpath4.test: ditto.
8561 * modules/modpath3.test: s/-m test /-m modtest /
8562 * modules/shadow.m4: use {un,}loadmodule(`modtest').
8564 2000-01-16 Gary V. Vaughan <gary@gnu.org>
8566 * src/ltdl.c (find_file): Updated to new version with fixed memory
8567 allocation bug in `next'.
8568 * src/ltdl.h: updated to match.
8570 * modules/Makefile.am: Cleaned up and reordered.
8572 2000-01-16 René Seindal <rene@seindal.dk>
8574 * modules/Makefile.am (TESTS): New tests for the module system.
8576 * modules/*.test: New files.
8578 * src/m4.c (main): Added call to module_init().
8579 Treats -M and -m as the arguments -D -U and -t, ie deferred.
8581 * src/m4.h: Added declaration of module_init().
8583 * src/module.c (module_init): No longer static
8585 * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
8586 Added to shut up automake about non standard libtool library
8589 * src/module.c: Disabled DEBUG by default.
8591 * modules/README: Changed example from unload.m4 to shadow.m4
8593 * modules/shadow.m4: Renamed from unload.m4
8595 * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
8597 * src/m4.c (main): Functionality for -m and -M were reversed.
8600 2000-01-12 Gary V. Vaughan <gary@gnu.org>
8602 * doc/help2man.pl: updated to version 1.020.
8604 * lib/COPYING.LIB: updated to version 2.1.
8606 * lib/m4module.h: restructure the M4_SCOPE code to work when
8607 creating a dll which links with libm4.la and both DLL_EXPORT
8608 (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
8611 2000-01-11 Gary V. Vaughan <gary@gnu.org>
8613 Merged the following changes from my tree:
8615 1999-06-15 Gary V. Vaughan <gary@gnu.org>
8617 * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
8618 ported to compile shared libs.
8620 * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
8621 use `__declspec(dllimport)' when linking libm4.la on win32.
8622 * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
8624 * configure.in (M4OBJS): Discover whether we need the shipped
8625 implementation of getopt_long.
8626 * src/Makefile.am (m4_LDADD): Link the getopt objects into the
8627 main binary here, as opposed to the module library in lib/libm4.la.
8629 1999-06-14 Gary V. Vaughan <gary@gnu.org>
8631 * modules/README: Updated to describe the improved libltdl based
8633 * README (cygwin): Added some compilation notes for building m4
8634 correctly under cygwin.
8635 * TODO: Cleaned out the entries for the module system since they
8636 are now implemented.
8638 * *.[ch]: __P is in the compiler's reserved namespace, so replaced
8639 all instances of __P with M4_PARAMS.
8641 * lib/getdate.h: removed unreferenced file.
8643 * lib/m4private.h: New file to define the private interface to the
8644 token_data struct, which must be shared between m4module.c, and
8645 builtin.c but not exported to modules built from the installed
8646 m4module.h since it's size changes depending on compile time
8649 * src/m4.h: Lots of stuff moved to lib/m4module.h.
8651 * lib/m4module.h: New file to define the interface available when
8652 compiling m4 modules.
8653 * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
8654 necessary for module compilation into this new file.
8656 * lib/Makefile.am (include_HEADERS): install headers (renamed to
8657 avoid nameclash with other system headers) necessary for compiling
8659 (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
8660 so that modules can include the (renamed) installed headers and
8661 be guaranteed a matching implementation.
8662 * lib/m4error.h: renamed from error.h.
8663 * lib/m4obstack.h: renamed from obstack.h.
8664 * lib/m4regex.h: renamed from regex.h.
8665 * configure.in (AC_REPLACE_FUNCS): Don't look for a system
8666 implementation, simply include the shipped version
8667 unconditionally, otherwise it is hard for a module to know
8668 whether the m4obstack.h header it is using matches the
8669 implementation it ends up linking against.
8670 (jm_WITH_REGEX): Include regex into libm4 unconditionally for
8673 1999-05-18 Gary V. Vaughan <gary@gnu.org>
8675 * examples/misc.test: Don't run this test on machines which don't
8676 have a root user in /etc/passwd (e.g. cygwin).
8678 * tests/get-them (/^@example$/): Error messages might have a
8679 ``.exe'' suffix to the program name, or else use the libtool
8680 ``.libs/lt-m4'' binary, or generally have an unexpected path. All
8681 of these cases are now catered for when comparing error messages
8683 * tests/other-tests/*.test: ditto.
8684 * examples/*.test: ditto.
8686 * tests/defs (M4): use libtool execute mode.
8687 * examples/defs (M4): ditto.
8689 * tests/get-them (END): explicitly close any open file.
8690 (printthem): In a regular expression, '{' is the start of a repeat
8691 count! Use `[{]' for a literal open brace.
8692 (/^@node /): Don't use substr on a string shorter than the trim
8695 1999-05-17 Gary V. Vaughan <gary@gnu.org>
8697 * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
8699 (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
8701 2000-01-10 Andreas Schwab <schwab@suse.de>
8703 * tests/other-tests/gmp.test: Find config.sh in build directory.
8705 * configure.in: Find tests/mkconfig.sh in $srcdir.
8707 * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
8708 <signal.h> (for SUS2 compliant systems).
8710 * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
8713 2000-01-10 René Seindal <rene@seindal.dk>
8717 * TODO, NEWS: Cleaned up and updated.
8719 * src/m4.c (main): New variable exit_status for exit status in
8720 case of unreadable files. Now m4 will exit with EXIT_FAILURE if a
8721 file cannot be read instead of EXIT_SUCCESS.
8723 * src/builtin.c (m4_indir): Changed error message to help
8724 translators (from Akim Demaille <demaille@inf.enst.fr>).
8726 * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
8729 * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
8732 * src/input.c (match_input): Reordering of code, to avoid multiple
8733 calls to push_string_init() from obstack_grow(), which can happen
8734 with some compilers (found and fixed by James Bonfield
8735 <jkb@mrc-lmb.cam.ac.uk>).
8737 * src/stackovf.c: Added prototypes for ultrix.
8738 (setup_stackovf_trap): Added __P to cast.
8739 (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
8741 2000-01-09 René Seindal <rene@seindal.dk>
8743 * doc/m4.texinfo (Changequote): Added comment about changing
8744 quotes when the old quote is a part of the new.
8746 * src/builtin.c (expand_ranges): Added break after trailing dash.
8747 This caused misbehavious on some systems (found and fixed by Akim
8748 Demaille <demaille@inf.enst.fr>).
8750 * AUTHORS: Thomas Tanner included
8752 * acconfig.h: Added entry for ss_sp (see below).
8754 * configure.in (use_stackovf): Added check for stack_t with member
8755 ss_base instead of ss_sp (BSDI notably). (Reported by Paul Eggert
8756 <eggert@twinsun.com>).
8758 * doc/m4.texinfo (Frozen files): Added a simpler example for
8759 generating frozen files from several input files.
8761 1999-11-14 Paul Eggert <eggert@twinsun.com>
8763 * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
8764 lib/regex.c, lib/xmalloc.c.
8766 1999-11-10 René Seindal <rene@seindal.dk>
8768 * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
8770 * src/module.c: reindented.
8771 (module_load): return if this is a repeated load of same module.
8772 (module_init): slight change of logic to avoid repeated
8773 initialisation debug messages.
8775 * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
8776 in the distribution.
8778 * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
8779 automake warnings about missing lib prefix.
8780 (time_la_LDFLAGS): ditto
8781 (stdlib_la_LDFLAGS): ditto
8783 1999-11-10 Paul Eggert <eggert@twinsun.com>
8785 * src/m4.h: Include error.h, since our macros use error.
8786 * src/m4.c: Don't need to include error.h.
8788 1999-11-09 Paul Eggert <eggert@twinsun.com>
8790 * src/m4.h (voidstar): Define to void * if __STDC__ is defined
8791 and zero, as Solaris 7 cc does.
8792 (bcopy): Remove macro; no longer needed with new obstack.h.
8794 * src/output.c (freeze_diversions): Don't assume that a
8795 diversion size can fit in `int'. Check for diversion file
8796 size too large to be printed with `unsigned long'.
8798 * src/Makefile.am (CFLAGS): Omit -Wall.
8800 * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
8802 * src/debug.c (trace_format):
8803 Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
8805 * src/freeze.c (produce_frozen_state):
8806 Don't assume string lengths fit in int.
8808 1999-10-13 René Seindal <rene@seindal.dk>
8810 * po/cs.po: Czech translation added.
8812 * po/sv.po: Updated Swedish translation.
8814 * po/ru.po: Updated Russian translation.
8816 * po/pl.po: Updated Polish translation.
8818 * po/el.po: Greek translation added.
8820 1999-10-13 René Seindal <rene@seindal.dk>
8822 * configure.in (ALL_LINGUAS): Added Greek translation (el).
8823 (ALL_LINGUAS): Added Czech translation (cs).
8825 1999-03-30 Gary V. Vaughan <gary@gnu.org>
8827 * src/builtin.c: moved module loading functions into...
8828 * src/module.c: entirely new implementation using libltdl.
8829 * po/POTFILES.in: added src/module.c.
8830 * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
8831 are modules, not linktime libraries.
8832 (LDFLAGS): added -no-undefined -module and -avoid-version flags.
8833 * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
8834 avoidance on exported symbols.
8835 * modules/test.c (m4_macro_table, m4_init_module,
8836 m4_finish_module): ditto.
8837 * modules/time.c (m4_macro_table): ditto.
8839 * modules/time2.m4: new file which requires command line loading
8841 * src/m4.c (--load-module): dynamically load named runtime module
8842 into running executable before reading the source.
8843 (--module-directory): prepend a directory to the module search
8845 (module_init()): Do this the first time we load a module instead;
8846 if the module subsystem is broken normal m4 scripts can still run.
8847 * src/m4.h (install_builtin_table): is now exported.
8849 1999-03-26 Gary V. Vaughan <gary@gnu.org>
8851 * src/module.c: removed. No longer required.
8852 * po/POTFILES.in: removed src/module.c.
8854 * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
8855 the bootstrap script can recreate.
8856 * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
8857 * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
8858 * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
8859 * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
8860 (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
8861 * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
8862 * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
8863 * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
8865 * acinclude.m4: removed. `aclocal -I acm4' handles this much
8867 * acm4/Makefile.am (ACINCLUDE_M4): ditto.
8868 * acm4/gettext.m4: removed. It causes a multiple definition vs.
8869 the installed gettext.m4 file when running aclocal.
8871 1999-03-25 Gary V. Vaughan <gary@gnu.org>
8873 * configure.in (AM_INIT_AUTOMAKE): bumped version number to
8874 distinguish this from the last prerelease.
8875 (AC_LIBLTDL_CONVENIENCE): build libltdl as a convenience library
8876 in its own subdirectory.
8878 * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
8879 lib prefix on a module" feature.
8880 (LDFLAGS): Added `-module -avoid-version' flags to build
8881 versionless module libraries.
8882 * src/builtin.c (m4_load_module): use libltdl.
8883 (module_unload_all): use libltdl.
8884 * src/m4.c (module_init): initialise module loading on demand for
8885 better diagnostics, and so that m4 will still work even if
8886 the module code is broken.
8887 * src/m4.h (module_init): removed. No longer relevant.
8888 * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
8889 exported symbols for compatibility with dlpreopening.
8890 * modules/test.c (m4_macro_table, m4_init_module,
8891 m4_finish_module): ditto.
8892 * modules/time.c (m4_macro_table): ditto.
8894 * bootstrap: New file. Runs all the autoutils in the right order
8895 after a fresh checkout, or a make maintainer-clean.
8897 1999-02-18 Akim Demaille <demaille@inf.enst.fr>
8899 * src/builtin.c (dump_symbols): New function, factoring common
8900 content of m4_dumpdef and m4_symbols.
8901 (m4_dumpdef): Use it.
8902 (m4_symbols): New function, implementing `symbols'. Use it.
8903 * doc/m4.texinfo: Fixed missing commas after @xref, so that the
8904 file compile with modern makeinfo.
8905 (Symbols): New node, documenting symbols.
8906 (direntry): Modernize.
8908 1998-12-11 René Seindal <rene@seindal.dk>
8910 * src/builtin.c (predefined_tab): New predefined macros
8911 __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
8912 configure time options.
8914 1998-12-01 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
8916 * src/module.c (module_try_load): Don't try to be clever and
8917 overwrite argument string. Instead allocate all constructed
8918 strings locally, since they can have arbitrary lengths. Make
8919 arguments pointers to const.
8920 (module_search): Simplify due to above change.
8922 1998-11-29 René Seindal <rene@seindal.dk>
8926 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
8928 * tests/other-tests/import-environment.{m4,test}: New test.
8930 * tests/other-tests/discard-comments.{m4,test}: New test.
8932 * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
8934 * src/m4.c (main): New option -c --discard-comments.
8935 New global variable discard_comments.
8937 * src/m4.h (token_type): New TOKEN_NONE for tokens to be
8938 discarded, ie never returned from next_token().
8939 Added declaration of discard_comments.
8941 * src/input.c (next_token): Now loops until token type is not
8942 TOKEN_NONE. Comments are now given this type when comments should
8945 * doc/m4.texinfo (Invoking m4): Updated for --import-environment
8948 1998-11-28 René Seindal <rene@seindal.dk>
8950 * src/m4.c (main): New option --import-environment (no single
8953 * When configured with --with-gmp both the normal (fast) eval()
8954 and the gmp aware mpeval() are defined. To restore previous
8955 bahaviour use "define(`eval', defn(`mpeval'))".
8957 * tests/other-tests/gmp.m4: Changed to use mpeval().
8959 * src/evalmp.c: New file for compiling eval.c as gmp aware.
8960 Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
8962 * src/eval.c: Now includes "numb.c" directly. Everything in this
8963 file must by static, except evaluate(), which is changed to
8964 mp_evaluate() if USE_GMP in force.
8966 * src/numb.c: Changed to be included by eval.c instead of being
8967 compiled separately. Everything is declared static.
8969 * src/numb.h: Removed declarations of functions, as numb.c is now
8972 * src/builtin.c: Declaration of m4_mpeval() added.
8973 Inserted `mpeval' in builtin table.
8974 (do_eval): New function with common code for m4_eval and m4_mpeval.
8975 (m4_mpeval): New function for gmp version of eval.
8977 * src/m4.h: Declaration of mp_evaluate().
8979 * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
8980 (EXTRA_m4_SOURCES): Now has numb.c and numb.h
8982 * src/m4.c (main): m4 --version also shows which options were used
8983 for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
8985 1998-11-27 René Seindal <rene@seindal.dk>
8987 * Error messages now always print program name before input file
8988 name as specified by GNU coding standards. Reported by Akim
8989 Demaille <demaille@inf.enst.fr>.
8991 * doc/m4.texinfo (Include): Change due to changed error message
8995 * tests/get-them: Minor change to sed script due to changed error
8998 * src/m4.c (print_program_name): New func used to print program
8999 name, input file and line number in error (). Used as an
9000 error_print_progname handler.
9001 (reference_error): Removed.
9002 (main): Assigns error_print_progname.
9004 * src/m4.h (M4ERROR): Removed reference_error ().
9006 1998-11-25 René Seindal <rene@seindal.dk>
9008 * Updated to libtool 1.2b.
9010 * src/builtin.c (install_builtin_table): Added braces to avoid
9011 warning of ambiguous 'else'.
9013 * src/module.c: Inserted search path code from path.c modified to
9015 (module_init): Configured default path used only if M4MODPATH is
9017 (module_try_load): Now reads libMODULE.la as generated by libtool
9018 for actual module name.
9019 (module_load): Gives better error messages on failure.
9021 * src/m4.h: Added declarations of structures and functions for
9022 generic search path handling.
9024 * src/path.c: Removed all module specific code and introduced new
9025 functions of more generic search path handling.
9027 1998-11-24 René Seindal <rene@seindal.dk>
9029 * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
9030 included gettext, as <libintl.h> might not be found
9031 otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
9033 1998-11-22 René Seindal <rene@seindal.dk>
9035 * src/output.c (insert_diversion): Fixed bug that might cause m4
9036 to read from standard output! Triggered by input
9037 'divert(1)undivert(0)'. Test for divnum>0 changed to divnum>=0,
9038 so now 'undivert(0)' does nothing.
9040 1998-11-18 René Seindal <rene@seindal.dk>
9044 * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
9045 could be changed when compiling a illegal regexp, causing later
9046 use of the regexp to dump core.
9048 * src/module.c (module_load): Changed error message to conform to
9051 * src/m4.c (usage): Added message about reporting bugs.
9053 * doc/m4.texinfo (Changeword): Corrected a wrong example.
9054 (Changeword): Added note about the type of regexps used.
9056 * ltconfig, ltmain.sh: New files from Libtool 1.2.
9058 * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
9059 and AM_PROG_LIBTOOL.
9061 * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
9064 * modules/Makefile.am: Changed completely to compile modules using
9065 libtool. The modules are compiled as shared libraries, and are
9066 renamed when installed.
9068 * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
9069 USE_SHL_LOAD to HAVE_SHL_LOAD
9071 * src/builtin.c (shipout_string): Now tests for a NULL string.
9073 * src/module.c: New level of indirection around non-portable
9074 functions to load shared objects. Intended to encapsulate the non
9075 portable parts better and to reduce the number of #ifdefs in the
9078 * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
9079 directory modules/ to the distribution.
9081 1998-11-15 René Seindal <rene@seindal.dk>
9085 * modules/stdlib.c: New module `stdlib' defining some standard
9086 functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
9087 getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
9089 * src/builtin.c (shipout_string): New convenience function for
9090 builtins and modules.
9092 * src/module.c (module_load): Tentative support for
9093 shl_load/shl_findsym, but I cannot test it. Copied from MetaHTML.
9095 * Makefile.am (SUBDIRS): Directory modules added if configured.
9097 * modules/Makefile.am: Now correctly compiles and installs
9098 modules in pkglibexecdir.
9100 * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
9101 These two are now initialised by autoconf macros.
9103 * src/path.c (module_env_init): MODULE_PATH is always on the
9106 * src/Makefile.am: Now generated pathconf.h which defined the
9107 default MODULE_PATH.
9109 * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
9110 where modules are installed.
9112 * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
9113 by Brian J. Fox <bfox@datawave.net>. This change allow modules to
9114 build and install automatically, and it is prepared for other
9115 interfacec than dlopen().
9117 * src/builtin.c (predefined_tab): Added __m4_version__ for the
9118 current version of GNU m4. It is a GNU extension.
9120 1998-11-14 René Seindal <rene@seindal.dk>
9122 * tests/Makefile.am (GENERATED_TESTS): Added new
9123 generated-tests/changesy.8.test
9125 * doc/m4.texinfo (Changesyntax): Documentation for escape
9128 * src/macro.c (expand_token): Check for escaped macro call before
9129 symbol table lookup.
9131 * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
9134 * src/input.c: New static variable use_macro_escape, which is TRUE
9135 iff some character has code SYNTAX_ESCAPE
9136 (input_init): Added initialisation of use_macro_escape.
9137 (check_use_macro_escape): New function to synchronise
9138 use_macro_escape with the syntax table.
9139 (set_quotes): Added call to check_use_macro_escape()
9142 (next_token): Added new case for IS_ESCAPE.
9144 * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
9146 1998-10-13 René Seindal <rene@seindal.dk>
9150 * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
9153 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
9154 maintained tests in tests/other-tests. These currently tests for
9155 8-bit transparency, multiple precision arithmetic and sync-line
9156 output. Test for stackoverflow detection does not work.
9158 * examples/Makefile.am (TESTS): Added tests for all example files.
9160 * examples/mktests.sh: New file. Help program for creating test
9163 * tests/mkconfig.sh: New file to generate tests/config.m4 and
9164 tests/config.sh. This is for tests of configure selectable
9165 features. Picks up all set WITH_ and ENABLE_ veriables from
9168 * src/path.c (path_search): Added argument 'char **expanded_name'
9169 to return the expanded name.
9171 * src/m4.h: Added 2nd argument to declaration of path_search().
9173 * src/m4.c (main): Added 2nd argument to path_search().
9175 * src/freeze.c (reload_frozen_state): Do.
9177 * src/builtin.c (m4_undivert): Do.
9180 1998-10-11 René Seindal <rene@seindal.dk>
9182 * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
9184 * acm4/modules.m4: New file. Defines AM_WITH_MODULES.
9186 * acm4/gmp.m4: New file. Defines AM_WITH_GMP.
9188 * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
9190 * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
9192 * intl/: Updated to GNU gettext 0.10.35.
9194 * doc/m4.texinfo (Format): Documented that format is blind.
9196 * src/builtin.c (builtin_tab): Builtin format marked as blind.
9198 1998-10-07 René Seindal <rene@seindal.dk>
9202 * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
9203 .test, as the files are no longer just m4 input.
9205 * tests/get-them (FILE): Changed .m4 extension to .test.
9207 * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
9208 Otherwise quoted strings with leading whitespace first in a macro
9209 argument would be eliminated.
9211 * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
9212 (expand_argument): Do.
9214 * src/input.c (next_token): SPACE and NUM/OTHER characters are only
9215 grouped together iff both quote and comment strings are single
9216 character. Otherwise they might include a comment/quote leader.
9217 (next_token): Returns new token type TOKEN_SPACE.
9219 * src/builtin.c (push_builtin_table): New function to push a
9220 builtin_table on the stack without installing its contents.
9221 (find_builtin_by_name): Added call to push_builtin_table() if
9222 reading frozen files. Otherwise the builtins named in the frozen
9223 files could not be found.
9224 (install_builtin_table): Changed to use push_builtin_table()
9226 1998-10-04 René Seindal <rene@seindal.dk>
9228 * po/pl.po: Polish translation added.
9230 * po/POTFILES.in: src/module.c added.
9232 1998-10-04 René Seindal <rene@seindal.dk>
9236 * configure.in (ALL_LINGUAS): Added Polish pl.po
9238 1998-10-03 René Seindal <rene@seindal.dk>
9240 * Many files: Incorporated changes to implement dynamic modules.
9241 Detailed comments in src/modules.c and modules/README
9243 * src/module.c: New file, implements the OS dependant parts of
9244 dynamic module loading.
9246 * src/Makefile.am (m4_SOURCES): Added module.c
9248 * src/builtin.h: New file, declares some functions from builtin.c
9249 that are of use for other modules (shipout_int, numeric_arg,
9250 skip_space, bad_argc), and the macros ARG() and DECLARE().
9252 * src/builtin.c (install_builtin_table): New function. Each
9253 module brings in a builtin_table, which is pushed on a stack.
9254 (struct builtin_table): New struct for list of builtin_tables.
9255 (m4_loadmodule): New function to implement builtin "loadmodule".
9256 (shipout_int): No longer static, to be used by modules.
9260 (builtin_init): changed to call install_builtin_table()
9261 (find_builtin_by_name): Now searches all builtin_tables
9262 (find_builtin_by_addr): do.
9264 * src/path.c: Reorganised to allow for two search paths, one for
9265 include files and one for modules.
9267 * src/m4.h: Added declarations for new functions in module.c and
9270 * src/m4.c (main): Added call to module_init().
9272 * modules: New directory with a few demo modules.
9274 * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
9277 * configure.in: Added modules/Makefile to AC_OUTPUT.
9279 * configure.in: Added code to implement --with-modules. Tests for
9282 * acconfig.h: Added WITH_MODULES
9284 1998-10-02 René Seindal <rene@seindal.dk>
9286 * examples/Makefile.am (pkgdata_DATA): Removed special target for
9287 check and variables TESTS. These tests are now run from the
9290 * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
9291 directory. The files stay there but the tests are run from the
9294 * tests/Makefile.am (EXTRA_DIST): Added run-test.
9296 * tests/run-test: New file. Run a test manually
9298 * tests/Makefile.am, tests/get_them: Moved automatically generated
9299 tests (from the manual) to sub directory tests/gentest/. The
9300 tests/ directory had gotten a bit messy.
9302 1998-09-06 Erick Branderhorst <Erick.Branderhorst@asml.nl>
9304 * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
9305 wrap}.test: Added a few testcases.
9307 1998-08-21 Erick Branderhorst <Erick.Branderhorst@asml.nl>
9311 * lib/Makefile.am (noinst_HEADERS): regex.h added
9313 * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
9314 acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
9316 * acm4/Makefile.am: created providing rules to create
9317 $(top_srcdir)/acinclude.m4 to be used by aclocal.
9319 * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
9320 `C'. Reported by Ulrich Drepper.
9322 * Makefile.am (SUBDIRS): Removed checks directory
9323 * configure.in (AC_OUTPUT): Removed checks/Makefile
9325 * doc/m4.texinfo (Patsubst,example): @comment added to preserve
9326 the space when m4.texinfo is edited and whitespace.el is active.
9327 (Defn,example): idem.
9329 1998-08-20 Erick Branderhorst <Erick.Branderhorst@asml.nl>
9331 * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
9332 ../COPYING. ../Makefile is a file which is certainly present when
9333 test is executed in testSubDir. One can't be sure that the COPYING
9334 file is in .. or ../.. in all situations, the ../Makefile is
9337 * doc/m4.texinfo (Include): adjusted expected test output
9338 according to new tests, i.e. the input will always come from the
9339 file `in' created by the test.
9341 * tests/Makefile.am: Added three lines at the top to get
9342 esyscmd.1.test working.
9344 * tests/get-them: modified to generate clearer tests who will need
9345 less maintenance when new test examples are created in
9346 `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
9347 need the generic file `defs') shell scripts creating `in', `ok',
9348 `out' and when apropriate `okerr' and `err' in the directory
9349 `testSubDir' when executed. The compare of `ok' and `out'
9350 (and of `okerr' and `err') will be the exit status of the test.
9351 `out' must match `ok' (and `okerr' must match `err') for the test
9354 * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
9355 the tests generated by tests/get-them getting it input normally
9356 from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
9357 (dot) before the numeric part) is reserved for all other (hand
9358 written) tests. The `+' means one or more times.
9360 1998-08-12 Erick Branderhorst <Erick.Branderhorst@asml.nl>
9362 * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
9363 supported short man page to refer to info documentation
9364 * helptoman.pl: added
9365 * configure.in: AC_PATH_PROG(PERL,perl)
9366 * Makefile.am (SUBDIRS): doc after src
9368 * libitized with libit 0.5 from
9369 ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
9371 * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
9372 * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
9373 replacement functions, (libm4_a_LIBADD): @LIBOBJS@
9374 * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
9376 * configure.in (AC_CHECK_FUNC): getopt_long
9378 * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
9380 * TODO: added entry about dependencies
9382 1998-08-10 René Seindal <rene@seindal.dk>
9386 * doc/m4.texinfo (Changesyntax): Added documentation for the macro
9389 * src/builtin.c (m4_changesyntax): Added builtin macro
9390 "changesyntax" to modify the syntax table.
9392 * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
9393 table. All categories are assigned a syntax code and tokens are
9394 read according to this table.
9396 1998-08-09 René Seindal <rene@seindal.dk>
9398 * src/numb.{c,h}: New files, implements multiple precision eval
9399 using GNU gmp. Originally submitted by John Gerard Makecki
9400 (johnm@vlibs.com), later modified. Tested with GNU gmp 2.0.2.
9402 * doc/m4.texinfo (Eval): Added documentation for multiple
9403 precision arithmetic library support.
9405 * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
9406 to accommodate multiple precision eval.
9408 1998-08-07 René Seindal <rene@seindal.dk>
9410 * src/input.c (MATCH, match_input), src/m4.h: changed definition
9411 of comment and quote strings to `unsigned int' to allow eight bit
9412 chars (reported by andrewb@zip.com.au (Andrew Bettison)).
9414 * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
9415 patch from Mike Howard <mike@clove.com>
9417 1998-08-06 René Seindal <rene@seindal.dk>
9419 * gettext.m4: corrected AM_WITH_NLS to handle use of installed
9422 1998-08-03 René Seindal <rene@seindal.dk>
9426 * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
9427 and _ macro. M4 now builds with --disable-nls.
9429 * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
9430 to look for right message catalogs. Call indef'ed by ENABLE_NLS.
9432 * configure.in (ALL_LINGUAS): Added complete list of translations:
9433 de fr it ja nl ru sv.
9435 1998-05-23 Erick Branderhorst <Erick.Branderhorst@asml.nl>
9437 * po/nl.po: Dutch translation by Erick Branderhorst.
9439 * po/fr.po: French translation by Erick Branderhorst, based on the
9440 translations by François Pinard in fr.msg and m4.cod.
9442 1998-05-22 Erick Branderhorst <Erick.Branderhorst@asml.nl>
9446 * src/m4.c: #include <signal.h> not <sys/signal.h>.
9448 * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
9450 * checks/Makefile.am: explicit list tests in CHECKS.
9452 * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
9453 src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
9454 mkinstalldirs, install-sh: Added automake (1.3) support.
9456 * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
9457 obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
9458 Used libitize (0.4) to update.
9460 * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
9461 (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
9464 * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
9465 stack overflow functionality.
9467 1994-12-03 François Pinard <pinard@iro.umontreal.ca>
9471 * Makefile.in (realclean-local): Delete stamp-h.in.
9473 * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
9474 Localize, adapting from how it is done in sharutils.
9476 * fr.tt: New file, for French.
9478 * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
9479 src/freeze.c: Rename PRODUCT to PACKAGE.
9481 1994-11-26 François Pinard <pinard@iro.umontreal.ca>
9483 * configure.in: Check for <libintl.h> and <locale.h>.
9484 * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
9485 src/stackovf.c: Rename _ to __P.
9486 * src/m4.h: Declare _ as a macro returning its argument, or else,
9487 include <libintl.h> and declare _ as gettext.
9488 * src/m4.c: Possibly include <locale.h> and call setlocale.
9489 * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
9490 src/input.c, src/macro.c, src/output.c, src/path.c,
9491 src/stackovf.c, src/symtab.c: Use _ macro over all localizable
9494 1994-11-07 François Pinard <pinard@iro.umontreal.ca>
9496 * doc/Makefile.in (stamp-vti): Use new -r option to date.
9498 * configure.in: Put --with-gmp in place, in prevision for John
9500 * acconfig.h: Document WITH_GMP.
9502 1994-11-05 François Pinard <pinard@iro.umontreal.ca>
9506 * doc/Makefile.in (realclean): Also remove stamp-vti.
9507 Reported by Eric Backus.
9509 1994-11-02 François Pinard <pinard@iro.umontreal.ca>
9511 * src/freeze.c (produce_frozen_state): If the frozen file cannot
9512 be opened, return immediately after producing the error message.
9513 Reported by Andreas Schwab.
9515 * configure.in: Check for const only after having found possible
9516 ANSIfying compiler flags, this is of no use to check it before.
9517 Reported by Alexander Lehmann.
9519 1994-11-01 François Pinard <pinard@iro.umontreal.ca>
9521 * src/macro.c (collect_arguments): Cast obstack arguments to
9522 (voidstar), so avoiding compiler warnings.
9523 Reported by Joseph E. Sacco.
9525 * src/freeze.c (produce_frozen_state): Cast printed lengths to
9526 (int) so they correspond to %d format items.
9527 Reported by Joseph E. Sacco.
9529 * src/m4.c (main): Cast the argument to xfree to (voidstar).
9530 * src/symtab.c (free_symbol): Idem.
9531 Reported by Karl Vogel.
9533 1994-10-31 François Pinard <pinard@iro.umontreal.ca>
9535 * Makefile.in (DISTFILES): Distribute BACKLOG.
9537 * configure.in: Define PRODUCT and VERSION.
9538 * acconfig.h: Document PRODUCT and VERSION.
9539 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
9540 constant string m4 and variable or parameter named version.
9542 1994-10-30 François Pinard <pinard@iro.umontreal.ca>
9544 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
9545 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
9546 defines __STDC__ to 0, for indicating it is *not* ANSI!
9547 Reported by Kaveh R. Ghazi.
9549 * configure.in: Added obsolescent tests for AIX and Minix.
9551 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
9552 which texclean does not exist anymore.
9553 Reported by Eric Backus, Jim Meyering, John David Anglin and
9556 1994-10-29 François Pinard <pinard@iro.umontreal.ca>
9558 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
9559 Reported by John David Anglin.
9561 * src/ansi2knr.c: New version, sent by Peter Deutsch.
9562 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
9563 ANSI2KNR, depending on the fact the compiler is ANSI or not.
9564 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
9565 Remove the sed filter after ansi2knr for debug.c. Use $O instead
9566 of $U, put underline in extensions rather than in basenames. Use
9567 implicit rules, now that regularity makes this possible.
9568 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
9569 of ansi2knr whenever it is needed.
9570 * configure.in: Adjusted for correct STACKOVF substitution.
9571 * src/debug.c (trace_format): When not __STDC__, use (...) as a
9572 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
9573 Reported by David MacKenzie.
9575 * Makefile.in: Remove binprefix. Use transform_name instead.
9576 Reported by David MacKenzie.
9578 * doc/Makefile.in: Create version.texi, use it, clean it.
9579 Reported by Jim Meyering.
9581 1994-10-28 François Pinard <pinard@iro.umontreal.ca>
9583 * Makefile.in (all, install, uninstall): Depend on Makefile.
9585 * Makefile.in: For actions invoking $(MAKE) from within compound
9586 sh statements, exit non-zero if the sub-make fails. Otherwise,
9587 the top-level make may exit successfully when it should fail.
9588 Reported by Jim Kingdon.
9590 * {,/*}Makefile.in: Use && after all cd, in case they fail.
9592 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
9593 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
9594 * configure.in: Substitute PRODUCT and VERSION.
9596 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
9598 1994-10-27 François Pinard <pinard@iro.umontreal.ca>
9600 * Makefile.in (mostlyclean-local): Do not remove *~.
9601 * */Makefile.in (mostlyclean): Idem.
9602 Reported by Robert E. Brown and Richard Stallman.
9604 1994-10-09 François Pinard <pinard@iro.umontreal.ca>
9606 * src/m4.h: Get rid of CONFIG_BROKETS.
9608 1994-10-02 François Pinard <pinard@iro.umontreal.ca>
9610 * configure.in: Use AC_ARG_PROGRAM.
9611 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
9612 Reported by David MacKenzie.
9614 1994-10-01 François Pinard <pinard@iro.umontreal.ca>
9616 * configure.in: Do not add -O to CFLAGS for GNU C, now that
9617 configure does it automatically.
9618 Reported by Jim Meyering.
9620 1994-09-23 François Pinard <pinard@iro.umontreal.ca>
9622 * src/stackovf.c: Declare the handler_t typedef earlier in the
9623 code, use it for stackovf_handler.
9624 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
9625 casting sigsegv_handler.
9626 Reported by Robert Bernstein.
9628 * src/m4.c (main): Initialize program_name to argv[0] without
9630 Reported by Karl Berry.
9632 1994-09-18 François Pinard <pinard@iro.umontreal.ca>
9634 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
9635 Reported by Karl Berry.
9637 1994-09-14 François Pinard <pinard@iro.umontreal.ca>
9639 * lib/Makefile.in (mostlyclean): Added.
9640 (TAGS): Make in $(srcdir).
9642 * configure.in: Use `choke me' in test, like everywhere!
9644 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
9645 unreacheable and useless.
9647 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
9649 * lib/Makefile.in (DISTFILES): Distribute TAGS.
9650 (distclean): Do not remove TAGS.
9651 (realclean): Remove it.
9652 * Makefile.in: Make TAGS in lib also, not just in src.
9653 Reported by Karl Berry.
9655 * Makefile.in (distclean, realclean): Instead of recursively
9656 calling $(MAKE) for the -local part, allow parallel execution of
9657 -recursive and -local, only delay the removal of config.status,
9658 which is repeated in both goals.
9660 1994-09-13 François Pinard <pinard@iro.umontreal.ca>
9664 * Makefile.in: Group all *clean-recursive goals in one, using sed
9665 to remove `-recursive' while calling make recursively. Also, use
9666 a subshell for each recursive $(MAKE).
9667 Reported by Jim Meyering.
9669 * src/m4.h (memcpy): Define with bcopy for BSD systems.
9670 Reported by Kaveh R. Ghazi.
9672 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
9673 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
9676 * configure.in: Use date instead of touch for stamp-h.
9677 * Makefile.in (stamp-h.in): Idem.
9679 * Makefile.in (distclean, realclean): Force serial execution of
9680 both goals, in case parallel makes are being used.
9681 Reported by Jim Meyering.
9683 * src/Makefile.in (DISTFILES): Distribute TAGS.
9684 (distclean): Do not remove TAGS.
9685 (realclean): Remove it.
9686 Reported by Karl Berry.
9688 1994-09-10 François Pinard <pinard@iro.umontreal.ca>
9690 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
9691 to old names, for following Autoconf.
9693 1994-09-08 François Pinard <pinard@iro.umontreal.ca>
9695 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
9696 ./install.sh will not be correctly referred to in sub-Makefiles.
9697 Reported by John David Anglin.
9699 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
9700 Reported by Eric Backus.
9702 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
9703 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
9704 config.status into remaking this directory's Makefile only.
9705 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
9706 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
9707 Reported by Jim Meyering.
9709 1994-09-06 François Pinard <pinard@iro.umontreal.ca>
9711 * configure.in: Correct stack overflow detection logic, taking
9712 care of systems having only incomplete implementations (like for
9713 Pyramid 9820 OSx 5.0d).
9714 Reported by Kaveh R. Ghazi.
9716 * src/Makefile.in (TAGS): Remote -t from etags call.
9718 1994-09-02 François Pinard <pinard@iro.umontreal.ca>
9720 * lib/Makefile.in (install): Depend on all.
9722 1994-08-31 François Pinard <pinard@iro.umontreal.ca>
9724 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
9725 Reported by Jim Meyering and John David Anglin.
9727 * Makefile.in (distclean-local): Delete config.log.
9728 Reported by Jim Meyering.
9730 Solidify frozen files with respect to -P:
9731 * src/m4.c: Have -P set prefix_all_buitins variable instead of
9732 calling a function by that name. Declare the variable.
9733 * src/m4.h: Adjust declaration for prefix_all_buitins.
9734 * src/builtin.c (builtin_init): Merge in functionality from
9735 previous prefix_all_buitins function, while making entries in the
9736 symbol table, but not modifying the builtin description itself.
9738 * src/freeze.c (reload_frozen_state): Add a useless `break;',
9739 because *many* compilers do not accept an empty `default:'.
9740 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
9741 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
9743 * configure.in: Use AC_TYPE_SIGNAL.
9744 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
9745 Reported by Robert Bernstein.
9747 * checks/Makefile.in (check): Modify PATH so check-them will find
9748 m4 in the src directory.
9749 * Makefile.in (check): Don't.
9750 Reported by Akiko Matsushita and Jim Meyering.
9752 * src/output.c (make_room_for, output_character_helper): New
9753 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
9754 a per buffer MAXIMUM_BUFFER_SIZE.
9756 * src/output.c (output_text): New function, for optimizing the
9757 output of strings of characters. Use it.
9759 1994-08-30 François Pinard <pinard@iro.umontreal.ca>
9761 * doc, src: New directories reorganizing the distribution.
9762 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
9764 * Makefile.in: Adjusted.
9765 * configure.in: Configure new Makefiles.
9767 * m4.h: Declare STRING typedef. Use it for comment and quote
9768 strings, adjusting all references. (This is the rudiments of a
9769 beginning for the eventual withdrawal of NUL terminated strings.)
9770 * output.c (shipout_text): Accept a length parameter, and use it.
9771 All callers adjusted.
9773 1994-08-29 François Pinard <pinard@iro.umontreal.ca>
9775 * m4.h: Include <unistd.h> if it exists.
9776 * stackovf.c: Don't.
9778 Clean up for current_diversion variable:
9779 * output.c: Move current_diversion from builtin.c.
9780 * m4.h: Declare current_diversion so builtin.c can access it.
9781 * output.c (output_init, make_diversion): Initialize or update
9783 * builtin.c (builtin_init, m4_divert): Leave current_diversion
9786 Remove limit on number of diversions:
9787 * output.c: Replace ndiversion by diversions, declare it.
9788 (output_init): Allocate only diversion 0.
9789 (make_diversion): Allocate new diversions as needed.
9790 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
9791 * m4.c: Still accept -N, but do nothing with it.
9792 Reported by David MacKenzie.
9795 * output.c (freeze_diversions): New function.
9796 * m4.h: Declare freeze_diversions.
9797 * freeze.c: Document frozen file format, revise it, call
9798 freeze_diversions to add diversions to frozen format, and code to
9799 reload them properly.
9800 * m4.c: Do not undivert automatically at end when status being
9801 frozen. Do not call builtin_init when reloading frozen state.
9803 Speed up diversion processing:
9804 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
9805 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
9806 structure and variables, cached variables out of output_diversion,
9807 reallocate_diversion_for and OUTPUT_CHARACTER.
9808 (shipout_text, make_diversion, insert_diversion): Adapted to new
9810 (insert_file): Use better buffering.
9811 Reported by David MacKenzie.
9813 1994-08-28 François Pinard <pinard@iro.umontreal.ca>
9815 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
9816 dist works from another build directory.
9818 1994-08-27 François Pinard <pinard@iro.umontreal.ca>
9820 * symtab.c (hack_all_symbols): Use hash_table_size instead of
9821 constant HASHMAX, for -H option to work better.
9823 * builtin.c (DECLARE): Simplify by using _ ().
9825 * freeze.c: New file.
9826 * Makefile.in: Compile it, distribute it.
9827 * m4.c: Recognize, document and process --freeze-state (-F) and
9828 --reload-state (-R) options. Pass a true flag to builtin_init
9829 only if no reloading some state.
9830 * builtin.c (define_builtin): Remove static specifier.
9831 (find_builtin_by_name): Remove static specifier.
9832 (builtin_init): Accept and obey a flag argument.
9833 * m4.h: Add declarations for freeze.c, changes for builtin.c.
9835 1994-08-24 François Pinard <pinard@iro.umontreal.ca>
9837 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
9840 * configure.in: Implement --with-dmalloc.
9841 * acconfig.h: Document WITH_DMALLOC.
9842 * m4.h: Add code for when WITH_DMALLOC.
9844 1994-08-15 François Pinard <pinard@iro.umontreal.ca>
9846 * m4.c (long_options): Use "error-output", the dash was missing.
9847 Reported by Akiko Matsushita.
9849 1994-08-12 François Pinard <pinard@iro.umontreal.ca>
9851 * m4.h: Include <sys/types.h>.
9852 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
9853 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
9855 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
9857 * builtin.c (dump_args): Declare len as size_t, not int.
9859 * debug.c: Prototype the forward declaration of debug_set_file.
9861 * builtin.c (m4_undivert): Replace div by file, for avoiding the
9862 shadowing of this variable.
9863 * output.c (insert_diversion): Idem.
9865 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
9866 (input_init): Duplicate default quote and comment strings.
9867 (set_quotes): Free previous quote strings in all cases. Duplicate
9868 even default quote strings.
9869 (set_comment): Free previous comment strings in all cases.
9870 Duplicate even default comment strings.
9872 * configure.in: Updated for Autoconf 2.0.
9873 * Makefile.in (distclean-local): Also delete config.cache.
9875 * m4.c (usage): Reorganize the --help output by topic. Include a
9876 description for debugging flags.
9878 1994-07-29 François Pinard <pinard@iro.umontreal.ca>
9880 * configure.in: If sigaction is available and SA_ONSTACK defined,
9881 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
9882 defined, use sigvec. Else don't compile stackovf.c.
9883 * stackovf.c (setup_stackovf_trap): Idem.
9884 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
9887 1994-07-21 François Pinard <pinard@iro.umontreal.ca>
9889 * m4.c (usage): Replace printf par fputs.
9891 1994-07-18 François Pinard <pinard@iro.umontreal.ca>
9895 1994-07-17 François Pinard <pinard@iro.umontreal.ca>
9897 * configure.in: Check for sigaction and sigvec. Add a new delayed
9898 check for RLIMIT_STACK, combine in the checking for getrlimit.
9899 All those things are not universally available.
9900 * stackovf.c: Split setting up the trap handler and catching
9901 signals, for better taking care of various configure outcomes.
9902 * examples/stackovf.sh: Correct a typo.
9903 Reported by Eric Backus, Jim Avera and Jim Meyering.
9905 1994-07-16 François Pinard <pinard@iro.umontreal.ca>
9907 * ansi2knr.c: New version sent by its author, Peter Deutsch.
9909 1994-07-15 François Pinard <pinard@iro.umontreal.ca>
9911 * Makefile.in: Modify so parallel make will not try making
9912 lib/libm4.a twice simultaneously.
9913 Reported by Jim Meyering.
9915 1994-07-14 François Pinard <pinard@iro.umontreal.ca>
9917 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
9918 error message, for when no code possibility exists. Even if this
9919 line is completely #ifdef'ed out, it brings a syntax error.
9920 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
9922 * Makefile.in (install): Have install depend on all too, for lib
9923 to be remade as needed.
9925 * examples/stackovf.sh: Try ksh, bsh and bash for shells
9926 providing ulimit, instead of using only ksh.
9927 Reported by Jim Avera and Joseph E. Sacco.
9929 1994-07-12 François Pinard <pinard@iro.umontreal.ca>
9931 * Makefile.in (check): Have it depend on all instead of m4. In
9932 this way, a change in lib will be detected and processed.
9934 * builtin.c (numeric_arg): Use strtol and verify the conversion,
9935 instead of using sscanf which stops as soon as there is a
9936 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
9937 and divert(1xyzzy) were all accepted without any warning or error
9939 * m4.h: Declare strtol as long if not including stdlib.h.
9940 * configure.in: Check for limits.h, and replace strtol if missing.
9941 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
9942 * lib/strtol.c: New file, from elsewhere.
9943 Reported by Andreas Schwab.
9945 1994-07-07 François Pinard <pinard@iro.umontreal.ca>
9947 * macro.c (expand_macro): Cast value to (boolean) prior to
9948 assigning it to traced.
9949 Reported by Tom McConnell.
9951 * Makefile.in (m4): Always make all in lib first.
9952 Reported by Jim Meyering.
9954 1994-07-06 Jim Avera <jima@netcom.com>
9956 * stackovf.c: Isolated OS-dependent sections; Improved portability,
9957 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
9958 handlers), and a default error message if the fault address is not
9959 available (when neither siginfo.h nor BSD sigcontext are supported).
9960 * configure.in: Changes for stackovf.h: Check for sigcontext,
9961 sigaction, sigstack, and define rlim_t as int if necessary.
9962 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
9963 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
9964 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
9966 1994-07-05 François Pinard <pinard@iro.umontreal.ca>
9968 * configure.in: Use AC_SET_MAKE.
9969 * Makefile.in: Use @SET_MAKE@.
9970 Reported by Jim Meyering.
9972 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
9973 Reported by Ian Taylor.
9975 1994-07-02 François Pinard <pinard@iro.umontreal.ca>
9977 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
9978 because siginfo.h is unrelated to standard headers, and siginfo.h
9979 is already checked for.
9980 Reported by Joseph E. Sacco.
9982 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
9984 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
9987 1994-06-29 François Pinard <pinard@iro.umontreal.ca>
9989 * builtin.c (substitute): Use \& to represent this part of the
9990 string which was matched by the whole regexp, instead of
9991 representing the whole string. Any usage of \0 issues a warning
9992 and acts like \&, it will disappear in some subsequent release.
9994 1994-06-27 François Pinard <pinard@iro.umontreal.ca>
9996 * m4.c: Complete prototype for forwarded declaration of usage.
9998 * input.c (init_macro_token): Correct own reference in error
9999 message. Previous name get_macro_func was referred to instead.
10000 (next_char): Correct own reference in error message. Previous
10001 name advance_input was referred to instead.
10003 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
10004 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
10005 and_term, not_term, logical_not_term, cmp_term, shift_term,
10006 add_term, mult_term, exp_term, unary_term, simple_term): Add
10007 prototype to forwarded declarations. Declare parameter v1 as
10008 eval_t * instead of int *. Same for local variable v2 in dyadic
10009 functions. Same for result in exp_term.
10010 * builtin.c (m4_eval): Declare value as eval_t instead of int.
10011 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
10012 unsigned_eval_t instead of unsigned int. Change casts accordingly.
10013 (shipout_int): Cast first argument of ntoa to eval_t.
10014 Reported by Thorsten Ohl.
10016 * macro.c: Complete the prototypes of forwarded expand_macro and
10018 Reported by Thorsten Ohl.
10020 * m4.h: Define voidstar as void * or char * depending on __STDC__.
10021 The Ultrix 3.1 compiler cannot do much with void pointers.
10023 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
10024 * m4.c (xfree): Replace void * by voidstar.
10025 Reported by Tom McConnell.
10027 * ansi2knr.1: New, from elsewhere.
10028 * Makefile.in (DISTFILES): Distribute ansi2knr.1
10030 * Makefile.in (stamp-h.in): Avoid running ./config.status if
10031 stamp-h does not exist yet. This avoids running it a second time
10032 just after the initial ./configure.
10033 Reported by David MacKenzie and Tom McConnell.
10035 * m4.h: Replace the enum debug_info declaration with a series of
10036 #define's. The Ultrix 3.1 compiler would otherwise need casting
10037 (int) to most references, when used in expressions.
10038 Reported by Tom McConnell.
10040 1994-06-25 François Pinard <pinard@iro.umontreal.ca>
10042 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
10043 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
10044 calls the compiler. Previously, FP_PROTOTYPES was only calling
10045 the preprocessor; by not being subject to CFLAGS, this was
10046 discouraging those flags asking for ANSI compilation.
10047 * acconfig.h: Document HAVE_PROTOTYPES.
10048 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
10049 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
10050 Reported by Eric Backus.
10052 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
10053 from the environment. Default CFLAGS to -g if not set.
10054 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
10055 * lib/Makefile.in: Have CFLAGS substituted from configure.
10056 Reported by Eric Backus and Tom McConnell.
10058 * configure.in: m4_undefine changeword before using AC_ENABLE.
10060 * m4.h: Declare prototypes for error (for ANSI compilers only),
10061 prefix_all_builtins and reference_error.
10062 Reported by Tom McConnell.
10064 * input.c (set_word_regexp): Do not try to initialize the array
10065 test from a string, this does not work with non-ANSI compilers.
10066 Reported by Eric Backus.
10068 * Makefile.in (dist): Clean examples/ before saving it.
10069 (distclean-local): Also remove stamp-h.
10070 Reported by Eric Backus.
10072 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
10073 non ANSI compilers.
10074 Reported by Tom McConnell.
10076 * checks/Makefile.in (clean): Depends on mostlyclean.
10077 (mostlyclean): New goal.
10079 1994-06-24 François Pinard <pinard@iro.umontreal.ca>
10081 * Makefile.in (DISTFILES): Distribute install.sh.
10082 * install.sh: New file, copied from elsewhere.
10083 Reported by Assar Westerlund and Kaveh R. Ghazi.
10085 1994-06-23 François Pinard <pinard@iro.umontreal.ca>
10087 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
10088 * acconfig.h: Explain ENABLE_CHANGEWORD.
10090 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
10091 from code provided by Pete Chown]
10092 * m4.h: Add original_text field to u_t variant of union u.
10093 Declare TOKEN_DATA_FUNC macro.
10094 * builtin.c: Declare changeword.
10095 (m4_changeword): New function.
10096 * input.c: Include "regex.h", define variables with word regexps.
10097 (input_init): Initialize the word regexp.
10098 (set_word_regexp): New.
10099 (next_token): Declare local variables, use the previous code if
10100 default_word_regexp is true. Else, match using a new code. Save
10102 * macro.c (expand_token): Ship out original text if not a macro
10104 Reported by Krste Asanovic and Pete Chown.
10106 [These modifs all depend upon ENABLE_CHANGEWORD]
10107 * m4.h: Declare external user_word_regexp.
10108 * m4.c: Declare user_word_regexp, and initialize it from
10109 --word-regexp or -W, or NULL if not specified.
10110 * input.c: Use user_word_regexp if specified, instead of
10111 DEFAULT_WORD_REGEXP.
10113 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
10116 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
10117 * checks/Makefile.in: Empty the suffix list.
10118 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
10120 * m4.c: Declare nesting_limit and initialize it to 250.
10121 Implement -LNUMBER or --nesting-limit=NUMBER to change its
10123 * m4.h: Declare nesting_limit as external.
10124 * macro.c (expand_macro): Stop execution whenever nesting limit
10126 Reported by Bengt Mertensson.
10128 * eval.c (evaluate): Diagnose excess characters in eval input.
10129 Things like `eval(08)' used to return 0 with no diagnostic.
10131 * m4.h: Capitalize first letter of all macro arguments in
10134 * m4.c: Declare warning_status, initialize it to 0. Add new
10135 option -E, or --fatal-warnings, which sets warning_status to
10136 EXIT_FAILURE instead.
10137 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
10138 EXIT_FAILURE if not otherwise done by header files.
10139 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
10140 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
10141 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
10142 argument of all M4ERROR calls.
10143 Reported by Noah Friedman.
10145 * examples/incl-test.m4: Renamed from incl_test.m4.
10146 * examples/include.m4: Include incl-test.m4 instead of
10148 * examples/multiquotes.m4: Renamed from multi-quotes.m.
10150 1994-06-22 François Pinard <pinard@iro.umontreal.ca>
10152 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
10153 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
10154 also tested it on a Sun Sparc workstation running SunOS 4.x.
10156 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
10157 49.format check, abusing a `union values' argument with sprintf
10158 without selecting the proper field. Now, save the formatting type
10159 first, delaying the fetch of the corresponding argument.
10160 Reported by Joseph E. Sacco and Tom Quinn.
10162 * format.c (format): Remove const from char *fmt declaration when
10163 not HAVE_EFGCVT, because a NUL may be forced into it.
10165 * m4.h: Declare atof() when not STDC_HEADERS.
10166 Reported by Joseph E. Sacco.
10168 * Regenerate configure using Autoconf 1.11, this corrects a
10169 problem about an incorrect cpp seting on NeXT 3.1.
10170 Reported by Alexander Lehmann.
10172 1994-06-05 François Pinard <pinard@iro.umontreal.ca>
10174 * m4.h (_): Change argument from `x' to `Args'.
10176 1994-04-22 François Pinard <pinard@iro.umontreal.ca>
10178 * m4.h: Rename Args() to _().
10179 * m4.h: Remove extern specifier from all function declarations.
10181 1994-04-22 Jim Avera <jima@netcom.com>
10183 * stackovf.c: New file implementing stack-overflow detection.
10184 * configure.in: Check for getrlimit, sigaction. If all of
10185 standard headers, getrlimit and sigaction, define USE_STACKOVF and
10186 substitute ${U}stackovf.o for STACKOVF.
10187 * acconfig.h: Declare USE_STACKOVF.
10188 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
10189 * m4.h: Declare setup_stackovf_trap().
10190 * m4.c: Call setup_stackovf_trap().
10191 * tests/stackovf_test.sh: New file.
10193 1994-04-13 François Pinard <pinard@iro.umontreal.ca>
10195 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
10197 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
10199 1994-01-30 François Pinard <pinard@iro.umontreal.ca>
10201 * m4.h: Remove definition of volatile, not used anymore.
10202 Reported by Jim Meyering and Joseph E. Sacco.
10204 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
10205 of `if ... else /* nothing */' for if macros.
10206 Reported by Jim Meyering.
10208 * builtin.c (m4_regexp): Reorganize the code for avoiding a
10209 warning from gcc about `repl' possibly used before defined.
10210 Reported by Jim Meyering.
10212 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
10213 Reported by Jim Meyering.
10215 1994-01-25 François Pinard <pinard@iro.umontreal.ca>
10217 * m4.h: Move the conditional definition of volatile after the
10218 inclusion of system files, because they may define it first.
10220 1994-01-04 François Pinard <pinard@iro.umontreal.ca>
10222 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
10223 get around a problem with Alpha make seeing a syntax error, there.
10224 Reported by Vern Paxson.
10226 1994-01-03 François Pinard <pinard@iro.umontreal.ca>
10228 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
10229 Reported by Richard Stallman.
10231 1993-12-25 François Pinard <pinard@iro.umontreal.ca>
10233 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
10234 instead of AC_HAVE_FUNCS.
10235 Reported by Noah Friedman.
10237 1993-12-01 François Pinard <pinard@iro.umontreal.ca>
10239 * m4.c: Initialize show_help and show_version to zero.
10241 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
10242 Use them in exit() and usage() calls.
10244 1993-11-27 François Pinard <pinard@iro.umontreal.ca>
10246 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
10247 syserr() macro. Delete errref, add reference_error and M4ERROR.
10248 * m4.c: Replace errref, which was returning an input reference
10249 string, with reference_error, which prints it on standard error.
10250 * builtin.c, output.c: Use errno as second parameter to error,
10251 instead of using syserr() with %s.
10252 * *.c: Use M4ERROR instead of error: no more errref() with %s.
10253 Doing so, the program name appears after the input reference
10254 instead of before, which eases M-x next-error processing.
10256 1993-11-24 François Pinard <pinard@iro.umontreal.ca>
10258 * checks/get-them: Escape braces with backslashes in patterns,
10259 because HPUX-9.01 awk needs this.
10260 Reported by Jim Meyering.
10262 1993-11-22 François Pinard <pinard@iro.umontreal.ca>
10264 * builtin.c: Declare "FILE *popen ();".
10266 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
10267 macros, replace error_message_prefix() declaration by errref()'s.
10268 Declare xrealloc, for use in errref().
10269 * m4.c: Delete error_message_prefix() function, add errref().
10270 * *.c: Use error() systematically in place of all error macros,
10271 now that error() flushes stdout first. Make needed adjustments.
10273 * m4.h: Remove const in sys_errlist[] declaration, it creates
10274 conflicts on SGI and Alpha.
10275 Reported by Kaveh R. Ghazi.
10277 1993-11-20 François Pinard <pinard@iro.umontreal.ca>
10279 * m4.c: Include <getopt.h> instead of "getopt.h".
10281 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
10282 * acconfig.h: New, for documenting HAVE_EFGCVT.
10283 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
10284 use them wherever appropriate. Also use -I. for compilations.
10285 * lib/Makefile.in: Use -I.. for compilations.
10286 * *.c: Include <config.h> or "config.h".
10288 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
10289 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
10291 1993-11-17 François Pinard <pinard@iro.umontreal.ca>
10293 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
10295 * input.c (input_init): Initialize quote and comment strings
10296 explicitely instead of calling set_quotes and set_comment: by
10297 doing so, we ensure we do not free uninitialized variables.
10299 * checks/check-them: Reverse arguments to both diff, so the
10300 expected is on the left and the obtained on the right.
10302 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
10303 macros. Delete declarations for m4error, warning, fatal and
10304 internal_error, add declaration for error_message_prefix.
10305 * m4.c: Delete m4error, warning, fatal and internal_error
10306 routines, add error_message_prefix routine.
10307 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
10308 warning with WARNING*, fatal with FATAL* and internal_error with
10310 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
10311 this is not needed anymore.
10313 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
10314 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
10315 and debug_message, add declaration for debug_message_prefix.
10316 * debug.c: Remove static specifier for FILE *debug declaration.
10317 Delete debug_print and debug_message routines, add
10318 debug_message_prefix routine.
10319 * builtin.c, debug.c: Replace debug_print routine calls with
10320 DEBUG_PRINT* macro calls.
10321 * input.c, path.c: Replace debug_message routine calls with
10322 DEBUG_MESSAGE* macro calls.
10324 * m4.h: Remove inclusion of <varargs.h>.
10325 * debug.c: Include <stdarg.h> or <varargs.h>.
10326 (trace_format): Use stdarg instead of varargs if __STDC__.
10328 * configure.in: Remove checks for vfprintf and _doprnt. These
10329 implementations use varargs tricks which are not portable enough.
10330 * lib/vfprintf.c: Deleted.
10331 * lib/_doprnt.c: Deleted.
10332 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
10333 Reported by Joel Sherrill.
10335 * path.c (add_include_directory): Use xstrdup.
10337 * builtin.c (find_builtin_by_name): Declare static.
10339 * *.[ch]: Add const to a few "char *" declarations.
10341 * configure.in: Remove commented tests for fileno() and fstat().
10342 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
10344 * debug.c (debug_flush_files): New.
10345 * m4.h: Declares it.
10346 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
10347 Reported by Nicolas Pioch.
10349 1993-11-12 François Pinard <pinard@iro.umontreal.ca>
10351 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
10352 Reported by Joel Sherrill.
10354 * builtin.c (prefix_all_builtins): Instead of the table size, use
10355 the null entry at end for stopping the loop. It was overwritten.
10356 Reported by Andreas Schwab and Jim Meyering.
10358 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
10359 Reported by Kaveh R. Ghazi.
10361 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
10362 Reported by Karl Vogel.
10364 1993-11-09 François Pinard <pinard@iro.umontreal.ca>
10366 * m4.h: Do not define volatile if already defined.
10367 Reported by René Seindal.
10369 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
10371 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
10372 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
10374 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
10376 * m4.h: Define strchr and strrchr in terms of index and rindex,
10377 instead of the other way around.
10378 * builtin.c, m4.c, path.c: Use strchr instead of index.
10380 * input.c (next_char): Remove a "break;" after a "return ...;".
10381 Reported by Tom McConnell.
10383 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
10387 * configure.in: Do not copy check files in the build hierarchy.
10388 * checks/check-them: Identify the m4 version being checked. For
10389 finding m4, look in $PATH instead of in the parent directory.
10390 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
10391 * checks/Makefile.in (.all-stamp): Always create check files in
10392 the source hierarchy, not anymore in the build hierarchy.
10393 (check): cd to the source hierarchy before performing checks.
10394 Do not copy nor clean COPYING anymore, take it from `..'.
10395 Reported by Tom McConnell.
10397 * Makefile.in (Makefile): Use $(SHELL).
10398 (config.status): Use $(SHELL). Use "config.status --recheck"
10399 instead of "configure --no-create", which is obsolete.
10400 Reported by Tom McConnell.
10402 1993-11-05 François Pinard <pinard@iro.umontreal.ca>
10404 * m4.c (usage): Use "%s" instead of "m4" in format string.
10405 Reported by Jim Meyering.
10407 * Makefile.in: Distribute mkinstalldirs.
10408 Reported by Pierre Gaumond.
10409 Reported by Jim Meyering.
10410 Reported by Tom McConnell.
10411 Reported by Andreas Gustafsson.
10413 * checks/check-them: Renamed from checks/check_them.
10414 * checks/get-them: Renamed from checks/get_them.
10415 * checks/.all-stamp: Renamed from checks/.all_stamp.
10416 * checks/Makefile.in: Changed accordingly.
10417 Reported by Jim Meyering.
10419 1993-11-04 François Pinard <pinard@iro.umontreal.ca>
10421 * lib/Makefile.in (dist): Correct permissions on files.
10423 * output.c: Declare tmpfile, some systems don't.
10425 1993-11-03 François Pinard <pinard@iro.umontreal.ca>
10427 * checks/Makefile.in (dist): Correct permissions on files.
10429 * Makefile.in (dist): Ensure recursive linking for subdirectory
10430 `examples', also set read/write permissions on all its files.
10432 * mkinstalldirs: New, from elsewhere.
10433 * Makefile.in: Use it.
10435 * debug.c: Synchronize debug messages and regular output when
10436 the debug file and stdout are redirected to the same file.
10437 * configure.in: Add (commented) checks for fileno and fstat.
10438 Reported by Jim Avera.
10440 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
10441 etc., arguments, then ignore the superfluous one. m4 used to
10442 diagnose missing arguments and return the empty string.
10443 Reported by Nick S. Kanakakorn.
10445 1993-11-02 François Pinard <pinard@iro.umontreal.ca>
10447 * m4.c (main): At end of all input, ensure all undiverted text
10448 goes to the main output stream.
10449 Reported by Andreas Gustafsson.
10451 * m4.c (main): exit (0), instead of return 0.
10453 * m4.c: Implement -P and --prefix-builtins.
10454 * builtin.c: Delete const specifier on builtin_tab.
10455 (prefix_all_builtins): New.
10456 Reported by Noah Friedman.
10457 Reported by Scott Bartram.
10459 * c-boxes.el: New, from elsewhere.
10460 * Makefile.in: Distribute it.
10462 * m4.h: Do not define bcopy if <string.h> defines it.
10463 Reported by Stephen Perkins.
10465 * builtin.c (define_macro): Allow a missing second argument, in
10466 which case it is implied empty. Affects define and pushdef.
10467 Reported by Eric Allman.
10469 1993-11-01 François Pinard <pinard@iro.umontreal.ca>
10471 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
10472 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
10473 * builtin.c: Initialize all the blindness fields in builtin_tab.
10474 (define_builtin): Copy the blindness of a builtin into its symbol.
10475 * macro.c (expand_token): Avoid processing a blind builtin if the
10476 next character is not an opening parenthesis.
10477 Reported by David MacKenzie.
10478 Reported by Noah Friedman.
10480 * configure.in: Ensure an exit status of 0 on completion.
10481 Reported by Vivek P. Singhal.
10483 * eval.c (eval_lex): Admit both lower and upper case letters for
10484 bases greater than 10. Only lower case letters were accepted.
10486 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
10487 Reported by Krste Asanovic.
10489 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
10490 * eval.c (logical_not_term): New name for not_term.
10491 * eval.c (xor_term): New, between or_term and and_term.
10492 * eval.c (not_term): New, between and_term and logical_not_term.
10493 * eval.c (shift_term): New, between cmp_term and add_term.
10494 Reported by Krste Asanovic: ~, ^, <<, >>.
10495 Reported by Ben A. Mesander: ** vs ^.
10497 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
10498 * m4.h: Delete xrealloc.c.
10499 * lib/xmalloc.c: New, from elsewhere.
10500 * lib/xstrdup.c: New, from elsewhere.
10501 * lib/Makefile.in: Distribute and compile them.
10503 * m4.c: Change progname to program_name.
10504 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
10505 * lib/error.c: New, from elsewhere.
10506 * lib/Makefile.in: Distribute and compile error.c.
10507 * configure.in: Check AC_VPRINTF and for strerror.
10508 * m4.c: Delete cmd_error. Use error instead.
10509 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
10511 * m4.h: Delete #define const, let Autoconf takes care of this.
10513 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
10514 Merge parse_args into main. Declare argv to be `char *const *',
10515 then remove superfluous casts.
10517 * m4.c: Rename --no-gnu-extensions to --traditional.
10518 Reported by Ben A. Mesander.
10520 * m4.c (usage): Add a status parameter. Supply one in various
10521 calls. Add --help processing. Remove -V for --version.
10523 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
10525 * lib/Makefile.in: Have an AR=ar declaration.
10526 Reported by Eric Backus.
10527 Reported by Bjorn R. Bjornsson.
10528 Reported by Tom Tromey.
10529 Reported by Kristine Lund.
10530 Reported by Marion Hakanson.
10532 1993-10-30 François Pinard <pinard@iro.umontreal.ca>
10534 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
10535 Reported by Noah Friedman.
10537 1993-10-25 François Pinard <pinard@iro.umontreal.ca>
10539 * Makefile.in: Remove MDEFINES and cleanup.
10541 1993-06-09 François Pinard <pinard@iro.umontreal.ca>
10543 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
10544 Create a gzip file.
10546 1993-02-06 François Pinard <pinard@iro.umontreal.ca>
10548 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
10549 ensure 777 mode for directories, so older tar's will restore file
10552 1993-01-17 François Pinard <pinard@iro.umontreal.ca>
10554 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
10555 so the installer can override automatically configured choices.
10556 Reported by Karl Berry.
10558 1993-01-15 François Pinard <pinard@iro.umontreal.ca>
10560 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
10561 previous version was not working properly on m68k-hp-bsd4.3.
10562 Reported by Roland McGrath.
10564 * lib/_doprnt.c: Stolen from Oleo distribution.
10565 * configure.in: Check for _doprnt.c if vfprintf.c selected.
10566 * lib/Makefile.in: Distribute _doprnt.c.
10567 Do not distribute regex.[ch].old anymore.
10569 1993-01-01 François Pinard <pinard@iro.umontreal.ca>
10571 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
10572 Richard wants it there.
10574 1992-12-27 François Pinard <pinard@iro.umontreal.ca>
10576 * Makefile.in: Add DEFS to MDEFINES.
10577 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
10578 (libm4.a): Remove the library before creating it.
10579 (distclean): Remove tags and TAGS too.
10581 1992-12-23 François Pinard <pinard@iro.umontreal.ca>
10583 * Makefile.in (dvi, m4.dvi): New goals.
10585 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
10586 macro.c, output.c, path.c, symtab.c: Change Copyright from
10587 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
10589 * examples/divert.m4: Deleted, this bug has been corrected.
10591 * Makefile.in (texclean, mostlyclean): New goals.
10593 * Makefile.in (clean): Remove clutter from ansi2knr.
10594 Reported by Pierre Gaumond.
10596 1992-12-20 François Pinard <pinard@iro.umontreal.ca>
10598 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
10599 might well use CFLAGS is s/he needs it.
10601 * Makefile.in: Allow installation of info files from a separate
10603 Reported by Jason Merrill.
10604 Reported by David MacKenzie.
10605 Reported by Skip Montanaro.
10606 Reported by Erez Zadok.
10607 Reported by Assar Westerlund.
10609 1992-12-19 François Pinard <pinard@iro.umontreal.ca>
10612 This is still a beta release for the future GNU m4 version 1.1.
10614 * lib/alloca.c: New, from elsewhere.
10615 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
10617 * m4.h: Do not define index/rindex if already defined. If
10618 FALSE/TRUE are already defined, do not redefine them, but merely
10619 define boolean typedef to int.
10621 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
10622 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
10623 because some C compilers do not like connectives with #ifdef.
10624 * m4.h: Define `volatile' only if __GNUC__, instead of once for
10625 __GNUC__ and once for __STDC__.
10626 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
10628 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
10629 Makefile dependencies. Without it, make keeps destroying and
10630 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
10632 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
10633 to diversion/DIVERSION, this was a spelling error.
10635 * m4.c: Declare version[], remove #include "version.h".
10636 * version.h: Deleted.
10637 * Makefile.in: Remove references to version.h.
10639 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
10640 production, by using a simpler and more robust algorithm. This
10641 solves the problem of synclines sometimes written in the middle of
10642 an output line. Delete sync_line() and output_lines variable.
10643 * m4.h: Remove sync_line prototype and output_lines declaration.
10644 * input.c (next_char), output.c (shipout_text): Remove references
10646 * input.c (push_file, pop_file): Merely put the value -1 in
10647 output_current_line instead of calling sync_line, for delaying a
10648 single `#line NUM FILE' before next output line. Do not test
10649 for sync_output, because this is unnecessary clutter.
10650 * output.c (make_divertion, insert_divertion): Idem.
10651 * input.c: Rename must_advance_line to start_of_input_line, for
10654 * debug.c (trace_header): Select a new debug line format, which
10655 better complies with GNU standards for formatting error messages.
10656 With option `-dfl', M-x next-error might be used on the output.
10657 * m4.c (vmesg): Adjust format of error output to GNU standards.
10658 * m4.texinfo: Adjust examples for `make check' to work.
10660 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
10661 case for enum debug_info constants, which were all lower case.
10663 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
10665 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
10666 collected patches. I tried a few times using newer regex.[ch], it
10667 mysteriously stopped aborting with this one. Insecure feeling...
10668 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
10670 1992-12-18 François Pinard <pinard@iro.umontreal.ca>
10672 * m4.c: Change `--no-warnings' to `--silent'.
10673 Reported by David MacKenzie.
10675 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
10676 leave it off for now. See comment in m4.c for justification.
10677 Reported by David MacKenzie.
10679 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
10680 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
10682 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
10684 * Makefile.in: Ensure recursive cleaning is done before local
10685 cleaning for all clean goals.
10687 * builtin.c (ntoa): Ensure the value is always interpreted as a
10688 signed quantity, whatever the radix is.
10690 1992-11-18 Jim Meyering <meyering@idefix>
10692 * builtin.c, format.c, input.c: Split long lines.
10693 * m4.c: Use typedef macro_definition instead of struct
10695 * symtab.c: Use typedef symbol instead of struct symbol.
10697 1992-11-17 François Pinard <pinard@iro.umontreal.ca>
10699 * *.[ch]: Remove all trailing whitespace, in code and comments.
10701 * configure.in: Find some awk.
10702 * Makefile.in: Add $(AWK) to MDEFINES.
10703 * checks/Makefile.in: Transmit $(AWK) to get_them.
10704 * checks/get_them: Use $AWK instead of gawk. Add a close in the
10705 awk script when switching files, because without this, mawk runs
10706 out of file descriptors.
10708 1992-11-16 François Pinard <pinard@iro.umontreal.ca>
10710 * Makefile.in (realclean): Delete m4.info*.
10711 Reported by Jim Meyering.
10713 * Makefile.in: Adjust and link with checks/Makefile.
10714 * checks/Makefile.in: New.
10715 * configure.in: Output checks/Makefile.
10717 * checks/get_them: Have the dnl header of each test more
10718 recognizable by next-error, also use a better message.
10720 1992-11-16 Jim Meyering <meyering@idefix>
10722 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
10723 And use that only if __GNUC__ since we're using it's GCC-specific
10724 semantics that tell the compiler the associated function doesn't
10727 * builtin.c (substitute): Don't use character as an array index.
10728 (dumpdef_cmp): Make formal arguments `const void *' to avoid
10729 warnings with gcc -W -Wall on systems with qsort prototype.
10730 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
10733 * eval.c (most functions): Add parentheses to assignments used
10734 as truth values go avoid warnings from gcc -Wall.
10736 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
10737 any functions that don't need external scope.
10739 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
10740 (many functions and arrays): Declare `const'.
10742 1992-11-15 François Pinard <pinard@iro.umontreal.ca>
10744 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
10745 removing the declaration from m4.h. Also rename false to FALSE
10748 * lib/Makefile.in (Makefile): New goal.
10750 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
10751 so heavily loaded. It gets more easily overridable, calling make.
10752 Reported by Jim Meyering.
10754 * Makefile.in (dist): Get .fname from the current directory name,
10755 instead of from version.h. I need updating many files manually,
10756 when the version changes, version.h is just one of them.
10758 1992-11-14 François Pinard <pinard@iro.umontreal.ca>
10760 * m4.h: Remove the tag `boolean' on the enum introducing typedef
10761 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
10762 Reported by Tom McConnell.
10764 1992-11-13 François Pinard <pinard@iro.umontreal.ca>
10766 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
10767 39.cleardiv, which were describing missing or spurious newlines.
10768 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
10769 do not depend on machine word size, `/bin/false' implementation,
10770 or `wc' output format. `make check' is more dependable, now.
10772 * checks/check_them: Summarize the failed tests by listing their
10773 name, at end. If none, issue `All checks successful'. Output
10774 `Checking' instead of `Input file:'.
10776 * checks/get_them, checks/check_them: Reindented.
10778 * Makefile.in (dist): chmod a+r before making the tar file.
10780 1992-11-12 François Pinard <pinard@iro.umontreal.ca>
10782 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
10784 * input.c (next_token): Reinitialize token_buttom just after using
10785 it as a watermark with obstack_free. Or else, a future token, big
10786 enough for triggering reallocation of the obstack chunk, could
10787 void the initialized value of token_buttom, later causing panic in
10788 obstack_free. Rename token_buttom to token_bottom everywhere.
10790 * m4.h: Before declaring errno, first include <errno.h> and
10791 ensure that it does not define errno.
10792 Reported by Richard Stallman.
10794 1992-11-11 François Pinard <pinard@iro.umontreal.ca>
10796 * builtin.c: Define and use DECLARE macro for builtins.
10798 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
10799 argument, this is a common idiom for introducing long comments.
10801 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
10802 arguments. The last argument was silently ignored.
10804 * m4.c (cmd_error): Add a missing semicolon before va_end().
10806 1992-11-10 François Pinard <pinard@iro.umontreal.ca>
10808 * Makefile.in: Now handle protoized sources. Define and use U.
10809 Compile and use ansi2knr with old compilers. Update DISTFILES.
10810 Add `aclocal.m4' to `configure' dependencies.
10811 * ansi2knr.c: New, from Ghostscript distribution.
10812 * configure.in: Define U through FP_PROTOTYPES for old compilers.
10813 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
10814 * aclocal.m4: New, provide FP_PROTOTYPES.
10815 * m4.h: Conditionnaly protoized through Args, save for varags.
10816 * builtin.c: Protoized. Then:
10817 Include <sys/types.h> if size_t is not defined, before "regex.h".
10818 (m4_ifelse): Fetch built-in name properly for diagnostic.
10819 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
10820 (m4_regexp): Add const to `msg' declaration.
10821 (m4_patsubst): Add const to `msg' declaration.
10822 * debug.c: Protoized, save for varargs.
10823 * eval.c: Protoized.
10824 * format.c: Protoized.
10825 * input.c: Protoized.
10826 * m4.c: Protoized, save for varargs. Then:
10827 (xfree): Accept void * instead of char *.
10828 (xmalloc): Return void * instead of char *.
10829 (xrealloc): Accept and return void * instead of char *.
10830 * macro.c: Protoized.
10831 * output.c: Protoized.
10832 * path.c: Protoized. Then cast some (char *) over xmalloc's.
10833 * symtab.c: Protoized.
10835 1992-11-06 François Pinard <pinard@iro.umontreal.ca>
10837 * m4.texinfo: Remove directory from diagnostics in 30.include,
10838 51.eval, 56.errprint and 57.m4exit tests.
10840 * m4.h: Remove declarations for int or void system functions, they
10841 cause more conflicting trouble than they make good.
10843 * configure.in: Avoid configuration header file. Add some tests.
10844 * m4.h: Remove #include "config.h".
10845 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
10846 Then, rewritten for better compliance with GNU standards.
10848 1992-11-05 François Pinard <pinard@iro.umontreal.ca>
10850 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
10851 because of a misplaced #endif.
10853 * Many *.[hc] files: Correct intra-line spacing here and there,
10854 according to GNU indent 1.6 advice.
10856 * configure.in: New, using Autoconf 1.2.
10857 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
10858 * Delete old configure.in, configure, etc/configure.in,
10859 etc/configure, lib/configure.in, lib/configure and config/*.
10860 Reported by Jason Merrill.
10862 * symtab.c (hash): Change (char) NULL to '\0'.
10863 Reported by Jason Merrill.
10865 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
10866 etc/nextvers.sh. Release numbers will be edited `by hand'.
10867 * version.h: De-automatize, force value in.
10869 * m4.c: Changes in order to use a newer getopt.h.
10870 Reported by David MacKenzie.
10872 * checks/: New name for examples/.
10873 * checks/get_them: New location for etc/get_examples.
10874 * checks/check_them: New location for etc/check_examples.
10875 * Makefile.in, checks/get_them, checks/check_them: Adjust.
10876 * lib/vfprintf.c: New location for etc/vfprintf.c.
10877 * Delete empty etc/.
10878 * examples/: New name for test/.
10880 1992-03-10 François Pinard <pinard@iro.umontreal.ca>
10882 * Makefile.in (check): Add m4 as dependency.
10884 * m4.c: Accept --no-warnings instead of --no_warnings, and
10885 --no-gnu-extensions instead of --no_gnu_extensions. Make the
10886 usage message more informative.
10887 Reported by David MacKenzie.
10889 1992-03-09 François Pinard <pinard@iro.umontreal.ca>
10891 * etc/check_examples: New name for check_examples.sh.
10892 * etc/get_examples: New name for get_examples.sh.
10893 * Makefile.in, etc/Makefile.in: Use new names.
10895 * Makefile.in: Transmit $(CC) while making in lib.
10897 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
10898 code disposition by hand.
10900 1992-03-08 François Pinard <pinard@iro.umontreal.ca>
10902 * m4.h: Delete definitions for abort() and exit().
10903 Reported by Richard Stallman.
10905 * config/hmake-unicos, config/s-unicos.h: New files.
10906 Reported by Hal Peterson.
10908 * eval.c (exp_term): Have N^0 return 1.
10909 Reported by Michael Fetterman.
10911 * eval.c, input.c, m4.h: Remove last comma in enums.
10912 Reported by Mike Lijewski.
10914 * Transfer of maintenance duties from René to François.
10916 1991-10-24 René Seindal <seindal@diku.dk>
10918 * Release 1.0. Many thanks to those, who provided me with bug
10919 reports and feedback.
10921 * Uses GNU configure, taken from the gdb distribution.
10923 * Uses GNU getopt(), with long option names.
10925 * The -Q/+quiet option is added, which suppresses warnings about
10926 missing or superflous arguments to built-in macros.
10928 * Added default options via the M4OPTS environment variable.
10930 * The built-in format can now be configured to use sprintf as
10931 the formatting engine, for systems without [efg]cvt(3).
10933 * GNU library code is moved to the ./lib subdirectory; other
10934 utility files are now in ./etc.
10936 * Several minor bugs have been fixed.
10938 1991-07-26 René Seindal <seindal@diku.dk>
10940 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
10941 François Pinard and Roland H. Pesch for providing me with reports.
10943 * The builtins incr and decr are now implemented without use of
10946 * The builtin indir is added, to allow for indirect macro calls
10947 (allows use of "illegal" macro names).
10949 * The debugging and tracing facilities has been enhanced
10950 considerably. See the manual for details.
10952 * The -tMACRO option is added, marks MACRO for tracing as soon
10955 * Builtins are traced after renaming iff they were before.
10957 * Named files can now be undiverted.
10959 * The -Nnum option can be used to increase the number of
10960 divertions available.
10962 * Calling changecom without arguments now disables all comment
10965 * The function m4_patsubst() is now consistently declared
10968 * A bug in dnl is fixed.
10970 * A bug in the multi-character quoting code is fixed.
10972 * Several typos in the manual has been corrected. More probably
10975 * The m4.info file is now installed along with the program.
10977 1990-11-15 René Seindal <seindal@diku.dk>
10979 * Updated and enhanced version. Release 0.75, manual 0.07.
10981 * Implemented search path for include files (-I option and
10982 M4PATH envronment variable).
10984 * Implemented builtin "format" for printf-like formatting.
10986 * Implemented builtin "regexp" for searching for regular
10989 * Implemented builtin "patsubst" for substitution with regular
10992 * Implemented builtin "esyscmd", which expands to a shell
10995 * Implemented "__file__" and "__line__" for use in error
10998 * Implemented character ranges in "translit".
11000 * Implemented control over debugging output.
11002 * Implemented multi-character quotes.
11004 * Implemented multi-character comment delimiters.
11006 * Changed predefined macro "gnu" to "__gnu__".
11008 * Changed predefined macro "unix" to "__unix__", when the -G
11009 option is not used. With -G, "unix" is still defined.
11011 * Changed "shift", "$@" and "$*" to not insert spaces afters
11014 * Added program name to error messages.
11016 * Fixed two missing null bytes bugs.
11018 1990-01-22 René Seindal <seindal@diku.dk>
11020 * Initial beta release. Release 0.50, manual 0.05.
11029 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
11030 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
11032 Copying and distribution of this file, with or without
11033 modification, are permitted provided the copyright notice
11034 and this notice are preserved.