mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Try to work around breakage in the OSX 10.12 SDK.
Apple is supposed to decorate their function declarations with macros to indicate which OSX version introduced them, so that you can tell the compiler that you want to build against certain versions of OSX. But they forgot to do that for clock_gettime() and getentropy(), both of which they introduced in 10.12. This patch adds a kludge to the configure.ac script where, if we detect that we are targeting OSX 10.11 or earlier, we don't even probe to see if the two offending functions are present. Closes ticket 20235.
This commit is contained in:
parent
2639fd08e7
commit
16fcbd21c9
4
changes/bug20235
Normal file
4
changes/bug20235
Normal file
@ -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.
|
30
configure.ac
30
configure.ac
@ -394,14 +394,12 @@ AC_CHECK_FUNCS(
|
|||||||
accept4 \
|
accept4 \
|
||||||
backtrace \
|
backtrace \
|
||||||
backtrace_symbols_fd \
|
backtrace_symbols_fd \
|
||||||
clock_gettime \
|
|
||||||
eventfd \
|
eventfd \
|
||||||
explicit_bzero \
|
explicit_bzero \
|
||||||
timingsafe_memcmp \
|
timingsafe_memcmp \
|
||||||
flock \
|
flock \
|
||||||
ftime \
|
ftime \
|
||||||
getaddrinfo \
|
getaddrinfo \
|
||||||
getentropy \
|
|
||||||
getifaddrs \
|
getifaddrs \
|
||||||
getpass \
|
getpass \
|
||||||
getrlimit \
|
getrlimit \
|
||||||
@ -438,6 +436,34 @@ AC_CHECK_FUNCS(
|
|||||||
_vscprintf
|
_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
|
if test "$bwin32" != "true"; then
|
||||||
AC_CHECK_HEADERS(pthread.h)
|
AC_CHECK_HEADERS(pthread.h)
|
||||||
AC_CHECK_FUNCS(pthread_create)
|
AC_CHECK_FUNCS(pthread_create)
|
||||||
|
Loading…
Reference in New Issue
Block a user