+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
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.
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)
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)
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)
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)
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)
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
# 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)"
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.
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
# 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)"
ac_subst_vars='LTLIBOBJS
LIBOBJS
compare_exclusions
+POSTSTAGE1_CONFIGURE_FLAGS
stage2_werror_flag
stage1_checking
stage1_cflags
enable_libssp
enable_static_libjava
enable_build_with_cxx
+enable_build_poststage1_with_cxx
with_mpc
with_mpc_include
with_mpc_lib
--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]
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; }
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
;;
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
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/*"
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
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
;;
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
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/*"
+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.
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