448 Commits

Author SHA1 Message Date
Eric Blake
b2628d2f88 Avoid tests that make no sense, because m4 is single-threaded.
* m4/gnulib-cache.m4: Avoid lock-tests and tls-tests.

Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit 2e16f59fdc15cace7c60960035f0d8fecd6232af)
2009-02-16 15:15:38 -07:00
Eric Blake
f66f95f604 Don't override signal handlers installed by c-stack.
* src/m4.c (main): Reorder installation of signal handlers, so we
don't trash a SIGBUS handler installed by c-stack.  Also provide a
SIGSEGV fallback, for platforms where c-stack combined with
libsigsegv uses something lower level than SIGSEGV.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-12-06 10:53:22 -07:00
Eric Blake
dde5417b29 Upgrade to FDL 1.3, keep COPYING in repository.
* Makefile.am (MAINTAINERCLEANFILES): Don't remove COPYING.
* .cvsignore: Don't ignore it.
* .gitignore: Likewise.
* COPYING: Store in repository, per automake 1.10.2
recommendation.
* m4/gnulib-cache.m4: Replace fdl module with fdl-1.3.
* doc/m4.texinfo (GNU Free Documentation License): Upgrade
license.
* doc/Makefile.am (m4_TEXINFOS): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-12-06 10:34:23 -07:00
Eric Blake
c315f0946b Update recommendation now that libsigsegv 2.6 is released.
* NEWS: Recommend libsigsegv 2.6+.
* README: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-08-25 12:14:56 -06:00
Eric Blake
e0835c041b Increase ulimit stack value to be larger than SIGSTKSZ.
* checks/stackovf.test (tmpfile): Use 300K rather than 50K, since
at least OpenBSD's sh died early from an undersized stack limit.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-08-03 14:34:31 -06:00
Eric Blake
b468fbd806 Fix missing copyright notices.
* acinclude.m4: Add copyright license details.
* c-boxes.el: Likewise.
* checks/get-them: Likewise.
* checks/check-them: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-17 16:55:18 -06:00
Eric Blake
463db2c7fe Remove redundant examples/stackovf.sh.
* examples/stackovf.sh: Delete, now that checks has better
version.
* examples/Makefile.am (EXTRA_DIST): Don't distribute it.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-17 16:49:57 -06:00
Eric Blake
8b9feabcec Adjust to c-stack changes in gnulib.
* src/Makefile.am (m4_LDADD): Use libsigsegv when available and
necessary, via LIBCSTACK.
* src/m4.c (main) [DEBUG_STACKOVF]: Make it easier to test fault
handlers.
* checks/stackovf.test: New file.
* checks/Makefile.in (CHECKS): Add stackovf.test, and factor...
(DOC_CHECKS): ...generated documentation tests into new macro.
(DISTFILES): Distribute stackovf.test.
* checks/check-them: Special-case stackovf.test.
* NEWS: Enhance the NEWS item for -L improvements.
* README: Mention the optional dependency.
* HACKING: Mention maintenance burden added by libsigsegv.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-07-17 16:17:46 -06:00
Eric Blake
f0aed09967 Adjust to new gnulib-tool layout.
* ltdl/m4/gnulib-cache.m4: Reformat.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-06-23 16:45:29 -06:00
Eric Blake
bb09ca5a7f Use new sigaction module.
* m4/gnulib-cache.m4: Import sigaction module.
* src/m4.c (main): Drop signal() calls.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-06-21 15:00:14 -06:00
Eric Blake
e0408e69ed Also trap SIGILL, SIGFPE, SIGBUS.
* m4/gnulib-cache.m4: Import strsignal module.
* src/m4.c (main): Register more handlers, and prefer sigaction
when available.
(SIGBUS, NSIG): Provide fallback when lacking.
(signal_message): New variable, to keep async-safety.
(fault_handler): Display faulting signal description.
* configure.ac (gl_DISABLE_THREADS): Request gnulib modules to
optimize for single-threaded operation.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-06-18 11:38:30 -06:00
Eric Blake
0b2dea68c4 Inform users what to do in case of programmer error.
* src/m4.h (EXIT_INTERNAL_ERROR): New macro.
* configure.ac (AC_TYPE_SIGNAL): Delete, now that we assume C89.
* src/m4.c (fault_handler): New method.
(program_error_message): New variable, for async-safety.
(main): Print bug reporting address rather than dump core on any
failed assertions or detected non-stack-overflow faults.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-06-06 16:37:21 -06:00
Eric Blake
15ddfa0680 Replace stackovf with gnulib c-stack.
* m4/gnulib.cache.m4: Import c-stack module.
* configure.ac (AC_CHECK_HEADERS_ONCE): Remove check for
siginfo.h, sys/wait.h.
(AC_CHECK_TYPES): Likewise for siginfo_t.
(AC_CHECK_MEMBERS): Likewise for sa_sigaction, ss_sp.
(AC_CHECK_FUNCS_ONCE): Likewise for sigaction, sigaltstack,
sigstack, sigvec, strerror.
(M4_cv_use_stackovf): Likewise for stack overflow detection.
* src/Makefile.am (m4_SOURCES): Don't build stackovf.c.
* src/stackovf.c: Delete.
* src/m4.h (setup_stackovf_trap): Delete.
* src/m4.c (stackovf_handler): Delete.
(main): Use c_stack_action instead of setup_stackovf_trap.  If
stack overflow is detectable, don't limit -L artificially.
(usage): Document unlimited default on supported systems.
* doc/m4.texinfo (Limits control): Document new default nesting
limit.
* NEWS: Document this change.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-06-06 09:35:30 -06:00
Eric Blake
3be468475e Use progname module rather than rolling our own program_name.
* m4/gnulib-cache.m4: Import progname module.
* src/m4.c (program_name): Replace...
(main): ...with a call to set_program_name.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-06-03 06:42:14 -06:00
Eric Blake
f3fbfb92cc Stage 24: Allow embedded NUL in macro names.
* m4/gnulib-cache.m4: Import xmemdup0 module.
* src/m4.h (define_builtin, push_string_init, push_wrapup_init)
(lookup_symbol): Add parameters.
(struct call_info): Add name_len member.
(struct token_data) [ENABLE_CHANGEWORD]: Add original_len member.
(struct symbol): Add len member.
(TOKEN_DATA_ORIG_LEN, SYMBOL_NAME_LEN): New accessors.
(m4_error_at_line, m4_warn_at_line): Delete.
(m4_error, m4_warn, debug_set_output, skip_line, set_word_regexp)
(bad_argc, evaluate): Adjust parameter type.
* src/m4.c (m4_error_at_line, m4_warn_at_line): Delete.
(m4_verror_at_line, m4_error, m4_warn): Adjust parameter type.
(main): Adjust caller.
* src/symtab.c (profile_strcmp) [DEBUG_SYMTAB]: Rename...
(profile_memcmp): ...and accomodate NUL.
(hash, lookup_symbol): Add parameter to track length.
(symtab_debug, symtab_print_list): Adjust callers.
* src/input.c (push_string_init, push_wrapup_init): Take location
as parameter rather than using global state.
(skip_line, set_word_regexp, next_token): Adjust parameter type.
(peek_input, next_char_1, match_input, lex_debug): Adjust
callers.
* src/macro.c (struct macro_arguments): Delete argv0 and argv0_len
members, now covered by info.
(expand_input, expand_token, expand_argument, collect_arguments)
(expand_macro, arg_text, arg_empty, arg_len, make_argv_ref)
(push_arg, wrap_args): Adjust callers.
* src/builtin.c (define_builtin): Add parameter.
(bad_argc, numeric_arg, mkstemp_helper, substitute): Adjust
parameter type.
(define_user_macro, builtin_init, define_macro, m4_undefine)
(m4_popdef, m4_ifdef, m4_ifelse, dumpdef_cmp, m4_dumpdef)
(m4_builtin, m4_indir, m4_defn, m4_syscmd, m4_esyscmd, m4_eval)
(m4_incr, m4_decr, m4_divert, m4_divnum, m4_undivert, m4_shift)
(m4_changequote, m4_changecom, m4_changeword, include)
(m4_maketemp, m4_mkstemp, m4_errprint, m4___file__, m4___line__)
(m4___program__, m4_m4exit, m4_m4wrap, m4_traceon, m4_traceoff)
(m4_debugmode, m4_debugfile, m4_len, m4_index, m4_substr)
(m4_translit, m4_format, m4_regexp, m4_patsubst): Adjust all
callers.
* src/debug.c (debug_set_file, debug_set_output): Adjust parameter
type.
(trace_flush, trace_prepre, trace_pre): Adjust all callers.
* src/eval.c (logical_or_term, logical_and_term, or_term)
(xor_term, and_term, equality_term, cmp_term, shift_term)
(add_term, mult_term, exp_term, unary_term, simple_term)
(evaluate): Adjust parameter type.
* src/format.c (arg_int, arg_long, arg_double): Likewise.
(expand_format): Adjust caller.
* doc/m4.texinfo (Using frozen files): Test this.
* examples/null.m4: Likewise.
* examples/null.err: Adjust expected output.
* examples/null.out: Likewise.

