summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac14
-rw-r--r--libusb/version_nano.h2
2 files changed, 13 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 2aaa9e6..d386053 100644
--- a/configure.ac
+++ b/configure.ac
@@ -153,10 +153,20 @@ fi
if test "x$threads" = xposix; then
AC_DEFINE([THREADS_POSIX], [1], [Define to 1 if using POSIX threads.])
- AC_SUBST(THREAD_CFLAGS, [-pthread])
+ dnl Some compilers do not support the '-pthread' option so check for it here
+ saved_CFLAGS="${CFLAGS}"
+ CFLAGS="-Wall -Werror -pthread"
+ AC_MSG_CHECKING([if $CC recognizes -pthread])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
+ [AC_MSG_RESULT([yes])
+ AC_SUBST(THREAD_CFLAGS, [-pthread])],
+ [AC_MSG_RESULT([no])])
+ CFLAGS="${saved_CFLAGS}"
dnl Android Linux and Darwin provide pthread functions directly in libc
dnl glibc also provides some pthread functions directly, so search for a thread-specific function
- AC_SEARCH_LIBS([pthread_key_create], [pthread], [AC_SUBST(THREAD_LIBS, [-lpthread])], [], [])
+ AC_SEARCH_LIBS([pthread_create], [pthread],
+ [test "x$ac_cv_search_pthread_create" != "xnone required" && AC_SUBST(THREAD_LIBS, [-lpthread])],
+ [], [])
elif test "x$threads" = xwindows; then
AC_DEFINE([THREADS_WINDOWS], [1], [Define to 1 if using Windows threads.])
else
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 07b0839..f5243a0 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11488
+#define LIBUSB_NANO 11489