summaryrefslogtreecommitdiff
path: root/doc/note/qemu/build-libcurl.txt
blob: be7b8c24ceb934cebfbd550f13301ff2c18200b2 (plain)
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
96
97
98
99


### Debian native
true \
  && PKGS_TO_ADD="autoconf automake ca-certificates curl make" \
  && SUDO=sudo \
  && PKGINIT="$SUDO apt update" \
  && PKGADD="$SUDO apt install -y --no-install-recommends" \
  && PKGCLEAN="$SUDO apt clean" \
  && HOST= \
  && true


### Alpine mingw cross
true \
  && PKGS_TO_ADD="git make mingw-w64-gcc curl tar cmake autoconf automake libtool m4" \
  && SUDO="/home/$USER/.local/bin/sudo" \
  && PKGINIT=true \
  && PKGADD="$SUDO apk add" \
  && PKGCLEAN="$SUDO apk clean" \
  && HOST=x86_64-w64-mingw32 \
  && true


## Generic
true \
  && CURL_VERSION="8.3.0" \
  && CACHE_DIR="/var/tmp" \
  && true


## Make
true \
  && if test -n "$(ls -A)"; then true \
     && printf '\n  It is recommended to run this script in an empty dir.\n\n' \
     && false \
     ;fi \
  && if test -n "$HOST"; then HOST_="${HOST:?}-" ;fi \
  && CURL_VERSION_UGLY="$(echo "$CURL_VERSION"|sed 's;\.;_;g')" \
  && CURL_URL="https://github.com/curl/curl/archive/refs/tags/curl-${CURL_VERSION_UGLY:?}.tar.gz" \
  && CURL_SRCTGZ="${CACHE_DIR:?}/curl-${CURL_VERSION:?}.tgz" \
  && CURL_BINTGZ="${CURL_SRCTGZ%.*}-bin.tgz" \
  \
  && ${PKGINIT:?} && ${PKGADD:?} $PKGS_TO_ADD \
  && printf '\n  Download Sources\n\n' \
  && if test ! -e "${CURL_SRCTGZ:?}"; then true \
     && echo "Download ${CURL_URL:?}" \
     && curl -sSLo "${CURL_SRCTGZ:?}" "${CURL_URL:?}" \
     ;fi \
  && if test ! -e "${CURL_BINTGZ:?}"; then (true \
     && printf '\n  Build curl\n\n' \
     && tar xf "${CURL_SRCTGZ:?}" \
     && cd "curl-curl-${CURL_VERSION_UGLY:?}" \
     && autoreconf -fi \
     && if test -n "$HOST"; then HORSCHT="--host=${HOST:?}";fi \
     && ./configure --prefix="$PWD/build/usr_local" --enable-http --with-nghttp2 --with-nghttp3 \
            --disable-alt-svc --disable-ares --disable-aws --disable-basic-auth \
            --disable-bearer-auth --disable-bindlocal --disable-cookies --disable-curldebug \
            --disable-dateparse --disable-debug --disable-dependency-tracking --disable-dict \
            --disable-digest-auth --disable-dnsshuffle --disable-doh --disable-ech --disable-file \
            --disable-form-api --disable-ftp --disable-get-easy-options --disable-gopher \
            --disable-headers-api --disable-hsts --disable-http-auth --disable-imap --enable-ipv6 \
            --disable-kerberos-auth --disable-largefile --disable-ldap --disable-ldaps \
            --disable-libcurl-option --disable-libtool-lock --enable-manual --disable-mime \
            --disable-mqtt --disable-negotiate-auth --disable-netrc --enable-ntlm --enable-ntlm-wb \
            --disable-openssl-auto-load-config --disable-optimize --disable-pop3 \
            --disable-progress-meter --enable-proxy --disable-pthreads --disable-rt --disable-rtsp \
            --disable-smb --enable-smtp --disable-socketpair --disable-sspi --disable-symbol-hiding \
            --disable-telnet --disable-tftp --disable-threaded-resolver --disable-tls-srp \
            --disable-unix-sockets --disable-verbose --disable-versioned-symbols --disable-warnings \
            --disable-websockets --disable-werror --without-schannel --without-secure-transport \
            --without-amissl --without-ssl --without-openssl --without-gnutls --without-mbedtls \
            --without-wolfssl --without-bearssl --without-rustls --without-test-nghttpx \
            --without-test-caddy --without-test-httpd --without-pic --without-aix-soname \
            --without-gnu-ld --without-sysroot --without-mingw1-deprecated --without-hyper \
            --without-zlib --without-brotli --without-zstd --without-ldap-lib --without-lber-lib \
            --without-gssapi-includes --without-gssapi-libs --without-gssapi \
            --without-default-ssl-backend --without-random --without-ca-bundle --without-ca-path \
            --without-ca-fallback --without-libpsl --without-libgsasl --without-librtmp \
            --without-winidn --without-libidn2 --without-ngtcp2 --without-quiche --without-msh3 \
            --without-zsh-functions-dir --without-fish-functions-dir \
            CFLAGS=-fPIC $HORSCHT \
     && make clean && make -j$(nproc) && make install \
     && (cd build/usr_local \
        && rm -rf share/aclocal bin/curl-config lib/libcurl.la lib/pkgconfig \
        && tar --owner=0 --group=0 -czf "${CURL_BINTGZ:?}" * \
        && md5sum -b "${CURL_BINTGZ:?}" > "${CURL_BINTGZ:?}.md5" \
        ) \
     && cd .. && rm -rf "curl-curl-${CURL_VERSION_UGLY:?}" \
     );fi \
  && printf '\n  DONE\n\n'


### Install
true \
  && $SUDO tar -C "${INSTALL_ROOT:?}" -xzf "${CURL_BINTGZ:?}" \
  && true