configure.ac: Add --enable-build-poststage1-with-cxx.
authorIan Lance Taylor <iant@google.com>
Tue, 19 Jul 2011 18:33:25 +0000 (18:33 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 19 Jul 2011 18:33:25 +0000 (18:33 +0000)
./: * configure.ac: Add --enable-build-poststage1-with-cxx.  If set,
make C++ a boot_language.  Set and substitute
POSTSTAGE1_CONFIGURE_FLAGS.
* Makefile.tpl (POSTSTAGE1_CONFIGURE_FLAGS): New variable.
(STAGE[+id+]_CONFIGURE_FLAGS): Add $(POSTSTAGE1_CONFIGURE_FLAGS).
* configure, Makefile.in: Rebuild.
gcc/:
* doc/install.texi (Configuration): Document
--enable-build-poststage1-with-cxx.

From-SVN: r176480

ChangeLog
Makefile.in
Makefile.tpl
configure
configure.ac
gcc/ChangeLog
gcc/doc/install.texi

index 8af7cbc6985f0e0774a136554bc0478ff96d0308..b8ff5f286ae3129c49c23935b18cec4e0744f0d0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-07-19  Ian Lance Taylor  <iant@google.com>
+
+       * configure.ac: Add --enable-build-poststage1-with-cxx.  If set,
+       make C++ a boot_language.  Set and substitute
+       POSTSTAGE1_CONFIGURE_FLAGS.
+       * Makefile.tpl (POSTSTAGE1_CONFIGURE_FLAGS): New variable.
+       (STAGE[+id+]_CONFIGURE_FLAGS): Add $(POSTSTAGE1_CONFIGURE_FLAGS).
+       * configure, Makefile.in: Rebuild.
+
 2011-07-19  Vladimir Makarov  <vmakarov@redhat.com>
 
        * MAINTAINERS (Register Allocation): Move myself from reviewers to
index 3b8e6c748590deaf11fd620d7e1d9d450c54b420..6df70593a26916959403f32c35010e0f9bb64272 100644 (file)
@@ -415,6 +415,7 @@ TFLAGS =
 STAGE_CFLAGS = $(BOOT_CFLAGS)
 STAGE_TFLAGS = $(TFLAGS)
 STAGE_CONFIGURE_FLAGS=@stage2_werror_flag@
+POSTSTAGE1_CONFIGURE_FLAGS = @POSTSTAGE1_CONFIGURE_FLAGS@
 
 
 # Defaults for stage 1; some are overridden below.
@@ -425,7 +426,10 @@ STAGE1_CXXFLAGS = $(CXXFLAGS)
 STAGE1_CXXFLAGS = $(STAGE1_CFLAGS)
 @endif target-libstdc++-v3-bootstrap
 STAGE1_TFLAGS = $(STAGE_TFLAGS)
-STAGE1_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
+# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
+# POSTSTAGE1_CONFIGURE_FLAGS here.
+STAGE1_CONFIGURE_FLAGS = \
+       $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
 
 # Defaults for stage 2; some are overridden below.
 STAGE2_CFLAGS = $(STAGE_CFLAGS)
@@ -435,7 +439,10 @@ STAGE2_CXXFLAGS = $(CXXFLAGS)
 STAGE2_CXXFLAGS = $(STAGE2_CFLAGS)
 @endif target-libstdc++-v3-bootstrap
 STAGE2_TFLAGS = $(STAGE_TFLAGS)
-STAGE2_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
+# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
+# POSTSTAGE1_CONFIGURE_FLAGS here.
+STAGE2_CONFIGURE_FLAGS = \
+       $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
 
 # Defaults for stage 3; some are overridden below.
 STAGE3_CFLAGS = $(STAGE_CFLAGS)
@@ -445,7 +452,10 @@ STAGE3_CXXFLAGS = $(CXXFLAGS)
 STAGE3_CXXFLAGS = $(STAGE3_CFLAGS)
 @endif target-libstdc++-v3-bootstrap
 STAGE3_TFLAGS = $(STAGE_TFLAGS)
-STAGE3_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
+# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
+# POSTSTAGE1_CONFIGURE_FLAGS here.
+STAGE3_CONFIGURE_FLAGS = \
+       $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
 
 # Defaults for stage 4; some are overridden below.
 STAGE4_CFLAGS = $(STAGE_CFLAGS)
@@ -455,7 +465,10 @@ STAGE4_CXXFLAGS = $(CXXFLAGS)
 STAGE4_CXXFLAGS = $(STAGE4_CFLAGS)
 @endif target-libstdc++-v3-bootstrap
 STAGE4_TFLAGS = $(STAGE_TFLAGS)
-STAGE4_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
+# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
+# POSTSTAGE1_CONFIGURE_FLAGS here.
+STAGE4_CONFIGURE_FLAGS = \
+       $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
 
 # Defaults for stage profile; some are overridden below.
 STAGEprofile_CFLAGS = $(STAGE_CFLAGS)
@@ -465,7 +478,10 @@ STAGEprofile_CXXFLAGS = $(CXXFLAGS)
 STAGEprofile_CXXFLAGS = $(STAGEprofile_CFLAGS)
 @endif target-libstdc++-v3-bootstrap
 STAGEprofile_TFLAGS = $(STAGE_TFLAGS)
-STAGEprofile_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
+# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
+# POSTSTAGE1_CONFIGURE_FLAGS here.
+STAGEprofile_CONFIGURE_FLAGS = \
+       $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
 
 # Defaults for stage feedback; some are overridden below.
 STAGEfeedback_CFLAGS = $(STAGE_CFLAGS)
@@ -475,7 +491,10 @@ STAGEfeedback_CXXFLAGS = $(CXXFLAGS)
 STAGEfeedback_CXXFLAGS = $(STAGEfeedback_CFLAGS)
 @endif target-libstdc++-v3-bootstrap
 STAGEfeedback_TFLAGS = $(STAGE_TFLAGS)
-STAGEfeedback_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
+# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
+# POSTSTAGE1_CONFIGURE_FLAGS here.
+STAGEfeedback_CONFIGURE_FLAGS = \
+       $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
 
 
 # Only build the C compiler for stage1, because that is the only one that
@@ -493,6 +512,9 @@ STAGE1_LANGUAGES = @stage1_languages@
 #   the last argument when conflicting --enable arguments are passed.
 # * Likewise, we force-disable coverage flags, since the installed
 #   compiler probably has never heard of them.
+# * Don't remove this, because above we added
+#   POSTSTAGE1_CONFIGURE_FLAGS to STAGE_CONFIGURE_FLAGS, which
+#   we don't want for STAGE1_CONFIGURE_FLAGS.
 STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
          --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"
 
index 0d2a0bfff2d5763a3fe091a5382931eb7092af2b..08d8b2f8b4745119cccfff28d6c1c8c64716f2e6 100644 (file)
@@ -418,6 +418,7 @@ TFLAGS =
 STAGE_CFLAGS = $(BOOT_CFLAGS)
 STAGE_TFLAGS = $(TFLAGS)
 STAGE_CONFIGURE_FLAGS=@stage2_werror_flag@
+POSTSTAGE1_CONFIGURE_FLAGS = @POSTSTAGE1_CONFIGURE_FLAGS@
 
 [+ FOR bootstrap-stage +]
 # Defaults for stage [+id+]; some are overridden below.
@@ -428,7 +429,10 @@ STAGE[+id+]_CXXFLAGS = $(CXXFLAGS)
 STAGE[+id+]_CXXFLAGS = $(STAGE[+id+]_CFLAGS)
 @endif target-libstdc++-v3-bootstrap
 STAGE[+id+]_TFLAGS = $(STAGE_TFLAGS)
-STAGE[+id+]_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
+# STAGE1_CONFIGURE_FLAGS overridden below, so we can use
+# POSTSTAGE1_CONFIGURE_FLAGS here.
+STAGE[+id+]_CONFIGURE_FLAGS = \
+       $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS)
 [+ ENDFOR bootstrap-stage +]
 
 # Only build the C compiler for stage1, because that is the only one that
