[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/12] use a shell function for AC_CHECK_DECL
From: |
Paolo Bonzini |
Subject: |
[PATCH 08/12] use a shell function for AC_CHECK_DECL |
Date: |
Mon, 20 Oct 2008 15:35:47 +0200 |
2008-10-12 Paolo Bonzini <address@hidden>
* lib/autoconf/general.m4 (AC_CHECK_DECL): Use a shell function.
---
lib/autoconf/general.m4 | 22 +++++++++++++++++-----
1 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 21606aa..2987716 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -2689,15 +2689,27 @@ $2],
# -------------------------------------------------------
# Check whether SYMBOL (a function, variable, or constant) is declared.
AC_DEFUN([AC_CHECK_DECL],
-[AS_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$1])dnl
-AC_CACHE_CHECK([whether $1 is declared], [ac_Symbol],
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])],
-[#ifndef $1
- (void) $1;
+[AC_REQUIRE_SHELL_FN([ac_func_]_AC_LANG_ABBREV[_check_decl],
+ [AS_FUNCTION_DESCRIBE([ac_func_]_AC_LANG_ABBREV[_check_decl],
+ [LINENO SYMBOL],
+ [Tests whether SYMBOL is declared, setting a cache variable
accordingly.])], [
+AS_LINENO_PUSH([$[]1])
+ac_symbol=[$]2
+ac_includes=[$]3
+AS_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$ac_symbol])dnl
+AC_CACHE_CHECK([whether $ac_symbol is declared], [ac_Symbol],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_includes],
+[#ifndef $ac_symbol
+ (void) $ac_symbol;
#endif
])],
[AS_VAR_SET([ac_Symbol], [yes])],
[AS_VAR_SET([ac_Symbol], [no])])])
+AS_VAR_POPDEF([ac_Symbol])dnl
+AS_LINENO_POP
+])dnl
+ac_func_[]_AC_LANG_ABBREV[]_check_decl "$LINENO" "$1"
"AS_ESCAPE([AC_INCLUDES_DEFAULT([$4], ["])])"
+AS_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$1])dnl
AS_VAR_IF([ac_Symbol], [yes], [$2], [$3])[]dnl
AS_VAR_POPDEF([ac_Symbol])dnl
])# AC_CHECK_DECL
--
1.5.5
- [PATCH 08/12] use a shell function for AC_CHECK_DECL,
Paolo Bonzini <=