5 \___|\___/|_| \_\_____|
9 Installing Binary Packages
10 ==========================
12 Lots of people download binary distributions of curl and libcurl. This
13 document does not describe how to install curl or libcurl using such a
14 binary package. This document describes how to compile, build and install
15 curl and libcurl from source code.
19 A normal unix installation is made in three or four steps (after you've
20 unpacked the source archive):
27 You probably need to be root when doing the last command.
29 If you have checked out the sources from the CVS repository, read the
30 CVS-INFO on how to proceed.
32 Get a full listing of all available configure options by invoking it like:
36 If you want to install curl in a different file hierarchy than /usr/local,
37 you need to specify that already when running configure:
39 ./configure --prefix=/path/to/curl/tree
41 If you happen to have write permission in that directory, you can do 'make
42 install' without being root. An example of this would be to make a local
43 install in your own home directory:
45 ./configure --prefix=$HOME
49 The configure script always tries to find a working SSL library unless
50 explicitly told not to. If you have OpenSSL installed in the default search
51 path for your compiler/linker, you don't need to do anything special. If
52 you have OpenSSL installed in /usr/local/ssl, you can run configure like:
54 ./configure --with-ssl
56 If you have OpenSSL installed somewhere else (for example, /opt/OpenSSL)
57 and you have pkg-config installed, set the pkg-config path first, like this:
59 env PKG_CONFIG_PATH=/opt/OpenSSL/lib/pkgconfig ./configure --with-ssl
61 Without pkg-config installed, use this:
63 ./configure --with-ssl=/opt/OpenSSL
65 If you insist on forcing a build without SSL support, even though you may
66 have OpenSSL installed in your system, you can run configure like this:
68 ./configure --without-ssl
70 If you have OpenSSL installed, but with the libraries in one place and the
71 header files somewhere else, you have to set the LDFLAGS and CPPFLAGS
72 environment variables prior to running configure. Something like this
75 (with the Bourne shell and its clones):
77 CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \
80 (with csh, tcsh and their clones):
82 env CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \
85 If you have shared SSL libs installed in a directory where your run-time
86 linker doesn't find them (which usually causes configure failures), you can
87 provide the -R option to ld on some operating systems to set a hard-coded
88 path to the run-time linker:
90 env LDFLAGS=-R/usr/local/ssl/lib ./configure --with-ssl
95 To force configure to use the standard cc compiler if both cc and gcc are
96 present, run configure like
100 env CC=cc ./configure
102 To force a static library compile, disable the shared library creation
103 by running configure like:
105 ./configure --disable-shared
107 To tell the configure script to skip searching for thread-safe functions,
110 ./configure --disable-thread
112 To build curl with kerberos4 support enabled, curl requires the krb4 libs
113 and headers installed. You can then use a set of options to tell
114 configure where those are:
116 --with-krb4-includes[=DIR] Specify location of kerberos4 headers
117 --with-krb4-libs[=DIR] Specify location of kerberos4 libs
118 --with-krb4[=DIR] where to look for Kerberos4
120 In most cases, /usr/athena is the install prefix and then it works with
122 ./configure --with-krb4=/usr/athena
124 If you're a curl developer and use gcc, you might want to enable more
125 debug options with the --enable-debug option.
127 curl can be built to use a whole range of libraries to provide various
128 useful services, and configure will try to auto-detect a decent
129 default. But if you want to alter it, you can select how to deal with
130 each individual library.
132 To build with GnuTLS support instead of OpenSSL for SSL/TLS, note that
133 you need to use both --without-ssl and --with-gnutls.
135 To build with yassl support instead of OpenSSL or GnuTLS, you must build
136 yassl with its OpenSSL emulation enabled and point to that directory root
137 with configure --with-ssl.
139 To build with NSS support instead of OpenSSL for SSL/TLS, note that
140 you need to use both --without-ssl and --with-nss.
142 To get GSSAPI support, build with --with-gssapi and have the MIT or
143 Heimdal Kerberos 5 packages installed.
145 To get support for SCP and SFTP, build with --with-libssh2 and have
146 libssh2 0.16 or later installed.
150 Some versions of uClibc require configuring with CPPFLAGS=-D_GNU_SOURCE=1
151 to get correct large file support.
153 The Open Watcom C compiler on Linux requires configuring with the variables:
155 ./configure CC=owcc AR="$WATCOM/binl/wlib" AR_FLAGS=-q \
156 RANLIB=/bin/true STRIP="$WATCOM/binl/wstrip" CFLAGS=-Wextra
162 Building Windows DLLs and C run-time (CRT) linkage issues
163 ---------------------------------------------------------
165 As a general rule, building a DLL with static CRT linkage is highly
166 discouraged, and intermixing CRTs in the same app is something to
169 Reading and comprehension of Microsoft Knowledge Base articles
170 KB94248 and KB140584 is a must for any Windows developer. Especially
171 important is full understanding if you are not going to follow the
174 KB94248 - How To Use the C Run-Time
175 http://support.microsoft.com/kb/94248/en-us
177 KB140584 - How to link with the correct C Run-Time (CRT) library
178 http://support.microsoft.com/kb/140584/en-us
180 If your app is misbehaving in some strange way, or it is suffering
181 from memory corruption, before asking for further help, please try
182 first to rebuild every single library your app uses as well as your
183 app using the debug multithreaded dynamic C runtime.
188 Make sure that MinGW32's bin dir is in the search path, for example:
190 set PATH=c:\mingw32\bin;%PATH%
192 then run 'mingw32-make mingw32' in the root dir. There are other
193 make targets available to build libcurl with more features, use:
194 'mingw32-make mingw32-zlib' to build with Zlib support;
195 'mingw32-make mingw32-ssl-zlib' to build with SSL and Zlib enabled;
196 'mingw32-make mingw32-ssh2-ssl-zlib' to build with SSH2, SSL, Zlib;
197 'mingw32-make mingw32-ssh2-ssl-sspi-zlib' to build with SSH2, SSL, Zlib
200 If you have any problems linking libraries or finding header files, be sure
201 to verify that the provided "Makefile.m32" files use the proper paths, and
202 adjust as necessary. It is also possible to override these paths with
203 environment variables, for example:
205 set ZLIB_PATH=c:\zlib-1.2.3
206 set OPENSSL_PATH=c:\openssl-0.9.8g
207 set LIBSSH2_PATH=c:\libssh2-0.17
209 ATTENTION: if you want to build with libssh2 support you have to use latest
210 version 0.17 - previous versions will NOT work with 7.17.0 and later!
211 Use 'mingw32-make mingw32-ssh2-ssl-zlib' to build with SSH2 and SSL enabled.
213 It is now also possible to build with other LDAP SDKs than MS LDAP;
214 currently it is possible to build with native Win32 OpenLDAP, or with the
215 Novell CLDAP SDK. If you want to use these you need to set these vars:
217 set LDAP_SDK=c:\openldap
218 set USE_LDAP_OPENLDAP=1
220 or for using the Novell SDK:
222 set USE_LDAP_NOVELL=1
224 If you want to enable LDAPS support then set LDAPS=1.
226 - optional MingW32-built OpenlDAP SDK available from:
227 http://www.gknw.net/mirror/openldap/
228 - optional recent Novell CLDAP SDK available from:
229 http://developer.novell.com/ndk/cldap.htm
235 Almost identical to the unix installation. Run the configure script in the
236 curl root with 'sh configure'. Make sure you have the sh executable in
237 /bin/ or you'll see the configure fail toward the end.
244 See the separate INSTALL.devcpp file for details.
246 MSVC from command line
247 ----------------------
249 Run the 'vcvars32.bat' file to get a proper environment. The
250 vcvars32.bat file is part of the Microsoft development environment and
251 you may find it in 'C:\Program Files\Microsoft Visual Studio\vc98\bin'
252 provided that you installed Visual C/C++ 6 in the default directory.
254 Then run 'nmake vc' in curl's root directory.
256 If you want to compile with zlib support, you will need to build
257 zlib (http://www.gzip.org/zlib/) as well. Please read the zlib
258 documentation on how to compile zlib. Define the ZLIB_PATH environment
259 variable to the location of zlib.h and zlib.lib, for example:
261 set ZLIB_PATH=c:\zlib-1.2.3
263 Then run 'nmake vc-zlib' in curl's root directory.
265 If you want to compile with SSL support you need the OpenSSL package.
266 Please read the OpenSSL documentation on how to compile and install
267 the OpenSSL libraries. The build process of OpenSSL generates the
268 libeay32.dll and ssleay32.dll files in the out32dll subdirectory in
269 the OpenSSL home directory. OpenSSL static libraries (libeay32.lib,
270 ssleay32.lib, RSAglue.lib) are created in the out32 subdirectory.
272 Before running nmake define the OPENSSL_PATH environment variable with
273 the root/base directory of OpenSSL, for example:
275 set OPENSSL_PATH=c:\openssl-0.9.8g
277 Then run 'nmake vc-ssl' or 'nmake vc-ssl-dll' in curl's root
278 directory. 'nmake vc-ssl' will create a libcurl static and dynamic
279 libraries in the lib subdirectory, as well as a statically linked
280 version of curl.exe in the src subdirectory. This statically linked
281 version is a standalone executable not requiring any DLL at
282 runtime. This make method requires that you have the static OpenSSL
283 libraries available in OpenSSL's out32 subdirectory.
284 'nmake vc-ssl-dll' creates the libcurl dynamic library and
285 links curl.exe against libcurl and OpenSSL dynamically.
286 This executable requires libcurl.dll and the OpenSSL DLLs
288 Run 'nmake vc-ssl-zlib' to build with both ssl and zlib support.
293 A minimal VC++ 6.0 reference workspace (vc6curl.dsw) is available with the
294 source distribution archive to allow proper building of the two included
295 projects, the libcurl library and the curl tool.
297 1) Open the vc6curl.dsw workspace with MSVC6's IDE.
298 2) Select 'Build' from top menu.
299 3) Select 'Batch Build' from dropdown menu.
300 4) Make sure that the eight project configurations are 'checked'.
301 5) Click on the 'Build' button.
302 6) Once the eight project configurations are built you are done.
304 Dynamic and static libcurl libraries are built in debug and release flavours,
305 and can be located each one in its own subdirectory, DLL-Debug, DLL-Release,
306 LIB-Debug and LIB-Release, all of them below the 'lib' subdirectory.
308 In the same way four curl executables are created, each using its respective
309 library. The resulting curl executables are located in its own subdirectory,
310 DLL-Debug, DLL-Release, LIB-Debug and LIB-Release, below the 'src' subdir.
312 These reference VC++ 6.0 configurations are generated using the dynamic CRT.
314 Intentionally, these reference VC++ 6.0 projects and configurations don't use
315 third party libraries, such as OpenSSL or Zlib, to allow proper compilation
316 and configuration for all new users without further requirements.
318 If you need something more 'involved' you might adjust them for your own use,
319 or explore the world of makefiles described above 'MSVC from command line'.
322 ---------------------
326 Make sure you include the paths to curl/include and openssl/inc32 in
329 eg : -I"c:\Bcc55\include;c:\path_curl\include;c:\path_openssl\inc32"
331 Check to make sure that all of the sources listed in lib/Makefile.b32
332 are present in the /path_to_curl/lib directory. (Check the src
333 directory for missing ones.)
335 Make sure the environment variable "BCCDIR" is set to the install
336 location for the compiler eg : c:\Borland\BCC55
339 make -f /path_to_curl/lib/Makefile-ssl.b32
341 compile simplessl.c with appropriate links
343 c:\curl\docs\examples\> bcc32 -L c:\path_to_curl\lib\libcurl.lib
344 -L c:\borland\bcc55\lib\psdk\ws2_32.lib
345 -L c:\openssl\out32\libeay32.lib
346 -L c:\openssl\out32\ssleay32.lib
352 If you use VC++, Borland or similar compilers. Include all lib source
353 files in a static lib "project" (all .c and .h files that is).
354 (you should name it libcurl or similar)
356 Make the sources in the src/ drawer be a "win32 console application"
357 project. Name it curl.
360 Disabling Specific Protocols in Win32 builds
361 --------------------------------------------
363 The configure utility, unfortunately, is not available for the Windows
364 environment, therefore, you cannot use the various disable-protocol
365 options of the configure utility on this platform.
367 However, you can use the following defines to disable specific
370 HTTP_ONLY disables all protocols except HTTP
371 CURL_DISABLE_FTP disables FTP
372 CURL_DISABLE_LDAP disables LDAP
373 CURL_DISABLE_TELNET disables TELNET
374 CURL_DISABLE_DICT disables DICT
375 CURL_DISABLE_FILE disables FILE
376 CURL_DISABLE_TFTP disables TFTP
377 CURL_DISABLE_HTTP disables HTTP
379 If you want to set any of these defines you have the following
382 - Modify lib/config-win32.h
384 - Modify lib/Makefile.vc6
385 - Add defines to Project/Settings/C/C++/General/Preprocessor Definitions
386 in the curllib.dsw/curllib.dsp Visual C++ 6 IDE project.
389 Important static libcurl usage note
390 -----------------------------------
392 When building an application that uses the static libcurl library, you must
393 add '-DCURL_STATICLIB' to your CFLAGS. Otherwise the linker will look for
394 dynamic import symbols.
399 Building under OS/2 is not much different from building under unix.
411 If you want to build with OpenSSL or OpenLDAP support, you'll need to
412 download those libraries, too. Dirk Ohme has done some work to port SSL
413 libraries under OS/2, but it looks like he doesn't care about emx. You'll
414 find his patches on: http://come.to/Dirk_Ohme
416 If during the linking you get an error about _errno being an undefined
417 symbol referenced from the text segment, you need to add -D__ST_MT_ERRNO__
420 If everything seems to work fine but there's no curl.exe, you need to add
421 -Zexe to your linker flags.
423 If you're getting huge binaries, probably your makefiles have the -g in
429 (The VMS section is in whole contributed by the friendly Nico Baggus)
431 Curl seems to work with FTP & HTTP other protocols are not tested. (the
432 perl http/ftp testing server supplied as testing too cannot work on VMS
433 because vms has no concept of fork(). [ I tried to give it a whack, but
436 SSL stuff has not been ported.
438 Telnet has about the same issues as for Win32. When the changes for Win32
439 are clear maybe they'll work for VMS too. The basic problem is that select
440 ONLY works for sockets.
442 Marked instances of fopen/[f]stat that might become a problem, especially
443 for non stream files. In this regard, the files opened for writing will be
444 created stream/lf and will thus be safe. Just keep in mind that non-binary
445 read/wring from/to files will have a records size limit of 32767 bytes
448 Stat to get the size of the files is again only safe for stream files &
449 fixed record files without implied CC.
451 -- My guess is that only allowing access to stream files is the quickest
452 way to get around the most issues. Therefore all files need to to be
453 checked to be sure they will be stream/lf before processing them. This is
454 the easiest way out, I know. The reason for this is that code that needs to
455 report the filesize will become a pain in the ass otherwise.
457 Exit status.... Well we needed something done here,
459 VMS has a structured exist status:
461 |1098|765432109876|5432109876543|210|
462 +----+------------+-------------+---+
463 |Ctrl| Facility | Error code |sev|
464 +----+------------+-------------+---+
466 With the Ctrl-bits an application can tell if part or the whole message has
467 already been printed from the program, DCL doesn't need to print it again.
469 Facility - basically the program ID. A code assigned to the program
470 the name can be fetched from external or internal message libraries
471 Error code - the err codes assigned by the application
472 Sev. - severity: Even = error, off = non error
480 This all presents itself with:
481 %<FACILITY>-<Sev>-<Errorname>, <Error message>
483 See also the src/curlmsg.msg file, it has the source for the messages In
484 src/main.c a section is devoted to message status values, the globalvalues
485 create symbols with certain values, referenced from a compiled message
486 file. Have all exit function use a exit status derived from a translation
487 table with the compiled message codes.
489 This was all compiled with:
491 Compaq C V6.2-003 on OpenVMS Alpha V7.1-1H2
493 So far for porting notes as of:
500 (This section was graciously brought to us by David Bentham)
502 As QNX is targeted for resource constrained environments, the QNX headers
503 set conservative limits. This includes the FD_SETSIZE macro, set by default
504 to 32. Socket descriptors returned within the CURL library may exceed this,
505 resulting in memory faults/SIGSEGV crashes when passed into select(..)
506 calls using fd_set macros.
508 A good all-round solution to this is to override the default when building
509 libcurl, by overriding CFLAGS during configure, example
510 # configure CFLAGS='-DFD_SETSIZE=64 -g -O2'
515 The library can be cross-compiled using gccsdk as follows:
517 CC=riscos-gcc AR=riscos-ar RANLIB='riscos-ar -s' ./configure \
518 --host=arm-riscos-aof --without-random --disable-shared
521 where riscos-gcc and riscos-ar are links to the gccsdk tools.
522 You can then link your program with curl/lib/.libs/libcurl.a
527 (This section was graciously brought to us by Diego Casorran)
529 To build cURL/libcurl on AmigaOS just type 'make amiga' ...
531 What you need is: (not tested with others versions)
533 GeekGadgets / gcc 2.95.3 (http://www.geekgadgets.org/)
535 AmiTCP SDK v4.3 (http://www.aminet.net/comm/tcp/AmiTCP-SDK-4.3.lha)
537 Native Developer Kit (http://www.amiga.com/3.9/download/NDK3.9.lha)
539 As no ixemul.library is required you will be able to build it for
540 WarpOS/PowerPC (not tested by me), as well a MorphOS version should be
541 possible with no problems.
543 To enable SSL support, you need a OpenSSL native version (without ixemul),
544 you can find a precompiled package at http://amiga.sourceforge.net/OpenSSL/
549 To compile curl.nlm / libcurl.nlm you need:
550 - either any gcc / nlmconv, or CodeWarrior 7 PDK 4 or later.
551 - gnu make and awk running on the platform you compile on;
552 native Win32 versions can be downloaded from:
553 http://www.gknw.net/development/prgtools/
554 - recent Novell LibC SDK available from:
555 http://developer.novell.com/ndk/libc.htm
556 - or recent Novell CLib SDK available from:
557 http://developer.novell.com/ndk/clib.htm
558 - optional recent Novell CLDAP SDK available from:
559 http://developer.novell.com/ndk/cldap.htm
560 - optional zlib sources (static or dynamic linking with zlib.imp);
561 sources with NetWare Makefile can be obtained from:
562 http://www.gknw.net/mirror/zlib/
563 - optional OpenSSL sources (version 0.9.8 or later build with BSD sockets);
564 you can find precompiled packages at:
565 http://www.gknw.net/development/ossl/netware/
566 for CLIB-based builds OpenSSL needs to be patched to build with BSD
567 sockets (currently only a winsock-based CLIB build is supported):
568 http://www.gknw.net/development/ossl/netware/patches/v_0.9.8g/openssl-0.9.8g.diff
569 - optional SSH2 sources (version 0.17 or later);
571 Set a search path to your compiler, linker and tools; on Linux make
572 sure that the var OSTYPE contains the string 'linux'; set the var
573 NDKBASE to point to the base of your Novell NDK; and then type
574 'make netware' from the top source directory; other targets available
575 are 'netware-ssl', 'netware-ssl-zlib', 'netware-zlib' and 'netware-ares';
576 if you need other combinations you can control the build with the
577 environment variables WITH_SSL, WITH_ZLIB, WITH_ARES, WITH_SSH2, and
578 ENABLE_IPV6; you can set LINK_STATIC=1 to link curl.nlm statically.
579 By default LDAP support is enabled, however currently you will need a patch
580 in order to use the CLDAP NDK with BSD sockets (Novell Bug 300237):
581 http://www.gknw.net/test/curl/cldap_ndk/ldap_ndk.diff
582 I found on some Linux systems (RH9) that OS detection didn't work although
583 a 'set | grep OSTYPE' shows the var present and set; I simply overwrote it
584 with 'OSTYPE=linux-rh9-gnu' and the detection in the Makefile worked...
585 Any help in testing appreciated!
586 Builds automatically created 8 times a day from current CVS are here:
587 http://www.gknw.net/mirror/curl/autobuilds/
588 the status of these builds can be viewed at the autobuild table:
589 http://curl.haxx.se/auto/
594 curl does not use the eCos build system, so you must first build eCos
595 separately, then link curl to the resulting eCos library. Here's a sample
596 configure line to do so on an x86 Linux box targeting x86:
598 GCCLIB=`gcc -print-libgcc-file-name` && \
599 CFLAGS="-D__ECOS=1 -nostdinc -I$ECOS_INSTALL/include \
600 -I`dirname $GCCLIB`/include" \
601 LDFLAGS="-nostdlib -Wl,--gc-sections -Wl,-static \
602 -L$ECOS_INSTALL/lib -Ttarget.ld -ltarget" \
603 ./configure --host=i386 --disable-shared \
604 --without-ssl --without-zlib --disable-manual --disable-ldap
606 In most cases, eCos users will be using libcurl from within a custom
607 embedded application. Using the standard 'curl' executable from
608 within eCos means facing the limitation of the standard eCos C
609 startup code which does not allow passing arguments in main(). To
610 run 'curl' from eCos and have it do something useful, you will need
611 to either modify the eCos startup code to pass in some arguments, or
612 modify the curl application itself to retrieve its arguments from
613 some location set by the bootloader or hard-code them.
615 Something like the following patch could be used to hard-code some
616 arguments. The MTAB_ENTRY line mounts a RAM disk as the root filesystem
617 (without mounting some kind of filesystem, eCos errors out all file
618 operations which curl does not take to well). The next section synthesizes
619 some command-line arguments for curl to use, in this case to direct curl
620 to read further arguments from a file. It then creates that file on the
621 RAM disk and places within it a URL to download: a file: URL that
622 just happens to point to the configuration file itself. The results
623 of running curl in this way is the contents of the configuration file
624 printed to the console.
626 --- src/main.c 19 Jul 2006 19:09:56 -0000 1.363
627 +++ src/main.c 24 Jul 2006 21:37:23 -0000
628 @@ -4286,11 +4286,31 @@
633 +#include <cyg/fileio/fileio.h>
634 +MTAB_ENTRY( testfs_mte1,
641 int main(int argc, char *argv[])
644 struct Configurable config;
646 + char *args[] = {"ecos-curl", "-K", "curlconf.txt"};
648 + argc = sizeof(args)/sizeof(args[0]);
651 + f = fopen("curlconf.txt", "w");
653 + fprintf(f, "--url file:curlconf.txt");
657 memset(&config, 0, sizeof(struct Configurable));
659 config.errors = stderr; /* default errors to stderr */
664 curl can be compiled on Minix 3 using gcc or ACK (starting with
669 Increase the heap sizes of the compiler with the command:
673 Configure and compile with:
675 ./configure CONFIG_SHELL=/bin/bigsh CC=cc LD=cc AR=/usr/bin/aal \
676 GREP=grep CPPFLAGS=-D_POSIX_SOURCE=1
681 Make sure gcc is in your PATH with the command:
683 export PATH=/usr/gnu/bin:$PATH
685 then configure and compile curl with:
687 ./configure CONFIG_SHELL=/bin/bigsh CC=gcc AR=/usr/gnu/bin/gar GREP=grep
693 The Symbian OS port uses the Symbian build system to compile. From the
694 packages/Symbian/group/ directory, run:
699 to compile and install curl and libcurl. If your Symbian SDK doesn't
700 include support for P.I.P.S., you will need to contact your SDK vendor
701 to obtain that first.
706 (This section was graciously brought to us by Jim Duey, with additions by
709 Download and unpack the cURL package.
711 'cd' to the new directory. (e.g. cd curl-7.12.3)
713 Set environment variables to point to the cross-compile toolchain and call
714 configure with any options you need. Be sure and specify the '--host' and
715 '--build' parameters at configuration time. The following script is an
716 example of cross-compiling for the IBM 405GP PowerPC processor using the
717 toolchain from MonteVista for Hardhat Linux.
723 export PATH=$PATH:/opt/hardhat/devkit/ppc/405/bin
724 export CPPFLAGS="-I/opt/hardhat/devkit/ppc/405/target/usr/include"
728 export RANLIB=ppc_405-ranlib
729 export CC=ppc_405-gcc
732 ./configure --target=powerpc-hardhat-linux \
733 --host=powerpc-hardhat-linux \
734 --build=i586-pc-linux-gnu \
735 --prefix=/opt/hardhat/devkit/ppc/405/target/usr/local \
736 --exec-prefix=/usr/local
740 You may also need to provide a parameter like '--with-random=/dev/urandom'
741 to configure as it cannot detect the presence of a random number
742 generating device for a target system. The '--prefix' parameter
743 specifies where cURL will be installed. If 'configure' completes
744 successfully, do 'make' and 'make install' as usual.
746 In some cases, you may be able to simplify the above commands to as
749 ./configure --host=ARCH-OS
754 There are a number of configure options that can be used to reduce the
755 size of libcurl for embedded applications where binary size is an
756 important factor. First, be sure to set the CFLAGS variable when
757 configuring with any relevant compiler optimization flags to reduce the
758 size of the binary. For gcc, this would mean at minimum the -Os option,
759 and potentially the -march=X and -mdynamic-no-pic options as well, e.g.
761 ./configure CFLAGS='-Os' ...
763 Note that newer compilers often produce smaller code than older versions
764 due to improved optimization.
766 Be sure to specify as many --disable- and --without- flags on the configure
767 command-line as you can to disable all the libcurl features that you
768 know your application is not going to need. Besides specifying the
769 --disable-PROTOCOL flags for all the types of URLs your application
770 will not use, here are some other flags that can reduce the size of the
773 --disable-ares (disables support for the ARES DNS library)
774 --disable-cookies (disables support for HTTP cookies)
775 --disable-crypto-auth (disables HTTP cryptographic authentication)
776 --disable-ipv6 (disables support for IPv6)
777 --disable-verbose (eliminates debugging strings and error code strings)
778 --enable-hidden-symbols (eliminates unneeded symbols in the shared library)
779 --without-libidn (disables support for the libidn DNS library)
780 --without-ssl (disables support for SSL/TLS)
781 --without-zlib (disables support for on-the-fly decompression)
783 The GNU linker has a number of options to reduce the size of the libcurl
784 dynamic libraries on some platforms even further. Specify them by giving
785 the options -Wl,-Bsymbolic and -Wl,-s on the gcc command-line.
786 Be sure also to strip debugging symbols from your binaries after
787 compiling using 'strip' (or the appropriate variant if cross-compiling).
788 If space is really tight, you may be able to remove some unneeded
789 sections of the shared library using the -R option to objcopy (e.g. the
792 Using these techniques it is possible to create an HTTP-only shared libcurl
793 library for i386 Linux platforms that is only 96 KiB in size (as of libcurl
794 version 7.17.1, using gcc 4.2.2).
796 You may find that statically linking libcurl to your application will
797 result in a lower total size.
802 This is a probably incomplete list of known hardware and operating systems
803 that curl has been compiled for. If you know a system curl compiles and
804 runs on, that isn't listed, please let us know!
807 - Alpha Digital UNIX v3.2
808 - Alpha FreeBSD 4.1, 4.5
809 - Alpha Linux 2.2, 2.4
812 - Alpha OpenVMS V7.1-1H2
813 - Alpha Tru64 v5.0 5.1
814 - HP-PA HP-UX 9.X 10.X 11.X
820 - Pocket PC/Win CE 3.0
821 - Power AIX 3.2.5, 4.2, 4.3.1, 4.3.2, 5.1, 5.2
831 - Sparc Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8, 9, 10
833 - StrongARM (and other ARM) RISC OS 3.1, 4.02
834 - StrongARM/ARM7/ARM9 Linux 2.4, 2.6
835 - StrongARM NetBSD 1.4.1
837 - Symbian OS (P.I.P.S.) 9.x
848 - i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4, 2.6
851 - i386 Novell NetWare
857 - i386 Windows 95, 98, ME, NT, 2000, XP, 2003
858 - i486 ncr-sysv4.3.03 (NCR MP-RAS)
864 - m88k dg-dgux5.4R3.00
866 - XScale/PXA250 Linux 2.4
872 OpenSSL http://www.openssl.org
873 MingW http://www.mingw.org
874 OpenLDAP http://www.openldap.org
875 Zlib http://www.gzip.org/zlib/
876 libssh2 http://www.libssh2.org