]> git.proxmox.com Git - mirror_frr.git/commitdiff
build: fix pthread CFLAGS for function checks
authorDavid Lamparter <equinox@opensourcerouting.org>
Tue, 27 Apr 2021 13:11:33 +0000 (15:11 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Tue, 27 Apr 2021 13:11:33 +0000 (15:11 +0200)
The pthread_* checks for extra pthread features really need
PTHREAD_CFLAGS...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
configure.ac

index a770a78105f08e931f0f611b153cc1caf6c6225f..f9fa8e07137e2fb07b3f590e5734d07a51aa9ee4 100644 (file)
@@ -459,6 +459,9 @@ AX_PTHREAD([
   AC_MSG_FAILURE([This FRR version needs pthreads])
 ])
 
+orig_cflags="$CFLAGS"
+CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
 AC_SEARCH_LIBS([pthread_condattr_setclock], [],
                [frr_cv_pthread_condattr_setclock=yes],
                [frr_cv_pthread_condattr_setclock=no])
@@ -466,6 +469,13 @@ if test "$frr_cv_pthread_condattr_setclock" = "yes"; then
   AC_DEFINE([HAVE_PTHREAD_CONDATTR_SETCLOCK], [1], [Have pthread.h pthread_condattr_setclock])
 fi
 
+AC_CHECK_HEADERS([pthread_np.h],,, [
+#include <pthread.h>
+])
+AC_CHECK_FUNCS([pthread_setname_np pthread_set_name_np pthread_getthreadid_np])
+
+CFLAGS="$orig_cflags"
+
 dnl --------------
 dnl Check programs
 dnl --------------
@@ -1041,11 +1051,6 @@ int main(int argc, char **argv) {
   ])
 ])
 
-AC_CHECK_HEADERS([pthread_np.h],,, [
-#include <pthread.h>
-])
-AC_CHECK_FUNCS([pthread_setname_np pthread_set_name_np pthread_getthreadid_np])
-
 needsync=true
 
 AS_IF([$needsync], [