AC_TRY_EVAL.
(_AC_COMPILE_IFELSE, _AC_LINK_IFELSE, _AC_RUN_IFELSE): More alike,
using AS_IFELSE, and systematically AC_TRY_COMMAND when testing
something (for the logs).
+2000-12-15 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (_AC_PREPROC_IFELSE): Use ac_status as set by
+ AC_TRY_EVAL.
+ (_AC_COMPILE_IFELSE, _AC_LINK_IFELSE, _AC_RUN_IFELSE): More alike,
+ using AS_IFELSE, and systematically AC_TRY_COMMAND when testing
+ something (for the logs).
+
2000-12-15 Akim Demaille <akim@epita.fr>
* aclang.m4 (_AC_PROG_PREPROC_WORKS): Use _AC_PREPROC_IFELSE.
# This macro can be used during the selection of a preprocessor.
AC_DEFUN([_AC_PREPROC_IFELSE],
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.err"
-if AC_TRY_EVAL(ac_try); then
+if AC_TRY_COMMAND([$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.err]); then
if egrep -v '^ *\+' conftest.err | grep . >/dev/null; then
ac_cpp_err=$ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag
else
m4_define([_AC_COMPILE_IFELSE],
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
rm -f conftest.$ac_objext
-if AC_TRY_EVAL(ac_compile) && test -s conftest.$ac_objext; then
- m4_default([$2], :)
-else
- echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
-m4_ifvaln([$3],[ $3])dnl
-fi
+AS_IFELSE([AC_TRY_EVAL(ac_compile) && test -s conftest.$ac_objext],
+ [$2],
+[echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
+cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
+m4_ifvaln([$3],[$3])dnl])
rm -f conftest.$ac_objext m4_ifval([$1], [conftest.$ac_ext])[]dnl
])# _AC_COMPILE_IFELSE
m4_define([_AC_LINK_IFELSE],
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
rm -f conftest.$ac_objext conftest$ac_exeext
-if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
- m4_default([$2], :)
-else
- echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
-m4_ifvaln([$3], [ $3])dnl
-fi
+AS_IFELSE([AC_TRY_EVAL(ac_link) &&
+ AC_TRY_COMMAND([test -s conftest$ac_exeext])],
+ [$2],
+ [echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
+cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
+m4_ifvaln([$3], [$3])dnl])
rm -f conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
])# _AC_LINK_IFELSE
m4_define([_AC_RUN_IFELSE],
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
rm -f conftest$ac_exeext
-AC_TRY_EVAL(ac_link) &&
- (./conftest$ac_exeext) >&AS_MESSAGE_LOG_FD 2>&1;
-ac_status=$?
-AS_IFELSE([test $ac_status = 0],
+AS_IFELSE([AC_TRY_EVAL(ac_link) && AC_TRY_COMMAND(./conftest$ac_exeext)],
[$2],
[echo "$as_me: program exited with status $ac_status" >&AS_MESSAGE_LOG_FD
echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
# This macro can be used during the selection of a preprocessor.
AC_DEFUN([_AC_PREPROC_IFELSE],
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.err"
-if AC_TRY_EVAL(ac_try); then
+if AC_TRY_COMMAND([$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.err]); then
if egrep -v '^ *\+' conftest.err | grep . >/dev/null; then
ac_cpp_err=$ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag
else
m4_define([_AC_COMPILE_IFELSE],
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
rm -f conftest.$ac_objext
-if AC_TRY_EVAL(ac_compile) && test -s conftest.$ac_objext; then
- m4_default([$2], :)
-else
- echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
-m4_ifvaln([$3],[ $3])dnl
-fi
+AS_IFELSE([AC_TRY_EVAL(ac_compile) && test -s conftest.$ac_objext],
+ [$2],
+[echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
+cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
+m4_ifvaln([$3],[$3])dnl])
rm -f conftest.$ac_objext m4_ifval([$1], [conftest.$ac_ext])[]dnl
])# _AC_COMPILE_IFELSE
m4_define([_AC_LINK_IFELSE],
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
rm -f conftest.$ac_objext conftest$ac_exeext
-if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
- m4_default([$2], :)
-else
- echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
-m4_ifvaln([$3], [ $3])dnl
-fi
+AS_IFELSE([AC_TRY_EVAL(ac_link) &&
+ AC_TRY_COMMAND([test -s conftest$ac_exeext])],
+ [$2],
+ [echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
+cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
+m4_ifvaln([$3], [$3])dnl])
rm -f conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
])# _AC_LINK_IFELSE
m4_define([_AC_RUN_IFELSE],
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
rm -f conftest$ac_exeext
-AC_TRY_EVAL(ac_link) &&
- (./conftest$ac_exeext) >&AS_MESSAGE_LOG_FD 2>&1;
-ac_status=$?
-AS_IFELSE([test $ac_status = 0],
+AS_IFELSE([AC_TRY_EVAL(ac_link) && AC_TRY_COMMAND(./conftest$ac_exeext)],
[$2],
[echo "$as_me: program exited with status $ac_status" >&AS_MESSAGE_LOG_FD
echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD