summaryrefslogtreecommitdiff
path: root/scripts/build/libc/newlib.sh
diff options
context:
space:
mode:
authorMartin Lund" <mgl@doredevelopment.dk>2009-05-22 14:46:18 (GMT)
committerMartin Lund" <mgl@doredevelopment.dk>2009-05-22 14:46:18 (GMT)
commita94b87075666680ca0285cd67efc253a5089756f (patch)
treebe807969719bedc90975851175e8759804d6a9a2 /scripts/build/libc/newlib.sh
parent7c893bce09f49acab08a2795ff36c066e5ed44fd (diff)
Added initial AVR32 support (bare-metal,newlib)
Diffstat (limited to 'scripts/build/libc/newlib.sh')
-rw-r--r--scripts/build/libc/newlib.sh71
1 files changed, 71 insertions, 0 deletions
diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh
new file mode 100644
index 0000000..79f074e
--- /dev/null
+++ b/scripts/build/libc/newlib.sh
@@ -0,0 +1,71 @@
+# This file adds functions to build the Newlib C library
+# Copyright 2008 Yann E. MORIN
+# Licensed under the GPL v2. See COPYING in the root of this package
+#
+# Edited by by Martin Lund <mgl@doredevelopment.dk>
+#
+
+
+do_libc_get() {
+ libc_src="ftp://sources.redhat.com/pub/newlib"
+
+ CT_GetFile "newlib-${CT_LIBC_VERSION}" ${libc_src}
+
+ return 0
+}
+
+do_libc_extract() {
+ CT_Extract "newlib-${CT_LIBC_VERSION}"
+ CT_Patch "newlib-${CT_LIBC_VERSION}"
+
+ return 0
+}
+
+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"
+
+ BUILD_CC="${CT_BUILD}-gcc" \
+ CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O" \
+ CC="${CT_TARGET}-gcc ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}" \
+ 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() {
+ :
+}