Dynamic loadable modules all need a common set of linker flags
-module -avoid-version $(AM_LDFLAGS)
Bundle those up into a $(AM_LDFLAGS_MOD) to avoid repetition.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/Makefile.am | 69 +++++++++++++++++++++++----------------------------------
1 file changed, 28 insertions(+), 41 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 492bbac22e..335b3a0c81 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -51,6 +51,7 @@ AM_LDFLAGS = $(DRIVER_MODULES_LDFLAGS) \
$(CYGWIN_EXTRA_LDFLAGS) \
$(MINGW_EXTRA_LDFLAGS) \
$(NULL)
+AM_LDFLAGS_MOD = -module -avoid-version $(AM_LDFLAGS)
POD2MAN = pod2man -c "Virtualization Support" -r
"$(PACKAGE)-$(VERSION)"
@@ -1335,7 +1336,7 @@ libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
mod_LTLIBRARIES += libvirt_driver_xen.la
libvirt_driver_xen_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
-libvirt_driver_xen_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
+libvirt_driver_xen_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_driver_xen_impl_la_CFLAGS = \
$(XEN_CFLAGS) \
@@ -1381,7 +1382,7 @@ libvirt_driver_vbox_la_LIBADD = libvirt_driver_vbox_impl.la
mod_LTLIBRARIES += \
libvirt_driver_vbox.la
libvirt_driver_vbox_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
-libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
+libvirt_driver_vbox_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_driver_vbox_impl_la_CFLAGS = \
-I$(srcdir)/conf \
@@ -1410,7 +1411,7 @@ libvirt_driver_libxl_la_SOURCES =
libvirt_driver_libxl_la_LIBADD = libvirt_driver_libxl_impl.la
mod_LTLIBRARIES += libvirt_driver_libxl.la
libvirt_driver_libxl_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
-libvirt_driver_libxl_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
+libvirt_driver_libxl_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_driver_libxl_impl_la_CFLAGS = \
$(LIBXL_CFLAGS) \
@@ -1439,7 +1440,7 @@ libvirt_driver_qemu_la_SOURCES =
libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la
mod_LTLIBRARIES += libvirt_driver_qemu.la
libvirt_driver_qemu_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
-libvirt_driver_qemu_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
+libvirt_driver_qemu_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_driver_qemu_impl_la_CFLAGS = \
$(GNUTLS_CFLAGS) \
@@ -1474,7 +1475,7 @@ libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
mod_LTLIBRARIES += libvirt_driver_lxc.la
libvirt_driver_lxc_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
-libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
+libvirt_driver_lxc_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_driver_lxc_impl_la_CFLAGS = \
$(LIBNL_CFLAGS) \
@@ -1511,7 +1512,7 @@ libvirt_driver_uml_la_SOURCES =
libvirt_driver_uml_la_LIBADD = libvirt_driver_uml_impl.la
mod_LTLIBRARIES += libvirt_driver_uml.la
libvirt_driver_uml_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
-libvirt_driver_uml_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
+libvirt_driver_uml_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_driver_uml_impl_la_CFLAGS = \
-I$(srcdir)/access \
@@ -1583,7 +1584,7 @@ libvirt_driver_vz_la_SOURCES =
libvirt_driver_vz_la_LIBADD = libvirt_driver_vz_impl.la
mod_LTLIBRARIES += libvirt_driver_vz.la
libvirt_driver_vz_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
-libvirt_driver_vz_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
+libvirt_driver_vz_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_driver_vz_impl_la_CFLAGS = \
-I$(srcdir)/conf \
-I$(srcdir)/access \
@@ -1599,7 +1600,7 @@ libvirt_driver_bhyve_la_SOURCES =
libvirt_driver_bhyve_la_LIBADD = libvirt_driver_bhyve_impl.la
mod_LTLIBRARIES += libvirt_driver_bhyve.la
libvirt_driver_bhyve_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
-libvirt_driver_bhyve_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
+libvirt_driver_bhyve_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_driver_bhyve_impl_la_CFLAGS = \
-I$(srcdir)/access \
@@ -1625,7 +1626,7 @@ libvirt_driver_network_la_LIBADD += libvirt.la
../gnulib/lib/libgnu.la \
$(LIBNL_LIBS) \
$(DBUS_LIBS) \
$(NULL)
-libvirt_driver_network_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
+libvirt_driver_network_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_driver_network_impl_la_CFLAGS = \
$(LIBNL_CFLAGS) \
@@ -1645,7 +1646,7 @@ libvirt_driver_interface_la_CFLAGS = \
-I$(srcdir)/access \
-I$(srcdir)/conf \
$(AM_CFLAGS) $(LIBNL_CFLAGS)
-libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS)
+libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_driver_interface_la_LIBADD =
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
@@ -1656,7 +1657,6 @@ libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
endif WITH_UDEV
libvirt_driver_interface_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
-libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
endif WITH_INTERFACE
@@ -1667,7 +1667,7 @@ libvirt_driver_secret_la_CFLAGS = \
-I$(srcdir)/conf \
$(AM_CFLAGS)
libvirt_driver_secret_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
-libvirt_driver_secret_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
+libvirt_driver_secret_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
endif WITH_SECRETS
@@ -1695,7 +1695,7 @@ libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
mod_LTLIBRARIES += libvirt_driver_storage.la
libvirt_driver_storage_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
-libvirt_driver_storage_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
+libvirt_driver_storage_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
@@ -1705,8 +1705,7 @@ libvirt_storage_backend_fs_la_CFLAGS = \
$(AM_CFLAGS)
storagebackend_LTLIBRARIES += libvirt_storage_backend_fs.la
-libvirt_storage_backend_fs_la_LDFLAGS = \
- -module -avoid-version $(AM_LDFLAGS)
+libvirt_storage_backend_fs_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_fs_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
endif WITH_STORAGE
@@ -1718,8 +1717,7 @@ libvirt_storage_backend_logical_la_CFLAGS = \
$(AM_CFLAGS)
storagebackend_LTLIBRARIES += libvirt_storage_backend_logical.la
-libvirt_storage_backend_logical_la_LDFLAGS = \
- -module -avoid-version $(AM_LDFLAGS)
+libvirt_storage_backend_logical_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_logical_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
endif WITH_STORAGE_LVM
@@ -1732,8 +1730,7 @@ libvirt_storage_backend_iscsi_la_CFLAGS = \
$(AM_CFLAGS)
storagebackend_LTLIBRARIES += libvirt_storage_backend_iscsi.la
-libvirt_storage_backend_iscsi_la_LDFLAGS = \
- -module -avoid-version $(AM_LDFLAGS)
+libvirt_storage_backend_iscsi_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_iscsi_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
endif WITH_STORAGE_ISCSI
@@ -1744,8 +1741,7 @@ libvirt_storage_backend_scsi_la_CFLAGS = \
$(AM_CFLAGS)
storagebackend_LTLIBRARIES += libvirt_storage_backend_scsi.la
-libvirt_storage_backend_scsi_la_LDFLAGS = \
- -module -avoid-version $(AM_LDFLAGS)
+libvirt_storage_backend_scsi_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_scsi_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
endif WITH_STORAGE_SCSI
@@ -1759,8 +1755,7 @@ libvirt_storage_backend_mpath_la_CFLAGS = \
$(AM_CFLAGS)
storagebackend_LTLIBRARIES += libvirt_storage_backend_mpath.la
-libvirt_storage_backend_mpath_la_LDFLAGS = \
- -module -avoid-version $(AM_LDFLAGS)
+libvirt_storage_backend_mpath_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_mpath_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
endif WITH_STORAGE_MPATH
@@ -1771,8 +1766,7 @@ libvirt_storage_backend_disk_la_CFLAGS = \
$(AM_CFLAGS)
storagebackend_LTLIBRARIES += libvirt_storage_backend_disk.la
-libvirt_storage_backend_disk_la_LDFLAGS = \
- -module -avoid-version $(AM_LDFLAGS)
+libvirt_storage_backend_disk_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_disk_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
endif WITH_STORAGE_DISK
@@ -1785,8 +1779,7 @@ libvirt_storage_backend_rbd_la_CFLAGS = \
$(AM_CFLAGS)
storagebackend_LTLIBRARIES += libvirt_storage_backend_rbd.la
-libvirt_storage_backend_rbd_la_LDFLAGS = \
- -module -avoid-version $(AM_LDFLAGS)
+libvirt_storage_backend_rbd_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_rbd_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
endif WITH_STORAGE_RBD
@@ -1806,8 +1799,7 @@ libvirt_storage_backend_sheepdog_priv_la_CFLAGS = \
noinst_LTLIBRARIES += libvirt_storage_backend_sheepdog_priv.la
storagebackend_LTLIBRARIES += libvirt_storage_backend_sheepdog.la
-libvirt_storage_backend_sheepdog_la_LDFLAGS = \
- -module -avoid-version $(AM_LDFLAGS)
+libvirt_storage_backend_sheepdog_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_sheepdog_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
endif WITH_STORAGE_SHEEPDOG
@@ -1821,8 +1813,7 @@ libvirt_storage_backend_gluster_la_CFLAGS = \
$(AM_CFLAGS)
storagebackend_LTLIBRARIES += libvirt_storage_backend_gluster.la
-libvirt_storage_backend_gluster_la_LDFLAGS = \
- -module -avoid-version $(AM_LDFLAGS)
+libvirt_storage_backend_gluster_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_gluster_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
endif WITH_STORAGE_GLUSTER
@@ -1833,8 +1824,7 @@ libvirt_storage_backend_zfs_la_CFLAGS = \
$(AM_CFLAGS)
storagebackend_LTLIBRARIES += libvirt_storage_backend_zfs.la
-libvirt_storage_backend_zfs_la_LDFLAGS = \
- -module -avoid-version $(AM_LDFLAGS)
+libvirt_storage_backend_zfs_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_zfs_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
endif WITH_STORAGE_ZFS
@@ -1846,8 +1836,7 @@ libvirt_storage_backend_vstorage_la_CFLAGS = \
$(AM_CFLAGS)
storagebackend_LTLIBRARIES += libvirt_storage_backend_vstorage.la
-libvirt_storage_backend_vstorage_la_LDFLAGS = \
- -module -avoid-version $(AM_LDFLAGS)
+libvirt_storage_backend_vstorage_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_storage_backend_vstorage_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
endif WITH_STORAGE_VSTORAGE
@@ -1860,7 +1849,7 @@ libvirt_driver_nodedev_la_CFLAGS = \
-I$(srcdir)/access \
-I$(srcdir)/conf \
$(AM_CFLAGS) $(LIBNL_CFLAGS)
-libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS)
+libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_driver_nodedev_la_LIBADD =
if WITH_LIBVIRTD
@@ -1877,7 +1866,6 @@ endif WITH_UDEV
endif WITH_LIBVIRTD
libvirt_driver_nodedev_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
-libvirt_driver_nodedev_la_LDFLAGS += -module -avoid-version
endif WITH_NODE_DEVICES
@@ -1886,7 +1874,7 @@ noinst_LTLIBRARIES += libvirt_driver_nwfilter_impl.la
libvirt_driver_nwfilter_la_SOURCES =
libvirt_driver_nwfilter_la_LIBADD = libvirt_driver_nwfilter_impl.la
mod_LTLIBRARIES += libvirt_driver_nwfilter.la
-libvirt_driver_nwfilter_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
+libvirt_driver_nwfilter_la_LDFLAGS = $(AM_LDFLAGS_MOD)
libvirt_driver_nwfilter_impl_la_CFLAGS = \
$(LIBPCAP_CFLAGS) \
$(LIBNL_CFLAGS) \
@@ -1900,7 +1888,6 @@ libvirt_driver_nwfilter_impl_la_LIBADD = \
$(LIBNL_LIBS) \
$(DBUS_LIBS)
libvirt_driver_nwfilter_impl_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
-libvirt_driver_nwfilter_impl_la_LDFLAGS += -module -avoid-version
libvirt_driver_nwfilter_impl_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
endif WITH_NWFILTER
@@ -2576,7 +2563,7 @@ lockd_la_SOURCES = \
lockd_la_CFLAGS = -I$(srcdir)/conf \
$(XDR_CFLAGS) \
$(AM_CFLAGS)
-lockd_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
+lockd_la_LDFLAGS = $(AM_LDFLAGS_MOD)
lockd_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
augeas_DATA += locking/libvirt_lockd.aug
if WITH_DTRACE_PROBES
@@ -2855,7 +2842,7 @@ if WITH_SANLOCK
lockdriver_LTLIBRARIES += sanlock.la
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
-sanlock_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
+sanlock_la_LDFLAGS = $(AM_LDFLAGS_MOD)
sanlock_la_LIBADD = -lsanlock_client libvirt.la ../gnulib/lib/libgnu.la
augeas_DATA += locking/libvirt_sanlock.aug
--
2.14.3