[PATCH 140/147] meson: convert sample plugins

Paolo Bonzini posted 147 patches 5 years, 4 months ago
Maintainers: Jason Wang <jasowang@redhat.com>, Raphael Norwitz <raphael.norwitz@nutanix.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Huacai Chen <chenhc@lemote.com>, Christian Schoenebeck <qemu_oss@crudebyte.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Paolo Bonzini <pbonzini@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, Alistair Francis <Alistair.Francis@wdc.com>, Michael Rolnik <mrolnik@gmail.com>, Laszlo Ersek <lersek@redhat.com>, Anthony Perard <anthony.perard@citrix.com>, John Snow <jsnow@redhat.com>, Thomas Huth <thuth@redhat.com>, Hannes Reinecke <hare@suse.com>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>, Palmer Dabbelt <palmer@dabbelt.com>, Greg Kurz <groug@kaod.org>, Igor Mammedov <imammedo@redhat.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, Andrzej Zaborowski <balrogg@gmail.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Su Hang <suhang16@mails.ucas.ac.cn>, Ben Warren <ben@skyportsystems.com>, "Alex Bennée" <alex.bennee@linaro.org>, Markus Armbruster <armbru@redhat.com>, Fam Zheng <fam@euphon.net>, Max Reitz <mreitz@redhat.com>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Eric Blake <eblake@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Keith Busch <kbusch@kernel.org>, Yuval Shaia <yuval.shaia.ml@gmail.com>, Juan Quintela <quintela@redhat.com>, Aurelien Jarno <aurelien@aurel32.net>, Richard Henderson <rth@twiddle.net>, Peter Maydell <peter.maydell@linaro.org>, Alex Williamson <alex.williamson@redhat.com>, Amit Shah <amit@kernel.org>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, Stafford Horne <shorne@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, Helge Deller <deller@gmx.de>, Max Filippov <jcmvbkbc@gmail.com>, Stefan Berger <stefanb@linux.ibm.com>, Joel Stanley <joel@jms.id.au>, Halil Pasic <pasic@linux.ibm.com>, Paul Durrant <paul@xen.org>, David Gibson <david@gibson.dropbear.id.au>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Riku Voipio <riku.voipio@iki.fi>, Stefan Hajnoczi <stefanha@redhat.com>, David Hildenbrand <david@redhat.com>, Artyom Tarasenko <atar4qemu@gmail.com>, "Cédric Le Goater" <clg@kaod.org>, Laurent Vivier <laurent@vivier.eu>, Cleber Rosa <crosa@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Stefano Stabellini <sstabellini@kernel.org>, Bandan Das <bsd@redhat.com>, Stefan Weil <sw@weilnetz.de>, Christian Borntraeger <borntraeger@de.ibm.com>, Alexander Bulekov <alxndr@bu.edu>, Sarah Harris <S.E.Harris@kent.ac.uk>, Cornelia Huck <cohuck@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Michael Roth <mdroth@linux.vnet.ibm.com>, Laurent Vivier <lvivier@redhat.com>, Sagar Karandikar <sagark@eecs.berkeley.edu>, Gerd Hoffmann <kraxel@redhat.com>, Dmitry Fleytman <dmitry.fleytman@gmail.com>
There is a newer version of this series
[PATCH 140/147] meson: convert sample plugins
Posted by Paolo Bonzini 5 years, 4 months ago
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure                |  4 ----
 tests/Makefile.include   |  9 ---------
 tests/meson.build        |  3 +++
 tests/plugin/Makefile    | 46 ----------------------------------------------
 tests/plugin/meson.build |  7 +++++++
 5 files changed, 10 insertions(+), 59 deletions(-)
 delete mode 100644 tests/plugin/Makefile
 create mode 100644 tests/plugin/meson.build

diff --git a/configure b/configure
index 5d57990..ee32003 100755
--- a/configure
+++ b/configure
@@ -6825,9 +6825,6 @@ echo "GIT_UPDATE=$git_update" >> $config_host_mak
 
 echo "ARCH=$ARCH" >> $config_host_mak
 
-echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
-echo "GLIB_LDFLAGS=$glib_ldflags" >> $config_host_mak
-
 if test "$default_devices" = "yes" ; then
   echo "CONFIG_MINIKCONF_MODE=--defconfig" >> $config_host_mak
 else
@@ -8312,7 +8309,6 @@ DIRS="$DIRS roms/seabios"
 LINKS="Makefile"
 LINKS="$LINKS tests/tcg/lm32/Makefile po/Makefile"
 LINKS="$LINKS tests/tcg/Makefile.target"
-LINKS="$LINKS tests/plugin/Makefile"
 LINKS="$LINKS pc-bios/optionrom/Makefile pc-bios/keymaps"
 LINKS="$LINKS pc-bios/s390-ccw/Makefile"
 LINKS="$LINKS roms/seabios/Makefile"
diff --git a/tests/Makefile.include b/tests/Makefile.include
index e023df8..aec293b 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -429,15 +429,6 @@ check-speed: $(check-speed-y)
 check-report-unit.tap: $(check-unit-y)
 	$(call do_test_tap,$^)
 
-# Plugins
-ifeq ($(CONFIG_PLUGIN),y)
-.PHONY: plugins
-plugins:
-	$(call quiet-command,\
-		$(MAKE) $(SUBDIR_MAKEFLAGS) -C tests/plugin V="$(V)", \
-		"BUILD", "plugins")
-endif
-
 # Per guest TCG tests
 
 BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGET_DIRS))
diff --git a/tests/meson.build b/tests/meson.build
index f834c27..fe2c6d8 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -9,6 +9,9 @@ test('decodetree', sh,
 
 if 'CONFIG_TCG' in config_host
   subdir('fp')
+  if 'CONFIG_PLUGIN' in config_host
+    subdir('plugin')
+  endif
 endif
 
 subdir('qapi-schema')
diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile
deleted file mode 100644
index e9348fd..0000000
--- a/tests/plugin/Makefile
+++ /dev/null
@@ -1,46 +0,0 @@
-# -*- Mode: makefile -*-
-#
-# This Makefile example is fairly independent from the main makefile
-# so users can take and adapt it for their build. We only really
-# include config-host.mak so we don't have to repeat probing for
-# cflags that the main configure has already done for us.
-#
-
-BUILD_DIR := $(CURDIR)/../..
-
-include $(BUILD_DIR)/config-host.mak
-
-VPATH += $(SRC_PATH)/tests/plugin
-
-NAMES :=
-NAMES += bb
-NAMES += empty
-NAMES += insn
-NAMES += mem
-NAMES += hotblocks
-NAMES += howvec
-NAMES += hotpages
-NAMES += lockstep
-
-SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))
-
-# The main QEMU uses Glib extensively so it's perfectly fine to use it
-# in plugins (which many example do).
-CFLAGS = $(GLIB_CFLAGS)
-CFLAGS += -fPIC
-CFLAGS += $(if $(findstring no-psabi,$(QEMU_CFLAGS)),-Wpsabi)
-CFLAGS += -I$(SRC_PATH)/include/qemu
-
-all: $(SONAMES)
-
-%.o: %.c
-	$(CC) $(CFLAGS) -c -o $@ $<
-
-lib%.so: %.o
-	$(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDLIBS)
-
-clean:
-	rm -f *.o *.so *.d
-	rm -Rf .libs
-
-.PHONY: all clean
diff --git a/tests/plugin/meson.build b/tests/plugin/meson.build
new file mode 100644
index 0000000..dbbdcba
--- /dev/null
+++ b/tests/plugin/meson.build
@@ -0,0 +1,7 @@
+t = []
+foreach i : ['bb', 'empty', 'insn', 'mem', 'hotblocks', 'howvec', 'hotpages', 'lockstep']
+  t += shared_module(i, files(i + '.c'),
+                     include_directories: '../../include/qemu',
+                     dependencies: glib)
+endforeach
+alias_target('plugins', t)
-- 
1.8.3.1