1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 18:15:18 -07:00
This commit is contained in:
Frank Denis 2019-03-30 11:25:40 +01:00
parent dfa8222d27
commit eebf2255ca
2 changed files with 34 additions and 6 deletions

38
configure vendored
View File

@ -5460,17 +5460,45 @@ test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test "x$ax_pthread_ok" = "xyes"; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <pthread.h>
int
main ()
{
pthread_mutex_t mutex;
pthread_mutex_lock(&mutex);
pthread_mutex_unlock(&mutex)
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h
with_threads="yes"
LIBS="$PTHREAD_LIBS $LIBS"
PKGCONFIG_LIBS_PRIVATE="$PTHREAD_LIBS $PTHREAD_CFLAGS $PKGCONFIG_LIBS_PRIVATE"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
with_threads="yes"
LIBS="$PTHREAD_LIBS $LIBS"
PKGCONFIG_LIBS_PRIVATE="$PTHREAD_LIBS $PTHREAD_CFLAGS $PKGCONFIG_LIBS_PRIVATE"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
:
else
ax_pthread_ok=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: pthread mutexes are not available" >&5
$as_echo "$as_me: pthread mutexes are not available" >&6;}
fi
ac_ext=c

View File

@ -131,7 +131,7 @@ AS_IF([test "x$withval" = "xyes"], [
pthread_mutex_t mutex;
pthread_mutex_lock(&mutex);
pthread_mutex_unlock(&mutex);
pthread_mutex_unlock(&mutex)
]]
)], [
AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files])