Skip to content

Commit

Permalink
Fix XCode 15.3 build #67
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonacox committed Mar 17, 2024
1 parent 4983bb5 commit 0c37e83
Show file tree
Hide file tree
Showing 23 changed files with 531 additions and 245 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This Script builds OpenSSL, nghttp2 and cURL/libcurl for MacOS (x86_64, arm64),

## News

* 17-Mar-2024: Updated tvOS build script to work with XCode 15.3 and added `--without-libpsl` for cURL due to on-by-default policy (see [cURL blog](https://daniel.haxx.se/blog/2024/01/10/psl-in-curl/)). TODO: Get a static build of libpsl for cross-compile.
* 19-Jul-2023: Added OpenSSL 3.0.x (LTS) Support and removed EOL bitcode for builds going forward.
* 13-Feb-2021: Update now builds XCFrameworks which supports all platforms and targets for easy import into your projects.
* 16-Jan-2021: Updated build scripts to allow user defined minimum macOS, iOS, tvOS and catalyst target build versions.
Expand Down
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ set -e
################################################

#OPENSSL="1.1.1u" # https://www.openssl.org/source/
OPENSSL="3.0.9" # https://www.openssl.org/source/
LIBCURL="8.1.2" # https://curl.haxx.se/download.html
NGHTTP2="1.55.1" # https://nghttp2.org/
OPENSSL="3.0.13" # https://www.openssl.org/source/
LIBCURL="8.6.0" # https://curl.haxx.se/download.html
NGHTTP2="1.60.0" # https://nghttp2.org/

################################################

Expand Down
2 changes: 1 addition & 1 deletion curl/libcurl-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ CURL_VERSION="curl-7.74.0"
nohttp2="0"
catalyst="0"
FORCE_SSLV3="no"
CONF_FLAGS="--without-libidn2 --disable-shared --enable-static -with-random=/dev/urandom"
CONF_FLAGS="--without-libidn2 --disable-shared --enable-static -with-random=/dev/urandom --without-libpsl"

# Set minimum OS versions for target
MACOS_X86_64_VERSION="" # Empty = use host version
Expand Down
428 changes: 323 additions & 105 deletions example/iOS Test App/iOS Test App/cacert.pem

Large diffs are not rendered by default.

85 changes: 53 additions & 32 deletions example/iOS Test App/include/curl/curl.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,19 @@
#include "curlver.h" /* libcurl version defines */
#include "system.h" /* determine things run-time */

/*
* Define CURL_WIN32 when build target is Win32 API
*/

#if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && \
!defined(__SYMBIAN32__)
#define CURL_WIN32
#endif

#include <stdio.h>
#include <limits.h>

#if (defined(__FreeBSD__) && (__FreeBSD__ >= 2)) || defined(__MidnightBSD__)
#if defined(__FreeBSD__) || defined(__MidnightBSD__)
/* Needed for __FreeBSD_version or __MidnightBSD_version symbol definition */
#include <osreldate.h>
#include <sys/param.h>
#endif

/* The include stuff here below is mainly for time_t! */
#include <sys/types.h>
#include <time.h>

#if defined(CURL_WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \
defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H))
/* The check above prevents the winsock2 inclusion if winsock.h already was
Expand All @@ -88,20 +79,20 @@
libc5-based Linux systems. Only include it on systems that are known to
require it! */
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
defined(__minix) || defined(__INTEGRITY) || \
defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \
defined(__CYGWIN__) || defined(AMIGA) || defined(__NuttX__) || \
(defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) || \
(defined(__MidnightBSD_version) && (__MidnightBSD_version < 100000)) || \
defined(__sun__) || defined(__serenity__)
defined(__sun__) || defined(__serenity__) || defined(__vxworks__)
#include <sys/select.h>
#endif

#if !defined(CURL_WIN32) && !defined(_WIN32_WCE)
#if !defined(_WIN32) && !defined(_WIN32_WCE)
#include <sys/socket.h>
#endif

#if !defined(CURL_WIN32)
#if !defined(_WIN32)
#include <sys/time.h>
#endif

Expand All @@ -128,7 +119,7 @@ typedef void CURLSH;

