cc/gcc: add option to use system zlib
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Dec 31 16:23:27 2011 +0100 (2011-12-31)
changeset 28143dc2727ebffc
parent 2813 5b9d68ed6f52
child 2815 446a17b5dd1e
cc/gcc: add option to use system zlib

In some cases, it might be desirable to use the system zlib

Eg. because latest gcc seem to be totally borked when it comes
to multilib, and tries to build a multilib host zlib, when it
is *absolutely* *not* needed: we want mulitlib on the target,
not on the host! Sigh... :-(

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
config/cc/gcc.in.2
scripts/build/cc/gcc.sh
     1.1 --- a/config/cc/gcc.in.2	Fri Dec 30 22:04:24 2011 +0100
     1.2 +++ b/config/cc/gcc.in.2	Sat Dec 31 16:23:27 2011 +0100
     1.3 @@ -53,6 +53,19 @@
     1.4        having to worry about distributing the matching version of libstdc++
     1.5        along with it.
     1.6  
     1.7 +config CC_GCC_SYSTEM_ZLIB
     1.8 +    bool
     1.9 +    prompt "Use system zlib"
    1.10 +    depends on EXPERIMENTAL
    1.11 +    help
    1.12 +      Do not use bundled zlib, and use the zlib already available for
    1.13 +      the host (eg. the system library).
    1.14 +      
    1.15 +      If you want to build a static toolchain, you will need to also
    1.16 +      install the static version of zlib for your host.
    1.17 +      
    1.18 +      If unsure, say 'n'.
    1.19 +
    1.20  #-----------------------------------------------------------------------------
    1.21  # Optimisation features
    1.22  
     2.1 --- a/scripts/build/cc/gcc.sh	Fri Dec 30 22:04:24 2011 +0100
     2.2 +++ b/scripts/build/cc/gcc.sh	Sat Dec 31 16:23:27 2011 +0100
     2.3 @@ -293,6 +293,10 @@
     2.4  
     2.5      [ "${CT_CC_GCC_DISABLE_PCH}" = "y" ] && extra_config+=("--disable-libstdcxx-pch")
     2.6  
     2.7 +    if [ "${CT_CC_GCC_SYSTEM_ZLIB}" = "y" ]; then
     2.8 +        extra_config+=("--with-system-zlib")
     2.9 +    fi
    2.10 +
    2.11      CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"
    2.12  
    2.13      # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
    2.14 @@ -603,6 +607,10 @@
    2.15  
    2.16      [ "${CT_TOOLCHAIN_ENABLE_NLS}" != "y" ] && extra_config+=("--disable-nls")
    2.17  
    2.18 +    if [ "${CT_CC_GCC_SYSTEM_ZLIB}" = "y" ]; then
    2.19 +        extra_config+=("--with-system-zlib")
    2.20 +    fi
    2.21 +
    2.22      CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"
    2.23  
    2.24      CT_DoExecLog CFG                                \