(m4_popdef, m4_pushdef): these.
Adjust dependencies.
* acgeneral.m4: Adjust.
* aclang.m4: Likewise.
* autoconf.m4 (popdef, pushdef): Reactivate them.
+2000-11-02 Akim Demaille <akim@epita.fr>
+
+ * m4sugar.m4 (popdef, pushdef): Rename as...
+ (m4_popdef, m4_pushdef): these.
+ Adjust dependencies.
+ * acgeneral.m4: Adjust.
+ * aclang.m4: Likewise.
+ * autoconf.m4 (popdef, pushdef): Reactivate them.
+
2000-11-02 Akim Demaille <akim@epita.fr>
* tests/atgeneral.m4 (AT_CHECK, AT_CLEANUP): Be more verbose when
# Initialize the diversion setup.
define([_m4_divert_diversion], _m4_divert([BODY]))
# Throw away output until AC_INIT is called.
-pushdef([_m4_divert_diversion], _m4_divert([KILL]))
+m4_pushdef([_m4_divert_diversion], _m4_divert([KILL]))
define([AC_VAR_PUSHDEF],
[AC_VAR_INDIR_IFELSE([$2],
[ac_$1=AC_TR_SH($2)
-pushdef([$1], [$ac_[$1]])],
- [pushdef([$1], [AC_TR_SH($2)])])])
+m4_pushdef([$1], [$ac_[$1]])],
+ [m4_pushdef([$1], [AC_TR_SH($2)])])])
# AC_VAR_POPDEF(VARNAME)
# ----------------------
# Free the shell variable accessor VARNAME. To be dnl'ed.
define([AC_VAR_POPDEF],
-[popdef([$1])])
+[m4_popdef([$1])])
# column 0 column 26
#
define([AC_HELP_STRING],
-[pushdef([AC_Prefix], m4_default([$3], [ ]))dnl
-pushdef([AC_Prefix_Format], [ %-]m4_eval(len(AC_Prefix) - 3)[s ])dnl [ %-23s ]
+[m4_pushdef([AC_Prefix], m4_default([$3], [ ]))dnl
+m4_pushdef([AC_Prefix_Format], [ %-]m4_eval(len(AC_Prefix) - 3)[s ])dnl [ %-23s ]
m4_wrap([$2], AC_Prefix, m4_format(AC_Prefix_Format, [$1]))dnl
-popdef([AC_Prefix_Format])dnl
-popdef([AC_Prefix])dnl
+m4_popdef([AC_Prefix_Format])dnl
+m4_popdef([AC_Prefix])dnl
])
# No big loss, I think, since most configures don't use this macro anyway.
AC_DEFUN([AC_PREFIX_PROGRAM],
[dnl Get an upper case version of $[1].
-pushdef([AC_Prog], m4_toupper([$1]))dnl
+m4_pushdef([AC_Prog], m4_toupper([$1]))dnl
if test "x$prefix" = xNONE; then
dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle.
echo $ECHO_N "checking for prefix by $ECHO_C" >&AC_FD_MSG
prefix=`AS_DIRNAME([$ac_cv_path_[]AC_Prog])`
fi
fi
-popdef([AC_Prog])dnl
+m4_popdef([AC_Prog])dnl
])# AC_PREFIX_PROGRAM
# is passed `-lfoo'. However, LIBRARY cannot be a shell variable;
# it must be a literal name.
AU_DEFUN([AC_HAVE_LIBRARY],
-[pushdef([AC_Lib_Name],
+[m4_pushdef([AC_Lib_Name],
patsubst(patsubst([[$1]], [lib\([^\.]*\)\.a], [\1]), [-l], []))dnl
AC_CHECK_LIB(AC_Lib_Name, main, [$2], [$3], [$4])dnl
ac_cv_lib_[]AC_Lib_Name()=ac_cv_lib_[]AC_Lib_Name()_main
-popdef([AC_Lib_Name])dnl
+m4_popdef([AC_Lib_Name])dnl
])
define([_AC_CONFIG_UNIQUE],
[m4_divert_push([KILL])
AC_FOREACH([AC_File], [$1],
-[pushdef([AC_Dest], patsubst(AC_File, [:.*]))
+[m4_pushdef([AC_Dest], patsubst(AC_File, [:.*]))
AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_HEADERS],
[AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_HEADER or AC_CONFIG_HEADERS.])])
AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_LINKS],
[AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_COMMANDS.])])
AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_FILES],
[AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_FILES or AC_OUTPUT.])])
-popdef([AC_Dest])])
+m4_popdef([AC_Dest])])
m4_divert_pop()dnl
])
# ------------------
# Save the current language, and use LANG.
define([AC_LANG_PUSH],
-[pushdef([_AC_LANG])dnl
+[m4_pushdef([_AC_LANG])dnl
AC_LANG([$1])])
# -----------
# Restore the previous language.
define([AC_LANG_POP],
-[popdef([_AC_LANG])dnl
+[m4_popdef([_AC_LANG])dnl
ifelse(_AC_LANG, [_AC_LANG],
[AC_FATAL([too many $0])])dnl
AC_LANG(_AC_LANG)])
[AC_DIAGNOSE([obsolete],
[instead of using `AC_LANG', `AC_LANG_SAVE',
and `AC_LANG_RESTORE', you should use `AC_LANG_PUSH' and `AC_LANG_POP'.])
-pushdef([_AC_LANG], _AC_LANG)])
+m4_pushdef([_AC_LANG], _AC_LANG)])
# AC_LANG_RESTORE
do
# The request may be several lines long, hence sed has to quit.
macro_name=`echo "$trace" | sed 's/:.*//;q'`
- trace_format=`echo "$trace" | sed '1s/^[^:]*://'`
+ trace_format=`echo "$trace" | sed '1s/^[^:]*:/:/'`
# GNU M4 1.4's tracing of builtins is buggy. When run on this input:
#
if echo "ifdef(\`$base_name', \`', \`m4exit(-1)')" | m4; then
# BASE_NAME is a builtin.
trace_opt="$trace_opt -t $base_name -t m4_$base_name"
- echo "$base_name:$trace_format" |
+ echo "$base_name$trace_format" |
$AWK -f $tmp/translate.awk >>$tmp/trace.m4 ||
{ (exit 1); exit; }
- echo "m4_$base_name:$trace_format" |
+ echo "m4_$base_name$trace_format" |
$AWK -f $tmp/translate.awk >>$tmp/trace.m4 ||
{ (exit 1); exit; }
else
m4_copy([m4_define], [define])
m4_copy([m4_defn], [defn])
+m4_copy([m4_popdef], [popdef])
+m4_copy([m4_pushdef], [pushdef])
m4_copy([m4_undefine], [undefine])
m4_include(acversion.m4)
do
# The request may be several lines long, hence sed has to quit.
macro_name=`echo "$trace" | sed 's/:.*//;q'`
- trace_format=`echo "$trace" | sed '1s/^[^:]*://'`
+ trace_format=`echo "$trace" | sed '1s/^[^:]*:/:/'`
# GNU M4 1.4's tracing of builtins is buggy. When run on this input:
#
if echo "ifdef(\`$base_name', \`', \`m4exit(-1)')" | m4; then
# BASE_NAME is a builtin.
trace_opt="$trace_opt -t $base_name -t m4_$base_name"
- echo "$base_name:$trace_format" |
+ echo "$base_name$trace_format" |
$AWK -f $tmp/translate.awk >>$tmp/trace.m4 ||
{ (exit 1); exit; }
- echo "m4_$base_name:$trace_format" |
+ echo "m4_$base_name$trace_format" |
$AWK -f $tmp/translate.awk >>$tmp/trace.m4 ||
{ (exit 1); exit; }
else
do
# The request may be several lines long, hence sed has to quit.
macro_name=`echo "$trace" | sed 's/:.*//;q'`
- trace_format=`echo "$trace" | sed '1s/^[^:]*://'`
+ trace_format=`echo "$trace" | sed '1s/^[^:]*:/:/'`
# GNU M4 1.4's tracing of builtins is buggy. When run on this input:
#
if echo "ifdef(\`$base_name', \`', \`m4exit(-1)')" | m4; then
# BASE_NAME is a builtin.
trace_opt="$trace_opt -t $base_name -t m4_$base_name"
- echo "$base_name:$trace_format" |
+ echo "$base_name$trace_format" |
$AWK -f $tmp/translate.awk >>$tmp/trace.m4 ||
{ (exit 1); exit; }
- echo "m4_$base_name:$trace_format" |
+ echo "m4_$base_name$trace_format" |
$AWK -f $tmp/translate.awk >>$tmp/trace.m4 ||
{ (exit 1); exit; }
else
m4_copy([m4_define], [define])
m4_copy([m4_defn], [defn])
+m4_copy([m4_popdef], [popdef])
+m4_copy([m4_pushdef], [pushdef])
m4_copy([m4_undefine], [undefine])
m4_include(acversion.m4)
# ------------------
# Save the current language, and use LANG.
define([AC_LANG_PUSH],
-[pushdef([_AC_LANG])dnl
+[m4_pushdef([_AC_LANG])dnl
AC_LANG([$1])])
# -----------
# Restore the previous language.
define([AC_LANG_POP],
-[popdef([_AC_LANG])dnl
+[m4_popdef([_AC_LANG])dnl
ifelse(_AC_LANG, [_AC_LANG],
[AC_FATAL([too many $0])])dnl
AC_LANG(_AC_LANG)])
[AC_DIAGNOSE([obsolete],
[instead of using `AC_LANG', `AC_LANG_SAVE',
and `AC_LANG_RESTORE', you should use `AC_LANG_PUSH' and `AC_LANG_POP'.])
-pushdef([_AC_LANG], _AC_LANG)])
+m4_pushdef([_AC_LANG], _AC_LANG)])
# AC_LANG_RESTORE
# ------------------
# Save the current language, and use LANG.
define([AC_LANG_PUSH],
-[pushdef([_AC_LANG])dnl
+[m4_pushdef([_AC_LANG])dnl
AC_LANG([$1])])
# -----------
# Restore the previous language.
define([AC_LANG_POP],
-[popdef([_AC_LANG])dnl
+[m4_popdef([_AC_LANG])dnl
ifelse(_AC_LANG, [_AC_LANG],
[AC_FATAL([too many $0])])dnl
AC_LANG(_AC_LANG)])
[AC_DIAGNOSE([obsolete],
[instead of using `AC_LANG', `AC_LANG_SAVE',
and `AC_LANG_RESTORE', you should use `AC_LANG_PUSH' and `AC_LANG_POP'.])
-pushdef([_AC_LANG], _AC_LANG)])
+m4_pushdef([_AC_LANG], _AC_LANG)])
# AC_LANG_RESTORE
# Initialize the diversion setup.
define([_m4_divert_diversion], _m4_divert([BODY]))
# Throw away output until AC_INIT is called.
-pushdef([_m4_divert_diversion], _m4_divert([KILL]))
+m4_pushdef([_m4_divert_diversion], _m4_divert([KILL]))
define([AC_VAR_PUSHDEF],
[AC_VAR_INDIR_IFELSE([$2],
[ac_$1=AC_TR_SH($2)
-pushdef([$1], [$ac_[$1]])],
- [pushdef([$1], [AC_TR_SH($2)])])])
+m4_pushdef([$1], [$ac_[$1]])],
+ [m4_pushdef([$1], [AC_TR_SH($2)])])])
# AC_VAR_POPDEF(VARNAME)
# ----------------------
# Free the shell variable accessor VARNAME. To be dnl'ed.
define([AC_VAR_POPDEF],
-[popdef([$1])])
+[m4_popdef([$1])])
# column 0 column 26
#
define([AC_HELP_STRING],
-[pushdef([AC_Prefix], m4_default([$3], [ ]))dnl
-pushdef([AC_Prefix_Format], [ %-]m4_eval(len(AC_Prefix) - 3)[s ])dnl [ %-23s ]
+[m4_pushdef([AC_Prefix], m4_default([$3], [ ]))dnl
+m4_pushdef([AC_Prefix_Format], [ %-]m4_eval(len(AC_Prefix) - 3)[s ])dnl [ %-23s ]
m4_wrap([$2], AC_Prefix, m4_format(AC_Prefix_Format, [$1]))dnl
-popdef([AC_Prefix_Format])dnl
-popdef([AC_Prefix])dnl
+m4_popdef([AC_Prefix_Format])dnl
+m4_popdef([AC_Prefix])dnl
])
# No big loss, I think, since most configures don't use this macro anyway.
AC_DEFUN([AC_PREFIX_PROGRAM],
[dnl Get an upper case version of $[1].
-pushdef([AC_Prog], m4_toupper([$1]))dnl
+m4_pushdef([AC_Prog], m4_toupper([$1]))dnl
if test "x$prefix" = xNONE; then
dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle.
echo $ECHO_N "checking for prefix by $ECHO_C" >&AC_FD_MSG
prefix=`AS_DIRNAME([$ac_cv_path_[]AC_Prog])`
fi
fi
-popdef([AC_Prog])dnl
+m4_popdef([AC_Prog])dnl
])# AC_PREFIX_PROGRAM
# is passed `-lfoo'. However, LIBRARY cannot be a shell variable;
# it must be a literal name.
AU_DEFUN([AC_HAVE_LIBRARY],
-[pushdef([AC_Lib_Name],
+[m4_pushdef([AC_Lib_Name],
patsubst(patsubst([[$1]], [lib\([^\.]*\)\.a], [\1]), [-l], []))dnl
AC_CHECK_LIB(AC_Lib_Name, main, [$2], [$3], [$4])dnl
ac_cv_lib_[]AC_Lib_Name()=ac_cv_lib_[]AC_Lib_Name()_main
-popdef([AC_Lib_Name])dnl
+m4_popdef([AC_Lib_Name])dnl
])
define([_AC_CONFIG_UNIQUE],
[m4_divert_push([KILL])
AC_FOREACH([AC_File], [$1],
-[pushdef([AC_Dest], patsubst(AC_File, [:.*]))
+[m4_pushdef([AC_Dest], patsubst(AC_File, [:.*]))
AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_HEADERS],
[AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_HEADER or AC_CONFIG_HEADERS.])])
AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_LINKS],
[AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_COMMANDS.])])
AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_FILES],
[AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_FILES or AC_OUTPUT.])])
-popdef([AC_Dest])])
+m4_popdef([AC_Dest])])
m4_divert_pop()dnl
])
# ------------------
# Save the current language, and use LANG.
define([AC_LANG_PUSH],
-[pushdef([_AC_LANG])dnl
+[m4_pushdef([_AC_LANG])dnl
AC_LANG([$1])])
# -----------
# Restore the previous language.
define([AC_LANG_POP],
-[popdef([_AC_LANG])dnl
+[m4_popdef([_AC_LANG])dnl
ifelse(_AC_LANG, [_AC_LANG],
[AC_FATAL([too many $0])])dnl
AC_LANG(_AC_LANG)])
[AC_DIAGNOSE([obsolete],
[instead of using `AC_LANG', `AC_LANG_SAVE',
and `AC_LANG_RESTORE', you should use `AC_LANG_PUSH' and `AC_LANG_POP'.])
-pushdef([_AC_LANG], _AC_LANG)])
+m4_pushdef([_AC_LANG], _AC_LANG)])
# AC_LANG_RESTORE
# Rename them a` la `m4 --prefix-builtins'.
m4_rename([eval], [m4_eval])
m4_rename([format], [m4_format])
+m4_rename([popdef], [m4_popdef])
+m4_rename([pushdef], [m4_pushdef])
m4_rename([shift], [m4_shift])
m4_rename([symbols], [m4_symbols])
# ---------------------
m4_define([_m4_dumpdefs_up],
[ifdef([$1],
- [pushdef([_m4_dumpdefs], m4_defn([$1]))dnl
+ [m4_pushdef([_m4_dumpdefs], m4_defn([$1]))dnl
dumpdef([$1])dnl
-popdef([$1])dnl
+m4_popdef([$1])dnl
_m4_dumpdefs_up([$1])])])
# -----------------------
m4_define([_m4_dumpdefs_down],
[ifdef([_m4_dumpdefs],
- [pushdef([$1], m4_defn([_m4_dumpdefs]))dnl
-popdef([_m4_dumpdefs])dnl
+ [m4_pushdef([$1], m4_defn([_m4_dumpdefs]))dnl
+m4_popdef([_m4_dumpdefs])dnl
_m4_dumpdefs_down([$1])])])
# m4_dumpdefs(NAME)
# -----------------
-# Similar to `dumpdef(NAME)', but if NAME was pushdef'ed, display its
+# Similar to `dumpdef(NAME)', but if NAME was m4_pushdef'ed, display its
# value stack (most recent displayed first).
m4_define([m4_dumpdefs],
[_m4_dumpdefs_up([$1])dnl
[m4_case(m4_sign(m4_eval($3 - $2)),
1, [m4_assert(m4_sign(m4_default($4, 1)) == 1)],
-1, [m4_assert(m4_sign(m4_default($4, -1)) == -1)])dnl
-pushdef([$1], [$2])dnl
+m4_pushdef([$1], [$2])dnl
ifelse(m4_eval([$3 > $2]), 1,
[_m4_for([$1], [$3], m4_default([$4], 1), [$5])],
[_m4_for([$1], [$3], m4_default([$4], -1), [$5])])dnl
-popdef([$1])])
+m4_popdef([$1])])
m4_define([_m4_for],
[$4[]dnl
#
# | # foreach(VAR, (LIST), STMT)
# | m4_define([foreach],
-# | [pushdef([$1])_foreach([$1], [$2], [$3])popdef([$1])])
+# | [m4_pushdef([$1])_foreach([$1], [$2], [$3])m4_popdef([$1])])
# | m4_define([_arg1], [$1])
# | m4_define([_foreach],
# | [ifelse([$2], [()], ,
# apply to the maintenance of m4sugar!).
#
# | # foreach(VAR, (LIST), STMT)
-# | m4_define([foreach], [pushdef([$1])_foreach($@)popdef([$1])])
+# | m4_define([foreach], [m4_pushdef([$1])_foreach($@)m4_popdef([$1])])
# | m4_define([_arg1], [[$1]])
# | m4_define([_foreach],
# | [ifelse($2, [()], ,
# simplifies the use:
#
# | # foreach(VAR, (LIST), STMT)
-# | m4_define([foreach], [pushdef([$1])_foreach($@)popdef([$1])])
+# | m4_define([foreach], [m4_pushdef([$1])_foreach($@)m4_popdef([$1])])
# | m4_define([_arg1], [$1])
# | m4_define([_foreach],
# | [ifelse($2, [], ,
# | m4_foreach(Var, [[[active]], [[active]]], [-Var-])
# => -active--active-
m4_define([m4_foreach],
-[pushdef([$1])_m4_foreach($@)popdef([$1])])
+[m4_pushdef([$1])_m4_foreach($@)m4_popdef([$1])])
# Low level macros used to define m4_foreach.
m4_define([m4_car], [$1])
# ------------------------------
# Change the diversion stream to DIVERSION-NAME, while stacking old values.
m4_define([m4_divert_push],
-[pushdef([_m4_divert_diversion], _m4_divert([$1]))dnl
+[m4_pushdef([_m4_divert_diversion], _m4_divert([$1]))dnl
divert(_m4_divert_diversion)dnl
])
# -------------
# Change the diversion stream to its previous value, unstacking it.
m4_define([m4_divert_pop],
-[popdef([_m4_divert_diversion])dnl
+[m4_popdef([_m4_divert_diversion])dnl
ifndef([_m4_divert_diversion],
[m4_fatal([too many m4_divert_pop])])dnl
divert(_m4_divert_diversion)dnl
# not for define'd macros.
#
# The scheme is simplistic: each time we enter an m4_defun'd macros,
-# we pushdef its name in _m4_expansion_stack, and when we exit the
-# macro, we popdef _m4_expansion_stack.
+# we m4_pushdef its name in _m4_expansion_stack, and when we exit the
+# macro, we m4_popdef _m4_expansion_stack.
#
# In addition, we want to use the expansion stack to detect circular
# m4_require dependencies. This means we need to browse the stack to
m4_define([_m4_expansion_stack_dump],
[ifdef([_m4_expansion_stack],
[m4_errprint(m4_defn([_m4_expansion_stack]))dnl
-popdef([_m4_expansion_stack])dnl
+m4_popdef([_m4_expansion_stack])dnl
_m4_expansion_stack_dump()],
[m4_errprint(m4_location[: the top level])])])
# -------------------------
# The prologue for Autoconf macros.
m4_define([_m4_defun_pro],
-[pushdef([_m4_expansion_stack],
+[m4_pushdef([_m4_expansion_stack],
m4_defn([m4_location($1)])[: $1 is expanded from...])dnl
-pushdef([_m4_expanding($1)])dnl
+m4_pushdef([_m4_expanding($1)])dnl
ifdef([_m4_divert_dump],
[m4_divert_push(m4_defn([_m4_divert_diversion]))],
[m4_copy([_m4_divert_diversion], [_m4_divert_dump])dnl
ifelse(_m4_divert_dump, _m4_divert_diversion,
[undivert(_m4_divert([GROW]))dnl
m4_undefine([_m4_divert_dump])])dnl
-popdef([_m4_expansion_stack])dnl
-popdef([_m4_expanding($1)])dnl
+m4_popdef([_m4_expansion_stack])dnl
+m4_popdef([_m4_expanding($1)])dnl
m4_provide([$1])dnl
])
# `extension' prevents `AC_LANG_COMPILER' from having actual arguments that
# it passes to `AC_LANG_COMPILER(C)'.
m4_define([_m4_require],
-[pushdef([_m4_expansion_stack],
+[m4_pushdef([_m4_expansion_stack],
m4_location[: $1 is required by...])dnl
ifdef([_m4_expanding($1)],
[m4_fatal([m4_require: circular dependency of $1])])dnl
[],
[m4_warn([syntax],
[$1 is m4_require'd but is not m4_defun'd])])dnl
-popdef([_m4_expansion_stack])dnl
+m4_popdef([_m4_expansion_stack])dnl
])
# FIXME: This macro should not exists. Currently it's used only in
# m4_wrap, which needs to be rewritten. But it's godam hard.
m4_define([m4_foreach_quoted],
-[pushdef([$1], [])_m4_foreach_quoted($@)popdef([$1])])
+[m4_pushdef([$1], [])_m4_foreach_quoted($@)m4_popdef([$1])])
# Low level macros used to define m4_foreach.
m4_define([m4_car_quoted], [[$1]])
# words are preceded by m4_Separator which is defined to empty for the
# first word, and then ` ' (single space) for all the others.
m4_define([m4_wrap],
-[pushdef([m4_Prefix], m4_default([$2], []))dnl
-pushdef([m4_Prefix1], m4_default([$3], [m4_Prefix]))dnl
-pushdef([m4_Width], m4_default([$4], 79))dnl
-pushdef([m4_Cursor], len(m4_Prefix1))dnl
-pushdef([m4_Separator], [])dnl
+[m4_pushdef([m4_Prefix], m4_default([$2], []))dnl
+m4_pushdef([m4_Prefix1], m4_default([$3], [m4_Prefix]))dnl
+m4_pushdef([m4_Width], m4_default([$4], 79))dnl
+m4_pushdef([m4_Cursor], len(m4_Prefix1))dnl
+m4_pushdef([m4_Separator], [])dnl
m4_Prefix1[]dnl
ifelse(m4_eval(m4_Cursor > len(m4_Prefix)),
1, [m4_define([m4_Cursor], len(m4_Prefix))
[m4_Separator])[]dnl
m4_Word[]dnl
m4_define([m4_Separator], [ ])])dnl
-popdef([m4_Separator])dnl
-popdef([m4_Cursor])dnl
-popdef([m4_Width])dnl
-popdef([m4_Prefix1])dnl
-popdef([m4_Prefix])dnl
+m4_popdef([m4_Separator])dnl
+m4_popdef([m4_Cursor])dnl
+m4_popdef([m4_Width])dnl
+m4_popdef([m4_Prefix1])dnl
+m4_popdef([m4_Prefix])dnl
])
# Rename them a` la `m4 --prefix-builtins'.
m4_rename([eval], [m4_eval])
m4_rename([format], [m4_format])
+m4_rename([popdef], [m4_popdef])
+m4_rename([pushdef], [m4_pushdef])
m4_rename([shift], [m4_shift])
m4_rename([symbols], [m4_symbols])
# ---------------------
m4_define([_m4_dumpdefs_up],
[ifdef([$1],
- [pushdef([_m4_dumpdefs], m4_defn([$1]))dnl
+ [m4_pushdef([_m4_dumpdefs], m4_defn([$1]))dnl
dumpdef([$1])dnl
-popdef([$1])dnl
+m4_popdef([$1])dnl
_m4_dumpdefs_up([$1])])])
# -----------------------
m4_define([_m4_dumpdefs_down],
[ifdef([_m4_dumpdefs],
- [pushdef([$1], m4_defn([_m4_dumpdefs]))dnl
-popdef([_m4_dumpdefs])dnl
+ [m4_pushdef([$1], m4_defn([_m4_dumpdefs]))dnl
+m4_popdef([_m4_dumpdefs])dnl
_m4_dumpdefs_down([$1])])])
# m4_dumpdefs(NAME)
# -----------------
-# Similar to `dumpdef(NAME)', but if NAME was pushdef'ed, display its
+# Similar to `dumpdef(NAME)', but if NAME was m4_pushdef'ed, display its
# value stack (most recent displayed first).
m4_define([m4_dumpdefs],
[_m4_dumpdefs_up([$1])dnl
[m4_case(m4_sign(m4_eval($3 - $2)),
1, [m4_assert(m4_sign(m4_default($4, 1)) == 1)],
-1, [m4_assert(m4_sign(m4_default($4, -1)) == -1)])dnl
-pushdef([$1], [$2])dnl
+m4_pushdef([$1], [$2])dnl
ifelse(m4_eval([$3 > $2]), 1,
[_m4_for([$1], [$3], m4_default([$4], 1), [$5])],
[_m4_for([$1], [$3], m4_default([$4], -1), [$5])])dnl
-popdef([$1])])
+m4_popdef([$1])])
m4_define([_m4_for],
[$4[]dnl
#
# | # foreach(VAR, (LIST), STMT)
# | m4_define([foreach],
-# | [pushdef([$1])_foreach([$1], [$2], [$3])popdef([$1])])
+# | [m4_pushdef([$1])_foreach([$1], [$2], [$3])m4_popdef([$1])])
# | m4_define([_arg1], [$1])
# | m4_define([_foreach],
# | [ifelse([$2], [()], ,
# apply to the maintenance of m4sugar!).
#
# | # foreach(VAR, (LIST), STMT)
-# | m4_define([foreach], [pushdef([$1])_foreach($@)popdef([$1])])
+# | m4_define([foreach], [m4_pushdef([$1])_foreach($@)m4_popdef([$1])])
# | m4_define([_arg1], [[$1]])
# | m4_define([_foreach],
# | [ifelse($2, [()], ,
# simplifies the use:
#
# | # foreach(VAR, (LIST), STMT)
-# | m4_define([foreach], [pushdef([$1])_foreach($@)popdef([$1])])
+# | m4_define([foreach], [m4_pushdef([$1])_foreach($@)m4_popdef([$1])])
# | m4_define([_arg1], [$1])
# | m4_define([_foreach],
# | [ifelse($2, [], ,
# | m4_foreach(Var, [[[active]], [[active]]], [-Var-])
# => -active--active-
m4_define([m4_foreach],
-[pushdef([$1])_m4_foreach($@)popdef([$1])])
+[m4_pushdef([$1])_m4_foreach($@)m4_popdef([$1])])
# Low level macros used to define m4_foreach.
m4_define([m4_car], [$1])
# ------------------------------
# Change the diversion stream to DIVERSION-NAME, while stacking old values.
m4_define([m4_divert_push],
-[pushdef([_m4_divert_diversion], _m4_divert([$1]))dnl
+[m4_pushdef([_m4_divert_diversion], _m4_divert([$1]))dnl
divert(_m4_divert_diversion)dnl
])
# -------------
# Change the diversion stream to its previous value, unstacking it.
m4_define([m4_divert_pop],
-[popdef([_m4_divert_diversion])dnl
+[m4_popdef([_m4_divert_diversion])dnl
ifndef([_m4_divert_diversion],
[m4_fatal([too many m4_divert_pop])])dnl
divert(_m4_divert_diversion)dnl
# not for define'd macros.
#
# The scheme is simplistic: each time we enter an m4_defun'd macros,
-# we pushdef its name in _m4_expansion_stack, and when we exit the
-# macro, we popdef _m4_expansion_stack.
+# we m4_pushdef its name in _m4_expansion_stack, and when we exit the
+# macro, we m4_popdef _m4_expansion_stack.
#
# In addition, we want to use the expansion stack to detect circular
# m4_require dependencies. This means we need to browse the stack to
m4_define([_m4_expansion_stack_dump],
[ifdef([_m4_expansion_stack],
[m4_errprint(m4_defn([_m4_expansion_stack]))dnl
-popdef([_m4_expansion_stack])dnl
+m4_popdef([_m4_expansion_stack])dnl
_m4_expansion_stack_dump()],
[m4_errprint(m4_location[: the top level])])])
# -------------------------
# The prologue for Autoconf macros.
m4_define([_m4_defun_pro],
-[pushdef([_m4_expansion_stack],
+[m4_pushdef([_m4_expansion_stack],
m4_defn([m4_location($1)])[: $1 is expanded from...])dnl
-pushdef([_m4_expanding($1)])dnl
+m4_pushdef([_m4_expanding($1)])dnl
ifdef([_m4_divert_dump],
[m4_divert_push(m4_defn([_m4_divert_diversion]))],
[m4_copy([_m4_divert_diversion], [_m4_divert_dump])dnl
ifelse(_m4_divert_dump, _m4_divert_diversion,
[undivert(_m4_divert([GROW]))dnl
m4_undefine([_m4_divert_dump])])dnl
-popdef([_m4_expansion_stack])dnl
-popdef([_m4_expanding($1)])dnl
+m4_popdef([_m4_expansion_stack])dnl
+m4_popdef([_m4_expanding($1)])dnl
m4_provide([$1])dnl
])
# `extension' prevents `AC_LANG_COMPILER' from having actual arguments that
# it passes to `AC_LANG_COMPILER(C)'.
m4_define([_m4_require],
-[pushdef([_m4_expansion_stack],
+[m4_pushdef([_m4_expansion_stack],
m4_location[: $1 is required by...])dnl
ifdef([_m4_expanding($1)],
[m4_fatal([m4_require: circular dependency of $1])])dnl
[],
[m4_warn([syntax],
[$1 is m4_require'd but is not m4_defun'd])])dnl
-popdef([_m4_expansion_stack])dnl
+m4_popdef([_m4_expansion_stack])dnl
])
# FIXME: This macro should not exists. Currently it's used only in
# m4_wrap, which needs to be rewritten. But it's godam hard.
m4_define([m4_foreach_quoted],
-[pushdef([$1], [])_m4_foreach_quoted($@)popdef([$1])])
+[m4_pushdef([$1], [])_m4_foreach_quoted($@)m4_popdef([$1])])
# Low level macros used to define m4_foreach.
m4_define([m4_car_quoted], [[$1]])
# words are preceded by m4_Separator which is defined to empty for the
# first word, and then ` ' (single space) for all the others.
m4_define([m4_wrap],
-[pushdef([m4_Prefix], m4_default([$2], []))dnl
-pushdef([m4_Prefix1], m4_default([$3], [m4_Prefix]))dnl
-pushdef([m4_Width], m4_default([$4], 79))dnl
-pushdef([m4_Cursor], len(m4_Prefix1))dnl
-pushdef([m4_Separator], [])dnl
+[m4_pushdef([m4_Prefix], m4_default([$2], []))dnl
+m4_pushdef([m4_Prefix1], m4_default([$3], [m4_Prefix]))dnl
+m4_pushdef([m4_Width], m4_default([$4], 79))dnl
+m4_pushdef([m4_Cursor], len(m4_Prefix1))dnl
+m4_pushdef([m4_Separator], [])dnl
m4_Prefix1[]dnl
ifelse(m4_eval(m4_Cursor > len(m4_Prefix)),
1, [m4_define([m4_Cursor], len(m4_Prefix))
[m4_Separator])[]dnl
m4_Word[]dnl
m4_define([m4_Separator], [ ])])dnl
-popdef([m4_Separator])dnl
-popdef([m4_Cursor])dnl
-popdef([m4_Width])dnl
-popdef([m4_Prefix1])dnl
-popdef([m4_Prefix])dnl
+m4_popdef([m4_Separator])dnl
+m4_popdef([m4_Cursor])dnl
+m4_popdef([m4_Width])dnl
+m4_popdef([m4_Prefix1])dnl
+m4_popdef([m4_Prefix])dnl
])