From bdd5dc28aa04c3bc6b10fe6bdd01ddbd59e689c7 Mon Sep 17 00:00:00 2001 From: Diego Novillo Date: Thu, 31 May 2012 13:25:41 -0400 Subject: [PATCH] Fix compilation of build/*.o when using C++. Found this while testing the C++ conversion for vec.[ch] on the cxx-conversion branch. We do not build the build/*.o files with g++, so I was getting lots of syntax errors while compiling build/vec.o. 2012-05-31 Diego Novillo * configure.ac (CXX_FOR_BUILD): Define and substitute. (BUILD_CXXFLAGS): Define and substitute. * Makefile.in (BUILD_CXXFLAGS): Define. (CXX_FOR_BUILD): Define. (COMPILER_FOR_BUILD): Set to CXX_FOR_BUILD if building with C++. (LINKER_FOR_BUILD): Likewise. (BUILD_COMPILERFLAGS): Set to BUILD_CXXFLAGS if building with C++. (BUILD_LINKERFLAGS): Likewise. * configure: Regenerate. From-SVN: r188069 --- gcc/ChangeLog | 12 ++++++++++++ gcc/Makefile.in | 12 ++++++++++++ gcc/configure | 8 ++++++-- gcc/configure.ac | 2 ++ 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a2c5d69ab30..c63e3c09bcc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2012-05-31 Diego Novillo + + * configure.ac (CXX_FOR_BUILD): Define and substitute. + (BUILD_CXXFLAGS): Define and substitute. + * Makefile.in (BUILD_CXXFLAGS): Define. + (CXX_FOR_BUILD): Define. + (COMPILER_FOR_BUILD): Set to CXX_FOR_BUILD if building with C++. + (LINKER_FOR_BUILD): Likewise. + (BUILD_COMPILERFLAGS): Set to BUILD_CXXFLAGS if building with C++. + (BUILD_LINKERFLAGS): Likewise. + * configure: Regenerate. + 2012-05-31 Steven Bosscher * Makefile.in: Fix many dependencies. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 53f49807ced..b36818d536a 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -728,15 +728,27 @@ DIR = ../gcc # Native compiler for the build machine and its switches. CC_FOR_BUILD = @CC_FOR_BUILD@ +CXX_FOR_BUILD = @CXX_FOR_BUILD@ BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE +BUILD_CXXFLAGS = @BUILD_CXXFLAGS@ -DGENERATOR_FILE # Native compiler that we use. This may be C++ some day. +ifneq ($(ENABLE_BUILD_WITH_CXX),yes) COMPILER_FOR_BUILD = $(CC_FOR_BUILD) BUILD_COMPILERFLAGS = $(BUILD_CFLAGS) +else +COMPILER_FOR_BUILD = $(CXX_FOR_BUILD) +BUILD_COMPILERFLAGS = $(BUILD_CXXFLAGS) +endif # Native linker that we use. +ifneq ($(ENABLE_BUILD_WITH_CXX),yes) LINKER_FOR_BUILD = $(CC_FOR_BUILD) BUILD_LINKERFLAGS = $(BUILD_CFLAGS) +else +LINKER_FOR_BUILD = $(CXX_FOR_BUILD) +BUILD_LINKERFLAGS = $(BUILD_CXXFLAGS) +endif # Native linker and preprocessor flags. For x-fragment overrides. BUILD_LDFLAGS=@BUILD_LDFLAGS@ diff --git a/gcc/configure b/gcc/configure index 1cd61344511..1fdf0af80ca 100755 --- a/gcc/configure +++ b/gcc/configure @@ -703,7 +703,9 @@ LIBTOOL collect2 STMP_FIXINC BUILD_LDFLAGS +BUILD_CXXFLAGS BUILD_CFLAGS +CXX_FOR_BUILD CC_FOR_BUILD inhibit_libc SYSTEM_HEADER_DIR @@ -11835,7 +11837,9 @@ fi # These are the normal (build=host) settings: CC_FOR_BUILD='$(CC)' +CXX_FOR_BUILD='$(CXX)' BUILD_CFLAGS='$(ALL_CFLAGS)' +BUILD_CXXFLAGS='$(ALL_CXXFLAGS)' BUILD_LDFLAGS='$(LDFLAGS)' STMP_FIXINC=stmp-fixinc @@ -17967,7 +17971,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17970 "configure" +#line 17974 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -18073,7 +18077,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18076 "configure" +#line 18080 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index a3a40389a3c..22dab55a24a 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1848,7 +1848,9 @@ AC_SUBST(inhibit_libc) # These are the normal (build=host) settings: CC_FOR_BUILD='$(CC)' AC_SUBST(CC_FOR_BUILD) +CXX_FOR_BUILD='$(CXX)' AC_SUBST(CXX_FOR_BUILD) BUILD_CFLAGS='$(ALL_CFLAGS)' AC_SUBST(BUILD_CFLAGS) +BUILD_CXXFLAGS='$(ALL_CXXFLAGS)' AC_SUBST(BUILD_CXXFLAGS) BUILD_LDFLAGS='$(LDFLAGS)' AC_SUBST(BUILD_LDFLAGS) STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_FIXINC) -- 2.11.4.GIT