android: use the machine specific NDK instead of always the 32bit variant
authorFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 15 Aug 2014 14:38:49 +0000 (16:38 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 22 Aug 2014 09:41:51 +0000 (11:41 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
make/Makefile.android

index e45c138..b6e2b34 100644 (file)
@@ -93,17 +93,18 @@ UNINSTALL_LIB =     rm -f $(LIBDIR)/$(PLUGIN_FULLNAME); \
                /sbin/ldconfig -n $(LIBDIR)
 
 # Android NDK setup
-HOST = arm-linux-androideabi
 NDK_BASE ?= /opt/android-ndk
 NDK_PLATFORM_LEVEL ?= 4
+NDK_ARCH=$(shell uname -m)
 NDK_ABI=arm
+NDK_ABIDIR=linux-androideabi
 NDK_SYSROOT=$(NDK_BASE)/platforms/android-$(NDK_PLATFORM_LEVEL)/arch-$(NDK_ABI)
 NDK_UNAME=$(shell uname -s | tr '[A-Z]' '[a-z]')
 # if you are using NDK older than r8, you must use 4.4.3:
 #NDK_COMPILER_VERSION=4.4.3
 NDK_COMPILER_VERSION=4.6
-NDK_TOOLCHAIN=$(NDK_BASE)/toolchains/$(NDK_ABI)-linux-androideabi-$(NDK_COMPILER_VERSION)/prebuilt/$(NDK_UNAME)-x86
-CROSS_COMPILE = $(NDK_TOOLCHAIN)/bin/$(HOST)-
+NDK_TOOLCHAIN=$(NDK_BASE)/toolchains/$(NDK_ABI)-$(NDK_ABIDIR)-$(NDK_COMPILER_VERSION)/prebuilt/$(NDK_UNAME)-$(NDK_ARCH)
+CROSS_COMPILE = $(NDK_TOOLCHAIN)/bin/$(NDK_ABI)-$(NDK_ABIDIR)-
 
 CC = $(CROSS_COMPILE)gcc --sysroot="$(NDK_SYSROOT)"
 LD = $(CROSS_COMPILE)ld