* m4sugar.m4 (m4_divert, divert, undivert): Rename as...
(m4_divert_text, m4_divert, m4_undivert): this.
* autoconf.m4 (divert, undivert): Restore them for user macros only.
+2000-11-23 Akim Demaille <akim@epita.fr>
+
+ Move divert and undivert into m4_.
+
+ * m4sugar.m4 (m4_divert, divert, undivert): Rename as...
+ (m4_divert_text, m4_divert, m4_undivert): this.
+ * autoconf.m4 (divert, undivert): Restore them for user macros only.
+
2000-11-23 Akim Demaille <akim@epita.fr>
Move Autotest on top of M4sh.
# 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([$1], [$2])])])
+[AC_EXPAND_ONCE([m4_divert_text([$1], [$2])])])
# AC_DIVERT_PUSH(DIVERSION-NAME)
#
# m4_patsubst(m4_quote($1), [^], [# ])
m4_define([AC_COPYRIGHT],
-[m4_divert([NOTICE],
+[m4_divert_text([NOTICE],
[m4_patsubst([
$1], [^], [@%:@ ])])dnl
-m4_divert([VERSION_BEGIN],
+m4_divert_text([VERSION_BEGIN],
[
$1])dnl
])# AC_COPYRIGHT
# The second quote in the translit is just to cope with font-lock-mode
# which sees the opening of a string.
m4_define([AC_REVISION],
-[m4_divert([REVISION],
- [@%:@ From __file__ m4_translit([$1], [$""]).])dnl
+[m4_divert_text([REVISION],
+ [@%:@ From __file__ m4_translit([$1], [$""]).])dnl
])
# _AC_INIT_NOTICE
# ---------------
m4_define([_AC_INIT_NOTICE],
-[m4_divert([NOTICE],
+[m4_divert_text([NOTICE],
[@%:@ Guess values for system-dependent variables and create Makefiles.
@%:@ Generated by Autoconf AC_ACVERSION[]dnl
ifset([AC_PACKAGE_STRING], [ for AC_PACKAGE_STRING]).])
ifset([AC_PACKAGE_BUGREPORT],
- [m4_divert([NOTICE],
- [@%:@
+ [m4_divert_text([NOTICE],
+ [@%:@
@%:@ Report bugs to <AC_PACKAGE_BUGREPORT>.])])
])
# AC_PREFIX_DEFAULT(PREFIX)
# -------------------------
AC_DEFUN([AC_PREFIX_DEFAULT],
-[m4_divert([DEFAULTS], [ac_default_prefix=$1])])
+[m4_divert_text([DEFAULTS], [ac_default_prefix=$1])])
# AC_CONFIG_SRCDIR([UNIQUE-FILE-IN-SOURCE-DIR])
# relative to the directory that configure is in, which we can look
# for to find out if srcdir is correct.
AC_DEFUN([AC_CONFIG_SRCDIR],
-[m4_divert([DEFAULTS], [ac_unique_file="$1"])])
+[m4_divert_text([DEFAULTS], [ac_unique_file="$1"])])
# _AC_INIT_SRCDIR
# ----------------
# Handle the `configure --version' message.
m4_define([_AC_INIT_VERSION],
-[m4_divert([VERSION_BEGIN],
+[m4_divert_text([VERSION_BEGIN],
[if $ac_init_version; then
cat <<\EOF])dnl
ifset([AC_PACKAGE_STRING],
-[m4_divert([VERSION_BEGIN],
- [configure (AC_PACKAGE_STRING) AC_ACVERSION])])
-m4_divert([VERSION_END],
+[m4_divert_text([VERSION_BEGIN],
+ [configure (AC_PACKAGE_STRING) AC_ACVERSION])])
+m4_divert_text([VERSION_END],
[EOF
exit 0
fi])dnl
# AC_CONFIG_SRCDIR.
m4_define([AC_INIT],
[ifval([$2], [_AC_INIT_PACKAGE($@)])dnl
-m4_divert([BINSH], [@%:@! /bin/sh])
+m4_divert_text([BINSH], [@%:@! /bin/sh])
_AC_INIT_DEFAULTS()dnl
m4_divert_pop()dnl to BODY
_AC_INIT_PARSE_ARGS
# ------------------
AC_DEFUN_ONCE([AC_CANONICAL_BUILD],
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-m4_divert([HELP_CANON],
+m4_divert_text([HELP_CANON],
[[
System types:
--build=BUILD configure for building on BUILD [guessed]]])dnl
# -----------------
AC_DEFUN_ONCE([AC_CANONICAL_HOST],
[AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-m4_divert([HELP_CANON],
+m4_divert_text([HELP_CANON],
[[ --host=HOST build programs to run on HOST [BUILD]]])dnl
AC_CACHE_CHECK([host system type], [ac_cv_host],
[ac_cv_host_alias=$host_alias
AC_DEFUN_ONCE([AC_CANONICAL_TARGET],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_BEFORE([$0], [AC_ARG_PROGRAM])dnl
-m4_divert([HELP_CANON],
+m4_divert_text([HELP_CANON],
[[ --target=TARGET configure for building compilers for TARGET [HOST]]])dnl
AC_CACHE_CHECK([target system type], [ac_cv_target],
[dnl Set target_alias.
AC_VAR_INDIR_IFELSE([$1],
[AC_DIAGNOSE(syntax,
[$0: you should use literals])])
-m4_divert([DEFAULTS], [ac_subdirs_all="$ac_subdirs_all $1"])
+m4_divert_text([DEFAULTS], [ac_subdirs_all="$ac_subdirs_all $1"])
AC_SUBST(subdirs, "$subdirs $1")dnl
])
m4_copy_unm4([m4_decr])
m4_copy_unm4([m4_define])
m4_copy_unm4([m4_defn])
+m4_copy_unm4([m4_divert])
m4_copy_unm4([m4_incr])
m4_copy_unm4([m4_index])
m4_copy_unm4([m4_indir])
m4_copy_unm4([m4_traceon])
m4_copy_unm4([m4_translit])
m4_copy_unm4([m4_undefine])
+m4_copy_unm4([m4_undivert])
m4_copy_unm4([m4_decr])
m4_copy_unm4([m4_define])
m4_copy_unm4([m4_defn])
+m4_copy_unm4([m4_divert])
m4_copy_unm4([m4_incr])
m4_copy_unm4([m4_index])
m4_copy_unm4([m4_indir])
m4_copy_unm4([m4_traceon])
m4_copy_unm4([m4_translit])
m4_copy_unm4([m4_undefine])
+m4_copy_unm4([m4_undivert])
# 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([$1], [$2])])])
+[AC_EXPAND_ONCE([m4_divert_text([$1], [$2])])])
# AC_DIVERT_PUSH(DIVERSION-NAME)
#
# m4_patsubst(m4_quote($1), [^], [# ])
m4_define([AC_COPYRIGHT],
-[m4_divert([NOTICE],
+[m4_divert_text([NOTICE],
[m4_patsubst([
$1], [^], [@%:@ ])])dnl
-m4_divert([VERSION_BEGIN],
+m4_divert_text([VERSION_BEGIN],
[
$1])dnl
])# AC_COPYRIGHT
# The second quote in the translit is just to cope with font-lock-mode
# which sees the opening of a string.
m4_define([AC_REVISION],
-[m4_divert([REVISION],
- [@%:@ From __file__ m4_translit([$1], [$""]).])dnl
+[m4_divert_text([REVISION],
+ [@%:@ From __file__ m4_translit([$1], [$""]).])dnl
])
# _AC_INIT_NOTICE
# ---------------
m4_define([_AC_INIT_NOTICE],
-[m4_divert([NOTICE],
+[m4_divert_text([NOTICE],
[@%:@ Guess values for system-dependent variables and create Makefiles.
@%:@ Generated by Autoconf AC_ACVERSION[]dnl
ifset([AC_PACKAGE_STRING], [ for AC_PACKAGE_STRING]).])
ifset([AC_PACKAGE_BUGREPORT],
- [m4_divert([NOTICE],
- [@%:@
+ [m4_divert_text([NOTICE],
+ [@%:@
@%:@ Report bugs to <AC_PACKAGE_BUGREPORT>.])])
])
# AC_PREFIX_DEFAULT(PREFIX)
# -------------------------
AC_DEFUN([AC_PREFIX_DEFAULT],
-[m4_divert([DEFAULTS], [ac_default_prefix=$1])])
+[m4_divert_text([DEFAULTS], [ac_default_prefix=$1])])
# AC_CONFIG_SRCDIR([UNIQUE-FILE-IN-SOURCE-DIR])
# relative to the directory that configure is in, which we can look
# for to find out if srcdir is correct.
AC_DEFUN([AC_CONFIG_SRCDIR],
-[m4_divert([DEFAULTS], [ac_unique_file="$1"])])
+[m4_divert_text([DEFAULTS], [ac_unique_file="$1"])])
# _AC_INIT_SRCDIR
# ----------------
# Handle the `configure --version' message.
m4_define([_AC_INIT_VERSION],
-[m4_divert([VERSION_BEGIN],
+[m4_divert_text([VERSION_BEGIN],
[if $ac_init_version; then
cat <<\EOF])dnl
ifset([AC_PACKAGE_STRING],
-[m4_divert([VERSION_BEGIN],
- [configure (AC_PACKAGE_STRING) AC_ACVERSION])])
-m4_divert([VERSION_END],
+[m4_divert_text([VERSION_BEGIN],
+ [configure (AC_PACKAGE_STRING) AC_ACVERSION])])
+m4_divert_text([VERSION_END],
[EOF
exit 0
fi])dnl
# AC_CONFIG_SRCDIR.
m4_define([AC_INIT],
[ifval([$2], [_AC_INIT_PACKAGE($@)])dnl
-m4_divert([BINSH], [@%:@! /bin/sh])
+m4_divert_text([BINSH], [@%:@! /bin/sh])
_AC_INIT_DEFAULTS()dnl
m4_divert_pop()dnl to BODY
_AC_INIT_PARSE_ARGS
# ------------------
AC_DEFUN_ONCE([AC_CANONICAL_BUILD],
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-m4_divert([HELP_CANON],
+m4_divert_text([HELP_CANON],
[[
System types:
--build=BUILD configure for building on BUILD [guessed]]])dnl
# -----------------
AC_DEFUN_ONCE([AC_CANONICAL_HOST],
[AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-m4_divert([HELP_CANON],
+m4_divert_text([HELP_CANON],
[[ --host=HOST build programs to run on HOST [BUILD]]])dnl
AC_CACHE_CHECK([host system type], [ac_cv_host],
[ac_cv_host_alias=$host_alias
AC_DEFUN_ONCE([AC_CANONICAL_TARGET],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_BEFORE([$0], [AC_ARG_PROGRAM])dnl
-m4_divert([HELP_CANON],
+m4_divert_text([HELP_CANON],
[[ --target=TARGET configure for building compilers for TARGET [HOST]]])dnl
AC_CACHE_CHECK([target system type], [ac_cv_target],
[dnl Set target_alias.
AC_VAR_INDIR_IFELSE([$1],
[AC_DIAGNOSE(syntax,
[$0: you should use literals])])
-m4_divert([DEFAULTS], [ac_subdirs_all="$ac_subdirs_all $1"])
+m4_divert_text([DEFAULTS], [ac_subdirs_all="$ac_subdirs_all $1"])
AC_SUBST(subdirs, "$subdirs $1")dnl
])
# Begin testing suite, using PROGRAM to check version. The search path
# should be already preset so the proper executable will be selected.
AT_DEFINE([AT_INIT],
-[AT_DEFINE(AT_ordinal, 0)
+[AT_DEFINE([AT_ordinal], 0)
. ./atconfig
# Snippet (3
# -e sets to true
at_failed_list=
at_ignore_count=0
-divert(2)[]dnl
+m4_divert(2)[]dnl
# Wrap up the testing suite with summary statistics.
fi
exit 0
-divert[]dnl
+m4_divert[]dnl
])# AT_INIT
m4_pushdef([AT_data_expout], )
m4_pushdef([AT_data_experr], )
if $at_stop_on_error && test -n "$at_failed_list"; then :; else
-divert(1)[]dnl
+m4_divert(1)[]dnl
echo AT_LINE > at-check-line
echo AT_LINE > at-setup-line
if $at_verbose; then
fi
at_test_count=AT_ordinal
if $at_stop_on_error && test -n "$at_failed_list"; then :; else
-divert(0)[]dnl
+m4_divert(0)[]dnl
[#] Snippet (c[]AT_ordinal[](
rm ifelse([AT_data_files$1], , [-f], [-rf[]AT_data_files[]ifelse($1, , , [ $1])]) stdout stderr[]AT_data_expout[]AT_data_experr
[#] Snippet )c[]AT_ordinal[])
-undivert(1)[]dnl
+m4_undivert(1)[]dnl
rm ifelse([AT_data_files$1], , [-f], [-rf[]AT_data_files[]ifelse($1, , , [ $1])]) stdout stderr[]AT_data_expout[]AT_data_experr
fi
fi
])# AT_CHECK
-divert(0)dnl
+m4_divert(0)dnl
m4_rename_m4([debugfile])
m4_rename_m4([debugmode])
m4_rename_m4([decr])
+m4_rename_m4([divert])
m4_rename_m4([dumpdef])
m4_rename_m4([eval])
m4_rename_m4([format])
m4_rename_m4([traceoff])
m4_rename_m4([traceon])
m4_rename_m4([translit])
+m4_rename_m4([undivert])
## ------------------- ##
# Change the diversion stream to DIVERSION-NAME, while stacking old values.
m4_define([m4_divert_push],
[m4_pushdef([_m4_divert_diversion], _m4_divert([$1]))dnl
-divert(_m4_divert_diversion)dnl
+m4_divert(_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
+m4_divert(_m4_divert_diversion)dnl
])
-# m4_divert(DIVERSION-NAME, CONTENT)
-# ----------------------------------
+# m4_divert_text(DIVERSION-NAME, CONTENT)
+# ---------------------------------------
# Output CONTENT into DIVERSION-NAME (which may be a number actually).
# An end of line is appended for free to CONTENT.
-m4_define([m4_divert],
+m4_define([m4_divert_text],
[m4_divert_push([$1])dnl
$2
m4_divert_pop()dnl
m4_define([_m4_defun_epi],
[m4_divert_pop()dnl
ifelse(_m4_divert_dump, _m4_divert_diversion,
- [undivert(_m4_divert([GROW]))dnl
+ [m4_undivert(_m4_divert([GROW]))dnl
m4_undefine([_m4_divert_dump])])dnl
m4_popdef([_m4_expansion_stack])dnl
m4_popdef([_m4_expanding($1)])dnl
[],
[m4_divert_push(m4_eval(_m4_divert_diversion - 1))dnl
m4_default([$2], [$1])
-divert(_m4_divert_dump)undivert(_m4_divert_diversion)dnl
+m4_divert(_m4_divert_dump)m4_undivert(_m4_divert_diversion)dnl
m4_divert_pop()])dnl
m4_provide_ifelse([$1],
[],
m4_rename_m4([debugfile])
m4_rename_m4([debugmode])
m4_rename_m4([decr])
+m4_rename_m4([divert])
m4_rename_m4([dumpdef])
m4_rename_m4([eval])
m4_rename_m4([format])
m4_rename_m4([traceoff])
m4_rename_m4([traceon])
m4_rename_m4([translit])
+m4_rename_m4([undivert])
## ------------------- ##
# Change the diversion stream to DIVERSION-NAME, while stacking old values.
m4_define([m4_divert_push],
[m4_pushdef([_m4_divert_diversion], _m4_divert([$1]))dnl
-divert(_m4_divert_diversion)dnl
+m4_divert(_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
+m4_divert(_m4_divert_diversion)dnl
])
-# m4_divert(DIVERSION-NAME, CONTENT)
-# ----------------------------------
+# m4_divert_text(DIVERSION-NAME, CONTENT)
+# ---------------------------------------
# Output CONTENT into DIVERSION-NAME (which may be a number actually).
# An end of line is appended for free to CONTENT.
-m4_define([m4_divert],
+m4_define([m4_divert_text],
[m4_divert_push([$1])dnl
$2
m4_divert_pop()dnl
m4_define([_m4_defun_epi],
[m4_divert_pop()dnl
ifelse(_m4_divert_dump, _m4_divert_diversion,
- [undivert(_m4_divert([GROW]))dnl
+ [m4_undivert(_m4_divert([GROW]))dnl
m4_undefine([_m4_divert_dump])])dnl
m4_popdef([_m4_expansion_stack])dnl
m4_popdef([_m4_expanding($1)])dnl
[],
[m4_divert_push(m4_eval(_m4_divert_diversion - 1))dnl
m4_default([$2], [$1])
-divert(_m4_divert_dump)undivert(_m4_divert_diversion)dnl
+m4_divert(_m4_divert_dump)m4_undivert(_m4_divert_diversion)dnl
m4_divert_pop()])dnl
m4_provide_ifelse([$1],
[],
check-local: atconfig testsuite
$(SHELL) testsuite
-testsuite: atgeneral.m4 atspecific.m4 $(SUITE)
+testsuite: $(top_srcdir)/m4sugar.m4 $(top_srcdir)/m4sh.m4 \
+ atgeneral.m4 atspecific.m4 \
+ $(SUITE)
$(M4) -I $(srcdir) -I $(top_srcdir) atspecific.m4 suite.at | \
sed -e 's/[ ]*$$//' | \
sed -e '/^$$/N;/\n$$/D' > $@-tmp
check-local: atconfig testsuite
$(SHELL) testsuite
-testsuite: atgeneral.m4 atspecific.m4 $(SUITE)
+testsuite: $(top_srcdir)/m4sugar.m4 $(top_srcdir)/m4sh.m4 \
+ atgeneral.m4 atspecific.m4 \
+ $(SUITE)
$(M4) -I $(srcdir) -I $(top_srcdir) atspecific.m4 suite.at | \
sed -e 's/[ ]*$$//' | \
sed -e '/^$$/N;/\n$$/D' > $@-tmp
# Begin testing suite, using PROGRAM to check version. The search path
# should be already preset so the proper executable will be selected.
AT_DEFINE([AT_INIT],
-[AT_DEFINE(AT_ordinal, 0)
+[AT_DEFINE([AT_ordinal], 0)
. ./atconfig
# Snippet (3
# -e sets to true
at_failed_list=
at_ignore_count=0
-divert(2)[]dnl
+m4_divert(2)[]dnl
# Wrap up the testing suite with summary statistics.
fi
exit 0
-divert[]dnl
+m4_divert[]dnl
])# AT_INIT
m4_pushdef([AT_data_expout], )
m4_pushdef([AT_data_experr], )
if $at_stop_on_error && test -n "$at_failed_list"; then :; else
-divert(1)[]dnl
+m4_divert(1)[]dnl
echo AT_LINE > at-check-line
echo AT_LINE > at-setup-line
if $at_verbose; then
fi
at_test_count=AT_ordinal
if $at_stop_on_error && test -n "$at_failed_list"; then :; else
-divert(0)[]dnl
+m4_divert(0)[]dnl
[#] Snippet (c[]AT_ordinal[](
rm ifelse([AT_data_files$1], , [-f], [-rf[]AT_data_files[]ifelse($1, , , [ $1])]) stdout stderr[]AT_data_expout[]AT_data_experr
[#] Snippet )c[]AT_ordinal[])
-undivert(1)[]dnl
+m4_undivert(1)[]dnl
rm ifelse([AT_data_files$1], , [-f], [-rf[]AT_data_files[]ifelse($1, , , [ $1])]) stdout stderr[]AT_data_expout[]AT_data_experr
fi
fi
])# AT_CHECK
-divert(0)dnl
+m4_divert(0)dnl
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
-include(atgeneral.m4)divert(-1)
+include(atgeneral.m4)m4_divert(-1)
AT_DEFINE(AT_CHECK_DEFINES,
[AT_CHECK([[fgrep '#' config.h | grep -v 'STDC_HEADERS']],, [$1])])
-divert(0)dnl
+m4_divert(0)dnl