Re: [PULL v8 062/152] meson: infrastructure for building emulators

2020-11-03 Thread Yonggang Luo
On Tue, Nov 3, 2020 at 10:25 PM Paolo Bonzini  wrote:
>
> On 03/11/20 15:19, 罗勇刚(Yonggang Luo) wrote:
> >> > +#include CONFIG_DEVICES
> > Mybe add config-devices.h back and detecting the target_cpu and include
> > it properly?
>
> We could add a one-line config-devices.h that contains "#include
> CONFIG_DEVICES" if desirable.
>
> Paolo
>
Make sense


--
 此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo


Re: [PULL v8 062/152] meson: infrastructure for building emulators

2020-11-03 Thread Paolo Bonzini
On 03/11/20 15:19, 罗勇刚(Yonggang Luo) wrote:
>> > +#include CONFIG_DEVICES
> Mybe add config-devices.h back and detecting the target_cpu and include
> it properly?

We could add a one-line config-devices.h that contains "#include
CONFIG_DEVICES" if desirable.

Paolo




Re: [PULL v8 062/152] meson: infrastructure for building emulators

2020-11-03 Thread Yonggang Luo
On Tue, Nov 3, 2020 at 9:41 PM Philippe Mathieu-Daudé 
wrote:
>
> On 8/21/20 12:21 PM, Paolo Bonzini wrote:
> > Signed-off-by: Marc-André Lureau 
> > Signed-off-by: Paolo Bonzini 
> > ---
> >  Makefile   |  74 ++
> >  Makefile.target|  19 +++--
> >  configure  |   6 --
> >  hw/i386/fw_cfg.c   |   2 +-
> >  hw/i386/pc.c   |   2 +-
> >  hw/i386/pc_piix.c  |   2 +-
> >  hw/i386/x86.c  |   2 +-
> >  hw/vfio/pci-quirks.c   |   2 +-
> >  hw/virtio/virtio-mem.c |   2 +-
> >  include/qemu/osdep.h   |   2 +-
> >  meson.build| 166 -
> >  rules.mak  |   8 --
> >  scripts/create_config  |   2 +
> >  scripts/grepy.sh   |   3 +
> >  scripts/minikconf.py   |   0
> >  softmmu/qtest.c|   2 +-
> >  16 files changed, 192 insertions(+), 102 deletions(-)
> >  create mode 100755 scripts/grepy.sh
> >  mode change 100755 => 100644 scripts/minikconf.py
> ...
>
> > diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c
> > index c55abfb01a..33441ad484 100644
> > --- a/hw/i386/fw_cfg.c
> > +++ b/hw/i386/fw_cfg.c
> > @@ -22,7 +22,7 @@
> >  #include "hw/nvram/fw_cfg.h"
> >  #include "e820_memory_layout.h"
> >  #include "kvm_i386.h"
> > -#include "config-devices.h"
> > +#include CONFIG_DEVICES
Mybe add config-devices.h back and detecting the target_cpu and include it
properly?
>
> Suggestion: add a comment to this include, because it is hard to
> figure out what it does (if you don't have minikconf + meson
> background). At least it was not obvious to me. (other
> occurrences in the codebase).
>
> Regards,
>
> Phil.
>
>


--
 此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo


Re: [PULL v8 062/152] meson: infrastructure for building emulators

2020-11-03 Thread Philippe Mathieu-Daudé
On 8/21/20 12:21 PM, Paolo Bonzini wrote:
> Signed-off-by: Marc-André Lureau 
> Signed-off-by: Paolo Bonzini 
> ---
>  Makefile   |  74 ++
>  Makefile.target|  19 +++--
>  configure  |   6 --
>  hw/i386/fw_cfg.c   |   2 +-
>  hw/i386/pc.c   |   2 +-
>  hw/i386/pc_piix.c  |   2 +-
>  hw/i386/x86.c  |   2 +-
>  hw/vfio/pci-quirks.c   |   2 +-
>  hw/virtio/virtio-mem.c |   2 +-
>  include/qemu/osdep.h   |   2 +-
>  meson.build| 166 -
>  rules.mak  |   8 --
>  scripts/create_config  |   2 +
>  scripts/grepy.sh   |   3 +
>  scripts/minikconf.py   |   0
>  softmmu/qtest.c|   2 +-
>  16 files changed, 192 insertions(+), 102 deletions(-)
>  create mode 100755 scripts/grepy.sh
>  mode change 100755 => 100644 scripts/minikconf.py
...

> diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c
> index c55abfb01a..33441ad484 100644
> --- a/hw/i386/fw_cfg.c
> +++ b/hw/i386/fw_cfg.c
> @@ -22,7 +22,7 @@
>  #include "hw/nvram/fw_cfg.h"
>  #include "e820_memory_layout.h"
>  #include "kvm_i386.h"
> -#include "config-devices.h"
> +#include CONFIG_DEVICES

Suggestion: add a comment to this include, because it is hard to
figure out what it does (if you don't have minikconf + meson
background). At least it was not obvious to me. (other
occurrences in the codebase).

Regards,

Phil.




[PULL v8 062/152] meson: infrastructure for building emulators

2020-08-21 Thread Paolo Bonzini
Signed-off-by: Marc-André Lureau 
Signed-off-by: Paolo Bonzini 
---
 Makefile   |  74 ++
 Makefile.target|  19 +++--
 configure  |   6 --
 hw/i386/fw_cfg.c   |   2 +-
 hw/i386/pc.c   |   2 +-
 hw/i386/pc_piix.c  |   2 +-
 hw/i386/x86.c  |   2 +-
 hw/vfio/pci-quirks.c   |   2 +-
 hw/virtio/virtio-mem.c |   2 +-
 include/qemu/osdep.h   |   2 +-
 meson.build| 166 -
 rules.mak  |   8 --
 scripts/create_config  |   2 +
 scripts/grepy.sh   |   3 +
 scripts/minikconf.py   |   0
 softmmu/qtest.c|   2 +-
 16 files changed, 192 insertions(+), 102 deletions(-)
 create mode 100755 scripts/grepy.sh
 mode change 100755 => 100644 scripts/minikconf.py

