(AC_DIVERT_ONCE): Move to...
* m4sugar.m4 (m4_expand_once): here.
+2001-01-23 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (AC_EXPAND_ONCE): Remove, use m4_expand_once.
+ (AC_DIVERT_ONCE): Move to...
+ * m4sugar.m4 (m4_expand_once): here.
+
2001-01-23 Akim Demaille <akim@epita.fr>
* aclang.m4 (_AC_LANG_SET): Turn off optimizations.
-# AC_DIVERT_ONCE(DIVERSION-NAME, CONTENT)
-# ---------------------------------------
-# Output once CONTENT into DIVERSION-NAME (which may be a number
-# actually). An end of line is appended for free to CONTENT.
-m4_define([AC_DIVERT_ONCE],
-[AC_EXPAND_ONCE([m4_divert_text([$1], [$2])])])
-
-
# AC_DIVERT_PUSH(DIVERSION-NAME)
# AC_DIVERT_POP
# ------------------------------
m4_copy([m4_require], [AC_REQUIRE])
-# AC_EXPAND_ONCE(TEXT)
-# --------------------
-# If TEXT has never been expanded, expand it *here*.
-m4_define([AC_EXPAND_ONCE],
-[m4_expand_once([$1],
- [],
- [AC_PROVIDE([$1])[]$1])])
-
-
# AC_PROVIDE(MACRO-NAME)
# ----------------------
# Ideally we should just use `m4_provide($1)', but unfortunately many
# AC_ARG_ENABLE(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
# ------------------------------------------------------------------------
AC_DEFUN([AC_ARG_ENABLE],
-[AC_DIVERT_ONCE([HELP_ENABLE], [[
+[m4_divert_once([HELP_ENABLE], [[
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]]])dnl
-AC_DIVERT_ONCE([HELP_ENABLE], [$2])dnl
+m4_divert_once([HELP_ENABLE], [$2])dnl
# Check whether --enable-$1 or --disable-$1 was given.
if test "[${enable_]m4_patsubst([$1], -, _)+set}" = set; then
enableval="[$enable_]m4_patsubst([$1], -, _)"
# AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, [ACTION-IF-FALSE])
# --------------------------------------------------------------------
AC_DEFUN([AC_ARG_WITH],
-[AC_DIVERT_ONCE([HELP_WITH], [[
+[m4_divert_once([HELP_WITH], [[
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)]])
-AC_DIVERT_ONCE([HELP_WITH], [$2])dnl
+m4_divert_once([HELP_WITH], [$2])dnl
# Check whether --with-$1 or --without-$1 was given.
if test "[${with_]m4_patsubst([$1], -, _)+set}" = set; then
withval="[$with_]m4_patsubst([$1], -, _)"
# In subsequent runs, after having loaded the cache, compare
# ac_cv_env_foo against ac_env_foo. See _AC_ARG_VAR_VALIDATE.
m4_define([_AC_ARG_VAR_PRECIOUS],
-[AC_DIVERT_ONCE([PARSE_ARGS],
+[m4_divert_once([PARSE_ARGS],
[ac_env_$1_set=${$1+set}
ac_env_$1_value=$$1
ac_cv_env_$1_set=${$1+set}
# Register VARNAME as a precious variable, and document it in
# `configure --help' (but only once).
AC_DEFUN([AC_ARG_VAR],
-[AC_DIVERT_ONCE([HELP_VAR], [
-Some influential environment variables:])dnl
-AC_DIVERT_ONCE([HELP_VAR_END], [
+[m4_divert_once([HELP_VAR], [[
+Some influential environment variables:]])dnl
+m4_divert_once([HELP_VAR_END], [
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.])dnl
-AC_DIVERT_ONCE([HELP_VAR], [AC_HELP_STRING([$1], [$2], [ ])])dnl
+m4_divert_once([HELP_VAR], [AC_HELP_STRING([$1], [$2], [ ])])dnl
_AC_ARG_VAR_PRECIOUS([$1])dnl
])# AC_ARG_VAR
# If VARIABLE has not already been AC_SUBST'ed, append the sed PROGRAM
# to `_AC_SUBST_SED_PROGRAM'.
m4_define([_AC_SUBST],
-[AC_EXPAND_ONCE([m4_append([_AC_SUBST_SED_PROGRAM],
+[m4_expand_once([m4_append([_AC_SUBST_SED_PROGRAM],
[$2
])])dnl
])
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
-AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
-AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
_AC_LANG_COMPILER_WORKS
_AC_LANG_COMPILER_GNU
GCC=`test $ac_compiler_gnu = yes && echo yes`
[g++ c++ gpp aCC CC cxx cc++ cl KCC RCC xlC_r xlC])],
g++)
-AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
-AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
_AC_LANG_COMPILER_WORKS
_AC_LANG_COMPILER_GNU
GXX=`test $ac_compiler_gnu = yes && echo yes`
[m4_default([$1],
[g77 f77 xlf cf77 pgf77 fl32 fort77 f90 xlf90 f95 lf95 pgf90 fc])])
-AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
-AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
_AC_LANG_COMPILER_WORKS
# If we don't use `.F' as extension, the preprocessor is not run on the
# input file.
# --without-x overrides everything else, but does not touch the cache.
AC_DEFUN([AC_PATH_X],
[dnl Document the X abnormal options inherited from history.
-AC_DIVERT_ONCE([HELP_BEGIN], [
+m4_divert_once([HELP_BEGIN], [
X features:
--x-includes=DIR X include files are in DIR
--x-libraries=DIR X library files are in DIR])dnl
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
-AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
-AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
_AC_LANG_COMPILER_WORKS
_AC_LANG_COMPILER_GNU
GCC=`test $ac_compiler_gnu = yes && echo yes`
[g++ c++ gpp aCC CC cxx cc++ cl KCC RCC xlC_r xlC])],
g++)
-AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
-AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
_AC_LANG_COMPILER_WORKS
_AC_LANG_COMPILER_GNU
GXX=`test $ac_compiler_gnu = yes && echo yes`
[m4_default([$1],
[g77 f77 xlf cf77 pgf77 fl32 fort77 f90 xlf90 f95 lf95 pgf90 fc])])
-AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
-AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
_AC_LANG_COMPILER_WORKS
# If we don't use `.F' as extension, the preprocessor is not run on the
# input file.
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
-AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
-AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
_AC_LANG_COMPILER_WORKS
_AC_LANG_COMPILER_GNU
GCC=`test $ac_compiler_gnu = yes && echo yes`
[g++ c++ gpp aCC CC cxx cc++ cl KCC RCC xlC_r xlC])],
g++)
-AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
-AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
_AC_LANG_COMPILER_WORKS
_AC_LANG_COMPILER_GNU
GXX=`test $ac_compiler_gnu = yes && echo yes`
[m4_default([$1],
[g77 f77 xlf cf77 pgf77 fl32 fort77 f90 xlf90 f95 lf95 pgf90 fc])])
-AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
-AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
_AC_LANG_COMPILER_WORKS
# If we don't use `.F' as extension, the preprocessor is not run on the
# input file.
-# AC_DIVERT_ONCE(DIVERSION-NAME, CONTENT)
-# ---------------------------------------
-# Output once CONTENT into DIVERSION-NAME (which may be a number
-# actually). An end of line is appended for free to CONTENT.
-m4_define([AC_DIVERT_ONCE],
-[AC_EXPAND_ONCE([m4_divert_text([$1], [$2])])])
-
-
# AC_DIVERT_PUSH(DIVERSION-NAME)
# AC_DIVERT_POP
# ------------------------------
m4_copy([m4_require], [AC_REQUIRE])
-# AC_EXPAND_ONCE(TEXT)
-# --------------------
-# If TEXT has never been expanded, expand it *here*.
-m4_define([AC_EXPAND_ONCE],
-[m4_expand_once([$1],
- [],
- [AC_PROVIDE([$1])[]$1])])
-
-
# AC_PROVIDE(MACRO-NAME)
# ----------------------
# Ideally we should just use `m4_provide($1)', but unfortunately many
# AC_ARG_ENABLE(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
# ------------------------------------------------------------------------
AC_DEFUN([AC_ARG_ENABLE],
-[AC_DIVERT_ONCE([HELP_ENABLE], [[
+[m4_divert_once([HELP_ENABLE], [[
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]]])dnl
-AC_DIVERT_ONCE([HELP_ENABLE], [$2])dnl
+m4_divert_once([HELP_ENABLE], [$2])dnl
# Check whether --enable-$1 or --disable-$1 was given.
if test "[${enable_]m4_patsubst([$1], -, _)+set}" = set; then
enableval="[$enable_]m4_patsubst([$1], -, _)"
# AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, [ACTION-IF-FALSE])
# --------------------------------------------------------------------
AC_DEFUN([AC_ARG_WITH],
-[AC_DIVERT_ONCE([HELP_WITH], [[
+[m4_divert_once([HELP_WITH], [[
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)]])
-AC_DIVERT_ONCE([HELP_WITH], [$2])dnl
+m4_divert_once([HELP_WITH], [$2])dnl
# Check whether --with-$1 or --without-$1 was given.
if test "[${with_]m4_patsubst([$1], -, _)+set}" = set; then
withval="[$with_]m4_patsubst([$1], -, _)"
# In subsequent runs, after having loaded the cache, compare
# ac_cv_env_foo against ac_env_foo. See _AC_ARG_VAR_VALIDATE.
m4_define([_AC_ARG_VAR_PRECIOUS],
-[AC_DIVERT_ONCE([PARSE_ARGS],
+[m4_divert_once([PARSE_ARGS],
[ac_env_$1_set=${$1+set}
ac_env_$1_value=$$1
ac_cv_env_$1_set=${$1+set}
# Register VARNAME as a precious variable, and document it in
# `configure --help' (but only once).
AC_DEFUN([AC_ARG_VAR],
-[AC_DIVERT_ONCE([HELP_VAR], [
-Some influential environment variables:])dnl
-AC_DIVERT_ONCE([HELP_VAR_END], [
+[m4_divert_once([HELP_VAR], [[
+Some influential environment variables:]])dnl
+m4_divert_once([HELP_VAR_END], [
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.])dnl
-AC_DIVERT_ONCE([HELP_VAR], [AC_HELP_STRING([$1], [$2], [ ])])dnl
+m4_divert_once([HELP_VAR], [AC_HELP_STRING([$1], [$2], [ ])])dnl
_AC_ARG_VAR_PRECIOUS([$1])dnl
])# AC_ARG_VAR
# If VARIABLE has not already been AC_SUBST'ed, append the sed PROGRAM
# to `_AC_SUBST_SED_PROGRAM'.
m4_define([_AC_SUBST],
-[AC_EXPAND_ONCE([m4_append([_AC_SUBST_SED_PROGRAM],
+[m4_expand_once([m4_append([_AC_SUBST_SED_PROGRAM],
[$2
])])dnl
])
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
-AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
-AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
_AC_LANG_COMPILER_WORKS
_AC_LANG_COMPILER_GNU
GCC=`test $ac_compiler_gnu = yes && echo yes`
[g++ c++ gpp aCC CC cxx cc++ cl KCC RCC xlC_r xlC])],
g++)
-AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
-AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
_AC_LANG_COMPILER_WORKS
_AC_LANG_COMPILER_GNU
GXX=`test $ac_compiler_gnu = yes && echo yes`
[m4_default([$1],
[g77 f77 xlf cf77 pgf77 fl32 fort77 f90 xlf90 f95 lf95 pgf90 fc])])
-AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
-AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
_AC_LANG_COMPILER_WORKS
# If we don't use `.F' as extension, the preprocessor is not run on the
# input file.
# --without-x overrides everything else, but does not touch the cache.
AC_DEFUN([AC_PATH_X],
[dnl Document the X abnormal options inherited from history.
-AC_DIVERT_ONCE([HELP_BEGIN], [
+m4_divert_once([HELP_BEGIN], [
X features:
--x-includes=DIR X include files are in DIR
--x-libraries=DIR X library files are in DIR])dnl
])
+# m4_divert_once(DIVERSION-NAME, CONTENT)
+# ---------------------------------------
+# Output once CONTENT into DIVERSION-NAME (which may be a number
+# actually). An end of line is appended for free to CONTENT.
+m4_define([m4_divert_once],
+[m4_expand_once([m4_divert_text([$1], [$2])])])
+
+
# m4_undivert(DIVERSION-NAME)
# ---------------------------
# Undivert DIVERSION-NAME.
])
+# m4_divert_once(DIVERSION-NAME, CONTENT)
+# ---------------------------------------
+# Output once CONTENT into DIVERSION-NAME (which may be a number
+# actually). An end of line is appended for free to CONTENT.
+m4_define([m4_divert_once],
+[m4_expand_once([m4_divert_text([$1], [$2])])])
+
+
# m4_undivert(DIVERSION-NAME)
# ---------------------------
# Undivert DIVERSION-NAME.