(cherry picked from commit 6167507cf07ddbc838e14e3d66803b360e63f6f2)

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-06-02 21:31:43 -06:00
Eric Blake
b9a0d949a0 Allow autobuild usage.
* m4/gnulib.cache: Import autobuild module.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-06-02 06:09:33 -06:00
Eric Blake
f2c5adaeec Make closing files be consistent.
* src/freeze.c (reload_frozen_state): Use close_stream.
Reported by Jean-Charles Longuet.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-05-23 06:27:16 -06:00
Eric Blake
fba265c02e Don't allow failure to freeze give exit status of 0.
* doc/m4.texinfo (Using frozen files): Test the fix from
2007-11-22.
* THANKS: Update.
Reported by Jean-Charles Longuet.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-05-22 05:58:07 -06:00
Eric Blake
34985ceaf5 Improve error message when frozen file is invalid.
* src/freeze.c (reload_frozen_state): Track current line.
[GET_STRING]: New helper macro.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-05-09 10:51:49 -06:00
Eric Blake
b5fe50a4ef Detect integer overflow when loading frozen file.
* src/freeze.c (reload_frozen_state) [GET_NUMBER]: Rewrite to fail
immediately on overflow.
Reported by Jim Meyering.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-05-09 10:51:47 -06:00
Eric Blake
bc4cf0aa6f Stage 23: allow tracing of indirect macro calls.
* src/m4.h (struct call_info): New struct.
(trace_prepre, trace_pre, trace_post, push_string_finish)
(input_print, call_macro): Alter signatures.
(arg_info): New prototype.
(input_block): Delete...
* src/input.c (input_block): ...and make typedef local again.
(push_string_init): Initialize length.
(push_string_finish, input_print): Change signature, so that
printing can be done before finalization.
* src/macro.c (struct macro_arguments): Add info member.
(collect_arguments, make_argv_ref): Manage new field.
(expand_macro): Change call context management.  Move tracing...
(call_macro): ...here, and remove redundant parameter.
(arg_info): New function.
* src/debug.c (trace_format): Delete unused modifiers.
(trace_header, trace_flush, trace_prepre, trace_pre, trace_post):
Change signatures for stacked trace messages, and for using call
context.
* src/builtin.c (m4_builtin, m4_indir): Update callers.
* src/m4.c (usage): Update debugmode flag summary.
* doc/m4.texinfo (Defn): Update examples to match new behavior.
(Trace): Mention new capability of indir.
(Debug Levels): Enhance text for 'c' and 'x', update examples.
(Incompatibilities): Mention risk of parsing trace output.
* examples/null.m4: Enhance test.
* examples/null.err: Update expected output.
* NEWS: Mention these changes.
Reported by Akim Demaille in the autoconf TODO file in 2000.

