Commit Graph

103 Commits

Author SHA1 Message Date
Paolo Bonzini a98006bc79 meson: compute config_all_devices directly
There is no need anymore to produce config-all-devices.mak, compute
the resulting dictionary directly instead of going through grepy.sh.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 11:43:16 +02:00
Marc-André Lureau 3909def82a meson: fix migration/stress compilation with glibc>=2.30
gettid() was introduced with glibc 2.30.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-16-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 11:43:16 +02:00
Marc-André Lureau af04e89dd9 meson: move keyutils dependency check
Since there is not minimum version specified, and it's a test-only
dependency, it's fair to depend on a version that ships with a .pc I
suppose.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-8-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 11:43:16 +02:00
Marc-André Lureau 9866a33cbb meson: declare keyutils dependency
Rename the variable to be more explicit. A further clean-up patch will
move the actual to dependency check to meson entirely.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-4-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Marc-André Lureau 8ce0a45fa2 meson: declare tasn1 dependency
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-3-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Paolo Bonzini 3e0e519026 meson: remove b_lundef option
Meson automatically adds "-undefined dynamic_lookup" to
shared_module build targets; b_lundef is only needed for
executables.  Therefore, we can remove this option.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Paolo Bonzini e781190cda qemu-iotests: move check-block back to Makefiles
check-block has its own test harness, unlike every other test.  If
we capture its output, as is in general nicer to do without V=1,
there will be no sign of progress.  So for lack of a better option
just move the invocation of the test back to Makefile rules.

As a side effect, this will also fix "make check" in --disable-tools
builds, as they were trying to run qemu-iotests without having
made qemu-img before.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Daniel P. Berrangé 46859d9398 crypto: fix build with gcrypt enabled
If nettle is disabled and gcrypt enabled, the compiler and linker flags
needed for gcrypt are not passed.

Gnutls was also not added as a dependancy when gcrypt is enabled.

Attempting to add the library dependencies at the same time as the
source dependencies is error prone, as there are alot of different
rules for picking which sources to use, and some of the source files
use code level conditionals intead. It is thus clearer to add the
library dependencies separately.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200901133050.381844-2-berrange@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Daniel P. Berrangé eb705985f4 nbd: disable signals and forking on Windows builds
Disabling these parts are sufficient to get the qemu-nbd program
compiling in a Windows build.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200825103850.119911-4-berrange@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2020-09-02 16:48:21 -05:00
Paolo Bonzini 1a94933fcc 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 <pbonzini@redhat.com>
2020-09-01 08:51:35 -04:00
Marc-André Lureau 8adfeba953 meson: add NSIS building
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200826110419.528931-9-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-01 08:51:34 -04:00
Marc-André Lureau b81efab7c7 meson: use meson mandir instead of qemu_mandir
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é <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200826110419.528931-8-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-01 08:51:34 -04:00
Marc-André Lureau 491e74c158 meson: pass docdir option
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 <marcandre.lureau@redhat.com>
Message-Id: <20200826110419.528931-7-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-01 08:51:33 -04:00
Marc-André Lureau ab4c0996f8 meson: use meson datadir instead of qemu_datadir
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 <marcandre.lureau@redhat.com>
Message-Id: <20200826110419.528931-6-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-01 08:51:33 -04:00
Paolo Bonzini 1ffb3bbb3c meson: move zlib detection to meson
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 <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-01 08:51:32 -04:00
Marc-André Lureau f5aa6320e8 meson: install scripts/qemu-trace-stap
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200826130622.553318-3-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-01 01:51:52 -04:00
Volker Rümelin 7161a43395 meson: fix SDL2_image detection
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 <vr_qemu@t-online.de>
Message-Id: <20200829104158.7461-1-vr_qemu@t-online.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-01 01:51:52 -04:00
César Belley 0a40bcb740 meson: Add U2F key to meson
Signed-off-by: César Belley <cesar.belley@lse.epita.fr>
Message-id: 20200826114209.28821-8-cesar.belley@lse.epita.fr

