2009-05-22 14:46:18 +00:00
|
|
|
# This file adds functions to build the Newlib C library
|
2009-06-14 20:43:33 +00:00
|
|
|
# Copyright 2009 DoréDevelopment
|
2009-05-22 14:46:18 +00:00
|
|
|
# Licensed under the GPL v2. See COPYING in the root of this package
|
|
|
|
#
|
2009-06-14 20:43:33 +00:00
|
|
|
# Edited by Martin Lund <mgl@doredevelopment.dk>
|
2009-05-22 14:46:18 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
do_libc_get() {
|
|
|
|
libc_src="ftp://sources.redhat.com/pub/newlib"
|
2009-05-23 18:46:42 +00:00
|
|
|
avr32headers_src="http://dev.doredevelopment.dk/avr32-toolchain/sources"
|
|
|
|
|
2009-05-22 14:46:18 +00:00
|
|
|
CT_GetFile "newlib-${CT_LIBC_VERSION}" ${libc_src}
|
|
|
|
|
2009-05-23 18:46:42 +00:00
|
|
|
if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
|
|
|
|
CT_GetFile "avr32headers" ${avr32headers_src}
|
|
|
|
fi
|
2009-05-22 14:46:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_libc_extract() {
|
|
|
|
CT_Extract "newlib-${CT_LIBC_VERSION}"
|
|
|
|
CT_Patch "newlib-${CT_LIBC_VERSION}"
|
|
|
|
|
2009-05-23 18:46:42 +00:00
|
|
|
if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
|
|
|
|
CT_Extract "avr32headers"
|
|
|
|
fi
|
2009-05-22 14:46:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_libc_check_config() {
|
|
|
|
:
|
|
|
|
}
|
|
|
|
|
|
|
|
do_libc_headers() {
|
|
|
|
:
|
|
|
|
}
|
|
|
|
|
|
|
|
do_libc_start_files() {
|
|
|
|
:
|
|
|
|
}
|
|
|
|
|
|
|
|
do_libc() {
|
|
|
|
CT_DoStep INFO "Installing C library"
|
|
|
|
|
|
|
|
mkdir -p "${CT_BUILD_DIR}/build-libc"
|
|
|
|
cd "${CT_BUILD_DIR}/build-libc"
|
|
|
|
|
|
|
|
CT_DoLog EXTRA "Configuring C library"
|
|
|
|
|
2009-05-22 20:44:01 +00:00
|
|
|
# CC="${CT_TARGET}-gcc ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}" \
|
2009-06-20 16:54:56 +00:00
|
|
|
BUILD_CC="${CT_BUILD}-gcc" \
|
|
|
|
CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O" \
|
2009-05-22 14:46:18 +00:00
|
|
|
AR=${CT_TARGET}-ar \
|
|
|
|
RANLIB=${CT_TARGET}-ranlib \
|
|
|
|
CT_DoExecLog ALL \
|
|
|
|
"${CT_SRC_DIR}/newlib-${CT_LIBC_VERSION}/configure" \
|
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host=${CT_HOST} \
|
|
|
|
--target=${CT_TARGET} \
|
|
|
|
--prefix=${CT_PREFIX_DIR} \
|
|
|
|
${extra_config} \
|
|
|
|
${CT_LIBC_GLIBC_EXTRA_CONFIG}
|
|
|
|
|
|
|
|
CT_DoLog EXTRA "Building C library"
|
|
|
|
|
|
|
|
CT_DoExecLog ALL make
|
|
|
|
|
|
|
|
CT_DoLog EXTRA "Installing C library"
|
|
|
|
|
|
|
|
CT_DoExecLog ALL make install install_root="${CT_SYSROOT_DIR}"
|
|
|
|
|
|
|
|
CT_EndStep
|
|
|
|
}
|
|
|
|
|
|
|
|
do_libc_finish() {
|
2009-05-23 18:46:42 +00:00
|
|
|
CT_DoStep INFO "Installing Atmel AVR32 headers"
|
|
|
|
|
|
|
|
if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
|
|
|
|
CT_DoExecLog ALL cp -r ${CT_SRC_DIR}/avr32headers "${CT_PREFIX_DIR}/${CT_TARGET}/include/avr32"
|
|
|
|
fi
|
|
|
|
|
|
|
|
CT_EndStep
|
2009-05-22 14:46:18 +00:00
|
|
|
}
|