This bash script builds libjepg static library with NDK for Android. This script makes "libjpeg.a", "libturbojpeg.a", and include files which are compatible with Android architectures, including arm64-v8a, armeabi-v7a, x86, and x86_64.
This script is based on the following repository: ibjpeg-turbo
git clone https://github.com/nekomimimi/libpng_for_android.git
git clone https://github.com/libjpeg-turbo/libjpeg-turbo.git -b 3.0.2
For example:
export NDK=/Users/your_id/Library/Android/sdk/ndk/26.2.11394342
export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64
export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/windows-x86_64
export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/darwin-x86_64
export API=21
./build.sh
This repository is not well-tested, so please thoroughly test it before using.