From 46504430e6b1f96ca8d805117ee4e20b74544c9f Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Sun, 30 Aug 2020 18:17:23 +0200 Subject: [PATCH 01/26] meson: bump submodule to 0.55.1 This version includes an important bugfix to avoid including unnecessary -Wl,-rpath flags. It also avoids the warnings on custom_targets with more than one output. Reported-by: Laurent Vivier Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier Signed-off-by: Paolo Bonzini --- configure | 2 +- meson | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 8dc981684b..f81900880a 100755 --- a/configure +++ b/configure @@ -2023,7 +2023,7 @@ python_version=$($python -c 'import sys; print("%d.%d.%d" % (sys.version_info[0] python="$python -B" if test -z "$meson"; then - if test "$explicit_python" = no && has meson && version_ge "$(meson --version)" 0.55.0; then + if test "$explicit_python" = no && has meson && version_ge "$(meson --version)" 0.55.1; then meson=meson elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then meson=git diff --git a/meson b/meson index d0c68dc115..68ed748f84 160000 --- a/meson +++ b/meson @@ -1 +1 @@ -Subproject commit d0c68dc11507a47b9b85de508e023d9590d60565 +Subproject commit 68ed748f84f14c2d4e62dcbd123816e5898eb04c From a10c8516ed59c1e4c0db9b0d9050960ed861703d Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 28 Aug 2020 19:32:40 +0200 Subject: [PATCH 02/26] block: always link with zlib The qcow2 driver needs the zlib dependency. While emulators provided it through the migration code, this is not true of the tools. Move the dependency from the qcow1 rule directly into block_ss so that it is included unconditionally. Fixes build with --disable-qcow1. Reported-by: Thomas Huth Reviewed-by: Thomas Huth Cc: qemu-block@nongnu.org Signed-off-by: Paolo Bonzini --- block/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/meson.build b/block/meson.build index 4dbbfe60b4..a3e56b7cd1 100644 --- a/block/meson.build +++ b/block/meson.build @@ -40,9 +40,9 @@ block_ss.add(files( 'vmdk.c', 'vpc.c', 'write-threshold.c', -), zstd) +), zstd, zlib) -block_ss.add(when: [zlib, 'CONFIG_QCOW1'], if_true: files('qcow.c')) +block_ss.add(when: 'CONFIG_QCOW1', if_true: files('qcow.c')) block_ss.add(when: 'CONFIG_VDI', if_true: files('vdi.c')) block_ss.add(when: 'CONFIG_CLOOP', if_true: files('cloop.c')) block_ss.add(when: 'CONFIG_BOCHS', if_true: files('bochs.c')) From 7161a43395c19206f1536b94b72cf7a90677275b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volker=20R=C3=BCmelin?= Date: Sat, 29 Aug 2020 12:41:58 +0200 Subject: [PATCH 03/26] meson: fix SDL2_image detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Configure used to probe for SDL2_image in sdl_image_probe (). Meson should do the same. This fixes the following error on my system: Run-time dependency sdl2 found: YES 2.0.8 Found CMake: /usr/bin/cmake (3.17.0) Run-time dependency sdl-image found: NO (tried pkgconfig and cmake) ../qemu-master/meson.build:256:2: ERROR: Dependency "sdl-image" not found, tried pkgconfig and cmake A full log can be found at /home/ruemelin/rpmbuild/BUILD /qemu-5.1.50-build/meson-logs/meson-log.txt ERROR: meson setup failed Signed-off-by: Volker Rümelin Message-Id: <20200829104158.7461-1-vr_qemu@t-online.de> Signed-off-by: Paolo Bonzini --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 1e7aee85e3..3c919e32f1 100644 --- a/meson.build +++ b/meson.build @@ -248,7 +248,7 @@ if sdl.found() # work around 2.0.8 bug sdl = declare_dependency(compile_args: '-Wno-undef', dependencies: sdl) - sdl_image = dependency('sdl-image', required: get_option('sdl_image'), + sdl_image = dependency('SDL2_image', required: get_option('sdl_image'), static: enable_static) else if get_option('sdl_image').enabled() From b17cf893ef1d1eeadc78ae3a265b302b759fd5c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 26 Aug 2020 17:06:17 +0400 Subject: [PATCH 04/26] meson: install pc-bios blobs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau Message-Id: <20200826130622.553318-2-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- Makefile | 31 ---------------------- pc-bios/meson.build | 63 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 31 deletions(-) diff --git a/Makefile b/Makefile index 81794d5c34..16b2ffa7fe 100644 --- a/Makefile +++ b/Makefile @@ -229,32 +229,6 @@ distclean: clean ninja-distclean rm -f linux-headers/asm rm -Rf .sdk -ifdef INSTALL_BLOBS -BLOBS=bios.bin bios-256k.bin bios-microvm.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \ -vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin \ -vgabios-ramfb.bin vgabios-bochs-display.bin vgabios-ati.bin \ -openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \ -pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \ -pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \ -efi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \ -efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \ -efi-e1000e.rom efi-vmxnet3.rom \ -qemu-nsis.bmp \ -bamboo.dtb canyonlands.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \ -multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin \ -s390-ccw.img s390-netboot.img \ -slof.bin skiboot.lid \ -palcode-clipper \ -u-boot.e500 u-boot-sam460-20100605.bin \ -qemu_vga.ndrv \ -edk2-licenses.txt \ -hppa-firmware.img \ -opensbi-riscv32-generic-fw_dynamic.bin opensbi-riscv64-generic-fw_dynamic.bin \ -opensbi-riscv32-generic-fw_dynamic.elf opensbi-riscv64-generic-fw_dynamic.elf -else -BLOBS= -endif - install-datadir: $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)" @@ -272,11 +246,6 @@ export DESTDIR install: all install-datadir install-localstatedir ifdef CONFIG_TRACE_SYSTEMTAP $(INSTALL_PROG) "scripts/qemu-trace-stap" $(DESTDIR)$(bindir) -endif -ifneq ($(BLOBS),) - set -e; for x in $(BLOBS); do \ - $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \ - done endif for s in $(ICON_SIZES); do \ mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps"; \ diff --git a/pc-bios/meson.build b/pc-bios/meson.build index b6389f5148..f608c2cdba 100644 --- a/pc-bios/meson.build +++ b/pc-bios/meson.build @@ -24,5 +24,68 @@ if 'DECOMPRESS_EDK2_BLOBS' in config_host endforeach endif +blobs = files( + 'bios.bin', + 'bios-256k.bin', + 'bios-microvm.bin', + 'sgabios.bin', + 'vgabios.bin', + 'vgabios-cirrus.bin', + 'vgabios-stdvga.bin', + 'vgabios-vmware.bin', + 'vgabios-qxl.bin', + 'vgabios-virtio.bin', + 'vgabios-ramfb.bin', + 'vgabios-bochs-display.bin', + 'vgabios-ati.bin', + 'openbios-sparc32', + 'openbios-sparc64', + 'openbios-ppc', + 'QEMU,tcx.bin', + 'QEMU,cgthree.bin', + 'pxe-e1000.rom', + 'pxe-eepro100.rom', + 'pxe-ne2k_pci.rom', + 'pxe-pcnet.rom', + 'pxe-rtl8139.rom', + 'pxe-virtio.rom', + 'efi-e1000.rom', + 'efi-eepro100.rom', + 'efi-ne2k_pci.rom', + 'efi-pcnet.rom', + 'efi-rtl8139.rom', + 'efi-virtio.rom', + 'efi-e1000e.rom', + 'efi-vmxnet3.rom', + 'qemu-nsis.bmp', + 'bamboo.dtb', + 'canyonlands.dtb', + 'petalogix-s3adsp1800.dtb', + 'petalogix-ml605.dtb', + 'multiboot.bin', + 'linuxboot.bin', + 'linuxboot_dma.bin', + 'kvmvapic.bin', + 'pvh.bin', + 's390-ccw.img', + 's390-netboot.img', + 'slof.bin', + 'skiboot.lid', + 'palcode-clipper', + 'u-boot.e500', + 'u-boot-sam460-20100605.bin', + 'qemu_vga.ndrv', + 'edk2-licenses.txt', + 'hppa-firmware.img', + 'opensbi-riscv32-generic-fw_dynamic.bin', + 'opensbi-riscv64-generic-fw_dynamic.bin', + 'opensbi-riscv32-generic-fw_dynamic.elf', + 'opensbi-riscv64-generic-fw_dynamic.elf', +) + +if install_blobs + install_data(blobs, install_dir: config_host['qemu_datadir']) +endif + subdir('descriptors') subdir('keymaps') From f5aa6320e83b0e8c1a14fd464b1fe6243c20b6d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 26 Aug 2020 17:06:18 +0400 Subject: [PATCH 05/26] meson: install scripts/qemu-trace-stap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau Message-Id: <20200826130622.553318-3-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- Makefile | 3 --- meson.build | 1 + scripts/meson.build | 3 +++ 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 scripts/meson.build diff --git a/Makefile b/Makefile index 16b2ffa7fe..058cf87f54 100644 --- a/Makefile +++ b/Makefile @@ -244,9 +244,6 @@ ICON_SIZES=16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512 # Needed by "meson install" export DESTDIR install: all install-datadir install-localstatedir -ifdef CONFIG_TRACE_SYSTEMTAP - $(INSTALL_PROG) "scripts/qemu-trace-stap" $(DESTDIR)$(bindir) -endif for s in $(ICON_SIZES); do \ mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps"; \ $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_$${s}.png \ diff --git a/meson.build b/meson.build index 3c919e32f1..6b2fc76933 100644 --- a/meson.build +++ b/meson.build @@ -1138,6 +1138,7 @@ if have_tools endif endif +subdir('scripts') subdir('tools') subdir('pc-bios') subdir('tests') diff --git a/scripts/meson.build b/scripts/meson.build new file mode 100644 index 0000000000..e8cc63896d --- /dev/null +++ b/scripts/meson.build @@ -0,0 +1,3 @@ +if 'CONFIG_TRACE_SYSTEMTAP' in config_host + install_data('qemu-trace-stap', install_dir: get_option('bindir')) +endif From a4d88926c6d37aed583e59c72f9074bc77c0b683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 26 Aug 2020 17:06:19 +0400 Subject: [PATCH 06/26] meson: install icons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau Message-Id: <20200826130622.553318-4-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- Makefile | 12 ------------ ui/icons/meson.build | 13 +++++++++++++ ui/meson.build | 1 + 3 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 ui/icons/meson.build diff --git a/Makefile b/Makefile index 058cf87f54..d1a3cd77a5 100644 --- a/Makefile +++ b/Makefile @@ -239,22 +239,10 @@ ifeq ($(CONFIG_GUEST_AGENT),y) endif endif -ICON_SIZES=16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512 # Needed by "meson install" export DESTDIR install: all install-datadir install-localstatedir - for s in $(ICON_SIZES); do \ - mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps"; \ - $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_$${s}.png \ - "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps/qemu.png"; \ - done; \ - mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/32x32/apps"; \ - $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_32x32.bmp \ - "$(DESTDIR)$(qemu_icondir)/hicolor/32x32/apps/qemu.bmp"; \ - mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/scalable/apps"; \ - $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu.svg \ - "$(DESTDIR)$(qemu_icondir)/hicolor/scalable/apps/qemu.svg" mkdir -p "$(DESTDIR)$(qemu_desktopdir)" $(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \ "$(DESTDIR)$(qemu_desktopdir)/qemu.desktop" diff --git a/ui/icons/meson.build b/ui/icons/meson.build new file mode 100644 index 0000000000..b6e21f6ad7 --- /dev/null +++ b/ui/icons/meson.build @@ -0,0 +1,13 @@ +foreach s: [16, 24, 32, 48, 64, 128, 256, 512] + s = '@0@x@0@'.format(s.to_string()) + install_data('qemu_@0@.png'.format(s), + rename: 'qemu.png', + install_dir: config_host['qemu_icondir'] / 'hicolor' / s / 'apps') +endforeach + +install_data('qemu_32x32.bmp', + rename: 'qemu.bmp', + install_dir: config_host['qemu_icondir'] / 'hicolor' / '32x32' / 'apps') + +install_data('qemu.svg', + install_dir: config_host['qemu_icondir'] / 'hicolor' / 'scalable' / 'apps') diff --git a/ui/meson.build b/ui/meson.build index 962e776569..dddffc9a7a 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -112,5 +112,6 @@ if have_system or xkbcommon.found() endif subdir('shader') +subdir('icons') modules += {'ui': ui_modules} From c04c071f40c4ce96049848e4fc3b60c961502b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 26 Aug 2020 17:06:20 +0400 Subject: [PATCH 07/26] meson: install desktop file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau Message-Id: <20200826130622.553318-5-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- Makefile | 3 --- ui/meson.build | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d1a3cd77a5..dc3c20dd5e 100644 --- a/Makefile +++ b/Makefile @@ -243,9 +243,6 @@ endif # Needed by "meson install" export DESTDIR install: all install-datadir install-localstatedir - mkdir -p "$(DESTDIR)$(qemu_desktopdir)" - $(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \ - "$(DESTDIR)$(qemu_desktopdir)/qemu.desktop" $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps" ifdef CONFIG_WIN32 diff --git a/ui/meson.build b/ui/meson.build index dddffc9a7a..aa8aa31516 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -114,4 +114,6 @@ endif subdir('shader') subdir('icons') +install_data('qemu.desktop', install_dir: config_host['qemu_desktopdir']) + modules += {'ui': ui_modules} From 8ab1aabc5d33a09ceee1adc1148f62cbb16cb43d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 26 Aug 2020 17:06:21 +0400 Subject: [PATCH 08/26] meson: install $localstatedir/run for qga MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau Message-Id: <20200826130622.553318-6-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- Makefile | 10 +--------- qga/meson.build | 2 ++ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index dc3c20dd5e..9a9e7c0301 100644 --- a/Makefile +++ b/Makefile @@ -232,17 +232,9 @@ distclean: clean ninja-distclean install-datadir: $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)" -install-localstatedir: -ifdef CONFIG_POSIX -ifeq ($(CONFIG_GUEST_AGENT),y) - $(INSTALL_DIR) "$(DESTDIR)$(qemu_localstatedir)"/run -endif -endif - - # Needed by "meson install" export DESTDIR -install: all install-datadir install-localstatedir +install: all install-datadir $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps" ifdef CONFIG_WIN32 diff --git a/qga/meson.build b/qga/meson.build index 3f28f74b52..e5c5778a3e 100644 --- a/qga/meson.build +++ b/qga/meson.build @@ -82,6 +82,8 @@ if targetos == 'windows' all_qga += [qga_msi] alias_target('msi', qga_msi) endif +else + install_subdir('run', install_dir: get_option('localstatedir')) endif alias_target('qemu-ga', all_qga) From 771f0fb8c59a0d229909b92cd8ce0284de2f2325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 26 Aug 2020 17:06:22 +0400 Subject: [PATCH 09/26] build-sys: remove install target from Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now covered by meson Signed-off-by: Marc-André Lureau Message-Id: <20200826130622.553318-7-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Makefile b/Makefile index 9a9e7c0301..75db8be52e 100644 --- a/Makefile +++ b/Makefile @@ -229,13 +229,8 @@ distclean: clean ninja-distclean rm -f linux-headers/asm rm -Rf .sdk -install-datadir: - $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)" - # Needed by "meson install" export DESTDIR -install: all install-datadir - $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps" ifdef CONFIG_WIN32 From 1ffb3bbb3cb1273a2ad17599dbe82f9c8d3682a2 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 28 Aug 2020 19:33:54 +0200 Subject: [PATCH 10/26] meson: move zlib detection to meson MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Meson includes the same logic that tries to look for -lz if pkg-config (and cmake) cannot find zlib. The undocumented --disable-zlib-test option becomes a no-op. There is still an instance of "-lz" in the LIBS directory. It will go away as soon as tests are converted to meson, because the zlib dependency does not propagate from libblock.fa to the Makefile-build unit tests. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 32 +------------------------------- meson.build | 6 +----- 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/configure b/configure index f81900880a..e8946aeefb 100755 --- a/configure +++ b/configure @@ -502,7 +502,6 @@ opengl="" opengl_dmabuf="no" cpuid_h="no" avx2_opt="" -zlib="yes" capstone="" lzo="" snappy="" @@ -1428,7 +1427,7 @@ for opt do ;; --enable-usb-redir) usb_redir="yes" ;; - --disable-zlib-test) zlib="no" + --disable-zlib-test) ;; --disable-lzo) lzo="no" ;; @@ -3904,30 +3903,6 @@ if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then fi fi -######################################### -# zlib check - -if test "$zlib" != "no" ; then - if $pkg_config --exists zlib; then - zlib_cflags=$($pkg_config --cflags zlib) - zlib_libs=$($pkg_config --libs zlib) - QEMU_CFLAGS="$zlib_cflags $QEMU_CFLAGS" - LIBS="$zlib_libs $LIBS" - else - cat > $TMPC << EOF -#include -int main(void) { zlibVersion(); return 0; } -EOF - if compile_prog "" "-lz" ; then - zlib_libs=-lz - LIBS="$LIBS $zlib_libs" - else - error_exit "zlib check failed" \ - "Make sure to have the zlib libs and headers installed." - fi - fi -fi - ########################################## # SHA command probe for modules if test "$modules" = yes; then @@ -7135,11 +7110,6 @@ fi if test "$posix_memalign" = "yes" ; then echo "CONFIG_POSIX_MEMALIGN=y" >> $config_host_mak fi -if test "$zlib" != "no" ; then - echo "CONFIG_ZLIB=y" >> $config_host_mak - echo "ZLIB_CFLAGS=$zlib_cflags" >> $config_host_mak - echo "ZLIB_LIBS=$zlib_libs" >> $config_host_mak -fi if test "$spice" = "yes" ; then echo "CONFIG_SPICE=y" >> $config_host_mak echo "SPICE_CFLAGS=$spice_cflags" >> $config_host_mak diff --git a/meson.build b/meson.build index 6b2fc76933..b68e1bdfc7 100644 --- a/meson.build +++ b/meson.build @@ -134,11 +134,7 @@ if 'CONFIG_AUTH_PAM' in config_host pam = cc.find_library('pam') endif libaio = cc.find_library('aio', required: false) -zlib = not_found -if 'CONFIG_ZLIB' in config_host - zlib = declare_dependency(compile_args: config_host['ZLIB_CFLAGS'].split(), - link_args: config_host['ZLIB_LIBS'].split()) -endif +zlib = dependency('zlib', required: true, static: enable_static) linux_io_uring = not_found if 'CONFIG_LINUX_IO_URING' in config_host linux_io_uring = declare_dependency(compile_args: config_host['LINUX_IO_URING_CFLAGS'].split(), From 77433a5fef35de9ac636a1f36dc1fad2855baa5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 26 Aug 2020 15:04:12 +0400 Subject: [PATCH 11/26] configure: rename confsuffix option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The value is used to construct conf/mod/data directories. Signed-off-by: Marc-André Lureau Message-Id: <20200826110419.528931-2-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/configure b/configure index e8946aeefb..46fe7914c3 100755 --- a/configure +++ b/configure @@ -474,7 +474,7 @@ modules="no" module_upgrades="no" prefix="/usr/local" firmwarepath="\${prefix}/share/qemu-firmware" -confsuffix="/qemu" +qemu_suffix="/qemu" slirp="" oss_lib="" bsd="no" @@ -1012,7 +1012,7 @@ if test "$mingw32" = "yes" ; then LIBS="-liberty $LIBS" fi prefix="c:/Program Files/QEMU" - confsuffix="" + qemu_suffix="" libs_qga="-lws2_32 -lwinmm -lpowrprof -lwtsapi32 -lwininet -liphlpapi -lnetapi32 $libs_qga" fi @@ -1122,7 +1122,7 @@ for opt do ;; --datadir=*) datadir="$optarg" ;; - --with-confsuffix=*) confsuffix="$optarg" + --with-suffix=*) qemu_suffix="$optarg" ;; --docdir=*) qemu_docdir="$optarg" ;; @@ -1832,16 +1832,16 @@ Advanced options (experts only): --with-git=GIT use specified git [$git] --static enable static build [$static] --mandir=PATH install man pages in PATH - --datadir=PATH install firmware in PATH$confsuffix - --docdir=PATH install documentation in PATH$confsuffix + --datadir=PATH install firmware in PATH$qemu_suffix + --docdir=PATH install documentation in PATH$qemu_suffix --bindir=PATH install binaries in PATH --libdir=PATH install libraries in PATH --libexecdir=PATH install helper binaries in PATH - --sysconfdir=PATH install config in PATH$confsuffix + --sysconfdir=PATH install config in PATH$qemu_suffix --localstatedir=PATH install local state in PATH (set at runtime on win32) --firmwarepath=PATH search PATH for firmware files --efi-aarch64=PATH PATH of efi file to use for aarch64 VMs. - --with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$confsuffix] + --with-suffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$qemu_suffix] --with-pkgversion=VERS use specified string as sub-version of the package --enable-debug enable common debug build options --enable-sanitizers enable default sanitizers @@ -6449,9 +6449,9 @@ EOF fi fi -qemu_confdir=$sysconfdir$confsuffix -qemu_moddir=$libdir$confsuffix -qemu_datadir=$datadir$confsuffix +qemu_confdir=$sysconfdir$qemu_suffix +qemu_moddir=$libdir$qemu_suffix +qemu_datadir=$datadir$qemu_suffix qemu_localedir="$datadir/locale" qemu_icondir="$datadir/icons" qemu_desktopdir="$datadir/applications" From 10ff82d1ffb894d0bcd0e895afe903b9790b7d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 26 Aug 2020 15:04:13 +0400 Subject: [PATCH 12/26] configure: always /-seperate directory from qemu_suffix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise, we may accept very strange directory names... While at it, quote the variables. Signed-off-by: Marc-André Lureau Message-Id: <20200826110419.528931-3-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 46fe7914c3..66d7a72aa9 100755 --- a/configure +++ b/configure @@ -474,7 +474,7 @@ modules="no" module_upgrades="no" prefix="/usr/local" firmwarepath="\${prefix}/share/qemu-firmware" -qemu_suffix="/qemu" +qemu_suffix="qemu" slirp="" oss_lib="" bsd="no" @@ -1832,12 +1832,12 @@ Advanced options (experts only): --with-git=GIT use specified git [$git] --static enable static build [$static] --mandir=PATH install man pages in PATH - --datadir=PATH install firmware in PATH$qemu_suffix - --docdir=PATH install documentation in PATH$qemu_suffix + --datadir=PATH install firmware in PATH/$qemu_suffix + --docdir=PATH install documentation in PATH/$qemu_suffix --bindir=PATH install binaries in PATH --libdir=PATH install libraries in PATH --libexecdir=PATH install helper binaries in PATH - --sysconfdir=PATH install config in PATH$qemu_suffix + --sysconfdir=PATH install config in PATH/$qemu_suffix --localstatedir=PATH install local state in PATH (set at runtime on win32) --firmwarepath=PATH search PATH for firmware files --efi-aarch64=PATH PATH of efi file to use for aarch64 VMs. @@ -6449,9 +6449,9 @@ EOF fi fi -qemu_confdir=$sysconfdir$qemu_suffix -qemu_moddir=$libdir$qemu_suffix -qemu_datadir=$datadir$qemu_suffix +qemu_confdir="$sysconfdir/$qemu_suffix" +qemu_moddir="$libdir/$qemu_suffix" +qemu_datadir="$datadir/$qemu_suffix" qemu_localedir="$datadir/locale" qemu_icondir="$datadir/icons" qemu_desktopdir="$datadir/applications" From ca8c0909f013cc15fdff2edf8bbd38ffa8385550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 26 Aug 2020 15:04:14 +0400 Subject: [PATCH 13/26] configure: build docdir like other suffixed directories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As documented in --help for --docdir. Signed-off-by: Marc-André Lureau Message-Id: <20200826110419.528931-4-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 66d7a72aa9..625b7ba062 100755 --- a/configure +++ b/configure @@ -1684,14 +1684,14 @@ includedir="${includedir:-$prefix/include}" if test "$mingw32" = "yes" ; then mandir="$prefix" datadir="$prefix" - qemu_docdir="$prefix" + docdir="$prefix" bindir="$prefix" sysconfdir="$prefix" local_statedir= else mandir="${mandir:-$prefix/share/man}" datadir="${datadir:-$prefix/share}" - qemu_docdir="${qemu_docdir:-$prefix/share/doc/qemu}" + docdir="${docdir:-$prefix/share/doc}" bindir="${bindir:-$prefix/bin}" sysconfdir="${sysconfdir:-$prefix/etc}" local_statedir="${local_statedir:-$prefix/var}" @@ -1841,7 +1841,7 @@ Advanced options (experts only): --localstatedir=PATH install local state in PATH (set at runtime on win32) --firmwarepath=PATH search PATH for firmware files --efi-aarch64=PATH PATH of efi file to use for aarch64 VMs. - --with-suffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$qemu_suffix] + --with-suffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir/docdir [$qemu_suffix] --with-pkgversion=VERS use specified string as sub-version of the package --enable-debug enable common debug build options --enable-sanitizers enable default sanitizers @@ -6452,6 +6452,7 @@ fi qemu_confdir="$sysconfdir/$qemu_suffix" qemu_moddir="$libdir/$qemu_suffix" qemu_datadir="$datadir/$qemu_suffix" +qemu_docdir="$docdir/$qemu_suffix" qemu_localedir="$datadir/locale" qemu_icondir="$datadir/icons" qemu_desktopdir="$datadir/applications" From 73f3aa3766e64492559e3ec05b5cc2cfde0d2c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 26 Aug 2020 15:04:15 +0400 Subject: [PATCH 14/26] meson: pass qemu_suffix option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following patches will make use of it to fix installation paths. Signed-off-by: Marc-André Lureau Message-Id: <20200826110419.528931-5-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 1 + meson_options.txt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/configure b/configure index 625b7ba062..78aae9c2a0 100755 --- a/configure +++ b/configure @@ -8198,6 +8198,7 @@ NINJA=${ninja:-$PWD/ninjatool} $meson setup \ --mandir "${pre_prefix}$mandir" \ --sysconfdir "${pre_prefix}$sysconfdir" \ --localstatedir "${pre_prefix}$local_statedir" \ + -Dqemu_suffix="$qemu_suffix" \ -Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \ -Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \ -Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \ diff --git a/meson_options.txt b/meson_options.txt index aef2de6523..dfdcf85063 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,5 @@ +option('qemu_suffix', type : 'string', value: '/qemu', + description: 'Suffix for QEMU data/modules/config directories (can be empty)') option('gettext', type : 'boolean', value : true) option('sdl', type : 'feature', value : 'auto') option('sdl_image', type : 'feature', value : 'auto') From ab4c0996f80d43d1fc28c6e76f4ecb27423a7e29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 26 Aug 2020 15:04:16 +0400 Subject: [PATCH 15/26] meson: use meson datadir instead of qemu_datadir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When cross-compiling, by default qemu_datadir is 'c:\Program Files\QEMU', which is not recognized as being an absolute path, and meson will end up adding the prefix again. Signed-off-by: Marc-André Lureau Message-Id: <20200826110419.528931-6-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- contrib/vhost-user-gpu/meson.build | 2 +- meson.build | 3 ++- meson_options.txt | 2 +- pc-bios/descriptors/meson.build | 2 +- pc-bios/keymaps/meson.build | 6 +++--- pc-bios/meson.build | 2 +- tools/virtiofsd/meson.build | 2 +- trace/meson.build | 2 +- 8 files changed, 11 insertions(+), 10 deletions(-) diff --git a/contrib/vhost-user-gpu/meson.build b/contrib/vhost-user-gpu/meson.build index 12d608c2e7..7d9b29da8b 100644 --- a/contrib/vhost-user-gpu/meson.build +++ b/contrib/vhost-user-gpu/meson.build @@ -10,5 +10,5 @@ if 'CONFIG_TOOLS' in config_host and 'CONFIG_VIRGL' in config_host \ configure_file(input: '50-qemu-gpu.json.in', output: '50-qemu-gpu.json', configuration: config_host, - install_dir: config_host['qemu_datadir'] / 'vhost-user') + install_dir: qemu_datadir / 'vhost-user') endif diff --git a/meson.build b/meson.build index b68e1bdfc7..6bcfafbc1f 100644 --- a/meson.build +++ b/meson.build @@ -18,6 +18,7 @@ config_all_disas = keyval.load(meson.current_build_dir() / 'config-all-disas.mak enable_modules = 'CONFIG_MODULES' in config_host enable_static = 'CONFIG_STATIC' in config_host build_docs = 'BUILD_DOCS' in config_host +qemu_datadir = get_option('datadir') / get_option('qemu_suffix') config_host_data = configuration_data() genh = [] @@ -1055,7 +1056,7 @@ foreach target : target_dirs output: exe['name'] + stp['ext'], capture: true, install: stp['install'], - install_dir: config_host['qemu_datadir'] / '../systemtap/tapset', + install_dir: qemu_datadir / '../systemtap/tapset', command: [ tracetool, '--group=all', '--format=' + stp['fmt'], '--binary=' + stp['bin'], diff --git a/meson_options.txt b/meson_options.txt index dfdcf85063..f4275691bd 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,4 +1,4 @@ -option('qemu_suffix', type : 'string', value: '/qemu', +option('qemu_suffix', type : 'string', value: 'qemu', description: 'Suffix for QEMU data/modules/config directories (can be empty)') option('gettext', type : 'boolean', value : true) option('sdl', type : 'feature', value : 'auto') diff --git a/pc-bios/descriptors/meson.build b/pc-bios/descriptors/meson.build index 7c715bace8..3798d32372 100644 --- a/pc-bios/descriptors/meson.build +++ b/pc-bios/descriptors/meson.build @@ -10,5 +10,5 @@ foreach f: [ output: f, configuration: {'DATADIR': config_host['qemu_datadir']}, install: install_blobs, - install_dir: config_host['qemu_datadir'] / 'firmware') + install_dir: qemu_datadir / 'firmware') endforeach diff --git a/pc-bios/keymaps/meson.build b/pc-bios/keymaps/meson.build index b737c82230..bbac83ece3 100644 --- a/pc-bios/keymaps/meson.build +++ b/pc-bios/keymaps/meson.build @@ -44,13 +44,13 @@ foreach km, args: keymaps build_by_default: true, output: km, command: [native_qemu_keymap, '-f', '@OUTPUT@', args.split()], - install_dir: config_host['qemu_datadir'] / 'keymaps') + install_dir: qemu_datadir / 'keymaps') endforeach if t.length() > 0 alias_target('update-keymaps', t) else # install from the source tree - install_data(keymaps.keys(), install_dir: config_host['qemu_datadir'] / 'keymaps') + install_data(keymaps.keys(), install_dir: qemu_datadir / 'keymaps') endif -install_data(['sl', 'sv'], install_dir: config_host['qemu_datadir'] / 'keymaps') +install_data(['sl', 'sv'], install_dir: qemu_datadir / 'keymaps') diff --git a/pc-bios/meson.build b/pc-bios/meson.build index f608c2cdba..8087e5c0a7 100644 --- a/pc-bios/meson.build +++ b/pc-bios/meson.build @@ -19,7 +19,7 @@ if 'DECOMPRESS_EDK2_BLOBS' in config_host input: '@0@.bz2'.format(f), capture: true, install: install_blobs, - install_dir: config_host['qemu_datadir'], + install_dir: qemu_datadir, command: [ bzip2, '-dc', '@INPUT0@' ]) endforeach endif diff --git a/tools/virtiofsd/meson.build b/tools/virtiofsd/meson.build index d1e23c5760..50022ed89e 100644 --- a/tools/virtiofsd/meson.build +++ b/tools/virtiofsd/meson.build @@ -16,4 +16,4 @@ executable('virtiofsd', files( configure_file(input: '50-qemu-virtiofsd.json.in', output: '50-qemu-virtiofsd.json', configuration: config_host, - install_dir: config_host['qemu_datadir'] / 'vhost-user') + install_dir: qemu_datadir / 'vhost-user') diff --git a/trace/meson.build b/trace/meson.build index 1c1fb31a61..b36937d3a6 100644 --- a/trace/meson.build +++ b/trace/meson.build @@ -58,7 +58,7 @@ trace_events_all = custom_target('trace-events-all', command: [ 'cat', '@INPUT@' ], capture: true, install: true, - install_dir: config_host['qemu_datadir']) + install_dir: qemu_datadir) foreach d : [ ['generated-tcg-tracers.h', 'tcg-h'], From 491e74c158d6bcac3291d2ec354093029169e572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 26 Aug 2020 15:04:17 +0400 Subject: [PATCH 16/26] meson: pass docdir option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When cross-compiling, by default qemu_docdir is 'c:\Program Files\QEMU\' which is not recognized as being an absolute path, and meson will end up adding the prefix again. Add an option to pass docdir location to meson, pre-prefixed like we do with other directories, build qemu_docdir with the common suffix and use that instead of config_host['qemu_docdir']. Signed-off-by: Marc-André Lureau Message-Id: <20200826110419.528931-7-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 2 +- docs/meson.build | 4 ++-- meson.build | 4 +++- meson_options.txt | 2 ++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 78aae9c2a0..1f478a46a9 100755 --- a/configure +++ b/configure @@ -6653,7 +6653,6 @@ echo "sysconfdir=$sysconfdir" >> $config_host_mak echo "qemu_confdir=$qemu_confdir" >> $config_host_mak echo "qemu_datadir=$qemu_datadir" >> $config_host_mak echo "qemu_firmwarepath=$firmwarepath" >> $config_host_mak -echo "qemu_docdir=$qemu_docdir" >> $config_host_mak echo "qemu_moddir=$qemu_moddir" >> $config_host_mak if test "$mingw32" = "no" ; then echo "qemu_localstatedir=$local_statedir" >> $config_host_mak @@ -8198,6 +8197,7 @@ NINJA=${ninja:-$PWD/ninjatool} $meson setup \ --mandir "${pre_prefix}$mandir" \ --sysconfdir "${pre_prefix}$sysconfdir" \ --localstatedir "${pre_prefix}$local_statedir" \ + -Ddocdir="${pre_prefix}$docdir" \ -Dqemu_suffix="$qemu_suffix" \ -Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \ -Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \ diff --git a/docs/meson.build b/docs/meson.build index 8b059a8e39..50f367349b 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -10,7 +10,7 @@ if build_docs configure_file(output: 'index.html', input: files('index.html.in'), configuration: {'VERSION': meson.project_version()}, - install_dir: config_host['qemu_docdir']) + install_dir: qemu_docdir) manuals = [ 'devel', 'interop', 'tools', 'specs', 'system', 'user' ] man_pages = { 'interop' : { @@ -48,7 +48,7 @@ if build_docs input_dir, output_dir]) sphinxdocs += this_manual if build_docs and manual != 'devel' - install_subdir(output_dir, install_dir: config_host['qemu_docdir']) + install_subdir(output_dir, install_dir: qemu_docdir) endif these_man_pages = [] diff --git a/meson.build b/meson.build index 6bcfafbc1f..abcfd5cd72 100644 --- a/meson.build +++ b/meson.build @@ -19,6 +19,7 @@ enable_modules = 'CONFIG_MODULES' in config_host enable_static = 'CONFIG_STATIC' in config_host build_docs = 'BUILD_DOCS' in config_host qemu_datadir = get_option('datadir') / get_option('qemu_suffix') +qemu_docdir = get_option('docdir') / get_option('qemu_suffix') config_host_data = configuration_data() genh = [] @@ -1182,7 +1183,7 @@ if build_docs input: input, output: output, install: true, - install_dir: config_host['qemu_docdir'] / 'interop', + install_dir: qemu_docdir / 'interop', command: cmd + args) endforeach alias_target(ext, t) @@ -1245,6 +1246,7 @@ if targetos != 'windows' else summary_info += {'local state directory': 'queried at runtime'} endif +summary_info += {'Doc directory': get_option('docdir')} summary_info += {'Build directory': meson.current_build_dir()} summary_info += {'Source path': meson.current_source_dir()} summary_info += {'GIT binary': config_host['GIT']} diff --git a/meson_options.txt b/meson_options.txt index f4275691bd..c3120fa359 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,5 +1,7 @@ option('qemu_suffix', type : 'string', value: 'qemu', description: 'Suffix for QEMU data/modules/config directories (can be empty)') +option('docdir', type : 'string', value : 'doc', + description: 'Base directory for documentation installation (can be empty)') option('gettext', type : 'boolean', value : true) option('sdl', type : 'feature', value : 'auto') option('sdl_image', type : 'feature', value : 'auto') From b81efab7c78777b00c6f385c17a24d19443fe15a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 26 Aug 2020 15:04:18 +0400 Subject: [PATCH 17/26] meson: use meson mandir instead of qemu_mandir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When cross-compiling, by default qemu_mandir is 'c:\Program Files\QEMU', which is not recognized as being an absolute path, and meson will end up adding the prefix again. Use the pre-prefixed meson mandir option instead. Reviewed-by: Daniel P. Berrangé Signed-off-by: Marc-André Lureau Message-Id: <20200826110419.528931-8-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 1 - meson.build | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 1f478a46a9..b9e977f13d 100755 --- a/configure +++ b/configure @@ -6648,7 +6648,6 @@ echo "bindir=$bindir" >> $config_host_mak echo "libdir=$libdir" >> $config_host_mak echo "libexecdir=$libexecdir" >> $config_host_mak echo "includedir=$includedir" >> $config_host_mak -echo "mandir=$mandir" >> $config_host_mak echo "sysconfdir=$sysconfdir" >> $config_host_mak echo "qemu_confdir=$qemu_confdir" >> $config_host_mak echo "qemu_datadir=$qemu_datadir" >> $config_host_mak diff --git a/meson.build b/meson.build index abcfd5cd72..164929f310 100644 --- a/meson.build +++ b/meson.build @@ -1223,7 +1223,7 @@ if build_docs output: man, capture: true, install: true, - install_dir: config_host['mandir'] / 'man7', + install_dir: get_option('mandir') / 'man7', command: [pod2man, '--utf8', '--section=7', '--center=" "', '--release=" "', '@INPUT@']) endforeach @@ -1242,7 +1242,7 @@ summary_info += {'include directory': config_host['includedir']} summary_info += {'config directory': config_host['sysconfdir']} if targetos != 'windows' summary_info += {'local state directory': config_host['qemu_localstatedir']} - summary_info += {'Manual directory': config_host['mandir']} + summary_info += {'Manual directory': get_option('mandir')} else summary_info += {'local state directory': 'queried at runtime'} endif From 8adfeba953e050efb546a92682c15fbddbdac61e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 26 Aug 2020 15:04:19 +0400 Subject: [PATCH 18/26] meson: add NSIS building MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Message-Id: <20200826110419.528931-9-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- Makefile | 56 ----------------------------------- meson.build | 25 ++++++++++++++++ scripts/nsis.py | 78 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 56 deletions(-) create mode 100644 scripts/nsis.py diff --git a/Makefile b/Makefile index 75db8be52e..f187ddf47a 100644 --- a/Makefile +++ b/Makefile @@ -232,62 +232,6 @@ distclean: clean ninja-distclean # Needed by "meson install" export DESTDIR -ifdef CONFIG_WIN32 - -INSTALLER = qemu-setup-$(VERSION)$(EXESUF) - -nsisflags = -V2 -NOCD - -ifneq ($(wildcard $(SRC_PATH)/dll),) -ifeq ($(ARCH),x86_64) -# 64 bit executables -DLL_PATH = $(SRC_PATH)/dll/w64 -nsisflags += -DW64 -else -# 32 bit executables -DLL_PATH = $(SRC_PATH)/dll/w32 -endif -endif - -.PHONY: installer -installer: $(INSTALLER) - -INSTDIR=/tmp/qemu-nsis - -$(INSTALLER): $(SRC_PATH)/qemu.nsi - $(MAKE) install DESTDIR=${INSTDIR} -ifdef SIGNCODE - (cd ${INSTDIR}/${bindir}; \ - for i in *.exe; do \ - $(SIGNCODE) $${i}; \ - done \ - ) -endif # SIGNCODE - (cd ${INSTDIR}/${bindir}; \ - for i in qemu-system-*.exe; do \ - arch=$${i%.exe}; \ - arch=$${arch#qemu-system-}; \ - echo Section \"$$arch\" Section_$$arch; \ - echo SetOutPath \"\$$INSTDIR\"; \ - echo File \"\$${BINDIR}\\$$i\"; \ - echo SectionEnd; \ - done \ - ) >${INSTDIR}/${bindir}/system-emulations.nsh - makensis $(nsisflags) \ - $(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \ - $(if $(CONFIG_GTK),-DCONFIG_GTK="y") \ - -DBINDIR="${INSTDIR}/${bindir}" \ - $(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \ - -DSRCDIR="$(SRC_PATH)" \ - -DOUTFILE="$(INSTALLER)" \ - -DDISPLAYVERSION="$(VERSION)" \ - $(SRC_PATH)/qemu.nsi - rm -r ${INSTDIR} -ifdef SIGNCODE - $(SIGNCODE) $(INSTALLER) -endif # SIGNCODE -endif # CONFIG_WIN - # Add a dependency on the generated files, so that they are always # rebuilt before other object files ifneq ($(wildcard config-host.mak),) diff --git a/meson.build b/meson.build index 164929f310..e8a0f12020 100644 --- a/meson.build +++ b/meson.build @@ -1230,6 +1230,31 @@ if build_docs endif endif +if host_machine.system() == 'windows' + nsis_cmd = [ + find_program('scripts/nsis.py'), + '@OUTPUT@', + get_option('prefix'), + meson.current_source_dir(), + host_machine.cpu_family(), + '--', + '-DDISPLAYVERSION=' + meson.project_version(), + ] + if build_docs + nsis_cmd += '-DCONFIG_DOCUMENTATION=y' + endif + if 'CONFIG_GTK' in config_host + nsis_cmd += '-DCONFIG_GTK=y' + endif + + nsis = custom_target('nsis', + output: 'qemu-setup-' + meson.project_version() + '.exe', + input: files('qemu.nsi'), + build_always_stale: true, + command: nsis_cmd + ['@INPUT@']) + alias_target('installer', nsis) +endif + summary_info = {} summary_info += {'Install prefix': config_host['prefix']} summary_info += {'BIOS directory': config_host['qemu_datadir']} diff --git a/scripts/nsis.py b/scripts/nsis.py new file mode 100644 index 0000000000..e1c409344e --- /dev/null +++ b/scripts/nsis.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2020 Red Hat, Inc. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import argparse +import glob +import os +import shutil +import subprocess +import tempfile + + +def signcode(path): + cmd = os.environ.get("SIGNCODE") + if not cmd: + return + subprocess.run([cmd, path]) + + +def main(): + parser = argparse.ArgumentParser(description="QEMU NSIS build helper.") + parser.add_argument("outfile") + parser.add_argument("prefix") + parser.add_argument("srcdir") + parser.add_argument("cpu") + parser.add_argument("nsisargs", nargs="*") + args = parser.parse_args() + + destdir = tempfile.mkdtemp() + try: + subprocess.run(["make", "install", "DESTDIR=" + destdir + os.path.sep]) + with open( + os.path.join(destdir + args.prefix, "system-emulations.nsh"), "w" + ) as nsh: + for exe in glob.glob( + os.path.join(destdir + args.prefix, "qemu-system-*.exe") + ): + exe = os.path.basename(exe) + arch = exe[12:-4] + nsh.write( + """ + Section "{0}" Section_{0} + SetOutPath "$INSTDIR" + File "${{BINDIR}}\\{1}" + SectionEnd + """.format( + arch, exe + ) + ) + + for exe in glob.glob(os.path.join(destdir + args.prefix, "*.exe")): + signcode(exe) + + makensis = [ + "makensis", + "-V2", + "-NOCD", + "-DSRCDIR=" + args.srcdir, + "-DBINDIR=" + destdir + args.prefix, + ] + dlldir = "w32" + if args.cpu == "x86_64": + dlldir = "w64" + makensis += ["-DW64"] + if os.path.exists(os.path.join(args.srcdir, "dll")): + makensis += "-DDLLDIR={0}/dll/{1}".format(args.srcdir, dlldir) + + makensis += ["-DOUTFILE=" + args.outfile] + args.nsisargs + subprocess.run(makensis) + signcode(args.outfile) + finally: + shutil.rmtree(destdir) + + +if __name__ == "__main__": + main() From a03e2cd749f1029f21c3ddc8913b0ffa8acd8cb8 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 30 Aug 2020 22:46:40 +0200 Subject: [PATCH 19/26] meson: add pixman dependency to chardev/baum module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Weil Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200830204640.482214-1-sw@weilnetz.de> Signed-off-by: Paolo Bonzini --- chardev/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chardev/meson.build b/chardev/meson.build index 7726837e34..27a9a28f4c 100644 --- a/chardev/meson.build +++ b/chardev/meson.build @@ -38,7 +38,7 @@ chardev_modules = {} if config_host.has_key('CONFIG_BRLAPI') and sdl.found() module_ss = ss.source_set() - module_ss.add(when: [sdl, brlapi], if_true: files('baum.c')) + module_ss.add(when: [sdl, brlapi], if_true: [files('baum.c'), pixman]) chardev_modules += { 'baum': module_ss } endif From 289e12dbc4864cebf0f64987898ae9da9d0c7839 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Sun, 30 Aug 2020 17:45:07 +0200 Subject: [PATCH 20/26] meson: add pixman dependency to UI modules Pixman used to be included directly in QEMU_CFLAGS and therefore the include path was added to every compiler invocation. Now that (just like basically everything else) it is a separate dependency, we need to add it to all build target, especially UI modules that need it due to their including ui/console.h. Reported-by: Stefan Weil Signed-off-by: Paolo Bonzini --- ui/meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/meson.build b/ui/meson.build index aa8aa31516..82f60756d9 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -40,7 +40,7 @@ ui_modules = {} if config_host.has_key('CONFIG_CURSES') curses_ss = ss.source_set() - curses_ss.add(when: [curses, iconv], if_true: files('curses.c')) + curses_ss.add(when: [curses, iconv], if_true: [files('curses.c'), pixman]) ui_modules += {'curses' : curses_ss} endif @@ -48,7 +48,7 @@ if config_host.has_key('CONFIG_GTK') softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c')) gtk_ss = ss.source_set() - gtk_ss.add(gtk, vte, files('gtk.c')) + gtk_ss.add(gtk, vte, pixman, files('gtk.c')) gtk_ss.add(when: [x11, 'CONFIG_X11'], if_true: files('x_keymap.c')) gtk_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('gtk-egl.c')) gtk_ss.add(when: [opengl, 'CONFIG_GTK_GL'], if_true: files('gtk-gl-area.c')) @@ -71,7 +71,7 @@ endif if config_host.has_key('CONFIG_SPICE') and config_host.has_key('CONFIG_GIO') spice_ss = ss.source_set() - spice_ss.add(spice, gio, files('spice-app.c')) + spice_ss.add(spice, gio, pixman, files('spice-app.c')) ui_modules += {'spice-app': spice_ss} endif From 87727cb1d20ebd43dac2e0c90e72be495d0dc72f Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 31 Aug 2020 04:48:07 -0400 Subject: [PATCH 21/26] configure: do not include ${prefix} in firmwarepath Left out in commit 22a87800e6 ("configure: expand path variables for meson configure", 2020-08-21), do it now. Signed-off-by: Paolo Bonzini --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index b9e977f13d..8a3acef89d 100755 --- a/configure +++ b/configure @@ -473,7 +473,6 @@ LDFLAGS_SHARED="-shared" modules="no" module_upgrades="no" prefix="/usr/local" -firmwarepath="\${prefix}/share/qemu-firmware" qemu_suffix="qemu" slirp="" oss_lib="" @@ -1677,6 +1676,7 @@ for opt do esac done +firmwarepath="${firmwarepath:-$prefix/share/qemu-firmware}" libdir="${libdir:-$prefix/lib}" libexecdir="${libexecdir:-$prefix/libexec}" includedir="${includedir:-$prefix/include}" From 1a94933fcc3d641bda9988244cde61769baae2e5 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 31 Aug 2020 06:27:00 -0400 Subject: [PATCH 22/26] meson: use pkg-config method to find dependencies We do not need to ask cmake for the dependencies, so just use the pkg-config mechanism. Keep "auto" for SDL so that it tries using sdl-config too. The documentation is adjusted to use SDL2_image as the example, rather than SDL which does not use the "pkg-config" method. Signed-off-by: Paolo Bonzini --- docs/devel/build-system.rst | 27 ++++++++++++++------------- meson.build | 8 ++++---- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/docs/devel/build-system.rst b/docs/devel/build-system.rst index 58bf392430..0c09fb9a54 100644 --- a/docs/devel/build-system.rst +++ b/docs/devel/build-system.rst @@ -66,46 +66,47 @@ following tasks: upon completion. -Taking the probe for SDL as an example, we have the following pieces +Taking the probe for SDL2_Image as an example, we have the following pieces in configure:: # Initial variable state - sdl=auto + sdl_image=auto ..snip.. # Configure flag processing - --disable-gnutls) sdl=disabled + --disable-sdl-image) sdl_image=disabled ;; - --enable-gnutls) sdl=enabled + --enable-sdl-image) sdl_image=enabled ;; ..snip.. # Help output feature message - sdl SDL UI + sdl-image SDL Image support for icons ..snip.. # Meson invocation - -Dsdl=$sdl + -Dsdl_image=$sdl_image In meson_options.txt:: - option('sdl', type : 'feature', value : 'auto') + option('sdl', type : 'feature', value : 'auto', + description: 'SDL Image support for icons') In meson.build:: # Detect dependency - sdl = dependency('sdl2', - required: get_option('sdl'), - static: enable_static) + sdl_image = dependency('SDL2_image', required: get_option('sdl_image'), + method: 'pkg-config', + static: enable_static) - # Create config-host.h - config_host_data.set('CONFIG_SDL', sdl.found()) + # Create config-host.h (if applicable) + config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) # Summary - summary_info += {'SDL support': sdl.found()} + summary_info += {'SDL image support': sdl_image.found()} diff --git a/meson.build b/meson.build index e8a0f12020..55c7d2318c 100644 --- a/meson.build +++ b/meson.build @@ -129,7 +129,7 @@ endif pixman = not_found if have_system or have_tools pixman = dependency('pixman-1', required: have_system, version:'>=0.21.8', - static: enable_static) + method: 'pkg-config', static: enable_static) endif pam = not_found if 'CONFIG_AUTH_PAM' in config_host @@ -168,7 +168,7 @@ if get_option('xkbcommon').auto() and not have_system and not have_tools xkbcommon = not_found else xkbcommon = dependency('xkbcommon', required: get_option('xkbcommon'), - static: enable_static) + method: 'pkg-config', static: enable_static) endif slirp = not_found if config_host.has_key('CONFIG_SLIRP') @@ -247,7 +247,7 @@ if sdl.found() sdl = declare_dependency(compile_args: '-Wno-undef', dependencies: sdl) sdl_image = dependency('SDL2_image', required: get_option('sdl_image'), - static: enable_static) + method: 'pkg-config', static: enable_static) else if get_option('sdl_image').enabled() error('sdl-image required, but SDL was @0@', @@ -332,7 +332,7 @@ sasl = not_found if get_option('vnc').enabled() vnc = declare_dependency() # dummy dependency png = dependency('libpng', required: get_option('vnc_png'), - static: enable_static) + method: 'pkg-config', static: enable_static) jpeg = cc.find_library('jpeg', has_headers: ['jpeglib.h'], required: get_option('vnc_jpeg'), static: enable_static) From 49b7d744266d8bd98544af61cada7fa969ff570d Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 31 Aug 2020 08:36:27 -0400 Subject: [PATCH 23/26] build: fix recurse-all target The missing "/all" suffix prevents the pc-bios/ parts of the build from running. In the meanwhile, -Wall has moved from QEMU_CFLAGS to CFLAGS. Simplify everything by not passing down CFLAGS, and add -Wall in the recursive Makefiles. Reported-by: Miroslav Rezanina Reviewed-by: Miroslav Rezanina Tested-by: Thomas Huth Fixes: 5e6d1573b4 ("remove Makefile.target", 2020-08-21) Signed-off-by: Paolo Bonzini --- Makefile | 4 ++-- pc-bios/optionrom/Makefile | 10 +++------- pc-bios/s390-ccw/Makefile | 3 ++- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index f187ddf47a..c1a93c66a0 100644 --- a/Makefile +++ b/Makefile @@ -186,10 +186,10 @@ ROM_DIRS_RULES=$(foreach t, all clean, $(addsuffix /$(t), $(ROM_DIRS))) # Only keep -O and -g cflags .PHONY: $(ROM_DIRS_RULES) $(ROM_DIRS_RULES): - $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" CFLAGS="$(filter -O% -g%,$(CFLAGS))" $(notdir $@),) + $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),) .PHONY: recurse-all recurse-clean -recurse-all: $(ROM_DIRS) +recurse-all: $(addsuffix /all, $(ROM_DIRS)) recurse-clean: $(addsuffix /clean, $(ROM_DIRS)) ###################################################################### diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile index 51cb6ca9d8..084fc10f05 100644 --- a/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile @@ -8,15 +8,12 @@ all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin @true include ../../config-host.mak +CFLAGS = -O2 -g quiet-command = $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1, @$1)) -cc-option = $(if $(shell $(CC) $1 -S -o /dev/null -xc /dev/null >/dev/null 2>&1 && echo OK), $1, $2) +cc-option = $(if $(shell $(CC) $1 -c -o /dev/null -xc /dev/null >/dev/null 2>&1 && echo OK), $1, $2) -# Compiling with no optimization creates ROMs that are too large -ifeq ($(lastword $(filter -O%, -O0 $(CFLAGS))),-O0) -override CFLAGS += -O2 -endif -override CFLAGS += -march=i486 +override CFLAGS += -march=i486 -Wall # Flags for dependency generation override CPPFLAGS += -MMD -MP -MT $@ -MF $(@D)/$(*F).d @@ -42,7 +39,6 @@ Wa = -Wa, override ASFLAGS += -32 override CFLAGS += $(call cc-option, $(Wa)-32) - LD_I386_EMULATION ?= elf_i386 override LDFLAGS = -m $(LD_I386_EMULATION) -T $(SRC_DIR)/flat.lds override LDFLAGS += $(LDFLAGS_NOPIE) diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile index cc0f77baa6..3eb785048a 100644 --- a/pc-bios/s390-ccw/Makefile +++ b/pc-bios/s390-ccw/Makefile @@ -3,6 +3,7 @@ all: build-all @true include ../../config-host.mak +CFLAGS = -O2 -g quiet-command = $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1, @$1)) cc-option = $(if $(shell $(CC) $1 -S -o /dev/null -xc /dev/null > /dev/null \ @@ -28,7 +29,7 @@ QEMU_DGFLAGS = -MMD -MP -MT $@ -MF $(@D)/$(*F).d OBJECTS = start.o main.o bootmap.o jump2ipl.o sclp.o menu.o \ virtio.o virtio-scsi.o virtio-blkdev.o libc.o cio.o dasd-ipl.o -QEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS)) +QEMU_CFLAGS := -Wall $(filter -W%, $(QEMU_CFLAGS)) QEMU_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -msoft-float QEMU_CFLAGS += -march=z900 -fPIE -fno-strict-aliasing QEMU_CFLAGS += -fno-asynchronous-unwind-tables From cb572714f955f5b3396a9219608b12be346f962b Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 1 Sep 2020 01:59:23 -0400 Subject: [PATCH 24/26] meson: add description to options This will be useful in the future to generate configure command line parsing from meson_options.txt. Signed-off-by: Paolo Bonzini --- meson_options.txt | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index c3120fa359..543cf70043 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -2,12 +2,23 @@ option('qemu_suffix', type : 'string', value: 'qemu', description: 'Suffix for QEMU data/modules/config directories (can be empty)') option('docdir', type : 'string', value : 'doc', description: 'Base directory for documentation installation (can be empty)') -option('gettext', type : 'boolean', value : true) -option('sdl', type : 'feature', value : 'auto') -option('sdl_image', type : 'feature', value : 'auto') -option('u2f', type : 'feature', value : 'auto') -option('vnc', type : 'feature', value : 'enabled') -option('vnc_jpeg', type : 'feature', value : 'auto') -option('vnc_png', type : 'feature', value : 'auto') -option('vnc_sasl', type : 'feature', value : 'auto') -option('xkbcommon', type : 'feature', value : 'auto') + +option('gettext', type : 'boolean', value : true, + description: 'Localization of the GTK+ user interface') + +option('sdl', type : 'feature', value : 'auto', + description: 'SDL user interface') +option('sdl_image', type : 'feature', value : 'auto', + description: 'SDL Image support for icons') +option('u2f', type : 'feature', value : 'auto', + description: 'U2F emulation support') +option('vnc', type : 'feature', value : 'enabled', + description: 'VNC server') +option('vnc_jpeg', type : 'feature', value : 'auto', + description: 'JPEG lossy compression for VNC server') +option('vnc_png', type : 'feature', value : 'auto', + description: 'PNG compression for VNC server') +option('vnc_sasl', type : 'feature', value : 'auto', + description: 'SASL authentication for VNC server') +option('xkbcommon', type : 'feature', value : 'auto', + description: 'xkbcommon support') From d79864058a643671bbed8f587edd893aada928da Mon Sep 17 00:00:00 2001 From: Greg Kurz Date: Tue, 1 Sep 2020 16:20:10 +0200 Subject: [PATCH 25/26] Makefile: Add back TAGS/ctags/cscope rules It is a bit of a pain to be forced to run configure before being able to use cscope and friends. Add back the rules to build them in-tree as before commit a56650518f5b. Fixes: a56650518f5b ("configure: integrate Meson in the build system") Signed-off-by: Greg Kurz Message-Id: <159897001005.442705.16516671603870288336.stgit@bahia.lan> Signed-off-by: Paolo Bonzini --- Makefile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c1a93c66a0..049e2ffa03 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ ninja-distclean:: build.ninja: config-host.mak Makefile.ninja: build.ninja ninjatool - ./ninjatool -t ninja2make --omit clean dist uninstall < $< > $@ + ./ninjatool -t ninja2make --omit clean dist uninstall cscope TAGS ctags < $< > $@ -include Makefile.ninja ${ninja-targets-c_COMPILER} ${ninja-targets-cpp_COMPILER}: .var.command += -MP @@ -229,6 +229,22 @@ distclean: clean ninja-distclean rm -f linux-headers/asm rm -Rf .sdk +.PHONY: ctags +ctags: + rm -f tags + find "$(SRC_PATH)" -name '*.[hc]' -exec ctags --append {} + + +.PHONY: TAGS +TAGS: + rm -f TAGS + find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} + + +.PHONY: cscope +cscope: + rm -f "$(SRC_PATH)"/cscope.* + find "$(SRC_PATH)/" -name "*.[chsS]" -print | sed -e 's,^\./,,' > "$(SRC_PATH)/cscope.files" + cscope -b -i"$(SRC_PATH)/cscope.files" + # Needed by "meson install" export DESTDIR From 9f5d95976895132976d9d6c14e7a35781d6f1e15 Mon Sep 17 00:00:00 2001 From: Greg Kurz Date: Tue, 1 Sep 2020 16:20:16 +0200 Subject: [PATCH 26/26] Makefile: Fix in-tree clean/distclean Doing 'make clean' or 'make distclean' in a freshly cloned tree results in: make: *** No rule to make target 'ninja-clean', needed by 'clean'. Stop. Make the fallback rules global. While here, change the ninjatool recipe to always have a zero exit status and thus prevent make to emit a warning. Fixes: a56650518f5b ("configure: integrate Meson in the build system") Signed-off-by: Greg Kurz Message-Id: <159897001659.442705.15538955005543395950.stgit@bahia.lan> Signed-off-by: Paolo Bonzini --- Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 049e2ffa03..ed354c43b0 100644 --- a/Makefile +++ b/Makefile @@ -54,13 +54,6 @@ export NINJA=./ninjatool # enough to prime the rest of the build. ninjatool: build.ninja -# Only needed in case Makefile.ninja does not exist. -.PHONY: ninja-clean ninja-distclean clean-ctlist -clean-ctlist: -ninja-clean:: -ninja-distclean:: -build.ninja: config-host.mak - Makefile.ninja: build.ninja ninjatool ./ninjatool -t ninja2make --omit clean dist uninstall cscope TAGS ctags < $< > $@ -include Makefile.ninja @@ -115,6 +108,13 @@ ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fa endif endif +# Only needed in case Makefile.ninja does not exist. +.PHONY: ninja-clean ninja-distclean clean-ctlist +clean-ctlist: +ninja-clean:: +ninja-distclean:: +build.ninja: config-host.mak + include $(SRC_PATH)/rules.mak # lor is defined in rules.mak @@ -195,7 +195,7 @@ recurse-clean: $(addsuffix /clean, $(ROM_DIRS)) ###################################################################### clean: recurse-clean ninja-clean clean-ctlist - -test -f ninjatool && ./ninjatool $(if $(V),-v,) -t clean + if test -f ninjatool; then ./ninjatool $(if $(V),-v,) -t clean; fi # 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 find . \( -name '*.so' -o -name '*.dll' -o -name '*.[oda]' \) -type f \