1 2006-07-10 Gary V. Vaughan <gary@gnu.org> (tiny change)
3 * modules/gnu.c (m4_regexp_search, regsub, substitute)
4 (esyscmd): Improve comments.
6 * modules/gnu.c (substitute): Remove old warning for \0.
7 (substitute_warned): No longer required. Removed.
9 * modules/gnu.c: Put macro definitions into alphabetical order.
11 2006-07-07 Eric Blake <ebb9@byu.net>
13 * tests/freeze.at (loading format 1): New file, with new test.
14 * tests/testsuite.at: Include it.
15 * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
16 * tests/modules.at (Freezing modules): Likewise.
18 * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
19 (AC_CHECK_HEADERS): Assume signal.h.
20 (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
21 (AC_CHECK_FUNCS_ONCE): Likewise.
22 * src/m4.h (includes): Assume signal.h.
24 2006-07-05 Eric Blake <ebb9@byu.net>
26 Fix all testsuite failures on cygwin.
27 * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
28 branch-1_4. Solves testsuite failure when uninstalled m4 is
29 shadowed by redefinition of PATH in libtool wrapper.
30 * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
31 contains the -no-undefined required by cygwin.
32 (TESTS_ENVIRONMENT): Export abs_top_builddir.
33 * tests/others.at (misc): Port to platforms where /etc/passwd
34 does not exist or does not contain user named root.
35 * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
37 * tests/builtins.at (define, divert): Avoid overquoting.
38 * tests/generate.awk (new_group): Likewise.
40 2006-07-05 Gary V. Vaughan <gary@gnu.org>
42 The regs_allocated field in a struct re_pattern_buffer refers
43 to the state of a particular re_registers struct when used in
44 successive matches using the same compiled pattern. Avoid a
45 SEGV in `renamesyms' resulting from using a new re_registers
46 with an existing re_pattern_buffer:
48 * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
49 pattern buffer and registers.
50 (m4_regexp_search): New function to call re_regexp_search with
51 correctly matched pattern buffer and register instantiations.
52 (m4_regexp_compile): Return an m4_pattern_buffer. Adust all
55 2006-07-04 Gary V. Vaughan <gary@gnu.org>
57 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
58 changes to gnulib getopt.m4 since last build.
59 * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
60 if the system getopt fails M4_GETOPT tests.
62 2006-06-22 Eric Blake <ebb9@byu.net>
64 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
65 Reported by Bruno Haible.
67 2006-06-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
69 * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
71 2006-06-19 Eric Blake <ebb9@byu.net>
75 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
77 * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
78 (clean-local): Split into and depend upon...
79 (clean-local-tests, clean-local-src): ...these two. The latter
80 removes the libtool object directory below `src', to work around
81 a buglet in Automake, failing to list it.
82 (EXTRA_DIST): Distribute modules/perl.c.
84 2006-06-19 Eric Blake <ebb9@byu.net>
86 * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
87 right side of dependency; VPATH does that.
88 (stamp-vcl): Update to use libtool's algorithm.
89 (EXTRA_DIST): Distribute stamp-vcl.
90 Reported by Ralf Wildenhues.
91 (TESTSUITE): Revert earlier change that used absolute path, as
92 that broke 'make dist' in VPATH. Stick with $(srcdir) instead.
93 (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
94 (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
95 atlocal takes care of it instead.
96 (check-local, installcheck-local, clean-local): Inline absolute
97 path to testsuite here, rather than relative path to testsuite
100 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
102 * m4/m4private.h (DELETE): Cast away const here...
103 * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
104 * src/freeze.c (reload_frozen_state): Avoid uninitialized
107 2006-06-19 Eric Blake <ebb9@byu.net>
109 * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
110 .info pages are built.
111 Reported by Ralf Wildenhues.
112 (EXTRA_DIST): Inline definition of testsuite, so that make dist
115 2006-06-16 Eric Blake <ebb9@byu.net>
117 Follow recommendations from autoconf manual for autotest.
118 * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
119 turn it into an absolute path until autotest provides an option
120 that allows us to avoid changing directories. Properly quote
122 (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
123 (check-recursive): Delete unused target.
124 ($(TESTSUITE)): Atomically update testsuite.
125 (CD_TESTDIR): Simplify.
126 (m4__cd): Delete unused macro.
127 (check-local): Let TESTSUITEFLAGS influence the run.
128 (installcheck-local): Let TESTSUITEFLAGS override
129 AUTOTEST_PATH. Add dependencies.
130 (clean-local): Clean up.
131 (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
132 * README: Document how to use the testsuite.
134 2006-06-15 Eric Blake <ebb9@byu.net>
136 * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
138 * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
139 clashes with m4sugar.
140 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
141 * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
142 * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
143 * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
144 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
145 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
146 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
147 * configure.ac: Likewise.
148 (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
149 * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
151 * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
153 Reduce compiler warnings. Inside GMP, mpq_t is an array type, so
154 const mpq_t is not assignable from plain mpq_t. Avoid
155 type-punning warnings caused trying to mix these types.
156 * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
157 (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
158 * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
159 (mult_term, exp_term): Remove type-punning casts.
160 (numb_pow): Remove const qualifier.
161 * src/freeze.c (reload_frozen_state): Fix typo in messages.
162 Fix variables that can be used uninitialized, which fixes
163 security hole where malicious frozen file can execute arbitrary
166 2006-06-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
168 * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
170 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
171 Eric Blake <ebb9@byu.net>
173 Allow `make dist' to work again.
174 * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
175 (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
176 (cvs-dist): Fix typo.
177 * NEWS: Match current version number.
179 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
181 * Makefile.am (AM_CPPFLAGS): Add $(LTDLINCL), so the right
184 * bootstrap: Do not run libtoolize manually, this is done
185 correctly by autoreconf. Invoke autoreconf with --no-recursive
186 to avoid unnecessary rerunning of autotools for libltdl.
188 2006-06-13 Eric Blake <ebb9@byu.net>
192 2006-06-12 Eric Blake <ebb9@byu.net>
194 * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
196 * src/m4.h: Don't declare mktemp.
197 * m4/input.c (m4__next_token): Avoid bzero.
198 * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
199 * Makefile.am (doc/m4.1): Depend on installed help2man, rather
200 than distributing outdated helptoman.pl.
201 * doc/helptoman.pl: Delete.
203 2006-06-10 Eric Blake <ebb9@byu.net>
205 * README (Patches): Document the current dependence on CVS
207 * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
208 * configure.ac: Use consistent quoting throughout.
209 (AC_PREREQ): Bump to 2.59d.
210 (AC_INIT): Package name begins with uppercase.
211 (AC_ARG_WITH): Use AS_HELP_STRING.
212 (AM_INIT_AUTOMAKE): Enable gnits mode.
213 (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
214 (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
215 (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
216 done by gnulib or automake, or which autoconf has declared
218 * m4/m4private.h (Includes): Assume C89 or better, and use errno
220 * m4/output.c (Includes): Likewise.
221 * modules/gnu.c (Includes): Likewise.
222 * modules/m4.c (Includes): Likewise.
223 * src/m4.h (Includes): Likewise.
225 * README-alpha: Update web address.
226 * README: Likewise. Change encoding to ASCII. Remove old advice
227 about cygwin. Document bootstrapping dependency.
228 * AUTHORS: Update from branch-1_4.
229 * THANKS: Likewise. Change encoding to UTF-8.
230 * BACKLOG: Delete. This file is too old and unmaintained to be
232 * ChangeLog: Change encoding to UTF-8.
234 Avoid compiler warnings.
235 * m4/macro.c (trace_format): Don't mark this as a printf format,
236 since we don't accept the same set of modifiers as printf. It
237 would be nice if gcc let us specify a custom format archetype.
238 * src/main.c (main): Cast away const.
240 2006-06-10 Andreas Schwab <schwab@suse.de> (tiny change)
241 Eric Blake <ebb9@byu.net>
243 * modules/time.c (ctime): Pass correctly typed variable to
246 (localtime): Likewise.
247 (strftime): Likewise.
248 * m4/utility.c (m4_numeric_arg): For now, document arbitrary
249 limit inherent in this interface.
251 2006-05-08 Bruno Haible <bruno@clisp.org> (tiny change)
253 * modules/m4.c (WEXITSTATUS): Provide fallback definition.
254 (sysval): Use WEXITSTATUS.
255 * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
256 big-endian and little-endian wait status definitions.
258 2006-05-06 Eric Blake <ebb9@byu.net>
260 * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
262 (support for -pipe): Move after LT_INIT, since it relies on
265 2006-05-05 Eric Blake <ebb9@byu.net>
267 * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
271 2006-05-05 Bruno Haible <bruno@clisp.org>
272 Eric Blake <ebb9@byu.net>
274 * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
275 * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
277 * bootstrap: Update usage of gnulib-tool.
279 2006-05-04 Eric Blake <ebb9@byu.net>
281 * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
284 2005-12-05 Gary V. Vaughan <gary@gnu.org>
286 * bootstrap (func_update_po): Synch with CVS GNU tar. wget 1.9.x
287 and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
288 Reported by Eric Blake <ebb9@byu.net>
290 2005-12-04 Gary V. Vaughan <gary@gnu.org>
292 * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
293 http caching as -C is no longer supported by wget 1.10.x.
294 Reported by Eric Blake <ebb9@byu.net>
296 2005-10-20 Gary V. Vaughan <gary@gnu.org>
298 * m4/module.c (caller_id): To match libtool-2.0 interface, changed
300 (iface_id): ...an lt_dlinterface_id type.
301 (m4__module_find): New abstraction for lt_dlhandle_fetch. Use
302 throughout, instead of calling obsolete lt_dlhandle_find directly.
303 (m4__module_next): Use multiloader-safe lt_dlhandle_iterate. Use
304 throughout, instead of calling obsolete lt_dlhandle_next.
305 * m4/m4private.h (m4__module_find): Declare it.
306 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
307 Use m4__module_next instead of obsolete lt_dlhandle_next.
309 2005-10-20 Gary V. Vaughan <gary@gnu.org>
311 * bootstrap (func_update_po): Update pofiles directly from the
313 * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
314 po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
315 these files under source control anymore.
316 Suggested by Eric Blake <ebb9@byu.net>
318 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
320 * ltdl/m4/m4-gnulib.m4: Update FSF contact address. Somehow this
321 file escaped the address updates on 2005-05-01.
323 2005-07-07 Gary V. Vaughan <gary@gnu.org>
325 * bootstrap: Allow user overriding of gnulib-tool location, and
326 correctly determine module source directories whether gnulib-tool
327 is given as a relative or absolute path, or is found by searching
329 Reported by Eric Blake <ebb9@byu.net>
331 2005-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
333 * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
334 and $RM are defined for various versions of
335 AC_LIBTOOL_COMPILER_OPTION.
337 * bootstrap (AUTORECONF): New variable to allow user overriding of
340 2005-07-07 Gary V. Vaughan <gary@gnu.org>
342 * doc/m4.texinfo (History): Add better notes on the ancestory of
343 GNU m4, and other historical interest.
345 2005-05-08 Gary V. Vaughan <gary@gnu.org>
347 * m4/symtab.c (m4_symbol_rename): New function that performs a low
349 * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
350 * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
351 (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
353 (erenamesyms, renamesyms): ...builtins that use these to implement
354 macro renaming by regular expression.
355 * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
356 * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
357 to stop the new generated tests from choking.
359 2005-05-07 Gary V. Vaughan <gary@gnu.org>
361 Since most of the build is handled from a single Makefile.am now,
362 we can teach make about the dependencies between the m4 binary and
363 the preopened modules it is built against:
365 * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
367 * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
368 of the preopened modules have changed.
370 2005-05-07 Gary V. Vaughan <gary@gnu.org>
372 * configure.ac (gl_MODULES): Add mkstemp for machines that don't
373 have a native implementation.
375 2005-05-06 Gary V. Vaughan <gary@gnu.org>
377 * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed. These are
378 handled already by gnu/exit.h.
380 * configure.ac (gl_MODULES): Add assert to support a
381 --disable-assert configure time option for NDEBUG setting.
383 * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
384 * bootstrap (src_modules): Add version-etc-fsf.
385 * src/main.c (version_etc_copyright): Removed.
387 * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
389 2005-05-04 Gary V. Vaughan <gary@gnu.org>
391 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
393 * src/freeze.c (produce_frozen_state): Use \n line-endings even
394 on Windows, so that the frozen file reader will work.
395 Reported by Josef T. Burger <bolo@bolo.com>
397 2005-05-04 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
399 Forward port of a patch that allowed m4-1.4.2 to compile on
402 * configure.ac (AC_CHECK_HEADERS): Add signal.h,
404 * src/m4.h: And include them as appropriate.
405 * src/main.c, src/stackovf.h: Don't include signal.h literally;
406 m4.h will include the correct file.
408 2005-05-04 Gary V. Vaughan <gary@gnu.org>
410 * m4/m4private.h: Make errno visible for the sources patched
413 2005-05-04 Paul Eggert <eggert@twinsun.com>
415 * src/main.c (print_program_name_CB): Preserve errno, since
416 M4ERROR relies on this.
417 * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
418 * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
419 * m4/path.c (m4_path_search): Don't let "free" trash errno when
422 * m4/output.c (m4_insert_file): Don't assume errno has a valid
423 value simply because fread returns zero. This fixes a
424 portability bug reported by Marion Hakanson in
425 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
427 2005-05-04 Santiago Vila <sanvila@debian.org>
429 * tests/stackovf.test: Use tempfile if available.
431 2005-05-04 Robert Bihlmeyer <robbe@orcus.priv.at> (tiny change)
433 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
434 * m4/output.c (m4_insert_file): Do not mix buffered and
435 unbuffered I/O, as this breaks on the Hurd.
437 2005-05-04 Gary V. Vaughan <gary@gnu.org>
439 Gnulib has changed again. Reimport. Adjust. Rinse. Repeat.
440 Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
441 and libtoolize does a better job of ltdl importing now too, so
442 take advantage of that while updating the tree:
444 * acm4, config: Moved from here...
445 * ltdl/m4, ltdl/config: ...to here.
446 * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
447 src/Makefile.am, tests/Makefile.am: Removed...
448 * Makefile.am: ...and migrated to here, with adjustments to
449 compensate for relative path differences.
450 * commit: Adjust relative paths.
451 * configure.ac: Adjust relative paths.
452 (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
454 (LT_PREREQ): 2.0 isn't released yet, but will work when it is! In
455 the meanwhile, CVS HEAD libtool is needed.
456 (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
457 stricly new enough, we also need a patch.
458 (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
459 (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
460 (gl_MODULES): Don't list getopt and version-etc, as they don't
462 * bootstrap: After running gnulib-tool to import the listed
463 modules, fetch getopt and version-etc into src manually.
464 (ltdldir): Change to ltdl.
465 * src/main.c: Adjust for changes in version-etc API.
466 * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
467 but works when the getopt module isn't to be included in the lib.
468 * README: Add note about patching autoconf and automake to
471 2005-05-02 Matt Kraai <kraai@debian.org> (tiny change)
473 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
474 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
475 empty file rather than to a nonexistent file. This closes a
476 common security hole.
477 * modules/m4.c (m4_maketemp): Implement the above, by using
478 mkstemp rather than mktemp.
480 2005-05-01 Gary V. Vaughan <gary@gnu.org>
482 The FSF are moving offices today. Changed their contact address
483 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
484 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
486 2005-03-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
488 * tests/Makefile (clean-local): Ignore testsuite cleanup
491 2005-03-11 Per Bothner <per@bothner.com> (tiny change)
493 * tests/Makefile (clean-local): Only run the testsuite cleanup
494 if the testsuite has been generated.
496 2005-02-11 Stepan Kasal <kasal@ucw.cz>
498 * TODO: slight clarification of the example of qindir usage.
500 2005-02-08 Gary V. Vaughan <gary@gnu.org>
502 * TODO: Add qindir requirement, and defn bug.
503 From Stepan Kasal <kasal@ucw.cz>
505 2005-02-08 Stepan Kasal <kasal@ucw.cz>
507 * TODO: Add ``execution stack'', fix a typo.
508 * doc/m4.texinfo: Typos.
510 2004-12-24 Eric Blake <ebb9@byu.net>
512 * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
513 to the gnu subdirectory.
514 * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
515 * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
516 * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
517 * m4/system_.h: Likewise, in non-configured includes.
519 2004-10-14 Noah Misch <noah@cs.caltech.edu>,
520 Gary V. Vaughan <gary@gnu.org>
522 * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
523 Protect definitions from macro expansion under -DNDEBUG by
524 parenthesising the expanded function names.
525 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
526 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
527 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
528 (m4_is_syntax_macro_escaped): Similarly protect function
529 definitions from macro expansion under -DNDEBUG by #undefing the
530 matching macro names before each definition. Also, move all the
531 function definitions to the end of the file so that any
532 invocations in the rest of the file pick up the fast macro
534 * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
535 (m4_set_debug_file, m4_set_trace_messages)
536 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
537 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
538 (m4_set_max_debug_arg_length_opt): New fast macro versions of the
539 option setter functions.
541 2004-09-23 Gary V. Vaughan <gary@gnu.org>
543 * src/main.c: Include gnulib files from the correct directory.
545 * gnulib/*: Don't store any of the gnulib files in arch, as they
546 generate spurious changes.
547 * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
548 gnulib macros now share our macro directory.
549 (SUBDIRS): Descend into `gnu' rather than `gnulib'.
550 * bootstrap: Call gnulib-tool to import from the gnulib tree.
551 (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
552 gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
553 the gettext macros from autopoint that overwrite the gnulib-tool
554 imported versions. Import sources and Makefile.am into the `gnu'
555 directory. Changed all callers.
556 * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
557 gl_INIT): Call these gnulib-tool macros instead of the hardcoded
558 for imported modules.
559 * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
560 acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
561 hardcoding the gnulib macros they wrap.
563 2004-07-15 Gary V. Vaughan <gary@gnu.org>
565 Latest CVS libtool can preload modules in libraries, including
566 its own module loaders! Tweak m4 so that it doesn't try to treat
567 libltdl's module loaders as m4 modules when freezing and on exit:
569 * gnulib/acm4/*.m4: Don't store these files in arch since they
570 generate spurious changes.
571 * bootstrap: Simplify initial libtoolize call, since CVS
572 libtoolize is smarter these days.
573 * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
575 * m4/module.h (m4__module_exit): Missing declaration.
576 * m4/m4private.h (m4__module_next): New function declaration.
577 * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
578 encapsulation. Changed all callers.
579 (m4__module_interface): New function to verify m4 loadable module
581 (m4__module_init): Register the interface validator.
582 (m4__module_exit): Only close my own modules.
583 * modules/m4.c (unistd.h): Provide missing declaration.
584 (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
585 (m4_expand_ranges): More missing declarations.
586 * modules/modtest.c (export_test): Ditto.
587 * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
588 * src/main.c (main): Bump copyright year.
589 * tests/modules.at: Fix sed syntax error.
592 2004-06-17 Gary V. Vaughan <gary@gnu.org>
594 Tweaking to enable compilation with latest CVS libtool and
595 libltdl. We can't just dump the library files directly into the
596 m4 directory anymore now that libltdl is built from pieces itself:
598 * bootstrap: Rewritten to use latest libtoolize sanely, and to
599 set up libltdl subdirectory.
600 * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
601 gnulib subdirectory's config.
602 (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
603 (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
605 (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
606 configure.ac, so use AC_WITH_LTDL instead.
607 * Makefile.am (SUBDIRS): Add libltdl.
608 * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated. gnulib now uses
610 * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
611 (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
612 (libm4_la_LIBADD): Add LIBLTDL.
613 * m4/ltdl.c, m4/ltdl.h: Removed.
614 * m4/m4module.h: Include canonical ltdl.h.
617 2004-06-14 Gary V. Vaughan <gary@gnu.org>
619 * gnulib/import: Now updates makefile fragments, and configure.ac.
620 * gnulib/m4/gnulib.am: New file. Generated makefile fragments.
621 * gnulib/m4/Makefile.am: include it.
622 * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
623 gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
624 gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
625 gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
626 gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
627 * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
628 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
629 gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
630 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
631 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
632 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
633 gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
634 gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
636 * gnulib/m4/getopt_int.h: New source file from latest gnulib
638 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
639 gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
640 gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
641 gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
642 Updated source files from latest gnulib.
644 2004-02-29 Gary V. Vaughan <gary@gnu.org>
646 * config/mailnotify: New file for mailing commit notifications,
647 imported from cvs-utils.
648 * commit: Updated from cvs-utils and tweaked for m4.
650 2003-12-01 Gary V. Vaughan <gary@gnu.org>
652 * config/mkstamp: Updated from CVS libtool.
653 * configure.ac: Generate a gnu coding standards compliant version
654 number, and use it for the banner.
655 * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
656 mhen the TIMESTAMP changes in ChangeLog, but the file modification
657 time doesn't (e.g. in cvs commit). Otherwise dist tarballs will
658 contain the previous version number.
659 * src/main.c: Make --version output conform to the GNU standard.
661 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
662 * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
663 m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
664 shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
665 time_la_SOURCES): ...so that these are defaulted correctly, and
666 can be removed from this file.
667 (AM_LDFLAGS): Add -module...
668 (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
669 traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
670 import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
671 the individual settings can be removed.
672 * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
673 * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
674 m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
675 shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
676 time_la_LIBADD): ...so that these are picked up as a deplib of
677 libm4 and don't need to be set explicitly.
679 2003-11-18 Gary V. Vaughan <gary@gnu.org>
681 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
682 from the standard build. It is too fragile.
684 * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
685 CVS libtool after merging m4 changes across to libtool.
687 * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
688 * m4/path.c (search_path_add): Ditto.
690 2003-11-13 Gary V. Vaughan <gary@gnu.org>
692 * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
693 libtool tags we don't use in configure. This reduces the size
694 of the script from over 1Mb to under 700Kb.
696 2003-11-13 Gary V. Vaughan <gary@gnu.org>
698 The import script was not written properly, and the last gnulib
699 import was incomplete. Fixed that problem, and reimport our
700 gnulib dependencies, which picks up the address calculation
701 overflow checks described by Paul below. Also tweak the clients
702 of the gnulib xalloc module not to use deprecated macros:
704 * gnulib/import: Recurse through module dependencies rather than
705 naively descending only one level.
706 * configure.ac: Add calls to gnulib's strnlen and extension module
708 * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
710 * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
711 gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
712 gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
713 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
715 * gnulib/acm4/libtool.m4: Updated from CVS libtool.
716 * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
717 place of `xcalloc (1, S)'.
718 * m4/m4.c (m4_create): Likewise.
719 * m4/m4private.h (m4_symbol_value_create): Likewise.
720 * m4/symtab.c (symtab_fetch): Likewise.
721 * m4/syntax.c (m4_syntax_create): Likewise.
722 * src/freeze.c (reload_frozen_state): Likewise.
723 * m4/path.c (search_path_add): Eliminate use of deprecated NEW
725 * m4/symtab.c (m4_symtab_create): Likewise.
727 2003-11-13 Gary V. Vaughan <gary@gnu.org>
729 * tests/module.at: Comment typo.
731 2003-10-10 Gary V. Vaughan <gary@gnu.org>
733 * tests/modules.at (modules: importing): Apply some lateral
734 thinking, and use AT_CHECK to compare the output of a sed pass
735 over stderr against the canonical strerror string.
737 * tests/modules.at (modules: importing): Edit the generated stderr
738 output to canonicalize strerror output, before a comparison.
740 2003-10-10 Gary V. Vaughan <gary@gnu.org>
742 Tru64UNIX perl is sloppy with namespace pollution. This patch is
743 careful not to trip over the mess:
745 * modules/perl.c: Some builds of perl install headers that contain
746 `#define try __builtin_try'. Be sure to undefine that macro
747 before `m4/hash.h' gets included, which uses the `try' symbol.
748 * m4/system_.h: Similarly for `bool'. Undefine `bool', `true' and
749 `false' before including `stdbool.h'.
750 (DELETE): This symbol is not in m4's namespace, and is in any
751 case only used internally...
752 * m4/m4private.h (DELETE): ...so move it to here.
753 Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
755 2003-10-08 Paul Eggert <eggert@twinsun.com>
757 Don't use XMALLOC and XCALLOC. Once we install the
758 corresponding patch into gnulib, this will fix some
759 address-calculation overflow bugs on hosts where calloc (A, B)
760 returns garbage when A*B overflows.
762 * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
763 maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
764 xmalloc, XCALLOC with xcalloc.
765 * m4/m4.c (m4_create): Likewise.
766 * m4/m4private.h (m4_symbol_value_create): Likewise.
767 * m4/output.c (m4_output_init): Likewise.
768 * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
769 * m4/syntax.c (remove_syntax_attribute): Likewise.
770 * src/freeze.c (reload_frozen_state): Likewise.
771 * src/main.c (main): Likewise.
773 2003-10-07 Gary V. Vaughan <gary@gnu.org>
775 * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
776 gnulib/acm4 directories for aclocal m4 macros.
777 * gnulib/Makefile.am (EXTRA_DIST): Removed.
778 (MAINTAINERCLEANFILES): Add Makefile.in.
779 * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
781 * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
782 * gnulib/import: New file. Temporary script for updating gnulib
783 imported files, until gnulib-tool is working.
784 * gnulib/config/codeset.m4, gnulib/config/error.m4,
785 gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
786 gnulib/config/getopt.m4, gnulib/config/gettext.m4,
787 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
788 gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
789 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
790 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
791 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
792 gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
793 gnulib/config/nls.m4, gnulib/config/obstack.m4,
794 gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
795 gnulib/config/progtest.m4, gnulib/config/realloc.m4,
796 gnulib/config/regex.m4, gnulib/config/restrict.m4.
797 gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
798 gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
799 gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
800 gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
801 gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
802 gnulib/config/xstrndup.m4: Removed.
803 * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
804 gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
805 gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
806 gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
807 gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
808 gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
809 gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
810 gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
811 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
812 gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
813 gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
814 gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
815 gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
816 gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
817 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
818 gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
819 gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
820 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
821 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
822 gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
823 gnulib/import script.
824 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
825 gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
826 gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
827 gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
828 gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
829 gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
830 gnulib with gnulib/import script.
831 * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
832 guards ready for gnulib-tool to autoupdate on import.
833 * config/debug.m4, config/gmp.m4, config/m4-error.m4,
834 config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
835 config/stackovf.m4: Moved from here...
836 * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
837 acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
838 acm4/stackovf.m4: ...to here, to separate aclocal macros from
839 configure time helper scripts.
840 * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
841 * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
842 m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
843 src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
845 * src/main.c (version_etc_copyright): Only output the current
847 (version_etc): Call with new variadic API.
849 2003-09-16 Gary V. Vaughan <gary@gnu.org>
851 * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
852 version-etc module from CVS gnulib.
853 * po/POTFILES.in: Add gnulib/m4/version-etc.c.
854 * src/Makefile.am: Build it.
855 * src/main.c: Use it.
857 * gnulib/m4/exit.h: Import exit module from CVS gnulib.
858 * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
859 * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
862 2003-09-15 Charles Wilson <cygwin@cwilson.fastmail.fm>,
863 Gary V. Vaughan <gary@gnu.org>
865 * bootstrap: Separate options.
866 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
867 * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
869 * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
870 (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
871 (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
872 (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
873 $(LTLIBINTL) for gettext support on cygwin.
874 * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
875 have $(LTLIBINTL) from the preloaded module la files.
876 * README: Remove the warning about using --disable-nls on Windows
879 2003-09-15 Gary V. Vaughan <gary@gnu.org>
881 * gnulib/m4/regex.c: s/<regex.h>/"regex.h"/ or else the compiler
882 picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
885 2003-09-12 Gary V. Vaughan <gary@gnu.org>
887 * doc/STYLE: Document the gnulib header naming conventions, and
889 * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
890 gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
891 gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
893 * gnulib/m4/Makefile.am: Remove the rules to build these headers.
895 * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
896 module from CVS gnulib.
897 * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
898 (gl_FUNC_STRTOL): In favour of the module macro.
900 2003-09-12 Gary V. Vaughan <gary@gnu.org>
902 Replace the getopt code with CVS gnulib getopt. The source files
903 detect whether they are in a glibc environment and preprocess away
904 all of the code if there is a system getopt, so we can compile
905 them into the m4 executable unconditionally:
907 * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
908 gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
909 * configure.ac (gl_GETOPT): Use this instead of homebrew inline
911 * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
913 * src/Makefile.am: Adjust.
914 * src/main.c: Always include our shipped getopt.h.
915 * po/POTFILES.in: Use new location of getopt.c.
917 2003-09-12 Gary V. Vaughan <gary@gnu.org>
919 * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
920 * config/Makefile.am: Removed. Automake 1.8 distributes the files
921 in this directory automatically.
922 * Makefile.am (EXTRA_DIST): Except config/mkstamp.
924 * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
926 * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
928 * modules/Makefile.am (pkglibexecdir): Set it here.
929 (pkgmodincdir): Renamed to pkgmodincludedir). Changed all clients.
931 * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
932 Import regex module from CVS gnulib.
933 * gnulib/config/restrict.m4: Ditto for dependee module restrict.
934 * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
935 do extra substitutions for Makefile.
936 * configure.ac: Use it.
937 * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
938 from regex_.h if necessary.
939 * m4/system_.h: Include the correct version of regex.h.
940 * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
942 * po/POTFILES.in: Use new location of regex.c.
944 * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
945 realloc.c: automake distributes these files already.
947 2003-09-12 Gary V. Vaughan <gary@gnu.org>
949 Replace the xstrzdup code by importing the xstrndup module from
950 CVS gnulib, along with its dependencies: strndup and strnlen:
952 * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
953 gnulib/config/xstrndup.m4: Import xstrndup module from CVS
955 * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
956 gnulib/config/strndup.m4: Ditto wrt strndup.
957 * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
959 * gnulib/m4/Makefile.am: Add rules from newly imported modules.
960 However, contrary to gnulib, we install xstrndup.h.
961 * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
962 * gnulib/lib/xstrzdup.c: Delete. This was never a gnulib file, it
963 is an artifact of the old m4 portability layer.
964 * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
965 * m4/system_.h: Include xstrndup.h.
966 * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
968 2003-09-11 Gary V. Vaughan <gary@gnu.org>
970 Reimport the latest xalloc module from CVS gnulib, and adjust the
971 m4 sources to take advantage of xalloc xfree. Also create a new
972 macro DELETE with the same semantics as the old m4 XFREE macro,
973 and carefully tweak callers:
975 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
977 * m4/utility.c (xfree): Removed. This function is now supplied by
979 * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
980 * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
981 * m4/symtab.c (m4_symtab_create): Ditto.
982 * m4/system_.h: Removed XFREE redefine.
983 (DELETE): New macro with same functionality as the original m4
984 XFREE macro, but based on xalloc.h now. Changed all callers.
985 * src/main.c (main): Use XMALLOC macro.
986 * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
988 * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
990 2003-09-10 Gary V. Vaughan <gary@gnu.org>
992 Import the xalloc module from CVS gnulib, along with its
993 dependencies: exitfail, malloc and realloc. We had different
994 semantics for our XFREE and a function xfree() not supplied by
995 gnulib, so also a bit of work to keep everything running
998 * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
999 (gl_XALLOC): Use gnulib equivalents.
1000 * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
1001 gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
1002 * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
1003 * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
1005 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
1006 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
1007 * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
1009 (pkgincdir): Removed. Use pkgincludedir instead.
1010 * m4/m4private.h (XFREE): xfree already checks for NULL.
1011 * m4/system_.h: Use xalloc module, and remove macros already
1012 supplied by xalloc.h.
1013 * m4/utility.c (xfree): xalloc does not yet implement xfree, so
1014 moved the old definition from m4/xmalloc.c to here for now.
1016 2003-09-09 Gary V. Vaughan <gary@gnu.org>
1018 Import the error and progname modules from CVS gnulib. Our old
1019 error.c subsumed the functionality of both, so a little adjustment
1020 was required to accomodate the split in sources. Also added more
1021 wrapper macros to choose between a system installed error.h or our
1022 shipped gnulib error module:
1024 * m4/error.c, m4/error.h: Removed.
1025 * m4/Makefile.am: Adjust.
1026 (pkgincdir): Removed. Use pkgincludedir instead.
1027 * m4/module.h, src/main.c: Don't include `m4/error.h'.
1028 * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
1030 * gnulib/m4/progname.c: Imported from CVS gnulib.
1031 * gnulib/m4/progname.h: Ditto.
1032 * src/main.c: Adjust to use progname module.
1033 * gnulib/m4/error.c: Imported from CVS gnulib.
1034 * gnulib/m4/error_.h: Ditto.
1035 * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
1036 if appropriate, and link a local error.h if the system version is
1038 (libgnu_la_SOURCES) Add progname module sources.
1039 * gnulib/config/error.m4: Imported from CVS gnulib.
1040 * gnulib/config/strerror_r.m4: Ditto.
1041 * config/m4-error.c: New file. Wrap gnulib error.m4 but arrange
1042 to have ERROR_H for Makefile substitutions and tell system.h
1043 whether the system error.h should be used, or a locally installed
1045 * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
1047 2003-09-09 Gary V. Vaughan <gary@gnu.org>
1049 * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
1050 s/gettext_.h/gettext.h/.
1052 * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
1053 automake have been fixed.
1055 * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
1056 gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
1057 of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
1058 rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
1060 2003-09-09 Gary V. Vaughan <gary@gnu.org>
1062 The gnulib obstack module requires the gnulib gettext module for
1063 systems that do not have GNU gettext installed. Because we use
1064 -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
1065 that directory incase it clashes with the system gettext.h. This
1066 delta uses gettext_.h and extra rules in the Makefile to make a
1067 link to gettext.h when needed:
1069 * Makefile.am (auxdir): Removed. No longer used.
1070 * configure.ac (ac_aux_dir): Removed AC_SUBST. No longer used.
1071 (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
1073 (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
1074 Makefile based build.
1075 (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
1076 of the macros are kept.
1077 * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
1078 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
1079 * config/Makefile (ACLOCAL_MACROS): Removed. Automake 1.7a
1080 distributes these automatically.
1081 * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
1082 warning from automake-1.7a.
1083 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
1084 m4_CHECK_DEBUGGING for consistency with gnulib prefixes. Changed
1086 * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
1087 wrt. m4_FUNC_OBSTACK.
1088 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
1089 wrt. m4_sys_STACKOVF.
1090 * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
1091 wrt. _m4_LIB_GMP, m4_LIB_GMP.
1092 (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
1093 namespace. Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
1095 * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
1096 * gnulib/m4/Makefile.am: Added a new block to make an appropriate
1097 gettext.h link on deficient systems.
1098 (pkginc_HEADERS): Mention $(GETTEXT_H).
1099 (EXTRA_HEADERS): Mention gettext.h.
1100 * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
1101 * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
1102 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
1103 gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
1104 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
1105 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
1106 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
1107 gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
1108 gnulib/config/po.m4, gnulib/config/progtest.m4,
1109 gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
1110 gnulib/config/ulonglong.m4: Imported from CVS gnulib.
1112 2003-09-05 Gary V. Vaughan <gary@gnu.org>
1114 We can't mirror the gnulib directory structure here, since we need
1115 to be able to eg. `#include <m4/obstack.h>' from our source files,
1116 which is much easier if the local obstack.h is created in a
1117 directory named m4. Rather than trying to symlink everything into
1118 the m4 directory, now we build a libtool convenience library from
1119 the sources we get from gnulib and link that with libm4.la:
1121 * gnulib/config/extensions.m4: Imported from CVS gnulib.
1122 * gnulib/config/unlocked-io.m4: Ditto.
1123 * gnulib/m4/unlocked-io.h: Ditto.
1124 * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
1125 gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
1126 * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
1127 gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
1128 * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
1129 * m4/Makefile.am: Adjust.
1130 * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
1131 macros we redistribute.
1132 * gnulib/m4/Makefile.am: New file. Build libgnu.la convenience
1133 library among others.
1134 (GNULIB_SRCS, GNULIB_MACROS): Removed.
1135 * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
1136 * config/m4-obstack.m4: Adjust.
1137 * po/POTFILES.in: Adjust.
1138 * configure.ac: Reformatting. Call newly imported gnulib macros.
1139 * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
1140 bogus calls of `#include "m4.h"'.
1141 * Makefile.am: INCLUDES has been deprecated in favour of
1143 * m4/Makefile.am: Ditto.
1144 * modules/Makefile.am: Ditto.
1145 * src/Makefile.am: Ditto.
1147 2003-09-05 Gary V. Vaughan <gary@gnu.org>
1149 * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
1151 2003-09-04 Gary V. Vaughan <gary@gnu.org>
1153 Migrate the obstack support into the gnulib directories for easy
1154 synchronisation with upstream files in gnulib:
1156 * config/gnu-obstack.m4: Moved from here...
1157 * config/m4-obstack.m4: ...to here.
1158 * config/Makefile.am (SPECIFIC_MACROS): Adjust.
1159 * m4/obstack.c, m4/obstack_.h: Moved from here...
1160 * gnulib/obstack.c, gnulib/obstack.h: ...to here.
1161 * po/POTFILES.in: Adjust.
1162 * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
1163 * m4/Makefile.am: Add a whole new section to link the obstack
1164 sources from the gnulib tree if necessary.
1165 * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
1167 * config/m4-obstack.m4: Rewrite as a wrapper for
1168 gnulib/m4/obstack.m4.
1170 2003-09-04 Gary V. Vaughan <gary@gnu.org>
1172 GNU M4 currently builds with a number of files adapted from
1173 upstream sources. Recently the gnulib project on savannah.gnu.org
1174 has pulled together a great many of these externally maintained
1175 files. This delta is the beginnings of isolating those files
1176 maintained in gnulib to make it easy to synchronise M4 with the
1177 upstream files prior to releases.
1179 * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
1181 (SUBDIRS): Added new gnulib subdirectory.
1182 * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
1183 * config/stdbool.m4: Moved from here...
1184 * gnulib/m4/stdbool.m4: ...to here.
1185 * m4/stdbool_.h: Moved from here...
1186 * gnulib/lib/stdbool_.h: ...to here.
1187 * gnulib/Makefile.am: New file. Make sure the gnulib tree is
1189 * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
1190 code to work with new stdbool_.h location.
1191 (gnulib_srcdir): New.
1193 2003-09-04 Gary V. Vaughan <gary@gnu.org>
1195 * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
1196 (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
1198 (SPECIFIC_TOOLS): New variable. Moved mkstamp to here.
1199 (EXTRA_DIST): Use it.
1201 * bootstrap: CVS autoreconf leaves file droppings. Remove
1202 aclocal.m4t incase autoreconf doesn't.
1204 2003-08-29 Gary V. Vaughan <gary@gnu.org>
1206 * m4/gnu-obstack.h: Updated from CVS gnulib. For consistency with
1207 the other gnulib imports, renamed to m4/obstack_.h.
1208 * m4/obstack.c: Updated from CVS gnulib.
1209 * m4/Makefile.am (EXTRA_HEADERS): Adjust.
1210 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
1211 header tests from gnulib obstack module. AC_CONFIG_LINKS knows
1212 about vpath already, and $top_srcdir upsets CVS Automake, so the
1213 $top_srcdir reference was removed.
1215 * m4/system-h.in: For consistency with the gnulib imports, renamed
1217 * m4/Makefile (EXTRA_HEADERS): Adjust.
1218 * configure.ac (AC_CONFIG_FILES): Adjust.
1220 * m4/stdbool_.h: New file from gnulib for systems without their
1222 * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
1223 * config/stdbool.m4: New file. Macros from gnulib for same.
1224 * configure.ac: Use it.
1226 2003-08-27 Gary V. Vaughan <gary@gnu.org>
1228 * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
1229 * config/gmp.m4: Ditto.
1230 * config/gnu-obstack.m4: Ditto.
1231 * config/stackovf.m4: Ditto.
1232 * m4/builtin.c: Ditto.
1233 * m4/debug.c: Ditto.
1234 * m4/error.c: Ditto.
1235 * m4/error.h: Ditto.
1236 * m4/gnu-obstack.h: Ditto.
1239 * m4/input.c: Ditto.
1241 * m4/m4module.h: Ditto.
1242 * m4/m4private.h: Ditto.
1243 * m4/macro.c: Ditto.
1244 * m4/module.c: Ditto.
1245 * m4/obstack.c: Ditto.
1246 * m4/output.c: Ditto.
1248 * m4/regex.c: Ditto.
1249 * m4/regex.h: Ditto.
1250 * m4/strtol.c: Ditto.
1251 * m4/symtab.c: Ditto.
1252 * m4/syntax.c: Ditto.
1253 * m4/utility.c: Ditto.
1254 * m4/xmalloc.c: Ditto.
1255 * m4/xstrdup.c: Ditto.
1256 * m4/xstrzdup.c: Ditto.
1257 * modules/evalparse.c: Ditto.
1258 * modules/format.c: Ditto.
1259 * modules/gnu.c: Ditto.
1260 * modules/import.c: Ditto.
1261 * modules/load.c: Ditto.
1262 * modules/m4.c: Ditto.
1263 * modules/m4.h: Ditto.
1264 * modules/modtest.c: Ditto.
1265 * modules/mpeval.c: Ditto.
1266 * modules/perl.c: Ditto.
1267 * modules/shadow.c: Ditto.
1268 * modules/stdlib.c: Ditto.
1269 * modules/time.c: Ditto.
1270 * modules/traditional.c: Ditto.
1271 * src/freeze.c: Ditto.
1272 * src/getopt.c: Ditto.
1273 * src/getopt1.c: Ditto.
1275 * src/main.c: Ditto.
1276 * src/stackovf.c: Ditto.
1278 * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
1279 ac_default_headers is an autoconf internal variable.
1280 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
1281 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
1283 * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
1284 * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
1287 2003-08-15 Gary V. Vaughan <gary@gnu.org>
1289 * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
1291 * system-h.in (m4_boolean): Removed in favour of using C99 bool if
1292 possible or faking one with a typedef. Changed all callers.
1294 2003-08-15 Gary V. Vaughan <gary@gnu.org>
1296 Still cleaning up the users' module API, by taking out the stuff
1297 that isn't used by any existing modules, and moving specialised
1298 functions out of libm4 and into the module they are used by.
1300 * m4/m4module.h (m4_skip_space): No need to export this. Moved...
1301 * m4/utility.c (m4_skip_space): ...to here the home of its only
1302 use, made static and renamed to `skip_space'. Changed all
1304 * m4/m4module.h (m4_expand_ranges): Removed prototype.
1305 * m4/utility.c (m4_expand_ranges): Moved definition from here...
1306 * modules/m4.c (m4_expand_ranges): ...to here, and exported using
1308 * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
1310 * modules/gnu.c (builtin_syntax): Import and use in this
1311 builtin implementation.
1312 * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
1314 * m4/macro.c (trace_flush): Except here where the macro is now
1316 * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
1317 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
1319 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
1320 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
1322 2003-08-14 Gary V. Vaughan <gary@gnu.org>
1324 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
1325 compiler based AC_CHECK_HEADER that was introduced in
1327 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
1328 * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
1329 * configure.ac: Use renamed M4_AC_LIB_GMP.
1331 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
1332 macro that requires arguments! This stops the shell's bad
1333 substitution error at configure time.
1335 * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
1336 variables to the testsuite shell. Set the value of USE_GMP so
1337 that the gmp test will run!
1338 (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
1340 2003-08-11 Gary V. Vaughan <gary@gnu.org>
1342 Libltdl already has an excellent mechanism for accessing C symbols
1343 in modules. Lets use that! Remove all the exporting cruft and
1344 just use lt_dlsym in conjunction with a few conventions to
1345 simplify module writers' jobs. Also removed the table address
1346 caching code and otherwise simplified the module loader quite a
1347 bit. To access exported symbols in other modules, first the
1348 exporting module must name the symbols <modname>_LTX_<symname>,
1349 and the importing module must define a function type called
1350 <symname>_func. The importer then adds
1351 M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
1352 that wishes to call out to the exported functions. Care must be
1353 taken that <symname> is non-NULL in the importing module incase
1354 M4_MODULE_IMPORT fails, but otherwise it can be called as if the
1355 definition was in the importers source. Study
1356 `modules/{gnu.c,m4.{c,h}' for a model example. At the moment,
1357 m4_module_import will attempt to automatically load a module
1358 required for symbol access if it is not loaded already.
1360 * TODO: Removed the items fixed in this delta.
1361 * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
1363 * m4/ltdl.h (lt_dlhandle_find): Declare it.
1364 * m4/module.c (m4_module_unload): Use it.
1365 * src/freeze.c (reload_frozen_state): Ditto.
1366 * m4/m4module.h (m4_export): Deleted. Removed all references.
1367 (M4_MODULE_IMPORT): New user convenience macro for importing
1368 arbitrary symbols from other modules.
1369 * m4/module.c (m4_module_import): New function to service
1370 M4_MODULE_IMPORT macro.
1371 (module_data): Removed. Looking up the tables on demand with
1372 lt_dlsym, rather than caching their addresses here simplifies the
1374 (m4_get_module_builtin_table, m4_get_module_macro_table):
1375 Removed. Changed all callers.
1376 (set_module_macro_table, set_module_builtin_table): Renamed to
1377 install_macro_table and install_builtin_table respectively, and
1378 simplified now that the cache is no more.
1379 * modules/gnu.c (builtin_symbols): Use this new mechanism to
1380 import m4_dump_symbols from the m4 module.
1381 (builtin_esyscmd): Likewise for m4_set_sysval and
1383 * modules/m4.c (m4_export_table): Removed. Functions are
1384 addressed with the new mechanism which doesn't need this.
1385 (m4_set_sysval): New exported accessor function to prevent
1386 problems with variable access on inferior architectures.
1387 * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
1388 (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
1389 that we can have some type safety.
1390 * modules/modtest.c (export_test): C level exported function for
1391 testing the new import mechanism.
1392 * modules/import.c: New file for the import end of the test.
1393 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
1394 * tests/modules.at: New test cases for intermodule symbol
1397 2003-08-07 Gary V. Vaughan <gary@gnu.org>
1399 * m4/m4module.c (m4_string): Moved from here...
1400 * m4/m4private.c (m4_string): ...to here.
1402 * m4/utility.c (dumpdef_cmp): Removed stale declaration.
1404 2003-07-29 Gary V. Vaughan <gary@gnu.org>
1406 * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
1407 already available to module writers through
1408 m4_{get,set}_nesting_limit_opt(), so moved from here...
1409 * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
1410 (m4_create): Use it.
1412 2003-07-28 Gary V. Vaughan <gary@gnu.org>
1414 Aside from auditing path.c for m4module.h api obfuscation, this
1415 delta introduces the concept of private struct members in opaque
1416 data types to GNU m4: See the STYLE file for details.
1418 * TODO: Remind ourselves that a rewrite of path.c is needed.
1419 * m4/m4module.h (m4_search_path, struct m4_search_path_info):
1421 * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
1422 here and renamed. These type definitions are for internal api use
1423 only. Changed all callers.
1424 * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
1426 * m4/path.c (search_path_env_init, search_path_add): ...to here
1427 and renamed. These calls were never used outside this file.
1428 Changed all callers.
1429 (dirpath): Moved functionality of this static declaration...
1430 * m4/m4private.h (struct m4): ...to this new internal only
1431 search_path field. Changed all callers.
1432 (m4__get_search_path): Added new internal api accessor.
1433 * m4/path.c (m4_search_path_info_new): Removed. Not used.
1434 (m4_include_init): Removed...
1435 * m4/m4.c (m4_create): ...because the new m4 field is now
1437 (m4_delete): Recycle search_path memory.
1438 * src/main.c (main): Don't call m4_include_init now that it's
1440 * doc/STYLE: Document convention for private fields in opaque
1443 2003-07-24 Gary V. Vaughan <gary@gnu.org>
1445 Sometimes exporting the address of a symbol from a module isn't
1446 enough for other modules to call that symbol correctly. If
1447 custom data types are used for function parameters, they need to
1448 be known to the caller. This change introduces the concept of
1449 $(prefix)/include/modules/$(modulename).h to declare those
1450 structures. Also we move m4_dump_symbols from libm4 to the m4
1451 module to show this concept in action.
1453 * m4/m4module.h (m4_dump_symbol_data): Moved from here...
1454 * modules/m4.h (m4_dump_symbol_data): ...to this new file for
1455 exporting data structures from modules/m4.c.
1456 * modules/m4.c, modules/gnu.c: Include it.
1457 * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
1458 * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
1460 * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
1462 * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
1463 ...to here, with slight renaming.
1464 (m4_export_table): Prototype and add m4_dump_symbols.
1465 * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
1466 definition of m4_dump_symbols.
1467 * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
1468 * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
1470 2003-07-24 Gary V. Vaughan <gary@gnu.org>
1472 Create an export table in modules/m4.c in readiness for beefing up
1473 the module loader to track module exports and imports.
1475 * m4/m4module.h (m4_debug_flush_files): Removed prototype.
1476 * m4/debug.c (m4_debug_flush_files): Moved...
1477 * modules/m4.c (m4_sysval_flush): ...to here and renamed.
1478 * modules/gnu.c (builtin_esysval): Use it.
1479 * m4/m4module.h (m4_export): New type for declaring module symbols
1481 * modules/m4.c (m4_export_table): List symbols exported from this
1482 module for use by other modules.
1484 2003-07-24 Gary V. Vaughan <gary@gnu.org>
1486 An experiment: There is loads of code in libm4 which should be in
1487 the m4 module, but is also used by another module. Just because
1488 some linkers won't cope with calls across dynamic runtime loaded
1489 objects I initially left the code in libm4. It will tidy the
1490 module api immensely if this code moves to the right place, I just
1491 need to remember to invent a suitable calling mechanism at some
1492 point. For now, only modules that are statically linked and
1493 preloaded will get this treatment, so the only platforms that will
1494 break are those that require all symbols to be resolved at link
1497 * TODO: Reminder that what I am doing could reduce portability
1498 unless I do something more robust later.
1499 * m4/m4module.h (m4_sysval): No longer exported from libm4.
1500 * m4/utility.c (m4_sysval): No longer declared in libm4.
1501 * modules/Makefile.am: Reformatting.
1502 * modules/m4.c (m4_sysval): Declare it at place of use.
1503 * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
1505 2003-07-23 Gary V. Vaughan <gary@gnu.org>
1507 * m4/m4module.h: Reformatting and rearranging lines a bit.
1508 (m4_obstack): Save typing by typedefing `struct obstack'. Changed
1510 (m4_call_macro, m4_expand_input): Renamed...
1511 (m4_macro_call, m4_macro_expand_input): ...to these. Changed all
1513 (m4_expansion_level, m4_process_macro): Moved...
1514 * m4/macro.c (expansion_level, process_macro): ...to here, and
1517 * m4/m4module.h (program_name): Not used by modules at all, so
1519 * src/main.c (program_name): ...to here.
1520 (print_program_name): Renamed...
1521 (print_program_name_CB): ...to conform to the STYLE guide.
1523 2003-07-23 Gary V. Vaughan <gary@gnu.org>
1525 More refactoring of the m4module.h API. Replace #defines with an
1526 enum, and move non-public functions out of the public API.
1528 * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
1530 * m4/macro.c (stdarg.h): Add ANSI C variadic header.
1531 * m4/debug.c (m4_debug, trace): Moved...
1532 * m4/m4private.h (struct m4): ...to fields of this struct.
1533 (m4_get_debug_file, m4_get_trace_messages): New fast access macros
1535 * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
1536 * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
1537 * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
1538 * m4/m4module.h (m4_context_field_table): Add entries for new
1539 debug_file and trace_messages fields.
1540 (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
1541 (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
1542 (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
1543 (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
1544 (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
1545 (m4_is_debug_bit): New macro to simplfy checks against the debug
1547 (m4_trace_format, m4_trace_header, m4_trace_flush)
1548 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
1550 * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
1551 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
1552 * m4/macro.c (trace_format, trace_header, trace_flush)
1553 (trace_prepre, trace_pre, trace_post): ...to these newly static
1554 functions, since they are only ever used from this file. Changed
1557 2003-07-17 Gary V. Vaughan <gary@gnu.org>
1559 Change the macros for checking syntax so that matching against
1560 multiple possible syntax classes can be done with a single
1561 comparison some of the time. The various classes are now bits of
1562 an int that can be checked with bitwise logic operators.
1564 * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
1565 (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
1566 (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
1567 (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
1568 (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
1569 (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
1570 (M4_SYNTAX_ALNUM): Removed. Changed all callers.
1571 (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
1572 (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
1573 (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
1574 (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
1575 Replace all calls with invocations of these...
1576 (m4_is_syntax, m4_has_syntax): ...New macros.
1577 * src/freeze.c (produce_syntax_dump): Remove mask argument, which
1578 is no longer required with new macros. Changed all callers.
1580 2003-07-15 Gary V. Vaughan <gary@gnu.org>
1582 * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
1583 values are returned as part of the internal interface, so they
1585 * m4/private.h: ...to here.
1586 * m4/macro.c (expand_token): Check for out of range
1587 m4_peek_input() results before looking up in the syntax table.
1588 (collect_arguments): Ditto.
1590 * NEWS: Note `$' syntax class.
1592 2003-07-08 Paul Eggert <eggert@twinsun.com> and
1593 Gary V. Vaughan <gary@gnu.org>
1595 Conform to POSIX if the POSIXLY_CORRECT environment is set.
1596 --traditional `define' now smashes all the definitions.
1598 * NEWS: Explain this.
1599 * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
1600 (Extensions): Explain that extensions that are incompatible with
1601 POSIX are disabled if POSIXLY_CORRECT is set.
1602 (Incompatibilities): Remove.
1603 (Define, Other Incompat): Explain difference
1604 between GNU and POSIX behavior of define, pushdef, popdef.
1605 * m4/m4.c (m4_get_posixly_correct_opt): New undef.
1606 * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
1607 * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
1608 (m4_get_posixly_correct_opt): New macro.
1609 * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
1611 * modules/m4.c (builtin_functions): defn now takes any number of args.
1612 (builtin_define): Smash all the definitions if
1614 (builtin_defn)): Allow any number of arguments.
1615 (builtin_undivert): Do not allow nonnumeric arguments
1617 * src/main.c (main): Set posixly-correct behavior if either
1618 POSIXLY_CORRECT is set, or if -G is given.
1619 * tests/builtins.at: New test for smashed definitions.
1621 2003-06-27 Gary V. Vaughan <gary@gnu.org>
1623 * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
1624 * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
1625 not to slow the parser down.
1626 (M4__IS_STRING): New macro to test string syntax class membership.
1627 * m4/syntax.c: Adjust docucomment.
1628 (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
1629 (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
1630 * m4/input.c (init_builtin_token): Comment typo.
1631 (m4__next_token): Comment typo.
1632 Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
1633 by using the new M4__IS_STRING macro.
1634 * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
1635 variable references in macro expansions.
1637 * doc/m4.texinfo (Eregexp and Regexp): Typo.
1638 (Epatsubst and Patsubst): Typo.
1641 2003-06-26 Gary V. Vaughan <gary@gnu.org>
1643 Move the global variables that pertain to syntax to a new `struct
1644 m4_syntax_table', and then add one of these to `struct m4'. The
1645 ripple effect through the code to both change formerly global
1646 references, and make sure a suitable context is available in
1647 lexical scope is disproportionately large compared to the size of
1648 the change proper. This change is a large part of decoupling
1649 syntax.c from the rest of the code that uses it.
1651 * m4/m4private.h (struct m4): Add a syntax field.
1652 * m4/m4.c (m4_create): Initialise it,
1653 (m4_delete): Recycle it.
1654 (m4_get_symtab): Remove hand coded version...
1655 (m4_get_symbol_table): ...and generate this with cpp. Changed all
1657 * m4/m4module.h (m4_context_field_table): Add an extra field so we
1658 can generate m4_get_symbol_table. Add a new row for
1659 m4_get_syntax_table.
1660 (M4SYNTAX): Syntactic sugar for module writers.
1661 (m4_symtab): Renamed to m4_symbol_table. Changed all callers.
1662 (m4_syntax_table): New home for syntax related formerly global
1664 * m4/m4private.h (struct m4_syntax_table): Define it.
1665 * m4/input.c (m4_input_init): Initialisation of these formerly
1666 global variables moved...
1667 * m4/syntax.c (m4_syntax_create): ...to here.
1668 * m4/input.c (m4_input_exit): And similarly, recycling of the
1669 memory used by those values moved...
1670 * m4/syntax.c (m4_syntax_delete): ...to here.
1671 * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
1672 Moved to m4/m4private.h.
1673 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
1674 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
1675 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
1676 (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
1677 objects. Changed all callers that used to directly access the
1679 (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
1680 Removed and incorporated into m4_syntax_table structure.
1681 * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
1682 * m4/syntax.c (m4_set_syntax): Now returns an error status,
1683 instead of requiring a `struct m4' to generate its own errors.
1684 Changed all callers.
1685 * src/main.c (main): Now that the syntax table is initialised as
1686 part of m4_create, we have to manually wipe the syntax entries if
1687 we are about to read a frozen file.
1689 2003-06-26 Gary V. Vaughan <gary@gnu.org>
1691 * doc/STYLE: Added notes on callback naming schemes.
1693 * m4/module.c (m4_set_module_macro_table)
1694 (m4_set_module_builtin_table): Declarations weren't changed when
1695 definitions were renamed on 2003-06-19.
1697 * m4/hash.c (m4_hash_resize): ifdefed out. This function is
1698 neither used nor particularly appropriate since it exposes the
1699 internal workings of the hash module. I haven't yet decided
1700 whether to remove it entirely.
1702 2003-06-20 Gary V. Vaughan <gary@gnu.org>
1704 Two related changes, and a huge knockon effect throughout the
1705 source: Moved the option variables out of global space and into
1706 `struct m4'; made `m4_symtab' a real datatype, so that its api
1707 is not marred passing `struct m4' around just so it can decide
1708 whether to keep traced symbol names or not. Added setters and
1709 getters for the formerly global option variables, and obviously
1710 changed a vast number of functions to take a `struct m4' and use
1711 the getter funcs to find option values.
1713 * m4/utility.c (interactive, sync_output, debug_level)
1714 (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
1715 (max_debug_argument_length, warning_status, nesting_limit)
1716 (discard_comments): Removed.
1717 * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
1718 (debug_level, max_debug_argument_length, prefix_all_builtins)
1719 (suppress_warnings, discard_comments, interactive, sync_output):
1720 Removed from here...
1721 * m4/m4private.h (struct m4): ...and equivalent fields added to
1723 (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
1724 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
1725 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
1726 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
1727 (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
1728 macros for the new fields.
1729 * m4/m4module.h (m4_context_field_table)
1730 (m4_context_opt_bit_table): Helper macros used to generate
1731 prototypes, setters and getters for new option fields
1733 * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
1734 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
1735 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
1736 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
1737 (m4_get_interactive_opt, m4_get_sync_output_opt)
1738 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
1739 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
1740 (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
1741 (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
1742 (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
1743 setter and getter functions generated by cpp from
1744 m4_context_field_table and m4_context_opt_bit_table, exported as
1745 part of the module api. Changed all callers.
1746 * m4/symtab (struct m4_symtab): Used as the concrete type for
1748 (m4_symtab_create): Allocate and initialise a new struct.
1749 (m4_symtab_apply): New function that works like m4_hash_apply, but
1750 with different callbacks specific to symbol tables. Changed all
1752 (symbol_destroy, arg_destroy, arg_copy): Renamed
1753 symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
1754 they have unused parameters for a reason!
1755 (dump_symbol_CB): New callback to dump the contents of a single
1757 (symtob_dump): Rewritten in terms of dump_symbol_CB.
1758 * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
1759 Changed all callers.
1760 * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
1761 of the contained `m4_symtab' at the `no_gnu_extensions' field.
1762 Although I'm not convinced these semantics are correct, they are
1763 at least consistent with how things were before this delta. Also
1764 set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
1766 2003-06-19 Gary V. Vaughan <gary@gnu.org>
1768 Tie down the interface to libm4 some more. Make more structures
1769 opaque to modules by moving them to m4private.h, and writing
1770 setters and getters. To win back the speed penalty for doing this
1771 also wrote macroized versions that do know about structure layout
1772 in m4private.h and #include that file into modules when NDEBUG is
1773 defined at compile time. There are still some accessor macros in
1774 m4private.h that need to go, but that is not necessary to clean
1777 * m4/m4module.h (m4_symbol_type): Moved...
1778 * m4/m4private.h (m4__symbol_type): ...to here.
1779 * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
1780 (m4_set_symbol_traced, m4_set_symbol_name_traced)
1781 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
1782 (m4_get_symbol_func, m4_symbol_value_create)
1783 (m4_symbol_value_delete, m4_set_symbol_value_text)
1784 (m4_set_symbol_value_func): New exported api to symbols.
1785 (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
1786 and m4_is_symbol_value_func.
1787 * m4/m4module.h: Prototype these guys.
1788 * m4/module.c (m4_set_module_macro_table)
1789 (m4_set_module_builtin_table): Make these static, there is no
1790 reason to pollute the api with them.
1791 * m4/m4private.h: Reformatting.
1792 (m4_get_symtab): Only define when NDEBUG is defined.
1793 (m4_get_symbol_value, m4_get_symbol_traced)
1794 (m4_set_symbol_traced, m4_set_symbol_name_traced)
1795 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
1796 (m4_get_symbol_func, m4_symbol_value_create)
1797 (m4_symbol_value_delete, m4_set_symbol_value_text)
1798 (m4_set_symbol_value_func): Macro implementations of the new
1799 functions when NDEBUG is defined.
1800 (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
1801 (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
1802 Superceded by the above. All callers changed.
1803 (M4ARG): Removed. This is no longer different to the
1804 m4/m4module.h definition.
1805 * modules/gnu.c, modules/m4.c: Only include m4private.h when
1806 NDEBUG is defined. That way we exercise the same (albeit slower)
1807 api that external modules must use.
1809 2003-06-18 Gary V. Vaughan <gary@gnu.org>
1811 Renamed some of the types and their accessors to make more sense.
1812 Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
1813 has a stack of SYMBOL_VALUEs.
1815 * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
1816 (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
1817 m4_get_symbol_value_type, m4_get_symbol_value_text,
1818 m4_get_symbol_value_func and m4_symbol_value_copy respectively.
1819 Changed all callers.
1820 (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
1821 (m4_get_token_type): Renamed
1822 * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
1823 to the internal api.
1824 * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
1826 (m4__symtab_init, m4__symtab_exit): Removed prototypes.
1827 (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
1828 (m4__token_type): Moved here from m4module.h.
1829 (m4__next_token): Renamed from m4_next_token.
1830 * m4/symtab.c: Removed some of the parameterised macro support
1831 functions for modularisation later.
1832 (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
1833 m4_hash_dup to perform a true deep copy of the SRC.
1834 (arg_copy): Callback for m4_symbol_value_copy.
1835 * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
1836 Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
1837 m4_get_symbol_value_func. Changed all callers.
1839 2003-06-18 Gary V. Vaughan <gary@gnu.org>
1841 Tidy up style of hash.[ch] in accordance with doc/STYLE.
1843 * m4/hash.c: Internal symbol renaming and formatting.
1844 (m4_hash_dup): New function to facilitate deep copies of hash
1846 (m4_hash_apply_func): Returns a void* now, which is a richer type
1847 for returning exceptions (NULL means keep going).
1848 (m4_hash_apply): Ditto.
1849 * m4/hash.h: Declare exported symbols with an explicit extern.
1852 2003-06-17 Gary V. Vaughan <gary@gnu.org>
1854 Still refactoring furiously. This delta represents a change in
1855 semantics to symtab.c. Instead of building temporary m4_tokens
1856 in the caller, and copying fields in the methods, we now create
1857 the actual m4_token for hashing in the caller so the methods just
1858 slot them in directly. Also, this means that we don't lookup a
1859 symbol and get back an allocated but VOID token to copy fields
1860 into, we create the token we want to push and pass that to
1861 m4_symbol_define or m4_symbol_pushdef. And that's it. There are
1862 a few other small changes to stop knowledge of the implementation
1863 of symtab.c leaking out into other files.
1865 * m4/macro.c (expand_argument): Comment typo corrected.
1866 * m4/symtab.c (symtab_fetch): New function to fetch the address of
1868 (m4_symbol_pushdef): Take an extra value parameter and use this
1869 directly as the new top of the value stack. All callers changed
1870 to build a token and pass responsibility for memory in, rather
1871 than copying as we used to.
1872 (m4_symbol_define): Also use the new value parameter directly as a
1873 replacement for the top of the value stack. All callers changed
1874 to build a token as above.
1875 (m4_set_symbol_traced): New function to set the traced bit on the
1876 named symbol, creating it if necessary.
1877 (symbol_popval): The guts of the old m4_symbol_popdef.
1878 (m4_symbol_popdef): Use it.
1879 * m4/builtin.c (m4_symbol_set_token): Removed,
1880 (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
1882 * m4/module.c (m4_set_module_builtin_table)
1883 (m4_set_module_macro_table): ...with these more orthogonal
1885 * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
1886 (m4_builtin_pushdef, m4_builtin_define): Removed. No longer
1888 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
1889 (m4_arg_signature_parse): Moved...
1890 * m4/symtab.c: ...to here.
1891 * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
1892 screw something up. Moved...
1893 * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
1894 actually does a proper deep copy of source to dest.
1896 2003-06-16 Gary V. Vaughan <gary@gnu.org>
1898 Further refactoring to stabilise the module API. Renaming some
1899 functions for orthogonality, and judicious definition migration to
1900 move things out of the set of exported symbols.
1902 * doc/STYLE: New file. Notes on coding style.
1903 * m4/m4module.c: Updated bitrotted docucomment at the top of the
1905 (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
1906 m4_get_module_name, m4_get_module_builtin_table,
1907 m4_get_module_macro_table which are verb phrases. Changed all
1909 * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
1911 * m4/module.c (m4_set_module_builtin_table)
1912 (m4_set_module_macro_table): ...here, and renamed. Changed all
1914 * m4/m4module.c (m4_module_data): This...
1915 * m4/m4private.c (struct m4_module_data): ...and this...
1916 * m4/module.c (module_data) ...consolidated here and no longer
1917 exported. Changed all callers.
1919 2003-06-16 Gary V. Vaughan <gary@gnu.org>
1921 Begin work on lifting the curse of the global variables. To start
1922 with create a `struct m4' context container, and replace
1923 `m4__symtab' with `context->symtab' throughout. This means
1924 initialising a context container in main, and adjusting many
1925 functions between main and the module entry points so that the
1926 container gets passed through. It would have been nice to
1927 defer this until after 1.5, but it has a major effect on the
1928 user's module writing ABI, so it needs to be addressed now - at
1929 least in the areas that impact the ABI. An interrelated change
1930 in the symtab API removes the dependency on a global symbol table,
1931 and instead focuses on a passed table (from the context
1934 * TODO: Reminders for finishing context functionality.
1935 * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
1936 * m4/m4.c: New file. Manage new struct m4 objects to eliminate
1937 global variables and eventually allow m4 to be reentrant.
1938 * m4/m4private.h (m4): Define the new structure here...
1939 (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
1940 don't carry the overhead of a function call.
1941 * m4/m4module.h: Prototype extern functions from m4/m4.c.
1942 (m4): Declare type for new struct m4 objects.
1943 (M4SYMTAB): User macro to ease finding the symbol table for the
1944 current context for module developers.
1945 (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
1947 (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
1948 (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
1949 (m4_call_macro, m4_dump_symbols, m4_expand_input)
1950 (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
1951 (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
1952 (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
1953 m4* context parameter. Changed definitions and all callers.
1954 (m4_symtab): Alias for m4_hash to decouple the
1955 m4_symtab api from m4_hash.
1956 (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
1958 (m4_symtab_create): New function to return an initialised
1960 (m4_symtab_delete): New function to delete an m4_symtab's memory.
1961 (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
1962 (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
1963 instead of simply using the global m4__symtab. Changed
1964 definitions and all callers.
1965 * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
1966 * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
1967 * src/main.c (main): Create a context and use that instead of the
1968 former global m4__symtab.
1970 2003-06-13 Gary V. Vaughan <gary@gnu.org>
1972 * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
1973 to the callback. Callbacks should not need to hardcode the
1974 hashtable they are working from, nor should we have to waste the
1975 userdata parameter to pass the table in.
1976 * m4/hash.h (m4_hash_apply_func): Require the initial table
1978 * m4/symtab.c (symtab_destroy): Use the passed table instead
1979 of hardcoding m4__symtab.
1980 (m4_symbol_popdef): Don't use the userdata parameter to pass the
1981 table to arg_destroy.
1982 (arg_destroy): Use the hash parameter, ignore userdata.
1983 * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
1985 (traceon, traceoff): Call set_trace with the extra initial
1988 2003-06-13 Gary V. Vaughan <gary@gnu.org>
1990 More refactoring to stabilise the module api, this time for
1991 symtab.c. Additionally, start to pay attention to function names
1992 that don't contain a verb like they should.
1994 * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
1995 wrapper for m4_hash_apply to decouple the symtab module from the
1997 (m4_symbol_builtin, m4_symbol_macro): Renamed to
1998 m4__symbol_set_builtin and m4__symbol_set_macro. Changed all
2000 (m4_symbol_delete): Create a macro version to save a function
2002 (m4_token_t, m4_data_t): These violate the POSIX reserved
2003 namespace. Renamed to m4_token_type and m4_symbol_type. Changed
2005 (m4_token_type): Renamed to m4_token_get_type.
2006 (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
2007 (m4_symtab_exit): Removed from the exported module
2009 * m4/m4private.h (m4__symtab, m4__symtab_init)
2010 (m4__symtab_remove_module_references, m4__symtab_exit): ...and
2011 renamed and added to the internal api. Changed all callers.
2012 (m4_symtab_apply): A faster macro version of the function for
2013 users of the internal api.
2014 * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
2015 symbol_destroy and arg_destroy.
2016 (symtab_debug): Added a prototype.
2017 (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
2018 so that callers in this file get the faster macro versions from
2021 2003-06-12 Gary V. Vaughan <gary@gnu.org>
2023 Refactoring modules to rationalise the API into an external
2024 documented (eventually!) API for use by modules in the `m4_'
2025 namespace declared in m4/m4module.h, an internal API between the
2026 source files we ship (including our shipped modules) in the `m4__'
2027 namespace declared in m4/m4private.h and making the rest as
2028 cohesive as possible with liberal use of the `static' keyword.
2029 This change represents an audit to m4/module.c along these
2032 * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
2033 Removed. No longer used.
2034 (m4_module_close): Removed prototypes.
2035 (m4_module_init, m4_module_open, m4_module_unload_all): Removed
2036 from the exported module api...
2037 * m4/m4private.h (m4__module_init, m4__module_open)
2038 (m4__module_exit): ...and renamed and added to the internal api.
2039 Changed all callers.
2040 (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
2041 Centralised definitions after renaming...
2042 * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
2043 (M4_FINISH_SYMBOL): ...and removing from here.
2044 (m4_module_dlerror, m4_module_remove, m4_module_close)
2045 (m4_caller_id): Not exported at all, so renamed to module_dlerror,
2046 module_remove, module_close and caller_id.
2047 (MODULE_SELF_NAME): New macro to make reporting self errors
2049 (m4_module_load, module_close, module_remove): Use it.
2050 * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
2052 * src/main.c (main): Use it.
2054 2003-06-12 Gary V. Vaughan <gary@gnu.org>
2056 * README: Remove references to --enable-changeword, which has been
2057 removed from the code.
2059 2003-06-11 Gary V. Vaughan <gary@gnu.org>
2061 Getting rid of the annoying bug with configure --enable-debug,
2062 which spewed -e: command not found errors. This was an interaction
2063 between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
2064 You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
2065 branch-1-5) to get the full fix.
2067 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
2068 of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
2069 and then use the probed value of $SED.
2070 (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
2071 this, it messes up the AC_REQUIRE stack.
2073 2003-06-10 Gary V. Vaughan <gary@gnu.org>
2075 * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
2076 the destroy callback.
2077 (m4_arg_destroy): Use the hash address to free the hash node key
2080 2003-06-06 Gary V. Vaughan <gary@gnu.org>
2082 First cut at formal parameters in macros.
2084 * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
2085 * m4/xstrzdup.c: New file.
2086 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
2087 associative array of parameter names to details.
2088 (m4_symbol_token): Capture macro names with parameter lists.
2089 (m4_arg_signature_parse): And build an associative array to hang
2090 from the symbol structure to map names to details.
2091 * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
2092 m4_hash_resize idiom. Now that we potentially add a little hash
2093 table to many of the entries in the symbol table, added an extra
2094 arg to set the initial size. Changed all callers.
2095 (m4_hash_apply): New function that is basically a generalised
2097 * m4/symtab.c (m4_symbol_apply): ...this. Now deleted. Adjusted
2098 all callers to call m4_hash_apply instead.
2099 (m4_arg_destroy): Recycle memory used by an m4_token_arg.
2100 (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
2101 m4_arg_signature association that might be attached to the symbol,
2102 * m4/hash.h (m4_hash_apply_func): Replacement type for...
2103 * m4/m4module.h (m4_symtab_apply_func): ...this. Now deleted.
2104 (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
2106 (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
2107 (M4_IS_IDENT): Detect characters that can be safely used in
2109 * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
2110 * m4/macro.c: Corrected grammar in some comments. Use `token'
2111 rather than `td' for m4_token variables.
2112 (m4_process_macro): If we find a dollar followed by some
2113 M4_IS_IDENT characters, replace that with the contents of the argv
2114 entry with offset stored in the m4_token_arg associated with the
2115 collected identifier.
2117 2003-06-05 Gary V. Vaughan <gary@gnu.org>
2119 Begin preparations for supporting formal parameters in m4 macros.
2121 * m4/m4private.h (struct m4_token_arg): Placeholder for holding
2122 the details of a formal parameter.
2123 (m4_token): Add an arg_signature member to hold a hash table for
2124 looking up formal parameters.
2125 * m4/input.c: Update more bitrotted comments.
2126 (m4_push_builtin): Initialise arg_signature member.
2127 (init_builtin_token): Copy arg_signature member.
2128 * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
2129 (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
2131 * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
2132 (m4_macro_pushdef, m4_macro_define): ...these, And...
2133 (m4_symbol_token): ...wrapped around this new function, which
2134 vastly simplifies the arguments required by the functions it
2136 Changed all callers.
2138 2003-06-05 Gary V. Vaughan <gary@gnu.org>
2140 * m4/macro.c: Format changes.
2142 2003-06-04 Gary V. Vaughan <gary@gnu.org>
2144 * m4/input.c: Updated various bitrotted comments.
2145 (m4_push_builtin): Just pass the whole m4_token, rather than
2146 extracting all the fields in the caller. This also allows us to
2147 check the token type for consistency.
2148 (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
2149 Renamed to builtin_funcs, builtin_peek, builtin_read,
2150 m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
2151 the code. Changed all callers.
2152 (struct input_block): Similarly renamed u_m member to u_b, and
2153 changed all callers.
2154 (m4_next_token): Use bzero to initialise the data fields.
2155 * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
2157 2003-05-29 Gary V. Vaughan <gary@gnu.org>
2159 These changes were necessary to get m4 to build on my iBook
2160 running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
2161 (GCC) 3.1 20020420 (prerelease)":
2163 * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
2164 inclusion of module loader headers.
2165 * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
2166 * m4/Makefile.am: Ditto.
2167 (libm4_la_LIBADD): Added $(LTLIBINTL).
2168 * m4/utility.c (program_name): Removed declaration in favour of
2169 the one already in error.c!
2170 * m4/m4module.h (program_name): Define to program_invocation_name
2171 when using GNU C library. Use an explicit extern declaration.
2172 (interactive, sync_output, debug_level, hash_table_size)
2173 (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
2174 (suppress_warnings, warning_status, nesting_limit, discard_comments)
2175 (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
2176 (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
2177 (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
2178 (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
2179 (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
2180 (m4_expansion_level, m4_expand_ranges, m4_expand_input)
2181 (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
2182 (m4_current_line, m4_current_diversion, m4_output_current_line):
2183 Don't rely on default, use an explicit extern.
2184 * m4/error.h (error, error_at_line, error_print_progname)
2185 (error_message_count, error_one_per_line): Ditto.
2186 * m4/ltdl.c: Update from CVS libtool.
2188 * commit: Update from CVS cvs-utils.
2190 2002-11-04 Akim Demaille <akim@epita.fr>
2192 * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
2194 * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
2196 2002-11-04 Akim Demaille <akim@epita.fr>
2198 * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
2200 2002-11-04 Akim Demaille <akim@epita.fr>
2202 * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
2203 used as `external', and Libtool 1.4.3.
2205 (LTLIBOBJS): Don't play with it.
2207 * Makefile.am (SUBDIRS): Remove intl.
2208 (ACLOCAL_AMFLAGS): Add -I config.
2209 (EXTRA_DIST): Add config/config.rpath.
2212 * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
2214 2002-05-29 Gary V. Vaughan <gary@gnu.org>
2216 Preparations for refactoring syntax tables to allow reverse
2217 lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
2218 speed of normal lookups in an array of unsigned short.
2220 * m4/input.c (single_quotes, single_comments, use_macro_escape):
2222 * m4/m4private.h (m4__single_quotes, m4__single_comments,
2223 m4__use_macro_escape): ...to here, and renamed. The `m4__' prefix
2224 is for internal symbols which unavoidably pollute the global
2225 namespace, but are not published APIs.
2226 Adjusted all callers.
2227 * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
2228 m4_set_comment, m4_set_syntax, set_syntax_internal,
2229 unset_syntax_attribute): Moved from this file...
2230 * m4/syntax.c: New. ...to this file.
2231 Also added an m4_syntax_exit stub for orthogonality.
2232 * src/main.c (main): Use it.
2233 * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
2234 * m4/m4module.h: Reformatting. New prototypes.
2236 2002-05-29 Gary V. Vaughan <gary@gnu.org>
2238 * bootstrap (aclocal_apiversion): The aclocal apiversion is
2239 distinct from the automake release number (in that the apiversion
2240 apparently has no micro-version-component).
2241 (aclocal_apilibdir): Use it.
2243 2002-05-28 Gary V. Vaughan <gary@gnu.org>
2245 * m4/hash.c (m4_hash_resize): New function.
2246 * m4/hash.h: Add prototype.
2247 * m4/symtab.c (m4_symtab_init): Use it. This could do with some
2248 benchmarking to find a good value for, say, autoconf. This is
2249 already a little quicker than before for me.
2251 * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
2252 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
2254 * m4/hash.h: Adjust prototypes.
2256 2002-01-22 Akim Demaille <akim@epita.fr>
2258 * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
2260 * tests/Makefile.am (package.m4): New.
2261 * tests/atlocal.in: Adjust to CVS Autotest.
2262 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
2263 * configure.ac: LIBOBJ is a forbidden string.
2264 Simplify AM_INIT_AUTOMAKE invocation.
2265 * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
2268 2001-10-19 Akim Demaille <akim@epita.fr>
2270 * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
2272 2001-10-19 Akim Demaille <akim@epita.fr>
2274 * m4/input.c (m4_next_token): Display where was opened what is
2277 2001-10-19 Akim Demaille <akim@epita.fr>
2279 * m4/macro.c (expand_argument): Display where was opened what is
2282 2001-10-18 Akim Demaille <akim@epita.fr>
2284 * m4/input.c, modules/m4.c: Formatting changes.
2286 2001-10-17 Gary V. Vaughan <gary@gnu.org>
2288 * bootstrap: s/configure.in/configure.ac/
2290 2001-10-16 Gary V. Vaughan <gary@gnu.org>
2292 * m4/symtab.c (m4_symbol_destroy): This function calls
2293 m4_symbol_popdef, which recycles a symbols memory when the last
2294 definition is popped. Since we were passing the address of the
2295 symbol name found in the symbol table, and it was being removed
2296 partway through m4_symbol_destroy() we were referencing freed
2297 memory for the balance of the function. Now we take a copy of the
2298 symbol name tring and use that as a key into the symbol
2299 table... that way if the original symbol name is freed, the copy
2302 2001-10-13 Akim Demaille <akim@epita.fr>
2304 * m4/ltdl.c: Update.
2306 2001-10-13 Akim Demaille <akim@epita.fr>
2308 * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
2309 Don't gettextize internal error messages.
2311 2001-10-13 Akim Demaille <akim@epita.fr>
2313 * tests/macros.at (Arity and defn): New failing test.
2314 (Arity, defn, and freeze): New.
2316 Fix `Arity and defn'.
2318 * m4/input.c (m4_push_macro): Don't forget the arity.
2319 * modules/m4.c (defn): Likewise.
2321 2001-10-13 Akim Demaille <akim@epita.fr>
2323 * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
2325 * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
2326 (Propagation of traceon, Propagation of --trace): this new file.
2328 2001-10-13 Akim Demaille <akim@epita.fr>
2330 * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
2331 interface instead of (name, argc...).
2332 Upon failure, specify which argument was guilty.
2335 2001-10-13 Akim Demaille <akim@epita.fr>
2337 * modules/evalparse.c: Save translators' time: don't translate
2338 internal error messages.
2339 (m4_evaluate): Simplify/normalize error messages.
2340 * doc/m4.texinfo (Eval): Adjust.
2342 2001-10-13 Akim Demaille <akim@epita.fr>
2344 * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
2345 where no checking is needed.
2346 * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
2347 interface instead of (name, argc...).
2349 * modules/gnu.c (m4_patsubst_do): Don't check argc, done
2352 2001-10-13 Akim Demaille <akim@epita.fr>
2354 * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
2355 exclude the builtin name from the count.
2356 * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
2357 calling ifelse with a single argument is valid.
2358 * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
2359 with 1 and 2 args, mostly to strengthen the test suite.
2361 2001-10-13 Akim Demaille <akim@epita.fr>
2363 * m4/output.c (m4_make_diversion, m4_insert_file)
2364 (m4_insert_diversion, +m4_freeze_diversions): Ansify.
2366 2001-10-12 Gary V. Vaughan <gary@gnu.org>
2368 * m4/input.c (init_builtin_token): Renamed from init_macro_token,
2369 since we call these things builtins in the rest of the code!
2371 * modules/gnu.c (m4_regexp_compile): s/%0/%s/
2373 2001-10-12 Gary V. Vaughan <gary@gnu.org>
2375 Rather than forcing each builtin definition to manage its own
2376 argument range checking, tabulate the maxima and minima for all
2377 builtins in each module. This forces us to consider what the
2378 valid ranges for each builtin should be, and moves the checking
2379 code out of each builtin implementation and into the builtin
2380 caller infrastructure.
2382 * m4/m4module.h (struct m4_builtin): Add argument minima and
2384 * m4/m4private.h (struct m4_token): Reflect them here too.
2385 * m4/input.c (struct input_block): ...and here.
2386 (m4_token_copy): New function for token copying.
2387 (init_macro_token): Copy them from a token to the input stack.
2388 (m4_next_token): Don't forget to initialise them for text
2390 * m4/macro.c (expand_argument): Use m4_token_copy, and also
2391 check argument counts before calling the builtin handler.
2392 * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
2393 (m4_symbol_macro): Likewise.
2394 * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
2395 parameters. Updated all callers.
2396 (m4_builtin_define): Ditto.
2397 (m4_macro_pushdef, m4_macro_define): Ditto.
2398 * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
2399 * modules/evalparse.c: Declare argument counts for defined
2400 builtins and remove explicit calls to m4_bad_argc().
2401 * modules/gnu.c: Ditto.
2402 * modules/load.c: Ditto.
2403 * modules/m4.c: Ditto.
2404 * modules/modtest.c: Ditto.
2405 * modules/mpeval.c: Ditto.
2406 * modules/perl.c: Ditto.
2407 * modules/shadow.c: Ditto.
2408 * modules/stdlib.c: Ditto.
2409 * modules/time.c: Ditto.
2412 2001-10-10 Gary V. Vaughan <gary@gnu.org>
2414 The trace semantics now attach the trace bit to a symbol name.
2415 For as long as a traceon(`foo') is active, calls to foo will be
2416 traced regardless of intervening undefines or module unloads.
2417 Fixed the flag propogation issues differently to the fixes
2418 reverted with the last attempt at nailing down trace:
2420 * m4/m4private.h: This file is not visible outside of the m4
2421 source tree, so I removed all the `M4_' and `m4_' prefixes to save
2422 on typing. Updated all clients.
2423 (m4_token): New typedef contains the fields that need to be passed
2424 around with the low level tokeniser.
2425 (m4_token_data): Removed.
2426 (m4_symbol): Now contains the traced flag again.
2427 * m4/symtab.c: Rewritten again. Now we don't remove symbols with
2428 the trace bit set. This change is contained entirely within this
2429 module and doesn't leak out into the callers. Updated all
2431 (m4_symbol_builtin, m4_symbol_macro): Adjusted to make use of the
2432 new fields in m4_token. Updated all clients.
2433 * m4/builtin.c (m4_builtin_pushdef): Needs a flags argument so
2434 that `groks_macro_args' and `blind_if_no_args' flags are retained
2435 when defn() results are passed around in m4 code. Updated all
2437 (m4_builtin_define): Ditto.
2438 (m4_macro_pushdef, m4_macro_define): Ditto.
2439 * m4/input.c (struct input_block): Add a flags field to facilitate
2441 (m4_push_macro): ...use it.
2442 (init_macro_token): Retrieve it.
2443 (m4_next_token): Initialise it.
2444 * m4/macro.c (expand_argument): Copy it.
2445 * m4/m4module.h: Adjust.
2446 * tests/builtins.at: Adjust the expected output of the trace
2447 tests to reflect the change in semantics.
2448 * tests/modules.at (modules: trace): Check that unloading a
2449 module which supplies a traced symbol definition doesn't lose te
2452 2001-10-07 Gary V. Vaughan <gary@gnu.org>
2454 * modules/gnu.c (m4_macro_table): Display the timetamp when
2455 expanding __m4_version__.
2457 * configure.ac (--with-modules): Forgot a comma in the
2458 AC_HELP_STRING parameter list.
2460 2001-10-05 Gary V. Vaughan <gary@gnu.org>
2462 * bootstrap: Remove aclocal.m4t when it is no longer required.
2464 2001-10-05 Akim Demaille <akim@epita.fr>
2466 * tests/Makefile.am: Adjust for gnuprog2.
2467 * tests/m4.in: There can be a leading path.
2468 * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
2469 * tests/testsuite.at: Adjust to the most recent Autotest.
2470 (AT_CHECK_M4_FILTER): Fix and rename as...
2472 * tests/others.at: Use it.
2474 * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
2475 variable in shell scripts, one uses `$'...
2477 2001-10-04 Gary V. Vaughan <gary@gnu.org>
2479 * configure.ac: `rm -f $m4_getopt_h' was lost.
2481 2001-10-04 Gary V. Vaughan <gary@gnu.org>
2483 * configure.ac (TIMESTAMP): Display with AS_BOX at configure
2484 time. Define it for config.h in order to...
2485 * src/main.c (main): ...display the timestamp for --version.
2487 2001-10-04 Akim Demaille <akim@epita.fr>
2489 * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
2490 previous builtins `regexp' and `patsubst'.
2491 (regexp, patsubst): Use them.
2492 (eregexp, epatsubst): New builtins.
2493 * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
2494 (Epatsubst and Patsubst, Eregexp and Regexp): these.
2495 (Extensions): More info on REs.
2497 2001-10-04 Akim Demaille <akim@epita.fr>
2499 * modules/modtest.c (init_handler): Consistently output to stderr.
2500 (finish_handler): New.
2501 (test): The `if' is an `assert'.
2502 * tests/modules.at: Adjust.
2504 2001-10-04 Akim Demaille <akim@epita.fr>
2506 * m4/utility.c (m4_bad_argc): Detail the mismatches.
2508 2001-10-01 Akim Demaille <akim@epita.fr>
2510 * tests/generate.awk: Tag the tests with `documentation'.
2511 * tests/modules.at (AT_CHECK_M4_MODTEST): New.
2512 Use the make the existing modtest tests more uniform, and complete
2513 the set of possibilities.
2515 2001-10-01 Akim Demaille <akim@epita.fr>
2517 * config/gmp.m4: Consult the user before using GMP: use
2519 * configure.ac: Adjust.
2520 * modules/gmp.c: No protection needed as the module is not built
2523 2001-10-01 Akim Demaille <akim@epita.fr>
2525 * tests/generate.awk: Remove debugging code.
2526 (fatal): Specify the current location.
2528 * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
2529 * modules/gnu.c, modules/m4.c: Use M4ARG.
2531 2001-10-01 Akim Demaille <akim@epita.fr>
2533 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
2534 (m4_regexp_compile): New.
2535 (regexp, patsubst): Use it.
2537 2001-09-30 Gary V. Vaughan <gary@gnu.org>
2539 Reinstate the memory handling improvements from the patch I just
2540 reverted. Relevant ChangeLog entries repeated here:
2542 * m4/module.c (m4_module_remove): New function that holds the core
2543 of the old m4_module_unload.
2544 (m4_module_unload): Use it.
2545 (m4_module_unload_all): When we know the modules will never be
2546 used again (i.e. on exit), free up as much module memory as
2547 possible. There are still some artifacts from resident modules
2548 living inside ltdl.c, but everything else is freed.
2549 * m4/debug.c (m4_debug_exit): Free memory allocated in
2551 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
2552 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
2553 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
2554 * m4/m4module.h: Updated prototypes.
2555 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
2556 * m4/hash.h: Updated prototypes.
2557 * src/main.c (main): Use all these new functions to clean up as
2558 much memory as possible before exit.
2560 2001-09-30 Gary V. Vaughan <gary@gnu.org>
2562 Reverted my large patch for removing the old m4_symbol
2563 structure on 2001-09-20. We are still not happy about the way
2564 trace works in conjunction with defn and undefine, and leaving
2565 the reverted patch active prevents us from moving the traced
2566 bit from the definition back to the symbol.
2568 2001-09-30 Gary V. Vaughan <gary@gnu.org>
2570 * configure.in: Moved to...
2571 * configure.ac: ...here. Added a libtool like timestamped
2572 banner, and tidied up the libltdl cruft.
2573 * config/mkstamp: Script to extract a timestamp from ChangeLog.
2574 * modules/Makefile.am (INCLTDL): Removed. This is required
2575 only when libltdl is configured in a subdirectory.
2576 * src/Makefile.am: Ditto.
2577 (LIBADD_DL): No need to add this again, libtool already knows
2578 that libm4.la depends on it.
2579 * m4/Makefile.am: Automake sets variables from AC_SUBST. Use
2582 * TODO: stackovf.c is basically broken.
2583 Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
2585 2001-09-28 Akim Demaille <akim@epita.fr>
2587 * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
2589 2001-09-27 Akim Demaille <akim@epita.fr>
2591 * tests/m4.in: Don't use short options.
2592 Simplify the stderr signature normalization.
2594 2001-09-27 Akim Demaille <akim@epita.fr>
2596 tests/m4 shall be position independent.
2600 * tests/testsuite.at: No args to AT_INIT.
2601 * configure.in, tests/Makefile.am: Adjust.
2603 2001-09-22 Akim Demaille <akim@epita.fr>
2605 Autotest has changed again.
2607 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
2608 (package.m4): Remove.
2609 * configure.in: Adjust to LIBADD_GMP.
2611 2001-09-21 Gary V. Vaughan <gary@gnu.org>
2613 * config/gmp.m4 (AC_ARG_WITH): Removed.
2614 (GMP_LIB): Renamed to LIBADD_GMP for consistency.
2615 (AC_LIB_GMP): When performing a test compile against libgmp,
2616 include the header gmp.h if possible, and link against -lgmp. If
2617 they both work define USE_GMP.
2618 * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
2619 (mpeval_LTX_init_func): Complain on load that there was no libgmp
2622 2001-09-20 Gary V. Vaughan <gary@gnu.org>
2624 * m4/evalparse.c: Moved to...
2625 * modules/evalparse.c: ...here. This code is shared between
2626 modules/mpeval.c and modules/m4.c, so there is no need to pollute
2627 the libm4 API with its details. Moderately rewritten to interface
2628 into its clients more simply.
2629 * m4/eval.c: Deleted. Migrated functionality to...
2630 * modules/m4.c: ...here.
2631 (builtin_eval): Implemented in terms of the new interface style.
2632 * modules/mpeval.c (builtin_mpeval): Ditto.
2633 * m4/m4module.h: Removed references to the former m4/eval.c.
2634 * m4/Makefile.am (libm4_la_SOURCES): Removed eval.c.
2635 (EXTRA_libm4_la_SOURCES): Deleted.
2636 * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
2637 (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
2639 2001-09-20 Akim Demaille <akim@epita.fr>
2641 * config/gmp.m4 (AM_WITH_GMP): Rename as...
2643 By default, use gmp.
2645 * configure.in: Adjust.
2646 Use Automake conditionals for USE_GMP.
2647 Always compute sizeof (long long int).
2648 This was a bug BTW, as `eval' (not `mpeval') depends on it:
2649 before, it was used _only_ if mpeval was not activated.
2650 * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
2651 (mpeval_la_LIBADD): New macros.
2652 * modules/mpeval.c: No longer be conditioned by WITH_GMP.
2654 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
2655 * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
2658 2001-09-20 Akim Demaille <akim@epita.fr>
2660 * tests/Makefile.am (package.m4): New.
2661 * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
2663 2001-09-20 Gary V. Vaughan <gary@gnu.org>
2665 More cleanup. After the last patch, m4_symbol holds nothing but
2666 the head of a chain of m4_token_data. So I have removed the old
2667 m4_symbol, so that m4_token_data chains are stored directly in the
2668 value cell of a hash table node. But there's more... m4_symbol
2669 was a more natural name for the symbol value cell, and now that it
2670 is gone I have renamed the former m4_token_data structure to
2671 m4_symbol. This change turned out to be a pig to get right, since
2672 the original code didn't need to modify the value cell itself,
2673 since changing the chain happened inside the m4_symbol that used
2674 to be returned -- I had to pass the address of the value cell
2675 across various function calls, incase the head value changed. I
2676 also tightened up the memory management to help me find a nasty
2677 memory corruption bug that took me all night to track down...
2679 * m4/m4private.h (struct m4_symbol): Removed.
2680 (struct m4_token_data): Renamed to `struct m4_symbol'. Updated
2682 * m4/hash.c (m4_hash_iterator_value): Return the address of the
2683 value cell. Updated all callers.
2684 * m4/symtab.c: Took advantage of the simplification in the data
2685 structures to rewrite a lot of this file more simply. There is
2686 still some room for optimisation here, but we should tackle that
2687 systematically closer to the release.
2689 * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
2690 revealed. This version is ahead of CVS libtool until I get chance
2691 to flush my changes.
2692 * m4/module.c (m4_module_remove): New function that holds the core
2693 of the old m4_module_unload.
2694 (m4_module_unload): Use it.
2695 (m4_module_unload_all): When we know the modules will never be
2696 used again (i.e. on exit), free up as much module memory as
2697 possible. There are still some artifacts from resident modules
2698 living inside ltdl.c, but everything else is freed.
2699 * m4/debug.c (m4_debug_exit): Free memory allocated in
2701 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
2702 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
2703 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
2704 * m4/m4module.h: Updated prototypes.
2705 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
2706 * m4/hash.h: Updated prototypes.
2707 * src/main.c (main): Use all these new functions to clean up as
2708 much memory as possible before exit.
2710 2001-09-18 Gary V. Vaughan <gary@gnu.org>
2712 The `traced' flag needs to be attached to the definition of a
2713 symbol rather than the current symbol containing the definition.
2714 Implementing this showed up some long standing post 1.4 bugs in
2715 flag propogation which I also fixed.
2717 * m4/m4private.h (struct m4_symbol): Remove the traced flag.
2718 (struct m4_token_data): And add it back in here.
2719 * m4/input.c (init_macro_token): Propogate the traced flag
2721 * m4/macro.c (expand_argument): Ditto.
2722 * tests/builtins.at (trace2, trace3): New tests based on Akim's
2725 2001-09-08 Gary V. Vaughan <gary@gnu.org>
2727 * m4/m4private.h (struct m4_token_data): Simplified by removing
2728 the redundant `traced' flag, and one level of structure nesting.
2729 (M4_TOKEN_DATA_FUNC_TRACED): Removed.
2730 * m4/input.c (init_macro_token): No need to initialise removed
2732 * m4/macro.c (expand_argument): No need to copy it either.
2733 * m4/utility.c (m4_token_data_func_traced): Or provide an access
2736 * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
2737 dependant on multiple symbols with the same key, so preserving
2738 relative symbol order in each bucket during resizing is no longer
2739 required. The resize function is considerably faster as a result.
2741 * m4/m4module.h, m4/builtin.c, m4/symtab.c:
2742 s/m4_symbol_insert/m4_symbol_define/g;
2743 s/m4_builtin_insert/m4_builtin_define/g;
2744 s/m4_macro_insert/m4_macro_define/g. Updated all callers.
2746 2001-09-08 Gary V. Vaughan <gary@gnu.org>
2748 Get rid of m4_symbol_lookup_t entirely. With Akim's earlier
2749 commits, the m4_lookup_symbol dispatch function is split into
2750 specialised functions that must be called directly.
2752 * m4/m4module.h (m4_symbol_lookup_t): Removed.
2753 * m4/symtab.c (m4_lookup_symbol): Removed.
2754 (m4_symbol_builtin, m4_symbol_macro): New functions.
2755 * m4/builtin.c (m4_builtin_define): Split into...
2756 (m4_builtin_pushdef, m4_builtin_insert): ...these.
2757 (m4_macro_define): Split into...
2758 (m4_macro_pushdef, m4_macro_insert): ...these.
2759 * src/main.c (main): Set command line macros from `-D' parameters
2760 using `m4_macro_define'.
2762 2001-09-08 Gary V. Vaughan <gary@gnu.org>
2764 * m4/symtab.c (m4_symtab_remove_module_references): Renamed as
2765 this from m4_remove_table_reference_symbols().
2766 * m4/m4module.h, m4/module.c: Updated all references.
2768 2001-09-07 Akim Demaille <akim@epita.fr>
2770 * modules/stdlib.c, modules/times.c: Misc cleanups.
2772 2001-09-07 Akim Demaille <akim@epita.fr>
2774 * configure.in: We now need Autoconf 2.52e.
2775 * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
2776 and `M4_SYMBOL_DELETE'.
2777 * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
2778 * src/main.c (main): Adjust.
2780 2001-09-06 Gary V. Vaughan <gary@gnu.org>
2782 Fix the obstack.h problem once and for all! At configure time we
2783 can test for a system supplied obstack.h: depending on the
2784 result, we now generate system.h with an #include of the correct
2785 header. As a bonus, I've also added a --with-included-obstack,
2786 incase the user doesn't like the system obstack for some
2787 reason... and also we can test the shipped obstack on a system
2788 that has oe of its own. We also now need to be careful to add
2789 build directories to the include search path, since the generated
2790 system.h will be in the build tree.
2792 * configure.in (AC_CONFIG_FILES): Generate system.h from
2794 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
2795 include the system obstack header or the copy shipped with M4.
2796 Allow the user to override configure and force the build to use
2797 the shipped version.
2798 * m4/system-h.in: New file, template for...
2799 * m4/system.h: ...this. Now deleted.
2800 * m4/m4module.h: Include system.h before everything else.
2801 * src/freeze.c: Ditto.
2802 * m4/Makefile.am (dist-hook): Remove generated system.h.
2803 (INCLUDES): Check builddir for generated headers before checking
2805 * modules/Makefile.am (INCLUDES): Ditto.
2806 * src/Makefile.am (INCLUDES): Ditto.
2808 2001-09-05 Gary V. Vaughan <gary@gnu.org>
2810 * TODO: Remove the items that have been addressed already.
2812 2001-09-05 Akim Demaille <akim@epita.fr>
2814 * src/main.c (main): Standardize --version.
2816 2001-09-05 Akim Demaille <akim@epita.fr>
2818 * modules/format.c (format): Have a bigger `str'.
2820 2001-09-05 Akim Demaille <akim@epita.fr>
2822 Rationalize warnings, reporting the macro name as if it were a
2823 program name, and assertions.
2825 * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
2827 * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
2829 Use assert for internal errors.
2830 * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
2832 * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
2834 * tests/builtins.at (pushpop): Adjust.
2836 2001-09-05 Akim Demaille <akim@epita.fr>
2838 * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
2841 2001-09-05 Akim Demaille <akim@epita.fr>
2843 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
2844 * m4/macro.c, m4/symtab.c: Adjust.
2846 2001-09-05 Akim Demaille <akim@epita.fr>
2848 * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
2849 (m4_symbol_pop, m4_symbol_del): this.
2850 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
2851 (m4_symbol_popdef, m4_symbol_delete): New.
2852 (m4_lookup_symbol): Adjust.
2853 * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
2855 2001-09-05 Akim Demaille <akim@epita.fr>
2857 * m4/m4module.h (m4_symbol_lookup): Rename as...
2858 (m4_symbol_lookup_t): this.
2860 2001-09-05 Akim Demaille <akim@epita.fr>
2862 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
2864 * m4/symtab.c (m4_lookup_symbol): Adjust.
2866 2001-09-03 Gary V. Vaughan <gary@gnu.org>
2868 Bootstrap will now work with Libtool 1.4.1 or higher:
2869 * bootstrap: Remove stale autom4te.cache files when
2871 * config/Makefile.am (ACLOCAL_MACROS): Add ltdl.m4 and
2873 * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
2874 libtool.m4 directly.
2875 Run libtoolize to refresh ltmain.sh.
2876 * config/ltmain.sh: Deleted.
2877 * acinclude.m4: Deleted.
2878 * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
2880 * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
2881 implementation for the cvs impaired libtool user.
2883 2001-09-03 Akim Demaille <akim@epita.fr>
2885 * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
2887 Avoid using `default' in switch, as it hides useful compiler
2888 warnings when a case is forgotten.
2890 2001-09-03 Akim Demaille <akim@epita.fr>
2892 * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
2893 is no such thing as `WITH_MODULES'.
2895 2001-09-03 Akim Demaille <akim@epita.fr>
2897 Improve the test suite's selfcontainedness.
2899 * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
2900 (Include, Undivert): Tag the other input files.
2901 * tests/generate.awk: Catch `@comment file:'.
2902 `-I $src' is no longer needed.
2903 `next' is really like `return': the rest is skipped.
2904 Adjust to `input.m4'.
2905 (fatal): New function.
2906 * tests/foo, tests/incl.m4: Remove.
2908 2001-09-01 Gary V. Vaughan <gary@gnu.org>
2910 The shadowing mechanism and, infact, the whole symbol table
2911 implementation was creaking under the weight of the features piled
2912 on top of it. We now have a separate hash table module which will
2913 dynamically resize to keep symbol density withing good performace
2914 limits, and a new symtab module layered above it. Symbol lookups
2915 are now marginally more efficient (since the shadowed flag is no
2916 longer required) and symbol removal, such as on module unload, is
2917 considerably faster due to a reorganisation of the data structures
2920 * src/main.c (main): Don't mention `-H'.
2921 * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
2924 * m4/hash.c: New generalised dynamic hash table data structure
2926 * m4/hash.h: Public interface.
2927 * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
2928 (libm4_la_SOURCES): Add hash.c.
2929 * m4/symtab.c: More or less rewritten from scratch, within the
2930 bounds of the previous API.
2931 (m4_symtab_apply): A cleaner version of the old hack_all_symbols
2932 call. Updated all callers.
2933 * m4/m4module.c: #include <m4/hash.h>, and changed all affected
2934 declarations to reflect API changes.
2935 (M4INIT): Generate a declaration too, to avoid the warning with
2936 --enable-debug builds.
2939 * m4/utility.c (hash_table_size): Removed.
2940 (m4_dump_symbols): Rewritten to build and qsort an array of symbol
2941 names, which are then looked up by builtin_dumpdef() as necessary.
2942 This implies a small speedup in builtin_symbols(), which discarded
2943 all of the symbol info under the old call.
2944 * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
2945 shadowing is implicit in respect to the new data structures.
2946 symbol names are no longer duplicated here, they are stored in the
2947 key field of the hash table.
2948 Moved macro_args and blind_no_args...
2949 (m4_token_data): ...to here.
2950 m4/macro.c (expand_macro): Added a name argument since the symbol
2951 name is no longer copied into each struct m4_symbol. Modified all
2953 (collect_arguments): Ditto.
2954 * modules/m4.c (set_trace): Ditto.
2955 * modules/gnu.c (builtin_symbols): Updated.
2956 * src/freeze.c (produce_symbol_dump): Much improved in light of
2957 the improved symbol table layout.
2959 2001-09-01 Gary V. Vaughan <gary@gnu.org>
2961 * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
2963 (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
2964 (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
2965 SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
2966 SYMBOL_HANDLE): Ditto.
2967 * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
2968 modules/gnu.c, modules/m4.c, src/freeze.c,
2969 src/main.c: Updated all references.
2971 * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
2972 Automake 1.5 chokes on dynamic source file lists, Besides, it is
2973 already listed in m4_LDADD... how did that ever used to work?
2974 * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
2976 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
2977 Suggested by Tim Van Holder <tim.van.holder@pandora.be>
2979 * tests/m4: Don't call the m4 wrapper script with libtool, it
2980 works fine all by itself.
2982 2001-08-30 Gary V. Vaughan <gary@gnu.org>
2984 The experimental `changeword' feature never took off, and has
2985 no obvious advantages over `changesyntax' to compensate the
2986 enormous speed penalty it carries:
2987 * configure.in (ENABLE_CHANGEWORD): Removed.
2988 * m4/m4module.h (m4_set_word_regexp): Removed.
2989 * m4/m4private.h (m4_token_data): Removed original_text field.
2990 * m4/utility.c (m4_token_data_orig_text): Removed.
2991 * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
2992 * m4/macro.c: Ditto.
2993 * src/main.c: Ditto.
2994 * modules/Makefile.am (changeword.la): Removed.
2995 * modules/changeword.c: File removed.
2996 * doc/m4.texinfo: References to changeword and --word-regexp
2998 * po/POTFILES.in: modules/changeword.c removed.
2999 * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
3000 * tests/builtins.at (changeword): Test removed.
3002 2001-08-30 Akim Demaille <akim@epita.fr>
3004 * bootstrap.sh: Create aclocal.m4 instead of modifying it.
3005 This also help having a single list of m4 files: in
3007 * config/Makefile.am (STANDARD_MACROS): Rename as...
3008 (ACLOCAL_MACROS): this.
3009 (list-standard-macros): Remove.
3012 2001-08-29 Gary V. Vaughan <gary@gnu.org>
3014 In an attempt to moderate my egomania...
3015 * tests/modules.at: Remove attributions.
3017 * tests/generate.awk: When making substitutions to "@&t@", either
3018 "&" or "\&" in the substitution string argument to gsub refer back
3019 to the matched text. "@\\&t@" seems to work though, Tests 43 and
3022 2001-08-29 Akim Demaille <akim@epita.fr>
3024 * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
3025 (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
3026 (sync-lines, trace, translit, undivert, wrap): Move to...
3027 * tests/builtins.at: this new file.
3028 * tests/others.at (Discard comments, import-environment): Move to...
3029 * tests/options.at: this new file.
3031 2001-08-29 Akim Demaille <akim@epita.fr>
3033 * tests/others.at (Freezing modules)
3034 (--module-directory: absolute path, modpath2, modpath3)
3035 (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
3036 * tests/modules.at: here, new file.
3037 * tests/others.at, tests/generate.awk: Add a banner.
3038 * tests/testsuite.at: Adjust.
3039 (AT_CHECK_M4_FILTER): New, but unused.
3041 2001-08-29 Akim Demaille <akim@epita.fr>
3043 * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
3045 * tests/others.at (wrap): Inline wrap.m4.
3046 (shadow): Inline shadow.m4.
3047 (iso8859): Don't specify the path from top_srcdir, but from srcdir.
3048 * tests/m4: Simplify.
3050 2001-08-29 Akim Demaille <akim@epita.fr>
3052 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
3055 2001-08-29 Akim Demaille <akim@epita.fr>
3057 * tests/generate.awk (normalize): s/@__@/@&t@/.
3059 2001-08-28 Akim Demaille <akim@epita.fr>
3061 * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
3063 2001-08-28 Gary V. Vaughan <gary@gnu.org>
3065 * bootstrap (generate.awk): Generate test cases with new script.
3067 2001-08-27 Akim Demaille <akim@epita.fr>
3069 * tests/Makefile.am (installcheck-local): Don't use
3070 `dc_install_base' which is not visible here, but `exec_prefix'
3071 which is clearly the RT anyway.
3072 * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
3073 related to testing a now installed m4.
3074 * tests/m4: Do it here.
3076 2001-08-27 Akim Demaille <akim@epita.fr>
3078 * tests/others.at (indir): Formatting change.
3080 2001-08-27 Akim Demaille <akim@epita.fr>
3082 * tests/Makefile.am (installcheck-local): New.
3083 * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
3085 Prefer options over envvars.
3086 * src/main.c (main): First bug caught by the test suite (yeah!):
3087 --batch lacked a `break' which resulted in an accidental
3088 invocation of --discard-comments.
3090 2001-08-27 Akim Demaille <akim@epita.fr>
3092 * tests/others.at (capitalize, changeword, comments, ddivert)
3093 (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
3094 (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
3095 (sysv-args, trace, translit, undivert): Don't rely on files in
3096 examples/: AT_DATA them.
3098 2001-08-27 Akim Demaille <akim@epita.fr>
3100 Let the test suite use a wrapper around the not installed m4 to
3101 pretend it is (installed).
3103 * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
3104 such a way that m4 does not process them.
3105 * configure.in: The package name seems to be `m4', not `M4'.
3107 * tests/atlocal.in (at_package, M4): Remove.
3108 * tests/testsuite.at, tests/others.at: Use m4, not $M4.
3110 2001-08-27 Akim Demaille <akim@epita.fr>
3112 * tests/Makefile.am (CLEANFILES): Remove.
3113 (DISTCLEANFILES, clean-local): New.
3114 * examples/mktests.sh: Remove.
3116 2001-08-27 Akim Demaille <akim@epita.fr>
3118 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
3119 Don't use aclocal: it's written by hand.
3120 * aclocal.m4: m4_include all the files instead of being built by
3122 * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
3123 until it reads the traces by itself.
3124 * configure.in: Require Autoconf 2.42c as we are now using
3125 AC_CONFIG_TESTDIR instead of AT_CONFIG.
3126 Catch unexpanded `jm_' macros.
3127 * config/atconfig.m4: Remove.
3128 * config/error.m4: new.
3129 * config/Makefile.am: Ship the files included by aclocal.m4.
3130 * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
3131 (TESTSUITE_AT): this, to please Automake.
3132 (TESTSUITE): This target uses autotest/autotest.m4, not
3133 autotest/general.m4.
3134 * tests/testsuite.at: Prereq Autotest 2.52c.
3135 * examples/Makefile.am (pkgdata_DATA): Rename as...
3136 (dist_pkgdata_DATA): this.
3137 * doc/Makefile.am (man_MANS): Rename as...
3138 (dist_man_mans): this.
3140 2001-08-20 Gary V. Vaughan <gary@gnu.org>
3142 * m4/system.h [cygwin*]: Thanks to Paul Sokolovsky and
3143 Robert Collins, building on Cygwin no longer requires Windows
3144 import and export symbol decorations.
3145 * m4/m4module.h (M4_SCOPE) [cygwin*]: Deleted all occurences.
3146 * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
3147 * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
3148 * m4/error.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
3149 * m4/input.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
3150 * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
3151 * m4/output.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
3152 * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
3153 * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
3154 * configure.in (LIBM4_DLL_IMPORT) [cygwin*]: Don't set this
3156 * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
3157 * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
3159 2001-08-20 Gary V. Vaughan <gary@gnu.org>
3161 Ansify the source. Previously we had a mix, where my code was
3162 in a K&R compatible style, and the preexisting code was in ANSI
3163 style. Nothing is lost wrt release 1.4 by reverting to ANSI,
3164 and now the code base is much cleaner.
3166 * m4/system.h: Remove M4_PARAMS macro and all users. Remove
3167 VOID macro and all users.
3168 * m4/m4module.h: Ansify function prototypes and headers.
3169 * m4/builtin.c: Ditto.
3170 * m4/evalparse.c: Ditto.
3171 * m4/input.c: Ditto.
3172 * m4/macro.c: Ditto.
3173 * m4/module.c: Ditto.
3174 * m4/output.c: Ditto.
3176 * m4/symtab.c: Ditto.
3177 * m4/utility.c: Ditto.
3178 * modules/format.c: Ditto.
3179 * modules/gnu.c: Ditto.
3180 * modules/m4.c: Ditto.
3181 * modules/mpeval.c: Ditto.
3182 * src/freeze.c: Ditto.
3184 * src/main.c: Ditto.
3186 2001-08-20 Akim Demaille <akim@epita.fr>
3188 * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
3189 generated with stock 2.52.
3191 2001-08-20 Akim Demaille <akim@epita.fr>
3193 * config/atconfig.m4: New, until part of Autoconf per se.
3194 * configure.in (AT_CONFIG): Use it.
3196 * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
3197 * tests/atlocal.in: New.
3198 * tests/generate.awk: For the time being, the empty quadrigraph is
3200 * tests/others.at (changeword, gmp): Check the configuration
3201 variable against `yes'.
3202 * tests/testsuite.at (dnl): Allow it, as it's used all over the
3205 2001-08-20 Akim Demaille <akim@epita.fr>
3207 * m4/utility.c (m4_numeric_arg): Spell out the culprit.
3208 * modules/m4.c (undivert): Disable the possibility of undiverting
3209 several files at once: it is not documented, it is inconsistent
3210 with the other macros, it can be straightforwardly mocked by
3211 several invocations, and most importantly, it prevents the
3212 possibility of other kinds of extension.
3213 Use `m4_numeric_arg'.
3215 2001-08-20 Akim Demaille <akim@epita.fr>
3217 * examples/include.m4: Typo.
3218 * tests/generate.awk: Really add it.
3219 * tests/Makefile.am: Adjust.
3220 * tests/others.at (Discard comments): It sure fails without `-c'.
3221 (include, undivert): Add -I examples/.
3223 2001-08-20 Akim Demaille <akim@epita.fr>
3225 Use sprintf, not ecft and friends since it is standard, portable,
3226 simplifies the code, and since the latter is even deprecated
3227 according to the GNU libc documentation.
3229 * modules/format.c: Drop evct support.
3231 2001-08-19 Gary V. Vaughan <gary@gnu.org>
3233 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up. Don't test
3235 * configure.in: ...do it here instead.
3237 * c-boxes.el: Deleted.
3238 * m4/builtin.c: Reformat box comments to be closer to GNU
3240 * m4/debug.c: Ditto.
3242 * m4/evalparse.c: Ditto.
3243 * m4/input.c: Ditto.
3244 * m4/m4module.h: Ditto.
3245 * m4/macro.c: Ditto.
3246 * m4/output.c: Ditto.
3247 * m4/symtab.c: Ditto.
3248 * m4/utility.c: Ditto.
3249 * modules/changeword.c: Ditto.
3250 * modules/format.c: Ditto.
3251 * modules/gnu.c: Ditto.
3252 * modules/load.c: Ditto.
3253 * modules/m4.c: Ditto.
3254 * modules/modtest.c: Ditto.
3255 * modules/mpeval.c: Ditto.
3256 * modules/perl.c: Ditto.
3257 * modules/shadow.c: Ditto.
3258 * modules/stdlib.c: Ditto.
3259 * modules/time.c: Ditto.
3260 * src/freeze.c: Ditto.
3261 * src/main.c: Ditto.
3263 2001-08-17 Gary V. Vaughan <gary@gnu.org>
3265 * m4/module.c: Fixup some errors in the description comment.
3267 2001-08-17 Akim Demaille <akim@epita.fr>
3269 * tests/others.at (iso8859): Specify the path to the M4 test file.
3270 * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
3271 files in error messages.
3273 2001-08-17 Akim Demaille <akim@epita.fr>
3275 * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
3276 * tests/others.at: Adjust input files paths.
3277 * tests/atconfig.in: Set top_builddir.
3278 * tests/Makefile.am: Adjust.
3279 `testsuite' is in src, not build.
3281 2001-08-17 Akim Demaille <akim@epita.fr>
3283 * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
3284 (generate.at): Install a temporary hack until the actual
3285 generate.awk is added to the repository.
3286 * tests/atconfig.in: New.
3288 2001-08-17 Akim Demaille <akim@epita.fr>
3290 Really apply the patch ``Drop Autoconf 2.13 compatibility.''
3292 2001-08-17 Akim Demaille <akim@epita.fr>
3294 * doc/m4.texinfo: Promote proper quotation.
3296 2001-08-17 Akim Demaille <akim@epita.fr>
3298 Remove the non Autotest tests.
3300 * tests/other-tests/capitalize.test,
3301 * tests/other-tests/changeword.test,
3302 * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
3303 * tests/other-tests/debug.test,
3304 * tests/other-tests/discard-comments.m4,
3305 * tests/other-tests/discard-comments.test,
3306 * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
3307 * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
3308 * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
3309 * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
3310 * tests/other-tests/hanoi.test,
3311 * tests/other-tests/import-environment.m4,
3312 * tests/other-tests/import-environment.test,
3313 * tests/other-tests/include.test, tests/other-tests/indir.test,
3314 * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
3315 * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
3316 * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
3317 * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
3318 * tests/other-tests/modtest.test,
3319 * tests/other-tests/multiquotes.test,
3320 * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
3321 * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
3322 * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
3323 * tests/other-tests/sync-lines.m4,
3324 * tests/other-tests/sync-lines.test,
3325 * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
3326 * tests/other-tests/translit.test, tests/other-tests/undivert.test,
3327 * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
3328 * tests/other-tests/wrap.test: Remove.
3330 * tests/run-test, tests/get-them: Remove.
3331 * tests/Makefile.am: Adjust.
3333 2001-08-17 Akim Demaille <akim@epita.fr>
3335 others.at no longer depends on other-tests/.
3337 * tests/others.at (stackovf): You're actually...
3339 (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
3340 (unload.test): Keep their authorship.
3341 (discard-comments, gmp, import-environment, modfreeze)
3342 (sync-lines): Embed the input files.
3343 * tests/stackovf.test: Copy from other-tests/stackovf.test.
3344 * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
3346 2001-08-17 Akim Demaille <akim@epita.fr>
3348 * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
3349 (M4exit): Tag the exit status of the example.
3350 * tests/get-them: Adjust.
3351 * tests/generate.awk: New, based on get-them.
3352 * tests/Makefile.am: Adjust to generate `generated.at'.
3353 * tests/testsuite.at: Adjust.
3354 (AT_CHECK_M4): Don't overquote. Blush...
3356 2001-08-17 Akim Demaille <akim@epita.fr>
3358 Start using Autotest. atconfig creation is still lacking.
3360 * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
3361 * examples/reverse.m4, tests/other-tests/import-environment.m4,
3362 * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
3363 * tests/other-tests/import-environment.test: Don't check LANGUAGE
3364 as it might be `unset', or set to `C'.
3365 * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
3366 * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
3367 * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
3368 * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
3369 * tests/other-tests/shadow.test: Adjust.
3370 * tests/testsuite.at, tests/others.at: New.
3371 * tests/Makefile.am: Adjust.
3373 2001-08-17 Akim Demaille <akim@epita.fr>
3375 Drop Autoconf 2.13 compatibility.
3377 * configure.in (changeword): No need to undefine it, as anyway if
3378 it's defined, M4sugar moved it as m4_changeword.
3379 And anyway, proper quotation is enough.
3380 (m4_pattern_allow): As it exists in 2.50, just use it.
3381 (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
3382 Don't handle Gettext's duties, let it handle them.
3383 * config/gnu-obstack.m4: Use m4_pattern_allow directly.
3385 2001-08-17 Akim Demaille <akim@epita.fr>
3387 * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
3388 (m4_errprint): Use fputs.
3389 * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
3390 dumpdef are not concerned.
3391 (Dumpdef, Errprint): Emphasize their insensitivity to
3393 * doc/Makefile.am: Add `TAGS' support.
3394 (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
3396 * config/Makefile.am (MAINTAINERCLEANFILES): New.
3398 2001-08-17 Akim Demaille <akim@epita.fr>
3400 * modules/Makefile.am (ETAGS_ARGS): New.
3402 2001-08-17 Akim Demaille <akim@epita.fr>
3404 * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
3407 2001-08-17 Akim Demaille <akim@epita.fr>
3409 * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
3411 2001-08-17 Akim Demaille <akim@epita.fr>
3413 * m4/m4module.h (m4/list.h): Don't include it.
3415 2001-08-16 Gary V. Vaughan <gary@gnu.org>
3417 m4_modules are no more, we use lt_dlhandles directly and let
3418 latest libltdl features manage the list of loaded modules.
3419 * acinclude.m4: Regenerated.
3420 * m4/ltdl.c: Updated from master copy.
3421 * m4/module.c: Reimplemented to take advantage of advances in
3423 * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
3424 list with lt_dlhandle_next.
3425 (m4_builtin_find_by_func): Ditto.
3426 (m4_builtin_table_install): Use lt_dlhandle.
3427 (m4_macro_define): Ditto.
3428 (m4_macro_table_install): Ditto.
3429 m4/module.h: Prototype new module management API.
3430 (m4_modules): No longer required.
3431 (m4_module_init_t, m4_module_finish_t): POSIX namespace
3432 violations, renamed to...
3433 (m4_module_init_func, m4_module_finish_func): ...these,
3435 (M4INIT_HANDLER): Clean way to declare init functions in modules.
3436 (M4FINISH_HANDLER): And similarly for finish functions.
3437 * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
3438 -- Add indirection to the CONC macro so that arguments are
3440 * modules/modtest.c (m4_init_module): Replaced with M4INIT_HANDLER.
3441 * modules/shadow.c (m4_init_module): Ditto.
3442 Due to new init function semantics, be careful to perform the
3443 initialisation only on first load.
3444 * modules/perl.c (m4_init_module): Ditto. And Ditto.
3445 (m4_finish_module): Replaced with M4FINISH_HANDLER.
3446 Due to new finish function semantics, be careful to perform the
3447 finalisation only on first load.
3448 * m4/m4private.h (m4_module): Removed in favour of...
3449 (m4_module_data): ...structure without all the wrapper fields.
3450 Instances of this new structure are stored associated lt_dlhandles
3451 with lt_dlcaller_data_set().
3452 * m4/builtin.c (m4_builtin_define): Takes a handle argument
3453 instead of the old module argument.
3454 (m4_builtin_table_install): Ditto.
3455 * modules/load.c (m4_resident_module): Removed. This is no
3456 longer implemented as a magic symbol...
3457 * modules/m4.c (m4_resident_module): Ditto.
3458 * modules/load.c (M4INIT_HANDLER): ...the module init function now
3459 uses the ltdl api to make the module resident.
3460 * modules/m4.c (M4INIT_HANDLER): Ditto.
3461 * modules/load.c (builtin_modules): Traverse the loaded module
3462 list with lt_dlhandle_next.
3463 (builtin_load): Much simplified in light of the reimplemented
3465 * src/freeze.c (produce_module_dump): Cleaned up and optimised in
3466 light of the m4/module.c rewrite.
3467 (produce_symbol_dump): Ditto.
3468 (reload_frozen_state): Ditto.
3469 * m4/list.c, m4/list.h: Files deleted. No longer required.
3470 * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
3471 (libm4_la_SOURCES): Delete list.c reference.
3472 * m4/m4private.h (m4_token_data): Add a handle field. This
3473 eliminates many of the searches to find the handle associated with
3474 various tokens that are passed between functions.
3475 (struct m4_symbol): Removed the module field. The
3476 module association does not belong with the symbol...
3477 * m4/input.c (struct m4_builtin): ...it belongs with the builtin
3478 that the module implementation code is from. Added a handle
3480 (m4_push_macro): Add a `handle' argument. Changed all callers.
3481 (init_macro_token): Set the `handle' field for the
3483 * m4/macro.c (expand_argument): Copy the new handle field during
3485 * modules/m4.c (macro_install): Use the new handle field to
3486 optimise the search for the correct builtin structure, and pass
3487 the handle details to m4_builtin_define.
3489 2001-08-15 Akim Demaille <akim@epita.fr>
3491 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
3492 when creating `m4/obstack.h'.
3493 * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
3495 * tests/defs: Make them absolute.
3496 (CDPATH) Neutralize.
3497 * tests/gethem: Use them.
3499 2001-08-14 Gary V. Vaughan <gary@gnu.org>
3501 * config/ltmain.sh: Doh! Import again for a quoting fix that
3502 prevented any regression test from passing.
3504 * m4/m4module.h (obstack.h): Choose between installed version
3505 and shipped version based on configure tests.
3506 * src/freeze.c (obstack.h): Ditto.
3508 * acconfig.h: Removed. No longer required.
3510 * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
3511 * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
3512 them to AC_INIT and AM_INIT_AUTOMAKE.
3513 * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
3514 disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
3515 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
3516 shell variable m4_cv_func_obstack_h.
3517 * tests/defs (M4): Be more careful about relative path to libtool
3518 script and m4 binary by using $srcdir.
3520 * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
3521 optargs to the existing libltdl search path.
3522 * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
3523 * m4/ltdl.c: Updated.
3525 * config/ltmain.sh: Ditto.
3527 2001-08-11 Gary V. Vaughan <gary@gnu.org>
3529 * src/main.c (main): Add `-b' (for `batch') mode switch to force
3530 interactive mode off.
3532 2001-08-10 Akim Demaille <akim@epita.fr>
3534 * configure.in: Require Autoconf 2.52.
3535 (AC_ARG_PROGRAM): Remove, handled by Automake.
3536 (m4_getopt): Rename as...
3537 (m4_getopt_h): this.
3538 Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
3539 Undefine `changeword' only if defined.
3540 * config/gnu-obstack.m4: Require Autoconf 2.52.
3541 (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
3544 2001-08-09 Yuji Minejima <ggb01164@nifty.ne.jp>
3546 * doc/m4.texinfo: Fix some typos, and apply some small
3549 2001-08-09 Andreas Schwab <schwab@suse.de>
3551 * src/main.c (main): Fix improper uses of error (missing format
3554 2001-08-07 Akim Demaille <akim@epita.fr>
3556 Improve `make distcheck'.
3558 * configure.in: Be sure to be able to run `mkconfig.sh' when src
3560 * Makefile.am (dist-hook): Remove, as it is no longer needed.
3561 * doc/m4.texinfo (Include): Add missing blank.
3562 * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
3565 2001-08-07 Akim Demaille <akim@epita.fr>
3567 * m4/evalparse.c: A better introductory comment.
3568 * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
3569 * m4/macro.c: Adjust old comments.
3570 * modules/README: Typo.
3572 2001-08-07 Akim Demaille <akim@epita.fr>
3574 * config/gnu-obstack.m4: New.
3576 2001-08-07 Akim Demaille <akim@epita.fr>
3578 * config/Makefile.am, config/stackovf.m4: New.
3579 * configure.in, Makefile.am: Adjust.
3581 2001-04-08 Roderick Koehle <Roderick.Koehle@infineon.com>
3583 * modules/format.c (format): Formatting for %f was not
3584 interpreting the position of the decimal point correctly for
3587 2000-12-01 Gary V. Vaughan <gary@gnu.org>
3589 * TODO: Removed m4exit bug.
3590 * modules/load.c (m4_resident_module): Make this module resident.
3591 * module/m4.c (m4_resident_module): Ditto.
3592 * m4/modules.c (m4_module_load): Use new ltdl resident modules
3593 feature to mark modules as resident if they export
3594 `m4_resident_module' as TRUE.
3595 (m4_module_unload): Do not remove resident modules, and take care
3596 with symbol insertion and deletion with resident modules.
3597 * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
3598 use resident modules feature.
3600 2000-11-30 Gary V. Vaughan <gary@gnu.org>
3602 * TODO: Updated. Removed some cruft that has since been fixed
3603 or implemented. Added some more entries.
3606 * modules/README: Updated.
3607 * doc/m4.texinfo: Updated.
3609 * modules/gnu.c (builtin_functions): Make indir orthogonal to
3610 builtin, in that each is recognised as a macro only with parameters
3611 (builtin_indir): Passing 0 arguments is now an error, as with
3614 * src/main.c (usage): Added missing description of `-c' option.
3616 2000-11-29 Gary V. Vaughan <gary@gnu.org>
3618 Consolidate the myriad of dispersed test scripts into the
3619 tests subdirectory. I think I now have all the file where I
3620 want them, so there shouldn't be anymore upheaval =)O|
3622 * tests/Makefile.am: Updated to run the new tests added below.
3623 * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
3624 tests/other-tests/ddivert.test, tests/other-tests/debug.test,
3625 tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
3626 tests/other-tests/foreach.test, tests/other-tests/forloop.test,
3627 tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
3628 tests/other-tests/hanoi.test, tests/other-tests/include.test,
3629 tests/other-tests/indir.test, tests/other-tests/misc.test,
3630 tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
3631 tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
3632 tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
3633 tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
3634 tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
3635 tests/other-tests/reverse.test, tests/other-tests/shadow.test,
3636 tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
3637 tests/other-tests/translit.test, tests/other-tests/undivert.test,
3638 tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
3639 tests/other-tests/wrap.test: New tests based on the contents
3640 of the tests removed below.
3641 * examples/Makefile.am, modules/Makefile.am: Updated to
3642 reflect removed tests.
3643 * examples/defs,modules/defs: Removed.
3644 * examples/capitalize.test, examples/comments.test,
3645 examples/ddivert.test, examples/debug.test,
3646 examples/esyscmd.test, examples/exp.test,
3647 examples/foreach.test, examples/forloop.test,
3648 examples/fstab.test, examples/hanoi.test,
3649 examples/include.test, examples/indir.test,
3650 examples/misc.test, examples/multiquotes.test,
3651 examples/patsubst.test, examples/pushpop.test,
3652 examples/regexp.test, examples/reverse.test,
3653 examples/sysv-args.test, examples/trace.test,
3654 examples/translit.test, examples/undivert.test,
3655 examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
3656 modules/modpath1.test, modules/modpath2.test,
3657 modules/modpath3.test, modules/modpath4.test,
3658 modules/modtest.test, modules/shadow.test,
3659 modules/unfrozen.m4, modules/unload.test: Removed.
3661 Move the implementation of GMP support for the mpeval() builtin
3662 into a loadable module that depends on libgmp. mpeval() and
3663 eval() share a common parser, now in m4/evalparser.c; the code
3664 in m4/numb.c and m4/numb.h is now physically split between
3665 m4/eval.c (the eval() backend) and modules/mpeval.c (the
3666 mpeval() backend), rather than being differentiated by cpp
3667 macros and multiple inclusion. The mpeval module is always
3668 built but will generate an diagnostic if it is used from an
3669 installation that didn't link in the gmp library.
3670 * modules/Makefile.am: build and install the new mpeval module.
3671 * modules/mpeval.c: Now contains the former parts of m4/numb.c
3672 and m4/numb.h that are required for gmp support in mpeval().
3673 * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
3674 * m4/evalmp.c: Removed.
3675 * m4/m4module.h: Removed conditional prototype for
3677 * m4/eval.c: Rewritten. Contains the former parts of m4/numb.c
3678 and m4/numb.h that do not rely on gmp.
3679 * m4/evalparse.c: New file, contains the shared parts of the
3680 eval() and evalmp() parser implementations, and is no longer
3681 unencumbered by cpp magic to uncover the right parts.
3682 * m4/numb.h: Removed. It's former contents are split between
3683 m4/eval.c and modules/mpeval.c.
3686 * tests/other-tests/changeword.test: New test. Rudimentary
3687 testing of changeword builtin runs only if --wnable-changeword
3688 was used at configure time.
3689 * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
3690 alternation correctly. Split into two expressions to compensate.
3691 * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
3692 * modules/Makefile.am: Build changeword module.
3693 * modules/changeword.c (m4_macro_table): Define __m4_changeword__
3694 only when --enable-changeword was passed to configure.
3695 (builtin_changeword): If --enable-changeword was not used, then
3696 report that changeword() builtin has no support in m4 binary.
3698 2000-11-28 Gary V. Vaughan <gary@gnu.org>
3700 * src/main.c (main): Fixed a particularly nasty bug is
3701 user_search_path setting -- the -M flag processing must be
3702 extremely careful with search path ordering, or else the default
3703 installed module directory (possibly containing modules from a
3704 previous release) is placed earlier in the search path than any -M
3705 arguments (which are relied upon to load uninstalled modules with
3706 most of the tests in the regresion suite).
3708 * modules/load.c (builtin_load): Nasty hack to prevent adding
3709 symbols to symtab again if a module is loaded more than once.
3710 * modules/m4.c (builtin_ifelse): removed unused variable argv0.
3712 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed a
3713 possible NULL pointer dereference.
3715 * m4/module.c (m4_module_find_by_modname): Renamed from
3716 m4_module_modname_find. Fixed all references.
3717 (m4_module_find_by_builtin): New function.
3719 * modules/modfreeze.test: load the `load' module with each
3721 * src/freeze.c (produce_frozen_state): Simplified in light of
3722 module field in m4_symbol. Allow a third argument for text macros
3723 to name the originating module.
3724 (reload_frozen_state): ditto.
3725 * m4/m4module.h: Fixup prototypes.
3726 * m4/builtin.h (m4_builtin_define): Add a module argument so
3727 that symbols can be registered against the defining module.
3728 (m4_macro_define): ditto.
3729 * m4/m4private.h (m4_symbol): Make the module field const to save
3730 on casting in the rest of the code.
3731 (SYMBOL_MODULE): New macro.
3733 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
3734 symbol reference maintenance bugs when removing a symbol from the
3737 * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
3739 2000-11-27 Gary V. Vaughan <gary@gnu.org>
3741 * configure.in (m4_cv_func_obstack): A better check for whether
3742 libc has an obstack implementation.
3743 * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
3745 * configure.in (--with-modules): Changed semantics. This
3746 option is now used to list modules to be preopened.
3747 * src/m4.h: #include "ltdl.h" unconditionally.
3748 * src/main.c: Removed all dependencies on WITH_MODULES.
3749 * src/freeze.c: ditto.
3750 * modules/Makefile.am: ditto.
3751 * m4/m4.c (builtin_m4exit): ditto.
3752 * modules/modpath1.test: ditto.
3753 * modules/modpath2.test: ditto.
3754 * modules/modpath3.test: ditto.
3755 * modules/modpath4.test: ditto.
3756 * modules/modtest.test: ditto.
3757 * modules/shadow.test: ditto.
3758 * modules/unload.test: ditto.
3760 * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
3761 comes up on demand in LTLIBOBJS now.
3762 * configure.in (getopt_long): Creating and relying on a link for
3763 getopt.h on hosts with no getopt_long() of thier own works
3764 correctly now. This is necessary so that callers of getopt_long()
3765 can simply `#include <getopt.h>': the naive way of doing this
3766 would end up using our own getopt.h and the installed
3767 getopt_long(), which is asking for trouble!
3768 (obstack_init): A similar argument applies to obstack.h and
3771 * m4/ltdl.c: Upgraded to latest bleeding edge version again.
3772 On Solaris-2.5 (at least) the native dlopen implementation
3773 gets confused about m4.o when looking for module "m4". This
3774 version always looks for .la an .$lib_ext suffixed names first
3775 to work around the problem. Sigh.
3777 * po/POTFILES.in: Take account of these file movements.
3778 * src/Makefile.am (m4_SOURCES): removed eval.c.
3779 (EXTRA_m4_SOURCES): removed numb.c and numb.h.
3780 * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
3781 (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
3782 * modules/m4.c (builtin_eval): Use m4_evaluate().
3783 * m4/eval.c: Moved here from src/eval.c to facilitate
3784 implementation of eval() builtin as part of the `m4' loadable
3786 (m4_evaluate): renamed from evaluate for namespace cleanliness.
3787 * m4/numb.c: Moved here from src/numb.c, since it is #included
3788 into eval.c at compile time.
3789 * m4/m4module.h (m4_evaluate): Added prototype.
3790 * src/m4.h (evaluate): Removed prototype.
3792 2000-11-25 Gary V. Vaughan <gary@gnu.org>
3794 * modules/perl.c (builtin_perleval): Use PL_na for
3795 compatibility with perl-5.6.
3797 * src/main.c (main): It is now safe to
3798 ``m4_module_install("m4")'', without tripping over the m4
3800 * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
3801 versions having fixed the insidious module search order bug.
3803 * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
3804 supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
3806 * configure.in: Figure out whether to use the installed
3807 getopt.h or the supplied one.
3808 * src/Makefile.am: ditto.
3810 * po/POTFILES.in: List files in their new positions.
3812 * config/ltmain.sh: This needs to be checked in to match the
3813 libtool macros copied to acinclude.m4 (until a released
3814 libtool copes with m4's needs).
3815 * bootstrap: Run gettextize.
3817 2000-11-24 Gary V. Vaughan <gary@gnu.org>
3819 * AUTHORS: Added my details.
3822 * bootstrap: temporary update until released libtool catches up.
3824 * All files: Use new GNU GPL copyright blurb with current contact
3827 * configure.in (LTLIBOBJS): Use canonical code for calculation of
3830 * config: renamed acm4 directory to config to be more like
3831 other autoconfiscated packages.
3833 * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
3834 * config/debug.m4: New file implementing configure macros to add
3835 suitable debug flags to the compiler invocation.
3837 * modules/load.c: New file implementing the ``load'' and
3838 ``unload'' builtins.
3839 * tests/get-them: Set the module search directory to the modules
3840 build directory in generated tests.
3841 * modules/shadow.test: ditto.
3842 * modules/modtest.test: ditto.
3843 * modules/modpath1.test: ditto.
3844 * modules/modpath2.test: ditto.
3845 * modules/modpath3.test: ditto.
3846 * modules/modpath4.test: ditto.
3847 * modules/modtest.test: ditto.
3848 * modules/modfreeze.test: ditto.
3849 * modules/unload.test: ditto.
3851 * modules/changeword.c: New file implementing the ``changeword''
3852 builtin as a loadable module.
3853 * modules/mpeval.c: New file implementing the ``mpeval'' builtin
3854 as a loadable module.
3856 * src/main.c (main): Load the gnu module if m4 was started
3857 normally -- i.e. without the -G option.
3858 * modules/gnu.c: New file implementing a new loadable module wuth
3859 definitions for all the gnu extension builtins.
3860 * modules/format.c: Moved here from src/format.c. Now included
3863 * src/main.c (main): Load the traditional module if m4 was
3864 started in `no_gnu_extensions' mode.
3865 * modules/traditional.c: New file implementing the ``unix'' macro,
3866 required when m4 is executed in traditional mode, as a loadable
3869 * src/main.c: Renamed from m4.c to avoid confusion with
3871 (main): Always load the m4 module.
3872 * modules/m4.c: New file implementing a new loadable module with
3873 definitions for all m4 builtins that are not gnu extensions.
3875 * m4/Makefile.am: Adjusted to take new files below into account.
3876 * m4/m4module.h: Prototypes for exported functions and types moved
3877 to this directory from the src directory.
3878 * m4/m4private.h: Moved here from src/m4private.h to facilitate
3879 the migration of all builtin implementations to loadable modules.
3880 * m4/macro.c: Moved this file here from the src directory,
3881 renaming all exported symbols to use the prefix ``m4_''.
3882 * m4/builtin.c: ditto.
3883 * m4/module.c: ditto.
3884 * m4/symtab.c: ditto.
3885 * m4/debug.c: ditto.
3886 * m4/input.c: ditto.
3887 * m4/output.c: ditto.
3889 * m4/ltdl.h, m4/ltdl.c: ditto.
3890 * m4/utility.c: Odd functions moved here from files in the src
3891 directory to facilitate builtin migration.
3893 2000-08-12 Gary V. Vaughan <gary@gnu.org>
3895 * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
3896 error message, to make translators' jobs a little easier.
3897 (builtin_builtin): ditto.
3898 (builtin_traceon): ditto.
3899 (builtin_traceoff): ditto.
3900 Reported by Akim Demaille <akim@epita.fr>
3902 * m4/Makefile.am (pkgincdir): Deleted. Use automake's built in
3903 pkgincludedir instead.
3905 * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
3906 it is exported globally. Fixed all references.
3910 (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
3911 globally. Fixed all references.
3912 (DEF_LQUOTE): ditto.
3916 2000-07-28 Gary V. Vaughan <gary@gnu.org>
3921 * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
3922 (AC_OUTPUT): touch stamp-h.in, not stamp-h.
3924 * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
3925 Removed `Prev', `Next' and `Up' fields of all @nodes now that
3926 makeinfo calculates them for us, and to make any future
3927 reorganisation easier.
3928 (Frozen files): Document format version 2.
3929 `V' now takes argument `2'.
3930 `F' can take a single argument if symbol and builtin names
3931 are the same, or 3 arguments if the builtin is from a module.
3932 New `S' specification for saving syntax table contents.
3933 New `M' specification for saving loaded module names.
3934 * src/freeze.c: Implement them.
3935 * src/input.c (syntax_code): For interpreting frozen syntax
3938 * examples/Makefile.am: Add the contents of the WWW directory to
3940 * examples/WWW/Makefile: ditto,
3941 (%.htm): Compares file contents (not just sizes) to determine
3942 whether a change has occured.
3943 * examples/WWW/_header.htm: Bumped version number.
3944 * examples/WWW: Regenerated content.
3946 * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
3947 compilers comes much easier without ansi2knr.
3948 * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
3950 * m4/list.c: New generic list container type.
3951 * m4/list.h: Interface to new container type.
3952 * m4/Makefile.am (pkginc_HEADERS): Install list.h.
3953 (libm4_la_SOURCES): compile and link list.c.
3954 * src/builtin.c (builtin_tables): Use list container.
3955 * src/module.c (symtab): ditto.
3956 * src/symtab.c (symtab): ditto.
3958 * m4/system.h: New file for common preprocessor definitions.
3959 * m4/Makefile.am (pkginc_HEADERS): install system.h.
3960 * m4/error.c: Use system.h in place of inline preprocessor.
3961 * m4/error.h: ditto.
3962 * m4/module.c: ditto.
3963 * m4/module.h: ditto.
3964 * m4/xmalloc.c: ditto.
3966 * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
3968 * m4/xmalloc.c (xmalloc_exit_failure): ditto.
3970 * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
3971 it is exported globally. Fixed all references.
3973 (module_init_t): ditto.
3974 (module_finish_t): ditto.
3975 (token_data): ditto.
3976 (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
3977 it is exported globally. Fixed all references.
3978 (SYNTAX_IGNORE): ditto.
3979 (SYNTAX_SPACE): ditto.
3980 (SYNTAX_OPEN): ditto.
3981 (SYNTAX_CLOSE): ditto.
3982 (SYNTAX_COMMA): ditto.
3983 (SYNTAX_DOLLAR): ditto.
3984 (SYNTAX_ACTIVE): ditto.
3985 (SYNTAX_ESCAPE): ditto.
3986 (SYNTAX_ALPHA): ditto.
3987 (SYNTAX_NUM): ditto.
3988 (SYNTAX_ALNUM): ditto.
3989 (SYNTAX_LQUOTE): ditto.
3990 (SYNTAX_RQUOTE): ditto.
3991 (SYNTAX_BCOMM): ditto.
3992 (SYNTAX_ECOMM): ditto.
3993 (SYNTAX_VALUE): ditto.
3994 (SYNTAX_MASKS): ditto.
4012 (TOKEN_NONE): ditto.
4013 (TOKEN_STRING): ditto.
4014 (TOKEN_SPACE): ditto.
4015 (TOKEN_WORD): ditto.
4016 (TOKEN_SIMPLE): ditto.
4017 (TOKEN_MACDEF): ditto.
4019 * m4/m4module.h (voidstar): Removed in favour of `VOID' for
4020 consistency. Fixed all references.
4021 (STRING): Renamed to `m4_string' for consistency, and because if
4022 is exported globally. Fixed all references.
4023 (token_type): Renamed to `m4_token_t' for the same reasons.
4024 (token_data_type): Renamed to `m4_token_data_t' for the same
4027 * m4/m4module.h (XCALLOC): Wrapper macro which handles type
4031 (XFREE): Wrapper macro which avoids freeing NULL pointers.
4033 * m4/m4module.h (m4_macro): New type for module defined user
4035 * modules/modtest.c (m4_macro_table): Define module user macros.
4036 * modules/shadow.c (m4_macro_table): ditto.
4038 * m4/m4module.h (M4BUILTIN_HANDLER): For defining handlers
4039 declared with M4BUILTIN.
4041 * m4/xmalloc.c: Use memset if bzero is not available when
4042 emulating calloc with malloc.
4043 (xcalloc): Fallback to malloc/bzero if calloc is not available.
4044 (xfree): Added for consistency. Will not try to free NULL
4046 * src/m4.c (xfree): Deleted in favour of the above.
4047 * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
4048 linking with libdmalloc.
4049 * m4/xstrdup.c (WITH_DMALLOC): ditto.
4051 * modules/frozen.m4: New test case.
4052 * modules/unfrozen.m4: ditto.
4053 * modules/modfreeze.test: New test.
4054 * modules/unload.test: ditto.
4055 * modules/Makefile.am (EXTRA_DIST): Distribute them.
4057 * modules/modpath1.test: Don't try this test if module support is
4059 * modules/modpath2.test: ditto.
4060 * modules/modpath3.test: ditto.
4061 * modules/modpath4.test: ditto.
4062 * modules/modtest.test: ditto.
4063 * modules/shadow.test: ditto.
4065 * modules/perl.c: New module.
4066 * modules/perl.m4: Example of using it.
4067 * modules/Makefile.am (perl_la_SOURCES): Build new perl module.
4069 * src/m4.c (main): Assume interactive mode if STDIN is connected
4071 Changed startup sequence slightly so that syntax is not
4072 initialised from here when loading a frozen file.
4074 * src/builtin.c: Much improved macro definition style.
4075 * src/m4private.h: Internal structures for m4_builtin and
4076 m4_macro instances. These are not exposed to module writers.
4077 * src/module.c (module_modname_find): Find a module structure
4079 (make_macro_table): Build an internal macro table from a external
4081 (make_builtin_table): Build an internal builtin table from an
4082 external definition.
4084 * src/module.c (module_unload): Be extremely careful to remove
4085 builtins and macros that match the module being unloaded -- no
4086 longer assume that the top element can be removed incase another
4087 odule defines an identical name.
4088 * src/symtab.c (remove_table_reference_symbols): remove all symbol
4089 table entries which refer to a given builtin table.
4090 * src/builtin.c (remove_tables): Use it!
4092 2000-07-13 Thomas Tanner <tanner@ffii.org>
4094 * Makefile.am (SUBDIRS): we need modules/ for "make dist"
4095 * acm4/modules.m4: deleted
4096 * bootstrap: don't libtoolize libltdl!
4097 * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
4098 if set, enable WITH_MODULES and add modules to DLPREOPEN
4099 * examples/misc.test: redirect standard output
4100 * lib/Makefile.am: don't use DLLDFLAGS
4101 * lib/m4module.c: include necessary headers to silence GCC -Wall
4102 * lib/m4regex.c: fixes to silence GCC -Wall
4103 * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
4104 build modules conditionally
4105 * modules/shadow.c: define symbol aliases before using them
4106 * modules/test.c: define symbol aliases before using them
4107 * po/de.po: update translation
4108 * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
4109 pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
4111 * src/m4.c: initialize libltdl's preloaded symbols via
4112 LTDL_SET_PRELOADED_SYMBOLS
4113 * src/module.c: libltdl's memory management must be initialized
4114 before calling lt_dlinit!, fix warnings
4116 2000-01-18 Gary V. Vaughan <gary@gnu.org>
4118 * README: Caveat about nls not supported by dll architecture on
4121 * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
4123 * tests/Makefile.am (stamp-TESTS): now works with VPATH.
4124 * src/Makefile.am (m4_LDADD): use $(builddir) for VPATH.
4125 * modules/Makefile.am (LIBS): ditto.
4126 (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
4127 $(top_srcdir)/m4 (for only <m4module.h>).
4128 * modules/shadow.test: fixed for VPATH.
4129 * modules/modtest.test: ditto.
4130 * modules/modpath4.test: ditto.
4131 * modules/modpath3.test: ditto.
4132 * modules/modpath2.test: ditto.
4133 * modules/modpath1.test: ditto.
4135 * modules/time.test: Removed due to timezone dependence,
4136 * modules/Makefile.am (TESTS): Removed time.test.
4138 * configure.in: Use $3 of AC_DEFINE so that we can,,,
4139 * acconfig.h: Remove everything except the gettext parameters.
4140 * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
4142 * acm4/ltdl.m4: Updated to latest from libtool cvs.
4143 * acm4/modules.m4: Remove code which duplicates ltdl.m4 and
4144 increment serial number.
4146 * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
4147 src dir and immediately after libm4 is built for confidence that
4148 it doesn't rely on the src directory.
4149 (SUBDIRS): Moved doc dir to the end since helptoman.pl and
4150 makeinfo stop the build on cygwin (because they don't work).
4152 * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
4154 * m4/m4private.h: ...is not a public header, so moved to src.
4155 Add `#include <config.h>', `#define _COMPILING_M4' and
4157 * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
4158 * src/Makefile.am (noinst_HEADERS): add m4private.h.
4159 * src/builtin.c: `#include "m4private.h"' now takes care of the
4160 above. Duplicates removed.
4161 * src/debug.c: ditto.
4162 * src/eval.c: ditto.
4163 * src/evalmp.c: ditto.
4164 * src/format.c: ditto.
4165 * src/freeze.c: ditto.
4166 * src/input.c: ditto.
4168 * src/macro.c: ditto.
4169 * src/module.c: ditto.
4170 * src/numb.h: ditto.
4171 * src/output.c: ditto.
4172 * src/path.c: ditto.
4173 * stackovf.c: ditto.
4176 * po/POTFILES.in: compensate for renaming of lib/*.
4177 * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
4178 (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
4179 and then in $(top_srcdir)/lib (for eg. "m4private.h").
4180 * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
4182 * m4/m4error.h: Renamed error.h, for installation to
4183 $prefix/include/m4..
4184 * m4/m4obstack.h: Renamed obstack.h, for same reason.
4185 * m4/m4regex.h: Renamed regex.h, for same reason.
4186 * m4/m4error.c: Renamed error.c, and use #include "error.h".
4187 * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
4188 * m4/m4regex.c: Renamed regex.c, and fix #includes.
4190 * lib: moved to m4 to easily support header installation to
4192 * Makefile.am (SUBDIRS): renamed lib dir to m4.
4193 * configure.in (AC_OUTPUT): reference m4/Makefile.in.
4194 * acm4/regex.m4: Point to m4/regex.c.
4196 * examples/foreach.m4: Sanitise quoting.
4197 * examples/foreach.test: New torture test.
4198 From Akim Demaille <akim@epita.fr>
4200 2000-01-17 Gary V. Vaughan <gary@gnu.org>
4202 * src/ltdl.c: Use access() to abort doomed module load attempts
4203 if module file does not exist.
4205 * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
4206 getopt1.o will already be used if appropriate, so I moved getopt.c
4207 and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
4209 * modules/modpath1.test: Use correct filename in header line.
4210 * modules/modpath2.test: ditto.
4211 * modules/modpath3.test: ditto.
4212 * modules/modpath4.test: ditto.
4214 Without these changes lt_dlopen("test") attempts to
4215 LoadLibrary("/bin/test") on Windows, which although harmless
4216 generates a spurious error message which spoils most of the tests:
4217 * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
4218 (TESTS): s/test.test /modtest.test /
4219 (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
4220 (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
4221 * modules/modpath1.test: s/test.m4 /modtest.m4 /
4222 * modules/modpath2.test: ditto.
4223 * modules/modpath4.test: ditto.
4224 * modules/modpath3.test: s/-m test /-m modtest /
4225 * modules/shadow.m4: use {un,}loadmodule(`modtest').
4227 2000-01-16 Gary V. Vaughan <gary@gnu.org>
4229 * src/ltdl.c (find_file): Updated to new version with fixed memory
4230 allocation bug in `next'.
4231 * src/ltdl.h: updated to match.
4233 * modules/Makefile.am: Cleaned up and reordered.
4235 2000-01-16 René Seindal <rene@seindal.dk>
4237 * modules/Makefile.am (TESTS): New tests for the module system.
4239 * modules/*.test: New files.
4241 * src/m4.c (main): Added call to module_init().
4242 Treats -M and -m as the arguments -D -U and -t, ie deferred.
4244 * src/m4.h: Added declaration of module_init().
4246 * src/module.c (module_init): No longer static
4248 * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
4249 Added to shut up automake about non standard libtool library
4252 * src/module.c: Disabled DEBUG by default.
4254 * modules/README: Changed example from unload.m4 to shadow.m4
4256 * modules/shadow.m4: Renamed from unload.m4
4258 * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
4260 * src/m4.c (main): Functionality for -m and -M were reversed.
4263 2000-01-12 Gary V. Vaughan <gary@gnu.org>
4265 * doc/help2man.pl: updated to version 1.020.
4267 * lib/COPYING.LIB: updated to version 2.1.
4269 * lib/m4module.h: restructure the M4_SCOPE code to work when
4270 creating a dll which links with libm4.la and both DLL_EXPORT
4271 (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
4274 2000-01-11 Gary V. Vaughan <gary@gnu.org>
4276 Merged the following changes from my tree:
4278 1999-06-15 Gary V. Vaughan <gary@gnu.org>
4280 * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
4281 ported to compile shared libs.
4283 * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
4284 use `__declspec(dllimport)' when linking libm4.la on win32.
4285 * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
4287 * configure.in (M4OBJS): Discover whether we need the shipped
4288 implementation of getopt_long.
4289 * src/Makefile.am (m4_LDADD): Link the getopt objects into the
4290 main binary here, as opposed to the module library in lib/libm4.la.
4292 1999-06-14 Gary V. Vaughan <gary@gnu.org>
4294 * modules/README: Updated to describe the improved libltdl based
4296 * README (cygwin): Added some compilation notes for building m4
4297 correctly under cygwin.
4298 * TODO: Cleaned out the entries for the module system since they
4299 are now implemented.
4301 * *.[ch]: __P is in the compiler's reserved namespace, so replaced
4302 all instances of __P with M4_PARAMS.
4304 * lib/getdate.h: removed unreferenced file.
4306 * lib/m4private.h: New file to define the private interface to the
4307 token_data struct, which must be shared between m4module.c, and
4308 builtin.c but not exported to modules built from the installed
4309 m4module.h since it's size changes depending on compile time
4312 * src/m4.h: Lots of stuff moved to lib/m4module.h.
4314 * lib/m4module.h: New file to define the interface available when
4315 compiling m4 modules.
4316 * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
4317 necessary for module compilation into this new file.
4319 * lib/Makefile.am (include_HEADERS): install headers (renamed to
4320 avoid nameclash with other system headers) necessary for compiling
4322 (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
4323 so that modules can include the (renamed) installed headers and
4324 be guaranteed a matching implementation.
4325 * lib/m4error.h: renamed from error.h.
4326 * lib/m4obstack.h: renamed from obstack.h.
4327 * lib/m4regex.h: renamed from regex.h.
4328 * configure.in (AC_REPLACE_FUNCS): Don't look for a system
4329 implementation, simply include the shipped version
4330 unconditionally, otherwise it is hard for a module to know
4331 whether the m4obstack.h header it is using matches the
4332 implementation it ends up linking against.
4333 (jm_WITH_REGEX): Include regex into libm4 unconditionally for
4336 1999-05-18 Gary V. Vaughan <gary@gnu.org>
4338 * examples/misc.test: Don't run this test on machines which don't
4339 have a root user in /etc/passwd (e.g. cygwin).
4341 * tests/get-them (/^@example$/): Error messages might have a
4342 ``.exe'' suffix to the program name, or else use the libtool
4343 ``.libs/lt-m4'' binary, or generally have an unexpected path. All
4344 of these cases are now catered for when comparing error messages
4346 * tests/other-tests/*.test: ditto.
4347 * examples/*.test: ditto.
4349 * tests/defs (M4): use libtool execute mode.
4350 * examples/defs (M4): ditto.
4352 * tests/get-them (END): explicitly close any open file.
4353 (printthem): In a regular expression, '{' is the start of a repeat
4354 count! Use `[{]' for a literal open brace.
4355 (/^@node /): Don't use substr on a string shorter than the trim
4358 1999-05-17 Gary V. Vaughan <gary@gnu.org>
4360 * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
4362 (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
4364 2000-01-10 Andreas Schwab <schwab@suse.de>
4366 * tests/other-tests/gmp.test: Find config.sh in build directory.
4368 * configure.in: Find tests/mkconfig.sh in $srcdir.
4370 * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
4371 <signal.h> (for SUS2 compliant systems).
4373 * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
4376 2000-01-10 René Seindal <rene@seindal.dk>
4380 * TODO, NEWS: Cleaned up and updated.
4382 * src/m4.c (main): New variable exit_status for exit status in
4383 case of unreadable files. Now m4 will exit with EXIT_FAILURE if a
4384 file cannot be read instead of EXIT_SUCCESS.
4386 * src/builtin.c (m4_indir): Changed error message to help
4387 translators (from Akim Demaille <demaille@inf.enst.fr>).
4389 * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
4392 * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
4395 * src/input.c (match_input): Reordering of code, to avoid multiple
4396 calls to push_string_init() from obstack_grow(), which can happen
4397 with some compilers (found and fixed by James Bonfield
4398 <jkb@mrc-lmb.cam.ac.uk>).
4400 * src/stackovf.c: Added prototypes for ultrix.
4401 (setup_stackovf_trap): Added __P to cast.
4402 (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
4404 2000-01-09 René Seindal <rene@seindal.dk>
4406 * doc/m4.texinfo (Changequote): Added comment about changing
4407 quotes when the old quote is a part of the new.
4409 * src/builtin.c (expand_ranges): Added break after trailing dash.
4410 This caused misbehavious on some systems (found and fixed by Akim
4411 Demaille <demaille@inf.enst.fr>).
4413 * AUTHORS: Thomas Tanner included
4415 * acconfig.h: Added entry for ss_sp (see below).
4417 * configure.in (use_stackovf): Added check for stack_t with member
4418 ss_base instead of ss_sp (BSDI notably). (Reported by Paul Eggert
4419 <eggert@twinsun.com>).
4421 * doc/m4.texinfo (Frozen files): Added a simpler example for
4422 generating frozen files from several input files.
4424 1999-11-14 Paul Eggert <eggert@twinsun.com>
4426 * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
4427 lib/regex.c, lib/xmalloc.c.
4429 1999-11-10 René Seindal <rene@seindal.dk>
4431 * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
4433 * src/module.c: reindented.
4434 (module_load): return if this is a repeated load of same module.
4435 (module_init): slight change of logic to avoid repeated
4436 initialisation debug messages.
4438 * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
4439 in the distribution.
4441 * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
4442 automake warnings about missing lib prefix.
4443 (time_la_LDFLAGS): ditto
4444 (stdlib_la_LDFLAGS): ditto
4446 1999-11-10 Paul Eggert <eggert@twinsun.com>
4448 * src/m4.h: Include error.h, since our macros use error.
4449 * src/m4.c: Don't need to include error.h.
4451 1999-11-09 Paul Eggert <eggert@twinsun.com>
4453 * src/m4.h (voidstar): Define to void * if __STDC__ is defined
4454 and zero, as Solaris 7 cc does.
4455 (bcopy): Remove macro; no longer needed with new obstack.h.
4457 * src/output.c (freeze_diversions): Don't assume that a
4458 diversion size can fit in `int'. Check for diversion file
4459 size too large to be printed with `unsigned long'.
4461 * src/Makefile.am (CFLAGS): Omit -Wall.
4463 * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
4465 * src/debug.c (trace_format):
4466 Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
4468 * src/freeze.c (produce_frozen_state):
4469 Don't assume string lengths fit in int.
4471 1999-10-13 René Seindal <rene@seindal.dk>
4473 * configure.in (ALL_LINGUAS): Added Greek translation (el).
4474 (ALL_LINGUAS): Added Czech translation (cs).
4476 1999-03-30 Gary V. Vaughan <gary@gnu.org>
4478 * src/builtin.c: moved module loading functions into...
4479 * src/module.c: entirely new implementation using libltdl.
4480 * po/POTFILES.in: added src/module.c.
4481 * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
4482 are modules, not linktime libraries.
4483 (LDFLAGS): added -no-undefined -module and -avoid-version flags.
4484 * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
4485 avoidance on exported symbols.
4486 * modules/test.c (m4_macro_table, m4_init_module,
4487 m4_finish_module): ditto.
4488 * modules/time.c (m4_macro_table): ditto.
4490 * modules/time2.m4: new file which requires command line loading
4492 * src/m4.c (--load-module): dynamically load named runtime module
4493 into running executable before reading the source.
4494 (--module-directory): prepend a directory to the module search
4496 (module_init()): Do this the first time we load a module instead;
4497 if the module subsystem is broken normal m4 scripts can still run.
4498 * src/m4.h (install_builtin_table): is now exported.
4500 1999-03-26 Gary V. Vaughan <gary@gnu.org>
4502 * src/module.c: removed. No longer required.
4503 * po/POTFILES.in: removed src/module.c.
4505 * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
4506 the bootstrap script can recreate.
4507 * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
4508 * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
4509 * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
4510 * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
4511 (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
4512 * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
4513 * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
4514 * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
4516 * acinclude.m4: removed. `aclocal -I acm4' handles this much
4518 * acm4/Makefile.am (ACINCLUDE_M4): ditto.
4519 * acm4/gettext.m4: removed. It causes a multiple definition vs.
4520 the installed gettext.m4 file when running aclocal.
4522 1999-03-25 Gary V. Vaughan <gary@gnu.org>
4524 * configure.in (AM_INIT_AUTOMAKE): bumped version number to
4525 distinguish this from the last prerelease.
4526 (AC_LIBLTDL_CONVENIENCE): build libltdl as a convenience library
4527 in its own subdirectory.
4529 * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
4530 lib prefix on a module" feature.
4531 (LDFLAGS): Added `-module -avoid-version' flags to build
4532 versionless module libraries.
4533 * src/builtin.c (m4_load_module): use libltdl.
4534 (module_unload_all): use libltdl.
4535 * src/m4.c (module_init): initialise module loading on demand for
4536 better diagnostics, and so that m4 will still work even if
4537 the module code is broken.
4538 * src/m4.h (module_init): removed. No longer relevant.
4539 * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
4540 exported symbols for compatibility with dlpreopening.
4541 * modules/test.c (m4_macro_table, m4_init_module,
4542 m4_finish_module): ditto.
4543 * modules/time.c (m4_macro_table): ditto.
4545 * bootstrap: New file. Runs all the autoutils in the right order
4546 after a fresh checkout, or a make maintainer-clean.
4548 1999-02-18 Akim Demaille <demaille@inf.enst.fr>
4550 * src/builtin.c (dump_symbols): New function, factoring common
4551 content of m4_dumpdef and m4_symbols.
4552 (m4_dumpdef): Use it.
4553 (m4_symbols): New function, implementing `symbols'. Use it.
4554 * doc/m4.texinfo: Fixed missing commas after @xref, so that the
4555 file compile with modern makeinfo.
4556 (Symbols): New node, documenting symbols.
4557 (direntry): Modernize.
4559 1998-12-11 René Seindal <rene@seindal.dk>
4561 * src/builtin.c (predefined_tab): New predefined macros
4562 __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
4563 configure time options.
4565 1998-12-01 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
4567 * src/module.c (module_try_load): Don't try to be clever and
4568 overwrite argument string. Instead allocate all constructed
4569 strings locally, since they can have arbitrary lengths. Make
4570 arguments pointers to const.
4571 (module_search): Simplify due to above change.
4573 1998-11-29 René Seindal <rene@seindal.dk>
4577 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
4579 * tests/other-tests/import-environment.{m4,test}: New test.
4581 * tests/other-tests/discard-comments.{m4,test}: New test.
4583 * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
4585 * src/m4.c (main): New option -c --discard-comments.
4586 New global variable discard_comments.
4588 * src/m4.h (token_type): New TOKEN_NONE for tokens to be
4589 discarded, ie never returned from next_token().
4590 Added declaration of discard_comments.
4592 * src/input.c (next_token): Now loops until token type is not
4593 TOKEN_NONE. Comments are now given this type when comments should
4596 * doc/m4.texinfo (Invoking m4): Updated for --import-environment
4599 1998-11-28 René Seindal <rene@seindal.dk>
4601 * src/m4.c (main): New option --import-environment (no single
4604 * When configured with --with-gmp both the normal (fast) eval()
4605 and the gmp aware mpeval() are defined. To restore previous
4606 bahaviour use "define(`eval', defn(`mpeval'))".
4608 * tests/other-tests/gmp.m4: Changed to use mpeval().
4610 * src/evalmp.c: New file for compiling eval.c as gmp aware.
4611 Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
4613 * src/eval.c: Now includes "numb.c" directly. Everything in this
4614 file must by static, except evaluate(), which is changed to
4615 mp_evaluate() if USE_GMP in force.
4617 * src/numb.c: Changed to be included by eval.c instead of being
4618 compiled separately. Everything is declared static.
4620 * src/numb.h: Removed declarations of functions, as numb.c is now
4623 * src/builtin.c: Declaration of m4_mpeval() added.
4624 Inserted `mpeval' in builtin table.
4625 (do_eval): New function with common code for m4_eval and m4_mpeval.
4626 (m4_mpeval): New function for gmp version of eval.
4628 * src/m4.h: Declaration of mp_evaluate().
4630 * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
4631 (EXTRA_m4_SOURCES): Now has numb.c and numb.h
4633 * src/m4.c (main): m4 --version also shows which options were used
4634 for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
4636 1998-11-27 René Seindal <rene@seindal.dk>
4638 * Error messages now always print program name before input file
4639 name as specified by GNU coding standards. Reported by Akim
4640 Demaille <demaille@inf.enst.fr>.
4642 * doc/m4.texinfo (Include): Change due to changed error message
4646 * tests/get-them: Minor change to sed script due to changed error
4649 * src/m4.c (print_program_name): New func used to print program
4650 name, input file and line number in error (). Used as an
4651 error_print_progname handler.
4652 (reference_error): Removed.
4653 (main): Assigns error_print_progname.
4655 * src/m4.h (M4ERROR): Removed reference_error ().
4657 1998-11-25 René Seindal <rene@seindal.dk>
4659 * Updated to libtool 1.2b.
4661 * src/builtin.c (install_builtin_table): Added braces to avoid
4662 warning of ambiguous 'else'.
4664 * src/module.c: Inserted search path code from path.c modified to
4666 (module_init): Configured default path used only if M4MODPATH is
4668 (module_try_load): Now reads libMODULE.la as generated by libtool
4669 for actual module name.
4670 (module_load): Gives better error messages on failure.
4672 * src/m4.h: Added declarations of structures and functions for
4673 generic search path handling.
4675 * src/path.c: Removed all module specific code and introduced new
4676 functions of more generic search path handling.
4678 1998-11-24 René Seindal <rene@seindal.dk>
4680 * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
4681 included gettext, as <libintl.h> might not be found
4682 otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
4684 1998-11-22 René Seindal <rene@seindal.dk>
4686 * src/output.c (insert_diversion): Fixed bug that might cause m4
4687 to read from standard output! Triggered by input
4688 'divert(1)undivert(0)'. Test for divnum>0 changed to divnum>=0,
4689 so now 'undivert(0)' does nothing.
4691 1998-11-18 René Seindal <rene@seindal.dk>
4695 * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
4696 could be changed when compiling a illegal regexp, causing later
4697 use of the regexp to dump core.
4699 * src/module.c (module_load): Changed error message to conform to
4702 * src/m4.c (usage): Added message about reporting bugs.
4704 * doc/m4.texinfo (Changeword): Corrected a wrong example.
4705 (Changeword): Added note about the type of regexps used.
4707 * ltconfig, ltmain.sh: New files from Libtool 1.2.
4709 * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
4710 and AM_PROG_LIBTOOL.
4712 * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
4715 * modules/Makefile.am: Changed completely to compile modules using
4716 libtool. The modules are compiled as shared libraries, and are
4717 renamed when installed.
4719 * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
4720 USE_SHL_LOAD to HAVE_SHL_LOAD
4722 * src/builtin.c (shipout_string): Now tests for a NULL string.
4724 * src/module.c: New level of indirection around non-portable
4725 functions to load shared objects. Intended to encapsulate the non
4726 portable parts better and to reduce the number of #ifdefs in the
4729 * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
4730 directory modules/ to the distribution.
4732 1998-11-15 René Seindal <rene@seindal.dk>
4736 * modules/stdlib.c: New module `stdlib' defining some standard
4737 functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
4738 getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
4740 * src/builtin.c (shipout_string): New convenience function for
4741 builtins and modules.
4743 * src/module.c (module_load): Tentative support for
4744 shl_load/shl_findsym, but I cannot test it. Copied from MetaHTML.
4746 * Makefile.am (SUBDIRS): Directory modules added if configured.
4748 * modules/Makefile.am: Now correctly compiles and installs
4749 modules in pkglibexecdir.
4751 * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
4752 These two are now initialised by autoconf macros.
4754 * src/path.c (module_env_init): MODULE_PATH is always on the
4757 * src/Makefile.am: Now generated pathconf.h which defined the
4758 default MODULE_PATH.
4760 * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
4761 where modules are installed.
4763 * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
4764 by Brian J. Fox <bfox@datawave.net>. This change allow modules to
4765 build and install automatically, and it is prepared for other
4766 interfacec than dlopen().
4768 * src/builtin.c (predefined_tab): Added __m4_version__ for the
4769 current version of GNU m4. It is a GNU extension.
4771 1998-11-14 René Seindal <rene@seindal.dk>
4773 * tests/Makefile.am (GENERATED_TESTS): Added new
4774 generated-tests/changesy.8.test
4776 * doc/m4.texinfo (Changesyntax): Documentation for escape
4779 * src/macro.c (expand_token): Check for escaped macro call before
4780 symbol table lookup.
4782 * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
4785 * src/input.c: New static variable use_macro_escape, which is TRUE
4786 iff some character has code SYNTAX_ESCAPE
4787 (input_init): Added initialisation of use_macro_escape.
4788 (check_use_macro_escape): New function to synchronise
4789 use_macro_escape with the syntax table.
4790 (set_quotes): Added call to check_use_macro_escape()
4793 (next_token): Added new case for IS_ESCAPE.
4795 * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
4797 1998-10-13 René Seindal <rene@seindal.dk>
4801 * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
4804 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
4805 maintained tests in tests/other-tests. These currently tests for
4806 8-bit transparency, multiple precision arithmetic and sync-line
4807 output. Test for stackoverflow detection does not work.
4809 * examples/Makefile.am (TESTS): Added tests for all example files.
4811 * examples/mktests.sh: New file. Help program for creating test
4814 * tests/mkconfig.sh: New file to generate tests/config.m4 and
4815 tests/config.sh. This is for tests of configure selectable
4816 features. Picks up all set WITH_ and ENABLE_ veriables from
4819 * src/path.c (path_search): Added argument 'char **expanded_name'
4820 to return the expanded name.
4822 * src/m4.h: Added 2nd argument to declaration of path_search().
4824 * src/m4.c (main): Added 2nd argument to path_search().
4826 * src/freeze.c (reload_frozen_state): Do.
4828 * src/builtin.c (m4_undivert): Do.
4831 1998-10-11 René Seindal <rene@seindal.dk>
4833 * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
4835 * acm4/modules.m4: New file. Defines AM_WITH_MODULES.
4837 * acm4/gmp.m4: New file. Defines AM_WITH_GMP.
4839 * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
4841 * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
4843 * intl/: Updated to GNU gettext 0.10.35.
4845 * doc/m4.texinfo (Format): Documented that format is blind.
4847 * src/builtin.c (builtin_tab): Builtin format marked as blind.
4849 1998-10-07 René Seindal <rene@seindal.dk>
4853 * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
4854 .test, as the files are no longer just m4 input.
4856 * tests/get-them (FILE): Changed .m4 extension to .test.
4858 * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
4859 Otherwise quoted strings with leading whitespace first in a macro
4860 argument would be eliminated.
4862 * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
4863 (expand_argument): Do.
4865 * src/input.c (next_token): SPACE and NUM/OTHER characters are only
4866 grouped together iff both quote and comment strings are single
4867 character. Otherwise they might include a comment/quote leader.
4868 (next_token): Returns new token type TOKEN_SPACE.
4870 * src/builtin.c (push_builtin_table): New function to push a
4871 builtin_table on the stack without installing its contents.
4872 (find_builtin_by_name): Added call to push_builtin_table() if
4873 reading frozen files. Otherwise the builtins named in the frozen
4874 files could not be found.
4875 (install_builtin_table): Changed to use push_builtin_table()
4877 1998-10-04 René Seindal <rene@seindal.dk>
4881 * configure.in (ALL_LINGUAS): Added Polish pl.po
4883 1998-10-03 René Seindal <rene@seindal.dk>
4885 * Many files: Incorporated changes to implement dynamic modules.
4886 Detailed comments in src/modules.c and modules/README
4888 * src/module.c: New file, implements the OS dependant parts of
4889 dynamic module loading.
4891 * src/Makefile.am (m4_SOURCES): Added module.c
4893 * src/builtin.h: New file, declares some functions from builtin.c
4894 that are of use for other modules (shipout_int, numeric_arg,
4895 skip_space, bad_argc), and the macros ARG() and DECLARE().
4897 * src/builtin.c (install_builtin_table): New function. Each
4898 module brings in a builtin_table, which is pushed on a stack.
4899 (struct builtin_table): New struct for list of builtin_tables.
4900 (m4_loadmodule): New function to implement builtin "loadmodule".
4901 (shipout_int): No longer static, to be used by modules.
4905 (builtin_init): changed to call install_builtin_table()
4906 (find_builtin_by_name): Now searches all builtin_tables
4907 (find_builtin_by_addr): do.
4909 * src/path.c: Reorganised to allow for two search paths, one for
4910 include files and one for modules.
4912 * src/m4.h: Added declarations for new functions in module.c and
4915 * src/m4.c (main): Added call to module_init().
4917 * modules: New directory with a few demo modules.
4919 * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
4922 * configure.in: Added modules/Makefile to AC_OUTPUT.
4924 * configure.in: Added code to implement --with-modules. Tests for
4927 * acconfig.h: Added WITH_MODULES
4929 1998-10-02 René Seindal <rene@seindal.dk>
4931 * examples/Makefile.am (pkgdata_DATA): Removed special target for
4932 check and variables TESTS. These tests are now run from the
4935 * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
4936 directory. The files stay there but the tests are run from the
4939 * tests/Makefile.am (EXTRA_DIST): Added run-test.
4941 * tests/run-test: New file. Run a test manually
4943 * tests/Makefile.am, tests/get_them: Moved automatically generated
4944 tests (from the manual) to sub directory tests/gentest/. The
4945 tests/ directory had gotten a bit messy.
4947 1998-09-06 Erick Branderhorst <Erick.Branderhorst@asml.nl>
4949 * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
4950 wrap}.test: Added a few testcases.
4952 1998-08-21 Erick Branderhorst <Erick.Branderhorst@asml.nl>
4956 * lib/Makefile.am (noinst_HEADERS): regex.h added
4958 * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
4959 acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
4961 * acm4/Makefile.am: created providing rules to create
4962 $(top_srcdir)/acinclude.m4 to be used by aclocal.
4964 * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
4965 `C'. Reported by Ulrich Drepper.
4967 * Makefile.am (SUBDIRS): Removed checks directory
4968 * configure.in (AC_OUTPUT): Removed checks/Makefile
4970 * doc/m4.texinfo (Patsubst,example): @comment added to preserve
4971 the space when m4.texinfo is edited and whitespace.el is active.
4972 (Defn,example): idem.
4974 1998-08-20 Erick Branderhorst <Erick.Branderhorst@asml.nl>
4976 * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
4977 ../COPYING. ../Makefile is a file which is certainly present when
4978 test is executed in testSubDir. One can't be sure that the COPYING
4979 file is in .. or ../.. in all situations, the ../Makefile is
4982 * doc/m4.texinfo (Include): adjusted expected test output
4983 according to new tests, i.e. the input will always come from the
4984 file `in' created by the test.
4986 * tests/Makefile.am: Added three lines at the top to get
4987 esyscmd.1.test working.
4989 * tests/get-them: modified to generate clearer tests who will need
4990 less maintenance when new test examples are created in
4991 `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
4992 need the generic file `defs') shell scripts creating `in', `ok',
4993 `out' and when apropriate `okerr' and `err' in the directory
4994 `testSubDir' when executed. The compare of `ok' and `out'
4995 (and of `okerr' and `err') will be the exit status of the test.
4996 `out' must match `ok' (and `okerr' must match `err') for the test
4999 * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
5000 the tests generated by tests/get-them getting it input normally
5001 from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
5002 (dot) before the numeric part) is reserved for all other (hand
5003 written) tests. The `+' means one or more times.
5005 1998-08-12 Erick Branderhorst <Erick.Branderhorst@asml.nl>
5007 * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
5008 supported short man page to refer to info documentation
5009 * helptoman.pl: added
5010 * configure.in: AC_PATH_PROG(PERL,perl)
5011 * Makefile.am (SUBDIRS): doc after src
5013 * libitized with libit 0.5 from
5014 ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
5016 * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
5017 * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
5018 replacement functions, (libm4_a_LIBADD): @LIBOBJS@
5019 * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
5021 * configure.in (AC_CHECK_FUNC): getopt_long
5023 * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
5025 * TODO: added entry about dependencies
5027 1998-08-10 René Seindal <rene@seindal.dk>
5031 * doc/m4.texinfo (Changesyntax): Added documentation for the macro
5034 * src/builtin.c (m4_changesyntax): Added builtin macro
5035 "changesyntax" to modify the syntax table.
5037 * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
5038 table. All categories are assigned a syntax code and tokens are
5039 read according to this table.
5041 1998-08-09 René Seindal <rene@seindal.dk>
5043 * src/numb.{c,h}: New files, implements multiple precision eval
5044 using GNU gmp. Originally submitted by John Gerard Makecki
5045 (johnm@vlibs.com), later modified. Tested with GNU gmp 2.0.2.
5047 * doc/m4.texinfo (Eval): Added documentation for multiple
5048 precision arithmetic library support.
5050 * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
5051 to accommodate multiple precision eval.
5053 1998-08-07 René Seindal <rene@seindal.dk>
5055 * src/input.c (MATCH, match_input), src/m4.h: changed definition
5056 of comment and quote strings to `unsigned int' to allow eight bit
5057 chars (reported by andrewb@zip.com.au (Andrew Bettison)).
5059 * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
5060 patch from Mike Howard <mike@clove.com>
5062 1998-08-06 René Seindal <rene@seindal.dk>
5064 * gettext.m4: corrected AM_WITH_NLS to handle use of installed
5067 1998-08-03 René Seindal <rene@seindal.dk>
5071 * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
5072 and _ macro. M4 now builds with --disable-nls.
5074 * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
5075 to look for right message catalogs. Call indef'ed by ENABLE_NLS.
5077 * configure.in (ALL_LINGUAS): Added complete list of translations:
5078 de fr it ja nl ru sv.
5080 1998-05-22 Erick Branderhorst <Erick.Branderhorst@asml.nl>
5084 * src/m4.c: #include <signal.h> not <sys/signal.h>.
5086 * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
5088 * checks/Makefile.am: explicit list tests in CHECKS.
5090 * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
5091 src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
5092 mkinstalldirs, install-sh: Added automake (1.3) support.
5094 * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
5095 obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
5096 Used libitize (0.4) to update.
5098 * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
5099 (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
5102 * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
5103 stack overflow functionality.
5105 1994-12-03 François Pinard <pinard@iro.umontreal.ca>
5109 * Makefile.in (realclean-local): Delete stamp-h.in.
5111 * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
5112 Localize, adapting from how it is done in sharutils.
5114 * fr.tt: New file, for French.
5116 * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
5117 src/freeze.c: Rename PRODUCT to PACKAGE.
5119 1994-11-26 François Pinard <pinard@iro.umontreal.ca>
5121 * configure.in: Check for <libintl.h> and <locale.h>.
5122 * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
5123 src/stackovf.c: Rename _ to __P.
5124 * src/m4.h: Declare _ as a macro returning its argument, or else,
5125 include <libintl.h> and declare _ as gettext.
5126 * src/m4.c: Possibly include <locale.h> and call setlocale.
5127 * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
5128 src/input.c, src/macro.c, src/output.c, src/path.c,
5129 src/stackovf.c, src/symtab.c: Use _ macro over all localizable
5132 1994-11-07 François Pinard <pinard@iro.umontreal.ca>
5134 * doc/Makefile.in (stamp-vti): Use new -r option to date.
5136 * configure.in: Put --with-gmp in place, in prevision for John
5138 * acconfig.h: Document WITH_GMP.
5140 1994-11-05 François Pinard <pinard@iro.umontreal.ca>
5144 * doc/Makefile.in (realclean): Also remove stamp-vti.
5145 Reported by Eric Backus.
5147 1994-11-02 François Pinard <pinard@iro.umontreal.ca>
5149 * src/freeze.c (produce_frozen_state): If the frozen file cannot
5150 be opened, return immediately after producing the error message.
5151 Reported by Andreas Schwab.
5153 * configure.in: Check for const only after having found possible
5154 ANSIfying compiler flags, this is of no use to check it before.
5155 Reported by Alexander Lehmann.
5157 1994-11-01 François Pinard <pinard@iro.umontreal.ca>
5159 * src/macro.c (collect_arguments): Cast obstack arguments to
5160 (voidstar), so avoiding compiler warnings.
5161 Reported by Joseph E. Sacco.
5163 * src/freeze.c (produce_frozen_state): Cast printed lengths to
5164 (int) so they correspond to %d format items.
5165 Reported by Joseph E. Sacco.
5167 * src/m4.c (main): Cast the argument to xfree to (voidstar).
5168 * src/symtab.c (free_symbol): Idem.
5169 Reported by Karl Vogel.
5171 1994-10-31 François Pinard <pinard@iro.umontreal.ca>
5173 * Makefile.in (DISTFILES): Distribute BACKLOG.
5175 * configure.in: Define PRODUCT and VERSION.
5176 * acconfig.h: Document PRODUCT and VERSION.
5177 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
5178 constant string m4 and variable or parameter named version.
5180 1994-10-30 François Pinard <pinard@iro.umontreal.ca>
5182 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
5183 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
5184 defines __STDC__ to 0, for indicating it is *not* ANSI!
5185 Reported by Kaveh R. Ghazi.
5187 * configure.in: Added obsolescent tests for AIX and Minix.
5189 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
5190 which texclean does not exist anymore.
5191 Reported by Eric Backus, Jim Meyering, John David Anglin and
5194 1994-10-29 François Pinard <pinard@iro.umontreal.ca>
5196 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
5197 Reported by John David Anglin.
5199 * src/ansi2knr.c: New version, sent by Peter Deutsch.
5200 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
5201 ANSI2KNR, depending on the fact the compiler is ANSI or not.
5202 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
5203 Remove the sed filter after ansi2knr for debug.c. Use $O instead
5204 of $U, put underline in extensions rather than in basenames. Use
5205 implicit rules, now that regularity makes this possible.
5206 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
5207 of ansi2knr whenever it is needed.
5208 * configure.in: Adjusted for correct STACKOVF substitution.
5209 * src/debug.c (trace_format): When not __STDC__, use (...) as a
5210 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
5211 Reported by David MacKenzie.
5213 * Makefile.in: Remove binprefix. Use transform_name instead.
5214 Reported by David MacKenzie.
5216 * doc/Makefile.in: Create version.texi, use it, clean it.
5217 Reported by Jim Meyering.
5219 1994-10-28 François Pinard <pinard@iro.umontreal.ca>
5221 * Makefile.in (all, install, uninstall): Depend on Makefile.
5223 * Makefile.in: For actions invoking $(MAKE) from within compound
5224 sh statements, exit non-zero if the sub-make fails. Otherwise,
5225 the top-level make may exit successfully when it should fail.
5226 Reported by Jim Kingdon.
5228 * {,/*}Makefile.in: Use && after all cd, in case they fail.
5230 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
5231 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
5232 * configure.in: Substitute PRODUCT and VERSION.
5234 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
5236 1994-10-27 François Pinard <pinard@iro.umontreal.ca>
5238 * Makefile.in (mostlyclean-local): Do not remove *~.
5239 * */Makefile.in (mostlyclean): Idem.
5240 Reported by Robert E. Brown and Richard Stallman.
5242 1994-10-09 François Pinard <pinard@iro.umontreal.ca>
5244 * src/m4.h: Get rid of CONFIG_BROKETS.
5246 1994-10-02 François Pinard <pinard@iro.umontreal.ca>
5248 * configure.in: Use AC_ARG_PROGRAM.
5249 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
5250 Reported by David MacKenzie.
5252 1994-10-01 François Pinard <pinard@iro.umontreal.ca>
5254 * configure.in: Do not add -O to CFLAGS for GNU C, now that
5255 configure does it automatically.
5256 Reported by Jim Meyering.
5258 1994-09-23 François Pinard <pinard@iro.umontreal.ca>
5260 * src/stackovf.c: Declare the handler_t typedef earlier in the
5261 code, use it for stackovf_handler.
5262 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
5263 casting sigsegv_handler.
5264 Reported by Robert Bernstein.
5266 * src/m4.c (main): Initialize program_name to argv[0] without
5268 Reported by Karl Berry.
5270 1994-09-18 François Pinard <pinard@iro.umontreal.ca>
5272 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
5273 Reported by Karl Berry.
5275 1994-09-14 François Pinard <pinard@iro.umontreal.ca>
5277 * lib/Makefile.in (mostlyclean): Added.
5278 (TAGS): Make in $(srcdir).
5280 * configure.in: Use `choke me' in test, like everywhere!
5282 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
5283 unreacheable and useless.
5285 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
5287 * lib/Makefile.in (DISTFILES): Distribute TAGS.
5288 (distclean): Do not remove TAGS.
5289 (realclean): Remove it.
5290 * Makefile.in: Make TAGS in lib also, not just in src.
5291 Reported by Karl Berry.
5293 * Makefile.in (distclean, realclean): Instead of recursively
5294 calling $(MAKE) for the -local part, allow parallel execution of
5295 -recursive and -local, only delay the removal of config.status,
5296 which is repeated in both goals.
5298 1994-09-13 François Pinard <pinard@iro.umontreal.ca>
5302 * Makefile.in: Group all *clean-recursive goals in one, using sed
5303 to remove `-recursive' while calling make recursively. Also, use
5304 a subshell for each recursive $(MAKE).
5305 Reported by Jim Meyering.
5307 * src/m4.h (memcpy): Define with bcopy for BSD systems.
5308 Reported by Kaveh R. Ghazi.
5310 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
5311 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
5314 * configure.in: Use date instead of touch for stamp-h.
5315 * Makefile.in (stamp-h.in): Idem.
5317 * Makefile.in (distclean, realclean): Force serial execution of
5318 both goals, in case parallel makes are being used.
5319 Reported by Jim Meyering.
5321 * src/Makefile.in (DISTFILES): Distribute TAGS.
5322 (distclean): Do not remove TAGS.
5323 (realclean): Remove it.
5324 Reported by Karl Berry.
5326 1994-09-10 François Pinard <pinard@iro.umontreal.ca>
5328 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
5329 to old names, for following Autoconf.
5331 1994-09-08 François Pinard <pinard@iro.umontreal.ca>
5333 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
5334 ./install.sh will not be correctly referred to in sub-Makefiles.
5335 Reported by John David Anglin.
5337 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
5338 Reported by Eric Backus.
5340 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
5341 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
5342 config.status into remaking this directory's Makefile only.
5343 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
5344 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
5345 Reported by Jim Meyering.
5347 1994-09-06 François Pinard <pinard@iro.umontreal.ca>
5349 * configure.in: Correct stack overflow detection logic, taking
5350 care of systems having only incomplete implementations (like for
5351 Pyramid 9820 OSx 5.0d).
5352 Reported by Kaveh R. Ghazi.
5354 * src/Makefile.in (TAGS): Remote -t from etags call.
5356 1994-09-02 François Pinard <pinard@iro.umontreal.ca>
5358 * lib/Makefile.in (install): Depend on all.
5360 1994-08-31 François Pinard <pinard@iro.umontreal.ca>
5362 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
5363 Reported by Jim Meyering and John David Anglin.
5365 * Makefile.in (distclean-local): Delete config.log.
5366 Reported by Jim Meyering.
5368 Solidify frozen files with respect to -P:
5369 * src/m4.c: Have -P set prefix_all_buitins variable instead of
5370 calling a function by that name. Declare the variable.
5371 * src/m4.h: Adjust declaration for prefix_all_buitins.
5372 * src/builtin.c (builtin_init): Merge in functionality from
5373 previous prefix_all_buitins function, while making entries in the
5374 symbol table, but not modifying the builtin description itself.
5376 * src/freeze.c (reload_frozen_state): Add a useless `break;',
5377 because *many* compilers do not accept an empty `default:'.
5378 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
5379 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
5381 * configure.in: Use AC_TYPE_SIGNAL.
5382 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
5383 Reported by Robert Bernstein.
5385 * checks/Makefile.in (check): Modify PATH so check-them will find
5386 m4 in the src directory.
5387 * Makefile.in (check): Don't.
5388 Reported by Akiko Matsushita and Jim Meyering.
5390 * src/output.c (make_room_for, output_character_helper): New
5391 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
5392 a per buffer MAXIMUM_BUFFER_SIZE.
5394 * src/output.c (output_text): New function, for optimizing the
5395 output of strings of characters. Use it.
5397 1994-08-30 François Pinard <pinard@iro.umontreal.ca>
5399 * doc, src: New directories reorganizing the distribution.
5400 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
5402 * Makefile.in: Adjusted.
5403 * configure.in: Configure new Makefiles.
5405 * m4.h: Declare STRING typedef. Use it for comment and quote
5406 strings, adjusting all references. (This is the rudiments of a
5407 beginning for the eventual withdrawal of NUL terminated strings.)
5408 * output.c (shipout_text): Accept a length parameter, and use it.
5409 All callers adjusted.
5411 1994-08-29 François Pinard <pinard@iro.umontreal.ca>
5413 * m4.h: Include <unistd.h> if it exists.
5414 * stackovf.c: Don't.
5416 Clean up for current_diversion variable:
5417 * output.c: Move current_diversion from builtin.c.
5418 * m4.h: Declare current_diversion so builtin.c can access it.
5419 * output.c (output_init, make_diversion): Initialize or update
5421 * builtin.c (builtin_init, m4_divert): Leave current_diversion
5424 Remove limit on number of diversions:
5425 * output.c: Replace ndiversion by diversions, declare it.
5426 (output_init): Allocate only diversion 0.
5427 (make_diversion): Allocate new diversions as needed.
5428 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
5429 * m4.c: Still accept -N, but do nothing with it.
5430 Reported by David MacKenzie.
5433 * output.c (freeze_diversions): New function.
5434 * m4.h: Declare freeze_diversions.
5435 * freeze.c: Document frozen file format, revise it, call
5436 freeze_diversions to add diversions to frozen format, and code to
5437 reload them properly.
5438 * m4.c: Do not undivert automatically at end when status being
5439 frozen. Do not call builtin_init when reloading frozen state.
5441 Speed up diversion processing:
5442 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
5443 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
5444 structure and variables, cached variables out of output_diversion,
5445 reallocate_diversion_for and OUTPUT_CHARACTER.
5446 (shipout_text, make_diversion, insert_diversion): Adapted to new
5448 (insert_file): Use better buffering.
5449 Reported by David MacKenzie.
5451 1994-08-28 François Pinard <pinard@iro.umontreal.ca>
5453 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
5454 dist works from another build directory.
5456 1994-08-27 François Pinard <pinard@iro.umontreal.ca>
5458 * symtab.c (hack_all_symbols): Use hash_table_size instead of
5459 constant HASHMAX, for -H option to work better.
5461 * builtin.c (DECLARE): Simplify by using _ ().
5463 * freeze.c: New file.
5464 * Makefile.in: Compile it, distribute it.
5465 * m4.c: Recognize, document and process --freeze-state (-F) and
5466 --reload-state (-R) options. Pass a true flag to builtin_init
5467 only if no reloading some state.
5468 * builtin.c (define_builtin): Remove static specifier.
5469 (find_builtin_by_name): Remove static specifier.
5470 (builtin_init): Accept and obey a flag argument.
5471 * m4.h: Add declarations for freeze.c, changes for builtin.c.
5473 1994-08-24 François Pinard <pinard@iro.umontreal.ca>
5475 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
5478 * configure.in: Implement --with-dmalloc.
5479 * acconfig.h: Document WITH_DMALLOC.
5480 * m4.h: Add code for when WITH_DMALLOC.
5482 1994-08-15 François Pinard <pinard@iro.umontreal.ca>
5484 * m4.c (long_options): Use "error-output", the dash was missing.
5485 Reported by Akiko Matsushita.
5487 1994-08-12 François Pinard <pinard@iro.umontreal.ca>
5489 * m4.h: Include <sys/types.h>.
5490 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
5491 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
5493 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
5495 * builtin.c (dump_args): Declare len as size_t, not int.
5497 * debug.c: Prototype the forward declaration of debug_set_file.
5499 * builtin.c (m4_undivert): Replace div by file, for avoiding the
5500 shadowing of this variable.
5501 * output.c (insert_diversion): Idem.
5503 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
5504 (input_init): Duplicate default quote and comment strings.
5505 (set_quotes): Free previous quote strings in all cases. Duplicate
5506 even default quote strings.
5507 (set_comment): Free previous comment strings in all cases.
5508 Duplicate even default comment strings.
5510 * configure.in: Updated for Autoconf 2.0.
5511 * Makefile.in (distclean-local): Also delete config.cache.
5513 * m4.c (usage): Reorganize the --help output by topic. Include a
5514 description for debugging flags.
5516 1994-07-29 François Pinard <pinard@iro.umontreal.ca>
5518 * configure.in: If sigaction is available and SA_ONSTACK defined,
5519 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
5520 defined, use sigvec. Else don't compile stackovf.c.
5521 * stackovf.c (setup_stackovf_trap): Idem.
5522 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
5525 1994-07-21 François Pinard <pinard@iro.umontreal.ca>
5527 * m4.c (usage): Replace printf par fputs.
5529 1994-07-18 François Pinard <pinard@iro.umontreal.ca>
5533 1994-07-17 François Pinard <pinard@iro.umontreal.ca>
5535 * configure.in: Check for sigaction and sigvec. Add a new delayed
5536 check for RLIMIT_STACK, combine in the checking for getrlimit.
5537 All those things are not universally available.
5538 * stackovf.c: Split setting up the trap handler and catching
5539 signals, for better taking care of various configure outcomes.
5540 * examples/stackovf.sh: Correct a typo.
5541 Reported by Eric Backus, Jim Avera and Jim Meyering.
5543 1994-07-16 François Pinard <pinard@iro.umontreal.ca>
5545 * ansi2knr.c: New version sent by its author, Peter Deutsch.
5547 1994-07-15 François Pinard <pinard@iro.umontreal.ca>
5549 * Makefile.in: Modify so parallel make will not try making
5550 lib/libm4.a twice simultaneously.
5551 Reported by Jim Meyering.
5553 1994-07-14 François Pinard <pinard@iro.umontreal.ca>
5555 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
5556 error message, for when no code possibility exists. Even if this
5557 line is completely #ifdef'ed out, it brings a syntax error.
5558 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
5560 * Makefile.in (install): Have install depend on all too, for lib
5561 to be remade as needed.
5563 * examples/stackovf.sh: Try ksh, bsh and bash for shells
5564 providing ulimit, instead of using only ksh.
5565 Reported by Jim Avera and Joseph E. Sacco.
5567 1994-07-12 François Pinard <pinard@iro.umontreal.ca>
5569 * Makefile.in (check): Have it depend on all instead of m4. In
5570 this way, a change in lib will be detected and processed.
5572 * builtin.c (numeric_arg): Use strtol and verify the conversion,
5573 instead of using sscanf which stops as soon as there is a
5574 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
5575 and divert(1xyzzy) were all accepted without any warning or error
5577 * m4.h: Declare strtol as long if not including stdlib.h.
5578 * configure.in: Check for limits.h, and replace strtol if missing.
5579 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
5580 * lib/strtol.c: New file, from elsewhere.
5581 Reported by Andreas Schwab.
5583 1994-07-07 François Pinard <pinard@iro.umontreal.ca>
5585 * macro.c (expand_macro): Cast value to (boolean) prior to
5586 assigning it to traced.
5587 Reported by Tom McConnell.
5589 * Makefile.in (m4): Always make all in lib first.
5590 Reported by Jim Meyering.
5592 1994-07-06 Jim Avera <jima@netcom.com>
5594 * stackovf.c: Isolated OS-dependent sections; Improved portability,
5595 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
5596 handlers), and a default error message if the fault address is not
5597 available (when neither siginfo.h nor BSD sigcontext are supported).
5598 * configure.in: Changes for stackovf.h: Check for sigcontext,
5599 sigaction, sigstack, and define rlim_t as int if necessary.
5600 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
5601 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
5602 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
5604 1994-07-05 François Pinard <pinard@iro.umontreal.ca>
5606 * configure.in: Use AC_SET_MAKE.
5607 * Makefile.in: Use @SET_MAKE@.
5608 Reported by Jim Meyering.
5610 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
5611 Reported by Ian Taylor.
5613 1994-07-02 François Pinard <pinard@iro.umontreal.ca>
5615 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
5616 because siginfo.h is unrelated to standard headers, and siginfo.h
5617 is already checked for.
5618 Reported by Joseph E. Sacco.
5620 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
5622 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
5625 1994-06-29 François Pinard <pinard@iro.umontreal.ca>
5627 * builtin.c (substitute): Use \& to represent this part of the
5628 string which was matched by the whole regexp, instead of
5629 representing the whole string. Any usage of \0 issues a warning
5630 and acts like \&, it will disappear in some subsequent release.
5632 1994-06-27 François Pinard <pinard@iro.umontreal.ca>
5634 * m4.c: Complete prototype for forwarded declaration of usage.
5636 * input.c (init_macro_token): Correct own reference in error
5637 message. Previous name get_macro_func was referred to instead.
5638 (next_char): Correct own reference in error message. Previous
5639 name advance_input was referred to instead.
5641 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
5642 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
5643 and_term, not_term, logical_not_term, cmp_term, shift_term,
5644 add_term, mult_term, exp_term, unary_term, simple_term): Add
5645 prototype to forwarded declarations. Declare parameter v1 as
5646 eval_t * instead of int *. Same for local variable v2 in dyadic
5647 functions. Same for result in exp_term.
5648 * builtin.c (m4_eval): Declare value as eval_t instead of int.
5649 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
5650 unsigned_eval_t instead of unsigned int. Change casts accordingly.
5651 (shipout_int): Cast first argument of ntoa to eval_t.
5652 Reported by Thorsten Ohl.
5654 * macro.c: Complete the prototypes of forwarded expand_macro and
5656 Reported by Thorsten Ohl.
5658 * m4.h: Define voidstar as void * or char * depending on __STDC__.
5659 The Ultrix 3.1 compiler cannot do much with void pointers.
5661 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
5662 * m4.c (xfree): Replace void * by voidstar.
5663 Reported by Tom McConnell.
5665 * ansi2knr.1: New, from elsewhere.
5666 * Makefile.in (DISTFILES): Distribute ansi2knr.1
5668 * Makefile.in (stamp-h.in): Avoid running ./config.status if
5669 stamp-h does not exist yet. This avoids running it a second time
5670 just after the initial ./configure.
5671 Reported by David MacKenzie and Tom McConnell.
5673 * m4.h: Replace the enum debug_info declaration with a series of
5674 #define's. The Ultrix 3.1 compiler would otherwise need casting
5675 (int) to most references, when used in expressions.
5676 Reported by Tom McConnell.
5678 1994-06-25 François Pinard <pinard@iro.umontreal.ca>
5680 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
5681 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
5682 calls the compiler. Previously, FP_PROTOTYPES was only calling
5683 the preprocessor; by not being subject to CFLAGS, this was
5684 discouraging those flags asking for ANSI compilation.
5685 * acconfig.h: Document HAVE_PROTOTYPES.
5686 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
5687 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
5688 Reported by Eric Backus.
5690 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
5691 from the environment. Default CFLAGS to -g if not set.
5692 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
5693 * lib/Makefile.in: Have CFLAGS substituted from configure.
5694 Reported by Eric Backus and Tom McConnell.
5696 * configure.in: m4_undefine changeword before using AC_ENABLE.
5698 * m4.h: Declare prototypes for error (for ANSI compilers only),
5699 prefix_all_builtins and reference_error.
5700 Reported by Tom McConnell.
5702 * input.c (set_word_regexp): Do not try to initialize the array
5703 test from a string, this does not work with non-ANSI compilers.
5704 Reported by Eric Backus.
5706 * Makefile.in (dist): Clean examples/ before saving it.
5707 (distclean-local): Also remove stamp-h.
5708 Reported by Eric Backus.
5710 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
5712 Reported by Tom McConnell.
5714 * checks/Makefile.in (clean): Depends on mostlyclean.
5715 (mostlyclean): New goal.
5717 1994-06-24 François Pinard <pinard@iro.umontreal.ca>
5719 * Makefile.in (DISTFILES): Distribute install.sh.
5720 * install.sh: New file, copied from elsewhere.
5721 Reported by Assar Westerlund and Kaveh R. Ghazi.
5723 1994-06-23 François Pinard <pinard@iro.umontreal.ca>
5725 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
5726 * acconfig.h: Explain ENABLE_CHANGEWORD.
5728 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
5729 from code provided by Pete Chown]
5730 * m4.h: Add original_text field to u_t variant of union u.
5731 Declare TOKEN_DATA_FUNC macro.
5732 * builtin.c: Declare changeword.
5733 (m4_changeword): New function.
5734 * input.c: Include "regex.h", define variables with word regexps.
5735 (input_init): Initialize the word regexp.
5736 (set_word_regexp): New.
5737 (next_token): Declare local variables, use the previous code if
5738 default_word_regexp is true. Else, match using a new code. Save
5740 * macro.c (expand_token): Ship out original text if not a macro
5742 Reported by Krste Asanovic and Pete Chown.
5744 [These modifs all depend upon ENABLE_CHANGEWORD]
5745 * m4.h: Declare external user_word_regexp.
5746 * m4.c: Declare user_word_regexp, and initialize it from
5747 --word-regexp or -W, or NULL if not specified.
5748 * input.c: Use user_word_regexp if specified, instead of
5749 DEFAULT_WORD_REGEXP.
5751 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
5754 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
5755 * checks/Makefile.in: Empty the suffix list.
5756 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
5758 * m4.c: Declare nesting_limit and initialize it to 250.
5759 Implement -LNUMBER or --nesting-limit=NUMBER to change its
5761 * m4.h: Declare nesting_limit as external.
5762 * macro.c (expand_macro): Stop execution whenever nesting limit
5764 Reported by Bengt Mertensson.
5766 * eval.c (evaluate): Diagnose excess characters in eval input.
5767 Things like `eval(08)' used to return 0 with no diagnostic.
5769 * m4.h: Capitalize first letter of all macro arguments in
5772 * m4.c: Declare warning_status, initialize it to 0. Add new
5773 option -E, or --fatal-warnings, which sets warning_status to
5774 EXIT_FAILURE instead.
5775 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
5776 EXIT_FAILURE if not otherwise done by header files.
5777 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
5778 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
5779 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
5780 argument of all M4ERROR calls.
5781 Reported by Noah Friedman.
5783 * examples/incl-test.m4: Renamed from incl_test.m4.
5784 * examples/include.m4: Include incl-test.m4 instead of
5786 * examples/multiquotes.m4: Renamed from multi-quotes.m.
5788 1994-06-22 François Pinard <pinard@iro.umontreal.ca>
5790 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
5791 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
5792 also tested it on a Sun Sparc workstation running SunOS 4.x.
5794 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
5795 49.format check, abusing a `union values' argument with sprintf
5796 without selecting the proper field. Now, save the formatting type
5797 first, delaying the fetch of the corresponding argument.
5798 Reported by Joseph E. Sacco and Tom Quinn.
5800 * format.c (format): Remove const from char *fmt declaration when
5801 not HAVE_EFGCVT, because a NUL may be forced into it.
5803 * m4.h: Declare atof() when not STDC_HEADERS.
5804 Reported by Joseph E. Sacco.
5806 * Regenerate configure using Autoconf 1.11, this corrects a
5807 problem about an incorrect cpp seting on NeXT 3.1.
5808 Reported by Alexander Lehmann.
5810 1994-06-05 François Pinard <pinard@iro.umontreal.ca>
5812 * m4.h (_): Change argument from `x' to `Args'.
5814 1994-04-22 François Pinard <pinard@iro.umontreal.ca>
5816 * m4.h: Rename Args() to _().
5817 * m4.h: Remove extern specifier from all function declarations.
5819 1994-04-22 Jim Avera <jima@netcom.com>
5821 * stackovf.c: New file implementing stack-overflow detection.
5822 * configure.in: Check for getrlimit, sigaction. If all of
5823 standard headers, getrlimit and sigaction, define USE_STACKOVF and
5824 substitute ${U}stackovf.o for STACKOVF.
5825 * acconfig.h: Declare USE_STACKOVF.
5826 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
5827 * m4.h: Declare setup_stackovf_trap().
5828 * m4.c: Call setup_stackovf_trap().
5829 * tests/stackovf_test.sh: New file.
5831 1994-04-13 François Pinard <pinard@iro.umontreal.ca>
5833 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
5835 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
5837 1994-01-30 <pinard@iro.umontreal.ca>
5839 * m4.h: Remove definition of volatile, not used anymore.
5840 Reported by Jim Meyering and Joseph E. Sacco.
5842 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
5843 of `if ... else /* nothing */' for if macros.
5844 Reported by Jim Meyering.
5846 * builtin.c (m4_regexp): Reorganize the code for avoiding a
5847 warning from gcc about `repl' possibly used before defined.
5848 Reported by Jim Meyering.
5850 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
5851 Reported by Jim Meyering.
5853 1994-01-25 François Pinard <pinard@iro.umontreal.ca>
5855 * m4.h: Move the conditional definition of volatile after the
5856 inclusion of system files, because they may define it first.
5858 1994-01-04 François Pinard <pinard@iro.umontreal.ca>
5860 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
5861 get around a problem with Alpha make seeing a syntax error, there.
5862 Reported by Vern Paxson.
5864 1994-01-03 François Pinard <pinard@iro.umontreal.ca>
5866 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
5867 Reported by Richard Stallman.
5869 1993-12-25 François Pinard <pinard@iro.umontreal.ca>
5871 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
5872 instead of AC_HAVE_FUNCS.
5873 Reported by Noah Friedman.
5875 1993-12-01 François Pinard <pinard@iro.umontreal.ca>
5877 * m4.c: Initialize show_help and show_version to zero.
5879 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
5880 Use them in exit() and usage() calls.
5882 1993-11-27 François Pinard <pinard@iro.umontreal.ca>
5884 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
5885 syserr() macro. Delete errref, add reference_error and M4ERROR.
5886 * m4.c: Replace errref, which was returning an input reference
5887 string, with reference_error, which prints it on standard error.
5888 * builtin.c, output.c: Use errno as second parameter to error,
5889 instead of using syserr() with %s.
5890 * *.c: Use M4ERROR instead of error: no more errref() with %s.
5891 Doing so, the program name appears after the input reference
5892 instead of before, which eases M-x next-error processing.
5894 1993-11-24 François Pinard <pinard@iro.umontreal.ca>
5896 * checks/get-them: Escape braces with backslashes in patterns,
5897 because HPUX-9.01 awk needs this.
5898 Reported by Jim Meyering.
5900 1993-11-22 François Pinard <pinard@iro.umontreal.ca>
5902 * builtin.c: Declare "FILE *popen ();".
5904 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
5905 macros, replace error_message_prefix() declaration by errref()'s.
5906 Declare xrealloc, for use in errref().
5907 * m4.c: Delete error_message_prefix() function, add errref().
5908 * *.c: Use error() systematically in place of all error macros,
5909 now that error() flushes stdout first. Make needed adjustments.
5911 * m4.h: Remove const in sys_errlist[] declaration, it creates
5912 conflicts on SGI and Alpha.
5913 Reported by Kaveh R. Ghazi.
5915 1993-11-20 François Pinard <pinard@iro.umontreal.ca>
5917 * m4.c: Include <getopt.h> instead of "getopt.h".
5919 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
5920 * acconfig.h: New, for documenting HAVE_EFGCVT.
5921 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
5922 use them wherever appropriate. Also use -I. for compilations.
5923 * lib/Makefile.in: Use -I.. for compilations.
5924 * *.c: Include <config.h> or "config.h".
5926 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
5927 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
5929 1993-11-17 François Pinard <pinard@iro.umontreal.ca>
5931 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
5933 * input.c (input_init): Initialize quote and comment strings
5934 explicitely instead of calling set_quotes and set_comment: by
5935 doing so, we ensure we do not free uninitialized variables.
5937 * checks/check-them: Reverse arguments to both diff, so the
5938 expected is on the left and the obtained on the right.
5940 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
5941 macros. Delete declarations for m4error, warning, fatal and
5942 internal_error, add declaration for error_message_prefix.
5943 * m4.c: Delete m4error, warning, fatal and internal_error
5944 routines, add error_message_prefix routine.
5945 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
5946 warning with WARNING*, fatal with FATAL* and internal_error with
5948 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
5949 this is not needed anymore.
5951 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
5952 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
5953 and debug_message, add declaration for debug_message_prefix.
5954 * debug.c: Remove static specifier for FILE *debug declaration.
5955 Delete debug_print and debug_message routines, add
5956 debug_message_prefix routine.
5957 * builtin.c, debug.c: Replace debug_print routine calls with
5958 DEBUG_PRINT* macro calls.
5959 * input.c, path.c: Replace debug_message routine calls with
5960 DEBUG_MESSAGE* macro calls.
5962 * m4.h: Remove inclusion of <varargs.h>.
5963 * debug.c: Include <stdarg.h> or <varargs.h>.
5964 (trace_format): Use stdarg instead of varargs if __STDC__.
5966 * configure.in: Remove checks for vfprintf and _doprnt. These
5967 implementations use varargs tricks which are not portable enough.
5968 * lib/vfprintf.c: Deleted.
5969 * lib/_doprnt.c: Deleted.
5970 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
5971 Reported by Joel Sherrill.
5973 * path.c (add_include_directory): Use xstrdup.
5975 * builtin.c (find_builtin_by_name): Declare static.
5977 * *.[ch]: Add const to a few "char *" declarations.
5979 * configure.in: Remove commented tests for fileno() and fstat().
5980 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
5982 * debug.c (debug_flush_files): New.
5983 * m4.h: Declares it.
5984 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
5985 Reported by Nicolas Pioch.
5987 1993-11-12 François Pinard <pinard@iro.umontreal.ca>
5989 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
5990 Reported by Joel Sherrill.
5992 * builtin.c (prefix_all_builtins): Instead of the table size, use
5993 the null entry at end for stopping the loop. It was overwritten.
5994 Reported by Andreas Schwab and Jim Meyering.
5996 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
5997 Reported by Kaveh R. Ghazi.
5999 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
6000 Reported by Karl Vogel.
6002 1993-11-09 François Pinard <pinard@iro.umontreal.ca>
6004 * m4.h: Do not define volatile if already defined.
6005 Reported by René Seindal.
6007 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
6009 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
6010 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
6012 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
6014 * m4.h: Define strchr and strrchr in terms of index and rindex,
6015 instead of the other way around.
6016 * builtin.c, m4.c, path.c: Use strchr instead of index.
6018 * input.c (next_char): Remove a "break;" after a "return ...;".
6019 Reported by Tom McConnell.
6021 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
6025 * configure.in: Do not copy check files in the build hierarchy.
6026 * checks/check-them: Identify the m4 version being checked. For
6027 finding m4, look in $PATH instead of in the parent directory.
6028 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
6029 * checks/Makefile.in (.all-stamp): Always create check files in
6030 the source hierarchy, not anymore in the build hierarchy.
6031 (check): cd to the source hierarchy before performing checks.
6032 Do not copy nor clean COPYING anymore, take it from `..'.
6033 Reported by Tom McConnell.
6035 * Makefile.in (Makefile): Use $(SHELL).
6036 (config.status): Use $(SHELL). Use "config.status --recheck"
6037 instead of "configure --no-create", which is obsolete.
6038 Reported by Tom McConnell.
6040 1993-11-05 François Pinard <pinard@iro.umontreal.ca>
6042 * m4.c (usage): Use "%s" instead of "m4" in format string.
6043 Reported by Jim Meyering.
6045 * Makefile.in: Distribute mkinstalldirs.
6046 Reported by Pierre Gaumond.
6047 Reported by Jim Meyering.
6048 Reported by Tom McConnell.
6049 Reported by Andreas Gustafsson.
6051 * checks/check-them: Renamed from checks/check_them.
6052 * checks/get-them: Renamed from checks/get_them.
6053 * checks/.all-stamp: Renamed from checks/.all_stamp.
6054 * checks/Makefile.in: Changed accordingly.
6055 Reported by Jim Meyering.
6057 1993-11-04 François Pinard <pinard@iro.umontreal.ca>
6059 * lib/Makefile.in (dist): Correct permissions on files.
6061 * output.c: Declare tmpfile, some systems don't.
6063 1993-11-03 François Pinard <pinard@iro.umontreal.ca>
6065 * checks/Makefile.in (dist): Correct permissions on files.
6067 * Makefile.in (dist): Ensure recursive linking for subdirectory
6068 `examples', also set read/write permissions on all its files.
6070 * mkinstalldirs: New, from elsewhere.
6071 * Makefile.in: Use it.
6073 * debug.c: Synchronize debug messages and regular output when
6074 the debug file and stdout are redirected to the same file.
6075 * configure.in: Add (commented) checks for fileno and fstat.
6076 Reported by Jim Avera.
6078 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
6079 etc., arguments, then ignore the superfluous one. m4 used to
6080 diagnose missing arguments and return the empty string.
6081 Reported by Nick S. Kanakakorn.
6083 1993-11-02 François Pinard <pinard@iro.umontreal.ca>
6085 * m4.c (main): At end of all input, ensure all undiverted text
6086 goes to the main output stream.
6087 Reported by Andreas Gustafsson.
6089 * m4.c (main): exit (0), instead of return 0.
6091 * m4.c: Implement -P and --prefix-builtins.
6092 * builtin.c: Delete const specifier on builtin_tab.
6093 (prefix_all_builtins): New.
6094 Reported by Noah Friedman.
6095 Reported by Scott Bartram.
6097 * c-boxes.el: New, from elsewhere.
6098 * Makefile.in: Distribute it.
6100 * m4.h: Do not define bcopy if <string.h> defines it.
6101 Reported by Stephen Perkins.
6103 * builtin.c (define_macro): Allow a missing second argument, in
6104 which case it is implied empty. Affects define and pushdef.
6105 Reported by Eric Allman.
6107 1993-11-01 François Pinard <pinard@iro.umontreal.ca>
6109 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
6110 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
6111 * builtin.c: Initialize all the blindness fields in builtin_tab.
6112 (define_builtin): Copy the blindness of a builtin into its symbol.
6113 * macro.c (expand_token): Avoid processing a blind builtin if the
6114 next character is not an opening parenthesis.
6115 Reported by David MacKenzie.
6116 Reported by Noah Friedman.
6118 * configure.in: Ensure an exit status of 0 on completion.
6119 Reported by Vivek P. Singhal.
6121 * eval.c (eval_lex): Admit both lower and upper case letters for
6122 bases greater than 10. Only lower case letters were accepted.
6124 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
6125 Reported by Krste Asanovic.
6127 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
6128 * eval.c (logical_not_term): New name for not_term.
6129 * eval.c (xor_term): New, between or_term and and_term.
6130 * eval.c (not_term): New, between and_term and logical_not_term.
6131 * eval.c (shift_term): New, between cmp_term and add_term.
6132 Reported by Krste Asanovic: ~, ^, <<, >>.
6133 Reported by Ben A. Mesander: ** vs ^.
6135 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
6136 * m4.h: Delete xrealloc.c.
6137 * lib/xmalloc.c: New, from elsewhere.
6138 * lib/xstrdup.c: New, from elsewhere.
6139 * lib/Makefile.in: Distribute and compile them.
6141 * m4.c: Change progname to program_name.
6142 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
6143 * lib/error.c: New, from elsewhere.
6144 * lib/Makefile.in: Distribute and compile error.c.
6145 * configure.in: Check AC_VPRINTF and for strerror.
6146 * m4.c: Delete cmd_error. Use error instead.
6147 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
6149 * m4.h: Delete #define const, let Autoconf takes care of this.
6151 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
6152 Merge parse_args into main. Declare argv to be `char *const *',
6153 then remove superfluous casts.
6155 * m4.c: Rename --no-gnu-extensions to --traditional.
6156 Reported by Ben A. Mesander.
6158 * m4.c (usage): Add a status parameter. Supply one in various
6159 calls. Add --help processing. Remove -V for --version.
6161 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
6163 * lib/Makefile.in: Have an AR=ar declaration.
6164 Reported by Eric Backus.
6165 Reported by Bjorn R. Bjornsson.
6166 Reported by Tom Tromey.
6167 Reported by Kristine Lund.
6168 Reported by Marion Hakanson.
6170 1993-10-30 François Pinard <pinard@iro.umontreal.ca>
6172 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
6173 Reported by Noah Friedman.
6175 1993-10-25 François Pinard <pinard@iro.umontreal.ca>
6177 * Makefile.in: Remove MDEFINES and cleanup.
6179 1993-06-09 François Pinard <pinard@iro.umontreal.ca>
6181 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
6184 1993-02-06 François Pinard <pinard@iro.umontreal.ca>
6186 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
6187 ensure 777 mode for directories, so older tar's will restore file
6190 1993-01-17 François Pinard <pinard@iro.umontreal.ca>
6192 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
6193 so the installer can override automatically configured choices.
6194 Reported by Karl Berry.
6196 1993-01-15 François Pinard <pinard@iro.umontreal.ca>
6198 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
6199 previous version was not working properly on m68k-hp-bsd4.3.
6200 Reported by Roland McGrath.
6202 * lib/_doprnt.c: Stolen from Oleo distribution.
6203 * configure.in: Check for _doprnt.c if vfprintf.c selected.
6204 * lib/Makefile.in: Distribute _doprnt.c.
6205 Do not distribute regex.[ch].old anymore.
6207 1993-01-01 François Pinard <pinard@iro.umontreal.ca>
6209 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
6210 Richard wants it there.
6212 1992-12-27 François Pinard <pinard@iro.umontreal.ca>
6214 * Makefile.in: Add DEFS to MDEFINES.
6215 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
6216 (libm4.a): Remove the library before creating it.
6217 (distclean): Remove tags and TAGS too.
6219 1992-12-23 François Pinard <pinard@iro.umontreal.ca>
6221 * Makefile.in (dvi, m4.dvi): New goals.
6223 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
6224 macro.c, output.c, path.c, symtab.c: Change Copyright from
6225 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
6227 * examples/divert.m4: Deleted, this bug has been corrected.
6229 * Makefile.in (texclean, mostlyclean): New goals.
6231 * Makefile.in (clean): Remove clutter from ansi2knr.
6232 Reported by Pierre Gaumond.
6234 1992-12-20 François Pinard <pinard@iro.umontreal.ca>
6236 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
6237 might well use CFLAGS is s/he needs it.
6239 * Makefile.in: Allow installation of info files from a separate
6241 Reported by Jason Merrill.
6242 Reported by David MacKenzie.
6243 Reported by Skip Montanaro.
6244 Reported by Erez Zadok.
6245 Reported by Assar Westerlund.
6247 1992-12-19 François Pinard <pinard@iro.umontreal.ca>
6250 This is still a beta release for the future GNU m4 version 1.1.
6252 * lib/alloca.c: New, from elsewhere.
6253 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
6255 * m4.h: Do not define index/rindex if already defined. If
6256 FALSE/TRUE are already defined, do not redefine them, but merely
6257 define boolean typedef to int.
6259 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
6260 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
6261 because some C compilers do not like connectives with #ifdef.
6262 * m4.h: Define `volatile' only if __GNUC__, instead of once for
6263 __GNUC__ and once for __STDC__.
6264 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
6266 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
6267 Makefile dependencies. Without it, make keeps destroying and
6268 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
6270 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
6271 to diversion/DIVERSION, this was a spelling error.
6273 * m4.c: Declare version[], remove #include "version.h".
6274 * version.h: Deleted.
6275 * Makefile.in: Remove references to version.h.
6277 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
6278 production, by using a simpler and more robust algorithm. This
6279 solves the problem of synclines sometimes written in the middle of
6280 an output line. Delete sync_line() and output_lines variable.
6281 * m4.h: Remove sync_line prototype and output_lines declaration.
6282 * input.c (next_char), output.c (shipout_text): Remove references
6284 * input.c (push_file, pop_file): Merely put the value -1 in
6285 output_current_line instead of calling sync_line, for delaying a
6286 single `#line NUM FILE' before next output line. Do not test
6287 for sync_output, because this is unnecessary clutter.
6288 * output.c (make_divertion, insert_divertion): Idem.
6289 * input.c: Rename must_advance_line to start_of_input_line, for
6292 * debug.c (trace_header): Select a new debug line format, which
6293 better complies with GNU standards for formatting error messages.
6294 With option `-dfl', M-x next-error might be used on the output.
6295 * m4.c (vmesg): Adjust format of error output to GNU standards.
6296 * m4.texinfo: Adjust examples for `make check' to work.
6298 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
6299 case for enum debug_info constants, which were all lower case.
6301 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
6303 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
6304 collected patches. I tried a few times using newer regex.[ch], it
6305 mysteriously stopped aborting with this one. Insecure feeling...
6306 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
6308 1992-12-18 François Pinard <pinard@iro.umontreal.ca>
6310 * m4.c: Change `--no-warnings' to `--silent'.
6311 Reported by David MacKenzie.
6313 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
6314 leave it off for now. See comment in m4.c for justification.
6315 Reported by David MacKenzie.
6317 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
6318 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
6320 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
6322 * Makefile.in: Ensure recursive cleaning is done before local
6323 cleaning for all clean goals.
6325 * builtin.c (ntoa): Ensure the value is always interpreted as a
6326 signed quantity, whatever the radix is.
6328 1992-11-18 Jim Meyering <meyering@idefix>
6330 * builtin.c, format.c, input.c: Split long lines.
6331 * m4.c: Use typedef macro_definition instead of struct
6333 * symtab.c: Use typedef symbol instead of struct symbol.
6335 1992-11-17 François Pinard <pinard@iro.umontreal.ca>
6337 * *.[ch]: Remove all trailing whitespace, in code and comments.
6339 * configure.in: Find some awk.
6340 * Makefile.in: Add $(AWK) to MDEFINES.
6341 * checks/Makefile.in: Transmit $(AWK) to get_them.
6342 * checks/get_them: Use $AWK instead of gawk. Add a close in the
6343 awk script when switching files, because without this, mawk runs
6344 out of file descriptors.
6346 1992-11-16 François Pinard <pinard@iro.umontreal.ca>
6348 * Makefile.in (realclean): Delete m4.info*.
6349 Reported by Jim Meyering.
6351 * Makefile.in: Adjust and link with checks/Makefile.
6352 * checks/Makefile.in: New.
6353 * configure.in: Output checks/Makefile.
6355 * checks/get_them: Have the dnl header of each test more
6356 recognizable by next-error, also use a better message.
6358 1992-11-16 Jim Meyering <meyering@idefix>
6360 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
6361 And use that only if __GNUC__ since we're using it's GCC-specific
6362 semantics that tell the compiler the associated function doesn't
6365 * builtin.c (substitute): Don't use character as an array index.
6366 (dumpdef_cmp): Make formal arguments `const void *' to avoid
6367 warnings with gcc -W -Wall on systems with qsort prototype.
6368 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
6371 * eval.c (most functions): Add parentheses to assignments used
6372 as truth values go avoid warnings from gcc -Wall.
6374 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
6375 any functions that don't need external scope.
6377 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
6378 (many functions and arrays): Declare `const'.
6380 1992-11-15 François Pinard <pinard@iro.umontreal.ca>
6382 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
6383 removing the declaration from m4.h. Also rename false to FALSE
6386 * lib/Makefile.in (Makefile): New goal.
6388 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
6389 so heavily loaded. It gets more easily overridable, calling make.
6390 Reported by Jim Meyering.
6392 * Makefile.in (dist): Get .fname from the current directory name,
6393 instead of from version.h. I need updating many files manually,
6394 when the version changes, version.h is just one of them.
6396 1992-11-14 François Pinard <pinard@iro.umontreal.ca>
6398 * m4.h: Remove the tag `boolean' on the enum introducing typedef
6399 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
6400 Reported by Tom McConnell.
6402 1992-11-13 François Pinard <pinard@iro.umontreal.ca>
6404 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
6405 39.cleardiv, which were describing missing or spurious newlines.
6406 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
6407 do not depend on machine word size, `/bin/false' implementation,
6408 or `wc' output format. `make check' is more dependable, now.
6410 * checks/check_them: Summarize the failed tests by listing their
6411 name, at end. If none, issue `All checks successful'. Output
6412 `Checking' instead of `Input file:'.
6414 * checks/get_them, checks/check_them: Reindented.
6416 * Makefile.in (dist): chmod a+r before making the tar file.
6418 1992-11-12 François Pinard <pinard@iro.umontreal.ca>
6420 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
6422 * input.c (next_token): Reinitialize token_buttom just after using
6423 it as a watermark with obstack_free. Or else, a future token, big
6424 enough for triggering reallocation of the obstack chunk, could
6425 void the initialized value of token_buttom, later causing panic in
6426 obstack_free. Rename token_buttom to token_bottom everywhere.
6428 * m4.h: Before declaring errno, first include <errno.h> and
6429 ensure that it does not define errno.
6430 Reported by Richard Stallman.
6432 1992-11-11 François Pinard <pinard@iro.umontreal.ca>
6434 * builtin.c: Define and use DECLARE macro for builtins.
6436 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
6437 argument, this is a common idiom for introducing long comments.
6439 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
6440 arguments. The last argument was silently ignored.
6442 * m4.c (cmd_error): Add a missing semicolon before va_end().
6444 1992-11-10 François Pinard <pinard@iro.umontreal.ca>
6446 * Makefile.in: Now handle protoized sources. Define and use U.
6447 Compile and use ansi2knr with old compilers. Update DISTFILES.
6448 Add `aclocal.m4' to `configure' dependencies.
6449 * ansi2knr.c: New, from Ghostscript distribution.
6450 * configure.in: Define U through FP_PROTOTYPES for old compilers.
6451 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
6452 * aclocal.m4: New, provide FP_PROTOTYPES.
6453 * m4.h: Conditionnaly protoized through Args, save for varags.
6454 * builtin.c: Protoized. Then:
6455 Include <sys/types.h> if size_t is not defined, before "regex.h".
6456 (m4_ifelse): Fetch built-in name properly for diagnostic.
6457 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
6458 (m4_regexp): Add const to `msg' declaration.
6459 (m4_patsubst): Add const to `msg' declaration.
6460 * debug.c: Protoized, save for varargs.
6461 * eval.c: Protoized.
6462 * format.c: Protoized.
6463 * input.c: Protoized.
6464 * m4.c: Protoized, save for varargs. Then:
6465 (xfree): Accept void * instead of char *.
6466 (xmalloc): Return void * instead of char *.
6467 (xrealloc): Accept and return void * instead of char *.
6468 * macro.c: Protoized.
6469 * output.c: Protoized.
6470 * path.c: Protoized. Then cast some (char *) over xmalloc's.
6471 * symtab.c: Protoized.
6473 1992-11-06 François Pinard <pinard@iro.umontreal.ca>
6475 * m4.texinfo: Remove directory from diagnostics in 30.include,
6476 51.eval, 56.errprint and 57.m4exit tests.
6478 * m4.h: Remove declarations for int or void system functions, they
6479 cause more conflicting trouble than they make good.
6481 * configure.in: Avoid configuration header file. Add some tests.
6482 * m4.h: Remove #include "config.h".
6483 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
6484 Then, rewritten for better compliance with GNU standards.
6486 1992-11-05 François Pinard <pinard@iro.umontreal.ca>
6488 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
6489 because of a misplaced #endif.
6491 * Many *.[hc] files: Correct intra-line spacing here and there,
6492 according to GNU indent 1.6 advice.
6494 * configure.in: New, using Autoconf 1.2.
6495 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
6496 * Delete old configure.in, configure, etc/configure.in,
6497 etc/configure, lib/configure.in, lib/configure and config/*.
6498 Reported by Jason Merrill.
6500 * symtab.c (hash): Change (char) NULL to '\0'.
6501 Reported by Jason Merrill.
6503 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
6504 etc/nextvers.sh. Release numbers will be edited `by hand'.
6505 * version.h: De-automatize, force value in.
6507 * m4.c: Changes in order to use a newer getopt.h.
6508 Reported by David MacKenzie.
6510 * checks/: New name for examples/.
6511 * checks/get_them: New location for etc/get_examples.
6512 * checks/check_them: New location for etc/check_examples.
6513 * Makefile.in, checks/get_them, checks/check_them: Adjust.
6514 * lib/vfprintf.c: New location for etc/vfprintf.c.
6515 * Delete empty etc/.
6516 * examples/: New name for test/.
6518 1992-03-10 François Pinard <pinard@iro.umontreal.ca>
6520 * Makefile.in (check): Add m4 as dependency.
6522 * m4.c: Accept --no-warnings instead of --no_warnings, and
6523 --no-gnu-extensions instead of --no_gnu_extensions. Make the
6524 usage message more informative.
6525 Reported by David MacKenzie.
6527 1992-03-09 François Pinard <pinard@iro.umontreal.ca>
6529 * etc/check_examples: New name for check_examples.sh.
6530 * etc/get_examples: New name for get_examples.sh.
6531 * Makefile.in, etc/Makefile.in: Use new names.
6533 * Makefile.in: Transmit $(CC) while making in lib.
6535 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
6536 code disposition by hand.
6538 1992-03-08 François Pinard <pinard@iro.umontreal.ca>
6540 * m4.h: Delete definitions for abort() and exit().
6541 Reported by Richard Stallman.
6543 * config/hmake-unicos, config/s-unicos.h: New files.
6544 Reported by Hal Peterson.
6546 * eval.c (exp_term): Have N^0 return 1.
6547 Reported by Michael Fetterman.
6549 * eval.c, input.c, m4.h: Remove last comma in enums.
6550 Reported by Mike Lijewski.
6552 * Transfer of maintenance duties from René to François.
6554 1991-10-24 René Seindal <seindal@diku.dk>
6556 * Release 1.0. Many thanks to those, who provided me with bug
6557 reports and feedback.
6559 * Uses GNU configure, taken from the gdb distribution.
6561 * Uses GNU getopt(), with long option names.
6563 * The -Q/+quiet option is added, which suppresses warnings about
6564 missing or superflous arguments to built-in macros.
6566 * Added default options via the M4OPTS environment variable.
6568 * The built-in format can now be configured to use sprintf as
6569 the formatting engine, for systems without [efg]cvt(3).
6571 * GNU library code is moved to the ./lib subdirectory; other
6572 utility files are now in ./etc.
6574 * Several minor bugs have been fixed.
6576 1991-07-26 René Seindal <seindal@diku.dk>
6578 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
6579 Francois Pinard and Roland H. Pesch for providing me with reports.
6581 * The builtins incr and decr are now implemented without use of
6584 * The builtin indir is added, to allow for indirect macro calls
6585 (allows use of "illegal" macro names).
6587 * The debugging and tracing facilities has been enhanced
6588 considerably. See the manual for details.
6590 * The -tMACRO option is added, marks MACRO for tracing as soon
6593 * Builtins are traced after renaming iff they were before.
6595 * Named files can now be undiverted.
6597 * The -Nnum option can be used to increase the number of
6598 divertions available.
6600 * Calling changecom without arguments now disables all comment
6603 * The function m4_patsubst() is now consistently declared
6606 * A bug in dnl is fixed.
6608 * A bug in the multi-character quoting code is fixed.
6610 * Several typos in the manual has been corrected. More probably
6613 * The m4.info file is now installed along with the program.
6615 1990-11-15 René Seindal <seindal@diku.dk>
6617 * Updated and enhanced version. Release 0.75, manual 0.07.
6619 * Implemented search path for include files (-I option and
6620 M4PATH envronment variable).
6622 * Implemented builtin "format" for printf-like formatting.
6624 * Implemented builtin "regexp" for searching for regular
6627 * Implemented builtin "patsubst" for substitution with regular
6630 * Implemented builtin "esyscmd", which expands to a shell
6633 * Implemented "__file__" and "__line__" for use in error
6636 * Implemented character ranges in "translit".
6638 * Implemented control over debugging output.
6640 * Implemented multi-character quotes.
6642 * Implemented multi-character comment delimiters.
6644 * Changed predefined macro "gnu" to "__gnu__".
6646 * Changed predefined macro "unix" to "__unix__", when the -G
6647 option is not used. With -G, "unix" is still defined.
6649 * Changed "shift", "$@" and "$*" to not insert spaces afters
6652 * Added program name to error messages.
6654 * Fixed two missing null bytes bugs.
6656 1990-01-22 René Seindal <seindal@diku.dk>
6658 * Initial beta release. Release 0.50, manual 0.05.