]> granicus.if.org Git - libjpeg-turbo/commitdiff
BUILDING.md: Adjust Android recipes for NDK r16+
authorDRC <information@libjpeg-turbo.org>
Fri, 15 Dec 2017 22:45:25 +0000 (16:45 -0600)
committerDRC <information@libjpeg-turbo.org>
Fri, 15 Dec 2017 22:53:25 +0000 (16:53 -0600)
NDK r16b moved some things around, so modify the Android build recipes
to take that into account while preserving compatibility with previous
NDK releases.

NOTE: the GCC 4.9 NDK toolchain is deprecated, so we will need to
develop new Android build recipes for libjpeg-turbo 1.6 that use the
Clang toolchain.

Closes #196

BUILDING.md

index 2725f30a4ccf1162535fc837e732efbded09f40c..42aadf28058b6fe3c8ee0c91016ab7fc01152c61 100644 (file)
@@ -388,7 +388,9 @@ needs.
     HOST=arm-linux-androideabi
     SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm
     ANDROID_CFLAGS="-march=armv7-a -mfloat-abi=softfp -fprefetch-loop-arrays \
-      --sysroot=${SYSROOT}"
+      -D__ANDROID_API__=${ANDROID_VERSION} --sysroot=${SYSROOT} \
+      -isystem ${NDK_PATH}/sysroot/usr/include \
+      -isystem ${NDK_PATH}/sysroot/usr/include/${HOST}"
 
     TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}
     export CPP=${TOOLCHAIN}/bin/${HOST}-cpp
@@ -424,7 +426,9 @@ needs.
     # It should not be necessary to modify the rest
     HOST=aarch64-linux-android
     SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm64
-    ANDROID_CFLAGS="--sysroot=${SYSROOT}"
+    ANDROID_CFLAGS="-D__ANDROID_API__=${ANDROID_VERSION} --sysroot=${SYSROOT} \
+      -isystem ${NDK_PATH}/sysroot/usr/include \
+      -isystem ${NDK_PATH}/sysroot/usr/include/${HOST}"
 
     TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}
     export CPP=${TOOLCHAIN}/bin/${HOST}-cpp
@@ -460,7 +464,9 @@ needs.
     # It should not be necessary to modify the rest
     HOST=i686-linux-android
     SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-x86
-    ANDROID_CFLAGS="--sysroot=${SYSROOT}"
+    ANDROID_CFLAGS="-D__ANDROID_API__=${ANDROID_VERSION} --sysroot=${SYSROOT} \
+      -isystem ${NDK_PATH}/sysroot/usr/include \
+      -isystem ${NDK_PATH}/sysroot/usr/include/${HOST}"
 
     TOOLCHAIN=${NDK_PATH}/toolchains/x86-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}
     export CPP=${TOOLCHAIN}/bin/${HOST}-cpp
@@ -496,7 +502,9 @@ needs.
     # It should not be necessary to modify the rest
     HOST=x86_64-linux-android
     SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-x86_64
-    ANDROID_CFLAGS="--sysroot=${SYSROOT}"
+    ANDROID_CFLAGS="-D__ANDROID_API__=${ANDROID_VERSION} --sysroot=${SYSROOT} \
+      -isystem ${NDK_PATH}/sysroot/usr/include \
+      -isystem ${NDK_PATH}/sysroot/usr/include/${HOST}"
 
     TOOLCHAIN=${NDK_PATH}/toolchains/x86_64-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}
     export CPP=${TOOLCHAIN}/bin/${HOST}-cpp