Commit ce521a9c by Paolo Bonzini Committed by Paolo Bonzini

Makefile.def (bootstrap stages): Add 'lean' parameter.

2004-08-26  Paolo Bonzini  <bonzini@gnu.org>

	* Makefile.def (bootstrap stages): Add 'lean' parameter.
	* Makefile.tpl (configure-stageN-*, all-stageN-*): Turned into
	phony targets; do not generate timestamp files.
	(distclean-stageN): Remove references to their timestamp files.
	(restageN, touch-stageN): Remove.
	(stageN-bubble): Rewritten.
	(compare): Support lean bootstraps.
	* Makefile.in: Regenerate.

	* configure.in: Only warn when bootstrapping but
	build != host or build != target.  Support lean bootstraps.
	* configure: Regenerate.

From-SVN: r86754
parent afa396ff
2004-08-26 Paolo Bonzini <bonzini@gnu.org>
* Makefile.def (bootstrap stages): Add 'lean' parameter.
* Makefile.tpl (configure-stageN-*, all-stageN-*): Turned into
phony targets; do not generate timestamp files.
(distclean-stageN): Remove references to their timestamp files.
(restageN, touch-stageN): Remove.
(stageN-bubble): Rewritten.
(compare): Support lean bootstraps.
* Makefile.in: Regenerate.
* configure.in: Only warn when bootstrapping but
build != host or build != target. Support lean bootstraps.
* configure: Regenerate.
2004-08-26 Phil Edwards <phil@codesourcery.com>
* configure.in: Give a better error message if GMP/MPFR are missing
......
......@@ -445,14 +445,14 @@ bootstrap_stage = {
stage_configure_flags="@stage2_werror_flag@" ;
stage_make_flags="" ; };
bootstrap_stage = {
id=3 ; prev=2 ;
id=3 ; prev=2 ; lean=1 ;
compare_target=compare ;
bootstrap_target=bootstrap ;
cleanstrap_target=cleanstrap ;
stage_configure_flags="@stage2_werror_flag@" ;
stage_make_flags="" ; };
bootstrap_stage = {
id=4 ; prev=3 ;
id=4 ; prev=3 ; lean=2 ;
compare_target=compare3 ;
bootstrap_target=bootstrap4 ;
stage_configure_flags="@stage2_werror_flag@" ;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1376,19 +1376,19 @@ POSTSTAGE1_FLAGS_TO_PASS = \
.PHONY: stage[+id+]-start stage[+id+]-end
stage[+id+]-start::
[ -f stage_current ] && $(MAKE) `cat stage_current`-end || :
@[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \
echo stage[+id+] > stage_current ; \
echo stage[+id+] > stage_last[+ FOR host_modules +][+ IF bootstrap +]
@if [+ module +]
[ -d stage[+id+]-[+module+] ] || mkdir stage[+id+]-[+module+]; \
@[ -d stage[+id+]-[+module+] ] || mkdir stage[+id+]-[+module+]; \
set stage[+id+]-[+module+] [+module+] ; @CREATE_LINK_TO_DIR@ [+ IF prev +] ; \
set stage[+prev+]-[+module+] prev-[+module+] ; @CREATE_LINK_TO_DIR@ [+ ENDIF prev +]
@endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
stage[+id+]-end::
rm -f stage_current[+ FOR host_modules +][+ IF bootstrap +]
@rm -f stage_current[+ FOR host_modules +][+ IF bootstrap +]
@if [+ module +]
set [+module+] stage[+id+]-[+module+] ; @UNDO_LINK_TO_DIR@ [+ IF prev +] ; \
@set [+module+] stage[+id+]-[+module+] ; @UNDO_LINK_TO_DIR@ [+ IF prev +] ; \
set prev-[+module+] stage[+prev+]-[+module+] ; @UNDO_LINK_TO_DIR@ [+ ENDIF prev +]
@endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
......@@ -1396,12 +1396,14 @@ stage[+id+]-end::
# are remade, but not reconfigured. The next stage (if any) will not
# be reconfigured as well.
.PHONY: stage[+id+]-bubble
stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +]
@case `echo all-stage[+id+]-*` in \
'all-stage[+id+]-*') ;; \
*) echo Remaking stage [+id+] ; rm -f all-stage[+id+]-* ;; \
esac ; \
$(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage[+id+]
stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +][+IF lean +]
@bootstrap_lean@-rm -rf stage[+lean+]-* ; $(STAMP) stage[+lean+]-lean[+ ENDIF lean +]
@if test -f stage[+id+]-lean [+
IF prev +]|| test -f stage[+prev+]-lean [+ ENDIF prev +] ; then \
echo Skipping rebuild of stage[+id+] ; \
else \
$(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage[+id+]; \
fi
.PHONY: all-stage[+id+]
all-stage[+id+]: [+ FOR host_modules +][+ IF bootstrap +]\
......@@ -1409,19 +1411,17 @@ all-stage[+id+]: [+ FOR host_modules +][+ IF bootstrap +]\
ENDIF bootstrap+] [+ ENDFOR host_modules +]
[+ FOR host_modules +][+ IF bootstrap +]
.PHONY: configure-stage[+id+]-[+module+] maybe-configure-stage[+id+]-[+module+]
.PHONY: all-stage[+id+]-[+module+] maybe-all-stage[+id+]-[+module+]
maybe-configure-stage[+id+]-[+module+]:
maybe-all-stage[+id+]-[+module+]:
@if [+module+]-bootstrap
maybe-configure-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+]
configure-stage[+id+]-[+module+]: [+ IF prev +] maybe-all-stage[+prev+]-[+module+] [+ ENDIF prev +]
$(MAKE) stage[+id+]-start
@if [ -f stage[+id+]-[+module+]/Makefile ] ; then \
$(STAMP) configure-stage[+id+]-[+module+] ; \
exit 0; \
else \
true ; \
fi ; \
configure-stage[+id+]-[+module+]:
@$(MAKE) stage[+id+]-start
@[ -f [+module+]/Makefile ] && exit 0 || : ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \
$(STAGE_HOST_EXPORTS) [+ ELSE prev +] \
......@@ -1441,12 +1441,11 @@ configure-stage[+id+]-[+module+]: [+ IF prev +] maybe-all-stage[+prev+]-[+module
esac; \
$(SHELL) $${libsrcdir}/configure \
$(HOST_CONFIGARGS) $${srcdiroption} \
[+stage_configure_flags+] [+extra_configure_flags+] && \
$(STAMP) ../configure-stage[+id+]-[+module+]
[+stage_configure_flags+] [+extra_configure_flags+]
maybe-all-stage[+id+]-[+module+]: all-stage[+id+]-[+module+]
all-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+]
$(MAKE) stage[+id+]-start
@$(MAKE) stage[+id+]-start
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \
$(STAGE_HOST_EXPORTS) [+ ELSE prev +] \
......@@ -1454,8 +1453,7 @@ all-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+]
cd [+module+] && \
$(MAKE) $(FLAGS_TO_PASS) [+ IF prev +] \
$(POSTSTAGE1_FLAGS_TO_PASS) [+ ENDIF prev +] \
[+stage_make_flags+] [+extra_make_flags+] && \
$(STAMP) ../all-stage[+id+]-[+module+]
[+stage_make_flags+] [+extra_make_flags+]
@endif [+module+]-bootstrap
[+ ENDIF bootstrap +][+ ENDFOR host_modules +]
......@@ -1463,8 +1461,12 @@ all-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+]
# only possibility, but now it conflicts with no-bootstrap rules
@if gcc-bootstrap
[+ IF compare-target +]
[+compare-target+]: all-stage[+id+]-gcc
[ -f stage_current ] && $(MAKE) `cat stage_current`-end || :
[+compare-target+]:
@if test -f stage[+prev+]-lean; then \
echo Cannot compare object files as stage [+prev+] was deleted. ; \
exit 0 ; \
fi; \
[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
rm -f .bad_compare ; \
......@@ -1483,49 +1485,23 @@ all-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+]
else \
true; \
fi ; \
$(STAMP) [+compare-target+]
$(STAMP) [+compare-target+][+ IF prev +]
@bootstrap_lean@-rm -rf stage[+prev+]-* ; $(STAMP) stage[+prev+]-lean[+ ENDIF prev +]
[+ ENDIF compare-target +]
[+ IF bootstrap-target +]
.PHONY: [+bootstrap-target+]
[+bootstrap-target+]: stage[+id+]-bubble [+
IF compare-target +] [+compare-target+] [+
ENDIF compare-target +] all
[+bootstrap-target+]: stage[+id+]-bubble [+compare-target+] all
[+ ENDIF bootstrap-target +]
.PHONY: restage[+id+] touch-stage[+id+] distclean-stage[+id+]
.PHONY: distclean-stage[+id+]
# Rules to wipe a stage and all the following ones, used for cleanstrap
[+ IF prev +]distclean-stage[+prev+]:: distclean-stage[+id+] [+ ENDIF prev +]
distclean-stage[+id+]::
[ -f stage_current ] && $(MAKE) `cat stage_current`-end || :
rm -rf configure-stage[+id+]-* all-stage[+id+]-* stage[+id+]-* [+
IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
# Rules to renew the timestamp on a stage and all the following ones
[+ IF prev +]touch-stage[+prev+]:: touch-stage[+id+] [+ ENDIF prev +]
touch-stage[+id+]::
@case `echo configure-stage[+id+]-*` in \
'configure-stage[+id+]-*') ;; \
*) \
echo '$(STAMP)' configure-stage[+id+]-* && \
$(STAMP) configure-stage[+id+]-* ;; \
esac ; \
case `echo all-stage[+id+]-*` in \
'all-stage[+id+]-*') ;; \
*) \
echo '$(STAMP)' all-stage[+id+]-* && \
$(STAMP) all-stage[+id+]-* ;; \
esac
# After building a stage, touch the following ones
[+ IF prev +]restage[+prev+]:: touch-stage[+id+] [+ ENDIF prev +]
restage[+id+]::
rm -rf all-stage[+id+]-* [+
rm -rf stage[+id+]-* [+
IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
$(MAKE) $(RECURSE_FLAGS_TO_PASS) [+
IF compare-target +][+compare-target+] [+
ELSE +] all-stage[+id+] [+ ENDIF compare-target +]
[+ IF cleanstrap-target +]
.PHONY: [+cleanstrap-target+]
......
......@@ -1695,28 +1695,62 @@ esac
# not to nest @if/@endif pairs, because configure will not warn you at all.
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
[ --enable-bootstrap[=lean] Enable bootstrapping [no]],,
enable_bootstrap=default)
# Issue errors and warnings for invalid/strange bootstrap combinations.
case "$configdirs" in
*gcc*) have_compiler=yes ;;
*) have_compiler=no ;;
esac
case "$have_compiler:$host:$target:$enable_bootstrap" in
*:*:*:no) ;;
# Default behavior. (We'll) enable bootstrap if we have a compiler
# and we are in a native configuration.
yes:$build:$build:default)
# This will become 'yes'
enable_bootstrap=no ;;
*:*:*:default)
enable_bootstrap=no ;;
# We have a compiler and we are in a native configuration, bootstrap is ok
yes:$build:$build:yes | yes:$build:$build:lean)
;;
# Other configurations, but we have a compiler. Assume the user knows
# what he's doing.
yes:*:*:yes | yes:*:*:lean)
AC_MSG_WARN([trying to bootstrap a cross compiler])
;;
# No compiler: if they passed --enable-bootstrap explicitly, fail
no:*:*:yes | no:*:*:lean)
AC_MSG_ERROR([cannot bootstrap without a compiler]) ;;
# Fail if wrong command line
*)
AC_MSG_ERROR([invalid option for --enable-bootstrap])
;;
esac
# Adjust the toplevel makefile according to whether bootstrap was selected.
case "$enable_bootstrap" in
yes)
bootstrap_lean='#'
default_target=bootstrap
bootstrap_suffix=bootstrap ;;
lean)
bootstrap_lean=''
default_target=bootstrap
bootstrap_suffix=bootstrap ;;
no)
default_target=all
bootstrap_suffix=no-bootstrap ;;
esac
AC_SUBST(bootstrap_lean)
AC_SUBST(default_target)
for module in ${build_configdirs} ; do
......@@ -2240,7 +2274,7 @@ esac
AC_SUBST(stage1_cflags)
# It makes debugging easier if we create as symlinks the stage directories
# gcc for stageN-gcc and stage-prev for stage(N-1). In case this is not
# gcc for stageN-gcc and stagePREV-gcc for stage(N-1). In case this is not
# possible, however, we can resort to mv.
AC_CACHE_CHECK([if symbolic links between directories work],
[gcc_cv_prog_ln_s_dir],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment