0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-29 00:32:34 +08:00
libzmq/builds/android/ci_build.sh
Stephan Guilloux 2b2fb9c708
Problem: Android NDK 22 download broken since support of NDK 23. (#4444)
* Problem: Android NDK 22 download broken since support of NDK 23.

Due to the PR to support NDK 23.

With NDK 23, the archive file name has changed.
This change is handled by the PR to support NDK23, but now, only 23 and after
are supported.

Also, NDK 23 support introduced a 2nd occurence of the variable
HOST_PLATFORM, with another value. One occurence being exported,
this may confuse next developpers (and it actually confused me).

Solution: Code review

1st occurence is simply dropped, and the algorithm around is changed so that
there is no need of a 'host_platform' kind of stuff.

2nd occurrence is renamed to ANDROID_BUILD_PLATFORM.

Note that 'HOST' is replaced by 'BUILD', as this is the common naming
when talking about the build/compilation machine, when cross compiling.

A dedicated function is created in the helpers, to actually download
the NDK. As this function is made 'public', more checks are performed.

Note:

    To be reported in CZMQ & ZYRE, via ZPROJECT, where NDK is downloaded
    in 2 different files.
2022-10-21 17:36:38 +01:00

25 lines
573 B
Bash
Executable File

#!/usr/bin/env bash
#
# Exit if any step fails
set -e
# Use directory of current script as the working directory
cd "$( dirname "${BASH_SOURCE[0]}" )"
# Configuration
export NDK_VERSION="${NDK_VERSION:-android-ndk-r25}"
export ANDROID_NDK_ROOT="${ANDROID_NDK_ROOT:-/tmp/${NDK_VERSION}}"
export MIN_SDK_VERSION=${MIN_SDK_VERSION:-21}
export ANDROID_BUILD_DIR="${ANDROID_BUILD_DIR:-${PWD}}"
# Cleanup.
rm -rf /tmp/android_build/
rm -rf "${PWD}/prefix"
rm -rf /tmp/tmp-deps
mkdir -p /tmp/tmp-deps
./build.sh "arm"
./build.sh "arm64"
./build.sh "x86"
./build.sh "x86_64"