From dd51beff1f96ff0c3697e17abb7cc53c91d47d9a Mon Sep 17 00:00:00 2001 From: Alexey Pelykh Date: Wed, 14 Mar 2012 14:48:59 +0200 Subject: [PATCH] Updated Makefiles to allow selective building. For Jenkins OSMAND_ARM_ONLY envvar should be set --- OsmAnd/jni/Android.mk | 22 +++++++++++++++++++--- OsmAnd/jni/Application.mk | 16 +++++++++++++++- OsmAnd/jni/cpufeatures_proxy/Android.mk | 2 +- OsmAnd/jni/expat/Android.mk | 2 +- OsmAnd/jni/freetype/Android.mk | 2 +- OsmAnd/jni/gif/Android.mk | 2 +- OsmAnd/jni/jpeg/Android.mk | 2 +- OsmAnd/jni/osmand/Android.mk | 2 +- OsmAnd/jni/png/Android.mk | 2 +- OsmAnd/jni/protobuf/Android.mk | 2 +- OsmAnd/jni/skia/Android.mk | 2 +- 11 files changed, 43 insertions(+), 13 deletions(-) diff --git a/OsmAnd/jni/Android.mk b/OsmAnd/jni/Android.mk index f168c4a662..9bff14a26a 100755 --- a/OsmAnd/jni/Android.mk +++ b/OsmAnd/jni/Android.mk @@ -1,13 +1,29 @@ OSMAND_MAKEFILES := $(all-subdir-makefiles) +# Protect from previous builds +ifneq ($(TARGET_ARCH_ABI),armeabi-v7a) +OSMAND_BUILDING_NEON_LIBRARY := false +endif + +# OSMAND_FORCE_NEON_SUPPORT is used to force only NEON support on ARMv7a +ifdef OSMAND_FORCE_NEON_SUPPORT +ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) +OSMAND_BUILDING_NEON_LIBRARY := true +endif +endif + # By default, include makefiles only once include $(OSMAND_MAKEFILES) - -# If we may support NEON, include them once more +# If we're not asked not to support NEON and not asked to support only NEON ARMv7a, then +# make additional build ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) +ifndef OSMAND_SKIP_NEON_SUPPORT +ifndef OSMAND_FORCE_NEON_SUPPORT -OSMAND_NEON := true +OSMAND_BUILDING_NEON_LIBRARY := true include $(OSMAND_MAKEFILES) +endif +endif endif \ No newline at end of file diff --git a/OsmAnd/jni/Application.mk b/OsmAnd/jni/Application.mk index 826c5a28d1..fdd99b5789 100755 --- a/OsmAnd/jni/Application.mk +++ b/OsmAnd/jni/Application.mk @@ -1,7 +1,21 @@ APP_STL := stlport_shared -APP_ABI := armeabi armeabi-v7a +APP_ABI := all APP_CPPFLAGS := -fno-rtti -fno-exceptions +ifdef OSMAND_X86_ONLY +APP_ABI := x86 +else +ifdef OSMAND_ARM_ONLY +APP_ABI := armeabi armeabi-v7a +endif +ifdef OSMAND_ARMv5_ONLY +APP_ABI := armeabi +endif +ifdef OSMAND_ARMv7a_ONLY +APP_ABI := armeabi-v7a +endif +endif + ifndef OSMAND_DEBUG_NATIVE # Force release compilation in release optimizations, even if application is debuggable by manifest APP_OPTIM := release diff --git a/OsmAnd/jni/cpufeatures_proxy/Android.mk b/OsmAnd/jni/cpufeatures_proxy/Android.mk index f92f7caf3b..4960b3ac22 100755 --- a/OsmAnd/jni/cpufeatures_proxy/Android.mk +++ b/OsmAnd/jni/cpufeatures_proxy/Android.mk @@ -1,5 +1,5 @@ # Do not build for NEON -ifneq ($(OSMAND_NEON),true) +ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true) LOCAL_PATH := $(call my-dir) diff --git a/OsmAnd/jni/expat/Android.mk b/OsmAnd/jni/expat/Android.mk index dea02411eb..703013078e 100755 --- a/OsmAnd/jni/expat/Android.mk +++ b/OsmAnd/jni/expat/Android.mk @@ -2,7 +2,7 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) -ifneq ($(OSMAND_NEON),true) +ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true) LOCAL_MODULE := libexpat_static else LOCAL_MODULE := libexpat_static_neon diff --git a/OsmAnd/jni/freetype/Android.mk b/OsmAnd/jni/freetype/Android.mk index 445fc0d67b..318e023cbf 100755 --- a/OsmAnd/jni/freetype/Android.mk +++ b/OsmAnd/jni/freetype/Android.mk @@ -50,7 +50,7 @@ LOCAL_CFLAGS += "-DFT2_BUILD_LIBRARY" LOCAL_CFLAGS += -O2 -ifneq ($(OSMAND_NEON),true) +ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true) LOCAL_MODULE := libft2_static else LOCAL_MODULE := libft2_static_neon diff --git a/OsmAnd/jni/gif/Android.mk b/OsmAnd/jni/gif/Android.mk index e11b3d7fdb..8391e236c5 100755 --- a/OsmAnd/jni/gif/Android.mk +++ b/OsmAnd/jni/gif/Android.mk @@ -18,7 +18,7 @@ LOCAL_C_INCLUDES += \ LOCAL_CFLAGS += -Wno-format -DHAVE_CONFIG_H -ifneq ($(OSMAND_NEON),true) +ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true) LOCAL_MODULE := libgif else LOCAL_MODULE := libgif_neon diff --git a/OsmAnd/jni/jpeg/Android.mk b/OsmAnd/jni/jpeg/Android.mk index 24375c9616..945b574665 100755 --- a/OsmAnd/jni/jpeg/Android.mk +++ b/OsmAnd/jni/jpeg/Android.mk @@ -74,7 +74,7 @@ ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) LOCAL_CFLAGS += -DANDROID_ARMV6_IDCT endif -ifneq ($(OSMAND_NEON),true) +ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true) LOCAL_MODULE := libjpeg else LOCAL_MODULE := libjpeg_neon diff --git a/OsmAnd/jni/osmand/Android.mk b/OsmAnd/jni/osmand/Android.mk index 58fdd951d3..049d4a866b 100644 --- a/OsmAnd/jni/osmand/Android.mk +++ b/OsmAnd/jni/osmand/Android.mk @@ -13,7 +13,7 @@ ifeq ($(OSMAND_SKIA_ABS),) endif # Name of the local module -ifneq ($(OSMAND_NEON),true) +ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true) LOCAL_MODULE := osmand else LOCAL_MODULE := osmand_neon diff --git a/OsmAnd/jni/png/Android.mk b/OsmAnd/jni/png/Android.mk index 46f4650683..fb679ae45e 100755 --- a/OsmAnd/jni/png/Android.mk +++ b/OsmAnd/jni/png/Android.mk @@ -50,7 +50,7 @@ LOCAL_C_INCLUDES += $(common_C_INCLUDES) \ LOCAL_SHARED_LIBRARIES := \ libz -ifneq ($(OSMAND_NEON),true) +ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true) LOCAL_MODULE := libpng else LOCAL_MODULE := libpng_neon diff --git a/OsmAnd/jni/protobuf/Android.mk b/OsmAnd/jni/protobuf/Android.mk index ac3153d2b8..560cd53361 100644 --- a/OsmAnd/jni/protobuf/Android.mk +++ b/OsmAnd/jni/protobuf/Android.mk @@ -15,7 +15,7 @@ CC_LITE_SRC_FILES := \ include $(CLEAR_VARS) -ifneq ($(OSMAND_NEON),true) +ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true) LOCAL_MODULE := proto else LOCAL_MODULE := proto_neon diff --git a/OsmAnd/jni/skia/Android.mk b/OsmAnd/jni/skia/Android.mk index 5561f3e358..5e333e15a4 100755 --- a/OsmAnd/jni/skia/Android.mk +++ b/OsmAnd/jni/skia/Android.mk @@ -4,7 +4,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -ifneq ($(OSMAND_NEON),true) +ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true) LOCAL_MODULE := skia else LOCAL_MODULE := skia_neon