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
5 # Define libfloat functions depending on wether it is selected or not
6 if [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ]; then
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
28 do_libfloat_extract() {
29 [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ] && CT_ExtractAndPatch "${CT_LIBFLOAT_FILE}"
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
37 [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ] || return 0
38 CT_DoStep INFO "Installing software floating point emulation library libfloat"
40 CT_Pushd "${CT_BUILD_DIR}"
41 CT_DoLog EXTRA "Copying sources to build dir"
44 ( cd "${CT_SRC_DIR}/${CT_LIBFLOAT_FILE}"; tar cf - . ) |tar xvf - |CT_DoLog ALL
46 CT_DoLog EXTRA "Cleaning library"
47 make clean 2>&1 |CT_DoLog ALL
49 CT_DoLog EXTRA "Building library"
50 make CROSS_COMPILE="${CT_CC_CORE_PREFIX_DIR}/bin/${CT_TARGET}-" 2>&1 |CT_DoLog ALL
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 ALL
61 else # "${CT_ARCH_FLOAT_SW_LIBFLOAT}" != "y"
66 do_libfloat_extract() {