Compare commits
8 commits
Author | SHA1 | Date | |
---|---|---|---|
|
0d59507c6f | ||
|
352ebab9e3 | ||
|
1ac35faa84 | ||
|
248684a695 | ||
|
4f16f7e0bf | ||
|
771b3050c8 | ||
|
afaae60d1c | ||
|
da994eaa99 |
5 changed files with 42 additions and 117 deletions
21
LICENSE
Normal file
21
LICENSE
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
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,18 +47,16 @@ 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
|
curl https://raw.githubusercontent.com/sinofool/build-libcurl-ios/master/build_libcurl_dist.sh openssl |bash
|
||||||
```
|
```
|
||||||
|
|
||||||
Binary (Not updated yet)
|
Binary
|
||||||
=================
|
=================
|
||||||
Following binary is curl-7.47.1, I will release 7.54.0 binaries after a longer test.
|
You can find a prebuild binary (version 7.57.0 built without OpenSSL) here: https://sinofool.net/dl/libcurl-ios-dist.tar.gz
|
||||||
|
|
||||||
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:
|
Double check the binary file before use:
|
||||||
|
|
||||||
```
|
```
|
||||||
SHA1:
|
SHA1:
|
||||||
993c9bb75d798a886749e7801d5f54c494dbf6fb libcurl-ios-dist.tar.bz2
|
a94458b89ef18b90422cf3affbdac5b8e2e0a0fd libcurl-ios-dist.tar.gz
|
||||||
|
|
||||||
GnuPG: (My Key ID: 9BE18853)
|
GnuPG: (My Key ID: 9BE18853)
|
||||||
https://sinofool.net/dl/libcurl-ios-dist.tar.bz2.sig
|
https://sinofool.net/dl/libcurl-ios-dist.tar.gz.sig
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,20 +1,15 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -euo pipefail
|
||||||
|
|
||||||
export DEVROOT=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
|
readonly XCODE_DEV="$(xcode-select -p)"
|
||||||
|
export DEVROOT="${XCODE_DEV}/Toolchains/XcodeDefault.xctoolchain"
|
||||||
DFT_DIST_DIR=${HOME}/Desktop/libcurl-ios-dist
|
DFT_DIST_DIR=${HOME}/Desktop/libcurl-ios-dist
|
||||||
DIST_DIR=${DIST_DIR:-$DFT_DIST_DIR}
|
DIST_DIR=${DIST_DIR:-$DFT_DIST_DIR}
|
||||||
|
|
||||||
function check_curl_ver() {
|
function check_curl_ver() {
|
||||||
echo "#include \"include/curl/curlver.h\"
|
echo "#include \"include/curl/curlver.h\"
|
||||||
#if LIBCURL_VERSION_MAJOR < 7 || LIBCURL_VERSION_MINOR < 40
|
#if LIBCURL_VERSION_MAJOR < 7 || LIBCURL_VERSION_MINOR < 55
|
||||||
#error Required curl 7.40.0+; See http://curl.haxx.se/docs/adv_20150108A.html
|
#error Required curl 7.40.0+; See http://curl.haxx.se/docs/adv_20150108A.html
|
||||||
#endif"|gcc -c -o /dev/null -xc -||exit 9
|
#error Supported minimal version is 7.55.0 for header file changes, see Issue #12 (https://github.com/sinofool/build-libcurl-ios/issues/12)
|
||||||
|
|
||||||
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
|
#endif"|gcc -c -o /dev/null -xc -||exit 9
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +25,7 @@ function build_for_arch() {
|
||||||
./configure --disable-shared --without-zlib --enable-static --enable-ipv6 ${SSL_FLAG} --host="${HOST}" --prefix=${PREFIX} && make -j8 && make install
|
./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
|
then
|
||||||
if [ ! -d ${HOME}/Desktop/openssl-ios-dist ]
|
if [ ! -d ${HOME}/Desktop/openssl-ios-dist ]
|
||||||
then
|
then
|
||||||
|
@ -45,25 +40,21 @@ fi
|
||||||
|
|
||||||
TMP_DIR=/tmp/build_libcurl_$$
|
TMP_DIR=/tmp/build_libcurl_$$
|
||||||
|
|
||||||
#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 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 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk ${TMP_DIR}/x86_64 || exit 2
|
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 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/arm64 || exit 3
|
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 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/armv7s || exit 4
|
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 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/armv7 || exit 5
|
build_for_arch armv7 armv7-apple-darwin ${XCODE_DEV}/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/armv7 || exit 5
|
||||||
|
|
||||||
mkdir -p ${TMP_DIR}/lib/
|
mkdir -p ${TMP_DIR}/lib/
|
||||||
${DEVROOT}/usr/bin/lipo \
|
${DEVROOT}/usr/bin/lipo \
|
||||||
-arch x86_64 ${TMP_DIR}/x86_64/lib/libcurl.a \
|
-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 armv7s ${TMP_DIR}/armv7s/lib/libcurl.a \
|
||||||
-arch arm64 ${TMP_DIR}/arm64/lib/libcurl.a \
|
-arch arm64 ${TMP_DIR}/arm64/lib/libcurl.a \
|
||||||
-output ${TMP_DIR}/lib/libcurl.a -create
|
-output ${TMP_DIR}/lib/libcurl.a -create
|
||||||
|
|
||||||
# -arch armv7 ${TMP_DIR}/armv7/lib/libcurl.a \
|
cp -r ${TMP_DIR}/arm64/include ${TMP_DIR}/
|
||||||
# -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}
|
mkdir -p ${DIST_DIR}
|
||||||
cp -r ${TMP_DIR}/include ${TMP_DIR}/lib ${DIST_DIR}
|
cp -r ${TMP_DIR}/include ${TMP_DIR}/lib ${DIST_DIR}
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
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)
|
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
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