* [PATCH 0/7] First round of meson bugfixes and cleanups for 6.0
@ 2020-12-16 16:19 Paolo Bonzini
2020-12-16 16:20 ` [PATCH 1/7] Makefile: add dummy target for build.ninja dependencies Paolo Bonzini
` (6 more replies)
0 siblings, 7 replies; 15+ messages in thread
From: Paolo Bonzini @ 2020-12-16 16:19 UTC (permalink / raw)
To: qemu-devel
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(-)
--
2.29.2
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/7] Makefile: add dummy target for build.ninja dependencies
2020-12-16 16:19 [PATCH 0/7] First round of meson bugfixes and cleanups for 6.0 Paolo Bonzini
@ 2020-12-16 16:20 ` Paolo Bonzini
2020-12-16 16:20 ` [PATCH 2/7] meson: update submodule to 0.56.0 Paolo Bonzini
` (5 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: Paolo Bonzini @ 2020-12-16 16:20 UTC (permalink / raw)
To: qemu-devel
The dummy targets ensure that incremental build can be done after
deleting a meson.build file.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
index 76dbb917f5..fb9923ff22 100644
--- a/Makefile
+++ b/Makefile
@@ -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
--
2.29.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 2/7] meson: update submodule to 0.56.0
2020-12-16 16:19 [PATCH 0/7] First round of meson bugfixes and cleanups for 6.0 Paolo Bonzini
2020-12-16 16:20 ` [PATCH 1/7] Makefile: add dummy target for build.ninja dependencies Paolo Bonzini
@ 2020-12-16 16:20 ` Paolo Bonzini
2020-12-16 16:52 ` Marc-André Lureau
2020-12-16 16:20 ` [PATCH 3/7] meson: switch minimum meson version " Paolo Bonzini
` (4 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Paolo Bonzini @ 2020-12-16 16:20 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
configure | 2 +-
meson | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 6317964997..8d12b715e3 100755
--- a/configure
+++ b/configure
@@ -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
diff --git a/meson b/meson
index 776acd2a80..f16d31607e 160000
--- a/meson
+++ b/meson
@@ -1 +1 @@
-Subproject commit 776acd2a805c9b42b4f0375150977df42130317f
+Subproject commit f16d31607eb3cd0f281758bd0944e206ef6be387
--
2.29.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 3/7] meson: switch minimum meson version to 0.56.0
2020-12-16 16:19 [PATCH 0/7] First round of meson bugfixes and cleanups for 6.0 Paolo Bonzini
2020-12-16 16:20 ` [PATCH 1/7] Makefile: add dummy target for build.ninja dependencies Paolo Bonzini
2020-12-16 16:20 ` [PATCH 2/7] meson: update submodule to 0.56.0 Paolo Bonzini
@ 2020-12-16 16:20 ` Paolo Bonzini
2020-12-16 16:53 ` Marc-André Lureau
2020-12-16 16:20 ` [PATCH 4/7] meson: fix detection of curses with pkgconfig Paolo Bonzini
` (3 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Paolo Bonzini @ 2020-12-16 16:20 UTC (permalink / raw)
To: qemu-devel
Meson 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.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
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(-)
diff --git a/configure b/configure
index 8d12b715e3..708cf365f0 100755
--- a/configure
+++ b/configure
@@ -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 \
diff --git a/docs/meson.build b/docs/meson.build
index bb8fe4c9e4..4e88ed7516 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -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',
diff --git a/meson.build b/meson.build
index 77ac9ec01b..39fc9b7143 100644
--- a/meson.build
+++ b/meson.build
@@ -1,14 +1,10 @@
-project('qemu', ['c'], meson_version: '>=0.55.0',
- default_options: ['warning_level=1', 'c_std=gnu99', 'cpp_std=gnu++11', 'b_colorout=auto'] +
- (meson.version().version_compare('>=0.56.0') ? [ 'b_staticpic=false' ] : []),
- version: run_command('head', meson.source_root() / 'VERSION').stdout().strip())
+project('qemu', ['c'], meson_version: '>=0.56.0',
+ default_options: ['warning_level=1', 'c_std=gnu99', 'cpp_std=gnu++11', 'b_colorout=auto',
+ 'b_staticpic=false'],
+ version: run_command('head', meson.project_source_root() / 'VERSION').stdout().strip())
not_found = dependency('', required: false)
-if meson.version().version_compare('>=0.56.0')
- keyval = import('keyval')
-else
- keyval = import('unstable-keyval')
-endif
+keyval = import('keyval')
ss = import('sourceset')
fs = import('fs')
@@ -1372,21 +1368,21 @@ genh += configure_file(output: 'config-host.h', configuration: config_host_data)
hxtool = find_program('scripts/hxtool')
shaderinclude = find_program('scripts/shaderinclude.pl')
qapi_gen = find_program('scripts/qapi-gen.py')
-qapi_gen_depends = [ meson.source_root() / 'scripts/qapi/__init__.py',
- meson.source_root() / 'scripts/qapi/commands.py',
- meson.source_root() / 'scripts/qapi/common.py',
- meson.source_root() / 'scripts/qapi/error.py',
- meson.source_root() / 'scripts/qapi/events.py',
- meson.source_root() / 'scripts/qapi/expr.py',
- meson.source_root() / 'scripts/qapi/gen.py',
- meson.source_root() / 'scripts/qapi/introspect.py',
- meson.source_root() / 'scripts/qapi/parser.py',
- meson.source_root() / 'scripts/qapi/schema.py',
- meson.source_root() / 'scripts/qapi/source.py',
- meson.source_root() / 'scripts/qapi/types.py',
- meson.source_root() / 'scripts/qapi/visit.py',
- meson.source_root() / 'scripts/qapi/common.py',
- meson.source_root() / 'scripts/qapi-gen.py'
+qapi_gen_depends = [ meson.current_source_dir() / 'scripts/qapi/__init__.py',
+ meson.current_source_dir() / 'scripts/qapi/commands.py',
+ meson.current_source_dir() / 'scripts/qapi/common.py',
+ meson.current_source_dir() / 'scripts/qapi/error.py',
+ meson.current_source_dir() / 'scripts/qapi/events.py',
+ meson.current_source_dir() / 'scripts/qapi/expr.py',
+ meson.current_source_dir() / 'scripts/qapi/gen.py',
+ meson.current_source_dir() / 'scripts/qapi/introspect.py',
+ meson.current_source_dir() / 'scripts/qapi/parser.py',
+ meson.current_source_dir() / 'scripts/qapi/schema.py',
+ meson.current_source_dir() / 'scripts/qapi/source.py',
+ meson.current_source_dir() / 'scripts/qapi/types.py',
+ meson.current_source_dir() / 'scripts/qapi/visit.py',
+ meson.current_source_dir() / 'scripts/qapi/common.py',
+ meson.current_source_dir() / 'scripts/qapi-gen.py'
]
tracetool = [
@@ -1894,14 +1890,14 @@ foreach target : target_dirs
if target.endswith('-softmmu')
execs = [{
'name': 'qemu-system-' + target_name,
- 'gui': false,
+ 'win_subsystem': 'console',
'sources': files('softmmu/main.c'),
'dependencies': []
}]
if targetos == 'windows' and (sdl.found() or gtk.found())
execs += [{
'name': 'qemu-system-' + target_name + 'w',
- 'gui': true,
+ 'win_subsystem': 'windows',
'sources': files('softmmu/main.c'),
'dependencies': []
}]
@@ -1910,7 +1906,7 @@ foreach target : target_dirs
specific_fuzz = specific_fuzz_ss.apply(config_target, strict: false)
execs += [{
'name': 'qemu-fuzz-' + target_name,
- 'gui': false,
+ 'win_subsystem': 'console',
'sources': specific_fuzz.sources(),
'dependencies': specific_fuzz.dependencies(),
}]
@@ -1918,7 +1914,7 @@ foreach target : target_dirs
else
execs = [{
'name': 'qemu-' + target_name,
- 'gui': false,
+ 'win_subsystem': 'console',
'sources': [],
'dependencies': []
}]
@@ -1933,7 +1929,7 @@ foreach target : target_dirs
link_language: link_language,
link_depends: [block_syms, qemu_syms] + exe.get('link_depends', []),
link_args: link_args,
- gui_app: exe['gui'])
+ win_subsystem: exe['win_subsystem'])
}
if 'CONFIG_TRACE_SYSTEMTAP' in config_host
diff --git a/plugins/meson.build b/plugins/meson.build
index e77723010e..d58efc980e 100644
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -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
diff --git a/tests/meson.build b/tests/meson.build
index 1fa068f27b..0b8c3c6f32 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -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': [],
}
diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build
index 304ef939bd..26588396d2 100644
--- a/tests/qapi-schema/meson.build
+++ b/tests/qapi-schema/meson.build
@@ -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()])
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index 6a67c538be..450af3e51c 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -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
diff --git a/trace/meson.build b/trace/meson.build
index b19309b327..012d0dbceb 100644
--- a/trace/meson.build
+++ b/trace/meson.build
@@ -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)
--
2.29.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 4/7] meson: fix detection of curses with pkgconfig
2020-12-16 16:19 [PATCH 0/7] First round of meson bugfixes and cleanups for 6.0 Paolo Bonzini
` (2 preceding siblings ...)
2020-12-16 16:20 ` [PATCH 3/7] meson: switch minimum meson version " Paolo Bonzini
@ 2020-12-16 16:20 ` Paolo Bonzini
2020-12-16 16:54 ` Marc-André Lureau
2020-12-16 16:20 ` [PATCH 5/7] meson: use pkg-config method for libudev Paolo Bonzini
` (2 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Paolo Bonzini @ 2020-12-16 16:20 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
meson.build | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/meson.build b/meson.build
index 39fc9b7143..ab622ae8bd 100644
--- a/meson.build
+++ b/meson.build
@@ -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')
--
2.29.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 5/7] meson: use pkg-config method for libudev
2020-12-16 16:19 [PATCH 0/7] First round of meson bugfixes and cleanups for 6.0 Paolo Bonzini
` (3 preceding siblings ...)
2020-12-16 16:20 ` [PATCH 4/7] meson: fix detection of curses with pkgconfig Paolo Bonzini
@ 2020-12-16 16:20 ` Paolo Bonzini
2020-12-16 16:56 ` Marc-André Lureau
2020-12-16 16:20 ` [PATCH 6/7] meson: use dependency to gate block modules Paolo Bonzini
2020-12-16 16:20 ` [PATCH 7/7] meson: cleanup Kconfig.host handling Paolo Bonzini
6 siblings, 1 reply; 15+ messages in thread
From: Paolo Bonzini @ 2020-12-16 16:20 UTC (permalink / raw)
To: qemu-devel
Do not bother asking CMake, this is a pkg-config dependency.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
meson.build | 1 +
1 file changed, 1 insertion(+)
diff --git a/meson.build b/meson.build
index ab622ae8bd..0b36fb38f1 100644
--- a/meson.build
+++ b/meson.build
@@ -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
--
2.29.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 6/7] meson: use dependency to gate block modules
2020-12-16 16:19 [PATCH 0/7] First round of meson bugfixes and cleanups for 6.0 Paolo Bonzini
` (4 preceding siblings ...)
2020-12-16 16:20 ` [PATCH 5/7] meson: use pkg-config method for libudev Paolo Bonzini
@ 2020-12-16 16:20 ` Paolo Bonzini
2020-12-16 16:57 ` Marc-André Lureau
2020-12-16 16:20 ` [PATCH 7/7] meson: cleanup Kconfig.host handling Paolo Bonzini
6 siblings, 1 reply; 15+ messages in thread
From: Paolo Bonzini @ 2020-12-16 16:20 UTC (permalink / raw)
To: qemu-devel
This 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.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
block/meson.build | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/block/meson.build b/block/meson.build
index 5dcc1e5cce..b02cb14aad 100644
--- a/block/meson.build
+++ b/block/meson.build
@@ -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}
--
2.29.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 7/7] meson: cleanup Kconfig.host handling
2020-12-16 16:19 [PATCH 0/7] First round of meson bugfixes and cleanups for 6.0 Paolo Bonzini
` (5 preceding siblings ...)
2020-12-16 16:20 ` [PATCH 6/7] meson: use dependency to gate block modules Paolo Bonzini
@ 2020-12-16 16:20 ` Paolo Bonzini
2020-12-16 17:18 ` Marc-André Lureau
6 siblings, 1 reply; 15+ messages in thread
From: Paolo Bonzini @ 2020-12-16 16:20 UTC (permalink / raw)
To: qemu-devel
Build 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.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
accel/Kconfig | 9 +++++++++
docs/devel/kconfig.rst | 19 +++++++++----------
meson.build | 43 +++++++++++++++++-------------------------
3 files changed, 35 insertions(+), 36 deletions(-)
diff --git a/accel/Kconfig b/accel/Kconfig
index 2ad94a3839..461104c771 100644
--- a/accel/Kconfig
+++ b/accel/Kconfig
@@ -1,3 +1,12 @@
+config WHPX
+ bool
+
+config HAX
+ bool
+
+config HVF
+ bool
+
config TCG
bool
diff --git a/docs/devel/kconfig.rst b/docs/devel/kconfig.rst
index 336ba0e8e5..cb2d7ffac0 100644
--- a/docs/devel/kconfig.rst
+++ b/docs/devel/kconfig.rst
@@ -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'] : []) + \
...
diff --git a/meson.build b/meson.build
index 0b36fb38f1..bb198f792a 100644
--- a/meson.build
+++ b/meson.build
@@ -954,21 +954,19 @@ if link_language == 'cpp'
}
endif
-kconfig_external_symbols = [
- 'CONFIG_KVM',
- 'CONFIG_XEN',
- 'CONFIG_TPM',
- 'CONFIG_SPICE',
- 'CONFIG_IVSHMEM',
- 'CONFIG_OPENGL',
- 'CONFIG_X11',
- 'CONFIG_VHOST_USER',
- 'CONFIG_VHOST_VDPA',
- 'CONFIG_VHOST_KERNEL',
- 'CONFIG_VIRTFS',
- 'CONFIG_LINUX',
- 'CONFIG_PVRDMA',
-]
+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'] : []) + \
+ ('CONFIG_OPENGL' in config_host ? ['CONFIG_OPENGL=y'] : []) + \
+ ('CONFIG_X11' in config_host ? ['CONFIG_X11=y'] : []) + \
+ ('CONFIG_VHOST_USER' in config_host ? ['CONFIG_VHOST_USER=y'] : []) + \
+ ('CONFIG_VHOST_VDPA' in config_host ? ['CONFIG_VHOST_VDPA=y'] : []) + \
+ ('CONFIG_VHOST_KERNEL' in config_host ? ['CONFIG_VHOST_KERNEL=y'] : []) + \
+ ('CONFIG_VIRTFS' in config_host ? ['CONFIG_VIRTFS=y'] : []) + \
+ ('CONFIG_LINUX' in config_host ? ['CONFIG_LINUX=y'] : []) + \
+ ('CONFIG_PVRDMA' in config_host ? ['CONFIG_PVRDMA=y'] : [])
+
ignored = [ 'TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_ARCH' ]
default_targets = 'CONFIG_DEFAULT_TARGETS' in config_host
@@ -1003,7 +1001,7 @@ foreach target : target_dirs
}
endif
- have_accel = false
+ accel_kconfig = []
foreach sym: accelerators
if sym == 'CONFIG_TCG' or target in accelerator_targets.get(sym, [])
config_target += { sym: 'y' }
@@ -1011,10 +1009,10 @@ foreach target : target_dirs
if sym == 'CONFIG_XEN' and have_xen_pci_passthrough
config_target += { 'CONFIG_XEN_PCI_PASSTHROUGH': 'y' }
endif
- have_accel = true
+ accel_kconfig += [ sym + '=y' ]
endif
endforeach
- if not have_accel
+ if accel_kconfig.length() == 0
if default_targets
continue
endif
@@ -1068,13 +1066,6 @@ foreach target : target_dirs
configuration: config_target_data)}
if target.endswith('-softmmu')
- base_kconfig = []
- foreach sym : kconfig_external_symbols
- if sym in config_target or sym in config_host
- base_kconfig += '@0@=y'.format(sym)
- endif
- endforeach
-
config_devices_mak = target + '-config-devices.mak'
config_devices_mak = configure_file(
input: ['default-configs/devices' / target + '.mak', 'Kconfig'],
@@ -1083,7 +1074,7 @@ foreach target : target_dirs
capture: true,
command: [minikconf, config_host['CONFIG_MINIKCONF_MODE'],
config_devices_mak, '@DEPFILE@', '@INPUT@',
- base_kconfig])
+ host_kconfig, accel_kconfig])
config_devices_data = configuration_data()
config_devices = keyval.load(config_devices_mak)
--
2.29.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 2/7] meson: update submodule to 0.56.0
2020-12-16 16:20 ` [PATCH 2/7] meson: update submodule to 0.56.0 Paolo Bonzini
@ 2020-12-16 16:52 ` Marc-André Lureau
0 siblings, 0 replies; 15+ messages in thread
From: Marc-André Lureau @ 2020-12-16 16:52 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: QEMU
[-- Attachment #1: Type: text/plain, Size: 1213 bytes --]
On Wed, Dec 16, 2020 at 8:25 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
> configure | 2 +-
> meson | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/configure b/configure
> index 6317964997..8d12b715e3 100755
> --- a/configure
> +++ b/configure
> @@ -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
> diff --git a/meson b/meson
> index 776acd2a80..f16d31607e 160000
> --- a/meson
> +++ b/meson
> @@ -1 +1 @@
> -Subproject commit 776acd2a805c9b42b4f0375150977df42130317f
> +Subproject commit f16d31607eb3cd0f281758bd0944e206ef6be387
> --
> 2.29.2
>
>
>
>
--
Marc-André Lureau
[-- Attachment #2: Type: text/html, Size: 2090 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 3/7] meson: switch minimum meson version to 0.56.0
2020-12-16 16:20 ` [PATCH 3/7] meson: switch minimum meson version " Paolo Bonzini
@ 2020-12-16 16:53 ` Marc-André Lureau
0 siblings, 0 replies; 15+ messages in thread
From: Marc-André Lureau @ 2020-12-16 16:53 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: QEMU
[-- Attachment #1: Type: text/plain, Size: 12713 bytes --]
On Wed, Dec 16, 2020 at 8:24 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
> Meson 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.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
> 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(-)
>
> diff --git a/configure b/configure
> index 8d12b715e3..708cf365f0 100755
> --- a/configure
> +++ b/configure
> @@ -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 \
> diff --git a/docs/meson.build b/docs/meson.build
> index bb8fe4c9e4..4e88ed7516 100644
> --- a/docs/meson.build
> +++ b/docs/meson.build
> @@ -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',
> diff --git a/meson.build b/meson.build
> index 77ac9ec01b..39fc9b7143 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -1,14 +1,10 @@
> -project('qemu', ['c'], meson_version: '>=0.55.0',
> - default_options: ['warning_level=1', 'c_std=gnu99',
> 'cpp_std=gnu++11', 'b_colorout=auto'] +
> - (meson.version().version_compare('>=0.56.0') ? [
> 'b_staticpic=false' ] : []),
> - version: run_command('head', meson.source_root() /
> 'VERSION').stdout().strip())
> +project('qemu', ['c'], meson_version: '>=0.56.0',
> + default_options: ['warning_level=1', 'c_std=gnu99',
> 'cpp_std=gnu++11', 'b_colorout=auto',
> + 'b_staticpic=false'],
> + version: run_command('head', meson.project_source_root() /
> 'VERSION').stdout().strip())
>
> not_found = dependency('', required: false)
> -if meson.version().version_compare('>=0.56.0')
> - keyval = import('keyval')
> -else
> - keyval = import('unstable-keyval')
> -endif
> +keyval = import('keyval')
> ss = import('sourceset')
> fs = import('fs')
>
> @@ -1372,21 +1368,21 @@ genh += configure_file(output: 'config-host.h',
> configuration: config_host_data)
> hxtool = find_program('scripts/hxtool')
> shaderinclude = find_program('scripts/shaderinclude.pl')
> qapi_gen = find_program('scripts/qapi-gen.py')
> -qapi_gen_depends = [ meson.source_root() / 'scripts/qapi/__init__.py',
> - meson.source_root() / 'scripts/qapi/commands.py',
> - meson.source_root() / 'scripts/qapi/common.py',
> - meson.source_root() / 'scripts/qapi/error.py',
> - meson.source_root() / 'scripts/qapi/events.py',
> - meson.source_root() / 'scripts/qapi/expr.py',
> - meson.source_root() / 'scripts/qapi/gen.py',
> - meson.source_root() / 'scripts/qapi/introspect.py',
> - meson.source_root() / 'scripts/qapi/parser.py',
> - meson.source_root() / 'scripts/qapi/schema.py',
> - meson.source_root() / 'scripts/qapi/source.py',
> - meson.source_root() / 'scripts/qapi/types.py',
> - meson.source_root() / 'scripts/qapi/visit.py',
> - meson.source_root() / 'scripts/qapi/common.py',
> - meson.source_root() / 'scripts/qapi-gen.py'
> +qapi_gen_depends = [ meson.current_source_dir() /
> 'scripts/qapi/__init__.py',
> + meson.current_source_dir() /
> 'scripts/qapi/commands.py',
> + meson.current_source_dir() /
> 'scripts/qapi/common.py',
> + meson.current_source_dir() / 'scripts/qapi/error.py',
> + meson.current_source_dir() /
> 'scripts/qapi/events.py',
> + meson.current_source_dir() / 'scripts/qapi/expr.py',
> + meson.current_source_dir() / 'scripts/qapi/gen.py',
> + meson.current_source_dir() /
> 'scripts/qapi/introspect.py',
> + meson.current_source_dir() /
> 'scripts/qapi/parser.py',
> + meson.current_source_dir() /
> 'scripts/qapi/schema.py',
> + meson.current_source_dir() /
> 'scripts/qapi/source.py',
> + meson.current_source_dir() / 'scripts/qapi/types.py',
> + meson.current_source_dir() / 'scripts/qapi/visit.py',
> + meson.current_source_dir() /
> 'scripts/qapi/common.py',
> + meson.current_source_dir() / 'scripts/qapi-gen.py'
> ]
>
> tracetool = [
> @@ -1894,14 +1890,14 @@ foreach target : target_dirs
> if target.endswith('-softmmu')
> execs = [{
> 'name': 'qemu-system-' + target_name,
> - 'gui': false,
> + 'win_subsystem': 'console',
> 'sources': files('softmmu/main.c'),
> 'dependencies': []
> }]
> if targetos == 'windows' and (sdl.found() or gtk.found())
> execs += [{
> 'name': 'qemu-system-' + target_name + 'w',
> - 'gui': true,
> + 'win_subsystem': 'windows',
> 'sources': files('softmmu/main.c'),
> 'dependencies': []
> }]
> @@ -1910,7 +1906,7 @@ foreach target : target_dirs
> specific_fuzz = specific_fuzz_ss.apply(config_target, strict: false)
> execs += [{
> 'name': 'qemu-fuzz-' + target_name,
> - 'gui': false,
> + 'win_subsystem': 'console',
> 'sources': specific_fuzz.sources(),
> 'dependencies': specific_fuzz.dependencies(),
> }]
> @@ -1918,7 +1914,7 @@ foreach target : target_dirs
> else
> execs = [{
> 'name': 'qemu-' + target_name,
> - 'gui': false,
> + 'win_subsystem': 'console',
> 'sources': [],
> 'dependencies': []
> }]
> @@ -1933,7 +1929,7 @@ foreach target : target_dirs
> link_language: link_language,
> link_depends: [block_syms, qemu_syms] +
> exe.get('link_depends', []),
> link_args: link_args,
> - gui_app: exe['gui'])
> + win_subsystem: exe['win_subsystem'])
> }
>
> if 'CONFIG_TRACE_SYSTEMTAP' in config_host
> diff --git a/plugins/meson.build b/plugins/meson.build
> index e77723010e..d58efc980e 100644
> --- a/plugins/meson.build
> +++ b/plugins/meson.build
> @@ -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
> diff --git a/tests/meson.build b/tests/meson.build
> index 1fa068f27b..0b8c3c6f32 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -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': [],
> }
>
> diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build
> index 304ef939bd..26588396d2 100644
> --- a/tests/qapi-schema/meson.build
> +++ b/tests/qapi-schema/meson.build
> @@ -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()])
> diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
> index 6a67c538be..450af3e51c 100644
> --- a/tests/qtest/meson.build
> +++ b/tests/qtest/meson.build
> @@ -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
> diff --git a/trace/meson.build b/trace/meson.build
> index b19309b327..012d0dbceb 100644
> --- a/trace/meson.build
> +++ b/trace/meson.build
> @@ -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)
> --
> 2.29.2
>
>
>
>
--
Marc-André Lureau
[-- Attachment #2: Type: text/html, Size: 16358 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 4/7] meson: fix detection of curses with pkgconfig
2020-12-16 16:20 ` [PATCH 4/7] meson: fix detection of curses with pkgconfig Paolo Bonzini
@ 2020-12-16 16:54 ` Marc-André Lureau
0 siblings, 0 replies; 15+ messages in thread
From: Marc-André Lureau @ 2020-12-16 16:54 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: QEMU
[-- Attachment #1: Type: text/plain, Size: 1456 bytes --]
On Wed, Dec 16, 2020 at 8:22 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
> meson.build | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index 39fc9b7143..ab622ae8bd 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -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')
> --
> 2.29.2
>
>
>
>
--
Marc-André Lureau
[-- Attachment #2: Type: text/html, Size: 2318 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 5/7] meson: use pkg-config method for libudev
2020-12-16 16:20 ` [PATCH 5/7] meson: use pkg-config method for libudev Paolo Bonzini
@ 2020-12-16 16:56 ` Marc-André Lureau
0 siblings, 0 replies; 15+ messages in thread
From: Marc-André Lureau @ 2020-12-16 16:56 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: QEMU
[-- Attachment #1: Type: text/plain, Size: 880 bytes --]
On Wed, Dec 16, 2020 at 8:28 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
> Do not bother asking CMake, this is a pkg-config dependency.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>
What was the problem with the default behaviour? Do we need to set
pkg-config explicitly on all dependencies?
---
> meson.build | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/meson.build b/meson.build
> index ab622ae8bd..0b36fb38f1 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -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
> --
> 2.29.2
>
>
>
>
--
Marc-André Lureau
[-- Attachment #2: Type: text/html, Size: 1612 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 6/7] meson: use dependency to gate block modules
2020-12-16 16:20 ` [PATCH 6/7] meson: use dependency to gate block modules Paolo Bonzini
@ 2020-12-16 16:57 ` Marc-André Lureau
0 siblings, 0 replies; 15+ messages in thread
From: Marc-André Lureau @ 2020-12-16 16:57 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: QEMU
[-- Attachment #1: Type: text/plain, Size: 2100 bytes --]
On Wed, Dec 16, 2020 at 8:26 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
> This 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.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
> block/meson.build | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/block/meson.build b/block/meson.build
> index 5dcc1e5cce..b02cb14aad 100644
> --- a/block/meson.build
> +++ b/block/meson.build
> @@ -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}
> --
> 2.29.2
>
>
>
>
--
Marc-André Lureau
[-- Attachment #2: Type: text/html, Size: 3263 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 7/7] meson: cleanup Kconfig.host handling
2020-12-16 16:20 ` [PATCH 7/7] meson: cleanup Kconfig.host handling Paolo Bonzini
@ 2020-12-16 17:18 ` Marc-André Lureau
0 siblings, 0 replies; 15+ messages in thread
From: Marc-André Lureau @ 2020-12-16 17:18 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: QEMU
[-- Attachment #1: Type: text/plain, Size: 5693 bytes --]
Hi
On Wed, Dec 16, 2020 at 8:26 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
> Build 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.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>
nice cleanup
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
> accel/Kconfig | 9 +++++++++
> docs/devel/kconfig.rst | 19 +++++++++----------
> meson.build | 43 +++++++++++++++++-------------------------
> 3 files changed, 35 insertions(+), 36 deletions(-)
>
> diff --git a/accel/Kconfig b/accel/Kconfig
> index 2ad94a3839..461104c771 100644
> --- a/accel/Kconfig
> +++ b/accel/Kconfig
> @@ -1,3 +1,12 @@
> +config WHPX
> + bool
> +
> +config HAX
> + bool
> +
> +config HVF
> + bool
> +
> config TCG
> bool
>
> diff --git a/docs/devel/kconfig.rst b/docs/devel/kconfig.rst
> index 336ba0e8e5..cb2d7ffac0 100644
> --- a/docs/devel/kconfig.rst
> +++ b/docs/devel/kconfig.rst
> @@ -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'] : []) + \
> ...
> diff --git a/meson.build b/meson.build
> index 0b36fb38f1..bb198f792a 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -954,21 +954,19 @@ if link_language == 'cpp'
> }
> endif
>
> -kconfig_external_symbols = [
> - 'CONFIG_KVM',
> - 'CONFIG_XEN',
> - 'CONFIG_TPM',
> - 'CONFIG_SPICE',
> - 'CONFIG_IVSHMEM',
> - 'CONFIG_OPENGL',
> - 'CONFIG_X11',
> - 'CONFIG_VHOST_USER',
> - 'CONFIG_VHOST_VDPA',
> - 'CONFIG_VHOST_KERNEL',
> - 'CONFIG_VIRTFS',
> - 'CONFIG_LINUX',
> - 'CONFIG_PVRDMA',
> -]
> +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'] : []) + \
> + ('CONFIG_OPENGL' in config_host ? ['CONFIG_OPENGL=y'] : []) + \
> + ('CONFIG_X11' in config_host ? ['CONFIG_X11=y'] : []) + \
> + ('CONFIG_VHOST_USER' in config_host ? ['CONFIG_VHOST_USER=y'] : []) + \
> + ('CONFIG_VHOST_VDPA' in config_host ? ['CONFIG_VHOST_VDPA=y'] : []) + \
> + ('CONFIG_VHOST_KERNEL' in config_host ? ['CONFIG_VHOST_KERNEL=y'] : [])
> + \
> + ('CONFIG_VIRTFS' in config_host ? ['CONFIG_VIRTFS=y'] : []) + \
> + ('CONFIG_LINUX' in config_host ? ['CONFIG_LINUX=y'] : []) + \
> + ('CONFIG_PVRDMA' in config_host ? ['CONFIG_PVRDMA=y'] : [])
> +
> ignored = [ 'TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_ARCH' ]
>
> default_targets = 'CONFIG_DEFAULT_TARGETS' in config_host
> @@ -1003,7 +1001,7 @@ foreach target : target_dirs
> }
> endif
>
> - have_accel = false
> + accel_kconfig = []
> foreach sym: accelerators
> if sym == 'CONFIG_TCG' or target in accelerator_targets.get(sym, [])
> config_target += { sym: 'y' }
> @@ -1011,10 +1009,10 @@ foreach target : target_dirs
> if sym == 'CONFIG_XEN' and have_xen_pci_passthrough
> config_target += { 'CONFIG_XEN_PCI_PASSTHROUGH': 'y' }
> endif
> - have_accel = true
> + accel_kconfig += [ sym + '=y' ]
> endif
> endforeach
> - if not have_accel
> + if accel_kconfig.length() == 0
> if default_targets
> continue
> endif
> @@ -1068,13 +1066,6 @@ foreach target : target_dirs
> configuration:
> config_target_data)}
>
> if target.endswith('-softmmu')
> - base_kconfig = []
> - foreach sym : kconfig_external_symbols
> - if sym in config_target or sym in config_host
> - base_kconfig += '@0@=y'.format(sym)
> - endif
> - endforeach
> -
> config_devices_mak = target + '-config-devices.mak'
> config_devices_mak = configure_file(
> input: ['default-configs/devices' / target + '.mak', 'Kconfig'],
> @@ -1083,7 +1074,7 @@ foreach target : target_dirs
> capture: true,
> command: [minikconf, config_host['CONFIG_MINIKCONF_MODE'],
> config_devices_mak, '@DEPFILE@', '@INPUT@',
> - base_kconfig])
> + host_kconfig, accel_kconfig])
>
> config_devices_data = configuration_data()
> config_devices = keyval.load(config_devices_mak)
> --
> 2.29.2
>
>
>
--
Marc-André Lureau
[-- Attachment #2: Type: text/html, Size: 7434 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 6/7] meson: use dependency to gate block modules
2020-12-16 15:02 [PATCH 0/7] First round of meson bugfixes and cleanups for 6.0 Paolo Bonzini
@ 2020-12-16 15:02 ` Paolo Bonzini
0 siblings, 0 replies; 15+ messages in thread
From: Paolo Bonzini @ 2020-12-16 15:02 UTC (permalink / raw)
To: qemu-devel
This 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.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
block/meson.build | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/block/meson.build b/block/meson.build
index 5dcc1e5cce..b02cb14aad 100644
--- a/block/meson.build
+++ b/block/meson.build
@@ -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}
--
2.29.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
end of thread, other threads:[~2020-12-16 17:35 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 16:19 [PATCH 0/7] First round of meson bugfixes and cleanups for 6.0 Paolo Bonzini
2020-12-16 16:20 ` [PATCH 1/7] Makefile: add dummy target for build.ninja dependencies Paolo Bonzini
2020-12-16 16:20 ` [PATCH 2/7] meson: update submodule to 0.56.0 Paolo Bonzini
2020-12-16 16:52 ` Marc-André Lureau
2020-12-16 16:20 ` [PATCH 3/7] meson: switch minimum meson version " Paolo Bonzini
2020-12-16 16:53 ` Marc-André Lureau
2020-12-16 16:20 ` [PATCH 4/7] meson: fix detection of curses with pkgconfig Paolo Bonzini
2020-12-16 16:54 ` Marc-André Lureau
2020-12-16 16:20 ` [PATCH 5/7] meson: use pkg-config method for libudev Paolo Bonzini
2020-12-16 16:56 ` Marc-André Lureau
2020-12-16 16:20 ` [PATCH 6/7] meson: use dependency to gate block modules Paolo Bonzini
2020-12-16 16:57 ` Marc-André Lureau
2020-12-16 16:20 ` [PATCH 7/7] meson: cleanup Kconfig.host handling Paolo Bonzini
2020-12-16 17:18 ` Marc-André Lureau
-- strict thread matches above, loose matches on Subject: below --
2020-12-16 15:02 [PATCH 0/7] First round of meson bugfixes and cleanups for 6.0 Paolo Bonzini
2020-12-16 15:02 ` [PATCH 6/7] meson: use dependency to gate block modules Paolo Bonzini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.