# HG changeset patch # User "Yann E. MORIN" # Date 1307037012 -7200 # Node ID ba1e71fa72a99f5714022767d0276d6df9719f26 # Parent 56b7eab1391ae9fa49a251c2f76c1cf8fd56b8cb cc/gcc: 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. Original patch by Bryan Hundven Signed-off-by: "Yann E. MORIN" diff -r 56b7eab1391a -r ba1e71fa72a9 config/cc/gcc.in.2 --- a/config/cc/gcc.in.2 Thu Jun 02 19:49:36 2011 +0200 +++ b/config/cc/gcc.in.2 Thu Jun 02 19:50:12 2011 +0200 @@ -44,6 +44,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 -r 56b7eab1391a -r ba1e71fa72a9 config/toolchain.in --- a/config/toolchain.in Thu Jun 02 19:49:36 2011 +0200 +++ b/config/toolchain.in Thu Jun 02 19:50:12 2011 +0200 @@ -46,10 +46,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 help Build static host binaries. diff -r 56b7eab1391a -r ba1e71fa72a9 configure --- a/configure Thu Jun 02 19:49:36 2011 +0200 +++ b/configure Thu Jun 02 19:50:12 2011 +0200 @@ -437,6 +437,14 @@ 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