scripts/build/libfloat.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun May 27 21:30:34 2007 +0000 (2007-05-27)
changeset 140 868aa6d66b01
parent 136 22b5ef41df97
child 161 be4484f10ac7
permissions -rw-r--r--
Fix libfloat when calling the compiler:
- when not compiling NPTL, the shared core C compiler does not exist,
- PATH arranges for the shared core C compiler to be found before the static one, so no need to force it.
     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     # Ah! libfloat separates the version string from the base name with
    11     # an underscore. We need to workaround this in a sane manner: soft link.
    12     local libfloat_file=`echo "${CT_LIBFLOAT_FILE}" |sed -r -e 's/^libfloat-/libfloat_/;'`
    13     CT_GetFile "${libfloat_file}"                                    \
    14                ftp://ftp.de.debian.org/debian/pool/main/libf/libfloat
    15     CT_Pushd "${CT_TARBALLS_DIR}"
    16     ext=`CT_GetFileExtension "${libfloat_file}"`
    17     ln -svf "${libfloat_file}${ext}" "${CT_LIBFLOAT_FILE}${ext}" |CT_DoLog DEBUG
    18     CT_Popd
    19 }
    20 
    21 # Extract libfloat
    22 do_libfloat_extract() {
    23     CT_ExtractAndPatch "${CT_LIBFLOAT_FILE}"
    24 }
    25 
    26 # Build libfloat
    27 do_libfloat() {
    28     # Here we build and install libfloat for the target, so that the C library
    29     # builds OK with those versions of gcc that have severed softfloat support
    30     # code
    31     CT_DoStep INFO "Installing software floating point emulation library libfloat"
    32     CT_Pushd "${CT_BUILD_DIR}"
    33     mkdir -p build-libfloat
    34     cd build-libfloat
    35 
    36     CT_DoLog EXTRA "Copying sources to build dir"
    37     ( cd "${CT_SRC_DIR}/${CT_LIBFLOAT_FILE}"; tar cf - . ) |tar xvf - |CT_DoLog ALL
    38 
    39     CT_DoLog EXTRA "Cleaning library"
    40     make clean 2>&1 |CT_DoLog ALL
    41 
    42     CT_DoLog EXTRA "Building library"
    43     make CROSS_COMPILE="${CT_TARGET}-" 2>&1 |CT_DoLog ALL
    44 
    45     CT_DoLog EXTRA "Installing library"
    46     make DESTDIR="${CT_SYSROOT_DIR}" install    2>&1 |CT_DoLog ALL
    47 
    48     CT_Popd
    49 
    50     CT_EndStep
    51 }
    52 
    53 else # "${CT_ARCH_FLOAT_SW_LIBFLOAT}" != "y"
    54 
    55 do_libfloat_get() {
    56     true
    57 }
    58 do_libfloat_extract() {
    59     true
    60 }
    61 do_libfloat() {
    62     true
    63 }
    64 
    65 fi