]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: src: build libvirt-lxc.so library
authorPavel Hrdina <phrdina@redhat.com>
Thu, 25 Jun 2020 14:30:41 +0000 (16:30 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:04 +0000 (09:27 +0200)
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>
m4/virt-win-symbols.m4
src/Makefile.am
src/meson.build

index dc5c5daa6607718987ade81b75fb7d391ce1fbd4..5ffee491877919a9e7d554e1161315b6a0ce6283 100644 (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])
 ])
index 3dcc7b6793ff99553de85123f759b99aa7f9569e..f97e35ada1de366ffee8e0d0aa0792b9b73c2f40 100644 (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=%) ; \
index 0b11c1fd32b036a092a21a40b07ec2894b6c2692..a0240c0ef637f1012fe00a7b78ffe7f7d47c277d 100644 (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,
+)