# HG changeset patch # User "Yann E. MORIN" # Date 1304352433 -7200 # Node ID 613e33173753114e40f2b698016d4408a0201c0b # Parent a8def65a32a1a36f1db787a27458ec9c4103a09d 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 Signed-off-by: "Yann E. MORIN" (transplanted from 539a3fa894f00888b02c7f89a2046f02c9d51e75) diff -r a8def65a32a1 -r 613e33173753 scripts/build/internals.sh --- a/scripts/build/internals.sh Sun May 01 00:29:20 2011 +0200 +++ b/scripts/build/internals.sh Mon May 02 18:07:13 2011 +0200 @@ -22,7 +22,19 @@ esac CT_DoLog INFO "Stripping all toolchain executables" CT_Pushd "${CT_PREFIX_DIR}" - gcc_version=$( cat "${CT_SRC_DIR}/gcc-${CT_GCC_VERSION}/gcc/BASE-VER" ) + # We can not use the version in CT_CC_VERSION because + # of the Linaro stuff. So, harvest the version string + # directly from the gcc sources... + # All gcc 4.x seem to have the version in gcc/BASE-VER + # while version prior to 4.x have the version in gcc/version.c + # Of course, here is not the better place to do that... + if [ -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" ]; then + gcc_version=$( cat "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" ) + else + gcc_version=$( sed -r -e '/version_string/!d; s/^.+= "([^"]+)".*$/\1/;' \ + "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/version.c" \ + ) + fi for _t in "bin/${CT_TARGET}-"* \ "${CT_TARGET}/bin/"* \ "libexec/gcc/${CT_TARGET}/${gcc_version}/"* \