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