Support LOCAL_MODULE_RELATIVE_PATH
Most users of LOCAL_MODULE_PATH are setting a subdirectory of the
normal install path, for example to install HALs into system/lib/hw.
This is problematic for multiarch builds, where the install location
depends on the arch. Allow modules to specify LOCAL_MODULE_RELATIVE_PATH.
HALs will generally use:
LOCAL_MODULE_RELATIVE_PATH := hw
Change-Id: I4e4ceec61d026bbe74ba604554c06104bde42e5e
diff --git a/core/base_rules.mk b/core/base_rules.mk
index 29c6c7f..ac126a7 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -99,6 +99,7 @@
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
my_module_path := $(strip $(LOCAL_MODULE_PATH))
+my_module_relative_path := $(strip $(LOCAL_MODULE_RELATIVE_PATH))
ifeq ($(my_module_path),)
ifdef LOCAL_IS_HOST_MODULE
partition_tag :=
@@ -121,6 +122,9 @@
$(error $(LOCAL_PATH): unhandled install path "$(install_path_var) for $(LOCAL_MODULE)")
endif
endif
+ifneq ($(my_module_relative_path),)
+ my_module_path := $(my_module_path)/$(my_module_relative_path)
+endif
endif # not LOCAL_UNINSTALLABLE_MODULE
ifneq ($(strip $(LOCAL_BUILT_MODULE)$(LOCAL_INSTALLED_MODULE)),)