(cherry picked from commit ec804cba9ceeef7ca863d163eeae3fca669ccd16)

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-05-09 06:12:25 -06:00
Eric Blake
c8a2c296df Fix traceon regression introduced 2006-06-06.
* src/builtin.m4 (traceon): Only perform insertion if lookup
fails.
* doc/m4.texinfo (Trace): Test for the bug.
* NEWS: Document it.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-05-07 10:55:33 -06:00
Eric Blake
50fabc46c2 Stage 22: allow builtin token concatenation outside $@.
* src/m4.h (arg_text): Add parameter.
(ARG): Adjust callers.
* src/input.c (init_macro_token): Add parameter.
(next_token): Support concatenating builtins.
* src/macro.c (warn_builtin_concat): Delete warning.
(expand_argument, arg_adjust_refcount): Handle builtin tokens.
(arg_text): Add parameter.
(arg_print): Adjust caller.
* src/builtin.c (define_macro): Flatten builtins, rather than
doing nothing.
(defn): Warn on undefined macro name.
* src/m4.c (main): Avoid atoi.
* src/output.c: Whitespace fixes.
* doc/m4.texinfo (Defn): Document the new semantics.
(Ifelse, Debug Levels, M4wrap): Enhance tests.
* NEWS: Document this change.

(cherry picked from commit 8a47a2029b7eb60ac61abb1b6423d4a67b371281)

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-05-05 21:24:30 -06:00
Eric Blake
26b3c17ceb Document define_blind.
* doc/m4.texinfo (Ifelse): Add a new composite macro.
* THANKS: Update.
Suggested by Mike R.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-05-03 11:51:55 -06:00
Eric Blake
f87a1e3fe9 Fix debugmode regression from 2008-04-14.
* src/input.c (pop_input): Fix -di output on end of input.
* doc/m4.texinfo (Debug Levels): Test this behavior.
(Changeword, Location): Correct examples.
* checks/check-them (examples): Update to account for recommended
location for running tests.
* doc/m4.texinfo (Debug Levels): Test this behavior.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-24 16:27:16 -06:00
Eric Blake
2185946237 Fix debugmode regression from 2008-02-18.
* src/m4.h (DEBUG_TRACE_VERBOSE): Make -dV verbose again.
* NEWS: Document this fix.

