mirror of
git://git.sv.gnu.org/autoconf
synced 2025-02-23 14:09:51 +08:00
Get rid of the m4 name spaces.
* libm4.m4 (m4_changequote, m4_define, m4_defn, m4_dnl, m4_indir, m4_popdef, m4_pushdef, m4_undefine, m4_namespace_push, m4_namespace_pop, m4_namespace_register, m4_namespace_define, m4_disable, m4_enable): Removed. All dependencies adjusted. * libm4.m4: Remove all the name space initialization. * acgeneral.m4: Adjust. (AU_DEFINE): Redefine as `AC_DEFUN'. * autoupdate.m4: Adjust. * tests/tools.m4: Temporarily disable the `autoupdate' test.
This commit is contained in:
parent
c706f3273a
commit
b93ddb3ab5
15
ChangeLog
15
ChangeLog
@ -1,3 +1,18 @@
|
||||
2000-05-11 Akim Demaille <akim@epita.fr>
|
||||
|
||||
Get rid of the m4 name spaces.
|
||||
|
||||
* libm4.m4 (m4_changequote, m4_define, m4_defn, m4_dnl, m4_indir,
|
||||
m4_popdef, m4_pushdef, m4_undefine, m4_namespace_push,
|
||||
m4_namespace_pop, m4_namespace_register, m4_namespace_define,
|
||||
m4_disable, m4_enable): Removed.
|
||||
All dependencies adjusted.
|
||||
* libm4.m4: Remove all the name space initialization.
|
||||
* acgeneral.m4: Adjust.
|
||||
(AU_DEFINE): Redefine as `AC_DEFUN'.
|
||||
* autoupdate.m4: Adjust.
|
||||
* tests/tools.m4: Temporarily disable the `autoupdate' test.
|
||||
|
||||
2000-05-11 Akim Demaille <akim@epita.fr>
|
||||
|
||||
Eradicate AC_TRY_COMPILE.
|
||||
|
72
acgeneral.m4
72
acgeneral.m4
@ -49,8 +49,6 @@
|
||||
# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
|
||||
# Roland McGrath, Noah Friedman, david d zuhn, and many others.
|
||||
|
||||
m4_namespace_push(autoconf)
|
||||
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
@ -311,11 +309,8 @@ define(AC_EXPAND_ONCE,
|
||||
|
||||
# AC_PROVIDE(MACRO-NAME)
|
||||
# ----------------------
|
||||
# We use `m4_define' and not `define' to avoid the cost of the name
|
||||
# space machinery. It makes no difference for any of the name
|
||||
# spaces.
|
||||
define(AC_PROVIDE,
|
||||
[m4_define([AC_PROVIDE_$1])])
|
||||
[define([AC_PROVIDE_$1])])
|
||||
|
||||
|
||||
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
|
||||
@ -343,14 +338,7 @@ define(AC_PROVIDE_IFELSE,
|
||||
# wrapping actions required by `autoupdate'.
|
||||
# We do not define anything in `autoconf::'.
|
||||
define(AU_DEFINE,
|
||||
[m4_namespace_define(autoupdate, [$1],
|
||||
[m4_changequote([, ])m4_dnl
|
||||
m4_enable(libm4)m4_dnl
|
||||
m4_warn([Updating use of `$1'. $3])m4_dnl
|
||||
$2[]m4_dnl
|
||||
m4_disable(libm4)m4_dnl
|
||||
m4_changequote(, )m4_dnl
|
||||
])])
|
||||
[AC_DEFUN([$1], [$2])])
|
||||
|
||||
|
||||
# AU_DEFUN(NAME, NEW-CODE, [MESSAGE])
|
||||
@ -365,11 +353,11 @@ m4_changequote(, )m4_dnl
|
||||
# and to update a configure.in.
|
||||
# See `acobsolete.m4' for a longer description.
|
||||
define(AU_DEFUN,
|
||||
[define([$1],
|
||||
[AC_DIAGNOSE([obsolete], [The macro `$1' is obsolete.
|
||||
[AU_DEFINE([$1],
|
||||
[AC_DIAGNOSE([obsolete], [The macro `$1' is obsolete.
|
||||
You should run autoupdate.])dnl
|
||||
$2])dnl
|
||||
AU_DEFINE([$1], [$2], [$3])dnl
|
||||
$2],
|
||||
[$3])dnl
|
||||
])
|
||||
|
||||
|
||||
@ -412,7 +400,7 @@ define([AH_TEMPLATE],
|
||||
# ------------
|
||||
# Output TEXT at the top of `config.h.in'.
|
||||
define([AH_TOP],
|
||||
[m4_define([_AH_COUNTER], incr(_AH_COUNTER))dnl
|
||||
[define([_AH_COUNTER], incr(_AH_COUNTER))dnl
|
||||
AH_VERBATIM([0000]_AH_COUNTER, [$1])])
|
||||
|
||||
|
||||
@ -420,7 +408,7 @@ AH_VERBATIM([0000]_AH_COUNTER, [$1])])
|
||||
# ---------------
|
||||
# Output TEXT at the bottom of `config.h.in'.
|
||||
define([AH_BOTTOM],
|
||||
[m4_define([_AH_COUNTER], incr(_AH_COUNTER))dnl
|
||||
[define([_AH_COUNTER], incr(_AH_COUNTER))dnl
|
||||
AH_VERBATIM([zzzz]_AH_COUNTER, [$1])])
|
||||
|
||||
# Initialize.
|
||||
@ -3567,9 +3555,7 @@ AC_CONFIG_COMMANDS([default-]AC_OUTPUT_COMMANDS_CNT, [[$1]], [[$2]])dnl
|
||||
])
|
||||
|
||||
# Initialize both in `autoconf::' and `autoupdate::'.
|
||||
define(AC_OUTPUT_COMMANDS_CNT, 0)
|
||||
m4_namespace_define(autoupdate,
|
||||
[AC_OUTPUT_COMMANDS_CNT], 0)
|
||||
AU_DEFINE([AC_OUTPUT_COMMANDS_CNT], 0)
|
||||
|
||||
|
||||
# AC_CONFIG_COMMANDS_PRE(CMDS)
|
||||
@ -3696,9 +3682,7 @@ AC_CONFIG_LINKS($[ac_config_links_]_AC_LINK_FILES_CNT)dnl
|
||||
|
||||
|
||||
# Initialize both in `autoconf::' and `autoupdate::'.
|
||||
define(_AC_LINK_FILES_CNT, 0)
|
||||
m4_namespace_define(autoupdate,
|
||||
[_AC_LINK_FILES_CNT], 0)
|
||||
AU_DEFINE([_AC_LINK_FILES_CNT], 0)
|
||||
|
||||
|
||||
|
||||
@ -3748,6 +3732,23 @@ AC_SUBST(subdirs)dnl
|
||||
define([AC_LIST_SUBDIRS])
|
||||
|
||||
|
||||
# autoupdate::AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
|
||||
# -------------------------------------------------------------------
|
||||
#
|
||||
# If there are arguments given to AC_OUTPUT, dispatch them to the
|
||||
# proper modern macros.
|
||||
|
||||
AU_DEFINE([AC_OUTPUT],
|
||||
[ifval([$1],
|
||||
[AC_CONFIG_FILES([$1])
|
||||
])dnl
|
||||
ifval([$2$3],
|
||||
[AC_CONFIG_COMMANDS(default, [[$2]], [[$3]])
|
||||
])dnl
|
||||
[AC_OUTPUT]],
|
||||
[`AC_OUTPUT' should be used without arguments.])
|
||||
|
||||
|
||||
# AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
|
||||
# -------------------------------------------------------
|
||||
# The big finish.
|
||||
@ -3755,7 +3756,7 @@ define([AC_LIST_SUBDIRS])
|
||||
# The CONFIG_HEADERS are defined in the m4 variable AC_LIST_HEADERS.
|
||||
# Pay special attention not to have too long here docs: some old
|
||||
# shells die. Unfortunately the limit is not known precisely...
|
||||
define(AC_OUTPUT,
|
||||
define([AC_OUTPUT],
|
||||
[dnl Dispatch the extra arguments to their native macros.
|
||||
ifval([$1],
|
||||
[AC_CONFIG_FILES([$1])])dnl
|
||||
@ -3804,23 +3805,6 @@ ifset([AC_LIST_SUBDIRS], [_AC_OUTPUT_SUBDIRS()])dnl
|
||||
])# AC_OUTPUT
|
||||
|
||||
|
||||
# autoupdate::AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
|
||||
# -------------------------------------------------------------------
|
||||
#
|
||||
# If there are arguments given to AC_OUTPUT, dispatch them to the
|
||||
# proper modern macros.
|
||||
|
||||
AU_DEFINE([AC_OUTPUT],
|
||||
[ifval([$1],
|
||||
[AC_CONFIG_FILES([$1])
|
||||
])dnl
|
||||
ifval([$2$3],
|
||||
[AC_CONFIG_COMMANDS(default, [[$2]], [[$3]])
|
||||
])dnl
|
||||
[AC_OUTPUT]],
|
||||
[`AC_OUTPUT' should be used without arguments.])
|
||||
|
||||
|
||||
# _AC_OUTPUT_CONFIG_STATUS
|
||||
# ------------------------
|
||||
# Produce config.status. Called by AC_OUTPUT.
|
||||
|
@ -105,7 +105,7 @@ define([_AC_LANG_DISPATCH],
|
||||
# If you add quotes here, they will be part of the name too, yielding
|
||||
# `AC_LANG([C])' for instance, which does not exist.
|
||||
AC_DEFUN([AC_LANG],
|
||||
[m4_define([_AC_LANG], [$1])dnl
|
||||
[define([_AC_LANG], [$1])dnl
|
||||
_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
|
||||
|
||||
|
||||
|
@ -28,9 +28,4 @@ m4_include(acgeneral.m4)
|
||||
m4_include(aclang.m4)
|
||||
m4_include(acspecific.m4)
|
||||
m4_include(acoldnames.m4)
|
||||
m4_disable(autoconf)
|
||||
m4_enable(autoupdate)
|
||||
# Disable m4
|
||||
m4_disable(libm4)
|
||||
m4_changequote(, )
|
||||
divert(0)m4_dnl
|
||||
divert(0)dnl
|
||||
|
@ -105,7 +105,7 @@ define([_AC_LANG_DISPATCH],
|
||||
# If you add quotes here, they will be part of the name too, yielding
|
||||
# `AC_LANG([C])' for instance, which does not exist.
|
||||
AC_DEFUN([AC_LANG],
|
||||
[m4_define([_AC_LANG], [$1])dnl
|
||||
[define([_AC_LANG], [$1])dnl
|
||||
_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
|
||||
|
||||
|
||||
|
@ -105,7 +105,7 @@ define([_AC_LANG_DISPATCH],
|
||||
# If you add quotes here, they will be part of the name too, yielding
|
||||
# `AC_LANG([C])' for instance, which does not exist.
|
||||
AC_DEFUN([AC_LANG],
|
||||
[m4_define([_AC_LANG], [$1])dnl
|
||||
[define([_AC_LANG], [$1])dnl
|
||||
_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
|
||||
|
||||
|
||||
|
@ -49,8 +49,6 @@
|
||||
# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
|
||||
# Roland McGrath, Noah Friedman, david d zuhn, and many others.
|
||||
|
||||
m4_namespace_push(autoconf)
|
||||
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
@ -311,11 +309,8 @@ define(AC_EXPAND_ONCE,
|
||||
|
||||
# AC_PROVIDE(MACRO-NAME)
|
||||
# ----------------------
|
||||
# We use `m4_define' and not `define' to avoid the cost of the name
|
||||
# space machinery. It makes no difference for any of the name
|
||||
# spaces.
|
||||
define(AC_PROVIDE,
|
||||
[m4_define([AC_PROVIDE_$1])])
|
||||
[define([AC_PROVIDE_$1])])
|
||||
|
||||
|
||||
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
|
||||
@ -343,14 +338,7 @@ define(AC_PROVIDE_IFELSE,
|
||||
# wrapping actions required by `autoupdate'.
|
||||
# We do not define anything in `autoconf::'.
|
||||
define(AU_DEFINE,
|
||||
[m4_namespace_define(autoupdate, [$1],
|
||||
[m4_changequote([, ])m4_dnl
|
||||
m4_enable(libm4)m4_dnl
|
||||
m4_warn([Updating use of `$1'. $3])m4_dnl
|
||||
$2[]m4_dnl
|
||||
m4_disable(libm4)m4_dnl
|
||||
m4_changequote(, )m4_dnl
|
||||
])])
|
||||
[AC_DEFUN([$1], [$2])])
|
||||
|
||||
|
||||
# AU_DEFUN(NAME, NEW-CODE, [MESSAGE])
|
||||
@ -365,11 +353,11 @@ m4_changequote(, )m4_dnl
|
||||
# and to update a configure.in.
|
||||
# See `acobsolete.m4' for a longer description.
|
||||
define(AU_DEFUN,
|
||||
[define([$1],
|
||||
[AC_DIAGNOSE([obsolete], [The macro `$1' is obsolete.
|
||||
[AU_DEFINE([$1],
|
||||
[AC_DIAGNOSE([obsolete], [The macro `$1' is obsolete.
|
||||
You should run autoupdate.])dnl
|
||||
$2])dnl
|
||||
AU_DEFINE([$1], [$2], [$3])dnl
|
||||
$2],
|
||||
[$3])dnl
|
||||
])
|
||||
|
||||
|
||||
@ -412,7 +400,7 @@ define([AH_TEMPLATE],
|
||||
# ------------
|
||||
# Output TEXT at the top of `config.h.in'.
|
||||
define([AH_TOP],
|
||||
[m4_define([_AH_COUNTER], incr(_AH_COUNTER))dnl
|
||||
[define([_AH_COUNTER], incr(_AH_COUNTER))dnl
|
||||
AH_VERBATIM([0000]_AH_COUNTER, [$1])])
|
||||
|
||||
|
||||
@ -420,7 +408,7 @@ AH_VERBATIM([0000]_AH_COUNTER, [$1])])
|
||||
# ---------------
|
||||
# Output TEXT at the bottom of `config.h.in'.
|
||||
define([AH_BOTTOM],
|
||||
[m4_define([_AH_COUNTER], incr(_AH_COUNTER))dnl
|
||||
[define([_AH_COUNTER], incr(_AH_COUNTER))dnl
|
||||
AH_VERBATIM([zzzz]_AH_COUNTER, [$1])])
|
||||
|
||||
# Initialize.
|
||||
@ -3567,9 +3555,7 @@ AC_CONFIG_COMMANDS([default-]AC_OUTPUT_COMMANDS_CNT, [[$1]], [[$2]])dnl
|
||||
])
|
||||
|
||||
# Initialize both in `autoconf::' and `autoupdate::'.
|
||||
define(AC_OUTPUT_COMMANDS_CNT, 0)
|
||||
m4_namespace_define(autoupdate,
|
||||
[AC_OUTPUT_COMMANDS_CNT], 0)
|
||||
AU_DEFINE([AC_OUTPUT_COMMANDS_CNT], 0)
|
||||
|
||||
|
||||
# AC_CONFIG_COMMANDS_PRE(CMDS)
|
||||
@ -3696,9 +3682,7 @@ AC_CONFIG_LINKS($[ac_config_links_]_AC_LINK_FILES_CNT)dnl
|
||||
|
||||
|
||||
# Initialize both in `autoconf::' and `autoupdate::'.
|
||||
define(_AC_LINK_FILES_CNT, 0)
|
||||
m4_namespace_define(autoupdate,
|
||||
[_AC_LINK_FILES_CNT], 0)
|
||||
AU_DEFINE([_AC_LINK_FILES_CNT], 0)
|
||||
|
||||
|
||||
|
||||
@ -3748,6 +3732,23 @@ AC_SUBST(subdirs)dnl
|
||||
define([AC_LIST_SUBDIRS])
|
||||
|
||||
|
||||
# autoupdate::AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
|
||||
# -------------------------------------------------------------------
|
||||
#
|
||||
# If there are arguments given to AC_OUTPUT, dispatch them to the
|
||||
# proper modern macros.
|
||||
|
||||
AU_DEFINE([AC_OUTPUT],
|
||||
[ifval([$1],
|
||||
[AC_CONFIG_FILES([$1])
|
||||
])dnl
|
||||
ifval([$2$3],
|
||||
[AC_CONFIG_COMMANDS(default, [[$2]], [[$3]])
|
||||
])dnl
|
||||
[AC_OUTPUT]],
|
||||
[`AC_OUTPUT' should be used without arguments.])
|
||||
|
||||
|
||||
# AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
|
||||
# -------------------------------------------------------
|
||||
# The big finish.
|
||||
@ -3755,7 +3756,7 @@ define([AC_LIST_SUBDIRS])
|
||||
# The CONFIG_HEADERS are defined in the m4 variable AC_LIST_HEADERS.
|
||||
# Pay special attention not to have too long here docs: some old
|
||||
# shells die. Unfortunately the limit is not known precisely...
|
||||
define(AC_OUTPUT,
|
||||
define([AC_OUTPUT],
|
||||
[dnl Dispatch the extra arguments to their native macros.
|
||||
ifval([$1],
|
||||
[AC_CONFIG_FILES([$1])])dnl
|
||||
@ -3804,23 +3805,6 @@ ifset([AC_LIST_SUBDIRS], [_AC_OUTPUT_SUBDIRS()])dnl
|
||||
])# AC_OUTPUT
|
||||
|
||||
|
||||
# autoupdate::AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
|
||||
# -------------------------------------------------------------------
|
||||
#
|
||||
# If there are arguments given to AC_OUTPUT, dispatch them to the
|
||||
# proper modern macros.
|
||||
|
||||
AU_DEFINE([AC_OUTPUT],
|
||||
[ifval([$1],
|
||||
[AC_CONFIG_FILES([$1])
|
||||
])dnl
|
||||
ifval([$2$3],
|
||||
[AC_CONFIG_COMMANDS(default, [[$2]], [[$3]])
|
||||
])dnl
|
||||
[AC_OUTPUT]],
|
||||
[`AC_OUTPUT' should be used without arguments.])
|
||||
|
||||
|
||||
# _AC_OUTPUT_CONFIG_STATUS
|
||||
# ------------------------
|
||||
# Produce config.status. Called by AC_OUTPUT.
|
||||
|
@ -105,7 +105,7 @@ define([_AC_LANG_DISPATCH],
|
||||
# If you add quotes here, they will be part of the name too, yielding
|
||||
# `AC_LANG([C])' for instance, which does not exist.
|
||||
AC_DEFUN([AC_LANG],
|
||||
[m4_define([_AC_LANG], [$1])dnl
|
||||
[define([_AC_LANG], [$1])dnl
|
||||
_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
|
||||
|
||||
|
||||
|
167
libm4.m4
167
libm4.m4
@ -65,140 +65,12 @@ m4exit(2)])
|
||||
## Defining macros and name spaces. ##
|
||||
## --------------------------------- ##
|
||||
|
||||
# Name spaces.
|
||||
|
||||
# Sometimes we want to disable some *set* of macros, and restore them
|
||||
# later. We provide support for this via name spaces.
|
||||
|
||||
# There are basically three characters playing this scene: defining a
|
||||
# macro in a namespace, disabling a namespace, and restoring a namespace
|
||||
# (i.e., all the definitions it holds).
|
||||
|
||||
# Technically, to define a MACRO in NAMESPACE means to define the
|
||||
# macro named `NAMESPACE::MACRO' to the VALUE. At the same time, we
|
||||
# append `undefine(NAME)' in the macro named `m4_disable(NAMESPACE)',
|
||||
# and similarly a binding of NAME to the value of `NAMESPACE::MACRO'
|
||||
# in `m4_enable(NAMESPACE)'. These mechanisms allow to bind the
|
||||
# macro of NAMESPACE and to unbind them at will.
|
||||
|
||||
# Of course this implementation is not really efficient: m4 has to
|
||||
# grow strings which can become quickly huge, which slows it
|
||||
# significantly. A better implementation should be a list of the
|
||||
# symbols associated to the name space, and m4_enable?m4_disable
|
||||
# would just loop over this list. Unfortunately loops of active
|
||||
# symbols are extremely delicate in m4, and I'm still unsure of the
|
||||
# implementation I want. So, until we reach a perfect agreement on
|
||||
# foreach loops implementation, I prefer to use the brute force.
|
||||
|
||||
# It should be noted that one should avoid as much as possible to use
|
||||
# `define' for temporaries. Now that `define' as quite a complex
|
||||
# meaning, it is an expensive operations that should be limited to
|
||||
# macros. Use `m4_define' for temporaries.
|
||||
|
||||
# Private copies of the macros we used in entering / exiting the
|
||||
# libm4 name space. It is much more convenient than fighting with
|
||||
# the renamed version of define etc.
|
||||
|
||||
define([m4_changequote], defn([changequote]))
|
||||
define([m4_define], defn([define]))
|
||||
define([m4_defn], defn([defn]))
|
||||
define([m4_dnl], defn([dnl]))
|
||||
define([m4_indir], defn([indir]))
|
||||
define([m4_popdef], defn([popdef]))
|
||||
define([m4_pushdef], defn([pushdef]))
|
||||
define([m4_undefine], defn([undefine]))
|
||||
|
||||
|
||||
m4_define([m4_namespace_push], [m4_pushdef([m4_namespace], [$1])])
|
||||
m4_define([m4_namespace_pop], [m4_popdef([m4_namespace])])
|
||||
|
||||
m4_namespace_push([libm4])
|
||||
|
||||
|
||||
|
||||
# m4_namespace_register(NAMESPACE, NAME)
|
||||
# --------------------------------------
|
||||
#
|
||||
# Register NAME in NAMESPACE, i.e., append the binding/unbinding in
|
||||
# `m4_disable(NAMESPACE)'/`m4_enable(NAMESPACE)'.
|
||||
m4_define([m4_namespace_register],
|
||||
[m4_define([m4_disable($1)],
|
||||
m4_defn([m4_disable($1)])[m4_undefine([$2])])dnl
|
||||
m4_define([m4_enable($1)],
|
||||
m4_defn([m4_enable($1)])[m4_define([$2], m4_defn([$1::$2]))])dnl
|
||||
])
|
||||
|
||||
|
||||
# m4_namespace_define(NAMESPACE, NAME, VALUE)
|
||||
# -------------------------------------------
|
||||
#
|
||||
# Assign VALUE to NAME in NAMESPACE, and register it.
|
||||
m4_define([m4_namespace_define],
|
||||
[m4_define([$1::$2], [$3])dnl
|
||||
m4_namespace_register([$1], [$2])dnl
|
||||
])
|
||||
|
||||
|
||||
# define(NAME, VALUE)
|
||||
# -------------------
|
||||
#
|
||||
# Assign VALUE to NAME in the current name space, and bind it at top level.
|
||||
m4_define([define],
|
||||
[m4_namespace_define(m4_namespace, [$1], [$2])dnl
|
||||
m4_define([$1], [$2])dnl
|
||||
])
|
||||
|
||||
# Register define too.
|
||||
m4_namespace_define(libm4, [define], defn([define]))
|
||||
|
||||
|
||||
# Put the m4 builtins into the `libm4' name space. We cannot use `define'
|
||||
# here because of the very special handling of `defn' for builtins.
|
||||
|
||||
# The following macro is useless but here, so undefine once done.
|
||||
m4_define(m4_namespace_builtin,
|
||||
[m4_define([libm4::$1], defn([$1]))
|
||||
m4_namespace_register(libm4, [$1])])
|
||||
|
||||
m4_namespace_builtin([builtin])
|
||||
m4_namespace_builtin([changequote])
|
||||
m4_namespace_builtin([defn])
|
||||
m4_namespace_builtin([dnl])
|
||||
m4_namespace_builtin([esyscmd])
|
||||
m4_namespace_builtin([ifdef])
|
||||
m4_namespace_builtin([ifelse])
|
||||
m4_namespace_builtin([indir])
|
||||
m4_namespace_builtin([patsubst])
|
||||
m4_namespace_builtin([popdef])
|
||||
m4_namespace_builtin([pushdef])
|
||||
m4_namespace_builtin([regexp])
|
||||
m4_namespace_builtin([undefine])
|
||||
m4_namespace_builtin([syscmd])
|
||||
m4_namespace_builtin([sysval])
|
||||
|
||||
m4_undefine([m4_namespace_builtin])
|
||||
|
||||
|
||||
# m4_disable(NAMESPACE)
|
||||
# ---------------------
|
||||
#
|
||||
# Undefine all the macros of NAMESPACE.
|
||||
m4_define([m4_disable], [m4_indir([m4_disable($1)])])
|
||||
|
||||
|
||||
# m4_enable(NAMESPACE)
|
||||
# --------------------
|
||||
#
|
||||
# Restore all the macros of NAMESPACE.
|
||||
m4_define([m4_enable], [m4_indir([m4_enable($1)])])
|
||||
|
||||
|
||||
# m4_rename(SRC, DST)
|
||||
# -------------------
|
||||
#
|
||||
# Rename the macro SRC as DST.
|
||||
define([m4_rename],
|
||||
[m4_define([$2], m4_defn([$1]))m4_undefine([$1])])
|
||||
[define([$2], defn([$1]))undefine([$1])])
|
||||
|
||||
# Some m4 internals have names colliding with tokens we might use.
|
||||
# Rename them a` la `m4 --prefix-builtins'.
|
||||
@ -231,6 +103,7 @@ define(m4_fatal,
|
||||
[m4_errprint([error: $1])dnl
|
||||
m4exit(ifelse([$2],, 1, [$2]))])
|
||||
|
||||
|
||||
# m4_assert( EXPRESSION [, EXIT-STATUS = 1 ])
|
||||
# ------------------------------------------
|
||||
# This macro ensures that EXPRESSION evaluates to true, and exits if
|
||||
@ -240,6 +113,7 @@ define([m4_assert],
|
||||
[m4_fatal([assert failed: $1], [$2])],
|
||||
[])])
|
||||
|
||||
|
||||
# We also want to neutralize include (and sinclude for symmetry),
|
||||
# but we want to extend them slightly: warn when a file is included
|
||||
# several times. This is in general a dangerous operation because
|
||||
@ -423,7 +297,7 @@ popdef([$1])])
|
||||
define([_m4_for],
|
||||
[$4[]dnl
|
||||
ifelse($1, [$2], [],
|
||||
[m4_define([$1], m4_eval($1+[$3]))_m4_for([$1], [$2], [$3], [$4])])])
|
||||
[define([$1], m4_eval($1+[$3]))_m4_for([$1], [$2], [$3], [$4])])])
|
||||
|
||||
|
||||
# Implementing `foreach' loops in m4 is much more tricky than it may
|
||||
@ -526,13 +400,12 @@ define([m4_foreach],
|
||||
[pushdef([$1])_m4_foreach($@)popdef([$1])])
|
||||
|
||||
# Low level macros used to define m4_foreach.
|
||||
# Use m4_define for temporaries.
|
||||
define([m4_car], [$1])
|
||||
define([_m4_foreach],
|
||||
[ifelse(m4_quote($2), [], [],
|
||||
[m4_define([$1], [m4_car($2)])$3[]_m4_foreach([$1],
|
||||
[m4_shift($2)],
|
||||
[$3])])])
|
||||
[define([$1], [m4_car($2)])$3[]_m4_foreach([$1],
|
||||
[m4_shift($2)],
|
||||
[$3])])])
|
||||
|
||||
|
||||
## ----------------- ##
|
||||
@ -574,12 +447,7 @@ define([m4_noquote],
|
||||
# obvious reasons (we want to insert square brackets). Outer
|
||||
# changequotes are needed because otherwise the m4 parser, when it
|
||||
# sees the closing bracket we add to the result, believes it is the
|
||||
# end of the body of the macro we define. And since the active quote
|
||||
# when `define' is called are not the ones which were used in its
|
||||
# definition, we cannot use `define' as defined above. Therefore,
|
||||
# using m4's builtin `m4_define', which is indepedent from the
|
||||
# current quotes, to define `m4_split', and then register `m4_split'
|
||||
# in libm4.
|
||||
# end of the body of the macro we define.
|
||||
#
|
||||
# Also, notice that $1 is quoted twice, since we want the result to
|
||||
# be quoted. Then you should understand that the argument of
|
||||
@ -591,7 +459,7 @@ define([m4_noquote],
|
||||
# => [active], [active], []end
|
||||
|
||||
changequote(<<, >>)
|
||||
m4_define(m4_split,
|
||||
define(<<m4_split>>,
|
||||
<<changequote(``, '')dnl
|
||||
[dnl Can't use m4_default here instead of ifelse, because m4_default uses
|
||||
dnl [ and ] as quotes.
|
||||
@ -601,8 +469,6 @@ patsubst(````$1'''',
|
||||
changequote([, ])>>)
|
||||
changequote([, ])
|
||||
|
||||
m4_namespace_register([m4_split], [libm4])
|
||||
|
||||
|
||||
|
||||
# m4_join(STRING)
|
||||
@ -681,7 +547,7 @@ define([m4_strip],
|
||||
# =>
|
||||
# => active
|
||||
define(m4_append,
|
||||
[m4_define([$1],
|
||||
[define([$1],
|
||||
ifdef([$1], [defn([$1])])[$2])])
|
||||
|
||||
|
||||
@ -689,7 +555,7 @@ ifdef([$1], [defn([$1])])[$2])])
|
||||
# ----------------------------------
|
||||
# Same as `m4_append', but each element is separated by `, '.
|
||||
define(m4_list_append,
|
||||
[m4_define([$1],
|
||||
[define([$1],
|
||||
ifdef([$1], [defn([$1]), ])[$2])])
|
||||
|
||||
|
||||
@ -707,13 +573,12 @@ define(m4_foreach_quoted,
|
||||
[pushdef([$1], [])_m4_foreach_quoted($@)popdef([$1])])
|
||||
|
||||
# Low level macros used to define m4_foreach.
|
||||
# Use m4_define for temporaries.
|
||||
define(m4_car_quoted, [[$1]])
|
||||
define(_m4_foreach_quoted,
|
||||
[ifelse($2, [()], ,
|
||||
[m4_define([$1], [m4_car_quoted$2])$3[]_m4_foreach_quoted([$1],
|
||||
[(m4_shift$2)],
|
||||
[$3])])])
|
||||
[define([$1], [m4_car_quoted$2])$3[]_m4_foreach_quoted([$1],
|
||||
[(m4_shift$2)],
|
||||
[$3])])])
|
||||
|
||||
|
||||
# m4_wrap(STRING, [PREFIX], [FIRST-PREFIX], [WIDTH])
|
||||
@ -764,7 +629,7 @@ ifelse(m4_eval(m4_Cursor > len(m4_Prefix)),
|
||||
1, [define([m4_Cursor], len(m4_Prefix))
|
||||
m4_Prefix])[]dnl
|
||||
m4_foreach_quoted([m4_Word], (m4_split(m4_strip(m4_join([$1])))),
|
||||
[m4_define([m4_Cursor], m4_eval(m4_Cursor + len(m4_Word) + 1))dnl
|
||||
[define([m4_Cursor], m4_eval(m4_Cursor + len(m4_Word) + 1))dnl
|
||||
dnl New line if too long, else insert a space unless it is the first
|
||||
dnl of the words.
|
||||
ifelse(m4_eval(m4_Cursor > m4_Width),
|
||||
@ -772,7 +637,7 @@ ifelse(m4_eval(m4_Cursor > m4_Width),
|
||||
m4_Prefix,
|
||||
[m4_Separator])[]dnl
|
||||
m4_Word[]dnl
|
||||
m4_define([m4_Separator], [ ])])dnl
|
||||
define([m4_Separator], [ ])])dnl
|
||||
popdef([m4_Separator])dnl
|
||||
popdef([m4_Cursor])dnl
|
||||
popdef([m4_Width])dnl
|
||||
|
@ -128,8 +128,8 @@ AT_SETUP([AC_CHECK_TYPES])
|
||||
|
||||
AT_DATA(configure.in,
|
||||
[[AC_INIT
|
||||
m4_define([_AC_CHECK_TYPE_NEW], [NEW])
|
||||
m4_define([_AC_CHECK_TYPE_OLD], [OLD])
|
||||
define([_AC_CHECK_TYPE_NEW], [NEW])
|
||||
define([_AC_CHECK_TYPE_OLD], [OLD])
|
||||
#(cut-from-here
|
||||
AC_CHECK_TYPE(ptrdiff_t)
|
||||
AC_CHECK_TYPE(ptrdiff_t, int)
|
||||
|
@ -160,27 +160,27 @@ AT_CLEANUP
|
||||
|
||||
# Check that AC_LINK_FILES and AC_OUTPUT are properly updated.
|
||||
# actest.m4 AU_ defines OSBOLETE to UPDATED.
|
||||
|
||||
AT_SETUP(autoupdate)
|
||||
|
||||
AT_DATA(configure.in,
|
||||
[[AC_INIT
|
||||
dnl The doc says 27 is a valid fubar.
|
||||
fubar=27
|
||||
AC_OUTPUT(Makefile, echo $fubar, fubar=$fubar)
|
||||
]])
|
||||
|
||||
# Checking `autoupdate'.
|
||||
AT_CHECK([../autoupdate -m .. -l $at_srcdir -<configure.in], 0,
|
||||
[[AC_INIT
|
||||
dnl The doc says 27 is a valid fubar.
|
||||
fubar=27
|
||||
AC_CONFIG_FILES(Makefile)
|
||||
AC_CONFIG_COMMANDS(default, [echo $fubar], [fubar=$fubar])
|
||||
AC_OUTPUT
|
||||
]], ignore)
|
||||
|
||||
AT_CLEANUP
|
||||
###FIXME: Disabled until there's a new autoupdate.
|
||||
###AT_SETUP(autoupdate)
|
||||
###
|
||||
###AT_DATA(configure.in,
|
||||
###[[AC_INIT
|
||||
###dnl The doc says 27 is a valid fubar.
|
||||
###fubar=27
|
||||
###AC_OUTPUT(Makefile, echo $fubar, fubar=$fubar)
|
||||
###]])
|
||||
###
|
||||
#### Checking `autoupdate'.
|
||||
###AT_CHECK([../autoupdate -m .. -l $at_srcdir -<configure.in], 0,
|
||||
###[[AC_INIT
|
||||
###dnl The doc says 27 is a valid fubar.
|
||||
###fubar=27
|
||||
###AC_CONFIG_FILES(Makefile)
|
||||
###AC_CONFIG_COMMANDS(default, [echo $fubar], [fubar=$fubar])
|
||||
###AC_OUTPUT
|
||||
###]], ignore)
|
||||
###
|
||||
###AT_CLEANUP
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user