2017-04-26 00:25:33 +00:00
|
|
|
# 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
|
|
|
|
|
|
|
|
# Install Unified headers
|
2018-11-24 06:14:07 +00:00
|
|
|
bionic_start_files()
|
|
|
|
{
|
2017-04-26 00:25:33 +00:00
|
|
|
CT_DoStep INFO "Installing C library headers"
|
2017-07-02 03:17:56 +00:00
|
|
|
CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/android-ndk/sysroot/usr" "${CT_SYSROOT_DIR}"
|
2017-04-26 00:25:33 +00:00
|
|
|
}
|
|
|
|
|
2018-11-24 06:14:07 +00:00
|
|
|
bionic_main()
|
|
|
|
{
|
2017-04-26 00:25:33 +00:00
|
|
|
local arch="${CT_ARCH}"
|
|
|
|
if [ "${CT_ARCH_64}" = "y" ]; then
|
|
|
|
if [ "${CT_ARCH}" = "x86" ]; then
|
2017-05-27 07:01:49 +00:00
|
|
|
arch="${arch}_"
|
|
|
|
fi
|
|
|
|
arch="${arch}64"
|
2017-04-26 00:25:33 +00:00
|
|
|
fi
|
|
|
|
CT_DoStep INFO "Installing C library binaries"
|
2017-07-02 03:17:56 +00:00
|
|
|
CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/android-ndk/platforms/android-${CT_ANDROID_API}/arch-${arch}/usr" "${CT_SYSROOT_DIR}"
|
2018-09-25 05:43:08 +00:00
|
|
|
|
2018-12-15 08:39:04 +00:00
|
|
|
# NB: Modifying both CT_TARGET_CFLAGS and CT_ALL_TARGET_CFLAGS: the __ANDROID_API__
|
2018-09-25 05:43:08 +00:00
|
|
|
# definition needs to be passed into GCC build, or the resulting libstdc++ gets
|
|
|
|
# miscompiled (attempt to link against it results in unresolved symbols to stdout/...).
|
|
|
|
# And since __ANDROID_API__ is a user config option, placing it with other user-supplied
|
|
|
|
# options isn't completely out of character.
|
2018-12-15 08:39:04 +00:00
|
|
|
# On the other hand, CT_ALL_TARGET_CFLAGS in non-multilib builds is already set and does
|
|
|
|
# not get recalculated after GCC build, so setting CT_TARGET_CFLAGS is not reflected
|
|
|
|
# on other libraries/apps, such as gdbserver.
|
2018-09-25 05:43:08 +00:00
|
|
|
CT_EnvModify CT_TARGET_CFLAGS "${CT_TARGET_CFLAGS} -D__ANDROID_API__=${CT_ANDROID_API}"
|
2018-12-15 08:39:04 +00:00
|
|
|
CT_EnvModify CT_ALL_TARGET_CFLAGS "${CT_ALL_TARGET_CFLAGS} -D__ANDROID_API__=${CT_ANDROID_API}"
|
2017-04-26 00:25:33 +00:00
|
|
|
}
|