--- toolchain.eclass 2013-06-16 17:42:59.000000000 -0700 +++ toolchain.eclass 2013-06-16 17:43:26.000000000 -0700 @@ -23,7 +23,7 @@ inherit git-2 fi -EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_postinst pkg_postrm +EXPORT_FUNCTIONS pkg_pretend pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm DESCRIPTION="The GNU Compiler Collection" FEATURES=${FEATURES/multilib-strict/} @@ -108,14 +108,15 @@ if tc_version_is_at_least 3 ; then IUSE+=" doc gcj gtk hardened multilib objc" + REQUIRED_USE+=" gcj? ( cxx )" tc_version_is_at_least "4.0" && IUSE+=" objc-gc mudflap" - tc_version_is_at_least "4.1" && IUSE+=" libssp objc++" + tc_version_is_at_least "4.1" && IUSE+=" libssp objc++" && REQUIRED_USE+=" objc++? ( cxx )" tc_version_is_at_least "4.2" && IUSE+=" openmp" tc_version_is_at_least "4.3" && IUSE+=" fixed-point" tc_version_is_at_least "4.6" && IUSE+=" graphite" tc_version_is_at_least "4.6" && IUSE+=" lto" - tc_version_is_at_least "4.7" && IUSE+=" go" + tc_version_is_at_least "4.7" && IUSE+=" go" && REQUIRED_USE+=" go? ( cxx )" fi fi @@ -559,7 +560,7 @@ #----<< specs + env.d logic >>---- #---->> pkg_* <<---- -toolchain_pkg_setup() { +toolchain-r1_pkg_pretend() { if [[ -n ${PRERELEASE}${SNAPSHOT} || ${PV} == *9999* ]] && [[ -z ${I_PROMISE_TO_SUPPLY_PATCHES_WITH_BUGS} ]] then @@ -567,21 +568,19 @@ "This is to try and cut down on people filing bugs for a compiler we do not currently support." fi + [[ -z ${UCLIBC_VER} ]] && [[ ${CTARGET} == *-uclibc* ]] && die "Sorry, this version does not support uClibc" +} + +toolchain-r1_pkg_setup() { # we dont want to use the installed compiler's specs to build gcc! unset GCC_SPECS - if ! use_if_iuse cxx ; then - use_if_iuse go && ewarn 'Go requires a C++ compiler, disabled due to USE="-cxx"' - use_if_iuse objc++ && ewarn 'Obj-C++ requires a C++ compiler, disabled due to USE="-cxx"' - use_if_iuse gcj && ewarn 'GCJ requires a C++ compiler, disabled due to USE="-cxx"' - fi - want_minispecs unset LANGUAGES #265283 } -toolchain_pkg_postinst() { +toolchain-r1_pkg_postinst() { do_gcc_config if ! is_crosscompile ; then @@ -617,7 +616,7 @@ fi } -toolchain_pkg_postrm() { +toolchain-r1_pkg_postrm() { # to make our lives easier (and saner), we do the fix_libtool stuff here. # rather than checking SLOT's and trying in upgrade paths, we just see if # the common libstdc++.la exists in the ${LIBPATH} of the gcc that we are @@ -694,17 +693,16 @@ die "Failed to fixup file ${jfile} for rename to grmic" done } -toolchain_src_unpack() { - [[ -z ${UCLIBC_VER} ]] && [[ ${CTARGET} == *-uclibc* ]] && die "Sorry, this version does not support uClibc" - +toolchain-r1_src_unpack() { if [[ ${PV} == *9999* ]]; then git-2_src_unpack else gcc_quick_unpack fi +} +toolchain-r1_src_prepare() { export BRANDING_GCC_PKGVERSION="Gentoo ${GCC_PVR}" - cd "${S}" if ! use vanilla ; then if [[ -n ${PATCH_VER} ]] ; then @@ -1466,7 +1464,7 @@ export GCJFLAGS=${GCJFLAGS:-${CFLAGS}} } -toolchain_src_compile() { +toolchain-r1_src_configure() { gcc_do_filter_flags einfo "CFLAGS=\"${CFLAGS}\"" einfo "CXXFLAGS=\"${CXXFLAGS}\"" @@ -1482,10 +1480,14 @@ fi # Build in a separate build tree mkdir -p "${WORKDIR}"/build - pushd "${WORKDIR}"/build > /dev/null + cd "${WORKDIR}"/build einfo "Configuring ${PN} ..." gcc_do_configure +} + +toolchain-r1_src_compile() { + cd "${WORKDIR}"/build touch "${S}"/gcc/c-gperf.h @@ -1495,18 +1497,16 @@ einfo "Compiling ${PN} ..." gcc_do_make ${GCC_MAKE_TARGET} - - popd > /dev/null } -toolchain_src_test() { +toolchain-r1_src_test() { if use regression-test ; then cd "${WORKDIR}"/build emake -k check fi } -toolchain_src_install() { +toolchain-r1_src_install() { local x= cd "${WORKDIR}"/build @@ -2096,9 +2096,3 @@ #use treelang return 0 } - -# should kill these off once all the ebuilds are migrated -gcc_pkg_setup() { toolchain_pkg_setup ; } -gcc_src_unpack() { toolchain_src_unpack ; } -gcc_src_compile() { toolchain_src_compile ; } -gcc_src_test() { toolchain_src_test ; }