scripts/build/libc/newlib.sh
author Arnaud Vrac <avrac@freebox.fr>
Fri Oct 09 16:22:09 2009 +0200 (2009-10-09)
changeset 1569 a4e30d311569
parent 1469 e79d9cc576c7
child 1588 3ccb1f76576f
permissions -rw-r--r--
eglibc: add support for user provided option groups

Signed-off-by: Arnaud Vrac <avrac@freebox.fr>
mgl@1371
     1
# This file adds functions to build the Newlib C library
mgl@1467
     2
# Copyright 2009 DoréDevelopment
mgl@1371
     3
# Licensed under the GPL v2. See COPYING in the root of this package
mgl@1371
     4
#
mgl@1467
     5
# Edited by Martin Lund <mgl@doredevelopment.dk>
mgl@1371
     6
#
mgl@1371
     7
mgl@1371
     8
mgl@1371
     9
do_libc_get() {
mgl@1371
    10
    libc_src="ftp://sources.redhat.com/pub/newlib"
mgl@1373
    11
    avr32headers_src="http://dev.doredevelopment.dk/avr32-toolchain/sources"
mgl@1373
    12
    
mgl@1373
    13
    CT_GetFile "newlib-${CT_LIBC_VERSION}" ${libc_src}
mgl@1371
    14
mgl@1373
    15
    if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
mgl@1373
    16
        CT_GetFile "avr32headers" ${avr32headers_src}
mgl@1373
    17
    fi
mgl@1371
    18
}
mgl@1371
    19
mgl@1371
    20
do_libc_extract() {
mgl@1371
    21
    CT_Extract "newlib-${CT_LIBC_VERSION}"
mgl@1371
    22
    CT_Patch "newlib-${CT_LIBC_VERSION}"
mgl@1371
    23
mgl@1373
    24
    if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
mgl@1373
    25
        CT_Extract "avr32headers"
mgl@1373
    26
    fi
mgl@1371
    27
}
mgl@1371
    28
mgl@1371
    29
do_libc_check_config() {
mgl@1371
    30
    :
mgl@1371
    31
}
mgl@1371
    32
mgl@1371
    33
do_libc_headers() {
mgl@1371
    34
    :
mgl@1371
    35
}
mgl@1371
    36
mgl@1371
    37
do_libc_start_files() {
mgl@1371
    38
    :
mgl@1371
    39
}
mgl@1371
    40
mgl@1371
    41
do_libc() {
mgl@1371
    42
    CT_DoStep INFO "Installing C library"
mgl@1371
    43
mgl@1371
    44
    mkdir -p "${CT_BUILD_DIR}/build-libc"
mgl@1371
    45
    cd "${CT_BUILD_DIR}/build-libc"
mgl@1371
    46
mgl@1371
    47
    CT_DoLog EXTRA "Configuring C library"
mgl@1371
    48
mgl@1372
    49
#    CC="${CT_TARGET}-gcc ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}" \
mgl@1469
    50
    BUILD_CC="${CT_BUILD}-gcc"                                      \
mgl@1469
    51
    CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O"   \
mgl@1371
    52
    AR=${CT_TARGET}-ar                                              \
mgl@1371
    53
    RANLIB=${CT_TARGET}-ranlib                                      \
mgl@1371
    54
    CT_DoExecLog ALL                                                \
mgl@1371
    55
    "${CT_SRC_DIR}/newlib-${CT_LIBC_VERSION}/configure"             \
mgl@1371
    56
        --build=${CT_BUILD}                                         \
mgl@1371
    57
        --host=${CT_HOST}                                           \
mgl@1371
    58
        --target=${CT_TARGET}                                       \
mgl@1371
    59
        --prefix=${CT_PREFIX_DIR}                                   \
mgl@1371
    60
        ${extra_config}                                             \
mgl@1371
    61
        ${CT_LIBC_GLIBC_EXTRA_CONFIG}
mgl@1371
    62
    
mgl@1371
    63
    CT_DoLog EXTRA "Building C library"
mgl@1371
    64
mgl@1371
    65
    CT_DoExecLog ALL make
mgl@1371
    66
    
mgl@1371
    67
    CT_DoLog EXTRA "Installing C library"
mgl@1371
    68
mgl@1371
    69
    CT_DoExecLog ALL make install install_root="${CT_SYSROOT_DIR}"
mgl@1371
    70
mgl@1371
    71
    CT_EndStep
mgl@1371
    72
}
mgl@1371
    73
mgl@1371
    74
do_libc_finish() {
mgl@1373
    75
    CT_DoStep INFO "Installing Atmel AVR32 headers"
mgl@1373
    76
    
mgl@1373
    77
    if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
mgl@1373
    78
        CT_DoExecLog ALL cp -r ${CT_SRC_DIR}/avr32headers "${CT_PREFIX_DIR}/${CT_TARGET}/include/avr32"
mgl@1373
    79
    fi
mgl@1373
    80
mgl@1373
    81
    CT_EndStep
mgl@1371
    82
}