commit adb9a193672fa7970969a5fae44ca40cd78bf3f0 Author: أحمد المحمودي (Ahmed El-Mahmoudy) aelmahmoudy@users.sourceforge.net Date: Mon Apr 27 17:58:57 2015 +0200
Add support for variable arch builds to support mips & 64-bit archs --- external/Makefile | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-)
diff --git a/external/Makefile b/external/Makefile index b9cd735..9a31f4f 100644 --- a/external/Makefile +++ b/external/Makefile @@ -24,17 +24,37 @@ endif # Android NDK setup NDK_BASE ?= /opt/android-ndk NDK_PLATFORM_LEVEL ?= 16 -NDK_ABI ?= arm NDK_TOOLCHAIN_VERSION=4.8 APP_ABI ?= armeabi + +NDK_ABI := $(APP_ABI) +ifneq ($(filter arm%, $(APP_ABI)),) + NDK_ABI := arm +endif +ifneq ($(filter arm64%, $(APP_ABI)),) + NDK_ABI := arm64 +endif NDK_SYSROOT=$(NDK_BASE)/platforms/android-$(NDK_PLATFORM_LEVEL)/arch-$(NDK_ABI) NDK_UNAME := $(shell uname -s | tr '[A-Z]' '[a-z]') -ifeq ($(NDK_ABI),x86) - HOST = i686-linux-android - NDK_TOOLCHAIN = $(NDK_ABI)-$(NDK_TOOLCHAIN_VERSION) -else - HOST = $(NDK_ABI)-linux-androideabi - NDK_TOOLCHAIN = $(HOST)-$(NDK_TOOLCHAIN_VERSION) +ifneq ($(filter mips%, $(NDK_ABI)),) + HOST := $(NDK_ABI)el-linux-android +endif +ifneq ($(filter arm64, $(NDK_ABI)),) + HOST := aarch64-linux-android +endif +ifneq ($(filter arm, $(NDK_ABI)),) + HOST := arm-linux-androideabi +endif +ifneq ($(filter x86, $(NDK_ABI)),) + HOST := i686-linux-android +endif +ifneq ($(filter x86_64, $(NDK_ABI)),) + HOST := x86_64-linux-android +endif + +NDK_TOOLCHAIN := $(HOST)-$(NDK_TOOLCHAIN_VERSION) +ifneq ($(filter x86%, $(NDK_ABI)),) + NDK_TOOLCHAIN := $(NDK_ABI)-$(NDK_TOOLCHAIN_VERSION) endif NDK_TOOLCHAIN_BASE=$(NDK_BASE)/toolchains/$(NDK_TOOLCHAIN)/prebuilt/$(NDK_UNAME)-$(NDK_PROCESSOR)
tor-commits@lists.torproject.org