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