cake_wallet/scripts/android/build_sodium.sh

31 lines
633 B
Bash
Raw Normal View History

2021-08-31 09:27:30 +00:00
#!/bin/sh
2021-03-16 18:18:54 +00:00
2021-08-31 09:27:30 +00:00
. ./config.sh
2021-03-16 18:18:54 +00:00
SODIUM_SRC_DIR=${WORKDIR}/libsodium
SODIUM_BRANCH=1.0.16
for arch in "aarch" "aarch64" "i686" "x86_64"
do
2021-08-31 09:27:30 +00:00
PREFIX=${WORKDIR}/prefix_${arch}
2021-12-29 20:12:54 +00:00
PATH="${TOOLCHAIN_BASE_DIR}_${arch}/bin:${ORIGINAL_PATH}"
2021-03-16 18:18:54 +00:00
case $arch in
2021-12-29 20:12:54 +00:00
"aarch" ) TARGET="arm";;
"i686" ) TARGET="x86";;
* ) TARGET="${arch}";;
esac
2021-03-16 18:18:54 +00:00
HOST="${TARGET}-linux-android"
cd $WORKDIR
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
2021-12-29 20:12:54 +00:00
CC=clang CXX=clang++ ./configure --prefix=${PREFIX} --host=${HOST} --enable-static --disable-shared
2021-03-16 18:18:54 +00:00
make
make install
done
2021-08-31 09:27:30 +00:00