aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-12-16 19:36:27 +0000
committerMike Frysinger <vapier@gentoo.org>2006-12-16 19:36:27 +0000
commite2cfbcf175a37dc04ab73f6eeb58c9ef33613c3c (patch)
tree950e1cfa8f0029e32414314f05760ada37699e3e /gcc-config
parentAdd support by Kevin F. Quinn for handling multiple files in GCC_SPECS #125805. (diff)
downloadgcc-config-e2cfbcf175a37dc04ab73f6eeb58c9ef33613c3c.tar.gz
gcc-config-e2cfbcf175a37dc04ab73f6eeb58c9ef33613c3c.tar.bz2
gcc-config-e2cfbcf175a37dc04ab73f6eeb58c9ef33613c3c.zip
some more tweaks/fixups from Kevin F. Quinn #125805
Diffstat (limited to 'gcc-config')
-rwxr-xr-xgcc-config22
1 files changed, 18 insertions, 4 deletions
diff --git a/gcc-config b/gcc-config
index a3f79dd..656b190 100755
--- a/gcc-config
+++ b/gcc-config
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.3.15,v 1.1 2006/12/09 07:33:09 vapier Exp $
+# $Header: gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.3.15,v 1.2 2006/12/16 19:36:27 vapier Exp $
trap ":" INT QUIT TSTP
@@ -163,13 +163,20 @@ files_exist() {
if [[ ${f} == /* ]] ; then
[[ ! -f ${f} ]] && ret=1 && break
else
+ # make sure the file exists in at least
+ # one of the specified paths
+ ret=1
for p in ${paths} ; do
- [[ ! -f ${p}/${f} ]] && ret=1 && break 2
+ [[ -f ${p}/${f} ]] && ret=0 && break
done
+ [[ ${ret} == 1 ]] && break
fi
done
export IFS=${old_IFS}
+ if [[ ${ret} == 1 ]] ; then
+ ewarn "Could not locate '${f}' in '${paths}'"
+ fi
return ${ret}
}
@@ -245,8 +252,15 @@ switch_profile() {
${AWK} '!/^(STDCXX_INCDIR|LDPATH|CC|CXX|CTARGET|GCCBITS|GCC_SPECS)=/ {print $0}' \
"${GCC_ENV_D}/${CC_COMP}" > "${ENV_D}/05gcc"
echo "LDPATH=\"${MY_LDPATH}\"" >> "${ENV_D}/05gcc"
- if [[ -n ${GCC_SPECS} ]] && files_exist ${MY_LDPATH} ${GCC_SPECS} ; then
- echo "GCC_SPECS=\"${GCC_SPECS}\"" >> "${ENV_D}/05gcc"
+ if [[ -n ${GCC_SPECS} ]] ; then
+ if files_exist ${MY_LDPATH} ${GCC_SPECS} ; then
+ echo "GCC_SPECS=\"${GCC_SPECS}\"" >> "${ENV_D}/05gcc"
+ else
+ echo
+ ewarn "Your GCC spec configurations are broken."
+ ewarn "Please re-emerge gcc."
+ echo
+ fi
else
# People need to rebuild their gcc or setting GCC_SPECS to
# "" will cause issues again :(