scripts/build/libc/newlib.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Oct 26 23:20:33 2009 +0100 (2009-10-26)
changeset 1589 c8619ad47c6d
parent 1588 3ccb1f76576f
child 1593 66b2463743af
permissions -rw-r--r--
libc/newlib: cleanup the build and finish steps

build step:
- ./configure
- remove glibc-specific options
- pass the target CFLAGS in the correct variable
- make:
- build in //

finish step:
- print proper message in finish step
     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     # Note: newlib handles the build/host/target a little bit differently
    50     # than one would expect:
    51     #   build  : not used
    52     #   host   : the machine building newlib
    53     #   target : the machine newlib runs on
    54     CC_FOR_BUILD="${CT_BUILD}-gcc"                          \
    55     CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS} -O"              \
    56     AR=${CT_TARGET}-ar                                      \
    57     RANLIB=${CT_TARGET}-ranlib                              \
    58     CT_DoExecLog ALL                                        \
    59     "${CT_SRC_DIR}/newlib-${CT_LIBC_VERSION}/configure"     \
    60         --host=${CT_BUILD}                                  \
    61         --target=${CT_TARGET}                               \
    62         --prefix=${CT_PREFIX_DIR}
    63     
    64     CT_DoLog EXTRA "Building C library"
    65 
    66     CT_DoExecLog ALL make ${PARALLELMFLAGS}
    67     
    68     CT_DoLog EXTRA "Installing C library"
    69 
    70     CT_DoExecLog ALL make install install_root="${CT_SYSROOT_DIR}"
    71 
    72     CT_EndStep
    73 }
    74 
    75 do_libc_finish() {
    76     CT_DoStep INFO "Finishing C library"
    77     
    78     if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
    79         CT_DoLog EXTRA "Installing Atmel's AVR32 headers"
    80         CT_DoExecLog ALL cp -r ${CT_SRC_DIR}/avr32headers "${CT_PREFIX_DIR}/${CT_TARGET}/include/avr32"
    81     fi
    82 
    83     CT_EndStep
    84 }