From: Andrei Tatar Date: Wed, 19 Jul 2023 08:05:35 +0000 (+0200) Subject: Makefile.uk: Condition header inclusion on Kconfig X-Git-Tag: RELEASE-0.14.0~4 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=860d2c2d57eb5d92f6b7477df7fa4a372be27bb6;p=unikraft%2Flibs%2Fmusl.git Makefile.uk: Condition header inclusion on Kconfig Previously musl would add its headers to the include path unconditionally when its Makefile would be included. This change conditions this inclusion on whether musl is enabled via Kconfig. Signed-off-by: Andrei Tatar Reviewed-by: Stefan Jumarea Reviewed-by: Eduard Vintilă Approved-by: Razvan Deaconescu Tested-by: Unikraft CI GitHub-Closes: #54 --- diff --git a/Makefile.rules b/Makefile.rules index 92a3d8f..c3b36d5 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -27,8 +27,8 @@ LIBMUSL_CINCLUDES-y += $$(LIBMUSL_$(call uc,$(1))_INCLUDES-y) LIBMUSL_CXXINCLUDES-y += $$(LIBMUSL_$(call uc,$(1))_INCLUDES-y) # includes for using libmusl -CINCLUDES-y += -I$(LIBMUSL_BUILD)/include/$(1)/include -CXXINCLUDES-y += -I$(LIBMUSL_BUILD)/include/$(1)/include +CINCLUDES-$(CONFIG_LIBMUSL) += -I$(LIBMUSL_BUILD)/include/$(1)/include +CXXINCLUDES-$(CONFIG_LIBMUSL) += -I$(LIBMUSL_BUILD)/include/$(1)/include # Append the sub library directory to the include path $(LIBMUSL_BUILD)/.prepared: $(subst $(LIBMUSL),$(LIBMUSL_BUILD)/include/$(1),$(2)) diff --git a/Makefile.uk b/Makefile.uk index 6f0f586..611d1ea 100644 --- a/Makefile.uk +++ b/Makefile.uk @@ -98,8 +98,8 @@ LIBMUSL_COMPFLAGS-y += -I$(LIBMUSL)/arch/$(MUSL_ARCH) LIBMUSL_COMPFLAGS-y += -I$(LIBMUSL)/src/include LIBMUSL_COMPFLAGS-y += -I$(LIBMUSL)/src/internal -CINCLUDES-y += $(LIBMUSL_GLOBAL_INCLUDES-y) -CXXINCLUDES-y += $(LIBMUSL_GLOBAL_INCLUDES-y) +CINCLUDES-$(CONFIG_LIBMUSL) += $(LIBMUSL_GLOBAL_INCLUDES-y) +CXXINCLUDES-$(CONFIG_LIBMUSL) += $(LIBMUSL_GLOBAL_INCLUDES-y) ################################################################################ # Musl-specific Targets @@ -159,8 +159,8 @@ LIBMUSL_ASFLAGS-y += -Wno-unused-command-line-argument LIBMUSL_CFLAGS-y += -ffreestanding # We globally switch off warnings that are caused by musl's public headers -CFLAGS += $(LIBMUSL_HDRS_FLAGS-y) -CXXFLAGS += $(LIBMUSL_HDRS_FLAGS-y) +CFLAGS-$(CONFIG_LIBMUSL) += $(LIBMUSL_HDRS_FLAGS-y) +CXXFLAGS-$(CONFIG_LIBMUSL) += $(LIBMUSL_HDRS_FLAGS-y) ################################################################################ # OS dependencies code - Glue between Unicore and musl