autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 02/12] use a shell function for _AC_COMPILE_IFELSE


From: Eric Blake
Subject: Re: [PATCH 02/12] use a shell function for _AC_COMPILE_IFELSE
Date: Wed, 22 Oct 2008 05:17:41 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17) Gecko/20080914 Thunderbird/2.0.0.17 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Paolo Bonzini on 10/20/2008 7:35 AM:
> 2008-10-12  Paolo Bonzini  <address@hidden>
> 
>       * lib/autoconf/general.m4 (_AC_COMPILE_IFELSE): Use a shell function.

Committed with this squashed on:

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkj/C9UACgkQ84KuGfSFAYCZGwCgo2oxnPHQK90ydI/mSVO3oLGK
R+YAoMTycOZZPKEwEstfzTr1KeOgM2gR
=TkFo
-----END PGP SIGNATURE-----
>From 8c353dff488d575694be8c932ce2183995a7d2c1 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Tue, 21 Oct 2008 17:21:47 -0600
Subject: [PATCH] tmp

---
 ChangeLog               |    7 +++++++
 lib/autoconf/general.m4 |   38 ++++++++++++++++++++++----------------
 2 files changed, 29 insertions(+), 16 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0eae97f..25ba3c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-10-21  Paolo Bonzini  <address@hidden>
+       and Eric Blake  <address@hidden>
+
+       Use a shell function for _AC_COMPILE_IFELSE.
+       * lib/autoconf/general.m4 (_AC_COMPILE_IFELSE_BODY): New macro.
+       (_AC_COMPILE_IFELSE): Use a shell function.
+
 2008-10-21  Eric Blake  <address@hidden>
 
        Use AS_VAR_APPEND.
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 50914f0..22111a1 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -2392,7 +2392,7 @@ m4_define([_AC_PREPROC_IFELSE_BODY],
   rm -f conftest.err
   AS_LINENO_POP
   return $ac_retval
-])
+])# _AC_PREPROC_IFELSE_BODY
 
 
 # _AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
@@ -2405,7 +2405,7 @@ AC_DEFUN([_AC_PREPROC_IFELSE],
 [AC_REQUIRE_SHELL_FN([ac_func_]_AC_LANG_ABBREV[_try_cpp],
   [AS_FUNCTION_DESCRIBE([ac_func_]_AC_LANG_ABBREV[_try_cpp], [LINENO],
     [Try to preprocess conftest.$ac_ext, and return whether this succeeded.])],
-    [$0_BODY])]dnl
+  [$0_BODY])]dnl
 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
 [AS_IF([ac_func_[]_AC_LANG_ABBREV[]_try_cpp "$LINENO"], [$2], [$3])
 m4_ifvaln([$1], [rm -f conftest.$ac_ext])dnl
@@ -2466,16 +2466,11 @@ AC_DEFUN([AC_EGREP_HEADER],
 ## Examining syntax.  ##
 ## ------------------ ##
 
-
-# _AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
-# ----------------------------------------------------------------
-# Try to compile PROGRAM.
-# This macro can be used during the selection of a compiler.
-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])
+# _AC_COMPILE_IFELSE_BODY
+# -----------------------
+# Shell function body for _AC_COMPILE_IFELSE.
+m4_define([_AC_COMPILE_IFELSE_BODY],
+[  AS_LINENO_PUSH([$[]1])
   rm -f conftest.$ac_objext
   AS_IF([_AC_DO_STDERR($ac_compile) && {
         test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
@@ -2487,10 +2482,21 @@ AC_DEFUN([_AC_COMPILE_IFELSE],
   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_BODY
+
+
+# _AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+# ----------------------------------------------------------------
+# Try to compile PROGRAM.
+# This macro can be used during the selection of a compiler.
+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.])],
+  [$0_BODY])]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])dnl
 ])# _AC_COMPILE_IFELSE
 
 
-- 
1.6.0.2


reply via email to

[Prev in Thread] Current Thread [Next in Thread]