* configure.ac (gl_MODULES): Add assert to support a
[m4/ericb.git] / ChangeLog
bloba6d0d9cff36976a4131cd359333ac39247c03964
1 2005-05-06  Gary V. Vaughan  <gary@gnu.org>
3         * configure.ac (gl_MODULES): Add assert to support a
4         --disable-assert configure time option for NDEBUG setting.
6         * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
7         * bootstrap (src_modules): Add version-etc-fsf.
8         * src/main.c (version_etc_copyright): Removed.
10         * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
12 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
14         * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
15         recognition macros.
16         * src/freeze.c (produce_frozen_state): Use \n line-endings even
17         on Windows, so that the frozen file reader will work.
18         Reported by Josef T. Burger <bolo@bolo.com>
20 2005-05-04  Vincent Lonngren  <Vincent.lonngren.759@student.lu.se>
22         Forward port of a patch that allowed m4-1.4.2 to compile on
23         QNX 6.3:
25         * configure.ac (AC_CHECK_HEADERS):  Add signal.h,
26         sys/signal.h.
27         * src/m4.h: And include them as appropriate.
28         * src/main.c, src/stackovf.h: Don't include signal.h literally;
29         m4.h will include the correct file.
31 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
33         * m4/m4private.h: Make errno visible for the sources patched
34         below.
36 2005-05-04  Paul Eggert  <eggert@twinsun.com>
38         * src/main.c (print_program_name_CB): Preserve errno, since
39         M4ERROR relies on this.
40         * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
41         * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
42         * m4/path.c (m4_path_search): Don't let "free" trash errno when
43         returning NULL.
45         * m4/output.c (m4_insert_file): Don't assume errno has a valid
46         value simply because fread returns zero.  This fixes a
47         portability bug reported by Marion Hakanson in
48         <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
50 2005-05-04  Santiago Vila  <sanvila@debian.org>
52         * tests/stackovf.test: Use tempfile if available.
54 2005-05-04  Robert Bihlmeyer  <robbe@orcus.priv.at>  (tiny change)
56         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
57         * m4/output.c (m4_insert_file): Do not mix buffered and
58         unbuffered I/O, as this breaks on the Hurd.
60 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
62         Gnulib has changed again.  Reimport.  Adjust.  Rinse.  Repeat.
63         Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
64         and libtoolize does a better job of ltdl importing now too, so
65         take advantage of that while updating the tree:
67         * acm4, config: Moved from here...
68         * ltdl/m4, ltdl/config: ...to here.
69         * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
70         src/Makefile.am, tests/Makefile.am: Removed...
71         * Makefile.am: ...and migrated to here, with adjustments to
72         compensate for relative path differences.
73         * commit: Adjust relative paths.
74         * configure.ac: Adjust relative paths.
75         (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
76         patch.
77         (LT_PREREQ): 2.0 isn't released yet, but will work when it is!  In
78         the meanwhile, CVS HEAD libtool is needed.
79         (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
80         stricly new enough, we also need a patch.
81         (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
82         (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
83         (gl_MODULES): Don't list getopt and version-etc, as they don't
84         belong in libm4.
85         * bootstrap: After running gnulib-tool to import the listed
86         modules, fetch getopt and version-etc into src manually.
87         (ltdldir): Change to ltdl.
88         * src/main.c: Adjust for changes in version-etc API.
89         * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
90         but works when the getopt module isn't to be included in the lib.
91         * README: Add note about patching autoconf and automake to
92         bootstrap CVS m4.
94 2005-05-02  Matt Kraai  <kraai@debian.org>  (tiny change)
96         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
97         * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
98         empty file rather than to a nonexistent file.  This closes a
99         common security hole.
100         * modules/m4.c (m4_maketemp): Implement the above, by using
101         mkstemp rather than mktemp.
103 2005-05-01  Gary V. Vaughan  <gary@gnu.org>
105         The FSF are moving offices today.  Changed their contact address
106         in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
107         `51 Franklin Street, Fifth Floor, MA 02110-1301'.
109 2005-03-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
111         * tests/Makefile (clean-local): Ignore testsuite cleanup
112         failures.
114 2005-03-11  Per Bothner  <per@bothner.com>  (tiny change)
116         * tests/Makefile (clean-local): Only run the testsuite cleanup
117         if the testsuite has been generated.
119 2005-02-11  Stepan Kasal  <kasal@ucw.cz>
121         * TODO: slight clarification of the example of qindir usage.
123 2005-02-08  Gary V. Vaughan  <gary@gnu.org>
125         * TODO: Add qindir requirement, and defn bug.
126         From Stepan Kasal  <kasal@ucw.cz>
128 2005-02-08  Stepan Kasal  <kasal@ucw.cz>
130         * TODO: Add ``execution stack'', fix a typo.
131         * doc/m4.texinfo: Typos.
133 2004-12-24  Eric Blake  <ebb9@byu.net>
135         * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
136         to the gnu subdirectory.
137         * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
138         * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
139         * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
140         * m4/system_.h: Likewise, in non-configured includes.
142 2004-10-14  Noah Misch  <noah@cs.caltech.edu>,
143             Gary V. Vaughan  <gary@gnu.org>
145         * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
146         Protect definitions from macro expansion under -DNDEBUG by
147         parenthesising the expanded function names.
148         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
149         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
150         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
151         (m4_is_syntax_macro_escaped): Similarly protect function
152         definitions from macro expansion under -DNDEBUG by #undefing the
153         matching macro names before each definition.  Also, move all the
154         function definitions to the end of the file so that any
155         invocations in the rest of the file pick up the fast macro
156         versions.
157         * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
158         (m4_set_debug_file, m4_set_trace_messages)
159         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
160         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
161         (m4_set_max_debug_arg_length_opt): New fast macro versions of the
162         option setter functions.
164 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
166         * src/main.c: Include gnulib files from the correct directory.
168         * gnulib/*: Don't store any of the gnulib files in arch, as they
169         generate spurious changes.
170         * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
171         gnulib macros now share our macro directory.
172         (SUBDIRS): Descend into `gnu' rather than `gnulib'.
173         * bootstrap: Call gnulib-tool to import from the gnulib tree.
174         (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
175         gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
176         the gettext macros from autopoint that overwrite the gnulib-tool
177         imported versions.  Import sources and Makefile.am into the `gnu'
178         directory.  Changed all callers.
179         * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
180         gl_INIT): Call these gnulib-tool macros instead of the hardcoded
181         for imported modules.
182         * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
183         acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
184         hardcoding the gnulib macros they wrap.
186 2004-07-15  Gary V. Vaughan  <gary@gnu.org>
188         Latest CVS libtool can preload modules in libraries, including
189         its own module loaders!  Tweak m4 so that it doesn't try to treat
190         libltdl's module loaders as m4 modules when freezing and on exit:
192         * gnulib/acm4/*.m4: Don't store these files in arch since they
193         generate spurious changes.
194         * bootstrap: Simplify initial libtoolize call, since CVS
195         libtoolize is smarter these days.
196         * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
197         build.
198         * m4/module.h (m4__module_exit): Missing declaration.
199         * m4/m4private.h (m4__module_next): New function declaration.
200         * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
201         encapsulation.  Changed all callers.
202         (m4__module_interface): New function to verify m4 loadable module
203         interfaces.
204         (m4__module_init): Register the interface validator.
205         (m4__module_exit): Only close my own modules.
206         * modules/m4.c (unistd.h): Provide missing declaration.
207         (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
208         (m4_expand_ranges): More missing declarations.
209         * modules/modtest.c (export_test): Ditto.
210         * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
211         * src/main.c (main): Bump copyright year.
212         * tests/modules.at: Fix sed syntax error.
215 2004-06-17  Gary V. Vaughan  <gary@gnu.org>
217         Tweaking to enable compilation with latest CVS libtool and
218         libltdl.  We can't just dump the library files directly into the
219         m4 directory anymore now that libltdl is built from pieces itself:
221         * bootstrap: Rewritten to use latest libtoolize sanely, and to
222         set up libltdl subdirectory.
223         * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
224         gnulib subdirectory's config.
225         (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
226         (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
227         macros from gnulib.
228         (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
229         configure.ac, so use AC_WITH_LTDL instead.
230         * Makefile.am (SUBDIRS): Add libltdl.
231         * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated.  gnulib now uses
232         gl_INCLUDED_REGEX.
233         * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
234         (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
235         (libm4_la_LIBADD): Add LIBLTDL.
236         * m4/ltdl.c, m4/ltdl.h: Removed.
237         * m4/m4module.h: Include canonical ltdl.h.
238         * po/*.po: Updated.
240 2004-06-14  Gary V. Vaughan  <gary@gnu.org>
242         * gnulib/import: Now updates makefile fragments, and configure.ac.
243         * gnulib/m4/gnulib.am: New file.  Generated makefile fragments.
244         * gnulib/m4/Makefile.am: include it.
245         * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
246         gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
247         gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
248         gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
249         gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
250         * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
251         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
252         gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
253         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
254         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
255         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
256         gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
257         gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
258         import.
259         * gnulib/m4/getopt_int.h: New source file from latest gnulib
260         import.
261         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
262         gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
263         gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
264         gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
265         Updated source files from latest gnulib.
267 2004-02-29  Gary V. Vaughan  <gary@gnu.org>
269         * config/mailnotify: New file for mailing commit notifications,
270         imported from cvs-utils.
271         * commit: Updated from cvs-utils and tweaked for m4.
273 2003-12-01  Gary V. Vaughan  <gary@gnu.org>
275         * config/mkstamp: Updated from CVS libtool.
276         * configure.ac: Generate a gnu coding standards compliant version
277         number, and use it for the banner.
278         * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
279         mhen the TIMESTAMP changes in ChangeLog, but the file modification
280         time doesn't (e.g. in cvs commit).  Otherwise dist tarballs will
281         contain the previous version number.
282         * src/main.c: Make --version output conform to the GNU standard.
284         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
285         * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
286         m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
287         shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
288         time_la_SOURCES): ...so that these are defaulted correctly, and
289         can be removed from this file.
290         (AM_LDFLAGS): Add -module...
291         (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
292         traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
293         import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
294         the individual settings can be removed.
295         * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
296         * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
297         m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
298         shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
299         time_la_LIBADD): ...so that these are picked up as a deplib of
300         libm4 and don't need to be set explicitly.
302 2003-11-18  Gary V. Vaughan  <gary@gnu.org>
304         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
305         from the standard build.  It is too fragile.
307         * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
308         CVS libtool after merging m4 changes across to libtool.
310         * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
311         * m4/path.c (search_path_add): Ditto.
313 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
315         * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
316         libtool tags we don't use in configure.  This reduces the size
317         of the script from over 1Mb to under 700Kb.
319 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
321         The import script was not written properly, and the last gnulib
322         import was incomplete.  Fixed that problem, and reimport our
323         gnulib dependencies, which picks up the address calculation
324         overflow checks described by Paul below.  Also tweak the clients
325         of the gnulib xalloc module not to use deprecated macros:
327         * gnulib/import: Recurse through module dependencies rather than
328         naively descending only one level.
329         * configure.ac: Add calls to gnulib's strnlen and extension module
330         macros.
331         * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
332         extension modules.
333         * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
334         gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
335         gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
336         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
337         gnulib.
338         * gnulib/acm4/libtool.m4: Updated from CVS libtool.
339         * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
340         place of `xcalloc (1, S)'.
341         * m4/m4.c (m4_create): Likewise.
342         * m4/m4private.h (m4_symbol_value_create): Likewise.
343         * m4/symtab.c (symtab_fetch): Likewise.
344         * m4/syntax.c (m4_syntax_create): Likewise.
345         * src/freeze.c (reload_frozen_state): Likewise.
346         * m4/path.c (search_path_add): Eliminate use of deprecated NEW
347         macro.
348         * m4/symtab.c (m4_symtab_create): Likewise.
350 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
352         * tests/module.at: Comment typo.
354 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
356         * tests/modules.at (modules: importing): Apply some lateral
357         thinking, and use AT_CHECK to compare the output of a sed pass
358         over stderr against the canonical strerror string.
360         * tests/modules.at (modules: importing): Edit the generated stderr
361         output to canonicalize strerror output, before a comparison.
363 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
365         Tru64UNIX perl is sloppy with namespace pollution.  This patch is
366         careful not to trip over the mess:
368         * modules/perl.c: Some builds of perl install headers that contain
369         `#define try __builtin_try'.  Be sure to undefine that macro
370         before `m4/hash.h' gets included, which uses the `try' symbol.
371         * m4/system_.h: Similarly for `bool'.  Undefine `bool', `true' and
372         `false' before including `stdbool.h'.
373         (DELETE):  This symbol is not in m4's namespace, and is in any
374         case only used internally...
375         * m4/m4private.h (DELETE): ...so move it to here.
376         Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
378 2003-10-08  Paul Eggert  <eggert@twinsun.com>
380         Don't use XMALLOC and XCALLOC.  Once we install the
381         corresponding patch into gnulib, this will fix some
382         address-calculation overflow bugs on hosts where calloc (A, B)
383         returns garbage when A*B overflows.
385         * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
386         maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
387         xmalloc, XCALLOC with xcalloc.
388         * m4/m4.c (m4_create): Likewise.
389         * m4/m4private.h (m4_symbol_value_create): Likewise.
390         * m4/output.c (m4_output_init): Likewise.
391         * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
392         * m4/syntax.c (remove_syntax_attribute): Likewise.
393         * src/freeze.c (reload_frozen_state): Likewise.
394         * src/main.c (main): Likewise.
396 2003-10-07  Gary V. Vaughan  <gary@gnu.org>
398         * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
399         gnulib/acm4 directories for aclocal m4 macros.
400         * gnulib/Makefile.am (EXTRA_DIST): Removed.
401         (MAINTAINERCLEANFILES): Add Makefile.in.
402         * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
403         modules we use.
404         * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
405         * gnulib/import: New file.  Temporary script for updating gnulib
406         imported files, until gnulib-tool is working.
407         * gnulib/config/codeset.m4, gnulib/config/error.m4,
408         gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
409         gnulib/config/getopt.m4, gnulib/config/gettext.m4,
410         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
411         gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
412         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
413         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
414         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
415         gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
416         gnulib/config/nls.m4, gnulib/config/obstack.m4,
417         gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
418         gnulib/config/progtest.m4, gnulib/config/realloc.m4,
419         gnulib/config/regex.m4, gnulib/config/restrict.m4.
420         gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
421         gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
422         gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
423         gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
424         gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
425         gnulib/config/xstrndup.m4: Removed.
426         * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
427         gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
428         gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
429         gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
430         gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
431         gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
432         gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
433         gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
434         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
435         gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
436         gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
437         gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
438         gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
439         gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
440         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
441         gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
442         gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
443         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
444         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
445         gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
446         gnulib/import script.
447         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
448         gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
449         gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
450         gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
451         gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
452         gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
453         gnulib with gnulib/import script.
454         * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
455         guards ready for gnulib-tool to autoupdate on import.
456         * config/debug.m4, config/gmp.m4, config/m4-error.m4,
457         config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
458         config/stackovf.m4: Moved from here...
459         * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
460         acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
461         acm4/stackovf.m4: ...to here, to separate aclocal macros from
462         configure time helper scripts.
463         * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
464         * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
465         m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
466         src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
467         gnulib xalloc.h.
468         * src/main.c (version_etc_copyright): Only output the current
469         year.
470         (version_etc): Call with new variadic API.
472 2003-09-16  Gary V. Vaughan  <gary@gnu.org>
474         * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
475         version-etc module from CVS gnulib.
476         * po/POTFILES.in: Add gnulib/m4/version-etc.c.
477         * src/Makefile.am: Build it.
478         * src/main.c: Use it.
480         * gnulib/m4/exit.h: Import exit module from CVS gnulib.
481         * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
482         * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
483         exit.h instead.
485 2003-09-15  Charles Wilson  <cygwin@cwilson.fastmail.fm>,
486             Gary V. Vaughan  <gary@gnu.org>
488         * bootstrap: Separate options.
489         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
490         * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
491         not set.
492         * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
493         (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
494         (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
495         (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
496         $(LTLIBINTL) for gettext support on cygwin.
497         * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
498         have $(LTLIBINTL) from the preloaded module la files.
499         * README: Remove the warning about using --disable-nls on Windows
500         machines.
502 2003-09-15  Gary V. Vaughan  <gary@gnu.org>
504         * gnulib/m4/regex.c:  s/<regex.h>/"regex.h"/ or else the compiler
505         picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
506         is required.
508 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
510         * doc/STYLE: Document the gnulib header naming conventions, and
511         #include policy.
512         * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
513         gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
514         gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
515         respectively.
516         * gnulib/m4/Makefile.am: Remove the rules to build these headers.
518         * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
519         module from CVS gnulib.
520         * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
521         (gl_FUNC_STRTOL): In favour of the module macro.
523 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
525         Replace the getopt code with CVS gnulib getopt.  The source files
526         detect whether they are in a glibc environment and preprocess away
527         all of the code if there is a system getopt, so we can compile
528         them into the m4 executable unconditionally:
530         * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
531         gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
532         * configure.ac (gl_GETOPT): Use this instead of homebrew inline
533         macros.
534         * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
535         version.
536         * src/Makefile.am: Adjust.
537         * src/main.c: Always include our shipped getopt.h.
538         * po/POTFILES.in: Use new location of getopt.c.
540 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
542         * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
543         * config/Makefile.am: Removed.  Automake 1.8 distributes the files
544         in this directory automatically.
545         * Makefile.am (EXTRA_DIST): Except config/mkstamp.
547         * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
548         isn't set yet.
549         * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
550         inline.
551         * modules/Makefile.am (pkglibexecdir): Set it here.
552         (pkgmodincdir): Renamed to pkgmodincludedir).  Changed all clients.
554         * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
555         Import regex module from CVS gnulib.
556         * gnulib/config/restrict.m4: Ditto for dependee module restrict.
557         * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
558         do extra substitutions for Makefile.
559         * configure.ac: Use it.
560         * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
561         from regex_.h if necessary.
562         * m4/system_.h: Include the correct version of regex.h.
563         * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
564         version.
565         * po/POTFILES.in: Use new location of regex.c.
567         * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
568         realloc.c: automake distributes these files already.
570 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
572         Replace the xstrzdup code by importing the xstrndup module from
573         CVS gnulib, along with its dependencies: strndup and strnlen:
575         * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
576         gnulib/config/xstrndup.m4: Import xstrndup module from CVS
577         gnulib.
578         * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
579         gnulib/config/strndup.m4: Ditto wrt strndup.
580         * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
581         strnlen.
582         * gnulib/m4/Makefile.am: Add rules from newly imported modules.
583         However, contrary to gnulib, we install xstrndup.h.
584         * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
585         * gnulib/lib/xstrzdup.c: Delete.  This was never a gnulib file, it
586         is an artifact of the old m4 portability layer.
587         * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
588         * m4/system_.h: Include xstrndup.h.
589         * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
591 2003-09-11  Gary V. Vaughan  <gary@gnu.org>
593         Reimport the latest xalloc module from CVS gnulib, and adjust the
594         m4 sources to take advantage of xalloc xfree.  Also create a new
595         macro DELETE with the same semantics as the old m4 XFREE macro,
596         and carefully tweak callers:
598         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
599         gnulib.
600         * m4/utility.c (xfree): Removed.  This function is now supplied by
601         gnulib xalloc.
602         * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
603         * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
604         * m4/symtab.c (m4_symtab_create): Ditto.
605         * m4/system_.h: Removed XFREE redefine.
606         (DELETE): New macro with same functionality as the original m4
607         XFREE macro, but based on xalloc.h now.  Changed all callers.
608         * src/main.c (main): Use XMALLOC macro.
609         * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
610         instead of XFREE.
611         * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
613 2003-09-10  Gary V. Vaughan  <gary@gnu.org>
615         Import the xalloc module from CVS gnulib, along with its
616         dependencies: exitfail, malloc and realloc. We had different
617         semantics for our XFREE and a function xfree() not supplied by
618         gnulib, so also a bit of work to keep everything running
619         smoothly:
621         * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
622         (gl_XALLOC): Use gnulib equivalents.
623         * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
624         gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
625         * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
626         * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
627         realloc.
628         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
629         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
630         * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
631         imported modules.
632         (pkgincdir): Removed.  Use pkgincludedir instead.
633         * m4/m4private.h (XFREE): xfree already checks for NULL.
634         * m4/system_.h: Use xalloc module, and remove macros already
635         supplied by xalloc.h.
636         * m4/utility.c (xfree): xalloc does not yet implement xfree, so
637         moved the old definition from m4/xmalloc.c to here for now.
639 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
641         Import the error and progname modules from CVS gnulib.  Our old
642         error.c subsumed the functionality of both, so a little adjustment
643         was required to accomodate the split in sources.  Also added more
644         wrapper macros to choose between a system installed error.h or our
645         shipped gnulib error module:
647         * m4/error.c, m4/error.h: Removed.
648         * m4/Makefile.am: Adjust.
649         (pkgincdir): Removed.  Use pkgincludedir instead.
650         * m4/module.h, src/main.c: Don't include `m4/error.h'.
651         * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
652         error.h.
653         * gnulib/m4/progname.c: Imported from CVS gnulib.
654         * gnulib/m4/progname.h: Ditto.
655         * src/main.c: Adjust to use progname module.
656         * gnulib/m4/error.c: Imported from CVS gnulib.
657         * gnulib/m4/error_.h: Ditto.
658         * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
659         if appropriate, and link a local error.h if the system version is
660         missing.
661         (libgnu_la_SOURCES) Add progname module sources.
662         * gnulib/config/error.m4: Imported from CVS gnulib.
663         * gnulib/config/strerror_r.m4: Ditto.
664         * config/m4-error.c: New file.  Wrap gnulib error.m4 but arrange
665         to have ERROR_H for Makefile substitutions and tell system.h
666         whether the system error.h should be used, or a locally installed
667         version.
668         * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
670 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
672         * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
673         s/gettext_.h/gettext.h/.
675         * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
676         automake have been fixed.
678         * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
679         gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
680         of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
681         rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
683 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
685         The gnulib obstack module requires the gnulib gettext module for
686         systems that do not have GNU gettext installed.  Because we use
687         -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
688         that directory incase it clashes with the system gettext.h.  This
689         delta uses gettext_.h and extra rules in the Makefile to make a
690         link to gettext.h when needed:
692         * Makefile.am (auxdir): Removed.  No longer used.
693         * configure.ac (ac_aux_dir): Removed AC_SUBST.  No longer used.
694         (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
695         moved.
696         (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
697         Makefile based build.
698         (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
699         of the macros are kept.
700         * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
701         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
702         * config/Makefile (ACLOCAL_MACROS): Removed.  Automake 1.7a
703         distributes these automatically.
704         * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
705         warning from automake-1.7a.
706         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
707         m4_CHECK_DEBUGGING for consistency with gnulib prefixes.  Changed
708         all callers.
709         * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
710         wrt. m4_FUNC_OBSTACK.
711         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
712         wrt. m4_sys_STACKOVF.
713         * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
714         wrt. _m4_LIB_GMP, m4_LIB_GMP.
715         (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
716         namespace.  Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
717         respectively.
718         * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
719         * gnulib/m4/Makefile.am: Added a new block to make an appropriate
720         gettext.h link on deficient systems.
721         (pkginc_HEADERS): Mention $(GETTEXT_H).
722         (EXTRA_HEADERS): Mention gettext.h.
723         * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
724         * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
725         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
726         gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
727         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
728         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
729         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
730         gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
731         gnulib/config/po.m4, gnulib/config/progtest.m4,
732         gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
733         gnulib/config/ulonglong.m4: Imported from CVS gnulib.
735 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
737         We can't mirror the gnulib directory structure here, since we need
738         to be able to eg. `#include <m4/obstack.h>' from our source files,
739         which is much easier if the local obstack.h is created in a
740         directory named m4.  Rather than trying to symlink everything into
741         the m4 directory, now we build a libtool convenience library from
742         the sources we get from gnulib and link that with libm4.la:
744         * gnulib/config/extensions.m4: Imported from CVS gnulib.
745         * gnulib/config/unlocked-io.m4: Ditto.
746         * gnulib/m4/unlocked-io.h: Ditto.
747         * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
748         gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
749         * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
750         gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
751         * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
752         * m4/Makefile.am: Adjust.
753         * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
754         macros we redistribute.
755         * gnulib/m4/Makefile.am: New file.  Build libgnu.la convenience
756         library among others.
757         (GNULIB_SRCS, GNULIB_MACROS): Removed.
758         * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
759         * config/m4-obstack.m4: Adjust.
760         * po/POTFILES.in: Adjust.
761         * configure.ac: Reformatting.  Call newly imported gnulib macros.
762         * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
763         bogus calls of `#include "m4.h"'.
764         * Makefile.am: INCLUDES has been deprecated in favour of
765         AM_CPPFLAGS.
766         * m4/Makefile.am: Ditto.
767         * modules/Makefile.am: Ditto.
768         * src/Makefile.am: Ditto.
770 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
772         * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
774 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
776         Migrate the obstack support into the gnulib directories for easy
777         synchronisation with upstream files in gnulib:
779         * config/gnu-obstack.m4: Moved from here...
780         * config/m4-obstack.m4: ...to here.
781         * config/Makefile.am (SPECIFIC_MACROS): Adjust.
782         * m4/obstack.c, m4/obstack_.h: Moved from here...
783         * gnulib/obstack.c, gnulib/obstack.h: ...to here.
784         * po/POTFILES.in: Adjust.
785         * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
786         * m4/Makefile.am: Add a whole new section to link the obstack
787         sources from the gnulib tree if necessary.
788         * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
789         from gnulib.
790         * config/m4-obstack.m4: Rewrite as a wrapper for
791         gnulib/m4/obstack.m4.
793 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
795         GNU M4 currently builds with a number of files adapted from
796         upstream sources.  Recently the gnulib project on savannah.gnu.org
797         has pulled together a great many of these externally maintained
798         files.  This delta is the beginnings of isolating those files
799         maintained in gnulib to make it easy to synchronise M4 with the
800         upstream files prior to releases.
802         * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
803         directory.
804         (SUBDIRS): Added new gnulib subdirectory.
805         * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
806         * config/stdbool.m4: Moved from here...
807         * gnulib/m4/stdbool.m4: ...to here.
808         * m4/stdbool_.h: Moved from here...
809         * gnulib/lib/stdbool_.h: ...to here.
810         * gnulib/Makefile.am: New file.  Make sure the gnulib tree is
811         distributed.
812         * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
813         code to work with new stdbool_.h location.
814         (gnulib_srcdir): New.
816 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
818         * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
819         (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
820         builds to work.
821         (SPECIFIC_TOOLS): New variable.  Moved mkstamp to here.
822         (EXTRA_DIST): Use it.
824         * bootstrap: CVS autoreconf leaves file droppings.  Remove
825         aclocal.m4t incase autoreconf doesn't.
827 2003-08-29  Gary V. Vaughan  <gary@gnu.org>
829         * m4/gnu-obstack.h: Updated from CVS gnulib.  For consistency with
830         the other gnulib imports, renamed to m4/obstack_.h.
831         * m4/obstack.c: Updated from CVS gnulib.
832         * m4/Makefile.am (EXTRA_HEADERS): Adjust.
833         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
834         header tests from gnulib obstack module.  AC_CONFIG_LINKS knows
835         about vpath already, and $top_srcdir upsets CVS Automake, so the
836         $top_srcdir reference was removed.
838         * m4/system-h.in: For consistency with the gnulib imports, renamed
839         to m4/system_.h.
840         * m4/Makefile (EXTRA_HEADERS): Adjust.
841         * configure.ac (AC_CONFIG_FILES): Adjust.
843         * m4/stdbool_.h: New file from gnulib for systems without their
844         own.
845         * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
846         * config/stdbool.m4: New file.  Macros from gnulib for same.
847         * configure.ac: Use it.
849 2003-08-27  Gary V. Vaughan  <gary@gnu.org>
851         * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
852         * config/gmp.m4: Ditto.
853         * config/gnu-obstack.m4: Ditto.
854         * config/stackovf.m4: Ditto.
855         * m4/builtin.c: Ditto.
856         * m4/debug.c: Ditto.
857         * m4/error.c: Ditto.
858         * m4/error.h: Ditto.
859         * m4/gnu-obstack.h: Ditto.
860         * m4/hash.c: Ditto.
861         * m4/hash.h: Ditto.
862         * m4/input.c: Ditto.
863         * m4/m4.c: Ditto.
864         * m4/m4module.h: Ditto.
865         * m4/m4private.h: Ditto.
866         * m4/macro.c: Ditto.
867         * m4/module.c: Ditto.
868         * m4/obstack.c: Ditto.
869         * m4/output.c: Ditto.
870         * m4/path.c: Ditto.
871         * m4/regex.c: Ditto.
872         * m4/regex.h: Ditto.
873         * m4/strtol.c: Ditto.
874         * m4/symtab.c: Ditto.
875         * m4/syntax.c: Ditto.
876         * m4/utility.c: Ditto.
877         * m4/xmalloc.c: Ditto.
878         * m4/xstrdup.c: Ditto.
879         * m4/xstrzdup.c: Ditto.
880         * modules/evalparse.c: Ditto.
881         * modules/format.c: Ditto.
882         * modules/gnu.c: Ditto.
883         * modules/import.c: Ditto.
884         * modules/load.c: Ditto.
885         * modules/m4.c: Ditto.
886         * modules/m4.h: Ditto.
887         * modules/modtest.c: Ditto.
888         * modules/mpeval.c: Ditto.
889         * modules/perl.c: Ditto.
890         * modules/shadow.c: Ditto.
891         * modules/stdlib.c: Ditto.
892         * modules/time.c: Ditto.
893         * modules/traditional.c: Ditto.
894         * src/freeze.c: Ditto.
895         * src/getopt.c: Ditto.
896         * src/getopt1.c: Ditto.
897         * src/m4.h: Ditto.
898         * src/main.c: Ditto.
899         * src/stackovf.c: Ditto.
901         * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
902         ac_default_headers is an autoconf internal variable.
903         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
904         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
906         * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
907         * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
908         delta.
910 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
912         * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
913         C99 bool.
914         * system-h.in (m4_boolean): Removed in favour of using C99 bool if
915         possible or faking one with a typedef.  Changed all callers.
917 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
919         Still cleaning up the users' module API, by taking out the stuff
920         that isn't used by any existing modules, and moving specialised
921         functions out of libm4 and into the module they are used by.
923         * m4/m4module.h (m4_skip_space): No need to export this.  Moved...
924         * m4/utility.c (m4_skip_space): ...to here the home of its only
925         use, made static and renamed to `skip_space'.  Changed all
926         callers.
927         * m4/m4module.h (m4_expand_ranges): Removed prototype.
928         * m4/utility.c (m4_expand_ranges): Moved definition from here...
929         * modules/m4.c (m4_expand_ranges): ...to here, and exported using
930         ltdl.
931         * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
932         casting .
933         * modules/gnu.c (builtin_syntax): Import and use in this
934         builtin implementation.
935         * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
936         Not used.  Deleted.
937         * m4/macro.c (trace_flush): Except here where the macro is now
938         manually inlined.
939         * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
940         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
941         moved...
942         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
943         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
945 2003-08-14  Gary V. Vaughan  <gary@gnu.org>
947         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
948         compiler based AC_CHECK_HEADER that was introduced in
949         autoconf-2.56.
950         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
951         * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
952         * configure.ac: Use renamed M4_AC_LIB_GMP.
954         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
955         macro that requires arguments! This stops the shell's bad
956         substitution error at configure time.
958         * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
959         variables to the testsuite shell.  Set the value of USE_GMP so
960         that the gmp test will run!
961         (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
963 2003-08-11  Gary V. Vaughan  <gary@gnu.org>
965         Libltdl already has an excellent mechanism for accessing C symbols
966         in modules.  Lets use that!  Remove all the exporting cruft and
967         just use lt_dlsym in conjunction with a few conventions to
968         simplify module writers' jobs.  Also removed the table address
969         caching code and otherwise simplified the module loader quite a
970         bit.  To access exported symbols in other modules, first the
971         exporting module must name the symbols <modname>_LTX_<symname>,
972         and the importing module must define a function type called
973         <symname>_func.  The importer then adds
974         M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
975         that wishes to call out to the exported functions.  Care must be
976         taken that <symname> is non-NULL in the importing module incase
977         M4_MODULE_IMPORT fails, but otherwise it can be called as if the
978         definition was in the importers source.  Study
979         `modules/{gnu.c,m4.{c,h}' for a model example.  At the moment,
980         m4_module_import will attempt to automatically load a module
981         required for symbol access if it is not loaded already.
983         * TODO: Removed the items fixed in this delta.
984         * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
985         module name.
986         * m4/ltdl.h (lt_dlhandle_find): Declare it.
987         * m4/module.c (m4_module_unload): Use it.
988         * src/freeze.c (reload_frozen_state): Ditto.
989         * m4/m4module.h (m4_export): Deleted.  Removed all references.
990         (M4_MODULE_IMPORT): New user convenience macro for importing
991         arbitrary symbols from other modules.
992         * m4/module.c (m4_module_import): New function to service
993         M4_MODULE_IMPORT macro.
994         (module_data): Removed.  Looking up the tables on demand with
995         lt_dlsym, rather than caching their addresses here simplifies the
996         code substantially.
997         (m4_get_module_builtin_table, m4_get_module_macro_table):
998         Removed.  Changed all callers.
999         (set_module_macro_table, set_module_builtin_table): Renamed to
1000         install_macro_table and install_builtin_table respectively, and
1001         simplified now that the cache is no more.
1002         * modules/gnu.c (builtin_symbols): Use this new mechanism to
1003         import m4_dump_symbols from the m4 module.
1004         (builtin_esyscmd): Likewise for m4_set_sysval and
1005         m4_sysval_flush.
1006         * modules/m4.c (m4_export_table): Removed.  Functions are
1007         addressed with the new mechanism which doesn't need this.
1008         (m4_set_sysval): New exported accessor function to prevent
1009         problems with variable access on inferior architectures.
1010         * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
1011         (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
1012         that we can have some type safety.
1013         * modules/modtest.c (export_test): C level exported function for
1014         testing the new import mechanism.
1015         * modules/import.c: New file for the import end of the test.
1016         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
1017         * tests/modules.at: New test cases for intermodule symbol
1018         importing.
1020 2003-08-07  Gary V. Vaughan  <gary@gnu.org>
1022         * m4/m4module.c (m4_string): Moved from here...
1023         * m4/m4private.c (m4_string): ...to here.
1025         * m4/utility.c (dumpdef_cmp): Removed stale declaration.
1027 2003-07-29  Gary V. Vaughan  <gary@gnu.org>
1029         * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
1030         already available to module writers through
1031         m4_{get,set}_nesting_limit_opt(), so moved from here...
1032         * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
1033         (m4_create): Use it.
1035 2003-07-28  Gary V. Vaughan  <gary@gnu.org>
1037         Aside from auditing path.c for m4module.h api obfuscation, this
1038         delta introduces the concept of private struct members in opaque
1039         data types to GNU m4: See the STYLE file for details.
1041         * TODO: Remind ourselves that a rewrite of path.c is needed.
1042         * m4/m4module.h (m4_search_path, struct m4_search_path_info):
1043         Moved from here...
1044         * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
1045         here and renamed.  These type definitions are for internal api use
1046         only.  Changed all callers.
1047         * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
1048         Moved from here...
1049         * m4/path.c (search_path_env_init, search_path_add): ...to here
1050         and renamed.  These calls were never used outside this file.
1051         Changed all callers.
1052         (dirpath): Moved functionality of this static declaration...
1053         * m4/m4private.h (struct m4): ...to this new internal only
1054         search_path field.  Changed all callers.
1055         (m4__get_search_path): Added new internal api accessor.
1056         * m4/path.c (m4_search_path_info_new):  Removed.  Not used.
1057         (m4_include_init): Removed...
1058         * m4/m4.c (m4_create): ...because the new m4 field is now
1059         initialised here.
1060         (m4_delete): Recycle search_path memory.
1061         * src/main.c (main): Don't call m4_include_init now that it's
1062         gone!
1063         * doc/STYLE: Document convention for private fields in opaque
1064         ADTs.
1066 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
1068         Sometimes exporting the address of a symbol from a module isn't
1069         enough for other modules to call that symbol correctly.  If
1070         custom data types are used for function parameters, they need to
1071         be known to the caller.  This change introduces the concept of
1072         $(prefix)/include/modules/$(modulename).h to declare those
1073         structures.  Also we move m4_dump_symbols from libm4 to the m4
1074         module to show this concept in action.
1076         * m4/m4module.h (m4_dump_symbol_data): Moved from here...
1077         * modules/m4.h (m4_dump_symbol_data): ...to this new file for
1078         exporting data structures from modules/m4.c.
1079         * modules/m4.c, modules/gnu.c: Include it.
1080         * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
1081         * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
1082         prototypes.
1083         * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
1084         Moved from here...
1085         * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
1086         ...to here, with slight renaming.
1087         (m4_export_table): Prototype and add m4_dump_symbols.
1088         * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
1089         definition of m4_dump_symbols.
1090         * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
1091         * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
1093 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
1095         Create an export table in modules/m4.c in readiness for beefing up
1096         the module loader to track module exports and imports.
1098         * m4/m4module.h (m4_debug_flush_files): Removed prototype.
1099         * m4/debug.c (m4_debug_flush_files): Moved...
1100         * modules/m4.c (m4_sysval_flush): ...to here and renamed.
1101         * modules/gnu.c (builtin_esysval): Use it.
1102         * m4/m4module.h (m4_export): New type for declaring module symbols
1103         for export.
1104         * modules/m4.c (m4_export_table): List symbols exported from this
1105         module for use by other modules.
1107 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
1109         An experiment: There is loads of code in libm4 which should be in
1110         the m4 module, but is also used by another module. Just because
1111         some linkers won't cope with calls across dynamic runtime loaded
1112         objects I initially left the code in libm4.  It will tidy the
1113         module api immensely if this code moves to the right place, I just
1114         need to remember to invent a suitable calling mechanism at some
1115         point.  For now, only modules that are statically linked and
1116         preloaded will get this treatment, so the only platforms that will
1117         break are those that require all symbols to be resolved at link
1118         time.
1120         * TODO: Reminder that what I am doing could reduce portability
1121         unless I do something more robust later.
1122         * m4/m4module.h (m4_sysval): No longer exported from libm4.
1123         * m4/utility.c (m4_sysval): No longer declared in libm4.
1124         * modules/Makefile.am: Reformatting.
1125         * modules/m4.c (m4_sysval): Declare it at place of use.
1126         * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
1128 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
1130         * m4/m4module.h: Reformatting and rearranging lines a bit.
1131         (m4_obstack): Save typing by typedefing `struct obstack'.  Changed
1132         all users.
1133         (m4_call_macro, m4_expand_input): Renamed...
1134         (m4_macro_call, m4_macro_expand_input): ...to these.  Changed all
1135         callers.
1136         (m4_expansion_level, m4_process_macro): Moved...
1137         * m4/macro.c (expansion_level, process_macro): ...to here, and
1138         made static.
1140         * m4/m4module.h (program_name): Not used by modules at all, so
1141         moved...
1142         * src/main.c (program_name): ...to here.
1143         (print_program_name): Renamed...
1144         (print_program_name_CB): ...to conform to the STYLE guide.
1146 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
1148         More refactoring of the m4module.h API.  Replace #defines with an
1149         enum, and move non-public functions out of the public API.
1151         * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
1152         inclusion.
1153         * m4/macro.c (stdarg.h): Add ANSI C variadic header.
1154         * m4/debug.c (m4_debug, trace): Moved...
1155         * m4/m4private.h (struct m4): ...to fields of this struct.
1156         (m4_get_debug_file, m4_get_trace_messages): New fast access macros
1157         for the new fields.
1158         * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
1159         * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
1160         * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
1161         * m4/m4module.h (m4_context_field_table): Add entries for new
1162         debug_file and trace_messages fields.
1163         (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
1164         (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
1165         (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
1166         (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
1167         (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
1168         (m4_is_debug_bit): New macro to simplfy checks against the debug
1169         bits above.
1170         (m4_trace_format, m4_trace_header, m4_trace_flush)
1171         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
1172         prototypes.
1173         * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
1174         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
1175         * m4/macro.c (trace_format, trace_header, trace_flush)
1176         (trace_prepre, trace_pre, trace_post): ...to these newly static
1177         functions, since they are only ever used from this file.  Changed
1178         all callers.
1180 2003-07-17  Gary V. Vaughan  <gary@gnu.org>
1182         Change the macros for checking syntax so that matching against
1183         multiple possible syntax classes can be done with a single
1184         comparison some of the time.  The various classes are now bits of
1185         an int that can be checked with bitwise logic operators.
1187         * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
1188         (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
1189         (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
1190         (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
1191         (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
1192         (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
1193         (M4_SYNTAX_ALNUM): Removed.  Changed all callers.
1194         (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
1195         (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
1196         (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
1197         (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
1198         Replace all calls with invocations of these...
1199         (m4_is_syntax, m4_has_syntax): ...New macros.
1200         * src/freeze.c (produce_syntax_dump): Remove mask argument, which
1201         is no longer required with new macros.  Changed all callers.
1203 2003-07-15  Gary V. Vaughan  <gary@gnu.org>
1205         * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
1206         values are returned as part of the internal interface, so they
1207         need to be moved...
1208         * m4/private.h: ...to here.
1209         * m4/macro.c (expand_token): Check for out of range
1210         m4_peek_input() results before looking up in the syntax table.
1211         (collect_arguments): Ditto.
1213         * NEWS: Note `$' syntax class.
1215 2003-07-08  Paul Eggert  <eggert@twinsun.com> and
1216             Gary V. Vaughan  <gary@gnu.org>
1218         Conform to POSIX if the POSIXLY_CORRECT environment is set.
1219         --traditional `define' now smashes all the definitions.
1221         * NEWS: Explain this.
1222         * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
1223         (Extensions): Explain that extensions that are incompatible with
1224         POSIX are disabled if POSIXLY_CORRECT is set.
1225         (Incompatibilities): Remove.
1226         (Define, Other Incompat): Explain difference
1227         between GNU and POSIX behavior of define, pushdef, popdef.
1228         * m4/m4.c (m4_get_posixly_correct_opt): New undef.
1229         * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
1230         * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
1231         (m4_get_posixly_correct_opt): New macro.
1232         * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
1233         POSIXLY_CORRECT.
1234         * modules/m4.c (builtin_functions): defn now takes any number of args.
1235         (builtin_define): Smash all the definitions if
1236         POSIXLY_CORRECT.
1237         (builtin_defn)): Allow any number of arguments.
1238         (builtin_undivert): Do not allow nonnumeric arguments
1239         if POSIXLY_CORRECT.
1240         * src/main.c (main): Set posixly-correct behavior if either
1241         POSIXLY_CORRECT is set, or if -G is given.
1242         * tests/builtins.at: New test for smashed definitions.
1244 2003-06-27  Gary V. Vaughan  <gary@gnu.org>
1246         * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
1247         * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
1248         not to slow the parser down.
1249         (M4__IS_STRING): New macro to test string syntax class membership.
1250         * m4/syntax.c: Adjust docucomment.
1251         (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
1252         (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
1253         * m4/input.c (init_builtin_token): Comment typo.
1254         (m4__next_token): Comment typo.
1255         Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
1256         by using the new M4__IS_STRING macro.
1257         * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
1258         variable references in macro expansions.
1260         * doc/m4.texinfo (Eregexp and Regexp): Typo.
1261         (Epatsubst and Patsubst): Typo.
1262         (Eval): Typo.
1264 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
1266         Move the global variables that pertain to syntax to a new `struct
1267         m4_syntax_table', and then add one of these to `struct m4'.  The
1268         ripple effect through the code to both change formerly global
1269         references, and make sure a suitable context is available in
1270         lexical scope is disproportionately large compared to the size of
1271         the change proper.  This change is a large part of decoupling
1272         syntax.c from the rest of the code that uses it.
1274         * m4/m4private.h (struct m4): Add a syntax field.
1275         * m4/m4.c (m4_create): Initialise it,
1276         (m4_delete): Recycle it.
1277         (m4_get_symtab): Remove hand coded version...
1278         (m4_get_symbol_table): ...and generate this with cpp.  Changed all
1279         callers.
1280         * m4/m4module.h (m4_context_field_table): Add an extra field so we
1281         can generate m4_get_symbol_table.  Add a new row for
1282         m4_get_syntax_table.
1283         (M4SYNTAX): Syntactic sugar for module writers.
1284         (m4_symtab): Renamed to m4_symbol_table.  Changed all callers.
1285         (m4_syntax_table): New home for syntax related formerly global
1286         variables.
1287         * m4/m4private.h (struct m4_syntax_table): Define it.
1288         * m4/input.c (m4_input_init): Initialisation of these formerly
1289         global variables moved...
1290         * m4/syntax.c (m4_syntax_create): ...to here.
1291         * m4/input.c (m4_input_exit): And similarly, recycling of the
1292         memory used by those values moved...
1293         * m4/syntax.c (m4_syntax_delete): ...to here.
1294         * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
1295         Moved to m4/m4private.h.
1296         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
1297         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
1298         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
1299         (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
1300         objects.  Changed all callers that used to directly access the
1301         global equivalents.
1302         (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
1303         Removed and incorporated into m4_syntax_table structure.
1304         * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
1305         * m4/syntax.c (m4_set_syntax): Now returns an error status,
1306         instead of requiring a `struct m4' to generate its own errors.
1307         Changed all callers.
1308         * src/main.c (main): Now that the syntax table is initialised as
1309         part of m4_create, we have to manually wipe the syntax entries if
1310         we are about to read a frozen file.
1312 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
1314         * doc/STYLE: Added notes on callback naming schemes.
1316         * m4/module.c (m4_set_module_macro_table)
1317         (m4_set_module_builtin_table): Declarations weren't changed when
1318         definitions were renamed on 2003-06-19.
1320         * m4/hash.c (m4_hash_resize): ifdefed out.  This function is
1321         neither used nor particularly appropriate since it exposes the
1322         internal workings of the hash module.  I haven't yet decided
1323         whether to remove it entirely.
1325 2003-06-20  Gary V. Vaughan  <gary@gnu.org>
1327         Two related changes, and a huge knockon effect throughout the
1328         source: Moved the option variables out of global space and into
1329         `struct m4'; made `m4_symtab' a real datatype, so that its api
1330         is not marred passing `struct m4' around just so it can decide
1331         whether to keep traced symbol names or not.  Added setters and
1332         getters for the formerly global option variables, and obviously
1333         changed a vast number of functions to take a `struct m4' and use
1334         the getter funcs to find option values.
1336         * m4/utility.c (interactive, sync_output, debug_level)
1337         (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
1338         (max_debug_argument_length, warning_status, nesting_limit)
1339         (discard_comments): Removed.
1340         * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
1341         (debug_level, max_debug_argument_length, prefix_all_builtins)
1342         (suppress_warnings, discard_comments, interactive, sync_output):
1343         Removed from here...
1344         * m4/m4private.h (struct m4): ...and equivalent fields added to
1345         this structure.
1346         (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
1347         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
1348         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
1349         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
1350         (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
1351         macros for the new fields.
1352         * m4/m4module.h (m4_context_field_table)
1353         (m4_context_opt_bit_table): Helper macros used to generate
1354         prototypes, setters and getters for new option fields
1355         consistently.
1356         * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
1357         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
1358         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
1359         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
1360         (m4_get_interactive_opt, m4_get_sync_output_opt)
1361         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
1362         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
1363         (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
1364         (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
1365         (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
1366         setter and getter functions generated by cpp from
1367         m4_context_field_table and m4_context_opt_bit_table, exported as
1368         part of the module api.  Changed all callers.
1369         * m4/symtab (struct m4_symtab): Used as the concrete type for
1370         m4_symtab now.
1371         (m4_symtab_create): Allocate and initialise a new struct.
1372         (m4_symtab_apply): New function that works like m4_hash_apply, but
1373         with different callbacks specific to symbol tables.  Changed all
1374         callers.
1375         (symbol_destroy, arg_destroy, arg_copy): Renamed
1376         symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
1377         they have unused parameters for a reason!
1378         (dump_symbol_CB): New callback to dump the contents of a single
1379         symbol.
1380         (symtob_dump): Rewritten in terms of dump_symbol_CB.
1381         * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
1382         Changed all callers.
1383         * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
1384         of the contained `m4_symtab' at the `no_gnu_extensions' field.
1385         Although I'm not convinced these semantics are correct, they are
1386         at least consistent with how things were before this delta.  Also
1387         set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
1389 2003-06-19  Gary V. Vaughan  <gary@gnu.org>
1391         Tie down the interface to libm4 some more.  Make more structures
1392         opaque to modules by moving them to m4private.h, and writing
1393         setters and getters.  To win back the speed penalty for doing this
1394         also wrote macroized versions that do know about structure layout
1395         in m4private.h and #include that file into modules when NDEBUG is
1396         defined at compile time.  There are still some accessor macros in
1397         m4private.h that need to go, but that is not necessary to clean
1398         the module api up.
1400         * m4/m4module.h (m4_symbol_type): Moved...
1401         * m4/m4private.h (m4__symbol_type): ...to here.
1402         * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
1403         (m4_set_symbol_traced, m4_set_symbol_name_traced)
1404         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
1405         (m4_get_symbol_func, m4_symbol_value_create)
1406         (m4_symbol_value_delete, m4_set_symbol_value_text)
1407         (m4_set_symbol_value_func): New exported api to symbols.
1408         (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
1409         and m4_is_symbol_value_func.
1410         * m4/m4module.h: Prototype these guys.
1411         * m4/module.c (m4_set_module_macro_table)
1412         (m4_set_module_builtin_table): Make these static, there is no
1413         reason to pollute the api with them.
1414         * m4/m4private.h: Reformatting.
1415         (m4_get_symtab): Only define when NDEBUG is defined.
1416         (m4_get_symbol_value, m4_get_symbol_traced)
1417         (m4_set_symbol_traced, m4_set_symbol_name_traced)
1418         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
1419         (m4_get_symbol_func, m4_symbol_value_create)
1420         (m4_symbol_value_delete, m4_set_symbol_value_text)
1421         (m4_set_symbol_value_func): Macro implementations of the new
1422         functions when NDEBUG is defined.
1423         (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
1424         (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
1425         Superceded by the above.  All callers changed.
1426         (M4ARG): Removed.  This is no longer different to the
1427         m4/m4module.h definition.
1428         * modules/gnu.c, modules/m4.c: Only include m4private.h when
1429         NDEBUG is defined.  That way we exercise the same (albeit slower)
1430         api that external modules must use.
1432 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
1434         Renamed some of the types and their accessors to make more sense.
1435         Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
1436         has a stack of SYMBOL_VALUEs.
1438         * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
1439         (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
1440         m4_get_symbol_value_type,  m4_get_symbol_value_text,
1441         m4_get_symbol_value_func and m4_symbol_value_copy respectively.
1442         Changed all callers.
1443         (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
1444         (m4_get_token_type): Renamed
1445         * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
1446         to the internal api.
1447         * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
1448         s/TOKEN_/VALUE_/
1449         (m4__symtab_init, m4__symtab_exit): Removed prototypes.
1450         (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
1451         (m4__token_type): Moved here from m4module.h.
1452         (m4__next_token): Renamed from m4_next_token.
1453         * m4/symtab.c: Removed some of the parameterised macro support
1454         functions for modularisation later.
1455         (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
1456         m4_hash_dup to perform a true deep copy of the SRC.
1457         (arg_copy): Callback for m4_symbol_value_copy.
1458         * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
1459         Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
1460         m4_get_symbol_value_func.  Changed all callers.
1462 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
1464         Tidy up style of hash.[ch] in accordance with doc/STYLE.
1466         * m4/hash.c: Internal symbol renaming and formatting.
1467         (m4_hash_dup): New function to facilitate deep copies of hash
1468         tables.
1469         (m4_hash_apply_func): Returns a void* now, which is a richer type
1470         for returning exceptions (NULL means keep going).
1471         (m4_hash_apply): Ditto.
1472         * m4/hash.h: Declare exported symbols with an explicit extern.
1473         Reformated.
1475 2003-06-17  Gary V. Vaughan  <gary@gnu.org>
1477         Still refactoring furiously.  This delta represents a change in
1478         semantics to symtab.c.  Instead of building temporary m4_tokens
1479         in the caller, and copying fields in the methods, we now create
1480         the actual m4_token for hashing in the caller so the methods just
1481         slot them in directly.  Also, this means that we don't lookup a
1482         symbol and get back an allocated but VOID token to copy fields
1483         into, we create the token we want to push and pass that to
1484         m4_symbol_define or m4_symbol_pushdef.  And that's it.  There are
1485         a few other small changes to stop knowledge of the implementation
1486         of symtab.c leaking out into other files.
1488         * m4/macro.c (expand_argument): Comment typo corrected.
1489         * m4/symtab.c (symtab_fetch): New function to fetch the address of
1490         an interned symbol.
1491         (m4_symbol_pushdef): Take an extra value parameter and use this
1492         directly as the new top of the value stack.  All callers changed
1493         to build a token and pass responsibility for memory in, rather
1494         than copying as we used to.
1495         (m4_symbol_define): Also use the new value parameter directly as a
1496         replacement for the top of the value stack.  All callers changed
1497         to build a token as above.
1498         (m4_set_symbol_traced): New function to set the traced bit on the
1499         named symbol, creating it if necessary.
1500         (symbol_popval): The guts of the old m4_symbol_popdef.
1501         (m4_symbol_popdef): Use it.
1502         * m4/builtin.c (m4_symbol_set_token): Removed,
1503         (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
1504         replaced...
1505         * m4/module.c (m4_set_module_builtin_table)
1506         (m4_set_module_macro_table): ...with these more orthogonal
1507         functions.
1508         * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
1509         (m4_builtin_pushdef, m4_builtin_define): Removed.  No longer
1510         required.
1511         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
1512         (m4_arg_signature_parse): Moved...
1513         * m4/symtab.c: ...to here.
1514         * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
1515         screw something up. Moved...
1516         * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
1517         actually does a proper deep copy of source to dest.
1519 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
1521         Further refactoring to stabilise the module API.  Renaming some
1522         functions for orthogonality, and judicious definition migration to
1523         move things out of the set of exported symbols.
1525         * doc/STYLE: New file.  Notes on coding style.
1526         * m4/m4module.c: Updated bitrotted docucomment at the top of the
1527         file.
1528         (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
1529         m4_get_module_name, m4_get_module_builtin_table,
1530         m4_get_module_macro_table which are verb phrases.  Changed all
1531         callers.
1532         * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
1533         Moved to...
1534         * m4/module.c (m4_set_module_builtin_table)
1535         (m4_set_module_macro_table): ...here, and renamed. Changed all
1536         callers.
1537         * m4/m4module.c (m4_module_data): This...
1538         * m4/m4private.c (struct m4_module_data): ...and this...
1539         * m4/module.c (module_data) ...consolidated here and no longer
1540         exported.  Changed all callers.
1542 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
1544         Begin work on lifting the curse of the global variables.  To start
1545         with create a `struct m4' context container, and replace
1546         `m4__symtab' with `context->symtab' throughout.  This means
1547         initialising a context container in main, and adjusting many
1548         functions between main and the module entry points so that the
1549         container gets passed through.  It would have been nice to
1550         defer this until after 1.5, but it has a major effect on the
1551         user's module writing ABI, so it needs to be addressed now - at
1552         least in the areas that impact the ABI.  An interrelated change
1553         in the symtab API removes the dependency on a global symbol table,
1554         and instead focuses on a passed table (from the context
1555         container).
1557         * TODO: Reminders for finishing context functionality.
1558         * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
1559         * m4/m4.c: New file. Manage new struct m4 objects to eliminate
1560         global variables and eventually allow m4 to be reentrant.
1561         * m4/m4private.h (m4): Define the new structure here...
1562         (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
1563         don't carry the overhead of a function call.
1564         * m4/m4module.h: Prototype extern functions from m4/m4.c.
1565         (m4): Declare type for new struct m4 objects.
1566         (M4SYMTAB): User macro to ease finding the symbol table for the
1567         current context for module developers.
1568         (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
1569         verb.
1570         (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
1571         (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
1572         (m4_call_macro, m4_dump_symbols, m4_expand_input)
1573         (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
1574         (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
1575         (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
1576         m4* context parameter. Changed definitions and all callers.
1577         (m4_symtab): Alias for m4_hash to decouple the
1578         m4_symtab api from m4_hash.
1579         (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
1580         m4_hash.
1581         (m4_symtab_create): New function to return an initialised
1582         m4_symtab.
1583         (m4_symtab_delete): New function to delete an m4_symtab's memory.
1584         (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
1585         (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
1586         instead of simply using the global m4__symtab.  Changed
1587         definitions and all callers.
1588         * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
1589         * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
1590         * src/main.c (main): Create a context and use that instead of the
1591         former global m4__symtab.
1593 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
1595         * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
1596         to the callback.  Callbacks should not need to hardcode the
1597         hashtable they are working from, nor should we have to waste the
1598         userdata parameter to pass the table in.
1599         * m4/hash.h (m4_hash_apply_func): Require the initial table
1600         parameter.
1601         * m4/symtab.c (symtab_destroy): Use the passed table instead
1602         of hardcoding m4__symtab.
1603         (m4_symbol_popdef): Don't use the userdata parameter to pass the
1604         table to arg_destroy.
1605         (arg_destroy): Use the hash parameter, ignore userdata.
1606         * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
1607         prototype.
1608         (traceon, traceoff): Call set_trace with the extra initial
1609         parameter.
1611 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
1613         More refactoring to stabilise the module api, this time for
1614         symtab.c.  Additionally, start to pay attention to function names
1615         that don't contain a verb like they should.
1617         * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
1618         wrapper for m4_hash_apply to decouple the symtab module from the
1619         hash module.
1620         (m4_symbol_builtin, m4_symbol_macro): Renamed to
1621         m4__symbol_set_builtin and m4__symbol_set_macro.  Changed all
1622         callers.
1623         (m4_symbol_delete): Create a macro version to save a function
1624         call.
1625         (m4_token_t, m4_data_t): These violate the POSIX reserved
1626         namespace.  Renamed to m4_token_type and m4_symbol_type. Changed
1627         all callers.
1628         (m4_token_type): Renamed to m4_token_get_type.
1629         (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
1630         (m4_symtab_exit): Removed from the exported module
1631         api...
1632         * m4/m4private.h (m4__symtab, m4__symtab_init)
1633         (m4__symtab_remove_module_references, m4__symtab_exit): ...and
1634         renamed and added to the internal api. Changed all callers.
1635         (m4_symtab_apply): A faster macro version of the function for
1636         users of the internal api.
1637         * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
1638         symbol_destroy and arg_destroy.
1639         (symtab_debug): Added a prototype.
1640         (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
1641         so that callers in this file get the faster macro versions from
1642         m4/m4private.h.
1644 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
1646         Refactoring modules to rationalise the API into an external
1647         documented (eventually!) API for use by modules in the `m4_'
1648         namespace declared in m4/m4module.h, an internal API between the
1649         source files we ship (including our shipped modules) in the `m4__'
1650         namespace declared in m4/m4private.h and making the rest as
1651         cohesive as possible with liberal use of the `static' keyword.
1652         This change represents an audit to m4/module.c along these
1653         guidelines.
1655         * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
1656         Removed.  No longer used.
1657         (m4_module_close): Removed prototypes.
1658         (m4_module_init, m4_module_open, m4_module_unload_all): Removed
1659         from the exported module api...
1660         * m4/m4private.h (m4__module_init, m4__module_open)
1661         (m4__module_exit): ...and renamed and added to the internal api.
1662         Changed all callers.
1663         (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
1664         Centralised definitions after renaming...
1665         * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
1666         (M4_FINISH_SYMBOL): ...and removing from here.
1667         (m4_module_dlerror, m4_module_remove, m4_module_close)
1668         (m4_caller_id): Not exported at all, so renamed to module_dlerror,
1669         module_remove, module_close and caller_id.
1670         (MODULE_SELF_NAME): New macro to make reporting self errors
1671         easier.
1672         (m4_module_load, module_close, module_remove): Use it.
1673         * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
1674         name.
1675         * src/main.c (main): Use it.
1677 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
1679         * README: Remove references to --enable-changeword, which has been
1680         removed from the code.
1682 2003-06-11  Gary V. Vaughan  <gary@gnu.org>
1684         Getting rid of the annoying bug with configure --enable-debug,
1685         which spewed -e: command not found errors.  This was an interaction
1686         between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
1687         You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
1688         branch-1-5) to get the full fix.
1690         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
1691         of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
1692         and then use the probed value of $SED.
1693         (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
1694         this, it messes up the AC_REQUIRE stack.
1696 2003-06-10  Gary V. Vaughan  <gary@gnu.org>
1698         * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
1699         the destroy callback.
1700         (m4_arg_destroy): Use the hash address to free the hash node key
1701         field.
1703 2003-06-06  Gary V. Vaughan  <gary@gnu.org>
1705         First cut at formal parameters in macros.
1707         * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
1708         * m4/xstrzdup.c: New file.
1709         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
1710         associative array of parameter names to details.
1711         (m4_symbol_token): Capture macro names with parameter lists.
1712         (m4_arg_signature_parse): And build an associative array to hang
1713         from the symbol structure to map names to details.
1714         * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
1715         m4_hash_resize idiom.  Now that we potentially add a little hash
1716         table to many of the entries in the symbol table, added an extra
1717         arg to set the initial size.  Changed all callers.
1718         (m4_hash_apply): New function that is basically a generalised
1719         version of...
1720         * m4/symtab.c (m4_symbol_apply): ...this.  Now deleted.  Adjusted
1721         all callers to call m4_hash_apply instead.
1722         (m4_arg_destroy): Recycle memory used by an m4_token_arg.
1723         (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
1724         m4_arg_signature association that might be attached to the symbol,
1725         * m4/hash.h (m4_hash_apply_func): Replacement type for...
1726         * m4/m4module.h (m4_symtab_apply_func): ...this.  Now deleted.
1727         (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
1728         parameter lists.
1729         (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
1730         (M4_IS_IDENT): Detect characters that can be safely used in
1731         parameter names.
1732         * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
1733         * m4/macro.c: Corrected grammar in some comments.  Use `token'
1734         rather than `td' for m4_token variables.
1735         (m4_process_macro): If we find a dollar followed by some
1736         M4_IS_IDENT characters, replace that with the contents of the argv
1737         entry with offset stored in the m4_token_arg associated with the
1738         collected identifier.
1740 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
1742         Begin preparations for supporting formal parameters in m4 macros.
1744         * m4/m4private.h (struct m4_token_arg): Placeholder for holding
1745         the details of a formal parameter.
1746         (m4_token): Add an arg_signature member to hold a hash table for
1747         looking up formal parameters.
1748         * m4/input.c: Update more bitrotted comments.
1749         (m4_push_builtin): Initialise arg_signature member.
1750         (init_builtin_token): Copy arg_signature member.
1751         * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
1752         (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
1753         replace...
1754         * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
1755         (m4_macro_pushdef, m4_macro_define): ...these, And...
1756         (m4_symbol_token): ...wrapped around this new function, which
1757         vastly simplifies the arguments required by the functions it
1758         replaces.
1759         Changed all callers.
1761 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
1763         * m4/macro.c: Format changes.
1765 2003-06-04  Gary V. Vaughan  <gary@gnu.org>
1767         * m4/input.c: Updated various bitrotted comments.
1768         (m4_push_builtin): Just pass the whole m4_token, rather than
1769         extracting all the fields in the caller.  This also allows us to
1770         check the token type for consistency.
1771         (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
1772         Renamed to builtin_funcs, builtin_peek, builtin_read,
1773         m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
1774         the code.  Changed all callers.
1775         (struct input_block): Similarly renamed u_m member to u_b, and
1776         changed all callers.
1777         (m4_next_token): Use bzero to initialise the data fields.
1778         * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
1780 2003-05-29  Gary V. Vaughan  <gary@gnu.org>
1782         These changes were necessary to get m4 to build on my iBook
1783         running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
1784         (GCC) 3.1 20020420 (prerelease)":
1786         * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
1787         inclusion of module loader headers.
1788         * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
1789         * m4/Makefile.am: Ditto.
1790         (libm4_la_LIBADD): Added $(LTLIBINTL).
1791         * m4/utility.c (program_name): Removed declaration in favour of
1792         the one already in error.c!
1793         * m4/m4module.h (program_name): Define to program_invocation_name
1794         when using GNU C library. Use an explicit extern declaration.
1795         (interactive, sync_output, debug_level, hash_table_size)
1796         (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
1797         (suppress_warnings, warning_status, nesting_limit, discard_comments)
1798         (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
1799         (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
1800         (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
1801         (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
1802         (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
1803         (m4_expansion_level, m4_expand_ranges, m4_expand_input)
1804         (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
1805         (m4_current_line, m4_current_diversion, m4_output_current_line):
1806         Don't rely on default, use an explicit extern.
1807         * m4/error.h (error, error_at_line, error_print_progname)
1808         (error_message_count, error_one_per_line): Ditto.
1809         * m4/ltdl.c: Update from CVS libtool.
1810         * m4/ltdl.h: Ditto.
1811         * commit: Update from CVS cvs-utils.
1813 2002-11-04  Akim Demaille  <akim@epita.fr>
1815         * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
1816         running m4 itself.
1817         * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
1819 2002-11-04  Akim Demaille  <akim@epita.fr>
1821         * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
1823 2002-11-04  Akim Demaille  <akim@epita.fr>
1825         * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
1826         used as `external', and Libtool 1.4.3.
1827         (LINGUAS): Remove.
1828         (LTLIBOBJS): Don't play with it.
1829         * intl/: Remove.
1830         * Makefile.am (SUBDIRS): Remove intl.
1831         (ACLOCAL_AMFLAGS): Add -I config.
1832         (EXTRA_DIST): Add config/config.rpath.
1833         * po/LINGUAS: New.
1834         * po/Makevars: New.
1835         * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
1837 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
1839         Preparations for refactoring syntax tables to allow reverse
1840         lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
1841         speed of normal lookups in an array of unsigned short.
1843         * m4/input.c (single_quotes, single_comments, use_macro_escape):
1844         Moved from here...
1845         * m4/m4private.h (m4__single_quotes, m4__single_comments,
1846         m4__use_macro_escape): ...to here, and renamed.  The `m4__' prefix
1847         is for internal symbols which unavoidably pollute the global
1848         namespace, but are not published APIs.
1849         Adjusted all callers.
1850         * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
1851         m4_set_comment, m4_set_syntax, set_syntax_internal,
1852         unset_syntax_attribute): Moved from this file...
1853         * m4/syntax.c: New. ...to this file.
1854         Also added an m4_syntax_exit stub for orthogonality.
1855         * src/main.c (main): Use it.
1856         * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
1857         * m4/m4module.h: Reformatting.  New prototypes.
1859 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
1861         * bootstrap (aclocal_apiversion): The aclocal apiversion is
1862         distinct from the automake release number (in that the apiversion
1863         apparently has no micro-version-component).
1864         (aclocal_apilibdir): Use it.
1866 2002-05-28  Gary V. Vaughan  <gary@gnu.org>
1868         * m4/hash.c (m4_hash_resize): New function.
1869         * m4/hash.h: Add prototype.
1870         * m4/symtab.c (m4_symtab_init):  Use it.  This could do with some
1871         benchmarking to find a good value for, say, autoconf.  This is
1872         already a little quicker than before for me.
1874         * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
1875         * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
1876         and reenamed.
1877         * m4/hash.h: Adjust prototypes.
1879 2002-01-22  Akim Demaille  <akim@epita.fr>
1881         * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
1882         APIVERSION scheme.
1883         * tests/Makefile.am (package.m4): New.
1884         * tests/atlocal.in: Adjust to CVS Autotest.
1885         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
1886         * configure.ac: LIBOBJ is a forbidden string.
1887         Simplify AM_INIT_AUTOMAKE invocation.
1888         * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
1889         options.m4.
1891 2001-10-19  Akim Demaille  <akim@epita.fr>
1893         * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
1895 2001-10-19  Akim Demaille  <akim@epita.fr>
1897         * m4/input.c (m4_next_token): Display where was opened what is
1898         not closed.
1900 2001-10-19  Akim Demaille  <akim@epita.fr>
1902         * m4/macro.c (expand_argument): Display where was opened what is
1903         not closed.
1905 2001-10-18  Akim Demaille  <akim@epita.fr>
1907         * m4/input.c, modules/m4.c: Formatting changes.
1909 2001-10-17  Gary V. Vaughan  <gary@gnu.org>
1911         * bootstrap: s/configure.in/configure.ac/
1913 2001-10-16  Gary V. Vaughan  <gary@gnu.org>
1915         * m4/symtab.c (m4_symbol_destroy): This function calls
1916         m4_symbol_popdef, which recycles a symbols memory when the last
1917         definition is popped.  Since we were passing the address of the
1918         symbol name found in the symbol table, and it was being removed
1919         partway through m4_symbol_destroy() we were referencing freed
1920         memory for the balance of the function.  Now we take a copy of the
1921         symbol name tring and use that as a key into the symbol
1922         table... that way if the original symbol name is freed, the copy
1923         is still valid.
1925 2001-10-13  Akim Demaille  <akim@epita.fr>
1927         * m4/ltdl.c: Update.
1929 2001-10-13  Akim Demaille  <akim@epita.fr>
1931         * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
1932         Don't gettextize internal error messages.
1934 2001-10-13  Akim Demaille  <akim@epita.fr>
1936         * tests/macros.at (Arity and defn): New failing test.
1937         (Arity, defn, and freeze): New.
1939         Fix `Arity and defn'.
1941         * m4/input.c (m4_push_macro): Don't forget the arity.
1942         * modules/m4.c (defn): Likewise.
1944 2001-10-13  Akim Demaille  <akim@epita.fr>
1946         * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
1947         to...
1948         * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
1949         (Propagation of traceon, Propagation of --trace): this new file.
1951 2001-10-13  Akim Demaille  <akim@epita.fr>
1953         * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
1954         interface instead of (name, argc...).
1955         Upon failure, specify which argument was guilty.
1956         Adjust callers.
1958 2001-10-13  Akim Demaille  <akim@epita.fr>
1960         * modules/evalparse.c: Save translators' time: don't translate
1961         internal error messages.
1962         (m4_evaluate): Simplify/normalize error messages.
1963         * doc/m4.texinfo (Eval): Adjust.
1965 2001-10-13  Akim Demaille  <akim@epita.fr>
1967         * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
1968         where no checking is needed.
1969         * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
1970         interface instead of (name, argc...).
1971         Adjust callers.
1972         * modules/gnu.c (m4_patsubst_do): Don't check argc, done
1973         elsewhere.
1975 2001-10-13  Akim Demaille  <akim@epita.fr>
1977         * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
1978         exclude the builtin name from the count.
1979         * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
1980         calling ifelse with a single argument is valid.
1981         * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
1982         with 1 and 2 args, mostly to strengthen the test suite.
1984 2001-10-13  Akim Demaille  <akim@epita.fr>
1986         * m4/output.c (m4_make_diversion, m4_insert_file)
1987         (m4_insert_diversion, +m4_freeze_diversions): Ansify.
1989 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
1991         * m4/input.c (init_builtin_token):  Renamed from init_macro_token,
1992         since we call these things builtins in the rest of the code!
1994         * modules/gnu.c (m4_regexp_compile): s/%0/%s/
1996 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
1998         Rather than forcing each builtin definition to manage its own
1999         argument range checking, tabulate the maxima and minima for all
2000         builtins in each module.  This forces us to consider what the
2001         valid ranges for each builtin should be, and moves the checking
2002         code out of each builtin implementation and into the builtin
2003         caller infrastructure.
2005         * m4/m4module.h (struct m4_builtin): Add argument minima and
2006         maxima.
2007         * m4/m4private.h (struct m4_token): Reflect them here too.
2008         * m4/input.c (struct input_block): ...and here.
2009         (m4_token_copy): New function for token copying.
2010         (init_macro_token): Copy them from a token to the input stack.
2011         (m4_next_token): Don't forget to initialise them for text
2012         macros.
2013         * m4/macro.c (expand_argument): Use m4_token_copy, and also
2014         check argument counts before calling the builtin handler.
2015         * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
2016         (m4_symbol_macro): Likewise.
2017         * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
2018         parameters.  Updated all callers.
2019         (m4_builtin_define): Ditto.
2020         (m4_macro_pushdef, m4_macro_define): Ditto.
2021         * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
2022         * modules/evalparse.c:  Declare argument counts for defined
2023         builtins and remove explicit calls to m4_bad_argc().
2024         * modules/gnu.c: Ditto.
2025         * modules/load.c: Ditto.
2026         * modules/m4.c: Ditto.
2027         * modules/modtest.c: Ditto.
2028         * modules/mpeval.c: Ditto.
2029         * modules/perl.c: Ditto.
2030         * modules/shadow.c: Ditto.
2031         * modules/stdlib.c: Ditto.
2032         * modules/time.c: Ditto.
2033         * TODO: Updated.
2035 2001-10-10  Gary V. Vaughan  <gary@gnu.org>
2037         The trace semantics now attach the trace bit to a symbol name.
2038         For as long as a traceon(`foo') is active, calls to foo will be
2039         traced regardless of intervening undefines or module unloads.
2040         Fixed the flag propogation issues differently to the fixes
2041         reverted with the last attempt at nailing down trace:
2043         * m4/m4private.h:  This file is not visible outside of the m4
2044         source tree, so I removed all the `M4_' and `m4_' prefixes to save
2045         on typing.  Updated all clients.
2046         (m4_token): New typedef contains the fields that need to be passed
2047         around with the low level tokeniser.
2048         (m4_token_data):  Removed.
2049         (m4_symbol): Now contains the traced flag again.
2050         * m4/symtab.c:  Rewritten again.  Now we don't remove symbols with
2051         the trace bit set.  This change is contained entirely within this
2052         module and doesn't leak out into the callers.  Updated all
2053         clients.
2054         (m4_symbol_builtin, m4_symbol_macro):  Adjusted to make use of the
2055         new fields in m4_token.  Updated all clients.
2056         * m4/builtin.c (m4_builtin_pushdef):  Needs a flags argument so
2057         that `groks_macro_args' and `blind_if_no_args' flags are retained
2058         when defn() results are passed around in m4 code.  Updated all
2059         callers.
2060         (m4_builtin_define): Ditto.
2061         (m4_macro_pushdef, m4_macro_define): Ditto.
2062         * m4/input.c (struct input_block): Add a flags field to facilitate
2063         the above.
2064         (m4_push_macro):  ...use it.
2065         (init_macro_token):  Retrieve it.
2066         (m4_next_token): Initialise it.
2067         * m4/macro.c (expand_argument):  Copy it.
2068         * m4/m4module.h: Adjust.
2069         * tests/builtins.at:  Adjust the expected output of the trace
2070         tests to reflect the change in semantics.
2071         * tests/modules.at (modules: trace):  Check that unloading a
2072         module which supplies a traced symbol definition doesn't lose te
2073         trace bit.
2075 2001-10-07  Gary V. Vaughan  <gary@gnu.org>
2077         * modules/gnu.c (m4_macro_table): Display the timetamp when
2078         expanding __m4_version__.
2080         * configure.ac (--with-modules): Forgot a comma in the
2081         AC_HELP_STRING parameter list.
2083 2001-10-05  Gary V. Vaughan  <gary@gnu.org>
2085         * bootstrap: Remove aclocal.m4t when it is no longer required.
2087 2001-10-05  Akim Demaille  <akim@epita.fr>
2089         * tests/Makefile.am: Adjust for gnuprog2.
2090         * tests/m4.in: There can be a leading path.
2091         * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
2092         * tests/testsuite.at: Adjust to the most recent Autotest.
2093         (AT_CHECK_M4_FILTER): Fix and rename as...
2094         (AT_TEST_M4): this.
2095         * tests/others.at: Use it.
2097         * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
2098         variable in shell scripts, one uses `$'...
2100 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
2102         * configure.ac: `rm -f $m4_getopt_h' was lost.
2104 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
2106         * configure.ac (TIMESTAMP): Display with AS_BOX at configure
2107         time.  Define it for config.h in order to...
2108         * src/main.c (main): ...display the timestamp for --version.
2110 2001-10-04  Akim Demaille  <akim@epita.fr>
2112         * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
2113         previous builtins `regexp' and `patsubst'.
2114         (regexp, patsubst): Use them.
2115         (eregexp, epatsubst): New builtins.
2116         * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
2117         (Epatsubst and Patsubst, Eregexp and Regexp): these.
2118         (Extensions): More info on REs.
2120 2001-10-04  Akim Demaille  <akim@epita.fr>
2122         * modules/modtest.c (init_handler): Consistently output to stderr.
2123         (finish_handler): New.
2124         (test): The `if' is an `assert'.
2125         * tests/modules.at: Adjust.
2127 2001-10-04  Akim Demaille  <akim@epita.fr>
2129         * m4/utility.c (m4_bad_argc): Detail the mismatches.
2131 2001-10-01  Akim Demaille  <akim@epita.fr>
2133         * tests/generate.awk: Tag the tests with `documentation'.
2134         * tests/modules.at (AT_CHECK_M4_MODTEST): New.
2135         Use the make the existing modtest tests more uniform, and complete
2136         the set of possibilities.
2138 2001-10-01  Akim Demaille  <akim@epita.fr>
2140         * config/gmp.m4: Consult the user before using GMP: use
2141         --without-gmp.
2142         * configure.ac: Adjust.
2143         * modules/gmp.c: No protection needed as the module is not built
2144         if GMP is not used.
2146 2001-10-01  Akim Demaille  <akim@epita.fr>
2148         * tests/generate.awk: Remove debugging code.
2149         (fatal): Specify the current location.
2151         * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
2152         * modules/gnu.c, modules/m4.c: Use M4ARG.
2154 2001-10-01  Akim Demaille  <akim@epita.fr>
2156         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
2157         (m4_regexp_compile): New.
2158         (regexp, patsubst): Use it.
2160 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
2162         Reinstate the memory handling improvements from the patch I just
2163         reverted.  Relevant ChangeLog entries repeated here:
2165         * m4/module.c (m4_module_remove): New function that holds the core
2166         of the old m4_module_unload.
2167         (m4_module_unload): Use it.
2168         (m4_module_unload_all): When we know the modules will never be
2169         used again (i.e. on exit), free up as much module memory as
2170         possible.  There are still some artifacts from resident modules
2171         living inside ltdl.c, but everything else is freed.
2172         * m4/debug.c (m4_debug_exit): Free memory allocated in
2173         m4_debug_init().
2174         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
2175         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
2176         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
2177         * m4/m4module.h: Updated prototypes.
2178         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
2179         * m4/hash.h: Updated prototypes.
2180         * src/main.c (main): Use all these new functions to clean up as
2181         much memory as possible before exit.
2183 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
2185         Reverted my large patch for removing the old m4_symbol
2186         structure on 2001-09-20.  We are still not happy about the way
2187         trace works in conjunction with defn and undefine, and leaving
2188         the reverted patch active prevents us from moving the traced
2189         bit from the definition back to the symbol.
2191 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
2193         * configure.in: Moved to...
2194         * configure.ac: ...here.  Added a libtool like timestamped
2195         banner, and tidied up the libltdl cruft.
2196         * config/mkstamp: Script to extract a timestamp from ChangeLog.
2197         * modules/Makefile.am (INCLTDL):  Removed.  This is required
2198         only when libltdl is configured in a subdirectory.
2199         * src/Makefile.am: Ditto.
2200         (LIBADD_DL):  No need to add this again, libtool already knows
2201         that libm4.la depends on it.
2202         * m4/Makefile.am: Automake sets variables from AC_SUBST.  Use
2203         them.
2205         * TODO: stackovf.c is basically broken.
2206         Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
2208 2001-09-28  Akim Demaille  <akim@epita.fr>
2210         * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
2212 2001-09-27  Akim Demaille  <akim@epita.fr>
2214         * tests/m4.in: Don't use short options.
2215         Simplify the stderr signature normalization.
2217 2001-09-27  Akim Demaille  <akim@epita.fr>
2219         tests/m4 shall be position independent.
2221         * tests/m4.in: New.
2222         * tests/m4: Remove.
2223         * tests/testsuite.at: No args to AT_INIT.
2224         * configure.in, tests/Makefile.am: Adjust.
2226 2001-09-22  Akim Demaille  <akim@epita.fr>
2228         Autotest has changed again.
2230         * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
2231         (package.m4): Remove.
2232         * configure.in: Adjust to LIBADD_GMP.
2234 2001-09-21  Gary V. Vaughan  <gary@gnu.org>
2236         * config/gmp.m4 (AC_ARG_WITH): Removed.
2237         (GMP_LIB): Renamed to LIBADD_GMP for consistency.
2238         (AC_LIB_GMP): When performing a test compile against libgmp,
2239         include the header gmp.h if possible, and link against -lgmp.  If
2240         they both work define USE_GMP.
2241         * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
2242         (mpeval_LTX_init_func): Complain on load that there was no libgmp
2243         at compile time.
2245 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
2247         * m4/evalparse.c: Moved to...
2248         * modules/evalparse.c:  ...here.  This code is shared between
2249         modules/mpeval.c and modules/m4.c, so there is no need to pollute
2250         the libm4 API with its details.  Moderately rewritten to interface
2251         into its clients more simply.
2252         * m4/eval.c: Deleted.  Migrated functionality to...
2253         * modules/m4.c: ...here.
2254         (builtin_eval):  Implemented in terms of the new interface style.
2255         * modules/mpeval.c (builtin_mpeval): Ditto.
2256         * m4/m4module.h: Removed references to the former m4/eval.c.
2257         * m4/Makefile.am (libm4_la_SOURCES):  Removed eval.c.
2258         (EXTRA_libm4_la_SOURCES): Deleted.
2259         * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
2260         (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
2262 2001-09-20  Akim Demaille  <akim@epita.fr>
2264         * config/gmp.m4 (AM_WITH_GMP): Rename as...
2265         (AC_LIB_GMP): this.
2266         By default, use gmp.
2267         Massive revamping.
2268         * configure.in: Adjust.
2269         Use Automake conditionals for USE_GMP.
2270         Always compute sizeof (long long int).
2271         This was a bug BTW, as `eval' (not `mpeval') depends on it:
2272         before, it was used _only_ if mpeval was not activated.
2273         * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
2274         (mpeval_la_LIBADD): New macros.
2275         * modules/mpeval.c: No longer be conditioned by WITH_GMP.
2276         Indent.
2277         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
2278         * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
2279         WITH_GMP.
2281 2001-09-20  Akim Demaille  <akim@epita.fr>
2283         * tests/Makefile.am (package.m4): New.
2284         * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
2286 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
2288         More cleanup.  After the last patch, m4_symbol holds nothing but
2289         the head of a chain of m4_token_data.  So I have removed the old
2290         m4_symbol, so that m4_token_data chains are stored directly in the
2291         value cell of a hash table node.  But there's more... m4_symbol
2292         was a more natural name for the symbol value cell, and now that it
2293         is gone I have renamed the former m4_token_data structure to
2294         m4_symbol.  This change turned out to be a pig to get right, since
2295         the original code didn't need to modify the value cell itself,
2296         since changing the chain happened inside the m4_symbol that used
2297         to be returned -- I had to pass the address of the value cell
2298         across various function calls, incase the head value changed.  I
2299         also tightened up the memory management to help me find a nasty
2300         memory corruption bug that took me all night to track down...
2302         * m4/m4private.h (struct m4_symbol): Removed.
2303         (struct m4_token_data): Renamed to `struct m4_symbol'.  Updated
2304         all references.
2305         * m4/hash.c (m4_hash_iterator_value): Return the address of the
2306         value cell.  Updated all callers.
2307         * m4/symtab.c: Took advantage of the simplification in the data
2308         structures to rewrite a lot of this file more simply.  There is
2309         still some room for optimisation here, but we should tackle that
2310         systematically closer to the release.
2312         * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
2313         revealed.  This version is ahead of CVS libtool until I get chance
2314         to flush my changes.
2315         * m4/module.c (m4_module_remove): New function that holds the core
2316         of the old m4_module_unload.
2317         (m4_module_unload): Use it.
2318         (m4_module_unload_all): When we know the modules will never be
2319         used again (i.e. on exit), free up as much module memory as
2320         possible.  There are still some artifacts from resident modules
2321         living inside ltdl.c, but everything else is freed.
2322         * m4/debug.c (m4_debug_exit): Free memory allocated in
2323         m4_debug_init().
2324         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
2325         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
2326         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
2327         * m4/m4module.h: Updated prototypes.
2328         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
2329         * m4/hash.h: Updated prototypes.
2330         * src/main.c (main): Use all these new functions to clean up as
2331         much memory as possible before exit.
2333 2001-09-18  Gary V. Vaughan  <gary@gnu.org>
2335         The `traced' flag needs to be attached to the definition of a
2336         symbol rather than the current symbol containing the definition.
2337         Implementing this showed up some long standing post 1.4 bugs in
2338         flag propogation which I also fixed.
2340         * m4/m4private.h (struct m4_symbol): Remove the traced flag.
2341         (struct m4_token_data): And add it back in here.
2342         * m4/input.c (init_macro_token): Propogate the traced flag
2343         correctly.
2344         * m4/macro.c (expand_argument): Ditto.
2345         * tests/builtins.at (trace2, trace3): New tests based on Akim's
2346         sadistic email ;-)
2348 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
2350         * m4/m4private.h (struct m4_token_data): Simplified by removing
2351         the redundant `traced' flag, and one level of structure nesting.
2352         (M4_TOKEN_DATA_FUNC_TRACED): Removed.
2353         * m4/input.c (init_macro_token): No need to initialise removed
2354         `traced' field.
2355         * m4/macro.c (expand_argument): No need to copy it either.
2356         * m4/utility.c (m4_token_data_func_traced): Or provide an access
2357         function.
2359         * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
2360         dependant on multiple symbols with the same key, so preserving
2361         relative symbol order in each bucket during resizing is no longer
2362         required.  The resize function is considerably faster as a result.
2364         * m4/m4module.h, m4/builtin.c, m4/symtab.c:
2365         s/m4_symbol_insert/m4_symbol_define/g;
2366         s/m4_builtin_insert/m4_builtin_define/g;
2367         s/m4_macro_insert/m4_macro_define/g.  Updated all callers.
2369 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
2371         Get rid of m4_symbol_lookup_t entirely.  With Akim's earlier
2372         commits, the m4_lookup_symbol dispatch function is split into
2373         specialised functions that must be called directly.
2375         * m4/m4module.h (m4_symbol_lookup_t): Removed.
2376         * m4/symtab.c (m4_lookup_symbol): Removed.
2377         (m4_symbol_builtin, m4_symbol_macro): New functions.
2378         * m4/builtin.c (m4_builtin_define): Split into...
2379         (m4_builtin_pushdef, m4_builtin_insert): ...these.
2380         (m4_macro_define): Split into...
2381         (m4_macro_pushdef, m4_macro_insert): ...these.
2382         * src/main.c (main): Set command line macros from `-D' parameters
2383         using `m4_macro_define'.
2385 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
2387         * m4/symtab.c (m4_symtab_remove_module_references):  Renamed as
2388         this from m4_remove_table_reference_symbols().
2389         * m4/m4module.h, m4/module.c: Updated all references.
2391 2001-09-07  Akim Demaille  <akim@epita.fr>
2393         * modules/stdlib.c, modules/times.c: Misc cleanups.
2395 2001-09-07  Akim Demaille  <akim@epita.fr>
2397         * configure.in: We now need Autoconf 2.52e.
2398         * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
2399         and `M4_SYMBOL_DELETE'.
2400         * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
2401         * src/main.c (main): Adjust.
2403 2001-09-06  Gary V. Vaughan  <gary@gnu.org>
2405         Fix the obstack.h problem once and for all!  At configure time we
2406         can test for a system supplied obstack.h:  depending on the
2407         result, we now generate system.h with an #include of the correct
2408         header.  As a bonus, I've also added a --with-included-obstack,
2409         incase the user doesn't like the system obstack for some
2410         reason... and also we can test the shipped obstack on a system
2411         that has oe of its own.  We also now need to be careful to add
2412         build directories to the include search path, since the generated
2413         system.h will be in the build tree.
2415         * configure.in (AC_CONFIG_FILES): Generate system.h from
2416         system-h.in.
2417         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
2418         include the system obstack header or the copy shipped with M4.
2419         Allow the user to override configure and force the build to use
2420         the shipped version.
2421         * m4/system-h.in: New file, template for...
2422         * m4/system.h: ...this.  Now deleted.
2423         * m4/m4module.h: Include system.h before everything else.
2424         * src/freeze.c: Ditto.
2425         * m4/Makefile.am (dist-hook): Remove generated system.h.
2426         (INCLUDES): Check builddir for generated headers before checking
2427         srcdir.
2428         * modules/Makefile.am (INCLUDES): Ditto.
2429         * src/Makefile.am (INCLUDES): Ditto.
2431 2001-09-05  Gary V. Vaughan  <gary@gnu.org>
2433         * TODO: Remove the items that have been addressed already.
2435 2001-09-05  Akim Demaille  <akim@epita.fr>
2437         * src/main.c (main): Standardize --version.
2439 2001-09-05  Akim Demaille  <akim@epita.fr>
2441         * modules/format.c (format): Have a bigger `str'.
2443 2001-09-05  Akim Demaille  <akim@epita.fr>
2445         Rationalize warnings, reporting the macro name as if it were a
2446         program name, and assertions.
2448         * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
2449         (M4WARN): New.
2450         * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
2451         (m4_symbol_delete):
2452         Use assert for internal errors.
2453         * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
2454         M4WARN.
2455         * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
2456         M4WARN and assert.
2457         * tests/builtins.at (pushpop): Adjust.
2459 2001-09-05  Akim Demaille  <akim@epita.fr>
2461         * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
2462         with pointers.
2464 2001-09-05  Akim Demaille  <akim@epita.fr>
2466         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
2467         * m4/macro.c, m4/symtab.c: Adjust.
2469 2001-09-05  Akim Demaille  <akim@epita.fr>
2471         * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
2472         (m4_symbol_pop, m4_symbol_del): this.
2473         (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
2474         (m4_symbol_popdef, m4_symbol_delete): New.
2475         (m4_lookup_symbol): Adjust.
2476         * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
2478 2001-09-05  Akim Demaille  <akim@epita.fr>
2480         * m4/m4module.h (m4_symbol_lookup): Rename as...
2481         (m4_symbol_lookup_t): this.
2483 2001-09-05  Akim Demaille  <akim@epita.fr>
2485         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
2486         unused.
2487         * m4/symtab.c (m4_lookup_symbol): Adjust.
2489 2001-09-03  Gary V. Vaughan  <gary@gnu.org>
2491         Bootstrap will now work with Libtool 1.4.1 or higher:
2492         * bootstrap: Remove stale autom4te.cache files when
2493         rebootstrapping.
2494         * config/Makefile.am (ACLOCAL_MACROS):  Add ltdl.m4 and
2495         libtool.m4.
2496         * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
2497         libtool.m4 directly.
2498         Run libtoolize to refresh ltmain.sh.
2499         * config/ltmain.sh:  Deleted.
2500         * acinclude.m4: Deleted.
2501         * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
2503         * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
2504         implementation for the cvs impaired libtool user.
2506 2001-09-03  Akim Demaille  <akim@epita.fr>
2508         * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
2509         internal errors.
2510         Avoid using `default' in switch, as it hides useful compiler
2511         warnings when a case is forgotten.
2513 2001-09-03  Akim Demaille  <akim@epita.fr>
2515         * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
2516         is no such thing as `WITH_MODULES'.
2518 2001-09-03  Akim Demaille  <akim@epita.fr>
2520         Improve the test suite's selfcontainedness.
2522         * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
2523         (Include, Undivert): Tag the other input files.
2524         * tests/generate.awk: Catch `@comment file:'.
2525         `-I $src' is no longer needed.
2526         `next' is really like `return': the rest is skipped.
2527         Adjust to `input.m4'.
2528         (fatal): New function.
2529         * tests/foo, tests/incl.m4: Remove.
2531 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
2533         The shadowing mechanism and, infact, the whole symbol table
2534         implementation was creaking under the weight of the features piled
2535         on top of it.  We now have a separate hash table module which will
2536         dynamically resize to keep symbol density withing good performace
2537         limits, and a new symtab module layered above it.  Symbol lookups
2538         are now marginally more efficient (since the shadowed flag is no
2539         longer required) and symbol removal, such as on module unload, is
2540         considerably faster due to a reorganisation of the data structures
2541         used in symtab.c.
2543         * src/main.c (main):  Don't mention `-H'.
2544         * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
2545         effect.
2546         * NEWS: Updated.
2547         * m4/hash.c: New generalised dynamic hash table data structure
2548         management module.
2549         * m4/hash.h: Public interface.
2550         * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
2551         (libm4_la_SOURCES): Add hash.c.
2552         * m4/symtab.c: More or less rewritten from scratch, within the
2553         bounds of the previous API.
2554         (m4_symtab_apply): A cleaner version of the old hack_all_symbols
2555         call.  Updated all callers.
2556         * m4/m4module.c: #include <m4/hash.h>, and changed all affected
2557         declarations to reflect API changes.
2558         (M4INIT): Generate a declaration too, to avoid the warning with
2559         --enable-debug builds.
2560         (M4FINISH): Ditto.
2561         (HASHMAX): Removed.
2562         * m4/utility.c (hash_table_size):  Removed.
2563         (m4_dump_symbols): Rewritten to build and qsort an array of symbol
2564         names, which are then looked up by builtin_dumpdef() as necessary.
2565         This implies a small speedup in builtin_symbols(), which discarded
2566         all of the symbol info under the old call.
2567         * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
2568         shadowing is implicit in respect to the new data structures.
2569         symbol names are no longer duplicated here, they are stored in the
2570         key field of the hash table.
2571         Moved macro_args and blind_no_args...
2572         (m4_token_data): ...to here.
2573         m4/macro.c (expand_macro):  Added a name argument since the symbol
2574         name is no longer copied into each struct m4_symbol.  Modified all
2575         callers.
2576         (collect_arguments):  Ditto.
2577         * modules/m4.c (set_trace): Ditto.
2578         * modules/gnu.c (builtin_symbols): Updated.
2579         * src/freeze.c (produce_symbol_dump): Much improved in light of
2580         the improved symbol table layout.
2582 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
2584         * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
2585         to M4_SYMBOL_NEXT.
2586         (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
2587         (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
2588         SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
2589         SYMBOL_HANDLE): Ditto.
2590         * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
2591         modules/gnu.c, modules/m4.c, src/freeze.c,
2592         src/main.c:  Updated all references.
2594         * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
2595         Automake 1.5 chokes on dynamic source file lists,  Besides, it is
2596         already listed in m4_LDADD... how did that ever used to work?
2597         * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
2598         link.
2599         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
2600         Suggested by Tim Van Holder <tim.van.holder@pandora.be>
2602         * tests/m4: Don't call the m4 wrapper script with libtool, it
2603         works fine all by itself.
2605 2001-08-30  Gary V. Vaughan  <gary@gnu.org>
2607         The experimental `changeword' feature never took off, and has
2608         no obvious advantages over `changesyntax' to compensate the
2609         enormous speed penalty it carries:
2610         * configure.in (ENABLE_CHANGEWORD): Removed.
2611         * m4/m4module.h (m4_set_word_regexp): Removed.
2612         * m4/m4private.h (m4_token_data): Removed original_text field.
2613         * m4/utility.c (m4_token_data_orig_text): Removed.
2614         * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
2615         * m4/macro.c: Ditto.
2616         * src/main.c: Ditto.
2617         * modules/Makefile.am (changeword.la): Removed.
2618         * modules/changeword.c: File removed.
2619         * doc/m4.texinfo: References to changeword and --word-regexp
2620         removed.
2621         * po/POTFILES.in: modules/changeword.c removed.
2622         * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
2623         * tests/builtins.at (changeword): Test removed.
2625 2001-08-30  Akim Demaille  <akim@epita.fr>
2627         * bootstrap.sh: Create aclocal.m4 instead of modifying it.
2628         This also help having a single list of m4 files: in
2629         config/Makefile.am.
2630         * config/Makefile.am (STANDARD_MACROS): Rename as...
2631         (ACLOCAL_MACROS): this.
2632         (list-standard-macros): Remove.
2633         (spy): New.
2635 2001-08-29  Gary V. Vaughan  <gary@gnu.org>
2637         In an attempt to moderate my egomania...
2638         * tests/modules.at: Remove attributions.
2640         * tests/generate.awk: When making substitutions to "@&t@", either
2641         "&" or "\&" in the substitution string argument to gsub refer back
2642         to the matched text.  "@\\&t@" seems to work though, Tests 43 and
2643         67 now pass for me.
2645 2001-08-29  Akim Demaille  <akim@epita.fr>
2647         * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
2648         (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
2649         (sync-lines, trace, translit, undivert, wrap): Move to...
2650         * tests/builtins.at: this new file.
2651         * tests/others.at (Discard comments, import-environment): Move to...
2652         * tests/options.at: this new file.
2654 2001-08-29  Akim Demaille  <akim@epita.fr>
2656         * tests/others.at (Freezing modules)
2657         (--module-directory: absolute path, modpath2, modpath3)
2658         (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
2659         * tests/modules.at: here, new file.
2660         * tests/others.at, tests/generate.awk: Add a banner.
2661         * tests/testsuite.at: Adjust.
2662         (AT_CHECK_M4_FILTER): New, but unused.
2664 2001-08-29  Akim Demaille  <akim@epita.fr>
2666         * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
2667         handle that.
2668         * tests/others.at (wrap): Inline wrap.m4.
2669         (shadow): Inline shadow.m4.
2670         (iso8859): Don't specify the path from top_srcdir, but from srcdir.
2671         * tests/m4: Simplify.
2673 2001-08-29  Akim Demaille  <akim@epita.fr>
2675         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
2676         --language.
2678 2001-08-29  Akim Demaille  <akim@epita.fr>
2680         * tests/generate.awk (normalize): s/@__@/@&t@/.
2682 2001-08-28  Akim Demaille  <akim@epita.fr>
2684         * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
2686 2001-08-28  Gary V. Vaughan  <gary@gnu.org>
2688         * bootstrap (generate.awk): Generate test cases with new script.
2690 2001-08-27  Akim Demaille  <akim@epita.fr>
2692         * tests/Makefile.am (installcheck-local): Don't use
2693         `dc_install_base' which is not visible here, but `exec_prefix'
2694         which is clearly the RT anyway.
2695         * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
2696         related to testing a now installed m4.
2697         * tests/m4: Do it here.
2699 2001-08-27  Akim Demaille  <akim@epita.fr>
2701         * tests/others.at (indir): Formatting change.
2703 2001-08-27  Akim Demaille  <akim@epita.fr>
2705         * tests/Makefile.am (installcheck-local): New.
2706         * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
2707         the test suite.
2708         Prefer options over envvars.
2709         * src/main.c (main): First bug caught by the test suite (yeah!):
2710         --batch lacked a `break' which resulted in an accidental
2711         invocation of --discard-comments.
2713 2001-08-27  Akim Demaille  <akim@epita.fr>
2715         * tests/others.at (capitalize, changeword, comments, ddivert)
2716         (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
2717         (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
2718         (sysv-args, trace, translit, undivert): Don't rely on files in
2719         examples/: AT_DATA them.
2721 2001-08-27  Akim Demaille  <akim@epita.fr>
2723         Let the test suite use a wrapper around the not installed m4 to
2724         pretend it is (installed).
2726         * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
2727         such a way that m4 does not process them.
2728         * configure.in: The package name seems to be `m4', not `M4'.
2729         * tests/m4: New.
2730         * tests/atlocal.in (at_package, M4): Remove.
2731         * tests/testsuite.at, tests/others.at: Use m4, not $M4.
2733 2001-08-27  Akim Demaille  <akim@epita.fr>
2735         * tests/Makefile.am (CLEANFILES): Remove.
2736         (DISTCLEANFILES, clean-local): New.
2737         * examples/mktests.sh: Remove.
2739 2001-08-27  Akim Demaille  <akim@epita.fr>
2741         * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
2742         Don't use aclocal: it's written by hand.
2743         * aclocal.m4: m4_include all the files instead of being built by
2744         aclocal.
2745         * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
2746         until it reads the traces by itself.
2747         * configure.in: Require Autoconf 2.42c as we are now using
2748         AC_CONFIG_TESTDIR instead of AT_CONFIG.
2749         Catch unexpanded `jm_' macros.
2750         * config/atconfig.m4: Remove.
2751         * config/error.m4: new.
2752         * config/Makefile.am: Ship the files included by aclocal.m4.
2753         * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
2754         (TESTSUITE_AT): this, to please Automake.
2755         (TESTSUITE): This target uses autotest/autotest.m4, not
2756         autotest/general.m4.
2757         * tests/testsuite.at: Prereq Autotest 2.52c.
2758         * examples/Makefile.am (pkgdata_DATA): Rename as...
2759         (dist_pkgdata_DATA): this.
2760         * doc/Makefile.am (man_MANS): Rename as...
2761         (dist_man_mans): this.
2763 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
2765         * m4/system.h [cygwin*]:  Thanks to Paul Sokolovsky and
2766         Robert Collins, building on Cygwin no longer requires Windows
2767         import and export symbol decorations.
2768         * m4/m4module.h (M4_SCOPE) [cygwin*]:  Deleted all occurences.
2769         * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
2770         * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
2771         * m4/error.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
2772         * m4/input.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
2773         * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
2774         * m4/output.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
2775         * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
2776         * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
2777         * configure.in (LIBM4_DLL_IMPORT) [cygwin*]:  Don't set this
2778         anymore.
2779         * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
2780         * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
2782 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
2784         Ansify the source.  Previously we had a mix, where my code was
2785         in a K&R compatible style, and the preexisting code was in ANSI
2786         style.  Nothing is lost wrt release 1.4 by reverting to ANSI,
2787         and now the code base is much cleaner.
2789         * m4/system.h:  Remove M4_PARAMS macro and all users.  Remove
2790         VOID macro and all users.
2791         * m4/m4module.h:  Ansify function prototypes and headers.
2792         * m4/builtin.c:  Ditto.
2793         * m4/evalparse.c:  Ditto.
2794         * m4/input.c:  Ditto.
2795         * m4/macro.c:  Ditto.
2796         * m4/module.c:  Ditto.
2797         * m4/output.c:  Ditto.
2798         * m4/path.c:  Ditto.
2799         * m4/symtab.c:  Ditto.
2800         * m4/utility.c:  Ditto.
2801         * modules/format.c:  Ditto.
2802         * modules/gnu.c:  Ditto.
2803         * modules/m4.c:  Ditto.
2804         * modules/mpeval.c:  Ditto.
2805         * src/freeze.c:  Ditto.
2806         * src/m4.h:  Ditto.
2807         * src/main.c:  Ditto.
2809 2001-08-20  Akim Demaille  <akim@epita.fr>
2811         * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
2812         generated with stock 2.52.
2814 2001-08-20  Akim Demaille  <akim@epita.fr>
2816         * config/atconfig.m4: New, until part of Autoconf per se.
2817         * configure.in (AT_CONFIG): Use it.
2818         Adjust.
2819         * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
2820         * tests/atlocal.in: New.
2821         * tests/generate.awk: For the time being, the empty quadrigraph is
2822         `@__@'.
2823         * tests/others.at (changeword, gmp): Check the configuration
2824         variable against `yes'.
2825         * tests/testsuite.at (dnl): Allow it, as it's used all over the
2826         place.
2828 2001-08-20  Akim Demaille  <akim@epita.fr>
2830         * m4/utility.c (m4_numeric_arg): Spell out the culprit.
2831         * modules/m4.c (undivert): Disable the possibility of undiverting
2832         several files at once: it is not documented, it is inconsistent
2833         with the other macros, it can be straightforwardly mocked by
2834         several invocations, and most importantly, it prevents the
2835         possibility of other kinds of extension.
2836         Use `m4_numeric_arg'.
2838 2001-08-20  Akim Demaille  <akim@epita.fr>
2840         * examples/include.m4: Typo.
2841         * tests/generate.awk: Really add it.
2842         * tests/Makefile.am: Adjust.
2843         * tests/others.at (Discard comments): It sure fails without `-c'.
2844         (include, undivert): Add -I examples/.
2846 2001-08-20  Akim Demaille  <akim@epita.fr>
2848         Use sprintf, not ecft and friends since it is standard, portable,
2849         simplifies the code, and since the latter is even deprecated
2850         according to the GNU libc documentation.
2852         * modules/format.c: Drop evct support.
2854 2001-08-19  Gary V. Vaughan  <gary@gnu.org>
2856         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up.  Don't test
2857         for `-pipe' here...
2858         * configure.in: ...do it here instead.
2860         * c-boxes.el: Deleted.
2861         * m4/builtin.c: Reformat box comments to be closer to GNU
2862         standards.
2863         * m4/debug.c:  Ditto.
2864         * m4/eval.c:  Ditto.
2865         * m4/evalparse.c:  Ditto.
2866         * m4/input.c:  Ditto.
2867         * m4/m4module.h:  Ditto.
2868         * m4/macro.c:  Ditto.
2869         * m4/output.c:  Ditto.
2870         * m4/symtab.c:  Ditto.
2871         * m4/utility.c:  Ditto.
2872         * modules/changeword.c:  Ditto.
2873         * modules/format.c:  Ditto.
2874         * modules/gnu.c:  Ditto.
2875         * modules/load.c:  Ditto.
2876         * modules/m4.c:  Ditto.
2877         * modules/modtest.c:  Ditto.
2878         * modules/mpeval.c:  Ditto.
2879         * modules/perl.c:  Ditto.
2880         * modules/shadow.c:  Ditto.
2881         * modules/stdlib.c:  Ditto.
2882         * modules/time.c:  Ditto.
2883         * src/freeze.c:  Ditto.
2884         * src/main.c:  Ditto.
2886 2001-08-17  Gary V. Vaughan  <gary@gnu.org>
2888         * m4/module.c: Fixup some errors in the description comment.
2890 2001-08-17  Akim Demaille  <akim@epita.fr>
2892         * tests/others.at (iso8859): Specify the path to the M4 test file.
2893         * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
2894         files in error messages.
2896 2001-08-17  Akim Demaille  <akim@epita.fr>
2898         * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
2899         * tests/others.at: Adjust input files paths.
2900         * tests/atconfig.in: Set top_builddir.
2901         * tests/Makefile.am: Adjust.
2902         `testsuite' is in src, not build.
2904 2001-08-17  Akim Demaille  <akim@epita.fr>
2906         * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
2907         (generate.at): Install a temporary hack until the actual
2908         generate.awk is added to the repository.
2909         * tests/atconfig.in: New.
2911 2001-08-17  Akim Demaille  <akim@epita.fr>
2913         Really apply the patch ``Drop Autoconf 2.13 compatibility.''
2915 2001-08-17  Akim Demaille  <akim@epita.fr>
2917         * doc/m4.texinfo: Promote proper quotation.
2919 2001-08-17  Akim Demaille  <akim@epita.fr>
2921         Remove the non Autotest tests.
2923         * tests/other-tests/capitalize.test,
2924         * tests/other-tests/changeword.test,
2925         * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
2926         * tests/other-tests/debug.test,
2927         * tests/other-tests/discard-comments.m4,
2928         * tests/other-tests/discard-comments.test,
2929         * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
2930         * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
2931         * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
2932         * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
2933         * tests/other-tests/hanoi.test,
2934         * tests/other-tests/import-environment.m4,
2935         * tests/other-tests/import-environment.test,
2936         * tests/other-tests/include.test, tests/other-tests/indir.test,
2937         * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
2938         * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
2939         * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
2940         * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
2941         * tests/other-tests/modtest.test,
2942         * tests/other-tests/multiquotes.test,
2943         * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
2944         * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
2945         * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
2946         * tests/other-tests/sync-lines.m4,
2947         * tests/other-tests/sync-lines.test,
2948         * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
2949         * tests/other-tests/translit.test, tests/other-tests/undivert.test,
2950         * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
2951         * tests/other-tests/wrap.test: Remove.
2953         * tests/run-test, tests/get-them: Remove.
2954         * tests/Makefile.am: Adjust.
2956 2001-08-17  Akim Demaille  <akim@epita.fr>
2958         others.at no longer depends on other-tests/.
2960         * tests/others.at (stackovf): You're actually...
2961         (sync-lines): this.
2962         (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
2963         (unload.test): Keep their authorship.
2964         (discard-comments, gmp, import-environment, modfreeze)
2965         (sync-lines): Embed the input files.
2966         * tests/stackovf.test: Copy from other-tests/stackovf.test.
2967         * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
2969 2001-08-17  Akim Demaille  <akim@epita.fr>
2971         * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
2972         (M4exit): Tag the exit status of the example.
2973         * tests/get-them: Adjust.
2974         * tests/generate.awk: New, based on get-them.
2975         * tests/Makefile.am: Adjust to generate `generated.at'.
2976         * tests/testsuite.at: Adjust.
2977         (AT_CHECK_M4): Don't overquote.  Blush...
2979 2001-08-17  Akim Demaille  <akim@epita.fr>
2981         Start using Autotest.  atconfig creation is still lacking.
2983         * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
2984         * examples/reverse.m4, tests/other-tests/import-environment.m4,
2985         * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
2986         * tests/other-tests/import-environment.test: Don't check LANGUAGE
2987         as it might be `unset', or set to `C'.
2988         * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
2989         * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
2990         * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
2991         * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
2992         * tests/other-tests/shadow.test: Adjust.
2993         * tests/testsuite.at, tests/others.at: New.
2994         * tests/Makefile.am: Adjust.
2996 2001-08-17  Akim Demaille  <akim@epita.fr>
2998         Drop Autoconf 2.13 compatibility.
3000         * configure.in (changeword): No need to undefine it, as anyway if
3001         it's defined, M4sugar moved it as m4_changeword.
3002         And anyway, proper quotation is enough.
3003         (m4_pattern_allow): As it exists in 2.50, just use it.
3004         (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
3005         Don't handle Gettext's duties, let it handle them.
3006         * config/gnu-obstack.m4: Use m4_pattern_allow directly.
3008 2001-08-17  Akim Demaille  <akim@epita.fr>
3010         * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
3011         (m4_errprint): Use fputs.
3012         * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
3013         dumpdef are not concerned.
3014         (Dumpdef, Errprint): Emphasize their insensitivity to
3015         --error-output.
3016         * doc/Makefile.am: Add `TAGS' support.
3017         (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
3018         in `config/' now.
3019         * config/Makefile.am (MAINTAINERCLEANFILES): New.
3021 2001-08-17  Akim Demaille  <akim@epita.fr>
3023         * modules/Makefile.am (ETAGS_ARGS): New.
3025 2001-08-17  Akim Demaille  <akim@epita.fr>
3027         * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
3028         changes.
3030 2001-08-17  Akim Demaille  <akim@epita.fr>
3032         * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
3034 2001-08-17  Akim Demaille  <akim@epita.fr>
3036         * m4/m4module.h (m4/list.h): Don't include it.
3038 2001-08-16  Gary V. Vaughan  <gary@gnu.org>
3040         m4_modules are no more, we use lt_dlhandles directly and let
3041         latest libltdl features manage the list of loaded modules.
3042         * acinclude.m4: Regenerated.
3043         * m4/ltdl.c: Updated from master copy.
3044         * m4/module.c: Reimplemented to take advantage of advances in
3045         libltdl.
3046         * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
3047         list with lt_dlhandle_next.
3048         (m4_builtin_find_by_func): Ditto.
3049         (m4_builtin_table_install): Use lt_dlhandle.
3050         (m4_macro_define): Ditto.
3051         (m4_macro_table_install): Ditto.
3052         m4/module.h: Prototype new module management API.
3053         (m4_modules): No longer required.
3054         (m4_module_init_t, m4_module_finish_t): POSIX namespace
3055         violations, renamed to...
3056         (m4_module_init_func, m4_module_finish_func): ...these,
3057         respectively.
3058         (M4INIT_HANDLER): Clean way to declare init functions in modules.
3059         (M4FINISH_HANDLER):  And similarly for finish functions.
3060         * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
3061         -- Add indirection to the CONC macro so that arguments are
3062         correctly expanded.
3063         * modules/modtest.c (m4_init_module):  Replaced with M4INIT_HANDLER.
3064         * modules/shadow.c (m4_init_module):  Ditto.
3065         Due to new init function semantics, be careful to perform the
3066         initialisation only on first load.
3067         * modules/perl.c (m4_init_module):  Ditto. And Ditto.
3068         (m4_finish_module): Replaced with M4FINISH_HANDLER.
3069         Due to new finish function semantics, be careful to perform the
3070         finalisation only on first load.
3071         * m4/m4private.h (m4_module): Removed in favour of...
3072         (m4_module_data): ...structure without all the wrapper fields.
3073         Instances of this new structure are stored associated lt_dlhandles
3074         with lt_dlcaller_data_set().
3075         * m4/builtin.c (m4_builtin_define): Takes a handle argument
3076         instead of the old module argument.
3077         (m4_builtin_table_install): Ditto.
3078         * modules/load.c (m4_resident_module):  Removed.  This is no
3079         longer implemented as a magic symbol...
3080         * modules/m4.c (m4_resident_module): Ditto.
3081         * modules/load.c (M4INIT_HANDLER): ...the module init function now
3082         uses the ltdl api to make the module resident.
3083         * modules/m4.c (M4INIT_HANDLER): Ditto.
3084         * modules/load.c (builtin_modules): Traverse the loaded module
3085         list with lt_dlhandle_next.
3086         (builtin_load): Much simplified in light of the reimplemented
3087         module loader.
3088         * src/freeze.c (produce_module_dump):  Cleaned up and optimised in
3089         light of the m4/module.c rewrite.
3090         (produce_symbol_dump): Ditto.
3091         (reload_frozen_state): Ditto.
3092         * m4/list.c, m4/list.h: Files deleted.  No longer required.
3093         * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
3094         (libm4_la_SOURCES): Delete list.c reference.
3095         * m4/m4private.h (m4_token_data):  Add a handle field.  This
3096         eliminates many of the searches to find the handle associated with
3097         various tokens that are passed between functions.
3098         (struct m4_symbol):  Removed the module field.  The
3099         module association does not belong with the symbol...
3100         * m4/input.c (struct m4_builtin): ...it belongs with the builtin
3101         that the module implementation code is from.  Added a handle
3102         field.
3103         (m4_push_macro): Add a `handle' argument.  Changed all callers.
3104         (init_macro_token):  Set the `handle' field for the
3105         m4_token_data.
3106         * m4/macro.c (expand_argument): Copy the new handle field during
3107         reassignment.
3108         * modules/m4.c (macro_install): Use the new handle field to
3109         optimise the search for the correct builtin structure, and pass
3110         the handle details to m4_builtin_define.
3112 2001-08-15  Akim Demaille  <akim@epita.fr>
3114         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
3115         when creating `m4/obstack.h'.
3116         * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
3117         top_builddir.
3118         * tests/defs: Make them absolute.
3119         (CDPATH) Neutralize.
3120         * tests/gethem: Use them.
3122 2001-08-14  Gary V. Vaughan  <gary@gnu.org>
3124         * config/ltmain.sh: Doh!  Import again for a quoting fix that
3125         prevented any regression test from passing.
3127         * m4/m4module.h (obstack.h): Choose between installed version
3128         and shipped version based on configure tests.
3129         * src/freeze.c (obstack.h): Ditto.
3131         * acconfig.h: Removed.  No longer required.
3133         * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
3134         * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
3135         them to AC_INIT and AM_INIT_AUTOMAKE.
3136         * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
3137         disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
3138         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
3139         shell variable m4_cv_func_obstack_h.
3140         * tests/defs (M4): Be more careful about relative path to libtool
3141         script and m4 binary by using $srcdir.
3143         * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
3144         optargs to the existing libltdl search path.
3145         * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
3146         * m4/ltdl.c: Updated.
3147         * m4/ltdl.h: Ditto.
3148         * config/ltmain.sh: Ditto.
3150 2001-08-11  Gary V. Vaughan  <gary@gnu.org>
3152         * src/main.c (main): Add `-b' (for `batch') mode switch to force
3153         interactive mode off.
3155 2001-08-10  Akim Demaille  <akim@epita.fr>
3157         * configure.in: Require Autoconf 2.52.
3158         (AC_ARG_PROGRAM): Remove, handled by Automake.
3159         (m4_getopt): Rename as...
3160         (m4_getopt_h): this.
3161         Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
3162         Undefine `changeword' only if defined.
3163         * config/gnu-obstack.m4: Require Autoconf 2.52.
3164         (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
3165         Allow this token.
3167 2001-08-09  Yuji Minejima  <ggb01164@nifty.ne.jp>
3169         * doc/m4.texinfo: Fix some typos, and apply some small
3170         clarifications.
3172 2001-08-09  Andreas Schwab  <schwab@suse.de>
3174         * src/main.c (main): Fix improper uses of error (missing format
3175         string).
3177 2001-08-07  Akim Demaille  <akim@epita.fr>
3179         Improve `make distcheck'.
3181         * configure.in: Be sure to be able to run `mkconfig.sh' when src
3182         != build.
3183         * Makefile.am (dist-hook): Remove, as it is no longer needed.
3184         * doc/m4.texinfo (Include): Add missing blank.
3185         * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
3186         obstack.c.
3188 2001-08-07  Akim Demaille  <akim@epita.fr>
3190         * m4/evalparse.c: A better introductory comment.
3191         * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
3192         * m4/macro.c: Adjust old comments.
3193         * modules/README: Typo.
3195 2001-08-07  Akim Demaille  <akim@epita.fr>
3197         * config/gnu-obstack.m4: New.
3199 2001-08-07  Akim Demaille  <akim@epita.fr>
3201         * config/Makefile.am, config/stackovf.m4: New.
3202         * configure.in, Makefile.am: Adjust.
3204 2001-04-08  Roderick Koehle <Roderick.Koehle@infineon.com>
3206         * modules/format.c (format):  Formatting for %f was not
3207         interpreting the position of the decimal point correctly for
3208         whole numbers.
3210 2000-12-01  Gary V. Vaughan  <gary@gnu.org>
3212         * TODO:  Removed m4exit bug.
3213         * modules/load.c (m4_resident_module): Make this module resident.
3214         * module/m4.c (m4_resident_module): Ditto.
3215         * m4/modules.c (m4_module_load):  Use new ltdl resident modules
3216         feature to mark modules as resident if they export
3217         `m4_resident_module' as TRUE.
3218         (m4_module_unload): Do not remove resident modules, and take care
3219         with symbol insertion and deletion with resident modules.
3220         * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
3221         use resident modules feature.
3223 2000-11-30  Gary V. Vaughan  <gary@gnu.org>
3225         * TODO: Updated.  Removed some cruft that has since been fixed
3226         or implemented.  Added some more entries.
3227         * NEWS: Updated.
3228         * README: Updated.
3229         * modules/README: Updated.
3230         * doc/m4.texinfo: Updated.
3232         * modules/gnu.c (builtin_functions): Make indir orthogonal to
3233         builtin, in that each is recognised as a macro only with parameters
3234         (builtin_indir): Passing 0 arguments is now an error, as with
3235         builtin.
3237         * src/main.c (usage): Added missing description of `-c' option.
3239 2000-11-29  Gary V. Vaughan  <gary@gnu.org>
3241         Consolidate the myriad of dispersed test scripts into the
3242         tests subdirectory.  I think I now have all the file where I
3243         want them, so there shouldn't be anymore upheaval =)O|
3244         Honest!
3245         * tests/Makefile.am: Updated to run the new tests added below.
3246         * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
3247         tests/other-tests/ddivert.test, tests/other-tests/debug.test,
3248         tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
3249         tests/other-tests/foreach.test, tests/other-tests/forloop.test,
3250         tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
3251         tests/other-tests/hanoi.test, tests/other-tests/include.test,
3252         tests/other-tests/indir.test, tests/other-tests/misc.test,
3253         tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
3254         tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
3255         tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
3256         tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
3257         tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
3258         tests/other-tests/reverse.test, tests/other-tests/shadow.test,
3259         tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
3260         tests/other-tests/translit.test, tests/other-tests/undivert.test,
3261         tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
3262         tests/other-tests/wrap.test:  New tests based on the contents
3263         of the tests removed below.
3264         * examples/Makefile.am, modules/Makefile.am:  Updated to
3265         reflect removed tests.
3266         * examples/defs,modules/defs: Removed.
3267         * examples/capitalize.test, examples/comments.test,
3268         examples/ddivert.test, examples/debug.test,
3269         examples/esyscmd.test, examples/exp.test,
3270         examples/foreach.test, examples/forloop.test,
3271         examples/fstab.test, examples/hanoi.test,
3272         examples/include.test, examples/indir.test,
3273         examples/misc.test, examples/multiquotes.test,
3274         examples/patsubst.test, examples/pushpop.test,
3275         examples/regexp.test, examples/reverse.test,
3276         examples/sysv-args.test, examples/trace.test,
3277         examples/translit.test, examples/undivert.test,
3278         examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
3279         modules/modpath1.test, modules/modpath2.test,
3280         modules/modpath3.test, modules/modpath4.test,
3281         modules/modtest.test, modules/shadow.test,
3282         modules/unfrozen.m4, modules/unload.test: Removed.
3284         Move the implementation of GMP support for the mpeval() builtin
3285         into a loadable module that depends on libgmp.  mpeval() and
3286         eval() share a common parser, now in m4/evalparser.c; the code
3287         in m4/numb.c and m4/numb.h is now physically split between
3288         m4/eval.c (the eval() backend) and modules/mpeval.c (the
3289         mpeval() backend), rather than being differentiated by cpp
3290         macros and multiple inclusion.  The mpeval module is always
3291         built but will generate an diagnostic if it is used from an
3292         installation that didn't link in the gmp library.
3293         * modules/Makefile.am: build and install the new mpeval module.
3294         * modules/mpeval.c: Now contains the former parts of m4/numb.c
3295         and m4/numb.h that are required for gmp support in mpeval().
3296         * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
3297         * m4/evalmp.c:  Removed.
3298         * m4/m4module.h: Removed conditional prototype for
3299         m4_mp_evaluate().
3300         * m4/eval.c: Rewritten.  Contains the former parts of m4/numb.c
3301         and m4/numb.h that do not rely on gmp.
3302         * m4/evalparse.c:  New file, contains the shared parts of the
3303         eval() and evalmp() parser implementations, and is no longer
3304         unencumbered by cpp magic to uncover the right parts.
3305         * m4/numb.h:  Removed.  It's former contents are split between
3306         m4/eval.c and modules/mpeval.c.
3307         * m4/numb.c: ditto.
3309         * tests/other-tests/changeword.test: New test.  Rudimentary
3310         testing of changeword builtin runs only if --wnable-changeword
3311         was used at configure time.
3312         * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
3313         alternation correctly.  Split into two expressions to compensate.
3314         * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
3315         * modules/Makefile.am: Build changeword module.
3316         * modules/changeword.c (m4_macro_table): Define __m4_changeword__
3317         only when --enable-changeword was passed to configure.
3318         (builtin_changeword): If --enable-changeword was not used, then
3319         report that changeword() builtin has no support in m4 binary.
3321 2000-11-28  Gary V. Vaughan  <gary@gnu.org>
3323         * src/main.c (main): Fixed a particularly nasty bug is
3324         user_search_path setting -- the -M flag processing must be
3325         extremely careful with search path ordering, or else the default
3326         installed module directory (possibly containing modules from a
3327         previous release) is placed earlier in the search path than any -M
3328         arguments (which are relied upon to load uninstalled modules with
3329         most of the tests in the regresion suite).
3331         * modules/load.c (builtin_load):  Nasty hack to prevent adding
3332         symbols to symtab again if a module is loaded more than once.
3333         * modules/m4.c (builtin_ifelse): removed unused variable argv0.
3335         * m4/symtab.c (m4_remove_table_reference_symbols):  Fixed a
3336         possible NULL pointer dereference.
3338         * m4/module.c (m4_module_find_by_modname): Renamed from
3339         m4_module_modname_find.   Fixed all references.
3340         (m4_module_find_by_builtin):  New function.
3342         * modules/modfreeze.test: load the `load' module with each
3343         invocation.
3344         * src/freeze.c (produce_frozen_state): Simplified in light of
3345         module field in m4_symbol.  Allow a third argument for text macros
3346         to name the originating module.
3347         (reload_frozen_state): ditto.
3348         * m4/m4module.h:  Fixup prototypes.
3349         * m4/builtin.h (m4_builtin_define): Add a module argument so
3350         that symbols can be registered against the defining module.
3351         (m4_macro_define): ditto.
3352         * m4/m4private.h (m4_symbol): Make the module field const to save
3353         on casting in the rest of the code.
3354         (SYMBOL_MODULE): New macro.
3356         * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
3357         symbol reference maintenance bugs when removing a symbol from the
3358         symtab.
3360         * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
3362 2000-11-27  Gary V. Vaughan  <gary@gnu.org>
3364         * configure.in (m4_cv_func_obstack): A better check for whether
3365         libc has an obstack implementation.
3366         * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
3368         * configure.in (--with-modules): Changed semantics.  This
3369         option is now used to list modules to be preopened.
3370         * src/m4.h: #include "ltdl.h" unconditionally.
3371         * src/main.c: Removed all dependencies on WITH_MODULES.
3372         * src/freeze.c: ditto.
3373         * modules/Makefile.am: ditto.
3374         * m4/m4.c (builtin_m4exit): ditto.
3375         * modules/modpath1.test: ditto.
3376         * modules/modpath2.test: ditto.
3377         * modules/modpath3.test: ditto.
3378         * modules/modpath4.test: ditto.
3379         * modules/modtest.test: ditto.
3380         * modules/shadow.test: ditto.
3381         * modules/unload.test: ditto.
3383         * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
3384         comes up on demand in LTLIBOBJS now.
3385         * configure.in (getopt_long):  Creating and relying on a link for
3386         getopt.h on hosts with no getopt_long() of thier own works
3387         correctly now.  This is necessary so that callers of getopt_long()
3388         can simply `#include <getopt.h>': the naive way of doing this
3389         would end up using our own getopt.h and the installed
3390         getopt_long(), which is asking for trouble!
3391         (obstack_init): A similar argument applies to obstack.h and
3392         obstack_init().
3394         * m4/ltdl.c: Upgraded to latest bleeding edge version again.
3395         On Solaris-2.5 (at least) the native dlopen implementation
3396         gets confused about m4.o when looking for module "m4".  This
3397         version always looks for .la an .$lib_ext suffixed names first
3398         to work around the problem.  Sigh.
3400         * po/POTFILES.in: Take account of these file movements.
3401         * src/Makefile.am (m4_SOURCES): removed eval.c.
3402         (EXTRA_m4_SOURCES): removed numb.c and numb.h.
3403         * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
3404         (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
3405         * modules/m4.c (builtin_eval): Use m4_evaluate().
3406         * m4/eval.c: Moved here from src/eval.c to facilitate
3407         implementation of eval() builtin as part of the `m4' loadable
3408         module.
3409         (m4_evaluate): renamed from evaluate for namespace cleanliness.
3410         * m4/numb.c: Moved here from src/numb.c, since it is #included
3411         into eval.c at compile time.
3412         * m4/m4module.h (m4_evaluate): Added prototype.
3413         * src/m4.h (evaluate): Removed prototype.
3415 2000-11-25  Gary V. Vaughan  <gary@gnu.org>
3417         * modules/perl.c (builtin_perleval):  Use PL_na for
3418         compatibility with perl-5.6.
3420         * src/main.c (main):  It is now safe to
3421         ``m4_module_install("m4")'', without tripping over the m4
3422         binary itself!
3423         * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
3424         versions having fixed the insidious module search order bug.
3426         * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
3427         supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
3429         * configure.in: Figure out whether to use the installed
3430         getopt.h or the supplied one.
3431         * src/Makefile.am: ditto.
3433         * po/POTFILES.in: List files in their new positions.
3435         * config/ltmain.sh:  This needs to be checked in to match the
3436         libtool macros copied to acinclude.m4 (until a released
3437         libtool copes with m4's needs).
3438         * bootstrap:  Run gettextize.
3440 2000-11-24  Gary V. Vaughan  <gary@gnu.org>
3442         * AUTHORS:  Added my details.
3443         * TODO: updated.
3444         * NEWS: updated.
3445         * bootstrap: temporary update until released libtool catches up.
3447         * All files:  Use new GNU GPL copyright blurb with current contact
3448         address.
3450         * configure.in (LTLIBOBJS): Use canonical code for calculation of
3451         this variable.
3453         * config: renamed acm4 directory to config to be more like
3454         other autoconfiscated packages.
3456         * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
3457         * config/debug.m4:  New file implementing configure macros to add
3458         suitable debug flags to the compiler invocation.
3460         * modules/load.c:  New file implementing the ``load'' and
3461         ``unload'' builtins.
3462         * tests/get-them:  Set the module search directory to the modules
3463         build directory in generated tests.
3464         * modules/shadow.test: ditto.
3465         * modules/modtest.test: ditto.
3466         * modules/modpath1.test: ditto.
3467         * modules/modpath2.test: ditto.
3468         * modules/modpath3.test: ditto.
3469         * modules/modpath4.test: ditto.
3470         * modules/modtest.test: ditto.
3471         * modules/modfreeze.test: ditto.
3472         * modules/unload.test: ditto.
3474         * modules/changeword.c:  New file implementing the ``changeword''
3475         builtin as a loadable module.
3476         * modules/mpeval.c:  New file implementing the ``mpeval'' builtin
3477         as a loadable module.
3479         * src/main.c (main):  Load the gnu module if m4 was started
3480         normally -- i.e. without the -G option.
3481         * modules/gnu.c:  New file implementing a new loadable module wuth
3482         definitions for all the gnu extension builtins.
3483         * modules/format.c:  Moved here from src/format.c.  Now included
3484         directly by gnu.c.
3486         * src/main.c (main):  Load the traditional module if m4 was
3487         started in `no_gnu_extensions' mode.
3488         * modules/traditional.c:  New file implementing the ``unix'' macro,
3489         required when m4 is executed in traditional mode, as a loadable
3490         module.
3492         * src/main.c:  Renamed from m4.c to avoid confusion with
3493         modules/m4.c.
3494         (main):  Always load the m4 module.
3495         * modules/m4.c:  New file implementing a new loadable module with
3496         definitions for all m4 builtins that are not gnu extensions.
3498         * m4/Makefile.am:  Adjusted to take new files below into account.
3499         * m4/m4module.h: Prototypes for exported functions and types moved
3500         to this directory from the src directory.
3501         * m4/m4private.h: Moved here from src/m4private.h to facilitate
3502         the migration of all builtin implementations to loadable modules.
3503         * m4/macro.c: Moved this file here from the src directory,
3504         renaming all exported symbols to use the prefix ``m4_''.
3505         * m4/builtin.c: ditto.
3506         * m4/module.c: ditto.
3507         * m4/symtab.c: ditto.
3508         * m4/debug.c: ditto.
3509         * m4/input.c: ditto.
3510         * m4/output.c: ditto.
3511         * m4/path.c: ditto.
3512         * m4/ltdl.h, m4/ltdl.c: ditto.
3513         * m4/utility.c: Odd functions moved here from files in the src
3514         directory to facilitate builtin migration.
3516 2000-08-12  Gary V. Vaughan  <gary@gnu.org>
3518         * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
3519         error message, to make translators' jobs a little easier.
3520         (builtin_builtin): ditto.
3521         (builtin_traceon): ditto.
3522         (builtin_traceoff): ditto.
3523         Reported by Akim Demaille <akim@epita.fr>
3525         * m4/Makefile.am (pkgincdir):  Deleted.  Use automake's built in
3526         pkgincludedir instead.
3528         * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
3529         it is exported globally.  Fixed all references.
3530         (lquote): ditto.
3531         (bcomm): ditto.
3532         (ecomm): ditto.
3533         (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
3534         globally.  Fixed all references.
3535         (DEF_LQUOTE): ditto.
3536         (DEF_BCOMM): ditto.
3537         (DEF_ECOMM): ditto.
3539 2000-07-28  Gary V. Vaughan  <gary@gnu.org>
3541         * NEWS: updated.
3542         * TODO: updated.
3544         * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
3545         (AC_OUTPUT): touch stamp-h.in, not stamp-h.
3547         * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
3548         Removed `Prev', `Next' and `Up' fields of all @nodes now that
3549         makeinfo calculates them for us, and to make any future
3550         reorganisation easier.
3551         (Frozen files): Document format version 2.
3552         `V' now takes argument `2'.
3553         `F' can take a single argument if symbol and builtin names
3554         are the same, or 3 arguments if the builtin is from a module.
3555         New `S' specification for saving syntax table contents.
3556         New `M' specification for saving loaded module names.
3557         * src/freeze.c: Implement them.
3558         * src/input.c (syntax_code): For interpreting frozen syntax
3559         state.
3561         * examples/Makefile.am:  Add the contents of the WWW directory to
3562         the distribution.
3563         * examples/WWW/Makefile:  ditto,
3564         (%.htm): Compares file contents (not just sizes) to determine
3565         whether a change has occured.
3566         * examples/WWW/_header.htm: Bumped version number.
3567         * examples/WWW: Regenerated content.
3569         * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
3570         compilers comes much easier without ansi2knr.
3571         * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
3573         * m4/list.c: New generic list container type.
3574         * m4/list.h: Interface to new container type.
3575         * m4/Makefile.am (pkginc_HEADERS): Install list.h.
3576         (libm4_la_SOURCES): compile and link list.c.
3577         * src/builtin.c (builtin_tables): Use list container.
3578         * src/module.c (symtab): ditto.
3579         * src/symtab.c (symtab): ditto.
3581         * m4/system.h: New file for common preprocessor definitions.
3582         * m4/Makefile.am (pkginc_HEADERS): install system.h.
3583         * m4/error.c: Use system.h in place of inline preprocessor.
3584         * m4/error.h: ditto.
3585         * m4/module.c: ditto.
3586         * m4/module.h: ditto.
3587         * m4/xmalloc.c: ditto.
3589         * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
3590         compatibility.
3591         * m4/xmalloc.c (xmalloc_exit_failure): ditto.
3593         * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
3594         it is exported globally.  Fixed all references.
3595         (builtin): ditto.
3596         (module_init_t): ditto.
3597         (module_finish_t): ditto.
3598         (token_data): ditto.
3599         (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
3600         it is exported globally.  Fixed all references.
3601         (SYNTAX_IGNORE): ditto.
3602         (SYNTAX_SPACE): ditto.
3603         (SYNTAX_OPEN): ditto.
3604         (SYNTAX_CLOSE): ditto.
3605         (SYNTAX_COMMA): ditto.
3606         (SYNTAX_DOLLAR): ditto.
3607         (SYNTAX_ACTIVE): ditto.
3608         (SYNTAX_ESCAPE): ditto.
3609         (SYNTAX_ALPHA): ditto.
3610         (SYNTAX_NUM): ditto.
3611         (SYNTAX_ALNUM): ditto.
3612         (SYNTAX_LQUOTE): ditto.
3613         (SYNTAX_RQUOTE): ditto.
3614         (SYNTAX_BCOMM): ditto.
3615         (SYNTAX_ECOMM): ditto.
3616         (SYNTAX_VALUE): ditto.
3617         (SYNTAX_MASKS): ditto.
3618         (IS_OTHER): ditto.
3619         (IS_IGNORE): ditto.
3620         (IS_SPACE): ditto.
3621         (IS_OPEN): ditto.
3622         (IS_CLOSE): ditto.
3623         (IS_COMMA): ditto.
3624         (IS_DOLLAR): ditto.
3625         (IS_ACTIVE): ditto.
3626         (IS_ESCAPE): ditto.
3627         (IS_ALPHA): ditto.
3628         (IS_NUM): ditto.
3629         (IS_ALNUM): ditto.
3630         (IS_LQUOTE): ditto.
3631         (IS_RQUOTE): ditto.
3632         (IS_BCOMM): ditto.
3633         (IS_ECOMM): ditto.
3634         (TOKEN_EOF): ditto.
3635         (TOKEN_NONE): ditto.
3636         (TOKEN_STRING): ditto.
3637         (TOKEN_SPACE): ditto.
3638         (TOKEN_WORD): ditto.
3639         (TOKEN_SIMPLE): ditto.
3640         (TOKEN_MACDEF): ditto.
3642         * m4/m4module.h (voidstar): Removed in favour of `VOID' for
3643         consistency.  Fixed all references.
3644         (STRING): Renamed to `m4_string' for consistency, and because if
3645         is exported globally.  Fixed all references.
3646         (token_type): Renamed to `m4_token_t' for the same reasons.
3647         (token_data_type): Renamed to `m4_token_data_t' for the same
3648         reasons.
3650         * m4/m4module.h (XCALLOC): Wrapper macro which handles type
3651         sizes.
3652         (XMALLOC): ditto.
3653         (XREALLOC): ditto.
3654         (XFREE): Wrapper macro which avoids freeing NULL pointers.
3656         * m4/m4module.h (m4_macro):  New type for module defined user
3657         macros.
3658         * modules/modtest.c (m4_macro_table):  Define module user macros.
3659         * modules/shadow.c (m4_macro_table):  ditto.
3661         * m4/m4module.h (M4BUILTIN_HANDLER):  For defining handlers
3662         declared with M4BUILTIN.
3664         * m4/xmalloc.c: Use memset if bzero is not available when
3665         emulating calloc with malloc.
3666         (xcalloc): Fallback to malloc/bzero if calloc is not available.
3667         (xfree): Added for consistency.  Will not try to free NULL
3668         pointers.
3669         * src/m4.c (xfree):  Deleted in favour of the above.
3670         * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
3671         linking with libdmalloc.
3672         * m4/xstrdup.c (WITH_DMALLOC): ditto.
3674         * modules/frozen.m4:  New test case.
3675         * modules/unfrozen.m4:  ditto.
3676         * modules/modfreeze.test:  New test.
3677         * modules/unload.test:  ditto.
3678         * modules/Makefile.am (EXTRA_DIST):  Distribute them.
3679         (TESTS): Use them.
3680         * modules/modpath1.test:  Don't try this test if module support is
3681         not compiled in.
3682         * modules/modpath2.test: ditto.
3683         * modules/modpath3.test: ditto.
3684         * modules/modpath4.test: ditto.
3685         * modules/modtest.test: ditto.
3686         * modules/shadow.test: ditto.
3688         * modules/perl.c: New module.
3689         * modules/perl.m4: Example of using it.
3690         * modules/Makefile.am (perl_la_SOURCES):  Build new perl module.
3692         * src/m4.c (main): Assume interactive mode if STDIN is connected
3693         to a tty.
3694         Changed startup sequence slightly so that syntax is not
3695         initialised from here when loading a frozen file.
3697         * src/builtin.c:  Much improved macro definition style.
3698         * src/m4private.h:  Internal structures for m4_builtin and
3699         m4_macro instances.  These are not exposed to module writers.
3700         * src/module.c (module_modname_find):  Find a module structure
3701         from the its name.
3702         (make_macro_table):  Build an internal macro table from a external
3703         definition.
3704         (make_builtin_table):  Build an internal builtin table from an
3705         external definition.
3707         * src/module.c (module_unload): Be extremely careful to remove
3708         builtins and macros that match the module being unloaded -- no
3709         longer assume that the top element can be removed incase another
3710         odule defines an identical name.
3711         * src/symtab.c (remove_table_reference_symbols): remove all symbol
3712         table entries which refer to a given builtin table.
3713         * src/builtin.c (remove_tables): Use it!
3715 2000-07-13  Thomas Tanner  <tanner@ffii.org>
3717         * Makefile.am (SUBDIRS): we need modules/ for "make dist"
3718         * acm4/modules.m4: deleted
3719         * bootstrap: don't libtoolize libltdl!
3720         * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
3721         if set, enable WITH_MODULES and add modules to DLPREOPEN
3722         * examples/misc.test: redirect standard output
3723         * lib/Makefile.am: don't use DLLDFLAGS
3724         * lib/m4module.c: include necessary headers to silence GCC -Wall
3725         * lib/m4regex.c: fixes to silence GCC -Wall
3726         * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
3727           build modules conditionally
3728         * modules/shadow.c: define symbol aliases before using them
3729         * modules/test.c: define symbol aliases before using them
3730         * po/de.po: update translation
3731         * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
3732         pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
3733         LIBLTDL to LIBS.
3734         * src/m4.c: initialize libltdl's preloaded symbols via
3735         LTDL_SET_PRELOADED_SYMBOLS
3736         * src/module.c: libltdl's memory management must be initialized
3737         before calling lt_dlinit!, fix warnings
3739 2000-01-18  Gary V. Vaughan  <gary@gnu.org>
3741         * README:  Caveat about nls not supported by dll architecture on
3742         Windows.
3744         * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
3746         * tests/Makefile.am (stamp-TESTS):  now works with VPATH.
3747         * src/Makefile.am (m4_LDADD):  use $(builddir) for VPATH.
3748         * modules/Makefile.am (LIBS): ditto.
3749         (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
3750         $(top_srcdir)/m4 (for only <m4module.h>).
3751         * modules/shadow.test: fixed for VPATH.
3752         * modules/modtest.test: ditto.
3753         * modules/modpath4.test: ditto.
3754         * modules/modpath3.test: ditto.
3755         * modules/modpath2.test: ditto.
3756         * modules/modpath1.test: ditto.
3758         * modules/time.test: Removed due to timezone dependence,
3759         * modules/Makefile.am (TESTS): Removed time.test.
3761         * configure.in: Use $3 of AC_DEFINE so that we can,,,
3762         * acconfig.h: Remove everything except the gettext parameters.
3763         * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
3764         AC_DEFINE.
3765         * acm4/ltdl.m4:  Updated to latest from libtool cvs.
3766         * acm4/modules.m4:  Remove code which duplicates ltdl.m4 and
3767         increment serial number.
3769         * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
3770         src dir and immediately after libm4 is built for confidence that
3771         it doesn't rely on the src directory.
3772         (SUBDIRS): Moved doc dir to the end since helptoman.pl and
3773         makeinfo stop the build on cygwin (because they don't work).
3775         * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
3777         * m4/m4private.h: ...is not a public header, so moved to src.
3778         Add `#include <config.h>', `#define _COMPILING_M4' and
3779         `#include "m4.h".
3780         * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
3781         * src/Makefile.am (noinst_HEADERS): add m4private.h.
3782         * src/builtin.c: `#include "m4private.h"' now takes care of the
3783         above.  Duplicates removed.
3784         * src/debug.c: ditto.
3785         * src/eval.c: ditto.
3786         * src/evalmp.c: ditto.
3787         * src/format.c: ditto.
3788         * src/freeze.c: ditto.
3789         * src/input.c: ditto.
3790         * src/m4.c: ditto.
3791         * src/macro.c: ditto.
3792         * src/module.c: ditto.
3793         * src/numb.h: ditto.
3794         * src/output.c: ditto.
3795         * src/path.c: ditto.
3796         * stackovf.c: ditto.
3797         * symtab.c: ditto.
3799         * po/POTFILES.in: compensate for renaming of lib/*.
3800         * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
3801         (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
3802         and then in $(top_srcdir)/lib (for eg. "m4private.h").
3803         * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
3804         m4/libm4.la.
3805         * m4/m4error.h:  Renamed error.h, for installation to
3806         $prefix/include/m4..
3807         * m4/m4obstack.h:  Renamed obstack.h, for same reason.
3808         * m4/m4regex.h: Renamed regex.h, for same reason.
3809         * m4/m4error.c:  Renamed error.c, and use #include "error.h".
3810         * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
3811         * m4/m4regex.c: Renamed regex.c, and fix #includes.
3813         * lib: moved to m4 to easily support header installation to
3814         $prefix/include/m4.
3815         * Makefile.am (SUBDIRS): renamed lib dir to m4.
3816         * configure.in (AC_OUTPUT): reference m4/Makefile.in.
3817         * acm4/regex.m4: Point to m4/regex.c.
3819         * examples/foreach.m4:  Sanitise quoting.
3820         * examples/foreach.test:  New torture test.
3821         From Akim Demaille <akim@epita.fr>
3823 2000-01-17  Gary V. Vaughan  <gary@gnu.org>
3825         * src/ltdl.c: Use access() to abort doomed module load attempts
3826         if module file does not exist.
3828         * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
3829         getopt1.o will already be used if appropriate, so I moved getopt.c
3830         and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
3832         * modules/modpath1.test: Use correct filename in header line.
3833         * modules/modpath2.test: ditto.
3834         * modules/modpath3.test: ditto.
3835         * modules/modpath4.test: ditto.
3837         Without these changes lt_dlopen("test") attempts to
3838         LoadLibrary("/bin/test") on Windows, which although harmless
3839         generates a spurious error message which spoils most of the tests:
3840         * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
3841         (TESTS): s/test.test /modtest.test /
3842         (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
3843         (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
3844         * modules/modpath1.test: s/test.m4 /modtest.m4 /
3845         * modules/modpath2.test: ditto.
3846         * modules/modpath4.test: ditto.
3847         * modules/modpath3.test: s/-m test /-m modtest /
3848         * modules/shadow.m4: use {un,}loadmodule(`modtest').
3850 2000-01-16  Gary V. Vaughan  <gary@gnu.org>
3852         * src/ltdl.c (find_file): Updated to new version with fixed memory
3853         allocation bug in `next'.
3854         * src/ltdl.h: updated to match.
3856         * modules/Makefile.am:  Cleaned up and reordered.
3858 2000-01-16  Rene' Seindal  <rene@seindal.dk>
3860         * modules/Makefile.am (TESTS): New tests for the module system.
3862         * modules/*.test: New files.
3864         * src/m4.c (main): Added call to module_init().
3865         Treats -M and -m as the arguments -D -U and -t, ie deferred.
3867         * src/m4.h: Added declaration of module_init().
3869         * src/module.c (module_init): No longer static
3871         * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
3872         Added to shut up automake about non standard libtool library
3873         names.
3875         * src/module.c: Disabled DEBUG by default.
3877         * modules/README: Changed example from unload.m4 to shadow.m4
3879         * modules/shadow.m4: Renamed from unload.m4
3881         * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
3883         * src/m4.c (main): Functionality for -m and -M were reversed.
3884         Fixed.
3886 2000-01-12  Gary V. Vaughan  <gary@gnu.org>
3888         * doc/help2man.pl: updated to version 1.020.
3890         * lib/COPYING.LIB:  updated to version 2.1.
3892         * lib/m4module.h: restructure the M4_SCOPE code to work when
3893         creating a dll which links with libm4.la and both DLL_EXPORT
3894         (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
3895         both defined.
3897 2000-01-11  Gary V. Vaughan  <gary@gnu.org>
3899         Merged the following changes from my tree:
3901         1999-06-15  Gary V. Vaughan  <gary@gnu.org>
3903         * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
3904         ported to compile shared libs.
3906         * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
3907         use `__declspec(dllimport)' when linking libm4.la on win32.
3908         * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
3910         * configure.in (M4OBJS): Discover whether we need the shipped
3911         implementation of getopt_long.
3912         * src/Makefile.am (m4_LDADD): Link the getopt objects into the
3913         main binary here, as opposed to the module library in lib/libm4.la.
3915         1999-06-14  Gary V. Vaughan  <gary@gnu.org>
3917         * modules/README: Updated to describe the improved libltdl based
3918         module scheme.
3919         * README (cygwin): Added some compilation notes for building m4
3920         correctly under cygwin.
3921         * TODO: Cleaned out the entries for the module system since they
3922         are now implemented.
3924         * *.[ch]: __P is in the compiler's reserved namespace, so replaced
3925         all instances of __P with M4_PARAMS.
3927         * lib/getdate.h: removed unreferenced file.
3929         * lib/m4private.h: New file to define the private interface to the
3930         token_data struct, which must be shared between m4module.c, and
3931         builtin.c but not exported to modules built from the installed
3932         m4module.h since it's size changes depending on compile time
3933         options.
3935         * src/m4.h: Lots of stuff moved to lib/m4module.h.
3937         * lib/m4module.h: New file to define the interface available when
3938         compiling m4 modules.
3939         * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
3940         necessary for module compilation into this new file.
3942         * lib/Makefile.am (include_HEADERS): install headers (renamed to
3943         avoid nameclash with other system headers) necessary for compiling
3944         modules.
3945         (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
3946         so that modules can include the (renamed) installed headers and
3947         be guaranteed a matching implementation.
3948         * lib/m4error.h: renamed from error.h.
3949         * lib/m4obstack.h: renamed from obstack.h.
3950         * lib/m4regex.h: renamed from regex.h.
3951         * configure.in (AC_REPLACE_FUNCS):  Don't look for a system
3952         implementation, simply include the shipped version
3953         unconditionally, otherwise it is hard for a module to know
3954         whether the m4obstack.h header it is using matches the
3955         implementation it ends up linking against.
3956         (jm_WITH_REGEX):  Include regex into libm4 unconditionally for
3957         the same reason.
3959         1999-05-18  Gary V. Vaughan  <gary@gnu.org>
3961         * examples/misc.test: Don't run this test on machines which don't
3962         have a root user in /etc/passwd (e.g. cygwin).
3964         * tests/get-them (/^@example$/): Error messages might have a
3965         ``.exe'' suffix to the program name, or else use the libtool
3966         ``.libs/lt-m4'' binary, or generally have an unexpected path.  All
3967         of these cases are now catered for when comparing error messages
3968         in generated tests.
3969         * tests/other-tests/*.test: ditto.
3970         * examples/*.test: ditto.
3972         * tests/defs (M4): use libtool execute mode.
3973         * examples/defs (M4): ditto.
3975         * tests/get-them (END): explicitly close any open file.
3976         (printthem): In a regular expression, '{' is the start of a repeat
3977         count!  Use `[{]' for a literal open brace.
3978         (/^@node /): Don't use substr on a string shorter than the trim
3979         length.
3981         1999-05-17  Gary V. Vaughan  <gary@gnu.org>
3983         * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
3984         substituted.
3985         (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
3987 2000-01-10  Andreas Schwab  <schwab@suse.de>
3989         * tests/other-tests/gmp.test: Find config.sh in build directory.
3991         * configure.in: Find tests/mkconfig.sh in $srcdir.
3993         * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
3994         <signal.h> (for SUS2 compliant systems).
3996         * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
3997         HAVE_SIGINFO_H.
3999 2000-01-10  Rene' Seindal  <rene@seindal.dk>
4001         * Prerelease 1.4o.
4003         * TODO, NEWS: Cleaned up and updated.
4005         * src/m4.c (main): New variable exit_status for exit status in
4006         case of unreadable files.  Now m4 will exit with EXIT_FAILURE if a
4007         file cannot be read instead of EXIT_SUCCESS.
4009         * src/builtin.c (m4_indir): Changed error message to help
4010         translators (from Akim Demaille <demaille@inf.enst.fr>).
4012         * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
4013         Cygnus.
4015         * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
4016         from glic 2.1.2.
4018         * src/input.c (match_input): Reordering of code, to avoid multiple
4019         calls to push_string_init() from obstack_grow(), which can happen
4020         with some compilers (found and fixed by James Bonfield
4021         <jkb@mrc-lmb.cam.ac.uk>).
4023         * src/stackovf.c: Added prototypes for ultrix.
4024         (setup_stackovf_trap): Added __P to cast.
4025         (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
4027 2000-01-09  Rene' Seindal  <rene@seindal.dk>
4029         * doc/m4.texinfo (Changequote): Added comment about changing
4030         quotes when the old quote is a part of the new.
4032         * src/builtin.c (expand_ranges): Added break after trailing dash.
4033         This caused misbehavious on some systems (found and fixed by Akim
4034         Demaille <demaille@inf.enst.fr>).
4036         * AUTHORS: Thomas Tanner included
4038         * acconfig.h: Added entry for ss_sp (see below).
4040         * configure.in (use_stackovf): Added check for stack_t with member
4041         ss_base instead of ss_sp (BSDI notably).  (Reported by Paul Eggert
4042         <eggert@twinsun.com>).
4044         * doc/m4.texinfo (Frozen files): Added a simpler example for
4045         generating frozen files from several input files.
4047 1999-11-14  Paul Eggert  <eggert@twinsun.com>
4049         * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
4050         lib/regex.c, lib/xmalloc.c.
4052 1999-11-10  Rene' Seindal  <rene@seindal.dk>
4054         * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
4056         * src/module.c: reindented.
4057         (module_load): return if this is a repeated load of same module.
4058         (module_init): slight change of logic to avoid repeated
4059         initialisation debug messages.
4061         * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
4062         in the distribution.
4064         * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
4065         automake warnings about missing lib prefix.
4066         (time_la_LDFLAGS): ditto
4067         (stdlib_la_LDFLAGS): ditto
4069 1999-11-10  Paul Eggert  <eggert@twinsun.com>
4071         * src/m4.h: Include error.h, since our macros use error.
4072         * src/m4.c: Don't need to include error.h.
4074 1999-11-09  Paul Eggert  <eggert@twinsun.com>
4076         * src/m4.h (voidstar): Define to void * if __STDC__ is defined
4077         and zero, as Solaris 7 cc does.
4078         (bcopy): Remove macro; no longer needed with new obstack.h.
4080         * src/output.c (freeze_diversions): Don't assume that a
4081         diversion size can fit in `int'.  Check for diversion file
4082         size too large to be printed with `unsigned long'.
4084         * src/Makefile.am (CFLAGS): Omit -Wall.
4086         * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
4088         * src/debug.c (trace_format):
4089         Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
4091         * src/freeze.c (produce_frozen_state):
4092         Don't assume string lengths fit in int.
4094 1999-10-13  Rene' Seindal  <rene@seindal.dk>
4096         * configure.in (ALL_LINGUAS): Added Greek translation (el).
4097         (ALL_LINGUAS): Added Czech translation (cs).
4099 1999-03-30  Gary V. Vaughan  <gary@gnu.org>
4101         * src/builtin.c: moved module loading functions into...
4102         * src/module.c: entirely new implementation using libltdl.
4103         * po/POTFILES.in: added src/module.c.
4104         * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
4105         are modules, not linktime libraries.
4106         (LDFLAGS): added -no-undefined -module and -avoid-version flags.
4107         * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
4108         avoidance on exported symbols.
4109         * modules/test.c (m4_macro_table, m4_init_module,
4110         m4_finish_module): ditto.
4111         * modules/time.c (m4_macro_table): ditto.
4113         * modules/time2.m4: new file which requires command line loading
4114         of modules.
4115         * src/m4.c (--load-module): dynamically load named runtime module
4116         into running executable before reading the source.
4117         (--module-directory): prepend a directory to the module search
4118         path.
4119         (module_init()): Do this the first time we load a module instead;
4120         if the module subsystem is broken normal m4 scripts can still run.
4121         * src/m4.h (install_builtin_table): is now exported.
4123 1999-03-26  Gary V. Vaughan  <gary@gnu.org>
4125         * src/module.c: removed.  No longer required.
4126         * po/POTFILES.in: removed src/module.c.
4128         * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
4129         the bootstrap script can recreate.
4130         * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
4131         * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
4132         * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
4133         * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
4134         (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
4135         * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
4136         * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
4137         * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
4139         * acinclude.m4: removed.  `aclocal -I acm4' handles this much
4140         better.
4141         * acm4/Makefile.am (ACINCLUDE_M4): ditto.
4142         * acm4/gettext.m4: removed.  It causes a multiple definition vs.
4143         the installed gettext.m4 file when running aclocal.
4145 1999-03-25  Gary V. Vaughan  <gary@gnu.org>
4147         * configure.in (AM_INIT_AUTOMAKE): bumped version number to
4148         distinguish this from the last prerelease.
4149         (AC_LIBLTDL_CONVENIENCE):  build libltdl as a convenience library
4150         in its own subdirectory.
4152         * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
4153         lib prefix on a module" feature.
4154         (LDFLAGS): Added `-module -avoid-version' flags to build
4155         versionless module libraries.
4156         * src/builtin.c (m4_load_module): use libltdl.
4157         (module_unload_all): use libltdl.
4158         * src/m4.c (module_init): initialise module loading on demand for
4159         better diagnostics, and so that m4 will still work even if
4160         the module code is broken.
4161         * src/m4.h (module_init): removed.  No longer relevant.
4162         * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
4163         exported symbols for compatibility with dlpreopening.
4164         * modules/test.c (m4_macro_table, m4_init_module,
4165         m4_finish_module): ditto.
4166         * modules/time.c (m4_macro_table): ditto.
4168         * bootstrap: New file.  Runs all the autoutils in the right order
4169         after a fresh checkout, or a make maintainer-clean.
4171 1999-02-18  Akim Demaille  <demaille@inf.enst.fr>
4173         * src/builtin.c (dump_symbols): New function, factoring common
4174         content of m4_dumpdef and m4_symbols.
4175         (m4_dumpdef): Use it.
4176         (m4_symbols): New function, implementing `symbols'.  Use it.
4177         * doc/m4.texinfo: Fixed missing commas after @xref, so that the
4178         file compile with modern makeinfo.
4179         (Symbols): New node, documenting symbols.
4180         (direntry): Modernize.
4182 1998-12-11  Rene' Seindal  <rene@seindal.dk>
4184         * src/builtin.c (predefined_tab): New predefined macros
4185         __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
4186         configure time options.
4188 1998-12-01  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
4190         * src/module.c (module_try_load): Don't try to be clever and
4191         overwrite argument string.  Instead allocate all constructed
4192         strings locally, since they can have arbitrary lengths.  Make
4193         arguments pointers to const.
4194         (module_search): Simplify due to above change.
4196 1998-11-29  Rene' Seindal  <rene@seindal.dk>
4198         * Prerelease 1.4n.
4200         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
4202         * tests/other-tests/import-environment.{m4,test}: New test.
4204         * tests/other-tests/discard-comments.{m4,test}: New test.
4206         * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
4208         * src/m4.c (main): New option -c --discard-comments.
4209         New global variable discard_comments.
4211         * src/m4.h (token_type): New TOKEN_NONE for tokens to be
4212         discarded, ie never returned from next_token().
4213         Added declaration of discard_comments.
4215         * src/input.c (next_token): Now loops until token type is not
4216         TOKEN_NONE.  Comments are now given this type when comments should
4217         be discarded.
4219         * doc/m4.texinfo (Invoking m4): Updated for --import-environment
4220         and mpeval.
4222 1998-11-28  Rene' Seindal  <rene@seindal.dk>
4224         * src/m4.c (main): New option --import-environment (no single
4225         letter option).
4227         * When configured with --with-gmp both the normal (fast) eval()
4228         and the gmp aware mpeval() are defined.  To restore previous
4229         bahaviour use "define(`eval', defn(`mpeval'))".
4231         * tests/other-tests/gmp.m4: Changed to use mpeval().
4233         * src/evalmp.c: New file for compiling eval.c as gmp aware.
4234         Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
4236         * src/eval.c: Now includes "numb.c" directly.  Everything in this
4237         file must by static, except evaluate(), which is changed to
4238         mp_evaluate() if USE_GMP in force.
4240         * src/numb.c: Changed to be included by eval.c instead of being
4241         compiled separately.  Everything is declared static.
4243         * src/numb.h: Removed declarations of functions, as numb.c is now
4244         included by eval.c.
4246         * src/builtin.c: Declaration of m4_mpeval() added.
4247         Inserted `mpeval' in builtin table.
4248         (do_eval): New function with common code for m4_eval and m4_mpeval.
4249         (m4_mpeval): New function for gmp version of eval.
4251         * src/m4.h: Declaration of mp_evaluate().
4253         * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
4254         (EXTRA_m4_SOURCES): Now has numb.c and numb.h
4256         * src/m4.c (main): m4 --version also shows which options were used
4257         for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
4259 1998-11-27  Rene' Seindal  <rene@seindal.dk>
4261         * Error messages now always print program name before input file
4262         name as specified by GNU coding standards.  Reported by Akim
4263         Demaille <demaille@inf.enst.fr>.
4265         * doc/m4.texinfo (Include): Change due to changed error message
4266         format.
4267         (Eval): Do.
4269         * tests/get-them: Minor change to sed script due to changed error
4270         message format.
4272         * src/m4.c (print_program_name): New func used to print program
4273         name, input file and line number in error ().  Used as an
4274         error_print_progname handler.
4275         (reference_error): Removed.
4276         (main): Assigns error_print_progname.
4278         * src/m4.h (M4ERROR): Removed reference_error ().
4280 1998-11-25  Rene' Seindal  <rene@seindal.dk>
4282         * Updated to libtool 1.2b.
4284         * src/builtin.c (install_builtin_table): Added braces to avoid
4285         warning of ambiguous 'else'.
4287         * src/module.c: Inserted search path code from path.c modified to
4288         use new interface.
4289         (module_init): Configured default path used only if M4MODPATH is
4290         not set.
4291         (module_try_load): Now reads libMODULE.la as generated by libtool
4292         for actual module name.
4293         (module_load): Gives better error messages on failure.
4295         * src/m4.h: Added declarations of structures and functions for
4296         generic search path handling.
4298         * src/path.c: Removed all module specific code and introduced new
4299         functions of more generic search path handling.
4301 1998-11-24  Rene' Seindal  <rene@seindal.dk>
4303         * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
4304         included gettext, as <libintl.h> might not be found
4305         otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
4307 1998-11-22  Rene' Seindal  <rene@seindal.dk>
4309         * src/output.c (insert_diversion): Fixed bug that might cause m4
4310         to read from standard output!  Triggered by input
4311         'divert(1)undivert(0)'.  Test for divnum>0 changed to divnum>=0,
4312         so now 'undivert(0)' does nothing.
4314 1998-11-18  Rene' Seindal  <rene@seindal.dk>
4316         * Prerelease 1.4m.
4318         * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
4319         could be changed when compiling a illegal regexp, causing later
4320         use of the regexp to dump core.
4322         * src/module.c (module_load): Changed error message to conform to
4323         standards.
4325         * src/m4.c (usage): Added message about reporting bugs.
4327         * doc/m4.texinfo (Changeword): Corrected a wrong example.
4328         (Changeword): Added note about the type of regexps used.
4330         * ltconfig, ltmain.sh: New files from Libtool 1.2.
4332         * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
4333         and AM_PROG_LIBTOOL.
4335         * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
4336         with libtool.
4338         * modules/Makefile.am: Changed completely to compile modules using
4339         libtool.  The modules are compiled as shared libraries, and are
4340         renamed when installed.
4342         * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
4343         USE_SHL_LOAD to HAVE_SHL_LOAD
4345         * src/builtin.c (shipout_string): Now tests for a NULL string.
4347         * src/module.c: New level of indirection around non-portable
4348         functions to load shared objects.  Intended to encapsulate the non
4349         portable parts better and to reduce the number of #ifdefs in the
4350         code.
4352         * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
4353         directory modules/ to the distribution.
4355 1998-11-15  Rene' Seindal  <rene@seindal.dk>
4357         * Prerelease 1.4l.
4359         * modules/stdlib.c: New module `stdlib' defining some standard
4360         functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
4361         getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
4363         * src/builtin.c (shipout_string): New convenience function for
4364         builtins and modules.
4366         * src/module.c (module_load): Tentative support for
4367         shl_load/shl_findsym, but I cannot test it.  Copied from MetaHTML.
4369         * Makefile.am (SUBDIRS): Directory modules added if configured.
4371         * modules/Makefile.am: Now correctly compiles and installs
4372         modules in pkglibexecdir.
4374         * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
4375         These two are now initialised by autoconf macros.
4377         * src/path.c (module_env_init): MODULE_PATH is always on the
4378         search path.
4380         * src/Makefile.am: Now generated pathconf.h which defined the
4381         default MODULE_PATH.
4383         * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
4384         where modules are installed.
4386         * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
4387         by Brian J. Fox <bfox@datawave.net>.  This change allow modules to
4388         build and install automatically, and it is prepared for other
4389         interfacec than dlopen().
4391         * src/builtin.c (predefined_tab): Added __m4_version__ for the
4392         current version of GNU m4.  It is a GNU extension.
4394 1998-11-14  Rene' Seindal  <rene@seindal.dk>
4396         * tests/Makefile.am (GENERATED_TESTS): Added new
4397         generated-tests/changesy.8.test
4399         * doc/m4.texinfo (Changesyntax): Documentation for escape
4400         syntax class.
4402         * src/macro.c (expand_token): Check for escaped macro call before
4403         symbol table lookup.
4405         * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
4406         characters
4408         * src/input.c: New static variable use_macro_escape, which is TRUE
4409         iff some character has code SYNTAX_ESCAPE
4410         (input_init): Added initialisation of use_macro_escape.
4411         (check_use_macro_escape): New function to synchronise
4412         use_macro_escape with the syntax table.
4413         (set_quotes): Added call to check_use_macro_escape()
4414         (set_comment): Do.
4415         (set_syntax): Do.
4416         (next_token): Added new case for IS_ESCAPE.
4418         * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
4420 1998-10-13  René Seindal  <rene@seindal.dk>
4422         * Prerelease 1.4k.
4424         * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
4425         generated-tests.
4427         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
4428         maintained tests in tests/other-tests.  These currently tests for
4429         8-bit transparency, multiple precision arithmetic and sync-line
4430         output.  Test for stackoverflow detection does not work.
4432         * examples/Makefile.am (TESTS): Added tests for all example files.
4434         * examples/mktests.sh: New file.  Help program for creating test
4435         files.
4437         * tests/mkconfig.sh: New file to generate tests/config.m4 and
4438         tests/config.sh.  This is for tests of configure selectable
4439         features.  Picks up all set WITH_ and ENABLE_ veriables from
4440         config.h
4442         * src/path.c (path_search): Added argument 'char **expanded_name'
4443         to return the expanded name.
4445         * src/m4.h: Added 2nd argument to declaration of path_search().
4447         * src/m4.c (main): Added 2nd argument to path_search().
4449         * src/freeze.c (reload_frozen_state): Do.
4451         * src/builtin.c (m4_undivert): Do.
4452         (include): Do.
4454 1998-10-11  René Seindal  <rene@seindal.dk>
4456         * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
4458         * acm4/modules.m4: New file.  Defines AM_WITH_MODULES.
4460         * acm4/gmp.m4: New file.  Defines AM_WITH_GMP.
4462         * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
4464         * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
4466         * intl/: Updated to GNU gettext 0.10.35.
4468         * doc/m4.texinfo (Format): Documented that format is blind.
4470         * src/builtin.c (builtin_tab): Builtin format marked as blind.
4472 1998-10-07  René Seindal  <rene@seindal.dk>
4474         * Prerelease 1.4j.
4476         * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
4477         .test, as the files are no longer just m4 input.
4479         * tests/get-them (FILE): Changed .m4 extension to .test.
4481         * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
4482         Otherwise quoted strings with leading whitespace first in a macro
4483         argument would be eliminated.
4485         * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
4486         (expand_argument): Do.
4488         * src/input.c (next_token): SPACE and NUM/OTHER characters are only
4489         grouped together iff both quote and comment strings are single
4490         character.  Otherwise they might include a comment/quote leader.
4491         (next_token): Returns new token type TOKEN_SPACE.
4493         * src/builtin.c (push_builtin_table): New function to push a
4494         builtin_table on the stack without installing its contents.
4495         (find_builtin_by_name): Added call to push_builtin_table() if
4496         reading frozen files.  Otherwise the builtins named in the frozen
4497         files could not be found.
4498         (install_builtin_table): Changed to use push_builtin_table()
4500 1998-10-04  René Seindal  <rene@seindal.dk>
4502         * Prerelease 1.4i.
4504         * configure.in (ALL_LINGUAS): Added Polish pl.po
4506 1998-10-03  René Seindal  <rene@seindal.dk>
4508         * Many files: Incorporated changes to implement dynamic modules.
4509         Detailed comments in src/modules.c and modules/README
4511         * src/module.c: New file, implements the OS dependant parts of
4512         dynamic module loading.
4514         * src/Makefile.am (m4_SOURCES): Added module.c
4516         * src/builtin.h: New file, declares some functions from builtin.c
4517         that are of use for other modules (shipout_int, numeric_arg,
4518         skip_space, bad_argc), and the macros ARG() and DECLARE().
4520         * src/builtin.c (install_builtin_table): New function.  Each
4521         module brings in a builtin_table, which is pushed on a stack.
4522         (struct builtin_table): New struct for list of builtin_tables.
4523         (m4_loadmodule): New function to implement builtin "loadmodule".
4524         (shipout_int): No longer static, to be used by modules.
4525         (numeric_arg): do.
4526         (skip_space): do.
4527         (bad_argc): do.
4528         (builtin_init): changed to call install_builtin_table()
4529         (find_builtin_by_name): Now searches all builtin_tables
4530         (find_builtin_by_addr): do.
4532         * src/path.c: Reorganised to allow for two search paths, one for
4533         include files and one for modules.
4535         * src/m4.h: Added declarations for new functions in module.c and
4536         in path.c.
4538         * src/m4.c (main): Added call to module_init().
4540         * modules: New directory with a few demo modules.
4542         * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
4543         in SUBDIRS.
4545         * configure.in: Added modules/Makefile to AC_OUTPUT.
4547         * configure.in: Added code to implement --with-modules.  Tests for
4548         <dlfcn.h> and -ldl.
4550         * acconfig.h: Added WITH_MODULES
4552 1998-10-02  René Seindal  <rene@seindal.dk>
4554         * examples/Makefile.am (pkgdata_DATA): Removed special target for
4555         check and variables TESTS.  These tests are now run from the
4556         tests/ directory.
4558         * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
4559         directory.  The files stay there but the tests are run from the
4560         tests/ directory.
4562         * tests/Makefile.am (EXTRA_DIST): Added run-test.
4564         * tests/run-test: New file.  Run a test manually
4566         * tests/Makefile.am, tests/get_them: Moved automatically generated
4567         tests (from the manual) to sub directory tests/gentest/.  The
4568         tests/ directory had gotten a bit messy.
4570 1998-09-06  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
4572         * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
4573         wrap}.test: Added a few testcases.
4575 1998-08-21  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
4577         * Prerelease 1.4h.
4579         * lib/Makefile.am (noinst_HEADERS): regex.h added
4581         * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
4582         acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
4584         * acm4/Makefile.am: created providing rules to create
4585         $(top_srcdir)/acinclude.m4 to be used by aclocal.
4587         * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
4588         `C'. Reported by Ulrich Drepper.
4590         * Makefile.am (SUBDIRS): Removed checks directory
4591         * configure.in (AC_OUTPUT): Removed checks/Makefile
4593         * doc/m4.texinfo (Patsubst,example): @comment added to preserve
4594         the space when m4.texinfo is edited and whitespace.el is active.
4595         (Defn,example): idem.
4597 1998-08-20  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
4599         * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
4600         ../COPYING. ../Makefile is a file which is certainly present when
4601         test is executed in testSubDir. One can't be sure that the COPYING
4602         file is in .. or ../.. in all situations, the ../Makefile is
4603         always there.
4605         * doc/m4.texinfo (Include): adjusted expected test output
4606         according to new tests, i.e. the input will always come from the
4607         file `in' created by the test.
4609         * tests/Makefile.am: Added three lines at the top to get
4610         esyscmd.1.test working.
4612         * tests/get-them: modified to generate clearer tests who will need
4613         less maintenance when new test examples are created in
4614         `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
4615         need the generic file `defs') shell scripts creating `in', `ok',
4616         `out' and when apropriate `okerr' and `err' in the directory
4617         `testSubDir' when executed. The compare of `ok' and `out'
4618         (and of `okerr' and `err') will be the exit status of the test.
4619         `out' must match `ok' (and `okerr' must match `err') for the test
4620         to be succesful.
4622         * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
4623         the tests generated by tests/get-them getting it input normally
4624         from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
4625         (dot) before the numeric part) is reserved for all other (hand
4626         written) tests. The `+' means one or more times.
4628 1998-08-12  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
4630         * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
4631         supported short man page to refer to info documentation
4632         * helptoman.pl: added
4633         * configure.in: AC_PATH_PROG(PERL,perl)
4634         * Makefile.am (SUBDIRS): doc after src
4636         * libitized with libit 0.5 from
4637         ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
4639         * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
4640         * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
4641          replacement functions, (libm4_a_LIBADD): @LIBOBJS@
4642         * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
4643           lib/rx.{c,h}: added
4644         * configure.in (AC_CHECK_FUNC): getopt_long
4646         * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
4648         * TODO: added entry about dependencies
4650 1998-08-10  René Seindal  <rene@seindal.dk>
4652         * Prerelease 1.4f
4654         * doc/m4.texinfo (Changesyntax): Added documentation for the macro
4655         "changesyntax".
4657         * src/builtin.c (m4_changesyntax): Added builtin macro
4658         "changesyntax" to modify the syntax table.
4660         * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
4661         table.  All categories are assigned a syntax code and tokens are
4662         read according to this table.
4664 1998-08-09  René Seindal  <rene@seindal.dk>
4666         * src/numb.{c,h}: New files, implements multiple precision eval
4667         using GNU gmp.  Originally submitted by John Gerard Makecki
4668         (johnm@vlibs.com), later modified.  Tested with GNU gmp 2.0.2.
4670         * doc/m4.texinfo (Eval): Added documentation for multiple
4671         precision arithmetic library support.
4673         * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
4674         to accommodate multiple precision eval.
4676 1998-08-07  René Seindal  <rene@seindal.dk>
4678         * src/input.c (MATCH, match_input), src/m4.h: changed definition
4679         of comment and quote strings to `unsigned int' to allow eight bit
4680         chars (reported by andrewb@zip.com.au (Andrew Bettison)).
4682         * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
4683         patch from Mike Howard <mike@clove.com>
4685 1998-08-06  René Seindal  <rene@seindal.dk>
4687         * gettext.m4: corrected AM_WITH_NLS to handle use of installed
4688         -lintl.
4690 1998-08-03  René Seindal  <rene@seindal.dk>
4692         * Prerelease 1.4e
4694         * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
4695         and _ macro.  M4 now builds with --disable-nls.
4697         * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
4698         to look for right message catalogs.  Call indef'ed by ENABLE_NLS.
4700         * configure.in (ALL_LINGUAS): Added complete list of translations:
4701         de fr it ja nl ru sv.
4703 1998-05-22  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
4705         * Prerelease 1.4d.
4707         * src/m4.c: #include <signal.h> not <sys/signal.h>.
4709         * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
4711         * checks/Makefile.am: explicit list tests in CHECKS.
4713         * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
4714         src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
4715         mkinstalldirs, install-sh: Added automake (1.3) support.
4717         * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
4718         obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
4719         Used libitize (0.4) to update.
4721         * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
4722         (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
4723         README accordingly.
4725         * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
4726         stack overflow functionality.
4728 1994-12-03  François Pinard  <pinard@iro.umontreal.ca>
4730         * Prerelease 1.4.1.
4732         * Makefile.in (realclean-local): Delete stamp-h.in.
4734         * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
4735         Localize, adapting from how it is done in sharutils.
4737         * fr.tt: New file, for French.
4739         * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
4740         src/freeze.c: Rename PRODUCT to PACKAGE.
4742 1994-11-26  François Pinard  <pinard@iro.umontreal.ca>
4744         * configure.in: Check for <libintl.h> and <locale.h>.
4745         * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
4746         src/stackovf.c: Rename _ to __P.
4747         * src/m4.h: Declare _ as a macro returning its argument, or else,
4748         include <libintl.h> and declare _ as gettext.
4749         * src/m4.c: Possibly include <locale.h> and call setlocale.
4750         * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
4751         src/input.c, src/macro.c, src/output.c, src/path.c,
4752         src/stackovf.c, src/symtab.c: Use _ macro over all localizable
4753         strings.
4755 1994-11-07  François Pinard  <pinard@iro.umontreal.ca>
4757         * doc/Makefile.in (stamp-vti): Use new -r option to date.
4759         * configure.in: Put --with-gmp in place, in prevision for John
4760         Gerard's work.
4761         * acconfig.h: Document WITH_GMP.
4763 1994-11-05  François Pinard  <pinard@iro.umontreal.ca>
4765         * Release 1.4.
4767         * doc/Makefile.in (realclean): Also remove stamp-vti.
4768         Reported by Eric Backus.
4770 1994-11-02  François Pinard  <pinard@iro.umontreal.ca>
4772         * src/freeze.c (produce_frozen_state): If the frozen file cannot
4773         be opened, return immediately after producing the error message.
4774         Reported by Andreas Schwab.
4776         * configure.in: Check for const only after having found possible
4777         ANSIfying compiler flags, this is of no use to check it before.
4778         Reported by Alexander Lehmann.
4780 1994-11-01  François Pinard  <pinard@iro.umontreal.ca>
4782         * src/macro.c (collect_arguments): Cast obstack arguments to
4783         (voidstar), so avoiding compiler warnings.
4784         Reported by Joseph E. Sacco.
4786         * src/freeze.c (produce_frozen_state): Cast printed lengths to
4787         (int) so they correspond to %d format items.
4788         Reported by Joseph E. Sacco.
4790         * src/m4.c (main): Cast the argument to xfree to (voidstar).
4791         * src/symtab.c (free_symbol): Idem.
4792         Reported by Karl Vogel.
4794 1994-10-31  François Pinard  <pinard@iro.umontreal.ca>
4796         * Makefile.in (DISTFILES): Distribute BACKLOG.
4798         * configure.in: Define PRODUCT and VERSION.
4799         * acconfig.h: Document PRODUCT and VERSION.
4800         * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
4801         constant string m4 and variable or parameter named version.
4803 1994-10-30  François Pinard  <pinard@iro.umontreal.ca>
4805         * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
4806         __STDC__.  Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
4807         defines __STDC__ to 0, for indicating it is *not* ANSI!
4808         Reported by Kaveh R. Ghazi.
4810         * configure.in: Added obsolescent tests for AIX and Minix.
4812         * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
4813         which texclean does not exist anymore.
4814         Reported by Eric Backus, Jim Meyering, John David Anglin and
4815         Joseph E. Sacco.
4817 1994-10-29  François Pinard  <pinard@iro.umontreal.ca>
4819         * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
4820         Reported by John David Anglin.
4822         * src/ansi2knr.c: New version, sent by Peter Deutsch.
4823         * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
4824         ANSI2KNR, depending on the fact the compiler is ANSI or not.
4825         * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
4826         Remove the sed filter after ansi2knr for debug.c.  Use $O instead
4827         of $U, put underline in extensions rather than in basenames.  Use
4828         implicit rules, now that regularity makes this possible.
4829         Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
4830         of ansi2knr whenever it is needed.
4831         * configure.in: Adjusted for correct STACKOVF substitution.
4832         * src/debug.c (trace_format): When not __STDC__, use (...) as a
4833         parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
4834         Reported by David MacKenzie.
4836         * Makefile.in: Remove binprefix.  Use transform_name instead.
4837         Reported by David MacKenzie.
4839         * doc/Makefile.in: Create version.texi, use it, clean it.
4840         Reported by Jim Meyering.
4842 1994-10-28  François Pinard  <pinard@iro.umontreal.ca>
4844         * Makefile.in (all, install, uninstall): Depend on Makefile.
4846         * Makefile.in: For actions invoking $(MAKE) from within compound
4847         sh statements, exit non-zero if the sub-make fails.  Otherwise,
4848         the top-level make may exit successfully when it should fail.
4849         Reported by Jim Kingdon.
4851         * {,/*}Makefile.in: Use && after all cd, in case they fail.
4853         * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
4854         (dist): Use PRODUCT and VERSION instead of tricks on .fname.
4855         * configure.in: Substitute PRODUCT and VERSION.
4857         * {,*/}Makefile.in (dist): Always try a hard link before a copy.
4859 1994-10-27  François Pinard  <pinard@iro.umontreal.ca>
4861         * Makefile.in (mostlyclean-local): Do not remove *~.
4862         * */Makefile.in (mostlyclean): Idem.
4863         Reported by Robert E. Brown and Richard Stallman.
4865 1994-10-09  François Pinard  <pinard@iro.umontreal.ca>
4867         * src/m4.h: Get rid of CONFIG_BROKETS.
4869 1994-10-02  François Pinard  <pinard@iro.umontreal.ca>
4871         * configure.in: Use AC_ARG_PROGRAM.
4872         * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
4873         Reported by David MacKenzie.
4875 1994-10-01  François Pinard  <pinard@iro.umontreal.ca>
4877         * configure.in: Do not add -O to CFLAGS for GNU C, now that
4878         configure does it automatically.
4879         Reported by Jim Meyering.
4881 1994-09-23  François Pinard  <pinard@iro.umontreal.ca>
4883         * src/stackovf.c: Declare the handler_t typedef earlier in the
4884         code, use it for stackovf_handler.
4885         (setup_stackovf_trap): Use RETSIGTYPE instead of void while
4886         casting sigsegv_handler.
4887         Reported by Robert Bernstein.
4889         * src/m4.c (main): Initialize program_name to argv[0] without
4890         basename'ing it.
4891         Reported by Karl Berry.
4893 1994-09-18  François Pinard  <pinard@iro.umontreal.ca>
4895         * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
4896         Reported by Karl Berry.
4898 1994-09-14  François Pinard  <pinard@iro.umontreal.ca>
4900         * lib/Makefile.in (mostlyclean): Added.
4901         (TAGS): Make in $(srcdir).
4903         * configure.in: Use `choke me' in test, like everywhere!
4905         * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
4906         unreacheable and useless.
4908         * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
4910         * lib/Makefile.in (DISTFILES): Distribute TAGS.
4911         (distclean): Do not remove TAGS.
4912         (realclean): Remove it.
4913         * Makefile.in: Make TAGS in lib also, not just in src.
4914         Reported by Karl Berry.
4916         * Makefile.in (distclean, realclean): Instead of recursively
4917         calling $(MAKE) for the -local part, allow parallel execution of
4918         -recursive and -local, only delay the removal of config.status,
4919         which is repeated in both goals.
4921 1994-09-13  François Pinard  <pinard@iro.umontreal.ca>
4923         * Release 1.3.
4925         * Makefile.in: Group all *clean-recursive goals in one, using sed
4926         to remove `-recursive' while calling make recursively.  Also, use
4927         a subshell for each recursive $(MAKE).
4928         Reported by Jim Meyering.
4930         * src/m4.h (memcpy): Define with bcopy for BSD systems.
4931         Reported by Kaveh R. Ghazi.
4933         * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
4934         4.1.3 requires -ldl to link even ansik2nr, and we need a way to
4935         specify it.
4937         * configure.in: Use date instead of touch for stamp-h.
4938         * Makefile.in (stamp-h.in): Idem.
4940         * Makefile.in (distclean, realclean): Force serial execution of
4941         both goals, in case parallel makes are being used.
4942         Reported by Jim Meyering.
4944         * src/Makefile.in (DISTFILES): Distribute TAGS.
4945         (distclean): Do not remove TAGS.
4946         (realclean): Remove it.
4947         Reported by Karl Berry.
4949 1994-09-10  François Pinard  <pinard@iro.umontreal.ca>
4951         * configure.in: Use fp_ to match aclocal.m4.  Revert _OS_ macros
4952         to old names, for following Autoconf.
4954 1994-09-08  François Pinard  <pinard@iro.umontreal.ca>
4956         * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
4957         ./install.sh will not be correctly referred to in sub-Makefiles.
4958         Reported by John David Anglin.
4960         * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
4961         Reported by Eric Backus.
4963         * Makefile.in, checks/Makefile.in, doc/Makefile.in,
4964         examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
4965         config.status into remaking this directory's Makefile only.
4966         * Makefile.in (stamp-h): Do not check nor touch stamp-h.
4967         * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
4968         Reported by Jim Meyering.
4970 1994-09-06  François Pinard  <pinard@iro.umontreal.ca>
4972         * configure.in: Correct stack overflow detection logic, taking
4973         care of systems having only incomplete implementations (like for
4974         Pyramid 9820 OSx 5.0d).
4975         Reported by Kaveh R. Ghazi.
4977         * src/Makefile.in (TAGS): Remote -t from etags call.
4979 1994-09-02  François Pinard  <pinard@iro.umontreal.ca>
4981         * lib/Makefile.in (install): Depend on all.
4983 1994-08-31  François Pinard  <pinard@iro.umontreal.ca>
4985         * examples/Makefile.in (mostlyclean): Do not depend on texclean.
4986         Reported by Jim Meyering and John David Anglin.
4988         * Makefile.in (distclean-local): Delete config.log.
4989         Reported by Jim Meyering.
4991         Solidify frozen files with respect to -P:
4992         * src/m4.c: Have -P set prefix_all_buitins variable instead of
4993         calling a function by that name.  Declare the variable.
4994         * src/m4.h: Adjust declaration for prefix_all_buitins.
4995         * src/builtin.c (builtin_init): Merge in functionality from
4996         previous prefix_all_buitins function, while making entries in the
4997         symbol table, but not modifying the builtin description itself.
4999         * src/freeze.c (reload_frozen_state): Add a useless `break;',
5000         because *many* compilers do not accept an empty `default:'.
5001         Reported by Akiko Matsushita, Eric Backus, John David Anglin,
5002         Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
5004         * configure.in: Use AC_TYPE_SIGNAL.
5005         * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
5006         Reported by Robert Bernstein.
5008         * checks/Makefile.in (check): Modify PATH so check-them will find
5009         m4 in the src directory.
5010         * Makefile.in (check): Don't.
5011         Reported by Akiko Matsushita and Jim Meyering.
5013         * src/output.c (make_room_for, output_character_helper): New
5014         functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
5015         a per buffer MAXIMUM_BUFFER_SIZE.
5017         * src/output.c (output_text): New function, for optimizing the
5018         output of strings of characters.  Use it.
5020 1994-08-30  François Pinard  <pinard@iro.umontreal.ca>
5022         * doc, src: New directories reorganizing the distribution.
5023         * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
5024         files.
5025         * Makefile.in: Adjusted.
5026         * configure.in: Configure new Makefiles.
5028         * m4.h: Declare STRING typedef.  Use it for comment and quote
5029         strings, adjusting all references.  (This is the rudiments of a
5030         beginning for the eventual withdrawal of NUL terminated strings.)
5031         * output.c (shipout_text): Accept a length parameter, and use it.
5032         All callers adjusted.
5034 1994-08-29  François Pinard  <pinard@iro.umontreal.ca>
5036         * m4.h: Include <unistd.h> if it exists.
5037         * stackovf.c: Don't.
5039         Clean up for current_diversion variable:
5040         * output.c: Move current_diversion from builtin.c.
5041         * m4.h: Declare current_diversion so builtin.c can access it.
5042         * output.c (output_init, make_diversion): Initialize or update
5043         current_diversion.
5044         * builtin.c (builtin_init, m4_divert): Leave current_diversion
5045         alone.
5047         Remove limit on number of diversions:
5048         * output.c: Replace ndiversion by diversions, declare it.
5049         (output_init): Allocate only diversion 0.
5050         (make_diversion): Allocate new diversions as needed.
5051         * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
5052         * m4.c: Still accept -N, but do nothing with it.
5053         Reported by David MacKenzie.
5055         Freeze diversions:
5056         * output.c (freeze_diversions): New function.
5057         * m4.h: Declare freeze_diversions.
5058         * freeze.c: Document frozen file format, revise it, call
5059         freeze_diversions to add diversions to frozen format, and code to
5060         reload them properly.
5061         * m4.c: Do not undivert automatically at end when status being
5062         frozen.  Do not call builtin_init when reloading frozen state.
5064         Speed up diversion processing:
5065         * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
5066         COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
5067         structure and variables, cached variables out of output_diversion,
5068         reallocate_diversion_for and OUTPUT_CHARACTER.
5069         (shipout_text, make_diversion, insert_diversion): Adapted to new
5070         structures.
5071         (insert_file): Use better buffering.
5072         Reported by David MacKenzie.
5074 1994-08-28  François Pinard  <pinard@iro.umontreal.ca>
5076         * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
5077         dist works from another build directory.
5079 1994-08-27  François Pinard  <pinard@iro.umontreal.ca>
5081         * symtab.c (hack_all_symbols): Use hash_table_size instead of
5082         constant HASHMAX, for -H option to work better.
5084         * builtin.c (DECLARE): Simplify by using _ ().
5086         * freeze.c: New file.
5087         * Makefile.in: Compile it, distribute it.
5088         * m4.c: Recognize, document and process --freeze-state (-F) and
5089         --reload-state (-R) options.  Pass a true flag to builtin_init
5090         only if no reloading some state.
5091         * builtin.c (define_builtin): Remove static specifier.
5092         (find_builtin_by_name): Remove static specifier.
5093         (builtin_init): Accept and obey a flag argument.
5094         * m4.h: Add declarations for freeze.c, changes for builtin.c.
5096 1994-08-24  François Pinard  <pinard@iro.umontreal.ca>
5098         * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
5099         specifier.
5101         * configure.in: Implement --with-dmalloc.
5102         * acconfig.h: Document WITH_DMALLOC.
5103         * m4.h: Add code for when WITH_DMALLOC.
5105 1994-08-15  François Pinard  <pinard@iro.umontreal.ca>
5107         * m4.c (long_options): Use "error-output", the dash was missing.
5108         Reported by Akiko Matsushita.
5110 1994-08-12  François Pinard  <pinard@iro.umontreal.ca>
5112         * m4.h: Include <sys/types.h>.
5113         * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
5114         * m4.h: Declare len_lquote and len_rquote as size_t, not int.
5115         int.
5116         * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
5117         as size_t, not int.
5118         * builtin.c (dump_args): Declare len as size_t, not int.
5120         * debug.c: Prototype the forward declaration of debug_set_file.
5122         * builtin.c (m4_undivert):  Replace div by file, for avoiding the
5123         shadowing of this variable.
5124         * output.c (insert_diversion): Idem.
5126         * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
5127         (input_init): Duplicate default quote and comment strings.
5128         (set_quotes): Free previous quote strings in all cases.  Duplicate
5129         even default quote strings.
5130         (set_comment): Free previous comment strings in all cases.
5131         Duplicate even default comment strings.
5133         * configure.in: Updated for Autoconf 2.0.
5134         * Makefile.in (distclean-local): Also delete config.cache.
5136         * m4.c (usage): Reorganize the --help output by topic.  Include a
5137         description for debugging flags.
5139 1994-07-29  François Pinard  <pinard@iro.umontreal.ca>
5141         * configure.in: If sigaction is available and SA_ONSTACK defined,
5142         use sigaction.  Otherwise, if sigvec is available and SV_ONSTACK
5143         defined, use sigvec.  Else don't compile stackovf.c.
5144         * stackovf.c (setup_stackovf_trap): Idem.
5145         Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
5146         and Simon Leinen.
5148 1994-07-21  François Pinard  <pinard@iro.umontreal.ca>
5150         * m4.c (usage): Replace printf par fputs.
5152 1994-07-18  François Pinard  <pinard@iro.umontreal.ca>
5154         * Release 1.2
5156 1994-07-17  François Pinard  <pinard@iro.umontreal.ca>
5158         * configure.in: Check for sigaction and sigvec.  Add a new delayed
5159         check for RLIMIT_STACK, combine in the checking for getrlimit.
5160         All those things are not universally available.
5161         * stackovf.c: Split setting up the trap handler and catching
5162         signals, for better taking care of various configure outcomes.
5163         * examples/stackovf.sh: Correct a typo.
5164         Reported by Eric Backus, Jim Avera and Jim Meyering.
5166 1994-07-16  François Pinard  <pinard@iro.umontreal.ca>
5168         * ansi2knr.c: New version sent by its author, Peter Deutsch.
5170 1994-07-15  François Pinard  <pinard@iro.umontreal.ca>
5172         * Makefile.in: Modify so parallel make will not try making
5173         lib/libm4.a twice simultaneously.
5174         Reported by Jim Meyering.
5176 1994-07-14  François Pinard  <pinard@iro.umontreal.ca>
5178         * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
5179         error message, for when no code possibility exists.  Even if this
5180         line is completely #ifdef'ed out, it brings a syntax error.
5181         Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
5183         * Makefile.in (install): Have install depend on all too, for lib
5184         to be remade as needed.
5186         * examples/stackovf.sh: Try ksh, bsh and bash for shells
5187         providing ulimit, instead of using only ksh.
5188         Reported by Jim Avera and Joseph E. Sacco.
5190 1994-07-12  François Pinard  <pinard@iro.umontreal.ca>
5192         * Makefile.in (check): Have it depend on all instead of m4.  In
5193         this way, a change in lib will be detected and processed.
5195         * builtin.c (numeric_arg): Use strtol and verify the conversion,
5196         instead of using sscanf which stops as soon as there is a
5197         non-digit in the input.  Previously, incr(1xyzzy), eval(1,2xyzzy)
5198         and divert(1xyzzy) were all accepted without any warning or error
5199         messages.
5200         * m4.h: Declare strtol as long if not including stdlib.h.
5201         * configure.in: Check for limits.h, and replace strtol if missing.
5202         * lib/Makefile.in: Substitute LIBOBJS.  Distribute strtol.c.
5203         * lib/strtol.c: New file, from elsewhere.
5204         Reported by Andreas Schwab.
5206 1994-07-07  François Pinard  <pinard@iro.umontreal.ca>
5208         * macro.c (expand_macro): Cast value to (boolean) prior to
5209         assigning it to traced.
5210         Reported by Tom McConnell.
5212         * Makefile.in (m4): Always make all in lib first.
5213         Reported by Jim Meyering.
5215 1994-07-06  Jim Avera <jima@netcom.com>
5217         * stackovf.c: Isolated OS-dependent sections; Improved portability,
5218         adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
5219         handlers), and a default error message if the fault address is not
5220         available (when neither siginfo.h nor BSD sigcontext are supported).
5221         * configure.in: Changes for stackovf.h: Check for sigcontext,
5222         sigaction, sigstack, and define rlim_t as int if necessary.
5223         * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
5224         * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
5225         * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
5227 1994-07-05  François Pinard  <pinard@iro.umontreal.ca>
5229         * configure.in: Use AC_SET_MAKE.
5230         * Makefile.in: Use @SET_MAKE@.
5231         Reported by Jim Meyering.
5233         * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
5234         Reported by Ian Taylor.
5236 1994-07-02  François Pinard  <pinard@iro.umontreal.ca>
5238         * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
5239         because siginfo.h is unrelated to standard headers, and siginfo.h
5240         is already checked for.
5241         Reported by Joseph E. Sacco.
5243         * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
5244         PROTOTYPES.
5245         * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
5246         AC_PROTOTYPES.
5248 1994-06-29  François Pinard  <pinard@iro.umontreal.ca>
5250         * builtin.c (substitute): Use \& to represent this part of the
5251         string which was matched by the whole regexp, instead of
5252         representing the whole string.  Any usage of \0 issues a warning
5253         and acts like \&, it will disappear in some subsequent release.
5255 1994-06-27  François Pinard  <pinard@iro.umontreal.ca>
5257         * m4.c: Complete prototype for forwarded declaration of usage.
5259         * input.c (init_macro_token): Correct own reference in error
5260         message.  Previous name get_macro_func was referred to instead.
5261         (next_char):  Correct own reference in error message.  Previous
5262         name advance_input was referred to instead.
5264         * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
5265         * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
5266         and_term, not_term, logical_not_term, cmp_term, shift_term,
5267         add_term, mult_term, exp_term, unary_term, simple_term): Add
5268         prototype to forwarded declarations.  Declare parameter v1 as
5269         eval_t * instead of int *.  Same for local variable v2 in dyadic
5270         functions.  Same for result in exp_term.
5271         * builtin.c (m4_eval): Declare value as eval_t instead of int.
5272         (ntoa): Declare value as eval_t instead of int.  Declare uvalue as
5273         unsigned_eval_t instead of unsigned int.  Change casts accordingly.
5274         (shipout_int): Cast first argument of ntoa to eval_t.
5275         Reported by Thorsten Ohl.
5277         * macro.c: Complete the prototypes of forwarded expand_macro and
5278         expand_token.
5279         Reported by Thorsten Ohl.
5281         * m4.h: Define voidstar as void * or char * depending on __STDC__.
5282         The Ultrix 3.1 compiler cannot do much with void pointers.
5284         * builtin.c (dumpdef_cmp): Replace void * by voidstar.
5285         * m4.c (xfree):  Replace void * by voidstar.
5286         Reported by Tom McConnell.
5288         * ansi2knr.1: New, from elsewhere.
5289         * Makefile.in (DISTFILES): Distribute ansi2knr.1
5291         * Makefile.in (stamp-h.in): Avoid running ./config.status if
5292         stamp-h does not exist yet.  This avoids running it a second time
5293         just after the initial ./configure.
5294         Reported by David MacKenzie and Tom McConnell.
5296         * m4.h: Replace the enum debug_info declaration with a series of
5297         #define's.  The Ultrix 3.1 compiler would otherwise need casting
5298         (int) to most references, when used in expressions.
5299         Reported by Tom McConnell.
5301 1994-06-25  François Pinard  <pinard@iro.umontreal.ca>
5303         * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
5304         following an idea from Brook G. Milligan.  AC_HAVE_PROTOTYPES
5305         calls the compiler.  Previously, FP_PROTOTYPES was only calling
5306         the preprocessor; by not being subject to CFLAGS, this was
5307         discouraging those flags asking for ANSI compilation.
5308         * acconfig.h: Document HAVE_PROTOTYPES.
5309         * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
5310         * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
5311         Reported by Eric Backus.
5313         * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
5314         from the environment.  Default CFLAGS to -g if not set.
5315         * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
5316         * lib/Makefile.in: Have CFLAGS substituted from configure.
5317         Reported by Eric Backus and Tom McConnell.
5319         * configure.in: m4_undefine changeword before using AC_ENABLE.
5321         * m4.h: Declare prototypes for error (for ANSI compilers only),
5322         prefix_all_builtins and reference_error.
5323         Reported by Tom McConnell.
5325         * input.c (set_word_regexp): Do not try to initialize the array
5326         test from a string, this does not work with non-ANSI compilers.
5327         Reported by Eric Backus.
5329         * Makefile.in (dist): Clean examples/ before saving it.
5330         (distclean-local): Also remove stamp-h.
5331         Reported by Eric Backus.
5333         * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
5334         non ANSI compilers.
5335         Reported by Tom McConnell.
5337         * checks/Makefile.in (clean): Depends on mostlyclean.
5338         (mostlyclean): New goal.
5340 1994-06-24  François Pinard  <pinard@iro.umontreal.ca>
5342         * Makefile.in (DISTFILES): Distribute install.sh.
5343         * install.sh: New file, copied from elsewhere.
5344         Reported by Assar Westerlund and Kaveh R. Ghazi.
5346 1994-06-23  François Pinard  <pinard@iro.umontreal.ca>
5348         * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
5349         * acconfig.h: Explain ENABLE_CHANGEWORD.
5351         [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
5352         from code provided by Pete Chown]
5353         * m4.h: Add original_text field to u_t variant of union u.
5354         Declare TOKEN_DATA_FUNC macro.
5355         * builtin.c: Declare changeword.
5356         (m4_changeword): New function.
5357         * input.c: Include "regex.h", define variables with word regexps.
5358         (input_init): Initialize the word regexp.
5359         (set_word_regexp): New.
5360         (next_token): Declare local variables, use the previous code if
5361         default_word_regexp is true.  Else, match using a new code.  Save
5362         the original text.
5363         * macro.c (expand_token): Ship out original text if not a macro
5364         name.
5365         Reported by Krste Asanovic and Pete Chown.
5367         [These modifs all depend upon ENABLE_CHANGEWORD]
5368         * m4.h: Declare external user_word_regexp.
5369         * m4.c: Declare user_word_regexp, and initialize it from
5370         --word-regexp or -W, or NULL if not specified.
5371         * input.c: Use user_word_regexp if specified, instead of
5372         DEFAULT_WORD_REGEXP.
5374         * Makefile.in (m4): Revert Jan 3 1994 change.  I'm unable to
5375         agree with it.
5377         * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
5378         * checks/Makefile.in: Empty the suffix list.
5379         Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
5381         * m4.c: Declare nesting_limit and initialize it to 250.
5382         Implement -LNUMBER or --nesting-limit=NUMBER to change its
5383         value.
5384         * m4.h: Declare nesting_limit as external.
5385         * macro.c (expand_macro): Stop execution whenever nesting limit
5386         is exceeded.
5387         Reported by Bengt Mertensson.
5389         * eval.c (evaluate): Diagnose excess characters in eval input.
5390         Things like `eval(08)' used to return 0 with no diagnostic.
5392         * m4.h: Capitalize first letter of all macro arguments in
5393         definitions.
5395         * m4.c: Declare warning_status, initialize it to 0.  Add new
5396         option -E, or --fatal-warnings, which sets warning_status to
5397         EXIT_FAILURE instead.
5398         * m4.h: Declare external warning_status.  Define EXIT_SUCCESS and
5399         EXIT_FAILURE if not otherwise done by header files.
5400         * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
5401         * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
5402         eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
5403         argument of all M4ERROR calls.
5404         Reported by Noah Friedman.
5406         * examples/incl-test.m4: Renamed from incl_test.m4.
5407         * examples/include.m4: Include incl-test.m4 instead of
5408         incl_test.m4.
5409         * examples/multiquotes.m4: Renamed from multi-quotes.m.
5411 1994-06-22  François Pinard  <pinard@iro.umontreal.ca>
5413         * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found.  Note
5414         that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
5415         also tested it on a Sun Sparc workstation running SunOS 4.x.
5417         * format.c (format): When not HAVE_EFGCVT, m4 was failing the
5418         49.format check, abusing a `union values' argument with sprintf
5419         without selecting the proper field.  Now, save the formatting type
5420         first, delaying the fetch of the corresponding argument.
5421         Reported by Joseph E. Sacco and Tom Quinn.
5423         * format.c (format): Remove const from char *fmt declaration when
5424         not HAVE_EFGCVT, because a NUL may be forced into it.
5426         * m4.h: Declare atof() when not STDC_HEADERS.
5427         Reported by Joseph E. Sacco.
5429         * Regenerate configure using Autoconf 1.11, this corrects a
5430         problem about an incorrect cpp seting on NeXT 3.1.
5431         Reported by Alexander Lehmann.
5433 1994-06-05  François Pinard  <pinard@iro.umontreal.ca>
5435         * m4.h (_): Change argument from `x' to `Args'.
5437 1994-04-22  François Pinard  <pinard@iro.umontreal.ca>
5439         * m4.h: Rename Args() to _().
5440         * m4.h: Remove extern specifier from all function declarations.
5442 1994-04-22  Jim Avera <jima@netcom.com>
5444         * stackovf.c: New file implementing stack-overflow detection.
5445         * configure.in: Check for getrlimit, sigaction.  If all of
5446         standard headers, getrlimit and sigaction, define USE_STACKOVF and
5447         substitute ${U}stackovf.o for STACKOVF.
5448         * acconfig.h: Declare USE_STACKOVF.
5449         * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
5450         * m4.h: Declare setup_stackovf_trap().
5451         * m4.c: Call setup_stackovf_trap().
5452         * tests/stackovf_test.sh: New file.
5454 1994-04-13  François Pinard  <pinard@iro.umontreal.ca>
5456         * checks/Makefile.in: Rename .all-stamp to stamp-checks.
5458         * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
5460 1994-01-30    <pinard@iro.umontreal.ca>
5462         * m4.h: Remove definition of volatile, not used anymore.
5463         Reported by Jim Meyering and Joseph E. Sacco.
5465         * m4.h: Consistently use `do { ... } while (0)' in macros, instead
5466         of `if ... else /* nothing */' for if macros.
5467         Reported by Jim Meyering.
5469         * builtin.c (m4_regexp): Reorganize the code for avoiding a
5470         warning from gcc about `repl' possibly used before defined.
5471         Reported by Jim Meyering.
5473         * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
5474         Reported by Jim Meyering.
5476 1994-01-25  François Pinard  <pinard@iro.umontreal.ca>
5478         * m4.h: Move the conditional definition of volatile after the
5479         inclusion of system files, because they may define it first.
5481 1994-01-04  François Pinard  <pinard@iro.umontreal.ca>
5483         * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
5484         get around a problem with Alpha make seeing a syntax error, there.
5485         Reported by Vern Paxson.
5487 1994-01-03  François Pinard  <pinard@iro.umontreal.ca>
5489         * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
5490         Reported by Richard Stallman.
5492 1993-12-25  François Pinard  <pinard@iro.umontreal.ca>
5494         * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
5495         instead of AC_HAVE_FUNCS.
5496         Reported by Noah Friedman.
5498 1993-12-01  François Pinard  <pinard@iro.umontreal.ca>
5500         * m4.c: Initialize show_help and show_version to zero.
5502         * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
5503         Use them in exit() and usage() calls.
5505 1993-11-27  François Pinard  <pinard@iro.umontreal.ca>
5507         * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
5508         syserr() macro.  Delete errref, add reference_error and M4ERROR.
5509         * m4.c: Replace errref, which was returning an input reference
5510         string, with reference_error, which prints it on standard error.
5511         * builtin.c, output.c: Use errno as second parameter to error,
5512         instead of using syserr() with %s.
5513         * *.c: Use M4ERROR instead of error: no more errref() with %s.
5514         Doing so, the program name appears after the input reference
5515         instead of before, which eases M-x next-error processing.
5517 1993-11-24  François Pinard  <pinard@iro.umontreal.ca>
5519         * checks/get-them: Escape braces with backslashes in patterns,
5520         because HPUX-9.01 awk needs this.
5521         Reported by Jim Meyering.
5523 1993-11-22  François Pinard  <pinard@iro.umontreal.ca>
5525         * builtin.c: Declare "FILE *popen ();".
5527         * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
5528         macros, replace error_message_prefix() declaration by errref()'s.
5529         Declare xrealloc, for use in errref().
5530         * m4.c: Delete error_message_prefix() function, add errref().
5531         * *.c: Use error() systematically in place of all error macros,
5532         now that error() flushes stdout first.  Make needed adjustments.
5534         * m4.h: Remove const in sys_errlist[] declaration, it creates
5535         conflicts on SGI and Alpha.
5536         Reported by Kaveh R. Ghazi.
5538 1993-11-20  François Pinard  <pinard@iro.umontreal.ca>
5540         * m4.c: Include <getopt.h> instead of "getopt.h".
5542         * configure.in: Output to config.h.  Use HAVE_FUNCS preferably.
5543         * acconfig.h: New, for documenting HAVE_EFGCVT.
5544         * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
5545         use them wherever appropriate.  Also use -I. for compilations.
5546         * lib/Makefile.in: Use -I.. for compilations.
5547         * *.c: Include <config.h> or "config.h".
5549         * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
5550         * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
5552 1993-11-17  François Pinard  <pinard@iro.umontreal.ca>
5554         * builtin.c (m4_eval): Cast strlen to (int) before comparing.
5556         * input.c (input_init): Initialize quote and comment strings
5557         explicitely instead of calling set_quotes and set_comment: by
5558         doing so, we ensure we do not free uninitialized variables.
5560         * checks/check-them: Reverse arguments to both diff, so the
5561         expected is on the left and the obtained on the right.
5563         * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
5564         macros. Delete declarations for m4error, warning, fatal and
5565         internal_error, add declaration for error_message_prefix.
5566         * m4.c:  Delete m4error, warning, fatal and internal_error
5567         routines, add error_message_prefix routine.
5568         * *.c: Replace m4error routine calls with MESSAGE* macro calls,
5569         warning with WARNING*, fatal with FATAL* and internal_error with
5570         INTERNAL_ERROR*.
5571         * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
5572         this is not needed anymore.
5574         * m4.h: Declare extern FILE *debug.  Add DEBUG_PRINT{1,3} and
5575         DEBUG_MESSAGE{,1,2} macros.  Delete declarations for debug_print
5576         and debug_message, add declaration for debug_message_prefix.
5577         * debug.c: Remove static specifier for FILE *debug declaration.
5578         Delete debug_print and debug_message routines, add
5579         debug_message_prefix routine.
5580         * builtin.c, debug.c: Replace debug_print routine calls with
5581         DEBUG_PRINT* macro calls.
5582         * input.c, path.c: Replace debug_message routine calls with
5583         DEBUG_MESSAGE* macro calls.
5585         * m4.h: Remove inclusion of <varargs.h>.
5586         * debug.c: Include <stdarg.h> or <varargs.h>.
5587         (trace_format): Use stdarg instead of varargs if __STDC__.
5589         * configure.in: Remove checks for vfprintf and _doprnt.  These
5590         implementations use varargs tricks which are not portable enough.
5591         * lib/vfprintf.c: Deleted.
5592         * lib/_doprnt.c: Deleted.
5593         * lib/Makefile.in: Adjusted accordingly.  Remove LIBOBJS.
5594         Reported by Joel Sherrill.
5596         * path.c (add_include_directory): Use xstrdup.
5598         * builtin.c (find_builtin_by_name): Declare static.
5600         * *.[ch]: Add const to a few "char *" declarations.
5602         * configure.in: Remove commented tests for fileno() and fstat().
5603         * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
5605         * debug.c (debug_flush_files): New.
5606         * m4.h: Declares it.
5607         * builtin.c (m4_syscmd, m4_esyscmd): Use it.
5608         Reported by Nicolas Pioch.
5610 1993-11-12  François Pinard  <pinard@iro.umontreal.ca>
5612         * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
5613         Reported by Joel Sherrill.
5615         * builtin.c (prefix_all_builtins): Instead of the table size, use
5616         the null entry at end for stopping the loop.  It was overwritten.
5617         Reported by Andreas Schwab and Jim Meyering.
5619         * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
5620         Reported by Kaveh R. Ghazi.
5622         * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
5623         Reported by Karl Vogel.
5625 1993-11-09  François Pinard  <pinard@iro.umontreal.ca>
5627         * m4.h: Do not define volatile if already defined.
5628         Reported by René Seindal.
5630         * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@.  Grrr!
5632         Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
5633         Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
5635 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
5637         * m4.h: Define strchr and strrchr in terms of index and rindex,
5638         instead of the other way around.
5639         * builtin.c, m4.c, path.c: Use strchr instead of index.
5641         * input.c (next_char): Remove a "break;" after a "return ...;".
5642         Reported by Tom McConnell.
5644 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
5646         * Release 1.1
5648         * configure.in: Do not copy check files in the build hierarchy.
5649         * checks/check-them: Identify the m4 version being checked.  For
5650         finding m4, look in $PATH instead of in the parent directory.
5651         * Makefile.in (check): Prepend `pwd` to $PATH before checking.
5652         * checks/Makefile.in (.all-stamp): Always create check files in
5653         the source hierarchy, not anymore in the build hierarchy.
5654         (check): cd to the source hierarchy before performing checks.
5655         Do not copy nor clean COPYING anymore, take it from `..'.
5656         Reported by Tom McConnell.
5658         * Makefile.in (Makefile): Use $(SHELL).
5659         (config.status): Use $(SHELL).  Use "config.status --recheck"
5660         instead of "configure --no-create", which is obsolete.
5661         Reported by Tom McConnell.
5663 1993-11-05  François Pinard  <pinard@iro.umontreal.ca>
5665         * m4.c (usage): Use "%s" instead of "m4" in format string.
5666         Reported by Jim Meyering.
5668         * Makefile.in: Distribute mkinstalldirs.
5669         Reported by Pierre Gaumond.
5670         Reported by Jim Meyering.
5671         Reported by Tom McConnell.
5672         Reported by Andreas Gustafsson.
5674         * checks/check-them: Renamed from checks/check_them.
5675         * checks/get-them: Renamed from checks/get_them.
5676         * checks/.all-stamp: Renamed from checks/.all_stamp.
5677         * checks/Makefile.in: Changed accordingly.
5678         Reported by Jim Meyering.
5680 1993-11-04  François Pinard  <pinard@iro.umontreal.ca>
5682         * lib/Makefile.in (dist): Correct permissions on files.
5684         * output.c: Declare tmpfile, some systems don't.
5686 1993-11-03  François Pinard  <pinard@iro.umontreal.ca>
5688         * checks/Makefile.in (dist): Correct permissions on files.
5690         * Makefile.in (dist): Ensure recursive linking for subdirectory
5691         `examples', also set read/write permissions on all its files.
5693         * mkinstalldirs: New, from elsewhere.
5694         * Makefile.in: Use it.
5696         * debug.c: Synchronize debug messages and regular output when
5697         the debug file and stdout are redirected to the same file.
5698         * configure.in: Add (commented) checks for fileno and fstat.
5699         Reported by Jim Avera.
5701         * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
5702         etc., arguments, then ignore the superfluous one.  m4 used to
5703         diagnose missing arguments and return the empty string.
5704         Reported by Nick S. Kanakakorn.
5706 1993-11-02  François Pinard  <pinard@iro.umontreal.ca>
5708         * m4.c (main): At end of all input, ensure all undiverted text
5709         goes to the main output stream.
5710         Reported by Andreas Gustafsson.
5712         * m4.c (main): exit (0), instead of return 0.
5714         * m4.c: Implement -P and --prefix-builtins.
5715         * builtin.c: Delete const specifier on builtin_tab.
5716         (prefix_all_builtins): New.
5717         Reported by Noah Friedman.
5718         Reported by Scott Bartram.
5720         * c-boxes.el: New, from elsewhere.
5721         * Makefile.in: Distribute it.
5723         * m4.h: Do not define bcopy if <string.h> defines it.
5724         Reported by Stephen Perkins.
5726         * builtin.c (define_macro): Allow a missing second argument, in
5727         which case it is implied empty.  Affects define and pushdef.
5728         Reported by Eric Allman.
5730 1993-11-01  François Pinard  <pinard@iro.umontreal.ca>
5732         * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
5733         struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
5734         * builtin.c: Initialize all the blindness fields in builtin_tab.
5735         (define_builtin): Copy the blindness of a builtin into its symbol.
5736         * macro.c (expand_token): Avoid processing a blind builtin if the
5737         next character is not an opening parenthesis.
5738         Reported by David MacKenzie.
5739         Reported by Noah Friedman.
5741         * configure.in: Ensure an exit status of 0 on completion.
5742         Reported by Vivek P. Singhal.
5744         * eval.c (eval_lex): Admit both lower and upper case letters for
5745         bases greater than 10.  Only lower case letters were accepted.
5747         * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
5748         Reported by Krste Asanovic.
5750         * eval.c:  Rename NOT to LNOT.  Add XOR, NOT, LSHIFT and RSHIFT.
5751         * eval.c (logical_not_term): New name for not_term.
5752         * eval.c (xor_term): New, between or_term and and_term.
5753         * eval.c (not_term): New, between and_term and logical_not_term.
5754         * eval.c (shift_term): New, between cmp_term and add_term.
5755         Reported by Krste Asanovic: ~, ^, <<, >>.
5756         Reported by Ben A. Mesander: ** vs ^.
5758         * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
5759         * m4.h: Delete xrealloc.c.
5760         * lib/xmalloc.c: New, from elsewhere.
5761         * lib/xstrdup.c: New, from elsewhere.
5762         * lib/Makefile.in: Distribute and compile them.
5764         * m4.c: Change progname to program_name.
5765         * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
5766         * lib/error.c: New, from elsewhere.
5767         * lib/Makefile.in: Distribute and compile error.c.
5768         * configure.in: Check AC_VPRINTF and for strerror.
5769         * m4.c: Delete cmd_error.  Use error instead.
5770         * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
5772         * m4.h: Delete #define const, let Autoconf takes care of this.
5774         * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
5775         Merge parse_args into main.  Declare argv to be `char *const *',
5776         then remove superfluous casts.
5778         * m4.c: Rename --no-gnu-extensions to --traditional.
5779         Reported by Ben A. Mesander.
5781         * m4.c (usage): Add a status parameter.  Supply one in various
5782         calls.  Add --help processing.  Remove -V for --version.
5784         * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
5786         * lib/Makefile.in: Have an AR=ar declaration.
5787         Reported by Eric Backus.
5788         Reported by Bjorn R. Bjornsson.
5789         Reported by Tom Tromey.
5790         Reported by Kristine Lund.
5791         Reported by Marion Hakanson.
5793 1993-10-30  François Pinard  <pinard@iro.umontreal.ca>
5795         * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
5796         Reported by Noah Friedman.
5798 1993-10-25  François Pinard  <pinard@iro.umontreal.ca>
5800         * Makefile.in: Remove MDEFINES and cleanup.
5802 1993-06-09  François Pinard  <pinard@iro.umontreal.ca>
5804         * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
5805         Create a gzip file.
5807 1993-02-06  François Pinard  <pinard@iro.umontreal.ca>
5809         * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
5810         ensure 777 mode for directories, so older tar's will restore file
5811         modes properly.
5813 1993-01-17  François Pinard  <pinard@iro.umontreal.ca>
5815         * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
5816         so the installer can override automatically configured choices.
5817         Reported by Karl Berry.
5819 1993-01-15  François Pinard  <pinard@iro.umontreal.ca>
5821         * lib/vfprintf.c: Stolen from Oleo distribution and adapted.  The
5822         previous version was not working properly on m68k-hp-bsd4.3.
5823         Reported by Roland McGrath.
5825         * lib/_doprnt.c: Stolen from Oleo distribution.
5826         * configure.in: Check for _doprnt.c if vfprintf.c selected.
5827         * lib/Makefile.in: Distribute _doprnt.c.
5828         Do not distribute regex.[ch].old anymore.
5830 1993-01-01  François Pinard  <pinard@iro.umontreal.ca>
5832         * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
5833         Richard wants it there.
5835 1992-12-27  François Pinard  <pinard@iro.umontreal.ca>
5837         * Makefile.in: Add DEFS to MDEFINES.
5838         * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
5839         (libm4.a): Remove the library before creating it.
5840         (distclean): Remove tags and TAGS too.
5842 1992-12-23  François Pinard  <pinard@iro.umontreal.ca>
5844         * Makefile.in (dvi, m4.dvi): New goals.
5846         * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
5847         macro.c, output.c, path.c, symtab.c: Change Copyright from
5848         1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
5850         * examples/divert.m4: Deleted, this bug has been corrected.
5852         * Makefile.in (texclean, mostlyclean): New goals.
5854         * Makefile.in (clean): Remove clutter from ansi2knr.
5855         Reported by Pierre Gaumond.
5857 1992-12-20  François Pinard  <pinard@iro.umontreal.ca>
5859         * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule.  The user
5860         might well use CFLAGS is s/he needs it.
5862         * Makefile.in: Allow installation of info files from a separate
5863         build directory.
5864         Reported by Jason Merrill.
5865         Reported by David MacKenzie.
5866         Reported by Skip Montanaro.
5867         Reported by Erez Zadok.
5868         Reported by Assar Westerlund.
5870 1992-12-19  François Pinard  <pinard@iro.umontreal.ca>
5872         * Release 1.0.3
5873         This is still a beta release for the future GNU m4 version 1.1.
5875         * lib/alloca.c: New, from elsewhere.
5876         * lib/Makefile.in: Distribute it.  Define and use $(ALLOCA).
5878         * m4.h: Do not define index/rindex if already defined.  If
5879         FALSE/TRUE are already defined, do not redefine them, but merely
5880         define boolean typedef to int.
5882         * Makefile.in: Use $(DEFS) while compiling ansi2knr.
5883         * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
5884         because some C compilers do not like connectives with #ifdef.
5885         * m4.h: Define `volatile' only if __GNUC__, instead of once for
5886         __GNUC__ and once for __STDC__.
5887         * lib/regex.h: Leave const alone, AC_CONST will take care of it.
5889         * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
5890         Makefile dependencies.  Without it, make keeps destroying and
5891         remaking $(CHECKS) in a loop (why?).  Distribute .all_stamp.
5893         * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
5894         to diversion/DIVERSION, this was a spelling error.
5896         * m4.c: Declare version[], remove #include "version.h".
5897         * version.h: Deleted.
5898         * Makefile.in: Remove references to version.h.
5900         * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
5901         production, by using a simpler and more robust algorithm.  This
5902         solves the problem of synclines sometimes written in the middle of
5903         an output line.  Delete sync_line() and output_lines variable.
5904         * m4.h: Remove sync_line prototype and output_lines declaration.
5905         * input.c (next_char), output.c (shipout_text): Remove references
5906         to output_lines.
5907         * input.c (push_file, pop_file): Merely put the value -1 in
5908         output_current_line instead of calling sync_line, for delaying a
5909         single `#line NUM FILE' before next output line.  Do not test
5910         for sync_output, because this is unnecessary clutter.
5911         * output.c (make_divertion, insert_divertion): Idem.
5912         * input.c: Rename must_advance_line to start_of_input_line, for
5913         consistency.
5915         * debug.c (trace_header): Select a new debug line format, which
5916         better complies with GNU standards for formatting error messages.
5917         With option `-dfl', M-x next-error might be used on the output.
5918         * m4.c (vmesg): Adjust format of error output to GNU standards.
5919         * m4.texinfo: Adjust examples for `make check' to work.
5921         * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
5922         case for enum debug_info constants, which were all lower case.
5924         * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
5925         re_search_2.
5926         * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
5927         collected patches.  I tried a few times using newer regex.[ch], it
5928         mysteriously stopped aborting with this one.  Insecure feeling...
5929         * lib/Makefile.in: Distribute regex.[ch].old, just in case!
5931 1992-12-18  François Pinard  <pinard@iro.umontreal.ca>
5933         * m4.c: Change `--no-warnings' to `--silent'.
5934         Reported by David MacKenzie.
5936         * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
5937         leave it off for now.  See comment in m4.c for justification.
5938         Reported by David MacKenzie.
5940         * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
5941         * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
5943         * Makefile.in: Add a new `info' goal.  Use macro MAKEINFO.
5945         * Makefile.in: Ensure recursive cleaning is done before local
5946         cleaning for all clean goals.
5948         * builtin.c (ntoa): Ensure the value is always interpreted as a
5949         signed quantity, whatever the radix is.
5951 1992-11-18  Jim Meyering  <meyering@idefix>
5953         * builtin.c, format.c, input.c: Split long lines.
5954         * m4.c: Use typedef macro_definition instead of struct
5955         macro_definition.
5956         * symtab.c: Use typedef symbol instead of struct symbol.
5958 1992-11-17  François Pinard  <pinard@iro.umontreal.ca>
5960         * *.[ch]: Remove all trailing whitespace, in code and comments.
5962         * configure.in: Find some awk.
5963         * Makefile.in: Add $(AWK) to MDEFINES.
5964         * checks/Makefile.in: Transmit $(AWK) to get_them.
5965         * checks/get_them: Use $AWK instead of gawk.  Add a close in the
5966         awk script when switching files, because without this, mawk runs
5967         out of file descriptors.
5969 1992-11-16  François Pinard  <pinard@iro.umontreal.ca>
5971         * Makefile.in (realclean): Delete m4.info*.
5972         Reported by Jim Meyering.
5974         * Makefile.in: Adjust and link with checks/Makefile.
5975         * checks/Makefile.in: New.
5976         * configure.in: Output checks/Makefile.
5978         * checks/get_them: Have the dnl header of each test more
5979         recognizable by next-error, also use a better message.
5981 1992-11-16  Jim Meyering  <meyering@idefix>
5983         * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
5984         And use that only if __GNUC__ since we're using it's GCC-specific
5985         semantics that tell the compiler the associated function doesn't
5986         return.
5988         * builtin.c (substitute): Don't use character as an array index.
5989         (dumpdef_cmp): Make formal arguments `const void *' to avoid
5990         warnings with gcc -W -Wall on systems with qsort prototype.
5991         (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
5992         from gcc -W -Wall.
5994         * eval.c (most functions): Add parentheses to assignments used
5995         as truth values go avoid warnings from gcc -Wall.
5997         * input.c, m4.c, output.c, path.c, symtab.c: Declare static
5998         any functions that don't need external scope.
6000         * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
6001         (many functions and arrays): Declare `const'.
6003 1992-11-15  François Pinard  <pinard@iro.umontreal.ca>
6005         * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
6006         removing the declaration from m4.h.  Also rename false to FALSE
6007         and true to TRUE.
6009         * lib/Makefile.in (Makefile): New goal.
6011         * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
6012         so heavily loaded.  It gets more easily overridable, calling make.
6013         Reported by Jim Meyering.
6015         * Makefile.in (dist): Get .fname from the current directory name,
6016         instead of from version.h.  I need updating many files manually,
6017         when the version changes, version.h is just one of them.
6019 1992-11-14  François Pinard  <pinard@iro.umontreal.ca>
6021         * m4.h: Remove the tag `boolean' on the enum introducing typedef
6022         `boolean'.  This tag conflicts with <sys/types.h> on SVR4.
6023         Reported by Tom McConnell.
6025 1992-11-13  François Pinard  <pinard@iro.umontreal.ca>
6027         * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
6028         39.cleardiv, which were describing missing or spurious newlines.
6029         Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
6030         do not depend on machine word size, `/bin/false' implementation,
6031         or `wc' output format.  `make check' is more dependable, now.
6033         * checks/check_them: Summarize the failed tests by listing their
6034         name, at end.  If none, issue `All checks successful'.  Output
6035         `Checking' instead of `Input file:'.
6037         * checks/get_them, checks/check_them: Reindented.
6039         * Makefile.in (dist): chmod a+r before making the tar file.
6041 1992-11-12  François Pinard  <pinard@iro.umontreal.ca>
6043         * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
6045         * input.c (next_token): Reinitialize token_buttom just after using
6046         it as a watermark with obstack_free.  Or else, a future token, big
6047         enough for triggering reallocation of the obstack chunk, could
6048         void the initialized value of token_buttom, later causing panic in
6049         obstack_free.  Rename token_buttom to token_bottom everywhere.
6051         * m4.h: Before declaring errno, first include <errno.h> and
6052         ensure that it does not define errno.
6053         Reported by Richard Stallman.
6055 1992-11-11  François Pinard  <pinard@iro.umontreal.ca>
6057         * builtin.c: Define and use DECLARE macro for builtins.
6059         * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
6060         argument, this is a common idiom for introducing long comments.
6062         * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
6063         arguments.  The last argument was silently ignored.
6065         * m4.c (cmd_error): Add a missing semicolon before va_end().
6067 1992-11-10  François Pinard  <pinard@iro.umontreal.ca>
6069         * Makefile.in: Now handle protoized sources.  Define and use U.
6070         Compile and use ansi2knr with old compilers.  Update DISTFILES.
6071         Add `aclocal.m4' to `configure' dependencies.
6072         * ansi2knr.c: New, from Ghostscript distribution.
6073         * configure.in: Define U through FP_PROTOTYPES for old compilers.
6074         Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
6075         * aclocal.m4: New, provide FP_PROTOTYPES.
6076         * m4.h: Conditionnaly protoized through Args, save for varags.
6077         * builtin.c: Protoized.  Then:
6078         Include <sys/types.h> if size_t is not defined, before "regex.h".
6079         (m4_ifelse): Fetch built-in name properly for diagnostic.
6080         (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
6081         (m4_regexp): Add const to `msg' declaration.
6082         (m4_patsubst): Add const to `msg' declaration.
6083         * debug.c: Protoized, save for varargs.
6084         * eval.c: Protoized.
6085         * format.c: Protoized.
6086         * input.c: Protoized.
6087         * m4.c: Protoized, save for varargs.  Then:
6088         (xfree): Accept void * instead of char *.
6089         (xmalloc): Return void * instead of char *.
6090         (xrealloc): Accept and return void * instead of char *.
6091         * macro.c: Protoized.
6092         * output.c: Protoized.
6093         * path.c: Protoized.  Then cast some (char *) over xmalloc's.
6094         * symtab.c: Protoized.
6096 1992-11-06  François Pinard  <pinard@iro.umontreal.ca>
6098         * m4.texinfo: Remove directory from diagnostics in 30.include,
6099         51.eval, 56.errprint and 57.m4exit tests.
6101         * m4.h: Remove declarations for int or void system functions, they
6102         cause more conflicting trouble than they make good.
6104         * configure.in: Avoid configuration header file.  Add some tests.
6105         * m4.h: Remove #include "config.h".
6106         * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
6107         Then, rewritten for better compliance with GNU standards.
6109 1992-11-05  François Pinard  <pinard@iro.umontreal.ca>
6111         * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
6112         because of a misplaced #endif.
6114         * Many *.[hc] files: Correct intra-line spacing here and there,
6115         according to GNU indent 1.6 advice.
6117         * configure.in: New, using Autoconf 1.2.
6118         * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
6119         * Delete old configure.in, configure, etc/configure.in,
6120         etc/configure, lib/configure.in, lib/configure and config/*.
6121         Reported by Jason Merrill.
6123         * symtab.c (hash): Change (char) NULL to '\0'.
6124         Reported by Jason Merrill.
6126         * Delete .vers, etc/newdist.sh, etc/newvers.sh and
6127         etc/nextvers.sh.  Release numbers will be edited `by hand'.
6128         * version.h: De-automatize, force value in.
6130         * m4.c: Changes in order to use a newer getopt.h.
6131         Reported by David MacKenzie.
6133         * checks/: New name for examples/.
6134         * checks/get_them: New location for etc/get_examples.
6135         * checks/check_them: New location for etc/check_examples.
6136         * Makefile.in, checks/get_them, checks/check_them: Adjust.
6137         * lib/vfprintf.c: New location for etc/vfprintf.c.
6138         * Delete empty etc/.
6139         * examples/: New name for test/.
6141 1992-03-10  François Pinard  <pinard@iro.umontreal.ca>
6143         * Makefile.in (check): Add m4 as dependency.
6145         * m4.c: Accept --no-warnings instead of --no_warnings, and
6146         --no-gnu-extensions instead of --no_gnu_extensions.  Make the
6147         usage message more informative.
6148         Reported by David MacKenzie.
6150 1992-03-09  François Pinard  <pinard@iro.umontreal.ca>
6152         * etc/check_examples: New name for check_examples.sh.
6153         * etc/get_examples: New name for get_examples.sh.
6154         * Makefile.in, etc/Makefile.in: Use new names.
6156         * Makefile.in: Transmit $(CC) while making in lib.
6158         * Many *.[hc] files: GNU indent'ed, with further fine tuning of
6159         code disposition by hand.
6161 1992-03-08  François Pinard  <pinard@iro.umontreal.ca>
6163         * m4.h: Delete definitions for abort() and exit().
6164         Reported by Richard Stallman.
6166         * config/hmake-unicos, config/s-unicos.h: New files.
6167         Reported by Hal Peterson.
6169         * eval.c (exp_term): Have N^0 return 1.
6170         Reported by Michael Fetterman.
6172         * eval.c, input.c, m4.h: Remove last comma in enums.
6173         Reported by Mike Lijewski.
6175         * Transfer of maintenance duties from René to François.
6177 1991-10-24  René Seindal <seindal@diku.dk>
6179         * Release 1.0.  Many thanks to those, who provided me with bug
6180         reports and feedback.
6182         * Uses GNU configure, taken from the gdb distribution.
6184         * Uses GNU getopt(), with long option names.
6186         * The -Q/+quiet option is added, which suppresses warnings about
6187         missing or superflous arguments to built-in macros.
6189         * Added default options via the M4OPTS environment variable.
6191         * The built-in format can now be configured to use sprintf as
6192         the formatting engine, for systems without [efg]cvt(3).
6194         * GNU library code is moved to the ./lib subdirectory; other
6195         utility files are now in ./etc.
6197         * Several minor bugs have been fixed.
6199 1991-07-26  René Seindal <seindal@diku.dk>
6201         * Fixed various bugs.  Release 0.99, manual 0.09.  Many thanks to
6202         Francois Pinard and Roland H. Pesch for providing me with reports.
6204         * The builtins incr and decr are now implemented without use of
6205         eval.
6207         * The builtin indir is added, to allow for indirect macro calls
6208         (allows use of "illegal" macro names).
6210         * The debugging and tracing facilities has been enhanced
6211         considerably.  See the manual for details.
6213         * The -tMACRO option is added, marks MACRO for tracing as soon
6214         as it is defined.
6216         * Builtins are traced after renaming iff they were before.
6218         * Named files can now be undiverted.
6220         * The -Nnum option can be used to increase the number of
6221         divertions available.
6223         * Calling changecom without arguments now disables all comment
6224         handling.
6226         * The function m4_patsubst() is now consistently declared
6227         static.
6229         * A bug in dnl is fixed.
6231         * A bug in the multi-character quoting code is fixed.
6233         * Several typos in the manual has been corrected.  More probably
6234         persist.
6236         * The m4.info file is now installed along with the program.
6238 1990-11-15  René Seindal <seindal@diku.dk>
6240         * Updated and enhanced version.  Release 0.75, manual 0.07.
6242         * Implemented search path for include files (-I option and
6243         M4PATH envronment variable).
6245         * Implemented builtin "format" for printf-like formatting.
6247         * Implemented builtin "regexp" for searching for regular
6248         expressions.
6250         * Implemented builtin "patsubst" for substitution with regular
6251         expressions.
6253         * Implemented builtin "esyscmd", which expands to a shell
6254         commands output.
6256         * Implemented "__file__" and "__line__" for use in error
6257         messages.
6259         * Implemented character ranges in "translit".
6261         * Implemented control over debugging output.
6263         * Implemented multi-character quotes.
6265         * Implemented multi-character comment delimiters.
6267         * Changed predefined macro "gnu" to "__gnu__".
6269         * Changed predefined macro "unix" to "__unix__", when the -G
6270         option is not used.  With -G, "unix" is still defined.
6272         * Changed "shift", "$@" and "$*" to not insert spaces afters
6273         commas.
6275         * Added program name to error messages.
6277         * Fixed two missing null bytes bugs.
6279 1990-01-22  René Seindal <seindal@diku.dk>
6281         * Initial beta release.  Release 0.50, manual 0.05.
6284         $Revision$ $Date$