summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2015-10-26 12:14:11 +0100
committerLukas Slebodnik <lslebodn@redhat.com>2015-10-26 13:19:20 +0100
commitf775337a7d4ca1c0be8eab683d0d753cbaee49e2 (patch)
treeafff0ccf40cb687a0a4eee0d62cc633b718b91c7
parent8fe87c3d35bf301cbb6ed7d441b588327d831924 (diff)
downloadsssd-f775337a7d4ca1c0be8eab683d0d753cbaee49e2.tar.gz
sssd-f775337a7d4ca1c0be8eab683d0d753cbaee49e2.tar.xz
sssd-f775337a7d4ca1c0be8eab683d0d753cbaee49e2.zip
BUILD: Fix detection of pthread with strict CFLAGS
If the configure was called with stricter flags (-Werror=unused-variable) then configure script did not detect tread safe initialisation. As a result of this client code was not build with mutexes. conftest.c: In function 'main': conftest.c:39:17: error: unused variable 'm' [-Werror=unused-variable] pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; ^ cc1: all warnings being treated as errors configure:15331: $? = 1 configure:15338: WARNING: Pthread library not found! Clients will not be thread safe... Reviewed-by: Pavel Březina <pbrezina@redhat.com>
-rw-r--r--configure.ac4
1 files changed, 3 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index c6debe20a..e699e30dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,7 +50,9 @@ BUILD_WITH_SHARED_BUILD_DIR
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <pthread.h>]],
- [[pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;]])],
+ [[pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
+ (void) m; /* unused */
+ ]])],
[AC_DEFINE([HAVE_PTHREAD], [1], [Pthread mutexes available.])
HAVE_PTHREAD=1
],