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