summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-08-23 14:58:10 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-08-23 15:27:06 +0200
commit619d0c3232af45ba46864e7e96176dc096e78592 (patch)
tree028264a2a70526c63da19fcbc4a2f06117f4b4c8
parentc90f6c8b51f9bb7db2f8a26f7a59f88552ed0beb (diff)
downloadgnutls-619d0c3232af45ba46864e7e96176dc096e78592.tar.gz
configure: do not link with pthread unless necessary
-rw-r--r--lib/configure.ac20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/configure.ac b/lib/configure.ac
index b20005a3ff..e638c406fe 100644
--- a/lib/configure.ac
+++ b/lib/configure.ac
@@ -61,6 +61,18 @@ AC_CHECK_TYPE(ssize_t,
#include <sys/types.h>
])
+case "$host" in
+ *mingw32* | *mingw64*)
+ have_win=yes
+ ;;
+ *darwin*)
+ have_macosx=yes
+ ;;
+ *)
+ have_elf=yes
+ ;;
+esac
+
# For minitasn1.
AC_CHECK_SIZEOF(unsigned long int, 4)
AC_CHECK_SIZEOF(unsigned int, 4)
@@ -125,7 +137,13 @@ fi
lgl_INIT
AC_CHECK_FUNCS(getrusage,,)
-AC_LIB_HAVE_LINKFLAGS(pthread,, [#include <pthread.h>], [pthread_mutex_lock (0);])
+
+if test "$have_win" != "yes";then
+ AC_CHECK_FUNCS([pthread_mutex_lock],,)
+ if test "$ac_cv_func_pthread_mutex_lock" != "yes";then
+ AC_LIB_HAVE_LINKFLAGS(pthread,, [#include <pthread.h>], [pthread_mutex_lock (0);])
+ fi
+fi
LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBS"
LIBGNUTLS_CFLAGS="-I${includedir}"