[libvirt PATCH 152/351] meson: src: build libvirt.so library

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 src/Makefile.am            | 35 +--------------------------------
 src/access/Makefile.inc.am |  2 --
 src/access/meson.build     |  2 ++
 src/admin/meson.build      |  2 ++
 src/conf/meson.build       |  2 ++
 src/cpu/meson.build        |  2 ++
 src/esx/meson.build        |  2 ++
 src/hyperv/meson.build     |  2 ++
 src/hypervisor/meson.build |  2 ++
 src/locking/meson.build    |  2 ++
 src/logging/meson.build    |  2 ++
 src/meson.build            | 40 ++++++++++++++++++++++++++++++++++++++
 src/openvz/meson.build     |  2 ++
 src/remote/meson.build     |  2 ++
 src/rpc/meson.build        |  6 ++++++
 src/security/meson.build   |  2 ++
 src/test/meson.build       |  2 ++
 src/util/meson.build       |  2 ++
 src/vmware/meson.build     |  2 ++
 src/vmx/meson.build        |  2 ++
 20 files changed, 79 insertions(+), 36 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 3ad565f7775..b83a087b716 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -35,7 +35,6 @@ mod_LTLIBRARIES =
 INSTALL_DATA_DIRS =
 INSTALL_DATA_LOCAL =
 UNINSTALL_LOCAL =
-libvirt_la_BUILT_LIBADD =
 SYM_FILES =
 USED_SYM_FILES =
 GENERATED_SYM_FILES =
@@ -65,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.la libvirt-qemu.la libvirt-lxc.la
+lib_LTLIBRARIES += libvirt-qemu.la libvirt-lxc.la
 
 include util/Makefile.inc.am
 include cpu_map/Makefile.inc.am
@@ -204,13 +203,6 @@ check-local: check-protocol check-symfile check-symsorting \
 .PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
 
 
-#########################
-#
-# Build up list of libvirt.la source files based on configure conditions
-#
-# First deal with sources usable in non-daemon context
-
-
 # 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)
@@ -237,32 +229,7 @@ check-augeas: $(augeas_DATA) $(augeastest_DATA)
 AUG_GENTEST_SCRIPT = $(top_srcdir)/scripts/augeas-gentest.py
 AUG_GENTEST = $(RUNUTF8) $(PYTHON) $(AUG_GENTEST_SCRIPT)
 
-# Empty source list - it merely links a bunch of convenience libs together
-libvirt_la_SOURCES =
-libvirt_la_LDFLAGS = \
-		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
-		-version-info $(LIBVIRT_VERSION_INFO) \
-		$(LIBVIRT_NODELETE) \
-		$(NO_UNDEFINED_LDFLAGS) \
-		$(FLAT_NAMESPACE_FLAGS) \
-		$(AM_LDFLAGS) \
-		$(NULL)
-libvirt_la_LIBADD += \
-		$(DLOPEN_LIBS) \
-		$(XDR_LIBS) \
-		$(NULL)
-libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
-# Because we specify libvirt_la_DEPENDENCIES for $(LIBVIRT_SYMBOL_FILE), we
-# lose automake's automatic dependencies on an appropriate subset of
-# $(libvirt_la_LIBADD).  But we were careful to create
-# $(libvirt_la_BUILT_LIBADD) as the subset that automake would have
-# picked out for us.
-libvirt_la_DEPENDENCIES = $(libvirt_la_BUILT_LIBADD) $(LIBVIRT_SYMBOL_FILE)
-
 if WITH_DTRACE_PROBES
-libvirt_la_BUILT_LIBADD += libvirt_probes.lo
-libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
-nodist_libvirt_la_SOURCES = libvirt_probes.h
 
 tapset_DATA += libvirt_functions.stp
 
diff --git a/src/access/Makefile.inc.am b/src/access/Makefile.inc.am
index bd1d51dd777..72c62a0d2cd 100644
--- a/src/access/Makefile.inc.am
+++ b/src/access/Makefile.inc.am
@@ -8,8 +8,6 @@ ACCESS_DRIVER_API_FILES = \
 
 ACCESS_DRIVER_POLKIT_POLICY = access/org.libvirt.api.policy
 
-libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
-
 $(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
     $(top_srcdir)/scripts/genpolkit.py Makefile.am
 	$(AM_V_GEN)$(RUNUTF8) $(PYTHON) \
diff --git a/src/access/meson.build b/src/access/meson.build
index dc962166873..f3b605f0009 100644
--- a/src/access/meson.build
+++ b/src/access/meson.build
@@ -75,6 +75,8 @@ virt_access_lib = static_library(
   ]
 )
 
+libvirt_libs += virt_access_lib
+
 access_inc_dir = include_directories('.')
 
 # Used by others where generated headers are required
diff --git a/src/admin/meson.build b/src/admin/meson.build
index cf2f206e34a..31d1a437fbe 100644
--- a/src/admin/meson.build
+++ b/src/admin/meson.build
@@ -48,3 +48,5 @@ admin_driver_lib = static_library(
     xdr_dep,
   ],
 )
+
+libvirt_libs += admin_driver_lib
diff --git a/src/conf/meson.build b/src/conf/meson.build
index 394cca4e6a1..03b90aa6f60 100644
--- a/src/conf/meson.build
+++ b/src/conf/meson.build
@@ -105,4 +105,6 @@ virt_conf_lib = static_library(
   ],
 )
 
+libvirt_libs += virt_conf_lib
+
 conf_inc_dir = include_directories('.')
diff --git a/src/cpu/meson.build b/src/cpu/meson.build
index 2404dc6b76f..b4ad95e46d5 100644
--- a/src/cpu/meson.build
+++ b/src/cpu/meson.build
@@ -17,3 +17,5 @@ cpu_lib = static_library(
     conf_inc_dir,
   ],
 )
+
+libvirt_libs += cpu_lib
diff --git a/src/esx/meson.build b/src/esx/meson.build
index 08d8a542498..1718411d759 100644
--- a/src/esx/meson.build
+++ b/src/esx/meson.build
@@ -54,6 +54,8 @@ if conf.has('WITH_ESX')
       vmx_inc_dir,
     ],
   )
+
+  libvirt_libs += esx_lib
 endif
 
 if conf.has('WITH_ESX')
diff --git a/src/hyperv/meson.build b/src/hyperv/meson.build
index 71382e3db0e..d499889b01b 100644
--- a/src/hyperv/meson.build
+++ b/src/hyperv/meson.build
@@ -38,4 +38,6 @@ if conf.has('WITH_HYPERV')
       conf_inc_dir,
     ]
   )
+
+  libvirt_libs += hyperv_lib
 endif
diff --git a/src/hypervisor/meson.build b/src/hypervisor/meson.build
index ea1dddfe983..85149c683ee 100644
--- a/src/hypervisor/meson.build
+++ b/src/hypervisor/meson.build
@@ -18,4 +18,6 @@ hypervisor_lib = static_library(
   ],
 )
 
+libvirt_libs += hypervisor_lib
+
 hypervisor_inc_dir = include_directories('.')
diff --git a/src/locking/meson.build b/src/locking/meson.build
index 67822486253..18b2e3c72a6 100644
--- a/src/locking/meson.build
+++ b/src/locking/meson.build
@@ -16,3 +16,5 @@ lock_driver_lib = static_library(
     conf_inc_dir,
   ],
 )
+
+libvirt_libs += lock_driver_lib
diff --git a/src/logging/meson.build b/src/logging/meson.build
index a9c30efe063..5d1f30ac08f 100644
--- a/src/logging/meson.build
+++ b/src/logging/meson.build
@@ -36,3 +36,5 @@ log_driver_lib = static_library(
     xdr_dep,
   ],
 )
+
+libvirt_libs += log_driver_lib
diff --git a/src/meson.build b/src/meson.build
index 257cdbe4090..b6b9da32df6 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -114,6 +114,11 @@ else
 endif
 
 
+# variables filled by subdirectories
+
+libvirt_libs = []
+
+
 # list subdirectories
 
 subdir('util')
@@ -179,6 +184,8 @@ driver_lib = static_library(
   ],
 )
 
+libvirt_libs += driver_lib
+
 
 # symbol files for libvirt.so
 
@@ -206,6 +213,7 @@ libvirt_syms = custom_target(
   command: [ gen_sym_files_prog, 'LIBVIRT_PRIVATE_' + meson.project_version(), '@INPUT@' ],
   capture: true,
 )
+libvirt_syms_file = libvirt_syms
 if host_machine.system() == 'windows'
   libvirt_def = custom_target(
     'libvirt.def',
@@ -214,4 +222,36 @@ if host_machine.system() == 'windows'
     command: [ gen_def_files_prog, '@INPUT@' ],
     capture: true,
   )