@@ -446,6 +450,9 @@ STAGE1_LANGUAGES = @stage1_languages@
 #   the last argument when conflicting --enable arguments are passed.
 # * Likewise, we force-disable coverage flags, since the installed
 #   compiler probably has never heard of them.
+# * Don't remove this, because above we added
+#   POSTSTAGE1_CONFIGURE_FLAGS to STAGE[+id+]_CONFIGURE_FLAGS, which
+#   we don't want for STAGE1_CONFIGURE_FLAGS.
 STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
          --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"
 
index 0097ab1ccb4deeabb55535f63ccb1aff484e7b02..40314d6cbd8d87c97bfe0ef06e7ee7b0f1cde927 100755 (executable)
--- a/configure
+++ b/configure
@@ -556,6 +556,7 @@ enable_option_checking=no
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 compare_exclusions
+POSTSTAGE1_CONFIGURE_FLAGS
 stage2_werror_flag
 stage1_checking
 stage1_cflags
@@ -749,6 +750,7 @@ enable_libada
 enable_libssp
 enable_static_libjava
 enable_build_with_cxx
+enable_build_poststage1_with_cxx
 with_mpc
 with_mpc_include
 with_mpc_lib
@@ -1465,6 +1467,8 @@ Optional Features:
   --enable-static-libjava[=ARG]
                           build static libjava [default=no]
   --enable-build-with-cxx build with C++ compiler instead of C compiler
