summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-12-01 10:05:38 -0500
committerNick Mathewson <nickm@torproject.org>2016-12-01 10:05:38 -0500
commit2cc900e74acd59ac5250b0b58f3b3f6a06665e2e (patch)
tree50e3a6df948623050420230f7a1f3c1cd4e5421d
parent91f06ba2806cf4f1d714072aee8b9f069dc61d92 (diff)
parent16fcbd21c963a9a65bf55024680c8323c8b7175d (diff)
downloadtor-2cc900e74acd59ac5250b0b58f3b3f6a06665e2e.tar.gz
tor-2cc900e74acd59ac5250b0b58f3b3f6a06665e2e.zip
Merge branch 'maint-0.2.8' into release-0.2.8
-rw-r--r--changes/bug202354
-rw-r--r--configure.ac30
2 files changed, 32 insertions, 2 deletions
diff --git a/changes/bug20235 b/changes/bug20235
new file mode 100644
index 0000000000..54026a8943
--- /dev/null
+++ b/changes/bug20235
@@ -0,0 +1,4 @@
+ o Minor features (compatibility):
+ - Work around a bug in the OSX 10.12 SDK that would prevent us
+ from successfully targetting earlier versions of OSX.
+ Resolves ticket 20235.
diff --git a/configure.ac b/configure.ac
index fb91f34246..6647523e0b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -394,14 +394,12 @@ AC_CHECK_FUNCS(
accept4 \
backtrace \
backtrace_symbols_fd \
- clock_gettime \
eventfd \
explicit_bzero \
timingsafe_memcmp \
flock \
ftime \
getaddrinfo \
- getentropy \
getifaddrs \
getpass \
getrlimit \
@@ -438,6 +436,34 @@ AC_CHECK_FUNCS(
_vscprintf
)
+# Apple messed up when they added two functions functions in Sierra: they
+# forgot to decorate them with appropriate AVAILABLE_MAC_OS_VERSION
+# checks. So we should only probe for those functions if we are sure that we
+# are not targetting OSX 10.11 or earlier.
+AC_MSG_CHECKING([for a pre-Sierra OSX build target])
+AC_TRY_COMPILE([
+#ifdef __APPLE__
+# include <AvailabilityMacros.h>
+# ifndef MAC_OS_VERSION_10_12
+# define MAC_OS_VERSION_10_12 101200
+# endif
+# if defined(MAC_OS_X_VERSION_MIN_REQUIRED)
+# if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_VERSION_10_12
+# error "Running on Mac OSX 10.11 or earlier"
+# endif
+# endif
+#endif
+], [],
+ [on_macos_pre_10_12=no ; AC_MSG_RESULT([no])],
+ [on_macos_pre_10_12=yes; AC_MSG_RESULT([yes])])
+
+if test "$on_macos_pre_10_12" = "no"; then
+ AC_CHECK_FUNCS(
+ clock_gettime \
+ getentropy \
+ )
+fi
+
if test "$bwin32" != "true"; then
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_FUNCS(pthread_create)