scripts/build/internals.sh
changeset 2430 539a3fa894f0
parent 2425 055e505f28be
child 2544 751c3f735ada
     1.1 --- a/scripts/build/internals.sh	Sat Apr 30 22:45:27 2011 +0200
     1.2 +++ b/scripts/build/internals.sh	Mon May 02 18:07:13 2011 +0200
     1.3 @@ -22,7 +22,19 @@
     1.4          esac
     1.5          CT_DoLog INFO "Stripping all toolchain executables"
     1.6          CT_Pushd "${CT_PREFIX_DIR}"
     1.7 -        gcc_version=$( cat "${CT_SRC_DIR}/gcc-${CT_GCC_VERSION}/gcc/BASE-VER" )
     1.8 +        # We can not use the version in CT_CC_VERSION because
     1.9 +        # of the Linaro stuff. So, harvest the version string
    1.10 +        # directly from the gcc sources...
    1.11 +        # All gcc 4.x seem to have the version in gcc/BASE-VER
    1.12 +        # while version prior to 4.x have the version in gcc/version.c
    1.13 +        # Of course, here is not the better place to do that...
    1.14 +        if [ -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" ]; then
    1.15 +            gcc_version=$( cat "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" )
    1.16 +        else
    1.17 +            gcc_version=$( sed -r -e '/version_string/!d; s/^.+= "([^"]+)".*$/\1/;' \
    1.18 +                               "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/version.c"   \
    1.19 +                         )
    1.20 +        fi
    1.21          for _t in "bin/${CT_TARGET}-"*                                      \
    1.22                    "${CT_TARGET}/bin/"*                                      \
    1.23                    "libexec/gcc/${CT_TARGET}/${gcc_version}/"*               \