summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/addToolVersion.sh6
-rw-r--r--scripts/build/arch/avr32.sh16
-rw-r--r--scripts/build/companion_libs/mpfr.sh9
-rw-r--r--scripts/build/libc/newlib.sh82
-rw-r--r--scripts/crosstool-NG.sh.in16
-rw-r--r--scripts/wrapper.in5
6 files changed, 127 insertions, 7 deletions
diff --git a/scripts/addToolVersion.sh b/scripts/addToolVersion.sh
index 337c656..255b8fe 100755
--- a/scripts/addToolVersion.sh
+++ b/scripts/addToolVersion.sh
@@ -96,7 +96,11 @@ addToolVersion() {
ver_m=$(echo "${version}...." |cut -d . -f 2)
if [ ${ver_M} -gt 4 \
-o \( ${ver_M} -eq 4 -a ${ver_m} -ge 3 \) ]; then
- SedExpr1=" select CC_GCC_4_3_or_later\n"
+ SedExpr1="${SedExpr1} select CC_GCC_4_3_or_later\n"
+ fi
+ if [ ${ver_M} -gt 4 \
+ -o \( ${ver_M} -eq 4 -a ${ver_m} -ge 4 \) ]; then
+ SedExpr1="${SedExpr1} select CC_GCC_4_4_or_later\n"
fi
fi
SedExpr2=" default \"${version}\" if ${cat}_V_${v}"
diff --git a/scripts/build/arch/avr32.sh b/scripts/build/arch/avr32.sh
new file mode 100644
index 0000000..03843a7
--- /dev/null
+++ b/scripts/build/arch/avr32.sh
@@ -0,0 +1,16 @@
+# Compute AVR32-specific values
+
+CT_DoArchTupleValues() {
+ # The architecture part of the tuple:
+ CT_TARGET_ARCH="${CT_ARCH}"
+
+ # gcc ./configure flags
+ CT_ARCH_WITH_ARCH=
+ CT_ARCH_WITH_ABI=
+ CT_ARCH_WITH_CPU=
+ CT_ARCH_WITH_TUNE=
+ CT_ARCH_WITH_FPU=
+ CT_ARCH_WITH_FLOAT=
+ CT_TARGET_SYS=none
+
+}
diff --git a/scripts/build/companion_libs/mpfr.sh b/scripts/build/companion_libs/mpfr.sh
index efca118..3c3480d 100644
--- a/scripts/build/companion_libs/mpfr.sh
+++ b/scripts/build/companion_libs/mpfr.sh
@@ -30,6 +30,15 @@ do_mpfr_extract() {
# do that in the future...
# It seems that MPFR >= 2.4.0 do not need this...
case "${CT_MPFR_VERSION}" in
+ 2.4.1)
+ CT_Pushd "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}"
+ if [ ! -f .autoreconf.ct-ng ]; then
+ CT_DoLog DEBUG "Running autoreconf"
+ CT_DoExecLog ALL autoreconf
+ touch .autoreconf.ct-ng
+ fi
+ CT_Popd
+ ;;
1.*|2.0.*|2.1.*|2.2.*|2.3.*)
CT_Pushd "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}"
if [ ! -f .autotools.ct-ng ]; then
diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh
new file mode 100644
index 0000000..196334d
--- /dev/null
+++ b/scripts/build/libc/newlib.sh
@@ -0,0 +1,82 @@
+# This file adds functions to build the Newlib C library
+# Copyright 2009 DoréDevelopment
+# Licensed under the GPL v2. See COPYING in the root of this package
+#
+# Edited by Martin Lund <mgl@doredevelopment.dk>
+#
+
+
+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 [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
+ CT_GetFile "avr32headers" ${avr32headers_src}
+ fi
+}
+
+do_libc_extract() {
+ CT_Extract "newlib-${CT_LIBC_VERSION}"
+ CT_Patch "newlib-${CT_LIBC_VERSION}"
+
+ if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
+ CT_Extract "avr32headers"
+ fi
+}
+
+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"
+
+# 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}
+
+ 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() {
+ 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
+}
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index 36c77ba..ba30c4f 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -63,8 +63,15 @@ CT_DoExecLog DEBUG rm -f "${CT_WORK_DIR}/foo"
# What's our shell?
# Will be plain /bin/sh on most systems, except if we have /bin/ash and we
# _explictly_ required using it
-CT_SHELL="/bin/sh"
-[ "${CT_CONFIG_SHELL_ASH}" = "y" -a -x "/bin/ash" ] && CT_SHELL="/bin/ash"
+case "${CT_CONFIG_SHELL}" in
+ sh) CT_SHELL="/bin/sh";;
+ ash) CT_SHELL="/bin/ash";;
+ bash) CT_SHELL="${BASH}";;
+ custom) CT_SHELL="${CT_CONFIG_SHELL_CUSTOM_PATH}";;
+esac
+
+# Check the user is using an existing SHELL to be used by ./configure and Makefiles
+CT_TestOrAbort "The CONFIG_SHELL '${CT_CONFIG_SHELL}' (${CT_SHELL}) is not valid" -f "${CT_SHELL}" -a -x "${CT_SHELL}"
# Create the bin-overide early
# Contains symlinks to the tools found by ./configure
@@ -405,7 +412,7 @@ if [ -z "${CT_RESTART}" ]; then
else
case "${tool}" in
# We'll at least need some of them...
- ar|as|gcc|ld|nm|objcopy|objdump|ranlib)
+ ar|as|gcc|g++|ld|nm|objcopy|objdump|ranlib)
CT_Abort "Missing: '${t}${tool}${!s}' or '${t}${tool}' or '${tool}' : either needed!"
;;
# Some are conditionnally required
@@ -452,7 +459,8 @@ if [ -z "${CT_RESTART}" ]; then
# Set the shell to be used by ./configure scripts and by Makefiles (those
# that support it!).
- export CONFIG_SHELL="${CT_SHELL}"
+ export CONFIG_SHELL="${CT_SHELL}" # for ./configure
+ export SHELL="${CT_SHELL}" # for Makefiles
# And help make go faster
PARALLELMFLAGS=
diff --git a/scripts/wrapper.in b/scripts/wrapper.in
index 6222333..1c501eb 100644
--- a/scripts/wrapper.in
+++ b/scripts/wrapper.in
@@ -1,7 +1,8 @@
#!/bin/sh
-dirname="$(dirname "${0}")"
-basename="$(basename "${0}")"
+canonicalizedname=$(readlink -nm "${0}")
+dirname="$(dirname "${canonicalizedname}")"
+basename="$(basename "${canonicalizedname}")"
ld_lib_path="$(dirname "${dirname}")/lib"