xref: /aosp_15_r20/external/curl/docs/INSTALL.md (revision 6236dae45794135f37c4eb022389c904c8b0090d)
1*6236dae4SAndroid Build Coastguard Worker<!--
2*6236dae4SAndroid Build Coastguard WorkerCopyright (C) Daniel Stenberg, <[email protected]>, et al.
3*6236dae4SAndroid Build Coastguard Worker
4*6236dae4SAndroid Build Coastguard WorkerSPDX-License-Identifier: curl
5*6236dae4SAndroid Build Coastguard Worker-->
6*6236dae4SAndroid Build Coastguard Worker
7*6236dae4SAndroid Build Coastguard Worker# How to install curl and libcurl
8*6236dae4SAndroid Build Coastguard Worker
9*6236dae4SAndroid Build Coastguard Worker## Installing Binary Packages
10*6236dae4SAndroid Build Coastguard Worker
11*6236dae4SAndroid Build Coastguard WorkerLots of people download binary distributions of curl and libcurl. This
12*6236dae4SAndroid Build Coastguard Workerdocument does not describe how to install curl or libcurl using such a binary
13*6236dae4SAndroid Build Coastguard Workerpackage. This document describes how to compile, build and install curl and
14*6236dae4SAndroid Build Coastguard Workerlibcurl from source code.
15*6236dae4SAndroid Build Coastguard Worker
16*6236dae4SAndroid Build Coastguard Worker## Building using vcpkg
17*6236dae4SAndroid Build Coastguard Worker
18*6236dae4SAndroid Build Coastguard WorkerYou can download and install curl and libcurl using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
19*6236dae4SAndroid Build Coastguard Worker
20*6236dae4SAndroid Build Coastguard Worker    git clone https://github.com/Microsoft/vcpkg.git
21*6236dae4SAndroid Build Coastguard Worker    cd vcpkg
22*6236dae4SAndroid Build Coastguard Worker    ./bootstrap-vcpkg.sh
23*6236dae4SAndroid Build Coastguard Worker    ./vcpkg integrate install
24*6236dae4SAndroid Build Coastguard Worker    vcpkg install curl[tool]
25*6236dae4SAndroid Build Coastguard Worker
26*6236dae4SAndroid Build Coastguard WorkerThe curl port in vcpkg is kept up to date by Microsoft team members and
27*6236dae4SAndroid Build Coastguard Workercommunity contributors. If the version is out of date, please [create an issue
28*6236dae4SAndroid Build Coastguard Workeror pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
29*6236dae4SAndroid Build Coastguard Worker
30*6236dae4SAndroid Build Coastguard Worker## Building from git
31*6236dae4SAndroid Build Coastguard Worker
32*6236dae4SAndroid Build Coastguard WorkerIf you get your code off a git repository instead of a release tarball, see
33*6236dae4SAndroid Build Coastguard Workerthe `GIT-INFO.md` file in the root directory for specific instructions on how
34*6236dae4SAndroid Build Coastguard Workerto proceed.
35*6236dae4SAndroid Build Coastguard Worker
36*6236dae4SAndroid Build Coastguard Worker# Unix
37*6236dae4SAndroid Build Coastguard Worker
38*6236dae4SAndroid Build Coastguard WorkerA normal Unix installation is made in three or four steps (after you have
39*6236dae4SAndroid Build Coastguard Workerunpacked the source archive):
40*6236dae4SAndroid Build Coastguard Worker
41*6236dae4SAndroid Build Coastguard Worker    ./configure --with-openssl [--with-gnutls --with-wolfssl]
42*6236dae4SAndroid Build Coastguard Worker    make
43*6236dae4SAndroid Build Coastguard Worker    make test (optional)
44*6236dae4SAndroid Build Coastguard Worker    make install
45*6236dae4SAndroid Build Coastguard Worker
46*6236dae4SAndroid Build Coastguard Worker(Adjust the configure line accordingly to use the TLS library you want.)
47*6236dae4SAndroid Build Coastguard Worker
48*6236dae4SAndroid Build Coastguard WorkerYou probably need to be root when doing the last command.
49*6236dae4SAndroid Build Coastguard Worker
50*6236dae4SAndroid Build Coastguard WorkerGet a full listing of all available configure options by invoking it like:
51*6236dae4SAndroid Build Coastguard Worker
52*6236dae4SAndroid Build Coastguard Worker    ./configure --help
53*6236dae4SAndroid Build Coastguard Worker
54*6236dae4SAndroid Build Coastguard WorkerIf you want to install curl in a different file hierarchy than `/usr/local`,
55*6236dae4SAndroid Build Coastguard Workerspecify that when running configure:
56*6236dae4SAndroid Build Coastguard Worker
57*6236dae4SAndroid Build Coastguard Worker    ./configure --prefix=/path/to/curl/tree
58*6236dae4SAndroid Build Coastguard Worker
59*6236dae4SAndroid Build Coastguard WorkerIf you have write permission in that directory, you can do 'make install'
60*6236dae4SAndroid Build Coastguard Workerwithout being root. An example of this would be to make a local install in
61*6236dae4SAndroid Build Coastguard Workeryour own home directory:
62*6236dae4SAndroid Build Coastguard Worker
63*6236dae4SAndroid Build Coastguard Worker    ./configure --prefix=$HOME
64*6236dae4SAndroid Build Coastguard Worker    make
65*6236dae4SAndroid Build Coastguard Worker    make install
66*6236dae4SAndroid Build Coastguard Worker
67*6236dae4SAndroid Build Coastguard WorkerThe configure script always tries to find a working SSL library unless
68*6236dae4SAndroid Build Coastguard Workerexplicitly told not to. If you have OpenSSL installed in the default search
69*6236dae4SAndroid Build Coastguard Workerpath for your compiler/linker, you do not need to do anything special. If you
70*6236dae4SAndroid Build Coastguard Workerhave OpenSSL installed in `/usr/local/ssl`, you can run configure like:
71*6236dae4SAndroid Build Coastguard Worker
72*6236dae4SAndroid Build Coastguard Worker    ./configure --with-openssl
73*6236dae4SAndroid Build Coastguard Worker
74*6236dae4SAndroid Build Coastguard WorkerIf you have OpenSSL installed somewhere else (for example, `/opt/OpenSSL`) and
75*6236dae4SAndroid Build Coastguard Workeryou have pkg-config installed, set the pkg-config path first, like this:
76*6236dae4SAndroid Build Coastguard Worker
77*6236dae4SAndroid Build Coastguard Worker    env PKG_CONFIG_PATH=/opt/OpenSSL/lib/pkgconfig ./configure --with-openssl
78*6236dae4SAndroid Build Coastguard Worker
79*6236dae4SAndroid Build Coastguard WorkerWithout pkg-config installed, use this:
80*6236dae4SAndroid Build Coastguard Worker
81*6236dae4SAndroid Build Coastguard Worker    ./configure --with-openssl=/opt/OpenSSL
82*6236dae4SAndroid Build Coastguard Worker
83*6236dae4SAndroid Build Coastguard WorkerIf you insist on forcing a build without SSL support, you can run configure
84*6236dae4SAndroid Build Coastguard Workerlike this:
85*6236dae4SAndroid Build Coastguard Worker
86*6236dae4SAndroid Build Coastguard Worker    ./configure --without-ssl
87*6236dae4SAndroid Build Coastguard Worker
88*6236dae4SAndroid Build Coastguard WorkerIf you have OpenSSL installed, but with the libraries in one place and the
89*6236dae4SAndroid Build Coastguard Workerheader files somewhere else, you have to set the `LDFLAGS` and `CPPFLAGS`
90*6236dae4SAndroid Build Coastguard Workerenvironment variables prior to running configure. Something like this should
91*6236dae4SAndroid Build Coastguard Workerwork:
92*6236dae4SAndroid Build Coastguard Worker
93*6236dae4SAndroid Build Coastguard Worker    CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" ./configure
94*6236dae4SAndroid Build Coastguard Worker
95*6236dae4SAndroid Build Coastguard WorkerIf you have shared SSL libs installed in a directory where your runtime
96*6236dae4SAndroid Build Coastguard Workerlinker does not find them (which usually causes configure failures), you can
97*6236dae4SAndroid Build Coastguard Workerprovide this option to gcc to set a hard-coded path to the runtime linker:
98*6236dae4SAndroid Build Coastguard Worker
99*6236dae4SAndroid Build Coastguard Worker    LDFLAGS=-Wl,-R/usr/local/ssl/lib ./configure --with-openssl
100*6236dae4SAndroid Build Coastguard Worker
101*6236dae4SAndroid Build Coastguard Worker## Static builds
102*6236dae4SAndroid Build Coastguard Worker
103*6236dae4SAndroid Build Coastguard WorkerTo force a static library compile, disable the shared library creation by
104*6236dae4SAndroid Build Coastguard Workerrunning configure like:
105*6236dae4SAndroid Build Coastguard Worker
106*6236dae4SAndroid Build Coastguard Worker    ./configure --disable-shared
107*6236dae4SAndroid Build Coastguard Worker
108*6236dae4SAndroid Build Coastguard WorkerThe configure script is primarily done to work with shared/dynamic third party
109*6236dae4SAndroid Build Coastguard Workerdependencies. When linking with shared libraries, the dependency "chain" is
110*6236dae4SAndroid Build Coastguard Workerhandled automatically by the library loader - on all modern systems.
111*6236dae4SAndroid Build Coastguard Worker
112*6236dae4SAndroid Build Coastguard WorkerIf you instead link with a static library, you need to provide all the
113*6236dae4SAndroid Build Coastguard Workerdependency libraries already at the link command line.
114*6236dae4SAndroid Build Coastguard Worker
115*6236dae4SAndroid Build Coastguard WorkerFiguring out all the dependency libraries for a given library is hard, as it
116*6236dae4SAndroid Build Coastguard Workermight involve figuring out the dependencies of the dependencies and they vary
117*6236dae4SAndroid Build Coastguard Workerbetween platforms and change between versions.
118*6236dae4SAndroid Build Coastguard Worker
119*6236dae4SAndroid Build Coastguard WorkerWhen using static dependencies, the build scripts mostly assume that you, the
120*6236dae4SAndroid Build Coastguard Workeruser, provide all the necessary additional dependency libraries as additional
121*6236dae4SAndroid Build Coastguard Workerarguments in the build. With configure, by setting `LIBS` or `LDFLAGS` on the
122*6236dae4SAndroid Build Coastguard Workercommand line.
123*6236dae4SAndroid Build Coastguard Worker
124*6236dae4SAndroid Build Coastguard WorkerBuilding statically is not for the faint of heart.
125*6236dae4SAndroid Build Coastguard Worker
126*6236dae4SAndroid Build Coastguard Worker## Debug
127*6236dae4SAndroid Build Coastguard Worker
128*6236dae4SAndroid Build Coastguard WorkerIf you are a curl developer and use gcc, you might want to enable more debug
129*6236dae4SAndroid Build Coastguard Workeroptions with the `--enable-debug` option.
130*6236dae4SAndroid Build Coastguard Worker
131*6236dae4SAndroid Build Coastguard Workercurl can be built to use a whole range of libraries to provide various useful
132*6236dae4SAndroid Build Coastguard Workerservices, and configure tries to auto-detect a decent default. If you want to
133*6236dae4SAndroid Build Coastguard Workeralter it, you can select how to deal with each individual library.
134*6236dae4SAndroid Build Coastguard Worker
135*6236dae4SAndroid Build Coastguard Worker## Select TLS backend
136*6236dae4SAndroid Build Coastguard Worker
137*6236dae4SAndroid Build Coastguard WorkerThese options are provided to select the TLS backend to use.
138*6236dae4SAndroid Build Coastguard Worker
139*6236dae4SAndroid Build Coastguard Worker - AmiSSL: `--with-amissl`
140*6236dae4SAndroid Build Coastguard Worker - BearSSL: `--with-bearssl`
141*6236dae4SAndroid Build Coastguard Worker - GnuTLS: `--with-gnutls`.
142*6236dae4SAndroid Build Coastguard Worker - mbedTLS: `--with-mbedtls`
143*6236dae4SAndroid Build Coastguard Worker - OpenSSL: `--with-openssl` (also for BoringSSL, AWS-LC, LibreSSL, and quictls)
144*6236dae4SAndroid Build Coastguard Worker - rustls: `--with-rustls`
145*6236dae4SAndroid Build Coastguard Worker - Schannel: `--with-schannel`
146*6236dae4SAndroid Build Coastguard Worker - Secure Transport: `--with-secure-transport`
147*6236dae4SAndroid Build Coastguard Worker - wolfSSL: `--with-wolfssl`
148*6236dae4SAndroid Build Coastguard Worker
149*6236dae4SAndroid Build Coastguard WorkerYou can build curl with *multiple* TLS backends at your choice, but some TLS
150*6236dae4SAndroid Build Coastguard Workerbackends cannot be combined: if you build with an OpenSSL fork (or wolfSSL),
151*6236dae4SAndroid Build Coastguard Workeryou cannot add another OpenSSL fork (or wolfSSL) simply because they have
152*6236dae4SAndroid Build Coastguard Workerconflicting identical symbol names.
153*6236dae4SAndroid Build Coastguard Worker
154*6236dae4SAndroid Build Coastguard WorkerWhen you build with multiple TLS backends, you can select the active one at
155*6236dae4SAndroid Build Coastguard Workerruntime when curl starts up.
156*6236dae4SAndroid Build Coastguard Worker
157*6236dae4SAndroid Build Coastguard Worker## MultiSSL and HTTP/3
158*6236dae4SAndroid Build Coastguard Worker
159*6236dae4SAndroid Build Coastguard WorkerHTTP/3 needs QUIC and QUIC needs TLS. Building libcurl with HTTP/3 and QUIC
160*6236dae4SAndroid Build Coastguard Workersupport is not compatible with the MultiSSL feature: they are mutually
161*6236dae4SAndroid Build Coastguard Workerexclusive. If you need MultiSSL in your build, you cannot have HTTP/3 support
162*6236dae4SAndroid Build Coastguard Workerand vice versa.
163*6236dae4SAndroid Build Coastguard Worker
164*6236dae4SAndroid Build Coastguard Workerlibcurl can only use a single TLS library with QUIC and that *same* TLS
165*6236dae4SAndroid Build Coastguard Workerlibrary needs to be used for the other TLS using protocols.
166*6236dae4SAndroid Build Coastguard Worker
167*6236dae4SAndroid Build Coastguard Worker## Configure finding libs in wrong directory
168*6236dae4SAndroid Build Coastguard Worker
169*6236dae4SAndroid Build Coastguard WorkerWhen the configure script checks for third-party libraries, it adds those
170*6236dae4SAndroid Build Coastguard Workerdirectories to the `LDFLAGS` variable and then tries linking to see if it
171*6236dae4SAndroid Build Coastguard Workerworks. When successful, the found directory is kept in the `LDFLAGS` variable
172*6236dae4SAndroid Build Coastguard Workerwhen the script continues to execute and do more tests and possibly check for
173*6236dae4SAndroid Build Coastguard Workermore libraries.
174*6236dae4SAndroid Build Coastguard Worker
175*6236dae4SAndroid Build Coastguard WorkerThis can make subsequent checks for libraries wrongly detect another
176*6236dae4SAndroid Build Coastguard Workerinstallation in a directory that was previously added to `LDFLAGS` by another
177*6236dae4SAndroid Build Coastguard Workerlibrary check.
178*6236dae4SAndroid Build Coastguard Worker
179*6236dae4SAndroid Build Coastguard Worker# Windows
180*6236dae4SAndroid Build Coastguard Worker
181*6236dae4SAndroid Build Coastguard WorkerBuilding for Windows XP is required as a minimum.
182*6236dae4SAndroid Build Coastguard Worker
183*6236dae4SAndroid Build Coastguard Worker## Building Windows DLLs and C runtime (CRT) linkage issues
184*6236dae4SAndroid Build Coastguard Worker
185*6236dae4SAndroid Build Coastguard Worker As a general rule, building a DLL with static CRT linkage is highly
186*6236dae4SAndroid Build Coastguard Worker discouraged, and intermixing CRTs in the same app is something to avoid at
187*6236dae4SAndroid Build Coastguard Worker any cost.
188*6236dae4SAndroid Build Coastguard Worker
189*6236dae4SAndroid Build Coastguard Worker Reading and comprehending Microsoft Knowledge Base articles KB94248 and
190*6236dae4SAndroid Build Coastguard Worker KB140584 is a must for any Windows developer. Especially important is full
191*6236dae4SAndroid Build Coastguard Worker understanding if you are not going to follow the advice given above.
192*6236dae4SAndroid Build Coastguard Worker
193*6236dae4SAndroid Build Coastguard Worker - [How To Use the C Runtime](https://support.microsoft.com/help/94248/how-to-use-the-c-run-time)
194*6236dae4SAndroid Build Coastguard Worker - [Runtime Library Compiler Options](https://docs.microsoft.com/cpp/build/reference/md-mt-ld-use-run-time-library)
195*6236dae4SAndroid Build Coastguard Worker - [Potential Errors Passing CRT Objects Across DLL Boundaries](https://docs.microsoft.com/cpp/c-runtime-library/potential-errors-passing-crt-objects-across-dll-boundaries)
196*6236dae4SAndroid Build Coastguard Worker
197*6236dae4SAndroid Build Coastguard WorkerIf your app is misbehaving in some strange way, or it is suffering from memory
198*6236dae4SAndroid Build Coastguard Workercorruption, before asking for further help, please try first to rebuild every
199*6236dae4SAndroid Build Coastguard Workersingle library your app uses as well as your app using the debug
200*6236dae4SAndroid Build Coastguard Workermulti-threaded dynamic C runtime.
201*6236dae4SAndroid Build Coastguard Worker
202*6236dae4SAndroid Build Coastguard Worker If you get linkage errors read section 5.7 of the FAQ document.
203*6236dae4SAndroid Build Coastguard Worker
204*6236dae4SAndroid Build Coastguard Worker## Cygwin
205*6236dae4SAndroid Build Coastguard Worker
206*6236dae4SAndroid Build Coastguard WorkerAlmost identical to the Unix installation. Run the configure script in the
207*6236dae4SAndroid Build Coastguard Workercurl source tree root with `sh configure`. Make sure you have the `sh`
208*6236dae4SAndroid Build Coastguard Workerexecutable in `/bin/` or you see the configure fail toward the end.
209*6236dae4SAndroid Build Coastguard Worker
210*6236dae4SAndroid Build Coastguard WorkerRun `make`
211*6236dae4SAndroid Build Coastguard Worker
212*6236dae4SAndroid Build Coastguard Worker## MS-DOS
213*6236dae4SAndroid Build Coastguard Worker
214*6236dae4SAndroid Build Coastguard WorkerRequires DJGPP in the search path and pointing to the Watt-32 stack via
215*6236dae4SAndroid Build Coastguard Worker`WATT_PATH=c:/djgpp/net/watt`.
216*6236dae4SAndroid Build Coastguard Worker
217*6236dae4SAndroid Build Coastguard WorkerRun `make -f Makefile.dist djgpp` in the root curl dir.
218*6236dae4SAndroid Build Coastguard Worker
219*6236dae4SAndroid Build Coastguard WorkerFor build configuration options, please see the mingw-w64 section.
220*6236dae4SAndroid Build Coastguard Worker
221*6236dae4SAndroid Build Coastguard WorkerNotes:
222*6236dae4SAndroid Build Coastguard Worker
223*6236dae4SAndroid Build Coastguard Worker - DJGPP 2.04 beta has a `sscanf()` bug so the URL parsing is not done
224*6236dae4SAndroid Build Coastguard Worker   properly. Use DJGPP 2.03 until they fix it.
225*6236dae4SAndroid Build Coastguard Worker
226*6236dae4SAndroid Build Coastguard Worker - Compile Watt-32 (and OpenSSL) with the same version of DJGPP. Otherwise
227*6236dae4SAndroid Build Coastguard Worker   things go wrong because things like FS-extensions and `errno` values have
228*6236dae4SAndroid Build Coastguard Worker   been changed between releases.
229*6236dae4SAndroid Build Coastguard Worker
230*6236dae4SAndroid Build Coastguard Worker## AmigaOS
231*6236dae4SAndroid Build Coastguard Worker
232*6236dae4SAndroid Build Coastguard WorkerRun `make -f Makefile.dist amiga` in the root curl dir.
233*6236dae4SAndroid Build Coastguard Worker
234*6236dae4SAndroid Build Coastguard WorkerFor build configuration options, please see the mingw-w64 section.
235*6236dae4SAndroid Build Coastguard Worker
236*6236dae4SAndroid Build Coastguard Worker## Disabling Specific Protocols in Windows builds
237*6236dae4SAndroid Build Coastguard Worker
238*6236dae4SAndroid Build Coastguard WorkerThe configure utility, unfortunately, is not available for the Windows
239*6236dae4SAndroid Build Coastguard Workerenvironment, therefore, you cannot use the various disable-protocol options of
240*6236dae4SAndroid Build Coastguard Workerthe configure utility on this platform.
241*6236dae4SAndroid Build Coastguard Worker
242*6236dae4SAndroid Build Coastguard WorkerYou can use specific defines to disable specific protocols and features. See
243*6236dae4SAndroid Build Coastguard Worker[CURL-DISABLE](CURL-DISABLE.md) for the full list.
244*6236dae4SAndroid Build Coastguard Worker
245*6236dae4SAndroid Build Coastguard WorkerIf you want to set any of these defines you have the following options:
246*6236dae4SAndroid Build Coastguard Worker
247*6236dae4SAndroid Build Coastguard Worker - Modify `lib/config-win32.h`
248*6236dae4SAndroid Build Coastguard Worker - Modify `lib/curl_setup.h`
249*6236dae4SAndroid Build Coastguard Worker - Modify `winbuild/Makefile.vc`
250*6236dae4SAndroid Build Coastguard Worker - Modify the "Preprocessor Definitions" in the libcurl project
251*6236dae4SAndroid Build Coastguard Worker
252*6236dae4SAndroid Build Coastguard WorkerNote: The pre-processor settings can be found using the Visual Studio IDE
253*6236dae4SAndroid Build Coastguard Workerunder "Project -> Properties -> Configuration Properties -> C/C++ ->
254*6236dae4SAndroid Build Coastguard WorkerPreprocessor".
255*6236dae4SAndroid Build Coastguard Worker
256*6236dae4SAndroid Build Coastguard Worker## Using BSD-style lwIP instead of Winsock TCP/IP stack in Windows builds
257*6236dae4SAndroid Build Coastguard Worker
258*6236dae4SAndroid Build Coastguard WorkerIn order to compile libcurl and curl using BSD-style lwIP TCP/IP stack it is
259*6236dae4SAndroid Build Coastguard Workernecessary to make the definition of the preprocessor symbol `USE_LWIPSOCK`
260*6236dae4SAndroid Build Coastguard Workervisible to libcurl and curl compilation processes. To set this definition you
261*6236dae4SAndroid Build Coastguard Workerhave the following alternatives:
262*6236dae4SAndroid Build Coastguard Worker
263*6236dae4SAndroid Build Coastguard Worker - Modify `lib/config-win32.h` and `src/config-win32.h`
264*6236dae4SAndroid Build Coastguard Worker - Modify `winbuild/Makefile.vc`
265*6236dae4SAndroid Build Coastguard Worker - Modify the "Preprocessor Definitions" in the libcurl project
266*6236dae4SAndroid Build Coastguard Worker
267*6236dae4SAndroid Build Coastguard WorkerNote: The pre-processor settings can be found using the Visual Studio IDE
268*6236dae4SAndroid Build Coastguard Workerunder "Project -> Properties -> Configuration Properties -> C/C++ ->
269*6236dae4SAndroid Build Coastguard WorkerPreprocessor".
270*6236dae4SAndroid Build Coastguard Worker
271*6236dae4SAndroid Build Coastguard WorkerOnce that libcurl has been built with BSD-style lwIP TCP/IP stack support, in
272*6236dae4SAndroid Build Coastguard Workerorder to use it with your program it is mandatory that your program includes
273*6236dae4SAndroid Build Coastguard WorkerlwIP header file `<lwip/opt.h>` (or another lwIP header that includes this)
274*6236dae4SAndroid Build Coastguard Workerbefore including any libcurl header. Your program does not need the
275*6236dae4SAndroid Build Coastguard Worker`USE_LWIPSOCK` preprocessor definition which is for libcurl internals only.
276*6236dae4SAndroid Build Coastguard Worker
277*6236dae4SAndroid Build Coastguard WorkerCompilation has been verified with lwIP 1.4.0.
278*6236dae4SAndroid Build Coastguard Worker
279*6236dae4SAndroid Build Coastguard WorkerThis BSD-style lwIP TCP/IP stack support must be considered experimental given
280*6236dae4SAndroid Build Coastguard Workerthat it has been verified that lwIP 1.4.0 still needs some polish, and libcurl
281*6236dae4SAndroid Build Coastguard Workermight yet need some additional adjustment.
282*6236dae4SAndroid Build Coastguard Worker
283*6236dae4SAndroid Build Coastguard Worker## Important static libcurl usage note
284*6236dae4SAndroid Build Coastguard Worker
285*6236dae4SAndroid Build Coastguard WorkerWhen building an application that uses the static libcurl library on Windows,
286*6236dae4SAndroid Build Coastguard Workeryou must add `-DCURL_STATICLIB` to your `CFLAGS`. Otherwise the linker looks
287*6236dae4SAndroid Build Coastguard Workerfor dynamic import symbols.
288*6236dae4SAndroid Build Coastguard Worker
289*6236dae4SAndroid Build Coastguard Worker## Legacy Windows and SSL
290*6236dae4SAndroid Build Coastguard Worker
291*6236dae4SAndroid Build Coastguard WorkerSchannel (from Windows SSPI), is the native SSL library in Windows. However,
292*6236dae4SAndroid Build Coastguard WorkerSchannel in Windows <= XP is unable to connect to servers that no longer
293*6236dae4SAndroid Build Coastguard Workersupport the legacy handshakes and algorithms used by those versions. If you
294*6236dae4SAndroid Build Coastguard Workerare using curl in one of those earlier versions of Windows you should choose
295*6236dae4SAndroid Build Coastguard Workeranother SSL backend such as OpenSSL.
296*6236dae4SAndroid Build Coastguard Worker
297*6236dae4SAndroid Build Coastguard Worker# Apple Platforms (macOS, iOS, tvOS, watchOS, and their simulator counterparts)
298*6236dae4SAndroid Build Coastguard Worker
299*6236dae4SAndroid Build Coastguard WorkerOn modern Apple operating systems, curl can be built to use Apple's SSL/TLS
300*6236dae4SAndroid Build Coastguard Workerimplementation, Secure Transport, instead of OpenSSL. To build with Secure
301*6236dae4SAndroid Build Coastguard WorkerTransport for SSL/TLS, use the configure option `--with-secure-transport`.
302*6236dae4SAndroid Build Coastguard Worker
303*6236dae4SAndroid Build Coastguard WorkerWhen Secure Transport is in use, the curl options `--cacert` and `--capath`
304*6236dae4SAndroid Build Coastguard Workerand their libcurl equivalents, are ignored, because Secure Transport uses the
305*6236dae4SAndroid Build Coastguard Workercertificates stored in the Keychain to evaluate whether or not to trust the
306*6236dae4SAndroid Build Coastguard Workerserver. This, of course, includes the root certificates that ship with the OS.
307*6236dae4SAndroid Build Coastguard WorkerThe `--cert` and `--engine` options, and their libcurl equivalents, are
308*6236dae4SAndroid Build Coastguard Workercurrently unimplemented in curl with Secure Transport.
309*6236dae4SAndroid Build Coastguard Worker
310*6236dae4SAndroid Build Coastguard WorkerIn general, a curl build for an Apple `ARCH/SDK/DEPLOYMENT_TARGET` combination
311*6236dae4SAndroid Build Coastguard Workercan be taken by providing appropriate values for `ARCH`, `SDK`, `DEPLOYMENT_TARGET`
312*6236dae4SAndroid Build Coastguard Workerbelow and running the commands:
313*6236dae4SAndroid Build Coastguard Worker
314*6236dae4SAndroid Build Coastguard Worker```bash
315*6236dae4SAndroid Build Coastguard Worker# Set these three according to your needs
316*6236dae4SAndroid Build Coastguard Workerexport ARCH=x86_64
317*6236dae4SAndroid Build Coastguard Workerexport SDK=macosx
318*6236dae4SAndroid Build Coastguard Workerexport DEPLOYMENT_TARGET=10.8
319*6236dae4SAndroid Build Coastguard Worker
320*6236dae4SAndroid Build Coastguard Workerexport CFLAGS="-arch $ARCH -isysroot $(xcrun -sdk $SDK --show-sdk-path) -m$SDK-version-min=$DEPLOYMENT_TARGET"
321*6236dae4SAndroid Build Coastguard Worker./configure --host=$ARCH-apple-darwin --prefix $(pwd)/artifacts --with-secure-transport
322*6236dae4SAndroid Build Coastguard Workermake -j8
323*6236dae4SAndroid Build Coastguard Workermake install
324*6236dae4SAndroid Build Coastguard Worker```
325*6236dae4SAndroid Build Coastguard Worker
326*6236dae4SAndroid Build Coastguard WorkerThe above command lines build curl for macOS platform with `x86_64`
327*6236dae4SAndroid Build Coastguard Workerarchitecture and `10.8` as deployment target.
328*6236dae4SAndroid Build Coastguard Worker
329*6236dae4SAndroid Build Coastguard WorkerHere is an example for iOS device:
330*6236dae4SAndroid Build Coastguard Worker
331*6236dae4SAndroid Build Coastguard Worker```bash
332*6236dae4SAndroid Build Coastguard Workerexport ARCH=arm64
333*6236dae4SAndroid Build Coastguard Workerexport SDK=iphoneos
334*6236dae4SAndroid Build Coastguard Workerexport DEPLOYMENT_TARGET=11.0
335*6236dae4SAndroid Build Coastguard Worker
336*6236dae4SAndroid Build Coastguard Workerexport CFLAGS="-arch $ARCH -isysroot $(xcrun -sdk $SDK --show-sdk-path) -m$SDK-version-min=$DEPLOYMENT_TARGET"
337*6236dae4SAndroid Build Coastguard Worker./configure --host=$ARCH-apple-darwin --prefix $(pwd)/artifacts --with-secure-transport
338*6236dae4SAndroid Build Coastguard Workermake -j8
339*6236dae4SAndroid Build Coastguard Workermake install
340*6236dae4SAndroid Build Coastguard Worker```
341*6236dae4SAndroid Build Coastguard Worker
342*6236dae4SAndroid Build Coastguard WorkerAnother example for watchOS simulator for macs with Apple Silicon:
343*6236dae4SAndroid Build Coastguard Worker
344*6236dae4SAndroid Build Coastguard Worker```bash
345*6236dae4SAndroid Build Coastguard Workerexport ARCH=arm64
346*6236dae4SAndroid Build Coastguard Workerexport SDK=watchsimulator
347*6236dae4SAndroid Build Coastguard Workerexport DEPLOYMENT_TARGET=5.0
348*6236dae4SAndroid Build Coastguard Worker
349*6236dae4SAndroid Build Coastguard Workerexport CFLAGS="-arch $ARCH -isysroot $(xcrun -sdk $SDK --show-sdk-path) -m$SDK-version-min=$DEPLOYMENT_TARGET"
350*6236dae4SAndroid Build Coastguard Worker./configure --host=$ARCH-apple-darwin --prefix $(pwd)/artifacts --with-secure-transport
351*6236dae4SAndroid Build Coastguard Workermake -j8
352*6236dae4SAndroid Build Coastguard Workermake install
353*6236dae4SAndroid Build Coastguard Worker```
354*6236dae4SAndroid Build Coastguard Worker
355*6236dae4SAndroid Build Coastguard WorkerIn all above, the built libraries and executables can be found in the
356*6236dae4SAndroid Build Coastguard Worker`artifacts` folder.
357*6236dae4SAndroid Build Coastguard Worker
358*6236dae4SAndroid Build Coastguard Worker# Android
359*6236dae4SAndroid Build Coastguard Worker
360*6236dae4SAndroid Build Coastguard WorkerWhen building curl for Android it is recommended to use a Linux/macOS
361*6236dae4SAndroid Build Coastguard Workerenvironment since using curl's `configure` script is the easiest way to build
362*6236dae4SAndroid Build Coastguard Workercurl for Android. Before you can build curl for Android, you need to install
363*6236dae4SAndroid Build Coastguard Workerthe Android NDK first. This can be done using the SDK Manager that is part of
364*6236dae4SAndroid Build Coastguard WorkerAndroid Studio. Once you have installed the Android NDK, you need to figure
365*6236dae4SAndroid Build Coastguard Workerout where it has been installed and then set up some environment variables
366*6236dae4SAndroid Build Coastguard Workerbefore launching `configure`. On macOS, those variables could look like this
367*6236dae4SAndroid Build Coastguard Workerto compile for `aarch64` and API level 29:
368*6236dae4SAndroid Build Coastguard Worker
369*6236dae4SAndroid Build Coastguard Worker```bash
370*6236dae4SAndroid Build Coastguard Workerexport ANDROID_NDK_HOME=~/Library/Android/sdk/ndk/25.1.8937393 # Point into your NDK.
371*6236dae4SAndroid Build Coastguard Workerexport HOST_TAG=darwin-x86_64 # Same tag for Apple Silicon. Other OS values here: https://developer.android.com/ndk/guides/other_build_systems#overview
372*6236dae4SAndroid Build Coastguard Workerexport TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$HOST_TAG
373*6236dae4SAndroid Build Coastguard Workerexport AR=$TOOLCHAIN/bin/llvm-ar
374*6236dae4SAndroid Build Coastguard Workerexport AS=$TOOLCHAIN/bin/llvm-as
375*6236dae4SAndroid Build Coastguard Workerexport CC=$TOOLCHAIN/bin/aarch64-linux-android21-clang
376*6236dae4SAndroid Build Coastguard Workerexport CXX=$TOOLCHAIN/bin/aarch64-linux-android21-clang++
377*6236dae4SAndroid Build Coastguard Workerexport LD=$TOOLCHAIN/bin/ld
378*6236dae4SAndroid Build Coastguard Workerexport RANLIB=$TOOLCHAIN/bin/llvm-ranlib
379*6236dae4SAndroid Build Coastguard Workerexport STRIP=$TOOLCHAIN/bin/llvm-strip
380*6236dae4SAndroid Build Coastguard Worker```
381*6236dae4SAndroid Build Coastguard Worker
382*6236dae4SAndroid Build Coastguard WorkerWhen building on Linux or targeting other API levels or architectures, you need
383*6236dae4SAndroid Build Coastguard Workerto adjust those variables accordingly. After that you can build curl like this:
384*6236dae4SAndroid Build Coastguard Worker
385*6236dae4SAndroid Build Coastguard Worker    ./configure --host aarch64-linux-android --with-pic --disable-shared
386*6236dae4SAndroid Build Coastguard Worker
387*6236dae4SAndroid Build Coastguard WorkerNote that this does not give you SSL/TLS support. If you need SSL/TLS, you
388*6236dae4SAndroid Build Coastguard Workerhave to build curl with a SSL/TLS library, e.g. OpenSSL, because it is
389*6236dae4SAndroid Build Coastguard Workerimpossible for curl to access Android's native SSL/TLS layer. To build curl
390*6236dae4SAndroid Build Coastguard Workerfor Android using OpenSSL, follow the OpenSSL build instructions and then
391*6236dae4SAndroid Build Coastguard Workerinstall `libssl.a` and `libcrypto.a` to `$TOOLCHAIN/sysroot/usr/lib` and copy
392*6236dae4SAndroid Build Coastguard Worker`include/openssl` to `$TOOLCHAIN/sysroot/usr/include`. Now you can build curl
393*6236dae4SAndroid Build Coastguard Workerfor Android using OpenSSL like this:
394*6236dae4SAndroid Build Coastguard Worker
395*6236dae4SAndroid Build Coastguard Worker```bash
396*6236dae4SAndroid Build Coastguard WorkerLIBS="-lssl -lcrypto -lc++" # For OpenSSL/BoringSSL. In general, you need to the SSL/TLS layer's transitive dependencies if you are linking statically.
397*6236dae4SAndroid Build Coastguard Worker./configure --host aarch64-linux-android --with-pic --disable-shared --with-openssl="$TOOLCHAIN/sysroot/usr"
398*6236dae4SAndroid Build Coastguard Worker```
399*6236dae4SAndroid Build Coastguard Worker
400*6236dae4SAndroid Build Coastguard Worker# IBM i
401*6236dae4SAndroid Build Coastguard Worker
402*6236dae4SAndroid Build Coastguard WorkerFor IBM i (formerly OS/400), you can use curl in two different ways:
403*6236dae4SAndroid Build Coastguard Worker
404*6236dae4SAndroid Build Coastguard Worker- Natively, running in the **ILE**. The obvious use is being able to call curl
405*6236dae4SAndroid Build Coastguard Worker  from ILE C or RPG applications.
406*6236dae4SAndroid Build Coastguard Worker- You need to build this from source. See `packages/OS400/README` for the ILE
407*6236dae4SAndroid Build Coastguard Worker  specific build instructions.
408*6236dae4SAndroid Build Coastguard Worker- In the **PASE** environment, which runs AIX programs. curl is built as it
409*6236dae4SAndroid Build Coastguard Worker  would be on AIX.
410*6236dae4SAndroid Build Coastguard Worker- IBM provides builds of curl in their Yum repository for PASE software.
411*6236dae4SAndroid Build Coastguard Worker- To build from source, follow the Unix instructions.
412*6236dae4SAndroid Build Coastguard Worker
413*6236dae4SAndroid Build Coastguard WorkerThere are some additional limitations and quirks with curl on this platform;
414*6236dae4SAndroid Build Coastguard Workerthey affect both environments.
415*6236dae4SAndroid Build Coastguard Worker
416*6236dae4SAndroid Build Coastguard Worker## Multi-threading notes
417*6236dae4SAndroid Build Coastguard Worker
418*6236dae4SAndroid Build Coastguard WorkerBy default, jobs in IBM i does not start with threading enabled. (Exceptions
419*6236dae4SAndroid Build Coastguard Workerinclude interactive PASE sessions started by `QP2TERM` or SSH.) If you use
420*6236dae4SAndroid Build Coastguard Workercurl in an environment without threading when options like asynchronous DNS
421*6236dae4SAndroid Build Coastguard Workerwere enabled, you get messages like:
422*6236dae4SAndroid Build Coastguard Worker
423*6236dae4SAndroid Build Coastguard Worker```
424*6236dae4SAndroid Build Coastguard Workergetaddrinfo() thread failed to start
425*6236dae4SAndroid Build Coastguard Worker```
426*6236dae4SAndroid Build Coastguard Worker
427*6236dae4SAndroid Build Coastguard WorkerDo not panic. curl and your program are not broken. You can fix this by:
428*6236dae4SAndroid Build Coastguard Worker
429*6236dae4SAndroid Build Coastguard Worker- Set the environment variable `QIBM_MULTI_THREADED` to `Y` before starting
430*6236dae4SAndroid Build Coastguard Worker  your program. This can be done at whatever scope you feel is appropriate.
431*6236dae4SAndroid Build Coastguard Worker- Alternatively, start the job with the `ALWMLTTHD` parameter set to `*YES`.
432*6236dae4SAndroid Build Coastguard Worker
433*6236dae4SAndroid Build Coastguard Worker# Cross compile
434*6236dae4SAndroid Build Coastguard Worker
435*6236dae4SAndroid Build Coastguard WorkerDownload and unpack the curl package.
436*6236dae4SAndroid Build Coastguard Worker
437*6236dae4SAndroid Build Coastguard Worker`cd` to the new directory. (e.g. `cd curl-7.12.3`)
438*6236dae4SAndroid Build Coastguard Worker
439*6236dae4SAndroid Build Coastguard WorkerSet environment variables to point to the cross-compile toolchain and call
440*6236dae4SAndroid Build Coastguard Workerconfigure with any options you need. Be sure and specify the `--host` and
441*6236dae4SAndroid Build Coastguard Worker`--build` parameters at configuration time. The following script is an example
442*6236dae4SAndroid Build Coastguard Workerof cross-compiling for the IBM 405GP PowerPC processor using the toolchain on
443*6236dae4SAndroid Build Coastguard WorkerLinux.
444*6236dae4SAndroid Build Coastguard Worker
445*6236dae4SAndroid Build Coastguard Worker```bash
446*6236dae4SAndroid Build Coastguard Worker#! /bin/sh
447*6236dae4SAndroid Build Coastguard Worker
448*6236dae4SAndroid Build Coastguard Workerexport PATH=$PATH:/opt/hardhat/devkit/ppc/405/bin
449*6236dae4SAndroid Build Coastguard Workerexport CPPFLAGS="-I/opt/hardhat/devkit/ppc/405/target/usr/include"
450*6236dae4SAndroid Build Coastguard Workerexport AR=ppc_405-ar
451*6236dae4SAndroid Build Coastguard Workerexport AS=ppc_405-as
452*6236dae4SAndroid Build Coastguard Workerexport LD=ppc_405-ld
453*6236dae4SAndroid Build Coastguard Workerexport RANLIB=ppc_405-ranlib
454*6236dae4SAndroid Build Coastguard Workerexport CC=ppc_405-gcc
455*6236dae4SAndroid Build Coastguard Workerexport NM=ppc_405-nm
456*6236dae4SAndroid Build Coastguard Worker
457*6236dae4SAndroid Build Coastguard Worker./configure --target=powerpc-hardhat-linux
458*6236dae4SAndroid Build Coastguard Worker    --host=powerpc-hardhat-linux
459*6236dae4SAndroid Build Coastguard Worker    --build=i586-pc-linux-gnu
460*6236dae4SAndroid Build Coastguard Worker    --prefix=/opt/hardhat/devkit/ppc/405/target/usr/local
461*6236dae4SAndroid Build Coastguard Worker    --exec-prefix=/usr/local
462*6236dae4SAndroid Build Coastguard Worker```
463*6236dae4SAndroid Build Coastguard Worker
464*6236dae4SAndroid Build Coastguard WorkerYou may also need to provide a parameter like `--with-random=/dev/urandom` to
465*6236dae4SAndroid Build Coastguard Workerconfigure as it cannot detect the presence of a random number generating
466*6236dae4SAndroid Build Coastguard Workerdevice for a target system. The `--prefix` parameter specifies where curl gets
467*6236dae4SAndroid Build Coastguard Workerinstalled. If `configure` completes successfully, do `make` and `make install`
468*6236dae4SAndroid Build Coastguard Workeras usual.
469*6236dae4SAndroid Build Coastguard Worker
470*6236dae4SAndroid Build Coastguard WorkerIn some cases, you may be able to simplify the above commands to as little as:
471*6236dae4SAndroid Build Coastguard Worker
472*6236dae4SAndroid Build Coastguard Worker    ./configure --host=ARCH-OS
473*6236dae4SAndroid Build Coastguard Worker
474*6236dae4SAndroid Build Coastguard Worker# REDUCING SIZE
475*6236dae4SAndroid Build Coastguard Worker
476*6236dae4SAndroid Build Coastguard WorkerThere are a number of configure options that can be used to reduce the size of
477*6236dae4SAndroid Build Coastguard Workerlibcurl for embedded applications where binary size is an important factor.
478*6236dae4SAndroid Build Coastguard WorkerFirst, be sure to set the `CFLAGS` variable when configuring with any relevant
479*6236dae4SAndroid Build Coastguard Workercompiler optimization flags to reduce the size of the binary. For gcc, this
480*6236dae4SAndroid Build Coastguard Workerwould mean at minimum the `-Os` option, and others like the following that
481*6236dae4SAndroid Build Coastguard Workermay be relevant in some environments: `-march=X`, `-mthumb`, `-m32`,
482*6236dae4SAndroid Build Coastguard Worker`-mdynamic-no-pic`, `-flto`, `-fdata-sections`, `-ffunction-sections`,
483*6236dae4SAndroid Build Coastguard Worker`-fno-unwind-tables`, `-fno-asynchronous-unwind-tables`,
484*6236dae4SAndroid Build Coastguard Worker`-fno-record-gcc-switches`, `-fsection-anchors`, `-fno-plt`,
485*6236dae4SAndroid Build Coastguard Worker`-Wl,--gc-sections`, `-Wl,-Bsymbolic`, `-Wl,-s`,
486*6236dae4SAndroid Build Coastguard Worker
487*6236dae4SAndroid Build Coastguard WorkerFor example, this is how to combine a few of these options:
488*6236dae4SAndroid Build Coastguard Worker
489*6236dae4SAndroid Build Coastguard Worker    ./configure CC=gcc CFLAGS='-Os -ffunction-sections' LDFLAGS='-Wl,--gc-sections'...
490*6236dae4SAndroid Build Coastguard Worker
491*6236dae4SAndroid Build Coastguard WorkerNote that newer compilers often produce smaller code than older versions
492*6236dae4SAndroid Build Coastguard Workerdue to improved optimization.
493*6236dae4SAndroid Build Coastguard Worker
494*6236dae4SAndroid Build Coastguard WorkerBe sure to specify as many `--disable-` and `--without-` flags on the
495*6236dae4SAndroid Build Coastguard Workerconfigure command-line as you can to disable all the libcurl features that you
496*6236dae4SAndroid Build Coastguard Workerknow your application is not going to need. Besides specifying the
497*6236dae4SAndroid Build Coastguard Worker`--disable-PROTOCOL` flags for all the types of URLs your application do not
498*6236dae4SAndroid Build Coastguard Workeruse, here are some other flags that can reduce the size of the library by
499*6236dae4SAndroid Build Coastguard Workerdisabling support for some feature (run `./configure --help` to see them all):
500*6236dae4SAndroid Build Coastguard Worker
501*6236dae4SAndroid Build Coastguard Worker - `--disable-alt-svc` (HTTP Alt-Svc)
502*6236dae4SAndroid Build Coastguard Worker - `--disable-ares` (the C-ARES DNS library)
503*6236dae4SAndroid Build Coastguard Worker - `--disable-cookies` (HTTP cookies)
504*6236dae4SAndroid Build Coastguard Worker - `--disable-basic-auth` (cryptographic authentication)
505*6236dae4SAndroid Build Coastguard Worker - `--disable-bearer-auth` (cryptographic authentication)
506*6236dae4SAndroid Build Coastguard Worker - `--disable-digest-auth` (cryptographic authentication)
507*6236dae4SAndroid Build Coastguard Worker - `--disable-kerberos-auth` (cryptographic authentication)
508*6236dae4SAndroid Build Coastguard Worker - `--disable-negotiate-auth` (cryptographic authentication)
509*6236dae4SAndroid Build Coastguard Worker - `--disable-aws` (cryptographic authentication)
510*6236dae4SAndroid Build Coastguard Worker - `--disable-dateparse` (date parsing for time conditionals)
511*6236dae4SAndroid Build Coastguard Worker - `--disable-dnsshuffle` (internal server load spreading)
512*6236dae4SAndroid Build Coastguard Worker - `--disable-doh` (DNS-over-HTTP)
513*6236dae4SAndroid Build Coastguard Worker - `--disable-form-api` (POST form API)
514*6236dae4SAndroid Build Coastguard Worker - `--disable-get-easy-options` (lookup easy options at runtime)
515*6236dae4SAndroid Build Coastguard Worker - `--disable-headers-api` (API to access headers)
516*6236dae4SAndroid Build Coastguard Worker - `--disable-hsts` (HTTP Strict Transport Security)
517*6236dae4SAndroid Build Coastguard Worker - `--disable-http-auth` (all HTTP authentication)
518*6236dae4SAndroid Build Coastguard Worker - `--disable-ipv6` (IPv6)
519*6236dae4SAndroid Build Coastguard Worker - `--disable-libcurl-option` (--libcurl C code generation support)
520*6236dae4SAndroid Build Coastguard Worker - `--disable-manual` (--manual built-in documentation)
521*6236dae4SAndroid Build Coastguard Worker - `--disable-mime` (MIME API)
522*6236dae4SAndroid Build Coastguard Worker - `--disable-netrc`  (.netrc file)
523*6236dae4SAndroid Build Coastguard Worker - `--disable-ntlm` (NTLM authentication)
524*6236dae4SAndroid Build Coastguard Worker - `--disable-ntlm-wb` (NTLM winbind)
525*6236dae4SAndroid Build Coastguard Worker - `--disable-progress-meter` (graphical progress meter in library)
526*6236dae4SAndroid Build Coastguard Worker - `--disable-proxy` (HTTP and SOCKS proxies)
527*6236dae4SAndroid Build Coastguard Worker - `--disable-pthreads` (multi-threading)
528*6236dae4SAndroid Build Coastguard Worker - `--disable-socketpair` (socketpair for asynchronous name resolving)
529*6236dae4SAndroid Build Coastguard Worker - `--disable-threaded-resolver`  (threaded name resolver)
530*6236dae4SAndroid Build Coastguard Worker - `--disable-tls-srp` (Secure Remote Password authentication for TLS)
531*6236dae4SAndroid Build Coastguard Worker - `--disable-unix-sockets` (Unix sockets)
532*6236dae4SAndroid Build Coastguard Worker - `--disable-verbose` (eliminates debugging strings and error code strings)
533*6236dae4SAndroid Build Coastguard Worker - `--disable-versioned-symbols` (versioned symbols)
534*6236dae4SAndroid Build Coastguard Worker - `--enable-symbol-hiding` (eliminates unneeded symbols in the shared library)
535*6236dae4SAndroid Build Coastguard Worker - `--without-brotli` (Brotli on-the-fly decompression)
536*6236dae4SAndroid Build Coastguard Worker - `--without-libpsl` (Public Suffix List in cookies)
537*6236dae4SAndroid Build Coastguard Worker - `--without-nghttp2` (HTTP/2 using nghttp2)
538*6236dae4SAndroid Build Coastguard Worker - `--without-ngtcp2` (HTTP/2 using ngtcp2)
539*6236dae4SAndroid Build Coastguard Worker - `--without-zstd` (Zstd on-the-fly decompression)
540*6236dae4SAndroid Build Coastguard Worker - `--without-libidn2` (internationalized domain names)
541*6236dae4SAndroid Build Coastguard Worker - `--without-librtmp` (RTMP)
542*6236dae4SAndroid Build Coastguard Worker - `--without-ssl` (SSL/TLS)
543*6236dae4SAndroid Build Coastguard Worker - `--without-zlib` (on-the-fly decompression)
544*6236dae4SAndroid Build Coastguard Worker
545*6236dae4SAndroid Build Coastguard WorkerBe sure also to strip debugging symbols from your binaries after compiling
546*6236dae4SAndroid Build Coastguard Workerusing 'strip' or an option like `-s`. If space is really tight, you may be able
547*6236dae4SAndroid Build Coastguard Workerto gain a few bytes by removing some unneeded sections of the shared library
548*6236dae4SAndroid Build Coastguard Workerusing the -R option to objcopy (e.g. the .comment section).
549*6236dae4SAndroid Build Coastguard Worker
550*6236dae4SAndroid Build Coastguard WorkerUsing these techniques it is possible to create a basic HTTP-only libcurl
551*6236dae4SAndroid Build Coastguard Workershared library for i386 Linux platforms that is only 130 KiB in size
552*6236dae4SAndroid Build Coastguard Worker(as of libcurl version 8.6.0, using gcc 13.2.0).
553*6236dae4SAndroid Build Coastguard Worker
554*6236dae4SAndroid Build Coastguard WorkerYou may find that statically linking libcurl to your application results in a
555*6236dae4SAndroid Build Coastguard Workerlower total size than dynamically linking.
556*6236dae4SAndroid Build Coastguard Worker
557*6236dae4SAndroid Build Coastguard WorkerThe curl test harness can detect the use of some, but not all, of the
558*6236dae4SAndroid Build Coastguard Worker`--disable` statements suggested above. Use of these can cause tests relying
559*6236dae4SAndroid Build Coastguard Workeron those features to fail. The test harness can be manually forced to skip the
560*6236dae4SAndroid Build Coastguard Workerrelevant tests by specifying certain key words on the `runtests.pl` command
561*6236dae4SAndroid Build Coastguard Workerline. Following is a list of appropriate key words for those configure options
562*6236dae4SAndroid Build Coastguard Workerthat are not automatically detected:
563*6236dae4SAndroid Build Coastguard Worker
564*6236dae4SAndroid Build Coastguard Worker - `--disable-cookies`          !cookies
565*6236dae4SAndroid Build Coastguard Worker - `--disable-dateparse`        !RETRY-AFTER !`CURLOPT_TIMECONDITION` !`CURLINFO_FILETIME` !`If-Modified-Since` !`curl_getdate` !`-z`
566*6236dae4SAndroid Build Coastguard Worker - `--disable-libcurl-option`   !`--libcurl`
567*6236dae4SAndroid Build Coastguard Worker - `--disable-verbose`          !verbose\ logs
568*6236dae4SAndroid Build Coastguard Worker
569*6236dae4SAndroid Build Coastguard Worker# Ports
570*6236dae4SAndroid Build Coastguard Worker
571*6236dae4SAndroid Build Coastguard WorkerThis is a probably incomplete list of known CPU architectures and operating
572*6236dae4SAndroid Build Coastguard Workersystems that curl has been compiled for. If you know a system curl compiles
573*6236dae4SAndroid Build Coastguard Workerand runs on, that is not listed, please let us know.
574*6236dae4SAndroid Build Coastguard Worker
575*6236dae4SAndroid Build Coastguard Worker## 101 Operating Systems
576*6236dae4SAndroid Build Coastguard Worker
577*6236dae4SAndroid Build Coastguard Worker    AIX, AmigaOS, Android, ArcoOS, Aros, Atari FreeMiNT, BeOS, Blackberry 10,
578*6236dae4SAndroid Build Coastguard Worker    Blackberry Tablet OS, Cell OS, CheriBSD, Chrome OS, Cisco IOS, DG/UX,
579*6236dae4SAndroid Build Coastguard Worker    Dragonfly BSD, DR DOS, eCOS, FreeBSD, FreeDOS, FreeRTOS, Fuchsia, Garmin OS,
580*6236dae4SAndroid Build Coastguard Worker    Genode, Haiku, HardenedBSD, HP-UX, Hurd, illumos, Integrity, iOS, ipadOS, IRIX,
581*6236dae4SAndroid Build Coastguard Worker    Linux, Lua RTOS, Mac OS 9, macOS, Mbed, Meego, Micrium, MINIX, Moblin, MorphOS,
582*6236dae4SAndroid Build Coastguard Worker    MPE/iX, MS-DOS, NCR MP-RAS, NetBSD, Netware, NextStep, Nintendo Switch,
583*6236dae4SAndroid Build Coastguard Worker    NonStop OS, NuttX, OpenBSD, OpenStep, Orbis OS, OS/2, OS/400, OS21, Plan 9,
584*6236dae4SAndroid Build Coastguard Worker    PlayStation Portable, QNX, Qubes OS, ReactOS, Redox, RISC OS, ROS, RTEMS,
585*6236dae4SAndroid Build Coastguard Worker    Sailfish OS, SCO Unix, Serenity, SINIX-Z, SkyOS, Solaris, Sortix, SunOS,
586*6236dae4SAndroid Build Coastguard Worker    Syllable OS, Symbian, Tizen, TPF, Tru64, tvOS, ucLinux, Ultrix, UNICOS,
587*6236dae4SAndroid Build Coastguard Worker    UnixWare, VMS, vxWorks, watchOS, Wear OS, WebOS, Wii system software, Wii U,
588*6236dae4SAndroid Build Coastguard Worker    Windows, Windows CE, Xbox System, Xenix, Zephyr, z/OS, z/TPF, z/VM, z/VSE
589*6236dae4SAndroid Build Coastguard Worker
590*6236dae4SAndroid Build Coastguard Worker## 28 CPU Architectures
591*6236dae4SAndroid Build Coastguard Worker
592*6236dae4SAndroid Build Coastguard Worker    Alpha, ARC, ARM, AVR32, C-SKY, CompactRISC, Elbrus, ETRAX, HP-PA, Itanium,
593*6236dae4SAndroid Build Coastguard Worker    LoongArch, m68k, m88k, MicroBlaze, MIPS, Nios, OpenRISC, POWER, PowerPC,
594*6236dae4SAndroid Build Coastguard Worker    RISC-V, s390, SH4, SPARC, Tilera, VAX, x86, Xtensa, z/arch
595