scripts/build/libc/newlib.sh
author "Martin Lund" <mgl@doredevelopment.dk>
Fri May 22 14:46:18 2009 +0000 (2009-05-22)
branchavr32
changeset 1371 802c132f1f71
child 1372 ff171891e7c4
permissions -rw-r--r--
Added initial AVR32 support (bare-metal,newlib)
mgl@1371
     1
# This file adds functions to build the Newlib C library
mgl@1371
     2
# Copyright 2008 Yann E. MORIN
mgl@1371
     3
# Licensed under the GPL v2. See COPYING in the root of this package
mgl@1371
     4
#
mgl@1371
     5
# Edited by 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@1371
    11
mgl@1371
    12
    CT_GetFile "newlib-${CT_LIBC_VERSION}" ${libc_src}
mgl@1371
    13
mgl@1371
    14
    return 0
mgl@1371
    15
}
mgl@1371
    16
mgl@1371
    17
do_libc_extract() {
mgl@1371
    18
    CT_Extract "newlib-${CT_LIBC_VERSION}"
mgl@1371
    19
    CT_Patch "newlib-${CT_LIBC_VERSION}"
mgl@1371
    20
mgl@1371
    21
    return 0
mgl@1371
    22
}
mgl@1371
    23
mgl@1371
    24
do_libc_check_config() {
mgl@1371
    25
    :
mgl@1371
    26
}
mgl@1371
    27
mgl@1371
    28
do_libc_headers() {
mgl@1371
    29
    :
mgl@1371
    30
}
mgl@1371
    31
mgl@1371
    32
do_libc_start_files() {
mgl@1371
    33
    :
mgl@1371
    34
}
mgl@1371
    35
mgl@1371
    36
do_libc() {
mgl@1371
    37
    CT_DoStep INFO "Installing C library"
mgl@1371
    38
mgl@1371
    39
    mkdir -p "${CT_BUILD_DIR}/build-libc"
mgl@1371
    40
    cd "${CT_BUILD_DIR}/build-libc"
mgl@1371
    41
mgl@1371
    42
    CT_DoLog EXTRA "Configuring C library"
mgl@1371
    43
mgl@1371
    44
    BUILD_CC="${CT_BUILD}-gcc"                                      \
mgl@1371
    45
    CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O"   \
mgl@1371
    46
    CC="${CT_TARGET}-gcc ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}" \
mgl@1371
    47
    AR=${CT_TARGET}-ar                                              \
mgl@1371
    48
    RANLIB=${CT_TARGET}-ranlib                                      \
mgl@1371
    49
    CT_DoExecLog ALL                                                \
mgl@1371
    50
    "${CT_SRC_DIR}/newlib-${CT_LIBC_VERSION}/configure"             \
mgl@1371
    51
        --build=${CT_BUILD}                                         \
mgl@1371
    52
        --host=${CT_HOST}                                           \
mgl@1371
    53
        --target=${CT_TARGET}                                       \
mgl@1371
    54
        --prefix=${CT_PREFIX_DIR}                                   \
mgl@1371
    55
        ${extra_config}                                             \
mgl@1371
    56
        ${CT_LIBC_GLIBC_EXTRA_CONFIG}
mgl@1371
    57
    
mgl@1371
    58
    CT_DoLog EXTRA "Building C library"
mgl@1371
    59
mgl@1371
    60
    CT_DoExecLog ALL make
mgl@1371
    61
    
mgl@1371
    62
    CT_DoLog EXTRA "Installing C library"
mgl@1371
    63
mgl@1371
    64
    CT_DoExecLog ALL make install install_root="${CT_SYSROOT_DIR}"
mgl@1371
    65
mgl@1371
    66
    CT_EndStep
mgl@1371
    67
}
mgl@1371
    68
mgl@1371
    69
do_libc_finish() {
mgl@1371
    70
    :
mgl@1371
    71
}