@@ -1,5 +1,6 @@
# These are "proxy" symbols used to pass config-host.mak values
-# down to Kconfig.
+# down to Kconfig. See also MINIKCONF_ARGS in the Makefile:
+# these two need to be kept in sync.
config KVM
bool
@@ -382,9 +382,19 @@ endif
-include $(SUBDIR_DEVICES_MAK_DEP)
-%/config-devices.mak: default-configs/%.mak $(SRC_PATH)/scripts/make_device_config.sh
+# This has to be kept in sync with Kconfig.host.
+MINIKCONF_ARGS = \
+ CONFIG_KVM=$(CONFIG_KVM) \
+ CONFIG_SPICE=$(CONFIG_SPICE) \
+ CONFIG_TPM=$(CONFIG_TPM) \
+ CONFIG_XEN=$(CONFIG_XEN) \
+ CONFIG_OPENGL=$(CONFIG_OPENGL)
+
+MINIKCONF = $(SHELL) $(SRC_PATH)/scripts/minikconf.sh
+
+%/config-devices.mak: default-configs/%-softmmu.mak Kconfig.host hw/Kconfig
$(call quiet-command, \
- $(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $< $*-config-devices.mak.d $@ > $@.tmp,"GEN","$@.tmp")
+ $(MINIKCONF) $@ $*-config-devices.mak.d $^ $(MINIKCONF_ARGS) > $@.tmp, " GEN $@.tmp")
$(call quiet-command, if test -f $@; then \
if cmp -s $@.old $@; then \
mv $@.tmp $@; \
@@ -4,9 +4,12 @@ BUILD_DIR?=$(CURDIR)/..
include ../config-host.mak
include config-target.mak
-include config-devices.mak
include $(SRC_PATH)/rules.mak
+ifdef CONFIG_SOFTMMU
+include config-devices.mak
+endif
+
$(call set-vpath, $(SRC_PATH):$(BUILD_DIR))
ifdef CONFIG_LINUX
QEMU_CFLAGS += -I../linux-headers
@@ -190,7 +193,9 @@ all-obj-$(CONFIG_USER_ONLY) += $(crypto-aes-obj-y)
all-obj-$(CONFIG_SOFTMMU) += $(crypto-obj-y)
all-obj-$(CONFIG_SOFTMMU) += $(io-obj-y)
+ifdef CONFIG_SOFTMMU
$(QEMU_PROG_BUILD): config-devices.mak
+endif
COMMON_LDADDS = ../libqemuutil.a
@@ -4,7 +4,6 @@ include pci.mak
include sound.mak
include usb.mak
include hyperv.mak
-CONFIG_QXL=$(CONFIG_SPICE)
CONFIG_VGA_ISA=y
CONFIG_VGA_CIRRUS=y
CONFIG_VMWARE_VGA=y
@@ -37,8 +36,6 @@ CONFIG_HPET=y
CONFIG_APPLESMC=y
CONFIG_I8259=y
CONFIG_PFLASH_CFI01=y
-CONFIG_TPM_TIS=$(CONFIG_TPM)
-CONFIG_TPM_CRB=$(CONFIG_TPM)
CONFIG_MC146818RTC=y
CONFIG_PCI_PIIX=y
CONFIG_WDT_IB700=y
@@ -51,6 +51,7 @@ config FRAMEBUFFER
config MILKYMIST_TMU2
bool
+ depends on OPENGL
config SM501
bool
@@ -66,6 +67,7 @@ config VGA
config QXL
bool
+ depends on SPICE
config VIRTIO_GPU
bool
@@ -3,12 +3,18 @@ config KVM
config I440FX
bool
+ select QXL if SPICE
+ select TPM_TIS if TPM
+ select XEN_I386 if XEN
config ISAPC
bool
config Q35
bool
+ select QXL if SPICE
+ select TPM_TIS if TPM
+ select XEN_I386 if XEN
config VTD
bool
@@ -21,9 +21,13 @@ config APIC
config ARM_GIC_KVM
bool
+ default y
+ depends on ARM_GIC && KVM
config OPENPIC_KVM
bool
+ default y
+ depends on OPENPIC && KVM
config XICS
bool
@@ -33,6 +37,8 @@ config XICS_SPAPR
config XICS_KVM
bool
+ default y
+ depends on XICS && KVM
config ALLWINNER_A10_PIC
bool
@@ -42,6 +48,8 @@ config S390_FLIC
config S390_FLIC_KVM
bool
+ default y
+ depends on S390_FLIC && KVM
config OMPIC
bool
@@ -48,6 +48,8 @@ config MACIO
config IVSHMEM_DEVICE
bool
+ default y
+ depends on PCI
config ECCMEMCTL
bool
@@ -3,6 +3,7 @@ config TPM
config TPM_TIS
bool
+ depends on TPM
config TPM_CRB
bool
@@ -142,7 +142,7 @@ cc-option = $(if $(shell $(CC) $1 $2 -S -o /dev/null -xc /dev/null \
cc-c-option = $(if $(shell $(CC) $1 $2 -c -o /dev/null -xc /dev/null \
>/dev/null 2>&1 && echo OK), $2, $3)
-VPATH_SUFFIXES = %.c %.h %.S %.cc %.cpp %.m %.mak %.texi %.sh %.rc
+VPATH_SUFFIXES = %.c %.h %.S %.cc %.cpp %.m %.mak %.texi %.sh %.rc Kconfig%
set-vpath = $(if $1,$(foreach PATTERN,$(VPATH_SUFFIXES),$(eval vpath $(PATTERN) $1)))
# install-prog list, dir
deleted file mode 100644
@@ -1,30 +0,0 @@
-#! /bin/sh
-# Writes a target device config file to stdout, from a default and from
-# include directives therein. Also emits Makefile dependencies.
-#
-# Usage: make_device_config.sh SRC DEPFILE-NAME DEPFILE-TARGET > DEST
-
-src=$1
-dep=$2
-target=$3
-src_dir=$(dirname $src)
-all_includes=
-
-process_includes () {
- cat $1 | grep '^include' | \
- while read include file ; do
- all_includes="$all_includes $src_dir/$file"
- process_includes $src_dir/$file
- done
-}
-
-f=$src
-while [ -n "$f" ] ; do
- f=$(cat $f | tr -d '\r' | awk '/^include / {printf "'$src_dir'/%s ", $2}')
- [ $? = 0 ] || exit 1
- all_includes="$all_includes $f"
-done
-process_includes $src
-
-cat $src $all_includes | grep -v '^include'
-echo "$target: $all_includes" > $dep
@@ -12,6 +12,7 @@
import os
import sys
+import re
__all__ = [ 'KconfigParserError', 'KconfigData', 'KconfigParser' ]
@@ -331,6 +332,12 @@ class KconfigParser:
self.get_token()
self.parse_config()
+ def do_assignment(self, var, val):
+ if not var.startswith("CONFIG_"):
+ raise Error('assigned variable should start with CONFIG_')
+ var = self.data.do_var(var[7:])
+ self.data.do_assignment(var, val)
+
# file management -----
def error_path(self):
@@ -619,6 +626,28 @@ class KconfigParser:
return None
if __name__ == '__main__':
- fname = len(sys.argv) > 1 and sys.argv[1] or 'Kconfig.test'
- data = KconfigParser.parse(open(fname, 'r'))
- print data.compute_config()
+ argv = sys.argv
+ if len(argv) == 1:
+ print >>sys.stderr, "%s: at least one argument is required" % argv[0]
+ os.exit(1)
+
+ data = KconfigData()
+ parser = KconfigParser(data)
+ for arg in argv[3:]:
+ m = re.match(r'^(CONFIG_[A-Z0-9_]+)=([yn]?)$', arg)
+ if m is not None:
+ name, value = m.groups()
+ parser.do_assignment(name, value == 'y')
+ else:
+ fp = open(arg, 'r')
+ parser.parse_file(fp)
+ fp.close()
+
+ config = data.compute_config()
+ for key in sorted(config.keys()):
+ print 'CONFIG_%s=%s'% (key, (config[key] and 'y' or 'n'))
+
+ deps = open(argv[2], 'w')
+ for fname in data.previously_included:
+ print >>deps, '%s: %s' % (argv[1], fname)
+ deps.close()