From 80dc0bce3e70e45ba04a50fc7985e3d4606c04e7 Mon Sep 17 00:00:00 2001 From: Xiaoguang Wu Date: Mon, 14 Jan 2019 06:42:02 +0000 Subject: [PATCH] DM: ACPI: Avoiding hard code the ASL_COMPILER macro The ASL_COMPILER macro is hard coded as /usr/sbin/iasl, it is complained by some developers. This patch changes it to a flexible way, by which the following make command lines are supported: make make devicemodel make ASL_COMPILER=/path/to/iasl make ASL_COMPILER=/path/to/iasl devicemodel Tracked-On: #2298 Signed-off-by: Xiaoguang Wu Reviewed-by: Binbin Wu --- Makefile | 2 +- devicemodel/Makefile | 4 ++++ devicemodel/hw/platform/acpi/acpi.c | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f0bfd2d39..2768300e9 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ sbl-hypervisor: devicemodel: tools $(MAKE) -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) clean - $(MAKE) -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) DM_BUILD_VERSION=$(BUILD_VERSION) DM_BUILD_TAG=$(BUILD_TAG) + $(MAKE) -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) DM_BUILD_VERSION=$(BUILD_VERSION) DM_BUILD_TAG=$(BUILD_TAG) DM_ASL_COMPILER=$(ASL_COMPILER) tools: mkdir -p $(TOOLS_OUT) diff --git a/devicemodel/Makefile b/devicemodel/Makefile index 32c521938..4707ab259 100644 --- a/devicemodel/Makefile +++ b/devicemodel/Makefile @@ -25,6 +25,10 @@ CFLAGS += -I$(BASEDIR)/include/public CFLAGS += -I$(DM_OBJDIR)/include CFLAGS += -I$(TOOLS_OUT) +ifneq (, $(DM_ASL_COMPILER)) +CFLAGS += -DASL_COMPILER=\"$(DM_ASL_COMPILER)\" +endif + GCC_MAJOR=$(shell echo __GNUC__ | $(CC) -E -x c - | tail -n 1) GCC_MINOR=$(shell echo __GNUC_MINOR__ | $(CC) -E -x c - | tail -n 1) diff --git a/devicemodel/hw/platform/acpi/acpi.c b/devicemodel/hw/platform/acpi/acpi.c index 8abf44b44..d43ec2371 100644 --- a/devicemodel/hw/platform/acpi/acpi.c +++ b/devicemodel/hw/platform/acpi/acpi.c @@ -89,7 +89,9 @@ #define ASL_TEMPLATE "dm.XXXXXXX" #define ASL_SUFFIX ".aml" +#ifndef ASL_COMPILER #define ASL_COMPILER "/usr/sbin/iasl" +#endif uint64_t audio_nhlt_len = 0; uint32_t csme_sec_cap = 0;