Add in lto use flag, and cleaning up of python scripts for gcc-4.5
authorMark Loeser <halcy0n@gentoo.org>
Sat, 24 Apr 2010 23:53:14 +0000 (23:53 +0000)
committerMark Loeser <halcy0n@gentoo.org>
Sat, 24 Apr 2010 23:53:14 +0000 (23:53 +0000)
eclass/toolchain.eclass

index 5d5c9add34e5e1ede869c3890067f67b61e941f0..5c2d2c2315bac5728e3ed6b040c27496c0182216 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2008 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.423 2010/04/23 18:58:06 armin76 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.424 2010/04/24 23:53:14 halcy0n Exp $
 #
 # Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
 
@@ -159,6 +159,7 @@ else
                        tc_version_is_at_least "4.2" && IUSE="${IUSE} openmp"
                        tc_version_is_at_least "4.3" && IUSE="${IUSE} fixed-point"
                        tc_version_is_at_least "4.4" && IUSE="${IUSE} graphite"
+                       tc_version_is_at_least "4.5" && IUSE="${IUSE} lto"
                fi
        fi
 
@@ -1351,6 +1352,11 @@ gcc_do_configure() {
        tc_version_is_at_least "4.4" && \
                confgcc="${confgcc} $(use_with graphite ppl) $(use_with graphite cloog)"
 
+       # lto support was added in 4.5, which depends upon elfutils.  This allows
+       # users to enable that option, and pull in the additional library
+       tc_version_is_at_least "4.5" && \
+               confgcc="${confgcc} $(use_enable lto)"
+
 
        [[ $(tc-is-softfloat) == "yes" ]] && confgcc="${confgcc} --with-float=soft"
 
@@ -1913,6 +1919,15 @@ gcc-compiler_src_install() {
 
        # Cpoy the needed minispec for hardened gcc 4
        copy_minispecs_gcc_specs
+
+       # Move pretty-printers to gdb datadir to shut ldconfig up
+       gdbdir=/usr/share/gdb/auto-load
+       for module in $(find "${D}" -iname "*-gdb.py" -print); do
+               insinto ${gdbdir}/$(dirname "${module/${D}/}" | \
+                               sed -e "s:/lib/:/$(get_libdir)/:g")
+               doins "${module}"
+               rm "${module}"
+       done
 }
 
 gcc_slot_java() {