+  --enable-build-poststage1-with-cxx
+                          build stages 2 and 3 with C++, not C
   --disable-ppl-version-check
                           disable check for PPL version
   --enable-cloog-backend[=BACKEND]
@@ -4988,6 +4992,15 @@ else
 fi
 
 
+# Build stage1 with C and build stages 2 and 3 with C++.
+# Check whether --enable-build-poststage1-with-cxx was given.
+if test "${enable_build_poststage1_with_cxx+set}" = set; then :
+  enableval=$enable_build_poststage1_with_cxx; ENABLE_BUILD_POSTSTAGE1_WITH_CXX=$enableval
+else
+  ENABLE_BUILD_POSTSTAGE1_WITH_CXX=yes
+fi
+
+
 # Used for setting $lt_cv_objdir
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
 $as_echo_n "checking for objdir... " >&6; }
@@ -6181,9 +6194,11 @@ if test -d ${srcdir}/gcc; then
           exit 1
         fi
 
-       if test "$language" = "c++" \
-          && test "$ENABLE_BUILD_WITH_CXX" = "yes"; then
-         boot_language=yes
+       if test "$language" = "c++"; then
+         if test "$ENABLE_BUILD_WITH_CXX" = "yes" \
+            || test "$ENABLE_BUILD_POSTSTAGE1_WITH_CXX" = "yes"; then
+           boot_language=yes
+         fi
        fi
 
         case ,${enable_languages}, in
@@ -6937,10 +6952,10 @@ $as_echo "$as_me: WARNING: trying to bootstrap a cross compiler" >&2;}
     ;;
 esac
 
-case ",$enable_languages,:$ENABLE_BUILD_WITH_CXX:$enable_bootstrap" in
-  *,c++,*:yes:yes) ;;
-  *:yes:yes)
-    as_fn_error "bootstrapping with --enable-build-with-cxx requires c++ in --enable-languages" "$LINENO" 5
+case ",$enable_languages,:,$ENABLE_BUILD_WITH_CXX,$ENABLE_BUILD_POSTSTAGE1_WITH_CXX,:$enable_bootstrap" in
+  *,c++,*:*:*) ;;
+  *:*,yes,*:yes)
+    as_fn_error "bootstrapping with --enable-build-with-cxx or --enable-build-postage1-with-cxx requires c++ in --enable-languages" "$LINENO" 5
     ;;
 esac
 
@@ -13990,6 +14005,15 @@ case ${enable_werror} in
 esac
 
 
+# If using ENABLE_BUILD_POSTSTAGE1_WITH_CXX, pass
+# --enable-build-with-cxx after stage1.
+if test "$ENABLE_BUILD_POSTSTAGE1_WITH_CXX" = "yes"; then
+  POSTSTAGE1_CONFIGURE_FLAGS=--enable-build-with-cxx
+else
+  POSTSTAGE1_CONFIGURE_FLAGS=
+fi
+
+
 # Specify what files to not compare during bootstrap.
 
 compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
index 7085eeaf23583747fbdb057751c1092d21f0afc0..c53d381b727c78c9b9a0ef192a52a11bdc084ce8 100644 (file)
@@ -1140,6 +1140,13 @@ AC_ARG_ENABLE(build-with-cxx,
 ENABLE_BUILD_WITH_CXX=$enableval,
 ENABLE_BUILD_WITH_CXX=no)
 
