scripts/build/libfloat.sh
changeset 83 286b5a6938ac
parent 78 c3868084d81a
child 107 06d3636f6611
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/scripts/build/libfloat.sh	Wed May 09 18:55:35 2007 +0000
     1.3 @@ -0,0 +1,73 @@
     1.4 +# This file adds functions to build libfloat
     1.5 +# Copyright 2007 Yann E. MORIN
     1.6 +# Licensed under the GPL v2. See COPYING in the root of this package
     1.7 +
     1.8 +# Define libfloat functions depending on wether it is selected or not
     1.9 +if [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ]; then
    1.10 +
    1.11 +# Download libfloat
    1.12 +do_libfloat_get() {
    1.13 +    # Please note: because the file we download, and the file we store on the
    1.14 +    # file system don't have the same name, CT_GetFile will always try to
    1.15 +    # download the file over and over.
    1.16 +    # To avoid this, we check that the file we want already exists in the
    1.17 +    # tarball directory first. This is an ugly hack that overrides the standard
    1.18 +    # CT_GetFile behavior... Sight...
    1.19 +    lib_float_url="ftp://ftp.de.debian.org/debian/pool/main/libf/libfloat/"
    1.20 +    ext=`CT_GetFileExtension "${CT_LIBFLOAT_FILE}"`
    1.21 +    if [ -z "${ext}" ]; then
    1.22 +        CT_GetFile libfloat_990616.orig "${lib_float_url}"
    1.23 +        ext=`CT_GetFileExtension "libfloat_990616.orig"`
    1.24 +        # Hack: remove the .orig extension, and change _ to -
    1.25 +        mv -v "${CT_TARBALLS_DIR}/libfloat_990616.orig${ext}" \
    1.26 +              "${CT_TARBALLS_DIR}/libfloat-990616${ext}"      2>&1 |CT_DoLog DEBUG
    1.27 +    fi
    1.28 +}
    1.29 +
    1.30 +# Extract libfloat
    1.31 +do_libfloat_extract() {
    1.32 +    [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ] && CT_ExtractAndPatch "${CT_LIBFLOAT_FILE}"
    1.33 +}
    1.34 +
    1.35 +# Build libfloat
    1.36 +do_libfloat() {
    1.37 +    # Here we build and install libfloat for the target, so that the C library
    1.38 +    # builds OK with those versions of gcc that have severed softfloat support
    1.39 +    # code
    1.40 +    [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ] || return 0
    1.41 +	CT_DoStep INFO "Installing software floating point emulation library libfloat"
    1.42 +
    1.43 +    CT_Pushd "${CT_BUILD_DIR}"
    1.44 +    CT_DoLog EXTRA "Copying sources to build dir"
    1.45 +    mkdir build-libfloat
    1.46 +    cd build-libfloat
    1.47 +    ( cd "${CT_SRC_DIR}/${CT_LIBFLOAT_FILE}"; tar cf - . ) |tar xvf - |CT_DoLog ALL
    1.48 +
    1.49 +    CT_DoLog EXTRA "Cleaning library"
    1.50 +    make clean 2>&1 |CT_DoLog ALL
    1.51 +
    1.52 +    CT_DoLog EXTRA "Building library"
    1.53 +    make CROSS_COMPILE="${CT_CC_CORE_PREFIX_DIR}/bin/${CT_TARGET}-" 2>&1 |CT_DoLog ALL
    1.54 +
    1.55 +    CT_DoLog EXTRA "Installing library"
    1.56 +    make CROSS_COMPILE="${CT_CC_CORE_PREFIX_DIR}/bin/${CT_TARGET}-" \
    1.57 +         DESTDIR="${CT_SYSROOT_DIR}" install                       2>&1 |CT_DoLog ALL
    1.58 +
    1.59 +    CT_Popd
    1.60 +
    1.61 +    CT_EndStep
    1.62 +}
    1.63 +
    1.64 +else # "${CT_ARCH_FLOAT_SW_LIBFLOAT}" != "y"
    1.65 +
    1.66 +do_libfloat_get() {
    1.67 +    true
    1.68 +}
    1.69 +do_libfloat_extract() {
    1.70 +    true
    1.71 +}
    1.72 +do_libfloat() {
    1.73 +    true
    1.74 +}
    1.75 +
    1.76 +fi