From cf331d931d4d254f1bccb18c27e675b41f764890 Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Wed, 25 Jun 2014 00:04:30 -0700 Subject: [PATCH] Host support for prefer symlink We need a host symlink for dalvik, our *-dalvik-host build targets are failing. Change-Id: I6045de20c948b456a150033deb3459895aff83c6 --- core/executable_prefer_symlink.mk | 32 +++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/core/executable_prefer_symlink.mk b/core/executable_prefer_symlink.mk index 2f04d0dab6..f66a5f223a 100644 --- a/core/executable_prefer_symlink.mk +++ b/core/executable_prefer_symlink.mk @@ -4,21 +4,30 @@ # # Note: now only limited to the binaries that will be installed under system/bin directory -my_symlink := $(addprefix $(TARGET_OUT)/bin/, $(LOCAL_MODULE)) # Create link to the one used depending on the target # configuration. Note that we require the TARGET_IS_64_BIT # check because 32 bit targets may not define TARGET_PREFER_32_BIT_APPS # et al. since those variables make no sense in that context. -ifeq ($(TARGET_IS_64_BIT),true) -ifneq ($(TARGET_PREFER_32_BIT_APPS),true) - $(my_symlink): PRIVATE_SRC_BINARY_NAME := $(LOCAL_MODULE_STEM_64) -else - $(my_symlink): PRIVATE_SRC_BINARY_NAME := $(LOCAL_MODULE_STEM_32) -endif -else - $(my_symlink): PRIVATE_SRC_BINARY_NAME := $(LOCAL_MODULE_STEM_32) -endif +ifneq ($(LOCAL_IS_HOST_MODULE),true) + my_symlink := $(addprefix $(TARGET_OUT)/bin/, $(LOCAL_MODULE)) + ifeq ($(TARGET_IS_64_BIT),true) + ifneq ($(TARGET_PREFER_32_BIT_APPS),true) +$(my_symlink): PRIVATE_SRC_BINARY_NAME := $(LOCAL_MODULE_STEM_64) + else +$(my_symlink): PRIVATE_SRC_BINARY_NAME := $(LOCAL_MODULE_STEM_32) + endif + else +$(my_symlink): PRIVATE_SRC_BINARY_NAME := $(LOCAL_MODULE_STEM_32) + endif +else + my_symlink := $(addprefix $(HOST_OUT)/bin/, $(LOCAL_MODULE)) + ifneq ($(HOST_PREFER_32_BIT),true) +$(my_symlink): PRIVATE_SRC_BINARY_NAME := $(LOCAL_MODULE_STEM_64) + else +$(my_symlink): PRIVATE_SRC_BINARY_NAME := $(LOCAL_MODULE_STEM_32) + endif +endif $(my_symlink): $(LOCAL_INSTALLED_MODULE) $(LOCAL_MODULE_MAKEFILE) @echo "Symlink: $@ -> $(PRIVATE_SRC_BINARY_NAME)" @@ -30,4 +39,7 @@ $(my_symlink): $(LOCAL_INSTALLED_MODULE) $(LOCAL_MODULE_MAKEFILE) # local module name ALL_MODULES.$(LOCAL_MODULE).INSTALLED += $(my_symlink) +# Create the symlink when you run mm/mmm or "make " +$(LOCAL_MODULE) : $(my_symlink) + my_symlink :=