aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile21
1 files changed, 14 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 036b29a..0d5b73e 100644
--- a/Makefile
+++ b/Makefile
@@ -139,21 +139,28 @@ ifeq ($(UNAME),ANDROID)
SHARED_EXTENSION = so
OS = android
PD_PATH = /usr
- NDK_BASE := /usr/local/android-ndk
+ NDK_BASE := /opt/android-ndk
NDK_PLATFORM_LEVEL ?= 5
NDK_ABI=arm
+ NDK_COMPILER_VERSION = 4.6
NDK_SYSROOT=$(NDK_BASE)/platforms/android-$(NDK_PLATFORM_LEVEL)/arch-$(NDK_ABI)
- NDK_UNAME := $(shell uname -s | tr '[A-Z]' '[a-z]')
- NDK_COMPILER_VERSION=4.6
- NDK_TOOLCHAIN=$(wildcard \
- $(NDK_BASE)/toolchains/$(NDK_ABI)*-$(NDK_COMPILER_VERSION)/prebuilt/$(NDK_UNAME)-x86)
- CC := $(wildcard $(NDK_TOOLCHAIN)/bin/*-linux-android*-gcc) --sysroot=$(NDK_SYSROOT)
+ NDK_UNAME:=$(shell uname -s | tr '[A-Z]' '[a-z]')
+ ifeq ($(NDK_ABI),x86)
+ HOST = i686-linux-android
+ NDK_TOOLCHAIN = $(NDK_ABI)-$(NDK_COMPILER_VERSION)
+ else
+ HOST = $(NDK_ABI)-linux-androideabi
+ NDK_TOOLCHAIN = $(HOST)-$(NDK_COMPILER_VERSION)
+ endif
+ NDK_TOOLCHAIN_BASE=$(NDK_BASE)/toolchains/$(NDK_TOOLCHAIN)/prebuilt/$(NDK_UNAME)-$(NDK_PROCESSOR)
+ CC := $(NDK_TOOLCHAIN_BASE)/bin/$(HOST)-gcc --sysroot=$(NDK_SYSROOT)
+ LD := $(NDK_TOOLCHAIN_BASE)/bin/$(HOST)-ld
OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
CFLAGS +=
LDFLAGS += -rdynamic -shared
SHARED_LDFLAGS += -Wl,-soname,$(SHARED_LIB) -shared
LIBS += -lc $(LIBS_android)
- STRIP := $(wildcard $(NDK_TOOLCHAIN)/bin/$(NDK_ABI)-linux-android*-strip) \
+ STRIP := $(NDK_TOOLCHAIN_BASE)/bin/$(HOST)-strip) \
--strip-unneeded -R .note -R .comment
DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
endif