aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-03-22 16:07:39 -0400
committerMike Frysinger <vapier@gentoo.org>2012-03-22 16:07:39 -0400
commit1719e69b00d6738300afd0971e8bbc7286a6c74a (patch)
tree03438dc8fdc019eea9d1f7e2466d20c577c008fe
parentgcc-config: make wrapper updates atomic (diff)
downloadgcc-config-1719e69b00d6738300afd0971e8bbc7286a6c74a.tar.gz
gcc-config-1719e69b00d6738300afd0971e8bbc7286a6c74a.tar.bz2
gcc-config-1719e69b00d6738300afd0971e8bbc7286a6c74a.zip
gcc-config: put native compilers before cross in $PATHv1.6
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rwxr-xr-xgcc-config23
1 files changed, 15 insertions, 8 deletions
diff --git a/gcc-config b/gcc-config
index f0bbd3a..9798118 100755
--- a/gcc-config
+++ b/gcc-config
@@ -339,14 +339,21 @@ switch_profile() {
# GCC_SPECS have long been stable, and people messing with
# them know better than to install bad paths, so don't bother
- # with sanity checks.
- local envd="${ENV_D}/05gcc-${CTARGET}" envd_changed=0
+ # with sanity checks anymore.
+
+ echo "CURRENT=${CC_COMP}" > "${GCC_ENV_D}/config-${CTARGET}"
+
+ # Give the native gcc a higher precedence so its PATH gets
+ # searched first. After all, we tend to run the native
+ # compiler a *lot* more than the cross-compilers.
+ local envd envd_num envd_changed=0
+ is_cross_compiler && envd_num="05" || envd_num="04"
+ envd="${ENV_D}/${envd_num}gcc-${CTARGET}"
cat <<-EOF > "${envd}.tmp"
- PATH="${GCC_PATH}"
- ROOTPATH="${GCC_PATH}"
- GCC_SPECS="${GCC_SPECS}"
+ PATH="${GCC_PATH}"
+ ROOTPATH="${GCC_PATH}"
+ GCC_SPECS="${GCC_SPECS}"
EOF
- echo "CURRENT=${CC_COMP}" > "${GCC_ENV_D}/config-${CTARGET}"
if ! is_cross_compiler ; then
# Regardless of the profile selected, keep the runtime lookup
# paths stable. Otherwise, all the apps that were built with
@@ -368,13 +375,13 @@ switch_profile() {
if [[ -d ${ROOT}/etc/ld.so.conf.d ]] ; then
echo "${MY_LDPATH}" > "${ROOT}"/etc/ld.so.conf.d/05gcc-${CTARGET}.conf
else
- echo "LDPATH=\"${MY_LDPATH}\"" >> "${envd}.tmp"
+ echo "LDPATH=\"${MY_LDPATH}\"" >> "${envd}tmp"
fi
# Punt old files; maybe globs too much, but oh well
rm -f \
"${GCC_ENV_D}/NATIVE" "${GCC_ENV_D}/.NATIVE" \
- "${ENV_D}/05gcc" \
+ "${ENV_D}/05gcc" "${ENV_D}/05gcc-${CTARGET}" \
"${ENV_D}/05gcc-${CTARGET}"-* "${GCC_ENV_D}/config-${CTARGET}"-*
# Help out the gcc wrapper