* Drop ninjatool and just require ninja (Paolo)

* Fix docs build under msys2 (Yonggang)
 * HAX snafu fix (Claudio)
 * Disable signal handlers during fuzzing (Alex)
 * Miscellaneous fixes (Bruce, Greg)
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAl+LA6QUHHBib256aW5p
 QHJlZGhhdC5jb20ACgkQv/vSX3jHroPa0wgAk6DqUR/eSv2tmwd6EiSLi+ngnA2q
 WcqbsEe8DQRZeNWB8WQHTp3g6DdwMjhCdn2KBZmT51g1pdyVoqu0wiW1lfb/plRR
 2aCcpMt++X4s8KdrILQ+gR7ZOR88GT6Mbm+9tt8MlYJu8aC8KW4wLMr/wAorNe+i
 iEMweEK0cw+TFYdb/cQV3vRgfp/DyiRGGG9MHrYa6eygkDqA1YBffTjlybivibjg
 WxRFtSd8pqFGyVsPsnRk0MX3+MY1U4Ah2Film/PukW6c2K0IOHR2zVRJOOR+Zd2E
 cCD3w+26/akivI01yH1V2kOzfsV2NipOtD7YW1DTMl5FFTSAKvXLzFibpA==
 =uWTa
 -----END PGP SIGNATURE-----

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

* Drop ninjatool and just require ninja (Paolo)
* Fix docs build under msys2 (Yonggang)
* HAX snafu fix (Claudio)
* Disable signal handlers during fuzzing (Alex)
* Miscellaneous fixes (Bruce, Greg)

# gpg: Signature made Sat 17 Oct 2020 15:45:56 BST
# 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: (22 commits)
  ci: include configure and meson logs in all jobs if configure fails
  hax: unbreak accelerator cpu code after cpus.c split
  fuzz: Disable QEMU's SIG{INT,HUP,TERM} handlers
  cirrus: Enable doc build on msys2/mingw
  meson: Move the detection logic for sphinx to meson
  meson: move SPHINX_ARGS references within "if build_docs"
  docs: Fix Sphinx configuration for msys2/mingw
  meson: Only install icons and qemu.desktop if have_system
  configure: fix handling of --docdir parameter
  meson: cleanup curses/iconv test
  meson.build: don't condition iconv detection on library detection
  build: add --enable/--disable-libudev
  build: replace ninjatool with ninja
  build: cleanups to Makefile
  add ninja to dockerfiles, CI configurations and test VMs
  dockerfiles: enable Centos 8 PowerTools
  configure: move QEMU_INCLUDES to meson
  tests: add missing generated sources to testqapi
  make: run shell with pipefail
  tests/Makefile.include: unbreak non-tcg builds
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2020-10-17 20:52:55 +01:00
commit 782d7b30dd
37 changed files with 391 additions and 1311 deletions

View File

@ -9,11 +9,11 @@ freebsd_12_task:
install_script: install_script:
- ASSUME_ALWAYS_YES=yes pkg bootstrap -f ; - ASSUME_ALWAYS_YES=yes pkg bootstrap -f ;
- pkg install -y bash curl cyrus-sasl git glib gmake gnutls gsed - pkg install -y bash curl cyrus-sasl git glib gmake gnutls gsed
nettle perl5 pixman pkgconf png usbredir nettle perl5 pixman pkgconf png usbredir ninja
script: script:
- mkdir build - mkdir build
- cd build - cd build
- ../configure --enable-werror || { cat config.log; exit 1; } - ../configure --enable-werror || { cat config.log meson-logs/meson-log.txt; exit 1; }
- gmake -j$(sysctl -n hw.ncpu) - gmake -j$(sysctl -n hw.ncpu)
- gmake -j$(sysctl -n hw.ncpu) check V=1 - gmake -j$(sysctl -n hw.ncpu) check V=1
@ -21,13 +21,13 @@ macos_task:
osx_instance: osx_instance:
image: catalina-base image: catalina-base
install_script: install_script:
- brew install pkg-config python gnu-sed glib pixman make sdl2 bash - brew install pkg-config python gnu-sed glib pixman make sdl2 bash ninja
script: script:
- mkdir build - mkdir build
- cd build - cd build
- ../configure --python=/usr/local/bin/python3 --enable-werror - ../configure --python=/usr/local/bin/python3 --enable-werror
--extra-cflags='-Wno-error=deprecated-declarations' --extra-cflags='-Wno-error=deprecated-declarations'
|| { cat config.log; exit 1; } || { cat config.log meson-logs/meson-log.txt; exit 1; }
- gmake -j$(sysctl -n hw.ncpu) - gmake -j$(sysctl -n hw.ncpu)
- gmake check V=1 - gmake check V=1
@ -36,12 +36,12 @@ macos_xcode_task:
# this is an alias for the latest Xcode # this is an alias for the latest Xcode
image: catalina-xcode image: catalina-xcode
install_script: install_script:
- brew install pkg-config gnu-sed glib pixman make sdl2 bash - brew install pkg-config gnu-sed glib pixman make sdl2 bash ninja
script: script:
- mkdir build - mkdir build
- cd build - cd build
- ../configure --extra-cflags='-Wno-error=deprecated-declarations' - ../configure --extra-cflags='-Wno-error=deprecated-declarations'
--enable-werror --cc=clang || { cat config.log; exit 1; } --enable-werror --cc=clang || { cat config.log meson-logs/meson-log.txt; exit 1; }
- gmake -j$(sysctl -n hw.ncpu) - gmake -j$(sysctl -n hw.ncpu)
- gmake check V=1 - gmake check V=1
@ -76,7 +76,6 @@ windows_msys2_task:
((Get-Content -path C:\tools\msys64\etc\\post-install\\07-pacman-key.post -Raw) -replace '--refresh-keys', '--version') | Set-Content -Path C:\tools\msys64\etc\\post-install\\07-pacman-key.post ((Get-Content -path C:\tools\msys64\etc\\post-install\\07-pacman-key.post -Raw) -replace '--refresh-keys', '--version') | Set-Content -Path C:\tools\msys64\etc\\post-install\\07-pacman-key.post
C:\tools\msys64\usr\bin\bash.exe -lc "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf" C:\tools\msys64\usr\bin\bash.exe -lc "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf"
C:\tools\msys64\usr\bin\bash.exe -lc "export" C:\tools\msys64\usr\bin\bash.exe -lc "export"
C:\tools\msys64\usr\bin\bash.exe -lc "grep -rl 'repo.msys2.org/' /etc/pacman.d/mirrorlist.* | xargs sed -i 's/repo.msys2.org\//mirrors.tuna.tsinghua.edu.cn\/msys2\//g'"
C:\tools\msys64\usr\bin\pacman.exe --noconfirm -Sy C:\tools\msys64\usr\bin\pacman.exe --noconfirm -Sy
echo Y | C:\tools\msys64\usr\bin\pacman.exe --noconfirm -Suu --overwrite=* echo Y | C:\tools\msys64\usr\bin\pacman.exe --noconfirm -Suu --overwrite=*
taskkill /F /FI "MODULES eq msys-2.0.dll" taskkill /F /FI "MODULES eq msys-2.0.dll"
@ -111,6 +110,11 @@ windows_msys2_task:
mingw-w64-x86_64-curl \ mingw-w64-x86_64-curl \
mingw-w64-x86_64-gnutls \ mingw-w64-x86_64-gnutls \
" "
bitsadmin /transfer msys_download /dynamic /download /priority FOREGROUND `
https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-python-sphinx-2.3.1-1-any.pkg.tar.xz `
C:\tools\mingw-w64-x86_64-python-sphinx-2.3.1-1-any.pkg.tar.xz
C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -U /c/tools/mingw-w64-x86_64-python-sphinx-2.3.1-1-any.pkg.tar.xz"
del C:\tools\mingw-w64-x86_64-python-sphinx-2.3.1-1-any.pkg.tar.xz
C:\tools\msys64\usr\bin\bash.exe -lc "rm -rf /var/cache/pacman/pkg/*" C:\tools\msys64\usr\bin\bash.exe -lc "rm -rf /var/cache/pacman/pkg/*"
cd C:\tools\msys64 cd C:\tools\msys64
echo "Start archive" echo "Start archive"
@ -123,8 +127,7 @@ windows_msys2_task:
script: script:
- C:\tools\msys64\usr\bin\bash.exe -lc "mkdir build" - C:\tools\msys64\usr\bin\bash.exe -lc "mkdir build"
- C:\tools\msys64\usr\bin\bash.exe -lc "cd build && ../configure - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && ../configure --python=python3"
--python=python3 --ninja=ninja"
- C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make -j8" - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make -j8"
test_script: test_script:
- C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make V=1 check" - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make V=1 check"

View File

