summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-20 14:08:42 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-20 14:08:42 +0000
commit6c59dfa445b9ed8b839dd7bfc85db3d6a5a10f8f (patch)
tree0e4a1a1ca26022ac44a348b5c18f5c399754b078 /configure.ac
parent6c2d82abbc1704e7b3fe408c067e677e09b37543 (diff)
downloadgcc-6c59dfa445b9ed8b839dd7bfc85db3d6a5a10f8f.tar.gz
PR bootstrap/49787
* configure.ac: Move --enable-bootstrap handling earlier in file. If --enable-bootstrap and either --enable-build-with-cxx or --enable-build-poststage1-with-cxx, enable C++ automatically. * configure: Rebuild. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176512 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac104
1 files changed, 55 insertions, 49 deletions
diff --git a/configure.ac b/configure.ac
index c53d381b727..e64e5775f13 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1133,6 +1133,48 @@ fi
ACX_PROG_GNAT
ACX_PROG_CMP_IGNORE_INITIAL
+AC_ARG_ENABLE([bootstrap],
+[AS_HELP_STRING([--enable-bootstrap],
+ [enable bootstrapping @<:@yes if native build@:>@])],,
+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. Enable bootstrap if we have a compiler
+ # and we are in a native configuration.
+ yes:$build:$build:default)
+ enable_bootstrap=yes ;;
+
+ *:*:*:default)
+ enable_bootstrap=no ;;
+
+ # We have a compiler and we are in a native configuration, bootstrap is ok
+ yes:$build:$build:yes)
+ ;;
+
+ # Other configurations, but we have a compiler. Assume the user knows
+ # what he's doing.
+ yes:*:*:yes)
+ AC_MSG_WARN([trying to bootstrap a cross compiler])
+ ;;
+
+ # No compiler: if they passed --enable-bootstrap explicitly, fail
+ no:*:*:yes)
+ AC_MSG_ERROR([cannot bootstrap without a compiler]) ;;
+
+ # Fail if wrong command line
+ *)
+ AC_MSG_ERROR([invalid option for --enable-bootstrap])
+ ;;
+esac
+
# See if we are building gcc with C++.
AC_ARG_ENABLE(build-with-cxx,
[AS_HELP_STRING([--enable-build-with-cxx],
@@ -1628,6 +1670,19 @@ if test -d ${srcdir}/gcc; then
;;
esac
+ # If bootstrapping, then using --enable-build-with-cxx or
+ # --enable-build-poststage1-with-cxx requires enabling C++.
+ case ",$enable_languages,:,$ENABLE_BUILD_WITH_CXX,$ENABLE_BUILD_POSTSTAGE1_WITH_CXX,:$enable_bootstrap" in
+ *,c++,*:*:*) ;;
+ *:*,yes,*:yes)
+ if test -f ${srcdir}/gcc/cp/config-lang.in; then
+ enable_languages="${enable_languages},c++"
+ else
+ AC_MSG_ERROR([bootstrapping with --enable-build-with-cxx or --enable-build-poststage1-with-cxx requires c++ sources])
+ fi
+ ;;
+ esac
+
# First scan to see if an enabled language requires some other language.
# We assume that a given config-lang.in will list all the language
# front ends it requires, even if some are required indirectly.
@@ -2378,55 +2433,6 @@ INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g`
# 99 commands in a script, for HP-UX sed.
# Do not nest @if/@endif pairs, because configure will not warn you at all.
-AC_ARG_ENABLE([bootstrap],
-[AS_HELP_STRING([--enable-bootstrap],
- [enable bootstrapping @<:@yes if native build@:>@])],,
-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. Enable bootstrap if we have a compiler
- # and we are in a native configuration.
- yes:$build:$build:default)
- enable_bootstrap=yes ;;
-
- *:*:*:default)
- enable_bootstrap=no ;;
-
- # We have a compiler and we are in a native configuration, bootstrap is ok
- yes:$build:$build:yes)
- ;;
-
- # Other configurations, but we have a compiler. Assume the user knows
- # what he's doing.
- yes:*:*:yes)
- AC_MSG_WARN([trying to bootstrap a cross compiler])
- ;;
-
- # No compiler: if they passed --enable-bootstrap explicitly, fail
- no:*:*:yes)
- AC_MSG_ERROR([cannot bootstrap without a compiler]) ;;
-
- # Fail if wrong command line
- *)
- AC_MSG_ERROR([invalid option for --enable-bootstrap])
- ;;
-esac
-
-case ",$enable_languages,:,$ENABLE_BUILD_WITH_CXX,$ENABLE_BUILD_POSTSTAGE1_WITH_CXX,:$enable_bootstrap" in
- *,c++,*:*:*) ;;
- *:*,yes,*:yes)
- AC_MSG_ERROR([bootstrapping with --enable-build-with-cxx or --enable-build-postage1-with-cxx requires c++ in --enable-languages])
- ;;
-esac
-
case "$enable_bootstrap:$ENABLE_GOLD: $configdirs :,$stage1_languages," in
yes:yes:*\ gold\ *:*,c++,*) ;;
yes:yes:*\ gold\ *:*)