OSDN Git Service

Add LOCAL_COPY_TO_INTERMEDIATE_LIBRARIES.
authorDan Albert <danalbert@google.com>
Wed, 20 Jul 2016 18:02:18 +0000 (11:02 -0700)
committerDan Albert <danalbert@google.com>
Thu, 28 Jul 2016 07:06:19 +0000 (00:06 -0700)
This allows a module to avoid being installed to the common library
directory.

Test: Prevents copying of NDK libraries with the NDK sysroot patches.
Bug: http://b/27533932
Change-Id: I24f11d5a70595bcd524ac5bd85034c226d2de211

core/clear_vars.mk
core/prebuilt_internal.mk

index 31b337a..562a272 100644 (file)
@@ -199,6 +199,7 @@ LOCAL_NOTICE_FILE:=
 # to avoid installing the presigned apks with classes.dex unstripped.
 LOCAL_REPLACE_PREBUILT_APK_INSTALLED:=
 LOCAL_NDK_VERSION:=current
+LOCAL_COPY_TO_INTERMEDIATE_LIBRARIES:=
 LOCAL_LOGTAGS_FILES:=
 
 # arch specific variables
index 90e9547..701414a 100644 (file)
@@ -46,9 +46,18 @@ my_pack_module_relocations := $(firstword \
   $(LOCAL_PACK_MODULE_RELOCATIONS))
 
 ifeq (SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS))
-  # Put the built targets of all shared libraries in a common directory
-  # to simplify the link line.
-  OVERRIDE_BUILT_MODULE_PATH := $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT_INTERMEDIATE_LIBRARIES)
+  # LOCAL_COPY_TO_INTERMEDIATE_LIBRARIES indicates that this prebuilt should be
+  # installed to the common directory of libraries. This is needed for the NDK
+  # shared libraries built by soong, as we build many different versions of each
+  # library (one for each API level). Since they all have the same basename,
+  # they'd clobber each other (as well as any platform libraries by the same
+  # name).
+  ifneq ($(LOCAL_COPY_TO_INTERMEDIATE_LIBRARIES),false)
+    # Put the built targets of all shared libraries in a common directory
+    # to simplify the link line.
+    OVERRIDE_BUILT_MODULE_PATH :=  \
+        $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT_INTERMEDIATE_LIBRARIES)
+  endif
   ifeq ($(LOCAL_IS_HOST_MODULE)$(my_strip_module),)
     # Strip but not try to add debuglink
     my_strip_module := no_debuglink