OSDN Git Service

2005-05-24 Paolo Bonzini <bonzini@gnu.org>
authorbonzini <bonzini>
Mon, 24 May 2004 11:08:46 +0000 (11:08 +0000)
committerbonzini <bonzini>
Mon, 24 May 2004 11:08:46 +0000 (11:08 +0000)
* configure.in: Test the ability to symlink directories.
* configure: Regenerate.

* Makefile.def (bootstrap-stage): New definitions.
* Makefile.tpl (configure-stage1-gcc,
configure-stage2-gcc, configure-stage3-gcc,
all-stage1-gcc, all-stage2-gcc, all-stage3-gcc,
new-bootstrap, new-cleanstrap, new-restage1, new-restage2,
new-restage3, compare): Autogenerate, see Makefile.in
entry for behavioral changes.
(distclean-stage1, new-stage1-start, new-stage1-end,
new-stage1-bubble, distclean-stage2, new-stage2-start,
new-stage2-end, new-stage2-bubble, distclean-stage3,
new-stage3-start, new-stage3-end): New autogenerated targets.
(objext, prebootstrap, BOOT_CFLAGS,
POSTSTAGE1_FLAGS_TO_PASS): Move above the autogenerated
targets.

* Makefile.in: Regenerate.
(distclean-stage1, new-stage1-start, new-stage1-end,
new-stage1-bubble, distclean-stage2, new-stage2-start,
new-stage2-end, new-stage2-bubble, distclean-stage3,
new-stage3-start, new-stage3-end): New targets.
(all-stage1-gcc): Move prebootstrap dependency from here...
(configure-stage1-gcc): ...to here.
(new-bootstrap): Use bubble targets.
(new-cleanstrap, new-restage1, new-restage2, new-restage3):
Use per-stage distclean targets.
(configure-stage1-gcc, configure-stage2-gcc,
configure-stage3-gcc, all-stage1-gcc,
all-stage2-gcc, all-stage3-gcc, new-bootstrap):
Use new-stageN-start to prepare the tree.

ChangeLog
Makefile.def
Makefile.in
Makefile.tpl
configure
configure.in

index f03cefe..6a1a36b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,38 @@
+2005-05-24  Paolo Bonzini <bonzini@gnu.org>
+
+       * configure.in: Test the ability to symlink directories.
+       * configure: Regenerate.
+
+       * Makefile.def (bootstrap-stage): New definitions.
+       * Makefile.tpl (configure-stage1-gcc,
+       configure-stage2-gcc, configure-stage3-gcc,
+       all-stage1-gcc, all-stage2-gcc, all-stage3-gcc,
+       new-bootstrap, new-cleanstrap, new-restage1, new-restage2,
+       new-restage3, compare): Autogenerate, see Makefile.in
+       entry for behavioral changes.
+       (distclean-stage1, new-stage1-start, new-stage1-end,
+       new-stage1-bubble, distclean-stage2, new-stage2-start,
+       new-stage2-end, new-stage2-bubble, distclean-stage3,
+       new-stage3-start, new-stage3-end): New autogenerated targets.
+       (objext, prebootstrap, BOOT_CFLAGS,
+       POSTSTAGE1_FLAGS_TO_PASS): Move above the autogenerated
+       targets.
+
+       * Makefile.in: Regenerate.
+       (distclean-stage1, new-stage1-start, new-stage1-end,
+       new-stage1-bubble, distclean-stage2, new-stage2-start,
+       new-stage2-end, new-stage2-bubble, distclean-stage3,
+       new-stage3-start, new-stage3-end): New targets.
+       (all-stage1-gcc): Move prebootstrap dependency from here...
+       (configure-stage1-gcc): ...to here.
+       (new-bootstrap): Use bubble targets.
+       (new-cleanstrap, new-restage1, new-restage2, new-restage3):
+       Use per-stage distclean targets.
+       (configure-stage1-gcc, configure-stage2-gcc,
+       configure-stage3-gcc, all-stage1-gcc,
+       all-stage2-gcc, all-stage3-gcc, new-bootstrap):
+       Use new-stageN-start to prepare the tree.
+
 2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
 
        * Makefile.def (host_modules): add libcpp.
index 788d3b0..9c42596 100644 (file)
@@ -213,3 +213,21 @@ flags_to_pass = { flag= LIBCXXFLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= NM_FOR_TARGET ; };
 flags_to_pass = { flag= RANLIB_FOR_TARGET ; };
 flags_to_pass = { flag= WINDRES_FOR_TARGET ; };
+
+// Toplevel bootstrap
+bootstrap_stage = {
+       id=1 ; next=2 ;
+       extra_configure_flags='--disable-intermodule \
+         --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"' ;
+       extra_make_flags='CFLAGS="$(STAGE1_CFLAGS)"' ; };
+bootstrap_stage = {
+       id=2 ; prev=1 ; next=3 ;
+       extra_configure_flags="@stage2_werror_flag@" ;
+       extra_make_flags="$(POSTSTAGE1_FLAGS_TO_PASS)" ; };
+bootstrap_stage = {
+       id=3 ; prev=2 ;
+       compare_target=compare ;
+       bootstrap_target=new-bootstrap ;
+       cleanstrap_target=new-cleanstrap ;
+       extra_configure_flags="@stage2_werror_flag@" ;
+       extra_make_flags="$(POSTSTAGE1_FLAGS_TO_PASS)" ; };
index 0b21184..11548f2 100644 (file)
@@ -28287,16 +28287,26 @@ maintainer-clean-gcc:
 # GCC bootstrap support
 # ---------------------
 
-# We name the directories for the various stages "stage1-gcc",
-# "stage2-gcc","stage3-gcc", etc.  
-# Unfortunately, the 'compare' process will fail (on debugging information)
-# if any directory names are different!
-# So in the building rule for each stage, we relocate them before and after.
-# The current one is 'gcc', while the previous one is 'prev-gcc'.  (The
-# current one must be 'gcc' for now because the scripts in that directory
-# assume it.)
-# At the end of the bootstrap, 'stage3-gcc' must be moved to 'gcc' so that
-# libraries can find it.  Ick!
+# We track the current stage (the one in 'gcc') in the stage_last file.
+# We name the build directories for the various stages "stage1-gcc",
+# "stage2-gcc","stage3-gcc", etc.
+
+# Since the 'compare' process will fail (on debugging information) if any
+# directory names are different, we need to link the gcc directory for
+# the previous stage to a constant name ('gcc-prev'), and to make the name of
+# the build directories constant as well. For the latter, we use naked names
+# like 'gcc', because the scripts in that directory assume it.  We use
+# mv on platforms where symlinks to directories do not work or are not
+# reliable.
+
+# At the end of the bootstrap, a symlink to 'stage3-gcc' named 'gcc' must
+# be kept, so that libraries can find it.  Ick!
+
+# It would be best to preinstall gcc into a staging area (and in the
+# future, gather there all prebootstrap packages).  This would allow
+# assemblers and linkers can be bootstrapped as well as the compiler
+# (both in a combined tree, or separately).  This however requires some
+# change to the gcc driver, again in order to avoid comparison failures.
 
 # Bugs: This is almost certainly not parallel-make safe.
 