+  libvirt_syms_file = libvirt_def
 endif
+
+
+# libvirt.so library
+
+libvirt_syms_flags = '@0@@1@'.format(
+  version_script_flags,
+  libvirt_syms_file.full_path(),
+)
+
+libvirt_lib = shared_library(
+  'virt',
+  dtrace_gen_objects,
+  dependencies: [
+    src_dep,
+  ],
+  link_args: [
+    libvirt_flat_namespace,
+    libvirt_no_undefined,
+    libvirt_nodelete,
+    libvirt_syms_flags,
+  ],
+  link_whole: [
+    libvirt_libs,
+  ],
+  link_depends: [
+    libvirt_syms_file,
+  ],
+  install: true,
+  version: libvirt_lib_version,
+  soversion: libvirt_so_version,
+)
diff --git a/src/openvz/meson.build b/src/openvz/meson.build
index 427b25fed1c..66048098774 100644
--- a/src/openvz/meson.build
+++ b/src/openvz/meson.build
@@ -17,6 +17,8 @@ if conf.has('WITH_OPENVZ')
       conf_inc_dir,
     ],
   )
+
+  libvirt_libs += openvz_lib
 endif
 
 if conf.has('WITH_OPENVZ')
diff --git a/src/remote/meson.build b/src/remote/meson.build
index f029edefd7e..a667f15ecf2 100644
--- a/src/remote/meson.build
+++ b/src/remote/meson.build
@@ -56,6 +56,8 @@ if conf.has('WITH_REMOTE')
       conf_inc_dir,
     ],
   )
+
+  libvirt_libs += remote_driver_lib
 endif
 
 if conf.has('WITH_REMOTE')
diff --git a/src/rpc/meson.build b/src/rpc/meson.build
index b8fbe0c38b1..8f4372bb3e2 100644
--- a/src/rpc/meson.build
+++ b/src/rpc/meson.build
@@ -112,3 +112,9 @@ rpc_dep = declare_dependency(
   include_directories: [ rpc_inc_dir ],
   sources: [ rpc_gen_headers ],
 )
+
+libvirt_libs += [
+  virt_rpc_lib,
+  virt_rpc_client_lib,
+  virt_rpc_server_lib,
+]
diff --git a/src/security/meson.build b/src/security/meson.build
index 3dc88c2c546..1e85d8dcf5f 100644
--- a/src/security/meson.build
+++ b/src/security/meson.build
@@ -29,3 +29,5 @@ security_driver_lib = static_library(
     conf_inc_dir,
   ],
 )
+
+libvirt_libs += security_driver_lib
diff --git a/src/test/meson.build b/src/test/meson.build
index ec7b12304ec..f54585adfd1 100644
--- a/src/test/meson.build
+++ b/src/test/meson.build
@@ -20,5 +20,7 @@ if conf.has('WITH_TEST')
     ],
   )
 
+  libvirt_libs += test_lib
+
   install_data(test_driver_assets, install_dir: pkgdatadir)
 endif
diff --git a/src/util/meson.build b/src/util/meson.build
index 59a531f6af1..3c728b355ee 100644
--- a/src/util/meson.build
+++ b/src/util/meson.build
@@ -193,4 +193,6 @@ virt_util_lib = static_library(
   ],
 )
 
+libvirt_libs += virt_util_lib
+
 util_inc_dir = include_directories('.')
diff --git a/src/vmware/meson.build b/src/vmware/meson.build
index dc2a32a1610..2021b4ffa44 100644
--- a/src/vmware/meson.build
+++ b/src/vmware/meson.build
@@ -15,6 +15,8 @@ if conf.has('WITH_VMWARE')
       vmx_inc_dir,
     ],
   )
+
+  libvirt_libs += vmware_lib
 endif
 
 if conf.has('WITH_VMWARE')
diff --git a/src/vmx/meson.build b/src/vmx/meson.build
index 25e3d1a6fca..e599b8de39b 100644
--- a/src/vmx/meson.build
+++ b/src/vmx/meson.build
@@ -15,6 +15,8 @@ if conf.has('WITH_VMX')
       conf_inc_dir,
     ],
   )
+
+  libvirt_libs += vmx_lib
 endif
 
 vmx_inc_dir = include_directories('.')
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux