This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH RFA: #define ENABLE_BUILD_WITH_CXX, check for C++ header files
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 02 Dec 2010 13:01:02 -0800
- Subject: PATCH RFA: #define ENABLE_BUILD_WITH_CXX, check for C++ header files
This simple patch to gcc/configure.ac #defines ENABLE_BUILD_WITH_CXX
when appropriate, and checks for the existence of a few C++ header
files. This is, of course, for the Go frontend merge. The Go frontend
tests these values to control the compilation of the C++ code.
Bootstrapped on x86_64-unknown-linux-gnu. OK for mainline?
Ian
2010-12-02 Ian Lance Taylor <iant@google.com>
* configure.ac: AC_DEFINE ENABLE_BUILD_WITH_CXX. Check for C++
header files unordered_map, tr1/unordered_map, and ext/hash_map.
* configure, config.in: Rebuild.
Index: configure.ac
===================================================================
--- configure.ac (revision 167382)
+++ configure.ac (working copy)
@@ -589,6 +589,10 @@ AC_ARG_ENABLE(build-with-cxx,
ENABLE_BUILD_WITH_CXX=$enableval,
ENABLE_BUILD_WITH_CXX=no)
AC_SUBST(ENABLE_BUILD_WITH_CXX)
+if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then
+ AC_DEFINE(ENABLE_BUILD_WITH_CXX, 1,
+ [Define if building with C++.])
+fi
# With stabs
AC_ARG_WITH(stabs,
@@ -905,6 +909,18 @@ AC_CHECK_HEADER(pthread.h, [have_pthread
gcc_AC_C_CHAR_BIT
AC_C_BIGENDIAN
+# --------------------
+# Checks for C++ headers
+# --------------------
+
+AC_LANG_PUSH(C++)
+
+AC_CHECK_HEADERS(unordered_map)
+AC_CHECK_HEADERS(tr1/unordered_map)
+AC_CHECK_HEADERS(ext/hash_map)
+
+AC_LANG_POP(C++)
+
# --------
# UNSORTED
# --------