Fixed makefiles

This commit is contained in:
pelya
2011-12-21 12:59:42 +02:00
parent 900c29d979
commit 9361882219
3 changed files with 26 additions and 12 deletions

View File

@@ -7,13 +7,13 @@ endif
NDK_VERSION := $(strip $(patsubst android-ndk-%,%,$(filter android-ndk-%, $(subst /, ,$(dir $(TARGET_CC))))))
#$(info NDK version $(NDK_VERSION)) # This warning puzzles ndk-gdb
ifneq ($(filter r1 r2 r3 r4,$(NDK_VERSION)),)
$(error Your NDK $(NDK_VERSION) is too old, please download NDK r4b, r5c or r6 from http://developer.android.com )
$(error Your NDK $(NDK_VERSION) is too old, please download NDK r4b, r5c or r6 from http://developer.android.com)
endif
ifneq ($(filter r5 r5b,$(NDK_VERSION)),)
$(error Your NDK $(NDK_VERSION) generates invalid code, please use NDK r5c from http://developer.android.com)
endif
ifeq ($(NDK_VERSION)-,-)
$(info Cannot determine NDK version, assuming NDK r5c - please do not rename NDK directory extracted from archive to avoid errors in the future)
$(warning Cannot determine NDK version, assuming NDK r5c - please do not rename NDK directory extracted from archive to avoid errors in the future)
NDK_VERSION := r5c
endif
@@ -21,16 +21,24 @@ ifneq ($(findstring r4-crystax,$(NDK_VERSION)),)
$(info Building with CrystaX r4 toolchain - internal STLPort disabled)
CRYSTAX_TOOLCHAIN := 1
endif
ifneq ($(findstring r6b,$(NDK_VERSION))$(findstring r6-crystax,$(NDK_VERSION))$(findstring r7,$(NDK_VERSION))$(findstring r8,$(NDK_VERSION))$(findstring r9,$(NDK_VERSION)),)
$(info Building with NDK r6b or r7)
ifneq ($(findstring r7,$(NDK_VERSION))$(findstring r8,$(NDK_VERSION))$(findstring r9,$(NDK_VERSION)),)
$(info Building with NDK r7 or newer)
NDK_R7_TOOLCHAIN := 1
endif
ifneq ($(findstring r6b,$(NDK_VERSION))$(findstring r6-crystax,$(NDK_VERSION))$(NDK_R7_TOOLCHAIN),)
$(info Building with NDK r6b)
NDK_R6_TOOLCHAIN := 1
endif
ifneq ($(findstring r5c,$(NDK_VERSION))$(findstring r5-crystax,$(NDK_VERSION))$(NDK_R6_TOOLCHAIN),)
$(info Building with NDK r5c or r6 - internal STLPort disabled)
$(info Building with NDK r5c or newer - internal STLPort disabled)
NDK_R5_TOOLCHAIN := 1
endif
ifneq ($(findstring r5-crystax-1,$(NDK_VERSION)),)
$(info Building with CrystaX r5 toolchain - wchar support enabled)
ifneq ($(findstring r7-crystax,$(NDK_VERSION)),)
$(info Building with CrystaX r7 or newer toolchain)
CRYSTAX_R7_TOOLCHAIN := 1
endif
ifneq ($(findstring r5-crystax,$(NDK_VERSION))$(findstring r6-crystax,$(NDK_VERSION))$(CRYSTAX_R7_TOOLCHAIN),)
$(info Building with CrystaX r5 or newer toolchain - wchar support enabled)
CRYSTAX_R5_TOOLCHAIN := 1
endif

View File

@@ -2,6 +2,7 @@ APP_PROJECT_PATH := $(call my-dir)/..
APP_STL := gnustl_static
APP_CFLAGS := -O2 -DNDEBUG -g # arm-linux-androideabi-4.4.3 crashes in -O0 mode on SDL sources
APP_PLATFORM := android-8
include jni/Settings.mk

View File

@@ -39,7 +39,7 @@ LOCAL_SHARED_LIBRARIES := sdl-$(SDL_VERSION) $(filter-out $(APP_AVAILABLE_STATIC
LOCAL_STATIC_LIBRARIES := $(filter $(APP_AVAILABLE_STATIC_LIBS), $(COMPILED_LIBRARIES))
LOCAL_STATIC_LIBRARIES += gnustl_static
#LOCAL_STATIC_LIBRARIES += gnustl_static
LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog -lz
@@ -47,14 +47,19 @@ LOCAL_LDFLAGS := -Lobj/local/armeabi
LOCAL_LDFLAGS += $(APPLICATION_ADDITIONAL_LDFLAGS)
ifneq ($(CRYSTAX_R5_TOOLCHAIN),)
LOCAL_C_INCLUDES += $(NDK_PATH)/sources/crystax/include
LOCAL_LDLIBS += -L$(NDK_PATH)/sources/crystax/libs/$(TARGET_ARCH_ABI) -lcrystax_static
endif
ifneq ($(NDK_R7_TOOLCHAIN)$(CRYSTAX_R7_TOOLCHAIN),) # NDK r7 broke it even more
LOCAL_C_INCLUDES += $(NDK_PATH)/sources/cxx-stl/gnu-libstdc++/include
LOCAL_LDLIBS += -L$(NDK_PATH)/sources/cxx-stl/gnu-libstdc++/libs/$(TARGET_ARCH_ABI) -lgnustl_static
else
ifneq ($(NDK_R6_TOOLCHAIN),) # NDK r6 broke it
LOCAL_C_INCLUDES += $(NDK_PATH)/sources/cxx-stl/gnu-libstdc++/include
LOCAL_LDLIBS += -L$(NDK_PATH)/sources/cxx-stl/gnu-libstdc++/libs/$(TARGET_ARCH_ABI) -lstdc++
endif
endif
ifneq ($(CRYSTAX_R5_TOOLCHAIN),)
LOCAL_C_INCLUDES += $(NDK_PATH)/sources/crystax/include
LOCAL_LDLIBS += -L$(NDK_PATH)/sources/crystax/libs/$(TARGET_ARCH_ABI) -lcrystax_static
endif
LIBS_WITH_LONG_SYMBOLS := $(strip $(shell \
for f in $(LOCAL_PATH)/../../obj/local/armeabi/*.so ; do \