Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx> --- m4/virt-win-symbols.m4 | 3 --- src/Makefile.am | 14 ++---------- src/meson.build | 48 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 15 deletions(-) diff --git a/m4/virt-win-symbols.m4 b/m4/virt-win-symbols.m4 index f7b8e612a8d..dc5c5daa660 100644 --- a/m4/virt-win-symbols.m4 +++ b/m4/virt-win-symbols.m4 @@ -20,7 +20,6 @@ dnl AC_DEFUN([LIBVIRT_WIN_CHECK_SYMBOLS], [ LIBVIRT_ADMIN_SYMBOL_FILE=admin/libvirt_admin.syms LIBVIRT_LXC_SYMBOL_FILE='$(srcdir)/libvirt_lxc.syms' - LIBVIRT_QEMU_SYMBOL_FILE='$(srcdir)/libvirt_qemu.syms' case "$host" in *-*-mingw* ) # Also set the symbol file to .def, so src/Makefile generates libvirt.def @@ -28,10 +27,8 @@ AC_DEFUN([LIBVIRT_WIN_CHECK_SYMBOLS], [ # linker LIBVIRT_ADMIN_SYMBOL_FILE=admin/libvirt_admin.def LIBVIRT_LXC_SYMBOL_FILE=libvirt_lxc.def - LIBVIRT_QEMU_SYMBOL_FILE=libvirt_qemu.def ;; esac AC_SUBST([LIBVIRT_ADMIN_SYMBOL_FILE]) AC_SUBST([LIBVIRT_LXC_SYMBOL_FILE]) - AC_SUBST([LIBVIRT_QEMU_SYMBOL_FILE]) ]) diff --git a/src/Makefile.am b/src/Makefile.am index e727ad32944..5655655ee32 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -64,7 +64,7 @@ COMMON_UNIT_VARS = \ # Set these variables before we include any of the subdirs as libvirt-admin.la # has to be installed after libvirt.la. -lib_LTLIBRARIES += libvirt-qemu.la libvirt-lxc.la +lib_LTLIBRARIES += libvirt-lxc.la include util/Makefile.inc.am include security/Makefile.inc.am @@ -206,7 +206,7 @@ check-local: check-protocol check-symfile check-symsorting \ # depending on whether they are stored in git and/or used in the build. SYM_FILES += $(USED_SYM_FILES) GENERATED_SYM_FILES += \ - libvirt_qemu.def libvirt_lxc.def \ + libvirt_lxc.def \ $(NULL) @@ -246,16 +246,6 @@ libvirt_functions.stp: $(RPC_PROBE_FILES) $(top_srcdir)/scripts/gensystemtap.py endif WITH_DTRACE_PROBES -libvirt_qemu_la_SOURCES = libvirt-qemu.c -libvirt_qemu_la_LDFLAGS = \ - $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \ - -version-info $(LIBVIRT_VERSION_INFO) \ - $(LIBVIRT_NODELETE) \ - $(AM_LDFLAGS) \ - $(NULL) -libvirt_qemu_la_CFLAGS = $(AM_CFLAGS) -libvirt_qemu_la_LIBADD = libvirt.la - libvirt_lxc_la_SOURCES = libvirt-lxc.c libvirt_lxc_la_LDFLAGS = \ $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \ diff --git a/src/meson.build b/src/meson.build index 748bb7a9914..a7fbff674c6 100644 --- a/src/meson.build +++ b/src/meson.build @@ -257,3 +257,51 @@ libvirt_lib = shared_library( version: libvirt_lib_version, soversion: libvirt_so_version, ) + + +# libvirt-qemu.syms symbol files + +libvirt_qemu_syms = meson.current_source_dir() / 'libvirt_qemu.syms' +libvirt_qemu_syms_file = libvirt_qemu_syms +libvirt_qemu_syms_path = libvirt_qemu_syms +if host_machine.system() == 'windows' + libvirt_qemu_def = custom_target( + 'libvirt_qemu.def', + input: libvirt_qemu_syms, + output: 'libvirt_qemu.def', + command: [ gen_def_files_prog, '@INPUT@' ], + capture: true, + ) + libvirt_qemu_syms_file = libvirt_qemu_def + libvirt_qemu_syms_path = libvirt_qemu_def.full_path() +endif + + +# libvirt-qemu.so + +libvirt_qemu_syms_flags = '@0@@1@'.format( + version_script_flags, + libvirt_qemu_syms_path, +) + +libvirt_qemu_lib = shared_library( + 'virt-qemu', + 'libvirt-qemu.c', + dependencies: [ + src_dep, + ], + link_args: [ + libvirt_nodelete, + libvirt_qemu_syms_flags, + ], + link_with: [ + libvirt_lib, + ], + link_depends: [ + libvirt_qemu_syms_file, + ], + install: true, + install_rpath: libdir, + version: libvirt_lib_version, + soversion: libvirt_so_version, +) -- 2.26.2