even nothing when not needed.
* acspecific.m4: Likewise.
+2000-03-14 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4: Replace some ifelse with ifval or m4_default, or
+ even nothing when not needed.
+ * acspecific.m4: Likewise.
+
2000-03-14 Akim Demaille <akim@epita.fr>
* acgeneral.m4 (_AC_INIT_PREPARE): Insert the Autoconf version in
@%:@ Check whether --enable-[$1] or --disable-[$1] was given.
if test "[${enable_]patsubst([$1], -, _)+set}" = set; then
enableval="[$enable_]patsubst([$1], -, _)"
- ifelse([$3], , :, [$3])
+ $3
ifval([$4], [else
$4
])dnl
@%:@ Check whether --with-[$1] or --without-[$1] was given.
if test "[${with_]patsubst([$1], -, _)+set}" = set; then
withval="[$with_]patsubst([$1], -, _)"
- ifelse([$3], , :, [$3])
+ $3
ifval([$4], [else
$4
])dnl
[ else
# Default is a loser.
AC_MSG_ERROR([$1=$6 unacceptable, but no other $4 found in dnl
-ifelse([$5], , [\$]PATH, [$5])])
+m4_default([$5], [\$PATH])])
])dnl
fi
fi
dnl $ac_dummy forces splitting on constant user-supplied paths.
dnl POSIX.2 word splitting is done only on the output of word expansions,
dnl not every word. This closes a longstanding sh security hole.
- ac_dummy="ifelse([$4], , $PATH, [$4])"
+ ac_dummy="m4_default([$4], [$PATH])"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_word"; then
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
dnl Don't remove the temporary files here, so they can be examined.
- ifelse([$2], , :, [$2])
+ m4_default([$2], [:])
else
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.$ac_ext >&AC_FD_CC
AC_DEFUN(AC_PROG_CC,
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
AC_ARG_VAR([CFLAGS], [Extra flags for the C compiler])
-ifelse([$1], ,
+ifval([$1],
+ [AC_CHECK_PROGS(CC, [$1])],
[
AC_CHECK_PROG(CC, gcc, gcc)
if test -z "$CC"; then
AC_CHECK_PROGS(CC, cl)
fi
fi
-], [AC_CHECK_PROGS(CC, [$1])])
+])
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
@%:@ Check whether --enable-[$1] or --disable-[$1] was given.
if test "[${enable_]patsubst([$1], -, _)+set}" = set; then
enableval="[$enable_]patsubst([$1], -, _)"
- ifelse([$3], , :, [$3])
+ $3
ifval([$4], [else
$4
])dnl
@%:@ Check whether --with-[$1] or --without-[$1] was given.
if test "[${with_]patsubst([$1], -, _)+set}" = set; then
withval="[$with_]patsubst([$1], -, _)"
- ifelse([$3], , :, [$3])
+ $3
ifval([$4], [else
$4
])dnl
[ else
# Default is a loser.
AC_MSG_ERROR([$1=$6 unacceptable, but no other $4 found in dnl
-ifelse([$5], , [\$]PATH, [$5])])
+m4_default([$5], [\$PATH])])
])dnl
fi
fi
dnl $ac_dummy forces splitting on constant user-supplied paths.
dnl POSIX.2 word splitting is done only on the output of word expansions,
dnl not every word. This closes a longstanding sh security hole.
- ac_dummy="ifelse([$4], , $PATH, [$4])"
+ ac_dummy="m4_default([$4], [$PATH])"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_word"; then
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
dnl Don't remove the temporary files here, so they can be examined.
- ifelse([$2], , :, [$2])
+ m4_default([$2], [:])
else
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.$ac_ext >&AC_FD_CC
AC_DEFUN(AC_PROG_CC,
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
AC_ARG_VAR([CFLAGS], [Extra flags for the C compiler])
-ifelse([$1], ,
+ifval([$1],
+ [AC_CHECK_PROGS(CC, [$1])],
[
AC_CHECK_PROG(CC, gcc, gcc)
if test -z "$CC"; then
AC_CHECK_PROGS(CC, cl)
fi
fi
-], [AC_CHECK_PROGS(CC, [$1])])
+])
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])