First round of meson bugfixes and cleanups for 6.0
Subsystems (3)
cover First round of meson bugfixes and cleanups for 6.0
Mostly switching to 0.56.0 in order to remove the b_staticpic version-dependent hack.
Paolo Bonzini (7):
Makefile: add dummy target for build.ninja dependencies
meson: update submodule to 0.56.0
meson: switch minimum meson version to 0.56.0
meson: fix detection of curses with pkgconfig
meson: use pkg-config method for libudev
meson: use dependency to gate block modules
meson: cleanup Kconfig.host handling
Makefile | 1 + accel/Kconfig | 9 +++ block/meson.build | 20 +++---- configure | 7 +-- docs/devel/kconfig.rst | 19 +++---- docs/meson.build | 12 ++-- meson | 2 +- meson.build | 104 +++++++++++++++------------------- plugins/meson.build | 4 +- tests/meson.build | 2 +- tests/qapi-schema/meson.build | 4 +- tests/qtest/meson.build | 2 +- trace/meson.build | 4 +- 13 files changed, 91 insertions(+), 99 deletions(-)
Signature · 1 line
2.29.2
PATCH 1/7 Makefile: add dummy target for build.ninja dependencies
The dummy targets ensure that incremental build can be done after deleting a meson.build file.
--- Makefile | 1 + 1 file changed, 1 insertion(+)
Makefile +1 -0
@@ -133,6 +133,7 @@ Makefile.ninja: build.ninja # A separate rule is needed for Makefile dependencies to avoid -n build.ninja: build.ninja.stamp +$(build-files): build.ninja.stamp: meson.stamp $(build-files) $(NINJA) $(if $V,-v,) build.ninja && touch $@ endif
Signature · 1 line
2.29.2
PATCH 2/7 meson: update submodule to 0.56.0
In reply to Paolo Bonzini--- configure | 2 +- meson | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
configure +1 -1
@@ -1938,7 +1938,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.3; then + if test "$explicit_python" = no && has meson && version_ge "$(meson --version)" 0.56.0; then meson=meson elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then meson=git
meson +1 -1
@@ -1 +1 @@ -Subproject commit 776acd2a805c9b42b4f0375150977df42130317f +Subproject commit f16d31607eb3cd0f281758bd0944e206ef6be387
Signature · 1 line
2.29.2
PATCH 3/7 meson: switch minimum meson version to 0.56.0
In reply to Paolo BonziniMeson 0.56.0 does not need b_staticpic=$pie anymore, and has stabilized the keyval module. Remove the workaround and use a few replacements for features deprecated in that release cycle.
--- configure | 5 ---- docs/meson.build | 12 ++++---- meson.build | 54 ++++++++++++++++------------------- plugins/meson.build | 4 +-- tests/meson.build | 2 +- tests/qapi-schema/meson.build | 4 +-- tests/qtest/meson.build | 2 +- trace/meson.build | 4 +-- 8 files changed, 39 insertions(+), 48 deletions(-)
configure +0 -5
@@ -6965,10 +6965,6 @@ fi mv $cross config-meson.cross rm -rf meson-private meson-info meson-logs -unset staticpic -if ! version_ge "$($meson --version)" 0.56.0; then - staticpic=$(if test "$pie" = yes; then echo true; else echo false; fi) -fi NINJA=$ninja $meson setup \ --prefix "$prefix" \ --libdir "$libdir" \
@@ -6988,7 +6984,6 @@ NINJA=$ninja $meson setup \ -Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \ -Dstrip=$(if test "$strip_opt" = yes; then echo true; else echo false; fi) \ -Db_pie=$(if test "$pie" = yes; then echo true; else echo false; fi) \ - ${staticpic:+-Db_staticpic=$staticpic} \ -Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \ -Db_lto=$lto -Dcfi=$cfi -Dcfi_debug=$cfi_debug \ -Dmalloc=$malloc -Dmalloc_trim=$malloc_trim -Dsparse=$sparse \
docs/meson.build +6 -6
@@ -38,12 +38,12 @@ endif if build_docs SPHINX_ARGS += ['-Dversion=' + meson.project_version(), '-Drelease=' + config_host['PKGVERSION']] - sphinx_extn_depends = [ meson.source_root() / 'docs/sphinx/depfile.py', - meson.source_root() / 'docs/sphinx/hxtool.py', - meson.source_root() / 'docs/sphinx/kerneldoc.py', - meson.source_root() / 'docs/sphinx/kernellog.py', - meson.source_root() / 'docs/sphinx/qapidoc.py', - meson.source_root() / 'docs/sphinx/qmp_lexer.py', + sphinx_extn_depends = [ meson.current_source_dir() / 'sphinx/depfile.py', + meson.current_source_dir() / 'sphinx/hxtool.py', + meson.current_source_dir() / 'sphinx/kerneldoc.py', + meson.current_source_dir() / 'sphinx/kernellog.py', + meson.current_source_dir() / 'sphinx/qapidoc.py', + meson.current_source_dir() / 'sphinx/qmp_lexer.py', qapi_gen_depends ] configure_file(output: 'index.html',
meson.build +25 -29
95 lines not on this page · raw message
plugins/meson.build +2 -2
@@ -1,7 +1,7 @@ if 'CONFIG_HAS_LD_DYNAMIC_LIST' in config_host - plugin_ldflags = ['-Wl,--dynamic-list=' + (meson.build_root() / 'qemu-plugins-ld.symbols')] + plugin_ldflags = ['-Wl,--dynamic-list=' + (meson.project_build_root() / 'qemu-plugins-ld.symbols')] elif 'CONFIG_HAS_LD_EXPORTED_SYMBOLS_LIST' in config_host - plugin_ldflags = ['-Wl,-exported_symbols_list,' + (meson.build_root() / 'qemu-plugins-ld64.symbols')] + plugin_ldflags = ['-Wl,-exported_symbols_list,' + (meson.project_build_root() / 'qemu-plugins-ld64.symbols')] else plugin_ldflags = [] endif
tests/meson.build +1 -1
@@ -113,7 +113,7 @@ tests = { 'test-keyval': [testqapi], 'test-logging': [], 'test-uuid': [], - 'ptimer-test': ['ptimer-test-stubs.c', meson.source_root() / 'hw/core/ptimer.c'], + 'ptimer-test': ['ptimer-test-stubs.c', meson.project_source_root() / 'hw/core/ptimer.c'], 'test-qapi-util': [], }
tests/qapi-schema/meson.build +2 -2
@@ -1,5 +1,5 @@ test_env = environment() -test_env.set('PYTHONPATH', meson.source_root() / 'scripts') +test_env.set('PYTHONPATH', meson.project_source_root() / 'scripts') test_env.set('PYTHONIOENCODING', 'utf-8') schemas = [
@@ -240,7 +240,7 @@ if build_docs # clutter up the build dir with the cache. command: [SPHINX_ARGS, '-b', 'text', '-E', - '-c', meson.source_root() / 'docs', + '-c', meson.project_source_root() / 'docs', '-D', 'master_doc=doc-good', meson.current_source_dir(), meson.current_build_dir()])
tests/qtest/meson.build +1 -1
@@ -237,7 +237,7 @@ foreach dir : target_dirs qtest_env.set('QTEST_QEMU_IMG', './qemu-img') test_deps += [qemu_img] endif - qtest_env.set('G_TEST_DBUS_DAEMON', meson.source_root() / 'tests/dbus-vmstate-daemon.sh') + qtest_env.set('G_TEST_DBUS_DAEMON', meson.project_source_root() / 'tests/dbus-vmstate-daemon.sh') qtest_env.set('QTEST_QEMU_BINARY', './qemu-system-' + target_base) foreach test : target_qtests
trace/meson.build +2 -2
@@ -2,7 +2,7 @@ specific_ss.add(files('control-target.c')) trace_events_files = [] foreach dir : [ '.' ] + trace_events_subdirs - trace_events_file = meson.source_root() / dir / 'trace-events' + trace_events_file = meson.project_source_root() / dir / 'trace-events' trace_events_files += [ trace_events_file ] group_name = dir == '.' ? 'root' : dir.underscorify() group = '--group=' + group_name
@@ -68,7 +68,7 @@ foreach d : [ ] gen = custom_target(d[0], output: d[0], - input: meson.source_root() / 'trace-events', + input: meson.project_source_root() / 'trace-events', command: [ tracetool, '--group=root', '--format=@0@'.format(d[1]), '@INPUT@' ], capture: true) specific_ss.add(when: 'CONFIG_TCG', if_true: gen)
Signature · 1 line
2.29.2
PATCH 4/7 meson: fix detection of curses with pkgconfig
In reply to Paolo Bonzini--- meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
meson.build +3 -3
@@ -500,16 +500,16 @@ if have_system and not get_option('curses').disabled() endif endforeach msg = get_option('curses').enabled() ? 'curses library not found' : '' + curses_compile_args = ['-DNCURSES_WIDECHAR'] if curses.found() - if cc.links(curses_test, dependencies: [curses]) - curses = declare_dependency(compile_args: '-DNCURSES_WIDECHAR', dependencies: [curses]) + if cc.links(curses_test, args: curses_compile_args, dependencies: [curses]) + curses = declare_dependency(compile_args: curses_compile_args, dependencies: [curses]) else msg = 'curses package not usable' curses = not_found endif endif if not curses.found() - curses_compile_args = ['-DNCURSES_WIDECHAR'] has_curses_h = cc.has_header('curses.h', args: curses_compile_args) if targetos != 'windows' and not has_curses_h message('Trying with /usr/include/ncursesw')
Signature · 1 line
2.29.2
PATCH 5/7 meson: use pkg-config method for libudev
In reply to Paolo BonziniDo not bother asking CMake, this is a pkg-config dependency.
--- meson.build | 1 + 1 file changed, 1 insertion(+)
meson.build +1 -0
@@ -399,6 +399,7 @@ endif libudev = not_found if targetos == 'linux' and (have_system or have_tools) libudev = dependency('libudev', + method: 'pkg-config', required: get_option('libudev'), static: enable_static) endif
Signature · 1 line
2.29.2
PATCH 6/7 meson: use dependency to gate block modules
In reply to Paolo BonziniThis will allow converting the dependencies to meson options one by one, because moving the tests to meson.build will get rid of the symbols in config-host.mak.
--- block/meson.build | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
block/meson.build +10 -10
@@ -70,14 +70,14 @@ block_modules = {} modsrc = [] foreach m : [ - ['CONFIG_CURL', 'curl', [curl, glib], 'curl.c'], - ['CONFIG_GLUSTERFS', 'gluster', glusterfs, 'gluster.c'], - ['CONFIG_LIBISCSI', 'iscsi', libiscsi, 'iscsi.c'], - ['CONFIG_LIBNFS', 'nfs', libnfs, 'nfs.c'], - ['CONFIG_LIBSSH', 'ssh', libssh, 'ssh.c'], - ['CONFIG_RBD', 'rbd', rbd, 'rbd.c'], + [curl, 'curl', [curl, glib], 'curl.c'], + [glusterfs, 'gluster', glusterfs, 'gluster.c'], + [libiscsi, 'iscsi', libiscsi, 'iscsi.c'], + [libnfs, 'nfs', libnfs, 'nfs.c'], + [libssh, 'ssh', libssh, 'ssh.c'], + [rbd, 'rbd', rbd, 'rbd.c'], ] - if config_host.has_key(m[0]) + if m[0].found() if enable_modules modsrc += files(m[3]) endif
@@ -90,10 +90,10 @@ endforeach # those are not exactly regular block modules, so treat them apart if 'CONFIG_DMG' in config_host foreach m : [ - ['CONFIG_LZFSE', 'dmg-lzfse', liblzfse, 'dmg-lzfse.c'], - ['CONFIG_BZIP2', 'dmg-bz2', [glib, libbzip2], 'dmg-bz2.c'] + [liblzfse, 'dmg-lzfse', liblzfse, 'dmg-lzfse.c'], + [libbzip2, 'dmg-bz2', [glib, libbzip2], 'dmg-bz2.c'] ] - if config_host.has_key(m[0]) + if m[0].found() module_ss = ss.source_set() module_ss.add(when: m[2], if_true: files(m[3])) block_modules += {m[1] : module_ss}
Signature · 1 line
2.29.2
PATCH 7/7 meson: cleanup Kconfig.host handling
In reply to Paolo BonziniBuild the array of command line arguments coming from config_host once for all targets. Add all accelerators to accel/Kconfig so that the command line arguments for accelerators can be computed easily in the existing "foreach sym: accelerators" loop.
--- accel/Kconfig | 9 +++++++++ docs/devel/kconfig.rst | 19 +++++++++---------- meson.build | 43 +++++++++++++++++------------------------- 3 files changed, 35 insertions(+), 36 deletions(-)
accel/Kconfig +9 -0
@@ -1,3 +1,12 @@ +config WHPX + bool + +config HAX + bool + +config HVF + bool + config TCG bool
docs/devel/kconfig.rst +9 -10
@@ -288,21 +288,20 @@ they will include all these symbols and some help text on what they do. ---------------- In some special cases, a configurable element depends on host features -that are detected by QEMU's configure script; for example some devices -depend on the availability of KVM or on the presence of a library on -the host. +that are detected by QEMU's configure or ``meson.build`` scripts; for +example some devices depend on the availability of KVM or on the presence +of a library on the host. These symbols should be listed in ``Kconfig.host`` like this:: - config KVM + config TPM bool -and also listed as follows in the top-level Makefile's ``MINIKCONF_ARGS`` +and also listed as follows in the top-level meson.build's host_kconfig variable:: - MINIKCONF_ARGS = \ - $@ $*/config-devices.mak.d $< $(MINIKCONF_INPUTS) \ - CONFIG_KVM=$(CONFIG_KVM) \ - CONFIG_SPICE=$(CONFIG_SPICE) \ - CONFIG_TPM=$(CONFIG_TPM) \ + host_kconfig = \ + ('CONFIG_TPM' in config_host ? ['CONFIG_TPM=y'] : []) + \ + ('CONFIG_SPICE' in config_host ? ['CONFIG_SPICE=y'] : []) + \ + ('CONFIG_IVSHMEM' in config_host ? ['CONFIG_IVSHMEM=y'] : []) + \ ...
meson.build +17 -26
75 lines not on this page · raw message
Signature · 1 line
2.29.2