Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstrea…
Browse files Browse the repository at this point in the history
…m' into staging

meson fixes:
* bump submodule to 0.55.1
* SDL, pixman and zlib fixes
* firmwarepath fix
* fix firmware builds

meson related:
* move install to Meson
* move NSIS to Meson
* do not make meson use cmake
* add description to options

# gpg: Signature made Tue 01 Sep 2020 17:11:03 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: (26 commits)
  Makefile: Fix in-tree clean/distclean
  Makefile: Add back TAGS/ctags/cscope rules
  meson: add description to options
  build: fix recurse-all target
  meson: use pkg-config method to find dependencies
  configure: do not include ${prefix} in firmwarepath
  meson: add pixman dependency to UI modules
  meson: add pixman dependency to chardev/baum module
  meson: add NSIS building
  meson: use meson mandir instead of qemu_mandir
  meson: pass docdir option
  meson: use meson datadir instead of qemu_datadir
  meson: pass qemu_suffix option
  configure: build docdir like other suffixed directories
  configure: always /-seperate directory from qemu_suffix
  configure: rename confsuffix option
  meson: move zlib detection to meson
  build-sys: remove install target from Makefile
  meson: install $localstatedir/run for qga
  meson: install desktop file
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed Sep 1, 2020
2 parents 8d90bfc + 9f5d959 commit 887adde
Show file tree
Hide file tree
Showing 22 changed files with 303 additions and 234 deletions.
150 changes: 24 additions & 126 deletions Makefile
Expand Up @@ -54,15 +54,8 @@ export NINJA=./ninjatool
# enough to prime the rest of the build.
ninjatool: build.ninja

# 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

Makefile.ninja: build.ninja ninjatool
./ninjatool -t ninja2make --omit clean dist uninstall < $< > $@
./ninjatool -t ninja2make --omit clean dist uninstall cscope TAGS ctags < $< > $@
-include Makefile.ninja

${ninja-targets-c_COMPILER} ${ninja-targets-cpp_COMPILER}: .var.command += -MP
Expand Down Expand Up @@ -115,6 +108,13 @@ ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fa
endif
endif

# 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

include $(SRC_PATH)/rules.mak

# lor is defined in rules.mak
Expand Down Expand Up @@ -186,16 +186,16 @@ ROM_DIRS_RULES=$(foreach t, all clean, $(addsuffix /$(t), $(ROM_DIRS)))
# Only keep -O and -g cflags
.PHONY: $(ROM_DIRS_RULES)
$(ROM_DIRS_RULES):
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" CFLAGS="$(filter -O% -g%,$(CFLAGS))" $(notdir $@),)
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),)

.PHONY: recurse-all recurse-clean
recurse-all: $(ROM_DIRS)
recurse-all: $(addsuffix /all, $(ROM_DIRS))
recurse-clean: $(addsuffix /clean, $(ROM_DIRS))

######################################################################

clean: recurse-clean ninja-clean clean-ctlist
-test -f ninjatool && ./ninjatool $(if $(V),-v,) -t clean
if test -f ninjatool; then ./ninjatool $(if $(V),-v,) -t clean; fi
# 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
find . \( -name '*.so' -o -name '*.dll' -o -name '*.[oda]' \) -type f \
Expand Down Expand Up @@ -229,126 +229,24 @@ distclean: clean ninja-distclean
rm -f linux-headers/asm
rm -Rf .sdk

ifdef INSTALL_BLOBS
BLOBS=bios.bin bios-256k.bin bios-microvm.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin \
vgabios-ramfb.bin vgabios-bochs-display.bin vgabios-ati.bin \
openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \
pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
efi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \
efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \
efi-e1000e.rom efi-vmxnet3.rom \
qemu-nsis.bmp \
bamboo.dtb canyonlands.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin \
s390-ccw.img s390-netboot.img \
slof.bin skiboot.lid \
palcode-clipper \
u-boot.e500 u-boot-sam460-20100605.bin \
qemu_vga.ndrv \
edk2-licenses.txt \
hppa-firmware.img \
opensbi-riscv32-generic-fw_dynamic.bin opensbi-riscv64-generic-fw_dynamic.bin \
opensbi-riscv32-generic-fw_dynamic.elf opensbi-riscv64-generic-fw_dynamic.elf
else
BLOBS=
endif

install-datadir:
$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
.PHONY: ctags
ctags:
rm -f tags
find "$(SRC_PATH)" -name '*.[hc]' -exec ctags --append {} +

