scripts/build/libc_libfloat.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue May 08 17:48:32 2007 +0000 (2007-05-08)
changeset 78 c3868084d81a
parent 63 89b41dbffe8d
permissions -rw-r--r--
Huge fixes to glibc build, so that we can build at least (and at last):
- use ports addon even when installing headers,
- use optimisation (-O) when installing headers, to avoid unnecessary warnings (thanks Robert P. J. DAY for pointing this out!),
- lowest kernel version to use is only X.Y.Z, not X.Y.Z.T,
- a bit of preparations for NPTL (RSN I hope),
- fix fixing the linker scripts (changing the backup file is kind of useless and stupid);

Shut uClibc finish step: there really is nothing to do;

Add a patch for glibc-2.3.6 weak aliases handling on some archs (ARM and ALPHA at least);

Did not catch the make errors: fixed the pattern matching in scripts/functions;

Introduce a new log level, ALL:
- send components' build messages there,
- DEBUG log level is destined only for crosstool-NG debug messages,
- migrate sub-actions to use appropriate log levels;

Update the armeb-unknown-linux-gnu sample:
- it builds!
- uses gcc-4.0.4 and glibc-2.3.6,
- updated to latest config options set.
     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 ALL
    45 
    46     CT_DoLog EXTRA "Cleaning library"
    47     make clean 2>&1 |CT_DoLog ALL
    48 
    49     CT_DoLog EXTRA "Building library"
    50     make CROSS_COMPILE="${CT_CC_CORE_PREFIX_DIR}/bin/${CT_TARGET}-" 2>&1 |CT_DoLog ALL
    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 ALL
    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