From: Mike Frysinger Date: Thu, 3 May 2007 04:51:07 +0000 (+0000) Subject: start moving to GCC_PATH for env.d #174422 and cleanup gcc-config logic so that it... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7d9f89700a2ee50674c0d871ec6d21b468ac6206;p=gentoo.git start moving to GCC_PATH for env.d #174422 and cleanup gcc-config logic so that it doesnt matter what the ROOT value is --- diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index ec5ca7334a6f..d060cf5606a1 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.332 2007/03/24 06:46:33 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.333 2007/05/03 04:51:07 vapier Exp $ # # Maintainer: Toolchain Ninjas @@ -632,8 +632,10 @@ create_gcc_env_entry() { gcc_specs_file="${LIBPATH}/$1.specs" fi + # phase PATH/ROOTPATH out ... echo "PATH=\"${BINPATH}\"" > ${gcc_envd_file} echo "ROOTPATH=\"${BINPATH}\"" >> ${gcc_envd_file} + echo "GCC_PATH=\"${BINPATH}\"" >> ${gcc_envd_file} if use multilib && ! has_multilib_profile; then LDPATH="${LIBPATH}" @@ -2088,9 +2090,6 @@ do_gcc_PIE_patches() { } should_we_gcc_config() { - # we only want to switch compilers if installing to / or /tmp/stage1root - [[ ${ROOT} == "/" || ${ROOT} == "/tmp/stage1root" ]] || return 1 - # we always want to run gcc-config if we're bootstrapping, otherwise # we might get stuck with the c-only stage1 compiler use bootstrap && return 0 @@ -2099,12 +2098,12 @@ should_we_gcc_config() { # if the current config is invalid, we definitely want a new one # Note: due to bash quirkiness, the following must not be 1 line local curr_config - curr_config=$(env -i gcc-config -c ${CTARGET} 2>&1) || return 0 + curr_config=$(env -i ROOT="${ROOT}" gcc-config -c ${CTARGET} 2>&1) || return 0 # if the previously selected config has the same major.minor (branch) as # the version we are installing, then it will probably be uninstalled # for being in the same SLOT, make sure we run gcc-config. - local curr_config_ver=$(env -i gcc-config -S ${curr_config} | awk '{print $2}') + local curr_config_ver=$(env -i ROOT="${ROOT}" gcc-config -S ${curr_config} | awk '{print $2}') local curr_branch_ver=$(get_version_component_range 1-2 ${curr_config_ver}) @@ -2136,14 +2135,14 @@ should_we_gcc_config() { do_gcc_config() { if ! should_we_gcc_config ; then - env -i gcc-config --use-old --force + env -i ROOT="${ROOT}" gcc-config --use-old --force return 0 fi local current_gcc_config="" current_specs="" use_specs="" # We grep out any possible errors - current_gcc_config=$(env -i gcc-config -c ${CTARGET} | grep -v '^ ') + current_gcc_config=$(env -i ROOT="${ROOT}" gcc-config -c ${CTARGET} | grep -v '^ ') if [[ -n ${current_gcc_config} ]] ; then # figure out which specs-specific config is active current_specs=$(gcc-config -S ${current_gcc_config} | awk '{print $3}') @@ -2166,9 +2165,6 @@ do_gcc_config() { } should_we_eselect_compiler() { - # we only want to switch compilers if installing to / or /tmp/stage1root - [[ ${ROOT} == "/" || ${ROOT} == "/tmp/stage1root" ]] || return 1 - # we always want to run gcc-config if we're bootstrapping, otherwise # we might get stuck with the c-only stage1 compiler use bootstrap && return 0