Add the main glib.h to internal.h so that all common code can use it.
Historically glib allowed applications to register an alternative
memory allocator, so mixing g_malloc/g_free with malloc/free was not
safe.
This was feature was dropped in 2.46.0 with:
commit 3be6ed60aa58095691bd697344765e715a327fc1
Author: Alexander Larsson <alexl(a)redhat.com>
Date: Sat Jun 27 18:38:42 2015 +0200
Deprecate and drop support for memory vtables
Applications are still encourged to match g_malloc/g_free, but it is no
longer a mandatory requirement for correctness, just stylistic. This is
explicitly clarified in
commit 1f24b36607bf708f037396014b2cdbc08d67b275
Author: Daniel P. Berrangé <berrange(a)redhat.com>
Date: Thu Sep 5 14:37:54 2019 +0100
gmem: clarify that g_malloc always uses the system allocator
Applications can still use custom allocators in general, but they must
do this by linking to a library that replaces the core malloc/free
implemenentation entirely, instead of via a glib specific call.
This means that libvirt does not need to be concerned about use of
g_malloc/g_free causing an ABI change in the public libary, and can
avoid memory copying when talking to external libraries.
This patch probes for glib, which provides the foundation layer with
a collection of data structures, helper APIs, and platform portability
logic.
Later patches will introduce linkage to gobject which provides the
object type system, built on glib, and gio which providing objects
for various interesting tasks, most notably including DBus client
and server support and portable sockets APIs, but much more too.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
docs/hacking.html.in | 21 +++++++++++++++++++++
src/Makefile.am | 3 +++
src/access/Makefile.inc.am | 4 +++-
src/bhyve/Makefile.inc.am | 1 +
src/interface/Makefile.inc.am | 1 +
src/internal.h | 1 +
src/libxl/Makefile.inc.am | 1 +
src/locking/Makefile.inc.am | 9 ++++++++-
src/logging/Makefile.inc.am | 1 +
src/lxc/Makefile.inc.am | 4 ++++
src/network/Makefile.inc.am | 2 ++
src/node_device/Makefile.inc.am | 5 ++++-
src/nwfilter/Makefile.inc.am | 1 +
src/qemu/Makefile.inc.am | 1 +
src/remote/Makefile.inc.am | 2 ++
src/secret/Makefile.inc.am | 1 +
src/security/Makefile.inc.am | 1 +
src/storage/Makefile.inc.am | 16 ++++++++++++++++
src/vbox/Makefile.inc.am | 1 +
src/vz/Makefile.inc.am | 1 +
tests/Makefile.am | 7 +++++--
tools/Makefile.am | 4 ++++
22 files changed, 83 insertions(+), 5 deletions(-)
diff --git a/docs/hacking.html.in b/docs/hacking.html.in
index edf2f54ce3..2e064ced5e 100644
--- a/docs/hacking.html.in
+++ b/docs/hacking.html.in
@@ -989,6 +989,27 @@ BAD:
it points to, or it is aliased to another pointer that is.
</p>
+ <h2><a id="glib">Adoption of GLib APIs</a></h2>
+
+ <p>
+ Libvirt has adopted use of the
+ <a
href="https://developer.gnome.org/glib/stable/">GLib
library</a>.
+ Due to libvirt's long history of development, there are many APIs
+ in libvirt, for which GLib provides an alternative solution. The
+ general rule to follow is that the standard GLib solution will be
+ preferred over historical libvirt APIs. Existing code will be
+ ported over to use GLib APIs over time, but new code should use
+ the GLib APIs straight away where possible.
+ </p>
+
+ <p>
+ The following is a list of libvirt APIs that should no longer be
+ used in new code, and their suggested GLib replacements:
+ </p>
+
+ <dl>
+ </dl>
+
<h2><a id="memalloc">Low level memory
management</a></h2>
<p>
diff --git a/src/Makefile.am b/src/Makefile.am
index bd03b09cb2..e646e954a4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -34,6 +34,7 @@ AM_CPPFLAGS = -I../gnulib/lib \
WARN_CFLAGS += $(STRICT_FRAME_LIMIT_CFLAGS)
AM_CFLAGS = $(LIBXML_CFLAGS) \
+ $(GLIB_CFLAGS) \
$(WARN_CFLAGS) \
$(LOCK_CHECKING_CFLAGS) \
$(WIN32_EXTRA_CFLAGS) \
@@ -558,6 +559,7 @@ libvirt_admin_la_LIBADD += \
$(YAJL_LIBS) \
$(DEVMAPPER_LIBS) \
$(LIBXML_LIBS) \
+ $(GLIB_LIBS) \
$(SSH2_LIBS) \
$(SASL_LIBS) \
$(GNUTLS_LIBS) \
@@ -773,6 +775,7 @@ libvirt_iohelper_LDFLAGS = \
$(NULL)
libvirt_iohelper_LDADD = \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
diff --git a/src/access/Makefile.inc.am b/src/access/Makefile.inc.am
index 4dc742f4e5..ea27adbe0b 100644
--- a/src/access/Makefile.inc.am
+++ b/src/access/Makefile.inc.am
@@ -59,7 +59,9 @@ libvirt_driver_access_la_CFLAGS = \
$(AM_CFLAGS) \
$(NULL)
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
-libvirt_driver_access_la_LIBADD =
+libvirt_driver_access_la_LIBADD = \
+ $(GLIB_LIBS) \
+ $(NULL)
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
diff --git a/src/bhyve/Makefile.inc.am b/src/bhyve/Makefile.inc.am
index 195069872a..a881a83c56 100644
--- a/src/bhyve/Makefile.inc.am
+++ b/src/bhyve/Makefile.inc.am
@@ -34,6 +34,7 @@ libvirt_driver_bhyve_la_SOURCES =
libvirt_driver_bhyve_la_LIBADD = \
libvirt_driver_bhyve_impl.la \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
mod_LTLIBRARIES += libvirt_driver_bhyve.la
diff --git a/src/interface/Makefile.inc.am b/src/interface/Makefile.inc.am
index baa85b4ba9..643e041232 100644
--- a/src/interface/Makefile.inc.am
+++ b/src/interface/Makefile.inc.am
@@ -28,6 +28,7 @@ libvirt_driver_interface_la_CFLAGS = \
libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
libvirt_driver_interface_la_LIBADD = \
libvirt.la \
+ $(GLIB_LIBS) \
$(NULL)
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
if WITH_NETCF
diff --git a/src/internal.h b/src/internal.h
index e1a69be9f2..56e99241b0 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <glib.h>
#if STATIC_ANALYSIS
# undef NDEBUG /* Don't let a prior NDEBUG definition cause trouble. */
diff --git a/src/libxl/Makefile.inc.am b/src/libxl/Makefile.inc.am
index c53396b7f3..49c6b4b12f 100644
--- a/src/libxl/Makefile.inc.am
+++ b/src/libxl/Makefile.inc.am
@@ -34,6 +34,7 @@ libvirt_driver_libxl_la_SOURCES =
libvirt_driver_libxl_la_LIBADD = \
libvirt_driver_libxl_impl.la \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
mod_LTLIBRARIES += libvirt_driver_libxl.la
diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am
index fae92a6e45..207aa9d7ef 100644
--- a/src/locking/Makefile.inc.am
+++ b/src/locking/Makefile.inc.am
@@ -103,6 +103,7 @@ lockd_la_CFLAGS = \
lockd_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
lockd_la_LIBADD = \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
augeas_DATA += locking/libvirt_lockd.aug
@@ -145,6 +146,7 @@ virtlockd_LDFLAGS = \
virtlockd_LDADD = \
libvirt.la \
libvirt_driver_admin.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(CYGWIN_EXTRA_LIBADD) \
$(NULL)
@@ -163,7 +165,12 @@ lockdriver_LTLIBRARIES += sanlock.la
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
sanlock_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
-sanlock_la_LIBADD = -lsanlock_client libvirt.la ../gnulib/lib/libgnu.la
+sanlock_la_LIBADD = \
+ -lsanlock_client \
+ libvirt.la \
+ $(GLIB_LIBS) \
+ ../gnulib/lib/libgnu.la \
+ $(NULL)
augeas_DATA += locking/libvirt_sanlock.aug
diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am
index 7e441dbffb..d7cb22f8bc 100644
--- a/src/logging/Makefile.inc.am
+++ b/src/logging/Makefile.inc.am
@@ -82,6 +82,7 @@ virtlogd_LDFLAGS = \
virtlogd_LDADD = \
libvirt_driver_admin.la \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(CYGWIN_EXTRA_LIBADD) \
$(NULL)
diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am
index b4d560702c..0b8d4e5273 100644
--- a/src/lxc/Makefile.inc.am
+++ b/src/lxc/Makefile.inc.am
@@ -83,6 +83,7 @@ libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = \
libvirt_driver_lxc_impl.la \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
mod_LTLIBRARIES += libvirt_driver_lxc.la
@@ -184,10 +185,12 @@ libvirt_lxc_LDFLAGS = \
$(PIE_LDFLAGS) \
$(CAPNG_LIBS) \
$(LIBXML_LIBS) \
+ $(GLIB_LIBS) \
$(NULL)
libvirt_lxc_LDADD = \
libvirt.la \
$(FUSE_LIBS) \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
if WITH_DTRACE_PROBES
@@ -200,6 +203,7 @@ libvirt_lxc_CFLAGS = \
$(PIE_CFLAGS) \
$(CAPNG_CFLAGS) \
$(LIBXML_CFLAGS) \
+ $(GLIB_CFLAGS) \
$(LIBNL_CFLAGS) \
$(FUSE_CFLAGS) \
$(DBUS_CFLAGS) \
diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am
index 17467a65ad..6a1bea7aed 100644
--- a/src/network/Makefile.inc.am
+++ b/src/network/Makefile.inc.am
@@ -32,6 +32,7 @@ libvirt_driver_network_la_SOURCES =
libvirt_driver_network_la_LIBADD = \
libvirt_driver_network_impl.la \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(LIBNL_LIBS) \
$(DBUS_LIBS) \
@@ -121,6 +122,7 @@ libvirt_leaseshelper_LDFLAGS = \
$(NULL)
libvirt_leaseshelper_LDADD = \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la
if WITH_DTRACE_PROBES
libvirt_leaseshelper_LDADD += libvirt_probes.lo
diff --git a/src/node_device/Makefile.inc.am b/src/node_device/Makefile.inc.am
index eac7f92e88..9e07bae839 100644
--- a/src/node_device/Makefile.inc.am
+++ b/src/node_device/Makefile.inc.am
@@ -44,7 +44,10 @@ libvirt_driver_nodedev_la_CFLAGS = \
$(LIBNL_CFLAGS) \
$(NULL)
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
-libvirt_driver_nodedev_la_LIBADD = libvirt.la
+libvirt_driver_nodedev_la_LIBADD = \
+ libvirt.la \
+ $(GLIB_LIBS) \
+ $(NULL)
if WITH_HAL
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
diff --git a/src/nwfilter/Makefile.inc.am b/src/nwfilter/Makefile.inc.am
index 6acb45705c..ceba8558fb 100644
--- a/src/nwfilter/Makefile.inc.am
+++ b/src/nwfilter/Makefile.inc.am
@@ -46,6 +46,7 @@ libvirt_driver_nwfilter_impl_la_LIBADD = \
$(LIBPCAP_LIBS) \
$(LIBNL_LIBS) \
$(DBUS_LIBS) \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
libvirt_driver_nwfilter_impl_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am
index e0e13fb1c3..e66da76c0a 100644
--- a/src/qemu/Makefile.inc.am
+++ b/src/qemu/Makefile.inc.am
@@ -83,6 +83,7 @@ libvirt_driver_qemu_la_SOURCES =
libvirt_driver_qemu_la_LIBADD = \
libvirt_driver_qemu_impl.la \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
mod_LTLIBRARIES += libvirt_driver_qemu.la
diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am
index 5a5c90a922..ae11e6592d 100644
--- a/src/remote/Makefile.inc.am
+++ b/src/remote/Makefile.inc.am
@@ -38,6 +38,7 @@ REMOTE_DAEMON_SOURCES = \
REMOTE_DAEMON_CFLAGS = \
$(LIBXML_CFLAGS) \
+ $(GLIB_CFLAGS) \
$(GNUTLS_CFLAGS) \
$(SASL_CFLAGS) \
$(XDR_CFLAGS) \
@@ -76,6 +77,7 @@ REMOTE_DAEMON_LD_ADD += ../src/libvirt_probes.lo
endif WITH_DTRACE_PROBES
REMOTE_DAEMON_LD_ADD += \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
diff --git a/src/secret/Makefile.inc.am b/src/secret/Makefile.inc.am
index 76bc67418c..41a5e23da2 100644
--- a/src/secret/Makefile.inc.am
+++ b/src/secret/Makefile.inc.am
@@ -33,6 +33,7 @@ libvirt_driver_secret_la_CFLAGS = \
$(NULL)
libvirt_driver_secret_la_LIBADD = \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
libvirt_driver_secret_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
diff --git a/src/security/Makefile.inc.am b/src/security/Makefile.inc.am
index 64e0f46857..6fe9d50f29 100644
--- a/src/security/Makefile.inc.am
+++ b/src/security/Makefile.inc.am
@@ -73,6 +73,7 @@ virt_aa_helper_LDFLAGS = \
virt_aa_helper_LDADD = \
libvirt.la \
libvirt_driver_storage_impl.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
if WITH_DTRACE_PROBES
diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am
index 4dccb14ac1..6d5093b6a0 100644
--- a/src/storage/Makefile.inc.am
+++ b/src/storage/Makefile.inc.am
@@ -136,6 +136,7 @@ libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = \
libvirt_driver_storage_impl.la \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
mod_LTLIBRARIES += libvirt_driver_storage.la
@@ -217,6 +218,7 @@ storagebackend_LTLIBRARIES += libvirt_storage_backend_fs.la
libvirt_storage_backend_fs_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_fs_la_LIBADD = \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
@@ -230,6 +232,7 @@ storagefile_LTLIBRARIES += libvirt_storage_file_fs.la
libvirt_storage_file_fs_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_file_fs_la_LIBADD = \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
endif WITH_STORAGE
@@ -245,6 +248,7 @@ storagebackend_LTLIBRARIES += libvirt_storage_backend_logical.la
libvirt_storage_backend_logical_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_logical_la_LIBADD = \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
endif WITH_STORAGE_LVM
@@ -261,6 +265,7 @@ storagebackend_LTLIBRARIES += libvirt_storage_backend_iscsi.la
libvirt_storage_backend_iscsi_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_iscsi_la_LIBADD = \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
endif WITH_STORAGE_ISCSI
@@ -279,6 +284,7 @@ storagebackend_LTLIBRARIES += libvirt_storage_backend_iscsi-direct.la
libvirt_storage_backend_iscsi_direct_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_iscsi_direct_la_LIBADD = \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(LIBISCSI_LIBS) \
$(NULL)
@@ -295,6 +301,7 @@ storagebackend_LTLIBRARIES += libvirt_storage_backend_scsi.la
libvirt_storage_backend_scsi_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_scsi_la_LIBADD = \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
endif WITH_STORAGE_SCSI
@@ -304,6 +311,7 @@ libvirt_storage_backend_mpath_la_SOURCES =
$(STORAGE_DRIVER_MPATH_SOURCES)
libvirt_storage_backend_mpath_la_LIBADD = \
libvirt.la \
$(DEVMAPPER_LIBS) \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
libvirt_storage_backend_mpath_la_CFLAGS = \
@@ -327,6 +335,7 @@ storagebackend_LTLIBRARIES += libvirt_storage_backend_disk.la
libvirt_storage_backend_disk_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_disk_la_LIBADD = \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
endif WITH_STORAGE_DISK
@@ -336,6 +345,7 @@ libvirt_storage_backend_rbd_la_SOURCES =
$(STORAGE_DRIVER_RBD_SOURCES)
libvirt_storage_backend_rbd_la_LIBADD = \
libvirt.la \
$(LIBRBD_LIBS) \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
libvirt_storage_backend_rbd_la_CFLAGS = \
@@ -368,6 +378,7 @@ storagebackend_LTLIBRARIES += libvirt_storage_backend_sheepdog.la
libvirt_storage_backend_sheepdog_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_sheepdog_la_LIBADD = \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
endif WITH_STORAGE_SHEEPDOG
@@ -378,6 +389,7 @@ libvirt_storage_backend_gluster_la_SOURCES = \
libvirt_storage_backend_gluster_la_LIBADD = \
libvirt.la \
$(GLUSTERFS_LIBS) \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
libvirt_storage_backend_gluster_la_CFLAGS = \
@@ -395,6 +407,7 @@ libvirt_storage_file_gluster_la_SOURCES = \
libvirt_storage_file_gluster_la_LIBADD = \
libvirt.la \
$(GLUSTERFS_LIBS) \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
libvirt_storage_file_gluster_la_CFLAGS = \
@@ -419,6 +432,7 @@ storagebackend_LTLIBRARIES += libvirt_storage_backend_zfs.la
libvirt_storage_backend_zfs_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_zfs_la_LIBADD = \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
endif WITH_STORAGE_ZFS
@@ -435,6 +449,7 @@ storagebackend_LTLIBRARIES += libvirt_storage_backend_vstorage.la
libvirt_storage_backend_vstorage_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_vstorage_la_LIBADD = \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
endif WITH_STORAGE_VSTORAGE
@@ -450,6 +465,7 @@ libvirt_parthelper_LDFLAGS = \
libvirt_parthelper_LDADD = \
$(LIBPARTED_LIBS) \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
if WITH_DTRACE_PROBES
diff --git a/src/vbox/Makefile.inc.am b/src/vbox/Makefile.inc.am
index 178c360b99..35e370ac32 100644
--- a/src/vbox/Makefile.inc.am
+++ b/src/vbox/Makefile.inc.am
@@ -46,6 +46,7 @@ libvirt_driver_vbox_la_SOURCES =
libvirt_driver_vbox_la_LIBADD = \
libvirt_driver_vbox_impl.la \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
mod_LTLIBRARIES += libvirt_driver_vbox.la
diff --git a/src/vz/Makefile.inc.am b/src/vz/Makefile.inc.am
index f56fceb8f7..63fe28be37 100644
--- a/src/vz/Makefile.inc.am
+++ b/src/vz/Makefile.inc.am
@@ -21,6 +21,7 @@ libvirt_driver_vz_la_SOURCES =
libvirt_driver_vz_la_LIBADD = \
libvirt_driver_vz_impl.la \
libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
mod_LTLIBRARIES += libvirt_driver_vz.la
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d88ad7f686..44fe51b83d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -35,6 +35,7 @@ AM_CFLAGS = \
-Dabs_srcdir="\"$(abs_srcdir)\"" \
-Dabs_top_srcdir="\"$(abs_top_srcdir)\"" \
$(LIBXML_CFLAGS) \
+ $(GLIB_CFLAGS) \
$(LIBNL_CFLAGS) \
$(GNUTLS_CFLAGS) \
$(SASL_CFLAGS) \
@@ -72,7 +73,9 @@ LDADDS = \
$(NO_INDIRECT_LDFLAGS) \
$(PROBES_O) \
$(GNULIB_LIBS) \
- ../src/libvirt.la
+ ../src/libvirt.la \
+ $(GLIB_LIBS) \
+ $(NULL)
MOCKLIBS_LIBS = \
$(GNULIB_LIBS) \
@@ -525,7 +528,7 @@ libxlxml2domconfigtest_LDADD = $(libxl_LDADDS) $(LIBXML_LIBS)
libxlmock_la_SOURCES = \
libxlmock.c
-libxlmock_la_CFLAGS = $(LIBXL_CFLAGS) $(LIBXML_CFLAGS)
+libxlmock_la_CFLAGS = $(LIBXL_CFLAGS) $(LIBXML_CFLAGS) $(GLIB_CFLAGS)
libxlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libxlmock_la_LIBADD = $(MOCKLIBS_LIBS)
diff --git a/tools/Makefile.am b/tools/Makefile.am
index ece70384e6..68320c7246 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -36,6 +36,7 @@ AM_CFLAGS = \
$(COVERAGE_CFLAGS) \
$(PIE_CFLAGS) \
$(LIBXML_CFLAGS) \
+ $(GLIB_CFLAGS) \
$(NULL)
AM_LDFLAGS = \
@@ -150,6 +151,7 @@ libvirt_shell_la_LIBADD = \
../src/libvirt.la \
$(LIBXML_LIBS) \
$(READLINE_LIBS) \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
libvirt_shell_la_SOURCES = \
@@ -195,6 +197,7 @@ virt_host_validate_LDFLAGS = \
virt_host_validate_LDADD = \
../src/libvirt.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la \
$(NULL)
@@ -221,6 +224,7 @@ virt_login_shell_helper_LDFLAGS = \
virt_login_shell_helper_LDADD = \
../src/libvirt.la \
../src/libvirt-lxc.la \
+ $(GLIB_LIBS) \
../gnulib/lib/libgnu.la
virt_login_shell_helper_CFLAGS = \
--
2.21.0