Test to come when merging stage 23 from branch argv_ref.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-24 15:14:08 -06:00
Eric Blake
05528e98e0 Fix spelling of attribution to Christopher Strachey.
* doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
* THANKS: Update.
Reported by Fernando Carrijo.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-21 16:27:01 -06:00
Eric Blake
2b570fc019 Fix buildbot failure.
* doc/m4.texinfo (Diversions): Consume all of m4's output, in case
SIGPIPE is ignored.
* THANKS: Update.
Detected by Bob Proulx's buildbot.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-17 06:50:34 -06:00
Eric Blake
2f26b68672 Avoid gcc shadowing warnings.
* src/builtin.c (m4_ifelse): Avoid the name index.
(m4_format): s/format/expand_format, so local variables can be
named format.
* src/format.c (format): Rename...
(expand_format): ...to this, and avoid the name index.
* src/input.c (push_file): Avoid the name close.
* src/m4.h (expand_format): Adjust prototype.
* src/macro.c (arg_token, arg_type, arg_text, arg_empty, arg_len)
(arg_func, arg_print, make_argv_ref_token, make_argv_ref)
(push_arg, push_arg_quote): Avoid the name index.
* src/output.c (threshold_diversion_CB): Avoid the name div.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-17 06:46:35 -06:00
Eric Blake
14840bcf0e Another 'make installcheck' fix.
* doc/m4.texinfo (Diversions): s/m4/__program__/ in case
--program-prefix was active.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-15 14:27:54 -06:00
Eric Blake
6b67f52903 Stage 21: $@ concatenates builtins, m4wrap takes builtins.
* src/m4.h (append_macro): New prototype.
(push_macro, push_wrapup_init, arg_print, func_print): Alter
prototypes.
* src/input.c (INPUT_MACRO): Delete, covered by INPUT_CHAIN.
(INPUT_EOF): New input block type, for efficiency.
(struct input_block): Remove u.func member.
(input_eof): New input sentinel.
(append_macro): New function.
(push_macro, push_wrapup_init): Add parameter.
(push_token): Support builtin tokens.
(init_macro_token): Always use chain for builtin tokens.
(push_string_init, pop_input, pop_wrapup, input_print)
(peek_input, next_char, next_char_1, input_init): Adjust callers.
* src/macro.c (arg_equal, wrap_args): Handle builtin tokens.
(arg_print): Add parameter.
(collect_arguments, arg_type, arg_text): Adjust callers.
* src/builtin.c (m4_m4wrap): Handle builtin tokens.
(func_print): Add parameter.
(m4_defn): Allow pushing builtin alongside other text.
(m4_errprint): Adjust caller.
* src/debug.c (trace_pre): Likewise.
* doc/m4.texinfo (Defn, Ifelse, Debug Levels): Update tests to new
behavior.
(M4wrap): New test.

