Compare commits

...

8 commits

Author SHA1 Message Date
Bochun Bai
0d59507c6f
Merge pull request #17 from MathPlayer/master
Use "xcode-select -p" instead of absolute path + minor changes
2018-04-27 10:45:53 -07:00
Bogdan-Constantin Popescu
352ebab9e3 Replace indentation tabs with spaces
This commit is changing a few lines indented using tabs.
The file was mainly using spaces for indenting, except for some lines.
2018-02-20 14:27:16 +01:00
Bogdan-Constantin Popescu
1ac35faa84 Unconmment build for i386 2018-02-20 14:27:03 +01:00
Bogdan-Constantin Popescu
248684a695 Use "xcode-select -p" instead of absolute path 2018-02-20 14:26:47 +01:00
Bogdan-Constantin Popescu
4f16f7e0bf Add safe flags for bash 2018-02-20 14:17:10 +01:00
Bochun Bai
771b3050c8 Fix Issue #14: Update precompiled binary. 2018-01-23 02:19:52 -08:00
Bochun Bai
afaae60d1c add armv7 arch 2018-01-03 05:27:43 -08:00
Bochun Bai
da994eaa99 Fix Issue #12
Support latest curl version 7.55.1
Add license file
2017-09-07 09:06:26 +08:00
5 changed files with 42 additions and 117 deletions

21
LICENSE Normal file
View 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.

View file

@ -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
``` ```

View file

@ -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}

View file

@ -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)

View file

@ -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