From 619d0c3232af45ba46864e7e96176dc096e78592 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Tue, 23 Aug 2016 14:58:10 +0200 Subject: configure: do not link with pthread unless necessary --- lib/configure.ac | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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 ]) +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_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_mutex_lock (0);]) + fi +fi LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBS" LIBGNUTLS_CFLAGS="-I${includedir}" -- cgit v1.2.1