1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-24 04:25:10 -07:00

update android build scripts to support latest ndk version and prebuilt toolchains (#1138)

* Update android-armv7-a.sh

update HOST_COMPILER variable to be compatible with updated android-build.sh that supports latest ndk and use of prebuilt toolchains.

* Update android-build.sh

update to allow use of prebuilt toolchains in latest ndk. The latest ndk does not support arm prior to armv7a and the HOST_COMPILER for armv7a must now be armv7a not just arm.

* Delete android-arm.sh

arm prior to armv7a is no longer supported by android ndk.

* Update android-build.sh

removing unneeded MAKE_TOOLCHAIN variable

* Update Makefile.am

removing obsolete android targets

* Delete android-mips32.sh

* Delete android-mips64.sh
This commit is contained in:
ReenigneCA 2021-12-28 16:12:52 -05:00 committed by GitHub
parent 234b7d4ab7
commit c3d0f1b666
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 29 deletions

View File

@ -1,11 +1,8 @@
EXTRA_DIST = \
android-build.sh \
android-arm.sh \
android-armv7-a.sh \
android-armv8-a.sh \
android-mips32.sh \
android-mips64.sh \
android-x86.sh \
android-x86_64.sh \
emscripten.sh \

View File

@ -1,4 +0,0 @@
#!/bin/sh
export TARGET_ARCH=armv6
export CFLAGS="-Os -mthumb -marm -march=${TARGET_ARCH}"
ARCH=arm HOST_COMPILER=arm-linux-androideabi "$(dirname "$0")/android-build.sh"

View File

@ -1,4 +1,4 @@
#!/bin/sh
export TARGET_ARCH=armv7-a
export CFLAGS="-Os -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -marm -march=${TARGET_ARCH}"
ARCH=arm HOST_COMPILER=arm-linux-androideabi "$(dirname "$0")/android-build.sh"
ARCH=arm HOST_COMPILER=armv7a-linux-androideabi "$(dirname "$0")/android-build.sh"

View File

@ -23,15 +23,14 @@ if [ "x$TARGET_ARCH" = 'x' ] || [ "x$ARCH" = 'x' ] || [ "x$HOST_COMPILER" = 'x'
exit 1
fi
export MAKE_TOOLCHAIN="${ANDROID_NDK_HOME}/build/tools/make_standalone_toolchain.py"
export PREFIX="$(pwd)/libsodium-android-${TARGET_ARCH}"
export TOOLCHAIN_DIR="$(pwd)/android-toolchain-${TARGET_ARCH}"
export TOOLCHAIN_OS_DIR="`uname | tr '[:upper:]' '[:lower:]'`-x86_64/"
export TOOLCHAIN_DIR="$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/${TOOLCHAIN_OS_DIR}"
echo "$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/${TOOLCHAIN_OS_DIR}/${HOST_COMPILER}"
export PATH="${PATH}:${TOOLCHAIN_DIR}/bin"
export CC=${CC:-"${HOST_COMPILER}-clang"}
rm -rf "${TOOLCHAIN_DIR}" "${PREFIX}"
SDK_VERSION_NUM=`echo $NDK_PLATFORM | cut -d'-' -f2`
export CC=${CC:-"${HOST_COMPILER}${SDK_VERSION_NUM}-clang"}
echo
echo "Warnings related to headers being present but not usable are due to functions"
@ -47,9 +46,6 @@ else
fi
echo
env - PATH="$PATH" \
"$MAKE_TOOLCHAIN" --force --api="$NDK_API_VERSION_COMPAT" \
--arch="$ARCH" --install-dir="$TOOLCHAIN_DIR" || exit 1
if [ -z "$LIBSODIUM_FULL_BUILD" ]; then
export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal"
@ -69,9 +65,6 @@ if [ "$NDK_PLATFORM" != "$NDK_PLATFORM_COMPAT" ]; then
echo
echo "Configuring again for platform [${NDK_PLATFORM}]"
echo
env - PATH="$PATH" \
"$MAKE_TOOLCHAIN" --force --api="$NDK_API_VERSION" \
--arch="$ARCH" --install-dir="$TOOLCHAIN_DIR" || exit 1
./configure \
--disable-soname-versions \

View File

@ -1,4 +0,0 @@
#!/bin/sh
export TARGET_ARCH=mips32
export CFLAGS="-Os"
ARCH=mips HOST_COMPILER=mipsel-linux-android "$(dirname "$0")/android-build.sh"

View File

@ -1,4 +0,0 @@
#!/bin/sh
export TARGET_ARCH=mips64r6
export CFLAGS="-Os -march=${TARGET_ARCH}"
CC="mips64el-linux-android-gcc" NDK_PLATFORM=android-21 ARCH=mips64 HOST_COMPILER=mips64el-linux-android "$(dirname "$0")/android-build.sh"