Feature #17730 » 0001-Remove-unneeded-dependencies-on-macOS.patch
| configure.ac | ||
|---|---|---|
|
[rhapsody*], [ ],
|
||
|
[darwin*], [
|
||
|
ORIG_LIBS="$LIBS"
|
||
|
RUBY_PREPEND_OPTION(LIBS, -lobjc)
|
||
|
RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT)
|
||
|
AC_CACHE_CHECK([whether syscall(2) is deprecated], rb_cv_syscall_deprecated,
|
||
|
[RUBY_WERROR_FLAG([
|
||
| ... | ... | |
|
],
|
||
|
[darwin*], [
|
||
|
RUBY_APPEND_OPTION(CFLAGS, -pipe)
|
||
|
AC_COMPILE_IFELSE([
|
||
|
AC_LANG_BOOL_COMPILE_TRY([@%:@include <AvailabilityMacros.h>],
|
||
|
[MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7])],
|
||
|
[dnl
|
||
|
RUBY_APPEND_OPTION(XLDFLAGS, [-framework Security])
|
||
|
RUBY_APPEND_OPTION(LIBRUBYARG_STATIC, [-framework Security])
|
||
|
]dnl
|
||
|
)
|
||
|
RUBY_APPEND_OPTION(XLDFLAGS, [-framework Foundation])
|
||
|
RUBY_APPEND_OPTION(LIBRUBYARG_STATIC, [-framework Foundation])
|
||
|
RUBY_APPEND_OPTION(XLDFLAGS, [-framework CoreFoundation])
|
||
|
RUBY_APPEND_OPTION(LIBRUBYARG_STATIC, [-framework CoreFoundation])
|
||
|
],
|
||
|
[osf*], [
|
||
|
AS_IF([test "$GCC" != "yes" ], [
|
||
| random.c | ||
|---|---|---|
|
#endif
|
||
|
#if 0
|
||
|
#elif defined MAC_OS_X_VERSION_10_7 && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
|
||
|
#include <Security/SecRandom.h>
|
||
|
#elif defined MAC_OS_X_VERSION_10_10 && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
|
||
|
#include <CommonCrypto/CommonRandom.h>
|
||
|
static int
|
||
|
fill_random_bytes_syscall(void *seed, size_t size, int unused)
|
||
|
{
|
||
|
int status = SecRandomCopyBytes(kSecRandomDefault, size, seed);
|
||
|
CCRNGStatus status = CCRandomGenerateBytes(seed, size);
|
||
|
if (status != errSecSuccess) {
|
||
|
if (status != kCCSuccess) {
|
||
|
# if 0
|
||
|
CFStringRef s = SecCopyErrorMessageString(status, NULL);
|
||
|
const char *m = s ? CFStringGetCStringPtr(s, kCFStringEncodingUTF8) : NULL;
|
||