parent
a63dae5d07
commit
31f631a142
@ -386,6 +386,14 @@ if(CMAKE_USE_SECTRANSP)
|
|||||||
list(APPEND CURL_LIBS "${COREFOUNDATION_FRAMEWORK}" "${SECURITY_FRAMEWORK}")
|
list(APPEND CURL_LIBS "${COREFOUNDATION_FRAMEWORK}" "${SECURITY_FRAMEWORK}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
|
find_library(SYSTEMCONFIGURATION_FRAMEWORK "SystemConfiguration")
|
||||||
|
if(NOT SYSTEMCONFIGURATION_FRAMEWORK)
|
||||||
|
message(FATAL_ERROR "SystemConfiguration framework not found")
|
||||||
|
endif()
|
||||||
|
list(APPEND CURL_LIBS "${SYSTEMCONFIGURATION_FRAMEWORK}")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CMAKE_USE_OPENSSL)
|
if(CMAKE_USE_OPENSSL)
|
||||||
find_package(OpenSSL REQUIRED)
|
find_package(OpenSSL REQUIRED)
|
||||||
set(SSL_ENABLED ON)
|
set(SSL_ENABLED ON)
|
||||||
|
|||||||
@ -479,6 +479,7 @@ CURL_CHECK_WIN32_LARGEFILE
|
|||||||
CURL_CHECK_WIN32_CRYPTO
|
CURL_CHECK_WIN32_CRYPTO
|
||||||
|
|
||||||
CURL_DARWIN_CFLAGS
|
CURL_DARWIN_CFLAGS
|
||||||
|
CURL_DARWIN_SYSTEMCONFIGURATION
|
||||||
CURL_SUPPORTS_BUILTIN_AVAILABLE
|
CURL_SUPPORTS_BUILTIN_AVAILABLE
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -247,7 +247,11 @@
|
|||||||
* performing this task will result in a synthesized IPv6 address.
|
* performing this task will result in a synthesized IPv6 address.
|
||||||
*/
|
*/
|
||||||
#if defined(__APPLE__) && !defined(USE_ARES)
|
#if defined(__APPLE__) && !defined(USE_ARES)
|
||||||
|
#include <TargetConditionals.h>
|
||||||
#define USE_RESOLVE_ON_IPS 1
|
#define USE_RESOLVE_ON_IPS 1
|
||||||
|
# if defined(TARGET_OS_OSX) && TARGET_OS_OSX
|
||||||
|
# define CURL_OSX_CALL_COPYPROXIES 1
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_LWIPSOCK
|
#ifdef USE_LWIPSOCK
|
||||||
|
|||||||
17
lib/hostip.c
17
lib/hostip.c
@ -68,6 +68,10 @@
|
|||||||
#include "curl_memory.h"
|
#include "curl_memory.h"
|
||||||
#include "memdebug.h"
|
#include "memdebug.h"
|
||||||
|
|
||||||
|
#if defined(ENABLE_IPV6) && defined(CURL_OSX_CALL_COPYPROXIES)
|
||||||
|
#include <SystemConfiguration/SystemConfiguration.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(CURLRES_SYNCH) && \
|
#if defined(CURLRES_SYNCH) && \
|
||||||
defined(HAVE_ALARM) && defined(SIGALRM) && defined(HAVE_SIGSETJMP)
|
defined(HAVE_ALARM) && defined(SIGALRM) && defined(HAVE_SIGSETJMP)
|
||||||
/* alarm-based timeouts can only be used with all the dependencies satisfied */
|
/* alarm-based timeouts can only be used with all the dependencies satisfied */
|
||||||
@ -529,6 +533,19 @@ enum resolve_t Curl_resolv(struct Curl_easy *data,
|
|||||||
return CURLRESOLV_ERROR;
|
return CURLRESOLV_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(ENABLE_IPV6) && defined(CURL_OSX_CALL_COPYPROXIES)
|
||||||
|
/*
|
||||||
|
* The automagic conversion from IPv4 literals to IPv6 literals only works
|
||||||
|
* if the SCDynamicStoreCopyProxies system function gets called first. As
|
||||||
|
* Curl currently doesn't support system-wide HTTP proxies, we therefore
|
||||||
|
* don't use any value this function might return.
|
||||||
|
*
|
||||||
|
* This function is only available on a macOS and is not needed for
|
||||||
|
* IPv4-only builds, hence the conditions above.
|
||||||
|
*/
|
||||||
|
SCDynamicStoreCopyProxies(NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef USE_RESOLVE_ON_IPS
|
#ifndef USE_RESOLVE_ON_IPS
|
||||||
/* First check if this is an IPv4 address string */
|
/* First check if this is an IPv4 address string */
|
||||||
if(Curl_inet_pton(AF_INET, hostname, &in) > 0)
|
if(Curl_inet_pton(AF_INET, hostname, &in) > 0)
|
||||||
|
|||||||
52
m4/curl-sysconfig.m4
Normal file
52
m4/curl-sysconfig.m4
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
#***************************************************************************
|
||||||
|
|
||||||
|
AC_DEFUN([CURL_DARWIN_SYSTEMCONFIGURATION], [
|
||||||
|
AC_MSG_CHECKING([whether to link macOS SystemConfiguration framework])
|
||||||
|
case $host_os in
|
||||||
|
darwin*)
|
||||||
|
AC_COMPILE_IFELSE([
|
||||||
|
AC_LANG_PROGRAM([[
|
||||||
|
#include <TargetConditionals.h>
|
||||||
|
]],[[
|
||||||
|
#if (TARGET_OS_OSX)
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
|
#error Not a macOS
|
||||||
|
#endif
|
||||||
|
]])
|
||||||
|
],[
|
||||||
|
build_for_macos="yes"
|
||||||
|
],[
|
||||||
|
build_for_macos="no"
|
||||||
|
])
|
||||||
|
if test "x$build_for_macos" != xno; then
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
LDFLAGS="$LDFLAGS -framework SystemConfiguration"
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
esac
|
||||||
|
])
|
||||||
Loading…
Reference in New Issue
Block a user