Force configure to check -lpthread
GCC requires -lpthread in order to link the shared library against the
pthread library. By default the AX_PTHREAD macro only outputs the
pthread flag for GCC. Changed to force AX_PTHREAD to check -lpthread.
@@ -82,8 +82,16 @@ LIBS="$LIBS $cryptopp_LIBS"
CPPFLAGS="-DKVZ_DLL_EXPORTS $CPPFLAGS"
+# We need to force AX_PTHREAD to check -pthread -lpthread since otherwise
+# it only outputs -pthread for GCC. Without -lpthread GCC does not link the
+# shared library against the pthread library (even though it does link the
+# executable).
+PTHREAD_CFLAGS=-pthread
+PTHREAD_LIBS=-lpthread
+
# This does workarounds for pthreads on various compilers.
-AX_PTHREAD
+AX_PTHREAD([],[AC_MSG_ERROR([POSIX threads not found])])
+
CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
CC="$PTHREAD_CC"