@@ -28312,6 +28322,21 @@ STAMP = echo timestamp >
 STAGE1_CFLAGS=@stage1_cflags@
 STAGE1_LANGUAGES=@stage1_languages@
 
+# We only want to compare .o files, so set this!
+objext = .o
+
+# Real targets act phony if they depend on phony targets; this hack
+# prevents gratuitous rebuilding of stage 1.
+prebootstrap:
+       $(MAKE) all-bootstrap
+       $(STAMP) prebootstrap
+
+# Flags to pass to stage2 and later makes.
+BOOT_CFLAGS= -g -O2
+POSTSTAGE1_FLAGS_TO_PASS = \
+       CFLAGS="$(BOOT_CFLAGS)" \
+       ADAC="\$$(CC)"
+
 # For stage 1:
 # * We force-disable intermodule optimizations, even if
 #   --enable-intermodule was passed, since the installed compiler probably
@@ -28320,27 +28345,53 @@ STAGE1_LANGUAGES=@stage1_languages@
 # * Likewise, we force-disable coverage flags, since the installed compiler
 #   probably has never heard of them.
 # * We build only C (and possibly Ada).
-configure-stage1-gcc:
-       echo configure-stage1-gcc > stage_last ; \
-       if [ -f stage1-gcc/Makefile ] ; then \
+
+
+.PHONY: new-stage1-start new-stage1-end
+
+new-stage1-start:
+       [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+       echo stage1 > stage_last ; \
+       [ -d stage1-gcc ] || mkdir stage1-gcc; \
+       set stage1-gcc gcc ; @CREATE_LINK_TO_DIR@ 
+
+new-stage1-end:
+       rm -f stage_last ; \
+       set gcc stage1-gcc ; @UNDO_LINK_TO_DIR@ 
+
+# Bubble a bugfix through all the stages up to stage 1.  They
+# are remade, but not reconfigured.  The next stage (if any) will not
+# be reconfigured as well.
+.PHONY: new-stage1-bubble
+new-stage1-bubble: 
+       @if [ -f all-stage1-gcc ] ; then \
+         echo Remaking stage 1 ; \
+         rm -f all-stage1-gcc ; \
+         $(MAKE) all-stage1-gcc  && \
+         if [ -f configure-stage2-gcc ] ; then \
+           $(STAMP) configure-stage2-gcc ; \
+         fi ; \
+       else \
+         $(MAKE) all-stage1-gcc ; \
+       fi
+
+configure-stage1-gcc:  prebootstrap 
+       $(MAKE) new-stage1-start
+       @if [ -f stage1-gcc/Makefile ] ; then \
          $(STAMP) configure-stage1-gcc ; \
          exit 0; \
        else \
          true ; \
        fi ; \
-       [ -d stage1-gcc ] || mkdir stage1-gcc; \
-       mv stage1-gcc gcc ; \
        r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
        TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
-       CC="$(CC)"; export CC; \
        CFLAGS="$(CFLAGS)"; export CFLAGS; \
        CXX="$(CXX)"; export CXX; \
        CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
        AR="$(AR)"; export AR; \
        AS="$(AS)"; export AS; \
-       CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
        DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
        LD="$(LD)"; export LD; \
        LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
@@ -28349,7 +28400,11 @@ configure-stage1-gcc:
        WINDRES="$(WINDRES)"; export WINDRES; \
        OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
        OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
-       echo Configuring stage 1 in gcc; \
+       GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
+       GMPINC="$(HOST_GMPINC)"; export GMPINC  ; \
+       CC="$(CC)"; export CC; \
+       CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD  ; \
+       echo Configuring stage 1 in gcc ; \
        cd gcc || exit 1; \
        case $(srcdir) in \
          \.) \
@@ -28364,45 +28419,72 @@ configure-stage1-gcc:
        esac; \
        $(SHELL) $${libsrcdir}/configure \
          $(HOST_CONFIGARGS) $${srcdiroption} \
-         --disable-intermodule --disable-coverage \
-         --enable-languages="$(STAGE1_LANGUAGES)"; \
-       cd .. ; \
-       mv gcc stage1-gcc ; \
-       $(STAMP) configure-stage1-gcc
+         --disable-intermodule           --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" && \
+         $(STAMP) ../configure-stage1-gcc
 
-# Real targets act phony if they depend on phony targets; this hack
-# prevents gratuitous rebuilding of stage 1.
-prebootstrap:
-       $(MAKE) all-bootstrap
-       $(STAMP) prebootstrap
-
-all-stage1-gcc: configure-stage1-gcc prebootstrap
-       echo all-stage1-gcc > stage_last ; \
-       r=`${PWD_COMMAND}`; export r; \
+all-stage1-gcc: configure-stage1-gcc
+       $(MAKE) new-stage1-start
+       @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       mv stage1-gcc gcc ; \
        cd gcc && \
