From 9340a673cda4e6558cf65454cf7406b8fe7cb3ed Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Tue, 14 May 2019 16:44:52 +0900 Subject: [PATCH] make: Add support to skip current VNDK install You can get a system.img without current VNDK libs. This may help when you want a smaller system.img given that the image will be used with a specific version (not current) of vendor image. Bug: 132140714 Test: m TARGET_SKIP_CURRENT_VNDK=true && see if current VNDK is not installed Change-Id: Ie0815e6dd6ce2f861b6c42e637da4bb146320673 --- core/clear_vars.mk | 1 + core/notice_files.mk | 3 +++ core/soong_cc_prebuilt.mk | 8 ++++++++ target/product/gsi/Android.mk | 8 +++++--- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/core/clear_vars.mk b/core/clear_vars.mk index fafdce68cc..5973e0e3c9 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -269,6 +269,7 @@ LOCAL_SOONG_STATIC_LIBRARY_EXTRA_PACKAGES := LOCAL_SOONG_SYMBOL_PATH := LOCAL_SOONG_TOC := LOCAL_SOONG_UNSTRIPPED_BINARY := +LOCAL_SOONG_VNDK_VERSION := # '',true LOCAL_SOURCE_FILES_ALL_GENERATED:= LOCAL_SRC_FILES:= diff --git a/core/notice_files.mk b/core/notice_files.mk index c3147341b4..6df570eca5 100644 --- a/core/notice_files.mk +++ b/core/notice_files.mk @@ -61,6 +61,9 @@ else # device-obj or host-obj. module_installed_filename := \ $(patsubst $(PRODUCT_OUT)/%,%,$($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT_SHARED_LIBRARIES))/$(notdir $(LOCAL_BUILT_MODULE)) + else ifeq ($(LOCAL_MODULE_CLASS),SHARED_LIBRARIES) + # Shared modules may be uninstallable(e.g. TARGET_SKIP_CURRENT_VNDK=true) + module_installed_filename := else ifeq ($(LOCAL_MODULE_CLASS),JAVA_LIBRARIES) # Stick the static java libraries with the regular java libraries. diff --git a/core/soong_cc_prebuilt.mk b/core/soong_cc_prebuilt.mk index 7a8f46e091..55dd077b26 100644 --- a/core/soong_cc_prebuilt.mk +++ b/core/soong_cc_prebuilt.mk @@ -3,6 +3,7 @@ # LOCAL_SOONG_LINK_TYPE # LOCAL_SOONG_TOC # LOCAL_SOONG_UNSTRIPPED_BINARY +# LOCAL_SOONG_VNDK_VERSION : means the version of VNDK where this module belongs ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK)) $(call pretty-error,soong_cc_prebuilt.mk may only be used from Soong) @@ -51,6 +52,13 @@ ifndef LOCAL_UNINSTALLABLE_MODULE endif endif +# Don't install modules of current VNDK when it is told so +ifeq ($(TARGET_SKIP_CURRENT_VNDK),true) + ifeq ($(LOCAL_SOONG_VNDK_VERSION),$(PLATFORM_VNDK_VERSION)) + LOCAL_UNINSTALLABLE_MODULE := true + endif +endif + ####################################### include $(BUILD_SYSTEM)/base_rules.mk ####################################### diff --git a/target/product/gsi/Android.mk b/target/product/gsi/Android.mk index eaaa0512f0..56932342cc 100644 --- a/target/product/gsi/Android.mk +++ b/target/product/gsi/Android.mk @@ -46,6 +46,8 @@ else ifeq ($(TARGET_BUILD_PDK),true) # b/118634643: don't check VNDK lib list when building PDK. Some libs (libandroid_net.so # and some render-script related ones) can't be built in PDK due to missing frameworks/base. check-vndk-list: ; +else ifeq ($(TARGET_SKIP_CURRENT_VNDK),true) +check-vndk-list: ; else check-vndk-list: $(check-vndk-list-timestamp) endif @@ -100,11 +102,11 @@ ifneq ($(BOARD_VNDK_VERSION),) include $(CLEAR_VARS) LOCAL_MODULE := vndk_package LOCAL_REQUIRED_MODULES := \ - $(LLNDK_LIBRARIES) \ - llndk.libraries.txt \ - vndksp.libraries.txt + $(LLNDK_LIBRARIES) ifneq ($(TARGET_SKIP_CURRENT_VNDK),true) LOCAL_REQUIRED_MODULES += \ + llndk.libraries.txt \ + vndksp.libraries.txt \ $(addsuffix .vendor,$(VNDK_CORE_LIBRARIES)) \ $(addsuffix .vendor,$(VNDK_SAMEPROCESS_LIBRARIES)) endif