summaryrefslogtreecommitdiff
path: root/scripts/build/libc/eglibc.sh
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-05-28 01:02:30 (GMT)
committerNicolás Reynolds" <fauno@kiwwwi.com.ar>2011-05-28 01:02:30 (GMT)
commit82fa824f68ca7c7c45060fff40ecb039682bd79a (patch)
tree908bbb94d62682718a4b67425bb20f0d9dcfb87a /scripts/build/libc/eglibc.sh
parenta257ff7da8d2ae772011d3cce0b22c741e5b3ce1 (diff)
libc/glibc: fix {e,}glibc add-ons with short or long names
Fixes the issue with {e,}glibc addons having short and long names (such as eglibc-ports-2_13 and ports), which caused configure scripts to run through them twice and thus configuring incorrectly. For instance, the mips64el-n32-linux-gnu toolchain would be recognized correctly first, but then the second pass would change it to mips32, building a mixed MIPS-III N32 and MIPS-I libc. Signed-off-by: Nicolás Reynolds <fauno@kiwwwi.com.ar> [yann.morin.1992@anciens.enib.fr: remove spurious trailing spaces] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Diffstat (limited to 'scripts/build/libc/eglibc.sh')
-rw-r--r--scripts/build/libc/eglibc.sh21
1 files changed, 16 insertions, 5 deletions
diff --git a/scripts/build/libc/eglibc.sh b/scripts/build/libc/eglibc.sh
index 12890be..680d6c4 100644
--- a/scripts/build/libc/eglibc.sh
+++ b/scripts/build/libc/eglibc.sh
@@ -109,15 +109,26 @@ do_libc_extract() {
[ "${addon}" = "nptl" ] && continue || true
CT_Pushd "${CT_SRC_DIR}/eglibc-${CT_LIBC_VERSION}"
CT_Extract nochdir "eglibc-${addon}-${CT_LIBC_VERSION}"
+
+ CT_TestAndAbort "Error in add-on '${addon}': both short and long names in tarball" \
+ -d "${addon}" -a -d "eglibc-${addon}-${CT_LIBC_VERSION}"
+
# Some addons have the 'long' name, while others have the
# 'short' name, but patches are non-uniformly built with
# either the 'long' or 'short' name, whatever the addons name
- # so we have to make symlinks from the existing to the missing
- # Fortunately for us, [ -d foo ], when foo is a symlink to a
- # directory, returns true!
- [ -d "${addon}" ] || ln -s "eglibc-${addon}-${CT_LIBC_VERSION}" "${addon}"
- [ -d "eglibc-${addon}-${CT_LIBC_VERSION}" ] || ln -s "${addon}" "eglibc-${addon}-${CT_LIBC_VERSION}"
+ # but we prefer the 'short' name and avoid duplicates.
+ if [ -d "eglibc-${addon}-${CT_LIBC_VERSION}" ]; then
+ mv "eglibc-${addon}-${CT_LIBC_VERSION}" "${addon}"
+ fi
+
+ ln -s "${addon}" "eglibc-${addon}-${CT_LIBC_VERSION}"
+
CT_Patch nochdir "eglibc" "${addon}-${CT_LIBC_VERSION}"
+
+ # Remove the long name since it can confuse configure scripts to run
+ # the same source twice.
+ rm "eglibc-${addon}-${CT_LIBC_VERSION}"
+
CT_Popd
done