This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[toplevel] Add --enable-bootstrap configure switch
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 24 May 2004 17:09:55 +0200
- Subject: [toplevel] Add --enable-bootstrap configure switch
This patch completes the change introduced by the previous
maybe-deps patch, and is the real reason why I wanted to do
that.
It provides a --enable-bootstrap configure switch that will
enable toplevel bootstrapping: when it is used, make all
actually behaves like a "make bubblestrap". gcc-directory
bootstrapping of course requires --disable-bootstrap: indeed
the two rule bodies for old vs. new-style bootstrapping are
now mutually exclusive in the Makefile.
The default is --disable-bootstrap until toplevel bootstrapping
becomes the default, then it will depend on build==host==target.
Old-bootstrapped and new-bootstrapped i686-pc-linux-gnu,
ok for mainline and src?
Paolo
2004-05-24 Paolo Bonzini <bonzini@gnu.org>
* Makefile.tpl (all.normal): Rename to all.
(all): Replace with a rule to pick the default
target from configure.
(all-gcc, configure-gcc): Use conditionals to
do nothing when toplevel bootstrap is going on.
(GCC old-style bootstrap) [gcc-bootstrap]: Disable.
(GCC new-style bootstrap) [gcc-no-bootstrap]: Disable.
* Makefile.in: Regenerate.
* configure.in: Support --enable-bootstrap.
* configure: Regenerate.
Index: Makefile.tpl
===================================================================
RCS file: /cvs/gcc/gcc/Makefile.tpl,v
retrieving revision 1.99
diff -u -r1.99 Makefile.tpl
--- Makefile.tpl 24 May 2004 11:08:12 -0000 1.99
+++ Makefile.tpl 24 May 2004 11:12:44 -0000
@@ -387,8 +387,7 @@
# The first rule in the file had better be this one. Don't put any above it.
# This lives here to allow makefile fragments to contain dependencies.
-all: all.normal
-.PHONY: all
+@default_target@:
#### host and target specific makefile fragments come in here.
@target_makefile_frag@
@@ -493,9 +492,9 @@
maybe-configure-target-[+module+][+
ENDFOR target_modules +]
-# The target built for a native build.
-.PHONY: all.normal
-all.normal: @all_build_modules@ all-host all-target
+# The target built for a native non-bootstrap build.
+.PHONY: all
+all: @all_build_modules@ all-host all-target
.PHONY: all-host
all-host: maybe-all-gcc [+
@@ -1106,8 +1105,9 @@
@if gcc
maybe-configure-gcc: configure-gcc
configure-gcc:
+@endif gcc
+@if gcc-no-bootstrap
@test ! -f gcc/Makefile || exit 0; \
- [ -f stage_last ] && exit 0; \
[ -d gcc ] || mkdir gcc; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
@@ -1146,7 +1146,7 @@
$(SHELL) $${libsrcdir}/configure \
$(HOST_CONFIGARGS) $${srcdiroption} \
|| exit 1
-@endif gcc
+@endif gcc-no-bootstrap
# Don't 'make all' in gcc if it's already been made by 'bootstrap'; that
# causes trouble. This wart will be fixed eventually by moving
@@ -1156,18 +1156,17 @@
@if gcc
maybe-all-gcc: all-gcc
all-gcc: configure-gcc
+@endif gcc
+@if gcc-no-bootstrap
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
- if [ -f stage_last ] ; then \
- true ; \
- elif [ -f gcc/stage_last ] ; then \
+ if [ -f gcc/stage_last ] ; then \
$(SET_LIB_PATH) \
(cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \
else \
$(SET_LIB_PATH) \
(cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
fi
-@endif gcc
# Building GCC uses some tools for rebuilding "source" files
# like texinfo, bison/byacc, etc. So we must depend on those.
@@ -1242,6 +1241,7 @@
echo "Building runtime libraries"; \
$(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
LANGUAGES="c c++" all
+@endif gcc-no-bootstrap
.PHONY: check-gcc maybe-check-gcc
maybe-check-gcc:
@@ -1337,6 +1337,7 @@
[+ ENDFOR recursive_targets +]
+@if gcc-bootstrap
# ---------------------
# GCC bootstrap support
# ---------------------
@@ -1545,6 +1546,7 @@
[+ ENDIF cleanstrap-target +]
[+ ENDFOR bootstrap-stage +]
+@endif gcc-bootstrap
# --------------------------------------
# Dependencies between different modules
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/configure.in,v
retrieving revision 1.290
diff -u -r1.290 configure.in
--- configure.in 24 May 2004 11:08:12 -0000 1.290
+++ configure.in 24 May 2004 11:12:44 -0000
@@ -1760,6 +1760,36 @@
/^@if target-$module\$/d
/^@endif target-$module\$/d"
done
+
+AC_ARG_ENABLE([bootstrap],
+[ --enable-bootstrap Enable bootstrapping [no]],,
+enable_bootstrap=no)
+if test -d ${srcdir}/gcc; then
+ case "$host:$target:$enable_bootstrap" in
+ $build:$build:yes | *:no) ;;
+ *:yes) AC_MSG_ERROR([cannot bootstrap a cross-compiler]) ;;
+ *) AC_MSG_ERROR([invalid option for --enable-bootstrap]) ;;
+ esac
+else
+ if test $enable_bootstrap = yes; then
+ AC_MSG_ERROR([cannot bootstrap without a compiler])
+ fi
+fi
+
+case "$enable_bootstrap" in
+ yes)
+ default_target=new-bootstrap
+ extrasub="$extrasub
+/^@if gcc-bootstrap\$/d
+/^@endif gcc-bootstrap\$/d" ;;
+ no)
+ default_target=all
+ extrasub="$extrasub
+/^@if gcc-no-bootstrap\$/d
+/^@endif gcc-no-bootstrap\$/d" ;;
+esac
+AC_SUBST(default_target)
+
extrasub="$extrasub
/^@if /,/^@endif /d"