build: fix pthread CFLAGS for function checks

The pthread_* checks for extra pthread features really need
PTHREAD_CFLAGS...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
David Lamparter 2021-04-27 15:11:33 +02:00
parent 2ccc493333
commit f1d85301f3

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