summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-01-12 18:37:18 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-01-12 18:37:18 (GMT)
commit958138fff1102992951b59a4f98dcb4c700d1de6 (patch)
tree840f3a16fe84a11007264202c346f177c1d025e8
parente3a4063ac61b336d96e4c43589e43ab42f9991b6 (diff)
libc/glibc: get the version string from version.h
We can not rely on the user-provided version string (be it via the choice, or manually entered), so fallback to reading version.h, which is both reliable and always present.
-rw-r--r--scripts/build/libc/glibc.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh
index c6a5dc1..43beb3e 100644
--- a/scripts/build/libc/glibc.sh
+++ b/scripts/build/libc/glibc.sh
@@ -268,8 +268,11 @@ do_libc_start_files() {
extra_config+=("$(do_libc_min_kernel_config)")
# Add some default CC args
- glibc_version_major=$(echo ${CT_LIBC_VERSION} |sed -r -e 's/^([[:digit:]]+).*/\1/')
- glibc_version_minor=$(echo ${CT_LIBC_VERSION} |sed -r -e 's/^[[:digit:]]+[\.-_]([[:digit:]]+).*/\1/')
+ glibc_version="$( grep -E '\<VERSION\>' "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/version.h" \
+ |cut -d '"' -f 2
+ )"
+ glibc_version_major=$(echo ${glibc_version} |sed -r -e 's/^([[:digit:]]+).*/\1/')
+ glibc_version_minor=$(echo ${glibc_version} |sed -r -e 's/^[[:digit:]]+[\.-_]([[:digit:]]+).*/\1/')
if [ ${glibc_version_major} -eq 2 -a ${glibc_version_minor} -ge 6 \
-o ${glibc_version_major} -gt 2 ]; then
# Don't use -pipe: configure chokes on it for glibc >= 2.6.