Patchwork PATCH RFA: #define ENABLE_BUILD_WITH_CXX, check for C++ header files

login
register
mail settings
Submitter Ian Taylor
Date Dec. 2, 2010, 9:01 p.m.
Message ID <mcrk4jr7uup.fsf@google.com>
Download mbox | patch
Permalink /patch/74030/
State New
Headers show

Comments

Ian Taylor - Dec. 2, 2010, 9:01 p.m.
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.
Ralf Wildenhues - Dec. 2, 2010, 9:04 p.m.
* Ian Lance Taylor wrote on Thu, Dec 02, 2010 at 10:01:02PM CET:
> 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?

OK.

> 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.

> --- configure.ac	(revision 167382)
> +++ configure.ac	(working copy)

> +# --------------------
> +# Checks for C++ headers
> +# --------------------

Align dashes with text?  ;-)

Thanks,
Ralf

Patch

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
 # --------