aboutsummaryrefslogtreecommitdiff
path: root/gcc/configure.ac
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2011-10-19 16:02:30 +0000
committerRainer Orth <ro@gcc.gnu.org>2011-10-19 16:02:30 +0000
commit87fb500b9377df6eddfc8efd0b5aa186e075951e (patch)
treeff885ca14bd208f4f68df8f5bac6ccd4ad83387b /gcc/configure.ac
parent09dbcd96d6b668e325e3b34297648d12f25e51b9 (diff)
downloadgcc-87fb500b9377df6eddfc8efd0b5aa186e075951e.zip
gcc-87fb500b9377df6eddfc8efd0b5aa186e075951e.tar.gz
gcc-87fb500b9377df6eddfc8efd0b5aa186e075951e.tar.bz2
Properly test for madvise on Solaris 10 (PR bootstrap/50777)
PR bootstrap/50777 * configure.ac: Save and restore CXXFLAGS around gcc_AC_CHECK_DECLS uses. Check for madvise() declaration with g++ if --enable-build-with-cxx. * configure: Regenerate. * config.in: Regenerate. * ggc-page.c (USING_MADVISE): Also check HAVE_DECL_MADVISE. From-SVN: r180195
Diffstat (limited to 'gcc/configure.ac')
-rw-r--r--gcc/configure.ac20
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/configure.ac b/gcc/configure.ac
index d19ca07..d63acea 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1094,6 +1094,8 @@ AM_LANGINFO_CODESET
# We will need to find libiberty.h and ansidecl.h
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
+saved_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS -I${srcdir} -I${srcdir}/../include"
gcc_AC_CHECK_DECLS(getenv atol asprintf sbrk abort atof getcwd getwd \
strsignal strstr strverscmp \
errno snprintf vsnprintf vasprintf malloc realloc calloc \
@@ -1146,6 +1148,21 @@ gcc_AC_CHECK_DECLS(sigaltstack, , ,[
#include <signal.h>
])
+# g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which hides the madvise()
+# prototype.
+AS_IF([test "$ENABLE_BUILD_WITH_CXX" = "yes"],
+ [AC_LANG_PUSH([C++])
+ gcc_AC_CHECK_DECLS(madvise, , ,[
+ #include "ansidecl.h"
+ #include "system.h"
+ ])
+ AC_LANG_POP([C++])],
+ [gcc_AC_CHECK_DECLS(madvise, , ,[
+ #include "ansidecl.h"
+ #include "system.h"
+ ])
+])
+
# More time-related stuff.
AC_CACHE_CHECK(for struct tms, ac_cv_struct_tms, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@@ -1172,8 +1189,9 @@ if test $gcc_cv_type_clock_t = yes; then
[Define if <time.h> defines clock_t.])
fi
-# Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
+# Restore CFLAGS, CXXFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
CFLAGS="$saved_CFLAGS"
+CXXFLAGS="$saved_CXXFLAGS"
gcc_AC_INITFINI_ARRAY