+# Build stage1 with C and build stages 2 and 3 with C++.
+AC_ARG_ENABLE(build-poststage1-with-cxx,
+[AS_HELP_STRING([--enable-build-poststage1-with-cxx],
+               [build stages 2 and 3 with C++, not C])],
+ENABLE_BUILD_POSTSTAGE1_WITH_CXX=$enableval,
+ENABLE_BUILD_POSTSTAGE1_WITH_CXX=yes)
+
 # Used for setting $lt_cv_objdir
 _LT_CHECK_OBJDIR
 
@@ -1710,9 +1717,11 @@ if test -d ${srcdir}/gcc; then
           exit 1
         fi
 
-       if test "$language" = "c++" \
-          && test "$ENABLE_BUILD_WITH_CXX" = "yes"; then
-         boot_language=yes
+       if test "$language" = "c++"; then
+         if test "$ENABLE_BUILD_WITH_CXX" = "yes" \
+            || test "$ENABLE_BUILD_POSTSTAGE1_WITH_CXX" = "yes"; then
+           boot_language=yes
+         fi
        fi
 
         case ,${enable_languages}, in
@@ -2411,10 +2420,10 @@ case "$have_compiler:$host:$target:$enable_bootstrap" in
     ;;
 esac
 
-case ",$enable_languages,:$ENABLE_BUILD_WITH_CXX:$enable_bootstrap" in
-  *,c++,*:yes:yes) ;;
-  *:yes:yes)
-    AC_MSG_ERROR([bootstrapping with --enable-build-with-cxx requires c++ in --enable-languages])
+case ",$enable_languages,:,$ENABLE_BUILD_WITH_CXX,$ENABLE_BUILD_POSTSTAGE1_WITH_CXX,:$enable_bootstrap" in
+  *,c++,*:*:*) ;;
+  *:*,yes,*:yes)
+    AC_MSG_ERROR([bootstrapping with --enable-build-with-cxx or --enable-build-postage1-with-cxx requires c++ in --enable-languages])
     ;;
 esac
 
@@ -3202,6 +3211,15 @@ case ${enable_werror} in
 esac
 AC_SUBST(stage2_werror_flag)
 
+# If using ENABLE_BUILD_POSTSTAGE1_WITH_CXX, pass
+# --enable-build-with-cxx after stage1.
+if test "$ENABLE_BUILD_POSTSTAGE1_WITH_CXX" = "yes"; then
+  POSTSTAGE1_CONFIGURE_FLAGS=--enable-build-with-cxx
+else
+  POSTSTAGE1_CONFIGURE_FLAGS=
+fi
+AC_SUBST(POSTSTAGE1_CONFIGURE_FLAGS)
+
 # Specify what files to not compare during bootstrap.
 
 compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
index 507ba8f222ad8eb77b96e9b52db5828e6fe6ab65..bac2275466d4f3aa6f6f40d7419272a6ede2276b 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-19  Ian Lance Taylor  <iant@google.com>
+
+       * doc/install.texi (Configuration): Document
+       --enable-build-poststage1-with-cxx.
+
 2011-07-19  Robert Millan  <rmh@gnu.org>
 
        * config/mips/gnu-user.h: Copy from linux.h.  Update comments.
index fdf17b9805636eba1b3baccd2ee53322ec84ce3e..9b1b037c02a5107fb51656a0d6773a39c2e99ce5 100644 (file)
@@ -1284,6 +1284,13 @@ will try to guess whether the @code{.init_array} and
 Build GCC using a C++ compiler rather than a C compiler.  This is an
 experimental option which may become the default in a later release.
 
+@item --enable-build-poststage1-with-cxx
+When bootstrapping, build stages 2 and 3 of GCC using a C++ compiler
+rather than a C compiler.  Stage 1 is still built with a C compiler.
+This is an experimental option which may become the default in a later
+release.  This is enabled by default and may be disabled using
+@option{--disable-build-poststage1-with-cxx}.
+
 @item --enable-maintainer-mode
 The build rules that regenerate the Autoconf and Automake output files as
 well as the GCC master message catalog @file{gcc.pot} are normally