我已经从https://github.com/libjpeg-turbo/libjpeg-turbo/下载了libjpeg-turbo库,并在Ubuntu 16.04中执行了以下CMake命令:
$ cd {path of my libjpeg-turbo library}
$ cmake -G"Unix Makefiles" {path of my libjpeg-turbo library}
$ make
然后生成了libjpeg.a, libjpeg.so, libjpeg.so.62, libjpeg.so.62.3.0, libjpegturbo.a, libjpegturbo.so, libjpegturbo.so.0, libjpegturbo.so.0.2.0
等
现在,我正在尝试为不同的CPU架构生成libjpeg-turbo.so文件。
对于arm64-v8a:
$ cd {path of my libjpeg-turbo library}
$ cmake -G"Unix Makefiles" \
-DANDROID_ABI=arm64-v8a \
-DANDROID_ARM_MODE=arm \
-DANDROID_PLATFORM=android-${21} \
-DANDROID_TOOLCHAIN=${gcc} \
-DCMAKE_ASM_FLAGS="--target=aarch64-linux-android${21}" \
-DCMAKE_TOOLCHAIN_FILE=${path of my ndk library}/build/cmake/android.toolchain.cmake \
{path of my libjpeg-turbo library}
输出:
-- CMAKE_BUILD_TYPE = Release
-- VERSION = 2.0.3, BUILD = 20190703
-- 64-bit build (x86_64)
-- CMAKE_INSTALL_PREFIX = /opt/libjpeg-turbo
-- CMAKE_INSTALL_BINDIR = bin (/opt/libjpeg-turbo/bin)
-- CMAKE_INSTALL_DATAROOTDIR = (/opt/libjpeg-turbo)
-- CMAKE_INSTALL_DOCDIR = doc (/opt/libjpeg-turbo/doc)
-- CMAKE_INSTALL_INCLUDEDIR = include (/opt/libjpeg-turbo/include)
-- CMAKE_INSTALL_LIBDIR = lib64 (/opt/libjpeg-turbo/lib64)
-- CMAKE_INSTALL_MANDIR = man (/opt/libjpeg-turbo/man)
-- Shared libraries enabled (ENABLE_SHARED = 1)
-- Static libraries enabled (ENABLE_STATIC = 1)
-- 12-bit JPEG support disabled (WITH_12BIT = 0)
-- Arithmetic decoding support enabled (WITH_ARITH_DEC = 1)
-- Arithmetic encoding support enabled (WITH_ARITH_ENC = 1)
-- TurboJPEG API library enabled (WITH_TURBOJPEG = 1)
-- TurboJPEG Java wrapper disabled (WITH_JAVA = 0)
-- In-memory source/destination managers enabled (WITH_MEM_SRCDST = 1)
-- Emulating libjpeg API/ABI v6.2 (WITH_JPEG7 = 0, WITH_JPEG8 = 0)
-- libjpeg API shared library version = 62.3.0
-- Compiler flags = -O3 -DNDEBUG
-- Linker flags =
-- Compiler supports pointers to undefined structures.
-- INLINE = __inline__ __attribute__((always_inline)) (FORCE_INLINE = 1)
-- Linker supports GNU-style version scripts
-- CMAKE_EXECUTABLE_SUFFIX =
-- CMAKE_ASM_NASM_COMPILER = /usr/bin/nasm
-- CMAKE_ASM_NASM_OBJECT_FORMAT = elf64
-- CMAKE_ASM_NASM_FLAGS = -DELF -D__x86_64__ -DPIC
-- SIMD extensions: x86_64 (WITH_SIMD = 1)
-- FLOATTEST = sse
-- RPM architecture = x86_64, DEB architecture = amd64
-- Configuring done
-- Generating done
-- Build files have been written to: {path of my libjpeg-turbo library}
$ make
输出:
[ 8%] Built target simd
[ 26%] Built target turbojpeg
[ 27%] Built target tjexample
[ 46%] Built target turbojpeg-static
[ 48%] Built target tjunittest-static
[ 64%] Built target jpeg-static
[ 65%] Built target wrjpgcom
[ 68%] Built target djpeg-static
[ 69%] Built target tjbench
[ 71%] Built target cjpeg-static
[ 72%] Built target tjunittest
[ 74%] Built target jpegtran-static
[ 75%] Built target rdjpgcom
[ 76%] Built target tjbench-static
[ 92%] Built target jpeg
[ 93%] Built target jpegtran
[ 96%] Built target djpeg
[ 97%] Built target jcstest
[ 99%] Built target cjpeg
[100%] Built target md5cmp
类似地,当我为armeabi-v7a架构执行时,也会得到类似的输出。
即使打印了以下三个语句,我也没有获得用于不同体系结构的.so文件:
-- Configuring done
-- Generating done
-- Build files have been written to: {path to my libjpeg-turbo library}
能否让我知道如何为arm64-v8a,armeabi-v7a和armeabi档案生成libjpeg-turbo.so文件?
谢谢。