install-localstatedir:
ifdef CONFIG_POSIX
ifeq ($(CONFIG_GUEST_AGENT),y)
$(INSTALL_DIR) "$(DESTDIR)$(qemu_localstatedir)"/run
endif
endif
.PHONY: TAGS
TAGS:
rm -f TAGS
find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +

ICON_SIZES=16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512
.PHONY: cscope
cscope:
rm -f "$(SRC_PATH)"/cscope.*
find "$(SRC_PATH)/" -name "*.[chsS]" -print | sed -e 's,^\./,,' > "$(SRC_PATH)/cscope.files"
cscope -b -i"$(SRC_PATH)/cscope.files"

# Needed by "meson install"
export DESTDIR
install: all install-datadir install-localstatedir
ifdef CONFIG_TRACE_SYSTEMTAP
$(INSTALL_PROG) "scripts/qemu-trace-stap" $(DESTDIR)$(bindir)
endif
ifneq ($(BLOBS),)
set -e; for x in $(BLOBS); do \
$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
done
endif
for s in $(ICON_SIZES); do \
mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps"; \
$(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_$${s}.png \
"$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps/qemu.png"; \
done; \
mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/32x32/apps"; \
$(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_32x32.bmp \
"$(DESTDIR)$(qemu_icondir)/hicolor/32x32/apps/qemu.bmp"; \
mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/scalable/apps"; \
$(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu.svg \
"$(DESTDIR)$(qemu_icondir)/hicolor/scalable/apps/qemu.svg"
mkdir -p "$(DESTDIR)$(qemu_desktopdir)"
$(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \
"$(DESTDIR)$(qemu_desktopdir)/qemu.desktop"
$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"

ifdef CONFIG_WIN32

INSTALLER = qemu-setup-$(VERSION)$(EXESUF)

nsisflags = -V2 -NOCD

ifneq ($(wildcard $(SRC_PATH)/dll),)
ifeq ($(ARCH),x86_64)
# 64 bit executables
DLL_PATH = $(SRC_PATH)/dll/w64
nsisflags += -DW64
else
# 32 bit executables
DLL_PATH = $(SRC_PATH)/dll/w32
endif
endif

.PHONY: installer
installer: $(INSTALLER)

INSTDIR=/tmp/qemu-nsis

$(INSTALLER): $(SRC_PATH)/qemu.nsi
$(MAKE) install DESTDIR=${INSTDIR}
ifdef SIGNCODE
(cd ${INSTDIR}/${bindir}; \
for i in *.exe; do \
$(SIGNCODE) $${i}; \
done \
)
endif # SIGNCODE
(cd ${INSTDIR}/${bindir}; \
for i in qemu-system-*.exe; do \
arch=$${i%.exe}; \
arch=$${arch#qemu-system-}; \
echo Section \"$$arch\" Section_$$arch; \
echo SetOutPath \"\$$INSTDIR\"; \
echo File \"\$${BINDIR}\\$$i\"; \
echo SectionEnd; \
done \
) >${INSTDIR}/${bindir}/system-emulations.nsh
makensis $(nsisflags) \
$(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \
$(if $(CONFIG_GTK),-DCONFIG_GTK="y") \
-DBINDIR="${INSTDIR}/${bindir}" \
$(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \
-DSRCDIR="$(SRC_PATH)" \
-DOUTFILE="$(INSTALLER)" \
-DDISPLAYVERSION="$(VERSION)" \
$(SRC_PATH)/qemu.nsi
rm -r ${INSTDIR}
ifdef SIGNCODE
$(SIGNCODE) $(INSTALLER)
endif # SIGNCODE
endif # CONFIG_WIN

# Add a dependency on the generated files, so that they are always
# rebuilt before other object files
Expand Down
4 changes: 2 additions & 2 deletions block/meson.build
Expand Up @@ -40,9 +40,9 @@ block_ss.add(files(
'vmdk.c',
'vpc.c',
'write-threshold.c',
), zstd)
), zstd, zlib)

block_ss.add(when: [zlib, 'CONFIG_QCOW1'], if_true: files('qcow.c'))
block_ss.add(when: 'CONFIG_QCOW1', if_true: files('qcow.c'))
block_ss.add(when: 'CONFIG_VDI', if_true: files('vdi.c'))
block_ss.add(when: 'CONFIG_CLOOP', if_true: files('cloop.c'))
block_ss.add(when: 'CONFIG_BOCHS', if_true: files('bochs.c'))
Expand Down
2 changes: 1 addition & 1 deletion chardev/meson.build
Expand Up @@ -38,7 +38,7 @@ chardev_modules = {}

if config_host.has_key('CONFIG_BRLAPI') and sdl.found()
module_ss = ss.source_set()
module_ss.add(when: [sdl, brlapi], if_true: files('baum.c'))
module_ss.add(when: [sdl, brlapi], if_true: [files('baum.c'), pixman])
chardev_modules += { 'baum': module_ss }
endif

Expand Down
65 changes: 18 additions & 47 deletions configure
Expand Up @@ -473,8 +473,7 @@ LDFLAGS_SHARED="-shared"
modules="no"
module_upgrades="no"
prefix="/usr/local"
firmwarepath="\${prefix}/share/qemu-firmware"
confsuffix="/qemu"
qemu_suffix="qemu"
slirp=""
oss_lib=""
bsd="no"
Expand Down Expand Up @@ -502,7 +501,6 @@ opengl=""
opengl_dmabuf="no"
cpuid_h="no"
avx2_opt=""
zlib="yes"
capstone=""
lzo=""
snappy=""
Expand Down Expand Up @@ -1013,7 +1011,7 @@ if test "$mingw32" = "yes" ; then
LIBS="-liberty $LIBS"
fi
prefix="c:/Program Files/QEMU"
confsuffix=""
qemu_suffix=""
libs_qga="-lws2_32 -lwinmm -lpowrprof -lwtsapi32 -lwininet -liphlpapi -lnetapi32 $libs_qga"
fi

Expand Down Expand Up @@ -1123,7 +1121,7 @@ for opt do
;;
--datadir=*) datadir="$optarg"
;;
--with-confsuffix=*) confsuffix="$optarg"
--with-suffix=*) qemu_suffix="$optarg"
;;
--docdir=*) qemu_docdir="$optarg"
;;
Expand Down Expand Up @@ -1428,7 +1426,7 @@ for opt do
;;
--enable-usb-redir) usb_redir="yes"
;;
--disable-zlib-test) zlib="no"
--disable-zlib-test)
;;
--disable-lzo) lzo="no"
;;
Expand Down Expand Up @@ -1678,21 +1676,22 @@ for opt do
esac
done

