diff options
author | Alexey Neyman <stilor@att.net> | 2017-05-16 04:12:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-16 04:12:36 (GMT) |
commit | 1dbb06f2d375d58f12e79399b64b3111fc4d35fc (patch) | |
tree | b2b8807fd6c7d0d700b3efd724fb308182001cb1 /scripts | |
parent | ef762bfe8e1ec9063d645b1745dc8843997b7767 (diff) | |
parent | 97a20eed5c3cf3a2f7bb261705405b8b16c56b36 (diff) |
Merge pull request #717 from stilor/merge-bionic
Merge bionic
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/build/arch/arm.sh | 1 | ||||
-rw-r--r-- | scripts/build/libc/bionic.sh | 43 | ||||
-rw-r--r-- | scripts/functions | 1 | ||||
-rwxr-xr-x | scripts/showSamples.sh | 2 |
4 files changed, 46 insertions, 1 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/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() { + : +} + diff --git a/scripts/functions b/scripts/functions index 39ec2b4..c1b99ce 100644 --- a/scripts/functions +++ b/scripts/functions @@ -1368,6 +1368,7 @@ CT_DoBuildTargetTuple() { *glibc) CT_TARGET_SYS=gnu;; uClibc) CT_TARGET_SYS=uclibc;; musl) CT_TARGET_SYS=musl;; + bionic) CT_TARGET_SYS=android;; avr-libc) # avr-libc only seems to work with the non-canonical "avr" target. CT_TARGET_SKIP_CONFIG_SUB=y diff --git a/scripts/showSamples.sh b/scripts/showSamples.sh index f3a21d2..e60e29f 100755 --- a/scripts/showSamples.sh +++ b/scripts/showSamples.sh @@ -101,7 +101,7 @@ dump_single_sample() { cc=$(echo ${CT_CC} | ${awk} '{ print toupper($0)}') version=$(eval echo \${CT_CC_${cc}_VERSION}) compiler=$(echo $cc | ${awk} '{print tolower($0)}') - printf " $compiler | $version" + printf " $compiler-$version" printf "\n" printf " %-*s : %s" ${width} "Languages" "C" [ "${CT_CC_LANG_CXX}" = "y" ] && printf ",C++" |