summaryrefslogtreecommitdiffstats
path: root/packaging/android
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-06-21 21:12:19 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-06-21 21:19:23 -0700
commit05435d64aa3a019c3a3d05ca6a112b44daf5195d (patch)
treefc107db23f38df06eb2493e7a9bf27f66b76ea24 /packaging/android
parentf0c903203f9d1b5daeed17424c0ef1326e2fe1b1 (diff)
downloadsubsurface-05435d64aa3a019c3a3d05ca6a112b44daf5195d.tar.gz
Android build: work around odd build problem with missing rand()
I don't quite understand why this isn't correctly substituted to lrand48() by the header file, but patching it in the source is easy enough. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'packaging/android')
-rwxr-xr-xpackaging/android/build.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/packaging/android/build.sh b/packaging/android/build.sh
index c08d8b5f3..06e7d5e02 100755
--- a/packaging/android/build.sh
+++ b/packaging/android/build.sh
@@ -243,6 +243,9 @@ fi
if [ ! -e "$PKG_CONFIG_LIBDIR/libgit2.pc" ] ; then
# We don't want to find the HTTP_Parser package of the build host by mistake
perl -pi -e 's/FIND_PACKAGE\(HTTP_Parser\)/#FIND_PACKAGE(HTTP_Parser)/' libgit2-${LIBGIT2_VERSION}/CMakeLists.txt
+ # also, with libgit-0.25.1 and ndk-14b we see an odd build failure with a missing rand() symbol
+ # trivial workaround is to just call lrand48()
+ perl -pi -e 's/seed = rand/seed = (int)lrand48/' libgit2-${LIBGIT2_VERSION}/src/cache.c
mkdir -p libgit2-build-"$ARCH"
pushd libgit2-build-"$ARCH"
cmake -DCMAKE_SYSTEM_NAME=Android -DSHA1_TYPE=builtin \