meson: plugins

For now link arguments end up in Makefile.target, they will move to the
right place soon.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2020-01-24 13:08:01 +01:00
parent c9322ab5bf
commit f556b4a10d
5 changed files with 21 additions and 30 deletions

View File

@ -433,13 +433,10 @@ endif
ICON_SIZES=16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512
install-includedir:
$(INSTALL_DIR) "$(DESTDIR)$(includedir)"
# Needed by "meson install"
export DESTDIR
install: all $(if $(BUILD_DOCS),install-doc) \
install-datadir install-localstatedir install-includedir \
install-datadir install-localstatedir \
recurse-install
ifdef CONFIG_TRACE_SYSTEMTAP
$(INSTALL_PROG) "scripts/qemu-trace-stap" $(DESTDIR)$(bindir)
@ -465,9 +462,6 @@ endif
"$(DESTDIR)$(qemu_desktopdir)/qemu.desktop"
ifdef CONFIG_GTK
$(MAKE) -C po $@
endif
ifeq ($(CONFIG_PLUGIN),y)
$(INSTALL_DATA) $(SRC_PATH)/include/qemu/qemu-plugin.h "$(DESTDIR)$(includedir)/qemu-plugin.h"
endif
$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
set -e; for x in $(KEYMAPS); do \

View File

@ -110,8 +110,6 @@ obj-y += trace/
#########################################################
LIBS := $(libs_cpu) $(LIBS)
obj-$(CONFIG_PLUGIN) += plugins/
#########################################################
# Linux user emulator target
@ -153,6 +151,16 @@ LIBS := $(LIBS) $(VDE_LIBS) $(SLIRP_LIBS)
LIBS := $(LIBS) $(LIBUSB_LIBS) $(SMARTCARD_LIBS) $(USB_REDIR_LIBS)
LIBS := $(LIBS) $(VIRGL_LIBS) $(CURSES_LIBS)
ifeq ($(CONFIG_PLUGIN),y)
ifdef CONFIG_HAS_LD_DYNAMIC_LIST
LIBS += -Wl,--dynamic-list=$(BUILD_DIR)/qemu-plugins-ld.symbols
else
ifdef CONFIG_HAS_LD_EXPORTED_SYMBOLS_LIST
LIBS += -Wl,-exported_symbols_list,$(BUILD_DIR)/qemu-plugins-ld64.symbols
endif
endif
endif
generated-files-y += hmp-commands.h hmp-commands-info.h
endif # CONFIG_SOFTMMU

View File

@ -731,6 +731,7 @@ subdir('net')
subdir('replay')
subdir('hw')
subdir('accel')
subdir('plugins')
subdir('bsd-user')
subdir('linux-user')
@ -899,6 +900,10 @@ endforeach
# Other build targets
if 'CONFIG_PLUGIN' in config_host
install_headers('include/qemu/qemu-plugin.h')
endif
if 'CONFIG_GUEST_AGENT' in config_host
subdir('qga')
endif

View File

@ -1,21 +0,0 @@
#
# Plugin Support
#
obj-y += loader.o
obj-y += core.o
obj-y += api.o
# Abuse -libs suffix to only link with --dynamic-list/-exported_symbols_list
# when the final binary includes the plugin object.
#
# Note that simply setting LDFLAGS is not enough: we build binaries that
# never link plugin.o, and the linker might fail (at least ld64 does)
# if the symbols in the list are not in the output binary.
ifdef CONFIG_HAS_LD_DYNAMIC_LIST
api.o-libs := -Wl,--dynamic-list=$(BUILD_DIR)/qemu-plugins-ld.symbols
else
ifdef CONFIG_HAS_LD_EXPORTED_SYMBOLS_LIST
api.o-libs := -Wl,-exported_symbols_list,$(BUILD_DIR)/qemu-plugins-ld64.symbols
endif
endif

5
plugins/meson.build Normal file
View File

@ -0,0 +1,5 @@
specific_ss.add(when: 'CONFIG_PLUGIN', if_true: [files(
'loader.c',
'core.c',
'api.c',
)])