yann@1: # This file adds functions to build libfloat yann@1: # Copyright 2007 Yann E. MORIN yann@1: # Licensed under the GPL v2. See COPYING in the root of this package yann@1: yann@63: # Define libfloat functions depending on wether it is selected or not yann@63: if [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ]; then yann@63: yann@63: # Download libfloat yann@63: do_libfloat_get() { yann@63: # Please note: because the file we download, and the file we store on the yann@63: # file system don't have the same name, CT_GetFile will always try to yann@63: # download the file over and over. yann@63: # To avoid this, we check that the file we want already exists in the yann@63: # tarball directory first. This is an ugly hack that overrides the standard yann@63: # CT_GetFile behavior... Sight... yann@63: lib_float_url="ftp://ftp.de.debian.org/debian/pool/main/libf/libfloat/" yann@63: ext=`CT_GetFileExtension "${CT_LIBFLOAT_FILE}"` yann@63: if [ -z "${ext}" ]; then yann@63: CT_GetFile libfloat_990616.orig "${lib_float_url}" yann@63: ext=`CT_GetFileExtension "libfloat_990616.orig"` yann@63: # Hack: remove the .orig extension, and change _ to - yann@63: mv -v "${CT_TARBALLS_DIR}/libfloat_990616.orig${ext}" \ yann@63: "${CT_TARBALLS_DIR}/libfloat-990616${ext}" 2>&1 |CT_DoLog DEBUG yann@63: fi yann@63: } yann@63: yann@63: # Extract libfloat yann@63: do_libfloat_extract() { yann@63: [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ] && CT_ExtractAndPatch "${CT_LIBFLOAT_FILE}" yann@63: } yann@63: yann@63: # Build libfloat yann@1: do_libfloat() { yann@1: # Here we build and install libfloat for the target, so that the C library yann@1: # builds OK with those versions of gcc that have severed softfloat support yann@1: # code yann@1: [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ] || return 0 yann@1: CT_DoStep INFO "Installing software floating point emulation library libfloat" yann@1: yann@1: CT_Pushd "${CT_BUILD_DIR}" yann@1: CT_DoLog EXTRA "Copying sources to build dir" yann@1: mkdir build-libfloat yann@1: cd build-libfloat yann@78: ( cd "${CT_SRC_DIR}/${CT_LIBFLOAT_FILE}"; tar cf - . ) |tar xvf - |CT_DoLog ALL yann@1: yann@1: CT_DoLog EXTRA "Cleaning library" yann@78: make clean 2>&1 |CT_DoLog ALL yann@1: yann@1: CT_DoLog EXTRA "Building library" yann@78: make CROSS_COMPILE="${CT_CC_CORE_PREFIX_DIR}/bin/${CT_TARGET}-" 2>&1 |CT_DoLog ALL yann@1: yann@1: CT_DoLog EXTRA "Installing library" yann@1: make CROSS_COMPILE="${CT_CC_CORE_PREFIX_DIR}/bin/${CT_TARGET}-" \ yann@78: DESTDIR="${CT_SYSROOT_DIR}" install 2>&1 |CT_DoLog ALL yann@1: yann@1: CT_Popd yann@1: yann@1: CT_EndStep yann@1: } yann@63: yann@63: else # "${CT_ARCH_FLOAT_SW_LIBFLOAT}" != "y" yann@63: yann@63: do_libfloat_get() { yann@63: true yann@63: } yann@63: do_libfloat_extract() { yann@63: true yann@63: } yann@63: do_libfloat() { yann@63: true yann@63: } yann@63: yann@63: fi