@ -32,7 +32,7 @@ include:
../configure --enable-werror $CONFIGURE_ARGS --target-list="$TARGETS" ; ../configure --enable-werror $CONFIGURE_ARGS --target-list="$TARGETS" ;
else else
../configure --enable-werror $CONFIGURE_ARGS ; ../configure --enable-werror $CONFIGURE_ARGS ;
fi fi || { cat config.log meson-logs/meson-log.txt && exit 1; }
- make -j"$JOBS" - make -j"$JOBS"
- if test -n "$MAKE_CHECK_ARGS"; - if test -n "$MAKE_CHECK_ARGS";
then then
@ -229,7 +229,7 @@ build-tcg-disabled:
script: script:
- mkdir build - mkdir build
- cd build - cd build
- ../configure --disable-tcg --audio-drv-list="" - ../configure --disable-tcg --audio-drv-list="" || { cat config.log meson-logs/meson-log.txt && exit 1; }
- make -j"$JOBS" - make -j"$JOBS"
- make check-unit - make check-unit
- make check-qapi-schema - make check-qapi-schema
@ -322,7 +322,7 @@ build-tci:
- mkdir build - mkdir build
- cd build - cd build
- ../configure --enable-tcg-interpreter - ../configure --enable-tcg-interpreter
--target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
- make -j"$JOBS" - make -j"$JOBS"
- make run-tcg-tests-x86_64-softmmu - make run-tcg-tests-x86_64-softmmu
- make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test

View File

@ -49,6 +49,7 @@ addons:
- libvdeplug-dev - libvdeplug-dev
- libvte-2.91-dev - libvte-2.91-dev
- libzstd-dev - libzstd-dev
- ninja-build
- sparse - sparse
- uuid-dev - uuid-dev
- gcovr - gcovr
@ -94,7 +95,7 @@ before_install:
# Configure step - may be overridden # Configure step - may be overridden
before_script: before_script:
- mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR} - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
- ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; } - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log meson-logs/meson-log.txt && exit 1; }
# Main build & test - rarely overridden - controlled by TEST_CMD # Main build & test - rarely overridden - controlled by TEST_CMD
script: script:
@ -177,6 +178,7 @@ jobs:
addons: addons:
apt: apt:
packages: packages:
- ninja-build
- python3-sphinx - python3-sphinx
- perl - perl
@ -197,7 +199,7 @@ jobs:
compiler: clang compiler: clang
before_script: before_script:
- mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR} - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
- ${SRC_DIR}/configure ${CONFIG} --extra-cflags="-fsanitize=undefined -Werror" || { cat config.log && exit 1; } - ${SRC_DIR}/configure ${CONFIG} --extra-cflags="-fsanitize=undefined -Werror" || { cat config.log meson-logs/meson-log.txt && exit 1; }
- name: "Clang (other-softmmu)" - name: "Clang (other-softmmu)"
@ -211,6 +213,10 @@ jobs:
# gprof/gcov are GCC features # gprof/gcov are GCC features
- name: "GCC gprof/gcov" - name: "GCC gprof/gcov"
dist: bionic dist: bionic
addons:
apt:
packages:
- ninja-build
env: env:
- CONFIG="--enable-gprof --enable-gcov --disable-libssh - CONFIG="--enable-gprof --enable-gcov --disable-libssh
--target-list=${MAIN_SOFTMMU_TARGETS}" --target-list=${MAIN_SOFTMMU_TARGETS}"
@ -281,6 +287,7 @@ jobs:
- liburcu-dev - liburcu-dev
- libusb-1.0-0-dev - libusb-1.0-0-dev
- libvte-2.91-dev - libvte-2.91-dev
- ninja-build
- sparse - sparse
- uuid-dev - uuid-dev
language: generic language: generic
@ -291,7 +298,7 @@ jobs:
- TEST_CMD="" - TEST_CMD=""
before_script: before_script:
- mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR} - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
- ${SRC_DIR}/configure ${CONFIG} --extra-cflags="-g3 -O0 -fsanitize=thread" || { cat config.log && exit 1; } - ${SRC_DIR}/configure ${CONFIG} --extra-cflags="-g3 -O0 -fsanitize=thread" || { cat config.log meson-logs/meson-log.txt && exit 1; }
# Run check-tcg against linux-user # Run check-tcg against linux-user
@ -346,6 +353,7 @@ jobs:
- libusb-1.0-0-dev - libusb-1.0-0-dev
- libvdeplug-dev - libvdeplug-dev
- libvte-2.91-dev - libvte-2.91-dev
- ninja-build
# Tests dependencies # Tests dependencies
- genisoimage - genisoimage
env: env:
@ -379,6 +387,7 @@ jobs:
- libusb-1.0-0-dev - libusb-1.0-0-dev
- libvdeplug-dev - libvdeplug-dev
- libvte-2.91-dev - libvte-2.91-dev
- ninja-build
# Tests dependencies # Tests dependencies
- genisoimage - genisoimage
env: env:
@ -411,6 +420,7 @@ jobs:
- libusb-1.0-0-dev - libusb-1.0-0-dev
- libvdeplug-dev - libvdeplug-dev
- libvte-2.91-dev - libvte-2.91-dev
- ninja-build
# Tests dependencies # Tests dependencies
- genisoimage - genisoimage
env: env:
@ -450,6 +460,7 @@ jobs:
- libzstd-dev - libzstd-dev
- nettle-dev - nettle-dev
- xfslibs-dev - xfslibs-dev
- ninja-build
# Tests dependencies # Tests dependencies
- genisoimage - genisoimage
env: env:
@ -463,6 +474,7 @@ jobs:
apt_packages: apt_packages:
- libgcrypt20-dev - libgcrypt20-dev
- libgnutls28-dev - libgnutls28-dev
- ninja-build
env: env:
- CONFIG="--disable-containers --disable-system" - CONFIG="--disable-containers --disable-system"
@ -493,6 +505,7 @@ jobs:
- libusb-1.0-0-dev - libusb-1.0-0-dev
- libvdeplug-dev - libvdeplug-dev
- libvte-2.91-dev - libvte-2.91-dev
- ninja-build
env: env:
- TEST_CMD="make check-unit" - TEST_CMD="make check-unit"
- CONFIG="--disable-containers --disable-tcg --enable-kvm - CONFIG="--disable-containers --disable-tcg --enable-kvm
@ -517,7 +530,7 @@ jobs:
- ls -l ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2 - ls -l ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2
- tar -xf ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2 && cd qemu-${QEMU_VERSION} - tar -xf ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2 && cd qemu-${QEMU_VERSION}
- mkdir -p release-build && cd release-build - mkdir -p release-build && cd release-build
- ../configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; } - ../configure ${BASE_CONFIG} ${CONFIG} || { cat config.log meson-logs/meson-log.txt && exit 1; }
- make install - make install
allow_failures: allow_failures:
- env: UNRELIABLE=true - env: UNRELIABLE=true

135
Makefile
View File

