summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/cc/gcc.in.21
-rw-r--r--config/toolchain.in9
-rwxr-xr-xconfigure8
3 files changed, 18 insertions, 0 deletions
diff --git a/config/cc/gcc.in.2 b/config/cc/gcc.in.2
index bf33373..c8d991a 100644
--- a/config/cc/gcc.in.2
+++ b/config/cc/gcc.in.2
@@ -44,6 +44,7 @@ config CC_STATIC_LIBSTDCXX
bool
prompt "Link libstdc++ statically into the gcc binary"
default y
+ depends on CONFIGURE_has_static_libstdcxx
depends on CC_GCC_4_4_or_later
help
Newer gcc versions use the PPL library which is C++ code. Statically
diff --git a/config/toolchain.in b/config/toolchain.in
index d5ee6b7..bc8f19c 100644
--- a/config/toolchain.in
+++ b/config/toolchain.in
@@ -46,10 +46,19 @@ config SYSROOT_DIR_PREFIX
In fact, the sysroot path is constructed as:
${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/${CT_SYSROOT_NAME}
+# In case we need to add more conditions to enable static
+# toolchain, we'll be adding them here
+config STATIC_TOOLCHAIN_POSSIBLE
+ bool
+ default y
+ depends on CONFIGURE_has_static_libstdcxx
+ # Add new deps here! :-)
+
config STATIC_TOOLCHAIN
bool
prompt "Build Static Toolchain (EXPERIMENTAL)"
depends on EXPERIMENTAL
+ depends on STATIC_TOOLCHAIN_POSSIBLE
help
Build static host binaries.
diff --git a/configure b/configure
index 6982257..d0c032a 100755
--- a/configure
+++ b/configure
@@ -437,6 +437,14 @@ stdcxx_libs="$( for x in so dylib a; do \
has_or_abort lib="${stdcxx_libs}" \
err="'libstdc++' shared library was not found"
+# Yes, we may be checking twice for libstdc++.a
+# The first is because we need one instance of libstdc++ (shared or static)
+# because it is needed for PPL; the second is because the static version is
+# required for static-linking, and if missing, the option is removed.
+has_or_warn lib="libstdc++.a" \
+ err="static 'libstdc++' is needed to statically link the toolchain's executables" \
+ kconfig=has_static_libstdcxx
+
#---------------------------------------------------------------------
# Compute the version string