(cherry picked from commit 32d4bf4d447e0e252c809897b795b57b3bfd74de)

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-14 22:05:40 -06:00
Eric Blake
fb04a26fa6 Ensure --program-prefix doesn't regress.
* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Enforce change from
2008-03-10 by testing it at 'make distcheck' time.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-11 16:16:45 -06:00
Eric Blake
7541b497e8 Improve OS/2+emx build.
* src/m4.h [__EMX__]: OS/2 does not have a Unix-compatible
system(3), no matter what other macros it pre-defined.
* doc/m4.texinfo (Mkstemp): Rework test to avoid globbing failure
on OS/2.
* src/builtin.c (predefined_tab): Ensure all possible system
identifiers are defined, not just the first; the testsuite will
catch if multiple identifiers mistakenly made it through.
* examples/null.m4 (esyscmd): Don't rely on printf to generate NUL
byte.
* examples/null.out (esyscmd): Check for esyscmd success.
* THANKS: Update.
Reported by Elbert Pol.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-11 10:05:33 -06:00
Eric Blake
be172ae7ca Fix mingw build.
* src/builtin.c (define_user_macro): Avoid compiler warning.
* NEWS: Tweak 1.4.10b entry.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-11 09:13:39 -06:00
Eric Blake
be555668bc Mention how to do Free Software Directory update.
* HACKING: Add another release process step.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-09 07:26:31 -06:00
Eric Blake
2c634e429e Remove redundant configure macros.
* configure.ac (AC_CANONICAL_BUILD, AC_CANONICAL_HOST)
(AC_SYS_LARGEFILE, AC_TYPE_SIZE_T): Delete, since gnulib does
this.
(AC_CHECK_HEADERS_ONCE): Remove limits.h.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-09 07:06:15 -06:00
Eric Blake
a82c183e85 Mention 1.4.11 release.
* NEWS: Update to match release on branch-1.4.
* doc/m4.texinfo (History): Update release history.
(Format): Test for C99 hex-float parsing.
* src/Makefile.am (m4_LDADD): Use POW_LIB when needed.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-04-02 14:52:33 -06:00
Eric Blake
d8075cd139 Improve release process.
* maint.mk (alpha): Check for PREV_VERSION setting sooner, and
remove tag operation.
(version-check): Enhance this check.
(prev-tarball): Depend on version-check.
(web-manual): Fix VPATH usage.
(this-vc-tag): Delete, and mention need to run tag...
* HACKING: ...here, prior to make maintainer-distcheck.
Update the instructions to match this particular release process.
* Makefile.am (.version, announcement): Allow for VPATH build.
* cfg.mk (gnulib_dir): Likewise.
* doc/Makefile.am ($(srcdir)/m4.1): Include release number in man
page.

Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit c07173b0a58b56c07633a28323d56451b98b7de5)

Conflicts:
2008-04-02 14:14:56 -06:00
Eric Blake
a86f1dcafc Add test for divert bug on 2007-05-28, patched 2007-07-21.
* doc/m4.texinfo (Diversions): Add test.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-27 06:58:07 -06:00
Eric Blake
89e1c326f2 Tweak wording to point to autoconf patch.
Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-24 15:49:13 -06:00
Eric Blake
972ddeee22 Mention FIFO m4wrap more prominently in NEWS.
* NEWS: Describe effect on autoconf 2.59 and earlier.
* doc/m4.texinfo (History): The next version will be 1.6, not
1.4.11.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
v1.5.89a
2008-03-24 06:53:38 -06:00
Eric Blake
5adf9c383d Pull GNUmakefile from gnulib.
* m4/gnulib-cache.m4: Import gnumakefile module.
* GNUmakefile: Remove from version control; supplied by gnulib
instead.
* configure.ac (AC_CONFIG_LINKS): Let gnulib do this now.
* Makefile.am (distclean-local): Likewise.
(EXTRA_DIST): Likewise.  Also handle renamed files.
* Makefile.cfg: Rename...
* cfg.mk: ...to this.
* Makefile.maint: Rename...
* maint.mk: ...to this.
(ME, makefile-check, m4-check): Use new macro instead of
hard-coded name.
* HACKING: Mention that maintainer rules should now work in VPATH
builds.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-24 05:55:12 -06:00
Eric Blake
ca0ae27571 Stage 20: make m4wrap obey POSIX fifo ordering.
* src/m4.h (enum token_chain_type): Add CHAIN_LOC.
(struct token_chain): Add u_l member.
(wrap_args): New prototype.
* src/input.c (push_wrapup_init, push_wrapup_finish): Rewrite to
guarantee a FIFO chain in the wrapup stack.
(pop_input, peek_input, next_char_1): Support location link.
(next_char): Add parameter.
(init_macro_token, init_argv_token): Require user to consume empty
input.
(skip_line, match_input): Adjust callers.
(next_token): Always consume first character.
* src/macro.c (arg_text): Tighten assertion.
(wrap_args): New method.
* src/builtin.c (m4_m4wrap): Use it.
(define_macro): Issue warning when ignoring builtin token during
macro definition.
* doc/m4.texinfo (M4wrap, Location, Incompatibilities)
(Improved m4wrap): Adjust examples to corrected behavior.
* NEWS: Document this fix.

