POSIX threads can be available while mutexes are not implemented
This is the odd case of WASI right now
This commit is contained in:
parent
daa6cb3e78
commit
dfa8222d27
25
configure.ac
25
configure.ac
@ -125,12 +125,25 @@ AC_ARG_WITH(pthreads, AC_HELP_STRING([--with-pthreads],
|
|||||||
|
|
||||||
AS_IF([test "x$withval" = "xyes"], [
|
AS_IF([test "x$withval" = "xyes"], [
|
||||||
AX_PTHREAD([
|
AX_PTHREAD([
|
||||||
AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files])
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||||
with_threads="yes"
|
#include <pthread.h>
|
||||||
LIBS="$PTHREAD_LIBS $LIBS"
|
]], [[
|
||||||
PKGCONFIG_LIBS_PRIVATE="$PTHREAD_LIBS $PTHREAD_CFLAGS $PKGCONFIG_LIBS_PRIVATE"
|
pthread_mutex_t mutex;
|
||||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
|
||||||
CC="$PTHREAD_CC"])
|
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"])
|
], [with_threads="no"])
|
||||||
|
|
||||||
AC_ARG_WITH(safecode,
|
AC_ARG_WITH(safecode,
|
||||||
|
Loading…
Reference in New Issue
Block a user