1 2005-05-06 Gary V. Vaughan <gary@gnu.org>
3 * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
4 * bootstrap (src_modules): Add version-etc-fsf.
5 * src/main.c (version_etc_copyright): Removed.
7 * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
9 2005-05-04 Gary V. Vaughan <gary@gnu.org>
11 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
13 * src/freeze.c (produce_frozen_state): Use \n line-endings even
14 on Windows, so that the frozen file reader will work.
15 Reported by Josef T. Burger <bolo@bolo.com>
17 2005-05-04 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
19 Forward port of a patch that allowed m4-1.4.2 to compile on
22 * configure.ac (AC_CHECK_HEADERS): Add signal.h,
24 * src/m4.h: And include them as appropriate.
25 * src/main.c, src/stackovf.h: Don't include signal.h literally;
26 m4.h will include the correct file.
28 2005-05-04 Gary V. Vaughan <gary@gnu.org>
30 * m4/m4private.h: Make errno visible for the sources patched
33 2005-05-04 Paul Eggert <eggert@twinsun.com>
35 * src/main.c (print_program_name_CB): Preserve errno, since
36 M4ERROR relies on this.
37 * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
38 * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
39 * m4/path.c (m4_path_search): Don't let "free" trash errno when
42 * m4/output.c (m4_insert_file): Don't assume errno has a valid
43 value simply because fread returns zero. This fixes a
44 portability bug reported by Marion Hakanson in
45 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
47 2005-05-04 Santiago Vila <sanvila@debian.org>
49 * tests/stackovf.test: Use tempfile if available.
51 2005-05-04 Robert Bihlmeyer <robbe@orcus.priv.at> (tiny change)
53 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
54 * m4/output.c (m4_insert_file): Do not mix buffered and
55 unbuffered I/O, as this breaks on the Hurd.
57 2005-05-04 Gary V. Vaughan <gary@gnu.org>
59 Gnulib has changed again. Reimport. Adjust. Rinse. Repeat.
60 Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
61 and libtoolize does a better job of ltdl importing now too, so
62 take advantage of that while updating the tree:
64 * acm4, config: Moved from here...
65 * ltdl/m4, ltdl/config: ...to here.
66 * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
67 src/Makefile.am, tests/Makefile.am: Removed...
68 * Makefile.am: ...and migrated to here, with adjustments to
69 compensate for relative path differences.
70 * commit: Adjust relative paths.
71 * configure.ac: Adjust relative paths.
72 (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
74 (LT_PREREQ): 2.0 isn't released yet, but will work when it is! In
75 the meanwhile, CVS HEAD libtool is needed.
76 (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
77 stricly new enough, we also need a patch.
78 (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
79 (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
80 (gl_MODULES): Don't list getopt and version-etc, as they don't
82 * bootstrap: After running gnulib-tool to import the listed
83 modules, fetch getopt and version-etc into src manually.
84 (ltdldir): Change to ltdl.
85 * src/main.c: Adjust for changes in version-etc API.
86 * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
87 but works when the getopt module isn't to be included in the lib.
88 * README: Add note about patching autoconf and automake to
91 2005-05-02 Matt Kraai <kraai@debian.org> (tiny change)
93 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
94 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
95 empty file rather than to a nonexistent file. This closes a
97 * modules/m4.c (m4_maketemp): Implement the above, by using
98 mkstemp rather than mktemp.
100 2005-05-01 Gary V. Vaughan <gary@gnu.org>
102 The FSF are moving offices today. Changed their contact address
103 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
104 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
106 2005-03-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
108 * tests/Makefile (clean-local): Ignore testsuite cleanup
111 2005-03-11 Per Bothner <per@bothner.com> (tiny change)
113 * tests/Makefile (clean-local): Only run the testsuite cleanup
114 if the testsuite has been generated.
116 2005-02-11 Stepan Kasal <kasal@ucw.cz>
118 * TODO: slight clarification of the example of qindir usage.
120 2005-02-08 Gary V. Vaughan <gary@gnu.org>
122 * TODO: Add qindir requirement, and defn bug.
123 From Stepan Kasal <kasal@ucw.cz>
125 2005-02-08 Stepan Kasal <kasal@ucw.cz>
127 * TODO: Add ``execution stack'', fix a typo.
128 * doc/m4.texinfo: Typos.
130 2004-12-24 Eric Blake <ebb9@byu.net>
132 * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
133 to the gnu subdirectory.
134 * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
135 * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
136 * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
137 * m4/system_.h: Likewise, in non-configured includes.
139 2004-10-14 Noah Misch <noah@cs.caltech.edu>,
140 Gary V. Vaughan <gary@gnu.org>
142 * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
143 Protect definitions from macro expansion under -DNDEBUG by
144 parenthesising the expanded function names.
145 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
146 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
147 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
148 (m4_is_syntax_macro_escaped): Similarly protect function
149 definitions from macro expansion under -DNDEBUG by #undefing the
150 matching macro names before each definition. Also, move all the
151 function definitions to the end of the file so that any
152 invocations in the rest of the file pick up the fast macro
154 * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
155 (m4_set_debug_file, m4_set_trace_messages)
156 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
157 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
158 (m4_set_max_debug_arg_length_opt): New fast macro versions of the
159 option setter functions.
161 2004-09-23 Gary V. Vaughan <gary@gnu.org>
163 * src/main.c: Include gnulib files from the correct directory.
165 * gnulib/*: Don't store any of the gnulib files in arch, as they
166 generate spurious changes.
167 * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
168 gnulib macros now share our macro directory.
169 (SUBDIRS): Descend into `gnu' rather than `gnulib'.
170 * bootstrap: Call gnulib-tool to import from the gnulib tree.
171 (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
172 gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
173 the gettext macros from autopoint that overwrite the gnulib-tool
174 imported versions. Import sources and Makefile.am into the `gnu'
175 directory. Changed all callers.
176 * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
177 gl_INIT): Call these gnulib-tool macros instead of the hardcoded
178 for imported modules.
179 * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
180 acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
181 hardcoding the gnulib macros they wrap.
183 2004-07-15 Gary V. Vaughan <gary@gnu.org>
185 Latest CVS libtool can preload modules in libraries, including
186 its own module loaders! Tweak m4 so that it doesn't try to treat
187 libltdl's module loaders as m4 modules when freezing and on exit:
189 * gnulib/acm4/*.m4: Don't store these files in arch since they
190 generate spurious changes.
191 * bootstrap: Simplify initial libtoolize call, since CVS
192 libtoolize is smarter these days.
193 * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
195 * m4/module.h (m4__module_exit): Missing declaration.
196 * m4/m4private.h (m4__module_next): New function declaration.
197 * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
198 encapsulation. Changed all callers.
199 (m4__module_interface): New function to verify m4 loadable module
201 (m4__module_init): Register the interface validator.
202 (m4__module_exit): Only close my own modules.
203 * modules/m4.c (unistd.h): Provide missing declaration.
204 (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
205 (m4_expand_ranges): More missing declarations.
206 * modules/modtest.c (export_test): Ditto.
207 * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
208 * src/main.c (main): Bump copyright year.
209 * tests/modules.at: Fix sed syntax error.
212 2004-06-17 Gary V. Vaughan <gary@gnu.org>
214 Tweaking to enable compilation with latest CVS libtool and
215 libltdl. We can't just dump the library files directly into the
216 m4 directory anymore now that libltdl is built from pieces itself:
218 * bootstrap: Rewritten to use latest libtoolize sanely, and to
219 set up libltdl subdirectory.
220 * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
221 gnulib subdirectory's config.
222 (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
223 (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
225 (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
226 configure.ac, so use AC_WITH_LTDL instead.
227 * Makefile.am (SUBDIRS): Add libltdl.
228 * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated. gnulib now uses
230 * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
231 (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
232 (libm4_la_LIBADD): Add LIBLTDL.
233 * m4/ltdl.c, m4/ltdl.h: Removed.
234 * m4/m4module.h: Include canonical ltdl.h.
237 2004-06-14 Gary V. Vaughan <gary@gnu.org>
239 * gnulib/import: Now updates makefile fragments, and configure.ac.
240 * gnulib/m4/gnulib.am: New file. Generated makefile fragments.
241 * gnulib/m4/Makefile.am: include it.
242 * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
243 gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
244 gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
245 gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
246 gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
247 * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
248 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
249 gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
250 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
251 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
252 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
253 gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
254 gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
256 * gnulib/m4/getopt_int.h: New source file from latest gnulib
258 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
259 gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
260 gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
261 gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
262 Updated source files from latest gnulib.
264 2004-02-29 Gary V. Vaughan <gary@gnu.org>
266 * config/mailnotify: New file for mailing commit notifications,
267 imported from cvs-utils.
268 * commit: Updated from cvs-utils and tweaked for m4.
270 2003-12-01 Gary V. Vaughan <gary@gnu.org>
272 * config/mkstamp: Updated from CVS libtool.
273 * configure.ac: Generate a gnu coding standards compliant version
274 number, and use it for the banner.
275 * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
276 mhen the TIMESTAMP changes in ChangeLog, but the file modification
277 time doesn't (e.g. in cvs commit). Otherwise dist tarballs will
278 contain the previous version number.
279 * src/main.c: Make --version output conform to the GNU standard.
281 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
282 * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
283 m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
284 shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
285 time_la_SOURCES): ...so that these are defaulted correctly, and
286 can be removed from this file.
287 (AM_LDFLAGS): Add -module...
288 (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
289 traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
290 import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
291 the individual settings can be removed.
292 * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
293 * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
294 m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
295 shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
296 time_la_LIBADD): ...so that these are picked up as a deplib of
297 libm4 and don't need to be set explicitly.
299 2003-11-18 Gary V. Vaughan <gary@gnu.org>
301 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
302 from the standard build. It is too fragile.
304 * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
305 CVS libtool after merging m4 changes across to libtool.
307 * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
308 * m4/path.c (search_path_add): Ditto.
310 2003-11-13 Gary V. Vaughan <gary@gnu.org>
312 * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
313 libtool tags we don't use in configure. This reduces the size
314 of the script from over 1Mb to under 700Kb.
316 2003-11-13 Gary V. Vaughan <gary@gnu.org>
318 The import script was not written properly, and the last gnulib
319 import was incomplete. Fixed that problem, and reimport our
320 gnulib dependencies, which picks up the address calculation
321 overflow checks described by Paul below. Also tweak the clients
322 of the gnulib xalloc module not to use deprecated macros:
324 * gnulib/import: Recurse through module dependencies rather than
325 naively descending only one level.
326 * configure.ac: Add calls to gnulib's strnlen and extension module
328 * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
330 * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
331 gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
332 gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
333 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
335 * gnulib/acm4/libtool.m4: Updated from CVS libtool.
336 * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
337 place of `xcalloc (1, S)'.
338 * m4/m4.c (m4_create): Likewise.
339 * m4/m4private.h (m4_symbol_value_create): Likewise.
340 * m4/symtab.c (symtab_fetch): Likewise.
341 * m4/syntax.c (m4_syntax_create): Likewise.
342 * src/freeze.c (reload_frozen_state): Likewise.
343 * m4/path.c (search_path_add): Eliminate use of deprecated NEW
345 * m4/symtab.c (m4_symtab_create): Likewise.
347 2003-11-13 Gary V. Vaughan <gary@gnu.org>
349 * tests/module.at: Comment typo.
351 2003-10-10 Gary V. Vaughan <gary@gnu.org>
353 * tests/modules.at (modules: importing): Apply some lateral
354 thinking, and use AT_CHECK to compare the output of a sed pass
355 over stderr against the canonical strerror string.
357 * tests/modules.at (modules: importing): Edit the generated stderr
358 output to canonicalize strerror output, before a comparison.
360 2003-10-10 Gary V. Vaughan <gary@gnu.org>
362 Tru64UNIX perl is sloppy with namespace pollution. This patch is
363 careful not to trip over the mess:
365 * modules/perl.c: Some builds of perl install headers that contain
366 `#define try __builtin_try'. Be sure to undefine that macro
367 before `m4/hash.h' gets included, which uses the `try' symbol.
368 * m4/system_.h: Similarly for `bool'. Undefine `bool', `true' and
369 `false' before including `stdbool.h'.
370 (DELETE): This symbol is not in m4's namespace, and is in any
371 case only used internally...
372 * m4/m4private.h (DELETE): ...so move it to here.
373 Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
375 2003-10-08 Paul Eggert <eggert@twinsun.com>
377 Don't use XMALLOC and XCALLOC. Once we install the
378 corresponding patch into gnulib, this will fix some
379 address-calculation overflow bugs on hosts where calloc (A, B)
380 returns garbage when A*B overflows.
382 * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
383 maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
384 xmalloc, XCALLOC with xcalloc.
385 * m4/m4.c (m4_create): Likewise.
386 * m4/m4private.h (m4_symbol_value_create): Likewise.
387 * m4/output.c (m4_output_init): Likewise.
388 * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
389 * m4/syntax.c (remove_syntax_attribute): Likewise.
390 * src/freeze.c (reload_frozen_state): Likewise.
391 * src/main.c (main): Likewise.
393 2003-10-07 Gary V. Vaughan <gary@gnu.org>
395 * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
396 gnulib/acm4 directories for aclocal m4 macros.
397 * gnulib/Makefile.am (EXTRA_DIST): Removed.
398 (MAINTAINERCLEANFILES): Add Makefile.in.
399 * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
401 * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
402 * gnulib/import: New file. Temporary script for updating gnulib
403 imported files, until gnulib-tool is working.
404 * gnulib/config/codeset.m4, gnulib/config/error.m4,
405 gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
406 gnulib/config/getopt.m4, gnulib/config/gettext.m4,
407 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
408 gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
409 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
410 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
411 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
412 gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
413 gnulib/config/nls.m4, gnulib/config/obstack.m4,
414 gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
415 gnulib/config/progtest.m4, gnulib/config/realloc.m4,
416 gnulib/config/regex.m4, gnulib/config/restrict.m4.
417 gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
418 gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
419 gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
420 gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
421 gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
422 gnulib/config/xstrndup.m4: Removed.
423 * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
424 gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
425 gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
426 gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
427 gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
428 gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
429 gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
430 gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
431 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
432 gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
433 gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
434 gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
435 gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
436 gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
437 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
438 gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
439 gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
440 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
441 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
442 gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
443 gnulib/import script.
444 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
445 gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
446 gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
447 gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
448 gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
449 gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
450 gnulib with gnulib/import script.
451 * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
452 guards ready for gnulib-tool to autoupdate on import.
453 * config/debug.m4, config/gmp.m4, config/m4-error.m4,
454 config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
455 config/stackovf.m4: Moved from here...
456 * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
457 acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
458 acm4/stackovf.m4: ...to here, to separate aclocal macros from
459 configure time helper scripts.
460 * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
461 * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
462 m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
463 src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
465 * src/main.c (version_etc_copyright): Only output the current
467 (version_etc): Call with new variadic API.
469 2003-09-16 Gary V. Vaughan <gary@gnu.org>
471 * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
472 version-etc module from CVS gnulib.
473 * po/POTFILES.in: Add gnulib/m4/version-etc.c.
474 * src/Makefile.am: Build it.
475 * src/main.c: Use it.
477 * gnulib/m4/exit.h: Import exit module from CVS gnulib.
478 * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
479 * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
482 2003-09-15 Charles Wilson <cygwin@cwilson.fastmail.fm>,
483 Gary V. Vaughan <gary@gnu.org>
485 * bootstrap: Separate options.
486 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
487 * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
489 * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
490 (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
491 (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
492 (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
493 $(LTLIBINTL) for gettext support on cygwin.
494 * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
495 have $(LTLIBINTL) from the preloaded module la files.
496 * README: Remove the warning about using --disable-nls on Windows
499 2003-09-15 Gary V. Vaughan <gary@gnu.org>
501 * gnulib/m4/regex.c: s/<regex.h>/"regex.h"/ or else the compiler
502 picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
505 2003-09-12 Gary V. Vaughan <gary@gnu.org>
507 * doc/STYLE: Document the gnulib header naming conventions, and
509 * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
510 gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
511 gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
513 * gnulib/m4/Makefile.am: Remove the rules to build these headers.
515 * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
516 module from CVS gnulib.
517 * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
518 (gl_FUNC_STRTOL): In favour of the module macro.
520 2003-09-12 Gary V. Vaughan <gary@gnu.org>
522 Replace the getopt code with CVS gnulib getopt. The source files
523 detect whether they are in a glibc environment and preprocess away
524 all of the code if there is a system getopt, so we can compile
525 them into the m4 executable unconditionally:
527 * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
528 gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
529 * configure.ac (gl_GETOPT): Use this instead of homebrew inline
531 * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
533 * src/Makefile.am: Adjust.
534 * src/main.c: Always include our shipped getopt.h.
535 * po/POTFILES.in: Use new location of getopt.c.
537 2003-09-12 Gary V. Vaughan <gary@gnu.org>
539 * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
540 * config/Makefile.am: Removed. Automake 1.8 distributes the files
541 in this directory automatically.
542 * Makefile.am (EXTRA_DIST): Except config/mkstamp.
544 * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
546 * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
548 * modules/Makefile.am (pkglibexecdir): Set it here.
549 (pkgmodincdir): Renamed to pkgmodincludedir). Changed all clients.
551 * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
552 Import regex module from CVS gnulib.
553 * gnulib/config/restrict.m4: Ditto for dependee module restrict.
554 * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
555 do extra substitutions for Makefile.
556 * configure.ac: Use it.
557 * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
558 from regex_.h if necessary.
559 * m4/system_.h: Include the correct version of regex.h.
560 * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
562 * po/POTFILES.in: Use new location of regex.c.
564 * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
565 realloc.c: automake distributes these files already.
567 2003-09-12 Gary V. Vaughan <gary@gnu.org>
569 Replace the xstrzdup code by importing the xstrndup module from
570 CVS gnulib, along with its dependencies: strndup and strnlen:
572 * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
573 gnulib/config/xstrndup.m4: Import xstrndup module from CVS
575 * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
576 gnulib/config/strndup.m4: Ditto wrt strndup.
577 * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
579 * gnulib/m4/Makefile.am: Add rules from newly imported modules.
580 However, contrary to gnulib, we install xstrndup.h.
581 * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
582 * gnulib/lib/xstrzdup.c: Delete. This was never a gnulib file, it
583 is an artifact of the old m4 portability layer.
584 * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
585 * m4/system_.h: Include xstrndup.h.
586 * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
588 2003-09-11 Gary V. Vaughan <gary@gnu.org>
590 Reimport the latest xalloc module from CVS gnulib, and adjust the
591 m4 sources to take advantage of xalloc xfree. Also create a new
592 macro DELETE with the same semantics as the old m4 XFREE macro,
593 and carefully tweak callers:
595 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
597 * m4/utility.c (xfree): Removed. This function is now supplied by
599 * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
600 * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
601 * m4/symtab.c (m4_symtab_create): Ditto.
602 * m4/system_.h: Removed XFREE redefine.
603 (DELETE): New macro with same functionality as the original m4
604 XFREE macro, but based on xalloc.h now. Changed all callers.
605 * src/main.c (main): Use XMALLOC macro.
606 * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
608 * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
610 2003-09-10 Gary V. Vaughan <gary@gnu.org>
612 Import the xalloc module from CVS gnulib, along with its
613 dependencies: exitfail, malloc and realloc. We had different
614 semantics for our XFREE and a function xfree() not supplied by
615 gnulib, so also a bit of work to keep everything running
618 * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
619 (gl_XALLOC): Use gnulib equivalents.
620 * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
621 gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
622 * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
623 * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
625 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
626 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
627 * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
629 (pkgincdir): Removed. Use pkgincludedir instead.
630 * m4/m4private.h (XFREE): xfree already checks for NULL.
631 * m4/system_.h: Use xalloc module, and remove macros already
632 supplied by xalloc.h.
633 * m4/utility.c (xfree): xalloc does not yet implement xfree, so
634 moved the old definition from m4/xmalloc.c to here for now.
636 2003-09-09 Gary V. Vaughan <gary@gnu.org>
638 Import the error and progname modules from CVS gnulib. Our old
639 error.c subsumed the functionality of both, so a little adjustment
640 was required to accomodate the split in sources. Also added more
641 wrapper macros to choose between a system installed error.h or our
642 shipped gnulib error module:
644 * m4/error.c, m4/error.h: Removed.
645 * m4/Makefile.am: Adjust.
646 (pkgincdir): Removed. Use pkgincludedir instead.
647 * m4/module.h, src/main.c: Don't include `m4/error.h'.
648 * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
650 * gnulib/m4/progname.c: Imported from CVS gnulib.
651 * gnulib/m4/progname.h: Ditto.
652 * src/main.c: Adjust to use progname module.
653 * gnulib/m4/error.c: Imported from CVS gnulib.
654 * gnulib/m4/error_.h: Ditto.
655 * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
656 if appropriate, and link a local error.h if the system version is
658 (libgnu_la_SOURCES) Add progname module sources.
659 * gnulib/config/error.m4: Imported from CVS gnulib.
660 * gnulib/config/strerror_r.m4: Ditto.
661 * config/m4-error.c: New file. Wrap gnulib error.m4 but arrange
662 to have ERROR_H for Makefile substitutions and tell system.h
663 whether the system error.h should be used, or a locally installed
665 * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
667 2003-09-09 Gary V. Vaughan <gary@gnu.org>
669 * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
670 s/gettext_.h/gettext.h/.
672 * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
673 automake have been fixed.
675 * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
676 gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
677 of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
678 rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
680 2003-09-09 Gary V. Vaughan <gary@gnu.org>
682 The gnulib obstack module requires the gnulib gettext module for
683 systems that do not have GNU gettext installed. Because we use
684 -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
685 that directory incase it clashes with the system gettext.h. This
686 delta uses gettext_.h and extra rules in the Makefile to make a
687 link to gettext.h when needed:
689 * Makefile.am (auxdir): Removed. No longer used.
690 * configure.ac (ac_aux_dir): Removed AC_SUBST. No longer used.
691 (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
693 (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
694 Makefile based build.
695 (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
696 of the macros are kept.
697 * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
698 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
699 * config/Makefile (ACLOCAL_MACROS): Removed. Automake 1.7a
700 distributes these automatically.
701 * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
702 warning from automake-1.7a.
703 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
704 m4_CHECK_DEBUGGING for consistency with gnulib prefixes. Changed
706 * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
707 wrt. m4_FUNC_OBSTACK.
708 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
709 wrt. m4_sys_STACKOVF.
710 * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
711 wrt. _m4_LIB_GMP, m4_LIB_GMP.
712 (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
713 namespace. Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
715 * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
716 * gnulib/m4/Makefile.am: Added a new block to make an appropriate
717 gettext.h link on deficient systems.
718 (pkginc_HEADERS): Mention $(GETTEXT_H).
719 (EXTRA_HEADERS): Mention gettext.h.
720 * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
721 * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
722 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
723 gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
724 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
725 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
726 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
727 gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
728 gnulib/config/po.m4, gnulib/config/progtest.m4,
729 gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
730 gnulib/config/ulonglong.m4: Imported from CVS gnulib.
732 2003-09-05 Gary V. Vaughan <gary@gnu.org>
734 We can't mirror the gnulib directory structure here, since we need
735 to be able to eg. `#include <m4/obstack.h>' from our source files,
736 which is much easier if the local obstack.h is created in a
737 directory named m4. Rather than trying to symlink everything into
738 the m4 directory, now we build a libtool convenience library from
739 the sources we get from gnulib and link that with libm4.la:
741 * gnulib/config/extensions.m4: Imported from CVS gnulib.
742 * gnulib/config/unlocked-io.m4: Ditto.
743 * gnulib/m4/unlocked-io.h: Ditto.
744 * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
745 gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
746 * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
747 gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
748 * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
749 * m4/Makefile.am: Adjust.
750 * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
751 macros we redistribute.
752 * gnulib/m4/Makefile.am: New file. Build libgnu.la convenience
753 library among others.
754 (GNULIB_SRCS, GNULIB_MACROS): Removed.
755 * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
756 * config/m4-obstack.m4: Adjust.
757 * po/POTFILES.in: Adjust.
758 * configure.ac: Reformatting. Call newly imported gnulib macros.
759 * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
760 bogus calls of `#include "m4.h"'.
761 * Makefile.am: INCLUDES has been deprecated in favour of
763 * m4/Makefile.am: Ditto.
764 * modules/Makefile.am: Ditto.
765 * src/Makefile.am: Ditto.
767 2003-09-05 Gary V. Vaughan <gary@gnu.org>
769 * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
771 2003-09-04 Gary V. Vaughan <gary@gnu.org>
773 Migrate the obstack support into the gnulib directories for easy
774 synchronisation with upstream files in gnulib:
776 * config/gnu-obstack.m4: Moved from here...
777 * config/m4-obstack.m4: ...to here.
778 * config/Makefile.am (SPECIFIC_MACROS): Adjust.
779 * m4/obstack.c, m4/obstack_.h: Moved from here...
780 * gnulib/obstack.c, gnulib/obstack.h: ...to here.
781 * po/POTFILES.in: Adjust.
782 * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
783 * m4/Makefile.am: Add a whole new section to link the obstack
784 sources from the gnulib tree if necessary.
785 * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
787 * config/m4-obstack.m4: Rewrite as a wrapper for
788 gnulib/m4/obstack.m4.
790 2003-09-04 Gary V. Vaughan <gary@gnu.org>
792 GNU M4 currently builds with a number of files adapted from
793 upstream sources. Recently the gnulib project on savannah.gnu.org
794 has pulled together a great many of these externally maintained
795 files. This delta is the beginnings of isolating those files
796 maintained in gnulib to make it easy to synchronise M4 with the
797 upstream files prior to releases.
799 * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
801 (SUBDIRS): Added new gnulib subdirectory.
802 * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
803 * config/stdbool.m4: Moved from here...
804 * gnulib/m4/stdbool.m4: ...to here.
805 * m4/stdbool_.h: Moved from here...
806 * gnulib/lib/stdbool_.h: ...to here.
807 * gnulib/Makefile.am: New file. Make sure the gnulib tree is
809 * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
810 code to work with new stdbool_.h location.
811 (gnulib_srcdir): New.
813 2003-09-04 Gary V. Vaughan <gary@gnu.org>
815 * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
816 (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
818 (SPECIFIC_TOOLS): New variable. Moved mkstamp to here.
819 (EXTRA_DIST): Use it.
821 * bootstrap: CVS autoreconf leaves file droppings. Remove
822 aclocal.m4t incase autoreconf doesn't.
824 2003-08-29 Gary V. Vaughan <gary@gnu.org>
826 * m4/gnu-obstack.h: Updated from CVS gnulib. For consistency with
827 the other gnulib imports, renamed to m4/obstack_.h.
828 * m4/obstack.c: Updated from CVS gnulib.
829 * m4/Makefile.am (EXTRA_HEADERS): Adjust.
830 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
831 header tests from gnulib obstack module. AC_CONFIG_LINKS knows
832 about vpath already, and $top_srcdir upsets CVS Automake, so the
833 $top_srcdir reference was removed.
835 * m4/system-h.in: For consistency with the gnulib imports, renamed
837 * m4/Makefile (EXTRA_HEADERS): Adjust.
838 * configure.ac (AC_CONFIG_FILES): Adjust.
840 * m4/stdbool_.h: New file from gnulib for systems without their
842 * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
843 * config/stdbool.m4: New file. Macros from gnulib for same.
844 * configure.ac: Use it.
846 2003-08-27 Gary V. Vaughan <gary@gnu.org>
848 * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
849 * config/gmp.m4: Ditto.
850 * config/gnu-obstack.m4: Ditto.
851 * config/stackovf.m4: Ditto.
852 * m4/builtin.c: Ditto.
856 * m4/gnu-obstack.h: Ditto.
861 * m4/m4module.h: Ditto.
862 * m4/m4private.h: Ditto.
864 * m4/module.c: Ditto.
865 * m4/obstack.c: Ditto.
866 * m4/output.c: Ditto.
870 * m4/strtol.c: Ditto.
871 * m4/symtab.c: Ditto.
872 * m4/syntax.c: Ditto.
873 * m4/utility.c: Ditto.
874 * m4/xmalloc.c: Ditto.
875 * m4/xstrdup.c: Ditto.
876 * m4/xstrzdup.c: Ditto.
877 * modules/evalparse.c: Ditto.
878 * modules/format.c: Ditto.
879 * modules/gnu.c: Ditto.
880 * modules/import.c: Ditto.
881 * modules/load.c: Ditto.
882 * modules/m4.c: Ditto.
883 * modules/m4.h: Ditto.
884 * modules/modtest.c: Ditto.
885 * modules/mpeval.c: Ditto.
886 * modules/perl.c: Ditto.
887 * modules/shadow.c: Ditto.
888 * modules/stdlib.c: Ditto.
889 * modules/time.c: Ditto.
890 * modules/traditional.c: Ditto.
891 * src/freeze.c: Ditto.
892 * src/getopt.c: Ditto.
893 * src/getopt1.c: Ditto.
896 * src/stackovf.c: Ditto.
898 * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
899 ac_default_headers is an autoconf internal variable.
900 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
901 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
903 * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
904 * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
907 2003-08-15 Gary V. Vaughan <gary@gnu.org>
909 * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
911 * system-h.in (m4_boolean): Removed in favour of using C99 bool if
912 possible or faking one with a typedef. Changed all callers.
914 2003-08-15 Gary V. Vaughan <gary@gnu.org>
916 Still cleaning up the users' module API, by taking out the stuff
917 that isn't used by any existing modules, and moving specialised
918 functions out of libm4 and into the module they are used by.
920 * m4/m4module.h (m4_skip_space): No need to export this. Moved...
921 * m4/utility.c (m4_skip_space): ...to here the home of its only
922 use, made static and renamed to `skip_space'. Changed all
924 * m4/m4module.h (m4_expand_ranges): Removed prototype.
925 * m4/utility.c (m4_expand_ranges): Moved definition from here...
926 * modules/m4.c (m4_expand_ranges): ...to here, and exported using
928 * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
930 * modules/gnu.c (builtin_syntax): Import and use in this
931 builtin implementation.
932 * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
934 * m4/macro.c (trace_flush): Except here where the macro is now
936 * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
937 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
939 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
940 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
942 2003-08-14 Gary V. Vaughan <gary@gnu.org>
944 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
945 compiler based AC_CHECK_HEADER that was introduced in
947 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
948 * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
949 * configure.ac: Use renamed M4_AC_LIB_GMP.
951 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
952 macro that requires arguments! This stops the shell's bad
953 substitution error at configure time.
955 * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
956 variables to the testsuite shell. Set the value of USE_GMP so
957 that the gmp test will run!
958 (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
960 2003-08-11 Gary V. Vaughan <gary@gnu.org>
962 Libltdl already has an excellent mechanism for accessing C symbols
963 in modules. Lets use that! Remove all the exporting cruft and
964 just use lt_dlsym in conjunction with a few conventions to
965 simplify module writers' jobs. Also removed the table address
966 caching code and otherwise simplified the module loader quite a
967 bit. To access exported symbols in other modules, first the
968 exporting module must name the symbols <modname>_LTX_<symname>,
969 and the importing module must define a function type called
970 <symname>_func. The importer then adds
971 M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
972 that wishes to call out to the exported functions. Care must be
973 taken that <symname> is non-NULL in the importing module incase
974 M4_MODULE_IMPORT fails, but otherwise it can be called as if the
975 definition was in the importers source. Study
976 `modules/{gnu.c,m4.{c,h}' for a model example. At the moment,
977 m4_module_import will attempt to automatically load a module
978 required for symbol access if it is not loaded already.
980 * TODO: Removed the items fixed in this delta.
981 * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
983 * m4/ltdl.h (lt_dlhandle_find): Declare it.
984 * m4/module.c (m4_module_unload): Use it.
985 * src/freeze.c (reload_frozen_state): Ditto.
986 * m4/m4module.h (m4_export): Deleted. Removed all references.
987 (M4_MODULE_IMPORT): New user convenience macro for importing
988 arbitrary symbols from other modules.
989 * m4/module.c (m4_module_import): New function to service
990 M4_MODULE_IMPORT macro.
991 (module_data): Removed. Looking up the tables on demand with
992 lt_dlsym, rather than caching their addresses here simplifies the
994 (m4_get_module_builtin_table, m4_get_module_macro_table):
995 Removed. Changed all callers.
996 (set_module_macro_table, set_module_builtin_table): Renamed to
997 install_macro_table and install_builtin_table respectively, and
998 simplified now that the cache is no more.
999 * modules/gnu.c (builtin_symbols): Use this new mechanism to
1000 import m4_dump_symbols from the m4 module.
1001 (builtin_esyscmd): Likewise for m4_set_sysval and
1003 * modules/m4.c (m4_export_table): Removed. Functions are
1004 addressed with the new mechanism which doesn't need this.
1005 (m4_set_sysval): New exported accessor function to prevent
1006 problems with variable access on inferior architectures.
1007 * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
1008 (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
1009 that we can have some type safety.
1010 * modules/modtest.c (export_test): C level exported function for
1011 testing the new import mechanism.
1012 * modules/import.c: New file for the import end of the test.
1013 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
1014 * tests/modules.at: New test cases for intermodule symbol
1017 2003-08-07 Gary V. Vaughan <gary@gnu.org>
1019 * m4/m4module.c (m4_string): Moved from here...
1020 * m4/m4private.c (m4_string): ...to here.
1022 * m4/utility.c (dumpdef_cmp): Removed stale declaration.
1024 2003-07-29 Gary V. Vaughan <gary@gnu.org>
1026 * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
1027 already available to module writers through
1028 m4_{get,set}_nesting_limit_opt(), so moved from here...
1029 * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
1030 (m4_create): Use it.
1032 2003-07-28 Gary V. Vaughan <gary@gnu.org>
1034 Aside from auditing path.c for m4module.h api obfuscation, this
1035 delta introduces the concept of private struct members in opaque
1036 data types to GNU m4: See the STYLE file for details.
1038 * TODO: Remind ourselves that a rewrite of path.c is needed.
1039 * m4/m4module.h (m4_search_path, struct m4_search_path_info):
1041 * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
1042 here and renamed. These type definitions are for internal api use
1043 only. Changed all callers.
1044 * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
1046 * m4/path.c (search_path_env_init, search_path_add): ...to here
1047 and renamed. These calls were never used outside this file.
1048 Changed all callers.
1049 (dirpath): Moved functionality of this static declaration...
1050 * m4/m4private.h (struct m4): ...to this new internal only
1051 search_path field. Changed all callers.
1052 (m4__get_search_path): Added new internal api accessor.
1053 * m4/path.c (m4_search_path_info_new): Removed. Not used.
1054 (m4_include_init): Removed...
1055 * m4/m4.c (m4_create): ...because the new m4 field is now
1057 (m4_delete): Recycle search_path memory.
1058 * src/main.c (main): Don't call m4_include_init now that it's
1060 * doc/STYLE: Document convention for private fields in opaque
1063 2003-07-24 Gary V. Vaughan <gary@gnu.org>
1065 Sometimes exporting the address of a symbol from a module isn't
1066 enough for other modules to call that symbol correctly. If
1067 custom data types are used for function parameters, they need to
1068 be known to the caller. This change introduces the concept of
1069 $(prefix)/include/modules/$(modulename).h to declare those
1070 structures. Also we move m4_dump_symbols from libm4 to the m4
1071 module to show this concept in action.
1073 * m4/m4module.h (m4_dump_symbol_data): Moved from here...
1074 * modules/m4.h (m4_dump_symbol_data): ...to this new file for
1075 exporting data structures from modules/m4.c.
1076 * modules/m4.c, modules/gnu.c: Include it.
1077 * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
1078 * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
1080 * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
1082 * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
1083 ...to here, with slight renaming.
1084 (m4_export_table): Prototype and add m4_dump_symbols.
1085 * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
1086 definition of m4_dump_symbols.
1087 * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
1088 * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
1090 2003-07-24 Gary V. Vaughan <gary@gnu.org>
1092 Create an export table in modules/m4.c in readiness for beefing up
1093 the module loader to track module exports and imports.
1095 * m4/m4module.h (m4_debug_flush_files): Removed prototype.
1096 * m4/debug.c (m4_debug_flush_files): Moved...
1097 * modules/m4.c (m4_sysval_flush): ...to here and renamed.
1098 * modules/gnu.c (builtin_esysval): Use it.
1099 * m4/m4module.h (m4_export): New type for declaring module symbols
1101 * modules/m4.c (m4_export_table): List symbols exported from this
1102 module for use by other modules.
1104 2003-07-24 Gary V. Vaughan <gary@gnu.org>
1106 An experiment: There is loads of code in libm4 which should be in
1107 the m4 module, but is also used by another module. Just because
1108 some linkers won't cope with calls across dynamic runtime loaded
1109 objects I initially left the code in libm4. It will tidy the
1110 module api immensely if this code moves to the right place, I just
1111 need to remember to invent a suitable calling mechanism at some
1112 point. For now, only modules that are statically linked and
1113 preloaded will get this treatment, so the only platforms that will
1114 break are those that require all symbols to be resolved at link
1117 * TODO: Reminder that what I am doing could reduce portability
1118 unless I do something more robust later.
1119 * m4/m4module.h (m4_sysval): No longer exported from libm4.
1120 * m4/utility.c (m4_sysval): No longer declared in libm4.
1121 * modules/Makefile.am: Reformatting.
1122 * modules/m4.c (m4_sysval): Declare it at place of use.
1123 * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
1125 2003-07-23 Gary V. Vaughan <gary@gnu.org>
1127 * m4/m4module.h: Reformatting and rearranging lines a bit.
1128 (m4_obstack): Save typing by typedefing `struct obstack'. Changed
1130 (m4_call_macro, m4_expand_input): Renamed...
1131 (m4_macro_call, m4_macro_expand_input): ...to these. Changed all
1133 (m4_expansion_level, m4_process_macro): Moved...
1134 * m4/macro.c (expansion_level, process_macro): ...to here, and
1137 * m4/m4module.h (program_name): Not used by modules at all, so
1139 * src/main.c (program_name): ...to here.
1140 (print_program_name): Renamed...
1141 (print_program_name_CB): ...to conform to the STYLE guide.
1143 2003-07-23 Gary V. Vaughan <gary@gnu.org>
1145 More refactoring of the m4module.h API. Replace #defines with an
1146 enum, and move non-public functions out of the public API.
1148 * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
1150 * m4/macro.c (stdarg.h): Add ANSI C variadic header.
1151 * m4/debug.c (m4_debug, trace): Moved...
1152 * m4/m4private.h (struct m4): ...to fields of this struct.
1153 (m4_get_debug_file, m4_get_trace_messages): New fast access macros
1155 * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
1156 * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
1157 * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
1158 * m4/m4module.h (m4_context_field_table): Add entries for new
1159 debug_file and trace_messages fields.
1160 (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
1161 (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
1162 (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
1163 (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
1164 (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
1165 (m4_is_debug_bit): New macro to simplfy checks against the debug
1167 (m4_trace_format, m4_trace_header, m4_trace_flush)
1168 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
1170 * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
1171 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
1172 * m4/macro.c (trace_format, trace_header, trace_flush)
1173 (trace_prepre, trace_pre, trace_post): ...to these newly static
1174 functions, since they are only ever used from this file. Changed
1177 2003-07-17 Gary V. Vaughan <gary@gnu.org>
1179 Change the macros for checking syntax so that matching against
1180 multiple possible syntax classes can be done with a single
1181 comparison some of the time. The various classes are now bits of
1182 an int that can be checked with bitwise logic operators.
1184 * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
1185 (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
1186 (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
1187 (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
1188 (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
1189 (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
1190 (M4_SYNTAX_ALNUM): Removed. Changed all callers.
1191 (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
1192 (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
1193 (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
1194 (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
1195 Replace all calls with invocations of these...
1196 (m4_is_syntax, m4_has_syntax): ...New macros.
1197 * src/freeze.c (produce_syntax_dump): Remove mask argument, which
1198 is no longer required with new macros. Changed all callers.
1200 2003-07-15 Gary V. Vaughan <gary@gnu.org>
1202 * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
1203 values are returned as part of the internal interface, so they
1205 * m4/private.h: ...to here.
1206 * m4/macro.c (expand_token): Check for out of range
1207 m4_peek_input() results before looking up in the syntax table.
1208 (collect_arguments): Ditto.
1210 * NEWS: Note `$' syntax class.
1212 2003-07-08 Paul Eggert <eggert@twinsun.com> and
1213 Gary V. Vaughan <gary@gnu.org>
1215 Conform to POSIX if the POSIXLY_CORRECT environment is set.
1216 --traditional `define' now smashes all the definitions.
1218 * NEWS: Explain this.
1219 * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
1220 (Extensions): Explain that extensions that are incompatible with
1221 POSIX are disabled if POSIXLY_CORRECT is set.
1222 (Incompatibilities): Remove.
1223 (Define, Other Incompat): Explain difference
1224 between GNU and POSIX behavior of define, pushdef, popdef.
1225 * m4/m4.c (m4_get_posixly_correct_opt): New undef.
1226 * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
1227 * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
1228 (m4_get_posixly_correct_opt): New macro.
1229 * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
1231 * modules/m4.c (builtin_functions): defn now takes any number of args.
1232 (builtin_define): Smash all the definitions if
1234 (builtin_defn)): Allow any number of arguments.
1235 (builtin_undivert): Do not allow nonnumeric arguments
1237 * src/main.c (main): Set posixly-correct behavior if either
1238 POSIXLY_CORRECT is set, or if -G is given.
1239 * tests/builtins.at: New test for smashed definitions.
1241 2003-06-27 Gary V. Vaughan <gary@gnu.org>
1243 * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
1244 * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
1245 not to slow the parser down.
1246 (M4__IS_STRING): New macro to test string syntax class membership.
1247 * m4/syntax.c: Adjust docucomment.
1248 (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
1249 (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
1250 * m4/input.c (init_builtin_token): Comment typo.
1251 (m4__next_token): Comment typo.
1252 Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
1253 by using the new M4__IS_STRING macro.
1254 * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
1255 variable references in macro expansions.
1257 * doc/m4.texinfo (Eregexp and Regexp): Typo.
1258 (Epatsubst and Patsubst): Typo.
1261 2003-06-26 Gary V. Vaughan <gary@gnu.org>
1263 Move the global variables that pertain to syntax to a new `struct
1264 m4_syntax_table', and then add one of these to `struct m4'. The
1265 ripple effect through the code to both change formerly global
1266 references, and make sure a suitable context is available in
1267 lexical scope is disproportionately large compared to the size of
1268 the change proper. This change is a large part of decoupling
1269 syntax.c from the rest of the code that uses it.
1271 * m4/m4private.h (struct m4): Add a syntax field.
1272 * m4/m4.c (m4_create): Initialise it,
1273 (m4_delete): Recycle it.
1274 (m4_get_symtab): Remove hand coded version...
1275 (m4_get_symbol_table): ...and generate this with cpp. Changed all
1277 * m4/m4module.h (m4_context_field_table): Add an extra field so we
1278 can generate m4_get_symbol_table. Add a new row for
1279 m4_get_syntax_table.
1280 (M4SYNTAX): Syntactic sugar for module writers.
1281 (m4_symtab): Renamed to m4_symbol_table. Changed all callers.
1282 (m4_syntax_table): New home for syntax related formerly global
1284 * m4/m4private.h (struct m4_syntax_table): Define it.
1285 * m4/input.c (m4_input_init): Initialisation of these formerly
1286 global variables moved...
1287 * m4/syntax.c (m4_syntax_create): ...to here.
1288 * m4/input.c (m4_input_exit): And similarly, recycling of the
1289 memory used by those values moved...
1290 * m4/syntax.c (m4_syntax_delete): ...to here.
1291 * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
1292 Moved to m4/m4private.h.
1293 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
1294 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
1295 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
1296 (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
1297 objects. Changed all callers that used to directly access the
1299 (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
1300 Removed and incorporated into m4_syntax_table structure.
1301 * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
1302 * m4/syntax.c (m4_set_syntax): Now returns an error status,
1303 instead of requiring a `struct m4' to generate its own errors.
1304 Changed all callers.
1305 * src/main.c (main): Now that the syntax table is initialised as
1306 part of m4_create, we have to manually wipe the syntax entries if
1307 we are about to read a frozen file.
1309 2003-06-26 Gary V. Vaughan <gary@gnu.org>
1311 * doc/STYLE: Added notes on callback naming schemes.
1313 * m4/module.c (m4_set_module_macro_table)
1314 (m4_set_module_builtin_table): Declarations weren't changed when
1315 definitions were renamed on 2003-06-19.
1317 * m4/hash.c (m4_hash_resize): ifdefed out. This function is
1318 neither used nor particularly appropriate since it exposes the
1319 internal workings of the hash module. I haven't yet decided
1320 whether to remove it entirely.
1322 2003-06-20 Gary V. Vaughan <gary@gnu.org>
1324 Two related changes, and a huge knockon effect throughout the
1325 source: Moved the option variables out of global space and into
1326 `struct m4'; made `m4_symtab' a real datatype, so that its api
1327 is not marred passing `struct m4' around just so it can decide
1328 whether to keep traced symbol names or not. Added setters and
1329 getters for the formerly global option variables, and obviously
1330 changed a vast number of functions to take a `struct m4' and use
1331 the getter funcs to find option values.
1333 * m4/utility.c (interactive, sync_output, debug_level)
1334 (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
1335 (max_debug_argument_length, warning_status, nesting_limit)
1336 (discard_comments): Removed.
1337 * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
1338 (debug_level, max_debug_argument_length, prefix_all_builtins)
1339 (suppress_warnings, discard_comments, interactive, sync_output):
1340 Removed from here...
1341 * m4/m4private.h (struct m4): ...and equivalent fields added to
1343 (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
1344 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
1345 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
1346 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
1347 (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
1348 macros for the new fields.
1349 * m4/m4module.h (m4_context_field_table)
1350 (m4_context_opt_bit_table): Helper macros used to generate
1351 prototypes, setters and getters for new option fields
1353 * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
1354 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
1355 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
1356 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
1357 (m4_get_interactive_opt, m4_get_sync_output_opt)
1358 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
1359 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
1360 (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
1361 (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
1362 (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
1363 setter and getter functions generated by cpp from
1364 m4_context_field_table and m4_context_opt_bit_table, exported as
1365 part of the module api. Changed all callers.
1366 * m4/symtab (struct m4_symtab): Used as the concrete type for
1368 (m4_symtab_create): Allocate and initialise a new struct.
1369 (m4_symtab_apply): New function that works like m4_hash_apply, but
1370 with different callbacks specific to symbol tables. Changed all
1372 (symbol_destroy, arg_destroy, arg_copy): Renamed
1373 symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
1374 they have unused parameters for a reason!
1375 (dump_symbol_CB): New callback to dump the contents of a single
1377 (symtob_dump): Rewritten in terms of dump_symbol_CB.
1378 * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
1379 Changed all callers.
1380 * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
1381 of the contained `m4_symtab' at the `no_gnu_extensions' field.
1382 Although I'm not convinced these semantics are correct, they are
1383 at least consistent with how things were before this delta. Also
1384 set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
1386 2003-06-19 Gary V. Vaughan <gary@gnu.org>
1388 Tie down the interface to libm4 some more. Make more structures
1389 opaque to modules by moving them to m4private.h, and writing
1390 setters and getters. To win back the speed penalty for doing this
1391 also wrote macroized versions that do know about structure layout
1392 in m4private.h and #include that file into modules when NDEBUG is
1393 defined at compile time. There are still some accessor macros in
1394 m4private.h that need to go, but that is not necessary to clean
1397 * m4/m4module.h (m4_symbol_type): Moved...
1398 * m4/m4private.h (m4__symbol_type): ...to here.
1399 * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
1400 (m4_set_symbol_traced, m4_set_symbol_name_traced)
1401 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
1402 (m4_get_symbol_func, m4_symbol_value_create)
1403 (m4_symbol_value_delete, m4_set_symbol_value_text)
1404 (m4_set_symbol_value_func): New exported api to symbols.
1405 (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
1406 and m4_is_symbol_value_func.
1407 * m4/m4module.h: Prototype these guys.
1408 * m4/module.c (m4_set_module_macro_table)
1409 (m4_set_module_builtin_table): Make these static, there is no
1410 reason to pollute the api with them.
1411 * m4/m4private.h: Reformatting.
1412 (m4_get_symtab): Only define when NDEBUG is defined.
1413 (m4_get_symbol_value, m4_get_symbol_traced)
1414 (m4_set_symbol_traced, m4_set_symbol_name_traced)
1415 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
1416 (m4_get_symbol_func, m4_symbol_value_create)
1417 (m4_symbol_value_delete, m4_set_symbol_value_text)
1418 (m4_set_symbol_value_func): Macro implementations of the new
1419 functions when NDEBUG is defined.
1420 (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
1421 (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
1422 Superceded by the above. All callers changed.
1423 (M4ARG): Removed. This is no longer different to the
1424 m4/m4module.h definition.
1425 * modules/gnu.c, modules/m4.c: Only include m4private.h when
1426 NDEBUG is defined. That way we exercise the same (albeit slower)
1427 api that external modules must use.
1429 2003-06-18 Gary V. Vaughan <gary@gnu.org>
1431 Renamed some of the types and their accessors to make more sense.
1432 Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
1433 has a stack of SYMBOL_VALUEs.
1435 * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
1436 (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
1437 m4_get_symbol_value_type, m4_get_symbol_value_text,
1438 m4_get_symbol_value_func and m4_symbol_value_copy respectively.
1439 Changed all callers.
1440 (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
1441 (m4_get_token_type): Renamed
1442 * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
1443 to the internal api.
1444 * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
1446 (m4__symtab_init, m4__symtab_exit): Removed prototypes.
1447 (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
1448 (m4__token_type): Moved here from m4module.h.
1449 (m4__next_token): Renamed from m4_next_token.
1450 * m4/symtab.c: Removed some of the parameterised macro support
1451 functions for modularisation later.
1452 (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
1453 m4_hash_dup to perform a true deep copy of the SRC.
1454 (arg_copy): Callback for m4_symbol_value_copy.
1455 * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
1456 Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
1457 m4_get_symbol_value_func. Changed all callers.
1459 2003-06-18 Gary V. Vaughan <gary@gnu.org>
1461 Tidy up style of hash.[ch] in accordance with doc/STYLE.
1463 * m4/hash.c: Internal symbol renaming and formatting.
1464 (m4_hash_dup): New function to facilitate deep copies of hash
1466 (m4_hash_apply_func): Returns a void* now, which is a richer type
1467 for returning exceptions (NULL means keep going).
1468 (m4_hash_apply): Ditto.
1469 * m4/hash.h: Declare exported symbols with an explicit extern.
1472 2003-06-17 Gary V. Vaughan <gary@gnu.org>
1474 Still refactoring furiously. This delta represents a change in
1475 semantics to symtab.c. Instead of building temporary m4_tokens
1476 in the caller, and copying fields in the methods, we now create
1477 the actual m4_token for hashing in the caller so the methods just
1478 slot them in directly. Also, this means that we don't lookup a
1479 symbol and get back an allocated but VOID token to copy fields
1480 into, we create the token we want to push and pass that to
1481 m4_symbol_define or m4_symbol_pushdef. And that's it. There are
1482 a few other small changes to stop knowledge of the implementation
1483 of symtab.c leaking out into other files.
1485 * m4/macro.c (expand_argument): Comment typo corrected.
1486 * m4/symtab.c (symtab_fetch): New function to fetch the address of
1488 (m4_symbol_pushdef): Take an extra value parameter and use this
1489 directly as the new top of the value stack. All callers changed
1490 to build a token and pass responsibility for memory in, rather
1491 than copying as we used to.
1492 (m4_symbol_define): Also use the new value parameter directly as a
1493 replacement for the top of the value stack. All callers changed
1494 to build a token as above.
1495 (m4_set_symbol_traced): New function to set the traced bit on the
1496 named symbol, creating it if necessary.
1497 (symbol_popval): The guts of the old m4_symbol_popdef.
1498 (m4_symbol_popdef): Use it.
1499 * m4/builtin.c (m4_symbol_set_token): Removed,
1500 (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
1502 * m4/module.c (m4_set_module_builtin_table)
1503 (m4_set_module_macro_table): ...with these more orthogonal
1505 * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
1506 (m4_builtin_pushdef, m4_builtin_define): Removed. No longer
1508 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
1509 (m4_arg_signature_parse): Moved...
1510 * m4/symtab.c: ...to here.
1511 * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
1512 screw something up. Moved...
1513 * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
1514 actually does a proper deep copy of source to dest.
1516 2003-06-16 Gary V. Vaughan <gary@gnu.org>
1518 Further refactoring to stabilise the module API. Renaming some
1519 functions for orthogonality, and judicious definition migration to
1520 move things out of the set of exported symbols.
1522 * doc/STYLE: New file. Notes on coding style.
1523 * m4/m4module.c: Updated bitrotted docucomment at the top of the
1525 (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
1526 m4_get_module_name, m4_get_module_builtin_table,
1527 m4_get_module_macro_table which are verb phrases. Changed all
1529 * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
1531 * m4/module.c (m4_set_module_builtin_table)
1532 (m4_set_module_macro_table): ...here, and renamed. Changed all
1534 * m4/m4module.c (m4_module_data): This...
1535 * m4/m4private.c (struct m4_module_data): ...and this...
1536 * m4/module.c (module_data) ...consolidated here and no longer
1537 exported. Changed all callers.
1539 2003-06-16 Gary V. Vaughan <gary@gnu.org>
1541 Begin work on lifting the curse of the global variables. To start
1542 with create a `struct m4' context container, and replace
1543 `m4__symtab' with `context->symtab' throughout. This means
1544 initialising a context container in main, and adjusting many
1545 functions between main and the module entry points so that the
1546 container gets passed through. It would have been nice to
1547 defer this until after 1.5, but it has a major effect on the
1548 user's module writing ABI, so it needs to be addressed now - at
1549 least in the areas that impact the ABI. An interrelated change
1550 in the symtab API removes the dependency on a global symbol table,
1551 and instead focuses on a passed table (from the context
1554 * TODO: Reminders for finishing context functionality.
1555 * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
1556 * m4/m4.c: New file. Manage new struct m4 objects to eliminate
1557 global variables and eventually allow m4 to be reentrant.
1558 * m4/m4private.h (m4): Define the new structure here...
1559 (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
1560 don't carry the overhead of a function call.
1561 * m4/m4module.h: Prototype extern functions from m4/m4.c.
1562 (m4): Declare type for new struct m4 objects.
1563 (M4SYMTAB): User macro to ease finding the symbol table for the
1564 current context for module developers.
1565 (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
1567 (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
1568 (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
1569 (m4_call_macro, m4_dump_symbols, m4_expand_input)
1570 (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
1571 (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
1572 (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
1573 m4* context parameter. Changed definitions and all callers.
1574 (m4_symtab): Alias for m4_hash to decouple the
1575 m4_symtab api from m4_hash.
1576 (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
1578 (m4_symtab_create): New function to return an initialised
1580 (m4_symtab_delete): New function to delete an m4_symtab's memory.
1581 (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
1582 (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
1583 instead of simply using the global m4__symtab. Changed
1584 definitions and all callers.
1585 * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
1586 * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
1587 * src/main.c (main): Create a context and use that instead of the
1588 former global m4__symtab.
1590 2003-06-13 Gary V. Vaughan <gary@gnu.org>
1592 * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
1593 to the callback. Callbacks should not need to hardcode the
1594 hashtable they are working from, nor should we have to waste the
1595 userdata parameter to pass the table in.
1596 * m4/hash.h (m4_hash_apply_func): Require the initial table
1598 * m4/symtab.c (symtab_destroy): Use the passed table instead
1599 of hardcoding m4__symtab.
1600 (m4_symbol_popdef): Don't use the userdata parameter to pass the
1601 table to arg_destroy.
1602 (arg_destroy): Use the hash parameter, ignore userdata.
1603 * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
1605 (traceon, traceoff): Call set_trace with the extra initial
1608 2003-06-13 Gary V. Vaughan <gary@gnu.org>
1610 More refactoring to stabilise the module api, this time for
1611 symtab.c. Additionally, start to pay attention to function names
1612 that don't contain a verb like they should.
1614 * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
1615 wrapper for m4_hash_apply to decouple the symtab module from the
1617 (m4_symbol_builtin, m4_symbol_macro): Renamed to
1618 m4__symbol_set_builtin and m4__symbol_set_macro. Changed all
1620 (m4_symbol_delete): Create a macro version to save a function
1622 (m4_token_t, m4_data_t): These violate the POSIX reserved
1623 namespace. Renamed to m4_token_type and m4_symbol_type. Changed
1625 (m4_token_type): Renamed to m4_token_get_type.
1626 (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
1627 (m4_symtab_exit): Removed from the exported module
1629 * m4/m4private.h (m4__symtab, m4__symtab_init)
1630 (m4__symtab_remove_module_references, m4__symtab_exit): ...and
1631 renamed and added to the internal api. Changed all callers.
1632 (m4_symtab_apply): A faster macro version of the function for
1633 users of the internal api.
1634 * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
1635 symbol_destroy and arg_destroy.
1636 (symtab_debug): Added a prototype.
1637 (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
1638 so that callers in this file get the faster macro versions from
1641 2003-06-12 Gary V. Vaughan <gary@gnu.org>
1643 Refactoring modules to rationalise the API into an external
1644 documented (eventually!) API for use by modules in the `m4_'
1645 namespace declared in m4/m4module.h, an internal API between the
1646 source files we ship (including our shipped modules) in the `m4__'
1647 namespace declared in m4/m4private.h and making the rest as
1648 cohesive as possible with liberal use of the `static' keyword.
1649 This change represents an audit to m4/module.c along these
1652 * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
1653 Removed. No longer used.
1654 (m4_module_close): Removed prototypes.
1655 (m4_module_init, m4_module_open, m4_module_unload_all): Removed
1656 from the exported module api...
1657 * m4/m4private.h (m4__module_init, m4__module_open)
1658 (m4__module_exit): ...and renamed and added to the internal api.
1659 Changed all callers.
1660 (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
1661 Centralised definitions after renaming...
1662 * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
1663 (M4_FINISH_SYMBOL): ...and removing from here.
1664 (m4_module_dlerror, m4_module_remove, m4_module_close)
1665 (m4_caller_id): Not exported at all, so renamed to module_dlerror,
1666 module_remove, module_close and caller_id.
1667 (MODULE_SELF_NAME): New macro to make reporting self errors
1669 (m4_module_load, module_close, module_remove): Use it.
1670 * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
1672 * src/main.c (main): Use it.
1674 2003-06-12 Gary V. Vaughan <gary@gnu.org>
1676 * README: Remove references to --enable-changeword, which has been
1677 removed from the code.
1679 2003-06-11 Gary V. Vaughan <gary@gnu.org>
1681 Getting rid of the annoying bug with configure --enable-debug,
1682 which spewed -e: command not found errors. This was an interaction
1683 between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
1684 You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
1685 branch-1-5) to get the full fix.
1687 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
1688 of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
1689 and then use the probed value of $SED.
1690 (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
1691 this, it messes up the AC_REQUIRE stack.
1693 2003-06-10 Gary V. Vaughan <gary@gnu.org>
1695 * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
1696 the destroy callback.
1697 (m4_arg_destroy): Use the hash address to free the hash node key
1700 2003-06-06 Gary V. Vaughan <gary@gnu.org>
1702 First cut at formal parameters in macros.
1704 * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
1705 * m4/xstrzdup.c: New file.
1706 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
1707 associative array of parameter names to details.
1708 (m4_symbol_token): Capture macro names with parameter lists.
1709 (m4_arg_signature_parse): And build an associative array to hang
1710 from the symbol structure to map names to details.
1711 * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
1712 m4_hash_resize idiom. Now that we potentially add a little hash
1713 table to many of the entries in the symbol table, added an extra
1714 arg to set the initial size. Changed all callers.
1715 (m4_hash_apply): New function that is basically a generalised
1717 * m4/symtab.c (m4_symbol_apply): ...this. Now deleted. Adjusted
1718 all callers to call m4_hash_apply instead.
1719 (m4_arg_destroy): Recycle memory used by an m4_token_arg.
1720 (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
1721 m4_arg_signature association that might be attached to the symbol,
1722 * m4/hash.h (m4_hash_apply_func): Replacement type for...
1723 * m4/m4module.h (m4_symtab_apply_func): ...this. Now deleted.
1724 (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
1726 (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
1727 (M4_IS_IDENT): Detect characters that can be safely used in
1729 * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
1730 * m4/macro.c: Corrected grammar in some comments. Use `token'
1731 rather than `td' for m4_token variables.
1732 (m4_process_macro): If we find a dollar followed by some
1733 M4_IS_IDENT characters, replace that with the contents of the argv
1734 entry with offset stored in the m4_token_arg associated with the
1735 collected identifier.
1737 2003-06-05 Gary V. Vaughan <gary@gnu.org>
1739 Begin preparations for supporting formal parameters in m4 macros.
1741 * m4/m4private.h (struct m4_token_arg): Placeholder for holding
1742 the details of a formal parameter.
1743 (m4_token): Add an arg_signature member to hold a hash table for
1744 looking up formal parameters.
1745 * m4/input.c: Update more bitrotted comments.
1746 (m4_push_builtin): Initialise arg_signature member.
1747 (init_builtin_token): Copy arg_signature member.
1748 * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
1749 (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
1751 * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
1752 (m4_macro_pushdef, m4_macro_define): ...these, And...
1753 (m4_symbol_token): ...wrapped around this new function, which
1754 vastly simplifies the arguments required by the functions it
1756 Changed all callers.
1758 2003-06-05 Gary V. Vaughan <gary@gnu.org>
1760 * m4/macro.c: Format changes.
1762 2003-06-04 Gary V. Vaughan <gary@gnu.org>
1764 * m4/input.c: Updated various bitrotted comments.
1765 (m4_push_builtin): Just pass the whole m4_token, rather than
1766 extracting all the fields in the caller. This also allows us to
1767 check the token type for consistency.
1768 (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
1769 Renamed to builtin_funcs, builtin_peek, builtin_read,
1770 m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
1771 the code. Changed all callers.
1772 (struct input_block): Similarly renamed u_m member to u_b, and
1773 changed all callers.
1774 (m4_next_token): Use bzero to initialise the data fields.
1775 * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
1777 2003-05-29 Gary V. Vaughan <gary@gnu.org>
1779 These changes were necessary to get m4 to build on my iBook
1780 running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
1781 (GCC) 3.1 20020420 (prerelease)":
1783 * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
1784 inclusion of module loader headers.
1785 * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
1786 * m4/Makefile.am: Ditto.
1787 (libm4_la_LIBADD): Added $(LTLIBINTL).
1788 * m4/utility.c (program_name): Removed declaration in favour of
1789 the one already in error.c!
1790 * m4/m4module.h (program_name): Define to program_invocation_name
1791 when using GNU C library. Use an explicit extern declaration.
1792 (interactive, sync_output, debug_level, hash_table_size)
1793 (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
1794 (suppress_warnings, warning_status, nesting_limit, discard_comments)
1795 (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
1796 (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
1797 (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
1798 (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
1799 (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
1800 (m4_expansion_level, m4_expand_ranges, m4_expand_input)
1801 (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
1802 (m4_current_line, m4_current_diversion, m4_output_current_line):
1803 Don't rely on default, use an explicit extern.
1804 * m4/error.h (error, error_at_line, error_print_progname)
1805 (error_message_count, error_one_per_line): Ditto.
1806 * m4/ltdl.c: Update from CVS libtool.
1808 * commit: Update from CVS cvs-utils.
1810 2002-11-04 Akim Demaille <akim@epita.fr>
1812 * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
1814 * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
1816 2002-11-04 Akim Demaille <akim@epita.fr>
1818 * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
1820 2002-11-04 Akim Demaille <akim@epita.fr>
1822 * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
1823 used as `external', and Libtool 1.4.3.
1825 (LTLIBOBJS): Don't play with it.
1827 * Makefile.am (SUBDIRS): Remove intl.
1828 (ACLOCAL_AMFLAGS): Add -I config.
1829 (EXTRA_DIST): Add config/config.rpath.
1832 * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
1834 2002-05-29 Gary V. Vaughan <gary@gnu.org>
1836 Preparations for refactoring syntax tables to allow reverse
1837 lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
1838 speed of normal lookups in an array of unsigned short.
1840 * m4/input.c (single_quotes, single_comments, use_macro_escape):
1842 * m4/m4private.h (m4__single_quotes, m4__single_comments,
1843 m4__use_macro_escape): ...to here, and renamed. The `m4__' prefix
1844 is for internal symbols which unavoidably pollute the global
1845 namespace, but are not published APIs.
1846 Adjusted all callers.
1847 * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
1848 m4_set_comment, m4_set_syntax, set_syntax_internal,
1849 unset_syntax_attribute): Moved from this file...
1850 * m4/syntax.c: New. ...to this file.
1851 Also added an m4_syntax_exit stub for orthogonality.
1852 * src/main.c (main): Use it.
1853 * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
1854 * m4/m4module.h: Reformatting. New prototypes.
1856 2002-05-29 Gary V. Vaughan <gary@gnu.org>
1858 * bootstrap (aclocal_apiversion): The aclocal apiversion is
1859 distinct from the automake release number (in that the apiversion
1860 apparently has no micro-version-component).
1861 (aclocal_apilibdir): Use it.
1863 2002-05-28 Gary V. Vaughan <gary@gnu.org>
1865 * m4/hash.c (m4_hash_resize): New function.
1866 * m4/hash.h: Add prototype.
1867 * m4/symtab.c (m4_symtab_init): Use it. This could do with some
1868 benchmarking to find a good value for, say, autoconf. This is
1869 already a little quicker than before for me.
1871 * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
1872 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
1874 * m4/hash.h: Adjust prototypes.
1876 2002-01-22 Akim Demaille <akim@epita.fr>
1878 * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
1880 * tests/Makefile.am (package.m4): New.
1881 * tests/atlocal.in: Adjust to CVS Autotest.
1882 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
1883 * configure.ac: LIBOBJ is a forbidden string.
1884 Simplify AM_INIT_AUTOMAKE invocation.
1885 * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
1888 2001-10-19 Akim Demaille <akim@epita.fr>
1890 * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
1892 2001-10-19 Akim Demaille <akim@epita.fr>
1894 * m4/input.c (m4_next_token): Display where was opened what is
1897 2001-10-19 Akim Demaille <akim@epita.fr>
1899 * m4/macro.c (expand_argument): Display where was opened what is
1902 2001-10-18 Akim Demaille <akim@epita.fr>
1904 * m4/input.c, modules/m4.c: Formatting changes.
1906 2001-10-17 Gary V. Vaughan <gary@gnu.org>
1908 * bootstrap: s/configure.in/configure.ac/
1910 2001-10-16 Gary V. Vaughan <gary@gnu.org>
1912 * m4/symtab.c (m4_symbol_destroy): This function calls
1913 m4_symbol_popdef, which recycles a symbols memory when the last
1914 definition is popped. Since we were passing the address of the
1915 symbol name found in the symbol table, and it was being removed
1916 partway through m4_symbol_destroy() we were referencing freed
1917 memory for the balance of the function. Now we take a copy of the
1918 symbol name tring and use that as a key into the symbol
1919 table... that way if the original symbol name is freed, the copy
1922 2001-10-13 Akim Demaille <akim@epita.fr>
1924 * m4/ltdl.c: Update.
1926 2001-10-13 Akim Demaille <akim@epita.fr>
1928 * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
1929 Don't gettextize internal error messages.
1931 2001-10-13 Akim Demaille <akim@epita.fr>
1933 * tests/macros.at (Arity and defn): New failing test.
1934 (Arity, defn, and freeze): New.
1936 Fix `Arity and defn'.
1938 * m4/input.c (m4_push_macro): Don't forget the arity.
1939 * modules/m4.c (defn): Likewise.
1941 2001-10-13 Akim Demaille <akim@epita.fr>
1943 * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
1945 * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
1946 (Propagation of traceon, Propagation of --trace): this new file.
1948 2001-10-13 Akim Demaille <akim@epita.fr>
1950 * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
1951 interface instead of (name, argc...).
1952 Upon failure, specify which argument was guilty.
1955 2001-10-13 Akim Demaille <akim@epita.fr>
1957 * modules/evalparse.c: Save translators' time: don't translate
1958 internal error messages.
1959 (m4_evaluate): Simplify/normalize error messages.
1960 * doc/m4.texinfo (Eval): Adjust.
1962 2001-10-13 Akim Demaille <akim@epita.fr>
1964 * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
1965 where no checking is needed.
1966 * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
1967 interface instead of (name, argc...).
1969 * modules/gnu.c (m4_patsubst_do): Don't check argc, done
1972 2001-10-13 Akim Demaille <akim@epita.fr>
1974 * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
1975 exclude the builtin name from the count.
1976 * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
1977 calling ifelse with a single argument is valid.
1978 * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
1979 with 1 and 2 args, mostly to strengthen the test suite.
1981 2001-10-13 Akim Demaille <akim@epita.fr>
1983 * m4/output.c (m4_make_diversion, m4_insert_file)
1984 (m4_insert_diversion, +m4_freeze_diversions): Ansify.
1986 2001-10-12 Gary V. Vaughan <gary@gnu.org>
1988 * m4/input.c (init_builtin_token): Renamed from init_macro_token,
1989 since we call these things builtins in the rest of the code!
1991 * modules/gnu.c (m4_regexp_compile): s/%0/%s/
1993 2001-10-12 Gary V. Vaughan <gary@gnu.org>
1995 Rather than forcing each builtin definition to manage its own
1996 argument range checking, tabulate the maxima and minima for all
1997 builtins in each module. This forces us to consider what the
1998 valid ranges for each builtin should be, and moves the checking
1999 code out of each builtin implementation and into the builtin
2000 caller infrastructure.
2002 * m4/m4module.h (struct m4_builtin): Add argument minima and
2004 * m4/m4private.h (struct m4_token): Reflect them here too.
2005 * m4/input.c (struct input_block): ...and here.
2006 (m4_token_copy): New function for token copying.
2007 (init_macro_token): Copy them from a token to the input stack.
2008 (m4_next_token): Don't forget to initialise them for text
2010 * m4/macro.c (expand_argument): Use m4_token_copy, and also
2011 check argument counts before calling the builtin handler.
2012 * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
2013 (m4_symbol_macro): Likewise.
2014 * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
2015 parameters. Updated all callers.
2016 (m4_builtin_define): Ditto.
2017 (m4_macro_pushdef, m4_macro_define): Ditto.
2018 * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
2019 * modules/evalparse.c: Declare argument counts for defined
2020 builtins and remove explicit calls to m4_bad_argc().
2021 * modules/gnu.c: Ditto.
2022 * modules/load.c: Ditto.
2023 * modules/m4.c: Ditto.
2024 * modules/modtest.c: Ditto.
2025 * modules/mpeval.c: Ditto.
2026 * modules/perl.c: Ditto.
2027 * modules/shadow.c: Ditto.
2028 * modules/stdlib.c: Ditto.
2029 * modules/time.c: Ditto.
2032 2001-10-10 Gary V. Vaughan <gary@gnu.org>
2034 The trace semantics now attach the trace bit to a symbol name.
2035 For as long as a traceon(`foo') is active, calls to foo will be
2036 traced regardless of intervening undefines or module unloads.
2037 Fixed the flag propogation issues differently to the fixes
2038 reverted with the last attempt at nailing down trace:
2040 * m4/m4private.h: This file is not visible outside of the m4
2041 source tree, so I removed all the `M4_' and `m4_' prefixes to save
2042 on typing. Updated all clients.
2043 (m4_token): New typedef contains the fields that need to be passed
2044 around with the low level tokeniser.
2045 (m4_token_data): Removed.
2046 (m4_symbol): Now contains the traced flag again.
2047 * m4/symtab.c: Rewritten again. Now we don't remove symbols with
2048 the trace bit set. This change is contained entirely within this
2049 module and doesn't leak out into the callers. Updated all
2051 (m4_symbol_builtin, m4_symbol_macro): Adjusted to make use of the
2052 new fields in m4_token. Updated all clients.
2053 * m4/builtin.c (m4_builtin_pushdef): Needs a flags argument so
2054 that `groks_macro_args' and `blind_if_no_args' flags are retained
2055 when defn() results are passed around in m4 code. Updated all
2057 (m4_builtin_define): Ditto.
2058 (m4_macro_pushdef, m4_macro_define): Ditto.
2059 * m4/input.c (struct input_block): Add a flags field to facilitate
2061 (m4_push_macro): ...use it.
2062 (init_macro_token): Retrieve it.
2063 (m4_next_token): Initialise it.
2064 * m4/macro.c (expand_argument): Copy it.
2065 * m4/m4module.h: Adjust.
2066 * tests/builtins.at: Adjust the expected output of the trace
2067 tests to reflect the change in semantics.
2068 * tests/modules.at (modules: trace): Check that unloading a
2069 module which supplies a traced symbol definition doesn't lose te
2072 2001-10-07 Gary V. Vaughan <gary@gnu.org>
2074 * modules/gnu.c (m4_macro_table): Display the timetamp when
2075 expanding __m4_version__.
2077 * configure.ac (--with-modules): Forgot a comma in the
2078 AC_HELP_STRING parameter list.
2080 2001-10-05 Gary V. Vaughan <gary@gnu.org>
2082 * bootstrap: Remove aclocal.m4t when it is no longer required.
2084 2001-10-05 Akim Demaille <akim@epita.fr>
2086 * tests/Makefile.am: Adjust for gnuprog2.
2087 * tests/m4.in: There can be a leading path.
2088 * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
2089 * tests/testsuite.at: Adjust to the most recent Autotest.
2090 (AT_CHECK_M4_FILTER): Fix and rename as...
2092 * tests/others.at: Use it.
2094 * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
2095 variable in shell scripts, one uses `$'...
2097 2001-10-04 Gary V. Vaughan <gary@gnu.org>
2099 * configure.ac: `rm -f $m4_getopt_h' was lost.
2101 2001-10-04 Gary V. Vaughan <gary@gnu.org>
2103 * configure.ac (TIMESTAMP): Display with AS_BOX at configure
2104 time. Define it for config.h in order to...
2105 * src/main.c (main): ...display the timestamp for --version.
2107 2001-10-04 Akim Demaille <akim@epita.fr>
2109 * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
2110 previous builtins `regexp' and `patsubst'.
2111 (regexp, patsubst): Use them.
2112 (eregexp, epatsubst): New builtins.
2113 * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
2114 (Epatsubst and Patsubst, Eregexp and Regexp): these.
2115 (Extensions): More info on REs.
2117 2001-10-04 Akim Demaille <akim@epita.fr>
2119 * modules/modtest.c (init_handler): Consistently output to stderr.
2120 (finish_handler): New.
2121 (test): The `if' is an `assert'.
2122 * tests/modules.at: Adjust.
2124 2001-10-04 Akim Demaille <akim@epita.fr>
2126 * m4/utility.c (m4_bad_argc): Detail the mismatches.
2128 2001-10-01 Akim Demaille <akim@epita.fr>
2130 * tests/generate.awk: Tag the tests with `documentation'.
2131 * tests/modules.at (AT_CHECK_M4_MODTEST): New.
2132 Use the make the existing modtest tests more uniform, and complete
2133 the set of possibilities.
2135 2001-10-01 Akim Demaille <akim@epita.fr>
2137 * config/gmp.m4: Consult the user before using GMP: use
2139 * configure.ac: Adjust.
2140 * modules/gmp.c: No protection needed as the module is not built
2143 2001-10-01 Akim Demaille <akim@epita.fr>
2145 * tests/generate.awk: Remove debugging code.
2146 (fatal): Specify the current location.
2148 * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
2149 * modules/gnu.c, modules/m4.c: Use M4ARG.
2151 2001-10-01 Akim Demaille <akim@epita.fr>
2153 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
2154 (m4_regexp_compile): New.
2155 (regexp, patsubst): Use it.
2157 2001-09-30 Gary V. Vaughan <gary@gnu.org>
2159 Reinstate the memory handling improvements from the patch I just
2160 reverted. Relevant ChangeLog entries repeated here:
2162 * m4/module.c (m4_module_remove): New function that holds the core
2163 of the old m4_module_unload.
2164 (m4_module_unload): Use it.
2165 (m4_module_unload_all): When we know the modules will never be
2166 used again (i.e. on exit), free up as much module memory as
2167 possible. There are still some artifacts from resident modules
2168 living inside ltdl.c, but everything else is freed.
2169 * m4/debug.c (m4_debug_exit): Free memory allocated in
2171 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
2172 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
2173 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
2174 * m4/m4module.h: Updated prototypes.
2175 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
2176 * m4/hash.h: Updated prototypes.
2177 * src/main.c (main): Use all these new functions to clean up as
2178 much memory as possible before exit.
2180 2001-09-30 Gary V. Vaughan <gary@gnu.org>
2182 Reverted my large patch for removing the old m4_symbol
2183 structure on 2001-09-20. We are still not happy about the way
2184 trace works in conjunction with defn and undefine, and leaving
2185 the reverted patch active prevents us from moving the traced
2186 bit from the definition back to the symbol.
2188 2001-09-30 Gary V. Vaughan <gary@gnu.org>
2190 * configure.in: Moved to...
2191 * configure.ac: ...here. Added a libtool like timestamped
2192 banner, and tidied up the libltdl cruft.
2193 * config/mkstamp: Script to extract a timestamp from ChangeLog.
2194 * modules/Makefile.am (INCLTDL): Removed. This is required
2195 only when libltdl is configured in a subdirectory.
2196 * src/Makefile.am: Ditto.
2197 (LIBADD_DL): No need to add this again, libtool already knows
2198 that libm4.la depends on it.
2199 * m4/Makefile.am: Automake sets variables from AC_SUBST. Use
2202 * TODO: stackovf.c is basically broken.
2203 Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
2205 2001-09-28 Akim Demaille <akim@epita.fr>
2207 * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
2209 2001-09-27 Akim Demaille <akim@epita.fr>
2211 * tests/m4.in: Don't use short options.
2212 Simplify the stderr signature normalization.
2214 2001-09-27 Akim Demaille <akim@epita.fr>
2216 tests/m4 shall be position independent.
2220 * tests/testsuite.at: No args to AT_INIT.
2221 * configure.in, tests/Makefile.am: Adjust.
2223 2001-09-22 Akim Demaille <akim@epita.fr>
2225 Autotest has changed again.
2227 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
2228 (package.m4): Remove.
2229 * configure.in: Adjust to LIBADD_GMP.
2231 2001-09-21 Gary V. Vaughan <gary@gnu.org>
2233 * config/gmp.m4 (AC_ARG_WITH): Removed.
2234 (GMP_LIB): Renamed to LIBADD_GMP for consistency.
2235 (AC_LIB_GMP): When performing a test compile against libgmp,
2236 include the header gmp.h if possible, and link against -lgmp. If
2237 they both work define USE_GMP.
2238 * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
2239 (mpeval_LTX_init_func): Complain on load that there was no libgmp
2242 2001-09-20 Gary V. Vaughan <gary@gnu.org>
2244 * m4/evalparse.c: Moved to...
2245 * modules/evalparse.c: ...here. This code is shared between
2246 modules/mpeval.c and modules/m4.c, so there is no need to pollute
2247 the libm4 API with its details. Moderately rewritten to interface
2248 into its clients more simply.
2249 * m4/eval.c: Deleted. Migrated functionality to...
2250 * modules/m4.c: ...here.
2251 (builtin_eval): Implemented in terms of the new interface style.
2252 * modules/mpeval.c (builtin_mpeval): Ditto.
2253 * m4/m4module.h: Removed references to the former m4/eval.c.
2254 * m4/Makefile.am (libm4_la_SOURCES): Removed eval.c.
2255 (EXTRA_libm4_la_SOURCES): Deleted.
2256 * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
2257 (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
2259 2001-09-20 Akim Demaille <akim@epita.fr>
2261 * config/gmp.m4 (AM_WITH_GMP): Rename as...
2263 By default, use gmp.
2265 * configure.in: Adjust.
2266 Use Automake conditionals for USE_GMP.
2267 Always compute sizeof (long long int).
2268 This was a bug BTW, as `eval' (not `mpeval') depends on it:
2269 before, it was used _only_ if mpeval was not activated.
2270 * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
2271 (mpeval_la_LIBADD): New macros.
2272 * modules/mpeval.c: No longer be conditioned by WITH_GMP.
2274 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
2275 * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
2278 2001-09-20 Akim Demaille <akim@epita.fr>
2280 * tests/Makefile.am (package.m4): New.
2281 * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
2283 2001-09-20 Gary V. Vaughan <gary@gnu.org>
2285 More cleanup. After the last patch, m4_symbol holds nothing but
2286 the head of a chain of m4_token_data. So I have removed the old
2287 m4_symbol, so that m4_token_data chains are stored directly in the
2288 value cell of a hash table node. But there's more... m4_symbol
2289 was a more natural name for the symbol value cell, and now that it
2290 is gone I have renamed the former m4_token_data structure to
2291 m4_symbol. This change turned out to be a pig to get right, since
2292 the original code didn't need to modify the value cell itself,
2293 since changing the chain happened inside the m4_symbol that used
2294 to be returned -- I had to pass the address of the value cell
2295 across various function calls, incase the head value changed. I
2296 also tightened up the memory management to help me find a nasty
2297 memory corruption bug that took me all night to track down...
2299 * m4/m4private.h (struct m4_symbol): Removed.
2300 (struct m4_token_data): Renamed to `struct m4_symbol'. Updated
2302 * m4/hash.c (m4_hash_iterator_value): Return the address of the
2303 value cell. Updated all callers.
2304 * m4/symtab.c: Took advantage of the simplification in the data
2305 structures to rewrite a lot of this file more simply. There is
2306 still some room for optimisation here, but we should tackle that
2307 systematically closer to the release.
2309 * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
2310 revealed. This version is ahead of CVS libtool until I get chance
2311 to flush my changes.
2312 * m4/module.c (m4_module_remove): New function that holds the core
2313 of the old m4_module_unload.
2314 (m4_module_unload): Use it.
2315 (m4_module_unload_all): When we know the modules will never be
2316 used again (i.e. on exit), free up as much module memory as
2317 possible. There are still some artifacts from resident modules
2318 living inside ltdl.c, but everything else is freed.
2319 * m4/debug.c (m4_debug_exit): Free memory allocated in
2321 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
2322 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
2323 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
2324 * m4/m4module.h: Updated prototypes.
2325 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
2326 * m4/hash.h: Updated prototypes.
2327 * src/main.c (main): Use all these new functions to clean up as
2328 much memory as possible before exit.
2330 2001-09-18 Gary V. Vaughan <gary@gnu.org>
2332 The `traced' flag needs to be attached to the definition of a
2333 symbol rather than the current symbol containing the definition.
2334 Implementing this showed up some long standing post 1.4 bugs in
2335 flag propogation which I also fixed.
2337 * m4/m4private.h (struct m4_symbol): Remove the traced flag.
2338 (struct m4_token_data): And add it back in here.
2339 * m4/input.c (init_macro_token): Propogate the traced flag
2341 * m4/macro.c (expand_argument): Ditto.
2342 * tests/builtins.at (trace2, trace3): New tests based on Akim's
2345 2001-09-08 Gary V. Vaughan <gary@gnu.org>
2347 * m4/m4private.h (struct m4_token_data): Simplified by removing
2348 the redundant `traced' flag, and one level of structure nesting.
2349 (M4_TOKEN_DATA_FUNC_TRACED): Removed.
2350 * m4/input.c (init_macro_token): No need to initialise removed
2352 * m4/macro.c (expand_argument): No need to copy it either.
2353 * m4/utility.c (m4_token_data_func_traced): Or provide an access
2356 * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
2357 dependant on multiple symbols with the same key, so preserving
2358 relative symbol order in each bucket during resizing is no longer
2359 required. The resize function is considerably faster as a result.
2361 * m4/m4module.h, m4/builtin.c, m4/symtab.c:
2362 s/m4_symbol_insert/m4_symbol_define/g;
2363 s/m4_builtin_insert/m4_builtin_define/g;
2364 s/m4_macro_insert/m4_macro_define/g. Updated all callers.
2366 2001-09-08 Gary V. Vaughan <gary@gnu.org>
2368 Get rid of m4_symbol_lookup_t entirely. With Akim's earlier
2369 commits, the m4_lookup_symbol dispatch function is split into
2370 specialised functions that must be called directly.
2372 * m4/m4module.h (m4_symbol_lookup_t): Removed.
2373 * m4/symtab.c (m4_lookup_symbol): Removed.
2374 (m4_symbol_builtin, m4_symbol_macro): New functions.
2375 * m4/builtin.c (m4_builtin_define): Split into...
2376 (m4_builtin_pushdef, m4_builtin_insert): ...these.
2377 (m4_macro_define): Split into...
2378 (m4_macro_pushdef, m4_macro_insert): ...these.
2379 * src/main.c (main): Set command line macros from `-D' parameters
2380 using `m4_macro_define'.
2382 2001-09-08 Gary V. Vaughan <gary@gnu.org>
2384 * m4/symtab.c (m4_symtab_remove_module_references): Renamed as
2385 this from m4_remove_table_reference_symbols().
2386 * m4/m4module.h, m4/module.c: Updated all references.
2388 2001-09-07 Akim Demaille <akim@epita.fr>
2390 * modules/stdlib.c, modules/times.c: Misc cleanups.
2392 2001-09-07 Akim Demaille <akim@epita.fr>
2394 * configure.in: We now need Autoconf 2.52e.
2395 * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
2396 and `M4_SYMBOL_DELETE'.
2397 * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
2398 * src/main.c (main): Adjust.
2400 2001-09-06 Gary V. Vaughan <gary@gnu.org>
2402 Fix the obstack.h problem once and for all! At configure time we
2403 can test for a system supplied obstack.h: depending on the
2404 result, we now generate system.h with an #include of the correct
2405 header. As a bonus, I've also added a --with-included-obstack,
2406 incase the user doesn't like the system obstack for some
2407 reason... and also we can test the shipped obstack on a system
2408 that has oe of its own. We also now need to be careful to add
2409 build directories to the include search path, since the generated
2410 system.h will be in the build tree.
2412 * configure.in (AC_CONFIG_FILES): Generate system.h from
2414 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
2415 include the system obstack header or the copy shipped with M4.
2416 Allow the user to override configure and force the build to use
2417 the shipped version.
2418 * m4/system-h.in: New file, template for...
2419 * m4/system.h: ...this. Now deleted.
2420 * m4/m4module.h: Include system.h before everything else.
2421 * src/freeze.c: Ditto.
2422 * m4/Makefile.am (dist-hook): Remove generated system.h.
2423 (INCLUDES): Check builddir for generated headers before checking
2425 * modules/Makefile.am (INCLUDES): Ditto.
2426 * src/Makefile.am (INCLUDES): Ditto.
2428 2001-09-05 Gary V. Vaughan <gary@gnu.org>
2430 * TODO: Remove the items that have been addressed already.
2432 2001-09-05 Akim Demaille <akim@epita.fr>
2434 * src/main.c (main): Standardize --version.
2436 2001-09-05 Akim Demaille <akim@epita.fr>
2438 * modules/format.c (format): Have a bigger `str'.
2440 2001-09-05 Akim Demaille <akim@epita.fr>
2442 Rationalize warnings, reporting the macro name as if it were a
2443 program name, and assertions.
2445 * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
2447 * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
2449 Use assert for internal errors.
2450 * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
2452 * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
2454 * tests/builtins.at (pushpop): Adjust.
2456 2001-09-05 Akim Demaille <akim@epita.fr>
2458 * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
2461 2001-09-05 Akim Demaille <akim@epita.fr>
2463 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
2464 * m4/macro.c, m4/symtab.c: Adjust.
2466 2001-09-05 Akim Demaille <akim@epita.fr>
2468 * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
2469 (m4_symbol_pop, m4_symbol_del): this.
2470 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
2471 (m4_symbol_popdef, m4_symbol_delete): New.
2472 (m4_lookup_symbol): Adjust.
2473 * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
2475 2001-09-05 Akim Demaille <akim@epita.fr>
2477 * m4/m4module.h (m4_symbol_lookup): Rename as...
2478 (m4_symbol_lookup_t): this.
2480 2001-09-05 Akim Demaille <akim@epita.fr>
2482 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
2484 * m4/symtab.c (m4_lookup_symbol): Adjust.
2486 2001-09-03 Gary V. Vaughan <gary@gnu.org>
2488 Bootstrap will now work with Libtool 1.4.1 or higher:
2489 * bootstrap: Remove stale autom4te.cache files when
2491 * config/Makefile.am (ACLOCAL_MACROS): Add ltdl.m4 and
2493 * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
2494 libtool.m4 directly.
2495 Run libtoolize to refresh ltmain.sh.
2496 * config/ltmain.sh: Deleted.
2497 * acinclude.m4: Deleted.
2498 * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
2500 * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
2501 implementation for the cvs impaired libtool user.
2503 2001-09-03 Akim Demaille <akim@epita.fr>
2505 * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
2507 Avoid using `default' in switch, as it hides useful compiler
2508 warnings when a case is forgotten.
2510 2001-09-03 Akim Demaille <akim@epita.fr>
2512 * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
2513 is no such thing as `WITH_MODULES'.
2515 2001-09-03 Akim Demaille <akim@epita.fr>
2517 Improve the test suite's selfcontainedness.
2519 * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
2520 (Include, Undivert): Tag the other input files.
2521 * tests/generate.awk: Catch `@comment file:'.
2522 `-I $src' is no longer needed.
2523 `next' is really like `return': the rest is skipped.
2524 Adjust to `input.m4'.
2525 (fatal): New function.
2526 * tests/foo, tests/incl.m4: Remove.
2528 2001-09-01 Gary V. Vaughan <gary@gnu.org>
2530 The shadowing mechanism and, infact, the whole symbol table
2531 implementation was creaking under the weight of the features piled
2532 on top of it. We now have a separate hash table module which will
2533 dynamically resize to keep symbol density withing good performace
2534 limits, and a new symtab module layered above it. Symbol lookups
2535 are now marginally more efficient (since the shadowed flag is no
2536 longer required) and symbol removal, such as on module unload, is
2537 considerably faster due to a reorganisation of the data structures
2540 * src/main.c (main): Don't mention `-H'.
2541 * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
2544 * m4/hash.c: New generalised dynamic hash table data structure
2546 * m4/hash.h: Public interface.
2547 * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
2548 (libm4_la_SOURCES): Add hash.c.
2549 * m4/symtab.c: More or less rewritten from scratch, within the
2550 bounds of the previous API.
2551 (m4_symtab_apply): A cleaner version of the old hack_all_symbols
2552 call. Updated all callers.
2553 * m4/m4module.c: #include <m4/hash.h>, and changed all affected
2554 declarations to reflect API changes.
2555 (M4INIT): Generate a declaration too, to avoid the warning with
2556 --enable-debug builds.
2559 * m4/utility.c (hash_table_size): Removed.
2560 (m4_dump_symbols): Rewritten to build and qsort an array of symbol
2561 names, which are then looked up by builtin_dumpdef() as necessary.
2562 This implies a small speedup in builtin_symbols(), which discarded
2563 all of the symbol info under the old call.
2564 * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
2565 shadowing is implicit in respect to the new data structures.
2566 symbol names are no longer duplicated here, they are stored in the
2567 key field of the hash table.
2568 Moved macro_args and blind_no_args...
2569 (m4_token_data): ...to here.
2570 m4/macro.c (expand_macro): Added a name argument since the symbol
2571 name is no longer copied into each struct m4_symbol. Modified all
2573 (collect_arguments): Ditto.
2574 * modules/m4.c (set_trace): Ditto.
2575 * modules/gnu.c (builtin_symbols): Updated.
2576 * src/freeze.c (produce_symbol_dump): Much improved in light of
2577 the improved symbol table layout.
2579 2001-09-01 Gary V. Vaughan <gary@gnu.org>
2581 * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
2583 (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
2584 (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
2585 SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
2586 SYMBOL_HANDLE): Ditto.
2587 * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
2588 modules/gnu.c, modules/m4.c, src/freeze.c,
2589 src/main.c: Updated all references.
2591 * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
2592 Automake 1.5 chokes on dynamic source file lists, Besides, it is
2593 already listed in m4_LDADD... how did that ever used to work?
2594 * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
2596 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
2597 Suggested by Tim Van Holder <tim.van.holder@pandora.be>
2599 * tests/m4: Don't call the m4 wrapper script with libtool, it
2600 works fine all by itself.
2602 2001-08-30 Gary V. Vaughan <gary@gnu.org>
2604 The experimental `changeword' feature never took off, and has
2605 no obvious advantages over `changesyntax' to compensate the
2606 enormous speed penalty it carries:
2607 * configure.in (ENABLE_CHANGEWORD): Removed.
2608 * m4/m4module.h (m4_set_word_regexp): Removed.
2609 * m4/m4private.h (m4_token_data): Removed original_text field.
2610 * m4/utility.c (m4_token_data_orig_text): Removed.
2611 * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
2612 * m4/macro.c: Ditto.
2613 * src/main.c: Ditto.
2614 * modules/Makefile.am (changeword.la): Removed.
2615 * modules/changeword.c: File removed.
2616 * doc/m4.texinfo: References to changeword and --word-regexp
2618 * po/POTFILES.in: modules/changeword.c removed.
2619 * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
2620 * tests/builtins.at (changeword): Test removed.
2622 2001-08-30 Akim Demaille <akim@epita.fr>
2624 * bootstrap.sh: Create aclocal.m4 instead of modifying it.
2625 This also help having a single list of m4 files: in
2627 * config/Makefile.am (STANDARD_MACROS): Rename as...
2628 (ACLOCAL_MACROS): this.
2629 (list-standard-macros): Remove.
2632 2001-08-29 Gary V. Vaughan <gary@gnu.org>
2634 In an attempt to moderate my egomania...
2635 * tests/modules.at: Remove attributions.
2637 * tests/generate.awk: When making substitutions to "@&t@", either
2638 "&" or "\&" in the substitution string argument to gsub refer back
2639 to the matched text. "@\\&t@" seems to work though, Tests 43 and
2642 2001-08-29 Akim Demaille <akim@epita.fr>
2644 * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
2645 (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
2646 (sync-lines, trace, translit, undivert, wrap): Move to...
2647 * tests/builtins.at: this new file.
2648 * tests/others.at (Discard comments, import-environment): Move to...
2649 * tests/options.at: this new file.
2651 2001-08-29 Akim Demaille <akim@epita.fr>
2653 * tests/others.at (Freezing modules)
2654 (--module-directory: absolute path, modpath2, modpath3)
2655 (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
2656 * tests/modules.at: here, new file.
2657 * tests/others.at, tests/generate.awk: Add a banner.
2658 * tests/testsuite.at: Adjust.
2659 (AT_CHECK_M4_FILTER): New, but unused.
2661 2001-08-29 Akim Demaille <akim@epita.fr>
2663 * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
2665 * tests/others.at (wrap): Inline wrap.m4.
2666 (shadow): Inline shadow.m4.
2667 (iso8859): Don't specify the path from top_srcdir, but from srcdir.
2668 * tests/m4: Simplify.
2670 2001-08-29 Akim Demaille <akim@epita.fr>
2672 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
2675 2001-08-29 Akim Demaille <akim@epita.fr>
2677 * tests/generate.awk (normalize): s/@__@/@&t@/.
2679 2001-08-28 Akim Demaille <akim@epita.fr>
2681 * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
2683 2001-08-28 Gary V. Vaughan <gary@gnu.org>
2685 * bootstrap (generate.awk): Generate test cases with new script.
2687 2001-08-27 Akim Demaille <akim@epita.fr>
2689 * tests/Makefile.am (installcheck-local): Don't use
2690 `dc_install_base' which is not visible here, but `exec_prefix'
2691 which is clearly the RT anyway.
2692 * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
2693 related to testing a now installed m4.
2694 * tests/m4: Do it here.
2696 2001-08-27 Akim Demaille <akim@epita.fr>
2698 * tests/others.at (indir): Formatting change.
2700 2001-08-27 Akim Demaille <akim@epita.fr>
2702 * tests/Makefile.am (installcheck-local): New.
2703 * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
2705 Prefer options over envvars.
2706 * src/main.c (main): First bug caught by the test suite (yeah!):
2707 --batch lacked a `break' which resulted in an accidental
2708 invocation of --discard-comments.
2710 2001-08-27 Akim Demaille <akim@epita.fr>
2712 * tests/others.at (capitalize, changeword, comments, ddivert)
2713 (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
2714 (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
2715 (sysv-args, trace, translit, undivert): Don't rely on files in
2716 examples/: AT_DATA them.
2718 2001-08-27 Akim Demaille <akim@epita.fr>
2720 Let the test suite use a wrapper around the not installed m4 to
2721 pretend it is (installed).
2723 * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
2724 such a way that m4 does not process them.
2725 * configure.in: The package name seems to be `m4', not `M4'.
2727 * tests/atlocal.in (at_package, M4): Remove.
2728 * tests/testsuite.at, tests/others.at: Use m4, not $M4.
2730 2001-08-27 Akim Demaille <akim@epita.fr>
2732 * tests/Makefile.am (CLEANFILES): Remove.
2733 (DISTCLEANFILES, clean-local): New.
2734 * examples/mktests.sh: Remove.
2736 2001-08-27 Akim Demaille <akim@epita.fr>
2738 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
2739 Don't use aclocal: it's written by hand.
2740 * aclocal.m4: m4_include all the files instead of being built by
2742 * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
2743 until it reads the traces by itself.
2744 * configure.in: Require Autoconf 2.42c as we are now using
2745 AC_CONFIG_TESTDIR instead of AT_CONFIG.
2746 Catch unexpanded `jm_' macros.
2747 * config/atconfig.m4: Remove.
2748 * config/error.m4: new.
2749 * config/Makefile.am: Ship the files included by aclocal.m4.
2750 * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
2751 (TESTSUITE_AT): this, to please Automake.
2752 (TESTSUITE): This target uses autotest/autotest.m4, not
2753 autotest/general.m4.
2754 * tests/testsuite.at: Prereq Autotest 2.52c.
2755 * examples/Makefile.am (pkgdata_DATA): Rename as...
2756 (dist_pkgdata_DATA): this.
2757 * doc/Makefile.am (man_MANS): Rename as...
2758 (dist_man_mans): this.
2760 2001-08-20 Gary V. Vaughan <gary@gnu.org>
2762 * m4/system.h [cygwin*]: Thanks to Paul Sokolovsky and
2763 Robert Collins, building on Cygwin no longer requires Windows
2764 import and export symbol decorations.
2765 * m4/m4module.h (M4_SCOPE) [cygwin*]: Deleted all occurences.
2766 * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
2767 * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
2768 * m4/error.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
2769 * m4/input.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
2770 * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
2771 * m4/output.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
2772 * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
2773 * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
2774 * configure.in (LIBM4_DLL_IMPORT) [cygwin*]: Don't set this
2776 * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
2777 * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
2779 2001-08-20 Gary V. Vaughan <gary@gnu.org>
2781 Ansify the source. Previously we had a mix, where my code was
2782 in a K&R compatible style, and the preexisting code was in ANSI
2783 style. Nothing is lost wrt release 1.4 by reverting to ANSI,
2784 and now the code base is much cleaner.
2786 * m4/system.h: Remove M4_PARAMS macro and all users. Remove
2787 VOID macro and all users.
2788 * m4/m4module.h: Ansify function prototypes and headers.
2789 * m4/builtin.c: Ditto.
2790 * m4/evalparse.c: Ditto.
2791 * m4/input.c: Ditto.
2792 * m4/macro.c: Ditto.
2793 * m4/module.c: Ditto.
2794 * m4/output.c: Ditto.
2796 * m4/symtab.c: Ditto.
2797 * m4/utility.c: Ditto.
2798 * modules/format.c: Ditto.
2799 * modules/gnu.c: Ditto.
2800 * modules/m4.c: Ditto.
2801 * modules/mpeval.c: Ditto.
2802 * src/freeze.c: Ditto.
2804 * src/main.c: Ditto.
2806 2001-08-20 Akim Demaille <akim@epita.fr>
2808 * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
2809 generated with stock 2.52.
2811 2001-08-20 Akim Demaille <akim@epita.fr>
2813 * config/atconfig.m4: New, until part of Autoconf per se.
2814 * configure.in (AT_CONFIG): Use it.
2816 * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
2817 * tests/atlocal.in: New.
2818 * tests/generate.awk: For the time being, the empty quadrigraph is
2820 * tests/others.at (changeword, gmp): Check the configuration
2821 variable against `yes'.
2822 * tests/testsuite.at (dnl): Allow it, as it's used all over the
2825 2001-08-20 Akim Demaille <akim@epita.fr>
2827 * m4/utility.c (m4_numeric_arg): Spell out the culprit.
2828 * modules/m4.c (undivert): Disable the possibility of undiverting
2829 several files at once: it is not documented, it is inconsistent
2830 with the other macros, it can be straightforwardly mocked by
2831 several invocations, and most importantly, it prevents the
2832 possibility of other kinds of extension.
2833 Use `m4_numeric_arg'.
2835 2001-08-20 Akim Demaille <akim@epita.fr>
2837 * examples/include.m4: Typo.
2838 * tests/generate.awk: Really add it.
2839 * tests/Makefile.am: Adjust.
2840 * tests/others.at (Discard comments): It sure fails without `-c'.
2841 (include, undivert): Add -I examples/.
2843 2001-08-20 Akim Demaille <akim@epita.fr>
2845 Use sprintf, not ecft and friends since it is standard, portable,
2846 simplifies the code, and since the latter is even deprecated
2847 according to the GNU libc documentation.
2849 * modules/format.c: Drop evct support.
2851 2001-08-19 Gary V. Vaughan <gary@gnu.org>
2853 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up. Don't test
2855 * configure.in: ...do it here instead.
2857 * c-boxes.el: Deleted.
2858 * m4/builtin.c: Reformat box comments to be closer to GNU
2860 * m4/debug.c: Ditto.
2862 * m4/evalparse.c: Ditto.
2863 * m4/input.c: Ditto.
2864 * m4/m4module.h: Ditto.
2865 * m4/macro.c: Ditto.
2866 * m4/output.c: Ditto.
2867 * m4/symtab.c: Ditto.
2868 * m4/utility.c: Ditto.
2869 * modules/changeword.c: Ditto.
2870 * modules/format.c: Ditto.
2871 * modules/gnu.c: Ditto.
2872 * modules/load.c: Ditto.
2873 * modules/m4.c: Ditto.
2874 * modules/modtest.c: Ditto.
2875 * modules/mpeval.c: Ditto.
2876 * modules/perl.c: Ditto.
2877 * modules/shadow.c: Ditto.
2878 * modules/stdlib.c: Ditto.
2879 * modules/time.c: Ditto.
2880 * src/freeze.c: Ditto.
2881 * src/main.c: Ditto.
2883 2001-08-17 Gary V. Vaughan <gary@gnu.org>
2885 * m4/module.c: Fixup some errors in the description comment.
2887 2001-08-17 Akim Demaille <akim@epita.fr>
2889 * tests/others.at (iso8859): Specify the path to the M4 test file.
2890 * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
2891 files in error messages.
2893 2001-08-17 Akim Demaille <akim@epita.fr>
2895 * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
2896 * tests/others.at: Adjust input files paths.
2897 * tests/atconfig.in: Set top_builddir.
2898 * tests/Makefile.am: Adjust.
2899 `testsuite' is in src, not build.
2901 2001-08-17 Akim Demaille <akim@epita.fr>
2903 * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
2904 (generate.at): Install a temporary hack until the actual
2905 generate.awk is added to the repository.
2906 * tests/atconfig.in: New.
2908 2001-08-17 Akim Demaille <akim@epita.fr>
2910 Really apply the patch ``Drop Autoconf 2.13 compatibility.''
2912 2001-08-17 Akim Demaille <akim@epita.fr>
2914 * doc/m4.texinfo: Promote proper quotation.
2916 2001-08-17 Akim Demaille <akim@epita.fr>
2918 Remove the non Autotest tests.
2920 * tests/other-tests/capitalize.test,
2921 * tests/other-tests/changeword.test,
2922 * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
2923 * tests/other-tests/debug.test,
2924 * tests/other-tests/discard-comments.m4,
2925 * tests/other-tests/discard-comments.test,
2926 * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
2927 * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
2928 * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
2929 * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
2930 * tests/other-tests/hanoi.test,
2931 * tests/other-tests/import-environment.m4,
2932 * tests/other-tests/import-environment.test,
2933 * tests/other-tests/include.test, tests/other-tests/indir.test,
2934 * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
2935 * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
2936 * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
2937 * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
2938 * tests/other-tests/modtest.test,
2939 * tests/other-tests/multiquotes.test,
2940 * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
2941 * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
2942 * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
2943 * tests/other-tests/sync-lines.m4,
2944 * tests/other-tests/sync-lines.test,
2945 * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
2946 * tests/other-tests/translit.test, tests/other-tests/undivert.test,
2947 * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
2948 * tests/other-tests/wrap.test: Remove.
2950 * tests/run-test, tests/get-them: Remove.
2951 * tests/Makefile.am: Adjust.
2953 2001-08-17 Akim Demaille <akim@epita.fr>
2955 others.at no longer depends on other-tests/.
2957 * tests/others.at (stackovf): You're actually...
2959 (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
2960 (unload.test): Keep their authorship.
2961 (discard-comments, gmp, import-environment, modfreeze)
2962 (sync-lines): Embed the input files.
2963 * tests/stackovf.test: Copy from other-tests/stackovf.test.
2964 * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
2966 2001-08-17 Akim Demaille <akim@epita.fr>
2968 * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
2969 (M4exit): Tag the exit status of the example.
2970 * tests/get-them: Adjust.
2971 * tests/generate.awk: New, based on get-them.
2972 * tests/Makefile.am: Adjust to generate `generated.at'.
2973 * tests/testsuite.at: Adjust.
2974 (AT_CHECK_M4): Don't overquote. Blush...
2976 2001-08-17 Akim Demaille <akim@epita.fr>
2978 Start using Autotest. atconfig creation is still lacking.
2980 * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
2981 * examples/reverse.m4, tests/other-tests/import-environment.m4,
2982 * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
2983 * tests/other-tests/import-environment.test: Don't check LANGUAGE
2984 as it might be `unset', or set to `C'.
2985 * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
2986 * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
2987 * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
2988 * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
2989 * tests/other-tests/shadow.test: Adjust.
2990 * tests/testsuite.at, tests/others.at: New.
2991 * tests/Makefile.am: Adjust.
2993 2001-08-17 Akim Demaille <akim@epita.fr>
2995 Drop Autoconf 2.13 compatibility.
2997 * configure.in (changeword): No need to undefine it, as anyway if
2998 it's defined, M4sugar moved it as m4_changeword.
2999 And anyway, proper quotation is enough.
3000 (m4_pattern_allow): As it exists in 2.50, just use it.
3001 (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
3002 Don't handle Gettext's duties, let it handle them.
3003 * config/gnu-obstack.m4: Use m4_pattern_allow directly.
3005 2001-08-17 Akim Demaille <akim@epita.fr>
3007 * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
3008 (m4_errprint): Use fputs.
3009 * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
3010 dumpdef are not concerned.
3011 (Dumpdef, Errprint): Emphasize their insensitivity to
3013 * doc/Makefile.am: Add `TAGS' support.
3014 (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
3016 * config/Makefile.am (MAINTAINERCLEANFILES): New.
3018 2001-08-17 Akim Demaille <akim@epita.fr>
3020 * modules/Makefile.am (ETAGS_ARGS): New.
3022 2001-08-17 Akim Demaille <akim@epita.fr>
3024 * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
3027 2001-08-17 Akim Demaille <akim@epita.fr>
3029 * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
3031 2001-08-17 Akim Demaille <akim@epita.fr>
3033 * m4/m4module.h (m4/list.h): Don't include it.
3035 2001-08-16 Gary V. Vaughan <gary@gnu.org>
3037 m4_modules are no more, we use lt_dlhandles directly and let
3038 latest libltdl features manage the list of loaded modules.
3039 * acinclude.m4: Regenerated.
3040 * m4/ltdl.c: Updated from master copy.
3041 * m4/module.c: Reimplemented to take advantage of advances in
3043 * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
3044 list with lt_dlhandle_next.
3045 (m4_builtin_find_by_func): Ditto.
3046 (m4_builtin_table_install): Use lt_dlhandle.
3047 (m4_macro_define): Ditto.
3048 (m4_macro_table_install): Ditto.
3049 m4/module.h: Prototype new module management API.
3050 (m4_modules): No longer required.
3051 (m4_module_init_t, m4_module_finish_t): POSIX namespace
3052 violations, renamed to...
3053 (m4_module_init_func, m4_module_finish_func): ...these,
3055 (M4INIT_HANDLER): Clean way to declare init functions in modules.
3056 (M4FINISH_HANDLER): And similarly for finish functions.
3057 * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
3058 -- Add indirection to the CONC macro so that arguments are
3060 * modules/modtest.c (m4_init_module): Replaced with M4INIT_HANDLER.
3061 * modules/shadow.c (m4_init_module): Ditto.
3062 Due to new init function semantics, be careful to perform the
3063 initialisation only on first load.
3064 * modules/perl.c (m4_init_module): Ditto. And Ditto.
3065 (m4_finish_module): Replaced with M4FINISH_HANDLER.
3066 Due to new finish function semantics, be careful to perform the
3067 finalisation only on first load.
3068 * m4/m4private.h (m4_module): Removed in favour of...
3069 (m4_module_data): ...structure without all the wrapper fields.
3070 Instances of this new structure are stored associated lt_dlhandles
3071 with lt_dlcaller_data_set().
3072 * m4/builtin.c (m4_builtin_define): Takes a handle argument
3073 instead of the old module argument.
3074 (m4_builtin_table_install): Ditto.
3075 * modules/load.c (m4_resident_module): Removed. This is no
3076 longer implemented as a magic symbol...
3077 * modules/m4.c (m4_resident_module): Ditto.
3078 * modules/load.c (M4INIT_HANDLER): ...the module init function now
3079 uses the ltdl api to make the module resident.
3080 * modules/m4.c (M4INIT_HANDLER): Ditto.
3081 * modules/load.c (builtin_modules): Traverse the loaded module
3082 list with lt_dlhandle_next.
3083 (builtin_load): Much simplified in light of the reimplemented
3085 * src/freeze.c (produce_module_dump): Cleaned up and optimised in
3086 light of the m4/module.c rewrite.
3087 (produce_symbol_dump): Ditto.
3088 (reload_frozen_state): Ditto.
3089 * m4/list.c, m4/list.h: Files deleted. No longer required.
3090 * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
3091 (libm4_la_SOURCES): Delete list.c reference.
3092 * m4/m4private.h (m4_token_data): Add a handle field. This
3093 eliminates many of the searches to find the handle associated with
3094 various tokens that are passed between functions.
3095 (struct m4_symbol): Removed the module field. The
3096 module association does not belong with the symbol...
3097 * m4/input.c (struct m4_builtin): ...it belongs with the builtin
3098 that the module implementation code is from. Added a handle
3100 (m4_push_macro): Add a `handle' argument. Changed all callers.
3101 (init_macro_token): Set the `handle' field for the
3103 * m4/macro.c (expand_argument): Copy the new handle field during
3105 * modules/m4.c (macro_install): Use the new handle field to
3106 optimise the search for the correct builtin structure, and pass
3107 the handle details to m4_builtin_define.
3109 2001-08-15 Akim Demaille <akim@epita.fr>
3111 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
3112 when creating `m4/obstack.h'.
3113 * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
3115 * tests/defs: Make them absolute.
3116 (CDPATH) Neutralize.
3117 * tests/gethem: Use them.
3119 2001-08-14 Gary V. Vaughan <gary@gnu.org>
3121 * config/ltmain.sh: Doh! Import again for a quoting fix that
3122 prevented any regression test from passing.
3124 * m4/m4module.h (obstack.h): Choose between installed version
3125 and shipped version based on configure tests.
3126 * src/freeze.c (obstack.h): Ditto.
3128 * acconfig.h: Removed. No longer required.
3130 * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
3131 * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
3132 them to AC_INIT and AM_INIT_AUTOMAKE.
3133 * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
3134 disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
3135 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
3136 shell variable m4_cv_func_obstack_h.
3137 * tests/defs (M4): Be more careful about relative path to libtool
3138 script and m4 binary by using $srcdir.
3140 * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
3141 optargs to the existing libltdl search path.
3142 * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
3143 * m4/ltdl.c: Updated.
3145 * config/ltmain.sh: Ditto.
3147 2001-08-11 Gary V. Vaughan <gary@gnu.org>
3149 * src/main.c (main): Add `-b' (for `batch') mode switch to force
3150 interactive mode off.
3152 2001-08-10 Akim Demaille <akim@epita.fr>
3154 * configure.in: Require Autoconf 2.52.
3155 (AC_ARG_PROGRAM): Remove, handled by Automake.
3156 (m4_getopt): Rename as...
3157 (m4_getopt_h): this.
3158 Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
3159 Undefine `changeword' only if defined.
3160 * config/gnu-obstack.m4: Require Autoconf 2.52.
3161 (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
3164 2001-08-09 Yuji Minejima <ggb01164@nifty.ne.jp>
3166 * doc/m4.texinfo: Fix some typos, and apply some small
3169 2001-08-09 Andreas Schwab <schwab@suse.de>
3171 * src/main.c (main): Fix improper uses of error (missing format
3174 2001-08-07 Akim Demaille <akim@epita.fr>
3176 Improve `make distcheck'.
3178 * configure.in: Be sure to be able to run `mkconfig.sh' when src
3180 * Makefile.am (dist-hook): Remove, as it is no longer needed.
3181 * doc/m4.texinfo (Include): Add missing blank.
3182 * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
3185 2001-08-07 Akim Demaille <akim@epita.fr>
3187 * m4/evalparse.c: A better introductory comment.
3188 * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
3189 * m4/macro.c: Adjust old comments.
3190 * modules/README: Typo.
3192 2001-08-07 Akim Demaille <akim@epita.fr>
3194 * config/gnu-obstack.m4: New.
3196 2001-08-07 Akim Demaille <akim@epita.fr>
3198 * config/Makefile.am, config/stackovf.m4: New.
3199 * configure.in, Makefile.am: Adjust.
3201 2001-04-08 Roderick Koehle <Roderick.Koehle@infineon.com>
3203 * modules/format.c (format): Formatting for %f was not
3204 interpreting the position of the decimal point correctly for
3207 2000-12-01 Gary V. Vaughan <gary@gnu.org>
3209 * TODO: Removed m4exit bug.
3210 * modules/load.c (m4_resident_module): Make this module resident.
3211 * module/m4.c (m4_resident_module): Ditto.
3212 * m4/modules.c (m4_module_load): Use new ltdl resident modules
3213 feature to mark modules as resident if they export
3214 `m4_resident_module' as TRUE.
3215 (m4_module_unload): Do not remove resident modules, and take care
3216 with symbol insertion and deletion with resident modules.
3217 * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
3218 use resident modules feature.
3220 2000-11-30 Gary V. Vaughan <gary@gnu.org>
3222 * TODO: Updated. Removed some cruft that has since been fixed
3223 or implemented. Added some more entries.
3226 * modules/README: Updated.
3227 * doc/m4.texinfo: Updated.
3229 * modules/gnu.c (builtin_functions): Make indir orthogonal to
3230 builtin, in that each is recognised as a macro only with parameters
3231 (builtin_indir): Passing 0 arguments is now an error, as with
3234 * src/main.c (usage): Added missing description of `-c' option.
3236 2000-11-29 Gary V. Vaughan <gary@gnu.org>
3238 Consolidate the myriad of dispersed test scripts into the
3239 tests subdirectory. I think I now have all the file where I
3240 want them, so there shouldn't be anymore upheaval =)O|
3242 * tests/Makefile.am: Updated to run the new tests added below.
3243 * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
3244 tests/other-tests/ddivert.test, tests/other-tests/debug.test,
3245 tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
3246 tests/other-tests/foreach.test, tests/other-tests/forloop.test,
3247 tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
3248 tests/other-tests/hanoi.test, tests/other-tests/include.test,
3249 tests/other-tests/indir.test, tests/other-tests/misc.test,
3250 tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
3251 tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
3252 tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
3253 tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
3254 tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
3255 tests/other-tests/reverse.test, tests/other-tests/shadow.test,
3256 tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
3257 tests/other-tests/translit.test, tests/other-tests/undivert.test,
3258 tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
3259 tests/other-tests/wrap.test: New tests based on the contents
3260 of the tests removed below.
3261 * examples/Makefile.am, modules/Makefile.am: Updated to
3262 reflect removed tests.
3263 * examples/defs,modules/defs: Removed.
3264 * examples/capitalize.test, examples/comments.test,
3265 examples/ddivert.test, examples/debug.test,
3266 examples/esyscmd.test, examples/exp.test,
3267 examples/foreach.test, examples/forloop.test,
3268 examples/fstab.test, examples/hanoi.test,
3269 examples/include.test, examples/indir.test,
3270 examples/misc.test, examples/multiquotes.test,
3271 examples/patsubst.test, examples/pushpop.test,
3272 examples/regexp.test, examples/reverse.test,
3273 examples/sysv-args.test, examples/trace.test,
3274 examples/translit.test, examples/undivert.test,
3275 examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
3276 modules/modpath1.test, modules/modpath2.test,
3277 modules/modpath3.test, modules/modpath4.test,
3278 modules/modtest.test, modules/shadow.test,
3279 modules/unfrozen.m4, modules/unload.test: Removed.
3281 Move the implementation of GMP support for the mpeval() builtin
3282 into a loadable module that depends on libgmp. mpeval() and
3283 eval() share a common parser, now in m4/evalparser.c; the code
3284 in m4/numb.c and m4/numb.h is now physically split between
3285 m4/eval.c (the eval() backend) and modules/mpeval.c (the
3286 mpeval() backend), rather than being differentiated by cpp
3287 macros and multiple inclusion. The mpeval module is always
3288 built but will generate an diagnostic if it is used from an
3289 installation that didn't link in the gmp library.
3290 * modules/Makefile.am: build and install the new mpeval module.
3291 * modules/mpeval.c: Now contains the former parts of m4/numb.c
3292 and m4/numb.h that are required for gmp support in mpeval().
3293 * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
3294 * m4/evalmp.c: Removed.
3295 * m4/m4module.h: Removed conditional prototype for
3297 * m4/eval.c: Rewritten. Contains the former parts of m4/numb.c
3298 and m4/numb.h that do not rely on gmp.
3299 * m4/evalparse.c: New file, contains the shared parts of the
3300 eval() and evalmp() parser implementations, and is no longer
3301 unencumbered by cpp magic to uncover the right parts.
3302 * m4/numb.h: Removed. It's former contents are split between
3303 m4/eval.c and modules/mpeval.c.
3306 * tests/other-tests/changeword.test: New test. Rudimentary
3307 testing of changeword builtin runs only if --wnable-changeword
3308 was used at configure time.
3309 * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
3310 alternation correctly. Split into two expressions to compensate.
3311 * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
3312 * modules/Makefile.am: Build changeword module.
3313 * modules/changeword.c (m4_macro_table): Define __m4_changeword__
3314 only when --enable-changeword was passed to configure.
3315 (builtin_changeword): If --enable-changeword was not used, then
3316 report that changeword() builtin has no support in m4 binary.
3318 2000-11-28 Gary V. Vaughan <gary@gnu.org>
3320 * src/main.c (main): Fixed a particularly nasty bug is
3321 user_search_path setting -- the -M flag processing must be
3322 extremely careful with search path ordering, or else the default
3323 installed module directory (possibly containing modules from a
3324 previous release) is placed earlier in the search path than any -M
3325 arguments (which are relied upon to load uninstalled modules with
3326 most of the tests in the regresion suite).
3328 * modules/load.c (builtin_load): Nasty hack to prevent adding
3329 symbols to symtab again if a module is loaded more than once.
3330 * modules/m4.c (builtin_ifelse): removed unused variable argv0.
3332 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed a
3333 possible NULL pointer dereference.
3335 * m4/module.c (m4_module_find_by_modname): Renamed from
3336 m4_module_modname_find. Fixed all references.
3337 (m4_module_find_by_builtin): New function.
3339 * modules/modfreeze.test: load the `load' module with each
3341 * src/freeze.c (produce_frozen_state): Simplified in light of
3342 module field in m4_symbol. Allow a third argument for text macros
3343 to name the originating module.
3344 (reload_frozen_state): ditto.
3345 * m4/m4module.h: Fixup prototypes.
3346 * m4/builtin.h (m4_builtin_define): Add a module argument so
3347 that symbols can be registered against the defining module.
3348 (m4_macro_define): ditto.
3349 * m4/m4private.h (m4_symbol): Make the module field const to save
3350 on casting in the rest of the code.
3351 (SYMBOL_MODULE): New macro.
3353 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
3354 symbol reference maintenance bugs when removing a symbol from the
3357 * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
3359 2000-11-27 Gary V. Vaughan <gary@gnu.org>
3361 * configure.in (m4_cv_func_obstack): A better check for whether
3362 libc has an obstack implementation.
3363 * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
3365 * configure.in (--with-modules): Changed semantics. This
3366 option is now used to list modules to be preopened.
3367 * src/m4.h: #include "ltdl.h" unconditionally.
3368 * src/main.c: Removed all dependencies on WITH_MODULES.
3369 * src/freeze.c: ditto.
3370 * modules/Makefile.am: ditto.
3371 * m4/m4.c (builtin_m4exit): ditto.
3372 * modules/modpath1.test: ditto.
3373 * modules/modpath2.test: ditto.
3374 * modules/modpath3.test: ditto.
3375 * modules/modpath4.test: ditto.
3376 * modules/modtest.test: ditto.
3377 * modules/shadow.test: ditto.
3378 * modules/unload.test: ditto.
3380 * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
3381 comes up on demand in LTLIBOBJS now.
3382 * configure.in (getopt_long): Creating and relying on a link for
3383 getopt.h on hosts with no getopt_long() of thier own works
3384 correctly now. This is necessary so that callers of getopt_long()
3385 can simply `#include <getopt.h>': the naive way of doing this
3386 would end up using our own getopt.h and the installed
3387 getopt_long(), which is asking for trouble!
3388 (obstack_init): A similar argument applies to obstack.h and
3391 * m4/ltdl.c: Upgraded to latest bleeding edge version again.
3392 On Solaris-2.5 (at least) the native dlopen implementation
3393 gets confused about m4.o when looking for module "m4". This
3394 version always looks for .la an .$lib_ext suffixed names first
3395 to work around the problem. Sigh.
3397 * po/POTFILES.in: Take account of these file movements.
3398 * src/Makefile.am (m4_SOURCES): removed eval.c.
3399 (EXTRA_m4_SOURCES): removed numb.c and numb.h.
3400 * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
3401 (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
3402 * modules/m4.c (builtin_eval): Use m4_evaluate().
3403 * m4/eval.c: Moved here from src/eval.c to facilitate
3404 implementation of eval() builtin as part of the `m4' loadable
3406 (m4_evaluate): renamed from evaluate for namespace cleanliness.
3407 * m4/numb.c: Moved here from src/numb.c, since it is #included
3408 into eval.c at compile time.
3409 * m4/m4module.h (m4_evaluate): Added prototype.
3410 * src/m4.h (evaluate): Removed prototype.
3412 2000-11-25 Gary V. Vaughan <gary@gnu.org>
3414 * modules/perl.c (builtin_perleval): Use PL_na for
3415 compatibility with perl-5.6.
3417 * src/main.c (main): It is now safe to
3418 ``m4_module_install("m4")'', without tripping over the m4
3420 * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
3421 versions having fixed the insidious module search order bug.
3423 * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
3424 supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
3426 * configure.in: Figure out whether to use the installed
3427 getopt.h or the supplied one.
3428 * src/Makefile.am: ditto.
3430 * po/POTFILES.in: List files in their new positions.
3432 * config/ltmain.sh: This needs to be checked in to match the
3433 libtool macros copied to acinclude.m4 (until a released
3434 libtool copes with m4's needs).
3435 * bootstrap: Run gettextize.
3437 2000-11-24 Gary V. Vaughan <gary@gnu.org>
3439 * AUTHORS: Added my details.
3442 * bootstrap: temporary update until released libtool catches up.
3444 * All files: Use new GNU GPL copyright blurb with current contact
3447 * configure.in (LTLIBOBJS): Use canonical code for calculation of
3450 * config: renamed acm4 directory to config to be more like
3451 other autoconfiscated packages.
3453 * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
3454 * config/debug.m4: New file implementing configure macros to add
3455 suitable debug flags to the compiler invocation.
3457 * modules/load.c: New file implementing the ``load'' and
3458 ``unload'' builtins.
3459 * tests/get-them: Set the module search directory to the modules
3460 build directory in generated tests.
3461 * modules/shadow.test: ditto.
3462 * modules/modtest.test: ditto.
3463 * modules/modpath1.test: ditto.
3464 * modules/modpath2.test: ditto.
3465 * modules/modpath3.test: ditto.
3466 * modules/modpath4.test: ditto.
3467 * modules/modtest.test: ditto.
3468 * modules/modfreeze.test: ditto.
3469 * modules/unload.test: ditto.
3471 * modules/changeword.c: New file implementing the ``changeword''
3472 builtin as a loadable module.
3473 * modules/mpeval.c: New file implementing the ``mpeval'' builtin
3474 as a loadable module.
3476 * src/main.c (main): Load the gnu module if m4 was started
3477 normally -- i.e. without the -G option.
3478 * modules/gnu.c: New file implementing a new loadable module wuth
3479 definitions for all the gnu extension builtins.
3480 * modules/format.c: Moved here from src/format.c. Now included
3483 * src/main.c (main): Load the traditional module if m4 was
3484 started in `no_gnu_extensions' mode.
3485 * modules/traditional.c: New file implementing the ``unix'' macro,
3486 required when m4 is executed in traditional mode, as a loadable
3489 * src/main.c: Renamed from m4.c to avoid confusion with
3491 (main): Always load the m4 module.
3492 * modules/m4.c: New file implementing a new loadable module with
3493 definitions for all m4 builtins that are not gnu extensions.
3495 * m4/Makefile.am: Adjusted to take new files below into account.
3496 * m4/m4module.h: Prototypes for exported functions and types moved
3497 to this directory from the src directory.
3498 * m4/m4private.h: Moved here from src/m4private.h to facilitate
3499 the migration of all builtin implementations to loadable modules.
3500 * m4/macro.c: Moved this file here from the src directory,
3501 renaming all exported symbols to use the prefix ``m4_''.
3502 * m4/builtin.c: ditto.
3503 * m4/module.c: ditto.
3504 * m4/symtab.c: ditto.
3505 * m4/debug.c: ditto.
3506 * m4/input.c: ditto.
3507 * m4/output.c: ditto.
3509 * m4/ltdl.h, m4/ltdl.c: ditto.
3510 * m4/utility.c: Odd functions moved here from files in the src
3511 directory to facilitate builtin migration.
3513 2000-08-12 Gary V. Vaughan <gary@gnu.org>
3515 * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
3516 error message, to make translators' jobs a little easier.
3517 (builtin_builtin): ditto.
3518 (builtin_traceon): ditto.
3519 (builtin_traceoff): ditto.
3520 Reported by Akim Demaille <akim@epita.fr>
3522 * m4/Makefile.am (pkgincdir): Deleted. Use automake's built in
3523 pkgincludedir instead.
3525 * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
3526 it is exported globally. Fixed all references.
3530 (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
3531 globally. Fixed all references.
3532 (DEF_LQUOTE): ditto.
3536 2000-07-28 Gary V. Vaughan <gary@gnu.org>
3541 * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
3542 (AC_OUTPUT): touch stamp-h.in, not stamp-h.
3544 * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
3545 Removed `Prev', `Next' and `Up' fields of all @nodes now that
3546 makeinfo calculates them for us, and to make any future
3547 reorganisation easier.
3548 (Frozen files): Document format version 2.
3549 `V' now takes argument `2'.
3550 `F' can take a single argument if symbol and builtin names
3551 are the same, or 3 arguments if the builtin is from a module.
3552 New `S' specification for saving syntax table contents.
3553 New `M' specification for saving loaded module names.
3554 * src/freeze.c: Implement them.
3555 * src/input.c (syntax_code): For interpreting frozen syntax
3558 * examples/Makefile.am: Add the contents of the WWW directory to
3560 * examples/WWW/Makefile: ditto,
3561 (%.htm): Compares file contents (not just sizes) to determine
3562 whether a change has occured.
3563 * examples/WWW/_header.htm: Bumped version number.
3564 * examples/WWW: Regenerated content.
3566 * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
3567 compilers comes much easier without ansi2knr.
3568 * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
3570 * m4/list.c: New generic list container type.
3571 * m4/list.h: Interface to new container type.
3572 * m4/Makefile.am (pkginc_HEADERS): Install list.h.
3573 (libm4_la_SOURCES): compile and link list.c.
3574 * src/builtin.c (builtin_tables): Use list container.
3575 * src/module.c (symtab): ditto.
3576 * src/symtab.c (symtab): ditto.
3578 * m4/system.h: New file for common preprocessor definitions.
3579 * m4/Makefile.am (pkginc_HEADERS): install system.h.
3580 * m4/error.c: Use system.h in place of inline preprocessor.
3581 * m4/error.h: ditto.
3582 * m4/module.c: ditto.
3583 * m4/module.h: ditto.
3584 * m4/xmalloc.c: ditto.
3586 * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
3588 * m4/xmalloc.c (xmalloc_exit_failure): ditto.
3590 * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
3591 it is exported globally. Fixed all references.
3593 (module_init_t): ditto.
3594 (module_finish_t): ditto.
3595 (token_data): ditto.
3596 (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
3597 it is exported globally. Fixed all references.
3598 (SYNTAX_IGNORE): ditto.
3599 (SYNTAX_SPACE): ditto.
3600 (SYNTAX_OPEN): ditto.
3601 (SYNTAX_CLOSE): ditto.
3602 (SYNTAX_COMMA): ditto.
3603 (SYNTAX_DOLLAR): ditto.
3604 (SYNTAX_ACTIVE): ditto.
3605 (SYNTAX_ESCAPE): ditto.
3606 (SYNTAX_ALPHA): ditto.
3607 (SYNTAX_NUM): ditto.
3608 (SYNTAX_ALNUM): ditto.
3609 (SYNTAX_LQUOTE): ditto.
3610 (SYNTAX_RQUOTE): ditto.
3611 (SYNTAX_BCOMM): ditto.
3612 (SYNTAX_ECOMM): ditto.
3613 (SYNTAX_VALUE): ditto.
3614 (SYNTAX_MASKS): ditto.
3632 (TOKEN_NONE): ditto.
3633 (TOKEN_STRING): ditto.
3634 (TOKEN_SPACE): ditto.
3635 (TOKEN_WORD): ditto.
3636 (TOKEN_SIMPLE): ditto.
3637 (TOKEN_MACDEF): ditto.
3639 * m4/m4module.h (voidstar): Removed in favour of `VOID' for
3640 consistency. Fixed all references.
3641 (STRING): Renamed to `m4_string' for consistency, and because if
3642 is exported globally. Fixed all references.
3643 (token_type): Renamed to `m4_token_t' for the same reasons.
3644 (token_data_type): Renamed to `m4_token_data_t' for the same
3647 * m4/m4module.h (XCALLOC): Wrapper macro which handles type
3651 (XFREE): Wrapper macro which avoids freeing NULL pointers.
3653 * m4/m4module.h (m4_macro): New type for module defined user
3655 * modules/modtest.c (m4_macro_table): Define module user macros.
3656 * modules/shadow.c (m4_macro_table): ditto.
3658 * m4/m4module.h (M4BUILTIN_HANDLER): For defining handlers
3659 declared with M4BUILTIN.
3661 * m4/xmalloc.c: Use memset if bzero is not available when
3662 emulating calloc with malloc.
3663 (xcalloc): Fallback to malloc/bzero if calloc is not available.
3664 (xfree): Added for consistency. Will not try to free NULL
3666 * src/m4.c (xfree): Deleted in favour of the above.
3667 * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
3668 linking with libdmalloc.
3669 * m4/xstrdup.c (WITH_DMALLOC): ditto.
3671 * modules/frozen.m4: New test case.
3672 * modules/unfrozen.m4: ditto.
3673 * modules/modfreeze.test: New test.
3674 * modules/unload.test: ditto.
3675 * modules/Makefile.am (EXTRA_DIST): Distribute them.
3677 * modules/modpath1.test: Don't try this test if module support is
3679 * modules/modpath2.test: ditto.
3680 * modules/modpath3.test: ditto.
3681 * modules/modpath4.test: ditto.
3682 * modules/modtest.test: ditto.
3683 * modules/shadow.test: ditto.
3685 * modules/perl.c: New module.
3686 * modules/perl.m4: Example of using it.
3687 * modules/Makefile.am (perl_la_SOURCES): Build new perl module.
3689 * src/m4.c (main): Assume interactive mode if STDIN is connected
3691 Changed startup sequence slightly so that syntax is not
3692 initialised from here when loading a frozen file.
3694 * src/builtin.c: Much improved macro definition style.
3695 * src/m4private.h: Internal structures for m4_builtin and
3696 m4_macro instances. These are not exposed to module writers.
3697 * src/module.c (module_modname_find): Find a module structure
3699 (make_macro_table): Build an internal macro table from a external
3701 (make_builtin_table): Build an internal builtin table from an
3702 external definition.
3704 * src/module.c (module_unload): Be extremely careful to remove
3705 builtins and macros that match the module being unloaded -- no
3706 longer assume that the top element can be removed incase another
3707 odule defines an identical name.
3708 * src/symtab.c (remove_table_reference_symbols): remove all symbol
3709 table entries which refer to a given builtin table.
3710 * src/builtin.c (remove_tables): Use it!
3712 2000-07-13 Thomas Tanner <tanner@ffii.org>
3714 * Makefile.am (SUBDIRS): we need modules/ for "make dist"
3715 * acm4/modules.m4: deleted
3716 * bootstrap: don't libtoolize libltdl!
3717 * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
3718 if set, enable WITH_MODULES and add modules to DLPREOPEN
3719 * examples/misc.test: redirect standard output
3720 * lib/Makefile.am: don't use DLLDFLAGS
3721 * lib/m4module.c: include necessary headers to silence GCC -Wall
3722 * lib/m4regex.c: fixes to silence GCC -Wall
3723 * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
3724 build modules conditionally
3725 * modules/shadow.c: define symbol aliases before using them
3726 * modules/test.c: define symbol aliases before using them
3727 * po/de.po: update translation
3728 * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
3729 pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
3731 * src/m4.c: initialize libltdl's preloaded symbols via
3732 LTDL_SET_PRELOADED_SYMBOLS
3733 * src/module.c: libltdl's memory management must be initialized
3734 before calling lt_dlinit!, fix warnings
3736 2000-01-18 Gary V. Vaughan <gary@gnu.org>
3738 * README: Caveat about nls not supported by dll architecture on
3741 * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
3743 * tests/Makefile.am (stamp-TESTS): now works with VPATH.
3744 * src/Makefile.am (m4_LDADD): use $(builddir) for VPATH.
3745 * modules/Makefile.am (LIBS): ditto.
3746 (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
3747 $(top_srcdir)/m4 (for only <m4module.h>).
3748 * modules/shadow.test: fixed for VPATH.
3749 * modules/modtest.test: ditto.
3750 * modules/modpath4.test: ditto.
3751 * modules/modpath3.test: ditto.
3752 * modules/modpath2.test: ditto.
3753 * modules/modpath1.test: ditto.
3755 * modules/time.test: Removed due to timezone dependence,
3756 * modules/Makefile.am (TESTS): Removed time.test.
3758 * configure.in: Use $3 of AC_DEFINE so that we can,,,
3759 * acconfig.h: Remove everything except the gettext parameters.
3760 * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
3762 * acm4/ltdl.m4: Updated to latest from libtool cvs.
3763 * acm4/modules.m4: Remove code which duplicates ltdl.m4 and
3764 increment serial number.
3766 * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
3767 src dir and immediately after libm4 is built for confidence that
3768 it doesn't rely on the src directory.
3769 (SUBDIRS): Moved doc dir to the end since helptoman.pl and
3770 makeinfo stop the build on cygwin (because they don't work).
3772 * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
3774 * m4/m4private.h: ...is not a public header, so moved to src.
3775 Add `#include <config.h>', `#define _COMPILING_M4' and
3777 * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
3778 * src/Makefile.am (noinst_HEADERS): add m4private.h.
3779 * src/builtin.c: `#include "m4private.h"' now takes care of the
3780 above. Duplicates removed.
3781 * src/debug.c: ditto.
3782 * src/eval.c: ditto.
3783 * src/evalmp.c: ditto.
3784 * src/format.c: ditto.
3785 * src/freeze.c: ditto.
3786 * src/input.c: ditto.
3788 * src/macro.c: ditto.
3789 * src/module.c: ditto.
3790 * src/numb.h: ditto.
3791 * src/output.c: ditto.
3792 * src/path.c: ditto.
3793 * stackovf.c: ditto.
3796 * po/POTFILES.in: compensate for renaming of lib/*.
3797 * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
3798 (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
3799 and then in $(top_srcdir)/lib (for eg. "m4private.h").
3800 * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
3802 * m4/m4error.h: Renamed error.h, for installation to
3803 $prefix/include/m4..
3804 * m4/m4obstack.h: Renamed obstack.h, for same reason.
3805 * m4/m4regex.h: Renamed regex.h, for same reason.
3806 * m4/m4error.c: Renamed error.c, and use #include "error.h".
3807 * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
3808 * m4/m4regex.c: Renamed regex.c, and fix #includes.
3810 * lib: moved to m4 to easily support header installation to
3812 * Makefile.am (SUBDIRS): renamed lib dir to m4.
3813 * configure.in (AC_OUTPUT): reference m4/Makefile.in.
3814 * acm4/regex.m4: Point to m4/regex.c.
3816 * examples/foreach.m4: Sanitise quoting.
3817 * examples/foreach.test: New torture test.
3818 From Akim Demaille <akim@epita.fr>
3820 2000-01-17 Gary V. Vaughan <gary@gnu.org>
3822 * src/ltdl.c: Use access() to abort doomed module load attempts
3823 if module file does not exist.
3825 * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
3826 getopt1.o will already be used if appropriate, so I moved getopt.c
3827 and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
3829 * modules/modpath1.test: Use correct filename in header line.
3830 * modules/modpath2.test: ditto.
3831 * modules/modpath3.test: ditto.
3832 * modules/modpath4.test: ditto.
3834 Without these changes lt_dlopen("test") attempts to
3835 LoadLibrary("/bin/test") on Windows, which although harmless
3836 generates a spurious error message which spoils most of the tests:
3837 * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
3838 (TESTS): s/test.test /modtest.test /
3839 (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
3840 (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
3841 * modules/modpath1.test: s/test.m4 /modtest.m4 /
3842 * modules/modpath2.test: ditto.
3843 * modules/modpath4.test: ditto.
3844 * modules/modpath3.test: s/-m test /-m modtest /
3845 * modules/shadow.m4: use {un,}loadmodule(`modtest').
3847 2000-01-16 Gary V. Vaughan <gary@gnu.org>
3849 * src/ltdl.c (find_file): Updated to new version with fixed memory
3850 allocation bug in `next'.
3851 * src/ltdl.h: updated to match.
3853 * modules/Makefile.am: Cleaned up and reordered.
3855 2000-01-16 Rene' Seindal <rene@seindal.dk>
3857 * modules/Makefile.am (TESTS): New tests for the module system.
3859 * modules/*.test: New files.
3861 * src/m4.c (main): Added call to module_init().
3862 Treats -M and -m as the arguments -D -U and -t, ie deferred.
3864 * src/m4.h: Added declaration of module_init().
3866 * src/module.c (module_init): No longer static
3868 * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
3869 Added to shut up automake about non standard libtool library
3872 * src/module.c: Disabled DEBUG by default.
3874 * modules/README: Changed example from unload.m4 to shadow.m4
3876 * modules/shadow.m4: Renamed from unload.m4
3878 * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
3880 * src/m4.c (main): Functionality for -m and -M were reversed.
3883 2000-01-12 Gary V. Vaughan <gary@gnu.org>
3885 * doc/help2man.pl: updated to version 1.020.
3887 * lib/COPYING.LIB: updated to version 2.1.
3889 * lib/m4module.h: restructure the M4_SCOPE code to work when
3890 creating a dll which links with libm4.la and both DLL_EXPORT
3891 (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
3894 2000-01-11 Gary V. Vaughan <gary@gnu.org>
3896 Merged the following changes from my tree:
3898 1999-06-15 Gary V. Vaughan <gary@gnu.org>
3900 * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
3901 ported to compile shared libs.
3903 * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
3904 use `__declspec(dllimport)' when linking libm4.la on win32.
3905 * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
3907 * configure.in (M4OBJS): Discover whether we need the shipped
3908 implementation of getopt_long.
3909 * src/Makefile.am (m4_LDADD): Link the getopt objects into the
3910 main binary here, as opposed to the module library in lib/libm4.la.
3912 1999-06-14 Gary V. Vaughan <gary@gnu.org>
3914 * modules/README: Updated to describe the improved libltdl based
3916 * README (cygwin): Added some compilation notes for building m4
3917 correctly under cygwin.
3918 * TODO: Cleaned out the entries for the module system since they
3919 are now implemented.
3921 * *.[ch]: __P is in the compiler's reserved namespace, so replaced
3922 all instances of __P with M4_PARAMS.
3924 * lib/getdate.h: removed unreferenced file.
3926 * lib/m4private.h: New file to define the private interface to the
3927 token_data struct, which must be shared between m4module.c, and
3928 builtin.c but not exported to modules built from the installed
3929 m4module.h since it's size changes depending on compile time
3932 * src/m4.h: Lots of stuff moved to lib/m4module.h.
3934 * lib/m4module.h: New file to define the interface available when
3935 compiling m4 modules.
3936 * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
3937 necessary for module compilation into this new file.
3939 * lib/Makefile.am (include_HEADERS): install headers (renamed to
3940 avoid nameclash with other system headers) necessary for compiling
3942 (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
3943 so that modules can include the (renamed) installed headers and
3944 be guaranteed a matching implementation.
3945 * lib/m4error.h: renamed from error.h.
3946 * lib/m4obstack.h: renamed from obstack.h.
3947 * lib/m4regex.h: renamed from regex.h.
3948 * configure.in (AC_REPLACE_FUNCS): Don't look for a system
3949 implementation, simply include the shipped version
3950 unconditionally, otherwise it is hard for a module to know
3951 whether the m4obstack.h header it is using matches the
3952 implementation it ends up linking against.
3953 (jm_WITH_REGEX): Include regex into libm4 unconditionally for
3956 1999-05-18 Gary V. Vaughan <gary@gnu.org>
3958 * examples/misc.test: Don't run this test on machines which don't
3959 have a root user in /etc/passwd (e.g. cygwin).
3961 * tests/get-them (/^@example$/): Error messages might have a
3962 ``.exe'' suffix to the program name, or else use the libtool
3963 ``.libs/lt-m4'' binary, or generally have an unexpected path. All
3964 of these cases are now catered for when comparing error messages
3966 * tests/other-tests/*.test: ditto.
3967 * examples/*.test: ditto.
3969 * tests/defs (M4): use libtool execute mode.
3970 * examples/defs (M4): ditto.
3972 * tests/get-them (END): explicitly close any open file.
3973 (printthem): In a regular expression, '{' is the start of a repeat
3974 count! Use `[{]' for a literal open brace.
3975 (/^@node /): Don't use substr on a string shorter than the trim
3978 1999-05-17 Gary V. Vaughan <gary@gnu.org>
3980 * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
3982 (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
3984 2000-01-10 Andreas Schwab <schwab@suse.de>
3986 * tests/other-tests/gmp.test: Find config.sh in build directory.
3988 * configure.in: Find tests/mkconfig.sh in $srcdir.
3990 * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
3991 <signal.h> (for SUS2 compliant systems).
3993 * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
3996 2000-01-10 Rene' Seindal <rene@seindal.dk>
4000 * TODO, NEWS: Cleaned up and updated.
4002 * src/m4.c (main): New variable exit_status for exit status in
4003 case of unreadable files. Now m4 will exit with EXIT_FAILURE if a
4004 file cannot be read instead of EXIT_SUCCESS.
4006 * src/builtin.c (m4_indir): Changed error message to help
4007 translators (from Akim Demaille <demaille@inf.enst.fr>).
4009 * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
4012 * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
4015 * src/input.c (match_input): Reordering of code, to avoid multiple
4016 calls to push_string_init() from obstack_grow(), which can happen
4017 with some compilers (found and fixed by James Bonfield
4018 <jkb@mrc-lmb.cam.ac.uk>).
4020 * src/stackovf.c: Added prototypes for ultrix.
4021 (setup_stackovf_trap): Added __P to cast.
4022 (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
4024 2000-01-09 Rene' Seindal <rene@seindal.dk>
4026 * doc/m4.texinfo (Changequote): Added comment about changing
4027 quotes when the old quote is a part of the new.
4029 * src/builtin.c (expand_ranges): Added break after trailing dash.
4030 This caused misbehavious on some systems (found and fixed by Akim
4031 Demaille <demaille@inf.enst.fr>).
4033 * AUTHORS: Thomas Tanner included
4035 * acconfig.h: Added entry for ss_sp (see below).
4037 * configure.in (use_stackovf): Added check for stack_t with member
4038 ss_base instead of ss_sp (BSDI notably). (Reported by Paul Eggert
4039 <eggert@twinsun.com>).
4041 * doc/m4.texinfo (Frozen files): Added a simpler example for
4042 generating frozen files from several input files.
4044 1999-11-14 Paul Eggert <eggert@twinsun.com>
4046 * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
4047 lib/regex.c, lib/xmalloc.c.
4049 1999-11-10 Rene' Seindal <rene@seindal.dk>
4051 * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
4053 * src/module.c: reindented.
4054 (module_load): return if this is a repeated load of same module.
4055 (module_init): slight change of logic to avoid repeated
4056 initialisation debug messages.
4058 * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
4059 in the distribution.
4061 * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
4062 automake warnings about missing lib prefix.
4063 (time_la_LDFLAGS): ditto
4064 (stdlib_la_LDFLAGS): ditto
4066 1999-11-10 Paul Eggert <eggert@twinsun.com>
4068 * src/m4.h: Include error.h, since our macros use error.
4069 * src/m4.c: Don't need to include error.h.
4071 1999-11-09 Paul Eggert <eggert@twinsun.com>
4073 * src/m4.h (voidstar): Define to void * if __STDC__ is defined
4074 and zero, as Solaris 7 cc does.
4075 (bcopy): Remove macro; no longer needed with new obstack.h.
4077 * src/output.c (freeze_diversions): Don't assume that a
4078 diversion size can fit in `int'. Check for diversion file
4079 size too large to be printed with `unsigned long'.
4081 * src/Makefile.am (CFLAGS): Omit -Wall.
4083 * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
4085 * src/debug.c (trace_format):
4086 Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
4088 * src/freeze.c (produce_frozen_state):
4089 Don't assume string lengths fit in int.
4091 1999-10-13 Rene' Seindal <rene@seindal.dk>
4093 * configure.in (ALL_LINGUAS): Added Greek translation (el).
4094 (ALL_LINGUAS): Added Czech translation (cs).
4096 1999-03-30 Gary V. Vaughan <gary@gnu.org>
4098 * src/builtin.c: moved module loading functions into...
4099 * src/module.c: entirely new implementation using libltdl.
4100 * po/POTFILES.in: added src/module.c.
4101 * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
4102 are modules, not linktime libraries.
4103 (LDFLAGS): added -no-undefined -module and -avoid-version flags.
4104 * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
4105 avoidance on exported symbols.
4106 * modules/test.c (m4_macro_table, m4_init_module,
4107 m4_finish_module): ditto.
4108 * modules/time.c (m4_macro_table): ditto.
4110 * modules/time2.m4: new file which requires command line loading
4112 * src/m4.c (--load-module): dynamically load named runtime module
4113 into running executable before reading the source.
4114 (--module-directory): prepend a directory to the module search
4116 (module_init()): Do this the first time we load a module instead;
4117 if the module subsystem is broken normal m4 scripts can still run.
4118 * src/m4.h (install_builtin_table): is now exported.
4120 1999-03-26 Gary V. Vaughan <gary@gnu.org>
4122 * src/module.c: removed. No longer required.
4123 * po/POTFILES.in: removed src/module.c.
4125 * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
4126 the bootstrap script can recreate.
4127 * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
4128 * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
4129 * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
4130 * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
4131 (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
4132 * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
4133 * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
4134 * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
4136 * acinclude.m4: removed. `aclocal -I acm4' handles this much
4138 * acm4/Makefile.am (ACINCLUDE_M4): ditto.
4139 * acm4/gettext.m4: removed. It causes a multiple definition vs.
4140 the installed gettext.m4 file when running aclocal.
4142 1999-03-25 Gary V. Vaughan <gary@gnu.org>
4144 * configure.in (AM_INIT_AUTOMAKE): bumped version number to
4145 distinguish this from the last prerelease.
4146 (AC_LIBLTDL_CONVENIENCE): build libltdl as a convenience library
4147 in its own subdirectory.
4149 * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
4150 lib prefix on a module" feature.
4151 (LDFLAGS): Added `-module -avoid-version' flags to build
4152 versionless module libraries.
4153 * src/builtin.c (m4_load_module): use libltdl.
4154 (module_unload_all): use libltdl.
4155 * src/m4.c (module_init): initialise module loading on demand for
4156 better diagnostics, and so that m4 will still work even if
4157 the module code is broken.
4158 * src/m4.h (module_init): removed. No longer relevant.
4159 * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
4160 exported symbols for compatibility with dlpreopening.
4161 * modules/test.c (m4_macro_table, m4_init_module,
4162 m4_finish_module): ditto.
4163 * modules/time.c (m4_macro_table): ditto.
4165 * bootstrap: New file. Runs all the autoutils in the right order
4166 after a fresh checkout, or a make maintainer-clean.
4168 1999-02-18 Akim Demaille <demaille@inf.enst.fr>
4170 * src/builtin.c (dump_symbols): New function, factoring common
4171 content of m4_dumpdef and m4_symbols.
4172 (m4_dumpdef): Use it.
4173 (m4_symbols): New function, implementing `symbols'. Use it.
4174 * doc/m4.texinfo: Fixed missing commas after @xref, so that the
4175 file compile with modern makeinfo.
4176 (Symbols): New node, documenting symbols.
4177 (direntry): Modernize.
4179 1998-12-11 Rene' Seindal <rene@seindal.dk>
4181 * src/builtin.c (predefined_tab): New predefined macros
4182 __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
4183 configure time options.
4185 1998-12-01 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
4187 * src/module.c (module_try_load): Don't try to be clever and
4188 overwrite argument string. Instead allocate all constructed
4189 strings locally, since they can have arbitrary lengths. Make
4190 arguments pointers to const.
4191 (module_search): Simplify due to above change.
4193 1998-11-29 Rene' Seindal <rene@seindal.dk>
4197 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
4199 * tests/other-tests/import-environment.{m4,test}: New test.
4201 * tests/other-tests/discard-comments.{m4,test}: New test.
4203 * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
4205 * src/m4.c (main): New option -c --discard-comments.
4206 New global variable discard_comments.
4208 * src/m4.h (token_type): New TOKEN_NONE for tokens to be
4209 discarded, ie never returned from next_token().
4210 Added declaration of discard_comments.
4212 * src/input.c (next_token): Now loops until token type is not
4213 TOKEN_NONE. Comments are now given this type when comments should
4216 * doc/m4.texinfo (Invoking m4): Updated for --import-environment
4219 1998-11-28 Rene' Seindal <rene@seindal.dk>
4221 * src/m4.c (main): New option --import-environment (no single
4224 * When configured with --with-gmp both the normal (fast) eval()
4225 and the gmp aware mpeval() are defined. To restore previous
4226 bahaviour use "define(`eval', defn(`mpeval'))".
4228 * tests/other-tests/gmp.m4: Changed to use mpeval().
4230 * src/evalmp.c: New file for compiling eval.c as gmp aware.
4231 Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
4233 * src/eval.c: Now includes "numb.c" directly. Everything in this
4234 file must by static, except evaluate(), which is changed to
4235 mp_evaluate() if USE_GMP in force.
4237 * src/numb.c: Changed to be included by eval.c instead of being
4238 compiled separately. Everything is declared static.
4240 * src/numb.h: Removed declarations of functions, as numb.c is now
4243 * src/builtin.c: Declaration of m4_mpeval() added.
4244 Inserted `mpeval' in builtin table.
4245 (do_eval): New function with common code for m4_eval and m4_mpeval.
4246 (m4_mpeval): New function for gmp version of eval.
4248 * src/m4.h: Declaration of mp_evaluate().
4250 * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
4251 (EXTRA_m4_SOURCES): Now has numb.c and numb.h
4253 * src/m4.c (main): m4 --version also shows which options were used
4254 for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
4256 1998-11-27 Rene' Seindal <rene@seindal.dk>
4258 * Error messages now always print program name before input file
4259 name as specified by GNU coding standards. Reported by Akim
4260 Demaille <demaille@inf.enst.fr>.
4262 * doc/m4.texinfo (Include): Change due to changed error message
4266 * tests/get-them: Minor change to sed script due to changed error
4269 * src/m4.c (print_program_name): New func used to print program
4270 name, input file and line number in error (). Used as an
4271 error_print_progname handler.
4272 (reference_error): Removed.
4273 (main): Assigns error_print_progname.
4275 * src/m4.h (M4ERROR): Removed reference_error ().
4277 1998-11-25 Rene' Seindal <rene@seindal.dk>
4279 * Updated to libtool 1.2b.
4281 * src/builtin.c (install_builtin_table): Added braces to avoid
4282 warning of ambiguous 'else'.
4284 * src/module.c: Inserted search path code from path.c modified to
4286 (module_init): Configured default path used only if M4MODPATH is
4288 (module_try_load): Now reads libMODULE.la as generated by libtool
4289 for actual module name.
4290 (module_load): Gives better error messages on failure.
4292 * src/m4.h: Added declarations of structures and functions for
4293 generic search path handling.
4295 * src/path.c: Removed all module specific code and introduced new
4296 functions of more generic search path handling.
4298 1998-11-24 Rene' Seindal <rene@seindal.dk>
4300 * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
4301 included gettext, as <libintl.h> might not be found
4302 otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
4304 1998-11-22 Rene' Seindal <rene@seindal.dk>
4306 * src/output.c (insert_diversion): Fixed bug that might cause m4
4307 to read from standard output! Triggered by input
4308 'divert(1)undivert(0)'. Test for divnum>0 changed to divnum>=0,
4309 so now 'undivert(0)' does nothing.
4311 1998-11-18 Rene' Seindal <rene@seindal.dk>
4315 * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
4316 could be changed when compiling a illegal regexp, causing later
4317 use of the regexp to dump core.
4319 * src/module.c (module_load): Changed error message to conform to
4322 * src/m4.c (usage): Added message about reporting bugs.
4324 * doc/m4.texinfo (Changeword): Corrected a wrong example.
4325 (Changeword): Added note about the type of regexps used.
4327 * ltconfig, ltmain.sh: New files from Libtool 1.2.
4329 * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
4330 and AM_PROG_LIBTOOL.
4332 * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
4335 * modules/Makefile.am: Changed completely to compile modules using
4336 libtool. The modules are compiled as shared libraries, and are
4337 renamed when installed.
4339 * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
4340 USE_SHL_LOAD to HAVE_SHL_LOAD
4342 * src/builtin.c (shipout_string): Now tests for a NULL string.
4344 * src/module.c: New level of indirection around non-portable
4345 functions to load shared objects. Intended to encapsulate the non
4346 portable parts better and to reduce the number of #ifdefs in the
4349 * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
4350 directory modules/ to the distribution.
4352 1998-11-15 Rene' Seindal <rene@seindal.dk>
4356 * modules/stdlib.c: New module `stdlib' defining some standard
4357 functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
4358 getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
4360 * src/builtin.c (shipout_string): New convenience function for
4361 builtins and modules.
4363 * src/module.c (module_load): Tentative support for
4364 shl_load/shl_findsym, but I cannot test it. Copied from MetaHTML.
4366 * Makefile.am (SUBDIRS): Directory modules added if configured.
4368 * modules/Makefile.am: Now correctly compiles and installs
4369 modules in pkglibexecdir.
4371 * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
4372 These two are now initialised by autoconf macros.
4374 * src/path.c (module_env_init): MODULE_PATH is always on the
4377 * src/Makefile.am: Now generated pathconf.h which defined the
4378 default MODULE_PATH.
4380 * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
4381 where modules are installed.
4383 * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
4384 by Brian J. Fox <bfox@datawave.net>. This change allow modules to
4385 build and install automatically, and it is prepared for other
4386 interfacec than dlopen().
4388 * src/builtin.c (predefined_tab): Added __m4_version__ for the
4389 current version of GNU m4. It is a GNU extension.
4391 1998-11-14 Rene' Seindal <rene@seindal.dk>
4393 * tests/Makefile.am (GENERATED_TESTS): Added new
4394 generated-tests/changesy.8.test
4396 * doc/m4.texinfo (Changesyntax): Documentation for escape
4399 * src/macro.c (expand_token): Check for escaped macro call before
4400 symbol table lookup.
4402 * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
4405 * src/input.c: New static variable use_macro_escape, which is TRUE
4406 iff some character has code SYNTAX_ESCAPE
4407 (input_init): Added initialisation of use_macro_escape.
4408 (check_use_macro_escape): New function to synchronise
4409 use_macro_escape with the syntax table.
4410 (set_quotes): Added call to check_use_macro_escape()
4413 (next_token): Added new case for IS_ESCAPE.
4415 * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
4417 1998-10-13 René Seindal <rene@seindal.dk>
4421 * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
4424 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
4425 maintained tests in tests/other-tests. These currently tests for
4426 8-bit transparency, multiple precision arithmetic and sync-line
4427 output. Test for stackoverflow detection does not work.
4429 * examples/Makefile.am (TESTS): Added tests for all example files.
4431 * examples/mktests.sh: New file. Help program for creating test
4434 * tests/mkconfig.sh: New file to generate tests/config.m4 and
4435 tests/config.sh. This is for tests of configure selectable
4436 features. Picks up all set WITH_ and ENABLE_ veriables from
4439 * src/path.c (path_search): Added argument 'char **expanded_name'
4440 to return the expanded name.
4442 * src/m4.h: Added 2nd argument to declaration of path_search().
4444 * src/m4.c (main): Added 2nd argument to path_search().
4446 * src/freeze.c (reload_frozen_state): Do.
4448 * src/builtin.c (m4_undivert): Do.
4451 1998-10-11 René Seindal <rene@seindal.dk>
4453 * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
4455 * acm4/modules.m4: New file. Defines AM_WITH_MODULES.
4457 * acm4/gmp.m4: New file. Defines AM_WITH_GMP.
4459 * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
4461 * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
4463 * intl/: Updated to GNU gettext 0.10.35.
4465 * doc/m4.texinfo (Format): Documented that format is blind.
4467 * src/builtin.c (builtin_tab): Builtin format marked as blind.
4469 1998-10-07 René Seindal <rene@seindal.dk>
4473 * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
4474 .test, as the files are no longer just m4 input.
4476 * tests/get-them (FILE): Changed .m4 extension to .test.
4478 * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
4479 Otherwise quoted strings with leading whitespace first in a macro
4480 argument would be eliminated.
4482 * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
4483 (expand_argument): Do.
4485 * src/input.c (next_token): SPACE and NUM/OTHER characters are only
4486 grouped together iff both quote and comment strings are single
4487 character. Otherwise they might include a comment/quote leader.
4488 (next_token): Returns new token type TOKEN_SPACE.
4490 * src/builtin.c (push_builtin_table): New function to push a
4491 builtin_table on the stack without installing its contents.
4492 (find_builtin_by_name): Added call to push_builtin_table() if
4493 reading frozen files. Otherwise the builtins named in the frozen
4494 files could not be found.
4495 (install_builtin_table): Changed to use push_builtin_table()
4497 1998-10-04 René Seindal <rene@seindal.dk>
4501 * configure.in (ALL_LINGUAS): Added Polish pl.po
4503 1998-10-03 René Seindal <rene@seindal.dk>
4505 * Many files: Incorporated changes to implement dynamic modules.
4506 Detailed comments in src/modules.c and modules/README
4508 * src/module.c: New file, implements the OS dependant parts of
4509 dynamic module loading.
4511 * src/Makefile.am (m4_SOURCES): Added module.c
4513 * src/builtin.h: New file, declares some functions from builtin.c
4514 that are of use for other modules (shipout_int, numeric_arg,
4515 skip_space, bad_argc), and the macros ARG() and DECLARE().
4517 * src/builtin.c (install_builtin_table): New function. Each
4518 module brings in a builtin_table, which is pushed on a stack.
4519 (struct builtin_table): New struct for list of builtin_tables.
4520 (m4_loadmodule): New function to implement builtin "loadmodule".
4521 (shipout_int): No longer static, to be used by modules.
4525 (builtin_init): changed to call install_builtin_table()
4526 (find_builtin_by_name): Now searches all builtin_tables
4527 (find_builtin_by_addr): do.
4529 * src/path.c: Reorganised to allow for two search paths, one for
4530 include files and one for modules.
4532 * src/m4.h: Added declarations for new functions in module.c and
4535 * src/m4.c (main): Added call to module_init().
4537 * modules: New directory with a few demo modules.
4539 * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
4542 * configure.in: Added modules/Makefile to AC_OUTPUT.
4544 * configure.in: Added code to implement --with-modules. Tests for
4547 * acconfig.h: Added WITH_MODULES
4549 1998-10-02 René Seindal <rene@seindal.dk>
4551 * examples/Makefile.am (pkgdata_DATA): Removed special target for
4552 check and variables TESTS. These tests are now run from the
4555 * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
4556 directory. The files stay there but the tests are run from the
4559 * tests/Makefile.am (EXTRA_DIST): Added run-test.
4561 * tests/run-test: New file. Run a test manually
4563 * tests/Makefile.am, tests/get_them: Moved automatically generated
4564 tests (from the manual) to sub directory tests/gentest/. The
4565 tests/ directory had gotten a bit messy.
4567 1998-09-06 Erick Branderhorst <Erick.Branderhorst@asml.nl>
4569 * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
4570 wrap}.test: Added a few testcases.
4572 1998-08-21 Erick Branderhorst <Erick.Branderhorst@asml.nl>
4576 * lib/Makefile.am (noinst_HEADERS): regex.h added
4578 * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
4579 acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
4581 * acm4/Makefile.am: created providing rules to create
4582 $(top_srcdir)/acinclude.m4 to be used by aclocal.
4584 * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
4585 `C'. Reported by Ulrich Drepper.
4587 * Makefile.am (SUBDIRS): Removed checks directory
4588 * configure.in (AC_OUTPUT): Removed checks/Makefile
4590 * doc/m4.texinfo (Patsubst,example): @comment added to preserve
4591 the space when m4.texinfo is edited and whitespace.el is active.
4592 (Defn,example): idem.
4594 1998-08-20 Erick Branderhorst <Erick.Branderhorst@asml.nl>
4596 * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
4597 ../COPYING. ../Makefile is a file which is certainly present when
4598 test is executed in testSubDir. One can't be sure that the COPYING
4599 file is in .. or ../.. in all situations, the ../Makefile is
4602 * doc/m4.texinfo (Include): adjusted expected test output
4603 according to new tests, i.e. the input will always come from the
4604 file `in' created by the test.
4606 * tests/Makefile.am: Added three lines at the top to get
4607 esyscmd.1.test working.
4609 * tests/get-them: modified to generate clearer tests who will need
4610 less maintenance when new test examples are created in
4611 `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
4612 need the generic file `defs') shell scripts creating `in', `ok',
4613 `out' and when apropriate `okerr' and `err' in the directory
4614 `testSubDir' when executed. The compare of `ok' and `out'
4615 (and of `okerr' and `err') will be the exit status of the test.
4616 `out' must match `ok' (and `okerr' must match `err') for the test
4619 * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
4620 the tests generated by tests/get-them getting it input normally
4621 from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
4622 (dot) before the numeric part) is reserved for all other (hand
4623 written) tests. The `+' means one or more times.
4625 1998-08-12 Erick Branderhorst <Erick.Branderhorst@asml.nl>
4627 * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
4628 supported short man page to refer to info documentation
4629 * helptoman.pl: added
4630 * configure.in: AC_PATH_PROG(PERL,perl)
4631 * Makefile.am (SUBDIRS): doc after src
4633 * libitized with libit 0.5 from
4634 ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
4636 * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
4637 * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
4638 replacement functions, (libm4_a_LIBADD): @LIBOBJS@
4639 * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
4641 * configure.in (AC_CHECK_FUNC): getopt_long
4643 * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
4645 * TODO: added entry about dependencies
4647 1998-08-10 René Seindal <rene@seindal.dk>
4651 * doc/m4.texinfo (Changesyntax): Added documentation for the macro
4654 * src/builtin.c (m4_changesyntax): Added builtin macro
4655 "changesyntax" to modify the syntax table.
4657 * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
4658 table. All categories are assigned a syntax code and tokens are
4659 read according to this table.
4661 1998-08-09 René Seindal <rene@seindal.dk>
4663 * src/numb.{c,h}: New files, implements multiple precision eval
4664 using GNU gmp. Originally submitted by John Gerard Makecki
4665 (johnm@vlibs.com), later modified. Tested with GNU gmp 2.0.2.
4667 * doc/m4.texinfo (Eval): Added documentation for multiple
4668 precision arithmetic library support.
4670 * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
4671 to accommodate multiple precision eval.
4673 1998-08-07 René Seindal <rene@seindal.dk>
4675 * src/input.c (MATCH, match_input), src/m4.h: changed definition
4676 of comment and quote strings to `unsigned int' to allow eight bit
4677 chars (reported by andrewb@zip.com.au (Andrew Bettison)).
4679 * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
4680 patch from Mike Howard <mike@clove.com>
4682 1998-08-06 René Seindal <rene@seindal.dk>
4684 * gettext.m4: corrected AM_WITH_NLS to handle use of installed
4687 1998-08-03 René Seindal <rene@seindal.dk>
4691 * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
4692 and _ macro. M4 now builds with --disable-nls.
4694 * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
4695 to look for right message catalogs. Call indef'ed by ENABLE_NLS.
4697 * configure.in (ALL_LINGUAS): Added complete list of translations:
4698 de fr it ja nl ru sv.
4700 1998-05-22 Erick Branderhorst <Erick.Branderhorst@asml.nl>
4704 * src/m4.c: #include <signal.h> not <sys/signal.h>.
4706 * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
4708 * checks/Makefile.am: explicit list tests in CHECKS.
4710 * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
4711 src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
4712 mkinstalldirs, install-sh: Added automake (1.3) support.
4714 * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
4715 obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
4716 Used libitize (0.4) to update.
4718 * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
4719 (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
4722 * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
4723 stack overflow functionality.
4725 1994-12-03 François Pinard <pinard@iro.umontreal.ca>
4729 * Makefile.in (realclean-local): Delete stamp-h.in.
4731 * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
4732 Localize, adapting from how it is done in sharutils.
4734 * fr.tt: New file, for French.
4736 * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
4737 src/freeze.c: Rename PRODUCT to PACKAGE.
4739 1994-11-26 François Pinard <pinard@iro.umontreal.ca>
4741 * configure.in: Check for <libintl.h> and <locale.h>.
4742 * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
4743 src/stackovf.c: Rename _ to __P.
4744 * src/m4.h: Declare _ as a macro returning its argument, or else,
4745 include <libintl.h> and declare _ as gettext.
4746 * src/m4.c: Possibly include <locale.h> and call setlocale.
4747 * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
4748 src/input.c, src/macro.c, src/output.c, src/path.c,
4749 src/stackovf.c, src/symtab.c: Use _ macro over all localizable
4752 1994-11-07 François Pinard <pinard@iro.umontreal.ca>
4754 * doc/Makefile.in (stamp-vti): Use new -r option to date.
4756 * configure.in: Put --with-gmp in place, in prevision for John
4758 * acconfig.h: Document WITH_GMP.
4760 1994-11-05 François Pinard <pinard@iro.umontreal.ca>
4764 * doc/Makefile.in (realclean): Also remove stamp-vti.
4765 Reported by Eric Backus.
4767 1994-11-02 François Pinard <pinard@iro.umontreal.ca>
4769 * src/freeze.c (produce_frozen_state): If the frozen file cannot
4770 be opened, return immediately after producing the error message.
4771 Reported by Andreas Schwab.
4773 * configure.in: Check for const only after having found possible
4774 ANSIfying compiler flags, this is of no use to check it before.
4775 Reported by Alexander Lehmann.
4777 1994-11-01 François Pinard <pinard@iro.umontreal.ca>
4779 * src/macro.c (collect_arguments): Cast obstack arguments to
4780 (voidstar), so avoiding compiler warnings.
4781 Reported by Joseph E. Sacco.
4783 * src/freeze.c (produce_frozen_state): Cast printed lengths to
4784 (int) so they correspond to %d format items.
4785 Reported by Joseph E. Sacco.
4787 * src/m4.c (main): Cast the argument to xfree to (voidstar).
4788 * src/symtab.c (free_symbol): Idem.
4789 Reported by Karl Vogel.
4791 1994-10-31 François Pinard <pinard@iro.umontreal.ca>
4793 * Makefile.in (DISTFILES): Distribute BACKLOG.
4795 * configure.in: Define PRODUCT and VERSION.
4796 * acconfig.h: Document PRODUCT and VERSION.
4797 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
4798 constant string m4 and variable or parameter named version.
4800 1994-10-30 François Pinard <pinard@iro.umontreal.ca>
4802 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
4803 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
4804 defines __STDC__ to 0, for indicating it is *not* ANSI!
4805 Reported by Kaveh R. Ghazi.
4807 * configure.in: Added obsolescent tests for AIX and Minix.
4809 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
4810 which texclean does not exist anymore.
4811 Reported by Eric Backus, Jim Meyering, John David Anglin and
4814 1994-10-29 François Pinard <pinard@iro.umontreal.ca>
4816 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
4817 Reported by John David Anglin.
4819 * src/ansi2knr.c: New version, sent by Peter Deutsch.
4820 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
4821 ANSI2KNR, depending on the fact the compiler is ANSI or not.
4822 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
4823 Remove the sed filter after ansi2knr for debug.c. Use $O instead
4824 of $U, put underline in extensions rather than in basenames. Use
4825 implicit rules, now that regularity makes this possible.
4826 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
4827 of ansi2knr whenever it is needed.
4828 * configure.in: Adjusted for correct STACKOVF substitution.
4829 * src/debug.c (trace_format): When not __STDC__, use (...) as a
4830 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
4831 Reported by David MacKenzie.
4833 * Makefile.in: Remove binprefix. Use transform_name instead.
4834 Reported by David MacKenzie.
4836 * doc/Makefile.in: Create version.texi, use it, clean it.
4837 Reported by Jim Meyering.
4839 1994-10-28 François Pinard <pinard@iro.umontreal.ca>
4841 * Makefile.in (all, install, uninstall): Depend on Makefile.
4843 * Makefile.in: For actions invoking $(MAKE) from within compound
4844 sh statements, exit non-zero if the sub-make fails. Otherwise,
4845 the top-level make may exit successfully when it should fail.
4846 Reported by Jim Kingdon.
4848 * {,/*}Makefile.in: Use && after all cd, in case they fail.
4850 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
4851 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
4852 * configure.in: Substitute PRODUCT and VERSION.
4854 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
4856 1994-10-27 François Pinard <pinard@iro.umontreal.ca>
4858 * Makefile.in (mostlyclean-local): Do not remove *~.
4859 * */Makefile.in (mostlyclean): Idem.
4860 Reported by Robert E. Brown and Richard Stallman.
4862 1994-10-09 François Pinard <pinard@iro.umontreal.ca>
4864 * src/m4.h: Get rid of CONFIG_BROKETS.
4866 1994-10-02 François Pinard <pinard@iro.umontreal.ca>
4868 * configure.in: Use AC_ARG_PROGRAM.
4869 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
4870 Reported by David MacKenzie.
4872 1994-10-01 François Pinard <pinard@iro.umontreal.ca>
4874 * configure.in: Do not add -O to CFLAGS for GNU C, now that
4875 configure does it automatically.
4876 Reported by Jim Meyering.
4878 1994-09-23 François Pinard <pinard@iro.umontreal.ca>
4880 * src/stackovf.c: Declare the handler_t typedef earlier in the
4881 code, use it for stackovf_handler.
4882 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
4883 casting sigsegv_handler.
4884 Reported by Robert Bernstein.
4886 * src/m4.c (main): Initialize program_name to argv[0] without
4888 Reported by Karl Berry.
4890 1994-09-18 François Pinard <pinard@iro.umontreal.ca>
4892 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
4893 Reported by Karl Berry.
4895 1994-09-14 François Pinard <pinard@iro.umontreal.ca>
4897 * lib/Makefile.in (mostlyclean): Added.
4898 (TAGS): Make in $(srcdir).
4900 * configure.in: Use `choke me' in test, like everywhere!
4902 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
4903 unreacheable and useless.
4905 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
4907 * lib/Makefile.in (DISTFILES): Distribute TAGS.
4908 (distclean): Do not remove TAGS.
4909 (realclean): Remove it.
4910 * Makefile.in: Make TAGS in lib also, not just in src.
4911 Reported by Karl Berry.
4913 * Makefile.in (distclean, realclean): Instead of recursively
4914 calling $(MAKE) for the -local part, allow parallel execution of
4915 -recursive and -local, only delay the removal of config.status,
4916 which is repeated in both goals.
4918 1994-09-13 François Pinard <pinard@iro.umontreal.ca>
4922 * Makefile.in: Group all *clean-recursive goals in one, using sed
4923 to remove `-recursive' while calling make recursively. Also, use
4924 a subshell for each recursive $(MAKE).
4925 Reported by Jim Meyering.
4927 * src/m4.h (memcpy): Define with bcopy for BSD systems.
4928 Reported by Kaveh R. Ghazi.
4930 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
4931 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
4934 * configure.in: Use date instead of touch for stamp-h.
4935 * Makefile.in (stamp-h.in): Idem.
4937 * Makefile.in (distclean, realclean): Force serial execution of
4938 both goals, in case parallel makes are being used.
4939 Reported by Jim Meyering.
4941 * src/Makefile.in (DISTFILES): Distribute TAGS.
4942 (distclean): Do not remove TAGS.
4943 (realclean): Remove it.
4944 Reported by Karl Berry.
4946 1994-09-10 François Pinard <pinard@iro.umontreal.ca>
4948 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
4949 to old names, for following Autoconf.
4951 1994-09-08 François Pinard <pinard@iro.umontreal.ca>
4953 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
4954 ./install.sh will not be correctly referred to in sub-Makefiles.
4955 Reported by John David Anglin.
4957 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
4958 Reported by Eric Backus.
4960 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
4961 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
4962 config.status into remaking this directory's Makefile only.
4963 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
4964 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
4965 Reported by Jim Meyering.
4967 1994-09-06 François Pinard <pinard@iro.umontreal.ca>
4969 * configure.in: Correct stack overflow detection logic, taking
4970 care of systems having only incomplete implementations (like for
4971 Pyramid 9820 OSx 5.0d).
4972 Reported by Kaveh R. Ghazi.
4974 * src/Makefile.in (TAGS): Remote -t from etags call.
4976 1994-09-02 François Pinard <pinard@iro.umontreal.ca>
4978 * lib/Makefile.in (install): Depend on all.
4980 1994-08-31 François Pinard <pinard@iro.umontreal.ca>
4982 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
4983 Reported by Jim Meyering and John David Anglin.
4985 * Makefile.in (distclean-local): Delete config.log.
4986 Reported by Jim Meyering.
4988 Solidify frozen files with respect to -P:
4989 * src/m4.c: Have -P set prefix_all_buitins variable instead of
4990 calling a function by that name. Declare the variable.
4991 * src/m4.h: Adjust declaration for prefix_all_buitins.
4992 * src/builtin.c (builtin_init): Merge in functionality from
4993 previous prefix_all_buitins function, while making entries in the
4994 symbol table, but not modifying the builtin description itself.
4996 * src/freeze.c (reload_frozen_state): Add a useless `break;',
4997 because *many* compilers do not accept an empty `default:'.
4998 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
4999 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
5001 * configure.in: Use AC_TYPE_SIGNAL.
5002 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
5003 Reported by Robert Bernstein.
5005 * checks/Makefile.in (check): Modify PATH so check-them will find
5006 m4 in the src directory.
5007 * Makefile.in (check): Don't.
5008 Reported by Akiko Matsushita and Jim Meyering.
5010 * src/output.c (make_room_for, output_character_helper): New
5011 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
5012 a per buffer MAXIMUM_BUFFER_SIZE.
5014 * src/output.c (output_text): New function, for optimizing the
5015 output of strings of characters. Use it.
5017 1994-08-30 François Pinard <pinard@iro.umontreal.ca>
5019 * doc, src: New directories reorganizing the distribution.
5020 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
5022 * Makefile.in: Adjusted.
5023 * configure.in: Configure new Makefiles.
5025 * m4.h: Declare STRING typedef. Use it for comment and quote
5026 strings, adjusting all references. (This is the rudiments of a
5027 beginning for the eventual withdrawal of NUL terminated strings.)
5028 * output.c (shipout_text): Accept a length parameter, and use it.
5029 All callers adjusted.
5031 1994-08-29 François Pinard <pinard@iro.umontreal.ca>
5033 * m4.h: Include <unistd.h> if it exists.
5034 * stackovf.c: Don't.
5036 Clean up for current_diversion variable:
5037 * output.c: Move current_diversion from builtin.c.
5038 * m4.h: Declare current_diversion so builtin.c can access it.
5039 * output.c (output_init, make_diversion): Initialize or update
5041 * builtin.c (builtin_init, m4_divert): Leave current_diversion
5044 Remove limit on number of diversions:
5045 * output.c: Replace ndiversion by diversions, declare it.
5046 (output_init): Allocate only diversion 0.
5047 (make_diversion): Allocate new diversions as needed.
5048 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
5049 * m4.c: Still accept -N, but do nothing with it.
5050 Reported by David MacKenzie.
5053 * output.c (freeze_diversions): New function.
5054 * m4.h: Declare freeze_diversions.
5055 * freeze.c: Document frozen file format, revise it, call
5056 freeze_diversions to add diversions to frozen format, and code to
5057 reload them properly.
5058 * m4.c: Do not undivert automatically at end when status being
5059 frozen. Do not call builtin_init when reloading frozen state.
5061 Speed up diversion processing:
5062 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
5063 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
5064 structure and variables, cached variables out of output_diversion,
5065 reallocate_diversion_for and OUTPUT_CHARACTER.
5066 (shipout_text, make_diversion, insert_diversion): Adapted to new
5068 (insert_file): Use better buffering.
5069 Reported by David MacKenzie.
5071 1994-08-28 François Pinard <pinard@iro.umontreal.ca>
5073 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
5074 dist works from another build directory.
5076 1994-08-27 François Pinard <pinard@iro.umontreal.ca>
5078 * symtab.c (hack_all_symbols): Use hash_table_size instead of
5079 constant HASHMAX, for -H option to work better.
5081 * builtin.c (DECLARE): Simplify by using _ ().
5083 * freeze.c: New file.
5084 * Makefile.in: Compile it, distribute it.
5085 * m4.c: Recognize, document and process --freeze-state (-F) and
5086 --reload-state (-R) options. Pass a true flag to builtin_init
5087 only if no reloading some state.
5088 * builtin.c (define_builtin): Remove static specifier.
5089 (find_builtin_by_name): Remove static specifier.
5090 (builtin_init): Accept and obey a flag argument.
5091 * m4.h: Add declarations for freeze.c, changes for builtin.c.
5093 1994-08-24 François Pinard <pinard@iro.umontreal.ca>
5095 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
5098 * configure.in: Implement --with-dmalloc.
5099 * acconfig.h: Document WITH_DMALLOC.
5100 * m4.h: Add code for when WITH_DMALLOC.
5102 1994-08-15 François Pinard <pinard@iro.umontreal.ca>
5104 * m4.c (long_options): Use "error-output", the dash was missing.
5105 Reported by Akiko Matsushita.
5107 1994-08-12 François Pinard <pinard@iro.umontreal.ca>
5109 * m4.h: Include <sys/types.h>.
5110 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
5111 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
5113 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
5115 * builtin.c (dump_args): Declare len as size_t, not int.
5117 * debug.c: Prototype the forward declaration of debug_set_file.
5119 * builtin.c (m4_undivert): Replace div by file, for avoiding the
5120 shadowing of this variable.
5121 * output.c (insert_diversion): Idem.
5123 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
5124 (input_init): Duplicate default quote and comment strings.
5125 (set_quotes): Free previous quote strings in all cases. Duplicate
5126 even default quote strings.
5127 (set_comment): Free previous comment strings in all cases.
5128 Duplicate even default comment strings.
5130 * configure.in: Updated for Autoconf 2.0.
5131 * Makefile.in (distclean-local): Also delete config.cache.
5133 * m4.c (usage): Reorganize the --help output by topic. Include a
5134 description for debugging flags.
5136 1994-07-29 François Pinard <pinard@iro.umontreal.ca>
5138 * configure.in: If sigaction is available and SA_ONSTACK defined,
5139 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
5140 defined, use sigvec. Else don't compile stackovf.c.
5141 * stackovf.c (setup_stackovf_trap): Idem.
5142 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
5145 1994-07-21 François Pinard <pinard@iro.umontreal.ca>
5147 * m4.c (usage): Replace printf par fputs.
5149 1994-07-18 François Pinard <pinard@iro.umontreal.ca>
5153 1994-07-17 François Pinard <pinard@iro.umontreal.ca>
5155 * configure.in: Check for sigaction and sigvec. Add a new delayed
5156 check for RLIMIT_STACK, combine in the checking for getrlimit.
5157 All those things are not universally available.
5158 * stackovf.c: Split setting up the trap handler and catching
5159 signals, for better taking care of various configure outcomes.
5160 * examples/stackovf.sh: Correct a typo.
5161 Reported by Eric Backus, Jim Avera and Jim Meyering.
5163 1994-07-16 François Pinard <pinard@iro.umontreal.ca>
5165 * ansi2knr.c: New version sent by its author, Peter Deutsch.
5167 1994-07-15 François Pinard <pinard@iro.umontreal.ca>
5169 * Makefile.in: Modify so parallel make will not try making
5170 lib/libm4.a twice simultaneously.
5171 Reported by Jim Meyering.
5173 1994-07-14 François Pinard <pinard@iro.umontreal.ca>
5175 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
5176 error message, for when no code possibility exists. Even if this
5177 line is completely #ifdef'ed out, it brings a syntax error.
5178 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
5180 * Makefile.in (install): Have install depend on all too, for lib
5181 to be remade as needed.
5183 * examples/stackovf.sh: Try ksh, bsh and bash for shells
5184 providing ulimit, instead of using only ksh.
5185 Reported by Jim Avera and Joseph E. Sacco.
5187 1994-07-12 François Pinard <pinard@iro.umontreal.ca>
5189 * Makefile.in (check): Have it depend on all instead of m4. In
5190 this way, a change in lib will be detected and processed.
5192 * builtin.c (numeric_arg): Use strtol and verify the conversion,
5193 instead of using sscanf which stops as soon as there is a
5194 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
5195 and divert(1xyzzy) were all accepted without any warning or error
5197 * m4.h: Declare strtol as long if not including stdlib.h.
5198 * configure.in: Check for limits.h, and replace strtol if missing.
5199 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
5200 * lib/strtol.c: New file, from elsewhere.
5201 Reported by Andreas Schwab.
5203 1994-07-07 François Pinard <pinard@iro.umontreal.ca>
5205 * macro.c (expand_macro): Cast value to (boolean) prior to
5206 assigning it to traced.
5207 Reported by Tom McConnell.
5209 * Makefile.in (m4): Always make all in lib first.
5210 Reported by Jim Meyering.
5212 1994-07-06 Jim Avera <jima@netcom.com>
5214 * stackovf.c: Isolated OS-dependent sections; Improved portability,
5215 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
5216 handlers), and a default error message if the fault address is not
5217 available (when neither siginfo.h nor BSD sigcontext are supported).
5218 * configure.in: Changes for stackovf.h: Check for sigcontext,
5219 sigaction, sigstack, and define rlim_t as int if necessary.
5220 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
5221 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
5222 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
5224 1994-07-05 François Pinard <pinard@iro.umontreal.ca>
5226 * configure.in: Use AC_SET_MAKE.
5227 * Makefile.in: Use @SET_MAKE@.
5228 Reported by Jim Meyering.
5230 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
5231 Reported by Ian Taylor.
5233 1994-07-02 François Pinard <pinard@iro.umontreal.ca>
5235 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
5236 because siginfo.h is unrelated to standard headers, and siginfo.h
5237 is already checked for.
5238 Reported by Joseph E. Sacco.
5240 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
5242 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
5245 1994-06-29 François Pinard <pinard@iro.umontreal.ca>
5247 * builtin.c (substitute): Use \& to represent this part of the
5248 string which was matched by the whole regexp, instead of
5249 representing the whole string. Any usage of \0 issues a warning
5250 and acts like \&, it will disappear in some subsequent release.
5252 1994-06-27 François Pinard <pinard@iro.umontreal.ca>
5254 * m4.c: Complete prototype for forwarded declaration of usage.
5256 * input.c (init_macro_token): Correct own reference in error
5257 message. Previous name get_macro_func was referred to instead.
5258 (next_char): Correct own reference in error message. Previous
5259 name advance_input was referred to instead.
5261 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
5262 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
5263 and_term, not_term, logical_not_term, cmp_term, shift_term,
5264 add_term, mult_term, exp_term, unary_term, simple_term): Add
5265 prototype to forwarded declarations. Declare parameter v1 as
5266 eval_t * instead of int *. Same for local variable v2 in dyadic
5267 functions. Same for result in exp_term.
5268 * builtin.c (m4_eval): Declare value as eval_t instead of int.
5269 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
5270 unsigned_eval_t instead of unsigned int. Change casts accordingly.
5271 (shipout_int): Cast first argument of ntoa to eval_t.
5272 Reported by Thorsten Ohl.
5274 * macro.c: Complete the prototypes of forwarded expand_macro and
5276 Reported by Thorsten Ohl.
5278 * m4.h: Define voidstar as void * or char * depending on __STDC__.
5279 The Ultrix 3.1 compiler cannot do much with void pointers.
5281 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
5282 * m4.c (xfree): Replace void * by voidstar.
5283 Reported by Tom McConnell.
5285 * ansi2knr.1: New, from elsewhere.
5286 * Makefile.in (DISTFILES): Distribute ansi2knr.1
5288 * Makefile.in (stamp-h.in): Avoid running ./config.status if
5289 stamp-h does not exist yet. This avoids running it a second time
5290 just after the initial ./configure.
5291 Reported by David MacKenzie and Tom McConnell.
5293 * m4.h: Replace the enum debug_info declaration with a series of
5294 #define's. The Ultrix 3.1 compiler would otherwise need casting
5295 (int) to most references, when used in expressions.
5296 Reported by Tom McConnell.
5298 1994-06-25 François Pinard <pinard@iro.umontreal.ca>
5300 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
5301 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
5302 calls the compiler. Previously, FP_PROTOTYPES was only calling
5303 the preprocessor; by not being subject to CFLAGS, this was
5304 discouraging those flags asking for ANSI compilation.
5305 * acconfig.h: Document HAVE_PROTOTYPES.
5306 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
5307 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
5308 Reported by Eric Backus.
5310 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
5311 from the environment. Default CFLAGS to -g if not set.
5312 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
5313 * lib/Makefile.in: Have CFLAGS substituted from configure.
5314 Reported by Eric Backus and Tom McConnell.
5316 * configure.in: m4_undefine changeword before using AC_ENABLE.
5318 * m4.h: Declare prototypes for error (for ANSI compilers only),
5319 prefix_all_builtins and reference_error.
5320 Reported by Tom McConnell.
5322 * input.c (set_word_regexp): Do not try to initialize the array
5323 test from a string, this does not work with non-ANSI compilers.
5324 Reported by Eric Backus.
5326 * Makefile.in (dist): Clean examples/ before saving it.
5327 (distclean-local): Also remove stamp-h.
5328 Reported by Eric Backus.
5330 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
5332 Reported by Tom McConnell.
5334 * checks/Makefile.in (clean): Depends on mostlyclean.
5335 (mostlyclean): New goal.
5337 1994-06-24 François Pinard <pinard@iro.umontreal.ca>
5339 * Makefile.in (DISTFILES): Distribute install.sh.
5340 * install.sh: New file, copied from elsewhere.
5341 Reported by Assar Westerlund and Kaveh R. Ghazi.
5343 1994-06-23 François Pinard <pinard@iro.umontreal.ca>
5345 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
5346 * acconfig.h: Explain ENABLE_CHANGEWORD.
5348 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
5349 from code provided by Pete Chown]
5350 * m4.h: Add original_text field to u_t variant of union u.
5351 Declare TOKEN_DATA_FUNC macro.
5352 * builtin.c: Declare changeword.
5353 (m4_changeword): New function.
5354 * input.c: Include "regex.h", define variables with word regexps.
5355 (input_init): Initialize the word regexp.
5356 (set_word_regexp): New.
5357 (next_token): Declare local variables, use the previous code if
5358 default_word_regexp is true. Else, match using a new code. Save
5360 * macro.c (expand_token): Ship out original text if not a macro
5362 Reported by Krste Asanovic and Pete Chown.
5364 [These modifs all depend upon ENABLE_CHANGEWORD]
5365 * m4.h: Declare external user_word_regexp.
5366 * m4.c: Declare user_word_regexp, and initialize it from
5367 --word-regexp or -W, or NULL if not specified.
5368 * input.c: Use user_word_regexp if specified, instead of
5369 DEFAULT_WORD_REGEXP.
5371 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
5374 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
5375 * checks/Makefile.in: Empty the suffix list.
5376 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
5378 * m4.c: Declare nesting_limit and initialize it to 250.
5379 Implement -LNUMBER or --nesting-limit=NUMBER to change its
5381 * m4.h: Declare nesting_limit as external.
5382 * macro.c (expand_macro): Stop execution whenever nesting limit
5384 Reported by Bengt Mertensson.
5386 * eval.c (evaluate): Diagnose excess characters in eval input.
5387 Things like `eval(08)' used to return 0 with no diagnostic.
5389 * m4.h: Capitalize first letter of all macro arguments in
5392 * m4.c: Declare warning_status, initialize it to 0. Add new
5393 option -E, or --fatal-warnings, which sets warning_status to
5394 EXIT_FAILURE instead.
5395 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
5396 EXIT_FAILURE if not otherwise done by header files.
5397 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
5398 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
5399 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
5400 argument of all M4ERROR calls.
5401 Reported by Noah Friedman.
5403 * examples/incl-test.m4: Renamed from incl_test.m4.
5404 * examples/include.m4: Include incl-test.m4 instead of
5406 * examples/multiquotes.m4: Renamed from multi-quotes.m.
5408 1994-06-22 François Pinard <pinard@iro.umontreal.ca>
5410 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
5411 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
5412 also tested it on a Sun Sparc workstation running SunOS 4.x.
5414 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
5415 49.format check, abusing a `union values' argument with sprintf
5416 without selecting the proper field. Now, save the formatting type
5417 first, delaying the fetch of the corresponding argument.
5418 Reported by Joseph E. Sacco and Tom Quinn.
5420 * format.c (format): Remove const from char *fmt declaration when
5421 not HAVE_EFGCVT, because a NUL may be forced into it.
5423 * m4.h: Declare atof() when not STDC_HEADERS.
5424 Reported by Joseph E. Sacco.
5426 * Regenerate configure using Autoconf 1.11, this corrects a
5427 problem about an incorrect cpp seting on NeXT 3.1.
5428 Reported by Alexander Lehmann.
5430 1994-06-05 François Pinard <pinard@iro.umontreal.ca>
5432 * m4.h (_): Change argument from `x' to `Args'.
5434 1994-04-22 François Pinard <pinard@iro.umontreal.ca>
5436 * m4.h: Rename Args() to _().
5437 * m4.h: Remove extern specifier from all function declarations.
5439 1994-04-22 Jim Avera <jima@netcom.com>
5441 * stackovf.c: New file implementing stack-overflow detection.
5442 * configure.in: Check for getrlimit, sigaction. If all of
5443 standard headers, getrlimit and sigaction, define USE_STACKOVF and
5444 substitute ${U}stackovf.o for STACKOVF.
5445 * acconfig.h: Declare USE_STACKOVF.
5446 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
5447 * m4.h: Declare setup_stackovf_trap().
5448 * m4.c: Call setup_stackovf_trap().
5449 * tests/stackovf_test.sh: New file.
5451 1994-04-13 François Pinard <pinard@iro.umontreal.ca>
5453 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
5455 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
5457 1994-01-30 <pinard@iro.umontreal.ca>
5459 * m4.h: Remove definition of volatile, not used anymore.
5460 Reported by Jim Meyering and Joseph E. Sacco.
5462 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
5463 of `if ... else /* nothing */' for if macros.
5464 Reported by Jim Meyering.
5466 * builtin.c (m4_regexp): Reorganize the code for avoiding a
5467 warning from gcc about `repl' possibly used before defined.
5468 Reported by Jim Meyering.
5470 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
5471 Reported by Jim Meyering.
5473 1994-01-25 François Pinard <pinard@iro.umontreal.ca>
5475 * m4.h: Move the conditional definition of volatile after the
5476 inclusion of system files, because they may define it first.
5478 1994-01-04 François Pinard <pinard@iro.umontreal.ca>
5480 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
5481 get around a problem with Alpha make seeing a syntax error, there.
5482 Reported by Vern Paxson.
5484 1994-01-03 François Pinard <pinard@iro.umontreal.ca>
5486 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
5487 Reported by Richard Stallman.
5489 1993-12-25 François Pinard <pinard@iro.umontreal.ca>
5491 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
5492 instead of AC_HAVE_FUNCS.
5493 Reported by Noah Friedman.
5495 1993-12-01 François Pinard <pinard@iro.umontreal.ca>
5497 * m4.c: Initialize show_help and show_version to zero.
5499 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
5500 Use them in exit() and usage() calls.
5502 1993-11-27 François Pinard <pinard@iro.umontreal.ca>
5504 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
5505 syserr() macro. Delete errref, add reference_error and M4ERROR.
5506 * m4.c: Replace errref, which was returning an input reference
5507 string, with reference_error, which prints it on standard error.
5508 * builtin.c, output.c: Use errno as second parameter to error,
5509 instead of using syserr() with %s.
5510 * *.c: Use M4ERROR instead of error: no more errref() with %s.
5511 Doing so, the program name appears after the input reference
5512 instead of before, which eases M-x next-error processing.
5514 1993-11-24 François Pinard <pinard@iro.umontreal.ca>
5516 * checks/get-them: Escape braces with backslashes in patterns,
5517 because HPUX-9.01 awk needs this.
5518 Reported by Jim Meyering.
5520 1993-11-22 François Pinard <pinard@iro.umontreal.ca>
5522 * builtin.c: Declare "FILE *popen ();".
5524 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
5525 macros, replace error_message_prefix() declaration by errref()'s.
5526 Declare xrealloc, for use in errref().
5527 * m4.c: Delete error_message_prefix() function, add errref().
5528 * *.c: Use error() systematically in place of all error macros,
5529 now that error() flushes stdout first. Make needed adjustments.
5531 * m4.h: Remove const in sys_errlist[] declaration, it creates
5532 conflicts on SGI and Alpha.
5533 Reported by Kaveh R. Ghazi.
5535 1993-11-20 François Pinard <pinard@iro.umontreal.ca>
5537 * m4.c: Include <getopt.h> instead of "getopt.h".
5539 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
5540 * acconfig.h: New, for documenting HAVE_EFGCVT.
5541 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
5542 use them wherever appropriate. Also use -I. for compilations.
5543 * lib/Makefile.in: Use -I.. for compilations.
5544 * *.c: Include <config.h> or "config.h".
5546 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
5547 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
5549 1993-11-17 François Pinard <pinard@iro.umontreal.ca>
5551 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
5553 * input.c (input_init): Initialize quote and comment strings
5554 explicitely instead of calling set_quotes and set_comment: by
5555 doing so, we ensure we do not free uninitialized variables.
5557 * checks/check-them: Reverse arguments to both diff, so the
5558 expected is on the left and the obtained on the right.
5560 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
5561 macros. Delete declarations for m4error, warning, fatal and
5562 internal_error, add declaration for error_message_prefix.
5563 * m4.c: Delete m4error, warning, fatal and internal_error
5564 routines, add error_message_prefix routine.
5565 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
5566 warning with WARNING*, fatal with FATAL* and internal_error with
5568 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
5569 this is not needed anymore.
5571 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
5572 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
5573 and debug_message, add declaration for debug_message_prefix.
5574 * debug.c: Remove static specifier for FILE *debug declaration.
5575 Delete debug_print and debug_message routines, add
5576 debug_message_prefix routine.
5577 * builtin.c, debug.c: Replace debug_print routine calls with
5578 DEBUG_PRINT* macro calls.
5579 * input.c, path.c: Replace debug_message routine calls with
5580 DEBUG_MESSAGE* macro calls.
5582 * m4.h: Remove inclusion of <varargs.h>.
5583 * debug.c: Include <stdarg.h> or <varargs.h>.
5584 (trace_format): Use stdarg instead of varargs if __STDC__.
5586 * configure.in: Remove checks for vfprintf and _doprnt. These
5587 implementations use varargs tricks which are not portable enough.
5588 * lib/vfprintf.c: Deleted.
5589 * lib/_doprnt.c: Deleted.
5590 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
5591 Reported by Joel Sherrill.
5593 * path.c (add_include_directory): Use xstrdup.
5595 * builtin.c (find_builtin_by_name): Declare static.
5597 * *.[ch]: Add const to a few "char *" declarations.
5599 * configure.in: Remove commented tests for fileno() and fstat().
5600 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
5602 * debug.c (debug_flush_files): New.
5603 * m4.h: Declares it.
5604 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
5605 Reported by Nicolas Pioch.
5607 1993-11-12 François Pinard <pinard@iro.umontreal.ca>
5609 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
5610 Reported by Joel Sherrill.
5612 * builtin.c (prefix_all_builtins): Instead of the table size, use
5613 the null entry at end for stopping the loop. It was overwritten.
5614 Reported by Andreas Schwab and Jim Meyering.
5616 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
5617 Reported by Kaveh R. Ghazi.
5619 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
5620 Reported by Karl Vogel.
5622 1993-11-09 François Pinard <pinard@iro.umontreal.ca>
5624 * m4.h: Do not define volatile if already defined.
5625 Reported by René Seindal.
5627 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
5629 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
5630 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
5632 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
5634 * m4.h: Define strchr and strrchr in terms of index and rindex,
5635 instead of the other way around.
5636 * builtin.c, m4.c, path.c: Use strchr instead of index.
5638 * input.c (next_char): Remove a "break;" after a "return ...;".
5639 Reported by Tom McConnell.
5641 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
5645 * configure.in: Do not copy check files in the build hierarchy.
5646 * checks/check-them: Identify the m4 version being checked. For
5647 finding m4, look in $PATH instead of in the parent directory.
5648 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
5649 * checks/Makefile.in (.all-stamp): Always create check files in
5650 the source hierarchy, not anymore in the build hierarchy.
5651 (check): cd to the source hierarchy before performing checks.
5652 Do not copy nor clean COPYING anymore, take it from `..'.
5653 Reported by Tom McConnell.
5655 * Makefile.in (Makefile): Use $(SHELL).
5656 (config.status): Use $(SHELL). Use "config.status --recheck"
5657 instead of "configure --no-create", which is obsolete.
5658 Reported by Tom McConnell.
5660 1993-11-05 François Pinard <pinard@iro.umontreal.ca>
5662 * m4.c (usage): Use "%s" instead of "m4" in format string.
5663 Reported by Jim Meyering.
5665 * Makefile.in: Distribute mkinstalldirs.
5666 Reported by Pierre Gaumond.
5667 Reported by Jim Meyering.
5668 Reported by Tom McConnell.
5669 Reported by Andreas Gustafsson.
5671 * checks/check-them: Renamed from checks/check_them.
5672 * checks/get-them: Renamed from checks/get_them.
5673 * checks/.all-stamp: Renamed from checks/.all_stamp.
5674 * checks/Makefile.in: Changed accordingly.
5675 Reported by Jim Meyering.
5677 1993-11-04 François Pinard <pinard@iro.umontreal.ca>
5679 * lib/Makefile.in (dist): Correct permissions on files.
5681 * output.c: Declare tmpfile, some systems don't.
5683 1993-11-03 François Pinard <pinard@iro.umontreal.ca>
5685 * checks/Makefile.in (dist): Correct permissions on files.
5687 * Makefile.in (dist): Ensure recursive linking for subdirectory
5688 `examples', also set read/write permissions on all its files.
5690 * mkinstalldirs: New, from elsewhere.
5691 * Makefile.in: Use it.
5693 * debug.c: Synchronize debug messages and regular output when
5694 the debug file and stdout are redirected to the same file.
5695 * configure.in: Add (commented) checks for fileno and fstat.
5696 Reported by Jim Avera.
5698 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
5699 etc., arguments, then ignore the superfluous one. m4 used to
5700 diagnose missing arguments and return the empty string.
5701 Reported by Nick S. Kanakakorn.
5703 1993-11-02 François Pinard <pinard@iro.umontreal.ca>
5705 * m4.c (main): At end of all input, ensure all undiverted text
5706 goes to the main output stream.
5707 Reported by Andreas Gustafsson.
5709 * m4.c (main): exit (0), instead of return 0.
5711 * m4.c: Implement -P and --prefix-builtins.
5712 * builtin.c: Delete const specifier on builtin_tab.
5713 (prefix_all_builtins): New.
5714 Reported by Noah Friedman.
5715 Reported by Scott Bartram.
5717 * c-boxes.el: New, from elsewhere.
5718 * Makefile.in: Distribute it.
5720 * m4.h: Do not define bcopy if <string.h> defines it.
5721 Reported by Stephen Perkins.
5723 * builtin.c (define_macro): Allow a missing second argument, in
5724 which case it is implied empty. Affects define and pushdef.
5725 Reported by Eric Allman.
5727 1993-11-01 François Pinard <pinard@iro.umontreal.ca>
5729 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
5730 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
5731 * builtin.c: Initialize all the blindness fields in builtin_tab.
5732 (define_builtin): Copy the blindness of a builtin into its symbol.
5733 * macro.c (expand_token): Avoid processing a blind builtin if the
5734 next character is not an opening parenthesis.
5735 Reported by David MacKenzie.
5736 Reported by Noah Friedman.
5738 * configure.in: Ensure an exit status of 0 on completion.
5739 Reported by Vivek P. Singhal.
5741 * eval.c (eval_lex): Admit both lower and upper case letters for
5742 bases greater than 10. Only lower case letters were accepted.
5744 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
5745 Reported by Krste Asanovic.
5747 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
5748 * eval.c (logical_not_term): New name for not_term.
5749 * eval.c (xor_term): New, between or_term and and_term.
5750 * eval.c (not_term): New, between and_term and logical_not_term.
5751 * eval.c (shift_term): New, between cmp_term and add_term.
5752 Reported by Krste Asanovic: ~, ^, <<, >>.
5753 Reported by Ben A. Mesander: ** vs ^.
5755 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
5756 * m4.h: Delete xrealloc.c.
5757 * lib/xmalloc.c: New, from elsewhere.
5758 * lib/xstrdup.c: New, from elsewhere.
5759 * lib/Makefile.in: Distribute and compile them.
5761 * m4.c: Change progname to program_name.
5762 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
5763 * lib/error.c: New, from elsewhere.
5764 * lib/Makefile.in: Distribute and compile error.c.
5765 * configure.in: Check AC_VPRINTF and for strerror.
5766 * m4.c: Delete cmd_error. Use error instead.
5767 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
5769 * m4.h: Delete #define const, let Autoconf takes care of this.
5771 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
5772 Merge parse_args into main. Declare argv to be `char *const *',
5773 then remove superfluous casts.
5775 * m4.c: Rename --no-gnu-extensions to --traditional.
5776 Reported by Ben A. Mesander.
5778 * m4.c (usage): Add a status parameter. Supply one in various
5779 calls. Add --help processing. Remove -V for --version.
5781 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
5783 * lib/Makefile.in: Have an AR=ar declaration.
5784 Reported by Eric Backus.
5785 Reported by Bjorn R. Bjornsson.
5786 Reported by Tom Tromey.
5787 Reported by Kristine Lund.
5788 Reported by Marion Hakanson.
5790 1993-10-30 François Pinard <pinard@iro.umontreal.ca>
5792 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
5793 Reported by Noah Friedman.
5795 1993-10-25 François Pinard <pinard@iro.umontreal.ca>
5797 * Makefile.in: Remove MDEFINES and cleanup.
5799 1993-06-09 François Pinard <pinard@iro.umontreal.ca>
5801 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
5804 1993-02-06 François Pinard <pinard@iro.umontreal.ca>
5806 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
5807 ensure 777 mode for directories, so older tar's will restore file
5810 1993-01-17 François Pinard <pinard@iro.umontreal.ca>
5812 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
5813 so the installer can override automatically configured choices.
5814 Reported by Karl Berry.
5816 1993-01-15 François Pinard <pinard@iro.umontreal.ca>
5818 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
5819 previous version was not working properly on m68k-hp-bsd4.3.
5820 Reported by Roland McGrath.
5822 * lib/_doprnt.c: Stolen from Oleo distribution.
5823 * configure.in: Check for _doprnt.c if vfprintf.c selected.
5824 * lib/Makefile.in: Distribute _doprnt.c.
5825 Do not distribute regex.[ch].old anymore.
5827 1993-01-01 François Pinard <pinard@iro.umontreal.ca>
5829 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
5830 Richard wants it there.
5832 1992-12-27 François Pinard <pinard@iro.umontreal.ca>
5834 * Makefile.in: Add DEFS to MDEFINES.
5835 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
5836 (libm4.a): Remove the library before creating it.
5837 (distclean): Remove tags and TAGS too.
5839 1992-12-23 François Pinard <pinard@iro.umontreal.ca>
5841 * Makefile.in (dvi, m4.dvi): New goals.
5843 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
5844 macro.c, output.c, path.c, symtab.c: Change Copyright from
5845 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
5847 * examples/divert.m4: Deleted, this bug has been corrected.
5849 * Makefile.in (texclean, mostlyclean): New goals.
5851 * Makefile.in (clean): Remove clutter from ansi2knr.
5852 Reported by Pierre Gaumond.
5854 1992-12-20 François Pinard <pinard@iro.umontreal.ca>
5856 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
5857 might well use CFLAGS is s/he needs it.
5859 * Makefile.in: Allow installation of info files from a separate
5861 Reported by Jason Merrill.
5862 Reported by David MacKenzie.
5863 Reported by Skip Montanaro.
5864 Reported by Erez Zadok.
5865 Reported by Assar Westerlund.
5867 1992-12-19 François Pinard <pinard@iro.umontreal.ca>
5870 This is still a beta release for the future GNU m4 version 1.1.
5872 * lib/alloca.c: New, from elsewhere.
5873 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
5875 * m4.h: Do not define index/rindex if already defined. If
5876 FALSE/TRUE are already defined, do not redefine them, but merely
5877 define boolean typedef to int.
5879 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
5880 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
5881 because some C compilers do not like connectives with #ifdef.
5882 * m4.h: Define `volatile' only if __GNUC__, instead of once for
5883 __GNUC__ and once for __STDC__.
5884 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
5886 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
5887 Makefile dependencies. Without it, make keeps destroying and
5888 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
5890 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
5891 to diversion/DIVERSION, this was a spelling error.
5893 * m4.c: Declare version[], remove #include "version.h".
5894 * version.h: Deleted.
5895 * Makefile.in: Remove references to version.h.
5897 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
5898 production, by using a simpler and more robust algorithm. This
5899 solves the problem of synclines sometimes written in the middle of
5900 an output line. Delete sync_line() and output_lines variable.
5901 * m4.h: Remove sync_line prototype and output_lines declaration.
5902 * input.c (next_char), output.c (shipout_text): Remove references
5904 * input.c (push_file, pop_file): Merely put the value -1 in
5905 output_current_line instead of calling sync_line, for delaying a
5906 single `#line NUM FILE' before next output line. Do not test
5907 for sync_output, because this is unnecessary clutter.
5908 * output.c (make_divertion, insert_divertion): Idem.
5909 * input.c: Rename must_advance_line to start_of_input_line, for
5912 * debug.c (trace_header): Select a new debug line format, which
5913 better complies with GNU standards for formatting error messages.
5914 With option `-dfl', M-x next-error might be used on the output.
5915 * m4.c (vmesg): Adjust format of error output to GNU standards.
5916 * m4.texinfo: Adjust examples for `make check' to work.
5918 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
5919 case for enum debug_info constants, which were all lower case.
5921 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
5923 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
5924 collected patches. I tried a few times using newer regex.[ch], it
5925 mysteriously stopped aborting with this one. Insecure feeling...
5926 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
5928 1992-12-18 François Pinard <pinard@iro.umontreal.ca>
5930 * m4.c: Change `--no-warnings' to `--silent'.
5931 Reported by David MacKenzie.
5933 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
5934 leave it off for now. See comment in m4.c for justification.
5935 Reported by David MacKenzie.
5937 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
5938 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
5940 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
5942 * Makefile.in: Ensure recursive cleaning is done before local
5943 cleaning for all clean goals.
5945 * builtin.c (ntoa): Ensure the value is always interpreted as a
5946 signed quantity, whatever the radix is.
5948 1992-11-18 Jim Meyering <meyering@idefix>
5950 * builtin.c, format.c, input.c: Split long lines.
5951 * m4.c: Use typedef macro_definition instead of struct
5953 * symtab.c: Use typedef symbol instead of struct symbol.
5955 1992-11-17 François Pinard <pinard@iro.umontreal.ca>
5957 * *.[ch]: Remove all trailing whitespace, in code and comments.
5959 * configure.in: Find some awk.
5960 * Makefile.in: Add $(AWK) to MDEFINES.
5961 * checks/Makefile.in: Transmit $(AWK) to get_them.
5962 * checks/get_them: Use $AWK instead of gawk. Add a close in the
5963 awk script when switching files, because without this, mawk runs
5964 out of file descriptors.
5966 1992-11-16 François Pinard <pinard@iro.umontreal.ca>
5968 * Makefile.in (realclean): Delete m4.info*.
5969 Reported by Jim Meyering.
5971 * Makefile.in: Adjust and link with checks/Makefile.
5972 * checks/Makefile.in: New.
5973 * configure.in: Output checks/Makefile.
5975 * checks/get_them: Have the dnl header of each test more
5976 recognizable by next-error, also use a better message.
5978 1992-11-16 Jim Meyering <meyering@idefix>
5980 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
5981 And use that only if __GNUC__ since we're using it's GCC-specific
5982 semantics that tell the compiler the associated function doesn't
5985 * builtin.c (substitute): Don't use character as an array index.
5986 (dumpdef_cmp): Make formal arguments `const void *' to avoid
5987 warnings with gcc -W -Wall on systems with qsort prototype.
5988 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
5991 * eval.c (most functions): Add parentheses to assignments used
5992 as truth values go avoid warnings from gcc -Wall.
5994 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
5995 any functions that don't need external scope.
5997 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
5998 (many functions and arrays): Declare `const'.
6000 1992-11-15 François Pinard <pinard@iro.umontreal.ca>
6002 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
6003 removing the declaration from m4.h. Also rename false to FALSE
6006 * lib/Makefile.in (Makefile): New goal.
6008 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
6009 so heavily loaded. It gets more easily overridable, calling make.
6010 Reported by Jim Meyering.
6012 * Makefile.in (dist): Get .fname from the current directory name,
6013 instead of from version.h. I need updating many files manually,
6014 when the version changes, version.h is just one of them.
6016 1992-11-14 François Pinard <pinard@iro.umontreal.ca>
6018 * m4.h: Remove the tag `boolean' on the enum introducing typedef
6019 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
6020 Reported by Tom McConnell.
6022 1992-11-13 François Pinard <pinard@iro.umontreal.ca>
6024 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
6025 39.cleardiv, which were describing missing or spurious newlines.
6026 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
6027 do not depend on machine word size, `/bin/false' implementation,
6028 or `wc' output format. `make check' is more dependable, now.
6030 * checks/check_them: Summarize the failed tests by listing their
6031 name, at end. If none, issue `All checks successful'. Output
6032 `Checking' instead of `Input file:'.
6034 * checks/get_them, checks/check_them: Reindented.
6036 * Makefile.in (dist): chmod a+r before making the tar file.
6038 1992-11-12 François Pinard <pinard@iro.umontreal.ca>
6040 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
6042 * input.c (next_token): Reinitialize token_buttom just after using
6043 it as a watermark with obstack_free. Or else, a future token, big
6044 enough for triggering reallocation of the obstack chunk, could
6045 void the initialized value of token_buttom, later causing panic in
6046 obstack_free. Rename token_buttom to token_bottom everywhere.
6048 * m4.h: Before declaring errno, first include <errno.h> and
6049 ensure that it does not define errno.
6050 Reported by Richard Stallman.
6052 1992-11-11 François Pinard <pinard@iro.umontreal.ca>
6054 * builtin.c: Define and use DECLARE macro for builtins.
6056 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
6057 argument, this is a common idiom for introducing long comments.
6059 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
6060 arguments. The last argument was silently ignored.
6062 * m4.c (cmd_error): Add a missing semicolon before va_end().
6064 1992-11-10 François Pinard <pinard@iro.umontreal.ca>
6066 * Makefile.in: Now handle protoized sources. Define and use U.
6067 Compile and use ansi2knr with old compilers. Update DISTFILES.
6068 Add `aclocal.m4' to `configure' dependencies.
6069 * ansi2knr.c: New, from Ghostscript distribution.
6070 * configure.in: Define U through FP_PROTOTYPES for old compilers.
6071 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
6072 * aclocal.m4: New, provide FP_PROTOTYPES.
6073 * m4.h: Conditionnaly protoized through Args, save for varags.
6074 * builtin.c: Protoized. Then:
6075 Include <sys/types.h> if size_t is not defined, before "regex.h".
6076 (m4_ifelse): Fetch built-in name properly for diagnostic.
6077 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
6078 (m4_regexp): Add const to `msg' declaration.
6079 (m4_patsubst): Add const to `msg' declaration.
6080 * debug.c: Protoized, save for varargs.
6081 * eval.c: Protoized.
6082 * format.c: Protoized.
6083 * input.c: Protoized.
6084 * m4.c: Protoized, save for varargs. Then:
6085 (xfree): Accept void * instead of char *.
6086 (xmalloc): Return void * instead of char *.
6087 (xrealloc): Accept and return void * instead of char *.
6088 * macro.c: Protoized.
6089 * output.c: Protoized.
6090 * path.c: Protoized. Then cast some (char *) over xmalloc's.
6091 * symtab.c: Protoized.
6093 1992-11-06 François Pinard <pinard@iro.umontreal.ca>
6095 * m4.texinfo: Remove directory from diagnostics in 30.include,
6096 51.eval, 56.errprint and 57.m4exit tests.
6098 * m4.h: Remove declarations for int or void system functions, they
6099 cause more conflicting trouble than they make good.
6101 * configure.in: Avoid configuration header file. Add some tests.
6102 * m4.h: Remove #include "config.h".
6103 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
6104 Then, rewritten for better compliance with GNU standards.
6106 1992-11-05 François Pinard <pinard@iro.umontreal.ca>
6108 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
6109 because of a misplaced #endif.
6111 * Many *.[hc] files: Correct intra-line spacing here and there,
6112 according to GNU indent 1.6 advice.
6114 * configure.in: New, using Autoconf 1.2.
6115 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
6116 * Delete old configure.in, configure, etc/configure.in,
6117 etc/configure, lib/configure.in, lib/configure and config/*.
6118 Reported by Jason Merrill.
6120 * symtab.c (hash): Change (char) NULL to '\0'.
6121 Reported by Jason Merrill.
6123 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
6124 etc/nextvers.sh. Release numbers will be edited `by hand'.
6125 * version.h: De-automatize, force value in.
6127 * m4.c: Changes in order to use a newer getopt.h.
6128 Reported by David MacKenzie.
6130 * checks/: New name for examples/.
6131 * checks/get_them: New location for etc/get_examples.
6132 * checks/check_them: New location for etc/check_examples.
6133 * Makefile.in, checks/get_them, checks/check_them: Adjust.
6134 * lib/vfprintf.c: New location for etc/vfprintf.c.
6135 * Delete empty etc/.
6136 * examples/: New name for test/.
6138 1992-03-10 François Pinard <pinard@iro.umontreal.ca>
6140 * Makefile.in (check): Add m4 as dependency.
6142 * m4.c: Accept --no-warnings instead of --no_warnings, and
6143 --no-gnu-extensions instead of --no_gnu_extensions. Make the
6144 usage message more informative.
6145 Reported by David MacKenzie.
6147 1992-03-09 François Pinard <pinard@iro.umontreal.ca>
6149 * etc/check_examples: New name for check_examples.sh.
6150 * etc/get_examples: New name for get_examples.sh.
6151 * Makefile.in, etc/Makefile.in: Use new names.
6153 * Makefile.in: Transmit $(CC) while making in lib.
6155 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
6156 code disposition by hand.
6158 1992-03-08 François Pinard <pinard@iro.umontreal.ca>
6160 * m4.h: Delete definitions for abort() and exit().
6161 Reported by Richard Stallman.
6163 * config/hmake-unicos, config/s-unicos.h: New files.
6164 Reported by Hal Peterson.
6166 * eval.c (exp_term): Have N^0 return 1.
6167 Reported by Michael Fetterman.
6169 * eval.c, input.c, m4.h: Remove last comma in enums.
6170 Reported by Mike Lijewski.
6172 * Transfer of maintenance duties from René to François.
6174 1991-10-24 René Seindal <seindal@diku.dk>
6176 * Release 1.0. Many thanks to those, who provided me with bug
6177 reports and feedback.
6179 * Uses GNU configure, taken from the gdb distribution.
6181 * Uses GNU getopt(), with long option names.
6183 * The -Q/+quiet option is added, which suppresses warnings about
6184 missing or superflous arguments to built-in macros.
6186 * Added default options via the M4OPTS environment variable.
6188 * The built-in format can now be configured to use sprintf as
6189 the formatting engine, for systems without [efg]cvt(3).
6191 * GNU library code is moved to the ./lib subdirectory; other
6192 utility files are now in ./etc.
6194 * Several minor bugs have been fixed.
6196 1991-07-26 René Seindal <seindal@diku.dk>
6198 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
6199 Francois Pinard and Roland H. Pesch for providing me with reports.
6201 * The builtins incr and decr are now implemented without use of
6204 * The builtin indir is added, to allow for indirect macro calls
6205 (allows use of "illegal" macro names).
6207 * The debugging and tracing facilities has been enhanced
6208 considerably. See the manual for details.
6210 * The -tMACRO option is added, marks MACRO for tracing as soon
6213 * Builtins are traced after renaming iff they were before.
6215 * Named files can now be undiverted.
6217 * The -Nnum option can be used to increase the number of
6218 divertions available.
6220 * Calling changecom without arguments now disables all comment
6223 * The function m4_patsubst() is now consistently declared
6226 * A bug in dnl is fixed.
6228 * A bug in the multi-character quoting code is fixed.
6230 * Several typos in the manual has been corrected. More probably
6233 * The m4.info file is now installed along with the program.
6235 1990-11-15 René Seindal <seindal@diku.dk>
6237 * Updated and enhanced version. Release 0.75, manual 0.07.
6239 * Implemented search path for include files (-I option and
6240 M4PATH envronment variable).
6242 * Implemented builtin "format" for printf-like formatting.
6244 * Implemented builtin "regexp" for searching for regular
6247 * Implemented builtin "patsubst" for substitution with regular
6250 * Implemented builtin "esyscmd", which expands to a shell
6253 * Implemented "__file__" and "__line__" for use in error
6256 * Implemented character ranges in "translit".
6258 * Implemented control over debugging output.
6260 * Implemented multi-character quotes.
6262 * Implemented multi-character comment delimiters.
6264 * Changed predefined macro "gnu" to "__gnu__".
6266 * Changed predefined macro "unix" to "__unix__", when the -G
6267 option is not used. With -G, "unix" is still defined.
6269 * Changed "shift", "$@" and "$*" to not insert spaces afters
6272 * Added program name to error messages.
6274 * Fixed two missing null bytes bugs.
6276 1990-01-22 René Seindal <seindal@diku.dk>
6278 * Initial beta release. Release 0.50, manual 0.05.