diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2012-10-09 23:45:50 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2012-10-09 23:45:50 +0000 |
commit | 0cd1fc71c3cbfa2a3537c93ad2c164f1312d83a0 (patch) | |
tree | 7f6bf8212c68e4afe54925df3fee89cbedc64a10 | |
parent | 515e05344b5443bd7b5a7e03e7ff034e0743c641 (diff) |
support other versions of the Android gcc, as well as other arches (i.e. arm, mipsel, x86...)
svn path=/trunk/externals/template/; revision=16369
-rw-r--r-- | Makefile | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -135,22 +135,25 @@ endif ifeq ($(UNAME),ANDROID) CPU := arm SOURCES += $(SOURCES_android) - EXTENSION = pd_linux + EXTENSION = so SHARED_EXTENSION = so OS = android PD_PATH = /usr NDK_BASE := /usr/local/android-ndk - NDK_PLATFORM_VERSION := 5 - NDK_SYSROOT=$(NDK_BASE)/platforms/android-$(NDK_PLATFORM_VERSION)/arch-arm + NDK_PLATFORM_LEVEL ?= 5 + NDK_ABI=arm + NDK_SYSROOT=$(NDK_BASE)/platforms/android-$(NDK_PLATFORM_LEVEL)/arch-$(NDK_ABI) NDK_UNAME := $(shell uname -s | tr '[A-Z]' '[a-z]') - NDK_TOOLCHAIN_BASE=$(NDK_BASE)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/$(NDK_UNAME)-x86 - CC := $(NDK_TOOLCHAIN_BASE)/bin/arm-linux-androideabi-gcc --sysroot=$(NDK_SYSROOT) + 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) OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer CFLAGS += LDFLAGS += -rdynamic -shared SHARED_LDFLAGS += -Wl,-soname,$(SHARED_LIB) -shared LIBS += -lc $(LIBS_android) - STRIP := $(NDK_TOOLCHAIN_BASE)/bin/arm-linux-androideabi-strip \ + STRIP := $(wildcard $(NDK_TOOLCHAIN)/bin/$(NDK_ABI)-linux-android*-strip) \ --strip-unneeded -R .note -R .comment DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m) endif @@ -442,3 +445,6 @@ showsetup: @echo "pkglibdir: $(pkglibdir)" @echo "DISTDIR: $(DISTDIR)" @echo "ORIGDIR: $(ORIGDIR)" + @echo "NDK_TOOLCHAIN: $(NDK_TOOLCHAIN)" + @echo "NDK_BASE: $(NDK_BASE)" + @echo "NDK_SYSROOT: $(NDK_SYSROOT)" |