Index: Makefile.android |
diff --git a/Makefile.android b/Makefile.android |
index c49cb85b9b6514d70280d184248a031cf8e4a448..51e4570e7a7ddd75537994d33c924b8e950635f3 100644 |
--- a/Makefile.android |
+++ b/Makefile.android |
@@ -35,18 +35,27 @@ MODES = release debug |
ANDROID_BUILDS = $(foreach mode,$(MODES), \ |
$(addsuffix .$(mode),$(ANDROID_ARCHES))) |
+HOST_OS = $(shell uname -s | sed -e 's/Linux/linux/;s/Darwin/darwin/') |
+HOST_ARCH = $(shell uname -m | sed -e 's/i[3456]86/x86/') |
+ |
ifeq ($(ARCH), android_arm) |
DEFINES = target_arch=arm v8_target_arch=arm |
+ ANDROID_TOOLCHAIN = $(ANDROID_NDK_ROOT)/toolchains/arm-linux-androideabi-4.9/prebuilt/$(HOST_OS)-$(HOST_ARCH)/arm-linux-androideabi/bin |
else ifeq ($(ARCH), android_arm64) |
DEFINES = target_arch=arm64 v8_target_arch=arm64 |
+ ANDROID_TOOLCHAIN = $(ANDROID_NDK_ROOT)/toolchains/aarch64-linux-android-4.9/prebuilt/$(HOST_OS)-$(HOST_ARCH)/aarch64-linux-android/bin |
else ifeq ($(ARCH), android_mipsel) |
DEFINES = target_arch=mipsel v8_target_arch=mipsel |
+ ANDROID_TOOLCHAIN = $(ANDROID_NDK_ROOT)/toolchains/mipsel-linux-android-4.9/prebuilt/$(HOST_OS)-$(HOST_ARCH)/mipsel-linux-android/bin |
else ifeq ($(ARCH), android_ia32) |
DEFINES = target_arch=ia32 v8_target_arch=ia32 |
+ ANDROID_TOOLCHAIN = $(ANDROID_NDK_ROOT)/toolchains/x86-4.9/prebuilt/$(HOST_OS)-$(HOST_ARCH)/i686-linux-android/bin |
else ifeq ($(ARCH), android_x64) |
DEFINES = target_arch=x64 v8_target_arch=x64 |
+ ANDROID_TOOLCHAIN = $(ANDROID_NDK_ROOT)/toolchains/x86_64-4.9/prebuilt/$(HOST_OS)-$(HOST_ARCH)/x86_64-linux-android/bin |
else ifeq ($(ARCH), android_x87) |
DEFINES = target_arch=ia32 v8_target_arch=x87 |
+ ANDROID_TOOLCHAIN = $(ANDROID_NDK_ROOT)/toolchains/x86-4.9/prebuilt/$(HOST_OS)-$(HOST_ARCH)/i686-linux-android/bin |
else |
$(error Target architecture "${ARCH}" is not supported) |
endif |
@@ -57,6 +66,7 @@ DEFINES += OS=android |
.SECONDEXPANSION: |
$(ANDROID_BUILDS): $(OUTDIR)/Makefile.$$@ |
@$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \ |
+ AR="$(ANDROID_TOOLCHAIN)/ar" \ |
BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ |
python -c "print raw_input().capitalize()") \ |
builddir="$(shell pwd)/$(OUTDIR)/$@" |