summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac28
-rw-r--r--libusb/version_nano.h2
2 files changed, 25 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 5b880f6..7c86598 100644
--- a/configure.ac
+++ b/configure.ac
@@ -199,17 +199,37 @@ dnl headers not available on all platforms but required on others
AC_CHECK_HEADERS([sys/time.h])
if test "x$platform" = xposix; then
- dnl the clock_gettime() function needs certain clock IDs defined
- AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes], [have_clock_gettime=])
+ dnl check availability of clock_gettime()
+ if test "x$backend" = xdarwin; then
+ dnl need to verify that OS X target is 10.12 or later for clock_gettime()
+ AC_MSG_CHECKING([whether OS X target version is 10.12 or later])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+ #include <AvailabilityMacros.h>
+ #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12
+ # error "Target OS X version is too old"
+ #endif
+ ], [])],
+ [AC_MSG_RESULT([yes])
+ osx_10_12_or_later=yes],
+ [AC_MSG_RESULT([no])
+ osx_10_12_or_later=])
+ if test "x$osx_10_12_or_later" = xyes; then
+ AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes], [have_clock_gettime=])
+ else
+ AC_MSG_NOTICE([clock_gettime() is not available on target OS X version])
+ fi
+ else
+ AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes], [AC_MSG_ERROR([clock_gettime() is required on this platform])])
+ fi
+
if test "x$have_clock_gettime" = xyes; then
+ dnl the clock_gettime() function needs certain clock IDs defined
AC_CHECK_DECL([CLOCK_MONOTONIC], [], [AC_MSG_ERROR([C library headers missing definition for CLOCK_MONOTONIC])], [[#include <time.h>]])
dnl use the monotonic clock for condition variable timed waits if possible
AC_CHECK_FUNCS([pthread_condattr_setclock], [need_clock_realtime=], [need_clock_realtime=yes])
if test "x$need_clock_realtime" = xyes; then
AC_CHECK_DECL([CLOCK_REALTIME], [], [AC_MSG_ERROR([C library headers missing definition for CLOCK_REALTIME])], [[#include <time.h>]])
fi
- elif test "x$backend" != xdarwin; then
- AC_MSG_ERROR([clock_gettime() is required on this platform])
fi
fi
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index e7da9f6..b8e72d6 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11597
+#define LIBUSB_NANO 11598