diff options
author | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2010-06-03 06:33:10 +0000 |
---|---|---|
committer | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2010-06-03 06:33:10 +0000 |
commit | 416a7ddd02bd7e6e95c2275008d82a469ca0de1e (patch) | |
tree | 0e0d551cbc7be01245122e2dbfc5ea85c143a328 /config | |
parent | 92ae5b9a844876931db11ee1384a64a252446005 (diff) | |
download | gdb-416a7ddd02bd7e6e95c2275008d82a469ca0de1e.zip gdb-416a7ddd02bd7e6e95c2275008d82a469ca0de1e.tar.gz gdb-416a7ddd02bd7e6e95c2275008d82a469ca0de1e.tar.bz2 |
Import AC_CHECK_DECL for C++ fixes from git Autoconf.
config/:
Sync from GCC:
PR bootstrap/42798
* override.m4 (_AC_CHECK_DECL_BODY, _AC_CHECK_DECLS): Import
definitions from git Autoconf.
Diffstat (limited to 'config')
-rw-r--r-- | config/ChangeLog | 8 | ||||
-rw-r--r-- | config/override.m4 | 41 |
2 files changed, 49 insertions, 0 deletions
diff --git a/config/ChangeLog b/config/ChangeLog index 140e2ce..e0561d2 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,11 @@ +2010-06-03 Joern Rennecke <joern.rennecke@embecosm.com> + Ralf Wildenhues <Ralf.Wildenhues@gmx.de> + + Sync from GCC: + PR bootstrap/42798 + * override.m4 (_AC_CHECK_DECL_BODY, _AC_CHECK_DECLS): Import + definitions from git Autoconf. + 2010-06-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> Sync from GCC: diff --git a/config/override.m4 b/config/override.m4 index cfa225a..47d8dac 100644 --- a/config/override.m4 +++ b/config/override.m4 @@ -272,3 +272,44 @@ m4_define([m4_wrap], [m4_ifdef([_$0_text], [m4_define([_$0_text], [$1])m4_builtin([m4wrap], [m4_default(m4_defn([_$0_text])m4_undefine([_$0_text]))])])]) ]) + +m4_version_prereq([2.66],, [ +dnl We need AC_CHECK_DECL which works for overloaded C++ functions. + +# _AC_CHECK_DECL_BODY +# ------------------- +# Shell function body for AC_CHECK_DECL. +m4_define([_AC_CHECK_DECL_BODY], +[ AS_LINENO_PUSH([$[]1]) + [as_decl_name=`echo $][2|sed 's/ *(.*//'`] + [as_decl_use=`echo $][2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`] + AC_CACHE_CHECK([whether $as_decl_name is declared], [$[]3], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$[]4], +[@%:@ifndef $[]as_decl_name +@%:@ifdef __cplusplus + (void) $[]as_decl_use; +@%:@else + (void) $[]as_decl_name; +@%:@endif +@%:@endif +])], + [AS_VAR_SET([$[]3], [yes])], + [AS_VAR_SET([$[]3], [no])])]) + AS_LINENO_POP +])# _AC_CHECK_DECL_BODY + +# _AC_CHECK_DECLS(SYMBOL, ACTION-IF_FOUND, ACTION-IF-NOT-FOUND, +# INCLUDES) +# ------------------------------------------------------------- +# Helper to AC_CHECK_DECLS, which generates the check for a single +# SYMBOL with INCLUDES, performs the AC_DEFINE, then expands +# ACTION-IF-FOUND or ACTION-IF-NOT-FOUND. +m4_define([_AC_CHECK_DECLS], +[AC_CHECK_DECL([$1], [ac_have_decl=1], [ac_have_decl=0], [$4])]dnl +[AC_DEFINE_UNQUOTED(AS_TR_CPP(m4_bpatsubst(HAVE_DECL_[$1],[ *(.*])), + [$ac_have_decl], + [Define to 1 if you have the declaration of `$1', + and to 0 if you don't.])]dnl +[m4_ifvaln([$2$3], [AS_IF([test $ac_have_decl = 1], [$2], [$3])])]) + +]) |