[PATCH] Cleanup parameters for mock libraries

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

 



All the libraries use same parameters when building, why not have it in
one place at the begining of the Makefile.

This will also ensure no new mock library will have a problem with
missing e.g. MINGW_EXTRA_LDFLAGS.

Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 tests/Makefile.am | 58 +++++++++++++++++--------------------------------------
 1 file changed, 18 insertions(+), 40 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 03c2c8a..dc7daaa 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in

-## Copyright (C) 2005-2014 Red Hat, Inc.
+## Copyright (C) 2005-2015 Red Hat, Inc.
 ##
 ## This library is free software; you can redistribute it and/or
 ## modify it under the terms of the GNU Lesser General Public
@@ -47,6 +47,10 @@ AM_CFLAGS = \
 AM_LDFLAGS = \
 	-export-dynamic

+MOCKLIBS_LDFLAGS = -module -avoid-version \
+	-rpath /evil/libtool/hack/to/force/shared/lib/creation \
+	$(MINGW_EXTRA_LDFLAGS)
+
 if WITH_DRIVER_MODULES
 INCLUDES += \
 	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
@@ -552,9 +556,7 @@ qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LDADDS) $(LIBXML_LIBS)
 qemuxml2argvmock_la_SOURCES = \
 	qemuxml2argvmock.c
 qemuxml2argvmock_la_CFLAGS = $(AM_CFLAGS)
-qemuxml2argvmock_la_LDFLAGS = -module -avoid-version \
-	-rpath /evil/libtool/hack/to/force/shared/lib/creation \
-	$(MINGW_EXTRA_LDFLAGS)
+qemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)

 qemuxml2xmltest_SOURCES = \
 	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
@@ -614,9 +616,7 @@ qemucaps2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
 qemucaps2xmlmock_la_SOURCES = \
 	qemucaps2xmlmock.c
 qemucaps2xmlmock_la_CFLAGS = $(AM_CFLAGS)
-qemucaps2xmlmock_la_LDFLAGS = -module -avoid-version \
-		-rpath /evil/libtool/hack/to/force/shared/lib/creation \
-		$(MINGW_EXTRA_LDFLAGS)
+qemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)

 qemuagenttest_SOURCES = \
 	qemuagenttest.c \
@@ -723,9 +723,7 @@ if WITH_BHYVE
 bhyvexml2argvmock_la_SOURCES = \
 	bhyvexml2argvmock.c
 bhyvexml2argvmock_la_CFLAGS = $(AM_CFLAGS)
-bhyvexml2argvmock_la_LDFLAGS = -module -avoid-version \
-			-rpath /evil/libtool/hack/to/force/shared/lib/creation \
-			$(MINGW_EXTRA_LDFLAGS)
+bhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)

 bhyve_LDADDS = ../src/libvirt_driver_bhyve_impl.la
 if WITH_STORAGE
@@ -932,9 +930,7 @@ virnetserverclienttest_LDADD = $(LDADDS)
 virnetserverclientmock_la_SOURCES = \
 	virnetserverclientmock.c
 virnetserverclientmock_la_CFLAGS = $(AM_CFLAGS)
-virnetserverclientmock_la_LDFLAGS = -module -avoid-version \
-        -rpath /evil/libtool/hack/to/force/shared/lib/creation \
-	$(MINGW_EXTRA_LDFLAGS)
+virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)

 if WITH_GNUTLS
 virnettlscontexttest_SOURCES = \
@@ -1012,9 +1008,7 @@ virportallocatortest_LDADD = $(LDADDS)
 libvirportallocatormock_la_SOURCES = \
 	virportallocatortest.c
 libvirportallocatormock_la_CFLAGS = $(AM_CFLAGS) -DMOCK_HELPER=1
-libvirportallocatormock_la_LDFLAGS = -module -avoid-version \
-        -rpath /evil/libtool/hack/to/force/shared/lib/creation \
-	$(MINGW_EXTRA_LDFLAGS)
+libvirportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)

 vircgrouptest_SOURCES = \
 	vircgrouptest.c testutils.h testutils.c
