This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR bootstrap/42798
- From: Ralf Wildenhues <Ralf dot Wildenhues at gmx dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Joern Rennecke <joern dot rennecke at embecosm dot com>, bonzini at gnu dot org
- Date: Tue, 1 Jun 2010 22:44:09 +0200
- Subject: [PATCH] Fix PR bootstrap/42798
I'm bootstrapping this patch with and without --enable-build-with-cxx.
OK for trunk if that succeeds? I will then look into syncing to src
again.
Converting libcpp and fixincludes also, in case they ever happen to use
_GNU_SOURCE.
Thanks,
Ralf
config/ChangeLog:
2010-06-01 Joern Rennecke <joern.rennecke@embecosm.com>
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR bootstrap/42798
* override.m4 (_AC_CHECK_DECL_BODY, _AC_CHECK_DECLS): Import
definitions from git Autoconf.
libiberty/ChangeLog:
2010-06-01 Joern Rennecke <joern.rennecke@embecosm.com>
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR bootstrap/42798
* configure.ac: Check for declaration of 'basename(char *)',
* configure: Regenerate.
libjava/classpath/ChangeLog:
2010-06-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure: Regenerate.
libjava/ChangeLog:
2010-06-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure: Regenerate.
fixincludes/ChangeLog:
2010-06-01 Joern Rennecke <joern.rennecke@embecosm.com>
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR bootstrap/42798
* configure.ac: Check for declaration of 'basename(char *)',
* configure: Regenerate.
libcpp/ChangeLog:
2010-06-01 Joern Rennecke <joern.rennecke@embecosm.com>
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR bootstrap/42798
* configure.ac: Check for declaration of 'basename(char *)',
* configure: Regenerate.
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])])])
+
+])
diff --git a/libcpp/configure.ac b/libcpp/configure.ac
index d520e93..ea5b533 100644
--- a/libcpp/configure.ac
+++ b/libcpp/configure.ac
@@ -81,7 +81,8 @@ define(libcpp_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl
fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
putchar_unlocked putc_unlocked)
AC_CHECK_FUNCS(libcpp_UNLOCKED_FUNCS)
-AC_CHECK_DECLS(m4_split(m4_normalize(abort asprintf basename errno getopt \
+AC_CHECK_DECLS([basename(char *)])
+AC_CHECK_DECLS(m4_split(m4_normalize(abort asprintf errno getopt \
libcpp_UNLOCKED_FUNCS vasprintf)))
# Checks for library functions.
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index 515bb33..25f0b03 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -379,7 +379,7 @@ if test "x" = "y"; then
table times tmpnam \
vasprintf vfprintf vprintf vsprintf \
wait3 wait4 waitpid)
- AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf, snprintf, vsnprintf])
+ AC_CHECK_DECLS([basename(char *), ffs, asprintf, vasprintf, snprintf, vsnprintf])
AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if you have the sys_errlist variable.])
AC_DEFINE(HAVE_SYS_NERR, 1, [Define if you have the sys_nerr variable.])
AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if you have the sys_siglist variable.])
diff --git a/fixincludes/configure.ac b/fixincludes/configure.ac
index f30a642..f20fd4b 100644
--- a/fixincludes/configure.ac
+++ b/fixincludes/configure.ac
@@ -87,7 +87,8 @@ define(fixincludes_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl
fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
putchar_unlocked putc_unlocked)
AC_CHECK_FUNCS(fixincludes_UNLOCKED_FUNCS)
-AC_CHECK_DECLS(m4_split(m4_normalize(abort asprintf basename errno vasprintf fixincludes_UNLOCKED_FUNCS)))
+AC_CHECK_DECLS([basename(char *)])
+AC_CHECK_DECLS(m4_split(m4_normalize(abort asprintf errno vasprintf fixincludes_UNLOCKED_FUNCS)))
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST