summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel/gcc-config/files/gcc-config-1.3.9')
-rwxr-xr-xsys-devel/gcc-config/files/gcc-config-1.3.932
1 files changed, 20 insertions, 12 deletions
diff --git a/sys-devel/gcc-config/files/gcc-config-1.3.9 b/sys-devel/gcc-config/files/gcc-config-1.3.9
index a481a9dd7ee7..4a6689342815 100755
--- a/sys-devel/gcc-config/files/gcc-config-1.3.9
+++ b/sys-devel/gcc-config/files/gcc-config-1.3.9
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.3.9,v 1.2 2005/01/05 08:31:53 eradicator Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.3.9,v 1.3 2005/01/07 20:14:57 vapier Exp $
# Author: Martin Schlemmer <azarah@gentoo.org>
trap ":" INT QUIT TSTP
@@ -255,7 +255,11 @@ switch_profile() {
get_current_profile() {
local conf="${GCC_ENV_D}/config"
- [[ -n ${CTARGET} ]] && conf="${GCC_ENV_D}/config-${CTARGET}"
+ if [[ -n ${CTARGET} ]] ; then
+ conf="${conf}-${CTARGET}"
+ elif [[ -f ${GCC_ENV_D}/config-${CC_COMP} ]] ; then
+ conf="${conf}-${CC_COMP}"
+ fi
if [[ ! -f ${conf} ]] ; then
eerror "$0: No gcc profile is active!"
@@ -438,7 +442,9 @@ for x in "$@" ; do
else
# User gave us a full HOST-gccver
x=${x##*/}
- if [[ ! -f ${GCC_ENV_D}/${x} ]] ; then
+ if [[ ${DOIT} != "get_current_profile" ]] && \
+ [[ ! -f ${GCC_ENV_D}/${x} ]]
+ then
eerror "$0: Could not locate '$x' in '${GCC_ENV_D}/'!"
exit 1
fi
@@ -466,17 +472,19 @@ if [[ -z ${CC_COMP} ]] ; then
fi
fi
-CC_COMP_NO_SPECS=$(echo ${CC_COMP} | awk -F- '{ print $1"-"$2"-"$3"-"$4"-"$5 }')
+if [[ ${DOIT} != "get_current_profile" ]] ; then
+ CC_COMP_NO_SPECS=$(echo ${CC_COMP} | awk -F- '{ print $1"-"$2"-"$3"-"$4"-"$5 }')
-GCC_LIB=$(source "${GCC_ENV_D}/${CC_COMP}"
- cmd_setup
- echo ${LDPATH} | ${AWK} -F/ '{ print "/"$2"/"$3"/"$4"/" }')
+ GCC_LIB=$(source "${GCC_ENV_D}/${CC_COMP}"
+ cmd_setup
+ echo ${LDPATH} | ${AWK} -F/ '{ print "/"$2"/"$3"/"$4"/" }')
-if [[ ! -d ${ROOT}/${GCC_LIB}/${CC_COMP_NO_SPECS%-*}/${CC_COMP_NO_SPECS##*-} ]] || \
- [[ ! -f ${GCC_ENV_D}/${CC_COMP} ]]
-then
- eerror "$0: Profile does not exist or invalid setting for ${GCC_ENV_D}/${CC_COMP}" 1>&2
- #exit 1
+ if [[ ! -d ${ROOT}/${GCC_LIB}/${CC_COMP_NO_SPECS%-*}/${CC_COMP_NO_SPECS##*-} ]] || \
+ [[ ! -f ${GCC_ENV_D}/${CC_COMP} ]]
+ then
+ eerror "$0: Profile does not exist or invalid setting for ${GCC_ENV_D}/${CC_COMP}" 1>&2
+ #exit 1
+ fi
fi
if [[ ${CHECK_CHOST} = "yes" ]] ; then