scrub more ETYPE logic
authorMike Frysinger <vapier@gentoo.org>
Mon, 26 Sep 2011 17:32:44 +0000 (17:32 +0000)
committerMike Frysinger <vapier@gentoo.org>
Mon, 26 Sep 2011 17:32:44 +0000 (17:32 +0000)
eclass/toolchain.eclass

index afb27c188f05077fa58975ead27f4fc48d7253be..62aebd165642ad27837a2df01e77fe76dcd92a08 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.469 2011/09/22 23:08:28 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.470 2011/09/26 17:32:44 vapier Exp $
 #
 # Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
 
@@ -719,25 +719,21 @@ copy_minispecs_gcc_specs() {
 
 #---->> pkg_* <<----
 toolchain_pkg_setup() {
-       [[ -z ${ETYPE} ]] && die "Your ebuild needs to set the ETYPE variable"
-
-       if [[ ${ETYPE} == "gcc-compiler" ]] ; then
-               # Setup variables which would normally be in the profile
-               if is_crosscompile ; then
-                       multilib_env ${CTARGET}
-                       if ! is_multilib ; then
-                               MULTILIB_ABIS=${DEFAULT_ABI}
-                       fi
+       # Setup variables which would normally be in the profile
+       if is_crosscompile ; then
+               multilib_env ${CTARGET}
+               if ! is_multilib ; then
+                       MULTILIB_ABIS=${DEFAULT_ABI}
                fi
+       fi
 
-               # we dont want to use the installed compiler's specs to build gcc!
-               unset GCC_SPECS
+       # we dont want to use the installed compiler's specs to build gcc!
+       unset GCC_SPECS
 
-               if use nocxx ; then
-                       use go && ewarn 'Go requires a C++ compiler, disabled due to USE="nocxx"'
-                       use objc++ && ewarn 'Obj-C++ requires a C++ compiler, disabled due to USE="nocxx"'
-                       use gcj && ewarn 'GCJ requires a C++ compiler, disabled due to USE="nocxx"'
-               fi
+       if use nocxx ; then
+               use go && ewarn 'Go requires a C++ compiler, disabled due to USE="nocxx"'
+               use objc++ && ewarn 'Obj-C++ requires a C++ compiler, disabled due to USE="nocxx"'
+               use gcj && ewarn 'GCJ requires a C++ compiler, disabled due to USE="nocxx"'
        fi
 
        want_libssp && libc_has_ssp && \
@@ -847,36 +843,6 @@ toolchain_pkg_postrm() {
 
 #---->> src_* <<----
 
-# generic GCC src_unpack, to be called from the ebuild's src_unpack.
-# BIG NOTE regarding hardened support: ebuilds with support for hardened are
-# expected to export the following variable:
-#
-#      HARDENED_GCC_WORKS
-#                      This variable should be set to the archs on which hardened should
-#                      be allowed. For example: HARDENED_GCC_WORKS="x86 sparc amd64"
-#                      This allows for additional archs to be supported by hardened when
-#                      ready.
-#
-# Travis Tilley <lv@gentoo.org> (03 Sep 2004)
-#
-gcc-compiler_src_unpack() {
-       # fail if using pie patches, building hardened, and glibc doesnt have
-       # the necessary support
-       want_pie && use hardened && glibc_have_pie
-
-       if use hardened ; then
-               einfo "updating configuration to build hardened GCC"
-               make_gcc_hard || die "failed to make gcc hard"
-       fi
-
-       if is_libffi ; then
-               # move the libffi target out of gcj and into all
-               sed -i \
-                       -e '/^libgcj=/s:target-libffi::' \
-                       -e '/^target_lib/s:=":="target-libffi :' \
-                       "${S}"/configure || die
-       fi
-}
 guess_patch_type_in_dir() {
        [[ -n $(ls "$1"/*.bz2 2>/dev/null) ]] \
                && EPATCH_SUFFIX="patch.bz2" \
@@ -944,7 +910,22 @@ toolchain_src_unpack() {
        do_gcc_PIE_patches
        epatch_user
 
-       ${ETYPE}_src_unpack || die "failed to ${ETYPE}_src_unpack"
+       # fail if using pie patches, building hardened, and glibc doesnt have
+       # the necessary support
+       want_pie && use hardened && glibc_have_pie
+
+       if use hardened ; then
+               einfo "updating configuration to build hardened GCC"
+               make_gcc_hard || die "failed to make gcc hard"
+       fi
+
+       if is_libffi ; then
+               # move the libffi target out of gcj and into all
+               sed -i \
+                       -e '/^libgcj=/s:target-libffi::' \
+                       -e '/^target_lib/s:=":="target-libffi :' \
+                       "${S}"/configure || die
+       fi
 
        # protoize don't build on FreeBSD, skip it
        ## removed in 4.5, bug #270558 --de.
@@ -1298,9 +1279,7 @@ gcc_do_configure() {
                --disable-werror \
                --enable-secureplt"
 
-       # etype specific configuration
-       einfo "running ${ETYPE}-configure"
-       ${ETYPE}-configure || die
+       gcc-compiler-configure || die
 
        # if not specified, assume we are building for a target that only
        # requires C support
@@ -1617,7 +1596,7 @@ toolchain_src_compile() {
 
        # Do not create multiple specs files for PIE+SSP if boundschecking is in
        # USE, as we disable PIE+SSP when it is.
-       if [[ ${ETYPE} == "gcc-compiler" ]] && want_split_specs && ! want_minispecs; then
+       if want_split_specs && ! want_minispecs; then
                split_out_specs_files || die "failed to split out specs"
        fi