firmwarepath="${firmwarepath:-$prefix/share/qemu-firmware}"
libdir="${libdir:-$prefix/lib}"
libexecdir="${libexecdir:-$prefix/libexec}"
includedir="${includedir:-$prefix/include}"

if test "$mingw32" = "yes" ; then
mandir="$prefix"
datadir="$prefix"
qemu_docdir="$prefix"
docdir="$prefix"
bindir="$prefix"
sysconfdir="$prefix"
local_statedir=
else
mandir="${mandir:-$prefix/share/man}"
datadir="${datadir:-$prefix/share}"
qemu_docdir="${qemu_docdir:-$prefix/share/doc/qemu}"
docdir="${docdir:-$prefix/share/doc}"
bindir="${bindir:-$prefix/bin}"
sysconfdir="${sysconfdir:-$prefix/etc}"
local_statedir="${local_statedir:-$prefix/var}"
Expand Down Expand Up @@ -1833,16 +1832,16 @@ Advanced options (experts only):
--with-git=GIT use specified git [$git]
--static enable static build [$static]
--mandir=PATH install man pages in PATH
--datadir=PATH install firmware in PATH$confsuffix
--docdir=PATH install documentation in PATH$confsuffix
--datadir=PATH install firmware in PATH/$qemu_suffix
--docdir=PATH install documentation in PATH/$qemu_suffix
--bindir=PATH install binaries in PATH
--libdir=PATH install libraries in PATH
--libexecdir=PATH install helper binaries in PATH
--sysconfdir=PATH install config in PATH$confsuffix
--sysconfdir=PATH install config in PATH/$qemu_suffix
--localstatedir=PATH install local state in PATH (set at runtime on win32)
--firmwarepath=PATH search PATH for firmware files
--efi-aarch64=PATH PATH of efi file to use for aarch64 VMs.
--with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$confsuffix]
--with-suffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir/docdir [$qemu_suffix]
--with-pkgversion=VERS use specified string as sub-version of the package
--enable-debug enable common debug build options
--enable-sanitizers enable default sanitizers
Expand Down Expand Up @@ -2023,7 +2022,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.0; then
if test "$explicit_python" = no && has meson && version_ge "$(meson --version)" 0.55.1; then
meson=meson
elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then
meson=git
Expand Down Expand Up @@ -3904,30 +3903,6 @@ if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then
fi
fi

