aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in62
1 files changed, 48 insertions, 14 deletions
diff --git a/configure.in b/configure.in
index b6c046b..080ac0d 100644
--- a/configure.in
+++ b/configure.in
@@ -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],