summaryrefslogtreecommitdiff
path: root/scripts/build
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build')
-rw-r--r--scripts/build/arch/arm.sh1
-rw-r--r--scripts/build/arch/mips.sh11
-rw-r--r--scripts/build/arch/msp430.sh5
-rw-r--r--scripts/build/cc/100-gcc.sh12
-rw-r--r--scripts/build/companion_libs/050-zlib.sh49
-rw-r--r--scripts/build/debug/300-gdb.sh9
-rw-r--r--scripts/build/libc/bionic.sh43
7 files changed, 106 insertions, 24 deletions
diff --git a/scripts/build/arch/arm.sh b/scripts/build/arch/arm.sh
index eeffc7d..8733ac3 100644
--- a/scripts/build/arch/arm.sh
+++ b/scripts/build/arch/arm.sh
@@ -18,6 +18,7 @@ CT_DoArchTupleValues() {
*glibc,y) CT_TARGET_SYS=gnueabi;;
uClibc,y) CT_TARGET_SYS=uclibc${CT_LIBC_UCLIBC_USE_GNU_SUFFIX:+gnu}eabi;;
musl,y) CT_TARGET_SYS=musleabi;;
+ bionic,y) CT_TARGET_SYS=android;;
*,y) CT_TARGET_SYS=eabi;;
esac
diff --git a/scripts/build/arch/mips.sh b/scripts/build/arch/mips.sh
index f91a80a..acb8851 100644
--- a/scripts/build/arch/mips.sh
+++ b/scripts/build/arch/mips.sh
@@ -48,6 +48,17 @@ CT_DoArchUClibcConfig() {
CT_KconfigDeleteOption "CONFIG_MIPS_ISA_MIPS64R2" "${cfg}"
}
+CT_DoArchUClibcHeaderDir() {
+ local dir_var="${1}"
+ local cflags="${2}"
+
+ # If it is non-default multilib, add a suffix with architecture (reported by gcc)
+ # to the headers installation path.
+ if [ -n "${cflags}" ]; then
+ eval "${dir_var}="$( ${CT_TARGET}-${CT_CC} -print-multiarch ${cflags} )
+ fi
+}
+
CT_DoArchUClibcCflags() {
local cfg="${1}"
local cflags="${2}"
diff --git a/scripts/build/arch/msp430.sh b/scripts/build/arch/msp430.sh
new file mode 100644
index 0000000..8edb72a
--- /dev/null
+++ b/scripts/build/arch/msp430.sh
@@ -0,0 +1,5 @@
+# Compute MSP430-specific values
+
+CT_DoArchTupleValues() {
+ CT_TARGET_ARCH="${CT_ARCH}"
+}
diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh
index 190aec8..c45253a 100644
--- a/scripts/build/cc/100-gcc.sh
+++ b/scripts/build/cc/100-gcc.sh
@@ -337,10 +337,8 @@ do_gcc_core_backend() {
CT_DoLog EXTRA "Configuring final gcc compiler"
extra_user_config=( "${CT_CC_GCC_EXTRA_CONFIG_ARRAY[@]}" )
log_txt="final gcc compiler"
- if [ "${CT_CC_GCC_TARGET_FINAL}" = "y" ]; then
- # to inhibit the libiberty and libgcc tricks later on
- build_libgcc=no
- fi
+ # to inhibit the libiberty and libgcc tricks later on
+ build_libgcc=no
;;
*)
CT_Abort "Internal Error: 'build_step' must be one of: 'core1', 'core2', 'gcc_build' or 'gcc_host', not '${build_step:-(empty)}'"
@@ -663,10 +661,8 @@ do_gcc_core_backend() {
case "${build_step}" in
gcc_build|gcc_host)
- if [ "${CT_CC_GCC_TARGET_FINAL}" = "y" ]; then
- core_targets_all=all
- core_targets_install=install
- fi
+ core_targets_all=all
+ core_targets_install=install
;;
esac
diff --git a/scripts/build/companion_libs/050-zlib.sh b/scripts/build/companion_libs/050-zlib.sh
index 10779af..a3ba638 100644
--- a/scripts/build/companion_libs/050-zlib.sh
+++ b/scripts/build/companion_libs/050-zlib.sh
@@ -76,30 +76,51 @@ do_zlib_backend() {
local ldflags
local arg
local -a extra_config
+ local -a extra_make
for arg in "$@"; do
eval "${arg// /\\ }"
done
- CT_DoLog EXTRA "Configuring zlib"
-
- CT_DoExecLog CFG \
- CFLAGS="${cflags}" \
- LDFLAGS="${ldflags}" \
- CHOST="${host}" \
- ${CONFIG_SHELL} \
- "${CT_SRC_DIR}/zlib-${CT_ZLIB_VERSION}/configure" \
- --prefix="${prefix}" \
- --static \
- "${extra_config[@]}"
+ case "${host}" in
+ *-mingw32)
+ # zlib treats mingw host differently and requires using a different
+ # makefile rather than configure+make. It also does not support
+ # out-of-tree building.
+ cp -av "${CT_SRC_DIR}/zlib-${CT_ZLIB_VERSION}/." .
+ extra_make=( -f win32/Makefile.gcc \
+ PREFIX="${host}-" \
+ SHAREDLIB= \
+ IMPLIB= \
+ LIBRARY_PATH="${prefix}/lib" \
+ INCLUDE_PATH="${prefix}/include" \
+ BINARY_PATH="${prefix}/bin" \
+ prefix="${prefix}" \
+ )
+ ;;
+
+ *)
+ CT_DoLog EXTRA "Configuring zlib"
+
+ CT_DoExecLog CFG \
+ CFLAGS="${cflags}" \
+ LDFLAGS="${ldflags}" \
+ CHOST="${host}" \
+ ${CONFIG_SHELL} \
+ "${CT_SRC_DIR}/zlib-${CT_ZLIB_VERSION}/configure" \
+ --prefix="${prefix}" \
+ --static \
+ "${extra_config[@]}"
+ ;;
+ esac
CT_DoLog EXTRA "Building zlib"
- CT_DoExecLog ALL make ${JOBSFLAGS}
+ CT_DoExecLog ALL make "${extra_make[@]}" ${JOBSFLAGS}
if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
if [ "${host}" = "${CT_BUILD}" ]; then
CT_DoLog EXTRA "Checking zlib"
- CT_DoExecLog ALL make ${JOBSFLAGS} -s check
+ CT_DoExecLog ALL make "${extra_make[@]}" -s test
else
# Cannot run host binaries on build in a canadian cross
CT_DoLog EXTRA "Skipping check for zlib on the host"
@@ -107,7 +128,7 @@ do_zlib_backend() {
fi
CT_DoLog EXTRA "Installing zlib"
- CT_DoExecLog ALL make install
+ CT_DoExecLog ALL make "${extra_make[@]}" install
}
fi # CT_ZLIB
diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh
index 68510e1..98ef5e5 100644
--- a/scripts/build/debug/300-gdb.sh
+++ b/scripts/build/debug/300-gdb.sh
@@ -190,6 +190,7 @@ do_debug_gdb_build() {
CT_EndStep
fi
+ # TBD combine GDB native and gdbserver backends, build either or both in a single pass.
if [ "${CT_GDB_NATIVE}" = "y" ]; then
local -a native_extra_config
@@ -198,7 +199,9 @@ do_debug_gdb_build() {
native_extra_config=("${extra_config[@]}")
# We may not have C++ language configured for target
- native_extra_config+=("--disable-build-with-cxx")
+ if [ "${GDB_TARGET_DISABLE_CXX_BUILD}" = "y" ]; then
+ native_extra_config+=("--disable-build-with-cxx")
+ fi
# GDB on Mingw depends on PDcurses, not ncurses
if [ "${CT_MINGW32}" != "y" ]; then
@@ -317,7 +320,9 @@ do_debug_gdb_build() {
gdbserver_extra_config=("${extra_config[@]}")
# We may not have C++ language configured for target
- gdbserver_extra_config+=("--disable-build-with-cxx")
+ if [ "${GDB_TARGET_DISABLE_CXX_BUILD}" = "y" ]; then
+ gdbserver_extra_config+=("--disable-build-with-cxx")
+ fi
if [ "${CT_GDB_GDBSERVER_HAS_IPA_LIB}" = "y" ]; then
if [ "${CT_GDB_GDBSERVER_BUILD_IPA_LIB}" = "y" ]; then
diff --git a/scripts/build/libc/bionic.sh b/scripts/build/libc/bionic.sh
new file mode 100644
index 0000000..fcdc57f
--- /dev/null
+++ b/scripts/build/libc/bionic.sh
@@ -0,0 +1,43 @@
+# This file adds functions to extract the bionic C library from the Android NDK
+# Copyright 2017 Howard Chu
+# Licensed under the GPL v2. See COPYING in the root of this package
+
+do_libc_get() {
+ if [ "${CT_LIBC_BIONIC_CUSTOM}" = "y" ]; then
+ CT_GetCustom "bionic" "${CT_LIBC_BIONIC_CUSTOM_VERSION}" \
+ "${CT_LIBC_BIONIC_CUSTOM_LOCATION}"
+ else # ! custom location
+ CT_GetFile "android-ndk-${CT_LIBC_VERSION}-linux-x86_64.zip" https://dl.google.com/android/repository
+ fi # ! custom location
+}
+
+do_libc_extract() {
+ CT_Extract "android-ndk-${CT_LIBC_VERSION}-linux-x86_64"
+ CT_Pushd "${CT_SRC_DIR}/android-ndk-${CT_LIBC_VERSION}/"
+ CT_Patch nochdir bionic "${CT_LIBC_VERSION}"
+ CT_Popd
+}
+
+# Install Unified headers
+do_libc_start_files() {
+ CT_DoStep INFO "Installing C library headers"
+ CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/android-ndk-${CT_LIBC_VERSION}/sysroot/usr" "${CT_SYSROOT_DIR}"
+}
+
+do_libc() {
+ local arch="${CT_ARCH}"
+ if [ "${CT_ARCH_64}" = "y" ]; then
+ if [ "${CT_ARCH}" = "x86" ]; then
+ arch="${arch}_"
+ fi
+ arch="${arch}64"
+ fi
+ CT_DoStep INFO "Installing C library binaries"
+ CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/android-ndk-${CT_LIBC_VERSION}/platforms/android-${CT_ANDROID_API}/arch-${arch}/usr" "${CT_SYSROOT_DIR}"
+ CT_EnvModify CT_TARGET_CFLAGS "${CT_TARGET_CFLAGS} -D__ANDROID_API__=${CT_ANDROID_API}"
+}
+
+do_libc_post_cc() {
+ :
+}
+