summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-07-31 08:30:01 -0400
committerNick Mathewson <nickm@torproject.org>2018-07-31 08:30:01 -0400
commit1c85b609d5e3c85c424800da508e80769474cb57 (patch)
tree8cf8d00c21f8637841f8c91b364595da9e026452
parent56fd0249f288998a81d00456416e2e42dea1e246 (diff)
parentbcce3e7e0b53b0d800337c53b855713bfb83c37e (diff)
downloadtor-1c85b609d5e3c85c424800da508e80769474cb57.tar.gz
tor-1c85b609d5e3c85c424800da508e80769474cb57.zip
Merge branch 'maint-0.3.4' into release-0.3.4
-rw-r--r--changes/bug268764
-rw-r--r--configure.ac32
2 files changed, 33 insertions, 3 deletions
diff --git a/changes/bug26876 b/changes/bug26876
new file mode 100644
index 0000000000..b661104236
--- /dev/null
+++ b/changes/bug26876
@@ -0,0 +1,4 @@
+ o Minor bugfixes (portability):
+ - Work around two different bugs in the OS X 10.10 and later SDKs that
+ would prevent us from successfully targeting earlier versions of OS X.
+ Fixes bug 26876; bugfix on 0.3.3.1-alpha.
diff --git a/configure.ac b/configure.ac
index 7f9ae48c97..c6953a0e31 100644
--- a/configure.ac
+++ b/configure.ac
@@ -608,7 +608,6 @@ AC_CHECK_FUNCS(
llround \
localtime_r \
lround \
- mach_approximate_time \
memmem \
memset_s \
mmap \
@@ -635,9 +634,36 @@ AC_CHECK_FUNCS(
_vscprintf
)
-# Apple messed up when they added two functions functions in Sierra: they
+# Apple messed up when they added some functions: 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
+# checks.
+
+# We should only probe for these functions if we are sure that we
+# are not targeting OS X 10.9 or earlier.
+AC_MSG_CHECKING([for a pre-Yosemite OS X build target])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#ifdef __APPLE__
+# include <AvailabilityMacros.h>
+# ifndef MAC_OS_X_VERSION_10_10
+# define MAC_OS_X_VERSION_10_10 101000
+# endif
+# if defined(MAC_OS_X_VERSION_MIN_REQUIRED)
+# if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10
+# error "Running on Mac OS X 10.9 or earlier"
+# endif
+# endif
+#endif
+]], [[]])],
+ [on_macos_pre_10_10=no ; AC_MSG_RESULT([no])],
+ [on_macos_pre_10_10=yes; AC_MSG_RESULT([yes])])
+
+if test "$on_macos_pre_10_10" = "no"; then
+ AC_CHECK_FUNCS(
+ mach_approximate_time \
+ )
+fi
+
+# We should only probe for these functions if we are sure that we
# are not targeting OSX 10.11 or earlier.
AC_MSG_CHECKING([for a pre-Sierra OSX build target])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[