summaryrefslogtreecommitdiff
path: root/scripts/build/libc
diff options
context:
space:
mode:
authorhyc <hyc@symas.com>2017-04-26 00:25:33 (GMT)
committerAlexey Neyman <stilor@att.net>2017-05-14 22:23:34 (GMT)
commit8762c7698cc380d33042fa9e0b8ee9704a842281 (patch)
tree9523e367b74193f45419019759d17301d69fc2a9 /scripts/build/libc
parentef762bfe8e1ec9063d645b1745dc8843997b7767 (diff)
Preliminary bionic/Android support
Mostly from Crystax NDK
Diffstat (limited to 'scripts/build/libc')
-rw-r--r--scripts/build/libc/bionic.sh43
1 files changed, 43 insertions, 0 deletions
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() {
+ :
+}
+