aboutsummaryrefslogtreecommitdiff
path: root/BUILDING.txt
diff options
context:
space:
mode:
authordcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db>2014-05-06 21:03:35 +0000
committerdcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db>2014-05-06 21:03:35 +0000
commit8fcd1b936e7f54fdf85af3ab793ff42b79b63225 (patch)
treeec2b95332c0d070e801bb73a724d1d1a4ba4a449 /BUILDING.txt
parent63c827f88443bf0d263432090f0dc913ccbbec7e (diff)
Replace our custom version of Android.mk with instructions on how to build a libjpeg-turbo SDK for Android using autotools. Upon consulting with AOSP, it appears that Android.mk isn't really necessary except when building libjpeg-turbo for use by the Android platform itself, and it makes more sense for them to maintain the makefile for that purpose rather than for it to be upstreamed. ndk-build has serious limitations that prevent it from being used to generate static libjpeg-turbo libraries (mainly, it isn't possible to combine pre-built objects from one module into a static library for another module, which is necessary because the SIMD extensions sometimes have to be built with different CFLAGS than the rest of the code.) In general, it's just better not to introduce a new build system.
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1272 632fc199-4ca6-4c93-a231-07263d6284db
Diffstat (limited to 'BUILDING.txt')
-rw-r--r--BUILDING.txt41
1 files changed, 40 insertions, 1 deletions
diff --git a/BUILDING.txt b/BUILDING.txt
index d40c270..13835a1 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -319,7 +319,7 @@ This release of libjpeg-turbo can use ARM NEON SIMD instructions to accelerate
JPEG compression/decompression by approximately 2-4x on ARMv7 and later
platforms. If libjpeg-turbo is configured on an ARM Linux platform, then the
build system will automatically include the NEON SIMD routines, if they are
-supported.
+supported. Build instructions for other ARM-based platforms follow.
Building libjpeg-turbo for iOS
@@ -393,6 +393,45 @@ described above. Otherwise, you may get a libtool error such as "unable to
infer tagged configuration."
+Building libjpeg-turbo for Android
+----------------------------------
+
+Building libjpeg-turbo for Android platforms requires the Android NDK
+(https://developer.android.com/tools/sdk/ndk) and autotools. The following is
+a general recipe script that can be modified for your specific needs.
+
+ # Set these variables to suit your needs
+ NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/ndk}
+ BUILD_PLATFORM={the platform name for the NDK package you installed--
+ for example, "windows-x86" or "linux-x86_64"}
+ TOOLCHAIN_VERSION={"4.6", "4.8", etc. This corresponds to a toolchain
+ directory under ${NDK_PATH}/toolchains/.}
+ ANDROID_VERSION={The minimum version of Android to support-- for example,
+ "9", "19", etc.}
+
+ HOST=arm-linux-androideabi
+ TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}
+ SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm
+ ANDROID_INCLUDES="-I${SYSROOT}/usr/include -I${TOOLCHAIN}/include"
+ ANDROID_CFLAGS="-march=armv7-a -mfloat-abi=softfp -fprefetch-loop-arrays \
+ -fstrict-aliasing --sysroot=${SYSROOT}"
+ export CPP=${TOOLCHAIN}/bin/${HOST}-cpp
+ export AR=${TOOLCHAIN}/bin/${HOST}-ar
+ export AS=${TOOLCHAIN}/bin/${HOST}-as
+ export NM=${TOOLCHAIN}/bin/${HOST}-nm
+ export CC=${TOOLCHAIN}/bin/${HOST}-gcc
+ export LD=${TOOLCHAIN}/bin/${HOST}-ld
+ export RANLIB=${TOOLCHAIN}/bin/${HOST}-ranlib
+ export OBJDUMP=${TOOLCHAIN}/bin/${HOST}-objdump
+ export STRIP=${TOOLCHAIN}/bin/${HOST}-strip
+ cd {build_directory}
+ sh {source_directory}/configure --host=${HOST} \
+ CFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS} -O3" \
+ CPPFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS}" \
+ LDFLAGS="${ANDROID_CFLAGS}" --with-simd ${1+"$@"}
+ make
+
+
*******************************************************************************
** Building on Windows (Visual C++ or MinGW)
*******************************************************************************