diff --git a/Makefile b/Makefile
index 698bbdfcd3..19f167ba5f 100644
--- a/Makefile
+++ b/Makefile
@@ -121,8 +121,6 @@ include $(SRC_PATH)/rules.mak
 # lor is defined in rules.mak
 CONFIG_BLOCK := $(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS))
 
-generated-files-y = config-host.h
-
 generated-files-y += module_block.h
 generated-files-y += target/s390x/gen-features.h
 target/s390x/gen-features.h: Makefile.ninja
@@ -178,65 +176,6 @@ DOCS=
 endif
 
 SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet) 
BUILD_DIR=$(BUILD_DIR)
-SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(filter %-softmmu, 
$(TARGET_DIRS)))
-SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %.d, $(SUBDIR_DEVICES_MAK))
-
-ifeq ($(SUBDIR_DEVICES_MAK),)
-config-all-devices.mak: config-host.mak
-   $(call quiet-command,echo '# no devices' > $@,"GEN","$@")
-else
-config-all-devices.mak: $(SUBDIR_DEVICES_MAK) config-host.mak
-   $(call quiet-command, sed -n \
- 's|^\([^=]*\)=\(.*\)$$|\1:=$$(findstring y,$$(\1)\2)|p' \
- $(SUBDIR_DEVICES_MAK) | sort -u > $@, \
- "GEN","$@")
-endif
-
--include $(SUBDIR_DEVICES_MAK_DEP)
-
-# This has to be kept in sync with Kconfig.host.
-MINIKCONF_ARGS = \
-$(CONFIG_MINIKCONF_MODE) \
-$@ $*/config-devices.mak.d $< $(SRC_PATH)/Kconfig \
-CONFIG_TCG=$(CONFIG_TCG) \
-CONFIG_KVM=$(CONFIG_KVM) \
-CONFIG_SPICE=$(CONFIG_SPICE) \
-CONFIG_IVSHMEM=$(CONFIG_IVSHMEM) \
-CONFIG_TPM=$(CONFIG_TPM) \
-CONFIG_XEN=$(CONFIG_XEN) \
-CONFIG_OPENGL=$(CONFIG_OPENGL) \
-CONFIG_X11=$(CONFIG_X11) \
-CONFIG_VHOST_USER=$(CONFIG_VHOST_USER) \
-CONFIG_VHOST_KERNEL=$(CONFIG_VHOST_KERNEL) \
-CONFIG_VIRTFS=$(CONFIG_VIRTFS) \
-CONFIG_LINUX=$(CONFIG_LINUX) \
-CONFIG_PVRDMA=$(CONFIG_PVRDMA)
-
-MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py
-
-$(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak 
$(SRC_PATH)/Kconfig $(BUILD_DIR)/config-host.mak
-   $(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) \
-   > $@.tmp, "GEN", "$@.tmp")
-   $(call quiet-command, if test -f $@; then \
- if cmp -s $@.old $@; then \
-   mv $@.tmp $@; \
-   cp -p $@ $@.old; \
- else \
-   if test -f $@.old; then \
- echo "WARNING: $@ (user modified) out of date.";\
-   else \
- echo "WARNING: $@ out of date.";\
-   fi; \
-   echo "Run \"$(MAKE) defconfig\" to regenerate."; \
-   rm $@.tmp; \
- fi; \
-else \
- mv $@.tmp $@; \
- cp -p $@ $@.old; \
-fi,"GEN","$@");
-
-defconfig:
-   rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
 
 ifneq ($(wildcard config-host.mak),)
 include $(SRC_PATH)/Makefile.objs
@@ -279,10 +218,15 @@ $(SOFTMMU_FUZZ_RULES): $(io-obj-y)
 $(SOFTMMU_FUZZ_RULES): config-all-devices.mak
 $(SOFTMMU_FUZZ_RULES): $(edk2-decompressed)
 
+# meson: this is sub-optimal but going away after conversion
+TARGET_DEPS = $(patsubst %,%-config-target.h, $(TARGET_DIRS))
+TARGET_DEPS += $(patsubst %,%-config-devices.h, $(filter 
%-softmmu,$(TARGET_DIRS)))
+TARGET_DEPS += $(patsubst %,libqemu-%.fa, $(TARGET_DIRS))
+
 .PHONY: $(TARGET_DIRS_RULES)
 # The $(TARGET_DIRS_RULES) are of the form SUBDIR/GOAL, so that
 # $(dir $@) yields the sub-directory, and $(notdir $@) yields the sub-goal
-$(TARGET_DIRS_RULES):
+$(TARGET_DIRS_RULES): $(TARGET_DEPS)
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" 
TARGET_DIR="$(dir $@)" $(notdir $@),)
 
 # LIBFDT_lib="": avoid breaking existing trees with objects requiring -fPIC
@@ -370,7 +314,6 @@ clean: recurse-clean ninja-clean clean-ctlist
-test -f ninjatool && ./ninjatool $(if $(V),-v,) -t clean
 # avoid old build problems by removing potentially incorrect old files
rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h 
gen-op-arm.h
-   rm -f qemu-options.def
find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name 
'*.[oda]' \) -type f \
! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-aarch64.a \
! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-arm.a \
@@ -379,8 +322,