[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[mini-os master] mini-os: make config handling more generic



commit 297348018f8224d1beeaa82c529e8f8b1046eb77
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Tue Aug 17 11:54:58 2021 +0200
Commit:     Wei Liu <wl@xxxxxxx>
CommitDate: Tue Aug 31 15:56:30 2021 +0000

    mini-os: make config handling more generic
    
    When adding a new CONFIG_ variable this needs to be done in multiple
    places. Change the handling to be more generic.
    
    This at once fixes a bug with CONFIG_XC which was not defined for the
    C preprocessor (it seems that this never resulted in any real issues,
    though).
    
    Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
    Reviewed-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
---
 Config.mk | 66 +++++++++++++++++++++++++++------------------------------------
 1 file changed, 28 insertions(+), 38 deletions(-)

diff --git a/Config.mk b/Config.mk
index cb823c2..15311ef 100644
--- a/Config.mk
+++ b/Config.mk
@@ -171,49 +171,39 @@ endif
 # CONFIG_ variables.
 
 # Configuration defaults
+CONFIG-y += CONFIG_START_NETWORK
+CONFIG-y += CONFIG_SPARSE_BSS
+CONFIG-y += CONFIG_BLKFRONT
+CONFIG-y += CONFIG_NETFRONT
+CONFIG-y += CONFIG_FBFRONT
+CONFIG-y += CONFIG_KBDFRONT
+CONFIG-y += CONFIG_CONSFRONT
+CONFIG-y += CONFIG_XENBUS
+CONFIG-y += CONFIG_XC
+CONFIG-n += CONFIG_QEMU_XS_ARGS
+CONFIG-n += CONFIG_TEST
+CONFIG-n += CONFIG_PCIFRONT
+CONFIG-n += CONFIG_TPMFRONT
+CONFIG-n += CONFIG_TPM_TIS
+CONFIG-n += CONFIG_TPMBACK
+CONFIG-n += CONFIG_BALLOON
+# Setting CONFIG_USE_XEN_CONSOLE copies all print output to the Xen emergency
+# console apart of standard dom0 handled console.
+CONFIG-n += CONFIG_USE_XEN_CONSOLE
 ifeq ($(TARGET_ARCH_FAM),x86)
-CONFIG_PARAVIRT ?= y
+CONFIG-y += CONFIG_PARAVIRT
 else
-CONFIG_PARAVIRT ?= n
+CONFIG-n += CONFIG_PARAVIRT
 endif
-CONFIG_START_NETWORK ?= y
-CONFIG_SPARSE_BSS ?= y
-CONFIG_QEMU_XS_ARGS ?= n
-CONFIG_TEST ?= n
-CONFIG_PCIFRONT ?= n
-CONFIG_BLKFRONT ?= y
-CONFIG_TPMFRONT ?= n
-CONFIG_TPM_TIS ?= n
-CONFIG_TPMBACK ?= n
-CONFIG_NETFRONT ?= y
-CONFIG_FBFRONT ?= y
-CONFIG_KBDFRONT ?= y
-CONFIG_CONSFRONT ?= y
-CONFIG_XENBUS ?= y
-CONFIG_XC ?=y
-CONFIG_LWIP ?= $(lwip)
-CONFIG_BALLOON ?= n
-# Setting CONFIG_USE_XEN_CONSOLE copies all print output to the Xen emergency
-# console apart of standard dom0 handled console.
-CONFIG_USE_XEN_CONSOLE ?= n
+CONFIG-$(lwip) += CONFIG_LWIP
+
+$(foreach i,$(CONFIG-y),$(eval $(i) ?= y))
+$(foreach i,$(CONFIG-n),$(eval $(i) ?= n))
+
+CONFIG-all := $(CONFIG-y) $(CONFIG-n)
 
 # Export config items as compiler directives
-DEFINES-$(CONFIG_PARAVIRT) += -DCONFIG_PARAVIRT
-DEFINES-$(CONFIG_START_NETWORK) += -DCONFIG_START_NETWORK
-DEFINES-$(CONFIG_SPARSE_BSS) += -DCONFIG_SPARSE_BSS
-DEFINES-$(CONFIG_QEMU_XS_ARGS) += -DCONFIG_QEMU_XS_ARGS
-DEFINES-$(CONFIG_PCIFRONT) += -DCONFIG_PCIFRONT
-DEFINES-$(CONFIG_BLKFRONT) += -DCONFIG_BLKFRONT
-DEFINES-$(CONFIG_TPMFRONT) += -DCONFIG_TPMFRONT
-DEFINES-$(CONFIG_TPM_TIS) += -DCONFIG_TPM_TIS
-DEFINES-$(CONFIG_TPMBACK) += -DCONFIG_TPMBACK
-DEFINES-$(CONFIG_NETFRONT) += -DCONFIG_NETFRONT
-DEFINES-$(CONFIG_KBDFRONT) += -DCONFIG_KBDFRONT
-DEFINES-$(CONFIG_FBFRONT) += -DCONFIG_FBFRONT
-DEFINES-$(CONFIG_CONSFRONT) += -DCONFIG_CONSFRONT
-DEFINES-$(CONFIG_XENBUS) += -DCONFIG_XENBUS
-DEFINES-$(CONFIG_BALLOON) += -DCONFIG_BALLOON
-DEFINES-$(CONFIG_USE_XEN_CONSOLE) += -DCONFIG_USE_XEN_CONSOLE
+$(foreach i,$(CONFIG-all),$(eval DEFINES-$($(i)) += -D$(i)))
 
 DEFINES-y += -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION)
 
--
generated by git-patchbot for /home/xen/git/mini-os.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.