Compile bzip2 for Android?

Compile bzip2 for Android?

本文关键字:Android for bzip2 Compile      更新时间:2023-10-16

我正在尝试从ubuntu 18.04交叉编译Kenlm for Android。为此,我需要首先编译它的所有依赖项。我成功地为 android 编译了 boost,但我找不到如何在 bzip2 中做到这一点。

当我使用 cmake交叉编译 kenlm 时,使用此工具链.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)

我可以看到这个:

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

我尝试从 github 编译:https://github.com/enthought/bzip2-1.0.6,但我不知道如何为另一个目标编译 Makefile。 此存储库的自述文件说

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 链接到sourceforge,但只有一个文件可以下载,它是一个tar.gz。

谢谢你的时间。

也许这个可以提供帮助(例如编译bzip2(。