Compare commits
No commits in common. "master" and "for-7.54" have entirely different histories.
5 changed files with 117 additions and 42 deletions
21
LICENSE
21
LICENSE
|
@ -1,21 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2017 Bochun Bai
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
10
README.md
10
README.md
|
@ -47,16 +47,18 @@ To use OpenSSL, use https://github.com/sinofool/build-openssl-ios/ to build Open
|
|||
curl https://raw.githubusercontent.com/sinofool/build-libcurl-ios/master/build_libcurl_dist.sh openssl |bash
|
||||
```
|
||||
|
||||
Binary
|
||||
Binary (Not updated yet)
|
||||
=================
|
||||
You can find a prebuild binary (version 7.57.0 built without OpenSSL) here: https://sinofool.net/dl/libcurl-ios-dist.tar.gz
|
||||
Following binary is curl-7.47.1, I will release 7.54.0 binaries after a longer test.
|
||||
|
||||
You can find a prebuild binary (with OpenSSL) here: https://sinofool.net/dl/libcurl-ios-dist.tar.bz2
|
||||
|
||||
Double check the binary file before use:
|
||||
|
||||
```
|
||||
SHA1:
|
||||
a94458b89ef18b90422cf3affbdac5b8e2e0a0fd libcurl-ios-dist.tar.gz
|
||||
993c9bb75d798a886749e7801d5f54c494dbf6fb libcurl-ios-dist.tar.bz2
|
||||
|
||||
GnuPG: (My Key ID: 9BE18853)
|
||||
https://sinofool.net/dl/libcurl-ios-dist.tar.gz.sig
|
||||
https://sinofool.net/dl/libcurl-ios-dist.tar.bz2.sig
|
||||
```
|
||||
|
|
|
@ -1,15 +1,20 @@
|
|||
#!/bin/bash -euo pipefail
|
||||
#!/bin/bash
|
||||
|
||||
readonly XCODE_DEV="$(xcode-select -p)"
|
||||
export DEVROOT="${XCODE_DEV}/Toolchains/XcodeDefault.xctoolchain"
|
||||
export DEVROOT=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
|
||||
DFT_DIST_DIR=${HOME}/Desktop/libcurl-ios-dist
|
||||
DIST_DIR=${DIST_DIR:-$DFT_DIST_DIR}
|
||||
|
||||
function check_curl_ver() {
|
||||
echo "#include \"include/curl/curlver.h\"
|
||||
#if LIBCURL_VERSION_MAJOR < 7 || LIBCURL_VERSION_MINOR < 55
|
||||
#if LIBCURL_VERSION_MAJOR < 7 || LIBCURL_VERSION_MINOR < 40
|
||||
#error Required curl 7.40.0+; See http://curl.haxx.se/docs/adv_20150108A.html
|
||||
#error Supported minimal version is 7.55.0 for header file changes, see Issue #12 (https://github.com/sinofool/build-libcurl-ios/issues/12)
|
||||
#endif"|gcc -c -o /dev/null -xc -||exit 9
|
||||
|
||||
echo "#include \"include/curl/curlver.h\"
|
||||
#if LIBCURL_VERSION_MAJOR == 7 && LIBCURL_VERSION_MINOR <= 52 && LIBCURL_VERSION_PATCH <= 1
|
||||
#warning curl 7.52.1 have an issue build with darwinssl; See patch here: https://github.com/curl/curl/commit/8db3afe16c0916ea5acf6aed6e7cf02f06cc8677
|
||||
#warning For 7.52.1 is the latest release version, the patch commited just one day later than release cut. I can't automatically apply the patch for you.
|
||||
#warning Please patch it with: patch -p1 < darwinssl-fix-iOS-build.patch
|
||||
#endif"|gcc -c -o /dev/null -xc -||exit 9
|
||||
}
|
||||
|
||||
|
@ -25,7 +30,7 @@ function build_for_arch() {
|
|||
./configure --disable-shared --without-zlib --enable-static --enable-ipv6 ${SSL_FLAG} --host="${HOST}" --prefix=${PREFIX} && make -j8 && make install
|
||||
}
|
||||
|
||||
if [ "${1:-''}" == "openssl" ]
|
||||
if [ "$1" == "openssl" ]
|
||||
then
|
||||
if [ ! -d ${HOME}/Desktop/openssl-ios-dist ]
|
||||
then
|
||||
|
@ -40,21 +45,25 @@ fi
|
|||
|
||||
TMP_DIR=/tmp/build_libcurl_$$
|
||||
|
||||
build_for_arch i386 i386-apple-darwin ${XCODE_DEV}/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk ${TMP_DIR}/i386 || exit 1
|
||||
build_for_arch x86_64 x86_64-apple-darwin ${XCODE_DEV}/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk ${TMP_DIR}/x86_64 || exit 2
|
||||
build_for_arch arm64 arm-apple-darwin ${XCODE_DEV}/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/arm64 || exit 3
|
||||
build_for_arch armv7s armv7s-apple-darwin ${XCODE_DEV}/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/armv7s || exit 4
|
||||
build_for_arch armv7 armv7-apple-darwin ${XCODE_DEV}/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/armv7 || exit 5
|
||||
#build_for_arch i386 i386-apple-darwin /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk ${TMP_DIR}/i386 || exit 1
|
||||
build_for_arch x86_64 x86_64-apple-darwin /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk ${TMP_DIR}/x86_64 || exit 2
|
||||
build_for_arch arm64 arm-apple-darwin /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/arm64 || exit 3
|
||||
build_for_arch armv7s armv7s-apple-darwin /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/armv7s || exit 4
|
||||
#build_for_arch armv7 armv7-apple-darwin /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/armv7 || exit 5
|
||||
|
||||
mkdir -p ${TMP_DIR}/lib/
|
||||
${DEVROOT}/usr/bin/lipo \
|
||||
-arch x86_64 ${TMP_DIR}/x86_64/lib/libcurl.a \
|
||||
-arch armv7 ${TMP_DIR}/armv7/lib/libcurl.a \
|
||||
-arch armv7s ${TMP_DIR}/armv7s/lib/libcurl.a \
|
||||
-arch arm64 ${TMP_DIR}/arm64/lib/libcurl.a \
|
||||
-output ${TMP_DIR}/lib/libcurl.a -create
|
||||
-arch x86_64 ${TMP_DIR}/x86_64/lib/libcurl.a \
|
||||
-arch armv7s ${TMP_DIR}/armv7s/lib/libcurl.a \
|
||||
-arch arm64 ${TMP_DIR}/arm64/lib/libcurl.a \
|
||||
-output ${TMP_DIR}/lib/libcurl.a -create
|
||||
|
||||
cp -r ${TMP_DIR}/arm64/include ${TMP_DIR}/
|
||||
# -arch armv7 ${TMP_DIR}/armv7/lib/libcurl.a \
|
||||
# -arch i386 ${TMP_DIR}/i386/lib/libcurl.a \
|
||||
|
||||
cp -r ${TMP_DIR}/armv7s/include ${TMP_DIR}/
|
||||
curl -O https://raw.githubusercontent.com/sinofool/build-libcurl-ios/master/patch-include.patch
|
||||
patch ${TMP_DIR}/include/curl/curlbuild.h < patch-include.patch
|
||||
|
||||
mkdir -p ${DIST_DIR}
|
||||
cp -r ${TMP_DIR}/include ${TMP_DIR}/lib ${DIST_DIR}
|
||||
|
|
30
darwinssl-fix-iOS-build.patch
Normal file
30
darwinssl-fix-iOS-build.patch
Normal file
|
@ -0,0 +1,30 @@
|
|||
From 8db3afe16c0916ea5acf6aed6e7cf02f06cc8677 Mon Sep 17 00:00:00 2001
|
||||
From: Chris Araman <chris-araman@users.noreply.github.com>
|
||||
Date: Thu, 22 Dec 2016 18:27:17 -0800
|
||||
Subject: [PATCH] darwinssl: fix iOS build
|
||||
|
||||
Reviewed-by: Nick Zitzmann
|
||||
Fixes #1172
|
||||
---
|
||||
lib/vtls/darwinssl.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/lib/vtls/darwinssl.c b/lib/vtls/darwinssl.c
|
||||
index a43e391..2146b56 100644
|
||||
--- a/lib/vtls/darwinssl.c
|
||||
+++ b/lib/vtls/darwinssl.c
|
||||
@@ -936,7 +936,11 @@ static OSStatus CopyIdentityWithLabel(char *label,
|
||||
(SecIdentityRef) CFArrayGetValueAtIndex(keys_list, i);
|
||||
err = SecIdentityCopyCertificate(*out_cert_and_key, &cert);
|
||||
if(err == noErr) {
|
||||
+#if CURL_BUILD_IOS
|
||||
+ common_name = SecCertificateCopySubjectSummary(cert);
|
||||
+#else // CURL_BUILD_MAC_10_7
|
||||
SecCertificateCopyCommonName(cert, &common_name);
|
||||
+#endif
|
||||
if(CFStringCompare(common_name, label_cf, 0) == kCFCompareEqualTo) {
|
||||
CFRelease(cert);
|
||||
CFRelease(common_name);
|
||||
--
|
||||
2.10.1 (Apple Git-78)
|
||||
|
55
patch-include.patch
Normal file
55
patch-include.patch
Normal file
|
@ -0,0 +1,55 @@
|
|||
diff armv7s/include/curl/curlbuild.h include/curl/curlbuild.h
|
||||
135a136,138
|
||||
> #ifdef __LP64__
|
||||
> /* #undef CURL_PULL_STDINT_H */
|
||||
> #else
|
||||
136a140
|
||||
> #endif
|
||||
142a147,149
|
||||
> #ifdef __LP64__
|
||||
> /* #undef CURL_PULL_INTTYPES_H */
|
||||
> #else
|
||||
143a151
|
||||
> #endif
|
||||
162a171,173
|
||||
> #ifdef __LP64__
|
||||
> #define CURL_SIZEOF_LONG 8
|
||||
> #else
|
||||
163a175
|
||||
> #endif
|
||||
174a187,189
|
||||
> #ifdef __LP64__
|
||||
> #define CURL_TYPEOF_CURL_OFF_T long
|
||||
> #else
|
||||
175a191
|
||||
> #endif
|
||||
180a197,199
|
||||
> #ifdef __LP64__
|
||||
> #define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
> #else
|
||||
181a201
|
||||
> #endif
|
||||
183a204,206
|
||||
> #ifdef __LP64__
|
||||
> #define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
> #else
|
||||
184a208
|
||||
> #endif
|
||||
186a211,213
|
||||
> #ifdef __LP64__
|
||||
> #define CURL_FORMAT_OFF_T "%ld"
|
||||
> #else
|
||||
187a215
|
||||
> #endif
|
||||
192a221,223
|
||||
> #ifdef __LP64__
|
||||
> #define CURL_SUFFIX_CURL_OFF_T L
|
||||
> #else
|
||||
193a225
|
||||
> #endif
|
||||
195a228,230
|
||||
> #ifdef __LP64__
|
||||
> #define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
> #else
|
||||
196a232
|
||||
> #endif
|
Loading…
Reference in a new issue