From 7ab76cecd643d0d098fb7293340afa0e2b5f9f37 Mon Sep 17 00:00:00 2001 From: ian Date: Wed, 24 Jun 2009 04:03:51 +0000 Subject: ./: * configure.ac: Add --enable-build-with-cxx. When set, add c++ to boot_languages. Only bootstrap target libraries listed in target_libs for some boot language. Add --with-stage1-ldflags, --with-stage1-libs, --with-boot-ldflags, --with-boot-libs. Remove with_host_libstdcxx from ppllibs. Only add -fkeep-inline-functions if not building with C++. * Makefile.def: For target_module libstdc++-v3, set bootstrap=true. * Makefile.tpl (STAGE1_LDFLAGS, STAGE1_LIBS): New variables. (POSTSTAGE1_LDFLAGS, POSTSTAGE1_LIBS): New variables. (HOST_EXPORTS): Add STAGE1_LDFLAGS to LDFLAGS. Export HOST_LIBS. (POSTSTAGE1_HOST_EXPORTS): Set CXX and CXX_FOR_BUILD. Add POSTSTAGE1_LDFLAGS to LDFLAGS. Export HOST_LIBS. (POSTSTAGE1_FLAGS_TO_PASS): Likewise. * configure, Makefile.in: Rebuild. gcc/: * configure.ac: Invoke AC_PROG_CXX. Separate C specific warnings from loose_warn into c_loose_warn and from strict_warn into c_strict_warn. Set and substitute warn_cxxflags. Check for --enable-build-with-cxx. Set and substitute ENABLE_BUILD_WITH_CXX. Set and substitute HOST_LIBS. * Makefile.in (CXXFLAGS): New variable. (C_LOOSE_WARN, C_STRICT_WARN): New variables. (GCC_WARN_CFLAGS): Add $(C_LOOSE_WARN). Add $(C_STRICT_WARN) if the default is the same as $(STRICT_WARN). (GCC_WARN_CXXFLAGS, WARN_CXXFLAGS): New variables. (CXX): New variable. (COMPILER): New value if ENABLE_BUILD_WITH_CXX. (COMPILER_FLAGS, LINKER, LINKER_FLAGS): Likewise. (ALL_COMPILERFLAGS, ALL_LINKERFLAGS): Likewise. (HOST_LIBS): New variable. (GCC_CFLAGS): Add $(C_LOOSE_WARN). (ALL_CXXFLAGS): New variable. (LIBS, BACKENDLIBS): Add $(HOST_LIBS). * doc/install.texi (Configuration): Document --enable-build-with-cxx, --with-stage1-ldflags, --with-stage1-libs, --with-boot-ldflags, --with-boot-libs. * configure: Rebuild. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148889 138bc75d-0d04-0410-961f-82ee72b054a4 --- Makefile.tpl | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'Makefile.tpl') diff --git a/Makefile.tpl b/Makefile.tpl index 44c2bd88f90..24952813347 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -120,6 +120,19 @@ BUILD_SUBDIR = @build_subdir@ # directories built for the build system. BUILD_CONFIGARGS = @build_configargs@ --with-build-subdir="$(BUILD_SUBDIR)" +# Linker flags to use on the host, for stage1 or when not +# bootstrapping. +STAGE1_LDFLAGS = @stage1_ldflags@ + +# Libraries to use on the host, for stage1 or when not bootstrapping. +STAGE1_LIBS = @stage1_libs@ + +# Linker flags to use for stage2 and later. +POSTSTAGE1_LDFLAGS = @poststage1_ldflags@ + +# Libraries to use for stage2 and later. +POSTSTAGE1_LIBS = @poststage1_libs@ + # This is the list of variables to export in the environment when # configuring any subdirectory. It must also be exported whenever # recursing into a build directory in case that directory's Makefile @@ -185,7 +198,7 @@ HOST_EXPORTS = \ CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ LD="$(LD)"; export LD; \ - LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + LDFLAGS="$(STAGE1_LDFLAGS) $(LDFLAGS)"; export LDFLAGS; \ NM="$(NM)"; export NM; \ RANLIB="$(RANLIB)"; export RANLIB; \ WINDRES="$(WINDRES)"; export WINDRES; \ @@ -200,6 +213,7 @@ HOST_EXPORTS = \ OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \ RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \ TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ + HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \ GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \ GMPINC="$(HOST_GMPINC)"; export GMPINC; \ PPLLIBS="$(HOST_PPLLIBS)"; export PPLLIBS; \ @@ -218,8 +232,16 @@ POSTSTAGE1_HOST_EXPORTS = \ -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ \ $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \ CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \ - GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND \ - LDFLAGS="$(BOOT_LDFLAGS)"; export LDFLAGS; + CXX="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/g++$(exeext) \ + -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \ + -I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \ + -I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \ + -I$$r/$(srcdir)/libstdc++-v3/libsupc++ \ + -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs"; export CXX; \ + CXX_FOR_BUILD="$$CXX"; export CXX_FOR_BUILD; \ + GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND; \ + LDFLAGS="$(POSTSTAGE1_LDFLAGS) $(BOOT_LDFLAGS)"; export LDFLAGS; \ + HOST_LIBS="$(POSTSTAGE1_LIBS)"; export HOST_LIBS; # Target libraries are put under this directory: TARGET_SUBDIR = @target_subdir@ @@ -540,8 +562,11 @@ X11_FLAGS_TO_PASS = \ # Flags to pass to stage2 and later makes. POSTSTAGE1_FLAGS_TO_PASS = \ - CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" GNATBIND="$${GNATBIND}" \ - LDFLAGS="$(BOOT_LDFLAGS)" \ + CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \ + CXX="$${CXX}" CXX_FOR_BUILD="$${CXX_FOR_BUILD}" \ + GNATBIND="$${GNATBIND}" \ + LDFLAGS="$(POSTSTAGE1_LDFLAGS) $(BOOT_LDFLAGS)" \ + HOST_LIBS="$(POSTSTAGE1_LIBS)" \ "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" # Flags to pass down to makes which are built with the target environment. -- cgit v1.2.1