]> Savannah Git Hosting - gnulib.git/commitdiff
lock tests: Fix build failure on z/OS.
authorBruno Haible <bruno@clisp.org>
Mon, 20 Feb 2017 21:34:24 +0000 (22:34 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 20 Feb 2017 21:34:24 +0000 (22:34 +0100)
Reported by Daniel Richard G. <skunk@iskunk.org>.
* modules/lock-tests (configure.ac): Test for <semaphore.h>.
* tests/test-lock.c (USE_SEMAPHORE): Don't set if <semaphore.h> does not
exist.

ChangeLog
modules/lock-tests
tests/test-lock.c

index 2feb63278794a82d11f7768ccf6ca1261f420551..e5dd80d663dc92adfec72b06e3da30d508304911 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2017-02-20  Bruno Haible  <bruno@clisp.org>
+
+       lock tests: Fix build failure on z/OS.
+       Reported by Daniel Richard G. <skunk@iskunk.org>.
+       * modules/lock-tests (configure.ac): Test for <semaphore.h>.
+       * tests/test-lock.c (USE_SEMAPHORE): Don't set if <semaphore.h> does not
+       exist.
+
 2017-02-19  Bruno Haible  <bruno@clisp.org>
 
        havelib: Prefer the search path of /usr/bin/gcc over the one of $CC.
index b7f1a736633d79564491e58ebd4194f2ea2eeec4..bfab1f4576d8473a707b5b2f8a5150c9b7aa7950 100644 (file)
@@ -8,6 +8,7 @@ usleep
 yield
 
 configure.ac:
+AC_CHECK_HEADERS_ONCE([semaphore.h])
 
 Makefile.am:
 TESTS += test-rwlock1 test-lock
index f3da4ccdfd2468ac8348025da9347cb6f3101bb4..c6bc399f7dec6b451ba572bbe1c17cf5ca98de3c 100644 (file)
@@ -58,7 +58,7 @@
    synchronization/communication between different CPUs.  */
 #define USE_VOLATILE 0
 
-#if USE_POSIX_THREADS
+#if USE_POSIX_THREADS && HAVE_SEMAPHORE_H
 /* Whether to use a semaphore to communicate information between threads.
    If set to 0, a lock is used. If set to 1, a semaphore is used.
    Uncomment this to reduce the dependencies of this test.  */