-
Notifications
You must be signed in to change notification settings - Fork 29
/
install_curl.sh
executable file
·95 lines (78 loc) · 2.03 KB
/
install_curl.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
91
92
93
94
95
#!/bin/bash
# If any commands fail, fail the script immediately.
set -ex
# Exit if the build root has not been defined.
[[ -d ${BUILD_ROOT} ]] || exit 1
# Parse the options.
OPTIND=1
CODE_COVERAGE_OPTION=""
while getopts "c" opt
do
case "$opt" in
c) CODE_COVERAGE_OPTION="--enable-code-coverage"
;;
esac
done
shift $((OPTIND-1))
SRCDIR=$1
INSTALLDIR=$2
if [[ ! -d ${INSTALLDIR} ]]
then
# Make an install target for curl.
mkdir ${INSTALLDIR}
fi
if [[ -f ${INSTALLDIR}/lib/libssl.a ]]
then
SSLOPTION=--with-ssl=${INSTALLDIR}
else
SSLOPTION=--without-ssl
fi
if [[ -f ${INSTALLDIR}/lib/libnghttp2.a ]]
then
NGHTTPOPTION=--with-nghttp2=${INSTALLDIR}
else
NGHTTPOPTION=--without-nghttp2
fi
pushd ${SRCDIR}
# TODO: Ignore HTTP3 socket connection failures
pushd $1
patch -p1 <<'EOF'
diff --git a/lib/cf-socket.c b/lib/cf-socket.c
index e42b4a87b..f99fcd80c 100644
--- a/lib/cf-socket.c
+++ b/lib/cf-socket.c
@@ -1650,7 +1650,7 @@ static CURLcode cf_udp_setup_quic(struct Curl_cfilter *cf,
rc = connect(ctx->sock, &ctx->addr.sa_addr, ctx->addr.addrlen);
if(-1 == rc) {
- return socket_connect_result(data, ctx->r_ip, SOCKERRNO);
+ /* return socket_connect_result(data, ctx->r_ip, SOCKERRNO); */
}
set_local_ip(cf, data);
CURL_TRC_CF(data, cf, "%s socket %" CURL_FORMAT_SOCKET_T
EOF
popd
# Build the library.
./buildconf
./configure PKG_CONFIG_PATH=${INSTALLDIR}/lib/pkgconfig \
--prefix=${INSTALLDIR} \
--disable-shared \
--enable-debug \
--enable-maintainer-mode \
--disable-symbol-hiding \
--enable-ipv6 \
--enable-websockets \
--with-random=/dev/null \
--with-openssl \
--with-nghttp3 \
--with-ngtcp2 \
${SSLOPTION} \
${NGHTTPOPTION} \
${CODE_COVERAGE_OPTION}
make V=1
make install
# Make any explicit folders which are post install
UTFUZZDIR=${INSTALLDIR}/utfuzzer
mkdir -p ${UTFUZZDIR}
# Copy header files.
cp -v lib/curl_fnmatch.h ${UTFUZZDIR}
popd