1 2006-07-14 Gary V. Vaughan <gary@gnu.org> (tiny change)
3 * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
5 2006-07-14 Eric Blake <ebb9@byu.net>
7 * src/main.c (main): Avoid compiler warning.
8 * modules/gnu.c (renamesyms): Remove unused variable.
10 2006-07-14 Gary V. Vaughan <gary@gnu.org>
12 * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
13 (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
14 new functions for managing regexp syntax options.
15 * m4/m4private.h (m4): Add regexp_syntax field.
16 * m4/resyntax.c: New file implements the above.
17 * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
18 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
19 (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
20 (m4_patsubst_do, m4_renamesyms_do): Removed.
21 (builtin_changeresyntax): New builtin to change regular expression
23 (m4_resyntax_encode_safe): Factor out diagnostics code.
24 * src/freeze.c (produce_resyntax_dump): New function to dump
25 default regexp syntax specifier to frozen file.
26 (reload_frozen_state): Updated to action 'R' directive.
27 * src/main.c (usage): Describe new -r option.
28 (long_options, OPTSTRING): Declare it.
29 (main): Encode and store cli regexp syntax option argument.
30 * tests/freeze.at (regexp syntax): New test that regexp syntax
32 * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
33 * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
34 (Epatsubst and Patsubst): Renamed to...
35 (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
36 documentation and added new examples.
37 (Changeresyntax): New section describing changeresyntax builtin,
38 and regexp syntax names.
39 (Regular expression syntax): New section describing differences
40 between various regular expression syntaxes.
41 (Frozen files): Document 'R' directive.
44 2006-07-13 Gary V. Vaughan <gary@gnu.org>
46 * bootstrap: Enhanced to work more like our other scripts:
47 Add a copyright statement; support --version and --help; accept a
48 --download-po option with argument as a substitute for DOWNLOAD_PO
51 2006-07-11 Eric Blake <ebb9@byu.net>
53 * Makefile.am (doc/m4.1): Port patch from branch that avoids
55 * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
58 2006-07-10 Gary V. Vaughan <gary@gnu.org> (tiny change)
60 * tests/builtin.at (patsubst, regexp): Adjust these tests, now
61 that `\0' is no longer accepted.
63 * src/main.c (usage): Alphabetize options within their sections.
65 * modules/gnu.c (m4_regexp_search, regsub, substitute)
66 (esyscmd): Improve comments.
68 * modules/gnu.c (substitute): Remove old warning for \0.
69 (substitute_warned): No longer required. Removed.
71 * modules/gnu.c: Put macro definitions into alphabetical order.
73 2006-07-07 Eric Blake <ebb9@byu.net>
75 * tests/freeze.at (loading format 1): New file, with new test.
76 * tests/testsuite.at: Include it.
77 * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
78 * tests/modules.at (Freezing modules): Likewise.
80 * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
81 (AC_CHECK_HEADERS): Assume signal.h.
82 (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
83 (AC_CHECK_FUNCS_ONCE): Likewise.
84 * src/m4.h (includes): Assume signal.h.
86 2006-07-05 Eric Blake <ebb9@byu.net>
88 Fix all testsuite failures on cygwin.
89 * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
90 branch-1_4. Solves testsuite failure when uninstalled m4 is
91 shadowed by redefinition of PATH in libtool wrapper.
92 * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
93 contains the -no-undefined required by cygwin.
94 (TESTS_ENVIRONMENT): Export abs_top_builddir.
95 * tests/others.at (misc): Port to platforms where /etc/passwd
96 does not exist or does not contain user named root.
97 * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
99 * tests/builtins.at (define, divert): Avoid overquoting.
100 * tests/generate.awk (new_group): Likewise.
102 2006-07-05 Gary V. Vaughan <gary@gnu.org>
104 The regs_allocated field in a struct re_pattern_buffer refers
105 to the state of a particular re_registers struct when used in
106 successive matches using the same compiled pattern. Avoid a
107 SEGV in `renamesyms' resulting from using a new re_registers
108 with an existing re_pattern_buffer:
110 * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
111 pattern buffer and registers.
112 (m4_regexp_search): New function to call re_regexp_search with
113 correctly matched pattern buffer and register instantiations.
114 (m4_regexp_compile): Return an m4_pattern_buffer. Adust all
117 2006-07-04 Gary V. Vaughan <gary@gnu.org>
119 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
120 changes to gnulib getopt.m4 since last build.
121 * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
122 if the system getopt fails M4_GETOPT tests.
124 2006-06-22 Eric Blake <ebb9@byu.net>
126 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
127 Reported by Bruno Haible.
129 2006-06-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
131 * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
133 2006-06-19 Eric Blake <ebb9@byu.net>
137 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
139 * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
140 (clean-local): Split into and depend upon...
141 (clean-local-tests, clean-local-src): ...these two. The latter
142 removes the libtool object directory below `src', to work around
143 a buglet in Automake, failing to list it.
144 (EXTRA_DIST): Distribute modules/perl.c.
146 2006-06-19 Eric Blake <ebb9@byu.net>
148 * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
149 right side of dependency; VPATH does that.
150 (stamp-vcl): Update to use libtool's algorithm.
151 (EXTRA_DIST): Distribute stamp-vcl.
152 Reported by Ralf Wildenhues.
153 (TESTSUITE): Revert earlier change that used absolute path, as
154 that broke 'make dist' in VPATH. Stick with $(srcdir) instead.
155 (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
156 (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
157 atlocal takes care of it instead.
158 (check-local, installcheck-local, clean-local): Inline absolute
159 path to testsuite here, rather than relative path to testsuite
162 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
164 * m4/m4private.h (DELETE): Cast away const here...
165 * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
166 * src/freeze.c (reload_frozen_state): Avoid uninitialized
169 2006-06-19 Eric Blake <ebb9@byu.net>
171 * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
172 .info pages are built.
173 Reported by Ralf Wildenhues.
174 (EXTRA_DIST): Inline definition of testsuite, so that make dist
177 2006-06-16 Eric Blake <ebb9@byu.net>
179 Follow recommendations from autoconf manual for autotest.
180 * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
181 turn it into an absolute path until autotest provides an option
182 that allows us to avoid changing directories. Properly quote
184 (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
185 (check-recursive): Delete unused target.
186 ($(TESTSUITE)): Atomically update testsuite.
187 (CD_TESTDIR): Simplify.
188 (m4__cd): Delete unused macro.
189 (check-local): Let TESTSUITEFLAGS influence the run.
190 (installcheck-local): Let TESTSUITEFLAGS override
191 AUTOTEST_PATH. Add dependencies.
192 (clean-local): Clean up.
193 (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
194 * README: Document how to use the testsuite.
196 2006-06-15 Eric Blake <ebb9@byu.net>
198 * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
200 * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
201 clashes with m4sugar.
202 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
203 * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
204 * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
205 * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
206 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
207 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
208 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
209 * configure.ac: Likewise.
210 (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
211 * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
213 * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
215 Reduce compiler warnings. Inside GMP, mpq_t is an array type, so
216 const mpq_t is not assignable from plain mpq_t. Avoid
217 type-punning warnings caused trying to mix these types.
218 * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
219 (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
220 * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
221 (mult_term, exp_term): Remove type-punning casts.
222 (numb_pow): Remove const qualifier.
223 * src/freeze.c (reload_frozen_state): Fix typo in messages.
224 Fix variables that can be used uninitialized, which fixes
225 security hole where malicious frozen file can execute arbitrary
228 2006-06-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
230 * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
232 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
233 Eric Blake <ebb9@byu.net>
235 Allow `make dist' to work again.
236 * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
237 (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
238 (cvs-dist): Fix typo.
239 * NEWS: Match current version number.
241 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
243 * Makefile.am (AM_CPPFLAGS): Add $(LTDLINCL), so the right
246 * bootstrap: Do not run libtoolize manually, this is done
247 correctly by autoreconf. Invoke autoreconf with --no-recursive
248 to avoid unnecessary rerunning of autotools for libltdl.
250 2006-06-13 Eric Blake <ebb9@byu.net>
254 2006-06-12 Eric Blake <ebb9@byu.net>
256 * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
258 * src/m4.h: Don't declare mktemp.
259 * m4/input.c (m4__next_token): Avoid bzero.
260 * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
261 * Makefile.am (doc/m4.1): Depend on installed help2man, rather
262 than distributing outdated helptoman.pl.
263 * doc/helptoman.pl: Delete.
265 2006-06-10 Eric Blake <ebb9@byu.net>
267 * README (Patches): Document the current dependence on CVS
269 * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
270 * configure.ac: Use consistent quoting throughout.
271 (AC_PREREQ): Bump to 2.59d.
272 (AC_INIT): Package name begins with uppercase.
273 (AC_ARG_WITH): Use AS_HELP_STRING.
274 (AM_INIT_AUTOMAKE): Enable gnits mode.
275 (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
276 (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
277 (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
278 done by gnulib or automake, or which autoconf has declared
280 * m4/m4private.h (Includes): Assume C89 or better, and use errno
282 * m4/output.c (Includes): Likewise.
283 * modules/gnu.c (Includes): Likewise.
284 * modules/m4.c (Includes): Likewise.
285 * src/m4.h (Includes): Likewise.
287 * README-alpha: Update web address.
288 * README: Likewise. Change encoding to ASCII. Remove old advice
289 about cygwin. Document bootstrapping dependency.
290 * AUTHORS: Update from branch-1_4.
291 * THANKS: Likewise. Change encoding to UTF-8.
292 * BACKLOG: Delete. This file is too old and unmaintained to be
294 * ChangeLog: Change encoding to UTF-8.
296 Avoid compiler warnings.
297 * m4/macro.c (trace_format): Don't mark this as a printf format,
298 since we don't accept the same set of modifiers as printf. It
299 would be nice if gcc let us specify a custom format archetype.
300 * src/main.c (main): Cast away const.
302 2006-06-10 Andreas Schwab <schwab@suse.de> (tiny change)
303 Eric Blake <ebb9@byu.net>
305 * modules/time.c (ctime): Pass correctly typed variable to
308 (localtime): Likewise.
309 (strftime): Likewise.
310 * m4/utility.c (m4_numeric_arg): For now, document arbitrary
311 limit inherent in this interface.
313 2006-05-08 Bruno Haible <bruno@clisp.org> (tiny change)
315 * modules/m4.c (WEXITSTATUS): Provide fallback definition.
316 (sysval): Use WEXITSTATUS.
317 * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
318 big-endian and little-endian wait status definitions.
320 2006-05-06 Eric Blake <ebb9@byu.net>
322 * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
324 (support for -pipe): Move after LT_INIT, since it relies on
327 2006-05-05 Eric Blake <ebb9@byu.net>
329 * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
333 2006-05-05 Bruno Haible <bruno@clisp.org>
334 Eric Blake <ebb9@byu.net>
336 * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
337 * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
339 * bootstrap: Update usage of gnulib-tool.
341 2006-05-04 Eric Blake <ebb9@byu.net>
343 * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
346 2005-12-05 Gary V. Vaughan <gary@gnu.org>
348 * bootstrap (func_update_po): Synch with CVS GNU tar. wget 1.9.x
349 and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
350 Reported by Eric Blake <ebb9@byu.net>
352 2005-12-04 Gary V. Vaughan <gary@gnu.org>
354 * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
355 http caching as -C is no longer supported by wget 1.10.x.
356 Reported by Eric Blake <ebb9@byu.net>
358 2005-10-20 Gary V. Vaughan <gary@gnu.org>
360 * m4/module.c (caller_id): To match libtool-2.0 interface, changed
362 (iface_id): ...an lt_dlinterface_id type.
363 (m4__module_find): New abstraction for lt_dlhandle_fetch. Use
364 throughout, instead of calling obsolete lt_dlhandle_find directly.
365 (m4__module_next): Use multiloader-safe lt_dlhandle_iterate. Use
366 throughout, instead of calling obsolete lt_dlhandle_next.
367 * m4/m4private.h (m4__module_find): Declare it.
368 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
369 Use m4__module_next instead of obsolete lt_dlhandle_next.
371 2005-10-20 Gary V. Vaughan <gary@gnu.org>
373 * bootstrap (func_update_po): Update pofiles directly from the
375 * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
376 po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
377 these files under source control anymore.
378 Suggested by Eric Blake <ebb9@byu.net>
380 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
382 * ltdl/m4/m4-gnulib.m4: Update FSF contact address. Somehow this
383 file escaped the address updates on 2005-05-01.
385 2005-07-07 Gary V. Vaughan <gary@gnu.org>
387 * bootstrap: Allow user overriding of gnulib-tool location, and
388 correctly determine module source directories whether gnulib-tool
389 is given as a relative or absolute path, or is found by searching
391 Reported by Eric Blake <ebb9@byu.net>
393 2005-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
395 * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
396 and $RM are defined for various versions of
397 AC_LIBTOOL_COMPILER_OPTION.
399 * bootstrap (AUTORECONF): New variable to allow user overriding of
402 2005-07-07 Gary V. Vaughan <gary@gnu.org>
404 * doc/m4.texinfo (History): Add better notes on the ancestory of
405 GNU m4, and other historical interest.
407 2005-05-08 Gary V. Vaughan <gary@gnu.org>
409 * m4/symtab.c (m4_symbol_rename): New function that performs a low
411 * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
412 * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
413 (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
415 (erenamesyms, renamesyms): ...builtins that use these to implement
416 macro renaming by regular expression.
417 * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
418 * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
419 to stop the new generated tests from choking.
421 2005-05-07 Gary V. Vaughan <gary@gnu.org>
423 Since most of the build is handled from a single Makefile.am now,
424 we can teach make about the dependencies between the m4 binary and
425 the preopened modules it is built against:
427 * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
429 * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
430 of the preopened modules have changed.
432 2005-05-07 Gary V. Vaughan <gary@gnu.org>
434 * configure.ac (gl_MODULES): Add mkstemp for machines that don't
435 have a native implementation.
437 2005-05-06 Gary V. Vaughan <gary@gnu.org>
439 * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed. These are
440 handled already by gnu/exit.h.
442 * configure.ac (gl_MODULES): Add assert to support a
443 --disable-assert configure time option for NDEBUG setting.
445 * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
446 * bootstrap (src_modules): Add version-etc-fsf.
447 * src/main.c (version_etc_copyright): Removed.
449 * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
451 2005-05-04 Gary V. Vaughan <gary@gnu.org>
453 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
455 * src/freeze.c (produce_frozen_state): Use \n line-endings even
456 on Windows, so that the frozen file reader will work.
457 Reported by Josef T. Burger <bolo@bolo.com>
459 2005-05-04 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
461 Forward port of a patch that allowed m4-1.4.2 to compile on
464 * configure.ac (AC_CHECK_HEADERS): Add signal.h,
466 * src/m4.h: And include them as appropriate.
467 * src/main.c, src/stackovf.h: Don't include signal.h literally;
468 m4.h will include the correct file.
470 2005-05-04 Gary V. Vaughan <gary@gnu.org>
472 * m4/m4private.h: Make errno visible for the sources patched
475 2005-05-04 Paul Eggert <eggert@twinsun.com>
477 * src/main.c (print_program_name_CB): Preserve errno, since
478 M4ERROR relies on this.
479 * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
480 * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
481 * m4/path.c (m4_path_search): Don't let "free" trash errno when
484 * m4/output.c (m4_insert_file): Don't assume errno has a valid
485 value simply because fread returns zero. This fixes a
486 portability bug reported by Marion Hakanson in
487 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
489 2005-05-04 Santiago Vila <sanvila@debian.org>
491 * tests/stackovf.test: Use tempfile if available.
493 2005-05-04 Robert Bihlmeyer <robbe@orcus.priv.at> (tiny change)
495 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
496 * m4/output.c (m4_insert_file): Do not mix buffered and
497 unbuffered I/O, as this breaks on the Hurd.
499 2005-05-04 Gary V. Vaughan <gary@gnu.org>
501 Gnulib has changed again. Reimport. Adjust. Rinse. Repeat.
502 Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
503 and libtoolize does a better job of ltdl importing now too, so
504 take advantage of that while updating the tree:
506 * acm4, config: Moved from here...
507 * ltdl/m4, ltdl/config: ...to here.
508 * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
509 src/Makefile.am, tests/Makefile.am: Removed...
510 * Makefile.am: ...and migrated to here, with adjustments to
511 compensate for relative path differences.
512 * commit: Adjust relative paths.
513 * configure.ac: Adjust relative paths.
514 (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
516 (LT_PREREQ): 2.0 isn't released yet, but will work when it is! In
517 the meanwhile, CVS HEAD libtool is needed.
518 (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
519 stricly new enough, we also need a patch.
520 (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
521 (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
522 (gl_MODULES): Don't list getopt and version-etc, as they don't
524 * bootstrap: After running gnulib-tool to import the listed
525 modules, fetch getopt and version-etc into src manually.
526 (ltdldir): Change to ltdl.
527 * src/main.c: Adjust for changes in version-etc API.
528 * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
529 but works when the getopt module isn't to be included in the lib.
530 * README: Add note about patching autoconf and automake to
533 2005-05-02 Matt Kraai <kraai@debian.org> (tiny change)
535 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
536 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
537 empty file rather than to a nonexistent file. This closes a
538 common security hole.
539 * modules/m4.c (m4_maketemp): Implement the above, by using
540 mkstemp rather than mktemp.
542 2005-05-01 Gary V. Vaughan <gary@gnu.org>
544 The FSF are moving offices today. Changed their contact address
545 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
546 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
548 2005-03-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
550 * tests/Makefile (clean-local): Ignore testsuite cleanup
553 2005-03-11 Per Bothner <per@bothner.com> (tiny change)
555 * tests/Makefile (clean-local): Only run the testsuite cleanup
556 if the testsuite has been generated.
558 2005-02-11 Stepan Kasal <kasal@ucw.cz>
560 * TODO: slight clarification of the example of qindir usage.
562 2005-02-08 Gary V. Vaughan <gary@gnu.org>
564 * TODO: Add qindir requirement, and defn bug.
565 From Stepan Kasal <kasal@ucw.cz>
567 2005-02-08 Stepan Kasal <kasal@ucw.cz>
569 * TODO: Add ``execution stack'', fix a typo.
570 * doc/m4.texinfo: Typos.
572 2004-12-24 Eric Blake <ebb9@byu.net>
574 * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
575 to the gnu subdirectory.
576 * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
577 * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
578 * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
579 * m4/system_.h: Likewise, in non-configured includes.
581 2004-10-14 Noah Misch <noah@cs.caltech.edu>,
582 Gary V. Vaughan <gary@gnu.org>
584 * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
585 Protect definitions from macro expansion under -DNDEBUG by
586 parenthesising the expanded function names.
587 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
588 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
589 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
590 (m4_is_syntax_macro_escaped): Similarly protect function
591 definitions from macro expansion under -DNDEBUG by #undefing the
592 matching macro names before each definition. Also, move all the
593 function definitions to the end of the file so that any
594 invocations in the rest of the file pick up the fast macro
596 * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
597 (m4_set_debug_file, m4_set_trace_messages)
598 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
599 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
600 (m4_set_max_debug_arg_length_opt): New fast macro versions of the
601 option setter functions.
603 2004-09-23 Gary V. Vaughan <gary@gnu.org>
605 * src/main.c: Include gnulib files from the correct directory.
607 * gnulib/*: Don't store any of the gnulib files in arch, as they
608 generate spurious changes.
609 * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
610 gnulib macros now share our macro directory.
611 (SUBDIRS): Descend into `gnu' rather than `gnulib'.
612 * bootstrap: Call gnulib-tool to import from the gnulib tree.
613 (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
614 gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
615 the gettext macros from autopoint that overwrite the gnulib-tool
616 imported versions. Import sources and Makefile.am into the `gnu'
617 directory. Changed all callers.
618 * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
619 gl_INIT): Call these gnulib-tool macros instead of the hardcoded
620 for imported modules.
621 * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
622 acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
623 hardcoding the gnulib macros they wrap.
625 2004-07-15 Gary V. Vaughan <gary@gnu.org>
627 Latest CVS libtool can preload modules in libraries, including
628 its own module loaders! Tweak m4 so that it doesn't try to treat
629 libltdl's module loaders as m4 modules when freezing and on exit:
631 * gnulib/acm4/*.m4: Don't store these files in arch since they
632 generate spurious changes.
633 * bootstrap: Simplify initial libtoolize call, since CVS
634 libtoolize is smarter these days.
635 * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
637 * m4/module.h (m4__module_exit): Missing declaration.
638 * m4/m4private.h (m4__module_next): New function declaration.
639 * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
640 encapsulation. Changed all callers.
641 (m4__module_interface): New function to verify m4 loadable module
643 (m4__module_init): Register the interface validator.
644 (m4__module_exit): Only close my own modules.
645 * modules/m4.c (unistd.h): Provide missing declaration.
646 (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
647 (m4_expand_ranges): More missing declarations.
648 * modules/modtest.c (export_test): Ditto.
649 * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
650 * src/main.c (main): Bump copyright year.
651 * tests/modules.at: Fix sed syntax error.
654 2004-06-17 Gary V. Vaughan <gary@gnu.org>
656 Tweaking to enable compilation with latest CVS libtool and
657 libltdl. We can't just dump the library files directly into the
658 m4 directory anymore now that libltdl is built from pieces itself:
660 * bootstrap: Rewritten to use latest libtoolize sanely, and to
661 set up libltdl subdirectory.
662 * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
663 gnulib subdirectory's config.
664 (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
665 (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
667 (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
668 configure.ac, so use AC_WITH_LTDL instead.
669 * Makefile.am (SUBDIRS): Add libltdl.
670 * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated. gnulib now uses
672 * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
673 (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
674 (libm4_la_LIBADD): Add LIBLTDL.
675 * m4/ltdl.c, m4/ltdl.h: Removed.
676 * m4/m4module.h: Include canonical ltdl.h.
679 2004-06-14 Gary V. Vaughan <gary@gnu.org>
681 * gnulib/import: Now updates makefile fragments, and configure.ac.
682 * gnulib/m4/gnulib.am: New file. Generated makefile fragments.
683 * gnulib/m4/Makefile.am: include it.
684 * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
685 gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
686 gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
687 gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
688 gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
689 * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
690 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
691 gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
692 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
693 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
694 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
695 gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
696 gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
698 * gnulib/m4/getopt_int.h: New source file from latest gnulib
700 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
701 gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
702 gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
703 gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
704 Updated source files from latest gnulib.
706 2004-02-29 Gary V. Vaughan <gary@gnu.org>
708 * config/mailnotify: New file for mailing commit notifications,
709 imported from cvs-utils.
710 * commit: Updated from cvs-utils and tweaked for m4.
712 2003-12-01 Gary V. Vaughan <gary@gnu.org>
714 * config/mkstamp: Updated from CVS libtool.
715 * configure.ac: Generate a gnu coding standards compliant version
716 number, and use it for the banner.
717 * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
718 mhen the TIMESTAMP changes in ChangeLog, but the file modification
719 time doesn't (e.g. in cvs commit). Otherwise dist tarballs will
720 contain the previous version number.
721 * src/main.c: Make --version output conform to the GNU standard.
723 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
724 * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
725 m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
726 shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
727 time_la_SOURCES): ...so that these are defaulted correctly, and
728 can be removed from this file.
729 (AM_LDFLAGS): Add -module...
730 (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
731 traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
732 import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
733 the individual settings can be removed.
734 * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
735 * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
736 m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
737 shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
738 time_la_LIBADD): ...so that these are picked up as a deplib of
739 libm4 and don't need to be set explicitly.
741 2003-11-18 Gary V. Vaughan <gary@gnu.org>
743 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
744 from the standard build. It is too fragile.
746 * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
747 CVS libtool after merging m4 changes across to libtool.
749 * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
750 * m4/path.c (search_path_add): Ditto.
752 2003-11-13 Gary V. Vaughan <gary@gnu.org>
754 * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
755 libtool tags we don't use in configure. This reduces the size
756 of the script from over 1Mb to under 700Kb.
758 2003-11-13 Gary V. Vaughan <gary@gnu.org>
760 The import script was not written properly, and the last gnulib
761 import was incomplete. Fixed that problem, and reimport our
762 gnulib dependencies, which picks up the address calculation
763 overflow checks described by Paul below. Also tweak the clients
764 of the gnulib xalloc module not to use deprecated macros:
766 * gnulib/import: Recurse through module dependencies rather than
767 naively descending only one level.
768 * configure.ac: Add calls to gnulib's strnlen and extension module
770 * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
772 * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
773 gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
774 gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
775 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
777 * gnulib/acm4/libtool.m4: Updated from CVS libtool.
778 * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
779 place of `xcalloc (1, S)'.
780 * m4/m4.c (m4_create): Likewise.
781 * m4/m4private.h (m4_symbol_value_create): Likewise.
782 * m4/symtab.c (symtab_fetch): Likewise.
783 * m4/syntax.c (m4_syntax_create): Likewise.
784 * src/freeze.c (reload_frozen_state): Likewise.
785 * m4/path.c (search_path_add): Eliminate use of deprecated NEW
787 * m4/symtab.c (m4_symtab_create): Likewise.
789 2003-11-13 Gary V. Vaughan <gary@gnu.org>
791 * tests/module.at: Comment typo.
793 2003-10-10 Gary V. Vaughan <gary@gnu.org>
795 * tests/modules.at (modules: importing): Apply some lateral
796 thinking, and use AT_CHECK to compare the output of a sed pass
797 over stderr against the canonical strerror string.
799 * tests/modules.at (modules: importing): Edit the generated stderr
800 output to canonicalize strerror output, before a comparison.
802 2003-10-10 Gary V. Vaughan <gary@gnu.org>
804 Tru64UNIX perl is sloppy with namespace pollution. This patch is
805 careful not to trip over the mess:
807 * modules/perl.c: Some builds of perl install headers that contain
808 `#define try __builtin_try'. Be sure to undefine that macro
809 before `m4/hash.h' gets included, which uses the `try' symbol.
810 * m4/system_.h: Similarly for `bool'. Undefine `bool', `true' and
811 `false' before including `stdbool.h'.
812 (DELETE): This symbol is not in m4's namespace, and is in any
813 case only used internally...
814 * m4/m4private.h (DELETE): ...so move it to here.
815 Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
817 2003-10-08 Paul Eggert <eggert@twinsun.com>
819 Don't use XMALLOC and XCALLOC. Once we install the
820 corresponding patch into gnulib, this will fix some
821 address-calculation overflow bugs on hosts where calloc (A, B)
822 returns garbage when A*B overflows.
824 * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
825 maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
826 xmalloc, XCALLOC with xcalloc.
827 * m4/m4.c (m4_create): Likewise.
828 * m4/m4private.h (m4_symbol_value_create): Likewise.
829 * m4/output.c (m4_output_init): Likewise.
830 * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
831 * m4/syntax.c (remove_syntax_attribute): Likewise.
832 * src/freeze.c (reload_frozen_state): Likewise.
833 * src/main.c (main): Likewise.
835 2003-10-07 Gary V. Vaughan <gary@gnu.org>
837 * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
838 gnulib/acm4 directories for aclocal m4 macros.
839 * gnulib/Makefile.am (EXTRA_DIST): Removed.
840 (MAINTAINERCLEANFILES): Add Makefile.in.
841 * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
843 * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
844 * gnulib/import: New file. Temporary script for updating gnulib
845 imported files, until gnulib-tool is working.
846 * gnulib/config/codeset.m4, gnulib/config/error.m4,
847 gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
848 gnulib/config/getopt.m4, gnulib/config/gettext.m4,
849 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
850 gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
851 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
852 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
853 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
854 gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
855 gnulib/config/nls.m4, gnulib/config/obstack.m4,
856 gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
857 gnulib/config/progtest.m4, gnulib/config/realloc.m4,
858 gnulib/config/regex.m4, gnulib/config/restrict.m4.
859 gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
860 gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
861 gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
862 gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
863 gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
864 gnulib/config/xstrndup.m4: Removed.
865 * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
866 gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
867 gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
868 gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
869 gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
870 gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
871 gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
872 gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
873 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
874 gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
875 gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
876 gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
877 gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
878 gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
879 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
880 gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
881 gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
882 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
883 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
884 gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
885 gnulib/import script.
886 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
887 gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
888 gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
889 gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
890 gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
891 gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
892 gnulib with gnulib/import script.
893 * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
894 guards ready for gnulib-tool to autoupdate on import.
895 * config/debug.m4, config/gmp.m4, config/m4-error.m4,
896 config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
897 config/stackovf.m4: Moved from here...
898 * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
899 acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
900 acm4/stackovf.m4: ...to here, to separate aclocal macros from
901 configure time helper scripts.
902 * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
903 * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
904 m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
905 src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
907 * src/main.c (version_etc_copyright): Only output the current
909 (version_etc): Call with new variadic API.
911 2003-09-16 Gary V. Vaughan <gary@gnu.org>
913 * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
914 version-etc module from CVS gnulib.
915 * po/POTFILES.in: Add gnulib/m4/version-etc.c.
916 * src/Makefile.am: Build it.
917 * src/main.c: Use it.
919 * gnulib/m4/exit.h: Import exit module from CVS gnulib.
920 * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
921 * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
924 2003-09-15 Charles Wilson <cygwin@cwilson.fastmail.fm>,
925 Gary V. Vaughan <gary@gnu.org>
927 * bootstrap: Separate options.
928 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
929 * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
931 * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
932 (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
933 (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
934 (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
935 $(LTLIBINTL) for gettext support on cygwin.
936 * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
937 have $(LTLIBINTL) from the preloaded module la files.
938 * README: Remove the warning about using --disable-nls on Windows
941 2003-09-15 Gary V. Vaughan <gary@gnu.org>
943 * gnulib/m4/regex.c: s/<regex.h>/"regex.h"/ or else the compiler
944 picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
947 2003-09-12 Gary V. Vaughan <gary@gnu.org>
949 * doc/STYLE: Document the gnulib header naming conventions, and
951 * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
952 gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
953 gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
955 * gnulib/m4/Makefile.am: Remove the rules to build these headers.
957 * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
958 module from CVS gnulib.
959 * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
960 (gl_FUNC_STRTOL): In favour of the module macro.
962 2003-09-12 Gary V. Vaughan <gary@gnu.org>
964 Replace the getopt code with CVS gnulib getopt. The source files
965 detect whether they are in a glibc environment and preprocess away
966 all of the code if there is a system getopt, so we can compile
967 them into the m4 executable unconditionally:
969 * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
970 gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
971 * configure.ac (gl_GETOPT): Use this instead of homebrew inline
973 * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
975 * src/Makefile.am: Adjust.
976 * src/main.c: Always include our shipped getopt.h.
977 * po/POTFILES.in: Use new location of getopt.c.
979 2003-09-12 Gary V. Vaughan <gary@gnu.org>
981 * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
982 * config/Makefile.am: Removed. Automake 1.8 distributes the files
983 in this directory automatically.
984 * Makefile.am (EXTRA_DIST): Except config/mkstamp.
986 * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
988 * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
990 * modules/Makefile.am (pkglibexecdir): Set it here.
991 (pkgmodincdir): Renamed to pkgmodincludedir). Changed all clients.
993 * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
994 Import regex module from CVS gnulib.
995 * gnulib/config/restrict.m4: Ditto for dependee module restrict.
996 * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
997 do extra substitutions for Makefile.
998 * configure.ac: Use it.
999 * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
1000 from regex_.h if necessary.
1001 * m4/system_.h: Include the correct version of regex.h.
1002 * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
1004 * po/POTFILES.in: Use new location of regex.c.
1006 * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
1007 realloc.c: automake distributes these files already.
1009 2003-09-12 Gary V. Vaughan <gary@gnu.org>
1011 Replace the xstrzdup code by importing the xstrndup module from
1012 CVS gnulib, along with its dependencies: strndup and strnlen:
1014 * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
1015 gnulib/config/xstrndup.m4: Import xstrndup module from CVS
1017 * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
1018 gnulib/config/strndup.m4: Ditto wrt strndup.
1019 * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
1021 * gnulib/m4/Makefile.am: Add rules from newly imported modules.
1022 However, contrary to gnulib, we install xstrndup.h.
1023 * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
1024 * gnulib/lib/xstrzdup.c: Delete. This was never a gnulib file, it
1025 is an artifact of the old m4 portability layer.
1026 * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
1027 * m4/system_.h: Include xstrndup.h.
1028 * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
1030 2003-09-11 Gary V. Vaughan <gary@gnu.org>
1032 Reimport the latest xalloc module from CVS gnulib, and adjust the
1033 m4 sources to take advantage of xalloc xfree. Also create a new
1034 macro DELETE with the same semantics as the old m4 XFREE macro,
1035 and carefully tweak callers:
1037 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
1039 * m4/utility.c (xfree): Removed. This function is now supplied by
1041 * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
1042 * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
1043 * m4/symtab.c (m4_symtab_create): Ditto.
1044 * m4/system_.h: Removed XFREE redefine.
1045 (DELETE): New macro with same functionality as the original m4
1046 XFREE macro, but based on xalloc.h now. Changed all callers.
1047 * src/main.c (main): Use XMALLOC macro.
1048 * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
1050 * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
1052 2003-09-10 Gary V. Vaughan <gary@gnu.org>
1054 Import the xalloc module from CVS gnulib, along with its
1055 dependencies: exitfail, malloc and realloc. We had different
1056 semantics for our XFREE and a function xfree() not supplied by
1057 gnulib, so also a bit of work to keep everything running
1060 * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
1061 (gl_XALLOC): Use gnulib equivalents.
1062 * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
1063 gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
1064 * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
1065 * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
1067 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
1068 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
1069 * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
1071 (pkgincdir): Removed. Use pkgincludedir instead.
1072 * m4/m4private.h (XFREE): xfree already checks for NULL.
1073 * m4/system_.h: Use xalloc module, and remove macros already
1074 supplied by xalloc.h.
1075 * m4/utility.c (xfree): xalloc does not yet implement xfree, so
1076 moved the old definition from m4/xmalloc.c to here for now.
1078 2003-09-09 Gary V. Vaughan <gary@gnu.org>
1080 Import the error and progname modules from CVS gnulib. Our old
1081 error.c subsumed the functionality of both, so a little adjustment
1082 was required to accomodate the split in sources. Also added more
1083 wrapper macros to choose between a system installed error.h or our
1084 shipped gnulib error module:
1086 * m4/error.c, m4/error.h: Removed.
1087 * m4/Makefile.am: Adjust.
1088 (pkgincdir): Removed. Use pkgincludedir instead.
1089 * m4/module.h, src/main.c: Don't include `m4/error.h'.
1090 * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
1092 * gnulib/m4/progname.c: Imported from CVS gnulib.
1093 * gnulib/m4/progname.h: Ditto.
1094 * src/main.c: Adjust to use progname module.
1095 * gnulib/m4/error.c: Imported from CVS gnulib.
1096 * gnulib/m4/error_.h: Ditto.
1097 * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
1098 if appropriate, and link a local error.h if the system version is
1100 (libgnu_la_SOURCES) Add progname module sources.
1101 * gnulib/config/error.m4: Imported from CVS gnulib.
1102 * gnulib/config/strerror_r.m4: Ditto.
1103 * config/m4-error.c: New file. Wrap gnulib error.m4 but arrange
1104 to have ERROR_H for Makefile substitutions and tell system.h
1105 whether the system error.h should be used, or a locally installed
1107 * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
1109 2003-09-09 Gary V. Vaughan <gary@gnu.org>
1111 * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
1112 s/gettext_.h/gettext.h/.
1114 * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
1115 automake have been fixed.
1117 * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
1118 gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
1119 of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
1120 rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
1122 2003-09-09 Gary V. Vaughan <gary@gnu.org>
1124 The gnulib obstack module requires the gnulib gettext module for
1125 systems that do not have GNU gettext installed. Because we use
1126 -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
1127 that directory incase it clashes with the system gettext.h. This
1128 delta uses gettext_.h and extra rules in the Makefile to make a
1129 link to gettext.h when needed:
1131 * Makefile.am (auxdir): Removed. No longer used.
1132 * configure.ac (ac_aux_dir): Removed AC_SUBST. No longer used.
1133 (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
1135 (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
1136 Makefile based build.
1137 (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
1138 of the macros are kept.
1139 * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
1140 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
1141 * config/Makefile (ACLOCAL_MACROS): Removed. Automake 1.7a
1142 distributes these automatically.
1143 * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
1144 warning from automake-1.7a.
1145 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
1146 m4_CHECK_DEBUGGING for consistency with gnulib prefixes. Changed
1148 * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
1149 wrt. m4_FUNC_OBSTACK.
1150 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
1151 wrt. m4_sys_STACKOVF.
1152 * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
1153 wrt. _m4_LIB_GMP, m4_LIB_GMP.
1154 (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
1155 namespace. Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
1157 * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
1158 * gnulib/m4/Makefile.am: Added a new block to make an appropriate
1159 gettext.h link on deficient systems.
1160 (pkginc_HEADERS): Mention $(GETTEXT_H).
1161 (EXTRA_HEADERS): Mention gettext.h.
1162 * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
1163 * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
1164 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
1165 gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
1166 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
1167 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
1168 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
1169 gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
1170 gnulib/config/po.m4, gnulib/config/progtest.m4,
1171 gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
1172 gnulib/config/ulonglong.m4: Imported from CVS gnulib.
1174 2003-09-05 Gary V. Vaughan <gary@gnu.org>
1176 We can't mirror the gnulib directory structure here, since we need
1177 to be able to eg. `#include <m4/obstack.h>' from our source files,
1178 which is much easier if the local obstack.h is created in a
1179 directory named m4. Rather than trying to symlink everything into
1180 the m4 directory, now we build a libtool convenience library from
1181 the sources we get from gnulib and link that with libm4.la:
1183 * gnulib/config/extensions.m4: Imported from CVS gnulib.
1184 * gnulib/config/unlocked-io.m4: Ditto.
1185 * gnulib/m4/unlocked-io.h: Ditto.
1186 * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
1187 gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
1188 * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
1189 gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
1190 * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
1191 * m4/Makefile.am: Adjust.
1192 * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
1193 macros we redistribute.
1194 * gnulib/m4/Makefile.am: New file. Build libgnu.la convenience
1195 library among others.
1196 (GNULIB_SRCS, GNULIB_MACROS): Removed.
1197 * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
1198 * config/m4-obstack.m4: Adjust.
1199 * po/POTFILES.in: Adjust.
1200 * configure.ac: Reformatting. Call newly imported gnulib macros.
1201 * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
1202 bogus calls of `#include "m4.h"'.
1203 * Makefile.am: INCLUDES has been deprecated in favour of
1205 * m4/Makefile.am: Ditto.
1206 * modules/Makefile.am: Ditto.
1207 * src/Makefile.am: Ditto.
1209 2003-09-05 Gary V. Vaughan <gary@gnu.org>
1211 * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
1213 2003-09-04 Gary V. Vaughan <gary@gnu.org>
1215 Migrate the obstack support into the gnulib directories for easy
1216 synchronisation with upstream files in gnulib:
1218 * config/gnu-obstack.m4: Moved from here...
1219 * config/m4-obstack.m4: ...to here.
1220 * config/Makefile.am (SPECIFIC_MACROS): Adjust.
1221 * m4/obstack.c, m4/obstack_.h: Moved from here...
1222 * gnulib/obstack.c, gnulib/obstack.h: ...to here.
1223 * po/POTFILES.in: Adjust.
1224 * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
1225 * m4/Makefile.am: Add a whole new section to link the obstack
1226 sources from the gnulib tree if necessary.
1227 * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
1229 * config/m4-obstack.m4: Rewrite as a wrapper for
1230 gnulib/m4/obstack.m4.
1232 2003-09-04 Gary V. Vaughan <gary@gnu.org>
1234 GNU M4 currently builds with a number of files adapted from
1235 upstream sources. Recently the gnulib project on savannah.gnu.org
1236 has pulled together a great many of these externally maintained
1237 files. This delta is the beginnings of isolating those files
1238 maintained in gnulib to make it easy to synchronise M4 with the
1239 upstream files prior to releases.
1241 * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
1243 (SUBDIRS): Added new gnulib subdirectory.
1244 * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
1245 * config/stdbool.m4: Moved from here...
1246 * gnulib/m4/stdbool.m4: ...to here.
1247 * m4/stdbool_.h: Moved from here...
1248 * gnulib/lib/stdbool_.h: ...to here.
1249 * gnulib/Makefile.am: New file. Make sure the gnulib tree is
1251 * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
1252 code to work with new stdbool_.h location.
1253 (gnulib_srcdir): New.
1255 2003-09-04 Gary V. Vaughan <gary@gnu.org>
1257 * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
1258 (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
1260 (SPECIFIC_TOOLS): New variable. Moved mkstamp to here.
1261 (EXTRA_DIST): Use it.
1263 * bootstrap: CVS autoreconf leaves file droppings. Remove
1264 aclocal.m4t incase autoreconf doesn't.
1266 2003-08-29 Gary V. Vaughan <gary@gnu.org>
1268 * m4/gnu-obstack.h: Updated from CVS gnulib. For consistency with
1269 the other gnulib imports, renamed to m4/obstack_.h.
1270 * m4/obstack.c: Updated from CVS gnulib.
1271 * m4/Makefile.am (EXTRA_HEADERS): Adjust.
1272 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
1273 header tests from gnulib obstack module. AC_CONFIG_LINKS knows
1274 about vpath already, and $top_srcdir upsets CVS Automake, so the
1275 $top_srcdir reference was removed.
1277 * m4/system-h.in: For consistency with the gnulib imports, renamed
1279 * m4/Makefile (EXTRA_HEADERS): Adjust.
1280 * configure.ac (AC_CONFIG_FILES): Adjust.
1282 * m4/stdbool_.h: New file from gnulib for systems without their
1284 * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
1285 * config/stdbool.m4: New file. Macros from gnulib for same.
1286 * configure.ac: Use it.
1288 2003-08-27 Gary V. Vaughan <gary@gnu.org>
1290 * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
1291 * config/gmp.m4: Ditto.
1292 * config/gnu-obstack.m4: Ditto.
1293 * config/stackovf.m4: Ditto.
1294 * m4/builtin.c: Ditto.
1295 * m4/debug.c: Ditto.
1296 * m4/error.c: Ditto.
1297 * m4/error.h: Ditto.
1298 * m4/gnu-obstack.h: Ditto.
1301 * m4/input.c: Ditto.
1303 * m4/m4module.h: Ditto.
1304 * m4/m4private.h: Ditto.
1305 * m4/macro.c: Ditto.
1306 * m4/module.c: Ditto.
1307 * m4/obstack.c: Ditto.
1308 * m4/output.c: Ditto.
1310 * m4/regex.c: Ditto.
1311 * m4/regex.h: Ditto.
1312 * m4/strtol.c: Ditto.
1313 * m4/symtab.c: Ditto.
1314 * m4/syntax.c: Ditto.
1315 * m4/utility.c: Ditto.
1316 * m4/xmalloc.c: Ditto.
1317 * m4/xstrdup.c: Ditto.
1318 * m4/xstrzdup.c: Ditto.
1319 * modules/evalparse.c: Ditto.
1320 * modules/format.c: Ditto.
1321 * modules/gnu.c: Ditto.
1322 * modules/import.c: Ditto.
1323 * modules/load.c: Ditto.
1324 * modules/m4.c: Ditto.
1325 * modules/m4.h: Ditto.
1326 * modules/modtest.c: Ditto.
1327 * modules/mpeval.c: Ditto.
1328 * modules/perl.c: Ditto.
1329 * modules/shadow.c: Ditto.
1330 * modules/stdlib.c: Ditto.
1331 * modules/time.c: Ditto.
1332 * modules/traditional.c: Ditto.
1333 * src/freeze.c: Ditto.
1334 * src/getopt.c: Ditto.
1335 * src/getopt1.c: Ditto.
1337 * src/main.c: Ditto.
1338 * src/stackovf.c: Ditto.
1340 * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
1341 ac_default_headers is an autoconf internal variable.
1342 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
1343 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
1345 * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
1346 * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
1349 2003-08-15 Gary V. Vaughan <gary@gnu.org>
1351 * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
1353 * system-h.in (m4_boolean): Removed in favour of using C99 bool if
1354 possible or faking one with a typedef. Changed all callers.
1356 2003-08-15 Gary V. Vaughan <gary@gnu.org>
1358 Still cleaning up the users' module API, by taking out the stuff
1359 that isn't used by any existing modules, and moving specialised
1360 functions out of libm4 and into the module they are used by.
1362 * m4/m4module.h (m4_skip_space): No need to export this. Moved...
1363 * m4/utility.c (m4_skip_space): ...to here the home of its only
1364 use, made static and renamed to `skip_space'. Changed all
1366 * m4/m4module.h (m4_expand_ranges): Removed prototype.
1367 * m4/utility.c (m4_expand_ranges): Moved definition from here...
1368 * modules/m4.c (m4_expand_ranges): ...to here, and exported using
1370 * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
1372 * modules/gnu.c (builtin_syntax): Import and use in this
1373 builtin implementation.
1374 * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
1376 * m4/macro.c (trace_flush): Except here where the macro is now
1378 * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
1379 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
1381 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
1382 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
1384 2003-08-14 Gary V. Vaughan <gary@gnu.org>
1386 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
1387 compiler based AC_CHECK_HEADER that was introduced in
1389 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
1390 * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
1391 * configure.ac: Use renamed M4_AC_LIB_GMP.
1393 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
1394 macro that requires arguments! This stops the shell's bad
1395 substitution error at configure time.
1397 * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
1398 variables to the testsuite shell. Set the value of USE_GMP so
1399 that the gmp test will run!
1400 (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
1402 2003-08-11 Gary V. Vaughan <gary@gnu.org>
1404 Libltdl already has an excellent mechanism for accessing C symbols
1405 in modules. Lets use that! Remove all the exporting cruft and
1406 just use lt_dlsym in conjunction with a few conventions to
1407 simplify module writers' jobs. Also removed the table address
1408 caching code and otherwise simplified the module loader quite a
1409 bit. To access exported symbols in other modules, first the
1410 exporting module must name the symbols <modname>_LTX_<symname>,
1411 and the importing module must define a function type called
1412 <symname>_func. The importer then adds
1413 M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
1414 that wishes to call out to the exported functions. Care must be
1415 taken that <symname> is non-NULL in the importing module incase
1416 M4_MODULE_IMPORT fails, but otherwise it can be called as if the
1417 definition was in the importers source. Study
1418 `modules/{gnu.c,m4.{c,h}' for a model example. At the moment,
1419 m4_module_import will attempt to automatically load a module
1420 required for symbol access if it is not loaded already.
1422 * TODO: Removed the items fixed in this delta.
1423 * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
1425 * m4/ltdl.h (lt_dlhandle_find): Declare it.
1426 * m4/module.c (m4_module_unload): Use it.
1427 * src/freeze.c (reload_frozen_state): Ditto.
1428 * m4/m4module.h (m4_export): Deleted. Removed all references.
1429 (M4_MODULE_IMPORT): New user convenience macro for importing
1430 arbitrary symbols from other modules.
1431 * m4/module.c (m4_module_import): New function to service
1432 M4_MODULE_IMPORT macro.
1433 (module_data): Removed. Looking up the tables on demand with
1434 lt_dlsym, rather than caching their addresses here simplifies the
1436 (m4_get_module_builtin_table, m4_get_module_macro_table):
1437 Removed. Changed all callers.
1438 (set_module_macro_table, set_module_builtin_table): Renamed to
1439 install_macro_table and install_builtin_table respectively, and
1440 simplified now that the cache is no more.
1441 * modules/gnu.c (builtin_symbols): Use this new mechanism to
1442 import m4_dump_symbols from the m4 module.
1443 (builtin_esyscmd): Likewise for m4_set_sysval and
1445 * modules/m4.c (m4_export_table): Removed. Functions are
1446 addressed with the new mechanism which doesn't need this.
1447 (m4_set_sysval): New exported accessor function to prevent
1448 problems with variable access on inferior architectures.
1449 * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
1450 (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
1451 that we can have some type safety.
1452 * modules/modtest.c (export_test): C level exported function for
1453 testing the new import mechanism.
1454 * modules/import.c: New file for the import end of the test.
1455 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
1456 * tests/modules.at: New test cases for intermodule symbol
1459 2003-08-07 Gary V. Vaughan <gary@gnu.org>
1461 * m4/m4module.c (m4_string): Moved from here...
1462 * m4/m4private.c (m4_string): ...to here.
1464 * m4/utility.c (dumpdef_cmp): Removed stale declaration.
1466 2003-07-29 Gary V. Vaughan <gary@gnu.org>
1468 * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
1469 already available to module writers through
1470 m4_{get,set}_nesting_limit_opt(), so moved from here...
1471 * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
1472 (m4_create): Use it.
1474 2003-07-28 Gary V. Vaughan <gary@gnu.org>
1476 Aside from auditing path.c for m4module.h api obfuscation, this
1477 delta introduces the concept of private struct members in opaque
1478 data types to GNU m4: See the STYLE file for details.
1480 * TODO: Remind ourselves that a rewrite of path.c is needed.
1481 * m4/m4module.h (m4_search_path, struct m4_search_path_info):
1483 * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
1484 here and renamed. These type definitions are for internal api use
1485 only. Changed all callers.
1486 * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
1488 * m4/path.c (search_path_env_init, search_path_add): ...to here
1489 and renamed. These calls were never used outside this file.
1490 Changed all callers.
1491 (dirpath): Moved functionality of this static declaration...
1492 * m4/m4private.h (struct m4): ...to this new internal only
1493 search_path field. Changed all callers.
1494 (m4__get_search_path): Added new internal api accessor.
1495 * m4/path.c (m4_search_path_info_new): Removed. Not used.
1496 (m4_include_init): Removed...
1497 * m4/m4.c (m4_create): ...because the new m4 field is now
1499 (m4_delete): Recycle search_path memory.
1500 * src/main.c (main): Don't call m4_include_init now that it's
1502 * doc/STYLE: Document convention for private fields in opaque
1505 2003-07-24 Gary V. Vaughan <gary@gnu.org>
1507 Sometimes exporting the address of a symbol from a module isn't
1508 enough for other modules to call that symbol correctly. If
1509 custom data types are used for function parameters, they need to
1510 be known to the caller. This change introduces the concept of
1511 $(prefix)/include/modules/$(modulename).h to declare those
1512 structures. Also we move m4_dump_symbols from libm4 to the m4
1513 module to show this concept in action.
1515 * m4/m4module.h (m4_dump_symbol_data): Moved from here...
1516 * modules/m4.h (m4_dump_symbol_data): ...to this new file for
1517 exporting data structures from modules/m4.c.
1518 * modules/m4.c, modules/gnu.c: Include it.
1519 * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
1520 * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
1522 * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
1524 * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
1525 ...to here, with slight renaming.
1526 (m4_export_table): Prototype and add m4_dump_symbols.
1527 * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
1528 definition of m4_dump_symbols.
1529 * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
1530 * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
1532 2003-07-24 Gary V. Vaughan <gary@gnu.org>
1534 Create an export table in modules/m4.c in readiness for beefing up
1535 the module loader to track module exports and imports.
1537 * m4/m4module.h (m4_debug_flush_files): Removed prototype.
1538 * m4/debug.c (m4_debug_flush_files): Moved...
1539 * modules/m4.c (m4_sysval_flush): ...to here and renamed.
1540 * modules/gnu.c (builtin_esysval): Use it.
1541 * m4/m4module.h (m4_export): New type for declaring module symbols
1543 * modules/m4.c (m4_export_table): List symbols exported from this
1544 module for use by other modules.
1546 2003-07-24 Gary V. Vaughan <gary@gnu.org>
1548 An experiment: There is loads of code in libm4 which should be in
1549 the m4 module, but is also used by another module. Just because
1550 some linkers won't cope with calls across dynamic runtime loaded
1551 objects I initially left the code in libm4. It will tidy the
1552 module api immensely if this code moves to the right place, I just
1553 need to remember to invent a suitable calling mechanism at some
1554 point. For now, only modules that are statically linked and
1555 preloaded will get this treatment, so the only platforms that will
1556 break are those that require all symbols to be resolved at link
1559 * TODO: Reminder that what I am doing could reduce portability
1560 unless I do something more robust later.
1561 * m4/m4module.h (m4_sysval): No longer exported from libm4.
1562 * m4/utility.c (m4_sysval): No longer declared in libm4.
1563 * modules/Makefile.am: Reformatting.
1564 * modules/m4.c (m4_sysval): Declare it at place of use.
1565 * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
1567 2003-07-23 Gary V. Vaughan <gary@gnu.org>
1569 * m4/m4module.h: Reformatting and rearranging lines a bit.
1570 (m4_obstack): Save typing by typedefing `struct obstack'. Changed
1572 (m4_call_macro, m4_expand_input): Renamed...
1573 (m4_macro_call, m4_macro_expand_input): ...to these. Changed all
1575 (m4_expansion_level, m4_process_macro): Moved...
1576 * m4/macro.c (expansion_level, process_macro): ...to here, and
1579 * m4/m4module.h (program_name): Not used by modules at all, so
1581 * src/main.c (program_name): ...to here.
1582 (print_program_name): Renamed...
1583 (print_program_name_CB): ...to conform to the STYLE guide.
1585 2003-07-23 Gary V. Vaughan <gary@gnu.org>
1587 More refactoring of the m4module.h API. Replace #defines with an
1588 enum, and move non-public functions out of the public API.
1590 * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
1592 * m4/macro.c (stdarg.h): Add ANSI C variadic header.
1593 * m4/debug.c (m4_debug, trace): Moved...
1594 * m4/m4private.h (struct m4): ...to fields of this struct.
1595 (m4_get_debug_file, m4_get_trace_messages): New fast access macros
1597 * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
1598 * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
1599 * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
1600 * m4/m4module.h (m4_context_field_table): Add entries for new
1601 debug_file and trace_messages fields.
1602 (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
1603 (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
1604 (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
1605 (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
1606 (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
1607 (m4_is_debug_bit): New macro to simplfy checks against the debug
1609 (m4_trace_format, m4_trace_header, m4_trace_flush)
1610 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
1612 * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
1613 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
1614 * m4/macro.c (trace_format, trace_header, trace_flush)
1615 (trace_prepre, trace_pre, trace_post): ...to these newly static
1616 functions, since they are only ever used from this file. Changed
1619 2003-07-17 Gary V. Vaughan <gary@gnu.org>
1621 Change the macros for checking syntax so that matching against
1622 multiple possible syntax classes can be done with a single
1623 comparison some of the time. The various classes are now bits of
1624 an int that can be checked with bitwise logic operators.
1626 * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
1627 (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
1628 (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
1629 (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
1630 (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
1631 (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
1632 (M4_SYNTAX_ALNUM): Removed. Changed all callers.
1633 (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
1634 (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
1635 (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
1636 (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
1637 Replace all calls with invocations of these...
1638 (m4_is_syntax, m4_has_syntax): ...New macros.
1639 * src/freeze.c (produce_syntax_dump): Remove mask argument, which
1640 is no longer required with new macros. Changed all callers.
1642 2003-07-15 Gary V. Vaughan <gary@gnu.org>
1644 * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
1645 values are returned as part of the internal interface, so they
1647 * m4/private.h: ...to here.
1648 * m4/macro.c (expand_token): Check for out of range
1649 m4_peek_input() results before looking up in the syntax table.
1650 (collect_arguments): Ditto.
1652 * NEWS: Note `$' syntax class.
1654 2003-07-08 Paul Eggert <eggert@twinsun.com> and
1655 Gary V. Vaughan <gary@gnu.org>
1657 Conform to POSIX if the POSIXLY_CORRECT environment is set.
1658 --traditional `define' now smashes all the definitions.
1660 * NEWS: Explain this.
1661 * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
1662 (Extensions): Explain that extensions that are incompatible with
1663 POSIX are disabled if POSIXLY_CORRECT is set.
1664 (Incompatibilities): Remove.
1665 (Define, Other Incompat): Explain difference
1666 between GNU and POSIX behavior of define, pushdef, popdef.
1667 * m4/m4.c (m4_get_posixly_correct_opt): New undef.
1668 * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
1669 * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
1670 (m4_get_posixly_correct_opt): New macro.
1671 * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
1673 * modules/m4.c (builtin_functions): defn now takes any number of args.
1674 (builtin_define): Smash all the definitions if
1676 (builtin_defn)): Allow any number of arguments.
1677 (builtin_undivert): Do not allow nonnumeric arguments
1679 * src/main.c (main): Set posixly-correct behavior if either
1680 POSIXLY_CORRECT is set, or if -G is given.
1681 * tests/builtins.at: New test for smashed definitions.
1683 2003-06-27 Gary V. Vaughan <gary@gnu.org>
1685 * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
1686 * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
1687 not to slow the parser down.
1688 (M4__IS_STRING): New macro to test string syntax class membership.
1689 * m4/syntax.c: Adjust docucomment.
1690 (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
1691 (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
1692 * m4/input.c (init_builtin_token): Comment typo.
1693 (m4__next_token): Comment typo.
1694 Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
1695 by using the new M4__IS_STRING macro.
1696 * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
1697 variable references in macro expansions.
1699 * doc/m4.texinfo (Eregexp and Regexp): Typo.
1700 (Epatsubst and Patsubst): Typo.
1703 2003-06-26 Gary V. Vaughan <gary@gnu.org>
1705 Move the global variables that pertain to syntax to a new `struct
1706 m4_syntax_table', and then add one of these to `struct m4'. The
1707 ripple effect through the code to both change formerly global
1708 references, and make sure a suitable context is available in
1709 lexical scope is disproportionately large compared to the size of
1710 the change proper. This change is a large part of decoupling
1711 syntax.c from the rest of the code that uses it.
1713 * m4/m4private.h (struct m4): Add a syntax field.
1714 * m4/m4.c (m4_create): Initialise it,
1715 (m4_delete): Recycle it.
1716 (m4_get_symtab): Remove hand coded version...
1717 (m4_get_symbol_table): ...and generate this with cpp. Changed all
1719 * m4/m4module.h (m4_context_field_table): Add an extra field so we
1720 can generate m4_get_symbol_table. Add a new row for
1721 m4_get_syntax_table.
1722 (M4SYNTAX): Syntactic sugar for module writers.
1723 (m4_symtab): Renamed to m4_symbol_table. Changed all callers.
1724 (m4_syntax_table): New home for syntax related formerly global
1726 * m4/m4private.h (struct m4_syntax_table): Define it.
1727 * m4/input.c (m4_input_init): Initialisation of these formerly
1728 global variables moved...
1729 * m4/syntax.c (m4_syntax_create): ...to here.
1730 * m4/input.c (m4_input_exit): And similarly, recycling of the
1731 memory used by those values moved...
1732 * m4/syntax.c (m4_syntax_delete): ...to here.
1733 * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
1734 Moved to m4/m4private.h.
1735 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
1736 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
1737 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
1738 (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
1739 objects. Changed all callers that used to directly access the
1741 (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
1742 Removed and incorporated into m4_syntax_table structure.
1743 * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
1744 * m4/syntax.c (m4_set_syntax): Now returns an error status,
1745 instead of requiring a `struct m4' to generate its own errors.
1746 Changed all callers.
1747 * src/main.c (main): Now that the syntax table is initialised as
1748 part of m4_create, we have to manually wipe the syntax entries if
1749 we are about to read a frozen file.
1751 2003-06-26 Gary V. Vaughan <gary@gnu.org>
1753 * doc/STYLE: Added notes on callback naming schemes.
1755 * m4/module.c (m4_set_module_macro_table)
1756 (m4_set_module_builtin_table): Declarations weren't changed when
1757 definitions were renamed on 2003-06-19.
1759 * m4/hash.c (m4_hash_resize): ifdefed out. This function is
1760 neither used nor particularly appropriate since it exposes the
1761 internal workings of the hash module. I haven't yet decided
1762 whether to remove it entirely.
1764 2003-06-20 Gary V. Vaughan <gary@gnu.org>
1766 Two related changes, and a huge knockon effect throughout the
1767 source: Moved the option variables out of global space and into
1768 `struct m4'; made `m4_symtab' a real datatype, so that its api
1769 is not marred passing `struct m4' around just so it can decide
1770 whether to keep traced symbol names or not. Added setters and
1771 getters for the formerly global option variables, and obviously
1772 changed a vast number of functions to take a `struct m4' and use
1773 the getter funcs to find option values.
1775 * m4/utility.c (interactive, sync_output, debug_level)
1776 (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
1777 (max_debug_argument_length, warning_status, nesting_limit)
1778 (discard_comments): Removed.
1779 * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
1780 (debug_level, max_debug_argument_length, prefix_all_builtins)
1781 (suppress_warnings, discard_comments, interactive, sync_output):
1782 Removed from here...
1783 * m4/m4private.h (struct m4): ...and equivalent fields added to
1785 (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
1786 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
1787 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
1788 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
1789 (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
1790 macros for the new fields.
1791 * m4/m4module.h (m4_context_field_table)
1792 (m4_context_opt_bit_table): Helper macros used to generate
1793 prototypes, setters and getters for new option fields
1795 * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
1796 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
1797 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
1798 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
1799 (m4_get_interactive_opt, m4_get_sync_output_opt)
1800 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
1801 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
1802 (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
1803 (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
1804 (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
1805 setter and getter functions generated by cpp from
1806 m4_context_field_table and m4_context_opt_bit_table, exported as
1807 part of the module api. Changed all callers.
1808 * m4/symtab (struct m4_symtab): Used as the concrete type for
1810 (m4_symtab_create): Allocate and initialise a new struct.
1811 (m4_symtab_apply): New function that works like m4_hash_apply, but
1812 with different callbacks specific to symbol tables. Changed all
1814 (symbol_destroy, arg_destroy, arg_copy): Renamed
1815 symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
1816 they have unused parameters for a reason!
1817 (dump_symbol_CB): New callback to dump the contents of a single
1819 (symtob_dump): Rewritten in terms of dump_symbol_CB.
1820 * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
1821 Changed all callers.
1822 * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
1823 of the contained `m4_symtab' at the `no_gnu_extensions' field.
1824 Although I'm not convinced these semantics are correct, they are
1825 at least consistent with how things were before this delta. Also
1826 set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
1828 2003-06-19 Gary V. Vaughan <gary@gnu.org>
1830 Tie down the interface to libm4 some more. Make more structures
1831 opaque to modules by moving them to m4private.h, and writing
1832 setters and getters. To win back the speed penalty for doing this
1833 also wrote macroized versions that do know about structure layout
1834 in m4private.h and #include that file into modules when NDEBUG is
1835 defined at compile time. There are still some accessor macros in
1836 m4private.h that need to go, but that is not necessary to clean
1839 * m4/m4module.h (m4_symbol_type): Moved...
1840 * m4/m4private.h (m4__symbol_type): ...to here.
1841 * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
1842 (m4_set_symbol_traced, m4_set_symbol_name_traced)
1843 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
1844 (m4_get_symbol_func, m4_symbol_value_create)
1845 (m4_symbol_value_delete, m4_set_symbol_value_text)
1846 (m4_set_symbol_value_func): New exported api to symbols.
1847 (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
1848 and m4_is_symbol_value_func.
1849 * m4/m4module.h: Prototype these guys.
1850 * m4/module.c (m4_set_module_macro_table)
1851 (m4_set_module_builtin_table): Make these static, there is no
1852 reason to pollute the api with them.
1853 * m4/m4private.h: Reformatting.
1854 (m4_get_symtab): Only define when NDEBUG is defined.
1855 (m4_get_symbol_value, m4_get_symbol_traced)
1856 (m4_set_symbol_traced, m4_set_symbol_name_traced)
1857 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
1858 (m4_get_symbol_func, m4_symbol_value_create)
1859 (m4_symbol_value_delete, m4_set_symbol_value_text)
1860 (m4_set_symbol_value_func): Macro implementations of the new
1861 functions when NDEBUG is defined.
1862 (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
1863 (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
1864 Superceded by the above. All callers changed.
1865 (M4ARG): Removed. This is no longer different to the
1866 m4/m4module.h definition.
1867 * modules/gnu.c, modules/m4.c: Only include m4private.h when
1868 NDEBUG is defined. That way we exercise the same (albeit slower)
1869 api that external modules must use.
1871 2003-06-18 Gary V. Vaughan <gary@gnu.org>
1873 Renamed some of the types and their accessors to make more sense.
1874 Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
1875 has a stack of SYMBOL_VALUEs.
1877 * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
1878 (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
1879 m4_get_symbol_value_type, m4_get_symbol_value_text,
1880 m4_get_symbol_value_func and m4_symbol_value_copy respectively.
1881 Changed all callers.
1882 (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
1883 (m4_get_token_type): Renamed
1884 * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
1885 to the internal api.
1886 * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
1888 (m4__symtab_init, m4__symtab_exit): Removed prototypes.
1889 (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
1890 (m4__token_type): Moved here from m4module.h.
1891 (m4__next_token): Renamed from m4_next_token.
1892 * m4/symtab.c: Removed some of the parameterised macro support
1893 functions for modularisation later.
1894 (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
1895 m4_hash_dup to perform a true deep copy of the SRC.
1896 (arg_copy): Callback for m4_symbol_value_copy.
1897 * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
1898 Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
1899 m4_get_symbol_value_func. Changed all callers.
1901 2003-06-18 Gary V. Vaughan <gary@gnu.org>
1903 Tidy up style of hash.[ch] in accordance with doc/STYLE.
1905 * m4/hash.c: Internal symbol renaming and formatting.
1906 (m4_hash_dup): New function to facilitate deep copies of hash
1908 (m4_hash_apply_func): Returns a void* now, which is a richer type
1909 for returning exceptions (NULL means keep going).
1910 (m4_hash_apply): Ditto.
1911 * m4/hash.h: Declare exported symbols with an explicit extern.
1914 2003-06-17 Gary V. Vaughan <gary@gnu.org>
1916 Still refactoring furiously. This delta represents a change in
1917 semantics to symtab.c. Instead of building temporary m4_tokens
1918 in the caller, and copying fields in the methods, we now create
1919 the actual m4_token for hashing in the caller so the methods just
1920 slot them in directly. Also, this means that we don't lookup a
1921 symbol and get back an allocated but VOID token to copy fields
1922 into, we create the token we want to push and pass that to
1923 m4_symbol_define or m4_symbol_pushdef. And that's it. There are
1924 a few other small changes to stop knowledge of the implementation
1925 of symtab.c leaking out into other files.
1927 * m4/macro.c (expand_argument): Comment typo corrected.
1928 * m4/symtab.c (symtab_fetch): New function to fetch the address of
1930 (m4_symbol_pushdef): Take an extra value parameter and use this
1931 directly as the new top of the value stack. All callers changed
1932 to build a token and pass responsibility for memory in, rather
1933 than copying as we used to.
1934 (m4_symbol_define): Also use the new value parameter directly as a
1935 replacement for the top of the value stack. All callers changed
1936 to build a token as above.
1937 (m4_set_symbol_traced): New function to set the traced bit on the
1938 named symbol, creating it if necessary.
1939 (symbol_popval): The guts of the old m4_symbol_popdef.
1940 (m4_symbol_popdef): Use it.
1941 * m4/builtin.c (m4_symbol_set_token): Removed,
1942 (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
1944 * m4/module.c (m4_set_module_builtin_table)
1945 (m4_set_module_macro_table): ...with these more orthogonal
1947 * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
1948 (m4_builtin_pushdef, m4_builtin_define): Removed. No longer
1950 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
1951 (m4_arg_signature_parse): Moved...
1952 * m4/symtab.c: ...to here.
1953 * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
1954 screw something up. Moved...
1955 * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
1956 actually does a proper deep copy of source to dest.
1958 2003-06-16 Gary V. Vaughan <gary@gnu.org>
1960 Further refactoring to stabilise the module API. Renaming some
1961 functions for orthogonality, and judicious definition migration to
1962 move things out of the set of exported symbols.
1964 * doc/STYLE: New file. Notes on coding style.
1965 * m4/m4module.c: Updated bitrotted docucomment at the top of the
1967 (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
1968 m4_get_module_name, m4_get_module_builtin_table,
1969 m4_get_module_macro_table which are verb phrases. Changed all
1971 * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
1973 * m4/module.c (m4_set_module_builtin_table)
1974 (m4_set_module_macro_table): ...here, and renamed. Changed all
1976 * m4/m4module.c (m4_module_data): This...
1977 * m4/m4private.c (struct m4_module_data): ...and this...
1978 * m4/module.c (module_data) ...consolidated here and no longer
1979 exported. Changed all callers.
1981 2003-06-16 Gary V. Vaughan <gary@gnu.org>
1983 Begin work on lifting the curse of the global variables. To start
1984 with create a `struct m4' context container, and replace
1985 `m4__symtab' with `context->symtab' throughout. This means
1986 initialising a context container in main, and adjusting many
1987 functions between main and the module entry points so that the
1988 container gets passed through. It would have been nice to
1989 defer this until after 1.5, but it has a major effect on the
1990 user's module writing ABI, so it needs to be addressed now - at
1991 least in the areas that impact the ABI. An interrelated change
1992 in the symtab API removes the dependency on a global symbol table,
1993 and instead focuses on a passed table (from the context
1996 * TODO: Reminders for finishing context functionality.
1997 * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
1998 * m4/m4.c: New file. Manage new struct m4 objects to eliminate
1999 global variables and eventually allow m4 to be reentrant.
2000 * m4/m4private.h (m4): Define the new structure here...
2001 (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
2002 don't carry the overhead of a function call.
2003 * m4/m4module.h: Prototype extern functions from m4/m4.c.
2004 (m4): Declare type for new struct m4 objects.
2005 (M4SYMTAB): User macro to ease finding the symbol table for the
2006 current context for module developers.
2007 (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
2009 (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
2010 (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
2011 (m4_call_macro, m4_dump_symbols, m4_expand_input)
2012 (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
2013 (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
2014 (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
2015 m4* context parameter. Changed definitions and all callers.
2016 (m4_symtab): Alias for m4_hash to decouple the
2017 m4_symtab api from m4_hash.
2018 (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
2020 (m4_symtab_create): New function to return an initialised
2022 (m4_symtab_delete): New function to delete an m4_symtab's memory.
2023 (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
2024 (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
2025 instead of simply using the global m4__symtab. Changed
2026 definitions and all callers.
2027 * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
2028 * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
2029 * src/main.c (main): Create a context and use that instead of the
2030 former global m4__symtab.
2032 2003-06-13 Gary V. Vaughan <gary@gnu.org>
2034 * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
2035 to the callback. Callbacks should not need to hardcode the
2036 hashtable they are working from, nor should we have to waste the
2037 userdata parameter to pass the table in.
2038 * m4/hash.h (m4_hash_apply_func): Require the initial table
2040 * m4/symtab.c (symtab_destroy): Use the passed table instead
2041 of hardcoding m4__symtab.
2042 (m4_symbol_popdef): Don't use the userdata parameter to pass the
2043 table to arg_destroy.
2044 (arg_destroy): Use the hash parameter, ignore userdata.
2045 * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
2047 (traceon, traceoff): Call set_trace with the extra initial
2050 2003-06-13 Gary V. Vaughan <gary@gnu.org>
2052 More refactoring to stabilise the module api, this time for
2053 symtab.c. Additionally, start to pay attention to function names
2054 that don't contain a verb like they should.
2056 * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
2057 wrapper for m4_hash_apply to decouple the symtab module from the
2059 (m4_symbol_builtin, m4_symbol_macro): Renamed to
2060 m4__symbol_set_builtin and m4__symbol_set_macro. Changed all
2062 (m4_symbol_delete): Create a macro version to save a function
2064 (m4_token_t, m4_data_t): These violate the POSIX reserved
2065 namespace. Renamed to m4_token_type and m4_symbol_type. Changed
2067 (m4_token_type): Renamed to m4_token_get_type.
2068 (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
2069 (m4_symtab_exit): Removed from the exported module
2071 * m4/m4private.h (m4__symtab, m4__symtab_init)
2072 (m4__symtab_remove_module_references, m4__symtab_exit): ...and
2073 renamed and added to the internal api. Changed all callers.
2074 (m4_symtab_apply): A faster macro version of the function for
2075 users of the internal api.
2076 * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
2077 symbol_destroy and arg_destroy.
2078 (symtab_debug): Added a prototype.
2079 (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
2080 so that callers in this file get the faster macro versions from
2083 2003-06-12 Gary V. Vaughan <gary@gnu.org>
2085 Refactoring modules to rationalise the API into an external
2086 documented (eventually!) API for use by modules in the `m4_'
2087 namespace declared in m4/m4module.h, an internal API between the
2088 source files we ship (including our shipped modules) in the `m4__'
2089 namespace declared in m4/m4private.h and making the rest as
2090 cohesive as possible with liberal use of the `static' keyword.
2091 This change represents an audit to m4/module.c along these
2094 * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
2095 Removed. No longer used.
2096 (m4_module_close): Removed prototypes.
2097 (m4_module_init, m4_module_open, m4_module_unload_all): Removed
2098 from the exported module api...
2099 * m4/m4private.h (m4__module_init, m4__module_open)
2100 (m4__module_exit): ...and renamed and added to the internal api.
2101 Changed all callers.
2102 (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
2103 Centralised definitions after renaming...
2104 * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
2105 (M4_FINISH_SYMBOL): ...and removing from here.
2106 (m4_module_dlerror, m4_module_remove, m4_module_close)
2107 (m4_caller_id): Not exported at all, so renamed to module_dlerror,
2108 module_remove, module_close and caller_id.
2109 (MODULE_SELF_NAME): New macro to make reporting self errors
2111 (m4_module_load, module_close, module_remove): Use it.
2112 * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
2114 * src/main.c (main): Use it.
2116 2003-06-12 Gary V. Vaughan <gary@gnu.org>
2118 * README: Remove references to --enable-changeword, which has been
2119 removed from the code.
2121 2003-06-11 Gary V. Vaughan <gary@gnu.org>
2123 Getting rid of the annoying bug with configure --enable-debug,
2124 which spewed -e: command not found errors. This was an interaction
2125 between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
2126 You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
2127 branch-1-5) to get the full fix.
2129 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
2130 of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
2131 and then use the probed value of $SED.
2132 (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
2133 this, it messes up the AC_REQUIRE stack.
2135 2003-06-10 Gary V. Vaughan <gary@gnu.org>
2137 * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
2138 the destroy callback.
2139 (m4_arg_destroy): Use the hash address to free the hash node key
2142 2003-06-06 Gary V. Vaughan <gary@gnu.org>
2144 First cut at formal parameters in macros.
2146 * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
2147 * m4/xstrzdup.c: New file.
2148 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
2149 associative array of parameter names to details.
2150 (m4_symbol_token): Capture macro names with parameter lists.
2151 (m4_arg_signature_parse): And build an associative array to hang
2152 from the symbol structure to map names to details.
2153 * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
2154 m4_hash_resize idiom. Now that we potentially add a little hash
2155 table to many of the entries in the symbol table, added an extra
2156 arg to set the initial size. Changed all callers.
2157 (m4_hash_apply): New function that is basically a generalised
2159 * m4/symtab.c (m4_symbol_apply): ...this. Now deleted. Adjusted
2160 all callers to call m4_hash_apply instead.
2161 (m4_arg_destroy): Recycle memory used by an m4_token_arg.
2162 (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
2163 m4_arg_signature association that might be attached to the symbol,
2164 * m4/hash.h (m4_hash_apply_func): Replacement type for...
2165 * m4/m4module.h (m4_symtab_apply_func): ...this. Now deleted.
2166 (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
2168 (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
2169 (M4_IS_IDENT): Detect characters that can be safely used in
2171 * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
2172 * m4/macro.c: Corrected grammar in some comments. Use `token'
2173 rather than `td' for m4_token variables.
2174 (m4_process_macro): If we find a dollar followed by some
2175 M4_IS_IDENT characters, replace that with the contents of the argv
2176 entry with offset stored in the m4_token_arg associated with the
2177 collected identifier.
2179 2003-06-05 Gary V. Vaughan <gary@gnu.org>
2181 Begin preparations for supporting formal parameters in m4 macros.
2183 * m4/m4private.h (struct m4_token_arg): Placeholder for holding
2184 the details of a formal parameter.
2185 (m4_token): Add an arg_signature member to hold a hash table for
2186 looking up formal parameters.
2187 * m4/input.c: Update more bitrotted comments.
2188 (m4_push_builtin): Initialise arg_signature member.
2189 (init_builtin_token): Copy arg_signature member.
2190 * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
2191 (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
2193 * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
2194 (m4_macro_pushdef, m4_macro_define): ...these, And...
2195 (m4_symbol_token): ...wrapped around this new function, which
2196 vastly simplifies the arguments required by the functions it
2198 Changed all callers.
2200 2003-06-05 Gary V. Vaughan <gary@gnu.org>
2202 * m4/macro.c: Format changes.
2204 2003-06-04 Gary V. Vaughan <gary@gnu.org>
2206 * m4/input.c: Updated various bitrotted comments.
2207 (m4_push_builtin): Just pass the whole m4_token, rather than
2208 extracting all the fields in the caller. This also allows us to
2209 check the token type for consistency.
2210 (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
2211 Renamed to builtin_funcs, builtin_peek, builtin_read,
2212 m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
2213 the code. Changed all callers.
2214 (struct input_block): Similarly renamed u_m member to u_b, and
2215 changed all callers.
2216 (m4_next_token): Use bzero to initialise the data fields.
2217 * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
2219 2003-05-29 Gary V. Vaughan <gary@gnu.org>
2221 These changes were necessary to get m4 to build on my iBook
2222 running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
2223 (GCC) 3.1 20020420 (prerelease)":
2225 * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
2226 inclusion of module loader headers.
2227 * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
2228 * m4/Makefile.am: Ditto.
2229 (libm4_la_LIBADD): Added $(LTLIBINTL).
2230 * m4/utility.c (program_name): Removed declaration in favour of
2231 the one already in error.c!
2232 * m4/m4module.h (program_name): Define to program_invocation_name
2233 when using GNU C library. Use an explicit extern declaration.
2234 (interactive, sync_output, debug_level, hash_table_size)
2235 (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
2236 (suppress_warnings, warning_status, nesting_limit, discard_comments)
2237 (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
2238 (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
2239 (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
2240 (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
2241 (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
2242 (m4_expansion_level, m4_expand_ranges, m4_expand_input)
2243 (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
2244 (m4_current_line, m4_current_diversion, m4_output_current_line):
2245 Don't rely on default, use an explicit extern.
2246 * m4/error.h (error, error_at_line, error_print_progname)
2247 (error_message_count, error_one_per_line): Ditto.
2248 * m4/ltdl.c: Update from CVS libtool.
2250 * commit: Update from CVS cvs-utils.
2252 2002-11-04 Akim Demaille <akim@epita.fr>
2254 * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
2256 * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
2258 2002-11-04 Akim Demaille <akim@epita.fr>
2260 * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
2262 2002-11-04 Akim Demaille <akim@epita.fr>
2264 * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
2265 used as `external', and Libtool 1.4.3.
2267 (LTLIBOBJS): Don't play with it.
2269 * Makefile.am (SUBDIRS): Remove intl.
2270 (ACLOCAL_AMFLAGS): Add -I config.
2271 (EXTRA_DIST): Add config/config.rpath.
2274 * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
2276 2002-05-29 Gary V. Vaughan <gary@gnu.org>
2278 Preparations for refactoring syntax tables to allow reverse
2279 lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
2280 speed of normal lookups in an array of unsigned short.
2282 * m4/input.c (single_quotes, single_comments, use_macro_escape):
2284 * m4/m4private.h (m4__single_quotes, m4__single_comments,
2285 m4__use_macro_escape): ...to here, and renamed. The `m4__' prefix
2286 is for internal symbols which unavoidably pollute the global
2287 namespace, but are not published APIs.
2288 Adjusted all callers.
2289 * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
2290 m4_set_comment, m4_set_syntax, set_syntax_internal,
2291 unset_syntax_attribute): Moved from this file...
2292 * m4/syntax.c: New. ...to this file.
2293 Also added an m4_syntax_exit stub for orthogonality.
2294 * src/main.c (main): Use it.
2295 * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
2296 * m4/m4module.h: Reformatting. New prototypes.
2298 2002-05-29 Gary V. Vaughan <gary@gnu.org>
2300 * bootstrap (aclocal_apiversion): The aclocal apiversion is
2301 distinct from the automake release number (in that the apiversion
2302 apparently has no micro-version-component).
2303 (aclocal_apilibdir): Use it.
2305 2002-05-28 Gary V. Vaughan <gary@gnu.org>
2307 * m4/hash.c (m4_hash_resize): New function.
2308 * m4/hash.h: Add prototype.
2309 * m4/symtab.c (m4_symtab_init): Use it. This could do with some
2310 benchmarking to find a good value for, say, autoconf. This is
2311 already a little quicker than before for me.
2313 * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
2314 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
2316 * m4/hash.h: Adjust prototypes.
2318 2002-01-22 Akim Demaille <akim@epita.fr>
2320 * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
2322 * tests/Makefile.am (package.m4): New.
2323 * tests/atlocal.in: Adjust to CVS Autotest.
2324 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
2325 * configure.ac: LIBOBJ is a forbidden string.
2326 Simplify AM_INIT_AUTOMAKE invocation.
2327 * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
2330 2001-10-19 Akim Demaille <akim@epita.fr>
2332 * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
2334 2001-10-19 Akim Demaille <akim@epita.fr>
2336 * m4/input.c (m4_next_token): Display where was opened what is
2339 2001-10-19 Akim Demaille <akim@epita.fr>
2341 * m4/macro.c (expand_argument): Display where was opened what is
2344 2001-10-18 Akim Demaille <akim@epita.fr>
2346 * m4/input.c, modules/m4.c: Formatting changes.
2348 2001-10-17 Gary V. Vaughan <gary@gnu.org>
2350 * bootstrap: s/configure.in/configure.ac/
2352 2001-10-16 Gary V. Vaughan <gary@gnu.org>
2354 * m4/symtab.c (m4_symbol_destroy): This function calls
2355 m4_symbol_popdef, which recycles a symbols memory when the last
2356 definition is popped. Since we were passing the address of the
2357 symbol name found in the symbol table, and it was being removed
2358 partway through m4_symbol_destroy() we were referencing freed
2359 memory for the balance of the function. Now we take a copy of the
2360 symbol name tring and use that as a key into the symbol
2361 table... that way if the original symbol name is freed, the copy
2364 2001-10-13 Akim Demaille <akim@epita.fr>
2366 * m4/ltdl.c: Update.
2368 2001-10-13 Akim Demaille <akim@epita.fr>
2370 * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
2371 Don't gettextize internal error messages.
2373 2001-10-13 Akim Demaille <akim@epita.fr>
2375 * tests/macros.at (Arity and defn): New failing test.
2376 (Arity, defn, and freeze): New.
2378 Fix `Arity and defn'.
2380 * m4/input.c (m4_push_macro): Don't forget the arity.
2381 * modules/m4.c (defn): Likewise.
2383 2001-10-13 Akim Demaille <akim@epita.fr>
2385 * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
2387 * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
2388 (Propagation of traceon, Propagation of --trace): this new file.
2390 2001-10-13 Akim Demaille <akim@epita.fr>
2392 * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
2393 interface instead of (name, argc...).
2394 Upon failure, specify which argument was guilty.
2397 2001-10-13 Akim Demaille <akim@epita.fr>
2399 * modules/evalparse.c: Save translators' time: don't translate
2400 internal error messages.
2401 (m4_evaluate): Simplify/normalize error messages.
2402 * doc/m4.texinfo (Eval): Adjust.
2404 2001-10-13 Akim Demaille <akim@epita.fr>
2406 * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
2407 where no checking is needed.
2408 * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
2409 interface instead of (name, argc...).
2411 * modules/gnu.c (m4_patsubst_do): Don't check argc, done
2414 2001-10-13 Akim Demaille <akim@epita.fr>
2416 * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
2417 exclude the builtin name from the count.
2418 * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
2419 calling ifelse with a single argument is valid.
2420 * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
2421 with 1 and 2 args, mostly to strengthen the test suite.
2423 2001-10-13 Akim Demaille <akim@epita.fr>
2425 * m4/output.c (m4_make_diversion, m4_insert_file)
2426 (m4_insert_diversion, +m4_freeze_diversions): Ansify.
2428 2001-10-12 Gary V. Vaughan <gary@gnu.org>
2430 * m4/input.c (init_builtin_token): Renamed from init_macro_token,
2431 since we call these things builtins in the rest of the code!
2433 * modules/gnu.c (m4_regexp_compile): s/%0/%s/
2435 2001-10-12 Gary V. Vaughan <gary@gnu.org>
2437 Rather than forcing each builtin definition to manage its own
2438 argument range checking, tabulate the maxima and minima for all
2439 builtins in each module. This forces us to consider what the
2440 valid ranges for each builtin should be, and moves the checking
2441 code out of each builtin implementation and into the builtin
2442 caller infrastructure.
2444 * m4/m4module.h (struct m4_builtin): Add argument minima and
2446 * m4/m4private.h (struct m4_token): Reflect them here too.
2447 * m4/input.c (struct input_block): ...and here.
2448 (m4_token_copy): New function for token copying.
2449 (init_macro_token): Copy them from a token to the input stack.
2450 (m4_next_token): Don't forget to initialise them for text
2452 * m4/macro.c (expand_argument): Use m4_token_copy, and also
2453 check argument counts before calling the builtin handler.
2454 * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
2455 (m4_symbol_macro): Likewise.
2456 * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
2457 parameters. Updated all callers.
2458 (m4_builtin_define): Ditto.
2459 (m4_macro_pushdef, m4_macro_define): Ditto.
2460 * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
2461 * modules/evalparse.c: Declare argument counts for defined
2462 builtins and remove explicit calls to m4_bad_argc().
2463 * modules/gnu.c: Ditto.
2464 * modules/load.c: Ditto.
2465 * modules/m4.c: Ditto.
2466 * modules/modtest.c: Ditto.
2467 * modules/mpeval.c: Ditto.
2468 * modules/perl.c: Ditto.
2469 * modules/shadow.c: Ditto.
2470 * modules/stdlib.c: Ditto.
2471 * modules/time.c: Ditto.
2474 2001-10-10 Gary V. Vaughan <gary@gnu.org>
2476 The trace semantics now attach the trace bit to a symbol name.
2477 For as long as a traceon(`foo') is active, calls to foo will be
2478 traced regardless of intervening undefines or module unloads.
2479 Fixed the flag propogation issues differently to the fixes
2480 reverted with the last attempt at nailing down trace:
2482 * m4/m4private.h: This file is not visible outside of the m4
2483 source tree, so I removed all the `M4_' and `m4_' prefixes to save
2484 on typing. Updated all clients.
2485 (m4_token): New typedef contains the fields that need to be passed
2486 around with the low level tokeniser.
2487 (m4_token_data): Removed.
2488 (m4_symbol): Now contains the traced flag again.
2489 * m4/symtab.c: Rewritten again. Now we don't remove symbols with
2490 the trace bit set. This change is contained entirely within this
2491 module and doesn't leak out into the callers. Updated all
2493 (m4_symbol_builtin, m4_symbol_macro): Adjusted to make use of the
2494 new fields in m4_token. Updated all clients.
2495 * m4/builtin.c (m4_builtin_pushdef): Needs a flags argument so
2496 that `groks_macro_args' and `blind_if_no_args' flags are retained
2497 when defn() results are passed around in m4 code. Updated all
2499 (m4_builtin_define): Ditto.
2500 (m4_macro_pushdef, m4_macro_define): Ditto.
2501 * m4/input.c (struct input_block): Add a flags field to facilitate
2503 (m4_push_macro): ...use it.
2504 (init_macro_token): Retrieve it.
2505 (m4_next_token): Initialise it.
2506 * m4/macro.c (expand_argument): Copy it.
2507 * m4/m4module.h: Adjust.
2508 * tests/builtins.at: Adjust the expected output of the trace
2509 tests to reflect the change in semantics.
2510 * tests/modules.at (modules: trace): Check that unloading a
2511 module which supplies a traced symbol definition doesn't lose te
2514 2001-10-07 Gary V. Vaughan <gary@gnu.org>
2516 * modules/gnu.c (m4_macro_table): Display the timetamp when
2517 expanding __m4_version__.
2519 * configure.ac (--with-modules): Forgot a comma in the
2520 AC_HELP_STRING parameter list.
2522 2001-10-05 Gary V. Vaughan <gary@gnu.org>
2524 * bootstrap: Remove aclocal.m4t when it is no longer required.
2526 2001-10-05 Akim Demaille <akim@epita.fr>
2528 * tests/Makefile.am: Adjust for gnuprog2.
2529 * tests/m4.in: There can be a leading path.
2530 * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
2531 * tests/testsuite.at: Adjust to the most recent Autotest.
2532 (AT_CHECK_M4_FILTER): Fix and rename as...
2534 * tests/others.at: Use it.
2536 * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
2537 variable in shell scripts, one uses `$'...
2539 2001-10-04 Gary V. Vaughan <gary@gnu.org>
2541 * configure.ac: `rm -f $m4_getopt_h' was lost.
2543 2001-10-04 Gary V. Vaughan <gary@gnu.org>
2545 * configure.ac (TIMESTAMP): Display with AS_BOX at configure
2546 time. Define it for config.h in order to...
2547 * src/main.c (main): ...display the timestamp for --version.
2549 2001-10-04 Akim Demaille <akim@epita.fr>
2551 * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
2552 previous builtins `regexp' and `patsubst'.
2553 (regexp, patsubst): Use them.
2554 (eregexp, epatsubst): New builtins.
2555 * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
2556 (Epatsubst and Patsubst, Eregexp and Regexp): these.
2557 (Extensions): More info on REs.
2559 2001-10-04 Akim Demaille <akim@epita.fr>
2561 * modules/modtest.c (init_handler): Consistently output to stderr.
2562 (finish_handler): New.
2563 (test): The `if' is an `assert'.
2564 * tests/modules.at: Adjust.
2566 2001-10-04 Akim Demaille <akim@epita.fr>
2568 * m4/utility.c (m4_bad_argc): Detail the mismatches.
2570 2001-10-01 Akim Demaille <akim@epita.fr>
2572 * tests/generate.awk: Tag the tests with `documentation'.
2573 * tests/modules.at (AT_CHECK_M4_MODTEST): New.
2574 Use the make the existing modtest tests more uniform, and complete
2575 the set of possibilities.
2577 2001-10-01 Akim Demaille <akim@epita.fr>
2579 * config/gmp.m4: Consult the user before using GMP: use
2581 * configure.ac: Adjust.
2582 * modules/gmp.c: No protection needed as the module is not built
2585 2001-10-01 Akim Demaille <akim@epita.fr>
2587 * tests/generate.awk: Remove debugging code.
2588 (fatal): Specify the current location.
2590 * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
2591 * modules/gnu.c, modules/m4.c: Use M4ARG.
2593 2001-10-01 Akim Demaille <akim@epita.fr>
2595 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
2596 (m4_regexp_compile): New.
2597 (regexp, patsubst): Use it.
2599 2001-09-30 Gary V. Vaughan <gary@gnu.org>
2601 Reinstate the memory handling improvements from the patch I just
2602 reverted. Relevant ChangeLog entries repeated here:
2604 * m4/module.c (m4_module_remove): New function that holds the core
2605 of the old m4_module_unload.
2606 (m4_module_unload): Use it.
2607 (m4_module_unload_all): When we know the modules will never be
2608 used again (i.e. on exit), free up as much module memory as
2609 possible. There are still some artifacts from resident modules
2610 living inside ltdl.c, but everything else is freed.
2611 * m4/debug.c (m4_debug_exit): Free memory allocated in
2613 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
2614 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
2615 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
2616 * m4/m4module.h: Updated prototypes.
2617 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
2618 * m4/hash.h: Updated prototypes.
2619 * src/main.c (main): Use all these new functions to clean up as
2620 much memory as possible before exit.
2622 2001-09-30 Gary V. Vaughan <gary@gnu.org>
2624 Reverted my large patch for removing the old m4_symbol
2625 structure on 2001-09-20. We are still not happy about the way
2626 trace works in conjunction with defn and undefine, and leaving
2627 the reverted patch active prevents us from moving the traced
2628 bit from the definition back to the symbol.
2630 2001-09-30 Gary V. Vaughan <gary@gnu.org>
2632 * configure.in: Moved to...
2633 * configure.ac: ...here. Added a libtool like timestamped
2634 banner, and tidied up the libltdl cruft.
2635 * config/mkstamp: Script to extract a timestamp from ChangeLog.
2636 * modules/Makefile.am (INCLTDL): Removed. This is required
2637 only when libltdl is configured in a subdirectory.
2638 * src/Makefile.am: Ditto.
2639 (LIBADD_DL): No need to add this again, libtool already knows
2640 that libm4.la depends on it.
2641 * m4/Makefile.am: Automake sets variables from AC_SUBST. Use
2644 * TODO: stackovf.c is basically broken.
2645 Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
2647 2001-09-28 Akim Demaille <akim@epita.fr>
2649 * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
2651 2001-09-27 Akim Demaille <akim@epita.fr>
2653 * tests/m4.in: Don't use short options.
2654 Simplify the stderr signature normalization.
2656 2001-09-27 Akim Demaille <akim@epita.fr>
2658 tests/m4 shall be position independent.
2662 * tests/testsuite.at: No args to AT_INIT.
2663 * configure.in, tests/Makefile.am: Adjust.
2665 2001-09-22 Akim Demaille <akim@epita.fr>
2667 Autotest has changed again.
2669 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
2670 (package.m4): Remove.
2671 * configure.in: Adjust to LIBADD_GMP.
2673 2001-09-21 Gary V. Vaughan <gary@gnu.org>
2675 * config/gmp.m4 (AC_ARG_WITH): Removed.
2676 (GMP_LIB): Renamed to LIBADD_GMP for consistency.
2677 (AC_LIB_GMP): When performing a test compile against libgmp,
2678 include the header gmp.h if possible, and link against -lgmp. If
2679 they both work define USE_GMP.
2680 * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
2681 (mpeval_LTX_init_func): Complain on load that there was no libgmp
2684 2001-09-20 Gary V. Vaughan <gary@gnu.org>
2686 * m4/evalparse.c: Moved to...
2687 * modules/evalparse.c: ...here. This code is shared between
2688 modules/mpeval.c and modules/m4.c, so there is no need to pollute
2689 the libm4 API with its details. Moderately rewritten to interface
2690 into its clients more simply.
2691 * m4/eval.c: Deleted. Migrated functionality to...
2692 * modules/m4.c: ...here.
2693 (builtin_eval): Implemented in terms of the new interface style.
2694 * modules/mpeval.c (builtin_mpeval): Ditto.
2695 * m4/m4module.h: Removed references to the former m4/eval.c.
2696 * m4/Makefile.am (libm4_la_SOURCES): Removed eval.c.
2697 (EXTRA_libm4_la_SOURCES): Deleted.
2698 * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
2699 (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
2701 2001-09-20 Akim Demaille <akim@epita.fr>
2703 * config/gmp.m4 (AM_WITH_GMP): Rename as...
2705 By default, use gmp.
2707 * configure.in: Adjust.
2708 Use Automake conditionals for USE_GMP.
2709 Always compute sizeof (long long int).
2710 This was a bug BTW, as `eval' (not `mpeval') depends on it:
2711 before, it was used _only_ if mpeval was not activated.
2712 * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
2713 (mpeval_la_LIBADD): New macros.
2714 * modules/mpeval.c: No longer be conditioned by WITH_GMP.
2716 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
2717 * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
2720 2001-09-20 Akim Demaille <akim@epita.fr>
2722 * tests/Makefile.am (package.m4): New.
2723 * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
2725 2001-09-20 Gary V. Vaughan <gary@gnu.org>
2727 More cleanup. After the last patch, m4_symbol holds nothing but
2728 the head of a chain of m4_token_data. So I have removed the old
2729 m4_symbol, so that m4_token_data chains are stored directly in the
2730 value cell of a hash table node. But there's more... m4_symbol
2731 was a more natural name for the symbol value cell, and now that it
2732 is gone I have renamed the former m4_token_data structure to
2733 m4_symbol. This change turned out to be a pig to get right, since
2734 the original code didn't need to modify the value cell itself,
2735 since changing the chain happened inside the m4_symbol that used
2736 to be returned -- I had to pass the address of the value cell
2737 across various function calls, incase the head value changed. I
2738 also tightened up the memory management to help me find a nasty
2739 memory corruption bug that took me all night to track down...
2741 * m4/m4private.h (struct m4_symbol): Removed.
2742 (struct m4_token_data): Renamed to `struct m4_symbol'. Updated
2744 * m4/hash.c (m4_hash_iterator_value): Return the address of the
2745 value cell. Updated all callers.
2746 * m4/symtab.c: Took advantage of the simplification in the data
2747 structures to rewrite a lot of this file more simply. There is
2748 still some room for optimisation here, but we should tackle that
2749 systematically closer to the release.
2751 * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
2752 revealed. This version is ahead of CVS libtool until I get chance
2753 to flush my changes.
2754 * m4/module.c (m4_module_remove): New function that holds the core
2755 of the old m4_module_unload.
2756 (m4_module_unload): Use it.
2757 (m4_module_unload_all): When we know the modules will never be
2758 used again (i.e. on exit), free up as much module memory as
2759 possible. There are still some artifacts from resident modules
2760 living inside ltdl.c, but everything else is freed.
2761 * m4/debug.c (m4_debug_exit): Free memory allocated in
2763 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
2764 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
2765 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
2766 * m4/m4module.h: Updated prototypes.
2767 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
2768 * m4/hash.h: Updated prototypes.
2769 * src/main.c (main): Use all these new functions to clean up as
2770 much memory as possible before exit.
2772 2001-09-18 Gary V. Vaughan <gary@gnu.org>
2774 The `traced' flag needs to be attached to the definition of a
2775 symbol rather than the current symbol containing the definition.
2776 Implementing this showed up some long standing post 1.4 bugs in
2777 flag propogation which I also fixed.
2779 * m4/m4private.h (struct m4_symbol): Remove the traced flag.
2780 (struct m4_token_data): And add it back in here.
2781 * m4/input.c (init_macro_token): Propogate the traced flag
2783 * m4/macro.c (expand_argument): Ditto.
2784 * tests/builtins.at (trace2, trace3): New tests based on Akim's
2787 2001-09-08 Gary V. Vaughan <gary@gnu.org>
2789 * m4/m4private.h (struct m4_token_data): Simplified by removing
2790 the redundant `traced' flag, and one level of structure nesting.
2791 (M4_TOKEN_DATA_FUNC_TRACED): Removed.
2792 * m4/input.c (init_macro_token): No need to initialise removed
2794 * m4/macro.c (expand_argument): No need to copy it either.
2795 * m4/utility.c (m4_token_data_func_traced): Or provide an access
2798 * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
2799 dependant on multiple symbols with the same key, so preserving
2800 relative symbol order in each bucket during resizing is no longer
2801 required. The resize function is considerably faster as a result.
2803 * m4/m4module.h, m4/builtin.c, m4/symtab.c:
2804 s/m4_symbol_insert/m4_symbol_define/g;
2805 s/m4_builtin_insert/m4_builtin_define/g;
2806 s/m4_macro_insert/m4_macro_define/g. Updated all callers.
2808 2001-09-08 Gary V. Vaughan <gary@gnu.org>
2810 Get rid of m4_symbol_lookup_t entirely. With Akim's earlier
2811 commits, the m4_lookup_symbol dispatch function is split into
2812 specialised functions that must be called directly.
2814 * m4/m4module.h (m4_symbol_lookup_t): Removed.
2815 * m4/symtab.c (m4_lookup_symbol): Removed.
2816 (m4_symbol_builtin, m4_symbol_macro): New functions.
2817 * m4/builtin.c (m4_builtin_define): Split into...
2818 (m4_builtin_pushdef, m4_builtin_insert): ...these.
2819 (m4_macro_define): Split into...
2820 (m4_macro_pushdef, m4_macro_insert): ...these.
2821 * src/main.c (main): Set command line macros from `-D' parameters
2822 using `m4_macro_define'.
2824 2001-09-08 Gary V. Vaughan <gary@gnu.org>
2826 * m4/symtab.c (m4_symtab_remove_module_references): Renamed as
2827 this from m4_remove_table_reference_symbols().
2828 * m4/m4module.h, m4/module.c: Updated all references.
2830 2001-09-07 Akim Demaille <akim@epita.fr>
2832 * modules/stdlib.c, modules/times.c: Misc cleanups.
2834 2001-09-07 Akim Demaille <akim@epita.fr>
2836 * configure.in: We now need Autoconf 2.52e.
2837 * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
2838 and `M4_SYMBOL_DELETE'.
2839 * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
2840 * src/main.c (main): Adjust.
2842 2001-09-06 Gary V. Vaughan <gary@gnu.org>
2844 Fix the obstack.h problem once and for all! At configure time we
2845 can test for a system supplied obstack.h: depending on the
2846 result, we now generate system.h with an #include of the correct
2847 header. As a bonus, I've also added a --with-included-obstack,
2848 incase the user doesn't like the system obstack for some
2849 reason... and also we can test the shipped obstack on a system
2850 that has oe of its own. We also now need to be careful to add
2851 build directories to the include search path, since the generated
2852 system.h will be in the build tree.
2854 * configure.in (AC_CONFIG_FILES): Generate system.h from
2856 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
2857 include the system obstack header or the copy shipped with M4.
2858 Allow the user to override configure and force the build to use
2859 the shipped version.
2860 * m4/system-h.in: New file, template for...
2861 * m4/system.h: ...this. Now deleted.
2862 * m4/m4module.h: Include system.h before everything else.
2863 * src/freeze.c: Ditto.
2864 * m4/Makefile.am (dist-hook): Remove generated system.h.
2865 (INCLUDES): Check builddir for generated headers before checking
2867 * modules/Makefile.am (INCLUDES): Ditto.
2868 * src/Makefile.am (INCLUDES): Ditto.
2870 2001-09-05 Gary V. Vaughan <gary@gnu.org>
2872 * TODO: Remove the items that have been addressed already.
2874 2001-09-05 Akim Demaille <akim@epita.fr>
2876 * src/main.c (main): Standardize --version.
2878 2001-09-05 Akim Demaille <akim@epita.fr>
2880 * modules/format.c (format): Have a bigger `str'.
2882 2001-09-05 Akim Demaille <akim@epita.fr>
2884 Rationalize warnings, reporting the macro name as if it were a
2885 program name, and assertions.
2887 * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
2889 * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
2891 Use assert for internal errors.
2892 * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
2894 * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
2896 * tests/builtins.at (pushpop): Adjust.
2898 2001-09-05 Akim Demaille <akim@epita.fr>
2900 * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
2903 2001-09-05 Akim Demaille <akim@epita.fr>
2905 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
2906 * m4/macro.c, m4/symtab.c: Adjust.
2908 2001-09-05 Akim Demaille <akim@epita.fr>
2910 * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
2911 (m4_symbol_pop, m4_symbol_del): this.
2912 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
2913 (m4_symbol_popdef, m4_symbol_delete): New.
2914 (m4_lookup_symbol): Adjust.
2915 * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
2917 2001-09-05 Akim Demaille <akim@epita.fr>
2919 * m4/m4module.h (m4_symbol_lookup): Rename as...
2920 (m4_symbol_lookup_t): this.
2922 2001-09-05 Akim Demaille <akim@epita.fr>
2924 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
2926 * m4/symtab.c (m4_lookup_symbol): Adjust.
2928 2001-09-03 Gary V. Vaughan <gary@gnu.org>
2930 Bootstrap will now work with Libtool 1.4.1 or higher:
2931 * bootstrap: Remove stale autom4te.cache files when
2933 * config/Makefile.am (ACLOCAL_MACROS): Add ltdl.m4 and
2935 * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
2936 libtool.m4 directly.
2937 Run libtoolize to refresh ltmain.sh.
2938 * config/ltmain.sh: Deleted.
2939 * acinclude.m4: Deleted.
2940 * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
2942 * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
2943 implementation for the cvs impaired libtool user.
2945 2001-09-03 Akim Demaille <akim@epita.fr>
2947 * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
2949 Avoid using `default' in switch, as it hides useful compiler
2950 warnings when a case is forgotten.
2952 2001-09-03 Akim Demaille <akim@epita.fr>
2954 * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
2955 is no such thing as `WITH_MODULES'.
2957 2001-09-03 Akim Demaille <akim@epita.fr>
2959 Improve the test suite's selfcontainedness.
2961 * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
2962 (Include, Undivert): Tag the other input files.
2963 * tests/generate.awk: Catch `@comment file:'.
2964 `-I $src' is no longer needed.
2965 `next' is really like `return': the rest is skipped.
2966 Adjust to `input.m4'.
2967 (fatal): New function.
2968 * tests/foo, tests/incl.m4: Remove.
2970 2001-09-01 Gary V. Vaughan <gary@gnu.org>
2972 The shadowing mechanism and, infact, the whole symbol table
2973 implementation was creaking under the weight of the features piled
2974 on top of it. We now have a separate hash table module which will
2975 dynamically resize to keep symbol density withing good performace
2976 limits, and a new symtab module layered above it. Symbol lookups
2977 are now marginally more efficient (since the shadowed flag is no
2978 longer required) and symbol removal, such as on module unload, is
2979 considerably faster due to a reorganisation of the data structures
2982 * src/main.c (main): Don't mention `-H'.
2983 * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
2986 * m4/hash.c: New generalised dynamic hash table data structure
2988 * m4/hash.h: Public interface.
2989 * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
2990 (libm4_la_SOURCES): Add hash.c.
2991 * m4/symtab.c: More or less rewritten from scratch, within the
2992 bounds of the previous API.
2993 (m4_symtab_apply): A cleaner version of the old hack_all_symbols
2994 call. Updated all callers.
2995 * m4/m4module.c: #include <m4/hash.h>, and changed all affected
2996 declarations to reflect API changes.
2997 (M4INIT): Generate a declaration too, to avoid the warning with
2998 --enable-debug builds.
3001 * m4/utility.c (hash_table_size): Removed.
3002 (m4_dump_symbols): Rewritten to build and qsort an array of symbol
3003 names, which are then looked up by builtin_dumpdef() as necessary.
3004 This implies a small speedup in builtin_symbols(), which discarded
3005 all of the symbol info under the old call.
3006 * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
3007 shadowing is implicit in respect to the new data structures.
3008 symbol names are no longer duplicated here, they are stored in the
3009 key field of the hash table.
3010 Moved macro_args and blind_no_args...
3011 (m4_token_data): ...to here.
3012 m4/macro.c (expand_macro): Added a name argument since the symbol
3013 name is no longer copied into each struct m4_symbol. Modified all
3015 (collect_arguments): Ditto.
3016 * modules/m4.c (set_trace): Ditto.
3017 * modules/gnu.c (builtin_symbols): Updated.
3018 * src/freeze.c (produce_symbol_dump): Much improved in light of
3019 the improved symbol table layout.
3021 2001-09-01 Gary V. Vaughan <gary@gnu.org>
3023 * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
3025 (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
3026 (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
3027 SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
3028 SYMBOL_HANDLE): Ditto.
3029 * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
3030 modules/gnu.c, modules/m4.c, src/freeze.c,
3031 src/main.c: Updated all references.
3033 * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
3034 Automake 1.5 chokes on dynamic source file lists, Besides, it is
3035 already listed in m4_LDADD... how did that ever used to work?
3036 * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
3038 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
3039 Suggested by Tim Van Holder <tim.van.holder@pandora.be>
3041 * tests/m4: Don't call the m4 wrapper script with libtool, it
3042 works fine all by itself.
3044 2001-08-30 Gary V. Vaughan <gary@gnu.org>
3046 The experimental `changeword' feature never took off, and has
3047 no obvious advantages over `changesyntax' to compensate the
3048 enormous speed penalty it carries:
3049 * configure.in (ENABLE_CHANGEWORD): Removed.
3050 * m4/m4module.h (m4_set_word_regexp): Removed.
3051 * m4/m4private.h (m4_token_data): Removed original_text field.
3052 * m4/utility.c (m4_token_data_orig_text): Removed.
3053 * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
3054 * m4/macro.c: Ditto.
3055 * src/main.c: Ditto.
3056 * modules/Makefile.am (changeword.la): Removed.
3057 * modules/changeword.c: File removed.
3058 * doc/m4.texinfo: References to changeword and --word-regexp
3060 * po/POTFILES.in: modules/changeword.c removed.
3061 * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
3062 * tests/builtins.at (changeword): Test removed.
3064 2001-08-30 Akim Demaille <akim@epita.fr>
3066 * bootstrap.sh: Create aclocal.m4 instead of modifying it.
3067 This also help having a single list of m4 files: in
3069 * config/Makefile.am (STANDARD_MACROS): Rename as...
3070 (ACLOCAL_MACROS): this.
3071 (list-standard-macros): Remove.
3074 2001-08-29 Gary V. Vaughan <gary@gnu.org>
3076 In an attempt to moderate my egomania...
3077 * tests/modules.at: Remove attributions.
3079 * tests/generate.awk: When making substitutions to "@&t@", either
3080 "&" or "\&" in the substitution string argument to gsub refer back
3081 to the matched text. "@\\&t@" seems to work though, Tests 43 and
3084 2001-08-29 Akim Demaille <akim@epita.fr>
3086 * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
3087 (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
3088 (sync-lines, trace, translit, undivert, wrap): Move to...
3089 * tests/builtins.at: this new file.
3090 * tests/others.at (Discard comments, import-environment): Move to...
3091 * tests/options.at: this new file.
3093 2001-08-29 Akim Demaille <akim@epita.fr>
3095 * tests/others.at (Freezing modules)
3096 (--module-directory: absolute path, modpath2, modpath3)
3097 (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
3098 * tests/modules.at: here, new file.
3099 * tests/others.at, tests/generate.awk: Add a banner.
3100 * tests/testsuite.at: Adjust.
3101 (AT_CHECK_M4_FILTER): New, but unused.
3103 2001-08-29 Akim Demaille <akim@epita.fr>
3105 * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
3107 * tests/others.at (wrap): Inline wrap.m4.
3108 (shadow): Inline shadow.m4.
3109 (iso8859): Don't specify the path from top_srcdir, but from srcdir.
3110 * tests/m4: Simplify.
3112 2001-08-29 Akim Demaille <akim@epita.fr>
3114 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
3117 2001-08-29 Akim Demaille <akim@epita.fr>
3119 * tests/generate.awk (normalize): s/@__@/@&t@/.
3121 2001-08-28 Akim Demaille <akim@epita.fr>
3123 * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
3125 2001-08-28 Gary V. Vaughan <gary@gnu.org>
3127 * bootstrap (generate.awk): Generate test cases with new script.
3129 2001-08-27 Akim Demaille <akim@epita.fr>
3131 * tests/Makefile.am (installcheck-local): Don't use
3132 `dc_install_base' which is not visible here, but `exec_prefix'
3133 which is clearly the RT anyway.
3134 * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
3135 related to testing a now installed m4.
3136 * tests/m4: Do it here.
3138 2001-08-27 Akim Demaille <akim@epita.fr>
3140 * tests/others.at (indir): Formatting change.
3142 2001-08-27 Akim Demaille <akim@epita.fr>
3144 * tests/Makefile.am (installcheck-local): New.
3145 * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
3147 Prefer options over envvars.
3148 * src/main.c (main): First bug caught by the test suite (yeah!):
3149 --batch lacked a `break' which resulted in an accidental
3150 invocation of --discard-comments.
3152 2001-08-27 Akim Demaille <akim@epita.fr>
3154 * tests/others.at (capitalize, changeword, comments, ddivert)
3155 (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
3156 (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
3157 (sysv-args, trace, translit, undivert): Don't rely on files in
3158 examples/: AT_DATA them.
3160 2001-08-27 Akim Demaille <akim@epita.fr>
3162 Let the test suite use a wrapper around the not installed m4 to
3163 pretend it is (installed).
3165 * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
3166 such a way that m4 does not process them.
3167 * configure.in: The package name seems to be `m4', not `M4'.
3169 * tests/atlocal.in (at_package, M4): Remove.
3170 * tests/testsuite.at, tests/others.at: Use m4, not $M4.
3172 2001-08-27 Akim Demaille <akim@epita.fr>
3174 * tests/Makefile.am (CLEANFILES): Remove.
3175 (DISTCLEANFILES, clean-local): New.
3176 * examples/mktests.sh: Remove.
3178 2001-08-27 Akim Demaille <akim@epita.fr>
3180 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
3181 Don't use aclocal: it's written by hand.
3182 * aclocal.m4: m4_include all the files instead of being built by
3184 * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
3185 until it reads the traces by itself.
3186 * configure.in: Require Autoconf 2.42c as we are now using
3187 AC_CONFIG_TESTDIR instead of AT_CONFIG.
3188 Catch unexpanded `jm_' macros.
3189 * config/atconfig.m4: Remove.
3190 * config/error.m4: new.
3191 * config/Makefile.am: Ship the files included by aclocal.m4.
3192 * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
3193 (TESTSUITE_AT): this, to please Automake.
3194 (TESTSUITE): This target uses autotest/autotest.m4, not
3195 autotest/general.m4.
3196 * tests/testsuite.at: Prereq Autotest 2.52c.
3197 * examples/Makefile.am (pkgdata_DATA): Rename as...
3198 (dist_pkgdata_DATA): this.
3199 * doc/Makefile.am (man_MANS): Rename as...
3200 (dist_man_mans): this.
3202 2001-08-20 Gary V. Vaughan <gary@gnu.org>
3204 * m4/system.h [cygwin*]: Thanks to Paul Sokolovsky and
3205 Robert Collins, building on Cygwin no longer requires Windows
3206 import and export symbol decorations.
3207 * m4/m4module.h (M4_SCOPE) [cygwin*]: Deleted all occurences.
3208 * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
3209 * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
3210 * m4/error.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
3211 * m4/input.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
3212 * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
3213 * m4/output.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
3214 * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
3215 * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
3216 * configure.in (LIBM4_DLL_IMPORT) [cygwin*]: Don't set this
3218 * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
3219 * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
3221 2001-08-20 Gary V. Vaughan <gary@gnu.org>
3223 Ansify the source. Previously we had a mix, where my code was
3224 in a K&R compatible style, and the preexisting code was in ANSI
3225 style. Nothing is lost wrt release 1.4 by reverting to ANSI,
3226 and now the code base is much cleaner.
3228 * m4/system.h: Remove M4_PARAMS macro and all users. Remove
3229 VOID macro and all users.
3230 * m4/m4module.h: Ansify function prototypes and headers.
3231 * m4/builtin.c: Ditto.
3232 * m4/evalparse.c: Ditto.
3233 * m4/input.c: Ditto.
3234 * m4/macro.c: Ditto.
3235 * m4/module.c: Ditto.
3236 * m4/output.c: Ditto.
3238 * m4/symtab.c: Ditto.
3239 * m4/utility.c: Ditto.
3240 * modules/format.c: Ditto.
3241 * modules/gnu.c: Ditto.
3242 * modules/m4.c: Ditto.
3243 * modules/mpeval.c: Ditto.
3244 * src/freeze.c: Ditto.
3246 * src/main.c: Ditto.
3248 2001-08-20 Akim Demaille <akim@epita.fr>
3250 * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
3251 generated with stock 2.52.
3253 2001-08-20 Akim Demaille <akim@epita.fr>
3255 * config/atconfig.m4: New, until part of Autoconf per se.
3256 * configure.in (AT_CONFIG): Use it.
3258 * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
3259 * tests/atlocal.in: New.
3260 * tests/generate.awk: For the time being, the empty quadrigraph is
3262 * tests/others.at (changeword, gmp): Check the configuration
3263 variable against `yes'.
3264 * tests/testsuite.at (dnl): Allow it, as it's used all over the
3267 2001-08-20 Akim Demaille <akim@epita.fr>
3269 * m4/utility.c (m4_numeric_arg): Spell out the culprit.
3270 * modules/m4.c (undivert): Disable the possibility of undiverting
3271 several files at once: it is not documented, it is inconsistent
3272 with the other macros, it can be straightforwardly mocked by
3273 several invocations, and most importantly, it prevents the
3274 possibility of other kinds of extension.
3275 Use `m4_numeric_arg'.
3277 2001-08-20 Akim Demaille <akim@epita.fr>
3279 * examples/include.m4: Typo.
3280 * tests/generate.awk: Really add it.
3281 * tests/Makefile.am: Adjust.
3282 * tests/others.at (Discard comments): It sure fails without `-c'.
3283 (include, undivert): Add -I examples/.
3285 2001-08-20 Akim Demaille <akim@epita.fr>
3287 Use sprintf, not ecft and friends since it is standard, portable,
3288 simplifies the code, and since the latter is even deprecated
3289 according to the GNU libc documentation.
3291 * modules/format.c: Drop evct support.
3293 2001-08-19 Gary V. Vaughan <gary@gnu.org>
3295 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up. Don't test
3297 * configure.in: ...do it here instead.
3299 * c-boxes.el: Deleted.
3300 * m4/builtin.c: Reformat box comments to be closer to GNU
3302 * m4/debug.c: Ditto.
3304 * m4/evalparse.c: Ditto.
3305 * m4/input.c: Ditto.
3306 * m4/m4module.h: Ditto.
3307 * m4/macro.c: Ditto.
3308 * m4/output.c: Ditto.
3309 * m4/symtab.c: Ditto.
3310 * m4/utility.c: Ditto.
3311 * modules/changeword.c: Ditto.
3312 * modules/format.c: Ditto.
3313 * modules/gnu.c: Ditto.
3314 * modules/load.c: Ditto.
3315 * modules/m4.c: Ditto.
3316 * modules/modtest.c: Ditto.
3317 * modules/mpeval.c: Ditto.
3318 * modules/perl.c: Ditto.
3319 * modules/shadow.c: Ditto.
3320 * modules/stdlib.c: Ditto.
3321 * modules/time.c: Ditto.
3322 * src/freeze.c: Ditto.
3323 * src/main.c: Ditto.
3325 2001-08-17 Gary V. Vaughan <gary@gnu.org>
3327 * m4/module.c: Fixup some errors in the description comment.
3329 2001-08-17 Akim Demaille <akim@epita.fr>
3331 * tests/others.at (iso8859): Specify the path to the M4 test file.
3332 * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
3333 files in error messages.
3335 2001-08-17 Akim Demaille <akim@epita.fr>
3337 * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
3338 * tests/others.at: Adjust input files paths.
3339 * tests/atconfig.in: Set top_builddir.
3340 * tests/Makefile.am: Adjust.
3341 `testsuite' is in src, not build.
3343 2001-08-17 Akim Demaille <akim@epita.fr>
3345 * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
3346 (generate.at): Install a temporary hack until the actual
3347 generate.awk is added to the repository.
3348 * tests/atconfig.in: New.
3350 2001-08-17 Akim Demaille <akim@epita.fr>
3352 Really apply the patch ``Drop Autoconf 2.13 compatibility.''
3354 2001-08-17 Akim Demaille <akim@epita.fr>
3356 * doc/m4.texinfo: Promote proper quotation.
3358 2001-08-17 Akim Demaille <akim@epita.fr>
3360 Remove the non Autotest tests.
3362 * tests/other-tests/capitalize.test,
3363 * tests/other-tests/changeword.test,
3364 * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
3365 * tests/other-tests/debug.test,
3366 * tests/other-tests/discard-comments.m4,
3367 * tests/other-tests/discard-comments.test,
3368 * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
3369 * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
3370 * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
3371 * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
3372 * tests/other-tests/hanoi.test,
3373 * tests/other-tests/import-environment.m4,
3374 * tests/other-tests/import-environment.test,
3375 * tests/other-tests/include.test, tests/other-tests/indir.test,
3376 * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
3377 * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
3378 * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
3379 * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
3380 * tests/other-tests/modtest.test,
3381 * tests/other-tests/multiquotes.test,
3382 * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
3383 * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
3384 * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
3385 * tests/other-tests/sync-lines.m4,
3386 * tests/other-tests/sync-lines.test,
3387 * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
3388 * tests/other-tests/translit.test, tests/other-tests/undivert.test,
3389 * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
3390 * tests/other-tests/wrap.test: Remove.
3392 * tests/run-test, tests/get-them: Remove.
3393 * tests/Makefile.am: Adjust.
3395 2001-08-17 Akim Demaille <akim@epita.fr>
3397 others.at no longer depends on other-tests/.
3399 * tests/others.at (stackovf): You're actually...
3401 (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
3402 (unload.test): Keep their authorship.
3403 (discard-comments, gmp, import-environment, modfreeze)
3404 (sync-lines): Embed the input files.
3405 * tests/stackovf.test: Copy from other-tests/stackovf.test.
3406 * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
3408 2001-08-17 Akim Demaille <akim@epita.fr>
3410 * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
3411 (M4exit): Tag the exit status of the example.
3412 * tests/get-them: Adjust.
3413 * tests/generate.awk: New, based on get-them.
3414 * tests/Makefile.am: Adjust to generate `generated.at'.
3415 * tests/testsuite.at: Adjust.
3416 (AT_CHECK_M4): Don't overquote. Blush...
3418 2001-08-17 Akim Demaille <akim@epita.fr>
3420 Start using Autotest. atconfig creation is still lacking.
3422 * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
3423 * examples/reverse.m4, tests/other-tests/import-environment.m4,
3424 * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
3425 * tests/other-tests/import-environment.test: Don't check LANGUAGE
3426 as it might be `unset', or set to `C'.
3427 * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
3428 * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
3429 * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
3430 * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
3431 * tests/other-tests/shadow.test: Adjust.
3432 * tests/testsuite.at, tests/others.at: New.
3433 * tests/Makefile.am: Adjust.
3435 2001-08-17 Akim Demaille <akim@epita.fr>
3437 Drop Autoconf 2.13 compatibility.
3439 * configure.in (changeword): No need to undefine it, as anyway if
3440 it's defined, M4sugar moved it as m4_changeword.
3441 And anyway, proper quotation is enough.
3442 (m4_pattern_allow): As it exists in 2.50, just use it.
3443 (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
3444 Don't handle Gettext's duties, let it handle them.
3445 * config/gnu-obstack.m4: Use m4_pattern_allow directly.
3447 2001-08-17 Akim Demaille <akim@epita.fr>
3449 * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
3450 (m4_errprint): Use fputs.
3451 * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
3452 dumpdef are not concerned.
3453 (Dumpdef, Errprint): Emphasize their insensitivity to
3455 * doc/Makefile.am: Add `TAGS' support.
3456 (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
3458 * config/Makefile.am (MAINTAINERCLEANFILES): New.
3460 2001-08-17 Akim Demaille <akim@epita.fr>
3462 * modules/Makefile.am (ETAGS_ARGS): New.
3464 2001-08-17 Akim Demaille <akim@epita.fr>
3466 * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
3469 2001-08-17 Akim Demaille <akim@epita.fr>
3471 * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
3473 2001-08-17 Akim Demaille <akim@epita.fr>
3475 * m4/m4module.h (m4/list.h): Don't include it.
3477 2001-08-16 Gary V. Vaughan <gary@gnu.org>
3479 m4_modules are no more, we use lt_dlhandles directly and let
3480 latest libltdl features manage the list of loaded modules.
3481 * acinclude.m4: Regenerated.
3482 * m4/ltdl.c: Updated from master copy.
3483 * m4/module.c: Reimplemented to take advantage of advances in
3485 * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
3486 list with lt_dlhandle_next.
3487 (m4_builtin_find_by_func): Ditto.
3488 (m4_builtin_table_install): Use lt_dlhandle.
3489 (m4_macro_define): Ditto.
3490 (m4_macro_table_install): Ditto.
3491 m4/module.h: Prototype new module management API.
3492 (m4_modules): No longer required.
3493 (m4_module_init_t, m4_module_finish_t): POSIX namespace
3494 violations, renamed to...
3495 (m4_module_init_func, m4_module_finish_func): ...these,
3497 (M4INIT_HANDLER): Clean way to declare init functions in modules.
3498 (M4FINISH_HANDLER): And similarly for finish functions.
3499 * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
3500 -- Add indirection to the CONC macro so that arguments are
3502 * modules/modtest.c (m4_init_module): Replaced with M4INIT_HANDLER.
3503 * modules/shadow.c (m4_init_module): Ditto.
3504 Due to new init function semantics, be careful to perform the
3505 initialisation only on first load.
3506 * modules/perl.c (m4_init_module): Ditto. And Ditto.
3507 (m4_finish_module): Replaced with M4FINISH_HANDLER.
3508 Due to new finish function semantics, be careful to perform the
3509 finalisation only on first load.
3510 * m4/m4private.h (m4_module): Removed in favour of...
3511 (m4_module_data): ...structure without all the wrapper fields.
3512 Instances of this new structure are stored associated lt_dlhandles
3513 with lt_dlcaller_data_set().
3514 * m4/builtin.c (m4_builtin_define): Takes a handle argument
3515 instead of the old module argument.
3516 (m4_builtin_table_install): Ditto.
3517 * modules/load.c (m4_resident_module): Removed. This is no
3518 longer implemented as a magic symbol...
3519 * modules/m4.c (m4_resident_module): Ditto.
3520 * modules/load.c (M4INIT_HANDLER): ...the module init function now
3521 uses the ltdl api to make the module resident.
3522 * modules/m4.c (M4INIT_HANDLER): Ditto.
3523 * modules/load.c (builtin_modules): Traverse the loaded module
3524 list with lt_dlhandle_next.
3525 (builtin_load): Much simplified in light of the reimplemented
3527 * src/freeze.c (produce_module_dump): Cleaned up and optimised in
3528 light of the m4/module.c rewrite.
3529 (produce_symbol_dump): Ditto.
3530 (reload_frozen_state): Ditto.
3531 * m4/list.c, m4/list.h: Files deleted. No longer required.
3532 * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
3533 (libm4_la_SOURCES): Delete list.c reference.
3534 * m4/m4private.h (m4_token_data): Add a handle field. This
3535 eliminates many of the searches to find the handle associated with
3536 various tokens that are passed between functions.
3537 (struct m4_symbol): Removed the module field. The
3538 module association does not belong with the symbol...
3539 * m4/input.c (struct m4_builtin): ...it belongs with the builtin
3540 that the module implementation code is from. Added a handle
3542 (m4_push_macro): Add a `handle' argument. Changed all callers.
3543 (init_macro_token): Set the `handle' field for the
3545 * m4/macro.c (expand_argument): Copy the new handle field during
3547 * modules/m4.c (macro_install): Use the new handle field to
3548 optimise the search for the correct builtin structure, and pass
3549 the handle details to m4_builtin_define.
3551 2001-08-15 Akim Demaille <akim@epita.fr>
3553 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
3554 when creating `m4/obstack.h'.
3555 * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
3557 * tests/defs: Make them absolute.
3558 (CDPATH) Neutralize.
3559 * tests/gethem: Use them.
3561 2001-08-14 Gary V. Vaughan <gary@gnu.org>
3563 * config/ltmain.sh: Doh! Import again for a quoting fix that
3564 prevented any regression test from passing.
3566 * m4/m4module.h (obstack.h): Choose between installed version
3567 and shipped version based on configure tests.
3568 * src/freeze.c (obstack.h): Ditto.
3570 * acconfig.h: Removed. No longer required.
3572 * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
3573 * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
3574 them to AC_INIT and AM_INIT_AUTOMAKE.
3575 * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
3576 disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
3577 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
3578 shell variable m4_cv_func_obstack_h.
3579 * tests/defs (M4): Be more careful about relative path to libtool
3580 script and m4 binary by using $srcdir.
3582 * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
3583 optargs to the existing libltdl search path.
3584 * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
3585 * m4/ltdl.c: Updated.
3587 * config/ltmain.sh: Ditto.
3589 2001-08-11 Gary V. Vaughan <gary@gnu.org>
3591 * src/main.c (main): Add `-b' (for `batch') mode switch to force
3592 interactive mode off.
3594 2001-08-10 Akim Demaille <akim@epita.fr>
3596 * configure.in: Require Autoconf 2.52.
3597 (AC_ARG_PROGRAM): Remove, handled by Automake.
3598 (m4_getopt): Rename as...
3599 (m4_getopt_h): this.
3600 Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
3601 Undefine `changeword' only if defined.
3602 * config/gnu-obstack.m4: Require Autoconf 2.52.
3603 (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
3606 2001-08-09 Yuji Minejima <ggb01164@nifty.ne.jp>
3608 * doc/m4.texinfo: Fix some typos, and apply some small
3611 2001-08-09 Andreas Schwab <schwab@suse.de>
3613 * src/main.c (main): Fix improper uses of error (missing format
3616 2001-08-07 Akim Demaille <akim@epita.fr>
3618 Improve `make distcheck'.
3620 * configure.in: Be sure to be able to run `mkconfig.sh' when src
3622 * Makefile.am (dist-hook): Remove, as it is no longer needed.
3623 * doc/m4.texinfo (Include): Add missing blank.
3624 * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
3627 2001-08-07 Akim Demaille <akim@epita.fr>
3629 * m4/evalparse.c: A better introductory comment.
3630 * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
3631 * m4/macro.c: Adjust old comments.
3632 * modules/README: Typo.
3634 2001-08-07 Akim Demaille <akim@epita.fr>
3636 * config/gnu-obstack.m4: New.
3638 2001-08-07 Akim Demaille <akim@epita.fr>
3640 * config/Makefile.am, config/stackovf.m4: New.
3641 * configure.in, Makefile.am: Adjust.
3643 2001-04-08 Roderick Koehle <Roderick.Koehle@infineon.com>
3645 * modules/format.c (format): Formatting for %f was not
3646 interpreting the position of the decimal point correctly for
3649 2000-12-01 Gary V. Vaughan <gary@gnu.org>
3651 * TODO: Removed m4exit bug.
3652 * modules/load.c (m4_resident_module): Make this module resident.
3653 * module/m4.c (m4_resident_module): Ditto.
3654 * m4/modules.c (m4_module_load): Use new ltdl resident modules
3655 feature to mark modules as resident if they export
3656 `m4_resident_module' as TRUE.
3657 (m4_module_unload): Do not remove resident modules, and take care
3658 with symbol insertion and deletion with resident modules.
3659 * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
3660 use resident modules feature.
3662 2000-11-30 Gary V. Vaughan <gary@gnu.org>
3664 * TODO: Updated. Removed some cruft that has since been fixed
3665 or implemented. Added some more entries.
3668 * modules/README: Updated.
3669 * doc/m4.texinfo: Updated.
3671 * modules/gnu.c (builtin_functions): Make indir orthogonal to
3672 builtin, in that each is recognised as a macro only with parameters
3673 (builtin_indir): Passing 0 arguments is now an error, as with
3676 * src/main.c (usage): Added missing description of `-c' option.
3678 2000-11-29 Gary V. Vaughan <gary@gnu.org>
3680 Consolidate the myriad of dispersed test scripts into the
3681 tests subdirectory. I think I now have all the file where I
3682 want them, so there shouldn't be anymore upheaval =)O|
3684 * tests/Makefile.am: Updated to run the new tests added below.
3685 * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
3686 tests/other-tests/ddivert.test, tests/other-tests/debug.test,
3687 tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
3688 tests/other-tests/foreach.test, tests/other-tests/forloop.test,
3689 tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
3690 tests/other-tests/hanoi.test, tests/other-tests/include.test,
3691 tests/other-tests/indir.test, tests/other-tests/misc.test,
3692 tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
3693 tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
3694 tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
3695 tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
3696 tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
3697 tests/other-tests/reverse.test, tests/other-tests/shadow.test,
3698 tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
3699 tests/other-tests/translit.test, tests/other-tests/undivert.test,
3700 tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
3701 tests/other-tests/wrap.test: New tests based on the contents
3702 of the tests removed below.
3703 * examples/Makefile.am, modules/Makefile.am: Updated to
3704 reflect removed tests.
3705 * examples/defs,modules/defs: Removed.
3706 * examples/capitalize.test, examples/comments.test,
3707 examples/ddivert.test, examples/debug.test,
3708 examples/esyscmd.test, examples/exp.test,
3709 examples/foreach.test, examples/forloop.test,
3710 examples/fstab.test, examples/hanoi.test,
3711 examples/include.test, examples/indir.test,
3712 examples/misc.test, examples/multiquotes.test,
3713 examples/patsubst.test, examples/pushpop.test,
3714 examples/regexp.test, examples/reverse.test,
3715 examples/sysv-args.test, examples/trace.test,
3716 examples/translit.test, examples/undivert.test,
3717 examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
3718 modules/modpath1.test, modules/modpath2.test,
3719 modules/modpath3.test, modules/modpath4.test,
3720 modules/modtest.test, modules/shadow.test,
3721 modules/unfrozen.m4, modules/unload.test: Removed.
3723 Move the implementation of GMP support for the mpeval() builtin
3724 into a loadable module that depends on libgmp. mpeval() and
3725 eval() share a common parser, now in m4/evalparser.c; the code
3726 in m4/numb.c and m4/numb.h is now physically split between
3727 m4/eval.c (the eval() backend) and modules/mpeval.c (the
3728 mpeval() backend), rather than being differentiated by cpp
3729 macros and multiple inclusion. The mpeval module is always
3730 built but will generate an diagnostic if it is used from an
3731 installation that didn't link in the gmp library.
3732 * modules/Makefile.am: build and install the new mpeval module.
3733 * modules/mpeval.c: Now contains the former parts of m4/numb.c
3734 and m4/numb.h that are required for gmp support in mpeval().
3735 * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
3736 * m4/evalmp.c: Removed.
3737 * m4/m4module.h: Removed conditional prototype for
3739 * m4/eval.c: Rewritten. Contains the former parts of m4/numb.c
3740 and m4/numb.h that do not rely on gmp.
3741 * m4/evalparse.c: New file, contains the shared parts of the
3742 eval() and evalmp() parser implementations, and is no longer
3743 unencumbered by cpp magic to uncover the right parts.
3744 * m4/numb.h: Removed. It's former contents are split between
3745 m4/eval.c and modules/mpeval.c.
3748 * tests/other-tests/changeword.test: New test. Rudimentary
3749 testing of changeword builtin runs only if --wnable-changeword
3750 was used at configure time.
3751 * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
3752 alternation correctly. Split into two expressions to compensate.
3753 * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
3754 * modules/Makefile.am: Build changeword module.
3755 * modules/changeword.c (m4_macro_table): Define __m4_changeword__
3756 only when --enable-changeword was passed to configure.
3757 (builtin_changeword): If --enable-changeword was not used, then
3758 report that changeword() builtin has no support in m4 binary.
3760 2000-11-28 Gary V. Vaughan <gary@gnu.org>
3762 * src/main.c (main): Fixed a particularly nasty bug is
3763 user_search_path setting -- the -M flag processing must be
3764 extremely careful with search path ordering, or else the default
3765 installed module directory (possibly containing modules from a
3766 previous release) is placed earlier in the search path than any -M
3767 arguments (which are relied upon to load uninstalled modules with
3768 most of the tests in the regresion suite).
3770 * modules/load.c (builtin_load): Nasty hack to prevent adding
3771 symbols to symtab again if a module is loaded more than once.
3772 * modules/m4.c (builtin_ifelse): removed unused variable argv0.
3774 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed a
3775 possible NULL pointer dereference.
3777 * m4/module.c (m4_module_find_by_modname): Renamed from
3778 m4_module_modname_find. Fixed all references.
3779 (m4_module_find_by_builtin): New function.
3781 * modules/modfreeze.test: load the `load' module with each
3783 * src/freeze.c (produce_frozen_state): Simplified in light of
3784 module field in m4_symbol. Allow a third argument for text macros
3785 to name the originating module.
3786 (reload_frozen_state): ditto.
3787 * m4/m4module.h: Fixup prototypes.
3788 * m4/builtin.h (m4_builtin_define): Add a module argument so
3789 that symbols can be registered against the defining module.
3790 (m4_macro_define): ditto.
3791 * m4/m4private.h (m4_symbol): Make the module field const to save
3792 on casting in the rest of the code.
3793 (SYMBOL_MODULE): New macro.
3795 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
3796 symbol reference maintenance bugs when removing a symbol from the
3799 * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
3801 2000-11-27 Gary V. Vaughan <gary@gnu.org>
3803 * configure.in (m4_cv_func_obstack): A better check for whether
3804 libc has an obstack implementation.
3805 * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
3807 * configure.in (--with-modules): Changed semantics. This
3808 option is now used to list modules to be preopened.
3809 * src/m4.h: #include "ltdl.h" unconditionally.
3810 * src/main.c: Removed all dependencies on WITH_MODULES.
3811 * src/freeze.c: ditto.
3812 * modules/Makefile.am: ditto.
3813 * m4/m4.c (builtin_m4exit): ditto.
3814 * modules/modpath1.test: ditto.
3815 * modules/modpath2.test: ditto.
3816 * modules/modpath3.test: ditto.
3817 * modules/modpath4.test: ditto.
3818 * modules/modtest.test: ditto.
3819 * modules/shadow.test: ditto.
3820 * modules/unload.test: ditto.
3822 * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
3823 comes up on demand in LTLIBOBJS now.
3824 * configure.in (getopt_long): Creating and relying on a link for
3825 getopt.h on hosts with no getopt_long() of thier own works
3826 correctly now. This is necessary so that callers of getopt_long()
3827 can simply `#include <getopt.h>': the naive way of doing this
3828 would end up using our own getopt.h and the installed
3829 getopt_long(), which is asking for trouble!
3830 (obstack_init): A similar argument applies to obstack.h and
3833 * m4/ltdl.c: Upgraded to latest bleeding edge version again.
3834 On Solaris-2.5 (at least) the native dlopen implementation
3835 gets confused about m4.o when looking for module "m4". This
3836 version always looks for .la an .$lib_ext suffixed names first
3837 to work around the problem. Sigh.
3839 * po/POTFILES.in: Take account of these file movements.
3840 * src/Makefile.am (m4_SOURCES): removed eval.c.
3841 (EXTRA_m4_SOURCES): removed numb.c and numb.h.
3842 * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
3843 (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
3844 * modules/m4.c (builtin_eval): Use m4_evaluate().
3845 * m4/eval.c: Moved here from src/eval.c to facilitate
3846 implementation of eval() builtin as part of the `m4' loadable
3848 (m4_evaluate): renamed from evaluate for namespace cleanliness.
3849 * m4/numb.c: Moved here from src/numb.c, since it is #included
3850 into eval.c at compile time.
3851 * m4/m4module.h (m4_evaluate): Added prototype.
3852 * src/m4.h (evaluate): Removed prototype.
3854 2000-11-25 Gary V. Vaughan <gary@gnu.org>
3856 * modules/perl.c (builtin_perleval): Use PL_na for
3857 compatibility with perl-5.6.
3859 * src/main.c (main): It is now safe to
3860 ``m4_module_install("m4")'', without tripping over the m4
3862 * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
3863 versions having fixed the insidious module search order bug.
3865 * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
3866 supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
3868 * configure.in: Figure out whether to use the installed
3869 getopt.h or the supplied one.
3870 * src/Makefile.am: ditto.
3872 * po/POTFILES.in: List files in their new positions.
3874 * config/ltmain.sh: This needs to be checked in to match the
3875 libtool macros copied to acinclude.m4 (until a released
3876 libtool copes with m4's needs).
3877 * bootstrap: Run gettextize.
3879 2000-11-24 Gary V. Vaughan <gary@gnu.org>
3881 * AUTHORS: Added my details.
3884 * bootstrap: temporary update until released libtool catches up.
3886 * All files: Use new GNU GPL copyright blurb with current contact
3889 * configure.in (LTLIBOBJS): Use canonical code for calculation of
3892 * config: renamed acm4 directory to config to be more like
3893 other autoconfiscated packages.
3895 * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
3896 * config/debug.m4: New file implementing configure macros to add
3897 suitable debug flags to the compiler invocation.
3899 * modules/load.c: New file implementing the ``load'' and
3900 ``unload'' builtins.
3901 * tests/get-them: Set the module search directory to the modules
3902 build directory in generated tests.
3903 * modules/shadow.test: ditto.
3904 * modules/modtest.test: ditto.
3905 * modules/modpath1.test: ditto.
3906 * modules/modpath2.test: ditto.
3907 * modules/modpath3.test: ditto.
3908 * modules/modpath4.test: ditto.
3909 * modules/modtest.test: ditto.
3910 * modules/modfreeze.test: ditto.
3911 * modules/unload.test: ditto.
3913 * modules/changeword.c: New file implementing the ``changeword''
3914 builtin as a loadable module.
3915 * modules/mpeval.c: New file implementing the ``mpeval'' builtin
3916 as a loadable module.
3918 * src/main.c (main): Load the gnu module if m4 was started
3919 normally -- i.e. without the -G option.
3920 * modules/gnu.c: New file implementing a new loadable module wuth
3921 definitions for all the gnu extension builtins.
3922 * modules/format.c: Moved here from src/format.c. Now included
3925 * src/main.c (main): Load the traditional module if m4 was
3926 started in `no_gnu_extensions' mode.
3927 * modules/traditional.c: New file implementing the ``unix'' macro,
3928 required when m4 is executed in traditional mode, as a loadable
3931 * src/main.c: Renamed from m4.c to avoid confusion with
3933 (main): Always load the m4 module.
3934 * modules/m4.c: New file implementing a new loadable module with
3935 definitions for all m4 builtins that are not gnu extensions.
3937 * m4/Makefile.am: Adjusted to take new files below into account.
3938 * m4/m4module.h: Prototypes for exported functions and types moved
3939 to this directory from the src directory.
3940 * m4/m4private.h: Moved here from src/m4private.h to facilitate
3941 the migration of all builtin implementations to loadable modules.
3942 * m4/macro.c: Moved this file here from the src directory,
3943 renaming all exported symbols to use the prefix ``m4_''.
3944 * m4/builtin.c: ditto.
3945 * m4/module.c: ditto.
3946 * m4/symtab.c: ditto.
3947 * m4/debug.c: ditto.
3948 * m4/input.c: ditto.
3949 * m4/output.c: ditto.
3951 * m4/ltdl.h, m4/ltdl.c: ditto.
3952 * m4/utility.c: Odd functions moved here from files in the src
3953 directory to facilitate builtin migration.
3955 2000-08-12 Gary V. Vaughan <gary@gnu.org>
3957 * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
3958 error message, to make translators' jobs a little easier.
3959 (builtin_builtin): ditto.
3960 (builtin_traceon): ditto.
3961 (builtin_traceoff): ditto.
3962 Reported by Akim Demaille <akim@epita.fr>
3964 * m4/Makefile.am (pkgincdir): Deleted. Use automake's built in
3965 pkgincludedir instead.
3967 * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
3968 it is exported globally. Fixed all references.
3972 (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
3973 globally. Fixed all references.
3974 (DEF_LQUOTE): ditto.
3978 2000-07-28 Gary V. Vaughan <gary@gnu.org>
3983 * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
3984 (AC_OUTPUT): touch stamp-h.in, not stamp-h.
3986 * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
3987 Removed `Prev', `Next' and `Up' fields of all @nodes now that
3988 makeinfo calculates them for us, and to make any future
3989 reorganisation easier.
3990 (Frozen files): Document format version 2.
3991 `V' now takes argument `2'.
3992 `F' can take a single argument if symbol and builtin names
3993 are the same, or 3 arguments if the builtin is from a module.
3994 New `S' specification for saving syntax table contents.
3995 New `M' specification for saving loaded module names.
3996 * src/freeze.c: Implement them.
3997 * src/input.c (syntax_code): For interpreting frozen syntax
4000 * examples/Makefile.am: Add the contents of the WWW directory to
4002 * examples/WWW/Makefile: ditto,
4003 (%.htm): Compares file contents (not just sizes) to determine
4004 whether a change has occured.
4005 * examples/WWW/_header.htm: Bumped version number.
4006 * examples/WWW: Regenerated content.
4008 * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
4009 compilers comes much easier without ansi2knr.
4010 * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
4012 * m4/list.c: New generic list container type.
4013 * m4/list.h: Interface to new container type.
4014 * m4/Makefile.am (pkginc_HEADERS): Install list.h.
4015 (libm4_la_SOURCES): compile and link list.c.
4016 * src/builtin.c (builtin_tables): Use list container.
4017 * src/module.c (symtab): ditto.
4018 * src/symtab.c (symtab): ditto.
4020 * m4/system.h: New file for common preprocessor definitions.
4021 * m4/Makefile.am (pkginc_HEADERS): install system.h.
4022 * m4/error.c: Use system.h in place of inline preprocessor.
4023 * m4/error.h: ditto.
4024 * m4/module.c: ditto.
4025 * m4/module.h: ditto.
4026 * m4/xmalloc.c: ditto.
4028 * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
4030 * m4/xmalloc.c (xmalloc_exit_failure): ditto.
4032 * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
4033 it is exported globally. Fixed all references.
4035 (module_init_t): ditto.
4036 (module_finish_t): ditto.
4037 (token_data): ditto.
4038 (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
4039 it is exported globally. Fixed all references.
4040 (SYNTAX_IGNORE): ditto.
4041 (SYNTAX_SPACE): ditto.
4042 (SYNTAX_OPEN): ditto.
4043 (SYNTAX_CLOSE): ditto.
4044 (SYNTAX_COMMA): ditto.
4045 (SYNTAX_DOLLAR): ditto.
4046 (SYNTAX_ACTIVE): ditto.
4047 (SYNTAX_ESCAPE): ditto.
4048 (SYNTAX_ALPHA): ditto.
4049 (SYNTAX_NUM): ditto.
4050 (SYNTAX_ALNUM): ditto.
4051 (SYNTAX_LQUOTE): ditto.
4052 (SYNTAX_RQUOTE): ditto.
4053 (SYNTAX_BCOMM): ditto.
4054 (SYNTAX_ECOMM): ditto.
4055 (SYNTAX_VALUE): ditto.
4056 (SYNTAX_MASKS): ditto.
4074 (TOKEN_NONE): ditto.
4075 (TOKEN_STRING): ditto.
4076 (TOKEN_SPACE): ditto.
4077 (TOKEN_WORD): ditto.
4078 (TOKEN_SIMPLE): ditto.
4079 (TOKEN_MACDEF): ditto.
4081 * m4/m4module.h (voidstar): Removed in favour of `VOID' for
4082 consistency. Fixed all references.
4083 (STRING): Renamed to `m4_string' for consistency, and because if
4084 is exported globally. Fixed all references.
4085 (token_type): Renamed to `m4_token_t' for the same reasons.
4086 (token_data_type): Renamed to `m4_token_data_t' for the same
4089 * m4/m4module.h (XCALLOC): Wrapper macro which handles type
4093 (XFREE): Wrapper macro which avoids freeing NULL pointers.
4095 * m4/m4module.h (m4_macro): New type for module defined user
4097 * modules/modtest.c (m4_macro_table): Define module user macros.
4098 * modules/shadow.c (m4_macro_table): ditto.
4100 * m4/m4module.h (M4BUILTIN_HANDLER): For defining handlers
4101 declared with M4BUILTIN.
4103 * m4/xmalloc.c: Use memset if bzero is not available when
4104 emulating calloc with malloc.
4105 (xcalloc): Fallback to malloc/bzero if calloc is not available.
4106 (xfree): Added for consistency. Will not try to free NULL
4108 * src/m4.c (xfree): Deleted in favour of the above.
4109 * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
4110 linking with libdmalloc.
4111 * m4/xstrdup.c (WITH_DMALLOC): ditto.
4113 * modules/frozen.m4: New test case.
4114 * modules/unfrozen.m4: ditto.
4115 * modules/modfreeze.test: New test.
4116 * modules/unload.test: ditto.
4117 * modules/Makefile.am (EXTRA_DIST): Distribute them.
4119 * modules/modpath1.test: Don't try this test if module support is
4121 * modules/modpath2.test: ditto.
4122 * modules/modpath3.test: ditto.
4123 * modules/modpath4.test: ditto.
4124 * modules/modtest.test: ditto.
4125 * modules/shadow.test: ditto.
4127 * modules/perl.c: New module.
4128 * modules/perl.m4: Example of using it.
4129 * modules/Makefile.am (perl_la_SOURCES): Build new perl module.
4131 * src/m4.c (main): Assume interactive mode if STDIN is connected
4133 Changed startup sequence slightly so that syntax is not
4134 initialised from here when loading a frozen file.
4136 * src/builtin.c: Much improved macro definition style.
4137 * src/m4private.h: Internal structures for m4_builtin and
4138 m4_macro instances. These are not exposed to module writers.
4139 * src/module.c (module_modname_find): Find a module structure
4141 (make_macro_table): Build an internal macro table from a external
4143 (make_builtin_table): Build an internal builtin table from an
4144 external definition.
4146 * src/module.c (module_unload): Be extremely careful to remove
4147 builtins and macros that match the module being unloaded -- no
4148 longer assume that the top element can be removed incase another
4149 odule defines an identical name.
4150 * src/symtab.c (remove_table_reference_symbols): remove all symbol
4151 table entries which refer to a given builtin table.
4152 * src/builtin.c (remove_tables): Use it!
4154 2000-07-13 Thomas Tanner <tanner@ffii.org>
4156 * Makefile.am (SUBDIRS): we need modules/ for "make dist"
4157 * acm4/modules.m4: deleted
4158 * bootstrap: don't libtoolize libltdl!
4159 * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
4160 if set, enable WITH_MODULES and add modules to DLPREOPEN
4161 * examples/misc.test: redirect standard output
4162 * lib/Makefile.am: don't use DLLDFLAGS
4163 * lib/m4module.c: include necessary headers to silence GCC -Wall
4164 * lib/m4regex.c: fixes to silence GCC -Wall
4165 * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
4166 build modules conditionally
4167 * modules/shadow.c: define symbol aliases before using them
4168 * modules/test.c: define symbol aliases before using them
4169 * po/de.po: update translation
4170 * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
4171 pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
4173 * src/m4.c: initialize libltdl's preloaded symbols via
4174 LTDL_SET_PRELOADED_SYMBOLS
4175 * src/module.c: libltdl's memory management must be initialized
4176 before calling lt_dlinit!, fix warnings
4178 2000-01-18 Gary V. Vaughan <gary@gnu.org>
4180 * README: Caveat about nls not supported by dll architecture on
4183 * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
4185 * tests/Makefile.am (stamp-TESTS): now works with VPATH.
4186 * src/Makefile.am (m4_LDADD): use $(builddir) for VPATH.
4187 * modules/Makefile.am (LIBS): ditto.
4188 (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
4189 $(top_srcdir)/m4 (for only <m4module.h>).
4190 * modules/shadow.test: fixed for VPATH.
4191 * modules/modtest.test: ditto.
4192 * modules/modpath4.test: ditto.
4193 * modules/modpath3.test: ditto.
4194 * modules/modpath2.test: ditto.
4195 * modules/modpath1.test: ditto.
4197 * modules/time.test: Removed due to timezone dependence,
4198 * modules/Makefile.am (TESTS): Removed time.test.
4200 * configure.in: Use $3 of AC_DEFINE so that we can,,,
4201 * acconfig.h: Remove everything except the gettext parameters.
4202 * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
4204 * acm4/ltdl.m4: Updated to latest from libtool cvs.
4205 * acm4/modules.m4: Remove code which duplicates ltdl.m4 and
4206 increment serial number.
4208 * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
4209 src dir and immediately after libm4 is built for confidence that
4210 it doesn't rely on the src directory.
4211 (SUBDIRS): Moved doc dir to the end since helptoman.pl and
4212 makeinfo stop the build on cygwin (because they don't work).
4214 * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
4216 * m4/m4private.h: ...is not a public header, so moved to src.
4217 Add `#include <config.h>', `#define _COMPILING_M4' and
4219 * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
4220 * src/Makefile.am (noinst_HEADERS): add m4private.h.
4221 * src/builtin.c: `#include "m4private.h"' now takes care of the
4222 above. Duplicates removed.
4223 * src/debug.c: ditto.
4224 * src/eval.c: ditto.
4225 * src/evalmp.c: ditto.
4226 * src/format.c: ditto.
4227 * src/freeze.c: ditto.
4228 * src/input.c: ditto.
4230 * src/macro.c: ditto.
4231 * src/module.c: ditto.
4232 * src/numb.h: ditto.
4233 * src/output.c: ditto.
4234 * src/path.c: ditto.
4235 * stackovf.c: ditto.
4238 * po/POTFILES.in: compensate for renaming of lib/*.
4239 * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
4240 (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
4241 and then in $(top_srcdir)/lib (for eg. "m4private.h").
4242 * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
4244 * m4/m4error.h: Renamed error.h, for installation to
4245 $prefix/include/m4..
4246 * m4/m4obstack.h: Renamed obstack.h, for same reason.
4247 * m4/m4regex.h: Renamed regex.h, for same reason.
4248 * m4/m4error.c: Renamed error.c, and use #include "error.h".
4249 * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
4250 * m4/m4regex.c: Renamed regex.c, and fix #includes.
4252 * lib: moved to m4 to easily support header installation to
4254 * Makefile.am (SUBDIRS): renamed lib dir to m4.
4255 * configure.in (AC_OUTPUT): reference m4/Makefile.in.
4256 * acm4/regex.m4: Point to m4/regex.c.
4258 * examples/foreach.m4: Sanitise quoting.
4259 * examples/foreach.test: New torture test.
4260 From Akim Demaille <akim@epita.fr>
4262 2000-01-17 Gary V. Vaughan <gary@gnu.org>
4264 * src/ltdl.c: Use access() to abort doomed module load attempts
4265 if module file does not exist.
4267 * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
4268 getopt1.o will already be used if appropriate, so I moved getopt.c
4269 and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
4271 * modules/modpath1.test: Use correct filename in header line.
4272 * modules/modpath2.test: ditto.
4273 * modules/modpath3.test: ditto.
4274 * modules/modpath4.test: ditto.
4276 Without these changes lt_dlopen("test") attempts to
4277 LoadLibrary("/bin/test") on Windows, which although harmless
4278 generates a spurious error message which spoils most of the tests:
4279 * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
4280 (TESTS): s/test.test /modtest.test /
4281 (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
4282 (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
4283 * modules/modpath1.test: s/test.m4 /modtest.m4 /
4284 * modules/modpath2.test: ditto.
4285 * modules/modpath4.test: ditto.
4286 * modules/modpath3.test: s/-m test /-m modtest /
4287 * modules/shadow.m4: use {un,}loadmodule(`modtest').
4289 2000-01-16 Gary V. Vaughan <gary@gnu.org>
4291 * src/ltdl.c (find_file): Updated to new version with fixed memory
4292 allocation bug in `next'.
4293 * src/ltdl.h: updated to match.
4295 * modules/Makefile.am: Cleaned up and reordered.
4297 2000-01-16 René Seindal <rene@seindal.dk>
4299 * modules/Makefile.am (TESTS): New tests for the module system.
4301 * modules/*.test: New files.
4303 * src/m4.c (main): Added call to module_init().
4304 Treats -M and -m as the arguments -D -U and -t, ie deferred.
4306 * src/m4.h: Added declaration of module_init().
4308 * src/module.c (module_init): No longer static
4310 * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
4311 Added to shut up automake about non standard libtool library
4314 * src/module.c: Disabled DEBUG by default.
4316 * modules/README: Changed example from unload.m4 to shadow.m4
4318 * modules/shadow.m4: Renamed from unload.m4
4320 * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
4322 * src/m4.c (main): Functionality for -m and -M were reversed.
4325 2000-01-12 Gary V. Vaughan <gary@gnu.org>
4327 * doc/help2man.pl: updated to version 1.020.
4329 * lib/COPYING.LIB: updated to version 2.1.
4331 * lib/m4module.h: restructure the M4_SCOPE code to work when
4332 creating a dll which links with libm4.la and both DLL_EXPORT
4333 (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
4336 2000-01-11 Gary V. Vaughan <gary@gnu.org>
4338 Merged the following changes from my tree:
4340 1999-06-15 Gary V. Vaughan <gary@gnu.org>
4342 * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
4343 ported to compile shared libs.
4345 * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
4346 use `__declspec(dllimport)' when linking libm4.la on win32.
4347 * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
4349 * configure.in (M4OBJS): Discover whether we need the shipped
4350 implementation of getopt_long.
4351 * src/Makefile.am (m4_LDADD): Link the getopt objects into the
4352 main binary here, as opposed to the module library in lib/libm4.la.
4354 1999-06-14 Gary V. Vaughan <gary@gnu.org>
4356 * modules/README: Updated to describe the improved libltdl based
4358 * README (cygwin): Added some compilation notes for building m4
4359 correctly under cygwin.
4360 * TODO: Cleaned out the entries for the module system since they
4361 are now implemented.
4363 * *.[ch]: __P is in the compiler's reserved namespace, so replaced
4364 all instances of __P with M4_PARAMS.
4366 * lib/getdate.h: removed unreferenced file.
4368 * lib/m4private.h: New file to define the private interface to the
4369 token_data struct, which must be shared between m4module.c, and
4370 builtin.c but not exported to modules built from the installed
4371 m4module.h since it's size changes depending on compile time
4374 * src/m4.h: Lots of stuff moved to lib/m4module.h.
4376 * lib/m4module.h: New file to define the interface available when
4377 compiling m4 modules.
4378 * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
4379 necessary for module compilation into this new file.
4381 * lib/Makefile.am (include_HEADERS): install headers (renamed to
4382 avoid nameclash with other system headers) necessary for compiling
4384 (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
4385 so that modules can include the (renamed) installed headers and
4386 be guaranteed a matching implementation.
4387 * lib/m4error.h: renamed from error.h.
4388 * lib/m4obstack.h: renamed from obstack.h.
4389 * lib/m4regex.h: renamed from regex.h.
4390 * configure.in (AC_REPLACE_FUNCS): Don't look for a system
4391 implementation, simply include the shipped version
4392 unconditionally, otherwise it is hard for a module to know
4393 whether the m4obstack.h header it is using matches the
4394 implementation it ends up linking against.
4395 (jm_WITH_REGEX): Include regex into libm4 unconditionally for
4398 1999-05-18 Gary V. Vaughan <gary@gnu.org>
4400 * examples/misc.test: Don't run this test on machines which don't
4401 have a root user in /etc/passwd (e.g. cygwin).
4403 * tests/get-them (/^@example$/): Error messages might have a
4404 ``.exe'' suffix to the program name, or else use the libtool
4405 ``.libs/lt-m4'' binary, or generally have an unexpected path. All
4406 of these cases are now catered for when comparing error messages
4408 * tests/other-tests/*.test: ditto.
4409 * examples/*.test: ditto.
4411 * tests/defs (M4): use libtool execute mode.
4412 * examples/defs (M4): ditto.
4414 * tests/get-them (END): explicitly close any open file.
4415 (printthem): In a regular expression, '{' is the start of a repeat
4416 count! Use `[{]' for a literal open brace.
4417 (/^@node /): Don't use substr on a string shorter than the trim
4420 1999-05-17 Gary V. Vaughan <gary@gnu.org>
4422 * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
4424 (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
4426 2000-01-10 Andreas Schwab <schwab@suse.de>
4428 * tests/other-tests/gmp.test: Find config.sh in build directory.
4430 * configure.in: Find tests/mkconfig.sh in $srcdir.
4432 * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
4433 <signal.h> (for SUS2 compliant systems).
4435 * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
4438 2000-01-10 René Seindal <rene@seindal.dk>
4442 * TODO, NEWS: Cleaned up and updated.
4444 * src/m4.c (main): New variable exit_status for exit status in
4445 case of unreadable files. Now m4 will exit with EXIT_FAILURE if a
4446 file cannot be read instead of EXIT_SUCCESS.
4448 * src/builtin.c (m4_indir): Changed error message to help
4449 translators (from Akim Demaille <demaille@inf.enst.fr>).
4451 * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
4454 * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
4457 * src/input.c (match_input): Reordering of code, to avoid multiple
4458 calls to push_string_init() from obstack_grow(), which can happen
4459 with some compilers (found and fixed by James Bonfield
4460 <jkb@mrc-lmb.cam.ac.uk>).
4462 * src/stackovf.c: Added prototypes for ultrix.
4463 (setup_stackovf_trap): Added __P to cast.
4464 (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
4466 2000-01-09 René Seindal <rene@seindal.dk>
4468 * doc/m4.texinfo (Changequote): Added comment about changing
4469 quotes when the old quote is a part of the new.
4471 * src/builtin.c (expand_ranges): Added break after trailing dash.
4472 This caused misbehavious on some systems (found and fixed by Akim
4473 Demaille <demaille@inf.enst.fr>).
4475 * AUTHORS: Thomas Tanner included
4477 * acconfig.h: Added entry for ss_sp (see below).
4479 * configure.in (use_stackovf): Added check for stack_t with member
4480 ss_base instead of ss_sp (BSDI notably). (Reported by Paul Eggert
4481 <eggert@twinsun.com>).
4483 * doc/m4.texinfo (Frozen files): Added a simpler example for
4484 generating frozen files from several input files.
4486 1999-11-14 Paul Eggert <eggert@twinsun.com>
4488 * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
4489 lib/regex.c, lib/xmalloc.c.
4491 1999-11-10 René Seindal <rene@seindal.dk>
4493 * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
4495 * src/module.c: reindented.
4496 (module_load): return if this is a repeated load of same module.
4497 (module_init): slight change of logic to avoid repeated
4498 initialisation debug messages.
4500 * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
4501 in the distribution.
4503 * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
4504 automake warnings about missing lib prefix.
4505 (time_la_LDFLAGS): ditto
4506 (stdlib_la_LDFLAGS): ditto
4508 1999-11-10 Paul Eggert <eggert@twinsun.com>
4510 * src/m4.h: Include error.h, since our macros use error.
4511 * src/m4.c: Don't need to include error.h.
4513 1999-11-09 Paul Eggert <eggert@twinsun.com>
4515 * src/m4.h (voidstar): Define to void * if __STDC__ is defined
4516 and zero, as Solaris 7 cc does.
4517 (bcopy): Remove macro; no longer needed with new obstack.h.
4519 * src/output.c (freeze_diversions): Don't assume that a
4520 diversion size can fit in `int'. Check for diversion file
4521 size too large to be printed with `unsigned long'.
4523 * src/Makefile.am (CFLAGS): Omit -Wall.
4525 * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
4527 * src/debug.c (trace_format):
4528 Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
4530 * src/freeze.c (produce_frozen_state):
4531 Don't assume string lengths fit in int.
4533 1999-10-13 René Seindal <rene@seindal.dk>
4535 * configure.in (ALL_LINGUAS): Added Greek translation (el).
4536 (ALL_LINGUAS): Added Czech translation (cs).
4538 1999-03-30 Gary V. Vaughan <gary@gnu.org>
4540 * src/builtin.c: moved module loading functions into...
4541 * src/module.c: entirely new implementation using libltdl.
4542 * po/POTFILES.in: added src/module.c.
4543 * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
4544 are modules, not linktime libraries.
4545 (LDFLAGS): added -no-undefined -module and -avoid-version flags.
4546 * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
4547 avoidance on exported symbols.
4548 * modules/test.c (m4_macro_table, m4_init_module,
4549 m4_finish_module): ditto.
4550 * modules/time.c (m4_macro_table): ditto.
4552 * modules/time2.m4: new file which requires command line loading
4554 * src/m4.c (--load-module): dynamically load named runtime module
4555 into running executable before reading the source.
4556 (--module-directory): prepend a directory to the module search
4558 (module_init()): Do this the first time we load a module instead;
4559 if the module subsystem is broken normal m4 scripts can still run.
4560 * src/m4.h (install_builtin_table): is now exported.
4562 1999-03-26 Gary V. Vaughan <gary@gnu.org>
4564 * src/module.c: removed. No longer required.
4565 * po/POTFILES.in: removed src/module.c.
4567 * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
4568 the bootstrap script can recreate.
4569 * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
4570 * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
4571 * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
4572 * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
4573 (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
4574 * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
4575 * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
4576 * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
4578 * acinclude.m4: removed. `aclocal -I acm4' handles this much
4580 * acm4/Makefile.am (ACINCLUDE_M4): ditto.
4581 * acm4/gettext.m4: removed. It causes a multiple definition vs.
4582 the installed gettext.m4 file when running aclocal.
4584 1999-03-25 Gary V. Vaughan <gary@gnu.org>
4586 * configure.in (AM_INIT_AUTOMAKE): bumped version number to
4587 distinguish this from the last prerelease.
4588 (AC_LIBLTDL_CONVENIENCE): build libltdl as a convenience library
4589 in its own subdirectory.
4591 * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
4592 lib prefix on a module" feature.
4593 (LDFLAGS): Added `-module -avoid-version' flags to build
4594 versionless module libraries.
4595 * src/builtin.c (m4_load_module): use libltdl.
4596 (module_unload_all): use libltdl.
4597 * src/m4.c (module_init): initialise module loading on demand for
4598 better diagnostics, and so that m4 will still work even if
4599 the module code is broken.
4600 * src/m4.h (module_init): removed. No longer relevant.
4601 * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
4602 exported symbols for compatibility with dlpreopening.
4603 * modules/test.c (m4_macro_table, m4_init_module,
4604 m4_finish_module): ditto.
4605 * modules/time.c (m4_macro_table): ditto.
4607 * bootstrap: New file. Runs all the autoutils in the right order
4608 after a fresh checkout, or a make maintainer-clean.
4610 1999-02-18 Akim Demaille <demaille@inf.enst.fr>
4612 * src/builtin.c (dump_symbols): New function, factoring common
4613 content of m4_dumpdef and m4_symbols.
4614 (m4_dumpdef): Use it.
4615 (m4_symbols): New function, implementing `symbols'. Use it.
4616 * doc/m4.texinfo: Fixed missing commas after @xref, so that the
4617 file compile with modern makeinfo.
4618 (Symbols): New node, documenting symbols.
4619 (direntry): Modernize.
4621 1998-12-11 René Seindal <rene@seindal.dk>
4623 * src/builtin.c (predefined_tab): New predefined macros
4624 __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
4625 configure time options.
4627 1998-12-01 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
4629 * src/module.c (module_try_load): Don't try to be clever and
4630 overwrite argument string. Instead allocate all constructed
4631 strings locally, since they can have arbitrary lengths. Make
4632 arguments pointers to const.
4633 (module_search): Simplify due to above change.
4635 1998-11-29 René Seindal <rene@seindal.dk>
4639 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
4641 * tests/other-tests/import-environment.{m4,test}: New test.
4643 * tests/other-tests/discard-comments.{m4,test}: New test.
4645 * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
4647 * src/m4.c (main): New option -c --discard-comments.
4648 New global variable discard_comments.
4650 * src/m4.h (token_type): New TOKEN_NONE for tokens to be
4651 discarded, ie never returned from next_token().
4652 Added declaration of discard_comments.
4654 * src/input.c (next_token): Now loops until token type is not
4655 TOKEN_NONE. Comments are now given this type when comments should
4658 * doc/m4.texinfo (Invoking m4): Updated for --import-environment
4661 1998-11-28 René Seindal <rene@seindal.dk>
4663 * src/m4.c (main): New option --import-environment (no single
4666 * When configured with --with-gmp both the normal (fast) eval()
4667 and the gmp aware mpeval() are defined. To restore previous
4668 bahaviour use "define(`eval', defn(`mpeval'))".
4670 * tests/other-tests/gmp.m4: Changed to use mpeval().
4672 * src/evalmp.c: New file for compiling eval.c as gmp aware.
4673 Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
4675 * src/eval.c: Now includes "numb.c" directly. Everything in this
4676 file must by static, except evaluate(), which is changed to
4677 mp_evaluate() if USE_GMP in force.
4679 * src/numb.c: Changed to be included by eval.c instead of being
4680 compiled separately. Everything is declared static.
4682 * src/numb.h: Removed declarations of functions, as numb.c is now
4685 * src/builtin.c: Declaration of m4_mpeval() added.
4686 Inserted `mpeval' in builtin table.
4687 (do_eval): New function with common code for m4_eval and m4_mpeval.
4688 (m4_mpeval): New function for gmp version of eval.
4690 * src/m4.h: Declaration of mp_evaluate().
4692 * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
4693 (EXTRA_m4_SOURCES): Now has numb.c and numb.h
4695 * src/m4.c (main): m4 --version also shows which options were used
4696 for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
4698 1998-11-27 René Seindal <rene@seindal.dk>
4700 * Error messages now always print program name before input file
4701 name as specified by GNU coding standards. Reported by Akim
4702 Demaille <demaille@inf.enst.fr>.
4704 * doc/m4.texinfo (Include): Change due to changed error message
4708 * tests/get-them: Minor change to sed script due to changed error
4711 * src/m4.c (print_program_name): New func used to print program
4712 name, input file and line number in error (). Used as an
4713 error_print_progname handler.
4714 (reference_error): Removed.
4715 (main): Assigns error_print_progname.
4717 * src/m4.h (M4ERROR): Removed reference_error ().
4719 1998-11-25 René Seindal <rene@seindal.dk>
4721 * Updated to libtool 1.2b.
4723 * src/builtin.c (install_builtin_table): Added braces to avoid
4724 warning of ambiguous 'else'.
4726 * src/module.c: Inserted search path code from path.c modified to
4728 (module_init): Configured default path used only if M4MODPATH is
4730 (module_try_load): Now reads libMODULE.la as generated by libtool
4731 for actual module name.
4732 (module_load): Gives better error messages on failure.
4734 * src/m4.h: Added declarations of structures and functions for
4735 generic search path handling.
4737 * src/path.c: Removed all module specific code and introduced new
4738 functions of more generic search path handling.
4740 1998-11-24 René Seindal <rene@seindal.dk>
4742 * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
4743 included gettext, as <libintl.h> might not be found
4744 otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
4746 1998-11-22 René Seindal <rene@seindal.dk>
4748 * src/output.c (insert_diversion): Fixed bug that might cause m4
4749 to read from standard output! Triggered by input
4750 'divert(1)undivert(0)'. Test for divnum>0 changed to divnum>=0,
4751 so now 'undivert(0)' does nothing.
4753 1998-11-18 René Seindal <rene@seindal.dk>
4757 * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
4758 could be changed when compiling a illegal regexp, causing later
4759 use of the regexp to dump core.
4761 * src/module.c (module_load): Changed error message to conform to
4764 * src/m4.c (usage): Added message about reporting bugs.
4766 * doc/m4.texinfo (Changeword): Corrected a wrong example.
4767 (Changeword): Added note about the type of regexps used.
4769 * ltconfig, ltmain.sh: New files from Libtool 1.2.
4771 * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
4772 and AM_PROG_LIBTOOL.
4774 * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
4777 * modules/Makefile.am: Changed completely to compile modules using
4778 libtool. The modules are compiled as shared libraries, and are
4779 renamed when installed.
4781 * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
4782 USE_SHL_LOAD to HAVE_SHL_LOAD
4784 * src/builtin.c (shipout_string): Now tests for a NULL string.
4786 * src/module.c: New level of indirection around non-portable
4787 functions to load shared objects. Intended to encapsulate the non
4788 portable parts better and to reduce the number of #ifdefs in the
4791 * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
4792 directory modules/ to the distribution.
4794 1998-11-15 René Seindal <rene@seindal.dk>
4798 * modules/stdlib.c: New module `stdlib' defining some standard
4799 functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
4800 getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
4802 * src/builtin.c (shipout_string): New convenience function for
4803 builtins and modules.
4805 * src/module.c (module_load): Tentative support for
4806 shl_load/shl_findsym, but I cannot test it. Copied from MetaHTML.
4808 * Makefile.am (SUBDIRS): Directory modules added if configured.
4810 * modules/Makefile.am: Now correctly compiles and installs
4811 modules in pkglibexecdir.
4813 * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
4814 These two are now initialised by autoconf macros.
4816 * src/path.c (module_env_init): MODULE_PATH is always on the
4819 * src/Makefile.am: Now generated pathconf.h which defined the
4820 default MODULE_PATH.
4822 * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
4823 where modules are installed.
4825 * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
4826 by Brian J. Fox <bfox@datawave.net>. This change allow modules to
4827 build and install automatically, and it is prepared for other
4828 interfacec than dlopen().
4830 * src/builtin.c (predefined_tab): Added __m4_version__ for the
4831 current version of GNU m4. It is a GNU extension.
4833 1998-11-14 René Seindal <rene@seindal.dk>
4835 * tests/Makefile.am (GENERATED_TESTS): Added new
4836 generated-tests/changesy.8.test
4838 * doc/m4.texinfo (Changesyntax): Documentation for escape
4841 * src/macro.c (expand_token): Check for escaped macro call before
4842 symbol table lookup.
4844 * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
4847 * src/input.c: New static variable use_macro_escape, which is TRUE
4848 iff some character has code SYNTAX_ESCAPE
4849 (input_init): Added initialisation of use_macro_escape.
4850 (check_use_macro_escape): New function to synchronise
4851 use_macro_escape with the syntax table.
4852 (set_quotes): Added call to check_use_macro_escape()
4855 (next_token): Added new case for IS_ESCAPE.
4857 * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
4859 1998-10-13 René Seindal <rene@seindal.dk>
4863 * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
4866 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
4867 maintained tests in tests/other-tests. These currently tests for
4868 8-bit transparency, multiple precision arithmetic and sync-line
4869 output. Test for stackoverflow detection does not work.
4871 * examples/Makefile.am (TESTS): Added tests for all example files.
4873 * examples/mktests.sh: New file. Help program for creating test
4876 * tests/mkconfig.sh: New file to generate tests/config.m4 and
4877 tests/config.sh. This is for tests of configure selectable
4878 features. Picks up all set WITH_ and ENABLE_ veriables from
4881 * src/path.c (path_search): Added argument 'char **expanded_name'
4882 to return the expanded name.
4884 * src/m4.h: Added 2nd argument to declaration of path_search().
4886 * src/m4.c (main): Added 2nd argument to path_search().
4888 * src/freeze.c (reload_frozen_state): Do.
4890 * src/builtin.c (m4_undivert): Do.
4893 1998-10-11 René Seindal <rene@seindal.dk>
4895 * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
4897 * acm4/modules.m4: New file. Defines AM_WITH_MODULES.
4899 * acm4/gmp.m4: New file. Defines AM_WITH_GMP.
4901 * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
4903 * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
4905 * intl/: Updated to GNU gettext 0.10.35.
4907 * doc/m4.texinfo (Format): Documented that format is blind.
4909 * src/builtin.c (builtin_tab): Builtin format marked as blind.
4911 1998-10-07 René Seindal <rene@seindal.dk>
4915 * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
4916 .test, as the files are no longer just m4 input.
4918 * tests/get-them (FILE): Changed .m4 extension to .test.
4920 * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
4921 Otherwise quoted strings with leading whitespace first in a macro
4922 argument would be eliminated.
4924 * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
4925 (expand_argument): Do.
4927 * src/input.c (next_token): SPACE and NUM/OTHER characters are only
4928 grouped together iff both quote and comment strings are single
4929 character. Otherwise they might include a comment/quote leader.
4930 (next_token): Returns new token type TOKEN_SPACE.
4932 * src/builtin.c (push_builtin_table): New function to push a
4933 builtin_table on the stack without installing its contents.
4934 (find_builtin_by_name): Added call to push_builtin_table() if
4935 reading frozen files. Otherwise the builtins named in the frozen
4936 files could not be found.
4937 (install_builtin_table): Changed to use push_builtin_table()
4939 1998-10-04 René Seindal <rene@seindal.dk>
4943 * configure.in (ALL_LINGUAS): Added Polish pl.po
4945 1998-10-03 René Seindal <rene@seindal.dk>
4947 * Many files: Incorporated changes to implement dynamic modules.
4948 Detailed comments in src/modules.c and modules/README
4950 * src/module.c: New file, implements the OS dependant parts of
4951 dynamic module loading.
4953 * src/Makefile.am (m4_SOURCES): Added module.c
4955 * src/builtin.h: New file, declares some functions from builtin.c
4956 that are of use for other modules (shipout_int, numeric_arg,
4957 skip_space, bad_argc), and the macros ARG() and DECLARE().
4959 * src/builtin.c (install_builtin_table): New function. Each
4960 module brings in a builtin_table, which is pushed on a stack.
4961 (struct builtin_table): New struct for list of builtin_tables.
4962 (m4_loadmodule): New function to implement builtin "loadmodule".
4963 (shipout_int): No longer static, to be used by modules.
4967 (builtin_init): changed to call install_builtin_table()
4968 (find_builtin_by_name): Now searches all builtin_tables
4969 (find_builtin_by_addr): do.
4971 * src/path.c: Reorganised to allow for two search paths, one for
4972 include files and one for modules.
4974 * src/m4.h: Added declarations for new functions in module.c and
4977 * src/m4.c (main): Added call to module_init().
4979 * modules: New directory with a few demo modules.
4981 * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
4984 * configure.in: Added modules/Makefile to AC_OUTPUT.
4986 * configure.in: Added code to implement --with-modules. Tests for
4989 * acconfig.h: Added WITH_MODULES
4991 1998-10-02 René Seindal <rene@seindal.dk>
4993 * examples/Makefile.am (pkgdata_DATA): Removed special target for
4994 check and variables TESTS. These tests are now run from the
4997 * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
4998 directory. The files stay there but the tests are run from the
5001 * tests/Makefile.am (EXTRA_DIST): Added run-test.
5003 * tests/run-test: New file. Run a test manually
5005 * tests/Makefile.am, tests/get_them: Moved automatically generated
5006 tests (from the manual) to sub directory tests/gentest/. The
5007 tests/ directory had gotten a bit messy.
5009 1998-09-06 Erick Branderhorst <Erick.Branderhorst@asml.nl>
5011 * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
5012 wrap}.test: Added a few testcases.
5014 1998-08-21 Erick Branderhorst <Erick.Branderhorst@asml.nl>
5018 * lib/Makefile.am (noinst_HEADERS): regex.h added
5020 * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
5021 acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
5023 * acm4/Makefile.am: created providing rules to create
5024 $(top_srcdir)/acinclude.m4 to be used by aclocal.
5026 * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
5027 `C'. Reported by Ulrich Drepper.
5029 * Makefile.am (SUBDIRS): Removed checks directory
5030 * configure.in (AC_OUTPUT): Removed checks/Makefile
5032 * doc/m4.texinfo (Patsubst,example): @comment added to preserve
5033 the space when m4.texinfo is edited and whitespace.el is active.
5034 (Defn,example): idem.
5036 1998-08-20 Erick Branderhorst <Erick.Branderhorst@asml.nl>
5038 * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
5039 ../COPYING. ../Makefile is a file which is certainly present when
5040 test is executed in testSubDir. One can't be sure that the COPYING
5041 file is in .. or ../.. in all situations, the ../Makefile is
5044 * doc/m4.texinfo (Include): adjusted expected test output
5045 according to new tests, i.e. the input will always come from the
5046 file `in' created by the test.
5048 * tests/Makefile.am: Added three lines at the top to get
5049 esyscmd.1.test working.
5051 * tests/get-them: modified to generate clearer tests who will need
5052 less maintenance when new test examples are created in
5053 `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
5054 need the generic file `defs') shell scripts creating `in', `ok',
5055 `out' and when apropriate `okerr' and `err' in the directory
5056 `testSubDir' when executed. The compare of `ok' and `out'
5057 (and of `okerr' and `err') will be the exit status of the test.
5058 `out' must match `ok' (and `okerr' must match `err') for the test
5061 * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
5062 the tests generated by tests/get-them getting it input normally
5063 from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
5064 (dot) before the numeric part) is reserved for all other (hand
5065 written) tests. The `+' means one or more times.
5067 1998-08-12 Erick Branderhorst <Erick.Branderhorst@asml.nl>
5069 * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
5070 supported short man page to refer to info documentation
5071 * helptoman.pl: added
5072 * configure.in: AC_PATH_PROG(PERL,perl)
5073 * Makefile.am (SUBDIRS): doc after src
5075 * libitized with libit 0.5 from
5076 ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
5078 * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
5079 * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
5080 replacement functions, (libm4_a_LIBADD): @LIBOBJS@
5081 * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
5083 * configure.in (AC_CHECK_FUNC): getopt_long
5085 * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
5087 * TODO: added entry about dependencies
5089 1998-08-10 René Seindal <rene@seindal.dk>
5093 * doc/m4.texinfo (Changesyntax): Added documentation for the macro
5096 * src/builtin.c (m4_changesyntax): Added builtin macro
5097 "changesyntax" to modify the syntax table.
5099 * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
5100 table. All categories are assigned a syntax code and tokens are
5101 read according to this table.
5103 1998-08-09 René Seindal <rene@seindal.dk>
5105 * src/numb.{c,h}: New files, implements multiple precision eval
5106 using GNU gmp. Originally submitted by John Gerard Makecki
5107 (johnm@vlibs.com), later modified. Tested with GNU gmp 2.0.2.
5109 * doc/m4.texinfo (Eval): Added documentation for multiple
5110 precision arithmetic library support.
5112 * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
5113 to accommodate multiple precision eval.
5115 1998-08-07 René Seindal <rene@seindal.dk>
5117 * src/input.c (MATCH, match_input), src/m4.h: changed definition
5118 of comment and quote strings to `unsigned int' to allow eight bit
5119 chars (reported by andrewb@zip.com.au (Andrew Bettison)).
5121 * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
5122 patch from Mike Howard <mike@clove.com>
5124 1998-08-06 René Seindal <rene@seindal.dk>
5126 * gettext.m4: corrected AM_WITH_NLS to handle use of installed
5129 1998-08-03 René Seindal <rene@seindal.dk>
5133 * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
5134 and _ macro. M4 now builds with --disable-nls.
5136 * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
5137 to look for right message catalogs. Call indef'ed by ENABLE_NLS.
5139 * configure.in (ALL_LINGUAS): Added complete list of translations:
5140 de fr it ja nl ru sv.
5142 1998-05-22 Erick Branderhorst <Erick.Branderhorst@asml.nl>
5146 * src/m4.c: #include <signal.h> not <sys/signal.h>.
5148 * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
5150 * checks/Makefile.am: explicit list tests in CHECKS.
5152 * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
5153 src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
5154 mkinstalldirs, install-sh: Added automake (1.3) support.
5156 * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
5157 obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
5158 Used libitize (0.4) to update.
5160 * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
5161 (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
5164 * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
5165 stack overflow functionality.
5167 1994-12-03 François Pinard <pinard@iro.umontreal.ca>
5171 * Makefile.in (realclean-local): Delete stamp-h.in.
5173 * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
5174 Localize, adapting from how it is done in sharutils.
5176 * fr.tt: New file, for French.
5178 * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
5179 src/freeze.c: Rename PRODUCT to PACKAGE.
5181 1994-11-26 François Pinard <pinard@iro.umontreal.ca>
5183 * configure.in: Check for <libintl.h> and <locale.h>.
5184 * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
5185 src/stackovf.c: Rename _ to __P.
5186 * src/m4.h: Declare _ as a macro returning its argument, or else,
5187 include <libintl.h> and declare _ as gettext.
5188 * src/m4.c: Possibly include <locale.h> and call setlocale.
5189 * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
5190 src/input.c, src/macro.c, src/output.c, src/path.c,
5191 src/stackovf.c, src/symtab.c: Use _ macro over all localizable
5194 1994-11-07 François Pinard <pinard@iro.umontreal.ca>
5196 * doc/Makefile.in (stamp-vti): Use new -r option to date.
5198 * configure.in: Put --with-gmp in place, in prevision for John
5200 * acconfig.h: Document WITH_GMP.
5202 1994-11-05 François Pinard <pinard@iro.umontreal.ca>
5206 * doc/Makefile.in (realclean): Also remove stamp-vti.
5207 Reported by Eric Backus.
5209 1994-11-02 François Pinard <pinard@iro.umontreal.ca>
5211 * src/freeze.c (produce_frozen_state): If the frozen file cannot
5212 be opened, return immediately after producing the error message.
5213 Reported by Andreas Schwab.
5215 * configure.in: Check for const only after having found possible
5216 ANSIfying compiler flags, this is of no use to check it before.
5217 Reported by Alexander Lehmann.
5219 1994-11-01 François Pinard <pinard@iro.umontreal.ca>
5221 * src/macro.c (collect_arguments): Cast obstack arguments to
5222 (voidstar), so avoiding compiler warnings.
5223 Reported by Joseph E. Sacco.
5225 * src/freeze.c (produce_frozen_state): Cast printed lengths to
5226 (int) so they correspond to %d format items.
5227 Reported by Joseph E. Sacco.
5229 * src/m4.c (main): Cast the argument to xfree to (voidstar).
5230 * src/symtab.c (free_symbol): Idem.
5231 Reported by Karl Vogel.
5233 1994-10-31 François Pinard <pinard@iro.umontreal.ca>
5235 * Makefile.in (DISTFILES): Distribute BACKLOG.
5237 * configure.in: Define PRODUCT and VERSION.
5238 * acconfig.h: Document PRODUCT and VERSION.
5239 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
5240 constant string m4 and variable or parameter named version.
5242 1994-10-30 François Pinard <pinard@iro.umontreal.ca>
5244 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
5245 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
5246 defines __STDC__ to 0, for indicating it is *not* ANSI!
5247 Reported by Kaveh R. Ghazi.
5249 * configure.in: Added obsolescent tests for AIX and Minix.
5251 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
5252 which texclean does not exist anymore.
5253 Reported by Eric Backus, Jim Meyering, John David Anglin and
5256 1994-10-29 François Pinard <pinard@iro.umontreal.ca>
5258 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
5259 Reported by John David Anglin.
5261 * src/ansi2knr.c: New version, sent by Peter Deutsch.
5262 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
5263 ANSI2KNR, depending on the fact the compiler is ANSI or not.
5264 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
5265 Remove the sed filter after ansi2knr for debug.c. Use $O instead
5266 of $U, put underline in extensions rather than in basenames. Use
5267 implicit rules, now that regularity makes this possible.
5268 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
5269 of ansi2knr whenever it is needed.
5270 * configure.in: Adjusted for correct STACKOVF substitution.
5271 * src/debug.c (trace_format): When not __STDC__, use (...) as a
5272 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
5273 Reported by David MacKenzie.
5275 * Makefile.in: Remove binprefix. Use transform_name instead.
5276 Reported by David MacKenzie.
5278 * doc/Makefile.in: Create version.texi, use it, clean it.
5279 Reported by Jim Meyering.
5281 1994-10-28 François Pinard <pinard@iro.umontreal.ca>
5283 * Makefile.in (all, install, uninstall): Depend on Makefile.
5285 * Makefile.in: For actions invoking $(MAKE) from within compound
5286 sh statements, exit non-zero if the sub-make fails. Otherwise,
5287 the top-level make may exit successfully when it should fail.
5288 Reported by Jim Kingdon.
5290 * {,/*}Makefile.in: Use && after all cd, in case they fail.
5292 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
5293 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
5294 * configure.in: Substitute PRODUCT and VERSION.
5296 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
5298 1994-10-27 François Pinard <pinard@iro.umontreal.ca>
5300 * Makefile.in (mostlyclean-local): Do not remove *~.
5301 * */Makefile.in (mostlyclean): Idem.
5302 Reported by Robert E. Brown and Richard Stallman.
5304 1994-10-09 François Pinard <pinard@iro.umontreal.ca>
5306 * src/m4.h: Get rid of CONFIG_BROKETS.
5308 1994-10-02 François Pinard <pinard@iro.umontreal.ca>
5310 * configure.in: Use AC_ARG_PROGRAM.
5311 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
5312 Reported by David MacKenzie.
5314 1994-10-01 François Pinard <pinard@iro.umontreal.ca>
5316 * configure.in: Do not add -O to CFLAGS for GNU C, now that
5317 configure does it automatically.
5318 Reported by Jim Meyering.
5320 1994-09-23 François Pinard <pinard@iro.umontreal.ca>
5322 * src/stackovf.c: Declare the handler_t typedef earlier in the
5323 code, use it for stackovf_handler.
5324 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
5325 casting sigsegv_handler.
5326 Reported by Robert Bernstein.
5328 * src/m4.c (main): Initialize program_name to argv[0] without
5330 Reported by Karl Berry.
5332 1994-09-18 François Pinard <pinard@iro.umontreal.ca>
5334 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
5335 Reported by Karl Berry.
5337 1994-09-14 François Pinard <pinard@iro.umontreal.ca>
5339 * lib/Makefile.in (mostlyclean): Added.
5340 (TAGS): Make in $(srcdir).
5342 * configure.in: Use `choke me' in test, like everywhere!
5344 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
5345 unreacheable and useless.
5347 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
5349 * lib/Makefile.in (DISTFILES): Distribute TAGS.
5350 (distclean): Do not remove TAGS.
5351 (realclean): Remove it.
5352 * Makefile.in: Make TAGS in lib also, not just in src.
5353 Reported by Karl Berry.
5355 * Makefile.in (distclean, realclean): Instead of recursively
5356 calling $(MAKE) for the -local part, allow parallel execution of
5357 -recursive and -local, only delay the removal of config.status,
5358 which is repeated in both goals.
5360 1994-09-13 François Pinard <pinard@iro.umontreal.ca>
5364 * Makefile.in: Group all *clean-recursive goals in one, using sed
5365 to remove `-recursive' while calling make recursively. Also, use
5366 a subshell for each recursive $(MAKE).
5367 Reported by Jim Meyering.
5369 * src/m4.h (memcpy): Define with bcopy for BSD systems.
5370 Reported by Kaveh R. Ghazi.
5372 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
5373 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
5376 * configure.in: Use date instead of touch for stamp-h.
5377 * Makefile.in (stamp-h.in): Idem.
5379 * Makefile.in (distclean, realclean): Force serial execution of
5380 both goals, in case parallel makes are being used.
5381 Reported by Jim Meyering.
5383 * src/Makefile.in (DISTFILES): Distribute TAGS.
5384 (distclean): Do not remove TAGS.
5385 (realclean): Remove it.
5386 Reported by Karl Berry.
5388 1994-09-10 François Pinard <pinard@iro.umontreal.ca>
5390 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
5391 to old names, for following Autoconf.
5393 1994-09-08 François Pinard <pinard@iro.umontreal.ca>
5395 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
5396 ./install.sh will not be correctly referred to in sub-Makefiles.
5397 Reported by John David Anglin.
5399 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
5400 Reported by Eric Backus.
5402 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
5403 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
5404 config.status into remaking this directory's Makefile only.
5405 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
5406 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
5407 Reported by Jim Meyering.
5409 1994-09-06 François Pinard <pinard@iro.umontreal.ca>
5411 * configure.in: Correct stack overflow detection logic, taking
5412 care of systems having only incomplete implementations (like for
5413 Pyramid 9820 OSx 5.0d).
5414 Reported by Kaveh R. Ghazi.
5416 * src/Makefile.in (TAGS): Remote -t from etags call.
5418 1994-09-02 François Pinard <pinard@iro.umontreal.ca>
5420 * lib/Makefile.in (install): Depend on all.
5422 1994-08-31 François Pinard <pinard@iro.umontreal.ca>
5424 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
5425 Reported by Jim Meyering and John David Anglin.
5427 * Makefile.in (distclean-local): Delete config.log.
5428 Reported by Jim Meyering.
5430 Solidify frozen files with respect to -P:
5431 * src/m4.c: Have -P set prefix_all_buitins variable instead of
5432 calling a function by that name. Declare the variable.
5433 * src/m4.h: Adjust declaration for prefix_all_buitins.
5434 * src/builtin.c (builtin_init): Merge in functionality from
5435 previous prefix_all_buitins function, while making entries in the
5436 symbol table, but not modifying the builtin description itself.
5438 * src/freeze.c (reload_frozen_state): Add a useless `break;',
5439 because *many* compilers do not accept an empty `default:'.
5440 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
5441 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
5443 * configure.in: Use AC_TYPE_SIGNAL.
5444 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
5445 Reported by Robert Bernstein.
5447 * checks/Makefile.in (check): Modify PATH so check-them will find
5448 m4 in the src directory.
5449 * Makefile.in (check): Don't.
5450 Reported by Akiko Matsushita and Jim Meyering.
5452 * src/output.c (make_room_for, output_character_helper): New
5453 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
5454 a per buffer MAXIMUM_BUFFER_SIZE.
5456 * src/output.c (output_text): New function, for optimizing the
5457 output of strings of characters. Use it.
5459 1994-08-30 François Pinard <pinard@iro.umontreal.ca>
5461 * doc, src: New directories reorganizing the distribution.
5462 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
5464 * Makefile.in: Adjusted.
5465 * configure.in: Configure new Makefiles.
5467 * m4.h: Declare STRING typedef. Use it for comment and quote
5468 strings, adjusting all references. (This is the rudiments of a
5469 beginning for the eventual withdrawal of NUL terminated strings.)
5470 * output.c (shipout_text): Accept a length parameter, and use it.
5471 All callers adjusted.
5473 1994-08-29 François Pinard <pinard@iro.umontreal.ca>
5475 * m4.h: Include <unistd.h> if it exists.
5476 * stackovf.c: Don't.
5478 Clean up for current_diversion variable:
5479 * output.c: Move current_diversion from builtin.c.
5480 * m4.h: Declare current_diversion so builtin.c can access it.
5481 * output.c (output_init, make_diversion): Initialize or update
5483 * builtin.c (builtin_init, m4_divert): Leave current_diversion
5486 Remove limit on number of diversions:
5487 * output.c: Replace ndiversion by diversions, declare it.
5488 (output_init): Allocate only diversion 0.
5489 (make_diversion): Allocate new diversions as needed.
5490 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
5491 * m4.c: Still accept -N, but do nothing with it.
5492 Reported by David MacKenzie.
5495 * output.c (freeze_diversions): New function.
5496 * m4.h: Declare freeze_diversions.
5497 * freeze.c: Document frozen file format, revise it, call
5498 freeze_diversions to add diversions to frozen format, and code to
5499 reload them properly.
5500 * m4.c: Do not undivert automatically at end when status being
5501 frozen. Do not call builtin_init when reloading frozen state.
5503 Speed up diversion processing:
5504 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
5505 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
5506 structure and variables, cached variables out of output_diversion,
5507 reallocate_diversion_for and OUTPUT_CHARACTER.
5508 (shipout_text, make_diversion, insert_diversion): Adapted to new
5510 (insert_file): Use better buffering.
5511 Reported by David MacKenzie.
5513 1994-08-28 François Pinard <pinard@iro.umontreal.ca>
5515 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
5516 dist works from another build directory.
5518 1994-08-27 François Pinard <pinard@iro.umontreal.ca>
5520 * symtab.c (hack_all_symbols): Use hash_table_size instead of
5521 constant HASHMAX, for -H option to work better.
5523 * builtin.c (DECLARE): Simplify by using _ ().
5525 * freeze.c: New file.
5526 * Makefile.in: Compile it, distribute it.
5527 * m4.c: Recognize, document and process --freeze-state (-F) and
5528 --reload-state (-R) options. Pass a true flag to builtin_init
5529 only if no reloading some state.
5530 * builtin.c (define_builtin): Remove static specifier.
5531 (find_builtin_by_name): Remove static specifier.
5532 (builtin_init): Accept and obey a flag argument.
5533 * m4.h: Add declarations for freeze.c, changes for builtin.c.
5535 1994-08-24 François Pinard <pinard@iro.umontreal.ca>
5537 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
5540 * configure.in: Implement --with-dmalloc.
5541 * acconfig.h: Document WITH_DMALLOC.
5542 * m4.h: Add code for when WITH_DMALLOC.
5544 1994-08-15 François Pinard <pinard@iro.umontreal.ca>
5546 * m4.c (long_options): Use "error-output", the dash was missing.
5547 Reported by Akiko Matsushita.
5549 1994-08-12 François Pinard <pinard@iro.umontreal.ca>
5551 * m4.h: Include <sys/types.h>.
5552 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
5553 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
5555 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
5557 * builtin.c (dump_args): Declare len as size_t, not int.
5559 * debug.c: Prototype the forward declaration of debug_set_file.
5561 * builtin.c (m4_undivert): Replace div by file, for avoiding the
5562 shadowing of this variable.
5563 * output.c (insert_diversion): Idem.
5565 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
5566 (input_init): Duplicate default quote and comment strings.
5567 (set_quotes): Free previous quote strings in all cases. Duplicate
5568 even default quote strings.
5569 (set_comment): Free previous comment strings in all cases.
5570 Duplicate even default comment strings.
5572 * configure.in: Updated for Autoconf 2.0.
5573 * Makefile.in (distclean-local): Also delete config.cache.
5575 * m4.c (usage): Reorganize the --help output by topic. Include a
5576 description for debugging flags.
5578 1994-07-29 François Pinard <pinard@iro.umontreal.ca>
5580 * configure.in: If sigaction is available and SA_ONSTACK defined,
5581 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
5582 defined, use sigvec. Else don't compile stackovf.c.
5583 * stackovf.c (setup_stackovf_trap): Idem.
5584 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
5587 1994-07-21 François Pinard <pinard@iro.umontreal.ca>
5589 * m4.c (usage): Replace printf par fputs.
5591 1994-07-18 François Pinard <pinard@iro.umontreal.ca>
5595 1994-07-17 François Pinard <pinard@iro.umontreal.ca>
5597 * configure.in: Check for sigaction and sigvec. Add a new delayed
5598 check for RLIMIT_STACK, combine in the checking for getrlimit.
5599 All those things are not universally available.
5600 * stackovf.c: Split setting up the trap handler and catching
5601 signals, for better taking care of various configure outcomes.
5602 * examples/stackovf.sh: Correct a typo.
5603 Reported by Eric Backus, Jim Avera and Jim Meyering.
5605 1994-07-16 François Pinard <pinard@iro.umontreal.ca>
5607 * ansi2knr.c: New version sent by its author, Peter Deutsch.
5609 1994-07-15 François Pinard <pinard@iro.umontreal.ca>
5611 * Makefile.in: Modify so parallel make will not try making
5612 lib/libm4.a twice simultaneously.
5613 Reported by Jim Meyering.
5615 1994-07-14 François Pinard <pinard@iro.umontreal.ca>
5617 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
5618 error message, for when no code possibility exists. Even if this
5619 line is completely #ifdef'ed out, it brings a syntax error.
5620 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
5622 * Makefile.in (install): Have install depend on all too, for lib
5623 to be remade as needed.
5625 * examples/stackovf.sh: Try ksh, bsh and bash for shells
5626 providing ulimit, instead of using only ksh.
5627 Reported by Jim Avera and Joseph E. Sacco.
5629 1994-07-12 François Pinard <pinard@iro.umontreal.ca>
5631 * Makefile.in (check): Have it depend on all instead of m4. In
5632 this way, a change in lib will be detected and processed.
5634 * builtin.c (numeric_arg): Use strtol and verify the conversion,
5635 instead of using sscanf which stops as soon as there is a
5636 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
5637 and divert(1xyzzy) were all accepted without any warning or error
5639 * m4.h: Declare strtol as long if not including stdlib.h.
5640 * configure.in: Check for limits.h, and replace strtol if missing.
5641 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
5642 * lib/strtol.c: New file, from elsewhere.
5643 Reported by Andreas Schwab.
5645 1994-07-07 François Pinard <pinard@iro.umontreal.ca>
5647 * macro.c (expand_macro): Cast value to (boolean) prior to
5648 assigning it to traced.
5649 Reported by Tom McConnell.
5651 * Makefile.in (m4): Always make all in lib first.
5652 Reported by Jim Meyering.
5654 1994-07-06 Jim Avera <jima@netcom.com>
5656 * stackovf.c: Isolated OS-dependent sections; Improved portability,
5657 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
5658 handlers), and a default error message if the fault address is not
5659 available (when neither siginfo.h nor BSD sigcontext are supported).
5660 * configure.in: Changes for stackovf.h: Check for sigcontext,
5661 sigaction, sigstack, and define rlim_t as int if necessary.
5662 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
5663 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
5664 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
5666 1994-07-05 François Pinard <pinard@iro.umontreal.ca>
5668 * configure.in: Use AC_SET_MAKE.
5669 * Makefile.in: Use @SET_MAKE@.
5670 Reported by Jim Meyering.
5672 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
5673 Reported by Ian Taylor.
5675 1994-07-02 François Pinard <pinard@iro.umontreal.ca>
5677 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
5678 because siginfo.h is unrelated to standard headers, and siginfo.h
5679 is already checked for.
5680 Reported by Joseph E. Sacco.
5682 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
5684 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
5687 1994-06-29 François Pinard <pinard@iro.umontreal.ca>
5689 * builtin.c (substitute): Use \& to represent this part of the
5690 string which was matched by the whole regexp, instead of
5691 representing the whole string. Any usage of \0 issues a warning
5692 and acts like \&, it will disappear in some subsequent release.
5694 1994-06-27 François Pinard <pinard@iro.umontreal.ca>
5696 * m4.c: Complete prototype for forwarded declaration of usage.
5698 * input.c (init_macro_token): Correct own reference in error
5699 message. Previous name get_macro_func was referred to instead.
5700 (next_char): Correct own reference in error message. Previous
5701 name advance_input was referred to instead.
5703 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
5704 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
5705 and_term, not_term, logical_not_term, cmp_term, shift_term,
5706 add_term, mult_term, exp_term, unary_term, simple_term): Add
5707 prototype to forwarded declarations. Declare parameter v1 as
5708 eval_t * instead of int *. Same for local variable v2 in dyadic
5709 functions. Same for result in exp_term.
5710 * builtin.c (m4_eval): Declare value as eval_t instead of int.
5711 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
5712 unsigned_eval_t instead of unsigned int. Change casts accordingly.
5713 (shipout_int): Cast first argument of ntoa to eval_t.
5714 Reported by Thorsten Ohl.
5716 * macro.c: Complete the prototypes of forwarded expand_macro and
5718 Reported by Thorsten Ohl.
5720 * m4.h: Define voidstar as void * or char * depending on __STDC__.
5721 The Ultrix 3.1 compiler cannot do much with void pointers.
5723 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
5724 * m4.c (xfree): Replace void * by voidstar.
5725 Reported by Tom McConnell.
5727 * ansi2knr.1: New, from elsewhere.
5728 * Makefile.in (DISTFILES): Distribute ansi2knr.1
5730 * Makefile.in (stamp-h.in): Avoid running ./config.status if
5731 stamp-h does not exist yet. This avoids running it a second time
5732 just after the initial ./configure.
5733 Reported by David MacKenzie and Tom McConnell.
5735 * m4.h: Replace the enum debug_info declaration with a series of
5736 #define's. The Ultrix 3.1 compiler would otherwise need casting
5737 (int) to most references, when used in expressions.
5738 Reported by Tom McConnell.
5740 1994-06-25 François Pinard <pinard@iro.umontreal.ca>
5742 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
5743 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
5744 calls the compiler. Previously, FP_PROTOTYPES was only calling
5745 the preprocessor; by not being subject to CFLAGS, this was
5746 discouraging those flags asking for ANSI compilation.
5747 * acconfig.h: Document HAVE_PROTOTYPES.
5748 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
5749 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
5750 Reported by Eric Backus.
5752 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
5753 from the environment. Default CFLAGS to -g if not set.
5754 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
5755 * lib/Makefile.in: Have CFLAGS substituted from configure.
5756 Reported by Eric Backus and Tom McConnell.
5758 * configure.in: m4_undefine changeword before using AC_ENABLE.
5760 * m4.h: Declare prototypes for error (for ANSI compilers only),
5761 prefix_all_builtins and reference_error.
5762 Reported by Tom McConnell.
5764 * input.c (set_word_regexp): Do not try to initialize the array
5765 test from a string, this does not work with non-ANSI compilers.
5766 Reported by Eric Backus.
5768 * Makefile.in (dist): Clean examples/ before saving it.
5769 (distclean-local): Also remove stamp-h.
5770 Reported by Eric Backus.
5772 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
5774 Reported by Tom McConnell.
5776 * checks/Makefile.in (clean): Depends on mostlyclean.
5777 (mostlyclean): New goal.
5779 1994-06-24 François Pinard <pinard@iro.umontreal.ca>
5781 * Makefile.in (DISTFILES): Distribute install.sh.
5782 * install.sh: New file, copied from elsewhere.
5783 Reported by Assar Westerlund and Kaveh R. Ghazi.
5785 1994-06-23 François Pinard <pinard@iro.umontreal.ca>
5787 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
5788 * acconfig.h: Explain ENABLE_CHANGEWORD.
5790 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
5791 from code provided by Pete Chown]
5792 * m4.h: Add original_text field to u_t variant of union u.
5793 Declare TOKEN_DATA_FUNC macro.
5794 * builtin.c: Declare changeword.
5795 (m4_changeword): New function.
5796 * input.c: Include "regex.h", define variables with word regexps.
5797 (input_init): Initialize the word regexp.
5798 (set_word_regexp): New.
5799 (next_token): Declare local variables, use the previous code if
5800 default_word_regexp is true. Else, match using a new code. Save
5802 * macro.c (expand_token): Ship out original text if not a macro
5804 Reported by Krste Asanovic and Pete Chown.
5806 [These modifs all depend upon ENABLE_CHANGEWORD]
5807 * m4.h: Declare external user_word_regexp.
5808 * m4.c: Declare user_word_regexp, and initialize it from
5809 --word-regexp or -W, or NULL if not specified.
5810 * input.c: Use user_word_regexp if specified, instead of
5811 DEFAULT_WORD_REGEXP.
5813 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
5816 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
5817 * checks/Makefile.in: Empty the suffix list.
5818 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
5820 * m4.c: Declare nesting_limit and initialize it to 250.
5821 Implement -LNUMBER or --nesting-limit=NUMBER to change its
5823 * m4.h: Declare nesting_limit as external.
5824 * macro.c (expand_macro): Stop execution whenever nesting limit
5826 Reported by Bengt Mertensson.
5828 * eval.c (evaluate): Diagnose excess characters in eval input.
5829 Things like `eval(08)' used to return 0 with no diagnostic.
5831 * m4.h: Capitalize first letter of all macro arguments in
5834 * m4.c: Declare warning_status, initialize it to 0. Add new
5835 option -E, or --fatal-warnings, which sets warning_status to
5836 EXIT_FAILURE instead.
5837 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
5838 EXIT_FAILURE if not otherwise done by header files.
5839 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
5840 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
5841 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
5842 argument of all M4ERROR calls.
5843 Reported by Noah Friedman.
5845 * examples/incl-test.m4: Renamed from incl_test.m4.
5846 * examples/include.m4: Include incl-test.m4 instead of
5848 * examples/multiquotes.m4: Renamed from multi-quotes.m.
5850 1994-06-22 François Pinard <pinard@iro.umontreal.ca>
5852 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
5853 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
5854 also tested it on a Sun Sparc workstation running SunOS 4.x.
5856 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
5857 49.format check, abusing a `union values' argument with sprintf
5858 without selecting the proper field. Now, save the formatting type
5859 first, delaying the fetch of the corresponding argument.
5860 Reported by Joseph E. Sacco and Tom Quinn.
5862 * format.c (format): Remove const from char *fmt declaration when
5863 not HAVE_EFGCVT, because a NUL may be forced into it.
5865 * m4.h: Declare atof() when not STDC_HEADERS.
5866 Reported by Joseph E. Sacco.
5868 * Regenerate configure using Autoconf 1.11, this corrects a
5869 problem about an incorrect cpp seting on NeXT 3.1.
5870 Reported by Alexander Lehmann.
5872 1994-06-05 François Pinard <pinard@iro.umontreal.ca>
5874 * m4.h (_): Change argument from `x' to `Args'.
5876 1994-04-22 François Pinard <pinard@iro.umontreal.ca>
5878 * m4.h: Rename Args() to _().
5879 * m4.h: Remove extern specifier from all function declarations.
5881 1994-04-22 Jim Avera <jima@netcom.com>
5883 * stackovf.c: New file implementing stack-overflow detection.
5884 * configure.in: Check for getrlimit, sigaction. If all of
5885 standard headers, getrlimit and sigaction, define USE_STACKOVF and
5886 substitute ${U}stackovf.o for STACKOVF.
5887 * acconfig.h: Declare USE_STACKOVF.
5888 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
5889 * m4.h: Declare setup_stackovf_trap().
5890 * m4.c: Call setup_stackovf_trap().
5891 * tests/stackovf_test.sh: New file.
5893 1994-04-13 François Pinard <pinard@iro.umontreal.ca>
5895 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
5897 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
5899 1994-01-30 <pinard@iro.umontreal.ca>
5901 * m4.h: Remove definition of volatile, not used anymore.
5902 Reported by Jim Meyering and Joseph E. Sacco.
5904 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
5905 of `if ... else /* nothing */' for if macros.
5906 Reported by Jim Meyering.
5908 * builtin.c (m4_regexp): Reorganize the code for avoiding a
5909 warning from gcc about `repl' possibly used before defined.
5910 Reported by Jim Meyering.
5912 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
5913 Reported by Jim Meyering.
5915 1994-01-25 François Pinard <pinard@iro.umontreal.ca>
5917 * m4.h: Move the conditional definition of volatile after the
5918 inclusion of system files, because they may define it first.
5920 1994-01-04 François Pinard <pinard@iro.umontreal.ca>
5922 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
5923 get around a problem with Alpha make seeing a syntax error, there.
5924 Reported by Vern Paxson.
5926 1994-01-03 François Pinard <pinard@iro.umontreal.ca>
5928 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
5929 Reported by Richard Stallman.
5931 1993-12-25 François Pinard <pinard@iro.umontreal.ca>
5933 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
5934 instead of AC_HAVE_FUNCS.
5935 Reported by Noah Friedman.
5937 1993-12-01 François Pinard <pinard@iro.umontreal.ca>
5939 * m4.c: Initialize show_help and show_version to zero.
5941 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
5942 Use them in exit() and usage() calls.
5944 1993-11-27 François Pinard <pinard@iro.umontreal.ca>
5946 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
5947 syserr() macro. Delete errref, add reference_error and M4ERROR.
5948 * m4.c: Replace errref, which was returning an input reference
5949 string, with reference_error, which prints it on standard error.
5950 * builtin.c, output.c: Use errno as second parameter to error,
5951 instead of using syserr() with %s.
5952 * *.c: Use M4ERROR instead of error: no more errref() with %s.
5953 Doing so, the program name appears after the input reference
5954 instead of before, which eases M-x next-error processing.
5956 1993-11-24 François Pinard <pinard@iro.umontreal.ca>
5958 * checks/get-them: Escape braces with backslashes in patterns,
5959 because HPUX-9.01 awk needs this.
5960 Reported by Jim Meyering.
5962 1993-11-22 François Pinard <pinard@iro.umontreal.ca>
5964 * builtin.c: Declare "FILE *popen ();".
5966 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
5967 macros, replace error_message_prefix() declaration by errref()'s.
5968 Declare xrealloc, for use in errref().
5969 * m4.c: Delete error_message_prefix() function, add errref().
5970 * *.c: Use error() systematically in place of all error macros,
5971 now that error() flushes stdout first. Make needed adjustments.
5973 * m4.h: Remove const in sys_errlist[] declaration, it creates
5974 conflicts on SGI and Alpha.
5975 Reported by Kaveh R. Ghazi.
5977 1993-11-20 François Pinard <pinard@iro.umontreal.ca>
5979 * m4.c: Include <getopt.h> instead of "getopt.h".
5981 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
5982 * acconfig.h: New, for documenting HAVE_EFGCVT.
5983 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
5984 use them wherever appropriate. Also use -I. for compilations.
5985 * lib/Makefile.in: Use -I.. for compilations.
5986 * *.c: Include <config.h> or "config.h".
5988 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
5989 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
5991 1993-11-17 François Pinard <pinard@iro.umontreal.ca>
5993 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
5995 * input.c (input_init): Initialize quote and comment strings
5996 explicitely instead of calling set_quotes and set_comment: by
5997 doing so, we ensure we do not free uninitialized variables.
5999 * checks/check-them: Reverse arguments to both diff, so the
6000 expected is on the left and the obtained on the right.
6002 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
6003 macros. Delete declarations for m4error, warning, fatal and
6004 internal_error, add declaration for error_message_prefix.
6005 * m4.c: Delete m4error, warning, fatal and internal_error
6006 routines, add error_message_prefix routine.
6007 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
6008 warning with WARNING*, fatal with FATAL* and internal_error with
6010 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
6011 this is not needed anymore.
6013 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
6014 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
6015 and debug_message, add declaration for debug_message_prefix.
6016 * debug.c: Remove static specifier for FILE *debug declaration.
6017 Delete debug_print and debug_message routines, add
6018 debug_message_prefix routine.
6019 * builtin.c, debug.c: Replace debug_print routine calls with
6020 DEBUG_PRINT* macro calls.
6021 * input.c, path.c: Replace debug_message routine calls with
6022 DEBUG_MESSAGE* macro calls.
6024 * m4.h: Remove inclusion of <varargs.h>.
6025 * debug.c: Include <stdarg.h> or <varargs.h>.
6026 (trace_format): Use stdarg instead of varargs if __STDC__.
6028 * configure.in: Remove checks for vfprintf and _doprnt. These
6029 implementations use varargs tricks which are not portable enough.
6030 * lib/vfprintf.c: Deleted.
6031 * lib/_doprnt.c: Deleted.
6032 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
6033 Reported by Joel Sherrill.
6035 * path.c (add_include_directory): Use xstrdup.
6037 * builtin.c (find_builtin_by_name): Declare static.
6039 * *.[ch]: Add const to a few "char *" declarations.
6041 * configure.in: Remove commented tests for fileno() and fstat().
6042 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
6044 * debug.c (debug_flush_files): New.
6045 * m4.h: Declares it.
6046 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
6047 Reported by Nicolas Pioch.
6049 1993-11-12 François Pinard <pinard@iro.umontreal.ca>
6051 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
6052 Reported by Joel Sherrill.
6054 * builtin.c (prefix_all_builtins): Instead of the table size, use
6055 the null entry at end for stopping the loop. It was overwritten.
6056 Reported by Andreas Schwab and Jim Meyering.
6058 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
6059 Reported by Kaveh R. Ghazi.
6061 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
6062 Reported by Karl Vogel.
6064 1993-11-09 François Pinard <pinard@iro.umontreal.ca>
6066 * m4.h: Do not define volatile if already defined.
6067 Reported by René Seindal.
6069 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
6071 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
6072 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
6074 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
6076 * m4.h: Define strchr and strrchr in terms of index and rindex,
6077 instead of the other way around.
6078 * builtin.c, m4.c, path.c: Use strchr instead of index.
6080 * input.c (next_char): Remove a "break;" after a "return ...;".
6081 Reported by Tom McConnell.
6083 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
6087 * configure.in: Do not copy check files in the build hierarchy.
6088 * checks/check-them: Identify the m4 version being checked. For
6089 finding m4, look in $PATH instead of in the parent directory.
6090 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
6091 * checks/Makefile.in (.all-stamp): Always create check files in
6092 the source hierarchy, not anymore in the build hierarchy.
6093 (check): cd to the source hierarchy before performing checks.
6094 Do not copy nor clean COPYING anymore, take it from `..'.
6095 Reported by Tom McConnell.
6097 * Makefile.in (Makefile): Use $(SHELL).
6098 (config.status): Use $(SHELL). Use "config.status --recheck"
6099 instead of "configure --no-create", which is obsolete.
6100 Reported by Tom McConnell.
6102 1993-11-05 François Pinard <pinard@iro.umontreal.ca>
6104 * m4.c (usage): Use "%s" instead of "m4" in format string.
6105 Reported by Jim Meyering.
6107 * Makefile.in: Distribute mkinstalldirs.
6108 Reported by Pierre Gaumond.
6109 Reported by Jim Meyering.
6110 Reported by Tom McConnell.
6111 Reported by Andreas Gustafsson.
6113 * checks/check-them: Renamed from checks/check_them.
6114 * checks/get-them: Renamed from checks/get_them.
6115 * checks/.all-stamp: Renamed from checks/.all_stamp.
6116 * checks/Makefile.in: Changed accordingly.
6117 Reported by Jim Meyering.
6119 1993-11-04 François Pinard <pinard@iro.umontreal.ca>
6121 * lib/Makefile.in (dist): Correct permissions on files.
6123 * output.c: Declare tmpfile, some systems don't.
6125 1993-11-03 François Pinard <pinard@iro.umontreal.ca>
6127 * checks/Makefile.in (dist): Correct permissions on files.
6129 * Makefile.in (dist): Ensure recursive linking for subdirectory
6130 `examples', also set read/write permissions on all its files.
6132 * mkinstalldirs: New, from elsewhere.
6133 * Makefile.in: Use it.
6135 * debug.c: Synchronize debug messages and regular output when
6136 the debug file and stdout are redirected to the same file.
6137 * configure.in: Add (commented) checks for fileno and fstat.
6138 Reported by Jim Avera.
6140 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
6141 etc., arguments, then ignore the superfluous one. m4 used to
6142 diagnose missing arguments and return the empty string.
6143 Reported by Nick S. Kanakakorn.
6145 1993-11-02 François Pinard <pinard@iro.umontreal.ca>
6147 * m4.c (main): At end of all input, ensure all undiverted text
6148 goes to the main output stream.
6149 Reported by Andreas Gustafsson.
6151 * m4.c (main): exit (0), instead of return 0.
6153 * m4.c: Implement -P and --prefix-builtins.
6154 * builtin.c: Delete const specifier on builtin_tab.
6155 (prefix_all_builtins): New.
6156 Reported by Noah Friedman.
6157 Reported by Scott Bartram.
6159 * c-boxes.el: New, from elsewhere.
6160 * Makefile.in: Distribute it.
6162 * m4.h: Do not define bcopy if <string.h> defines it.
6163 Reported by Stephen Perkins.
6165 * builtin.c (define_macro): Allow a missing second argument, in
6166 which case it is implied empty. Affects define and pushdef.
6167 Reported by Eric Allman.
6169 1993-11-01 François Pinard <pinard@iro.umontreal.ca>
6171 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
6172 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
6173 * builtin.c: Initialize all the blindness fields in builtin_tab.
6174 (define_builtin): Copy the blindness of a builtin into its symbol.
6175 * macro.c (expand_token): Avoid processing a blind builtin if the
6176 next character is not an opening parenthesis.
6177 Reported by David MacKenzie.
6178 Reported by Noah Friedman.
6180 * configure.in: Ensure an exit status of 0 on completion.
6181 Reported by Vivek P. Singhal.
6183 * eval.c (eval_lex): Admit both lower and upper case letters for
6184 bases greater than 10. Only lower case letters were accepted.
6186 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
6187 Reported by Krste Asanovic.
6189 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
6190 * eval.c (logical_not_term): New name for not_term.
6191 * eval.c (xor_term): New, between or_term and and_term.
6192 * eval.c (not_term): New, between and_term and logical_not_term.
6193 * eval.c (shift_term): New, between cmp_term and add_term.
6194 Reported by Krste Asanovic: ~, ^, <<, >>.
6195 Reported by Ben A. Mesander: ** vs ^.
6197 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
6198 * m4.h: Delete xrealloc.c.
6199 * lib/xmalloc.c: New, from elsewhere.
6200 * lib/xstrdup.c: New, from elsewhere.
6201 * lib/Makefile.in: Distribute and compile them.
6203 * m4.c: Change progname to program_name.
6204 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
6205 * lib/error.c: New, from elsewhere.
6206 * lib/Makefile.in: Distribute and compile error.c.
6207 * configure.in: Check AC_VPRINTF and for strerror.
6208 * m4.c: Delete cmd_error. Use error instead.
6209 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
6211 * m4.h: Delete #define const, let Autoconf takes care of this.
6213 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
6214 Merge parse_args into main. Declare argv to be `char *const *',
6215 then remove superfluous casts.
6217 * m4.c: Rename --no-gnu-extensions to --traditional.
6218 Reported by Ben A. Mesander.
6220 * m4.c (usage): Add a status parameter. Supply one in various
6221 calls. Add --help processing. Remove -V for --version.
6223 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
6225 * lib/Makefile.in: Have an AR=ar declaration.
6226 Reported by Eric Backus.
6227 Reported by Bjorn R. Bjornsson.
6228 Reported by Tom Tromey.
6229 Reported by Kristine Lund.
6230 Reported by Marion Hakanson.
6232 1993-10-30 François Pinard <pinard@iro.umontreal.ca>
6234 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
6235 Reported by Noah Friedman.
6237 1993-10-25 François Pinard <pinard@iro.umontreal.ca>
6239 * Makefile.in: Remove MDEFINES and cleanup.
6241 1993-06-09 François Pinard <pinard@iro.umontreal.ca>
6243 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
6246 1993-02-06 François Pinard <pinard@iro.umontreal.ca>
6248 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
6249 ensure 777 mode for directories, so older tar's will restore file
6252 1993-01-17 François Pinard <pinard@iro.umontreal.ca>
6254 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
6255 so the installer can override automatically configured choices.
6256 Reported by Karl Berry.
6258 1993-01-15 François Pinard <pinard@iro.umontreal.ca>
6260 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
6261 previous version was not working properly on m68k-hp-bsd4.3.
6262 Reported by Roland McGrath.
6264 * lib/_doprnt.c: Stolen from Oleo distribution.
6265 * configure.in: Check for _doprnt.c if vfprintf.c selected.
6266 * lib/Makefile.in: Distribute _doprnt.c.
6267 Do not distribute regex.[ch].old anymore.
6269 1993-01-01 François Pinard <pinard@iro.umontreal.ca>
6271 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
6272 Richard wants it there.
6274 1992-12-27 François Pinard <pinard@iro.umontreal.ca>
6276 * Makefile.in: Add DEFS to MDEFINES.
6277 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
6278 (libm4.a): Remove the library before creating it.
6279 (distclean): Remove tags and TAGS too.
6281 1992-12-23 François Pinard <pinard@iro.umontreal.ca>
6283 * Makefile.in (dvi, m4.dvi): New goals.
6285 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
6286 macro.c, output.c, path.c, symtab.c: Change Copyright from
6287 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
6289 * examples/divert.m4: Deleted, this bug has been corrected.
6291 * Makefile.in (texclean, mostlyclean): New goals.
6293 * Makefile.in (clean): Remove clutter from ansi2knr.
6294 Reported by Pierre Gaumond.
6296 1992-12-20 François Pinard <pinard@iro.umontreal.ca>
6298 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
6299 might well use CFLAGS is s/he needs it.
6301 * Makefile.in: Allow installation of info files from a separate
6303 Reported by Jason Merrill.
6304 Reported by David MacKenzie.
6305 Reported by Skip Montanaro.
6306 Reported by Erez Zadok.
6307 Reported by Assar Westerlund.
6309 1992-12-19 François Pinard <pinard@iro.umontreal.ca>
6312 This is still a beta release for the future GNU m4 version 1.1.
6314 * lib/alloca.c: New, from elsewhere.
6315 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
6317 * m4.h: Do not define index/rindex if already defined. If
6318 FALSE/TRUE are already defined, do not redefine them, but merely
6319 define boolean typedef to int.
6321 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
6322 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
6323 because some C compilers do not like connectives with #ifdef.
6324 * m4.h: Define `volatile' only if __GNUC__, instead of once for
6325 __GNUC__ and once for __STDC__.
6326 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
6328 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
6329 Makefile dependencies. Without it, make keeps destroying and
6330 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
6332 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
6333 to diversion/DIVERSION, this was a spelling error.
6335 * m4.c: Declare version[], remove #include "version.h".
6336 * version.h: Deleted.
6337 * Makefile.in: Remove references to version.h.
6339 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
6340 production, by using a simpler and more robust algorithm. This
6341 solves the problem of synclines sometimes written in the middle of
6342 an output line. Delete sync_line() and output_lines variable.
6343 * m4.h: Remove sync_line prototype and output_lines declaration.
6344 * input.c (next_char), output.c (shipout_text): Remove references
6346 * input.c (push_file, pop_file): Merely put the value -1 in
6347 output_current_line instead of calling sync_line, for delaying a
6348 single `#line NUM FILE' before next output line. Do not test
6349 for sync_output, because this is unnecessary clutter.
6350 * output.c (make_divertion, insert_divertion): Idem.
6351 * input.c: Rename must_advance_line to start_of_input_line, for
6354 * debug.c (trace_header): Select a new debug line format, which
6355 better complies with GNU standards for formatting error messages.
6356 With option `-dfl', M-x next-error might be used on the output.
6357 * m4.c (vmesg): Adjust format of error output to GNU standards.
6358 * m4.texinfo: Adjust examples for `make check' to work.
6360 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
6361 case for enum debug_info constants, which were all lower case.
6363 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
6365 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
6366 collected patches. I tried a few times using newer regex.[ch], it
6367 mysteriously stopped aborting with this one. Insecure feeling...
6368 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
6370 1992-12-18 François Pinard <pinard@iro.umontreal.ca>
6372 * m4.c: Change `--no-warnings' to `--silent'.
6373 Reported by David MacKenzie.
6375 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
6376 leave it off for now. See comment in m4.c for justification.
6377 Reported by David MacKenzie.
6379 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
6380 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
6382 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
6384 * Makefile.in: Ensure recursive cleaning is done before local
6385 cleaning for all clean goals.
6387 * builtin.c (ntoa): Ensure the value is always interpreted as a
6388 signed quantity, whatever the radix is.
6390 1992-11-18 Jim Meyering <meyering@idefix>
6392 * builtin.c, format.c, input.c: Split long lines.
6393 * m4.c: Use typedef macro_definition instead of struct
6395 * symtab.c: Use typedef symbol instead of struct symbol.
6397 1992-11-17 François Pinard <pinard@iro.umontreal.ca>
6399 * *.[ch]: Remove all trailing whitespace, in code and comments.
6401 * configure.in: Find some awk.
6402 * Makefile.in: Add $(AWK) to MDEFINES.
6403 * checks/Makefile.in: Transmit $(AWK) to get_them.
6404 * checks/get_them: Use $AWK instead of gawk. Add a close in the
6405 awk script when switching files, because without this, mawk runs
6406 out of file descriptors.
6408 1992-11-16 François Pinard <pinard@iro.umontreal.ca>
6410 * Makefile.in (realclean): Delete m4.info*.
6411 Reported by Jim Meyering.
6413 * Makefile.in: Adjust and link with checks/Makefile.
6414 * checks/Makefile.in: New.
6415 * configure.in: Output checks/Makefile.
6417 * checks/get_them: Have the dnl header of each test more
6418 recognizable by next-error, also use a better message.
6420 1992-11-16 Jim Meyering <meyering@idefix>
6422 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
6423 And use that only if __GNUC__ since we're using it's GCC-specific
6424 semantics that tell the compiler the associated function doesn't
6427 * builtin.c (substitute): Don't use character as an array index.
6428 (dumpdef_cmp): Make formal arguments `const void *' to avoid
6429 warnings with gcc -W -Wall on systems with qsort prototype.
6430 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
6433 * eval.c (most functions): Add parentheses to assignments used
6434 as truth values go avoid warnings from gcc -Wall.
6436 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
6437 any functions that don't need external scope.
6439 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
6440 (many functions and arrays): Declare `const'.
6442 1992-11-15 François Pinard <pinard@iro.umontreal.ca>
6444 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
6445 removing the declaration from m4.h. Also rename false to FALSE
6448 * lib/Makefile.in (Makefile): New goal.
6450 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
6451 so heavily loaded. It gets more easily overridable, calling make.
6452 Reported by Jim Meyering.
6454 * Makefile.in (dist): Get .fname from the current directory name,
6455 instead of from version.h. I need updating many files manually,
6456 when the version changes, version.h is just one of them.
6458 1992-11-14 François Pinard <pinard@iro.umontreal.ca>
6460 * m4.h: Remove the tag `boolean' on the enum introducing typedef
6461 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
6462 Reported by Tom McConnell.
6464 1992-11-13 François Pinard <pinard@iro.umontreal.ca>
6466 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
6467 39.cleardiv, which were describing missing or spurious newlines.
6468 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
6469 do not depend on machine word size, `/bin/false' implementation,
6470 or `wc' output format. `make check' is more dependable, now.
6472 * checks/check_them: Summarize the failed tests by listing their
6473 name, at end. If none, issue `All checks successful'. Output
6474 `Checking' instead of `Input file:'.
6476 * checks/get_them, checks/check_them: Reindented.
6478 * Makefile.in (dist): chmod a+r before making the tar file.
6480 1992-11-12 François Pinard <pinard@iro.umontreal.ca>
6482 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
6484 * input.c (next_token): Reinitialize token_buttom just after using
6485 it as a watermark with obstack_free. Or else, a future token, big
6486 enough for triggering reallocation of the obstack chunk, could
6487 void the initialized value of token_buttom, later causing panic in
6488 obstack_free. Rename token_buttom to token_bottom everywhere.
6490 * m4.h: Before declaring errno, first include <errno.h> and
6491 ensure that it does not define errno.
6492 Reported by Richard Stallman.
6494 1992-11-11 François Pinard <pinard@iro.umontreal.ca>
6496 * builtin.c: Define and use DECLARE macro for builtins.
6498 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
6499 argument, this is a common idiom for introducing long comments.
6501 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
6502 arguments. The last argument was silently ignored.
6504 * m4.c (cmd_error): Add a missing semicolon before va_end().
6506 1992-11-10 François Pinard <pinard@iro.umontreal.ca>
6508 * Makefile.in: Now handle protoized sources. Define and use U.
6509 Compile and use ansi2knr with old compilers. Update DISTFILES.
6510 Add `aclocal.m4' to `configure' dependencies.
6511 * ansi2knr.c: New, from Ghostscript distribution.
6512 * configure.in: Define U through FP_PROTOTYPES for old compilers.
6513 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
6514 * aclocal.m4: New, provide FP_PROTOTYPES.
6515 * m4.h: Conditionnaly protoized through Args, save for varags.
6516 * builtin.c: Protoized. Then:
6517 Include <sys/types.h> if size_t is not defined, before "regex.h".
6518 (m4_ifelse): Fetch built-in name properly for diagnostic.
6519 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
6520 (m4_regexp): Add const to `msg' declaration.
6521 (m4_patsubst): Add const to `msg' declaration.
6522 * debug.c: Protoized, save for varargs.
6523 * eval.c: Protoized.
6524 * format.c: Protoized.
6525 * input.c: Protoized.
6526 * m4.c: Protoized, save for varargs. Then:
6527 (xfree): Accept void * instead of char *.
6528 (xmalloc): Return void * instead of char *.
6529 (xrealloc): Accept and return void * instead of char *.
6530 * macro.c: Protoized.
6531 * output.c: Protoized.
6532 * path.c: Protoized. Then cast some (char *) over xmalloc's.
6533 * symtab.c: Protoized.
6535 1992-11-06 François Pinard <pinard@iro.umontreal.ca>
6537 * m4.texinfo: Remove directory from diagnostics in 30.include,
6538 51.eval, 56.errprint and 57.m4exit tests.
6540 * m4.h: Remove declarations for int or void system functions, they
6541 cause more conflicting trouble than they make good.
6543 * configure.in: Avoid configuration header file. Add some tests.
6544 * m4.h: Remove #include "config.h".
6545 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
6546 Then, rewritten for better compliance with GNU standards.
6548 1992-11-05 François Pinard <pinard@iro.umontreal.ca>
6550 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
6551 because of a misplaced #endif.
6553 * Many *.[hc] files: Correct intra-line spacing here and there,
6554 according to GNU indent 1.6 advice.
6556 * configure.in: New, using Autoconf 1.2.
6557 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
6558 * Delete old configure.in, configure, etc/configure.in,
6559 etc/configure, lib/configure.in, lib/configure and config/*.
6560 Reported by Jason Merrill.
6562 * symtab.c (hash): Change (char) NULL to '\0'.
6563 Reported by Jason Merrill.
6565 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
6566 etc/nextvers.sh. Release numbers will be edited `by hand'.
6567 * version.h: De-automatize, force value in.
6569 * m4.c: Changes in order to use a newer getopt.h.
6570 Reported by David MacKenzie.
6572 * checks/: New name for examples/.
6573 * checks/get_them: New location for etc/get_examples.
6574 * checks/check_them: New location for etc/check_examples.
6575 * Makefile.in, checks/get_them, checks/check_them: Adjust.
6576 * lib/vfprintf.c: New location for etc/vfprintf.c.
6577 * Delete empty etc/.
6578 * examples/: New name for test/.
6580 1992-03-10 François Pinard <pinard@iro.umontreal.ca>
6582 * Makefile.in (check): Add m4 as dependency.
6584 * m4.c: Accept --no-warnings instead of --no_warnings, and
6585 --no-gnu-extensions instead of --no_gnu_extensions. Make the
6586 usage message more informative.
6587 Reported by David MacKenzie.
6589 1992-03-09 François Pinard <pinard@iro.umontreal.ca>
6591 * etc/check_examples: New name for check_examples.sh.
6592 * etc/get_examples: New name for get_examples.sh.
6593 * Makefile.in, etc/Makefile.in: Use new names.
6595 * Makefile.in: Transmit $(CC) while making in lib.
6597 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
6598 code disposition by hand.
6600 1992-03-08 François Pinard <pinard@iro.umontreal.ca>
6602 * m4.h: Delete definitions for abort() and exit().
6603 Reported by Richard Stallman.
6605 * config/hmake-unicos, config/s-unicos.h: New files.
6606 Reported by Hal Peterson.
6608 * eval.c (exp_term): Have N^0 return 1.
6609 Reported by Michael Fetterman.
6611 * eval.c, input.c, m4.h: Remove last comma in enums.
6612 Reported by Mike Lijewski.
6614 * Transfer of maintenance duties from René to François.
6616 1991-10-24 René Seindal <seindal@diku.dk>
6618 * Release 1.0. Many thanks to those, who provided me with bug
6619 reports and feedback.
6621 * Uses GNU configure, taken from the gdb distribution.
6623 * Uses GNU getopt(), with long option names.
6625 * The -Q/+quiet option is added, which suppresses warnings about
6626 missing or superflous arguments to built-in macros.
6628 * Added default options via the M4OPTS environment variable.
6630 * The built-in format can now be configured to use sprintf as
6631 the formatting engine, for systems without [efg]cvt(3).
6633 * GNU library code is moved to the ./lib subdirectory; other
6634 utility files are now in ./etc.
6636 * Several minor bugs have been fixed.
6638 1991-07-26 René Seindal <seindal@diku.dk>
6640 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
6641 Francois Pinard and Roland H. Pesch for providing me with reports.
6643 * The builtins incr and decr are now implemented without use of
6646 * The builtin indir is added, to allow for indirect macro calls
6647 (allows use of "illegal" macro names).
6649 * The debugging and tracing facilities has been enhanced
6650 considerably. See the manual for details.
6652 * The -tMACRO option is added, marks MACRO for tracing as soon
6655 * Builtins are traced after renaming iff they were before.
6657 * Named files can now be undiverted.
6659 * The -Nnum option can be used to increase the number of
6660 divertions available.
6662 * Calling changecom without arguments now disables all comment
6665 * The function m4_patsubst() is now consistently declared
6668 * A bug in dnl is fixed.
6670 * A bug in the multi-character quoting code is fixed.
6672 * Several typos in the manual has been corrected. More probably
6675 * The m4.info file is now installed along with the program.
6677 1990-11-15 René Seindal <seindal@diku.dk>
6679 * Updated and enhanced version. Release 0.75, manual 0.07.
6681 * Implemented search path for include files (-I option and
6682 M4PATH envronment variable).
6684 * Implemented builtin "format" for printf-like formatting.
6686 * Implemented builtin "regexp" for searching for regular
6689 * Implemented builtin "patsubst" for substitution with regular
6692 * Implemented builtin "esyscmd", which expands to a shell
6695 * Implemented "__file__" and "__line__" for use in error
6698 * Implemented character ranges in "translit".
6700 * Implemented control over debugging output.
6702 * Implemented multi-character quotes.
6704 * Implemented multi-character comment delimiters.
6706 * Changed predefined macro "gnu" to "__gnu__".
6708 * Changed predefined macro "unix" to "__unix__", when the -G
6709 option is not used. With -G, "unix" is still defined.
6711 * Changed "shift", "$@" and "$*" to not insert spaces afters
6714 * Added program name to error messages.
6716 * Fixed two missing null bytes bugs.
6718 1990-01-22 René Seindal <seindal@diku.dk>
6720 * Initial beta release. Release 0.50, manual 0.05.