scripts/build/libc_libfloat.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon May 07 15:57:02 2007 +0000 (2007-05-07)
changeset 64 7dab8d1a2426
parent 1 eeea35fbf182
child 78 c3868084d81a
permissions -rw-r--r--
Fix glibc and uClibc downloading and extracting.
Although we no longer need the kernel config file, we now need to specify the kernel source directory when installing headers.
Re-order components downloading to match build order.
Fix the saveSample.sh script in case the referenced files are the same as the destination files.
yann@1
     1
# This file adds functions to build libfloat
yann@1
     2
# Copyright 2007 Yann E. MORIN
yann@1
     3
# Licensed under the GPL v2. See COPYING in the root of this package
yann@1
     4
yann@63
     5
# Define libfloat functions depending on wether it is selected or not
yann@63
     6
if [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ]; then
yann@63
     7
yann@63
     8
# Download libfloat
yann@63
     9
do_libfloat_get() {
yann@63
    10
    # Please note: because the file we download, and the file we store on the
yann@63
    11
    # file system don't have the same name, CT_GetFile will always try to
yann@63
    12
    # download the file over and over.
yann@63
    13
    # To avoid this, we check that the file we want already exists in the
yann@63
    14
    # tarball directory first. This is an ugly hack that overrides the standard
yann@63
    15
    # CT_GetFile behavior... Sight...
yann@63
    16
    lib_float_url="ftp://ftp.de.debian.org/debian/pool/main/libf/libfloat/"
yann@63
    17
    ext=`CT_GetFileExtension "${CT_LIBFLOAT_FILE}"`
yann@63
    18
    if [ -z "${ext}" ]; then
yann@63
    19
        CT_GetFile libfloat_990616.orig "${lib_float_url}"
yann@63
    20
        ext=`CT_GetFileExtension "libfloat_990616.orig"`
yann@63
    21
        # Hack: remove the .orig extension, and change _ to -
yann@63
    22
        mv -v "${CT_TARBALLS_DIR}/libfloat_990616.orig${ext}" \
yann@63
    23
              "${CT_TARBALLS_DIR}/libfloat-990616${ext}"      2>&1 |CT_DoLog DEBUG
yann@63
    24
    fi
yann@63
    25
}
yann@63
    26
yann@63
    27
# Extract libfloat
yann@63
    28
do_libfloat_extract() {
yann@63
    29
    [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ] && CT_ExtractAndPatch "${CT_LIBFLOAT_FILE}"
yann@63
    30
}
yann@63
    31
yann@63
    32
# Build libfloat
yann@1
    33
do_libfloat() {
yann@1
    34
    # Here we build and install libfloat for the target, so that the C library
yann@1
    35
    # builds OK with those versions of gcc that have severed softfloat support
yann@1
    36
    # code
yann@1
    37
    [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ] || return 0
yann@1
    38
	CT_DoStep INFO "Installing software floating point emulation library libfloat"
yann@1
    39
yann@1
    40
    CT_Pushd "${CT_BUILD_DIR}"
yann@1
    41
    CT_DoLog EXTRA "Copying sources to build dir"
yann@1
    42
    mkdir build-libfloat
yann@1
    43
    cd build-libfloat
yann@1
    44
    ( cd "${CT_SRC_DIR}/${CT_LIBFLOAT_FILE}"; tar cf - . ) |tar xvf - |CT_DoLog DEBUG
yann@1
    45
yann@1
    46
    CT_DoLog EXTRA "Cleaning library"
yann@1
    47
    make clean 2>&1 |CT_DoLog DEBUG
yann@1
    48
yann@1
    49
    CT_DoLog EXTRA "Building library"
yann@1
    50
    make CROSS_COMPILE="${CT_CC_CORE_PREFIX_DIR}/bin/${CT_TARGET}-" 2>&1 |CT_DoLog DEBUG
yann@1
    51
yann@1
    52
    CT_DoLog EXTRA "Installing library"
yann@1
    53
    make CROSS_COMPILE="${CT_CC_CORE_PREFIX_DIR}/bin/${CT_TARGET}-" \
yann@1
    54
         DESTDIR="${CT_SYSROOT_DIR}" install                       2>&1 |CT_DoLog DEBUG
yann@1
    55
yann@1
    56
    CT_Popd
yann@1
    57
yann@1
    58
    CT_EndStep
yann@1
    59
}
yann@63
    60
yann@63
    61
else # "${CT_ARCH_FLOAT_SW_LIBFLOAT}" != "y"
yann@63
    62
yann@63
    63
do_libfloat_get() {
yann@63
    64
    true
yann@63
    65
}
yann@63
    66
do_libfloat_extract() {
yann@63
    67
    true
yann@63
    68
}
yann@63
    69
do_libfloat() {
yann@63
    70
    true
yann@63
    71
}
yann@63
    72
yann@63
    73
fi