internals: fix stripping yet once again
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon May 02 18:07:13 2011 +0200 (2011-05-02)
changeset 2430539a3fa894f0
parent 2426 c28f755277eb
child 2435 da167ec304be
internals: fix stripping yet once again

Fix typo introduced by changeset #055e505f28be.
Also, handle older versions of gcc (typically, all versions
prior to 4.0.0).

Maxime provided a similar patch, missing the case for the
legacy versions of gcc.

Reported-by: Maxime Bizon <mbizon@freebox.fr>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
scripts/build/internals.sh
     1.1 --- a/scripts/build/internals.sh	Thu Apr 28 19:36:56 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}/"*               \