Compile bzip2 for Android?

520 Views Asked by At

I'm trying to crosscompile Kenlm for Android from ubuntu 18.04. To do that i need to compile all its dependecies first. I succeeded in compiling boost for android but I don't find how to do that whith bzip2.

When I use cmake to cross compile kenlm, with this toolchain.cmake

set(CMAKE_SYSTEM_NAME Android)
set(CMAKE_SYSTEM_VERSION 26)
set(CMAKE_ANDROID_ARCH_ABI arm64-v8a)
set(CMAKE_ANDROID_NDK "/home/marie/Android/Sdk/ndk/16.1.4479499")
set(ZLIB_LIBRARIES "/home/marie/Android/Sdk/ndk/16.1.4479499/platforms/android-26/arch-arm64/usr/lib")
set(BOOST_LIBRARYDIR "/home/marie/Documents/Boost-for-Android/boost_1_73_0/stage/lib")
set(BOOST_INCLUDEDIR "/home/marie/Documents/Boost-for-Android/boost_1_73_0")
set(LIBLZMA_LIBRARY "/home/marie/Downloads/liblzma.a")
set(LIBLZMA_HAS_AUTO_DECODER TRUE)
set(LIBLZMA_HAS_EASY_ENCODER TRUE)
set(LIBLZMA_HAS_LZMA_PRESET TRUE)

I can see this :

Found BZip2: /usr/local/lib/libbz2.a (found version "1.0.6") 
Looking for BZ2_bzCompressInit
Looking for BZ2_bzCompressInit - not found

I tried compiling from github : https://github.com/enthought/bzip2-1.0.6, but I dont know how to compile a Makefile for another target. The Readme of this repo says

HOW TO BUILD -- Windows 95, NT, DOS, Mac, etc.

It's difficult for me to support compilation on all these platforms.
My approach is to collect binaries for these platforms, and put them
on the master web site (http://www.bzip.org).

Bzip.org link to sourceforge, but there is only one file to download which is a tar.gz.

Thanks for your time.

1

There are 1 best solutions below

1
On

Maybe this one can help (compiling bzip2 in example).