1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
ppc: 0.916
device: 0.835
PID: 0.776
mistranslation: 0.722
semantic: 0.645
files: 0.619
graphic: 0.565
socket: 0.530
arm: 0.503
network: 0.466
peripherals: 0.449
debug: 0.430
hypervisor: 0.396
vnc: 0.369
architecture: 0.353
boot: 0.338
performance: 0.336
assembly: 0.322
register: 0.310
user-level: 0.294
kernel: 0.289
risc-v: 0.285
permissions: 0.284
virtual: 0.205
VMM: 0.185
TCG: 0.177
x86: 0.176
i386: 0.144
KVM: 0.109
contrib/plugins/Makefile is not crossplatform
Description of problem:
Currently `contrib/plugins/Makefile` makes multiple assumptions about paths used, compiler flags available, and library extension
Steps to reproduce:
1. Compile QEMU from sources on macOS or Windows
2. Enter `contrib/plugins`
3. Type `make` and become sad.
Additional information:
As the rest of QEMU switched to Meson, maybe it's a good idea to do the same for plugins as well?
This is what I come with myself:
`meson.build`:
```meson
project('qemu-plugins', 'c', meson_version: '>=0.50.0')
qemu_src = get_option('qemu_path')
if qemu_src == ''
qemu_src = '../..'
endif
qemu_include = qemu_src + '/include/qemu'
incdir = include_directories(qemu_include)
plugins = [
'execlog',
'hotblocks',
'hotpages',
'howvec',
'lockstep',
'hwprofile',
'cache',
'drcov',
]
th = dependency('threads', required: true)
glib = dependency('glib-2.0', required: true)
foreach p: plugins
library(p, p + '.c',
include_directories: incdir,
dependencies: [th, glib],
override_options: ['b_lundef=false']
)
endforeach
```
`meson_options.txt`:
```
option('qemu_path', type : 'string', value : '', description : 'Full path to the QEMU sources to build the plugin for')
```
|