mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-16 17:27:37 +00:00
Update android build scripts.
This commit is contained in:
parent
dd784a7829
commit
e5e525edae
8 changed files with 50 additions and 84 deletions
|
@ -9,7 +9,7 @@ for arch in "aarch" "aarch64" "i686" "x86_64"
|
|||
do
|
||||
|
||||
PREFIX=$WORKDIR/prefix_${arch}
|
||||
|
||||
PATH="${TOOLCHAIN_BASE_DIR}_${arch}/bin:${ORIGINAL_PATH}"
|
||||
./init_boost.sh $arch $PREFIX $BOOST_SRC_DIR $BOOST_FILENAME $BOOST_VERSION
|
||||
./finish_boost.sh $arch $PREFIX $BOOST_SRC_DIR $BOOST_SRC_DIR
|
||||
|
||||
|
|
|
@ -13,15 +13,16 @@ for arch in aarch aarch64 i686 x86_64
|
|||
do
|
||||
|
||||
PREFIX=${WORKDIR}/prefix_${arch}
|
||||
PATH="${TOOLCHAIN_BASE_DIR}_${arch}/bin:${ORIGINAL_PATH}"
|
||||
|
||||
case $arch in
|
||||
"aarch" )
|
||||
CLANG=armv7a-linux-androideabi${API}-clang
|
||||
CXXLANG=armv7a-linux-androideabi${API}-clang++
|
||||
HOST="arm";;
|
||||
CLANG=armv7a-linux-androideabi-clang
|
||||
CXXLANG=arm-linux-androideabi-clang++
|
||||
HOST="arm-linux-android";;
|
||||
* )
|
||||
CLANG=${arch}-linux-android${API}-clang
|
||||
CXXLANG=${arch}-linux-android${API}-clang++
|
||||
CLANG=${arch}-linux-android-clang
|
||||
CXXLANG=${arch}-linux-android-clang++
|
||||
HOST="${arch}-linux-android";;
|
||||
esac
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
. ./config.sh
|
||||
MONERO_BRANCH=v0.17.2.3-android
|
||||
MONERO_SRC_DIR=${WORKDIR}/monero
|
||||
CMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake"
|
||||
|
||||
git clone https://github.com/cake-tech/monero.git ${MONERO_SRC_DIR} --branch ${MONERO_BRANCH}
|
||||
cd $MONERO_SRC_DIR
|
||||
|
@ -18,36 +17,38 @@ DEST_LIB_DIR=${PREFIX}/lib/monero
|
|||
DEST_INCLUDE_DIR=${PREFIX}/include
|
||||
export CMAKE_INCLUDE_PATH="${PREFIX}/include"
|
||||
export CMAKE_LIBRARY_PATH="${PREFIX}/lib"
|
||||
ANDROID_STANDALONE_TOOLCHAIN_PATH="${TOOLCHAIN_BASE_DIR}_${arch}"
|
||||
PATH="${ANDROID_STANDALONE_TOOLCHAIN_PATH}/bin:${ORIGINAL_PATH}"
|
||||
|
||||
mkdir -p $DEST_LIB_DIR
|
||||
mkdir -p $DEST_INCLUDE_DIR
|
||||
|
||||
case $arch in
|
||||
"aarch" )
|
||||
ANDROID_CLANG=armv7a-linux-androideabi${API}-clang
|
||||
ANDROID_CLANGPP=armv7a-linux-androideabi${API}-clang++
|
||||
CLANG=arm-linux-androideabi-clang
|
||||
CXXLANG=arm-linux-androideabi-clang++
|
||||
BUILD_64=OFF
|
||||
TAG="android-armv7"
|
||||
ARCH="armv7-a"
|
||||
ARCH_ABI="armeabi-v7a"
|
||||
FLAGS="-D CMAKE_ANDROID_ARM_MODE=ON -D NO_AES=true";;
|
||||
"aarch64" )
|
||||
ANDROID_CLANG=aarch64-linux-androideabi${API}-clang
|
||||
ANDROID_CLANGPP=aarch64-linux-androideabi${API}-clang++
|
||||
CLANG=aarch64-linux-androideabi-clang
|
||||
CXXLANG=aarch64-linux-androideabi-clang++
|
||||
BUILD_64=ON
|
||||
TAG="android-armv8"
|
||||
ARCH="armv8-a"
|
||||
ARCH_ABI="arm64-v8a";;
|
||||
"i686" )
|
||||
ANDROID_CLANG=i686-linux-androideabi${API}-clang
|
||||
ANDROID_CLANGPP=i686-linux-androideabi${API}-clang++
|
||||
CLANG=i686-linux-androideabi-clang
|
||||
CXXLANG=i686-linux-androideabi-clang++
|
||||
BUILD_64=OFF
|
||||
TAG="android-x86"
|
||||
ARCH="i686"
|
||||
ARCH_ABI="x86";;
|
||||
"x86_64" )
|
||||
ANDROID_CLANG=x86_64-linux-androideabi${API}-clang
|
||||
ANDROID_CLANGPP=x86_64-linux-androideabi${API}-clang++
|
||||
CLANG=x86_64-linux-androideabi-clang
|
||||
CXXLANG=x86_64-linux-androideabi-clang++
|
||||
BUILD_64=ON
|
||||
TAG="android-x86_64"
|
||||
ARCH="x86-64"
|
||||
|
@ -58,24 +59,7 @@ cd $MONERO_SRC_DIR
|
|||
rm -rf ./build/release
|
||||
mkdir -p ./build/release
|
||||
cd ./build/release
|
||||
cmake \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \
|
||||
-DCMAKE_PREFIX_PATH="${PREFIX}" \
|
||||
-DCMAKE_FIND_ROOT_PATH="${PREFIX}" \
|
||||
-DCMAKE_BUILD_TYPE=release \
|
||||
-DARCH=$ARCH \
|
||||
-DANDROID=true \
|
||||
-DANDROID_NATIVE_API_LEVEL=$API \
|
||||
-DANDROID_ABI=$ARCH_ABI \
|
||||
-DANDROID_TOOLCHAIN=clang \
|
||||
-DLRELEASE_PATH="${PREFIX}/bin" \
|
||||
-DSTATIC=ON \
|
||||
-DBUILD_64=$BUILD_64 \
|
||||
-DINSTALL_VENDORED_LIBUNBOUND=ON \
|
||||
-DUSE_DEVICE_TREZOR=OFF \
|
||||
-DBUILD_GUI_DEPS=1 \
|
||||
-DBUILD_TESTS=OFF \
|
||||
${FLAGS} ../..
|
||||
CC=${CLANG} CXX=${CXXLANG} cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH=${ARCH} -D STATIC=ON -D BUILD_64=${BUILD_64} -D CMAKE_BUILD_TYPE=release -D ANDROID=true -D INSTALL_VENDORED_LIBUNBOUND=ON -D BUILD_TAG=${TAG} -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_STANDALONE_TOOLCHAIN="${ANDROID_STANDALONE_TOOLCHAIN_PATH}" -D CMAKE_ANDROID_ARCH_ABI=${ARCH_ABI} $FLAGS ../..
|
||||
|
||||
make wallet_api -j4
|
||||
find . -path ./lib -prune -o -name '*.a' -exec cp '{}' lib \;
|
||||
|
|
|
@ -24,37 +24,31 @@ echo $OPENSSL_SHA256 $OPENSSL_FILE_PATH | sha256sum -c - || exit 1
|
|||
for arch in "aarch" "aarch64" "i686" "x86_64"
|
||||
do
|
||||
PREFIX=$WORKDIR/prefix_${arch}
|
||||
TOOLCHAIN=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64
|
||||
PATH="${TOOLCHAIN}/bin:${ORIGINAL_PATH}"
|
||||
|
||||
case $arch in
|
||||
"aarch") CLANG=armv7a-linux-androideabi${API}-clang
|
||||
CXXLANG=armv7a-linux-androideabi${API}-clang++
|
||||
X_ARCH="android-arm";;
|
||||
"aarch64") CLANG=${arch}-linux-android${API}-clang
|
||||
CXXLANG=${arch}-linux-android${API}-clang++
|
||||
X_ARCH="android-arm64";;
|
||||
"i686") CLANG=${arch}-linux-android${API}-clang
|
||||
CXXLANG=${arch}-linux-android${API}-clang++
|
||||
X_ARCH="android-x86";;
|
||||
"x86_64") CLANG=${arch}-linux-android${API}-clang
|
||||
CXXLANG=${arch}-linux-android${API}-clang++
|
||||
X_ARCH="android-x86_64";;
|
||||
*) CLANG=${arch}-linux-android${API}-clang
|
||||
CXXLANG=${arch}-linux-android${API}-clang++
|
||||
X_ARCH="android-${arch}";;
|
||||
"aarch") X_ARCH="android-arm";;
|
||||
"aarch64") X_ARCH="android-arm64";;
|
||||
"i686") X_ARCH="android-x86";;
|
||||
"x86_64") X_ARCH="android-x86_64";;
|
||||
*) X_ARCH="android-${arch}";;
|
||||
esac
|
||||
|
||||
cd $WORKDIR
|
||||
rm -rf $OPENSSL_SRC_DIR
|
||||
tar -xzf $OPENSSL_FILE_PATH -C $WORKDIR
|
||||
cd $OPENSSL_SRC_DIR
|
||||
./Configure CC=${CLANG} CXX=${CXXLANG} ${X_ARCH} \
|
||||
no-asm no-shared --static \
|
||||
|
||||
sed -i -e "s/mandroid/target\ ${TARGET}\-linux\-android/" Configure
|
||||
CC=clang ANDROID_NDK=$TOOLCHAIN \
|
||||
./Configure ${X_ARCH} \
|
||||
no-asm no-shared \
|
||||
--with-zlib-include=${PREFIX}/include \
|
||||
--with-zlib-lib=${PREFIX}/lib \
|
||||
--prefix=${PREFIX} \
|
||||
--openssldir=${PREFIX} \
|
||||
-D__ANDROID_API__=$API
|
||||
sed -i 's/CNF_EX_LIBS=-ldl -pthread//g;s/BIN_CFLAGS=-pie $(CNF_CFLAGS) $(CFLAGS)//g' Makefile
|
||||
-D__ANDROID_API__=$API
|
||||
make -j4
|
||||
make install
|
||||
|
||||
|
|
|
@ -8,18 +8,13 @@ for arch in "aarch" "aarch64" "i686" "x86_64"
|
|||
do
|
||||
|
||||
PREFIX=${WORKDIR}/prefix_${arch}
|
||||
PATH="${TOOLCHAIN_BASE_DIR}_${arch}/bin:${ORIGINAL_PATH}"
|
||||
|
||||
case $arch in
|
||||
"aarch" ) TARGET="arm"
|
||||
CC=armv7a-linux-androideabi${API}-clang
|
||||
CXX=armv7a-linux-androideabi${API}-clang++;;
|
||||
"i686" ) TARGET="x86"
|
||||
CC=${arch}-linux-android${API}-clang
|
||||
CXX=${arch}-linux-android${API}-clang++;;
|
||||
* ) TARGET="${arch}"
|
||||
CC=${arch}-linux-android${API}-clang
|
||||
CXX=${arch}-linux-android${API}-clang++;;
|
||||
esac
|
||||
"aarch" ) TARGET="arm";;
|
||||
"i686" ) TARGET="x86";;
|
||||
* ) TARGET="${arch}";;
|
||||
esac
|
||||
|
||||
HOST="${TARGET}-linux-android"
|
||||
cd $WORKDIR
|
||||
|
@ -27,7 +22,7 @@ rm -rf $SODIUM_SRC_DIR
|
|||
git clone https://github.com/jedisct1/libsodium.git $SODIUM_SRC_DIR -b $SODIUM_BRANCH
|
||||
cd $SODIUM_SRC_DIR
|
||||
./autogen.sh
|
||||
./configure --prefix=${PREFIX} --host=${HOST} --enable-static --disable-shared
|
||||
CC=clang CXX=clang++ ./configure --prefix=${PREFIX} --host=${HOST} --enable-static --disable-shared
|
||||
make
|
||||
make install
|
||||
|
||||
|
|
|
@ -9,17 +9,12 @@ for arch in "aarch" "aarch64" "i686" "x86_64"
|
|||
do
|
||||
|
||||
PREFIX=$WORKDIR/prefix_${arch}
|
||||
PATH="${TOOLCHAIN_BASE_DIR}_${arch}/bin:${ORIGINAL_PATH}"
|
||||
|
||||
case $arch in
|
||||
"aarch" ) TARGET="arm"
|
||||
ANDROID_CLANG=armv7a-linux-androideabi${API}-clang
|
||||
ANDROID_CLANGPP=armv7a-linux-androideabi${API}-clang++;;
|
||||
"i686" ) TARGET="x86"
|
||||
ANDROID_CLANG=${arch}-linux-android${API}-clang
|
||||
ANDROID_CLANGPP=${arch}-linux-android${API}-clang++;;
|
||||
* ) TARGET="${arch}"
|
||||
ANDROID_CLANG=${arch}-linux-android${API}-clang
|
||||
ANDROID_CLANGPP=${arch}-linux-android${API}-clang++;;
|
||||
"aarch" ) TARGET="arm";;
|
||||
"i686" ) TARGET="x86";;
|
||||
* ) TARGET="${arch}";;
|
||||
esac
|
||||
|
||||
|
||||
|
@ -30,7 +25,7 @@ git clone https://github.com/zeromq/libzmq.git ${ZMQ_SRC_DIR} -b ${ZMQ_BRANCH}
|
|||
cd $ZMQ_SRC_DIR
|
||||
git checkout ${ZMQ_COMMIT_HASH}
|
||||
./autogen.sh
|
||||
CC=${ANDROID_CLANG} CXX=${ANDROID_CLANGPP} ./configure --prefix=${PREFIX} --host=${HOST} --enable-static --disable-shared
|
||||
CC=clang CXX=clang++ ./configure --prefix=${PREFIX} --host=${HOST} --enable-static --disable-shared
|
||||
make
|
||||
make install
|
||||
|
||||
|
|
|
@ -2,12 +2,9 @@
|
|||
|
||||
export API=21
|
||||
export WORKDIR=/opt/android
|
||||
export ANDROID_NDK_ZIP=${WORKDIR}/android-ndk-r20b.zip
|
||||
export ANDROID_NDK_ROOT=${WORKDIR}/android-ndk-r20b
|
||||
export ANDROID_NDK_ZIP=${WORKDIR}/android-ndk-r17c.zip
|
||||
export ANDROID_NDK_ROOT=${WORKDIR}/android-ndk-r17c
|
||||
export ANDROID_NDK_HOME=$ANDROID_NDK_ROOT
|
||||
export TOOLCHAIN_DIR="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64"
|
||||
|
||||
case :${PATH:=${TOOLCHAIN_DIR}/bin}: in
|
||||
(*:"${TOOLCHAIN_DIR}/bin":*) ;; (*)
|
||||
export PATH=${TOOLCHAIN_DIR}/bin:$PATH
|
||||
esac;
|
||||
export TOOLCHAIN_DIR="${WORKDIR}/toolchain"
|
||||
export TOOLCHAIN_BASE_DIR=$TOOLCHAIN_DIR
|
||||
export ORIGINAL_PATH=$PATH
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./config.sh
|
||||
ANDROID_NDK_SHA256="8381c440fe61fcbb01e209211ac01b519cd6adf51ab1c2281d5daad6ca4c8c8c"
|
||||
ANDROID_NDK_SHA256="3f541adbd0330a9205ba12697f6d04ec90752c53d6b622101a2a8a856e816589"
|
||||
|
||||
curl https://dl.google.com/android/repository/android-ndk-r20b-linux-x86_64.zip -o ${ANDROID_NDK_ZIP}
|
||||
curl https://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip -o ${ANDROID_NDK_ZIP}
|
||||
echo $ANDROID_NDK_SHA256 $ANDROID_NDK_ZIP | sha256sum -c || exit 1
|
||||
unzip /opt/android/android-ndk-r20b.zip -d $WORKDIR
|
||||
unzip /opt/android/android-ndk-r17c.zip -d $WORKDIR
|
||||
|
|
Loading…
Reference in a new issue