@ -14,6 +14,8 @@ SRC_PATH=.
# we have explicit rules for everything # we have explicit rules for everything
MAKEFLAGS += -rR MAKEFLAGS += -rR
SHELL = /usr/bin/env bash -o pipefail
# Usage: $(call quiet-command,command and args,"NAME","args to print") # Usage: $(call quiet-command,command and args,"NAME","args to print")
# This will run "command and args", and either: # This will run "command and args", and either:
# if V=1 just print the whole command and args # if V=1 just print the whole command and args
@ -28,13 +30,21 @@ UNCHECKED_GOALS := %clean TAGS cscope ctags dist \
help check-help print-% \ help check-help print-% \
docker docker-% vm-help vm-test vm-build-% docker docker-% vm-help vm-test vm-build-%
all:
.PHONY: all clean distclean recurse-all dist msi FORCE
# Don't try to regenerate Makefile or configure
# We don't generate any of them
Makefile: ;
configure: ;
# All following code might depend on configuration variables # All following code might depend on configuration variables
ifneq ($(wildcard config-host.mak),) ifneq ($(wildcard config-host.mak),)
# Put the all: rule here so that config-host.mak can contain dependencies.
all:
include config-host.mak include config-host.mak
git-submodule-update: git-submodule-update:
.git-submodule-status: git-submodule-update config-host.mak
Makefile: .git-submodule-status
.PHONY: git-submodule-update .PHONY: git-submodule-update
@ -62,28 +72,7 @@ git-submodule-update:
endif endif
endif endif
export NINJA=./ninjatool # 0. ensure the build tree is okay
# Running meson regenerates both build.ninja and ninjatool, and that is
# enough to prime the rest of the build.
ninjatool: build.ninja
Makefile.ninja: build.ninja ninjatool
./ninjatool -t ninja2make --omit clean dist uninstall cscope TAGS ctags < $< > $@
-include Makefile.ninja
${ninja-targets-c_COMPILER} ${ninja-targets-cpp_COMPILER}: .var.command += -MP
# If MESON is empty, the rule will be re-evaluated after Makefiles are
# reread (and MESON won't be empty anymore).
ifneq ($(MESON),)
Makefile.mtest: build.ninja scripts/mtest2make.py
$(MESON) introspect --targets --tests --benchmarks | $(PYTHON) scripts/mtest2make.py > $@
-include Makefile.mtest
endif
Makefile: .git-submodule-status
.git-submodule-status: git-submodule-update config-host.mak
# Check that we're not trying to do an out-of-tree build from # Check that we're not trying to do an out-of-tree build from
# a tree that's been used for an in-tree build. # a tree that's been used for an in-tree build.
@ -95,6 +84,21 @@ seems to have been used for an in-tree build. You can fix this by running \
endif endif
endif endif
# force a rerun of configure if config-host.mak is too old or corrupted
ifeq ($(MESON),)
.PHONY: config-host.mak
x := $(shell rm -rf meson-private meson-info meson-logs)
endif
ifeq ($(NINJA),)
.PHONY: config-host.mak
x := $(shell rm -rf meson-private meson-info meson-logs)
endif
ifeq ($(wildcard build.ninja),)
.PHONY: config-host.mak
x := $(shell rm -rf meson-private meson-info meson-logs)
endif
# 1. ensure config-host.mak is up-to-date
config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-bios $(SRC_PATH)/VERSION config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-bios $(SRC_PATH)/VERSION
@echo $@ is out-of-date, running configure @echo $@ is out-of-date, running configure
@if test -f meson-private/coredata.dat; then \ @if test -f meson-private/coredata.dat; then \
@ -103,6 +107,46 @@ config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-bios $(SRC_PATH)/VERSION
./config.status; \ ./config.status; \
fi fi
# 2. ensure generated build files are up-to-date
ifneq ($(NINJA),)
# A separate rule is needed for Makefile dependencies to avoid -n
export NINJA
Makefile.ninja: build.ninja
$(quiet-@){ echo 'ninja-targets = \'; $(NINJA) -t targets all | sed 's/:.*//; $$!s/$$/ \\/'; } > $@
-include Makefile.ninja
endif
ifneq ($(MESON),)
# The dependency on config-host.mak ensures that meson has run
Makefile.mtest: build.ninja scripts/mtest2make.py config-host.mak
$(MESON) introspect --targets --tests --benchmarks | $(PYTHON) scripts/mtest2make.py > $@
-include Makefile.mtest
endif
# 3. Rules to bridge to other makefiles
ifneq ($(NINJA),)
NINJAFLAGS = $(if $V,-v,) \
$(filter-out -j, $(lastword -j1 $(filter -l% -j%, $(MAKEFLAGS)))) \
$(subst -k, -k0, $(filter -n -k,$(MAKEFLAGS)))
ninja-cmd-goals = $(or $(MAKECMDGOALS), all)
ninja-cmd-goals += $(foreach t, $(.tests), $(.test.deps.$t))
makefile-targets := build.ninja ctags TAGS cscope dist clean uninstall
ninja-targets := $(filter-out $(makefile-targets), $(ninja-targets))
.PHONY: $(ninja-targets) run-ninja
$(ninja-targets): run-ninja
# Use "| cat" to give Ninja a more "make-y" output. Use "+" to bypass the
# --output-sync line.
run-ninja: config-host.mak
ifneq ($(filter $(ninja-targets), $(ninja-cmd-goals)),)
+@$(NINJA) $(NINJAFLAGS) $(sort $(filter $(ninja-targets), $(ninja-cmd-goals))) | cat
endif
endif
# Force configure to re-run if the API symbols are updated # Force configure to re-run if the API symbols are updated
ifeq ($(CONFIG_PLUGIN),y) ifeq ($(CONFIG_PLUGIN),y)
config-host.mak: $(SRC_PATH)/plugins/qemu-plugins.symbols config-host.mak: $(SRC_PATH)/plugins/qemu-plugins.symbols
@ -112,37 +156,21 @@ plugins:
$(call quiet-command,\ $(call quiet-command,\
$(MAKE) $(SUBDIR_MAKEFLAGS) -C contrib/plugins V="$(V)", \ $(MAKE) $(SUBDIR_MAKEFLAGS) -C contrib/plugins V="$(V)", \
"BUILD", "example plugins") "BUILD", "example plugins")
endif endif # $(CONFIG_PLUGIN)
else else # config-host.mak does not exist
config-host.mak: config-host.mak:
ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail)) ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
@echo "Please call configure before running make!" @echo "Please call configure before running make!"
@exit 1 @exit 1
endif endif
endif endif # config-host.mak does not exist
# Only needed in case Makefile.ninja does not exist.
.PHONY: ninja-clean ninja-distclean clean-ctlist
clean-ctlist:
ninja-clean::
ninja-distclean::
build.ninja: config-host.mak
# Don't try to regenerate Makefile or configure
# We don't generate any of them
Makefile: ;
configure: ;
.PHONY: all clean distclean install \
recurse-all dist msi FORCE
SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet) SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet)
include $(SRC_PATH)/tests/Makefile.include include $(SRC_PATH)/tests/Makefile.include
all: recurse-all all: recurse-all
Makefile:
ROM_DIRS = $(addprefix pc-bios/, $(ROMS)) ROM_DIRS = $(addprefix pc-bios/, $(ROMS))
ROM_DIRS_RULES=$(foreach t, all clean, $(addsuffix /$(t), $(ROM_DIRS))) ROM_DIRS_RULES=$(foreach t, all clean, $(addsuffix /$(t), $(ROM_DIRS)))
@ -157,8 +185,9 @@ recurse-clean: $(addsuffix /clean, $(ROM_DIRS))
###################################################################### ######################################################################
clean: recurse-clean ninja-clean clean-ctlist clean: recurse-clean
if test -f ninjatool; then ./ninjatool $(if $(V),-v,) -t clean; fi -@test -f build.ninja && $(quiet-@)$(NINJA) $(NINJAFLAGS) -t clean || :
-@test -f build.ninja && $(NINJA) $(NINJAFLAGS) clean-ctlist || :
# avoid old build problems by removing potentially incorrect old files # avoid old build problems by removing potentially incorrect old files
rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
find . \( -name '*.so' -o -name '*.dll' -o -name '*.[oda]' \) -type f \ find . \( -name '*.so' -o -name '*.dll' -o -name '*.[oda]' \) -type f \
@ -175,8 +204,8 @@ dist: qemu-$(VERSION).tar.bz2
qemu-%.tar.bz2: qemu-%.tar.bz2:
$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)" $(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
distclean: clean ninja-distclean distclean: clean
-test -f ninjatool && ./ninjatool $(if $(V),-v,) -t clean -g -@test -f build.ninja && $(quiet-@)$(NINJA) $(NINJAFLAGS) -t clean -g || :
rm -f config-host.mak config-host.h* rm -f config-host.mak config-host.h*
rm -f tests/tcg/config-*.mak rm -f tests/tcg/config-*.mak
rm -f config-all-disas.mak config.status rm -f config-all-disas.mak config.status
@ -185,7 +214,7 @@ distclean: clean ninja-distclean
rm -f qemu-plugins-ld.symbols qemu-plugins-ld64.symbols rm -f qemu-plugins-ld.symbols qemu-plugins-ld64.symbols
rm -f *-config-target.h *-config-devices.mak *-config-devices.h rm -f *-config-target.h *-config-devices.mak *-config-devices.h
rm -rf meson-private meson-logs meson-info compile_commands.json rm -rf meson-private meson-logs meson-info compile_commands.json
rm -f Makefile.ninja ninjatool ninjatool.stamp Makefile.mtest rm -f Makefile.ninja Makefile.mtest
rm -f config.log rm -f config.log
rm -f linux-headers/asm rm -f linux-headers/asm
rm -Rf .sdk rm -Rf .sdk
@ -194,19 +223,19 @@ find-src-path = find "$(SRC_PATH)/" -path "$(SRC_PATH)/meson" -prune -o -name "*
.PHONY: ctags .PHONY: ctags
ctags: ctags:
rm -f tags rm -f "$(SRC_PATH)/"tags
$(find-src-path) -exec ctags --append {} + $(find-src-path) -exec ctags -f "$(SRC_PATH)/"tags --append {} +
.PHONY: TAGS .PHONY: TAGS
TAGS: TAGS:
rm -f TAGS rm -f "$(SRC_PATH)/"TAGS
$(find-src-path) -exec etags --append {} + $(find-src-path) -exec etags -f "$(SRC_PATH)/"TAGS --append {} +
.PHONY: cscope .PHONY: cscope
cscope: cscope:
rm -f "$(SRC_PATH)"/cscope.* rm -f "$(SRC_PATH)"/cscope.*
$(find-src-path) -print | sed -e 's,^\./,,' > "$(SRC_PATH)/cscope.files" $(find-src-path) -print | sed -e 's,^\./,,' > "$(SRC_PATH)/cscope.files"
cscope -b -i"$(SRC_PATH)/cscope.files" cscope -b -i"$(SRC_PATH)/cscope.files" -f"$(SRC_PATH)"/cscope.out
# Needed by "meson install" # Needed by "meson install"
export DESTDIR export DESTDIR

101
configure vendored
View File

