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

[libvirt] [PATCH libvirt 1/3] build: do not build shunloadtest if pthread missing



Fixes build on Windows systems
---
 configure.ac      |    2 ++
 tests/Makefile.am |    8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 89fe818..347c48c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -154,6 +154,8 @@ AC_CHECK_FUNC([clock_gettime],[
 LIBS=$old_libs
 AC_SUBST(RT_LIBS)
 
+AM_CONDITIONAL([HAVE_PTHREAD], [test x"$HAVE_PTHREAD_H" = x"1"])
+
 dnl Availability of various common headers (non-fatal if missing).
 AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/un.h \
   sys/poll.h syslog.h mntent.h net/ethernet.h linux/magic.h \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c4d550f..3d9235c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -98,7 +98,7 @@ test_programs = virshtest sockettest \
 	nodeinfotest virbuftest \
 	commandtest seclabeltest \
 	virhashtest virnetmessagetest virnetsockettest \
-	utiltest virnettlscontexttest shunloadtest \
+	utiltest virnettlscontexttest \
 	virtimetest viruritest virkeyfiletest \
 	virauthconfigtest
 
@@ -106,6 +106,10 @@ test_programs = virshtest sockettest \
 ssh_SOURCES = ssh.c
 ssh_LDADD = $(COVERAGE_LDFLAGS)
 
+if HAVE_PTHREAD
+test_programs += shunloadtest
+endif
+
 if WITH_XEN
 test_programs += xml2sexprtest sexpr2xmltest \
 	xmconfigtest xencapstest statstest reconnect
@@ -527,10 +531,12 @@ 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
 
+if HAVE_PTHREAD
 shunloadtest_SOURCES = \
 	shunloadtest.c
 shunloadtest_LDADD = -lpthread
 shunloadtest_DEPENDENCIES = libshunload.la
+endif
 
 if WITH_CIL
 CILOPTFLAGS =
-- 
1.7.10


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