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> 2004-08-26 Phil Edwards <phil@codesourcery.com>
* configure.in: Give a better error message if GMP/MPFR are missing * configure.in: Give a better error message if GMP/MPFR are missing
......
...@@ -445,14 +445,14 @@ bootstrap_stage = { ...@@ -445,14 +445,14 @@ bootstrap_stage = {
stage_configure_flags="@stage2_werror_flag@" ; stage_configure_flags="@stage2_werror_flag@" ;
stage_make_flags="" ; }; stage_make_flags="" ; };
bootstrap_stage = { bootstrap_stage = {
id=3 ; prev=2 ; id=3 ; prev=2 ; lean=1 ;
compare_target=compare ; compare_target=compare ;
bootstrap_target=bootstrap ; bootstrap_target=bootstrap ;
cleanstrap_target=cleanstrap ; cleanstrap_target=cleanstrap ;
stage_configure_flags="@stage2_werror_flag@" ; stage_configure_flags="@stage2_werror_flag@" ;
stage_make_flags="" ; }; stage_make_flags="" ; };
bootstrap_stage = { bootstrap_stage = {
id=4 ; prev=3 ; id=4 ; prev=3 ; lean=2 ;
compare_target=compare3 ; compare_target=compare3 ;
bootstrap_target=bootstrap4 ; bootstrap_target=bootstrap4 ;
stage_configure_flags="@stage2_werror_flag@" ; 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 = \ ...@@ -1376,19 +1376,19 @@ POSTSTAGE1_FLAGS_TO_PASS = \
.PHONY: stage[+id+]-start stage[+id+]-end .PHONY: stage[+id+]-start stage[+id+]-end
stage[+id+]-start:: 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_current ; \
echo stage[+id+] > stage_last[+ FOR host_modules +][+ IF bootstrap +] echo stage[+id+] > stage_last[+ FOR host_modules +][+ IF bootstrap +]
@if [+ module +] @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[+id+]-[+module+] [+module+] ; @CREATE_LINK_TO_DIR@ [+ IF prev +] ; \
set stage[+prev+]-[+module+] prev-[+module+] ; @CREATE_LINK_TO_DIR@ [+ ENDIF prev +] set stage[+prev+]-[+module+] prev-[+module+] ; @CREATE_LINK_TO_DIR@ [+ ENDIF prev +]
@endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +] @endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
stage[+id+]-end:: stage[+id+]-end::
rm -f stage_current[+ FOR host_modules +][+ IF bootstrap +] @rm -f stage_current[+ FOR host_modules +][+ IF bootstrap +]
@if [+ module +] @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 +] set prev-[+module+] stage[+prev+]-[+module+] ; @UNDO_LINK_TO_DIR@ [+ ENDIF prev +]
@endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +] @endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
...@@ -1396,12 +1396,14 @@ stage[+id+]-end:: ...@@ -1396,12 +1396,14 @@ stage[+id+]-end::
# are remade, but not reconfigured. The next stage (if any) will not # are remade, but not reconfigured. The next stage (if any) will not
# be reconfigured as well. # be reconfigured as well.
.PHONY: stage[+id+]-bubble .PHONY: stage[+id+]-bubble
stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +] stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +][+IF lean +]
@case `echo all-stage[+id+]-*` in \ @bootstrap_lean@-rm -rf stage[+lean+]-* ; $(STAMP) stage[+lean+]-lean[+ ENDIF lean +]
'all-stage[+id+]-*') ;; \ @if test -f stage[+id+]-lean [+
*) echo Remaking stage [+id+] ; rm -f all-stage[+id+]-* ;; \ IF prev +]|| test -f stage[+prev+]-lean [+ ENDIF prev +] ; then \
esac ; \ echo Skipping rebuild of stage[+id+] ; \
$(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage[+id+] else \
$(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage[+id+]; \
fi
.PHONY: all-stage[+id+] .PHONY: all-stage[+id+]
all-stage[+id+]: [+ FOR host_modules +][+ IF bootstrap +]\ all-stage[+id+]: [+ FOR host_modules +][+ IF bootstrap +]\
...@@ -1409,19 +1411,17 @@ 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 +] ENDIF bootstrap+] [+ ENDFOR host_modules +]
[+ FOR host_modules +][+ IF bootstrap +] [+ 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-configure-stage[+id+]-[+module+]:
maybe-all-stage[+id+]-[+module+]: maybe-all-stage[+id+]-[+module+]:
@if [+module+]-bootstrap @if [+module+]-bootstrap
maybe-configure-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+] maybe-configure-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+]
configure-stage[+id+]-[+module+]: [+ IF prev +] maybe-all-stage[+prev+]-[+module+] [+ ENDIF prev +] configure-stage[+id+]-[+module+]:
$(MAKE) stage[+id+]-start @$(MAKE) stage[+id+]-start
@if [ -f stage[+id+]-[+module+]/Makefile ] ; then \ @[ -f [+module+]/Makefile ] && exit 0 || : ; \
$(STAMP) configure-stage[+id+]-[+module+] ; \
exit 0; \
else \
true ; \
fi ; \
r=`${PWD_COMMAND}`; export r; \ r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \
$(STAGE_HOST_EXPORTS) [+ ELSE prev +] \ $(STAGE_HOST_EXPORTS) [+ ELSE prev +] \
...@@ -1441,12 +1441,11 @@ configure-stage[+id+]-[+module+]: [+ IF prev +] maybe-all-stage[+prev+]-[+module ...@@ -1441,12 +1441,11 @@ configure-stage[+id+]-[+module+]: [+ IF prev +] maybe-all-stage[+prev+]-[+module
esac; \ esac; \
$(SHELL) $${libsrcdir}/configure \ $(SHELL) $${libsrcdir}/configure \
$(HOST_CONFIGARGS) $${srcdiroption} \ $(HOST_CONFIGARGS) $${srcdiroption} \
[+stage_configure_flags+] [+extra_configure_flags+] && \ [+stage_configure_flags+] [+extra_configure_flags+]
$(STAMP) ../configure-stage[+id+]-[+module+]
maybe-all-stage[+id+]-[+module+]: all-stage[+id+]-[+module+] maybe-all-stage[+id+]-[+module+]: all-stage[+id+]-[+module+]
all-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+] all-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+]
$(MAKE) stage[+id+]-start @$(MAKE) stage[+id+]-start
@r=`${PWD_COMMAND}`; export r; \ @r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \
$(STAGE_HOST_EXPORTS) [+ ELSE prev +] \ $(STAGE_HOST_EXPORTS) [+ ELSE prev +] \
...@@ -1454,8 +1453,7 @@ all-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+] ...@@ -1454,8 +1453,7 @@ all-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+]
cd [+module+] && \ cd [+module+] && \
$(MAKE) $(FLAGS_TO_PASS) [+ IF prev +] \ $(MAKE) $(FLAGS_TO_PASS) [+ IF prev +] \
$(POSTSTAGE1_FLAGS_TO_PASS) [+ ENDIF prev +] \ $(POSTSTAGE1_FLAGS_TO_PASS) [+ ENDIF prev +] \
[+stage_make_flags+] [+extra_make_flags+] && \ [+stage_make_flags+] [+extra_make_flags+]
$(STAMP) ../all-stage[+id+]-[+module+]
@endif [+module+]-bootstrap @endif [+module+]-bootstrap
[+ ENDIF bootstrap +][+ ENDFOR host_modules +] [+ ENDIF bootstrap +][+ ENDFOR host_modules +]
...@@ -1463,8 +1461,12 @@ all-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+] ...@@ -1463,8 +1461,12 @@ all-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+]
# only possibility, but now it conflicts with no-bootstrap rules # only possibility, but now it conflicts with no-bootstrap rules
@if gcc-bootstrap @if gcc-bootstrap
[+ IF compare-target +] [+ IF compare-target +]
[+compare-target+]: all-stage[+id+]-gcc [+compare-target+]:
[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : @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; \ @r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
rm -f .bad_compare ; \ rm -f .bad_compare ; \
...@@ -1483,49 +1485,23 @@ all-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+] ...@@ -1483,49 +1485,23 @@ all-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+]
else \ else \
true; \ true; \
fi ; \ fi ; \
$(STAMP) [+compare-target+] $(STAMP) [+compare-target+][+ IF prev +]
@bootstrap_lean@-rm -rf stage[+prev+]-* ; $(STAMP) stage[+prev+]-lean[+ ENDIF prev +]
[+ ENDIF compare-target +] [+ ENDIF compare-target +]
[+ IF bootstrap-target +] [+ IF bootstrap-target +]
.PHONY: [+bootstrap-target+] .PHONY: [+bootstrap-target+]
[+bootstrap-target+]: stage[+id+]-bubble [+ [+bootstrap-target+]: stage[+id+]-bubble [+compare-target+] all
IF compare-target +] [+compare-target+] [+
ENDIF compare-target +] all
[+ ENDIF bootstrap-target +] [+ 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 # Rules to wipe a stage and all the following ones, used for cleanstrap
[+ IF prev +]distclean-stage[+prev+]:: distclean-stage[+id+] [+ ENDIF prev +] [+ IF prev +]distclean-stage[+prev+]:: distclean-stage[+id+] [+ ENDIF prev +]
distclean-stage[+id+]:: distclean-stage[+id+]::
[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : [ -f stage_current ] && $(MAKE) `cat stage_current`-end || :
rm -rf configure-stage[+id+]-* all-stage[+id+]-* stage[+id+]-* [+ rm -rf 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+]-* [+
IF compare-target +][+compare-target+] [+ ENDIF compare-target +] 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 +] [+ IF cleanstrap-target +]
.PHONY: [+cleanstrap-target+] .PHONY: [+cleanstrap-target+]
......
...@@ -1695,28 +1695,62 @@ esac ...@@ -1695,28 +1695,62 @@ esac
# not to nest @if/@endif pairs, because configure will not warn you at all. # not to nest @if/@endif pairs, because configure will not warn you at all.
AC_ARG_ENABLE([bootstrap], AC_ARG_ENABLE([bootstrap],
[ --enable-bootstrap Enable bootstrapping [no]],, [ --enable-bootstrap[=lean] Enable bootstrapping [no]],,
enable_bootstrap=no) enable_bootstrap=default)
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
# 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 case "$enable_bootstrap" in
yes) yes)
bootstrap_lean='#'
default_target=bootstrap
bootstrap_suffix=bootstrap ;;
lean)
bootstrap_lean=''
default_target=bootstrap default_target=bootstrap
bootstrap_suffix=bootstrap ;; bootstrap_suffix=bootstrap ;;
no) no)
default_target=all default_target=all
bootstrap_suffix=no-bootstrap ;; bootstrap_suffix=no-bootstrap ;;
esac esac
AC_SUBST(bootstrap_lean)
AC_SUBST(default_target) AC_SUBST(default_target)
for module in ${build_configdirs} ; do for module in ${build_configdirs} ; do
...@@ -2240,7 +2274,7 @@ esac ...@@ -2240,7 +2274,7 @@ esac
AC_SUBST(stage1_cflags) AC_SUBST(stage1_cflags)
# It makes debugging easier if we create as symlinks the stage directories # 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. # possible, however, we can resort to mv.
AC_CACHE_CHECK([if symbolic links between directories work], AC_CACHE_CHECK([if symbolic links between directories work],
[gcc_cv_prog_ln_s_dir], [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