meson: src: build libvirt-lxc.so library

There are two extra dependencies compared to automake, apparmor and
selinux.  It looks like libtool is doing some magic and inheriting
dependencies from libvirt.la which inherits these dependencies from
other libraries.

Without these two dependencies in meson the compilation fails.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-06-25 16:30:41 +02:00
parent 96191634e9
commit 4bb4faf977
3 changed files with 52 additions and 23 deletions

View File

@ -19,16 +19,13 @@ dnl
AC_DEFUN([LIBVIRT_WIN_CHECK_SYMBOLS], [
LIBVIRT_ADMIN_SYMBOL_FILE=admin/libvirt_admin.syms
LIBVIRT_LXC_SYMBOL_FILE='$(srcdir)/libvirt_lxc.syms'
case "$host" in
*-*-mingw* )
# Also set the symbol file to .def, so src/Makefile generates libvirt.def
# from libvirt.syms and passes libvirt.def instead of libvirt.syms to the
# linker
LIBVIRT_ADMIN_SYMBOL_FILE=admin/libvirt_admin.def
LIBVIRT_LXC_SYMBOL_FILE=libvirt_lxc.def
;;
esac
AC_SUBST([LIBVIRT_ADMIN_SYMBOL_FILE])
AC_SUBST([LIBVIRT_LXC_SYMBOL_FILE])
])

View File

@ -38,7 +38,6 @@ INSTALL_DATA_LOCAL =
UNINSTALL_LOCAL =
SYM_FILES =
USED_SYM_FILES =
GENERATED_SYM_FILES =
augeas_DATA =
augeastest_DATA =
conf_DATA =
@ -63,10 +62,6 @@ COMMON_UNIT_VARS = \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
$(NULL)
# Set these variables before we include any of the subdirs as libvirt-admin.la
# has to be installed after libvirt.la.
lib_LTLIBRARIES += libvirt-lxc.la
include util/Makefile.inc.am
include security/Makefile.inc.am
include access/Makefile.inc.am
@ -208,9 +203,6 @@ check-local: check-protocol check-symfile check-symsorting \
# All .syms files should be placed in exactly one of these three lists,
# depending on whether they are stored in git and/or used in the build.
SYM_FILES += $(USED_SYM_FILES)
GENERATED_SYM_FILES += \
libvirt_lxc.def \
$(NULL)
check-local: check-augeas
@ -231,8 +223,6 @@ check-augeas: $(augeas_DATA) $(augeastest_DATA)
AUG_GENTEST_SCRIPT = $(top_srcdir)/scripts/augeas-gentest.py
AUG_GENTEST = $(RUNUTF8) $(PYTHON) $(AUG_GENTEST_SCRIPT)
BUILT_SOURCES += $(GENERATED_SYM_FILES)
if WITH_DTRACE_PROBES
BUILT_SOURCES += libvirt_functions.stp
@ -253,16 +243,6 @@ libvirt_functions.stp: $(RPC_PROBE_FILES) $(top_srcdir)/scripts/gensystemtap.py
endif WITH_DTRACE_PROBES
libvirt_lxc_la_SOURCES = libvirt-lxc.c
libvirt_lxc_la_LDFLAGS = \
$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
-version-info $(LIBVIRT_VERSION_INFO) \
$(LIBVIRT_NODELETE) \
$(AM_LDFLAGS) \
$(NULL)
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la
install-sysconfig:
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
for f in $(SYSCONF_FILES:%.sysconf=%) ; \

View File

@ -321,3 +321,55 @@ libvirt_qemu_lib = shared_library(
version: libvirt_lib_version,
soversion: libvirt_so_version,
)
# libvirt-lxc.so symbol files
libvirt_lxc_syms = meson.current_source_dir() / 'libvirt_lxc.syms'
libvirt_lxc_syms_file = libvirt_lxc_syms
libvirt_lxc_syms_path = libvirt_lxc_syms
if host_machine.system() == 'windows'
libvirt_lxc_def = custom_target(
'libvirt_lxc.def',
input: libvirt_lxc_syms,
output: 'libvirt_lxc.def',
command: [
meson_python_prog, python3_prog.path(), meson_gen_def_prog.path(),
'@INPUT@', '@OUTPUT@',
],
)
libvirt_lxc_syms_file = libvirt_lxc_def
libvirt_lxc_syms_path = libvirt_lxc_def.full_path()
endif
# libvirt-lxc.so
libvirt_lxc_syms_flags = '@0@@1@'.format(
version_script_flags,
libvirt_lxc_syms_path,
)
libvirt_lxc_lib = shared_library(
'virt-lxc',
'libvirt-lxc.c',
dependencies: [
apparmor_dep,
selinux_dep,
src_dep,
],
link_args: [
libvirt_nodelete,
libvirt_lxc_syms_flags,
],
link_with: [
libvirt_lib,
],
link_depends: [
libvirt_lxc_syms_file,
],
install: true,
install_rpath: libdir,
version: libvirt_lib_version,
soversion: libvirt_so_version,
)