scripts/build/libc/newlib.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Fri Sep 04 17:27:16 2009 +0200 (2009-09-04)
changeset 1512 439a6b292917
parent 1469 e79d9cc576c7
child 1588 3ccb1f76576f
permissions -rw-r--r--
TODO: update

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