(m4_if): this.
* autoconf.m4 (ifelse): Restore.
+2000-12-06 Akim Demaille <akim@epita.fr>
+
+ * m4sugar.m4 (ifelse): Rename as...
+ (m4_if): this.
+ * autoconf.m4 (ifelse): Restore.
+
2000-12-06 Akim Demaille <akim@epita.fr>
* m4sugar.m4 (m4_dquote, m4_pattern_forbid, m4_pattern_allow)
# If EXPRESSION has shell indirections ($var or `expr`), expand
# IF-INDIR, else IF-NOT-INDIR.
m4_define([AC_VAR_INDIR_IFELSE],
-[ifelse(m4_regexp([$1], [[`$]]),
- -1, [$3],
- [$2])])
+[m4_if(m4_regexp([$1], [[`$]]),
+ -1, [$3],
+ [$2])])
# AC_VAR_SET(VARIABLE, VALUE)
# ---------------------------
# occurrences with the current version of Autoconf, which is certainly
# not what mean the user.
AU_DEFUN([AC_PREREQ],
-[ifelse(m4_version_compare(]m4_defn([AC_ACVERSION])[, [$1]), -1,
+[m4_if(m4_version_compare(]m4_defn([AC_ACVERSION])[, [$1]), -1,
[m4_fatal([Autoconf version $1 or higher is required for this script])])dnl
[AC_PREREQ(]]m4_defn([AC_ACVERSION])[[)]])
# ------------------
# Complain and exit if the Autoconf version is less than VERSION.
m4_define([AC_PREREQ],
-[ifelse(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1,
+[m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1,
[AC_FATAL([Autoconf version $1 or higher is required for this script])])])
# The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
# Should be dnl'ed. Try to catch common mistakes.
m4_define([AC_CACHE_VAL],
-[ifelse(m4_regexp([$2], [AC_DEFINE]), [-1], [],
- [AC_DIAGNOSE(syntax,
+[m4_if(m4_regexp([$2], [AC_DEFINE]), [-1], [],
+ [AC_DIAGNOSE(syntax,
[$0($1, ...): suspicious presence of an AC_DEFINE in the second argument, ]dnl
[where no actions should be taken])])dnl
AC_VAR_SET_IFELSE([$1],
[AC_DEFINE_TRACE([$1])dnl
m4_ifval([$3], [AH_TEMPLATE([$1], [$3])])dnl
cat >>confdefs.h <<\EOF
-[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
+[@%:@define] $1 m4_if($#, 2, [$2], $#, 3, [$2], 1)
EOF
])
[AC_DEFINE_TRACE([$1])dnl
m4_ifval([$3], [AH_TEMPLATE([$1], [$3])])dnl
cat >>confdefs.h <<EOF
-[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
+[@%:@define] $1 m4_if($#, 2, [$2], $#, 3, [$2], 1)
EOF
])
# brokenness of AC_TRY_COMPILE, we are doomed to leave a extra new
# line here.
m4_define([AC_INCLUDES_DEFAULT],
-[ifelse([$1], [], [$ac_includes_default], [$1
-])])
+[m4_ifval([$1], [$1
+],
+ [$ac_includes_default])])
AC_DEFUN([AC_CHECK_MEMBER],
[AC_VAR_INDIR_IFELSE([$1],
[AC_FATAL([$0: requires literal arguments])])dnl
-ifelse(m4_regexp([$1], [\.]), -1,
- [AC_FATAL([$0: Did not see any dot in `$1'])])dnl
+m4_if(m4_regexp([$1], [\.]), -1,
+ [AC_FATAL([$0: Did not see any dot in `$1'])])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_VAR_PUSHDEF([ac_Member], [ac_cv_member_$1])dnl
dnl Extract the aggregate name, and the member name
set dummy "$ac_dir/$ac_word" ${1+"$[@]"}
shift
ac_cv_prog_$1="$[@]"
-ifelse([$2], [$4],
+m4_if([$2], [$4],
[ else
# Default is a loser.
AC_MSG_ERROR([$1=$6 unacceptable, but no other $4 found in dnl
# Because many people have used `off_t' and `size_t' too, they are added
# for better common-useward backward compatibility.
m4_define([_AC_CHECK_TYPE_REPLACEMENT_TYPE_P],
-[ifelse(m4_regexp([$1],
- [^\(_Bool\|bool\|char\|double\|float\|int\|long\|short\|\(un\)?signed\|size_t\|off_t\)\([_a-zA-Z0-9() *]\|\[\|\]\)*$]),
- 0, 1, 0)dnl
+[m4_if(m4_regexp([$1],
+ [^\(_Bool\|bool\|char\|double\|float\|int\|long\|short\|\(un\)?signed\|size_t\|off_t\)\([_a-zA-Z0-9() *]\|\[\|\]\)*$]),
+ 0, 1, 0)dnl
])# _AC_CHECK_TYPE_REPLACEMENT_TYPE_P
# -----------------------------------
# Return `1' if STRING looks like a C/C++ type.
m4_define([_AC_CHECK_TYPE_MAYBE_TYPE_P],
-[ifelse(m4_regexp([$1], [^[_a-zA-Z0-9 ]+\([_a-zA-Z0-9() *]\|\[\|\]\)*$]),
- 0, 1, 0)dnl
+[m4_if(m4_regexp([$1], [^[_a-zA-Z0-9 ]+\([_a-zA-Z0-9() *]\|\[\|\]\)*$]),
+ 0, 1, 0)dnl
])# _AC_CHECK_TYPE_MAYBE_TYPE_P
# 3. $2 seems to be a type => NEW plus a warning
# 4. default => NEW
AC_DEFUN([AC_CHECK_TYPE],
-[ifelse($#, 3,
- [_AC_CHECK_TYPE_NEW($@)],
- $#, 4,
- [_AC_CHECK_TYPE_NEW($@)],
- _AC_CHECK_TYPE_REPLACEMENT_TYPE_P([$2]), 1,
- [_AC_CHECK_TYPE_OLD($@)],
- _AC_CHECK_TYPE_MAYBE_TYPE_P([$2]), 1,
- [AC_DIAGNOSE([syntax],
+[m4_if($#, 3,
+ [_AC_CHECK_TYPE_NEW($@)],
+ $#, 4,
+ [_AC_CHECK_TYPE_NEW($@)],
+ _AC_CHECK_TYPE_REPLACEMENT_TYPE_P([$2]), 1,
+ [_AC_CHECK_TYPE_OLD($@)],
+ _AC_CHECK_TYPE_MAYBE_TYPE_P([$2]), 1,
+ [AC_DIAGNOSE([syntax],
[$0: assuming `$2' is not a type])_AC_CHECK_TYPE_NEW($@)],
- [_AC_CHECK_TYPE_NEW($@)])[]dnl
+ [_AC_CHECK_TYPE_NEW($@)])[]dnl
])# AC_CHECK_TYPE
# matching. The big problem is then that the active characters should
# be quoted. Currently `+*.' are quoted.
m4_define([AC_CONFIG_IF_MEMBER],
-[ifelse(m4_regexp($2, [\(^\| \)]m4_patsubst([$1],
- [\([+*.]\)], [\\\1])[\(:\| \|$\)]),
- -1, [$4], [$3])])
+[m4_if(m4_regexp($2, [\(^\| \)]m4_patsubst([$1],
+ [\([+*.]\)], [\\\1])[\(:\| \|$\)]),
+ -1, [$4], [$3])])
# AC_FILE_DEPENDENCY_TRACE(DEST, SOURCE1, [SOURCE2...])
_AC_CONFIG_UNIQUE([$1])
m4_append([AC_LIST_COMMANDS], [ $1])
-ifelse([$2],,, [AC_FOREACH([AC_Name], [$1],
+m4_if([$2],,, [AC_FOREACH([AC_Name], [$1],
[m4_append([AC_LIST_COMMANDS_COMMANDS],
[ ]m4_patsubst(AC_Name, [:.*])[ ) $2 ;;
])])])
_AC_CONFIG_DEPENDENCIES([$1])
m4_append([AC_LIST_HEADERS], [ $1])
dnl Register the commands
-ifelse([$2],,, [AC_FOREACH([AC_File], [$1],
+m4_ifval([$2], [AC_FOREACH([AC_File], [$1],
[m4_append([AC_LIST_HEADERS_COMMANDS],
[ ]m4_patsubst(AC_File, [:.*])[ ) $2 ;;
])])])
[m4_divert_push([KILL])
_AC_CONFIG_UNIQUE([$1])
_AC_CONFIG_DEPENDENCIES([$1])
-ifelse(m4_regexp([$1], [^\.:\| \.:]), -1,,
- [AC_FATAL([$0: invalid destination: `.'])])
+m4_if(m4_regexp([$1], [^\.:\| \.:]), -1,,
+ [AC_FATAL([$0: invalid destination: `.'])])
m4_append([AC_LIST_LINKS], [ $1])
dnl Register the commands
-ifelse([$2],,, [AC_FOREACH([AC_File], [$1],
+m4_ifval([$2], [AC_FOREACH([AC_File], [$1],
[m4_append([AC_LIST_LINKS_COMMANDS],
[ ]m4_patsubst(AC_File, [:.*])[ ) $2 ;;
])])])
#
# _AC_LINK_CNT is used to be robust to multiple calls.
AU_DEFUN([AC_LINK_FILES],
-[ifelse($#, 2, ,
- [m4_fatal([$0: incorrect number of arguments])])dnl
+[m4_if($#, 2, ,
+ [m4_fatal([$0: incorrect number of arguments])])dnl
m4_define([_AC_LINK_FILES_CNT], m4_incr(_AC_LINK_FILES_CNT))dnl
ac_sources="$1"
ac_dests="$2"
_AC_CONFIG_DEPENDENCIES([$1])
m4_append([AC_LIST_FILES], [ $1])
dnl Register the commands.
-ifelse([$2],,, [AC_FOREACH([AC_File], [$1],
+m4_ifval([$2], [AC_FOREACH([AC_File], [$1],
[m4_append([AC_LIST_FILES_COMMANDS],
[ ]m4_patsubst(AC_File, [:.*])[ ) $2 ;;
])])])
# ACTION-IF-NOT-FOUND.
AC_DEFUN([AC_LIST_MEMBER_OF],
[dnl Do some sanity checking of the arguments.
-ifelse([$1], , [AC_FATAL([$0]: missing argument 1)])dnl
-ifelse([$2], , [AC_FATAL([$0]: missing argument 2)])dnl
+m4_if([$1], , [AC_FATAL([$0]: missing argument 1)])dnl
+m4_if([$2], , [AC_FATAL([$0]: missing argument 2)])dnl
ac_exists=false
for ac_i in $2; do
# Restore the previous language.
m4_define([AC_LANG_POP],
[m4_popdef([_AC_LANG])dnl
-ifelse(_AC_LANG, [_AC_LANG],
- [AC_FATAL([too many $0])])dnl
+m4_if(_AC_LANG, [_AC_LANG], [AC_FATAL([too many $0])])dnl
AC_LANG(_AC_LANG)])
# Avoid conflicting decl of main.
m4_define([AC_LANG_CALL(C)],
[AC_LANG_PROGRAM([$1
-ifelse([$2], [main], ,
+m4_if([$2], [main], ,
[/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
*) ac_val="unknown" ;;
esac
case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac
-ifelse(m4_index([$1],[_]),-1,[],
+m4_if(m4_index([$1],[_]),-1,[],
[case $ac_cv_f77_mangling in *," extra underscore"*) ac_val="$ac_val"_ ;; esac
])
m4_default([$2],[$1])="$ac_val"
m4_copy_unm4([m4_errprint])
m4_copy_unm4([m4_esyscmd])
m4_copy_unm4([m4_ifdef])
+m4_copy([m4_if], [ifelse])
m4_copy_unm4([m4_incr])
m4_copy_unm4([m4_index])
m4_copy_unm4([m4_indir])
m4_copy_unm4([m4_errprint])
m4_copy_unm4([m4_esyscmd])
m4_copy_unm4([m4_ifdef])
+m4_copy([m4_if], [ifelse])
m4_copy_unm4([m4_incr])
m4_copy_unm4([m4_index])
m4_copy_unm4([m4_indir])
# Restore the previous language.
m4_define([AC_LANG_POP],
[m4_popdef([_AC_LANG])dnl
-ifelse(_AC_LANG, [_AC_LANG],
- [AC_FATAL([too many $0])])dnl
+m4_if(_AC_LANG, [_AC_LANG], [AC_FATAL([too many $0])])dnl
AC_LANG(_AC_LANG)])
# Avoid conflicting decl of main.
m4_define([AC_LANG_CALL(C)],
[AC_LANG_PROGRAM([$1
-ifelse([$2], [main], ,
+m4_if([$2], [main], ,
[/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
*) ac_val="unknown" ;;
esac
case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac
-ifelse(m4_index([$1],[_]),-1,[],
+m4_if(m4_index([$1],[_]),-1,[],
[case $ac_cv_f77_mangling in *," extra underscore"*) ac_val="$ac_val"_ ;; esac
])
m4_default([$2],[$1])="$ac_val"
# Restore the previous language.
m4_define([AC_LANG_POP],
[m4_popdef([_AC_LANG])dnl
-ifelse(_AC_LANG, [_AC_LANG],
- [AC_FATAL([too many $0])])dnl
+m4_if(_AC_LANG, [_AC_LANG], [AC_FATAL([too many $0])])dnl
AC_LANG(_AC_LANG)])
# Avoid conflicting decl of main.
m4_define([AC_LANG_CALL(C)],
[AC_LANG_PROGRAM([$1
-ifelse([$2], [main], ,
+m4_if([$2], [main], ,
[/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
*) ac_val="unknown" ;;
esac
case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac
-ifelse(m4_index([$1],[_]),-1,[],
+m4_if(m4_index([$1],[_]),-1,[],
[case $ac_cv_f77_mangling in *," extra underscore"*) ac_val="$ac_val"_ ;; esac
])
m4_default([$2],[$1])="$ac_val"
# If EXPRESSION has shell indirections ($var or `expr`), expand
# IF-INDIR, else IF-NOT-INDIR.
m4_define([AC_VAR_INDIR_IFELSE],
-[ifelse(m4_regexp([$1], [[`$]]),
- -1, [$3],
- [$2])])
+[m4_if(m4_regexp([$1], [[`$]]),
+ -1, [$3],
+ [$2])])
# AC_VAR_SET(VARIABLE, VALUE)
# ---------------------------
# occurrences with the current version of Autoconf, which is certainly
# not what mean the user.
AU_DEFUN([AC_PREREQ],
-[ifelse(m4_version_compare(]m4_defn([AC_ACVERSION])[, [$1]), -1,
+[m4_if(m4_version_compare(]m4_defn([AC_ACVERSION])[, [$1]), -1,
[m4_fatal([Autoconf version $1 or higher is required for this script])])dnl
[AC_PREREQ(]]m4_defn([AC_ACVERSION])[[)]])
# ------------------
# Complain and exit if the Autoconf version is less than VERSION.
m4_define([AC_PREREQ],
-[ifelse(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1,
+[m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1,
[AC_FATAL([Autoconf version $1 or higher is required for this script])])])
# The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
# Should be dnl'ed. Try to catch common mistakes.
m4_define([AC_CACHE_VAL],
-[ifelse(m4_regexp([$2], [AC_DEFINE]), [-1], [],
- [AC_DIAGNOSE(syntax,
+[m4_if(m4_regexp([$2], [AC_DEFINE]), [-1], [],
+ [AC_DIAGNOSE(syntax,
[$0($1, ...): suspicious presence of an AC_DEFINE in the second argument, ]dnl
[where no actions should be taken])])dnl
AC_VAR_SET_IFELSE([$1],
[AC_DEFINE_TRACE([$1])dnl
m4_ifval([$3], [AH_TEMPLATE([$1], [$3])])dnl
cat >>confdefs.h <<\EOF
-[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
+[@%:@define] $1 m4_if($#, 2, [$2], $#, 3, [$2], 1)
EOF
])
[AC_DEFINE_TRACE([$1])dnl
m4_ifval([$3], [AH_TEMPLATE([$1], [$3])])dnl
cat >>confdefs.h <<EOF
-[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
+[@%:@define] $1 m4_if($#, 2, [$2], $#, 3, [$2], 1)
EOF
])
# brokenness of AC_TRY_COMPILE, we are doomed to leave a extra new
# line here.
m4_define([AC_INCLUDES_DEFAULT],
-[ifelse([$1], [], [$ac_includes_default], [$1
-])])
+[m4_ifval([$1], [$1
+],
+ [$ac_includes_default])])
AC_DEFUN([AC_CHECK_MEMBER],
[AC_VAR_INDIR_IFELSE([$1],
[AC_FATAL([$0: requires literal arguments])])dnl
-ifelse(m4_regexp([$1], [\.]), -1,
- [AC_FATAL([$0: Did not see any dot in `$1'])])dnl
+m4_if(m4_regexp([$1], [\.]), -1,
+ [AC_FATAL([$0: Did not see any dot in `$1'])])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_VAR_PUSHDEF([ac_Member], [ac_cv_member_$1])dnl
dnl Extract the aggregate name, and the member name
set dummy "$ac_dir/$ac_word" ${1+"$[@]"}
shift
ac_cv_prog_$1="$[@]"
-ifelse([$2], [$4],
+m4_if([$2], [$4],
[ else
# Default is a loser.
AC_MSG_ERROR([$1=$6 unacceptable, but no other $4 found in dnl
# Because many people have used `off_t' and `size_t' too, they are added
# for better common-useward backward compatibility.
m4_define([_AC_CHECK_TYPE_REPLACEMENT_TYPE_P],
-[ifelse(m4_regexp([$1],
- [^\(_Bool\|bool\|char\|double\|float\|int\|long\|short\|\(un\)?signed\|size_t\|off_t\)\([_a-zA-Z0-9() *]\|\[\|\]\)*$]),
- 0, 1, 0)dnl
+[m4_if(m4_regexp([$1],
+ [^\(_Bool\|bool\|char\|double\|float\|int\|long\|short\|\(un\)?signed\|size_t\|off_t\)\([_a-zA-Z0-9() *]\|\[\|\]\)*$]),
+ 0, 1, 0)dnl
])# _AC_CHECK_TYPE_REPLACEMENT_TYPE_P
# -----------------------------------
# Return `1' if STRING looks like a C/C++ type.
m4_define([_AC_CHECK_TYPE_MAYBE_TYPE_P],
-[ifelse(m4_regexp([$1], [^[_a-zA-Z0-9 ]+\([_a-zA-Z0-9() *]\|\[\|\]\)*$]),
- 0, 1, 0)dnl
+[m4_if(m4_regexp([$1], [^[_a-zA-Z0-9 ]+\([_a-zA-Z0-9() *]\|\[\|\]\)*$]),
+ 0, 1, 0)dnl
])# _AC_CHECK_TYPE_MAYBE_TYPE_P
# 3. $2 seems to be a type => NEW plus a warning
# 4. default => NEW
AC_DEFUN([AC_CHECK_TYPE],
-[ifelse($#, 3,
- [_AC_CHECK_TYPE_NEW($@)],
- $#, 4,
- [_AC_CHECK_TYPE_NEW($@)],
- _AC_CHECK_TYPE_REPLACEMENT_TYPE_P([$2]), 1,
- [_AC_CHECK_TYPE_OLD($@)],
- _AC_CHECK_TYPE_MAYBE_TYPE_P([$2]), 1,
- [AC_DIAGNOSE([syntax],
+[m4_if($#, 3,
+ [_AC_CHECK_TYPE_NEW($@)],
+ $#, 4,
+ [_AC_CHECK_TYPE_NEW($@)],
+ _AC_CHECK_TYPE_REPLACEMENT_TYPE_P([$2]), 1,
+ [_AC_CHECK_TYPE_OLD($@)],
+ _AC_CHECK_TYPE_MAYBE_TYPE_P([$2]), 1,
+ [AC_DIAGNOSE([syntax],
[$0: assuming `$2' is not a type])_AC_CHECK_TYPE_NEW($@)],
- [_AC_CHECK_TYPE_NEW($@)])[]dnl
+ [_AC_CHECK_TYPE_NEW($@)])[]dnl
])# AC_CHECK_TYPE
# matching. The big problem is then that the active characters should
# be quoted. Currently `+*.' are quoted.
m4_define([AC_CONFIG_IF_MEMBER],
-[ifelse(m4_regexp($2, [\(^\| \)]m4_patsubst([$1],
- [\([+*.]\)], [\\\1])[\(:\| \|$\)]),
- -1, [$4], [$3])])
+[m4_if(m4_regexp($2, [\(^\| \)]m4_patsubst([$1],
+ [\([+*.]\)], [\\\1])[\(:\| \|$\)]),
+ -1, [$4], [$3])])
# AC_FILE_DEPENDENCY_TRACE(DEST, SOURCE1, [SOURCE2...])
_AC_CONFIG_UNIQUE([$1])
m4_append([AC_LIST_COMMANDS], [ $1])
-ifelse([$2],,, [AC_FOREACH([AC_Name], [$1],
+m4_if([$2],,, [AC_FOREACH([AC_Name], [$1],
[m4_append([AC_LIST_COMMANDS_COMMANDS],
[ ]m4_patsubst(AC_Name, [:.*])[ ) $2 ;;
])])])
_AC_CONFIG_DEPENDENCIES([$1])
m4_append([AC_LIST_HEADERS], [ $1])
dnl Register the commands
-ifelse([$2],,, [AC_FOREACH([AC_File], [$1],
+m4_ifval([$2], [AC_FOREACH([AC_File], [$1],
[m4_append([AC_LIST_HEADERS_COMMANDS],
[ ]m4_patsubst(AC_File, [:.*])[ ) $2 ;;
])])])
[m4_divert_push([KILL])
_AC_CONFIG_UNIQUE([$1])
_AC_CONFIG_DEPENDENCIES([$1])
-ifelse(m4_regexp([$1], [^\.:\| \.:]), -1,,
- [AC_FATAL([$0: invalid destination: `.'])])
+m4_if(m4_regexp([$1], [^\.:\| \.:]), -1,,
+ [AC_FATAL([$0: invalid destination: `.'])])
m4_append([AC_LIST_LINKS], [ $1])
dnl Register the commands
-ifelse([$2],,, [AC_FOREACH([AC_File], [$1],
+m4_ifval([$2], [AC_FOREACH([AC_File], [$1],
[m4_append([AC_LIST_LINKS_COMMANDS],
[ ]m4_patsubst(AC_File, [:.*])[ ) $2 ;;
])])])
#
# _AC_LINK_CNT is used to be robust to multiple calls.
AU_DEFUN([AC_LINK_FILES],
-[ifelse($#, 2, ,
- [m4_fatal([$0: incorrect number of arguments])])dnl
+[m4_if($#, 2, ,
+ [m4_fatal([$0: incorrect number of arguments])])dnl
m4_define([_AC_LINK_FILES_CNT], m4_incr(_AC_LINK_FILES_CNT))dnl
ac_sources="$1"
ac_dests="$2"
_AC_CONFIG_DEPENDENCIES([$1])
m4_append([AC_LIST_FILES], [ $1])
dnl Register the commands.
-ifelse([$2],,, [AC_FOREACH([AC_File], [$1],
+m4_ifval([$2], [AC_FOREACH([AC_File], [$1],
[m4_append([AC_LIST_FILES_COMMANDS],
[ ]m4_patsubst(AC_File, [:.*])[ ) $2 ;;
])])])
# ACTION-IF-NOT-FOUND.
AC_DEFUN([AC_LIST_MEMBER_OF],
[dnl Do some sanity checking of the arguments.
-ifelse([$1], , [AC_FATAL([$0]: missing argument 1)])dnl
-ifelse([$2], , [AC_FATAL([$0]: missing argument 2)])dnl
+m4_if([$1], , [AC_FATAL([$0]: missing argument 1)])dnl
+m4_if([$2], , [AC_FATAL([$0]: missing argument 2)])dnl
ac_exists=false
for ac_i in $2; do
# Restore the previous language.
m4_define([AC_LANG_POP],
[m4_popdef([_AC_LANG])dnl
-ifelse(_AC_LANG, [_AC_LANG],
- [AC_FATAL([too many $0])])dnl
+m4_if(_AC_LANG, [_AC_LANG], [AC_FATAL([too many $0])])dnl
AC_LANG(_AC_LANG)])
# Avoid conflicting decl of main.
m4_define([AC_LANG_CALL(C)],
[AC_LANG_PROGRAM([$1
-ifelse([$2], [main], ,
+m4_if([$2], [main], ,
[/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
*) ac_val="unknown" ;;
esac
case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac
-ifelse(m4_index([$1],[_]),-1,[],
+m4_if(m4_index([$1],[_]),-1,[],
[case $ac_cv_f77_mangling in *," extra underscore"*) ac_val="$ac_val"_ ;; esac
])
m4_default([$2],[$1])="$ac_val"
# AT_CLEANUP_FILE_IFELSE(FILE, IF-REGISTERED, IF-NOT-REGISTERED)
# --------------------------------------------------------------
m4_define([AT_CLEANUP_FILE_IFELSE],
-[ifelse(m4_regexp(AT_data_files, m4_patsubst([ $1 ], [\([\[\]*.]\)], [\\\1])),
- -1,
- [$3], [$2])])
+[m4_if(m4_regexp(AT_data_files, m4_patsubst([ $1 ], [\([\[\]*.]\)], [\\\1])),
+ -1,
+ [$3], [$2])])
# AT_CLEANUP_FILE(FILE)
# Otherwise it's modern.
# We use two quotes in the pattern to keep highlighting tools at peace.
m4_define([_AS_QUOTE_IFELSE],
-[ifelse(m4_regexp([$1], [\\[\\$]]),
- [-1], [ifelse(m4_regexp([$1], [\\[`""]]),
- [-1], [$2],
- [$3])],
- [$2])])
+[m4_if(m4_regexp([$1], [\\[\\$]]),
+ [-1], [m4_if(m4_regexp([$1], [\\[`""]]),
+ [-1], [$2],
+ [$3])],
+ [$2])])
# _AS_ECHO_UNQUOTED(STRING, [FD = AS_MESSAGE_FD])
m4_rename_m4([eval])
m4_rename_m4([format])
m4_rename_m4([ifdef])
+m4_rename([ifelse], [m4_if])
m4_rename_m4([incr])
m4_rename_m4([index])
m4_rename_m4([indir])
m4_define([m4_fatal],
[m4_errprintn(m4_location[: error: $1])dnl
m4_expansion_stack_dump()dnl
-m4_exit(ifelse([$2],, 1, [$2]))])
+m4_exit(m4_if([$2],, 1, [$2]))])
# m4_assert(EXPRESSION, [EXIT-STATUS = 1])
# This macro ensures that EXPRESSION evaluates to true, and exits if
# EXPRESSION evaluates to false.
m4_define([m4_assert],
-[ifelse(m4_eval([$1]), 0,
- [m4_fatal([assert failed: $1], [$2])],
- [])])
+[m4_if(m4_eval([$1]), 0,
+ [m4_fatal([assert failed: $1], [$2])])])
## ------------- ##
# --------------------------------------------------------------
# Implementation of the loop described above.
m4_define([_m4_warning_ifelse],
-[ifelse([$4], [$1], [$2],
- [$4], [all], [$2],
- [$4], [], [$3],
- [$4], [none], [$3],
- [$4], [no-$1], [$3],
- [$0([$1], [$2], [$3], m4_shiftn(4, $@))])])
+[m4_case([$4],
+ [$1], [$2],
+ [all], [$2],
+ [], [$3],
+ [none], [$3],
+ [no-$1], [$3],
+ [$0([$1], [$2], [$3], m4_shiftn(4, $@))])])
# _m4_warning_error_ifelse(IF-TRUE, IF-FALSE)
# --------------------------------------------
# The same as _m4_warning_ifelse, but scan for `error' only.
m4_define([__m4_warning_error_ifelse],
-[ifelse([$3], [error], [$1],
- [$3], [], [$2],
- [$3], [no-error], [$2],
- [$0([$1], [$2], m4_shiftn(3, $@))])])
+[m4_case([$3],
+ [error], [$1],
+ [], [$2],
+ [no-error], [$2],
+ [$0([$1], [$2], m4_shiftn(3, $@))])])
# If COND is not the empty string, expand IF-TRUE, otherwise IF-FALSE.
# Comparable to m4_ifdef.
m4_define([m4_ifval],
-[ifelse([$1], [], [$3], [$2])])
+[m4_if([$1], [], [$3], [$2])])
# m4_n(TEXT)
# ----------
# If TEXT is not empty, return TEXT and a new line, otherwise nothing.
m4_define([m4_n],
-[ifelse([$1],
- [], [],
- [$1
+[m4_if([$1],
+ [], [],
+ [$1
])])
# Same as `m4_ifval', but add an extra newline to IF-TRUE or IF-FALSE
# unless that argument is empty.
m4_define([m4_ifvaln],
-[ifelse([$1],
- [], [m4_n([$3])],
- [m4_n([$2])])])
+[m4_if([$1],
+ [], [m4_n([$3])],
+ [m4_n([$2])])])
# m4_ifset(MACRO, [IF-TRUE], [IF-FALSE])
# expand IF-FALSE, otherwise IF-TRUE.
m4_define([m4_ifset],
[m4_ifdef([$1],
- [ifelse(m4_defn([$1]), [], [$3], [$2])],
+ [m4_if(m4_defn([$1]), [], [$3], [$2])],
[$3])])
# All the values are optional, and the macro is robust to active
# symbols properly quoted.
m4_define([m4_case],
-[ifelse([$#], 0, [],
- [$#], 1, [],
- [$#], 2, [$2],
- [$1], [$2], [$3],
- [m4_case([$1], m4_shiftn(3, $@))])])
+[m4_if([$#], 0, [],
+ [$#], 1, [],
+ [$#], 2, [$2],
+ [$1], [$2], [$3],
+ [m4_case([$1], m4_shiftn(3, $@))])])
# m4_match(SWITCH, RE1, VAL1, RE2, VAL2, ..., DEFAULT)
# All the values are optional, and the macro is robust to active symbols
# properly quoted.
m4_define([m4_match],
-[ifelse([$#], 0, [],
- [$#], 1, [],
- [$#], 2, [$2],
- m4_regexp([$1], [$2]), -1, [m4_match([$1], m4_shiftn(3, $@))],
- [$3])])
+[m4_if([$#], 0, [],
+ [$#], 1, [],
+ [$#], 2, [$2],
+ m4_regexp([$1], [$2]), -1, [m4_match([$1], m4_shiftn(3, $@))],
+ [$3])])
# useful for making your macros more structured and readable by dropping
# unecessary dnl's and have the macros indented properly.
m4_define([m4_do],
- [ifelse($#, 0, [],
- $#, 1, [$1],
- [$1[]m4_do(m4_shift($@))])])
+[m4_if($#, 0, [],
+ $#, 1, [$1],
+ [$1[]m4_do(m4_shift($@))])])
# m4_default(EXP1, EXP2)
_m4_shiftn($@)])
m4_define([_m4_shiftn],
-[ifelse([$1], 0,
- [m4_shift($@)],
- [_m4_shiftn(m4_eval([$1]-1), m4_shift(m4_shift($@)))])])
+[m4_if([$1], 0,
+ [m4_shift($@)],
+ [_m4_shiftn(m4_eval([$1]-1), m4_shift(m4_shift($@)))])])
1, [m4_assert(m4_sign(m4_default($4, 1)) == 1)],
-1, [m4_assert(m4_sign(m4_default($4, -1)) == -1)])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
+m4_if(m4_eval([$3 > $2]), 1,
+ [_m4_for([$1], [$3], m4_default([$4], 1), [$5])],
+ [_m4_for([$1], [$3], m4_default([$4], -1), [$5])])dnl
m4_popdef([$1])])
m4_define([_m4_for],
[$4[]dnl
-ifelse($1, [$2], [],
- [m4_define([$1], m4_eval($1+[$3]))_m4_for([$1], [$2], [$3], [$4])])])
+m4_if($1, [$2], [],
+ [m4_define([$1], m4_eval($1+[$3]))_m4_for([$1], [$2], [$3], [$4])])])
# Implementing `foreach' loops in m4 is much more tricky than it may
# | [m4_pushdef([$1])_foreach([$1], [$2], [$3])m4_popdef([$1])])
# | m4_define([_arg1], [$1])
# | m4_define([_foreach],
-# | [ifelse([$2], [()], ,
-# | [m4_define([$1], _arg1$2)$3[]_foreach([$1],
-# | (shift$2),
-# | [$3])])])
+# | [m4_if([$2], [()], ,
+# | [m4_define([$1], _arg1$2)$3[]_foreach([$1],
+# | (shift$2),
+# | [$3])])])
#
# But then if you run
#
# | m4_define([foreach], [m4_pushdef([$1])_foreach($@)m4_popdef([$1])])
# | m4_define([_arg1], [[$1]])
# | m4_define([_foreach],
-# | [ifelse($2, [()], ,
-# | [m4_define([$1], [_arg1$2])$3[]_foreach([$1],
-# | [(shift$2)],
-# | [$3])])])
+# | [m4_if($2, [()], ,
+# | [m4_define([$1], [_arg1$2])$3[]_foreach([$1],
+# | [(shift$2)],
+# | [$3])])])
#
# which this time answers
#
# | m4_define([foreach], [m4_pushdef([$1])_foreach($@)m4_popdef([$1])])
# | m4_define([_arg1], [$1])
# | m4_define([_foreach],
-# | [ifelse($2, [], ,
-# | [m4_define([$1], [_arg1($2)])$3[]_foreach([$1],
-# | [shift($2)],
-# | [$3])])])
+# | [m4_if($2, [], ,
+# | [m4_define([$1], [_arg1($2)])$3[]_foreach([$1],
+# | [shift($2)],
+# | [$3])])])
#
#
-# Now, just replace the `$2' with `m4_quote($2)' in the outer `ifelse'
+# Now, just replace the `$2' with `m4_quote($2)' in the outer `m4_if'
# to improve robustness, and you come up with a quite satisfactory
# implementation.
# Low level macros used to define m4_foreach.
m4_define([m4_car], [$1])
m4_define([_m4_foreach],
-[ifelse(m4_quote($2), [], [],
- [m4_define([$1], [m4_car($2)])$3[]_m4_foreach([$1],
- [m4_shift($2)],
- [$3])])])
+[m4_if(m4_quote($2), [], [],
+ [m4_define([$1], [m4_car($2)])$3[]_m4_foreach([$1],
+ [m4_shift($2)],
+ [$3])])])
# the PRO/EPI pairs.
m4_define([_m4_defun_epi],
[m4_divert_pop()dnl
-ifelse(_m4_divert_dump, _m4_divert_diversion,
- [m4_undivert(_m4_divert([GROW]))dnl
+m4_if(_m4_divert_dump, _m4_divert_diversion,
+ [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_changequote(<<, >>)
m4_define(<<m4_split>>,
<<m4_changequote(``, '')dnl
-[dnl Can't use m4_default here instead of ifelse, because m4_default uses
+[dnl Can't use m4_default here instead of m4_if, because m4_default uses
dnl [ and ] as quotes.
m4_patsubst(````$1'''',
- ifelse(``$2'',, ``[ ]+'', ``$2''),
+ m4_if(``$2'',, ``[ ]+'', ``$2''),
``], ['')]dnl
m4_changequote([, ])>>)
m4_changequote([, ])
# Low level macros used to define m4_foreach.
m4_define([m4_car_quoted], [[$1]])
m4_define([_m4_foreach_quoted],
-[ifelse($2, [()], ,
- [m4_define([$1], [m4_car_quoted$2])$3[]_m4_foreach_quoted([$1],
+[m4_if($2, [()], ,
+ [m4_define([$1], [m4_car_quoted$2])$3[]_m4_foreach_quoted([$1],
[(m4_shift$2)],
[$3])])])
m4_pushdef([m4_Cursor], m4_len(m4_Prefix1))dnl
m4_pushdef([m4_Separator], [])dnl
m4_Prefix1[]dnl
-ifelse(m4_eval(m4_Cursor > m4_len(m4_Prefix)),
- 1, [m4_define([m4_Cursor], m4_len(m4_Prefix))
+m4_if(m4_eval(m4_Cursor > m4_len(m4_Prefix)),
+ 1, [m4_define([m4_Cursor], m4_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
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),
- 1, [m4_define([m4_Cursor],
- m4_eval(m4_len(m4_Prefix) + m4_len(m4_Word) + 1))]
+m4_if(m4_eval(m4_Cursor > m4_Width),
+ 1, [m4_define([m4_Cursor],
+ m4_eval(m4_len(m4_Prefix) + m4_len(m4_Word) + 1))]
m4_Prefix,
[m4_Separator])[]dnl
m4_Word[]dnl
# m4_list_cmp((1, 0), (1, 2)) -> -1
# m4_list_cmp((1), (1, 2)) -> -1
m4_define([m4_list_cmp],
-[ifelse([$1$2], [()()], 0,
- [$1], [()], [m4_list_cmp((0), [$2])],
- [$2], [()], [m4_list_cmp([$1], (0))],
- [m4_case(m4_cmp(m4_car$1, m4_car$2),
- -1, -1,
- 1, 1,
- 0, [m4_list_cmp((m4_shift$1), (m4_shift$2))])])])
+[m4_if([$1$2], [()()], 0,
+ [$1], [()], [m4_list_cmp((0), [$2])],
+ [$2], [()], [m4_list_cmp([$1], (0))],
+ [m4_case(m4_cmp(m4_car$1, m4_car$2),
+ -1, -1,
+ 1, 1,
+ 0, [m4_list_cmp((m4_shift$1), (m4_shift$2))])])])
[m4_syscmd([cat >>$1 <<_m4eof
$2
_m4eof])
-ifelse(m4_sysval, [0], [],
- [m4_fatal([$0: cannot write: $1])])])
+m4_if(m4_sysval, [0], [],
+ [m4_fatal([$0: cannot write: $1])])])
# Otherwise it's modern.
# We use two quotes in the pattern to keep highlighting tools at peace.
m4_define([_AS_QUOTE_IFELSE],
-[ifelse(m4_regexp([$1], [\\[\\$]]),
- [-1], [ifelse(m4_regexp([$1], [\\[`""]]),
- [-1], [$2],
- [$3])],
- [$2])])
+[m4_if(m4_regexp([$1], [\\[\\$]]),
+ [-1], [m4_if(m4_regexp([$1], [\\[`""]]),
+ [-1], [$2],
+ [$3])],
+ [$2])])
# _AS_ECHO_UNQUOTED(STRING, [FD = AS_MESSAGE_FD])
m4_rename_m4([eval])
m4_rename_m4([format])
m4_rename_m4([ifdef])
+m4_rename([ifelse], [m4_if])
m4_rename_m4([incr])
m4_rename_m4([index])
m4_rename_m4([indir])
m4_define([m4_fatal],
[m4_errprintn(m4_location[: error: $1])dnl
m4_expansion_stack_dump()dnl
-m4_exit(ifelse([$2],, 1, [$2]))])
+m4_exit(m4_if([$2],, 1, [$2]))])
# m4_assert(EXPRESSION, [EXIT-STATUS = 1])
# This macro ensures that EXPRESSION evaluates to true, and exits if
# EXPRESSION evaluates to false.
m4_define([m4_assert],
-[ifelse(m4_eval([$1]), 0,
- [m4_fatal([assert failed: $1], [$2])],
- [])])
+[m4_if(m4_eval([$1]), 0,
+ [m4_fatal([assert failed: $1], [$2])])])
## ------------- ##
# --------------------------------------------------------------
# Implementation of the loop described above.
m4_define([_m4_warning_ifelse],
-[ifelse([$4], [$1], [$2],
- [$4], [all], [$2],
- [$4], [], [$3],
- [$4], [none], [$3],
- [$4], [no-$1], [$3],
- [$0([$1], [$2], [$3], m4_shiftn(4, $@))])])
+[m4_case([$4],
+ [$1], [$2],
+ [all], [$2],
+ [], [$3],
+ [none], [$3],
+ [no-$1], [$3],
+ [$0([$1], [$2], [$3], m4_shiftn(4, $@))])])
# _m4_warning_error_ifelse(IF-TRUE, IF-FALSE)
# --------------------------------------------
# The same as _m4_warning_ifelse, but scan for `error' only.
m4_define([__m4_warning_error_ifelse],
-[ifelse([$3], [error], [$1],
- [$3], [], [$2],
- [$3], [no-error], [$2],
- [$0([$1], [$2], m4_shiftn(3, $@))])])
+[m4_case([$3],
+ [error], [$1],
+ [], [$2],
+ [no-error], [$2],
+ [$0([$1], [$2], m4_shiftn(3, $@))])])
# If COND is not the empty string, expand IF-TRUE, otherwise IF-FALSE.
# Comparable to m4_ifdef.
m4_define([m4_ifval],
-[ifelse([$1], [], [$3], [$2])])
+[m4_if([$1], [], [$3], [$2])])
# m4_n(TEXT)
# ----------
# If TEXT is not empty, return TEXT and a new line, otherwise nothing.
m4_define([m4_n],
-[ifelse([$1],
- [], [],
- [$1
+[m4_if([$1],
+ [], [],
+ [$1
])])
# Same as `m4_ifval', but add an extra newline to IF-TRUE or IF-FALSE
# unless that argument is empty.
m4_define([m4_ifvaln],
-[ifelse([$1],
- [], [m4_n([$3])],
- [m4_n([$2])])])
+[m4_if([$1],
+ [], [m4_n([$3])],
+ [m4_n([$2])])])
# m4_ifset(MACRO, [IF-TRUE], [IF-FALSE])
# expand IF-FALSE, otherwise IF-TRUE.
m4_define([m4_ifset],
[m4_ifdef([$1],
- [ifelse(m4_defn([$1]), [], [$3], [$2])],
+ [m4_if(m4_defn([$1]), [], [$3], [$2])],
[$3])])
# All the values are optional, and the macro is robust to active
# symbols properly quoted.
m4_define([m4_case],
-[ifelse([$#], 0, [],
- [$#], 1, [],
- [$#], 2, [$2],
- [$1], [$2], [$3],
- [m4_case([$1], m4_shiftn(3, $@))])])
+[m4_if([$#], 0, [],
+ [$#], 1, [],
+ [$#], 2, [$2],
+ [$1], [$2], [$3],
+ [m4_case([$1], m4_shiftn(3, $@))])])
# m4_match(SWITCH, RE1, VAL1, RE2, VAL2, ..., DEFAULT)
# All the values are optional, and the macro is robust to active symbols
# properly quoted.
m4_define([m4_match],
-[ifelse([$#], 0, [],
- [$#], 1, [],
- [$#], 2, [$2],
- m4_regexp([$1], [$2]), -1, [m4_match([$1], m4_shiftn(3, $@))],
- [$3])])
+[m4_if([$#], 0, [],
+ [$#], 1, [],
+ [$#], 2, [$2],
+ m4_regexp([$1], [$2]), -1, [m4_match([$1], m4_shiftn(3, $@))],
+ [$3])])
# useful for making your macros more structured and readable by dropping
# unecessary dnl's and have the macros indented properly.
m4_define([m4_do],
- [ifelse($#, 0, [],
- $#, 1, [$1],
- [$1[]m4_do(m4_shift($@))])])
+[m4_if($#, 0, [],
+ $#, 1, [$1],
+ [$1[]m4_do(m4_shift($@))])])
# m4_default(EXP1, EXP2)
_m4_shiftn($@)])
m4_define([_m4_shiftn],
-[ifelse([$1], 0,
- [m4_shift($@)],
- [_m4_shiftn(m4_eval([$1]-1), m4_shift(m4_shift($@)))])])
+[m4_if([$1], 0,
+ [m4_shift($@)],
+ [_m4_shiftn(m4_eval([$1]-1), m4_shift(m4_shift($@)))])])
1, [m4_assert(m4_sign(m4_default($4, 1)) == 1)],
-1, [m4_assert(m4_sign(m4_default($4, -1)) == -1)])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
+m4_if(m4_eval([$3 > $2]), 1,
+ [_m4_for([$1], [$3], m4_default([$4], 1), [$5])],
+ [_m4_for([$1], [$3], m4_default([$4], -1), [$5])])dnl
m4_popdef([$1])])
m4_define([_m4_for],
[$4[]dnl
-ifelse($1, [$2], [],
- [m4_define([$1], m4_eval($1+[$3]))_m4_for([$1], [$2], [$3], [$4])])])
+m4_if($1, [$2], [],
+ [m4_define([$1], m4_eval($1+[$3]))_m4_for([$1], [$2], [$3], [$4])])])
# Implementing `foreach' loops in m4 is much more tricky than it may
# | [m4_pushdef([$1])_foreach([$1], [$2], [$3])m4_popdef([$1])])
# | m4_define([_arg1], [$1])
# | m4_define([_foreach],
-# | [ifelse([$2], [()], ,
-# | [m4_define([$1], _arg1$2)$3[]_foreach([$1],
-# | (shift$2),
-# | [$3])])])
+# | [m4_if([$2], [()], ,
+# | [m4_define([$1], _arg1$2)$3[]_foreach([$1],
+# | (shift$2),
+# | [$3])])])
#
# But then if you run
#
# | m4_define([foreach], [m4_pushdef([$1])_foreach($@)m4_popdef([$1])])
# | m4_define([_arg1], [[$1]])
# | m4_define([_foreach],
-# | [ifelse($2, [()], ,
-# | [m4_define([$1], [_arg1$2])$3[]_foreach([$1],
-# | [(shift$2)],
-# | [$3])])])
+# | [m4_if($2, [()], ,
+# | [m4_define([$1], [_arg1$2])$3[]_foreach([$1],
+# | [(shift$2)],
+# | [$3])])])
#
# which this time answers
#
# | m4_define([foreach], [m4_pushdef([$1])_foreach($@)m4_popdef([$1])])
# | m4_define([_arg1], [$1])
# | m4_define([_foreach],
-# | [ifelse($2, [], ,
-# | [m4_define([$1], [_arg1($2)])$3[]_foreach([$1],
-# | [shift($2)],
-# | [$3])])])
+# | [m4_if($2, [], ,
+# | [m4_define([$1], [_arg1($2)])$3[]_foreach([$1],
+# | [shift($2)],
+# | [$3])])])
#
#
-# Now, just replace the `$2' with `m4_quote($2)' in the outer `ifelse'
+# Now, just replace the `$2' with `m4_quote($2)' in the outer `m4_if'
# to improve robustness, and you come up with a quite satisfactory
# implementation.
# Low level macros used to define m4_foreach.
m4_define([m4_car], [$1])
m4_define([_m4_foreach],
-[ifelse(m4_quote($2), [], [],
- [m4_define([$1], [m4_car($2)])$3[]_m4_foreach([$1],
- [m4_shift($2)],
- [$3])])])
+[m4_if(m4_quote($2), [], [],
+ [m4_define([$1], [m4_car($2)])$3[]_m4_foreach([$1],
+ [m4_shift($2)],
+ [$3])])])
# the PRO/EPI pairs.
m4_define([_m4_defun_epi],
[m4_divert_pop()dnl
-ifelse(_m4_divert_dump, _m4_divert_diversion,
- [m4_undivert(_m4_divert([GROW]))dnl
+m4_if(_m4_divert_dump, _m4_divert_diversion,
+ [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_changequote(<<, >>)
m4_define(<<m4_split>>,
<<m4_changequote(``, '')dnl
-[dnl Can't use m4_default here instead of ifelse, because m4_default uses
+[dnl Can't use m4_default here instead of m4_if, because m4_default uses
dnl [ and ] as quotes.
m4_patsubst(````$1'''',
- ifelse(``$2'',, ``[ ]+'', ``$2''),
+ m4_if(``$2'',, ``[ ]+'', ``$2''),
``], ['')]dnl
m4_changequote([, ])>>)
m4_changequote([, ])
# Low level macros used to define m4_foreach.
m4_define([m4_car_quoted], [[$1]])
m4_define([_m4_foreach_quoted],
-[ifelse($2, [()], ,
- [m4_define([$1], [m4_car_quoted$2])$3[]_m4_foreach_quoted([$1],
+[m4_if($2, [()], ,
+ [m4_define([$1], [m4_car_quoted$2])$3[]_m4_foreach_quoted([$1],
[(m4_shift$2)],
[$3])])])
m4_pushdef([m4_Cursor], m4_len(m4_Prefix1))dnl
m4_pushdef([m4_Separator], [])dnl
m4_Prefix1[]dnl
-ifelse(m4_eval(m4_Cursor > m4_len(m4_Prefix)),
- 1, [m4_define([m4_Cursor], m4_len(m4_Prefix))
+m4_if(m4_eval(m4_Cursor > m4_len(m4_Prefix)),
+ 1, [m4_define([m4_Cursor], m4_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
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),
- 1, [m4_define([m4_Cursor],
- m4_eval(m4_len(m4_Prefix) + m4_len(m4_Word) + 1))]
+m4_if(m4_eval(m4_Cursor > m4_Width),
+ 1, [m4_define([m4_Cursor],
+ m4_eval(m4_len(m4_Prefix) + m4_len(m4_Word) + 1))]
m4_Prefix,
[m4_Separator])[]dnl
m4_Word[]dnl
# m4_list_cmp((1, 0), (1, 2)) -> -1
# m4_list_cmp((1), (1, 2)) -> -1
m4_define([m4_list_cmp],
-[ifelse([$1$2], [()()], 0,
- [$1], [()], [m4_list_cmp((0), [$2])],
- [$2], [()], [m4_list_cmp([$1], (0))],
- [m4_case(m4_cmp(m4_car$1, m4_car$2),
- -1, -1,
- 1, 1,
- 0, [m4_list_cmp((m4_shift$1), (m4_shift$2))])])])
+[m4_if([$1$2], [()()], 0,
+ [$1], [()], [m4_list_cmp((0), [$2])],
+ [$2], [()], [m4_list_cmp([$1], (0))],
+ [m4_case(m4_cmp(m4_car$1, m4_car$2),
+ -1, -1,
+ 1, 1,
+ 0, [m4_list_cmp((m4_shift$1), (m4_shift$2))])])])
[m4_syscmd([cat >>$1 <<_m4eof
$2
_m4eof])
-ifelse(m4_sysval, [0], [],
- [m4_fatal([$0: cannot write: $1])])])
+m4_if(m4_sysval, [0], [],
+ [m4_fatal([$0: cannot write: $1])])])
# ------------------------
# Produce ARG1SEPARG2...SEPARGn.
define([join],
-[ifelse([$#], [1], [],
- [$#], [2], [[$2]],
- [[$2][$1]join([$1], m4_shift(m4_shift($@)))])])
+[m4_case([$#],
+ [1], [],
+ [2], [[$2]],
+ [[$2][$1]join([$1], m4_shift(m4_shift($@)))])])
# AC_STATE_SAVE(FILE)
# AT_CLEANUP_FILE_IFELSE(FILE, IF-REGISTERED, IF-NOT-REGISTERED)
# --------------------------------------------------------------
m4_define([AT_CLEANUP_FILE_IFELSE],
-[ifelse(m4_regexp(AT_data_files, m4_patsubst([ $1 ], [\([\[\]*.]\)], [\\\1])),
- -1,
- [$3], [$2])])
+[m4_if(m4_regexp(AT_data_files, m4_patsubst([ $1 ], [\([\[\]*.]\)], [\\\1])),
+ -1,
+ [$3], [$2])])
# AT_CLEANUP_FILE(FILE)
m4_define([AT_CHECK_MACRO],
[AT_SETUP([$1])
-_AT_CHECK_AC_MACRO([ifelse([$2],,[$1], [$2])])
+_AT_CHECK_AC_MACRO([m4_default([$2], [$1])])
$3
AT_CLEANUP()dnl
])# AT_CHECK_MACRO