scripts/build/libc/eglibc.sh
branch1.11
changeset 2553 fe2c448bf3b7
parent 2278 e86826b8621a
child 2483 fa3a18f9abcf
     1.1 --- a/scripts/build/libc/eglibc.sh	Sat Jan 22 22:36:20 2011 +0100
     1.2 +++ b/scripts/build/libc/eglibc.sh	Fri May 27 22:02:30 2011 -0300
     1.3 @@ -109,15 +109,26 @@
     1.4          [ "${addon}" = "nptl" ] && continue || true
     1.5          CT_Pushd "${CT_SRC_DIR}/eglibc-${CT_LIBC_VERSION}"
     1.6          CT_Extract nochdir "eglibc-${addon}-${CT_LIBC_VERSION}"
     1.7 +
     1.8 +        CT_TestAndAbort "Error in add-on '${addon}': both short and long names in tarball" \
     1.9 +            -d "${addon}" -a -d "eglibc-${addon}-${CT_LIBC_VERSION}"
    1.10 +
    1.11          # Some addons have the 'long' name, while others have the
    1.12          # 'short' name, but patches are non-uniformly built with
    1.13          # either the 'long' or 'short' name, whatever the addons name
    1.14 -        # so we have to make symlinks from the existing to the missing
    1.15 -        # Fortunately for us, [ -d foo ], when foo is a symlink to a
    1.16 -        # directory, returns true!
    1.17 -        [ -d "${addon}" ] || ln -s "eglibc-${addon}-${CT_LIBC_VERSION}" "${addon}"
    1.18 -        [ -d "eglibc-${addon}-${CT_LIBC_VERSION}" ] || ln -s "${addon}" "eglibc-${addon}-${CT_LIBC_VERSION}"
    1.19 +        # but we prefer the 'short' name and avoid duplicates.
    1.20 +        if [ -d "eglibc-${addon}-${CT_LIBC_VERSION}" ]; then
    1.21 +            mv "eglibc-${addon}-${CT_LIBC_VERSION}" "${addon}"
    1.22 +        fi
    1.23 +
    1.24 +        ln -s "${addon}" "eglibc-${addon}-${CT_LIBC_VERSION}"
    1.25 +
    1.26          CT_Patch nochdir "eglibc" "${addon}-${CT_LIBC_VERSION}"
    1.27 +
    1.28 +        # Remove the long name since it can confuse configure scripts to run
    1.29 +        # the same source twice.
    1.30 +        rm "eglibc-${addon}-${CT_LIBC_VERSION}"
    1.31 +
    1.32          CT_Popd
    1.33      done
    1.34