#########################################
# zlib check

if test "$zlib" != "no" ; then
if $pkg_config --exists zlib; then
zlib_cflags=$($pkg_config --cflags zlib)
zlib_libs=$($pkg_config --libs zlib)
QEMU_CFLAGS="$zlib_cflags $QEMU_CFLAGS"
LIBS="$zlib_libs $LIBS"
else
cat > $TMPC << EOF
#include <zlib.h>
int main(void) { zlibVersion(); return 0; }
EOF
if compile_prog "" "-lz" ; then
zlib_libs=-lz
LIBS="$LIBS $zlib_libs"
else
error_exit "zlib check failed" \
"Make sure to have the zlib libs and headers installed."
fi
fi
fi

##########################################
# SHA command probe for modules
if test "$modules" = yes; then
Expand Down Expand Up @@ -6474,9 +6449,10 @@ EOF
fi
fi

qemu_confdir=$sysconfdir$confsuffix
qemu_moddir=$libdir$confsuffix
qemu_datadir=$datadir$confsuffix
qemu_confdir="$sysconfdir/$qemu_suffix"
qemu_moddir="$libdir/$qemu_suffix"
qemu_datadir="$datadir/$qemu_suffix"
qemu_docdir="$docdir/$qemu_suffix"
qemu_localedir="$datadir/locale"
qemu_icondir="$datadir/icons"
qemu_desktopdir="$datadir/applications"
Expand Down Expand Up @@ -6672,12 +6648,10 @@ echo "bindir=$bindir" >> $config_host_mak
echo "libdir=$libdir" >> $config_host_mak
echo "libexecdir=$libexecdir" >> $config_host_mak
echo "includedir=$includedir" >> $config_host_mak
echo "mandir=$mandir" >> $config_host_mak
echo "sysconfdir=$sysconfdir" >> $config_host_mak
echo "qemu_confdir=$qemu_confdir" >> $config_host_mak
echo "qemu_datadir=$qemu_datadir" >> $config_host_mak
echo "qemu_firmwarepath=$firmwarepath" >> $config_host_mak
echo "qemu_docdir=$qemu_docdir" >> $config_host_mak
echo "qemu_moddir=$qemu_moddir" >> $config_host_mak
if test "$mingw32" = "no" ; then
echo "qemu_localstatedir=$local_statedir" >> $config_host_mak
Expand Down Expand Up @@ -7135,11 +7109,6 @@ fi
if test "$posix_memalign" = "yes" ; then
echo "CONFIG_POSIX_MEMALIGN=y" >> $config_host_mak
fi
if test "$zlib" != "no" ; then
echo "CONFIG_ZLIB=y" >> $config_host_mak
echo "ZLIB_CFLAGS=$zlib_cflags" >> $config_host_mak
echo "ZLIB_LIBS=$zlib_libs" >> $config_host_mak
fi
if test "$spice" = "yes" ; then
echo "CONFIG_SPICE=y" >> $config_host_mak
echo "SPICE_CFLAGS=$spice_cflags" >> $config_host_mak
Expand Down Expand Up @@ -8227,6 +8196,8 @@ NINJA=${ninja:-$PWD/ninjatool} $meson setup \
--mandir "${pre_prefix}$mandir" \
--sysconfdir "${pre_prefix}$sysconfdir" \
--localstatedir "${pre_prefix}$local_statedir" \
-Ddocdir="${pre_prefix}$docdir" \
-Dqemu_suffix="$qemu_suffix" \
-Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \
-Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \
-Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \
Expand Down
2 changes: 1 addition & 1 deletion contrib/vhost-user-gpu/meson.build
Expand Up @@ -10,5 +10,5 @@ if 'CONFIG_TOOLS' in config_host and 'CONFIG_VIRGL' in config_host \
configure_file(input: '50-qemu-gpu.json.in',
output: '50-qemu-gpu.json',
configuration: config_host,
install_dir: config_host['qemu_datadir'] / 'vhost-user')
install_dir: qemu_datadir / 'vhost-user')
endif

0 comments on commit 887adde

Please sign in to comment.