@@ -1023,9 +1017,7 @@ vircgrouptest_LDADD = $(LDADDS)
 vircgroupmock_la_SOURCES = \
 	vircgroupmock.c
 vircgroupmock_la_CFLAGS = $(AM_CFLAGS)
-vircgroupmock_la_LDFLAGS = -module -avoid-version \
-        -rpath /evil/libtool/hack/to/force/shared/lib/creation \
-	$(MINGW_EXTRA_LDFLAGS)
+vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)

 vircryptotest_SOURCES = \
 	vircryptotest.c testutils.h testutils.c
@@ -1044,9 +1036,7 @@ virpcimock_la_SOURCES = \
 virpcimock_la_CFLAGS = $(AM_CFLAGS)
 virpcimock_la_LIBADD = $(GNULIB_LIBS) \
 					   ../src/libvirt.la
-virpcimock_la_LDFLAGS = -module -avoid-version \
-        -rpath /evil/libtool/hack/to/force/shared/lib/creation \
-	$(MINGW_EXTRA_LDFLAGS)
+virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)

 virnetdevtest_SOURCES = \
 	virnetdevtest.c testutils.h testutils.c
@@ -1058,9 +1048,7 @@ virnetdevmock_la_SOURCES = \
 virnetdevmock_la_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
 virnetdevmock_la_LIBADD = $(GNULIB_LIBS) \
 					   ../src/libvirt.la
-virnetdevmock_la_LDFLAGS = -module -avoid-version \
-        -rpath /evil/libtool/hack/to/force/shared/lib/creation \
-	$(MINGW_EXTRA_LDFLAGS)
+virnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)

 if WITH_LINUX
 virusbtest_SOURCES = \
@@ -1073,16 +1061,12 @@ virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

 virusbmock_la_SOURCES = virusbmock.c
 virusbmock_la_CFLAGS = $(AM_CFLAGS)
-virusbmock_la_LDFLAGS = -module -avoid-version \
-        -rpath /evil/libtool/hack/to/force/shared/lib/creation \
-	$(MINGW_EXTRA_LDFLAGS)
+virusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)

 virnetdevbandwidthmock_la_SOURCES = \
 	virnetdevbandwidthmock.c
 virnetdevbandwidthmock_la_CFLAGS = $(AM_CFLAGS)
-virnetdevbandwidthmock_la_LDFLAGS = -module -avoid-version \
-        -rpath /evil/libtool/hack/to/force/shared/lib/creation \
-	$(MINGW_EXTRA_LDFLAGS)
+virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)

 else ! WITH_LINUX
 	EXTRA_DIST += virusbtest.c virusbmock.c \
@@ -1098,9 +1082,7 @@ virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
 virmockdbus_la_SOURCES = \
 	virmockdbus.c
 virmockdbus_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
-virmockdbus_la_LDFLAGS = -module -avoid-version \
-        -rpath /evil/libtool/hack/to/force/shared/lib/creation \
-	$(MINGW_EXTRA_LDFLAGS)
+virmockdbus_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)

 virpolkittest_SOURCES = \
 	virpolkittest.c testutils.h testutils.c
@@ -1146,9 +1128,7 @@ endif ! WITH_TESTS

 libsecurityselinuxhelper_la_SOURCES = \
 	securityselinuxhelper.c
-libsecurityselinuxhelper_la_LDFLAGS = -module -avoid-version \
-        -rpath /evil/libtool/hack/to/force/shared/lib/creation \
-	$(MINGW_EXTRA_LDFLAGS)
+libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)

 securityselinuxtest_SOURCES = \
 	securityselinuxtest.c testutils.h testutils.c
@@ -1220,9 +1200,7 @@ endif WITH_LIBVIRTD

 libshunload_la_SOURCES = shunloadhelper.c
 libshunload_la_LIBADD = ../src/libvirt.la
-libshunload_la_LDFLAGS = -module -avoid-version \
-	-rpath /evil/libtool/hack/to/force/shared/lib/creation \
-	$(MINGW_EXTRA_LDFLAGS)
+libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)

 shunloadtest_SOURCES = \
 	shunloadtest.c
-- 
2.3.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[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]