2008-10-12  Paolo Bonzini  <[EMAIL PROTECTED]>

        * 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



Reply via email to