-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sh
executable file
·90 lines (76 loc) · 1.67 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
# This script builds openssl+libcurl libraries for the Mac, iOS and tvOS
#
# Jason Cox, @jasonacox
# https://github.com/jasonacox/Build-OpenSSL-cURL
#
########################################
# EDIT this section to Select Versions #
########################################
MBEDTLS="2.4.0"
LIBCURL="7.51.0"
NGHTTP2="1.24.0"
CARES="1.8.0"
########################################
# HTTP2 Support?
NOHTTP2="/tmp/no-http2"
rm -f $NOHTTP2
usage ()
{
echo "usage: $0 [-disable-http2]"
exit 127
}
if [ "$1" == "-h" ]; then
usage
fi
echo
echo "Building mbedtls"
cd mbedtls
./mbedtls-build.sh "$MBEDTLS"
# echo "using darwinssl now"
cd ..
echo
echo "Building c-ares"
cd cares
./build-c-ares.sh "$CARES"
# echo "using darwinssl now"
cd ..
if [ "$1" == "-disable-http2" ]; then
touch "$NOHTTP2"
NGHTTP2="NONE"
else
echo
echo "Building nghttp2 for HTTP2 support"
cd nghttp2
./nghttp2-build.sh "$NGHTTP2"
cd ..
fi
echo
echo "Building Curl"
cd curl
./libcurl-build.sh "$LIBCURL"
cd ..
echo
echo "Libraries..."
echo
echo "mbedtls [$MBEDTLS]"
xcrun -sdk iphoneos lipo -info mbedtls/lib/*.a
echo
echo "nghttp2 (rename to libnghttp2.a) [$NGHTTP2]"
xcrun -sdk iphoneos lipo -info nghttp2/lib/*.a
echo
echo "libcurl (rename to libcurl.a) [$LIBCURL]"
xcrun -sdk iphoneos lipo -info curl/lib/*.a
echo
ARCHIVE="archive/libcurl-$LIBCURL-openssl-$OPENSSL-nghttp2-$NGHTTP2"
echo "Creating archive in $ARCHIVE..."
mkdir -p "$ARCHIVE"
cp curl/lib/*.a $ARCHIVE
cp mbedtls/lib/*.a $ARCHIVE
cp nghttp2/lib/*.a $ARCHIVE
cp cares/lib/*.a $ARCHIVE
echo "Archiving Mac binaries for curl and openssl..."
mv /tmp/curl $ARCHIVE
mv /tmp/openssl $ARCHIVE
$ARCHIVE/curl -V
rm -f $NOHTTP2