From 90355270862eb89269feb967da16e61828901284 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 31 Aug 2021 23:51:52 +0200 Subject: configure: Make sure to check properly for pthread_once and pthread_cancel --- configure.ac | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index a9dc0e6..2b5c430 100644 --- a/configure.ac +++ b/configure.ac @@ -56,11 +56,18 @@ case ${host_os} in ;; darwin*) AC_MSG_RESULT([${host_os}]) + AX_PTHREAD([], [AC_MSG_ERROR([pthread is required to build $PACKAGE])]) + AC_CHECK_FUNCS([pthread_once pthread_cancel]) ;; *) AC_MSG_RESULT([${host_os}]) AX_PTHREAD([], [AC_MSG_ERROR([pthread is required to build $PACKAGE_NAME])]) - AC_CHECK_LIB(pthread, [pthread_once], [], [AC_MSG_ERROR([pthread with pthread_once required to build $PACKAGE_NAME])]) + AC_CHECK_FUNC(pthread_cancel, [AC_DEFINE(HAVE_PTHREAD_CANCEL)], [ + AC_CHECK_LIB(pthread, [pthread_cancel],[AC_DEFINE(HAVE_PTHREAD_CANCEL)]) + ]) + AC_CHECK_FUNC(pthread_once, [AC_DEFINE(HAVE_PTHREAD_ONCE)], [ + AC_CHECK_LIB(pthread, [pthread_once], [], [AC_MSG_ERROR([pthread with pthread_once required to build $PACKAGE_NAME])]) + ]) ;; esac AM_CONDITIONAL(WIN32, test x$win32 = xtrue) -- cgit v1.1-32-gdbae