[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 02/12] use a shell function for _AC_COMPILE_IFELSE
From: |
Paolo Bonzini |
Subject: |
[PATCH 02/12] use a shell function for _AC_COMPILE_IFELSE |
Date: |
Mon, 20 Oct 2008 15:35:24 +0200 |
2008-10-12 Paolo Bonzini <address@hidden>
* lib/autoconf/general.m4 (_AC_COMPILE_IFELSE): Use a shell function.
---
lib/autoconf/general.m4 | 23 ++++++++++++++++-------
1 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 406a197..1cdabf7 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -2464,17 +2464,26 @@ AC_DEFUN([AC_EGREP_HEADER],
# ----------------------------------------------------------------
# Try to compile PROGRAM.
# This macro can be used during the selection of a compiler.
-m4_define([_AC_COMPILE_IFELSE],
-[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
-rm -f conftest.$ac_objext
-AS_IF([_AC_DO_STDERR($ac_compile) && {
+AC_DEFUN([_AC_COMPILE_IFELSE],
+[AC_REQUIRE_SHELL_FN([ac_func_]_AC_LANG_ABBREV[_try_compile],
+ [AS_FUNCTION_DESCRIBE([ac_func_]_AC_LANG_ABBREV[_try_compile], [LINENO],
+ [Try to compile conftest.$ac_ext, and return whether this succeeded.])], [
+ AS_LINENO_PUSH([$[]1])
+ rm -f conftest.$ac_objext
+ AS_IF([_AC_DO_STDERR($ac_compile) && {
test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext],
- [$2],
+ [ac_retval=0],
[_AC_MSG_LOG_CONFTEST
- $3])
-rm -f core conftest.err conftest.$ac_objext m4_ifval([$1],
[conftest.$ac_ext])[]dnl
+ ac_retval=1])
+ rm -f core conftest.err conftest.$ac_objext
+ AS_LINENO_POP
+ return $ac_retval
+])dnl
+m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
+AS_IF([ac_func_[]_AC_LANG_ABBREV[]_try_compile "$LINENO"], [$2], [$3])
+m4_ifvaln([$1], [rm -f conftest.$ac_ext])
])# _AC_COMPILE_IFELSE
--
1.5.5
- [PATCH 02/12] use a shell function for _AC_COMPILE_IFELSE,
Paolo Bonzini <=