diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-06-07 00:39:09 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-06-07 00:39:09 +0000 |
commit | 628ae053fc59c6ab72be61f010e0cbd3b9353767 (patch) | |
tree | d7a2419c0330f2184963f8c99bcebe7e1fa67c5e /sys-devel/gcc-config/files | |
parent | add option to build auxprop plugin. Bug #95165. (diff) | |
download | gentoo-2-628ae053fc59c6ab72be61f010e0cbd3b9353767.tar.gz gentoo-2-628ae053fc59c6ab72be61f010e0cbd3b9353767.tar.bz2 gentoo-2-628ae053fc59c6ab72be61f010e0cbd3b9353767.zip |
Cleanup the CHOST-GCCVER parsing so it isnt so fragile (and works with BSD hosts).
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'sys-devel/gcc-config/files')
-rw-r--r-- | sys-devel/gcc-config/files/digest-gcc-config-1.3.11-r1 (renamed from sys-devel/gcc-config/files/digest-gcc-config-1.3.11) | 0 | ||||
-rwxr-xr-x | sys-devel/gcc-config/files/gcc-config-1.3.11 | 28 |
2 files changed, 22 insertions, 6 deletions
diff --git a/sys-devel/gcc-config/files/digest-gcc-config-1.3.11 b/sys-devel/gcc-config/files/digest-gcc-config-1.3.11-r1 index e69de29bb2d1..e69de29bb2d1 100644 --- a/sys-devel/gcc-config/files/digest-gcc-config-1.3.11 +++ b/sys-devel/gcc-config/files/digest-gcc-config-1.3.11-r1 diff --git a/sys-devel/gcc-config/files/gcc-config-1.3.11 b/sys-devel/gcc-config/files/gcc-config-1.3.11 index b94f9887e52e..b7ae23697117 100755 --- a/sys-devel/gcc-config/files/gcc-config-1.3.11 +++ b/sys-devel/gcc-config/files/gcc-config-1.3.11 @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2005 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.11,v 1.1 2005/06/06 03:58:40 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.3.11,v 1.2 2005/06/07 00:39:09 vapier Exp $ trap ":" INT QUIT TSTP @@ -514,13 +514,28 @@ if [[ -z ${CC_COMP} ]] ; then fi fi +chop_gcc_ver() { + echo "$@" | awk -F- '{ + gccver="" + for (i=NF; i > 0; --i) { + if ($i ~ /^[[:digit:].]+$/) + gccver=$i"-"gccver + else + break + } + print substr(gccver,0,length(gccver)-1) + }' +} + if [[ ${DOIT} != "get_current_profile" ]] ; then - GCC_LIB=$(source "${GCC_ENV_D}/${CC_COMP}" + GCC_LIB=$( + source "${GCC_ENV_D}/${CC_COMP}" cmd_setup - echo ${LDPATH} | ${AWK} -F/ '{ print "/"$2"/"$3"/"$4"/" }') + echo ${LDPATH} | ${AWK} -F/ '{ print "/"$2"/"$3"/"$4"/" }' + ) - CC_COMP_TARGET=$(echo ${CC_COMP} | awk -F- '{ print $1"-"$2"-"$3"-"$4 }') - CC_COMP_VERSION=${CC_COMP/${CC_COMP_TARGET}-/} + CC_COMP_VERSION=$(chop_gcc_ver ${CC_COMP}) + CC_COMP_TARGET=${CC_COMP:0:${#CC_COMP}-${#CC_COMP_VERSION}-1} if [[ ! -d ${ROOT}/${GCC_LIB}/${CC_COMP_TARGET}/${CC_COMP_VERSION} ]]; then CC_COMP_VERSION=${CC_COMP_VERSION%-*} @@ -538,7 +553,8 @@ if [[ ${CHECK_CHOST} == "yes" ]] ; then # Chosen CHOST are not the same as the real CHOST according to # make.conf, and --use-portage-chost option was given, so do nothing get_real_chost - CC_COMP_TARGET=$(echo ${CC_COMP} | awk -F- '{ print $1"-"$2"-"$3"-"$4 }') + CC_COMP_VERSION=$(chop_gcc_ver ${CC_COMP}) + CC_COMP_TARGET=${CC_COMP:0:${#CC_COMP}-${#CC_COMP_VERSION}-1} [[ ${CC_COMP_TARGET} != ${REAL_CHOST} ]] && exit 0 fi |