-       $(MAKE) $(GCC_FLAGS_TO_PASS) \
-               CFLAGS="$(STAGE1_CFLAGS)" && $(STAMP) ../all-stage1-gcc ; \
-       result=$$? ; \
-       cd .. ; \
-       mv gcc stage1-gcc ; \
-       exit $$result
-
-# TODO: Deal with STAGE_PREFIX (which is only for ada, incidentally)
-# Possibly pass --enable-werror-always (depending on --enable-werror);
-# that's what @stage2_werror_flag@ is for
-configure-stage2-gcc: all-stage1-gcc
-       echo configure-stage2-gcc > stage_last ; \
-       if [ -f stage2-gcc/Makefile ] ; then \
+       $(MAKE) $(GCC_FLAGS_TO_PASS)  \
+               CFLAGS="$(STAGE1_CFLAGS)" && $(STAMP) ../all-stage1-gcc
+
+
+
+
+
+.PHONY: new-restage1 distclean-stage1
+
+distclean-stage1:  distclean-stage2 
+       [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+       rm -rf configure-stage1-gcc all-stage1-gcc stage1-gcc 
+
+new-restage1:  distclean-stage2 
+       rm -rf all-stage1-gcc 
+       $(MAKE)  all-stage1-gcc 
+
+
+
+
+.PHONY: new-stage2-start new-stage2-end
+
+new-stage2-start:
+       [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+       echo stage2 > stage_last ; \
+       [ -d stage2-gcc ] || mkdir stage2-gcc; \
+       set stage2-gcc gcc ; @CREATE_LINK_TO_DIR@  ; \
+       set stage1-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ 
+
+new-stage2-end:
+       rm -f stage_last ; \
+       set gcc stage2-gcc ; @UNDO_LINK_TO_DIR@  ; \
+       set prev-gcc stage1-gcc ; @UNDO_LINK_TO_DIR@ 
+
+# Bubble a bugfix through all the stages up to stage 2.  They
+# are remade, but not reconfigured.  The next stage (if any) will not
+# be reconfigured as well.
+.PHONY: new-stage2-bubble
+new-stage2-bubble: new-stage1-bubble
+       @if [ -f all-stage2-gcc ] ; then \
+         echo Remaking stage 2 ; \
+         rm -f all-stage2-gcc ; \
+         $(MAKE) all-stage2-gcc  && \
+         if [ -f configure-stage3-gcc ] ; then \
+           $(STAMP) configure-stage3-gcc ; \
+         fi ; \
+       else \
+         $(MAKE) all-stage2-gcc ; \
+       fi
+
+configure-stage2-gcc:  all-stage1-gcc 
+       $(MAKE) new-stage2-start
+       @if [ -f stage2-gcc/Makefile ] ; then \
          $(STAMP) configure-stage2-gcc ; \
          exit 0; \
        else \
          true ; \
        fi ; \
-       [ -d stage2-gcc ] || mkdir stage2-gcc; \
-       mv stage2-gcc gcc ; \
-       mv stage1-gcc prev-gcc ; \
        r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
@@ -28420,9 +28502,11 @@ configure-stage2-gcc: all-stage1-gcc
        WINDRES="$(WINDRES)"; export WINDRES; \
        OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
        OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+       GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
+       GMPINC="$(HOST_GMPINC)"; export GMPINC  ; \
        CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
-       CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; \
-       echo Configuring stage 2 in gcc; \
+       CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC_FOR_BUILD  ; \
+       echo Configuring stage 2 in gcc ; \
        cd gcc || exit 1; \
        case $(srcdir) in \
          \.) \
@@ -28436,47 +28520,73 @@ configure-stage2-gcc: all-stage1-gcc
            libsrcdir="$$s/gcc";; \
        esac; \
        $(SHELL) $${libsrcdir}/configure \
-         $(HOST_CONFIGARGS) $${srcdiroption} @stage2_werror_flag@ ; \
-       cd .. ; \
-       mv gcc stage2-gcc ; \
-       mv prev-gcc stage1-gcc ; \
-       $(STAMP) configure-stage2-gcc
-
-# Flags to pass to stage2 and later makes.
-BOOT_CFLAGS= -g -O2
-POSTSTAGE1_FLAGS_TO_PASS = \
-       CFLAGS="$(BOOT_CFLAGS)" \
-       ADAC="\$$(CC)"
+         $(HOST_CONFIGARGS) $${srcdiroption} \
+         @stage2_werror_flag@ && \
+         $(STAMP) ../configure-stage2-gcc
 
-all-stage2-gcc: all-stage1-gcc configure-stage2-gcc
-       echo all-stage2-gcc > stage_last ; \
-       r=`${PWD_COMMAND}`; export r; \
+all-stage2-gcc: configure-stage2-gcc
+       $(MAKE) new-stage2-start
+       @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       mv stage2-gcc gcc ; \
-       mv stage1-gcc prev-gcc ; \
        cd gcc && \
-       $(MAKE) $(GCC_FLAGS_TO_PASS) \
+       $(MAKE) $(GCC_FLAGS_TO_PASS)  \
                CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
                CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
-               STAGE_PREFIX=$$r/prev-gcc/ \
-               $(POSTSTAGE1_FLAGS_TO_PASS) && $(STAMP) ../all-stage2-gcc ; \
-       result=$$? ; \
-       cd .. ; \
-       mv prev-gcc stage1-gcc ; \
-       mv gcc stage2-gcc ; \
-       exit $$result
+               STAGE_PREFIX=$$r/stage1-gcc/  \
+               $(POSTSTAGE1_FLAGS_TO_PASS) && $(STAMP) ../all-stage2-gcc
+
+
+
+
+
+.PHONY: new-restage2 distclean-stage2
+
+distclean-stage2:  distclean-stage3 
+       [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+       rm -rf configure-stage2-gcc all-stage2-gcc stage2-gcc 
 
-configure-stage3-gcc: all-stage2-gcc
-       echo configure-stage3-gcc > stage_last ; \
-       if [ -f stage3-gcc/Makefile ] ; then \
+new-restage2:  distclean-stage3 
+       rm -rf all-stage2-gcc 
+       $(MAKE)  all-stage2-gcc 
+
+
+
+
+.PHONY: new-stage3-start new-stage3-end
+
+new-stage3-start:
+       [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+       echo stage3 > stage_last ; \
+       [ -d stage3-gcc ] || mkdir stage3-gcc; \
+       set stage3-gcc gcc ; @CREATE_LINK_TO_DIR@  ; \
+       set stage2-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ 
+
+new-stage3-end:
+       rm -f stage_last ; \
+       set gcc stage3-gcc ; @UNDO_LINK_TO_DIR@  ; \
+       set prev-gcc stage2-gcc ; @UNDO_LINK_TO_DIR@ 
+
+# Bubble a bugfix through all the stages up to stage 3.  They
+# are remade, but not reconfigured.  The next stage (if any) will not
+# be reconfigured as well.
+.PHONY: new-stage3-bubble
+new-stage3-bubble: new-stage2-bubble
+       @if [ -f all-stage3-gcc ] ; then \
+         echo Remaking stage 3 ; \
+         rm -f all-stage3-gcc ; \
+         $(MAKE) all-stage3-gcc ; \
+       else \
+         $(MAKE) all-stage3-gcc ; \
+       fi
+
+configure-stage3-gcc:  all-stage2-gcc 
+       $(MAKE) new-stage3-start
+       @if [ -f stage3-gcc/Makefile ] ; then \
          $(STAMP) configure-stage3-gcc ; \
          exit 0; \
        else \
          true ; \
        fi ; \
-       [ -d stage3-gcc ] || mkdir stage3-gcc; \
-       mv stage3-gcc gcc ; \
-       mv stage2-gcc prev-gcc ; \
        r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
@@ -28494,9 +28604,11 @@ configure-stage3-gcc: all-stage2-gcc
        WINDRES="$(WINDRES)"; export WINDRES; \
        OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
        OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+       GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
+       GMPINC="$(HOST_GMPINC)"; export GMPINC  ; \
        CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
-       CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; \
-       echo Configuring stage 3 in gcc; \
+       CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC_FOR_BUILD  ; \
+       echo Configuring stage 3 in gcc ; \
        cd gcc || exit 1; \
        case $(srcdir) in \
          \.) \
@@ -28510,35 +28622,25 @@ configure-stage3-gcc: all-stage2-gcc
            libsrcdir="$$s/gcc";; \
        esac; \
        $(SHELL) $${libsrcdir}/configure \
-         $(HOST_CONFIGARGS) $${srcdiroption} @stage2_werror_flag@ ; \
-       cd .. ; \
-       mv gcc stage3-gcc ; \
-       mv prev-gcc stage2-gcc ; \
-       $(STAMP) configure-stage3-gcc
+         $(HOST_CONFIGARGS) $${srcdiroption} \
+         @stage2_werror_flag@ && \
+         $(STAMP) ../configure-stage3-gcc
 
-all-stage3-gcc: all-stage2-gcc configure-stage3-gcc
-       echo all-stage3-gcc > stage_last ; \
-       r=`${PWD_COMMAND}`; export r; \
+all-stage3-gcc: configure-stage3-gcc
+       $(MAKE) new-stage3-start
+       @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       mv stage2-gcc prev-gcc ; \
-       mv stage3-gcc gcc ; \
        cd gcc && \
-       $(MAKE) $(GCC_FLAGS_TO_PASS) \
+       $(MAKE) $(GCC_FLAGS_TO_PASS)  \
                CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
                CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
-               STAGE_PREFIX=$$r/prev-gcc/ \
-               $(POSTSTAGE1_FLAGS_TO_PASS) && $(STAMP) ../all-stage3-gcc \
-       result=$$? ; \
-       cd .. ; \
-       mv prev-gcc stage2-gcc ; \
-       mv gcc stage3-gcc ; \
-       exit $$result
+               STAGE_PREFIX=$$r/stage2-gcc/  \
+               $(POSTSTAGE1_FLAGS_TO_PASS) && $(STAMP) ../all-stage3-gcc
 
-# We only want to compare .o files, so set this!
-objext = .o
 
 compare: all-stage3-gcc
-       r=`${PWD_COMMAND}`; export r; \
+       [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+       @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        rm -f .bad_compare ; \
        cd stage3-gcc; \
@@ -28556,40 +28658,32 @@ compare: all-stage3-gcc
        else \
          true; \
        fi ; \
-        $(STAMP) compare
+       $(STAMP) compare
+
+
 
 .PHONY: new-bootstrap
-# This target exists so that everything can be made in one pass.
-# 'all-gcc' has to avoid stomping on the bootstrap-generated gcc for
-# this to work.
-new-bootstrap: compare
-       mv stage3-gcc gcc ; \
-       $(MAKE) all ; \
-       mv gcc stage3-gcc
-
-new-cleanstrap:
-       rm -rf configure-stage1-gcc all-stage1-gcc stage1-gcc \
-         configure-stage2-gcc all-stage2-gcc stage2-gcc \
-         configure-stage3-gcc all-stage3-gcc stage3-gcc \
-         compare
-       $(MAKE) new-bootstrap
-
-new-restage1:
-       rm -rf all-stage1-gcc \
-         configure-stage2-gcc all-stage2-gcc stage2-gcc \
-         configure-stage3-gcc all-stage3-gcc stage3-gcc \
-         compare
-       $(MAKE) all-stage1-gcc
-
-new-restage2: all-stage1-gcc
-       rm -rf all-stage2-gcc \
-         configure-stage3-gcc all-stage3-gcc stage3-gcc \
-         compare
-       $(MAKE) all-stage2-gcc
-
-new-restage3: all-stage2-gcc
-       rm -rf all-stage3-gcc compare
-       $(MAKE) compare
+new-bootstrap:
+       $(MAKE) new-stage3-bubble  compare  \
+         new-stage3-start all new-stage3-end 
+
+
+.PHONY: new-restage3 distclean-stage3
+
+distclean-stage3: 
+       [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+       rm -rf configure-stage3-gcc all-stage3-gcc stage3-gcc compare 
+
+new-restage3: 
+       rm -rf all-stage3-gcc compare 
+       $(MAKE) compare 
+
+
+.PHONY: new-cleanstrap
+new-cleanstrap: distclean-stage1 new-bootstrap
+
+
+
 
 # --------------------------------------
 # Dependencies between different modules
index ec54c67..33764aa 100644 (file)
@@ -1341,16 +1341,26 @@ maybe-[+make_target+]-gcc: [+make_target+]-gcc
 # GCC bootstrap support
 # ---------------------
 
-# We name the directories for the various stages "stage1-gcc",
-# "stage2-gcc","stage3-gcc", etc.  
-# Unfortunately, the 'compare' process will fail (on debugging information)
-# if any directory names are different!
-# So in the building rule for each stage, we relocate them before and after.
-# The current one is 'gcc', while the previous one is 'prev-gcc'.  (The
-# current one must be 'gcc' for now because the scripts in that directory
-# assume it.)
-# At the end of the bootstrap, 'stage3-gcc' must be moved to 'gcc' so that
-# libraries can find it.  Ick!
+# We track the current stage (the one in 'gcc') in the stage_last file.
+# We name the build directories for the various stages "stage1-gcc",
+# "stage2-gcc","stage3-gcc", etc.
+
+# Since the 'compare' process will fail (on debugging information) if any
+# directory names are different, we need to link the gcc directory for
+# the previous stage to a constant name ('gcc-prev'), and to make the name of
+# the build directories constant as well. For the latter, we use naked names
+# like 'gcc', because the scripts in that directory assume it.  We use
+# mv on platforms where symlinks to directories do not work or are not
+# reliable.
+
+# At the end of the bootstrap, a symlink to 'stage3-gcc' named 'gcc' must
+# be kept, so that libraries can find it.  Ick!
+
+# It would be best to preinstall gcc into a staging area (and in the
+# future, gather there all prebootstrap packages).  This would allow
+# assemblers and linkers can be bootstrapped as well as the compiler
+# (both in a combined tree, or separately).  This however requires some
+# change to the gcc driver, again in order to avoid comparison failures.
 
 # Bugs: This is almost certainly not parallel-make safe.
 
@@ -1366,63 +1376,8 @@ STAMP = echo timestamp >
 STAGE1_CFLAGS=@stage1_cflags@
 STAGE1_LANGUAGES=@stage1_languages@
 
-# For stage 1:
-# * We force-disable intermodule optimizations, even if
-#   --enable-intermodule was passed, since the installed compiler probably
-#   can't handle them.  Luckily, autoconf always respects
-#   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.
-# * We build only C (and possibly Ada).
-configure-stage1-gcc:
-       echo configure-stage1-gcc > stage_last ; \
-       if [ -f stage1-gcc/Makefile ] ; then \
-         $(STAMP) configure-stage1-gcc ; \
-         exit 0; \
-       else \
-         true ; \
-       fi ; \
-       [ -d stage1-gcc ] || mkdir stage1-gcc; \
-       mv stage1-gcc gcc ; \
-       r=`${PWD_COMMAND}`; export r; \
-       s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-       TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
-       CC="$(CC)"; export CC; \
-       CFLAGS="$(CFLAGS)"; export CFLAGS; \
-       CXX="$(CXX)"; export CXX; \
-       CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-       AR="$(AR)"; export AR; \
-       AS="$(AS)"; export AS; \
-       CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-       DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-       LD="$(LD)"; export LD; \
-       LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
-       NM="$(NM)"; export NM; \
-       RANLIB="$(RANLIB)"; export RANLIB; \
-       WINDRES="$(WINDRES)"; export WINDRES; \
-       OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-       OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
-       echo Configuring stage 1 in gcc; \
-       cd gcc || exit 1; \
-       case $(srcdir) in \
-         \.) \
-           srcdiroption="--srcdir=."; \
-           libsrcdir=".";; \
-         /* | [A-Za-z]:[\\/]*) \
-           srcdiroption="--srcdir=$(srcdir)/gcc"; \
-           libsrcdir="$$s/gcc";; \
-         *) \
-           srcdiroption="--srcdir=../$(srcdir)/gcc"; \
-           libsrcdir="$$s/gcc";; \
-       esac; \
-       $(SHELL) $${libsrcdir}/configure \
-         $(HOST_CONFIGARGS) $${srcdiroption} \
-         --disable-intermodule --disable-coverage \
-         --enable-languages="$(STAGE1_LANGUAGES)"; \
-       cd .. ; \
-       mv gcc stage1-gcc ; \
-       $(STAMP) configure-stage1-gcc
+# We only want to compare .o files, so set this!
+objext = .o
 
 # Real targets act phony if they depend on phony targets; this hack
 # prevents gratuitous rebuilding of stage 1.
@@ -1430,107 +1385,61 @@ prebootstrap:
        $(MAKE) all-bootstrap
        $(STAMP) prebootstrap
 
-all-stage1-gcc: configure-stage1-gcc prebootstrap
-       echo all-stage1-gcc > stage_last ; \
-       r=`${PWD_COMMAND}`; export r; \
-       s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       mv stage1-gcc gcc ; \
-       cd gcc && \
-       $(MAKE) $(GCC_FLAGS_TO_PASS) \
-               CFLAGS="$(STAGE1_CFLAGS)" && $(STAMP) ../all-stage1-gcc ; \
-       result=$$? ; \
-       cd .. ; \
-       mv gcc stage1-gcc ; \
-       exit $$result
-
-# TODO: Deal with STAGE_PREFIX (which is only for ada, incidentally)
-# Possibly pass --enable-werror-always (depending on --enable-werror);
-# that's what @stage2_werror_flag@ is for
-configure-stage2-gcc: all-stage1-gcc
-       echo configure-stage2-gcc > stage_last ; \
-       if [ -f stage2-gcc/Makefile ] ; then \
-         $(STAMP) configure-stage2-gcc ; \
-         exit 0; \
-       else \
-         true ; \
-       fi ; \
-       [ -d stage2-gcc ] || mkdir stage2-gcc; \
-       mv stage2-gcc gcc ; \
-       mv stage1-gcc prev-gcc ; \
-       r=`${PWD_COMMAND}`; export r; \
-       s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-       TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
-       CFLAGS="$(CFLAGS)"; export CFLAGS; \
-       CXX="$(CXX)"; export CXX; \
-       CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-       AR="$(AR)"; export AR; \
-       AS="$(AS)"; export AS; \
-       DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-       LD="$(LD)"; export LD; \
-       LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
-       NM="$(NM)"; export NM; \
-       RANLIB="$(RANLIB)"; export RANLIB; \
-       WINDRES="$(WINDRES)"; export WINDRES; \
-       OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-       OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
-       CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
-       CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; \
-       echo Configuring stage 2 in gcc; \
-       cd gcc || exit 1; \
-       case $(srcdir) in \
-         \.) \
-           srcdiroption="--srcdir=."; \
-           libsrcdir=".";; \
-         /* | [A-Za-z]:[\\/]*) \
-           srcdiroption="--srcdir=$(srcdir)/gcc"; \
-           libsrcdir="$$s/gcc";; \
-         *) \
-           srcdiroption="--srcdir=../$(srcdir)/gcc"; \
-           libsrcdir="$$s/gcc";; \
-       esac; \
-       $(SHELL) $${libsrcdir}/configure \
-         $(HOST_CONFIGARGS) $${srcdiroption} @stage2_werror_flag@ ; \
-       cd .. ; \
-       mv gcc stage2-gcc ; \
-       mv prev-gcc stage1-gcc ; \
-       $(STAMP) configure-stage2-gcc
-
 # Flags to pass to stage2 and later makes.
 BOOT_CFLAGS= -g -O2
 POSTSTAGE1_FLAGS_TO_PASS = \
        CFLAGS="$(BOOT_CFLAGS)" \
        ADAC="\$$(CC)"
 
-all-stage2-gcc: all-stage1-gcc configure-stage2-gcc
-       echo all-stage2-gcc > stage_last ; \
-       r=`${PWD_COMMAND}`; export r; \
-       s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       mv stage2-gcc gcc ; \
-       mv stage1-gcc prev-gcc ; \
-       cd gcc && \
-       $(MAKE) $(GCC_FLAGS_TO_PASS) \
-               CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
-               CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
-               STAGE_PREFIX=$$r/prev-gcc/ \
-               $(POSTSTAGE1_FLAGS_TO_PASS) && $(STAMP) ../all-stage2-gcc ; \
-       result=$$? ; \
-       cd .. ; \
-       mv prev-gcc stage1-gcc ; \
-       mv gcc stage2-gcc ; \
-       exit $$result
-
-configure-stage3-gcc: all-stage2-gcc
-       echo configure-stage3-gcc > stage_last ; \
-       if [ -f stage3-gcc/Makefile ] ; then \
-         $(STAMP) configure-stage3-gcc ; \
+# For stage 1:
+# * We force-disable intermodule optimizations, even if
+#   --enable-intermodule was passed, since the installed compiler probably
+#   can't handle them.  Luckily, autoconf always respects
+#   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.
+# * We build only C (and possibly Ada).
+
+[+ FOR bootstrap-stage +]
+.PHONY: new-stage[+id+]-start new-stage[+id+]-end
+
+new-stage[+id+]-start:
+       [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+       echo stage[+id+] > stage_last ; \
+       [ -d stage[+id+]-gcc ] || mkdir stage[+id+]-gcc; \
+       set stage[+id+]-gcc gcc ; @CREATE_LINK_TO_DIR@ [+ IF prev +] ; \
+       set stage[+prev+]-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ [+ ENDIF prev +]
+
+new-stage[+id+]-end:
+       rm -f stage_last ; \
+       set gcc stage[+id+]-gcc ; @UNDO_LINK_TO_DIR@ [+ IF prev +] ; \
+       set prev-gcc stage[+prev+]-gcc ; @UNDO_LINK_TO_DIR@ [+ ENDIF prev +]
+
+# Bubble a bugfix through all the stages up to stage [+id+].  They
+# are remade, but not reconfigured.  The next stage (if any) will not
+# be reconfigured as well.
+.PHONY: new-stage[+id+]-bubble
+new-stage[+id+]-bubble: [+ IF prev +]new-stage[+prev+]-bubble[+ ENDIF +]
+       @if [ -f all-stage[+id+]-gcc ] ; then \
+         echo Remaking stage [+id+] ; \
+         rm -f all-stage[+id+]-gcc ; \
+         $(MAKE) all-stage[+id+]-gcc [+ IF next +] && \
+         if [ -f configure-stage[+next+]-gcc ] ; then \
+           $(STAMP) configure-stage[+next+]-gcc ; \
+         fi [+ ENDIF next +]; \
+       else \
+         $(MAKE) all-stage[+id+]-gcc ; \
+       fi
+
+configure-stage[+id+]-gcc: [+ IF prev +] all-stage[+prev+]-gcc [+
+         ELSE +] prebootstrap [+ ENDIF prev +]
+       $(MAKE) new-stage[+id+]-start
+       @if [ -f stage[+id+]-gcc/Makefile ] ; then \
+         $(STAMP) configure-stage[+id+]-gcc ; \
          exit 0; \
        else \
          true ; \
        fi ; \
-       [ -d stage3-gcc ] || mkdir stage3-gcc; \
-       mv stage3-gcc gcc ; \
-       mv stage2-gcc prev-gcc ; \
        r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
@@ -1548,9 +1457,13 @@ configure-stage3-gcc: all-stage2-gcc
        WINDRES="$(WINDRES)"; export WINDRES; \
        OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
        OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+       GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
+       GMPINC="$(HOST_GMPINC)"; export GMPINC [+ IF prev +] ; \
        CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
-       CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; \
-       echo Configuring stage 3 in gcc; \
+       CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC_FOR_BUILD [+ ELSE +] ; \
+       CC="$(CC)"; export CC; \
+       CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD [+ ENDIF prev +] ; \
+       echo Configuring stage [+id+] in gcc ; \
        cd gcc || exit 1; \
        case $(srcdir) in \
          \.) \
@@ -1564,42 +1477,32 @@ configure-stage3-gcc: all-stage2-gcc
            libsrcdir="$$s/gcc";; \
        esac; \
        $(SHELL) $${libsrcdir}/configure \
-         $(HOST_CONFIGARGS) $${srcdiroption} @stage2_werror_flag@ ; \
-       cd .. ; \
-       mv gcc stage3-gcc ; \
-       mv prev-gcc stage2-gcc ; \
-       $(STAMP) configure-stage3-gcc
+         $(HOST_CONFIGARGS) $${srcdiroption} \
+         [+extra_configure_flags+] && \
+         $(STAMP) ../configure-stage[+id+]-gcc
 
-all-stage3-gcc: all-stage2-gcc configure-stage3-gcc
-       echo all-stage3-gcc > stage_last ; \
-       r=`${PWD_COMMAND}`; export r; \
+all-stage[+id+]-gcc: configure-stage[+id+]-gcc
+       $(MAKE) new-stage[+id+]-start
+       @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-       mv stage2-gcc prev-gcc ; \
-       mv stage3-gcc gcc ; \
        cd gcc && \
-       $(MAKE) $(GCC_FLAGS_TO_PASS) \
+       $(MAKE) $(GCC_FLAGS_TO_PASS) [+ IF prev +] \
                CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
                CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
-               STAGE_PREFIX=$$r/prev-gcc/ \
-               $(POSTSTAGE1_FLAGS_TO_PASS) && $(STAMP) ../all-stage3-gcc \
-       result=$$? ; \
-       cd .. ; \
-       mv prev-gcc stage2-gcc ; \
-       mv gcc stage3-gcc ; \
-       exit $$result
+               STAGE_PREFIX=$$r/stage[+prev+]-gcc/ [+ ENDIF prev +] \
+               [+extra_make_flags+] && $(STAMP) ../all-stage[+id+]-gcc
 
-# We only want to compare .o files, so set this!
-objext = .o
-
-compare: all-stage3-gcc
-       r=`${PWD_COMMAND}`; export r; \
+[+ IF compare-target +]
+[+compare-target+]: all-stage[+id+]-gcc
+       [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+       @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        rm -f .bad_compare ; \
-       cd stage3-gcc; \
+       cd stage[+id+]-gcc; \
        files=`find . -name "*$(objext)" -print` ; \
        cd .. ; \
        for file in $${files} ; do \
-         f1=$$r/stage2-gcc/$$file; f2=$$r/stage3-gcc/$$file; \
+         f1=$$r/stage[+prev+]-gcc/$$file; f2=$$r/stage[+id+]-gcc/$$file; \
          @do_compare@ > /dev/null 2>&1; \
          test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \
        done ; \
@@ -1610,40 +1513,38 @@ compare: all-stage3-gcc
        else \
          true; \
        fi ; \
-        $(STAMP) compare
-
-.PHONY: new-bootstrap
-# This target exists so that everything can be made in one pass.
-# 'all-gcc' has to avoid stomping on the bootstrap-generated gcc for
-# this to work.
-new-bootstrap: compare
-       mv stage3-gcc gcc ; \
-       $(MAKE) all ; \
-       mv gcc stage3-gcc
-
-new-cleanstrap:
-       rm -rf configure-stage1-gcc all-stage1-gcc stage1-gcc \
-         configure-stage2-gcc all-stage2-gcc stage2-gcc \
-         configure-stage3-gcc all-stage3-gcc stage3-gcc \
-         compare
-       $(MAKE) new-bootstrap
-
-new-restage1:
-       rm -rf all-stage1-gcc \
-         configure-stage2-gcc all-stage2-gcc stage2-gcc \
-         configure-stage3-gcc all-stage3-gcc stage3-gcc \
-         compare
-       $(MAKE) all-stage1-gcc
-
-new-restage2: all-stage1-gcc
-       rm -rf all-stage2-gcc \
-         configure-stage3-gcc all-stage3-gcc stage3-gcc \
-         compare
-       $(MAKE) all-stage2-gcc
-
-new-restage3: all-stage2-gcc
-       rm -rf all-stage3-gcc compare
-       $(MAKE) compare
+       $(STAMP) [+compare-target+]
+[+ ENDIF compare-target +]
+
+[+ IF bootstrap-target +]
+.PHONY: [+bootstrap-target+]
+[+bootstrap-target+]:
+       $(MAKE) new-stage[+id+]-bubble [+
+         IF compare-target +] [+compare-target+] [+
+         ENDIF compare-target +] \
+         new-stage[+id+]-start all new-stage[+id+]-end 
+[+ ENDIF bootstrap-target +]
+
+.PHONY: new-restage[+id+] distclean-stage[+id+]
+
+distclean-stage[+id+]: [+ IF next +] distclean-stage[+next+] [+ ENDIF next +]
+       [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+       rm -rf configure-stage[+id+]-gcc all-stage[+id+]-gcc stage[+id+]-gcc [+
+         IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
+
+new-restage[+id+]: [+ IF next +] distclean-stage[+next+] [+ ENDIF next +]
+       rm -rf all-stage[+id+]-gcc [+
+         IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
+       $(MAKE) [+
+         IF compare-target +][+compare-target+] [+
+         ELSE +] all-stage[+id+]-gcc [+ ENDIF compare-target +]
+
+[+ IF cleanstrap-target +]
+.PHONY: [+cleanstrap-target+]
+[+cleanstrap-target+]: distclean-stage1 [+bootstrap-target+]
+[+ ENDIF cleanstrap-target +]
+
+[+ ENDFOR bootstrap-stage +]
 
 # --------------------------------------
 # Dependencies between different modules
index 9b3653b..580c916 100755 (executable)
--- a/configure
+++ b/configure
@@ -733,6 +733,27 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:738: checking whether ln -s works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+  rm -f conftestdata
+  ac_cv_prog_LN_S="ln -s"
+else
+  ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+  echo "$ac_t""yes" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
 
 # Autoconf M4 include file defining utility macros for complex Canadian
 # cross builds.
@@ -788,6 +809,11 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
 
+
+
+
+
+
 ### we might need to use some other shell than /bin/sh for running subshells
 ### If we are on Windows, search for the shell.  This will permit people
 ### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure
@@ -1894,7 +1920,7 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1898: checking for $ac_word" >&5
+echo "configure:1924: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1924,7 +1950,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1928: checking for $ac_word" >&5
+echo "configure:1954: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1975,7 +2001,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1979: checking for $ac_word" >&5
+echo "configure:2005: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2007,7 +2033,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2011: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2037: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -2018,12 +2044,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 2022 "configure"
+#line 2048 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:2027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -2049,12 +2075,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2053: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2079: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2058: checking whether we are using GNU C" >&5
+echo "configure:2084: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2063,7 +2089,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2067: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -2082,7 +2108,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2086: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2112: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2118,7 +2144,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gnatbind; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2122: checking for $ac_word" >&5
+echo "configure:2148: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2150,7 +2176,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "gnatbind", so it can be a program name with args.
 set dummy gnatbind; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2154: checking for $ac_word" >&5
+echo "configure:2180: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2183,7 +2209,7 @@ fi
 fi
 
 echo $ac_n "checking whether compiler driver understands Ada""... $ac_c" 1>&6
-echo "configure:2187: checking whether compiler driver understands Ada" >&5
+echo "configure:2213: checking whether compiler driver understands Ada" >&5
 if eval "test \"`echo '$''{'acx_cv_cc_gcc_supports_ada'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2216,7 +2242,7 @@ else
 fi
 
 echo $ac_n "checking how to compare bootstrapped objects""... $ac_c" 1>&6
-echo "configure:2220: checking how to compare bootstrapped objects" >&5
+echo "configure:2246: checking how to compare bootstrapped objects" >&5
 if eval "test \"`echo '$''{'gcc_cv_prog_cmp_skip'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2289,9 +2315,9 @@ saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS $gmpinc"
 # Check GMP actually works
 echo $ac_n "checking for correct version of gmp.h""... $ac_c" 1>&6
-echo "configure:2293: checking for correct version of gmp.h" >&5
+echo "configure:2319: checking for correct version of gmp.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2295 "configure"
+#line 2321 "configure"
 #include "confdefs.h"
 #include "gmp.h"
 int main() {
@@ -2302,7 +2328,7 @@ choke me
 
 ; return 0; }
 EOF
-if { (eval echo configure:2306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -2315,19 +2341,19 @@ rm -f conftest*
 
 if test x"$have_gmp" = xyes; then
   echo $ac_n "checking for mpf_init in -lgmp""... $ac_c" 1>&6
-echo "configure:2319: checking for mpf_init in -lgmp" >&5
+echo "configure:2345: checking for mpf_init in -lgmp" >&5
 
   saved_LIBS="$LIBS"
   LIBS="$LIBS $gmplibs"
   cat > conftest.$ac_ext <<EOF
-#line 2324 "configure"
+#line 2350 "configure"
 #include "confdefs.h"
 #include <gmp.h>
 int main() {
 mpf_t n; mpf_init(n);
 ; return 0; }
 EOF
-if { (eval echo configure:2331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -2789,7 +2815,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2793: checking for $ac_word" >&5
+echo "configure:2819: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DEFAULT_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2824,7 +2850,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2828: checking for $ac_word" >&5
+echo "configure:2854: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DEFAULT_M4'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2859,7 +2885,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2863: checking for $ac_word" >&5
+echo "configure:2889: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DEFAULT_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3434,7 +3460,7 @@ test -n "$target_alias" && ncn_target_tool_prefix=$target_alias-
   # Extract the first word of "${ncn_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3438: checking for $ac_word" >&5
+echo "configure:3464: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3467,7 +3493,7 @@ if test -z "$ac_cv_prog_AR" ; then
     # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3471: checking for $ac_word" >&5
+echo "configure:3497: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3506,7 +3532,7 @@ fi
   # Extract the first word of "${ncn_tool_prefix}as", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3510: checking for $ac_word" >&5
+echo "configure:3536: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3539,7 +3565,7 @@ if test -z "$ac_cv_prog_AS" ; then
     # Extract the first word of "as", so it can be a program name with args.
 set dummy as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3543: checking for $ac_word" >&5
+echo "configure:3569: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3578,7 +3604,7 @@ fi
   # Extract the first word of "${ncn_tool_prefix}dlltool", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3582: checking for $ac_word" >&5
+echo "configure:3608: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3611,7 +3637,7 @@ if test -z "$ac_cv_prog_DLLTOOL" ; then
     # Extract the first word of "dlltool", so it can be a program name with args.
 set dummy dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3615: checking for $ac_word" >&5
+echo "configure:3641: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3650,7 +3676,7 @@ fi
   # Extract the first word of "${ncn_tool_prefix}ld", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}ld; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3654: checking for $ac_word" >&5
+echo "configure:3680: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3683,7 +3709,7 @@ if test -z "$ac_cv_prog_LD" ; then
     # Extract the first word of "ld", so it can be a program name with args.
 set dummy ld; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3687: checking for $ac_word" >&5
+echo "configure:3713: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3722,7 +3748,7 @@ fi
   # Extract the first word of "${ncn_tool_prefix}nm", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}nm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3726: checking for $ac_word" >&5
+echo "configure:3752: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3755,7 +3781,7 @@ if test -z "$ac_cv_prog_NM" ; then
     # Extract the first word of "nm", so it can be a program name with args.
 set dummy nm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3759: checking for $ac_word" >&5
+echo "configure:3785: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3794,7 +3820,7 @@ fi
   # Extract the first word of "${ncn_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3798: checking for $ac_word" >&5
+echo "configure:3824: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3827,7 +3853,7 @@ if test -z "$ac_cv_prog_RANLIB" ; then
     # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3831: checking for $ac_word" >&5
+echo "configure:3857: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3866,7 +3892,7 @@ fi
   # Extract the first word of "${ncn_tool_prefix}windres", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3870: checking for $ac_word" >&5
+echo "configure:3896: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3899,7 +3925,7 @@ if test -z "$ac_cv_prog_WINDRES" ; then
     # Extract the first word of "windres", so it can be a program name with args.
 set dummy windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3903: checking for $ac_word" >&5
+echo "configure:3929: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3938,7 +3964,7 @@ fi
   # Extract the first word of "${ncn_tool_prefix}objcopy", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}objcopy; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3942: checking for $ac_word" >&5
+echo "configure:3968: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3971,7 +3997,7 @@ if test -z "$ac_cv_prog_OBJCOPY" ; then
     # Extract the first word of "objcopy", so it can be a program name with args.
 set dummy objcopy; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3975: checking for $ac_word" >&5
+echo "configure:4001: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJCOPY'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4010,7 +4036,7 @@ fi
   # Extract the first word of "${ncn_tool_prefix}objdump", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}objdump; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4014: checking for $ac_word" >&5
+echo "configure:4040: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4043,7 +4069,7 @@ if test -z "$ac_cv_prog_OBJDUMP" ; then
     # Extract the first word of "objdump", so it can be a program name with args.
 set dummy objdump; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4047: checking for $ac_word" >&5
+echo "configure:4073: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJDUMP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4092,7 +4118,7 @@ fi
   # Extract the first word of "${ncn_target_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4096: checking for $ac_word" >&5
+echo "configure:4122: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_AR_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4125,7 +4151,7 @@ if test -z "$ac_cv_prog_CONFIGURED_AR_FOR_TARGET" ; then
     # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4129: checking for $ac_word" >&5
+echo "configure:4155: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_AR_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4164,7 +4190,7 @@ fi
   # Extract the first word of "${ncn_target_tool_prefix}as", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4168: checking for $ac_word" >&5
+echo "configure:4194: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_AS_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4197,7 +4223,7 @@ if test -z "$ac_cv_prog_CONFIGURED_AS_FOR_TARGET" ; then
     # Extract the first word of "as", so it can be a program name with args.
 set dummy as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4201: checking for $ac_word" >&5
+echo "configure:4227: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_AS_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4236,7 +4262,7 @@ fi
   # Extract the first word of "${ncn_target_tool_prefix}dlltool", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4240: checking for $ac_word" >&5
+echo "configure:4266: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4269,7 +4295,7 @@ if test -z "$ac_cv_prog_CONFIGURED_DLLTOOL_FOR_TARGET" ; then
     # Extract the first word of "dlltool", so it can be a program name with args.
 set dummy dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4273: checking for $ac_word" >&5
+echo "configure:4299: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4308,7 +4334,7 @@ fi
   # Extract the first word of "${ncn_target_tool_prefix}ld", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}ld; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4312: checking for $ac_word" >&5
+echo "configure:4338: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_LD_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4341,7 +4367,7 @@ if test -z "$ac_cv_prog_CONFIGURED_LD_FOR_TARGET" ; then
     # Extract the first word of "ld", so it can be a program name with args.
 set dummy ld; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4345: checking for $ac_word" >&5
+echo "configure:4371: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_LD_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4380,7 +4406,7 @@ fi
   # Extract the first word of "${ncn_target_tool_prefix}nm", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}nm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4384: checking for $ac_word" >&5
+echo "configure:4410: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_NM_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4413,7 +4439,7 @@ if test -z "$ac_cv_prog_CONFIGURED_NM_FOR_TARGET" ; then
     # Extract the first word of "nm", so it can be a program name with args.
 set dummy nm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4417: checking for $ac_word" >&5
+echo "configure:4443: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_NM_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4452,7 +4478,7 @@ fi
   # Extract the first word of "${ncn_target_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4456: checking for $ac_word" >&5
+echo "configure:4482: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_RANLIB_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4485,7 +4511,7 @@ if test -z "$ac_cv_prog_CONFIGURED_RANLIB_FOR_TARGET" ; then
     # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4489: checking for $ac_word" >&5
+echo "configure:4515: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_RANLIB_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4524,7 +4550,7 @@ fi
   # Extract the first word of "${ncn_target_tool_prefix}windres", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4528: checking for $ac_word" >&5
+echo "configure:4554: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_WINDRES_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4557,7 +4583,7 @@ if test -z "$ac_cv_prog_CONFIGURED_WINDRES_FOR_TARGET" ; then
     # Extract the first word of "windres", so it can be a program name with args.
 set dummy windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4561: checking for $ac_word" >&5
+echo "configure:4587: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_WINDRES_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4642,7 +4668,7 @@ RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
 NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:4646: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:4672: checking whether to enable maintainer-specific portions of Makefiles" >&5
 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -4685,6 +4711,42 @@ case $build in
 esac
 
 
+# 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
+# possible, however, we can resort to mv.
+echo $ac_n "checking if symbolic links between directories work""... $ac_c" 1>&6
+echo "configure:4719: checking if symbolic links between directories work" >&5
+if eval "test \"`echo '$''{'gcc_cv_prog_ln_s_dir'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "${LN_S}" = "ln -s" \
+   && mkdir confdir.s1 \
+   && ln -s confdir.s1 confdir.s2 \
+   && echo timestamp1 > confdir.s1/conftest.1 \
+   && cmp confdir.s1/conftest.1 confdir.s2/conftest.1 \
+   && echo timestamp2 > confdir.s2/conftest.2 \
+   && cmp confdir.s1/conftest.2 confdir.s1/conftest.2 \
+   && rm -f confdir.s2; then
+  gcc_cv_prog_ln_s_dir=yes
+else
+  gcc_cv_prog_ln_s_dir=yes
+fi
+rm -rf confdir.s1 confdir.s2
+fi
+
+echo "$ac_t""$gcc_cv_prog_ln_s_dir" 1>&6
+
+case ${gcc_cv_prog_ln_s_dir} in
+  yes)
+    CREATE_LINK_TO_DIR='ln -s $$1 $$2'
+    UNDO_LINK_TO_DIR='rm -f $$1' ;;
+  *)
+    CREATE_LINK_TO_DIR='mv $$1 $$2'
+    UNDO_LINK_TO_DIR='mv $$1 $$2' ;;
+esac
+
+
+
 # Enable -Werror in bootstrap stage2 and later.
 # Change the default to "no" on release branches.
 # Check whether --enable-werror or --disable-werror was given.
@@ -4864,6 +4926,7 @@ s%@build_os@%$build_os%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
 s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@LN_S@%$LN_S%g
 s%@TOPLEVEL_CONFIGURE_ARGUMENTS@%$TOPLEVEL_CONFIGURE_ARGUMENTS%g
 s%@build_subdir@%$build_subdir%g
 s%@host_subdir@%$host_subdir%g
@@ -4965,6 +5028,8 @@ s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
 s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
 s%@MAINT@%$MAINT%g
 s%@stage1_cflags@%$stage1_cflags%g
+s%@CREATE_LINK_TO_DIR@%$CREATE_LINK_TO_DIR%g
+s%@UNDO_LINK_TO_DIR@%$UNDO_LINK_TO_DIR%g
 s%@stage2_werror_flag@%$stage2_werror_flag%g
 
 CEOF
index c4c7fad..42f7bea 100644 (file)
@@ -25,6 +25,7 @@ AC_ARG_PROGRAM
 
 # Get 'install' or 'install-sh' and its variants.
 AC_PROG_INSTALL
+AC_PROG_LN_S
 
 sinclude(config/acx.m4)
 
@@ -2247,6 +2248,36 @@ case $build in
 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
+# possible, however, we can resort to mv.
+AC_CACHE_CHECK([if symbolic links between directories work],
+[gcc_cv_prog_ln_s_dir],
+[if test "${LN_S}" = "ln -s" \
+   && mkdir confdir.s1 \
+   && ln -s confdir.s1 confdir.s2 \
+   && echo timestamp1 > confdir.s1/conftest.1 \
+   && cmp confdir.s1/conftest.1 confdir.s2/conftest.1 \
+   && echo timestamp2 > confdir.s2/conftest.2 \
+   && cmp confdir.s1/conftest.2 confdir.s1/conftest.2 \
+   && rm -f confdir.s2; then
+  gcc_cv_prog_ln_s_dir=yes
+else
+  gcc_cv_prog_ln_s_dir=yes
+fi
+rm -rf confdir.s1 confdir.s2])
+
+case ${gcc_cv_prog_ln_s_dir} in
+  yes)
+    CREATE_LINK_TO_DIR='ln -s $$1 $$2'
+    UNDO_LINK_TO_DIR='rm -f $$1' ;;
+  *)
+    CREATE_LINK_TO_DIR='mv $$1 $$2'
+    UNDO_LINK_TO_DIR='mv $$1 $$2' ;;
+esac
+AC_SUBST(CREATE_LINK_TO_DIR)
+AC_SUBST(UNDO_LINK_TO_DIR)
+
 # Enable -Werror in bootstrap stage2 and later.
 # Change the default to "no" on release branches.
 AC_ARG_ENABLE(werror,