From 32f0e24b333b7570fb63006fa18da79a2185319e Mon Sep 17 00:00:00 2001 From: Ying Wang <wangying@google.com> Date: Thu, 29 Mar 2012 14:57:55 -0700 Subject: [PATCH] Remove ".." in the native LOCAL_SRC_FILES. The build system does not work well with ".." in the path of native source code. ".." causes the object files to spill out of the module's intermediate directory. Change-Id: Ib4a473426be296a738e7facbaa091e56f0b7c5b8 --- native/jni/Android.mk | 87 +++++++++++++++++++++++++++++-------------- 1 file changed, 60 insertions(+), 27 deletions(-) diff --git a/native/jni/Android.mk b/native/jni/Android.mk index 5fd91016cf..f41d6916ee 100644 --- a/native/jni/Android.mk +++ b/native/jni/Android.mk @@ -13,6 +13,32 @@ # limitations under the License. LOCAL_PATH := $(call my-dir) + +############ some local flags +# If you change any of those flags, you need to rebuild both libjni_latinime_static +# and the shared library. +#FLAG_DBG := true +#FLAG_DO_PROFILE := true + +TARGETING_UNBUNDLED_FROYO := true + +ifeq ($(TARGET_ARCH), x86) + TARGETING_UNBUNDLED_FROYO := false +endif + +ifeq ($(TARGET_ARCH), mips) + TARGETING_UNBUNDLED_FROYO := false +endif + +ifeq ($(FLAG_DBG), true) + TARGETING_UNBUNDLED_FROYO := false +endif + +ifeq ($(FLAG_DO_PROFILE), true) + TARGETING_UNBUNDLED_FROYO := false +endif + +###################################### include $(CLEAR_VARS) LATIN_IME_SRC_DIR := src @@ -43,50 +69,57 @@ LOCAL_SRC_FILES := \ $(LATIN_IME_JNI_SRC_FILES) \ $(addprefix $(LATIN_IME_SRC_DIR)/,$(LATIN_IME_CORE_SRC_FILES)) -#FLAG_DBG := true -#FLAG_DO_PROFILE := true - -TARGETING_UNBUNDLED_FROYO := true - -ifeq ($(TARGET_ARCH), x86) - TARGETING_UNBUNDLED_FROYO := false -endif - -ifeq ($(TARGET_ARCH), mips) - TARGETING_UNBUNDLED_FROYO := false -endif - -ifeq ($(FLAG_DBG), true) - TARGETING_UNBUNDLED_FROYO := false -endif - -ifeq ($(FLAG_DO_PROFILE), true) - TARGETING_UNBUNDLED_FROYO := false -endif - ifeq ($(TARGETING_UNBUNDLED_FROYO), true) LOCAL_NDK_VERSION := 4 LOCAL_SDK_VERSION := 8 endif -LOCAL_MODULE := libjni_latinime +ifeq ($(FLAG_DO_PROFILE), true) + $(warning Making profiling version of native library) + LOCAL_CFLAGS += -DFLAG_DO_PROFILE +else # FLAG_DO_PROFILE +ifeq ($(FLAG_DBG), true) + $(warning Making debug version of native library) + LOCAL_CFLAGS += -DFLAG_DBG +endif # FLAG_DBG +endif # FLAG_DO_PROFILE +LOCAL_MODULE := libjni_latinime_static LOCAL_MODULE_TAGS := optional -# For STL -LOCAL_C_INCLUDES += external/stlport/stlport bionic -LOCAL_SHARED_LIBRARIES += libstlport +include external/stlport/libstlport.mk +include $(BUILD_STATIC_LIBRARY) + +###################################### +include $(CLEAR_VARS) + +# All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library. +LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_static +LOCAL_SHARED_LIBRARIES := libstlport ifeq ($(FLAG_DO_PROFILE), true) $(warning Making profiling version of native library) - LOCAL_CFLAGS += -DFLAG_DO_PROFILE LOCAL_SHARED_LIBRARIES += libcutils libutils else # FLAG_DO_PROFILE ifeq ($(FLAG_DBG), true) $(warning Making debug version of native library) - LOCAL_CFLAGS += -DFLAG_DBG LOCAL_SHARED_LIBRARIES += libcutils libutils endif # FLAG_DBG endif # FLAG_DO_PROFILE +ifeq ($(TARGETING_UNBUNDLED_FROYO), true) + LOCAL_NDK_VERSION := 4 + LOCAL_SDK_VERSION := 8 +endif + +LOCAL_MODULE := libjni_latinime +LOCAL_MODULE_TAGS := optional + +include external/stlport/libstlport.mk include $(BUILD_SHARED_LIBRARY) + +#################### Clean up the tmp vars +LATIN_IME_CORE_SRC_FILES := +LATIN_IME_JNI_SRC_FILES := +LATIN_IME_SRC_DIR := +TARGETING_UNBUNDLED_FROYO := -- GitLab