#ifdef CURL_STATICLIB
# define CURL_EXTERN
#elif defined(CURL_WIN32) || defined(__SYMBIAN32__) || \
#elif defined(_WIN32) || \
(__has_declspec_attribute(dllexport) && \
__has_declspec_attribute(dllimport))
# if defined(BUILDING_LIBCURL)
Expand All @@ -144,7 +135,7 @@ typedef void CURLSH;

#ifndef curl_socket_typedef
/* socket typedef */
#if defined(CURL_WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H)
#if defined(_WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H)
typedef SOCKET curl_socket_t;
#define CURL_SOCKET_BAD INVALID_SOCKET
#else
Expand All @@ -159,9 +150,9 @@ typedef enum {
CURLSSLBACKEND_NONE = 0,
CURLSSLBACKEND_OPENSSL = 1,
CURLSSLBACKEND_GNUTLS = 2,
CURLSSLBACKEND_NSS = 3,
CURLSSLBACKEND_NSS CURL_DEPRECATED(8.3.0, "") = 3,
CURLSSLBACKEND_OBSOLETE4 = 4, /* Was QSOSSL. */
CURLSSLBACKEND_GSKIT = 5,
CURLSSLBACKEND_GSKIT CURL_DEPRECATED(8.3.0, "") = 5,
CURLSSLBACKEND_POLARSSL CURL_DEPRECATED(7.69.0, "") = 6,
CURLSSLBACKEND_WOLFSSL = 7,
CURLSSLBACKEND_SCHANNEL = 8,
Expand Down Expand Up @@ -640,16 +631,17 @@ typedef enum {
CURLE_PROXY, /* 97 - proxy handshake error */
CURLE_SSL_CLIENTCERT, /* 98 - client-side certificate required */
CURLE_UNRECOVERABLE_POLL, /* 99 - poll/select returned fatal error */
CURLE_TOO_LARGE, /* 100 - a value/data met its maximum */
CURL_LAST /* never use! */
} CURLcode;

#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
the obsolete stuff removed! */

/* Previously obsolete error code re-used in 7.38.0 */
/* Previously obsolete error code reused in 7.38.0 */
#define CURLE_OBSOLETE16 CURLE_HTTP2

/* Previously obsolete error codes re-used in 7.24.0 */
/* Previously obsolete error codes reused in 7.24.0 */
#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED
#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT

Expand Down Expand Up @@ -781,7 +773,7 @@ typedef enum {
CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT
HTTP/1.0 */
CURLPROXY_HTTPS = 2, /* HTTPS but stick to HTTP/1 added in 7.52.0 */
CURLPROXY_HTTPS2 = 3, /* HTTPS and attempt HTTP/2 added in 8.1.0 */
CURLPROXY_HTTPS2 = 3, /* HTTPS and attempt HTTP/2 added in 8.2.0 */
CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
in 7.10 */
CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
Expand Down Expand Up @@ -1358,7 +1350,7 @@ typedef enum {
operation slower and is less friendly for the network. */
CURLOPT(CURLOPT_FRESH_CONNECT, CURLOPTTYPE_LONG, 74),

/* Set to explicitly forbid the upcoming transfer's connection to be re-used
/* Set to explicitly forbid the upcoming transfer's connection to be reused
when done. Do not use this unless you're absolutely sure of this, as it
makes the operation slower and is less friendly for the network. */
CURLOPT(CURLOPT_FORBID_REUSE, CURLOPTTYPE_LONG, 75),
Expand Down Expand Up @@ -1652,7 +1644,7 @@ typedef enum {
CURLOPT(CURLOPT_SOCKOPTFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 148),
CURLOPT(CURLOPT_SOCKOPTDATA, CURLOPTTYPE_CBPOINT, 149),

/* set to 0 to disable session ID re-use for this transfer, default is
/* set to 0 to disable session ID reuse for this transfer, default is
enabled (== 1) */
CURLOPT(CURLOPT_SSL_SESSIONID_CACHE, CURLOPTTYPE_LONG, 150),

Expand Down Expand Up @@ -1854,7 +1846,8 @@ typedef enum {
/* allow GSSAPI credential delegation */
CURLOPT(CURLOPT_GSSAPI_DELEGATION, CURLOPTTYPE_VALUES, 210),

/* Set the name servers to use for DNS resolution */
/* Set the name servers to use for DNS resolution.
* Only supported by the c-ares DNS backend */
CURLOPT(CURLOPT_DNS_SERVERS, CURLOPTTYPE_STRINGPOINT, 211),

/* Time-out accept operations (currently for FTP only) after this amount
Expand Down Expand Up @@ -2113,7 +2106,7 @@ typedef enum {
CURLOPT(CURLOPT_SASL_AUTHZID, CURLOPTTYPE_STRINGPOINT, 289),

/* allow RCPT TO command to fail for some recipients */
CURLOPT(CURLOPT_MAIL_RCPT_ALLLOWFAILS, CURLOPTTYPE_LONG, 290),
CURLOPT(CURLOPT_MAIL_RCPT_ALLOWFAILS, CURLOPTTYPE_LONG, 290),

/* the private SSL-certificate as a "blob" */
CURLOPT(CURLOPT_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 291),
Expand Down Expand Up @@ -2207,6 +2200,12 @@ typedef enum {
/* Can leak things, gonna exit() soon */
CURLOPT(CURLOPT_QUICK_EXIT, CURLOPTTYPE_LONG, 322),

/* set a specific client IP for HAProxy PROXY protocol header? */
CURLOPT(CURLOPT_HAPROXY_CLIENT_IP, CURLOPTTYPE_STRINGPOINT, 323),

/* millisecond version */
CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT_MS, CURLOPTTYPE_LONG, 324),

CURLOPT_LASTENTRY /* the last unused */
} CURLoption;

Expand Down Expand Up @@ -2235,6 +2234,9 @@ typedef enum {
/* */
#define CURLOPT_FTP_RESPONSE_TIMEOUT CURLOPT_SERVER_RESPONSE_TIMEOUT

/* Added in 8.2.0 */
#define CURLOPT_MAIL_RCPT_ALLLOWFAILS CURLOPT_MAIL_RCPT_ALLOWFAILS

#else
/* This is set if CURL_NO_OLDIES is defined at compile-time */
#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */
Expand Down Expand Up @@ -2725,6 +2727,20 @@ CURL_EXTERN CURLcode curl_global_init_mem(long flags,
*/
CURL_EXTERN void curl_global_cleanup(void);

/*
* NAME curl_global_trace()
*
* DESCRIPTION
*
* curl_global_trace() can be invoked at application start to
* configure which components in curl should participate in tracing.
* This function is thread-safe if CURL_VERSION_THREADSAFE is set in the
* curl_version_info_data.features flag (fetch by curl_version_info()).
*/
CURL_EXTERN CURLcode curl_global_trace(const char *config);

/* linked-list structure for the CURLOPT_QUOTE option (and other) */
struct curl_slist {
char *data;
Expand Down Expand Up @@ -2804,13 +2820,14 @@ CURL_EXTERN void curl_slist_free_all(struct curl_slist *list);
*/
CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);

/* info about the certificate chain, only for OpenSSL, GnuTLS, Schannel, NSS
and GSKit builds. Asked for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
/* info about the certificate chain, for SSL backends that support it. Asked
for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
struct curl_certinfo {
int num_of_certs; /* number of certificates with information */
struct curl_slist **certinfo; /* for each index in this array, there's a
linked list with textual information in the
format "name: value" */
linked list with textual information for a
certificate in the format "name:content".
eg "Subject:foo", "Issuer:bar", etc. */
};

/* Information about the SSL library used and the respective internal SSL
Expand Down Expand Up @@ -2918,7 +2935,10 @@ typedef enum {
CURLINFO_REFERER = CURLINFO_STRING + 60,
CURLINFO_CAINFO = CURLINFO_STRING + 61,
CURLINFO_CAPATH = CURLINFO_STRING + 62,
CURLINFO_LASTONE = 62
CURLINFO_XFER_ID = CURLINFO_OFF_T + 63,
CURLINFO_CONN_ID = CURLINFO_OFF_T + 64,
CURLINFO_QUEUE_TIME_T = CURLINFO_OFF_T + 65,
CURLINFO_LASTONE = 65
} CURLINFO;

/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
Expand Down Expand Up @@ -3197,6 +3217,7 @@ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
#include "options.h"
#include "header.h"
#include "websockets.h"
#include "mprintf.h"

/* the typechecker doesn't work in C++ (yet) */
#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \
Expand Down
10 changes: 5 additions & 5 deletions example/iOS Test App/include/curl/curlver.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@

/* This is the version number of the libcurl package from which this header
file origins: */
#define LIBCURL_VERSION "8.1.2"
#define LIBCURL_VERSION "8.6.0"

/* The numeric version number is also available "in parts" by using these
defines: */
#define LIBCURL_VERSION_MAJOR 8
#define LIBCURL_VERSION_MINOR 1
#define LIBCURL_VERSION_PATCH 2
#define LIBCURL_VERSION_MINOR 6
#define LIBCURL_VERSION_PATCH 0

/* This is the numeric version of the libcurl version number, meant for easier
parsing and comparisons by programs. The LIBCURL_VERSION_NUM define will
Expand All @@ -59,7 +59,7 @@
CURL_VERSION_BITS() macro since curl's own configure script greps for it
and needs it to contain the full number.
*/
#define LIBCURL_VERSION_NUM 0x080102
#define LIBCURL_VERSION_NUM 0x080600

/*
* This is the date and time when the full source package was created. The
Expand All @@ -70,7 +70,7 @@
*
* "2007-11-23"
*/
#define LIBCURL_TIMESTAMP "2023-05-30"
#define LIBCURL_TIMESTAMP "2024-01-31"

#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z))
#define CURL_AT_LEAST_VERSION(x,y,z) \
Expand Down
46 changes: 36 additions & 10 deletions example/iOS Test App/include/curl/mprintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,44 @@
extern "C" {
#endif

CURL_EXTERN int curl_mprintf(const char *format, ...);
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
#if (defined(__GNUC__) || defined(__clang__)) && \
defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
!defined(CURL_NO_FMT_CHECKS)
#if defined(__MINGW32__) && !defined(__clang__)
#define CURL_TEMP_PRINTF(fmt, arg) \
__attribute__((format(gnu_printf, fmt, arg)))
#else
#define CURL_TEMP_PRINTF(fmt, arg) \
__attribute__((format(printf, fmt, arg)))
#endif
#else
#define CURL_TEMP_PRINTF(fmt, arg)
#endif

CURL_EXTERN int curl_mprintf(const char *format, ...)
CURL_TEMP_PRINTF(1, 2);
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...)
CURL_TEMP_PRINTF(2, 3);
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...)
CURL_TEMP_PRINTF(2, 3);
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
const char *format, ...);
CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
const char *format, ...)
CURL_TEMP_PRINTF(3, 4);
CURL_EXTERN int curl_mvprintf(const char *format, va_list args)
CURL_TEMP_PRINTF(1, 0);
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args)
CURL_TEMP_PRINTF(2, 0);
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args)
CURL_TEMP_PRINTF(2, 0);
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
const char *format, va_list args);
CURL_EXTERN char *curl_maprintf(const char *format, ...);
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
const char *format, va_list args)
CURL_TEMP_PRINTF(3, 0);
CURL_EXTERN char *curl_maprintf(const char *format, ...)
CURL_TEMP_PRINTF(1, 2);
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args)
CURL_TEMP_PRINTF(1, 0);

#undef CURL_TEMP_PRINTF

#ifdef __cplusplus
} /* end of extern "C" */
Expand Down
13 changes: 12 additions & 1 deletion example/iOS Test App/include/curl/multi.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ typedef struct CURLMsg CURLMsg;
struct curl_waitfd {
curl_socket_t fd;
short events;
short revents; /* not supported yet */
short revents;
};

/*
Expand Down Expand Up @@ -426,6 +426,17 @@ CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
curl_socket_t sockfd, void *sockp);

/*
* Name: curl_multi_get_handles()
*
* Desc: Returns an allocated array holding all handles currently added to
* the multi handle. Marks the final entry with a NULL pointer. If
* there is no easy handle added to the multi handle, this function
* returns an array with the first entry as a NULL pointer.
*
* Returns: NULL on failure, otherwise a CURL **array pointer
*/
CURL_EXTERN CURL **curl_multi_get_handles(CURLM *multi_handle);

/*
* Name: curl_push_callback
Expand Down
Loading

0 comments on commit 0c37e83

Please sign in to comment.