summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/arch/arm.sh18
-rw-r--r--scripts/build/debug/100-dmalloc.sh6
-rw-r--r--scripts/build/libc/newlib.sh55
-rw-r--r--scripts/functions21
4 files changed, 69 insertions, 31 deletions
diff --git a/scripts/build/arch/arm.sh b/scripts/build/arch/arm.sh
index fafd871..e049696 100644
--- a/scripts/build/arch/arm.sh
+++ b/scripts/build/arch/arm.sh
@@ -8,10 +8,20 @@ CT_DoArchTupleValues() {
case "${CT_LIBC},${CT_ARCH_ARM_EABI}" in
*glibc,y) CT_TARGET_SYS=gnueabi;;
uClibc,y) CT_TARGET_SYS=uclibcgnueabi;;
- none,y) CT_TARGET_SYS=eabi;;
+ *,y) CT_TARGET_SYS=eabi;;
esac
- # In case we're EABI, do *not* specify any ABI!
- # which means, either we do not have an ABI specified, or we're not EABI.
- CT_TestOrAbort "Internal error: CT_ARCH_ABI should not be set for EABI build." -z "${CT_ARCH_ABI}" -o -z "${CT_ARCH_ARM_EABI}"
+ # Set the default instrcution set mode
+ case "${CT_ARCH_ARM_MODE}" in
+ arm) ;;
+ thumb)
+ CT_ARCH_CC_CORE_EXTRA_CONFIG="--with-mode=thumb"
+ CT_ARCH_CC_EXTRA_CONFIG="--with-mode=thumb"
+# CT_ARCH_TARGET_CFLAGS="-mthumb"
+ ;;
+ esac
+
+ if [ "${CT_ARCH_ARM_INTERWORKING}" = "y" ]; then
+ CT_ARCH_TARGET_CFLAGS+=" -mthumb-interwork"
+ fi
}
diff --git a/scripts/build/debug/100-dmalloc.sh b/scripts/build/debug/100-dmalloc.sh
index f95a36d..e8965e9 100644
--- a/scripts/build/debug/100-dmalloc.sh
+++ b/scripts/build/debug/100-dmalloc.sh
@@ -22,9 +22,9 @@ do_debug_dmalloc_build() {
y) extra_config+=("--enable-cxx");;
*) extra_config+=("--disable-cxx");;
esac
- case "${CT_THREADS_NONE}" in
- y) extra_config+=("--disable-threads");;
- *) extra_config+=("--enable-threads");;
+ case "${CT_THREADS}" in
+ none) extra_config+=("--disable-threads");;
+ *) extra_config+=("--enable-threads");;
esac
case "${CT_SHARED_LIBS}" in
y) extra_config+=("--enable-shlib");;
diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh
index 196334d..c4cf654 100644
--- a/scripts/build/libc/newlib.sh
+++ b/scripts/build/libc/newlib.sh
@@ -5,12 +5,27 @@
# Edited by Martin Lund <mgl@doredevelopment.dk>
#
+libc_newlib_basename() {
+ if [ -z "${CT_LIBC_NEWLIB_CVS}" ]; then
+ echo "newlib-${CT_LIBC_VERSION}"
+ else
+ echo "newlib-cvs${CT_LIBC_VERSION:+-${CT_LIBC_VERSION}}"
+ fi
+}
do_libc_get() {
libc_src="ftp://sources.redhat.com/pub/newlib"
avr32headers_src="http://dev.doredevelopment.dk/avr32-toolchain/sources"
-
- CT_GetFile "newlib-${CT_LIBC_VERSION}" ${libc_src}
+
+ if [ -z "${CT_LIBC_NEWLIB_CVS}" ]; then
+ CT_GetFile "newlib-${CT_LIBC_VERSION}" ${libc_src}
+ else
+ CT_GetCVS "$(libc_newlib_basename)" \
+ ":pserver:anoncvs@sources.redhat.com:/cvs/src" \
+ "newlib" \
+ "${CT_LIBC_VERSION}" \
+ "$(libc_newlib_basename)=src"
+ fi
if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
CT_GetFile "avr32headers" ${avr32headers_src}
@@ -18,8 +33,8 @@ do_libc_get() {
}
do_libc_extract() {
- CT_Extract "newlib-${CT_LIBC_VERSION}"
- CT_Patch "newlib-${CT_LIBC_VERSION}"
+ CT_Extract "$(libc_newlib_basename)"
+ CT_Patch "$(libc_newlib_basename)"
if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
CT_Extract "avr32headers"
@@ -46,23 +61,24 @@ do_libc() {
CT_DoLog EXTRA "Configuring C library"
-# CC="${CT_TARGET}-gcc ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}" \
- BUILD_CC="${CT_BUILD}-gcc" \
- CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O" \
- 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}
+ # Note: newlib handles the build/host/target a little bit differently
+ # than one would expect:
+ # build : not used
+ # host : the machine building newlib
+ # target : the machine newlib runs on
+ CC_FOR_BUILD="${CT_BUILD}-gcc" \
+ CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS} -O" \
+ AR=${CT_TARGET}-ar \
+ RANLIB=${CT_TARGET}-ranlib \
+ CT_DoExecLog ALL \
+ "${CT_SRC_DIR}/$(libc_newlib_basename)/configure" \
+ --host=${CT_BUILD} \
+ --target=${CT_TARGET} \
+ --prefix=${CT_PREFIX_DIR}
CT_DoLog EXTRA "Building C library"
- CT_DoExecLog ALL make
+ CT_DoExecLog ALL make ${PARALLELMFLAGS}
CT_DoLog EXTRA "Installing C library"
@@ -72,9 +88,10 @@ do_libc() {
}
do_libc_finish() {
- CT_DoStep INFO "Installing Atmel AVR32 headers"
+ CT_DoStep INFO "Finishing C library"
if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
+ CT_DoLog EXTRA "Installing Atmel's AVR32 headers"
CT_DoExecLog ALL cp -r ${CT_SRC_DIR}/avr32headers "${CT_PREFIX_DIR}/${CT_TARGET}/include/avr32"
fi
diff --git a/scripts/functions b/scripts/functions
index 62a2f99..b9aa7e7 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -477,7 +477,8 @@ CT_GetFile() {
# 'tag' is the tag to retrieve. Must be specified, but can be empty.
# If dirname is specified, then module will be renamed to dirname
# prior to building the tarball.
-# Usage: CT_GetCVS <basename> <url> <module> <tag> [dirname]
+# Usage: CT_GetCVS <basename> <url> <module> <tag> [dirname[=subdir]]
+# Note: if '=subdir' is given, then it is used instead of 'module'.
CT_GetCVS() {
local basename="$1"
local uri="$2"
@@ -499,8 +500,18 @@ CT_GetCVS() {
CT_Pushd "${tmp_dir}"
CT_DoExecLog ALL cvs -z 9 -d "${uri}" co -P ${tag} "${module}"
- [ -n "${dirname}" ] && CT_DoExecLog ALL mv "${module}" "${dirname}"
- CT_DoExecLog ALL tar cjf "${CT_TARBALLS_DIR}/${basename}.tar.bz2" "${dirname:-${module}}"
+ if [ -n "${dirname}" ]; then
+ case "${dirname}" in
+ *=*)
+ CT_DoExecLog DEBUG mv "${dirname#*=}" "${dirname%%=*}"
+ CT_DoExecLog ALL tar cjf "${CT_TARBALLS_DIR}/${basename}.tar.bz2" "${dirname%%=*}"
+ ;;
+ *)
+ CT_DoExecLog ALL mv "${module}" "${dirname}"
+ CT_DoExecLog ALL tar cjf "${CT_TARBALLS_DIR}/${basename}.tar.bz2" "${dirname:-${module}}"
+ ;;
+ esac
+ fi
CT_SaveLocal "${CT_TARBALLS_DIR}/${basename}.tar.bz2"
CT_Popd
@@ -612,7 +623,7 @@ CT_Patch() {
CT_DoLog EXTRA "Patching '${basename}'"
bundled_patch_dir="${CT_LIB_DIR}/patches/${base_file}/${ver_file}"
- local_patch_dir="${CT_CUSTOM_PATCH_DIR}/${base_file}/${ver_file}"
+ local_patch_dir="${CT_LOCAL_PATCH_DIR}/${base_file}/${ver_file}"
case "${CT_PATCH_ORDER}" in
bundled) patch_dirs=("${bundled_patch_dir}");;
@@ -696,9 +707,9 @@ CT_DoBuildTargetTuple() {
# Set defaults for the system part of the tuple. Can be overriden
# by architecture-specific values.
case "${CT_LIBC}" in
- none) CT_TARGET_SYS=elf;;
*glibc) CT_TARGET_SYS=gnu;;
uClibc) CT_TARGET_SYS=uclibc;;
+ *) CT_TARGET_SYS=elf;;
esac
# Transform the ARCH into a kernel-understandable ARCH