cc/gcc: fix C++ headers location
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Fri Oct 08 23:37:12 2010 +0200 (2010-10-08)
changeset 2141a09246191120
parent 2140 bf9fa67629cd
child 2142 17e9137b962e
child 2161 3c648212298e
cc/gcc: fix C++ headers location

In case we build the C++ compiler, we have to tell gcc where to put the C++
headers, or else it will try to # put it in prefix/tuple/include, which we
make a symlink to sysroot/usr/include during the build, and that we delete
(the symlink!) after the build, but gcc will not look in sysroot/usr/inlcude
for C++ headers by default.

Implements a fix suggested by: Bryan Hundven <bryanhundven@gmail.com>

Reported-by: Anthony Foiani <anthony.foiani@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
scripts/build/cc/gcc.sh
     1.1 --- a/scripts/build/cc/gcc.sh	Thu Oct 07 23:53:16 2010 +0200
     1.2 +++ b/scripts/build/cc/gcc.sh	Fri Oct 08 23:37:12 2010 +0200
     1.3 @@ -324,6 +324,15 @@
     1.4      CT_Test "Building ${CT_CC_LANG_OTHERS//,/ } language(s) is not yet supported. Will try..." -n "${CT_CC_LANG_OTHERS}"
     1.5      lang_opt=$(echo "${lang_opt},${CT_CC_LANG_OTHERS}" |sed -r -e 's/,+/,/g; s/,*$//;')
     1.6  
     1.7 +    # In case we build the C++ compiler, we have to tell gcc where to put the
     1.8 +    # C++ headers, or else it will try to put it in prefix/tuple/include,
     1.9 +    # which we make a symlink to sysroot/usr/include during the build, and
    1.10 +    # that we delete (the symlink!) after the build, but gcc will not look
    1.11 +    # in sysroot/usr/inlcude for C++ headers by default
    1.12 +    if [ "${CT_CC_LANG_CXX}" = "y"   ]; then
    1.13 +        extra_config+=("--with-gxx-include-dir=${CT_SYSROOT_DIR}/usr/include")
    1.14 +    fi
    1.15 +
    1.16      extra_config+=("--enable-languages=${lang_opt}")
    1.17      extra_config+=("--disable-multilib")
    1.18      for tmp in ARCH ABI CPU TUNE FPU FLOAT; do