diff options
-rw-r--r-- | core/binary.mk | 39 | ||||
-rw-r--r-- | core/clear_vars.mk | 1 | ||||
-rw-r--r-- | core/definitions.mk | 4 | ||||
-rw-r--r-- | core/host_shared_library.mk | 3 | ||||
-rw-r--r-- | core/host_static_library.mk | 3 | ||||
-rw-r--r-- | core/legacy_prebuilts.mk | 1 | ||||
-rw-r--r-- | core/prebuilt.mk | 36 | ||||
-rw-r--r-- | core/shared_library.mk | 3 | ||||
-rw-r--r-- | core/static_library.mk | 3 |
9 files changed, 76 insertions, 17 deletions
diff --git a/core/binary.mk b/core/binary.mk index e488200..de053b0 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -467,6 +467,26 @@ endif asm_objects := $(asm_objects_S) $(asm_objects_s) +#################################################### +## Import includes +#################################################### +import_includes := $(intermediates)/import_includes +import_includes_deps := $(strip \ + $(foreach l, $(installed_shared_library_module_names), \ + $(call intermediates-dir-for,SHARED_LIBRARIES,$(l),$(LOCAL_IS_HOST_MODULE))/export_includes) \ + $(foreach l, $(LOCAL_STATIC_LIBRARIES) $(LOCAL_WHOLE_STATIC_LIBRARIES), \ + $(call intermediates-dir-for,STATIC_LIBRARIES,$(l),$(LOCAL_IS_HOST_MODULE))/export_includes)) +$(import_includes) : $(import_includes_deps) + @echo Import includes file: $@ + $(hide) mkdir -p $(dir $@) && rm -f $@ +ifdef import_includes_deps + $(hide) for f in $^; do \ + cat $$f >> $@; \ + done +else + $(hide) touch $@ +endif + ########################################################### ## Common object handling. ########################################################### @@ -492,7 +512,7 @@ ifndef LOCAL_NDK_VERSION LOCAL_C_INCLUDES += $(JNI_H_INCLUDE) endif -$(all_objects) : | $(LOCAL_GENERATED_SOURCES) +$(all_objects) : | $(LOCAL_GENERATED_SOURCES) $(import_includes) ALL_C_CPP_ETC_OBJECTS += $(all_objects) ########################################################### @@ -592,6 +612,7 @@ $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CPPFLAGS := $(LOCAL_CPPFLAGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RTTI_FLAG := $(LOCAL_RTTI_FLAG) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_DEBUG_CFLAGS := $(debug_cflags) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_C_INCLUDES := $(LOCAL_C_INCLUDES) +$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_IMPORT_INCLUDES := $(import_includes) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_LDFLAGS := $(LOCAL_LDFLAGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_LDLIBS := $(LOCAL_LDLIBS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_NO_CRT := $(LOCAL_NO_CRT) @@ -616,3 +637,19 @@ all_libraries := \ # are linked into this module. This will force them to be installed # when this module is. $(LOCAL_INSTALLED_MODULE): | $(installed_static_library_notice_file_targets) + +########################################################### +# Export includes +########################################################### +export_includes := $(intermediates)/export_includes +$(export_includes): PRIVATE_EXPORT_C_INCLUDE_DIRS := $(LOCAL_EXPORT_C_INCLUDE_DIRS) +$(export_includes) : + @echo Export includes file: $< -- $@ + $(hide) mkdir -p $(dir $@) && rm -f $@ +ifdef LOCAL_EXPORT_C_INCLUDE_DIRS + $(hide) for d in $(PRIVATE_EXPORT_C_INCLUDE_DIRS); do \ + echo "-I $$d" >> $@; \ + done +else + $(hide) touch $@ +endif diff --git a/core/clear_vars.mk b/core/clear_vars.mk index d9f3372..fabdc57 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -44,6 +44,7 @@ LOCAL_CFLAGS:= LOCAL_CPPFLAGS:= LOCAL_RTTI_FLAG:= LOCAL_C_INCLUDES:= +LOCAL_EXPORT_C_INCLUDE_DIRS:= LOCAL_LDFLAGS:= LOCAL_LDLIBS:= LOCAL_AAPT_FLAGS:= diff --git a/core/definitions.mk b/core/definitions.mk index 5410b11..19bf503 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -875,6 +875,7 @@ define transform-cpp-to-o @echo "target $(PRIVATE_ARM_MODE) C++: $(PRIVATE_MODULE) <= $<" $(hide) $(PRIVATE_CXX) \ $(addprefix -I , $(PRIVATE_C_INCLUDES)) \ + @$(PRIVATE_IMPORT_INCLUDES) \ $(addprefix -isystem ,\ $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \ $(filter-out $(PRIVATE_C_INCLUDES), \ @@ -904,6 +905,7 @@ define transform-c-or-s-to-o-no-deps @mkdir -p $(dir $@) $(hide) $(PRIVATE_CC) \ $(addprefix -I , $(PRIVATE_C_INCLUDES)) \ + @$(PRIVATE_IMPORT_INCLUDES) \ $(addprefix -isystem ,\ $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \ $(filter-out $(PRIVATE_C_INCLUDES), \ @@ -965,6 +967,7 @@ define transform-host-cpp-to-o @echo "host C++: $(PRIVATE_MODULE) <= $<" $(hide) $(PRIVATE_CXX) \ $(addprefix -I , $(PRIVATE_C_INCLUDES)) \ + @$(PRIVATE_IMPORT_INCLUDES) \ $(addprefix -isystem ,\ $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \ $(filter-out $(PRIVATE_C_INCLUDES), \ @@ -992,6 +995,7 @@ define transform-host-c-or-s-to-o-no-deps @mkdir -p $(dir $@) $(hide) $(PRIVATE_CC) \ $(addprefix -I , $(PRIVATE_C_INCLUDES)) \ + @$(PRIVATE_IMPORT_INCLUDES) \ $(addprefix -isystem ,\ $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \ $(filter-out $(PRIVATE_C_INCLUDES), \ diff --git a/core/host_shared_library.mk b/core/host_shared_library.mk index f78b17b..976a942 100644 --- a/core/host_shared_library.mk +++ b/core/host_shared_library.mk @@ -18,6 +18,9 @@ endif ifneq ($(strip $(OVERRIDE_BUILT_MODULE_PATH)),) $(error $(LOCAL_PATH): Illegal use of OVERRIDE_BUILT_MODULE_PATH) endif +ifneq ($(strip $(LOCAL_MODULE_STEM)$(LOCAL_BUILT_MODULE_STEM)),) +$(error $(LOCAL_PATH): Can not set module stem for a library) +endif # Put the built modules of all shared libraries in a common directory # to simplify the link line. diff --git a/core/host_static_library.mk b/core/host_static_library.mk index 39c99ee..b04291b 100644 --- a/core/host_static_library.mk +++ b/core/host_static_library.mk @@ -13,6 +13,9 @@ endif ifeq ($(strip $(LOCAL_MODULE_SUFFIX)),) LOCAL_MODULE_SUFFIX := .a endif +ifneq ($(strip $(LOCAL_MODULE_STEM)$(LOCAL_BUILT_MODULE_STEM)),) +$(error $(LOCAL_PATH): Can not set module stem for a library) +endif LOCAL_UNINSTALLABLE_MODULE := true LOCAL_IS_HOST_MODULE := true diff --git a/core/legacy_prebuilts.mk b/core/legacy_prebuilts.mk index 41943b1..4b6b36f 100644 --- a/core/legacy_prebuilts.mk +++ b/core/legacy_prebuilts.mk @@ -84,7 +84,6 @@ GRANDFATHERED_ALL_PREBUILT := \ libGLESv1_CM_tegra.so \ libGLESv2_POWERVR_SGX530_121.so \ libGLESv2_tegra.so \ - libmdmctrl.a \ libmoto_ril.so \ libpppd_plugin-ril.so \ libril_rds.so \ diff --git a/core/prebuilt.mk b/core/prebuilt.mk index 54a7fa9..0c46341 100644 --- a/core/prebuilt.mk +++ b/core/prebuilt.mk @@ -27,6 +27,14 @@ ifeq (SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS)) OVERRIDE_BUILT_MODULE_PATH := $($(my_prefix)OUT_INTERMEDIATE_LIBRARIES) endif +# Deal with the OSX library timestamp issue when installing +# a prebuilt simulator library. +ifneq ($(filter STATIC_LIBRARIES SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS)),) + prebuilt_module_is_a_library := true +else + prebuilt_module_is_a_library := +endif + ifeq ($(LOCAL_STRIP_MODULE),true) ifdef LOCAL_IS_HOST_MODULE $(error Cannot strip host module LOCAL_PATH=$(LOCAL_PATH)) @@ -42,14 +50,13 @@ ifeq ($(LOCAL_STRIP_MODULE),true) else include $(BUILD_SYSTEM)/base_rules.mk built_module := $(LOCAL_BUILT_MODULE) -endif -# Deal with the OSX library timestamp issue when installing -# a prebuilt simulator library. -ifneq ($(filter STATIC_LIBRARIES SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS)),) - prebuilt_module_is_a_library := true -else - prebuilt_module_is_a_library := +ifdef prebuilt_module_is_a_library +# Create a dummy export_includes. +$(intermediates)/export_includes: + $(hide) mkdir -p $(dir $@) && rm -f $@ + $(hide) touch $@ +endif endif PACKAGES.$(LOCAL_MODULE).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES)) @@ -115,6 +122,13 @@ $(built_module) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES) else $(built_module) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES) | $(ACP) $(transform-prebuilt-to-target) +ifneq ($(prebuilt_module_is_a_library),) + ifneq ($(LOCAL_IS_HOST_MODULE),) + $(transform-host-ranlib-copy-hack) + else + $(transform-ranlib-copy-hack) + endif +endif endif endif @@ -135,11 +149,3 @@ $(common_javalib_jar) : $(common_classes_jar) | $(ACP) # make sure the classes.jar and javalib.jar are built before $(LOCAL_BUILT_MODULE) $(built_module) : $(common_javalib_jar) endif # TARGET JAVA_LIBRARIES - -ifneq ($(prebuilt_module_is_a_library),) - ifneq ($(LOCAL_IS_HOST_MODULE),) - $(transform-host-ranlib-copy-hack) - else - $(transform-ranlib-copy-hack) - endif -endif diff --git a/core/shared_library.mk b/core/shared_library.mk index ca639eb..d715349 100644 --- a/core/shared_library.mk +++ b/core/shared_library.mk @@ -16,6 +16,9 @@ endif ifneq ($(strip $(OVERRIDE_BUILT_MODULE_PATH)),) $(error $(LOCAL_PATH): Illegal use of OVERRIDE_BUILT_MODULE_PATH) endif +ifneq ($(strip $(LOCAL_MODULE_STEM)$(LOCAL_BUILT_MODULE_STEM)),) +$(error $(LOCAL_PATH): Can not set module stem for a library) +endif # Put the built targets of all shared libraries in a common directory # to simplify the link line. diff --git a/core/static_library.mk b/core/static_library.mk index 4ff5a34..66e091b 100644 --- a/core/static_library.mk +++ b/core/static_library.mk @@ -14,6 +14,9 @@ ifeq ($(strip $(LOCAL_MODULE_SUFFIX)),) LOCAL_MODULE_SUFFIX := .a endif LOCAL_UNINSTALLABLE_MODULE := true +ifneq ($(strip $(LOCAL_MODULE_STEM)$(LOCAL_BUILT_MODULE_STEM)),) +$(error $(LOCAL_PATH): Can not set module stem for a library) +endif include $(BUILD_SYSTEM)/binary.mk |