summaryrefslogtreecommitdiff
path: root/scripts/build
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build')
-rw-r--r--scripts/build/binutils/binutils.sh20
-rw-r--r--scripts/build/cc/100-gcc.sh36
-rw-r--r--scripts/build/debug/300-gdb.sh31
-rw-r--r--scripts/build/libc/glibc.sh21
-rw-r--r--scripts/build/libc/newlib.sh21
5 files changed, 55 insertions, 74 deletions
diff --git a/scripts/build/binutils/binutils.sh b/scripts/build/binutils/binutils.sh
index 0e285b6..17ea138 100644
--- a/scripts/build/binutils/binutils.sh
+++ b/scripts/build/binutils/binutils.sh
@@ -8,16 +8,16 @@ do_binutils_get() {
CT_GetCustom "binutils" "${CT_BINUTILS_CUSTOM_VERSION}" \
"${CT_BINUTILS_CUSTOM_LOCATION}"
else
- if echo ${CT_BINUTILS_VERSION} |grep -q linaro; then
- YYMM=`echo ${CT_BINUTILS_VERSION} |cut -d- -f3 |sed -e 's,^..,,'`
- CT_GetFile "binutils-${CT_BINUTILS_VERSION}" \
- https://releases.linaro.org/${YYMM}/components/toolchain/binutils-linaro \
- http://cbuild.validation.linaro.org/snapshots
- else
- CT_GetFile "binutils-${CT_BINUTILS_VERSION}" \
- {http,ftp}://{ftp.gnu.org/gnu,ftp.kernel.org/pub/linux/devel}/binutils \
- ftp://{sourceware.org,gcc.gnu.org}/pub/binutils/{releases,snapshots}
- fi
+ case "${CT_BINUTILS_VERSION}" in
+ linaro-*)
+ CT_GetLinaro "binutils" "${CT_BINUTILS_VERSION}"
+ ;;
+ *)
+ CT_GetFile "binutils-${CT_BINUTILS_VERSION}" \
+ {http,ftp}://{ftp.gnu.org/gnu,ftp.kernel.org/pub/linux/devel}/binutils \
+ ftp://{sourceware.org,gcc.gnu.org}/pub/binutils/{releases,snapshots}
+ ;;
+ esac
fi
if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh
index 3daa407..214f208 100644
--- a/scripts/build/cc/100-gcc.sh
+++ b/scripts/build/cc/100-gcc.sh
@@ -11,30 +11,18 @@ do_gcc_get() {
CT_GetCustom "gcc" "${CT_CC_GCC_CUSTOM_VERSION}" \
"${CT_CC_GCC_CUSTOM_LOCATION}"
else
- # Account for the Linaro versioning
- linaro_version="$( echo "${CT_CC_GCC_VERSION}" \
- |sed -r -e 's/^linaro-//;' \
- )"
- linaro_series="$( echo "${linaro_version}" \
- |sed -r -e 's/-.*//;' \
- )"
-
- # The official gcc hosts put gcc under a gcc/release/ directory,
- # whereas the mirrors put it in the gcc/ directory.
- # Also, Split out linaro mirrors, so that downloads happen faster.
- if [ x"${linaro_version}" = x"${CT_CC_GCC_VERSION}" ]; then
- CT_GetFile "gcc-${CT_CC_GCC_VERSION}" \
- {http,ftp,https}://ftp.gnu.org/gnu/gcc/gcc-${CT_CC_GCC_VERSION} \
- ftp://{gcc.gnu.org,sourceware.org}/pub/gcc/releases/gcc-${CT_CC_GCC_VERSION}
- else
- YYMM=`echo ${CT_CC_GCC_VERSION} |cut -d- -f3 |sed -e 's,^..,,'`
- CT_GetFile "gcc-${CT_CC_GCC_VERSION}" \
- "https://releases.linaro.org/components/toolchain/gcc-linaro/${linaro_version}" \
- "https://releases.linaro.org/${YYMM}/components/toolchain/gcc-linaro/${linaro_series}" \
- "http://launchpad.net/gcc-linaro/${linaro_series}/${linaro_version}/+download" \
- http://cbuild.validation.linaro.org/snapshots
- fi
-
+ case "${CT_CC_GCC_VERSION}" in
+ linaro-*)
+ CT_GetLinaro "gcc" "${CT_CC_GCC_VERSION}"
+ ;;
+ *)
+ # The official gcc hosts put gcc under a gcc/release/ directory,
+ # whereas the mirrors put it in the gcc/ directory.
+ CT_GetFile "gcc-${CT_CC_GCC_VERSION}" \
+ {http,ftp,https}://ftp.gnu.org/gnu/gcc/gcc-${CT_CC_GCC_VERSION} \
+ ftp://{gcc.gnu.org,sourceware.org}/pub/gcc/releases/gcc-${CT_CC_GCC_VERSION}
+ ;;
+ esac
fi # ! custom location
# Starting with GCC 4.3, ecj is used for Java, and will only be
# built if the configure script finds ecj.jar at the top of the
diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh
index 3d3af7b..dabd81a 100644
--- a/scripts/build/debug/300-gdb.sh
+++ b/scripts/build/debug/300-gdb.sh
@@ -10,26 +10,17 @@ do_debug_gdb_get() {
CT_GetCustom "gdb" "${CT_GDB_CUSTOM_VERSION}" \
"${CT_GDB_CUSTOM_LOCATION}"
else
- # Account for the Linaro versioning
- linaro_version="$( echo "${CT_GDB_VERSION}" \
- |sed -r -e 's/^linaro-//;' \
- )"
- linaro_series="$( echo "${linaro_version}" \
- |sed -r -e 's/-.*//;' \
- )"
-
- if [ x"${linaro_version}" = x"${CT_GDB_VERSION}" ]; then
- CT_GetFile "gdb-${CT_GDB_VERSION}" \
- http://mirrors.kernel.org/sourceware/gdb \
- {http,ftp,https}://ftp.gnu.org/pub/gnu/gdb \
- ftp://{sourceware.org,gcc.gnu.org}/pub/gdb/releases
- else
- YYMM=`echo ${CT_GDB_VERSION} |cut -d- -f3 |sed -e 's,^..,,'`
- CT_GetFile "gdb-${CT_GDB_VERSION}" \
- "http://launchpad.net/gdb-linaro/${linaro_series}/${linaro_version}/+download" \
- https://releases.linaro.org/${YYMM}/components/toolchain/gdb-linaro \
- http://cbuild.validation.linaro.org/snapshots
- fi
+ case "${CT_GDB_VERSION}" in
+ linaro-*)
+ CT_GetLinaro "gdb" "${CT_GDB_VERSION}"
+ ;;
+ *)
+ CT_GetFile "gdb-${CT_GDB_VERSION}" \
+ http://mirrors.kernel.org/sourceware/gdb \
+ {http,ftp,https}://ftp.gnu.org/pub/gnu/gdb \
+ ftp://{sourceware.org,gcc.gnu.org}/pub/gdb/releases
+ ;;
+ esac
fi
}
diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh
index 019dd90..3e2c88e 100644
--- a/scripts/build/libc/glibc.sh
+++ b/scripts/build/libc/glibc.sh
@@ -11,17 +11,16 @@ do_libc_get() {
CT_GetCustom "glibc" "${CT_LIBC_GLIBC_CUSTOM_VERSION}" \
"${CT_LIBC_GLIBC_CUSTOM_LOCATION}"
else
- if echo ${CT_LIBC_VERSION} |grep -q linaro; then
- # Linaro glibc releases come from regular downloads...
- YYMM=`echo ${CT_LIBC_VERSION} |cut -d- -f3 |sed -e 's,^..,,'`
- CT_GetFile "glibc-${CT_LIBC_VERSION}" \
- https://releases.linaro.org/${YYMM}/components/toolchain/glibc-linaro \
- http://cbuild.validation.linaro.org/snapshots
- else
- CT_GetFile "glibc-${CT_LIBC_VERSION}" \
- {http,ftp,https}://ftp.gnu.org/gnu/glibc \
- ftp://{sourceware.org,gcc.gnu.org}/pub/glibc/{releases,snapshots}
- fi
+ case "${CT_LIBC_VERSION}" in
+ linaro-*)
+ CT_GetLinaro "glibc" "${CT_LIBC_VERSION}"
+ ;;
+ *)
+ CT_GetFile "glibc-${CT_LIBC_VERSION}" \
+ {http,ftp,https}://ftp.gnu.org/gnu/glibc \
+ ftp://{sourceware.org,gcc.gnu.org}/pub/glibc/{releases,snapshots}
+ ;;
+ esac
fi
return 0
diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh
index 100dc1a..0c0c2aa 100644
--- a/scripts/build/libc/newlib.sh
+++ b/scripts/build/libc/newlib.sh
@@ -13,15 +13,18 @@ do_libc_get() {
CT_GetCustom "newlib" "${CT_LIBC_NEWLIB_CUSTOM_VERSION}" \
"${CT_LIBC_NEWLIB_CUSTOM_LOCATION}"
else # ! custom location
- if echo ${CT_LIBC_VERSION} |grep -q linaro; then
- YYMM=`echo ${CT_LIBC_VERSION} |cut -d- -f3 |sed -e 's,^..,,'`
- CT_GetFile "newlib-${CT_LIBC_VERSION}" ${libc_src} \
- https://releases.linaro.org/${YYMM}/components/toolchain/newlib-linaro \
- http://cbuild.validation.linaro.org/snapshots
- else
- CT_GetFile "newlib-${CT_LIBC_VERSION}" ${libc_src} \
- http://mirrors.kernel.org/sources.redhat.com/newlib
- fi
+ case "${CT_LIBC_VERSION}" in
+ linaro-*)
+ CT_GetLinaro "newlib" "${CT_LIBC_VERSION}"
+ ;;
+ *)
+ # kernel.org mirror is outdated, keep last as a fallback
+ CT_GetFile "newlib-${CT_LIBC_VERSION}" \
+ ftp://sourceware.org/pub/newlib \
+ http://mirrors.kernel.org/sourceware/newlib \
+ http://mirrors.kernel.org/sources.redhat.com/newlib
+ ;;
+ esac
fi # ! custom location
}