qemu-e2k/qga/meson.build
Peter Maydell 7a1043cef9 * configure and meson fixes
* "meson test" switch for iotests
 * deprecation of old SGX QAPI
 * unexport InterruptStatsProviderClass-related functions
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmHzwdAUHHBib256aW5p
 QHJlZGhhdC5jb20ACgkQv/vSX3jHroOlMwgApVO6T934TwuTOFBs02Tp8KcjcKQq
 5Qf5PrwbsluE8YixJERAFgfxgzbQKL/iHzkP97KoVo3CFFDc1sss7v3mrbbHxbwB
 jiYIgbNjRfBbZq7nNmxf2bcXxTpZYvMNEia0QPyNl1GQ0JS/RFOsEYcyVUPvVmAI
 djeESRyku1OS5bS5veqE2tL+AWDuodjHeW78qi+yIDRPx3jHLRzuGpQ/3KtgMN6o
 d61h5vVrqdxe1HYH/8sh+qU71w7drpNZVYq8PqkZyit/LXgDMyDDOks1XWarrrJE
 9xzNBUNR+B6CuHtNw1DGk4rvsCBV/F0ZVki6guVGoqG8njF3l6xyqRHPbw==
 =2/gW
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging

* configure and meson fixes
* "meson test" switch for iotests
* deprecation of old SGX QAPI
* unexport InterruptStatsProviderClass-related functions

# gpg: Signature made Fri 28 Jan 2022 10:13:36 GMT
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini-gitlab/tags/for-upstream:
  configure: fix parameter expansion of --cross-cc-cflags options
  qapi: Cleanup SGX related comments and restore @section-size
  check-block: replace -makecheck with TAP output
  qemu-iotests: require at least an argument to check-block.sh
  build: make check-block a meson test
  scripts/mtest2make: add support for SPEED=thorough
  check-block.sh: passthrough -jN flag of make to -j N flag of check
  meson: Use find_program() to resolve the entitlement.sh script
  exec/cpu: Make host pages variables / macros 'target agnostic'
  meson.build: Use a function from libfdt 1.5.1 for the library check
  intc: Unexport InterruptStatsProviderClass-related functions
  docker: add msitools to Fedora/mingw cross
  build-sys: fix undefined ARCH error
  build-sys: fix a meson deprecation warning

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-01-28 14:04:01 +00:00

138 lines
4.6 KiB
Meson

qga_qapi_outputs = [
'qga-qapi-commands.c',
'qga-qapi-commands.h',
'qga-qapi-emit-events.c',
'qga-qapi-emit-events.h',
'qga-qapi-events.c',
'qga-qapi-events.h',
'qga-qapi-init-commands.c',
'qga-qapi-init-commands.h',
'qga-qapi-introspect.c',
'qga-qapi-introspect.h',
'qga-qapi-types.c',
'qga-qapi-types.h',
'qga-qapi-visit.c',
'qga-qapi-visit.h',
]
# Problem: to generate trace events, we'd have to add the .trace-events
# file to qapi_trace_events like we do in qapi/meson.build. Since
# qapi_trace_events is used by trace/meson.build, we'd have to move
# subdir('qga') above subdir('trace') in the top-level meson.build.
# Can't, because it would break the dependency of qga on qemuutil (which
# depends on trace_ss). Not worth solving now; simply suppress trace
# event generation instead.
qga_qapi_files = custom_target('QGA QAPI files',
output: qga_qapi_outputs,
input: 'qapi-schema.json',
command: [ qapi_gen, '-o', 'qga', '-p', 'qga-', '@INPUT0@',
'--suppress-tracing' ],
depend_files: qapi_gen_depends)
qga_ss = ss.source_set()
qga_ss.add(qga_qapi_files.to_list())
qga_ss.add(files(
'commands.c',
'guest-agent-command-state.c',
'main.c',
))
qga_ss.add(when: 'CONFIG_POSIX', if_true: files(
'channel-posix.c',
'commands-posix.c',
'commands-posix-ssh.c',
))
qga_ss.add(when: 'CONFIG_WIN32', if_true: files(
'channel-win32.c',
'commands-win32.c',
'service-win32.c',
'vss-win32.c'
))
qga_ss = qga_ss.apply(config_host, strict: false)
qga = executable('qemu-ga', qga_ss.sources(),
link_args: config_host['LIBS_QGA'].split(),
dependencies: [qemuutil, libudev],
install: true)
all_qga = [qga]
if targetos == 'windows'
if 'CONFIG_QGA_VSS' in config_host
subdir('vss-win32')
else
gen_tlb = []
endif
qemu_ga_msi_arch = {
'x86': ['-D', 'Arch=32'],
'x86_64': ['-a', 'x64', '-D', 'Arch=64']
}
wixl = not_found
if cpu in qemu_ga_msi_arch
wixl = find_program('wixl', required: get_option('guest_agent_msi'))
elif get_option('guest_agent_msi').enabled()
error('CPU not supported for building guest agent installation package')
endif
if wixl.found()
deps = [gen_tlb, qga]
qemu_ga_msi_vss = []
if 'CONFIG_QGA_VSS' in config_host
qemu_ga_msi_vss = ['-D', 'InstallVss']
deps += qga_vss
endif
qga_msi = custom_target('QGA MSI',
input: files('installer/qemu-ga.wxs'),
output: 'qemu-ga-@0@.msi'.format(host_arch),
depends: deps,
command: [
find_program('env'),
'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'],
'QEMU_GA_MANUFACTURER=' + config_host['QEMU_GA_MANUFACTURER'],
'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'],
'BUILD_DIR=' + meson.build_root(),
wixl, '-o', '@OUTPUT0@', '@INPUT0@',
qemu_ga_msi_arch[cpu],
qemu_ga_msi_vss,
'-D', 'Mingw_dlls=' + config_host['QEMU_GA_MSI_MINGW_DLL_PATH'],
])
all_qga += [qga_msi]
alias_target('msi', qga_msi)
endif
else
if get_option('guest_agent_msi').enabled()
error('MSI guest agent package is available only for MinGW Windows cross-compilation')
endif
install_subdir('run', install_dir: get_option('localstatedir'))
endif
alias_target('qemu-ga', all_qga)
test_env = environment()
test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
# disable qga-ssh-test for now. glib's G_TEST_OPTION_ISOLATE_DIRS triggers
# the leak detector in build-oss-fuzz Gitlab CI test. we should re-enable
# this when an alternative is implemented or when the underlying glib
# issue is identified/fix
#if 'CONFIG_POSIX' in config_host
if false
srcs = [files('commands-posix-ssh.c')]
i = 0
foreach output: qga_qapi_outputs
if output.startswith('qga-qapi-types') or output.startswith('qga-qapi-visit')
srcs += qga_qapi_files[i]
endif
i = i + 1
endforeach
qga_ssh_test = executable('qga-ssh-test', srcs,
dependencies: [qemuutil],
c_args: ['-DQGA_BUILD_UNIT_TEST'])
test('qga-ssh-test',
qga_ssh_test,
env: test_env,
suite: ['unit', 'qga'])
endif