android-build: Remove old libgit2 special handling

And replace it with something that works on a modern cmake.

The upside with using the right linker, we get the symbols resolved
correctly so we don't need to regex the code.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
This commit is contained in:
Anton Lundin 2018-05-14 23:24:13 +02:00 committed by Dirk Hohndel
parent 75205240df
commit a2065334bb

View file

@ -297,12 +297,11 @@ fi
if [ ! -e "$PKG_CONFIG_LIBDIR/libgit2.pc" ] ; then if [ ! -e "$PKG_CONFIG_LIBDIR/libgit2.pc" ] ; then
# We don't want to find the HTTP_Parser package of the build host by mistake # 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 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" mkdir -p libgit2-build-"$ARCH"
pushd libgit2-build-"$ARCH" pushd libgit2-build-"$ARCH"
cmake -DCMAKE_SYSTEM_NAME=Android -DSHA1_TYPE=builtin \ cmake \
-DCMAKE_C_COMPILER="$CC" \
-DCMAKE_LINKER="$CC" \
-DBUILD_CLAR=OFF -DBUILD_SHARED_LIBS=OFF \ -DBUILD_CLAR=OFF -DBUILD_SHARED_LIBS=OFF \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \ -DCMAKE_INSTALL_PREFIX="$PREFIX" \
-DCURL=OFF \ -DCURL=OFF \