diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-05-02 18:07:13 +0200 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-05-02 18:07:13 +0200 |
commit | f73891e77ca7051a228505cb76fd76abf85cfbc2 (patch) | |
tree | aa24060bfcce22d3be4d095961b918972ec465c7 | |
parent | 21ce63f28b7a69c94bc0a7eae6698fb0e77262e1 (diff) | |
download | crosstool-ng-f73891e77ca7051a228505cb76fd76abf85cfbc2.tar.gz crosstool-ng-f73891e77ca7051a228505cb76fd76abf85cfbc2.tar.bz2 crosstool-ng-f73891e77ca7051a228505cb76fd76abf85cfbc2.zip |
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>
-rw-r--r-- | scripts/build/internals.sh | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh index f07a619d..c1f8313e 100644 --- a/scripts/build/internals.sh +++ b/scripts/build/internals.sh @@ -22,7 +22,19 @@ do_finish() { 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}/"* \ |