summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2021-08-31 23:51:52 +0200
committerGravatar Nikias Bassen2021-08-31 23:51:52 +0200
commit90355270862eb89269feb967da16e61828901284 (patch)
tree76dfa32934f75e0388df7d1b3d5cf3791ef4f61e /configure.ac
parent0c91d155aa4d7b53717e546776d87d8427e59de4 (diff)
downloadlibimobiledevice-glue-90355270862eb89269feb967da16e61828901284.tar.gz
libimobiledevice-glue-90355270862eb89269feb967da16e61828901284.tar.bz2
configure: Make sure to check properly for pthread_once and pthread_cancel
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac9
1 files changed, 8 insertions, 1 deletions
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)