@ -297,12 +297,13 @@ brlapi=""
curl="" curl=""
iconv="auto" iconv="auto"
curses="auto" curses="auto"
docs="" docs="auto"
fdt="auto" fdt="auto"
netmap="no" netmap="no"
sdl="auto" sdl="auto"
sdl_image="auto" sdl_image="auto"
virtfs="" virtfs=""
libudev="auto"
mpath="auto" mpath="auto"
vnc="enabled" vnc="enabled"
sparse="auto" sparse="auto"
@ -537,8 +538,6 @@ QEMU_CFLAGS="-fno-strict-aliasing -fno-common -fwrapv $QEMU_CFLAGS"
QEMU_CFLAGS="-Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" QEMU_CFLAGS="-Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
QEMU_INCLUDES="-iquote . -iquote ${source_path} -iquote ${source_path}/accel/tcg -iquote ${source_path}/include"
QEMU_INCLUDES="$QEMU_INCLUDES -iquote ${source_path}/disas/libvixl"
# Flags that are needed during configure but later taken care of by Meson # Flags that are needed during configure but later taken care of by Meson
CONFIGURE_CFLAGS="-std=gnu99 -Wall" CONFIGURE_CFLAGS="-std=gnu99 -Wall"
@ -796,7 +795,6 @@ Linux)
audio_possible_drivers="oss alsa sdl pa" audio_possible_drivers="oss alsa sdl pa"
linux="yes" linux="yes"
linux_user="yes" linux_user="yes"
QEMU_INCLUDES="-isystem ${source_path}/linux-headers -Ilinux-headers $QEMU_INCLUDES"
;; ;;
esac esac
@ -822,15 +820,6 @@ do
fi fi
done done
sphinx_build=
for binary in sphinx-build-3 sphinx-build
do
if has "$binary"
then
sphinx_build=$(command -v "$binary")
break
fi
done
# Check for ancillary tools used in testing # Check for ancillary tools used in testing
genisoimage= genisoimage=
@ -971,7 +960,7 @@ for opt do
;; ;;
--with-suffix=*) qemu_suffix="$optarg" --with-suffix=*) qemu_suffix="$optarg"
;; ;;
--docdir=*) qemu_docdir="$optarg" --docdir=*) docdir="$optarg"
;; ;;
--sysconfdir=*) sysconfdir="$optarg" --sysconfdir=*) sysconfdir="$optarg"
;; ;;
@ -1005,6 +994,10 @@ for opt do
;; ;;
--enable-virtfs) virtfs="yes" --enable-virtfs) virtfs="yes"
;; ;;
--disable-libudev) libudev="disabled"
;;
--enable-libudev) libudev="enabled"
;;
--disable-mpath) mpath="disabled" --disable-mpath) mpath="disabled"
;; ;;
--enable-mpath) mpath="enabled" --enable-mpath) mpath="enabled"
@ -1226,9 +1219,9 @@ for opt do
;; ;;
--disable-crypto-afalg) crypto_afalg="no" --disable-crypto-afalg) crypto_afalg="no"
;; ;;
--disable-docs) docs="no" --disable-docs) docs="disabled"
;; ;;
--enable-docs) docs="yes" --enable-docs) docs="enabled"
;; ;;
--disable-vhost-net) vhost_net="no" --disable-vhost-net) vhost_net="no"
;; ;;
@ -1762,6 +1755,7 @@ disabled with --disable-FEATURE, default is enabled if available:
vnc-png PNG compression for VNC server vnc-png PNG compression for VNC server
cocoa Cocoa UI (Mac OS X only) cocoa Cocoa UI (Mac OS X only)
virtfs VirtFS virtfs VirtFS
libudev Use libudev to enumerate host devices
mpath Multipath persistent reservation passthrough mpath Multipath persistent reservation passthrough
xen xen backend driver support xen xen backend driver support
xen-pci-passthrough PCI passthrough support for Xen xen-pci-passthrough PCI passthrough support for Xen
@ -1866,7 +1860,7 @@ python_version=$($python -c 'import sys; print("%d.%d.%d" % (sys.version_info[0]
python="$python -B" python="$python -B"
if test -z "$meson"; then if test -z "$meson"; then
if test "$explicit_python" = no && has meson && version_ge "$(meson --version)" 0.55.1; then if test "$explicit_python" = no && has meson && version_ge "$(meson --version)" 0.55.3; then
meson=meson meson=meson
elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then
meson=git meson=git
@ -1908,7 +1902,7 @@ case "$meson" in
*) meson=$(command -v "$meson") ;; *) meson=$(command -v "$meson") ;;
esac esac
# Probe for ninja (used for compdb) # Probe for ninja
if test -z "$ninja"; then if test -z "$ninja"; then
for c in ninja ninja-build samu; do for c in ninja ninja-build samu; do
@ -1917,6 +1911,9 @@ if test -z "$ninja"; then
break break
fi fi
done done
if test -z "$ninja"; then
error_exit "Cannot find Ninja"
fi
fi fi
# Check that the C compiler works. Doing this here before testing # Check that the C compiler works. Doing this here before testing
@ -4413,45 +4410,6 @@ if check_include linux/btrfs.h ; then
btrfs=yes btrfs=yes
fi fi
# If we're making warnings fatal, apply this to Sphinx runs as well
sphinx_werror=""
if test "$werror" = "yes"; then
sphinx_werror="-W"
fi
# Check we have a new enough version of sphinx-build
has_sphinx_build() {
# This is a bit awkward but works: create a trivial document and
# try to run it with our configuration file (which enforces a
# version requirement). This will fail if either
# sphinx-build doesn't exist at all or if it is too old.
mkdir -p "$TMPDIR1/sphinx"
touch "$TMPDIR1/sphinx/index.rst"
"$sphinx_build" $sphinx_werror -c "$source_path/docs" \
-b html "$TMPDIR1/sphinx" \
"$TMPDIR1/sphinx/out" >> config.log 2>&1
}
# Check if tools are available to build documentation.
if test "$docs" != "no" ; then
if has_sphinx_build; then
sphinx_ok=yes
else
sphinx_ok=no
fi
if test "$sphinx_ok" = "yes"; then
docs=yes
else
if test "$docs" = "yes" ; then
if has $sphinx_build && test "$sphinx_ok" != "yes"; then
echo "Warning: $sphinx_build exists but it is either too old or uses too old a Python version" >&2
fi
feature_not_found "docs" "Install a Python 3 version of python-sphinx"
fi
docs=no
fi
fi
# Search for bswap_32 function # Search for bswap_32 function
byteswap_h=no byteswap_h=no
cat > $TMPC << EOF cat > $TMPC << EOF
@ -5770,7 +5728,6 @@ fi
qemu_confdir="$sysconfdir/$qemu_suffix" qemu_confdir="$sysconfdir/$qemu_suffix"
qemu_moddir="$libdir/$qemu_suffix" qemu_moddir="$libdir/$qemu_suffix"
qemu_datadir="$datadir/$qemu_suffix" qemu_datadir="$datadir/$qemu_suffix"
qemu_docdir="$docdir/$qemu_suffix"
qemu_localedir="$datadir/locale" qemu_localedir="$datadir/locale"
qemu_icondir="$datadir/icons" qemu_icondir="$datadir/icons"
qemu_desktopdir="$datadir/applications" qemu_desktopdir="$datadir/applications"
@ -6088,9 +6045,6 @@ qemu_version=$(head $source_path/VERSION)
echo "PKGVERSION=$pkgversion" >>$config_host_mak echo "PKGVERSION=$pkgversion" >>$config_host_mak
echo "SRC_PATH=$source_path" >> $config_host_mak echo "SRC_PATH=$source_path" >> $config_host_mak
echo "TARGET_DIRS=$target_list" >> $config_host_mak echo "TARGET_DIRS=$target_list" >> $config_host_mak
if [ "$docs" = "yes" ] ; then
echo "BUILD_DOCS=yes" >> $config_host_mak
fi
if test "$modules" = "yes"; then if test "$modules" = "yes"; then
# $shacmd can generate a hash started with digit, which the compiler doesn't # $shacmd can generate a hash started with digit, which the compiler doesn't
# like as an symbol. So prefix it with an underscore # like as an symbol. So prefix it with an underscore
@ -6777,28 +6731,12 @@ if test "$secret_keyring" = "yes" ; then
echo "CONFIG_SECRET_KEYRING=y" >> $config_host_mak echo "CONFIG_SECRET_KEYRING=y" >> $config_host_mak
fi fi
if test "$tcg_interpreter" = "yes"; then
QEMU_INCLUDES="-iquote ${source_path}/tcg/tci $QEMU_INCLUDES"
elif test "$ARCH" = "sparc64" ; then
QEMU_INCLUDES="-iquote ${source_path}/tcg/sparc $QEMU_INCLUDES"
elif test "$ARCH" = "s390x" ; then
QEMU_INCLUDES="-iquote ${source_path}/tcg/s390 $QEMU_INCLUDES"
elif test "$ARCH" = "x86_64" || test "$ARCH" = "x32" ; then
QEMU_INCLUDES="-iquote ${source_path}/tcg/i386 $QEMU_INCLUDES"
elif test "$ARCH" = "ppc64" ; then
QEMU_INCLUDES="-iquote ${source_path}/tcg/ppc $QEMU_INCLUDES"
elif test "$ARCH" = "riscv32" || test "$ARCH" = "riscv64" ; then
QEMU_INCLUDES="-I${source_path}/tcg/riscv $QEMU_INCLUDES"
else
QEMU_INCLUDES="-iquote ${source_path}/tcg/${ARCH} $QEMU_INCLUDES"
fi
echo "ROMS=$roms" >> $config_host_mak echo "ROMS=$roms" >> $config_host_mak
echo "MAKE=$make" >> $config_host_mak echo "MAKE=$make" >> $config_host_mak
echo "PYTHON=$python" >> $config_host_mak echo "PYTHON=$python" >> $config_host_mak
echo "SPHINX_BUILD=$sphinx_build" >> $config_host_mak
echo "GENISOIMAGE=$genisoimage" >> $config_host_mak echo "GENISOIMAGE=$genisoimage" >> $config_host_mak
echo "MESON=$meson" >> $config_host_mak echo "MESON=$meson" >> $config_host_mak
echo "NINJA=$ninja" >> $config_host_mak
echo "CC=$cc" >> $config_host_mak echo "CC=$cc" >> $config_host_mak
if $iasl -h > /dev/null 2>&1; then if $iasl -h > /dev/null 2>&1; then
echo "CONFIG_IASL=$iasl" >> $config_host_mak echo "CONFIG_IASL=$iasl" >> $config_host_mak
@ -6819,7 +6757,6 @@ echo "WINDRES=$windres" >> $config_host_mak
echo "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak echo "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak
echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak
echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
echo "GLIB_LIBS=$glib_libs" >> $config_host_mak echo "GLIB_LIBS=$glib_libs" >> $config_host_mak
echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak
@ -7051,7 +6988,7 @@ fi
mv $cross config-meson.cross mv $cross config-meson.cross
rm -rf meson-private meson-info meson-logs rm -rf meson-private meson-info meson-logs
NINJA=${ninja:-$PWD/ninjatool} $meson setup \ NINJA=$ninja $meson setup \
--prefix "$prefix" \ --prefix "$prefix" \
--libdir "$libdir" \ --libdir "$libdir" \
--libexecdir "$libexecdir" \ --libexecdir "$libexecdir" \
@ -7077,14 +7014,14 @@ NINJA=${ninja:-$PWD/ninjatool} $meson setup \
-Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \ -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \
-Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f \ -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f \
-Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt \ -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt \
-Diconv=$iconv -Dcurses=$curses \ -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\
-Ddocs=$docs -Dsphinx_build=$sphinx_build \
$cross_arg \ $cross_arg \
"$PWD" "$source_path" "$PWD" "$source_path"
if test "$?" -ne 0 ; then if test "$?" -ne 0 ; then
error_exit "meson setup failed" error_exit "meson setup failed"
fi fi
touch ninjatool.stamp
fi fi
if test -n "${deprecated_features}"; then if test -n "${deprecated_features}"; then