(cherry picked from commit f7f45337fa1bfba9512841e8d3d2251359944681)

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-18 20:03:21 -06:00
Eric Blake
c011c3f82c Update for fresh bootstrap.
* m4/gnulib-cache.m4: Updated copyright from upstream.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-17 08:17:07 -06:00
Eric Blake
4cc7916e4d Document join, in order to fix bug in m4wrap example.
* examples/join.m4: New file.
* examples/wraplifo2.m4: Likewise.
* examples/Makefile.am (EXTRA_DIST): Add new files.
* doc/m4.texinfo (Improved m4wrap): New node.
(Defn, Location): Enhance tests.
(Shift): Document the composit macro join.
(Incompatibilities): Move documentation of LIFO vs. FIFO...
(M4wrap): ...here, to match improved example.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-15 20:20:36 -06:00
Eric Blake
d53cf5ec91 Stage 19: allow builtin tokens in more macros.
* src/m4.h (enum token_chain_type): Add CHAIN_FUNC.
(struct token_chain): Add func member.
* src/input.c (push_token, pop_input, input_print, peek_input)
(next_char_1, init_macro_token): Handle builtin tokens from
back-references.
(next_token): Flatten builtin tokens inside comments or quotes,
except when a builtin is the only thing inside quotes.
* src/macro.c (expand_argument): Strengthen assertion.
(collect_arguments): Handle builtin tokens.
(expand_macro): Fix harmless typo.
(arg_token): Add parameter.
(arg_type, arg_text, arg_equal, arg_empty, arg_len, arg_func)
(arg_print, push_arg_quote, push_args): Update callers to either
require flattened arguments or to handle builtins.
* src/builtin.c (m4_defn, m4_dumpdef, m4_ifdef, m4_ifelse)
(m4_popdef, m4_shift, m4_traceoff, m4_traceon, m4_undefine):
Handle builtin tokens, either by recognizing invalid macro names
or passing them through transparently.
(define_user_macro): Make all user macros handle builtin token
arguments transparently.
* doc/m4.texinfo (Defn, Ifdef, Ifelse, Debuglen): Document and
test the new behavior.
* NEWS: Document this change.

(cherry picked from commit 434656c96d6486cf959c3050aa85aecb72d948a0)

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-14 07:03:37 -06:00
Eric Blake
fb8ad0c1e4 Consistently cast malloc results, for C++ compilation.
* src/builtin.c (compile_pattern): Add cast.
* src/macro.c (expand_macro): Likewise.
* src/output.c (m4_tmpname): Likewise.
* src/stackovf.c (setup_stackovf_trap): Use correct type.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-13 12:17:41 -06:00
Eric Blake
c702fdb4cb Allow 'make installcheck' with './configure --program-prefix'.
* checks/Makefile.in (program_transform_name): New macro.
(installcheck): Use it to transform name of m4 before testing.
* checks/check-them (m4): Add -m option, to allow testing m4 by a
different name.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-10 07:16:46 -06:00
Eric Blake
fa7ece650e More maintainer fixes.
* GNUmakefile (_created_version_file): Delete, now that VPATH
builds include GNUmakefile.
* configure.ac (AC_INIT): Base version on .tarball-version, not
.version.
Reported by Ralf Wildenhues, fix by Jim Meyering in coreutils.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-10 06:45:58 -06:00
Eric Blake
ff87075d2c Fix nested builtin(`shift',$@) regression from 2008-02-22.
* src/macro.c (make_argv_ref_token): Don't output expansion text
when making wrapper for builtin or indir.
* doc/m4.texinfo (Builtin): Test it.
* NEWS: Document the fix.
Reported by Andreas Schwab.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-06 17:17:37 -07:00