add support for USE=mudflap (gcc4+), remove the cross-compile multilib hack for mips...
authorMike Frysinger <vapier@gentoo.org>
Fri, 18 Nov 2005 03:59:31 +0000 (03:59 +0000)
committerMike Frysinger <vapier@gentoo.org>
Fri, 18 Nov 2005 03:59:31 +0000 (03:59 +0000)
eclass/toolchain.eclass

index 508e5d6ef943ed7621929eb56079081b30ee614e..0d8bfb37f6b7338722e466c1d005e06bca2a7553 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.218 2005/11/16 05:21:35 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.219 2005/11/18 03:59:31 vapier Exp $
 
 HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html"
 LICENSE="GPL-2 LGPL-2.1"
@@ -126,7 +126,7 @@ if [[ ${ETYPE} == "gcc-library" ]] ; then
        IUSE="nls build"
        SLOT="${CTARGET}-${SO_VERSION_SLOT:-5}"
 else
-       IUSE="altivec bootstrap build fortran gcj gtk hardened ip28 multilib multislot n32 n64 nls nocxx objc objc-gc vanilla"
+       IUSE="altivec bootstrap build fortran gcj gtk hardened ip28 multilib multislot n32 n64 nls nocxx objc objc-gc vanilla mudflap"
        [[ -n ${PIE_VER}    ]] && IUSE="${IUSE} nopie"
        [[ -n ${PP_VER}     ]] && IUSE="${IUSE} nossp"
        [[ -n ${HTB_VER}    ]] && IUSE="${IUSE} boundschecking"
@@ -1047,6 +1047,8 @@ gcc-compiler-configure() {
                confgcc="${confgcc} --disable-multilib"
        fi
 
+       confgcc="${confgcc} $(use_enable mudflap libmudflap)"
+
        # GTK+ is preferred over xlib in 3.4.x (xlib is unmaintained
        # right now). Much thanks to <csm@gnu.org> for the heads up.
        # Travis Tilley <lv@gentoo.org>  (11 Jul 2004)
@@ -1059,9 +1061,9 @@ gcc-compiler-configure() {
        case $(tc-arch) in
                # Add --with-abi flags to enable respective MIPS ABIs
                mips)
-               if is_crosscompile && is_multilib; then
+               if is_multilib; then
                        confgcc="${confgcc} --with-abi=32 --with-abi=64 --with-abi=n32"
-               else
+               elif ! is_crosscompile ; then
                        is_multilib && confgcc="${confgcc} --with-abi=32"
                        use n64 && confgcc="${confgcc} --with-abi=64"
                        use n32 && confgcc="${confgcc} --with-abi=n32"
@@ -1176,9 +1178,10 @@ gcc_do_configure() {
                        avr)        confgcc="${confgcc} --enable-shared --disable-threads";;
                esac
                if [[ -n ${needed_libc} ]] ; then
-                       if ! has_version ${CATEGORY}/${needed_libc} && \
-                          ! has_version ${CATEGORY}/${needed_libc}-headers ; then
-                               confgcc="${confgcc} --disable-shared --disable-threads --without-headers --disable-libmudflap"
+                       if ! has_version ${CATEGORY}/${needed_libc} ; then
+                               confgcc="${confgcc} --disable-shared --disable-threads --without-headers"
+                       elif built_with_use ${CATEGORY}/${needed_libc} _E_CROSS_HEADERS_ONLY ; then
+                               confgcc="${confgcc} --disable-shared --with-sysroot=${PREFIX}/${CTARGET}"
                        else
                                confgcc="${confgcc} --with-sysroot=${PREFIX}/${CTARGET}"
                        fi
@@ -1534,7 +1537,7 @@ gcc-compiler_src_install() {
        fi
 
        # Move the libraries to the proper location
-       gcc_movelibs &> /dev/null
+       gcc_movelibs
 
        # Make sure we dont have stuff lying around that
        # can nuke multiple versions of gcc