View File

@ -241,7 +241,7 @@ texinfo_documents = [
# We use paths starting from qemu_docdir here so that you can run # We use paths starting from qemu_docdir here so that you can run
# sphinx-build from anywhere and the kerneldoc extension can still # sphinx-build from anywhere and the kerneldoc extension can still
# find everything. # find everything.
kerneldoc_bin = os.path.join(qemu_docdir, '../scripts/kernel-doc') kerneldoc_bin = ['perl', os.path.join(qemu_docdir, '../scripts/kernel-doc')]
kerneldoc_srctree = os.path.join(qemu_docdir, '..') kerneldoc_srctree = os.path.join(qemu_docdir, '..')
hxtool_srctree = os.path.join(qemu_docdir, '..') hxtool_srctree = os.path.join(qemu_docdir, '..')
qapidoc_srctree = os.path.join(qemu_docdir, '..') qapidoc_srctree = os.path.join(qemu_docdir, '..')

View File

@ -404,10 +404,8 @@ Built by Meson:
Built by Makefile: Built by Makefile:
`Makefile.ninja` `Makefile.ninja`
A Makefile conversion of the build rules in build.ninja. The conversion A Makefile include that bridges to ninja for the actual build. The
is straightforward and, were it necessary to debug the rules produced Makefile is mostly a list of targets that Meson included in build.ninja.
by Meson, it should be enough to look at build.ninja. The conversion
is performed by scripts/ninjatool.py.
`Makefile.mtest` `Makefile.mtest`
The Makefile definitions that let "make check" run tests defined in The Makefile definitions that let "make check" run tests defined in

View File

@ -1,4 +1,50 @@
if get_option('sphinx_build') == ''
sphinx_build = find_program(['sphinx-build-3', 'sphinx-build'],
required: get_option('docs'))
else
sphinx_build = find_program(get_option('sphinx_build'),
required: get_option('docs'))
endif
# Check if tools are available to build documentation.
build_docs = false
if sphinx_build.found()
SPHINX_ARGS = [sphinx_build]
# If we're making warnings fatal, apply this to Sphinx runs as well
if get_option('werror')
SPHINX_ARGS += [ '-W' ]
endif
# This is a bit awkward but works: create a trivial document and
# try to run it with our configuration file (which enforces a
# version requirement). This will fail if sphinx-build is too old.
run_command('mkdir', ['-p', tmpdir / 'sphinx'])
run_command('touch', [tmpdir / 'sphinx/index.rst'])
sphinx_build_test_out = run_command(SPHINX_ARGS + [
'-c', meson.current_source_dir(),
'-b', 'html', tmpdir / 'sphinx',
tmpdir / 'sphinx/out'])
build_docs = (sphinx_build_test_out.returncode() == 0)
if not build_docs
warning('@0@ exists but it is either too old or uses too old a Python version'.format(get_option('sphinx_build')))
if get_option('docs').enabled()
error('Install a Python 3 version of python-sphinx')
endif
endif
endif
if build_docs 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',
qapi_gen_depends ]
configure_file(output: 'index.html', configure_file(output: 'index.html',
input: files('index.html.in'), input: files('index.html.in'),
configuration: {'VERSION': meson.project_version()}, configuration: {'VERSION': meson.project_version()},

View File

@ -67,7 +67,7 @@ class KernelDocDirective(Directive):
def run(self): def run(self):
env = self.state.document.settings.env env = self.state.document.settings.env
cmd = [env.config.kerneldoc_bin, '-rst', '-enable-lineno'] cmd = env.config.kerneldoc_bin + ['-rst', '-enable-lineno']
filename = env.config.kerneldoc_srctree + '/' + self.arguments[0] filename = env.config.kerneldoc_srctree + '/' + self.arguments[0]
export_file_patterns = [] export_file_patterns = []

2
meson

@ -1 +1 @@
Subproject commit 68ed748f84f14c2d4e62dcbd123816e5898eb04c Subproject commit 776acd2a805c9b42b4f0375150977df42130317f

View File

@ -17,7 +17,13 @@ cc = meson.get_compiler('c')
config_host = keyval.load(meson.current_build_dir() / 'config-host.mak') config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')
enable_modules = 'CONFIG_MODULES' in config_host enable_modules = 'CONFIG_MODULES' in config_host
enable_static = 'CONFIG_STATIC' in config_host enable_static = 'CONFIG_STATIC' in config_host
build_docs = 'BUILD_DOCS' in config_host
# Temporary directory used for files created while
# configure runs. Since it is in the build directory
# we can safely blow away any previous version of it
# (and we need not jump through hoops to try to delete
# it when configure exits.)
tmpdir = meson.current_build_dir() / 'meson-private/temp'
if get_option('qemu_suffix').startswith('/') if get_option('qemu_suffix').startswith('/')
error('qemu_suffix cannot start with a /') error('qemu_suffix cannot start with a /')
@ -47,10 +53,6 @@ supported_cpus = ['ppc', 'ppc64', 's390x', 'riscv32', 'riscv64', 'x86', 'x86_64'
cpu = host_machine.cpu_family() cpu = host_machine.cpu_family()
targetos = host_machine.system() targetos = host_machine.system()
configure_file(input: files('scripts/ninjatool.py'),
output: 'ninjatool',
configuration: config_host)
if cpu in ['x86', 'x86_64'] if cpu in ['x86', 'x86_64']
kvm_targets = ['i386-softmmu', 'x86_64-softmmu'] kvm_targets = ['i386-softmmu', 'x86_64-softmmu']
elif cpu == 'aarch64' elif cpu == 'aarch64'
@ -93,9 +95,35 @@ add_project_arguments(config_host['QEMU_CXXFLAGS'].split(),
native: false, language: 'cpp') native: false, language: 'cpp')
add_project_link_arguments(config_host['QEMU_LDFLAGS'].split(), add_project_link_arguments(config_host['QEMU_LDFLAGS'].split(),
native: false, language: ['c', 'cpp', 'objc']) native: false, language: ['c', 'cpp', 'objc'])
add_project_arguments(config_host['QEMU_INCLUDES'].split(),
language: ['c', 'cpp', 'objc'])
if targetos == 'linux'
add_project_arguments('-isystem', meson.current_source_dir() / 'linux-headers',
'-isystem', 'linux-headers',
language: ['c', 'cpp'])
endif
if 'CONFIG_TCG_INTERPRETER' in config_host
tcg_arch = 'tci'
elif config_host['ARCH'] == 'sparc64'
tcg_arch = 'sparc'
elif config_host['ARCH'] == 's390x'
tcg_arch = 's390'
elif config_host['ARCH'] in ['x86_64', 'x32']
tcg_arch = 'i386'
elif config_host['ARCH'] == 'ppc64'
tcg_arch = 'ppc'
elif config_host['ARCH'] in ['riscv32', 'riscv64']
tcg_arch = 'riscv'
else
tcg_arch = config_host['ARCH']
endif
add_project_arguments('-iquote', meson.current_source_dir() / 'tcg' / tcg_arch,
'-iquote', '.',
'-iquote', meson.current_source_dir(),
'-iquote', meson.current_source_dir() / 'accel/tcg',
'-iquote', meson.current_source_dir() / 'include',
'-iquote', meson.current_source_dir() / 'disas/libvixl',
language: ['c', 'cpp', 'objc'])
link_language = meson.get_external_property('link_language', 'cpp') link_language = meson.get_external_property('link_language', 'cpp')
if link_language == 'cpp' if link_language == 'cpp'
@ -360,10 +388,11 @@ endif
libudev = not_found libudev = not_found
if targetos == 'linux' and (have_system or have_tools) if targetos == 'linux' and (have_system or have_tools)
libudev = dependency('libudev', libudev = dependency('libudev',
required: get_option('mpath').enabled(), required: get_option('libudev'),
static: enable_static) static: enable_static)
endif endif
mpathlibs = [libudev]
mpathpersist = not_found mpathpersist = not_found
mpathpersist_new_api = false mpathpersist_new_api = false
if targetos == 'linux' and have_tools and not get_option('mpath').disabled() if targetos == 'linux' and have_tools and not get_option('mpath').disabled()
@ -394,46 +423,52 @@ if targetos == 'linux' and have_tools and not get_option('mpath').disabled()
mpath_lib_init(udev); mpath_lib_init(udev);
return 0; return 0;
}''' }'''
mpathlibs = [libudev] libmpathpersist = cc.find_library('mpathpersist',
if enable_static required: get_option('mpath'),
mpathlibs += cc.find_library('devmapper', static: enable_static)
required: get_option('mpath'), if libmpathpersist.found()
static: enable_static) mpathlibs += libmpathpersist
endif if enable_static
mpathlibs += cc.find_library('multipath', mpathlibs += cc.find_library('devmapper',
required: get_option('mpath'), required: get_option('mpath'),
static: enable_static) static: enable_static)
mpathlibs += cc.find_library('mpathpersist',
required: get_option('mpath'),
static: enable_static)
foreach lib: mpathlibs
if not lib.found()
mpathlibs = []
break
endif endif
endforeach mpathlibs += cc.find_library('multipath',
if mpathlibs.length() > 0 required: get_option('mpath'),
if cc.links(mpath_test_source_new, dependencies: mpathlibs) static: enable_static)
foreach lib: mpathlibs
if not lib.found()
mpathlibs = []
break
endif
endforeach
if mpathlibs.length() == 0
msg = 'Dependencies missing for libmpathpersist'
elif cc.links(mpath_test_source_new, dependencies: mpathlibs)
mpathpersist = declare_dependency(dependencies: mpathlibs) mpathpersist = declare_dependency(dependencies: mpathlibs)
mpathpersist_new_api = true mpathpersist_new_api = true
elif cc.links(mpath_test_source_old, dependencies: mpathlibs) elif cc.links(mpath_test_source_old, dependencies: mpathlibs)
mpathpersist = declare_dependency(dependencies: mpathlibs) mpathpersist = declare_dependency(dependencies: mpathlibs)
else else
msg = 'Cannot detect libmpathpersist API'
endif
if not mpathpersist.found()
if get_option('mpath').enabled() if get_option('mpath').enabled()
error('Cannot detect libmpathpersist API') error(msg)
else else
warning('Cannot detect libmpathpersist API, disabling') warning(msg + ', disabling')
endif endif
endif endif
endif endif
endif endif
iconv = not_found iconv = not_found
if not get_option('iconv').disabled() curses = not_found
libiconv = cc.find_library('iconv', if have_system and not get_option('curses').disabled()
required: false, if not get_option('iconv').disabled()
static: enable_static) libiconv = cc.find_library('iconv',
if libiconv.found() required: false,
static: enable_static)
if cc.links(''' if cc.links('''
#include <iconv.h> #include <iconv.h>
int main(void) { int main(void) {
@ -443,28 +478,25 @@ if not get_option('iconv').disabled()
iconv = declare_dependency(dependencies: [libiconv]) iconv = declare_dependency(dependencies: [libiconv])
endif endif
endif endif
endif if get_option('iconv').enabled() and not iconv.found()
if get_option('iconv').enabled() and not iconv.found() error('Cannot detect iconv API')
error('Cannot detect iconv API') endif
endif if iconv.found()
curses_libname_list = ['ncursesw', 'ncurses', 'cursesw', 'pdcurses']
curses = not_found curses_test = '''
if iconv.found() and not get_option('curses').disabled() #include <locale.h>
curses_libname_list = ['ncursesw', 'ncurses', 'cursesw', 'pdcurses'] #include <curses.h>
curses_test = ''' #include <wchar.h>
#include <locale.h> int main(void) {
#include <curses.h> wchar_t wch = L'w';
#include <wchar.h> setlocale(LC_ALL, "");
int main(void) { resize_term(0, 0);
wchar_t wch = L'w'; addwstr(L"wide chars\n");
setlocale(LC_ALL, ""); addnwstr(&wch, 1);
resize_term(0, 0); add_wch(WACS_DEGREE);
addwstr(L"wide chars\n"); return 0;
addnwstr(&wch, 1); }'''
add_wch(WACS_DEGREE); foreach curses_libname : curses_libname_list
return 0;
}'''
foreach curses_libname : curses_libname_list
libcurses = dependency(curses_libname, libcurses = dependency(curses_libname,
required: false, required: false,
method: 'pkg-config', method: 'pkg-config',
@ -486,13 +518,18 @@ if iconv.found() and not get_option('curses').disabled()
break break
endif endif
endif endif
endforeach endforeach
endif endif
if get_option('curses').enabled() and not curses.found() if not curses.found()
if not iconv.found() if iconv.found()
error('Cannot detect iconv API') if get_option('curses').enabled()
else error('Cannot find curses')
error('Cannot detect curses API') endif
elif get_option('curses').enabled()
error('iconv required for curses UI but not available')
else
warning('iconv required for curses UI but not available, disabling')
endif
endif endif
endif endif
@ -1237,22 +1274,6 @@ foreach d : hx_headers
endforeach endforeach
genh += hxdep genh += hxdep
SPHINX_ARGS = [config_host['SPHINX_BUILD'],
'-Dversion=' + meson.project_version(),
'-Drelease=' + config_host['PKGVERSION']]
if get_option('werror')
SPHINX_ARGS += [ '-W' ]
endif
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',
qapi_gen_depends ]
################### ###################
# Collect sources # # Collect sources #
################### ###################
@ -1837,8 +1858,8 @@ endif
subdir('scripts') subdir('scripts')
subdir('tools') subdir('tools')
subdir('pc-bios') subdir('pc-bios')
subdir('tests')
subdir('docs') subdir('docs')
subdir('tests')
if 'CONFIG_GTK' in config_host if 'CONFIG_GTK' in config_host
subdir('po') subdir('po')
endif endif
@ -1920,7 +1941,7 @@ summary_info += {'QEMU_CFLAGS': config_host['QEMU_CFLAGS']}
summary_info += {'QEMU_LDFLAGS': config_host['QEMU_LDFLAGS']} summary_info += {'QEMU_LDFLAGS': config_host['QEMU_LDFLAGS']}
summary_info += {'make': config_host['MAKE']} summary_info += {'make': config_host['MAKE']}
summary_info += {'python': '@0@ (version: @1@)'.format(python.full_path(), python.language_version())} summary_info += {'python': '@0@ (version: @1@)'.format(python.full_path(), python.language_version())}
summary_info += {'sphinx-build': config_host['SPHINX_BUILD']} summary_info += {'sphinx-build': sphinx_build.found()}
summary_info += {'genisoimage': config_host['GENISOIMAGE']} summary_info += {'genisoimage': config_host['GENISOIMAGE']}
# TODO: add back version # TODO: add back version
summary_info += {'slirp support': slirp_opt == 'disabled' ? false : slirp_opt} summary_info += {'slirp support': slirp_opt == 'disabled' ? false : slirp_opt}
@ -1988,7 +2009,7 @@ if config_host.has_key('CONFIG_XEN_BACKEND')
summary_info += {'xen ctrl version': config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']} summary_info += {'xen ctrl version': config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']}
endif endif
summary_info += {'brlapi support': config_host.has_key('CONFIG_BRLAPI')} summary_info += {'brlapi support': config_host.has_key('CONFIG_BRLAPI')}
summary_info += {'Documentation': config_host.has_key('BUILD_DOCS')} summary_info += {'Documentation': build_docs}
summary_info += {'PIE': get_option('b_pie')} summary_info += {'PIE': get_option('b_pie')}
summary_info += {'vde support': config_host.has_key('CONFIG_VDE')} summary_info += {'vde support': config_host.has_key('CONFIG_VDE')}
summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')} summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')}

View File

@ -2,7 +2,11 @@ option('qemu_suffix', type : 'string', value: 'qemu',
description: 'Suffix for QEMU data/modules/config directories (can be empty)') description: 'Suffix for QEMU data/modules/config directories (can be empty)')
option('docdir', type : 'string', value : 'doc', option('docdir', type : 'string', value : 'doc',
description: 'Base directory for documentation installation (can be empty)') description: 'Base directory for documentation installation (can be empty)')
option('sphinx_build', type : 'string', value : '',
description: 'Use specified sphinx-build [$sphinx_build] for building document (default to be empty)')
option('docs', type : 'feature', value : 'auto',
description: 'Documentations build support')
option('gettext', type : 'boolean', value : true, option('gettext', type : 'boolean', value : true,
description: 'Localization of the GTK+ user interface') description: 'Localization of the GTK+ user interface')
option('sparse', type : 'feature', value : 'auto', option('sparse', type : 'feature', value : 'auto',
@ -36,6 +40,8 @@ option('iconv', type : 'feature', value : 'auto',
description: 'Font glyph conversion support') description: 'Font glyph conversion support')
option('curses', type : 'feature', value : 'auto', option('curses', type : 'feature', value : 'auto',
description: 'curses UI') description: 'curses UI')
option('libudev', type : 'feature', value : 'auto',
description: 'Use libudev to enumerate host devices')
option('sdl', type : 'feature', value : 'auto', option('sdl', type : 'feature', value : 'auto',
description: 'SDL user interface') description: 'SDL user interface')
option('sdl_image', type : 'feature', value : 'auto', option('sdl_image', type : 'feature', value : 'auto',

View File

@ -70,8 +70,9 @@ def process_tests(test, targets, suites):
print('.test.driver.%d := %s' % (i, driver)) print('.test.driver.%d := %s' % (i, driver))
print('.test.env.%d := $(.test.env) %s' % (i, env)) print('.test.env.%d := $(.test.env) %s' % (i, env))
print('.test.cmd.%d := %s' % (i, cmd)) print('.test.cmd.%d := %s' % (i, cmd))
print('.test.deps.%d := %s' % (i, ' '.join(deps)))
print('.PHONY: run-test-%d' % (i,)) print('.PHONY: run-test-%d' % (i,))
print('run-test-%d: %s' % (i, ' '.join(deps))) print('run-test-%d: $(.test.deps.%d)' % (i,i))
print('\t@$(call .test.run,%d,$(.test.output-format))' % (i,)) print('\t@$(call .test.run,%d,$(.test.output-format))' % (i,))
test_suites = test['suite'] or ['default'] test_suites = test['suite'] or ['default']

File diff suppressed because it is too large Load Diff

View File

@ -38,6 +38,7 @@ static void *hax_cpu_thread_fn(void *arg)
qemu_thread_get_self(cpu->thread); qemu_thread_get_self(cpu->thread);
cpu->thread_id = qemu_get_thread_id(); cpu->thread_id = qemu_get_thread_id();
current_cpu = cpu;
hax_init_vcpu(cpu); hax_init_vcpu(cpu);
cpu_thread_signal_created(cpu); cpu_thread_signal_created(cpu);
qemu_guest_random_seed_thread_part2(cpu->random_seed); qemu_guest_random_seed_thread_part2(cpu->random_seed);

View File

@ -140,7 +140,7 @@ QEMU_IOTESTS_HELPERS-$(CONFIG_LINUX) = tests/qemu-iotests/socket_scm_helper$(EXE
check: check-block check: check-block
check-block: $(SRC_PATH)/tests/check-block.sh qemu-img$(EXESUF) \ check-block: $(SRC_PATH)/tests/check-block.sh qemu-img$(EXESUF) \
qemu-io$(EXESUF) qemu-nbd$(EXESUF) $(QEMU_IOTESTS_HELPERS-y) \ qemu-io$(EXESUF) qemu-nbd$(EXESUF) $(QEMU_IOTESTS_HELPERS-y) \
$(patsubst %-softmmu,qemu-system-%,$(filter %-softmmu,$(TARGET_DIRS))) $(filter qemu-system-%, $(ninja-targets))
@$< @$<
endif endif

View File

@ -27,6 +27,7 @@ ENV PACKAGES \
mesa-libEGL-devel \ mesa-libEGL-devel \
mesa-libgbm-devel \ mesa-libgbm-devel \
nettle-devel \ nettle-devel \
ninja-build \
perl-Test-Harness \ perl-Test-Harness \
pixman-devel \ pixman-devel \
python3 \ python3 \

View File

@ -19,6 +19,7 @@ ENV PACKAGES \
make \ make \
mesa-libEGL-devel \ mesa-libEGL-devel \
nettle-devel \ nettle-devel \
ninja-build \
perl-Test-Harness \ perl-Test-Harness \
pixman-devel \ pixman-devel \
python36 \ python36 \
@ -28,5 +29,7 @@ ENV PACKAGES \
tar \ tar \
zlib-devel zlib-devel
RUN dnf install -y $PACKAGES RUN dnf install -y dnf-plugins-core && \
dnf config-manager --set-enabled PowerTools && \
dnf install -y $PACKAGES
RUN rpm -q $PACKAGES | sort > /packages.txt RUN rpm -q $PACKAGES | sort > /packages.txt

View File

@ -26,6 +26,7 @@ RUN apt update && \
gettext \ gettext \
git \ git \
libncurses5-dev \ libncurses5-dev \
ninja-build \
pkg-config \ pkg-config \
psmisc \ psmisc \
python3 \ python3 \

View File

@ -75,6 +75,7 @@ ENV PACKAGES \
mingw64-SDL2 \ mingw64-SDL2 \
ncurses-devel \ ncurses-devel \
nettle-devel \ nettle-devel \
ninja-build \
nss-devel \ nss-devel \
numactl-devel \ numactl-devel \
perl \ perl \

View File

@ -9,7 +9,7 @@ ENV LC_ALL en_US.UTF-8
RUN sed -i "s/# deb-src/deb-src/" /etc/apt/sources.list RUN sed -i "s/# deb-src/deb-src/" /etc/apt/sources.list
RUN apt-get update RUN apt-get update
RUN apt-get -y build-dep qemu RUN apt-get -y build-dep qemu
RUN apt-get -y install device-tree-compiler python3 python3-yaml dh-autoreconf gdb strace lsof net-tools gcovr RUN apt-get -y install device-tree-compiler python3 python3-yaml dh-autoreconf gdb strace lsof net-tools gcovr ninja-build
# Travis tools require PhantomJS / Neo4j / Maven accessible # Travis tools require PhantomJS / Neo4j / Maven accessible
# in their PATH (QEMU build won't access them). # in their PATH (QEMU build won't access them).
ENV PATH /usr/local/phantomjs/bin:/usr/local/phantomjs:/usr/local/neo4j-3.2.7/bin:/usr/local/maven-3.5.2/bin:/usr/local/cmake-3.9.2/bin:/usr/local/clang-5.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ENV PATH /usr/local/phantomjs/bin:/usr/local/phantomjs:/usr/local/neo4j-3.2.7/bin:/usr/local/maven-3.5.2/bin:/usr/local/cmake-3.9.2/bin:/usr/local/clang-5.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

View File

@ -60,6 +60,7 @@ ENV PACKAGES \
libxen-dev \ libxen-dev \
libzstd-dev \ libzstd-dev \
make \ make \
ninja-build \
python3-yaml \ python3-yaml \
python3-sphinx \ python3-sphinx \
sparse \ sparse \

View File

@ -48,6 +48,7 @@ ENV PACKAGES \
make \ make \
python3-yaml \ python3-yaml \
python3-sphinx \ python3-sphinx \
ninja-build \
sparse \ sparse \
xfslibs-dev xfslibs-dev
RUN apt-get update && \ RUN apt-get update && \

View File

@ -47,6 +47,7 @@ ENV PACKAGES flex bison \
libxen-dev \ libxen-dev \
libzstd-dev \ libzstd-dev \
make \ make \
ninja-build \
python3-numpy \ python3-numpy \
python3-opencv \ python3-opencv \
python3-pil \ python3-pil \

View File

@ -10,7 +10,7 @@ test_qapi_outputs_extra = [
'test-qapi-visit-sub-module.h', 'test-qapi-visit-sub-module.h',
] ]
test_qapi_outputs_extra = custom_target('QAPI test (include)', test_qapi_files_extra = custom_target('QAPI test (include)',
output: test_qapi_outputs_extra, output: test_qapi_outputs_extra,
input: test_qapi_files, input: test_qapi_files,
command: 'true') command: 'true')

View File

@ -56,8 +56,18 @@ test_qapi_files = custom_target('Test QAPI files',
# perhaps change qapi_gen to replace / with _, like Meson itself does? # perhaps change qapi_gen to replace / with _, like Meson itself does?
subdir('include') subdir('include')
libtestqapi = static_library('testqapi', sources: [test_qapi_files, genh, test_qapi_outputs_extra]) test_qapi_sources = []
testqapi = declare_dependency(link_with: libtestqapi) test_qapi_headers = []
i = 0
foreach o: test_qapi_files.to_list() + test_qapi_files_extra.to_list()
if o.full_path().endswith('.h')
test_qapi_headers += o
endif
test_qapi_sources += o
endforeach
libtestqapi = static_library('testqapi', sources: [genh, test_qapi_sources])
testqapi = declare_dependency(link_with: libtestqapi, sources: [genh, test_qapi_headers])
testblock = declare_dependency(dependencies: [block], sources: 'iothread.c') testblock = declare_dependency(dependencies: [block], sources: 'iothread.c')

View File

@ -219,53 +219,53 @@ qapi_doc = custom_target('QAPI doc',
'-p', 'doc-good-', '@INPUT0@' ], '-p', 'doc-good-', '@INPUT0@' ],
depend_files: qapi_gen_depends) depend_files: qapi_gen_depends)
# Test the document-comment document generation code by running a test schema
# file through Sphinx's plain-text builder and comparing the result against
# a golden reference. This is in theory susceptible to failures if Sphinx
# changes its output, but the text output has historically been very stable
# (no changes between Sphinx 1.6 and 3.0), so it is a better bet than
# texinfo or HTML generation, both of which have had changes. We might
# need to add more sophisticated logic here in future for some sort of
# fuzzy comparison if future Sphinx versions produce different text,
# but for now the simple comparison suffices.
qapi_doc_out = custom_target('QAPI rST doc',
output: ['doc-good.txt'],
input: files('doc-good.json', 'doc-good.rst'),
build_by_default: build_docs,
depend_files: sphinx_extn_depends,
# We use -E to suppress Sphinx's caching, because
# we want it to always really run the QAPI doc
# generation code. It also means we don't
# clutter up the build dir with the cache.
command: [SPHINX_ARGS,
'-b', 'text', '-E',
'-c', meson.source_root() / 'docs',
'-D', 'master_doc=doc-good',
meson.current_source_dir(),
meson.current_build_dir()])
# Fix possible inconsistency in line endings in generated output and
# in the golden reference (which could otherwise cause test failures
# on Windows hosts). Unfortunately diff --strip-trailing-cr
# is GNU-diff only. The odd-looking perl is because we must avoid
# using an explicit '\' character in the command arguments to
# a custom_target(), as Meson will unhelpfully replace it with a '/'
# (https://github.com/mesonbuild/meson/issues/1564)
qapi_doc_out_nocr = custom_target('QAPI rST doc newline-sanitized',
output: ['doc-good.txt.nocr'],
input: qapi_doc_out[0],
build_by_default: build_docs,
command: ['perl', '-pe', '$x = chr 13; s/$x$//', '@INPUT@'],
capture: true)
qapi_doc_ref_nocr = custom_target('QAPI rST doc reference newline-sanitized',
output: ['doc-good.ref.nocr'],
input: files('doc-good.txt'),
build_by_default: build_docs,
command: ['perl', '-pe', '$x = chr 13; s/$x$//', '@INPUT@'],
capture: true)
if build_docs if build_docs
# Test the document-comment document generation code by running a test schema
# file through Sphinx's plain-text builder and comparing the result against
# a golden reference. This is in theory susceptible to failures if Sphinx
# changes its output, but the text output has historically been very stable
# (no changes between Sphinx 1.6 and 3.0), so it is a better bet than
# texinfo or HTML generation, both of which have had changes. We might
# need to add more sophisticated logic here in future for some sort of
# fuzzy comparison if future Sphinx versions produce different text,
# but for now the simple comparison suffices.
qapi_doc_out = custom_target('QAPI rST doc',
output: ['doc-good.txt'],
input: files('doc-good.json', 'doc-good.rst'),
build_by_default: true,
depend_files: sphinx_extn_depends,
# We use -E to suppress Sphinx's caching, because
# we want it to always really run the QAPI doc
# generation code. It also means we don't
# clutter up the build dir with the cache.
command: [SPHINX_ARGS,
'-b', 'text', '-E',
'-c', meson.source_root() / 'docs',
'-D', 'master_doc=doc-good',
meson.current_source_dir(),
meson.current_build_dir()])
# Fix possible inconsistency in line endings in generated output and
# in the golden reference (which could otherwise cause test failures
# on Windows hosts). Unfortunately diff --strip-trailing-cr
# is GNU-diff only. The odd-looking perl is because we must avoid
# using an explicit '\' character in the command arguments to
# a custom_target(), as Meson will unhelpfully replace it with a '/'
# (https://github.com/mesonbuild/meson/issues/1564)
qapi_doc_out_nocr = custom_target('QAPI rST doc newline-sanitized',
output: ['doc-good.txt.nocr'],
input: qapi_doc_out[0],
build_by_default: true,
command: ['perl', '-pe', '$x = chr 13; s/$x$//', '@INPUT@'],
capture: true)
qapi_doc_ref_nocr = custom_target('QAPI rST doc reference newline-sanitized',
output: ['doc-good.ref.nocr'],
input: files('doc-good.txt'),
build_by_default: true,
command: ['perl', '-pe', '$x = chr 13; s/$x$//', '@INPUT@'],
capture: true)
# "full_path()" needed here to work around # "full_path()" needed here to work around
# https://github.com/mesonbuild/meson/issues/7585 # https://github.com/mesonbuild/meson/issues/7585
test('QAPI rST doc', diff, args: ['-u', qapi_doc_ref_nocr[0].full_path(), test('QAPI rST doc', diff, args: ['-u', qapi_doc_ref_nocr[0].full_path(),

View File

@ -217,5 +217,13 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char ***envp)
/* re-enable the rcu atfork, which was previously disabled in qemu_init */ /* re-enable the rcu atfork, which was previously disabled in qemu_init */
rcu_enable_atfork(); rcu_enable_atfork();
/*
* Disable QEMU's signal handlers, since we manually control the main_loop,
* and don't check for main_loop_should_exit
*/
signal(SIGINT, SIG_DFL);
signal(SIGHUP, SIG_DFL);
signal(SIGTERM, SIG_DFL);
return 0; return 0;
} }

View File

@ -42,7 +42,7 @@ class CentosVM(basevm.BaseVM):
self.wait_ssh() self.wait_ssh()
self.ssh_root_check("touch /etc/cloud/cloud-init.disabled") self.ssh_root_check("touch /etc/cloud/cloud-init.disabled")
self.ssh_root_check("yum update -y") self.ssh_root_check("yum update -y")
self.ssh_root_check("yum install -y docker make git python3") self.ssh_root_check("yum install -y docker make ninja-build git python3")
self.ssh_root_check("systemctl enable docker") self.ssh_root_check("systemctl enable docker")
self.ssh_root("poweroff") self.ssh_root("poweroff")
self.wait() self.wait()

View File

@ -23,7 +23,7 @@ import aarch64vm
DEFAULT_CONFIG = { DEFAULT_CONFIG = {
'cpu' : "max", 'cpu' : "max",
'machine' : "virt,gic-version=max", 'machine' : "virt,gic-version=max",
'install_cmds' : "yum install -y make git python3 gcc gcc-c++ flex bison, "\ 'install_cmds' : "yum install -y make ninja-build git python3 gcc gcc-c++ flex bison, "\
"yum install -y glib2-devel pixman-devel zlib-devel, "\ "yum install -y glib2-devel pixman-devel zlib-devel, "\
"yum install -y perl-Test-Harness, "\ "yum install -y perl-Test-Harness, "\
"alternatives --set python /usr/bin/python3, "\ "alternatives --set python /usr/bin/python3, "\

View File

@ -32,7 +32,7 @@ class FedoraVM(basevm.BaseVM):
pkgs = [ pkgs = [
# tools # tools
'git-core', 'git-core',
'gcc', 'binutils', 'make', 'gcc', 'binutils', 'make', 'ninja-build',
# perl # perl
'perl-Test-Harness', 'perl-Test-Harness',

View File

@ -34,6 +34,7 @@ class FreeBSDVM(basevm.BaseVM):
"bzip2", "bzip2",
"python37", "python37",
"py37-setuptools", "py37-setuptools",
"ninja",
# gnu tools # gnu tools
"bash", "bash",

View File

@ -32,6 +32,7 @@ class NetBSDVM(basevm.BaseVM):
"xz", "xz",
"python37", "python37",
"py37-setuptools", "py37-setuptools",
"ninja-build",
# gnu tools # gnu tools
"bash", "bash",

View File

@ -31,6 +31,7 @@ class OpenBSDVM(basevm.BaseVM):
"pkgconf", "pkgconf",
"bzip2", "xz", "bzip2", "xz",
"py3-setuptools", "py3-setuptools",
"ninja",
# gnu tools # gnu tools
"bash", "bash",

View File

@ -22,7 +22,7 @@ DEFAULT_CONFIG = {
'machine' : "virt,gic-version=3", 'machine' : "virt,gic-version=3",
'install_cmds' : "apt-get update,"\ 'install_cmds' : "apt-get update,"\
"apt-get build-dep -y --arch-only qemu,"\ "apt-get build-dep -y --arch-only qemu,"\
"apt-get install -y libfdt-dev pkg-config language-pack-en", "apt-get install -y libfdt-dev pkg-config language-pack-en ninja-build",
# We increase beyond the default time since during boot # We increase beyond the default time since during boot
# it can take some time (many seconds) to log into the VM # it can take some time (many seconds) to log into the VM
# especially using softmmu. # especially using softmmu.

View File

@ -18,7 +18,7 @@ import ubuntuvm
DEFAULT_CONFIG = { DEFAULT_CONFIG = {
'install_cmds' : "apt-get update,"\ 'install_cmds' : "apt-get update,"\
"apt-get build-dep -y qemu,"\ "apt-get build-dep -y qemu,"\
"apt-get install -y libfdt-dev language-pack-en", "apt-get install -y libfdt-dev language-pack-en ninja-build",
} }
class UbuntuX86VM(ubuntuvm.UbuntuVM): class UbuntuX86VM(ubuntuvm.UbuntuVM):

View File

@ -113,8 +113,11 @@ if have_system or xkbcommon.found()
endif endif
subdir('shader') subdir('shader')
subdir('icons')
install_data('qemu.desktop', install_dir: config_host['qemu_desktopdir']) if have_system
subdir('icons')
install_data('qemu.desktop', install_dir: config_host['qemu_desktopdir'])
endif
modules += {'ui': ui_modules} modules += {'ui': ui_modules}