summaryrefslogtreecommitdiff
path: root/scripts/build
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build')
-rw-r--r--scripts/build/arch/xtensa.sh8
-rw-r--r--scripts/build/binutils/binutils.sh29
-rw-r--r--scripts/build/cc.sh6
-rw-r--r--scripts/build/cc/100-gcc.sh68
-rw-r--r--scripts/build/companion_libs/120-ppl.sh144
-rw-r--r--scripts/build/companion_libs/130-cloog.sh75
-rw-r--r--scripts/build/companion_libs/200-libelf.sh7
-rwxr-xr-x[-rw-r--r--]scripts/build/companion_libs/210-expat.sh33
-rw-r--r--scripts/build/companion_libs/320-libiconv.sh1
-rw-r--r--scripts/build/debug/300-gdb.sh33
-rw-r--r--scripts/build/kernel/linux.sh57
-rw-r--r--scripts/build/libc/avr-libc.sh14
-rw-r--r--scripts/build/libc/glibc.sh16
-rw-r--r--scripts/build/libc/musl.sh14
-rw-r--r--scripts/build/libc/newlib.sh10
-rw-r--r--scripts/build/libc/uClibc.sh16
16 files changed, 121 insertions, 410 deletions
diff --git a/scripts/build/arch/xtensa.sh b/scripts/build/arch/xtensa.sh
index 7e49312..c7bd432 100644
--- a/scripts/build/arch/xtensa.sh
+++ b/scripts/build/arch/xtensa.sh
@@ -22,13 +22,7 @@ CT_ConfigureXtensa() {
custom_overlay="xtensa-overlay.tar"
fi
- if [ -n "${CT_CUSTOM_LOCATION_ROOT_DIR}" \
- -a -z "${custom_location}" ]; then
- custom_location="${CT_CUSTOM_LOCATION_ROOT_DIR}"
- fi
-
- CT_TestAndAbort "${custom_overlay}: CT_CUSTOM_LOCATION_ROOT_DIR or CT_ARCH_XTENSA_CUSTOM_OVERLAY_LOCATION must be set." \
- -z "${CT_CUSTOM_LOCATION_ROOT_DIR}" -a -z "${custom_location}"
+ CT_TestAndAbort "${custom_overlay}: CT_ARCH_XTENSA_CUSTOM_OVERLAY_LOCATION must be set." -z "${custom_location}"
local full_file="${custom_location}/${custom_overlay}"
local basename="${component}-${version}"
diff --git a/scripts/build/binutils/binutils.sh b/scripts/build/binutils/binutils.sh
index b3ea88e..69605db 100644
--- a/scripts/build/binutils/binutils.sh
+++ b/scripts/build/binutils/binutils.sh
@@ -5,8 +5,8 @@
# Download binutils
do_binutils_get() {
if [ "${CT_BINUTILS_CUSTOM}" = "y" ]; then
- CT_GetCustom "binutils" "${CT_BINUTILS_VERSION}" \
- "${CT_BINUTILS_CUSTOM_LOCATION}"
+ 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,^..,,'`
@@ -22,8 +22,8 @@ do_binutils_get() {
if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
if [ "${CT_ELF2FLT_CUSTOM}" = "y" ]; then
- CT_GetCustom "elf2flt" "${CT_ELF2FLT_VERSION}" \
- "${CT_ELF2FLT_CUSTOM_LOCATION}"
+ CT_GetCustom "elf2flt" "${CT_ELF2FLT_CUSTOM_VERSION}" \
+ "${CT_ELF2FLT_CUSTOM_LOCATION}"
else
CT_GetGit elf2flt "${CT_ELF2FLT_GIT_CSET}" git://wh0rd.org/elf2flt.git
fi
@@ -32,19 +32,12 @@ do_binutils_get() {
# Extract binutils
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_Patch "binutils" "${CT_BINUTILS_VERSION}"
- fi
+ CT_Extract "binutils-${CT_BINUTILS_VERSION}"
+ CT_Patch "binutils" "${CT_BINUTILS_VERSION}"
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_Patch "elf2flt" "${CT_ELF2FLT_GIT_CSET}"
- fi
+ CT_Extract "elf2flt-${CT_ELF2FLT_GIT_CSET}"
+ CT_Patch "elf2flt" "${CT_ELF2FLT_GIT_CSET}"
fi
if [ -n "${CT_ARCH_XTENSA_CUSTOM_NAME}" ]; then
@@ -235,7 +228,7 @@ do_binutils_backend() {
"${CT_BINUTILS_EXTRA_CONFIG_ARRAY[@]}"
if [ "${static_build}" = "y" ]; then
- extra_make_flags+=("LDFLAGS=-all-static")
+ extra_make_flags+=("LDFLAGS=${ldflags} -all-static")
CT_DoLog EXTRA "Prepare binutils for static build"
CT_DoExecLog ALL ${make} ${JOBSFLAGS} configure-host
fi
@@ -358,6 +351,10 @@ do_binutils_for_target() {
extra_config+=("--disable-multilib")
fi
+ if [ "${CT_BINUTILS_FOR_TARGET_IBERTY}" = "y" ]; then
+ extra_config+=("--enable-install-libiberty")
+ fi
+
[ "${CT_TOOLCHAIN_ENABLE_NLS}" != "y" ] && extra_config+=("--disable-nls")
CT_DoExecLog CFG \
diff --git a/scripts/build/cc.sh b/scripts/build/cc.sh
index 3c8aaef..0db6b9c 100644
--- a/scripts/build/cc.sh
+++ b/scripts/build/cc.sh
@@ -38,21 +38,21 @@ do_cc_core_pass_1() {
# Core pass 2 the cc facilities
do_cc_core_pass_2() {
- for f in ${CT_CC_FACILITY_LIST}; do
+ for f in ${CT_CC_FACILITY_LIST}; do
do_${f}_core_pass_2
done
}
# Build for build the cc facilities
do_cc_for_build() {
- for f in ${CT_CC_FACILITY_LIST}; do
+ for f in ${CT_CC_FACILITY_LIST}; do
do_${f}_for_build
done
}
# Build for host the cc facilities
do_cc_for_host() {
- for f in ${CT_CC_FACILITY_LIST}; do
+ for f in ${CT_CC_FACILITY_LIST}; do
do_${f}_for_host
done
}
diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh
index 6ed9e9c..022cebb 100644
--- a/scripts/build/cc/100-gcc.sh
+++ b/scripts/build/cc/100-gcc.sh
@@ -8,7 +8,8 @@ do_gcc_get() {
local linaro_series=""
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
# Account for the Linaro versioning
linaro_version="$( echo "${CT_CC_GCC_VERSION}" \
@@ -27,9 +28,10 @@ do_gcc_get() {
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}" \
- "http://launchpad.net/gcc-linaro/${linaro_series}/${linaro_version}/+download" \
- https://releases.linaro.org/${YYMM}/components/toolchain/gcc-linaro/${linaro_series} \
+ 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
@@ -48,12 +50,6 @@ do_gcc_get() {
# Extract gcc
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_Patch "gcc" "${CT_CC_GCC_VERSION}"
@@ -148,9 +144,7 @@ do_gcc_core_pass_2() {
;;
*)
core_opts+=( "mode=static" )
- if [ "${CT_CC_GCC_4_3_or_later}" = "y" ]; then
- core_opts+=( "build_libgcc=yes" )
- fi
+ core_opts+=( "build_libgcc=yes" )
;;
esac
@@ -317,20 +311,13 @@ do_gcc_core_backend() {
extra_config+=("--with-mpc=${complibs}")
fi
if [ "${CT_CC_GCC_USE_GRAPHITE}" = "y" ]; then
- if [ "${CT_PPL}" = "y" ]; then
- extra_config+=("--with-ppl=${complibs}")
- # With PPL 0.11+, also pull libpwl if needed
- if [ "${CT_PPL_NEEDS_LIBPWL}" = "y" ]; then
- host_libstdcxx_flags+=("-L${complibs}/lib")
- host_libstdcxx_flags+=("-lpwl")
- fi
- fi
if [ "${CT_ISL}" = "y" ]; then
extra_config+=("--with-isl=${complibs}")
fi
- extra_config+=("--with-cloog=${complibs}")
+ if [ "${CT_CLOOG}" = "y" ]; then
+ extra_config+=("--with-cloog=${complibs}")
+ fi
elif [ "${CT_CC_GCC_HAS_GRAPHITE}" = "y" ]; then
- extra_config+=("--with-ppl=no")
extra_config+=("--with-isl=no")
extra_config+=("--with-cloog=no")
fi
@@ -486,16 +473,8 @@ do_gcc_core_backend() {
CT_DoExecLog ALL ${make} ${JOBSFLAGS} -C libbacktrace
fi
- # Starting with GCC 4.3, libgcc.mk is no longer built,
- # and libgcc.mvars is used instead.
-
- if [ "${CT_CC_GCC_4_3_or_later}" = "y" ]; then
- libgcc_rule="libgcc.mvars"
- core_targets=( gcc target-libgcc )
- else
- libgcc_rule="libgcc.mk"
- core_targets=( gcc )
- fi
+ libgcc_rule="libgcc.mvars"
+ core_targets=( gcc target-libgcc )
# On bare metal and canadian build the host-compiler is used when
# actually the build-system compiler is required. Choose the correct
@@ -731,10 +710,8 @@ do_gcc_backend() {
if [ -n "${CT_CC_GCC_ENABLE_CXX_FLAGS}" ]; then
extra_config+=("--enable-cxx-flags=${CT_CC_GCC_ENABLE_CXX_FLAGS}")
fi
- if [ "${CT_CC_GCC_4_8_or_later}" = "y" ]; then
- if [ "${CT_THREADS}" = "none" ]; then
- extra_config+=(--disable-libatomic)
- fi
+ if [ "${CT_THREADS}" = "none" ]; then
+ extra_config+=(--disable-libatomic)
fi
if [ "${CT_CC_GCC_LIBMUDFLAP}" = "y" ]; then
extra_config+=(--enable-libmudflap)
@@ -811,20 +788,13 @@ do_gcc_backend() {
extra_config+=("--with-mpc=${complibs}")
fi
if [ "${CT_CC_GCC_USE_GRAPHITE}" = "y" ]; then
- if [ "${CT_PPL}" = "y" ]; then
- extra_config+=("--with-ppl=${complibs}")
- # With PPL 0.11+, also pull libpwl if needed
- if [ "${CT_PPL_NEEDS_LIBPWL}" = "y" ]; then
- host_libstdcxx_flags+=("-L${complibs}/lib")
- host_libstdcxx_flags+=("-lpwl")
- fi
- fi
if [ "${CT_ISL}" = "y" ]; then
extra_config+=("--with-isl=${complibs}")
fi
- extra_config+=("--with-cloog=${complibs}")
+ if [ "${CT_CLOOG}" = "y" ]; then
+ extra_config+=("--with-cloog=${complibs}")
+ fi
elif [ "${CT_CC_GCC_HAS_GRAPHITE}" = "y" ]; then
- extra_config+=("--with-ppl=no")
extra_config+=("--with-isl=no")
extra_config+=("--with-cloog=no")
fi
@@ -842,10 +812,6 @@ do_gcc_backend() {
if [ "${CT_THREADS}" = "none" ]; then
extra_config+=("--disable-threads")
- if [ "${CT_CC_GCC_4_2_or_later}" = y ]; then
- CT_Test "Disabling libgomp for no-thread gcc>=4.2" "${CT_CC_GCC_LIBGOMP}" = "Y"
- extra_config+=("--disable-libgomp")
- fi
else
if [ "${CT_THREADS}" = "win32" ]; then
extra_config+=("--enable-threads=win32")
diff --git a/scripts/build/companion_libs/120-ppl.sh b/scripts/build/companion_libs/120-ppl.sh
deleted file mode 100644
index dc7ce33..0000000
--- a/scripts/build/companion_libs/120-ppl.sh
+++ /dev/null
@@ -1,144 +0,0 @@
-# This file adds the functions to build the PPL library
-# Copyright 2009 Yann E. MORIN
-# Licensed under the GPL v2. See COPYING in the root of this package
-
-do_ppl_get() { :; }
-do_ppl_extract() { :; }
-do_ppl_for_build() { :; }
-do_ppl_for_host() { :; }
-do_ppl_for_target() { :; }
-
-# Overide functions depending on configuration
-if [ "${CT_PPL}" = "y" ]; then
-
-# Download PPL
-do_ppl_get() {
- CT_GetFile "ppl-${CT_PPL_VERSION}" \
- http://bugseng.com/products/ppl/download/ftp/releases/${CT_PPL_VERSION} \
- ftp://ftp.cs.unipr.it/pub/ppl/releases/${CT_PPL_VERSION}
-}
-
-# Extract PPL
-do_ppl_extract() {
- CT_Extract "ppl-${CT_PPL_VERSION}"
- CT_Patch "ppl" "${CT_PPL_VERSION}"
-}
-
-# Build PPL for running on build
-# - always build statically
-# - we do not have build-specific CFLAGS
-# - install in build-tools prefix
-do_ppl_for_build() {
- local -a ppl_opts
- local ppl_cflags
- local ppl_cxxflags
-
- case "${CT_TOOLCHAIN_TYPE}" in
- native|cross) return 0;;
- esac
-
- CT_DoStep INFO "Installing PPL for build"
- CT_mkdir_pushd "${CT_BUILD_DIR}/build-ppl-build-${CT_BUILD}"
-
- ppl_cflags="${CT_CFLAGS_FOR_BUILD}"
- ppl_cxxflags="${CT_CFLAGS_FOR_BUILD}"
- if [ "${CT_PPL_NEEDS_FPERMISSIVE}" = "y" ]; then
- ppl_cxxflags+=" -fpermissive"
- fi
-
- ppl_opts+=( "host=${CT_BUILD}" )
- ppl_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
- ppl_opts+=( "cflags=${ppl_cflags}" )
- ppl_opts+=( "cxxflags=${ppl_cxxflags}" )
- ppl_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
- do_ppl_backend "${ppl_opts[@]}"
-
- CT_Popd
- CT_EndStep
-}
-
-# Build PPL for running on host
-do_ppl_for_host() {
- local -a ppl_opts
- local ppl_cflags
- local ppl_cxxflags
-
- CT_DoStep INFO "Installing PPL for host"
- CT_mkdir_pushd "${CT_BUILD_DIR}/build-ppl-host-${CT_HOST}"
-
- ppl_cflags="${CT_CFLAGS_FOR_HOST}"
- ppl_cxxflags="${CT_CFLAGS_FOR_HOST}"
- if [ "${CT_PPL_NEEDS_FPERMISSIVE}" = "y" ]; then
- ppl_cxxflags+=" -fpermissive"
- fi
-
- ppl_opts+=( "host=${CT_HOST}" )
- ppl_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
- ppl_opts+=( "cflags=${ppl_cflags}" )
- ppl_opts+=( "cxxflags=${ppl_cxxflags}" )
- ppl_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
- do_ppl_backend "${ppl_opts[@]}"
-
- CT_Popd
- CT_EndStep
-}
-
-# Build PPL
-# Parameter : description : type : default
-# host : machine to run on : tuple : (none)
-# prefix : prefix to install into : dir : (none)
-# cflags : cflags to use : string : (empty)
-# ldflags : ldflags to use : string : (empty)
-do_ppl_backend() {
- local host
- local prefix
- local cflags
- local cxxflags
- local ldflags
- local arg
-
- for arg in "$@"; do
- eval "${arg// /\\ }"
- done
-
- CT_DoLog EXTRA "Configuring PPL"
-
- CT_DoExecLog CFG \
- CFLAGS="${cflags}" \
- CXXFLAGS="${cxxflags}" \
- LDFLAGS="${ldflags}" \
- "${CT_SRC_DIR}/ppl-${CT_PPL_VERSION}/configure" \
- --build=${CT_BUILD} \
- --host=${host} \
- --prefix="${prefix}" \
- --with-libgmp-prefix="${prefix}" \
- --with-libgmpxx-prefix="${prefix}" \
- --with-gmp-prefix="${prefix}" \
- --enable-watchdog \
- --disable-debugging \
- --disable-assertions \
- --disable-ppl_lcdd \
- --disable-ppl_lpsol \
- --disable-shared \
- --enable-interfaces='c c++' \
- --enable-static
-
- # Maybe-options:
- # --enable-optimization=speed or sspeed (yes, with 2 's')
-
- CT_DoLog EXTRA "Building PPL"
- CT_DoExecLog ALL ${make} ${JOBSFLAGS}
-
- if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
- CT_DoLog EXTRA "Checking PPL"
- CT_DoExecLog ALL ${make} ${JOBSFLAGS} -s check
- fi
-
- CT_DoLog EXTRA "Installing PPL"
- CT_DoExecLog ALL ${make} install
-
- # Remove spuriously installed file
- CT_DoExecLog ALL rm -f "${prefix}/bin/ppl-config"
-}
-
-fi # CT_PPL
diff --git a/scripts/build/companion_libs/130-cloog.sh b/scripts/build/companion_libs/130-cloog.sh
index 2d06d06..2376570 100644
--- a/scripts/build/companion_libs/130-cloog.sh
+++ b/scripts/build/companion_libs/130-cloog.sh
@@ -11,43 +11,20 @@ do_cloog_for_target() { :; }
# Overide functions depending on configuration
if [ "${CT_CLOOG}" = "y" ]; then
-cloog_basename() {
- printf "cloog"
- if [ "${CT_PPL}" = "y" ]; then
- printf -- "-ppl"
- fi
-}
-cloog_basename_version() {
- cloog_basename
- printf -- "-${CT_CLOOG_VERSION}"
-}
-
# Download CLooG
do_cloog_get() {
- CT_GetFile "$(cloog_basename_version)" \
+ CT_GetFile "cloog-${CT_CLOOG_VERSION}" \
http://www.bastoul.net/cloog/pages/download \
ftp://gcc.gnu.org/pub/gcc/infrastructure
}
# Extract CLooG
do_cloog_extract() {
- local _t
-
- # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!)
- # while versions 0.15.4 onward do have the version in the dirname.
- # But, because the infrastructure properly creates the extracted
- # directories (with tar's --strip-components), we can live safely...
- CT_Extract "$(cloog_basename_version)"
- CT_Patch "$(cloog_basename)" "${CT_CLOOG_VERSION}"
+ CT_Extract "cloog-${CT_CLOOG_VERSION}"
+ CT_Patch "cloog" "${CT_CLOOG_VERSION}"
# Help the autostuff in case it thinks there are things to regenerate...
- CT_DoExecLog DEBUG mkdir -p "${CT_SRC_DIR}/$(cloog_basename_version)/m4"
-
- if [ "${CT_CLOOG_NEEDS_AUTORECONF}" = "y" ]; then
- CT_Pushd "${CT_SRC_DIR}/$(cloog_basename_version)"
- CT_DoExecLog CFG ./autogen.sh
- CT_Popd
- fi
+ CT_DoExecLog DEBUG mkdir -p "${CT_SRC_DIR}/cloog-${CT_CLOOG_VERSION}/m4"
}
# Build CLooG for running on build
@@ -102,47 +79,37 @@ do_cloog_backend() {
local prefix
local cflags
local ldflags
- local cloog_src_dir="${CT_SRC_DIR}/$(cloog_basename_version)"
local arg
local -a cloog_opts
- local -a cloog_targets
- local -a cloog_install_targets
for arg in "$@"; do
eval "${arg// /\\ }"
done
if [ "${CT_CLOOG_0_18_or_later}" = y ]; then
- cloog_opts+=( --with-gmp=system --with-gmp-prefix="${prefix}" )
- cloog_opts+=( --with-isl=system --with-isl-prefix="${prefix}" )
- cloog_opts+=( --without-osl )
- cloog_targets=( all )
- cloog_install_targets=( install )
- else
- cloog_opts+=( --with-gmp="${prefix}" )
- cloog_opts+=( --with-ppl="${prefix}" )
- cloog_targets=( libcloog.la )
- cloog_install_targets=( install-libLTLIBRARIES install-pkgincludeHEADERS )
+ cloog_opts+=( --with-gmp=system --with-gmp-prefix="${prefix}" )
+ cloog_opts+=( --with-isl=system --with-isl-prefix="${prefix}" )
+ cloog_opts+=( --without-osl )
fi
CT_DoLog EXTRA "Configuring CLooG"
- CT_DoExecLog CFG \
- CFLAGS="${cflags}" \
- LDFLAGS="${ldflags}" \
- LIBS="-lm" \
- "${cloog_src_dir}/configure" \
- --build=${CT_BUILD} \
- --host=${host} \
- --prefix="${prefix}" \
- --with-bits=gmp \
- --with-host-libstdcxx='-lstdc++' \
- --disable-shared \
- --enable-static \
+ CT_DoExecLog CFG \
+ CFLAGS="${cflags}" \
+ LDFLAGS="${ldflags}" \
+ LIBS="-lm" \
+ "${CT_SRC_DIR}/cloog-${CT_CLOOG_VERSION}/configure" \
+ --build=${CT_BUILD} \
+ --host=${host} \
+ --prefix="${prefix}" \
+ --with-bits=gmp \
+ --with-host-libstdcxx='-lstdc++' \
+ --disable-shared \
+ --enable-static \
"${cloog_opts[@]}"
CT_DoLog EXTRA "Building CLooG"
- CT_DoExecLog ALL ${make} ${JOBSFLAGS} "${cloog_targets[@]}"
+ CT_DoExecLog ALL ${make} ${JOBSFLAGS}
if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
CT_DoLog EXTRA "Checking CLooG"
@@ -150,7 +117,7 @@ do_cloog_backend() {
fi
CT_DoLog EXTRA "Installing CLooG"
- CT_DoExecLog ALL ${make} "${cloog_install_targets[@]}"
+ CT_DoExecLog ALL ${make} install
}
fi # CT_CLOOG
diff --git a/scripts/build/companion_libs/200-libelf.sh b/scripts/build/companion_libs/200-libelf.sh
index 58aa315..529bba2 100644
--- a/scripts/build/companion_libs/200-libelf.sh
+++ b/scripts/build/companion_libs/200-libelf.sh
@@ -135,6 +135,13 @@ do_libelf_backend() {
CT_DoExecLog ALL ${make}
CT_DoLog EXTRA "Installing libelf"
+
+ # Guard against $destdir$prefix == //
+ # which is a UNC path on Cygwin/MSYS2
+ if [[ ${destdir} == / ]] && [[ ${prefix} == /* ]]; then
+ destdir=
+ fi
+
CT_DoExecLog ALL ${make} instroot="${destdir}" install
}
diff --git a/scripts/build/companion_libs/210-expat.sh b/scripts/build/companion_libs/210-expat.sh
index 304482c..7801d33 100644..100755
--- a/scripts/build/companion_libs/210-expat.sh
+++ b/scripts/build/companion_libs/210-expat.sh
@@ -22,13 +22,18 @@ if [ "${CT_EXPAT}" = "y" ]; then
# Do not need expat for build at this time.
do_expat_for_host() {
+ local -a expat_opts
+
CT_DoStep INFO "Installing expat for host"
CT_mkdir_pushd "${CT_BUILD_DIR}/build-expat-host-${CT_HOST}"
- do_expat_backend host="${CT_HOST}" \
- prefix="${CT_HOST_COMPLIBS_DIR}" \
- cflags="${CT_CFLAGS_FOR_HOST}" \
- ldflags="${CT_LDFLAGS_FOR_HOST}"
+ expat_opts+=( "host=${CT_HOST}" )
+ expat_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
+ expat_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
+ expat_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
+ expat_opts+=( "static_build=${CT_STATIC_TOOLCHAIN}" )
+
+ do_expat_backend "${expat_opts[@]}"
CT_Popd
CT_EndStep
@@ -37,12 +42,17 @@ fi
if [ "${CT_EXPAT_TARGET}" = "y" ]; then
do_expat_for_target() {
+ local -a expat_opts
+
CT_DoStep INFO "Installing expat for target"
CT_mkdir_pushd "${CT_BUILD_DIR}/build-expat-target-${CT_TARGET}"
- do_expat_backend host="${CT_TARGET}" \
- prefix="/usr" \
- destdir="${CT_SYSROOT_DIR}"
+ expat_opts+=( "host=${CT_TARGET}" )
+ expat_opts+=( "prefix=/usr" )
+ expat_opts+=( "destdir=${CT_SYSROOT_DIR}" )
+ expat_opts+=( "static_build=y" )
+
+ do_expat_backend "${expat_opts[@]}"
CT_Popd
CT_EndStep
@@ -60,11 +70,17 @@ do_expat_backend() {
local cflags
local ldflags
local arg
+ local -a extra_config
for arg in "$@"; do
eval "${arg// /\\ }"
done
+ if [ "${static_build}" = "y" ]; then
+ extra_config+=("--disable-shared")
+ extra_config+=("--enable-static")
+ fi
+
CT_DoLog EXTRA "Configuring expat"
CT_DoExecLog CFG \
@@ -74,8 +90,7 @@ do_expat_backend() {
--build=${CT_BUILD} \
--host=${host} \
--prefix="${prefix}" \
- --enable-static \
- --disable-shared
+ "${extra_config[@]}"
CT_DoLog EXTRA "Building expat"
CT_DoExecLog ALL ${make} ${JOBSFLAGS}
diff --git a/scripts/build/companion_libs/320-libiconv.sh b/scripts/build/companion_libs/320-libiconv.sh
index 06908b5..0c9e5cf 100644
--- a/scripts/build/companion_libs/320-libiconv.sh
+++ b/scripts/build/companion_libs/320-libiconv.sh
@@ -102,6 +102,7 @@ do_libiconv_backend() {
--build=${CT_BUILD} \
--host="${host}" \
--prefix="${prefix}" \
+ --disable-nls \
"${extra_config[@]}" \
CT_DoLog EXTRA "Building libiconv"
diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh
index beef5ff..418e85c 100644
--- a/scripts/build/debug/300-gdb.sh
+++ b/scripts/build/debug/300-gdb.sh
@@ -7,7 +7,8 @@ do_debug_gdb_get() {
local linaro_series=""
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
# Account for the Linaro versioning
linaro_version="$( echo "${CT_GDB_VERSION}" \
@@ -33,12 +34,6 @@ do_debug_gdb_get() {
}
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_Patch "gdb" "${CT_GDB_VERSION}"
@@ -100,10 +95,10 @@ do_debug_gdb_build() {
LD_for_gdb="${CT_HOST}-ld -static"
fi
- # Disable binutils options when building from the binutils-gdb repo.
- cross_extra_config+=("--disable-binutils")
- cross_extra_config+=("--disable-ld")
- cross_extra_config+=("--disable-gas")
+ # Disable binutils options when building from the binutils-gdb repo.
+ cross_extra_config+=("--disable-binutils")
+ cross_extra_config+=("--disable-ld")
+ cross_extra_config+=("--disable-gas")
CT_DoLog DEBUG "Extra config passed: '${cross_extra_config[*]}'"
@@ -191,10 +186,10 @@ do_debug_gdb_build() {
export ac_cv_func_strncmp_works=yes
- # Disable binutils options when building from the binutils-gdb repo.
- native_extra_config+=("--disable-binutils")
- native_extra_config+=("--disable-ld")
- native_extra_config+=("--disable-gas")
+ # Disable binutils options when building from the binutils-gdb repo.
+ native_extra_config+=("--disable-binutils")
+ native_extra_config+=("--disable-ld")
+ native_extra_config+=("--disable-gas")
CT_DoLog DEBUG "Extra config passed: '${native_extra_config[*]}'"
@@ -261,10 +256,10 @@ do_debug_gdb_build() {
fi
fi
- # Disable binutils options when building from the binutils-gdb repo.
- gdbserver_extra_config+=("--disable-binutils")
- gdbserver_extra_config+=("--disable-ld")
- gdbserver_extra_config+=("--disable-gas")
+ # Disable binutils options when building from the binutils-gdb repo.
+ gdbserver_extra_config+=("--disable-binutils")
+ gdbserver_extra_config+=("--disable-ld")
+ gdbserver_extra_config+=("--disable-gas")
CT_DoExecLog CFG \
CC="${CT_TARGET}-gcc" \
diff --git a/scripts/build/kernel/linux.sh b/scripts/build/kernel/linux.sh
index 49fe613..f0f2402 100644
--- a/scripts/build/kernel/linux.sh
+++ b/scripts/build/kernel/linux.sh
@@ -23,13 +23,9 @@ do_kernel_get() {
local rel_dir
local korg_base mirror_base
- if [ "${CT_KERNEL_LINUX_USE_CUSTOM_HEADERS}" = "y" ]; then
- return 0
- fi
-
if [ "${CT_KERNEL_LINUX_CUSTOM}" = "y" ]; then
- CT_GetCustom "linux" "${CT_KERNEL_VERSION}" \
- "${CT_KERNEL_LINUX_CUSTOM_LOCATION}"
+ CT_GetCustom "linux" "${CT_KERNEL_LINUX_CUSTOM_VERSION}" \
+ "${CT_KERNEL_LINUX_CUSTOM_LOCATION}"
else # Not a custom tarball
case "${CT_KERNEL_VERSION}" in
2.6.*.*|3.*.*|4.*.*)
@@ -59,11 +55,6 @@ do_kernel_get() {
# Extract kernel
do_kernel_extract() {
- # If using a custom headers tree, nothing to do
- if [ "${CT_KERNEL_LINUX_USE_CUSTOM_HEADERS}" = "y" ]; then
- return 0
- fi
-
# If using a custom directory location, nothing to do
if [ "${CT_KERNEL_LINUX_CUSTOM}" = "y" \
-a -d "${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}" ]; then
@@ -81,32 +72,16 @@ do_kernel_extract() {
CT_Patch "linux" "${CT_KERNEL_VERSION}"
}
-# Wrapper to the actual headers install method
-do_kernel_headers() {
- CT_DoStep INFO "Installing kernel headers"
-
- if [ "${CT_KERNEL_LINUX_USE_CUSTOM_HEADERS}" = "y" ]; then
- do_kernel_custom
- else
- do_kernel_install
- fi
-
- CT_EndStep
-}
-
# Install kernel headers using headers_install from kernel sources.
-do_kernel_install() {
+do_kernel_headers() {
local kernel_path
local kernel_arch
- CT_DoLog DEBUG "Using kernel's headers_install"
+ CT_DoStep INFO "Installing kernel headers"
mkdir -p "${CT_BUILD_DIR}/build-kernel-headers"
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}"
kernel_arch="${CT_ARCH}"
@@ -145,28 +120,6 @@ do_kernel_install() {
-o -name '..check.cmd' \
\) \
-exec rm {} \;
-}
-# Use custom headers (most probably by using make headers_install in a
-# modified (read: customised) kernel tree, or using pre-2.6.18 headers, such
-# as 2.4). In this case, simply copy the headers in place
-do_kernel_custom() {
- local tar_opt
-
- CT_DoLog EXTRA "Installing custom kernel headers"
-
- mkdir -p "${CT_SYSROOT_DIR}/usr"
- cd "${CT_SYSROOT_DIR}/usr"
- if [ "${CT_KERNEL_LINUX_CUSTOM_IS_TARBALL}" = "y" ]; then
- case "${CT_KERNEL_LINUX_CUSTOM_PATH}" in
- *.tar) ;;
- *.tgz) tar_opt=--gzip;;
- *.tar.gz) tar_opt=--gzip;;
- *.tar.bz2) tar_opt=--bzip2;;
- *.tar.xz) tar_opt=--xz;;
- esac
- CT_DoExecLog ALL tar x ${tar_opt} -vf ${CT_KERNEL_LINUX_CUSTOM_PATH}
- else
- CT_DoExecLog ALL cp -rv "${CT_KERNEL_LINUX_CUSTOM_PATH}/include" .
- fi
+ CT_EndStep
}
diff --git a/scripts/build/libc/avr-libc.sh b/scripts/build/libc/avr-libc.sh
index 103a795..b73f990 100644
--- a/scripts/build/libc/avr-libc.sh
+++ b/scripts/build/libc/avr-libc.sh
@@ -6,24 +6,14 @@ do_libc_get() {
libc_src="http://download.savannah.gnu.org/releases/avr-libc"
if [ "${CT_LIBC_AVR_LIBC_CUSTOM}" = "y" ]; then
- CT_GetCustom "avr-libc" "${CT_LIBC_VERSION}" \
- "${CT_LIBC_AVR_LIBC_CUSTOM_LOCATION}"
+ CT_GetCustom "avr-libc" "${CT_LIBC_AVR_LIBC_CUSTOM_VERSION}" \
+ "${CT_LIBC_AVR_LIBC_CUSTOM_LOCATION}"
else # ! custom location
CT_GetFile "avr-libc-${CT_LIBC_VERSION}" "${libc_src}"
fi # ! custom location
}
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_Patch "avr-libc" "${CT_LIBC_VERSION}"
}
diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh
index 126e9e0..d45248a 100644
--- a/scripts/build/libc/glibc.sh
+++ b/scripts/build/libc/glibc.sh
@@ -6,16 +6,10 @@
do_libc_extract() {
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}"
- fi
+ CT_Extract "${CT_LIBC}-${CT_LIBC_VERSION}"
CT_Pushd "${CT_SRC_DIR}/${CT_LIBC}-${CT_LIBC_VERSION}"
# Attempt CT_PATCH only if NOT custom
- if [ "${CT_LIBC_CUSTOM}" != "y" ]; then
- CT_Patch nochdir "${CT_LIBC}" "${CT_LIBC_VERSION}"
- fi
+ CT_Patch nochdir "${CT_LIBC}" "${CT_LIBC_VERSION}"
# Extract the add-opns if => 2.17
if [ "${CT_LIBC_GLIBC_2_17_or_later}" != "y" ]; then
@@ -554,9 +548,9 @@ do_libc_get() {
addons_list=($(do_libc_add_ons_list " "))
# Main source
- if [ "${CT_LIBC_CUSTOM}" = "y" ]; then
- CT_GetCustom "glibc" "${CT_LIBC_VERSION}" "${CT_LIBC_GLIBC_CUSTOM_LOCATION}"
- CT_LIBC_CUSTOM_LOCATION="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}"
+ if [ "${CT_LIBC_GLIBC_CUSTOM}" = "y" ]; then
+ 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...
diff --git a/scripts/build/libc/musl.sh b/scripts/build/libc/musl.sh
index f8f135c..f7dbb97 100644
--- a/scripts/build/libc/musl.sh
+++ b/scripts/build/libc/musl.sh
@@ -8,24 +8,14 @@ do_libc_get() {
libc_src="http://www.musl-libc.org/releases"
if [ "${CT_LIBC_MUSL_CUSTOM}" = "y" ]; then
- CT_GetCustom "musl" "${CT_LIBC_VERSION}" \
- "${CT_LIBC_MUSL_CUSTOM_LOCATION}"
+ CT_GetCustom "musl" "${CT_LIBC_MUSL_CUSTOM_VERSION}" \
+ "${CT_LIBC_MUSL_CUSTOM_LOCATION}"
else # ! custom location
CT_GetFile "musl-${CT_LIBC_VERSION}" "${libc_src}"
fi # ! custom location
}
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_Patch "musl" "${CT_LIBC_VERSION}"
}
diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh
index a4fe82e..ba52268 100644
--- a/scripts/build/libc/newlib.sh
+++ b/scripts/build/libc/newlib.sh
@@ -14,8 +14,8 @@ do_libc_get() {
ftp://sourceware.org/pub/newlib}"
if [ "${CT_LIBC_NEWLIB_CUSTOM}" = "y" ]; then
- CT_GetCustom "newlib" "${CT_LIBC_VERSION}" \
- "${CT_LIBC_NEWLIB_CUSTOM_LOCATION}"
+ 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,^..,,'`
@@ -30,12 +30,6 @@ do_libc_get() {
}
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_Patch "newlib" "${CT_LIBC_VERSION}"
diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc.sh
index f5b871c..422412c 100644
--- a/scripts/build/libc/uClibc.sh
+++ b/scripts/build/libc/uClibc.sh
@@ -19,8 +19,8 @@ fi
# Download uClibc
do_libc_get() {
if [ "${CT_LIBC_UCLIBC_CUSTOM}" = "y" ]; then
- CT_GetCustom "${uclibc_name}" "${CT_LIBC_VERSION}" \
- "${CT_LIBC_UCLIBC_CUSTOM_LOCATION}"
+ CT_GetCustom "${uclibc_name}" "${CT_LIBC_UCLIBC_CUSTOM_VERSION}" \
+ "${CT_LIBC_UCLIBC_CUSTOM_LOCATION}"
else
CT_GetFile "${uclibc_name}-${CT_LIBC_VERSION}" ${libc_src}
fi
@@ -34,16 +34,8 @@ do_libc_get() {
# Extract uClibc
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_Patch "${uclibc_name}" "${CT_LIBC_VERSION}"
- fi
+ CT_Extract "${uclibc_name}-${CT_LIBC_VERSION}"
+ CT_Patch "${uclibc_name}" "${CT_LIBC_VERSION}"
# uClibc locales
# Extracting pregen locales ourselves is kinda