scripts/build/libfloat.sh
changeset 107 06d3636f6611
parent 83 286b5a6938ac
child 108 69407950a2a2
     1.1 --- a/scripts/build/libfloat.sh	Wed May 09 18:55:35 2007 +0000
     1.2 +++ b/scripts/build/libfloat.sh	Sat May 19 13:10:11 2007 +0000
     1.3 @@ -7,26 +7,20 @@
     1.4  
     1.5  # Download libfloat
     1.6  do_libfloat_get() {
     1.7 -    # Please note: because the file we download, and the file we store on the
     1.8 -    # file system don't have the same name, CT_GetFile will always try to
     1.9 -    # download the file over and over.
    1.10 -    # To avoid this, we check that the file we want already exists in the
    1.11 -    # tarball directory first. This is an ugly hack that overrides the standard
    1.12 -    # CT_GetFile behavior... Sight...
    1.13 -    lib_float_url="ftp://ftp.de.debian.org/debian/pool/main/libf/libfloat/"
    1.14 -    ext=`CT_GetFileExtension "${CT_LIBFLOAT_FILE}"`
    1.15 -    if [ -z "${ext}" ]; then
    1.16 -        CT_GetFile libfloat_990616.orig "${lib_float_url}"
    1.17 -        ext=`CT_GetFileExtension "libfloat_990616.orig"`
    1.18 -        # Hack: remove the .orig extension, and change _ to -
    1.19 -        mv -v "${CT_TARBALLS_DIR}/libfloat_990616.orig${ext}" \
    1.20 -              "${CT_TARBALLS_DIR}/libfloat-990616${ext}"      2>&1 |CT_DoLog DEBUG
    1.21 -    fi
    1.22 +    # Ah! libfloat separates the version string from the base name with
    1.23 +    # an underscore. We need to workaround this in a sane manner: soft link.
    1.24 +    local libfloat_file=`echo "${CT_LIBFLOAT_FILE}" |sed -r -e 's/^libfloat-/libfloat_/;'`
    1.25 +    CT_GetFile "${libfloat_file}"                                    \
    1.26 +               ftp://ftp.de.debian.org/debian/pool/main/libf/libfloat
    1.27 +    CT_Pushd "${CT_TARBALLS_DIR}"
    1.28 +    ext=`CT_GetFileExtension "${libfloat_file}"`
    1.29 +    ln -s "${libfloat_file}${ext}" "${CT_LIBFLOAT_FILE}${ext}"
    1.30 +    CT_Popd
    1.31  }
    1.32  
    1.33  # Extract libfloat
    1.34  do_libfloat_extract() {
    1.35 -    [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ] && CT_ExtractAndPatch "${CT_LIBFLOAT_FILE}"
    1.36 +    CT_ExtractAndPatch "${CT_LIBFLOAT_FILE}"
    1.37  }
    1.38  
    1.39  # Build libfloat
    1.40 @@ -34,13 +28,12 @@
    1.41      # Here we build and install libfloat for the target, so that the C library
    1.42      # builds OK with those versions of gcc that have severed softfloat support
    1.43      # code
    1.44 -    [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ] || return 0
    1.45 -	CT_DoStep INFO "Installing software floating point emulation library libfloat"
    1.46 +    CT_DoStep INFO "Installing software floating point emulation library libfloat"
    1.47 +    mkdir build-libfloat
    1.48 +    cd build-libfloat
    1.49  
    1.50      CT_Pushd "${CT_BUILD_DIR}"
    1.51      CT_DoLog EXTRA "Copying sources to build dir"
    1.52 -    mkdir build-libfloat
    1.53 -    cd build-libfloat
    1.54      ( cd "${CT_SRC_DIR}/${CT_LIBFLOAT_FILE}"; tar cf - . ) |tar xvf - |CT_DoLog ALL
    1.55  
    1.56      CT_DoLog EXTRA "Cleaning library"