mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2024-12-19 12:57:53 +00:00
Unify fetching Linaro components.
Add CT_GetLinaro, use it from gcc/binutils/gdb/glibc/newlib. Signed-off-by: Alexey Neyman <stilor@att.net>
This commit is contained in:
parent
5e0f715ea7
commit
9f5a92a783
@ -8,16 +8,16 @@ do_binutils_get() {
|
|||||||
CT_GetCustom "binutils" "${CT_BINUTILS_CUSTOM_VERSION}" \
|
CT_GetCustom "binutils" "${CT_BINUTILS_CUSTOM_VERSION}" \
|
||||||
"${CT_BINUTILS_CUSTOM_LOCATION}"
|
"${CT_BINUTILS_CUSTOM_LOCATION}"
|
||||||
else
|
else
|
||||||
if echo ${CT_BINUTILS_VERSION} |grep -q linaro; then
|
case "${CT_BINUTILS_VERSION}" in
|
||||||
YYMM=`echo ${CT_BINUTILS_VERSION} |cut -d- -f3 |sed -e 's,^..,,'`
|
linaro-*)
|
||||||
CT_GetFile "binutils-${CT_BINUTILS_VERSION}" \
|
CT_GetLinaro "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}" \
|
||||||
CT_GetFile "binutils-${CT_BINUTILS_VERSION}" \
|
{http,ftp}://{ftp.gnu.org/gnu,ftp.kernel.org/pub/linux/devel}/binutils \
|
||||||
{http,ftp}://{ftp.gnu.org/gnu,ftp.kernel.org/pub/linux/devel}/binutils \
|
ftp://{sourceware.org,gcc.gnu.org}/pub/binutils/{releases,snapshots}
|
||||||
ftp://{sourceware.org,gcc.gnu.org}/pub/binutils/{releases,snapshots}
|
;;
|
||||||
fi
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
|
if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
|
||||||
|
@ -11,30 +11,18 @@ do_gcc_get() {
|
|||||||
CT_GetCustom "gcc" "${CT_CC_GCC_CUSTOM_VERSION}" \
|
CT_GetCustom "gcc" "${CT_CC_GCC_CUSTOM_VERSION}" \
|
||||||
"${CT_CC_GCC_CUSTOM_LOCATION}"
|
"${CT_CC_GCC_CUSTOM_LOCATION}"
|
||||||
else
|
else
|
||||||
# Account for the Linaro versioning
|
case "${CT_CC_GCC_VERSION}" in
|
||||||
linaro_version="$( echo "${CT_CC_GCC_VERSION}" \
|
linaro-*)
|
||||||
|sed -r -e 's/^linaro-//;' \
|
CT_GetLinaro "gcc" "${CT_CC_GCC_VERSION}"
|
||||||
)"
|
;;
|
||||||
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.
|
||||||
|
CT_GetFile "gcc-${CT_CC_GCC_VERSION}" \
|
||||||
# The official gcc hosts put gcc under a gcc/release/ directory,
|
{http,ftp,https}://ftp.gnu.org/gnu/gcc/gcc-${CT_CC_GCC_VERSION} \
|
||||||
# whereas the mirrors put it in the gcc/ directory.
|
ftp://{gcc.gnu.org,sourceware.org}/pub/gcc/releases/gcc-${CT_CC_GCC_VERSION}
|
||||||
# Also, Split out linaro mirrors, so that downloads happen faster.
|
;;
|
||||||
if [ x"${linaro_version}" = x"${CT_CC_GCC_VERSION}" ]; then
|
esac
|
||||||
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
|
|
||||||
|
|
||||||
fi # ! custom location
|
fi # ! custom location
|
||||||
# Starting with GCC 4.3, ecj is used for Java, and will only be
|
# 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
|
# built if the configure script finds ecj.jar at the top of the
|
||||||
|
@ -10,26 +10,17 @@ do_debug_gdb_get() {
|
|||||||
CT_GetCustom "gdb" "${CT_GDB_CUSTOM_VERSION}" \
|
CT_GetCustom "gdb" "${CT_GDB_CUSTOM_VERSION}" \
|
||||||
"${CT_GDB_CUSTOM_LOCATION}"
|
"${CT_GDB_CUSTOM_LOCATION}"
|
||||||
else
|
else
|
||||||
# Account for the Linaro versioning
|
case "${CT_GDB_VERSION}" in
|
||||||
linaro_version="$( echo "${CT_GDB_VERSION}" \
|
linaro-*)
|
||||||
|sed -r -e 's/^linaro-//;' \
|
CT_GetLinaro "gdb" "${CT_GDB_VERSION}"
|
||||||
)"
|
;;
|
||||||
linaro_series="$( echo "${linaro_version}" \
|
*)
|
||||||
|sed -r -e 's/-.*//;' \
|
CT_GetFile "gdb-${CT_GDB_VERSION}" \
|
||||||
)"
|
http://mirrors.kernel.org/sourceware/gdb \
|
||||||
|
{http,ftp,https}://ftp.gnu.org/pub/gnu/gdb \
|
||||||
if [ x"${linaro_version}" = x"${CT_GDB_VERSION}" ]; then
|
ftp://{sourceware.org,gcc.gnu.org}/pub/gdb/releases
|
||||||
CT_GetFile "gdb-${CT_GDB_VERSION}" \
|
;;
|
||||||
http://mirrors.kernel.org/sourceware/gdb \
|
esac
|
||||||
{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
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,17 +11,16 @@ do_libc_get() {
|
|||||||
CT_GetCustom "glibc" "${CT_LIBC_GLIBC_CUSTOM_VERSION}" \
|
CT_GetCustom "glibc" "${CT_LIBC_GLIBC_CUSTOM_VERSION}" \
|
||||||
"${CT_LIBC_GLIBC_CUSTOM_LOCATION}"
|
"${CT_LIBC_GLIBC_CUSTOM_LOCATION}"
|
||||||
else
|
else
|
||||||
if echo ${CT_LIBC_VERSION} |grep -q linaro; then
|
case "${CT_LIBC_VERSION}" in
|
||||||
# Linaro glibc releases come from regular downloads...
|
linaro-*)
|
||||||
YYMM=`echo ${CT_LIBC_VERSION} |cut -d- -f3 |sed -e 's,^..,,'`
|
CT_GetLinaro "glibc" "${CT_LIBC_VERSION}"
|
||||||
CT_GetFile "glibc-${CT_LIBC_VERSION}" \
|
;;
|
||||||
https://releases.linaro.org/${YYMM}/components/toolchain/glibc-linaro \
|
*)
|
||||||
http://cbuild.validation.linaro.org/snapshots
|
CT_GetFile "glibc-${CT_LIBC_VERSION}" \
|
||||||
else
|
{http,ftp,https}://ftp.gnu.org/gnu/glibc \
|
||||||
CT_GetFile "glibc-${CT_LIBC_VERSION}" \
|
ftp://{sourceware.org,gcc.gnu.org}/pub/glibc/{releases,snapshots}
|
||||||
{http,ftp,https}://ftp.gnu.org/gnu/glibc \
|
;;
|
||||||
ftp://{sourceware.org,gcc.gnu.org}/pub/glibc/{releases,snapshots}
|
esac
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
@ -17,15 +17,18 @@ do_libc_get() {
|
|||||||
CT_GetCustom "newlib" "${CT_LIBC_NEWLIB_CUSTOM_VERSION}" \
|
CT_GetCustom "newlib" "${CT_LIBC_NEWLIB_CUSTOM_VERSION}" \
|
||||||
"${CT_LIBC_NEWLIB_CUSTOM_LOCATION}"
|
"${CT_LIBC_NEWLIB_CUSTOM_LOCATION}"
|
||||||
else # ! custom location
|
else # ! custom location
|
||||||
if echo ${CT_LIBC_VERSION} |grep -q linaro; then
|
case "${CT_LIBC_VERSION}" in
|
||||||
YYMM=`echo ${CT_LIBC_VERSION} |cut -d- -f3 |sed -e 's,^..,,'`
|
linaro-*)
|
||||||
CT_GetFile "newlib-${CT_LIBC_VERSION}" ${libc_src} \
|
CT_GetLinaro "newlib" "${CT_LIBC_VERSION}"
|
||||||
https://releases.linaro.org/${YYMM}/components/toolchain/newlib-linaro \
|
;;
|
||||||
http://cbuild.validation.linaro.org/snapshots
|
*)
|
||||||
else
|
# kernel.org mirror is outdated, keep last as a fallback
|
||||||
CT_GetFile "newlib-${CT_LIBC_VERSION}" ${libc_src} \
|
CT_GetFile "newlib-${CT_LIBC_VERSION}" \
|
||||||
http://mirrors.kernel.org/sources.redhat.com/newlib
|
ftp://sourceware.org/pub/newlib \
|
||||||
fi
|
http://mirrors.kernel.org/sourceware/newlib \
|
||||||
|
http://mirrors.kernel.org/sources.redhat.com/newlib
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi # ! custom location
|
fi # ! custom location
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -798,6 +798,40 @@ CT_GetFile() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Get a component from Linaro archives.
|
||||||
|
# Usage: CT_GetLinaro <component> <version>
|
||||||
|
CT_GetLinaro() {
|
||||||
|
local comp="$1"
|
||||||
|
local version="$2"
|
||||||
|
local linaro_version
|
||||||
|
local yyyymm_p
|
||||||
|
local yymm
|
||||||
|
local base
|
||||||
|
|
||||||
|
case "${version}" in
|
||||||
|
linaro-*)
|
||||||
|
linaro_version="${version#linaro-}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
CT_Abort "Version ${version} is not a Linaro package"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Recent releases reside in top of the directory tree; older releases
|
||||||
|
# are moved into the archive. Subdirectories are named differently
|
||||||
|
# in archive!
|
||||||
|
# In archive, some URLs also contain base component version
|
||||||
|
# (e.g. "gcc-linaro/4.9") while some do not (e.g. just "newlib-linaro").
|
||||||
|
base="${linaro_version%%-*}"
|
||||||
|
# Strip base version, first two digits of the year and optional patchlevel
|
||||||
|
yymm="${linaro_version#*-??}"
|
||||||
|
yymm="${yymm%-*}"
|
||||||
|
CT_GetFile "${comp}-${version}" \
|
||||||
|
"https://releases.linaro.org/components/toolchain/${comp}-linaro/${linaro_version}" \
|
||||||
|
"https://releases.linaro.org/archive/${yymm}/components/toolchain/${comp}-linaro/${base}" \
|
||||||
|
"https://releases.linaro.org/archive/${yymm}/components/toolchain/${comp}-linaro"
|
||||||
|
}
|
||||||
|
|
||||||
# Checkout from CVS, and build the associated tarball
|
# Checkout from CVS, and build the associated tarball
|
||||||
# The tarball will be called ${basename}.tar.bz2
|
# The tarball will be called ${basename}.tar.bz2
|
||||||
# Prerequisite: either the server does not require password,
|
# Prerequisite: either the server does not require password,
|
||||||
|
Loading…
Reference in New Issue
Block a user