Add locks in android-build.sh scripts

This commit is contained in:
Matéo Duparc 2024-02-13 20:40:12 +01:00
parent 6388eaf433
commit c2e15be908
Signed by: hardcoresushi
GPG Key ID: AFE384344A45E13A
3 changed files with 22 additions and 11 deletions

@ -1 +1 @@
Subproject commit c6012c576e30ff6000ddab0988d59bad849200ce
Subproject commit 83ba7174dea6e0595085dc30051eb17747e7260a

View File

@ -1,19 +1,25 @@
#!/bin/sh
set -e
if [ $(find build/$2/lib -name libboost_*.a 2>/dev/null |wc -l) -eq 10 ]; then
echo "boost already built for $2";
exit 0
fi
mkdir -p build && rm -rf build/$2 && cd Boost-for-Android || exit 1
exec 9>/var/tmp/libcryfs-boost.lock
flock 9
mkdir -p build && rm -rf build/$2 && cd Boost-for-Android
BOOST_TAR=boost_1_77_0.tar.bz2
if [ ! -f $BOOST_TAR ]; then
wget -O $BOOST_TAR https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2 || exit 1
wget -O $BOOST_TAR https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2
fi
sha256sum -c ../checksum.txt
sha256sum -c ../checksum.txt && \
./build-android.sh --boost=1.77.0 --arch=$2 --target-version=21 \
--with-libraries=atomic,chrono,container,date_time,exception,filesystem,serialization,system,thread \
$1 && \
$1
mv build/out/$2 ../build

View File

@ -1,14 +1,19 @@
#!/usr/bin/env bash
set -e
if [ -f "vendor_cryptopp/build/$2/libcryptopp.a" ]; then
echo "Crypto++ already built for $2";
exit 0;
fi
export ANDROID_NDK_ROOT=$1 && \
cd vendor_cryptopp && \
make clean && \
mkdir -p build/$2 && \
source TestScripts/setenv-android.sh 21 $2 && \
make -f GNUmakefile-cross static && \
exec 9>/var/tmp/libcryfs-cryptopp.lock
flock 9
export ANDROID_NDK_ROOT=$1
cd vendor_cryptopp
make clean
mkdir -p build/$2
source TestScripts/setenv-android.sh 21 $2
make -f GNUmakefile-cross static
mv libcryptopp.a build/$2