scripts: Update usage of CT_GetCustom

This commit updates the build scripts to match the new usage of
CT_GetCustom from the previous change.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
This commit is contained in:
Bryan Hundven 2015-11-26 05:06:21 -08:00
parent 1b31314488
commit 4e2227e8a5
9 changed files with 29 additions and 89 deletions

View File

@ -5,7 +5,7 @@
# Download binutils # Download binutils
do_binutils_get() { do_binutils_get() {
if [ "${CT_BINUTILS_CUSTOM}" = "y" ]; then if [ "${CT_BINUTILS_CUSTOM}" = "y" ]; then
CT_GetCustom "binutils" "${CT_BINUTILS_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 if echo ${CT_BINUTILS_VERSION} |${grep} -q linaro; then
@ -22,7 +22,7 @@ do_binutils_get() {
if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
if [ "${CT_ELF2FLT_CUSTOM}" = "y" ]; then if [ "${CT_ELF2FLT_CUSTOM}" = "y" ]; then
CT_GetCustom "elf2flt" "${CT_ELF2FLT_VERSION}" \ CT_GetCustom "elf2flt" "${CT_ELF2FLT_CUSTOM_VERSION}" \
"${CT_ELF2FLT_CUSTOM_LOCATION}" "${CT_ELF2FLT_CUSTOM_LOCATION}"
else else
CT_GetGit elf2flt "${CT_ELF2FLT_GIT_CSET}" git://wh0rd.org/elf2flt.git CT_GetGit elf2flt "${CT_ELF2FLT_GIT_CSET}" git://wh0rd.org/elf2flt.git
@ -32,20 +32,13 @@ do_binutils_get() {
# Extract binutils # Extract binutils
do_binutils_extract() { do_binutils_extract() {
# If using custom directory location, nothing to do
if ! [ "${CT_BINUTILS_CUSTOM}" = "y" \
-a -d "${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}" ]; then
CT_Extract "binutils-${CT_BINUTILS_VERSION}" CT_Extract "binutils-${CT_BINUTILS_VERSION}"
CT_Patch "binutils" "${CT_BINUTILS_VERSION}" CT_Patch "binutils" "${CT_BINUTILS_VERSION}"
fi
if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
if ! [ "${CT_ELF2FLT_CUSTOM}" = "y" \
-a -d "${CT_SRC_DIR}/elf2flt-${CT_ELF2FLT_VERSION}" ]; then
CT_Extract "elf2flt-${CT_ELF2FLT_GIT_CSET}" CT_Extract "elf2flt-${CT_ELF2FLT_GIT_CSET}"
CT_Patch "elf2flt" "${CT_ELF2FLT_GIT_CSET}" CT_Patch "elf2flt" "${CT_ELF2FLT_GIT_CSET}"
fi fi
fi
if [ -n "${CT_ARCH_XTENSA_CUSTOM_NAME}" ]; then if [ -n "${CT_ARCH_XTENSA_CUSTOM_NAME}" ]; then
CT_ConfigureXtensa "binutils" "${CT_BINUTILS_VERSION}" CT_ConfigureXtensa "binutils" "${CT_BINUTILS_VERSION}"

View File

@ -8,7 +8,8 @@ do_gcc_get() {
local linaro_series="" local linaro_series=""
if [ "${CT_CC_GCC_CUSTOM}" = "y" ]; then if [ "${CT_CC_GCC_CUSTOM}" = "y" ]; then
CT_GetCustom "gcc" "${CT_CC_GCC_VERSION}" "${CT_CC_GCC_CUSTOM_LOCATION}" CT_GetCustom "gcc" "${CT_CC_GCC_CUSTOM_VERSION}" \
"${CT_CC_GCC_CUSTOM_LOCATION}"
else else
# Account for the Linaro versioning # Account for the Linaro versioning
linaro_version="$( echo "${CT_CC_GCC_VERSION}" \ linaro_version="$( echo "${CT_CC_GCC_VERSION}" \
@ -48,12 +49,6 @@ do_gcc_get() {
# Extract gcc # Extract gcc
do_gcc_extract() { do_gcc_extract() {
# If using custom directory location, nothing to do
if [ "${CT_CC_GCC_CUSTOM}" = "y" \
-a -d "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}" ]; then
return 0
fi
CT_Extract "gcc-${CT_CC_GCC_VERSION}" CT_Extract "gcc-${CT_CC_GCC_VERSION}"
CT_Patch "gcc" "${CT_CC_GCC_VERSION}" CT_Patch "gcc" "${CT_CC_GCC_VERSION}"

View File

@ -7,7 +7,8 @@ do_debug_gdb_get() {
local linaro_series="" local linaro_series=""
if [ "${CT_GDB_CUSTOM}" = "y" ]; then if [ "${CT_GDB_CUSTOM}" = "y" ]; then
CT_GetCustom "gdb" "${CT_GDB_VERSION}" "${CT_GDB_CUSTOM_LOCATION}" CT_GetCustom "gdb" "${CT_GDB_CUSTOM_VERSION}" \
"${CT_GDB_CUSTOM_LOCATION}"
else else
# Account for the Linaro versioning # Account for the Linaro versioning
linaro_version="$( echo "${CT_GDB_VERSION}" \ linaro_version="$( echo "${CT_GDB_VERSION}" \
@ -33,12 +34,6 @@ do_debug_gdb_get() {
} }
do_debug_gdb_extract() { do_debug_gdb_extract() {
# If using custom directory location, nothing to do
if [ "${CT_GDB_CUSTOM}" = "y" \
-a -d "${CT_SRC_DIR}/gdb-${CT_GDB_VERSION}" ]; then
return 0
fi
CT_Extract "gdb-${CT_GDB_VERSION}" CT_Extract "gdb-${CT_GDB_VERSION}"
CT_Patch "gdb" "${CT_GDB_VERSION}" CT_Patch "gdb" "${CT_GDB_VERSION}"

View File

@ -24,7 +24,7 @@ do_kernel_get() {
local korg_base mirror_base local korg_base mirror_base
if [ "${CT_KERNEL_LINUX_CUSTOM}" = "y" ]; then if [ "${CT_KERNEL_LINUX_CUSTOM}" = "y" ]; then
CT_GetCustom "linux" "${CT_KERNEL_VERSION}" \ CT_GetCustom "linux" "${CT_KERNEL_LINUX_CUSTOM_VERSION}" \
"${CT_KERNEL_LINUX_CUSTOM_LOCATION}" "${CT_KERNEL_LINUX_CUSTOM_LOCATION}"
else # Not a custom tarball else # Not a custom tarball
case "${CT_KERNEL_VERSION}" in case "${CT_KERNEL_VERSION}" in
@ -82,9 +82,6 @@ do_kernel_headers() {
mkdir -p "${CT_BUILD_DIR}/build-kernel-headers" mkdir -p "${CT_BUILD_DIR}/build-kernel-headers"
kernel_path="${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}" kernel_path="${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}"
if [ "${CT_KERNEL_LINUX_CUSTOM}" = "y" ]; then
kernel_path="${CT_SRC_DIR}/linux-custom"
fi
V_OPT="V=${CT_KERNEL_LINUX_VERBOSE_LEVEL}" V_OPT="V=${CT_KERNEL_LINUX_VERBOSE_LEVEL}"
kernel_arch="${CT_ARCH}" kernel_arch="${CT_ARCH}"

View File

@ -6,7 +6,7 @@ do_libc_get() {
libc_src="http://download.savannah.gnu.org/releases/avr-libc" libc_src="http://download.savannah.gnu.org/releases/avr-libc"
if [ "${CT_LIBC_AVR_LIBC_CUSTOM}" = "y" ]; then if [ "${CT_LIBC_AVR_LIBC_CUSTOM}" = "y" ]; then
CT_GetCustom "avr-libc" "${CT_LIBC_VERSION}" \ CT_GetCustom "avr-libc" "${CT_LIBC_AVR_LIBC_CUSTOM_VERSION}" \
"${CT_LIBC_AVR_LIBC_CUSTOM_LOCATION}" "${CT_LIBC_AVR_LIBC_CUSTOM_LOCATION}"
else # ! custom location else # ! custom location
CT_GetFile "avr-libc-${CT_LIBC_VERSION}" "${libc_src}" CT_GetFile "avr-libc-${CT_LIBC_VERSION}" "${libc_src}"
@ -14,16 +14,6 @@ do_libc_get() {
} }
do_libc_extract() { do_libc_extract() {
# If using custom directory location, nothing to do.
if [ "${CT_LIBC_AVR_LIBC_CUSTOM}" = "y" ]; then
# Abort if the custom directory is not found.
if ! [ -d "${CT_SRC_DIR}/avr-libc-${CT_LIBC_VERSION}" ]; then
CT_Abort "Directory not found: ${CT_SRC_DIR}/avr-libc-${CT_LIBC_VERSION}"
fi
return 0
fi
CT_Extract "avr-libc-${CT_LIBC_VERSION}" CT_Extract "avr-libc-${CT_LIBC_VERSION}"
CT_Patch "avr-libc" "${CT_LIBC_VERSION}" CT_Patch "avr-libc" "${CT_LIBC_VERSION}"
} }

View File

@ -6,16 +6,10 @@
do_libc_extract() { do_libc_extract() {
local addon local addon
# Attempt CT_EXTRACT only if NOT custom, or CUSTOM_LOCATION is not a directory
if [ "${CT_LIBC_CUSTOM}" != "y" \
-o ! -d "${CT_LIBC_CUSTOM_LOCATION}" ]; then
CT_Extract "${CT_LIBC}-${CT_LIBC_VERSION}" CT_Extract "${CT_LIBC}-${CT_LIBC_VERSION}"
fi
CT_Pushd "${CT_SRC_DIR}/${CT_LIBC}-${CT_LIBC_VERSION}" CT_Pushd "${CT_SRC_DIR}/${CT_LIBC}-${CT_LIBC_VERSION}"
# Attempt CT_PATCH only if NOT custom # Attempt CT_PATCH only if NOT custom
if [ "${CT_LIBC_CUSTOM}" != "y" ]; then
CT_Patch nochdir "${CT_LIBC}" "${CT_LIBC_VERSION}" CT_Patch nochdir "${CT_LIBC}" "${CT_LIBC_VERSION}"
fi
# Extract the add-opns if => 2.17 # Extract the add-opns if => 2.17
if [ "${CT_LIBC_GLIBC_2_17_or_later}" != "y" ]; then if [ "${CT_LIBC_GLIBC_2_17_or_later}" != "y" ]; then
@ -554,9 +548,9 @@ do_libc_get() {
addons_list=($(do_libc_add_ons_list " ")) addons_list=($(do_libc_add_ons_list " "))
# Main source # Main source
if [ "${CT_LIBC_CUSTOM}" = "y" ]; then if [ "${CT_LIBC_GLIBC_CUSTOM}" = "y" ]; then
CT_GetCustom "glibc" "${CT_LIBC_VERSION}" "${CT_LIBC_GLIBC_CUSTOM_LOCATION}" CT_GetCustom "glibc" "${CT_LIBC_GLIBC_CUSTOM_VERSION}" \
CT_LIBC_CUSTOM_LOCATION="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}" "${CT_LIBC_GLIBC_CUSTOM_LOCATION}"
else else
if echo ${CT_LIBC_VERSION} |${grep} -q linaro; then if echo ${CT_LIBC_VERSION} |${grep} -q linaro; then
# Linaro glibc releases come from regular downloads... # Linaro glibc releases come from regular downloads...

View File

@ -8,7 +8,7 @@ do_libc_get() {
libc_src="http://www.musl-libc.org/releases" libc_src="http://www.musl-libc.org/releases"
if [ "${CT_LIBC_MUSL_CUSTOM}" = "y" ]; then if [ "${CT_LIBC_MUSL_CUSTOM}" = "y" ]; then
CT_GetCustom "musl" "${CT_LIBC_VERSION}" \ CT_GetCustom "musl" "${CT_LIBC_MUSL_CUSTOM_VERSION}" \
"${CT_LIBC_MUSL_CUSTOM_LOCATION}" "${CT_LIBC_MUSL_CUSTOM_LOCATION}"
else # ! custom location else # ! custom location
CT_GetFile "musl-${CT_LIBC_VERSION}" "${libc_src}" CT_GetFile "musl-${CT_LIBC_VERSION}" "${libc_src}"
@ -16,16 +16,6 @@ do_libc_get() {
} }
do_libc_extract() { do_libc_extract() {
# If using custom directory location, nothing to do.
if [ "${CT_LIBC_MUSL_CUSTOM}" = "y" ]; then
# Abort if the custom directory is not found.
if ! [ -d "${CT_SRC_DIR}/musl-${CT_LIBC_VERSION}" ]; then
CT_Abort "Directory not found: ${CT_SRC_DIR}/musl-${CT_LIBC_VERSION}"
fi
return 0
fi
CT_Extract "musl-${CT_LIBC_VERSION}" CT_Extract "musl-${CT_LIBC_VERSION}"
CT_Patch "musl" "${CT_LIBC_VERSION}" CT_Patch "musl" "${CT_LIBC_VERSION}"
} }

View File

@ -14,7 +14,7 @@ do_libc_get() {
ftp://sourceware.org/pub/newlib}" ftp://sourceware.org/pub/newlib}"
if [ "${CT_LIBC_NEWLIB_CUSTOM}" = "y" ]; then if [ "${CT_LIBC_NEWLIB_CUSTOM}" = "y" ]; then
CT_GetCustom "newlib" "${CT_LIBC_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 if echo ${CT_LIBC_VERSION} |${grep} -q linaro; then
@ -30,12 +30,6 @@ do_libc_get() {
} }
do_libc_extract() { do_libc_extract() {
# If using custom directory location, nothing to do
if [ "${CT_LIBC_NEWLIB_CUSTOM}" = "y" \
-a -d "${CT_SRC_DIR}/newlib-${CT_LIBC_VERSION}" ]; then
return 0
fi
CT_Extract "newlib-${CT_LIBC_VERSION}" CT_Extract "newlib-${CT_LIBC_VERSION}"
CT_Patch "newlib" "${CT_LIBC_VERSION}" CT_Patch "newlib" "${CT_LIBC_VERSION}"

View File

@ -19,7 +19,7 @@ fi
# Download uClibc # Download uClibc
do_libc_get() { do_libc_get() {
if [ "${CT_LIBC_UCLIBC_CUSTOM}" = "y" ]; then if [ "${CT_LIBC_UCLIBC_CUSTOM}" = "y" ]; then
CT_GetCustom "${uclibc_name}" "${CT_LIBC_VERSION}" \ CT_GetCustom "${uclibc_name}" "${CT_LIBC_UCLIBC_CUSTOM_VERSION}" \
"${CT_LIBC_UCLIBC_CUSTOM_LOCATION}" "${CT_LIBC_UCLIBC_CUSTOM_LOCATION}"
else else
CT_GetFile "${uclibc_name}-${CT_LIBC_VERSION}" ${libc_src} CT_GetFile "${uclibc_name}-${CT_LIBC_VERSION}" ${libc_src}
@ -34,16 +34,8 @@ do_libc_get() {
# Extract uClibc # Extract uClibc
do_libc_extract() { do_libc_extract() {
# If not using custom directory location, extract and patch
# Note: we do the inverse test we do in other components,
# because here we still need to extract the locales, even for
# custom location directory. Just use negate the whole test,
# to keep it the same as for other components.
if ! [ "${CT_LIBC_UCLIBC_CUSTOM}" = "y" \
-a -d "${CT_SRC_DIR}/${uclibc_name}-${CT_LIBC_VERSION}" ]; then
CT_Extract "${uclibc_name}-${CT_LIBC_VERSION}" CT_Extract "${uclibc_name}-${CT_LIBC_VERSION}"
CT_Patch "${uclibc_name}" "${CT_LIBC_VERSION}" CT_Patch "${uclibc_name}" "${CT_LIBC_VERSION}"
fi
# uClibc locales # uClibc locales
# Extracting pregen locales ourselves is kinda # Extracting pregen locales ourselves is kinda