[PATCH 2 of 3] config/cc: CC_STATIC_LIBSTDCXX 'depends on' CONFIGURE_has_static_libstdcpp

Yann E. MORIN yann.morin.1998@anciens.enib.fr
Tue May 31 12:19:00 GMT 2011


# HG changeset patch
# User Bryan Hundven <bryanhundven@gmail.com>
# Date 1306822450 25200
# Node ID 2b8da144f6a51d1f82f53cd7e564c0dc59f190f0
# Parent  94a989d4e73b60775a1bfcfb0fc05790017f165d
config/cc: CC_STATIC_LIBSTDCXX 'depends on' CONFIGURE_has_static_libstdcpp

Hide the staticaly linked libstdc++ option if the static libstdc++ is not
present, detected at configure time.

Add a blind option that says whether static linking is possible at all.
It defaults to 'y', but depends on the needed CONFIGURE_* options. For
now, it only depends on static libtdc++, but new dependencies can be
easily added.

Hide the global static toolchain option behind this new option.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
[yann.morin.1998@anciens.enib.fr: change logic to keep forward deps]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>

diff --git a/config/cc/gcc.in.2 b/config/cc/gcc.in.2
--- a/config/cc/gcc.in.2
+++ b/config/cc/gcc.in.2
@@ -64,6 +64,7 @@
     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
--- a/config/toolchain.in
+++ b/config/toolchain.in
@@ -47,10 +47,19 @@
       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
     default n
     help
       Build static host binaries.
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -436,6 +436,10 @@
 has_or_abort lib="${stdcxx_libs}" \
              err="'libstdc++' shared library was not found"
 
+has_or_warn  lib="libstdc++.a" \
+             err="'libstdc++' static library was not found" \
+             kconfig=has_static_libstdcxx
+
 #---------------------------------------------------------------------
 # Compute the version string
 

--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list