summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-10-18 09:38:04 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-10-26 17:29:45 +0530
commitb4ba539ced6d1b6b1941bd824d5d43ad044e7c76 (patch)
tree97213c6e84dbb9480aa12af7c3109a394fb7d204
parent32ae9c6127d21b8408f2573904fec8ab0b666d36 (diff)
downloadgstreamer-b4ba539ced6d1b6b1941bd824d5d43ad044e7c76.tar.gz
build: Apply XCode 8 workaround for iOS too
clock_gettime was also added for iOS 10.0, so don't use it if we're targetting an older version. That would've caused the symbol to not be found at runtime on older devices.
-rw-r--r--configure.ac15
1 files changed, 11 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index b07dbf2c0c..cc51d6581a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -697,14 +697,21 @@ AC_CHECK_FUNC(clock_gettime, [CLOCK_GETTIME_FOUND="yes"], [
# autoconf check does its own prototype declaration that doesn't trigger that
# compiler flag.
#
-# It's only starting from macOS 10.12, that clock_gettime is actually available,
-# so we can unconditionally disable it when targetting older versions.
+# It's only starting from macOS 10.12 and iOS 10.0 that clock_gettime is
+# actually available, so we can unconditionally disable it for older versions.
case "$host_os" in
darwin*)
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <AvailabilityMacros.h>
-#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12
-#error "Not compiling for OS X 10.12 or later"
+#include <TargetConditionals.h>
+#if defined(TARGET_OS_MAC)
+# if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12
+# error "Not compiling for OS X 10.12 or later"
+# endif
+#else
+# if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0
+# error "Not compiling for iOS 10.0 or later"
+# endif
#endif
]])], [], [
if test "$CLOCK_GETTIME_FOUND" = "yes"; then