Skip to content

Commit

Permalink
BUILDING.md: Adjust Android recipes for NDK r16+
Browse files Browse the repository at this point in the history
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 libjpeg-turbo#196
  • Loading branch information
dcommander committed Dec 15, 2017
1 parent bf6c774 commit 7d3feda
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7d3feda

Please sign in to comment.