aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2014-07-13 00:55:11 +0100
committerRobert Savoye <rob.savoye@linaro.org>2014-07-22 12:27:18 +0000
commitadc18d8ec328e86bc60766e1f7dacbfcf5ab6c9d (patch)
treee0e67fefc2cd4e55e7c9d36a5f04d6c017e84a61
parentdb161edcd0fa1604f5c3ff0a3ec0907276f64b9d (diff)
Add configure option to choose compiler languages
Configure-time option --with-languages=<lang1,lang2,...> will configure gcc to compile for given languages. Special value "default" will choose appropriate default for the target. Change-Id: I29ec8d8c3b90552424cfff27a86a0287dc9be28d
-rw-r--r--config/gcc.conf17
-rwxr-xr-xconfigure13
-rw-r--r--configure.ac6
-rw-r--r--host.conf.in1
4 files changed, 35 insertions, 2 deletions
diff --git a/config/gcc.conf b/config/gcc.conf
index eb3778f..93f6def 100644
--- a/config/gcc.conf
+++ b/config/gcc.conf
@@ -100,7 +100,12 @@ if test x"${build}" != x"${target}"; then
need_qemu=yes
;;
*-mingw32)
- default_configure_flags="${default_configure_flags} --enable-languages=c,c++ --disable-plugins"
+ if test x"${with_languages}" != x"default"; then
+ languages="${with_languages}"
+ else
+ languages="c,c++"
+ fi
+ default_configure_flags="${default_configure_flags} --enable-languages=${languages} --disable-plugins"
# Cygwin doesn't support GCC plugins
# default_configure_flags="`echo ${default_configure_flags} | sed -e 's:--enable-plugin ::`"
need_qemu=no
@@ -133,6 +138,9 @@ if test x"${build}" != x"${target}"; then
esac
# bootstrapping is handled by Jenkins now.
+ if test x"${with_languages}" != x"default"; then
+ languages="${with_languages}"
+ fi
stage2_flags="--with-build-sysroot=${sysroots} --enable-lto --enable-linker-build-id --enable-long-long --enable-languages=${languages}"
# The sysroot path depends on the C library version.
@@ -142,7 +150,12 @@ if test x"${build}" != x"${target}"; then
# native builds are easy, so build almost everything
else
- default_configure_flags="${default_configure_flags} --enable-linker-build-id --without-included-gettext --enable-threads=posix --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --enable-languages=c,c++,go,objc,fortran"
+ if test x"${with_languages}" != x"default"; then
+ languages="${with_languages}"
+ else
+ languages="c,c++,go,objc,fortran"
+ fi
+ default_configure_flags="${default_configure_flags} --enable-linker-build-id --without-included-gettext --enable-threads=posix --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --enable-languages=${languages}"
# Native compilers are bootstrapped by default, but sometimes the extra time isn't
# desired.
if test x"${bootstrap}" = x"yes"; then
diff --git a/configure b/configure
index 8fb5a67..128c450 100755
--- a/configure
+++ b/configure
@@ -577,6 +577,7 @@ ENABLE_INSTALL
ENABLE_ALLTESTS
ENABLE_BOOTSTRAP
ENABLE_SSH
+WITH_LANGUAGES
REMOTE_SNAPSHOTS
LOCAL_BUILDS
GIT_REFERENCE_DIR
@@ -669,6 +670,7 @@ with_local_snapshots
with_git_reference_dir
with_local_builds
with_remote_snapshots
+with_languages
enable_ssh
enable_bootstrap
enable_alltests
@@ -1325,6 +1327,7 @@ Optional Packages:
--reference
--with-local-builds
--with-remote-snapshots
+ --with-languages List of languages for the compiler
Some influential environment variables:
CC C compiler command
@@ -3721,6 +3724,16 @@ $as_echo "$as_me: Sysroots will be installed in: ${SYSROOTS}" >&6;}
$as_echo "$as_me: Remote snapshots will be fetched from: ${REMOTE_SNAPSHOTS}" >&6;}
echo ""
+
+# Check whether --with-languages was given.
+if test "${with_languages+set}" = set; then :
+ withval=$with_languages; WITH_LANGUAGES=${withval}
+else
+ WITH_LANGUAGES='default'
+fi
+
+
+
# Check whether --enable-ssh was given.
if test "${enable_ssh+set}" = set; then :
enableval=$enable_ssh; case "${enableval}" in
diff --git a/configure.ac b/configure.ac
index cc29d59..90f9fa6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -290,6 +290,12 @@ AC_MSG_NOTICE([Sysroots will be installed in: ${SYSROOTS}])
AC_MSG_NOTICE([Remote snapshots will be fetched from: ${REMOTE_SNAPSHOTS}])
echo ""
+AC_ARG_WITH(languages,
+ AC_HELP_STRING([--with-languages], [List of languages for the compiler]),
+ WITH_LANGUAGES=${withval},
+ WITH_LANGUAGES='default')
+AC_SUBST(WITH_LANGUAGES)
+
dnl if you have SSH access to the remote machine
AC_ARG_ENABLE(ssh, AC_HELP_STRING([--enable-ssh], [If you have SSH access to remote build host]),
[case "${enableval}" in
diff --git a/host.conf.in b/host.conf.in
index a790d12..e0f08cb 100644
--- a/host.conf.in
+++ b/host.conf.in
@@ -27,6 +27,7 @@ hostname=@HOSTNAME@
distribution=@DISTRIBUTION@
# various configure time flags
+with_languages=@WITH_LANGUAGES@
enable_ssh=@ENABLE_SSH@
bootstrap=@ENABLE_BOOTSTRAP@
alltests=@ENABLE_ALLTESTS@