[ fixes suggested by paolo ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-08-31 08:23:10 +02:00
Gerd Hoffmann 90756b2fb3 meson: set colorout to auto
Dunno why the default is set to "always".  IMHO it should be "auto",
i.e. only colorize in case stdout goes to a terminal.  Cluttering
logfiles and confusing compiler message parsers with terminal control
sequences is not nice ...

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-27 18:52:30 +02:00
Yonggang Luo 363743dacb meson: Mingw64 gcc doesn't recognize system include_type for sdl2
Windows paths result in command lines like "-isystemC:/msys64/..." that
are not recognized by GCC.  "include_type: 'system'" was only included
in an attempt to fix the -Wundef warnings in SDL 2.0.8, but it was not
effective.  Therefore we can fix this by remove the include_type.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-27 18:52:30 +02:00
Paolo Bonzini 1917ec6d56 meson: cleanup xkbcommon detection
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-27 18:52:30 +02:00
Paolo Bonzini 760e4327cd meson: skip SDL2 detection if --disable-system
SDL is only used for system emulation; avoid spurious warnings for
static --disable-system emulation by skipping the detection of
the library if there are no system emulation targets.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-27 18:52:30 +02:00
Paolo Bonzini b7612f45da meson: move pixman detection to meson
When pixman is not installed (or too old), but virglrenderer is available
and "configure" has been run with "--disable-system", the build currently
aborts when trying to compile vhost-user-gpu (since it requires pixman).

Let's skip the build of vhost-user-gpu when pixman is not installed or
too old.  Instead of adding CONFIG_PIXMAN, it is simpler to move the
detection to pixman.

Based on a patch by Thomas Huth. <thuth@redhat.com>

Fixes: 9b52b17ba5 ("configure: Allow to build tools without pixman")
Reported-by: Rafael Kitover <rkitover@gmail.com>
Reported-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-27 18:52:30 +02:00
Bruce Rogers c7c91a749b meson: Fix meson build with --enable-libdaxctl
The daxctl library needs to be linked against when daxctl is asked for
in configure.

Signed-off-by: Bruce Rogers <brogers@suse.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-27 18:52:30 +02:00
Thomas Huth 5f7e966b27 meson: Build qemu-nbd on macOS again
Before switching to the meson build system, we used to compile qemu-nbd
for macOS, too, which is especially important for running the iotests
there. Commit b7c70bf2c5 disabled it by accident, since it did not take
into consideration that the $bsd variable in the configure script was
also set to "yes" on macOS. Fix it by enabling qemu-nbd on all systems
but Windows now instead (which was likely the original intention of the
old code in the configure script).

Fixes: b7c70bf2c5 ("meson: qemu-{img,io,nbd}")
Signed-off-by: Thomas Huth <thuth@redhat.com>
Acked-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-27 18:52:30 +02:00
Stefan Hajnoczi bd5f973ac2 trace: fix creation of systemtap files
The "exe_name" variable was renamed to exe['name'], so systemtap
files fail to build.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-27 18:52:22 +02:00
Laurent Vivier 9755c94a50 meson: avoid compiling qemu-keymap by default
qemu-keymap is not needed with linux-user, so disable it by default if
tools and system are disabled (tools are disabled by default with linux-user).

Avoid this error with statically linked binaries:

    Linking target qemu-keymap
    /usr/bin/ld: cannot find -lxkbcommon

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-id: 20200824152430.1844159-3-laurent@vivier.eu
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-08-25 08:12:19 +02:00
Laurent Vivier 4113f4cfee meson: move xkbcommon to meson
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-id: 20200824152430.1844159-2-laurent@vivier.eu
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-08-25 08:12:19 +02:00
Philippe Mathieu-Daudé 8855e8f046 meson: Fix --disable-tools --enable-system builds
Fixes:

 $ ../configure --disable-tools --disable-user
 ../tests/qemu-iotests/meson.build:7:0: ERROR: Unknown variable "qemu_block_tools".

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200821150556.1235625-1-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 17:06:17 -04:00
Marc-André Lureau 28742467c9 meson: convert pc-bios/keymaps/Makefile
Note that sl and sv keymaps were not created by qemu-keymap.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 17:06:17 -04:00
Paolo Bonzini b29b40f4ab meson: avoid unstable module warning with Meson 0.56.0 or newer
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:45 -04:00
Marc-André Lureau e8f3bd71d8 meson: convert po/
Meson warns if xgettext is not found.  In the future we may want to add
a required argument to i18n.gettext(); in the meanwhile, I am adding a
--enable-gettext/--disable-gettext option and feature detection in
configure.  This preserves QEMU's default behavior of detecting system
features, without any warning, if neither --enable-* nor --disable-*
is requested.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:45 -04:00
Paolo Bonzini a0b93237d8 meson: convert VNC and dependent libraries to meson
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:44 -04:00
Paolo Bonzini 35be72ba72 meson: move SDL and SDL-image detection to meson
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:44 -04:00
Paolo Bonzini 859aef026e meson: replace create-config with meson configure_file
Move the create-config logic to meson.build; create a
configuration_data object and let meson handle the
quoting and output.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:43 -04:00
Paolo Bonzini d3ca592b3c meson: convert check-block
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:42 -04:00
Paolo Bonzini acfdaac577 meson: build texi doc
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:42 -04:00
Paolo Bonzini f8aa24ea9a meson: sphinx-build
For now, sphinx is run on every invocation of make.  The previous mechanism
using $(wildcard) is not reproducible in Meson and was also brittle; for
example some .rst.inc files were left out.  The next patch will introduce
a Sphinx extension to emit a depfile.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:41 -04:00
Marc-André Lureau 10e1d2636d meson: convert systemtap files
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:41 -04:00
Paolo Bonzini 64ed6f92ff meson: link emulators without Makefile.target
The binaries move to the root directory, e.g. qemu-system-i386 or
qemu-arm.  This requires changes to qtests, CI, etc.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:40 -04:00
Paolo Bonzini f556b4a10d meson: plugins
For now link arguments end up in Makefile.target, they will move to the
right place soon.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:39 -04:00
Marc-André Lureau c9322ab5bf meson: cpu-emu
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:39 -04:00
Marc-André Lureau b309c32125 meson: bsd-user
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:38 -04:00
Marc-André Lureau 3a30446aed meson: linux-user
The most interesting or most complicated part here is the syscall_nr.h
generators.  In order to keep the generation logic all in meson.build,
I am adding to config_target the name of the .tbl file, and making the
generated file syscall<SUFFIX>_nr.h for input file syscall<SUFFIX>.tbl.

For architectures where the input file is not named syscall_nr.tbl,
syscall_nr.h has to be a source file; it's just a forwarder for x86
(i386/x86_64), while for MIPS64 it chooses between N32 and N64 ABIs.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:38 -04:00
Marc-André Lureau 1a82878a08 meson: accel
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:36 -04:00
Paolo Bonzini abff1abfe8 meson: target
Similar to hw_arch, each architecture defines two sourceset which are placed in
dictionaries target_arch and target_softmmu_arch.  These are then picked up
from there when building the per-emulator static_library.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:35 -04:00
Marc-André Lureau 2c44220d05 meson: convert hw/arch*
Each architecture's sourceset is placed in an hw_arch dictionary, and picked up
from there when building the per-emulator static_library.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:33 -04:00
Paolo Bonzini 06677ce161 meson: convert hw/usb
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:26 -04:00
Marc-André Lureau 582ea95f5f meson: convert hw/xen
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:24 -04:00
Marc-André Lureau c574e16112 meson: convert disas directory to Meson
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 06:30:24 -04:00