mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
POSIX threads can be available while mutexes are not implemented
This is the odd case of WASI right now
This commit is contained in:
+19
-6
@@ -121,12 +121,25 @@ AC_ARG_WITH(pthreads, AC_HELP_STRING([--with-pthreads],
|
||||
|
||||
AS_IF([test "x$withval" = "xyes"], [
|
||||
AX_PTHREAD([
|
||||
AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files])
|
||||
with_threads="yes"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
PKGCONFIG_LIBS_PRIVATE="$PTHREAD_LIBS $PTHREAD_CFLAGS $PKGCONFIG_LIBS_PRIVATE"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
CC="$PTHREAD_CC"])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <pthread.h>
|
||||
]], [[
|
||||
pthread_mutex_t mutex;
|
||||
|
||||
pthread_mutex_lock(&mutex);
|
||||
pthread_mutex_unlock(&mutex);
|
||||
]]
|
||||
)], [
|
||||
AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files])
|
||||
with_threads="yes"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
PKGCONFIG_LIBS_PRIVATE="$PTHREAD_LIBS $PTHREAD_CFLAGS $PKGCONFIG_LIBS_PRIVATE"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
CC="$PTHREAD_CC"
|
||||
])
|
||||
],
|
||||
[ AC_MSG_NOTICE(pthread mutexes are not available) ]
|
||||
)
|
||||
], [with_threads="no"])
|
||||
|
||||
AC_ARG_WITH(safecode,
|
||||
|
||||
Reference in New Issue
Block a user