mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-13 10:52:56 +01:00
5b6293c57e
Solution: Fix the qt-android build
57 lines
1.7 KiB
Bash
Executable File
57 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Use directory of current script as the build directory and working directory
|
|
cd "$( dirname "${BASH_SOURCE[0]}" )"
|
|
ANDROID_BUILD_DIR="$(pwd)"
|
|
|
|
# Get access to android_build functions and variables
|
|
source ${ANDROID_BUILD_DIR}/android_build_helper.sh
|
|
|
|
# Choose a C++ standard library implementation from the ndk
|
|
ANDROID_BUILD_CXXSTL="gnustl_shared_48"
|
|
|
|
# Set up android build environment and set ANDROID_BUILD_OPTS array
|
|
android_build_env
|
|
android_build_opts
|
|
|
|
# Use a temporary build directory
|
|
cache="/tmp/android_build/${TOOLCHAIN_NAME}"
|
|
mkdir -p "${cache}"
|
|
|
|
##
|
|
# Build libsodium from latest release tarball
|
|
|
|
(android_build_verify_so "libsodium.so" &> /dev/null) || {
|
|
rm -rf "${cache}/libsodium"
|
|
(cd "${cache}" && mkdir libsodium \
|
|
&& wget https://download.libsodium.org/libsodium/releases/LATEST.tar.gz\
|
|
-O "${cache}/libsodium.tar.gz" \
|
|
&& tar -C libsodium -xf libsodium.tar.gz --strip=1) || exit 1
|
|
|
|
(cd "${cache}/libsodium" && ./autogen.sh \
|
|
&& ./configure "${ANDROID_BUILD_OPTS[@]}" --disable-soname-versions \
|
|
&& make \
|
|
&& make install) || exit 1
|
|
}
|
|
|
|
##
|
|
# Build libzmq from local source
|
|
|
|
LIBTOOL_EXTRA_LDFLAGS='-avoid-version'
|
|
|
|
(android_build_verify_so "libzmq.so" "libsodium.so" &> /dev/null) || {
|
|
rm -rf "${cache}/libzmq"
|
|
(cp -r ../.. "${cache}/libzmq" && cd "${cache}/libzmq" && make clean)
|
|
|
|
(cd "${cache}/libzmq" && ./autogen.sh \
|
|
&& ./configure "${ANDROID_BUILD_OPTS[@]}" --with-libsodium=yes \
|
|
&& make \
|
|
&& make install) || exit 1
|
|
}
|
|
|
|
##
|
|
# Verify shared libraries in prefix
|
|
|
|
android_build_verify_so "libsodium.so"
|
|
android_build_verify_so "libzmq.so" "libsodium.so"
|