Patchwork RFA: Fix bootstrap/44432

login
register
mail settings
Submitter Joern Rennecke
Date June 8, 2010, 10:48 p.m.
Message ID <20100608184804.6wo3ezps0w84swkg-nzlynne@webmail.spamcop.net>
Download mbox | patch
Permalink /patch/55040/
State New
Headers show

Comments

Joern Rennecke - June 8, 2010, 10:48 p.m.
This adds a check that a trivial source file can be compiled as C++
before invoking ZW_PROG_COMPILER_DEPENDENCIES - the latter macro
was the source of the unhelpful error message.

I have verified that the expected error message appears when doing a
sequential or parallel bootstrap on a machine with the c++ compiler disabled,
and that during bootstrap with the c++ compiler re-enabled, the libcpp
configure succeeds.
2010-06-08  Joern Rennecke  <joern.rennecke@embecosm.com>

	PR bootstrap/44432
	* configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
	check that C++ compiler works.
	* configure: Regenerate.
Paolo Bonzini - June 9, 2010, 6:12 a.m.
On 06/09/2010 12:48 AM, Joern Rennecke wrote:
> This adds a check that a trivial source file can be compiled as C++
> before invoking ZW_PROG_COMPILER_DEPENDENCIES - the latter macro
> was the source of the unhelpful error message.
>
> I have verified that the expected error message appears when doing a
> sequential or parallel bootstrap on a machine with the c++ compiler
> disabled,
> and that during bootstrap with the c++ compiler re-enabled, the libcpp
> configure succeeds.

Ok.

Paolo

Patch

Index: libcpp/configure.ac
===================================================================
--- libcpp/configure.ac	(revision 160389)
+++ libcpp/configure.ac	(working copy)
@@ -45,6 +45,10 @@  ZW_CREATE_DEPDIR
 if test "$ENABLE_BUILD_WITH_CXX" = "no"; then
 ZW_PROG_COMPILER_DEPENDENCIES([CC])
 else
+AC_LANG_PUSH([C++])
+AC_COMPILE_IFELSE([[int i;]], [],
+		  [AC_MSG_ERROR([C++ compiler missing or inoperational])])
+AC_LANG_POP([C++])
 ZW_PROG_COMPILER_DEPENDENCIES([CXX])
 fi