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 git repository, read the
30 GIT-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 build with PolarSSL support instead of OpenSSL for SSL/TLS, note that
143 you need to use both --without-ssl and --with-polarssl.
145 To get GSSAPI support, build with --with-gssapi and have the MIT or
146 Heimdal Kerberos 5 packages installed.
148 To get support for SCP and SFTP, build with --with-libssh2 and have
149 libssh2 0.16 or later installed.
153 Some versions of uClibc require configuring with CPPFLAGS=-D_GNU_SOURCE=1
154 to get correct large file support.
156 The Open Watcom C compiler on Linux requires configuring with the variables:
158 ./configure CC=owcc AR="$WATCOM/binl/wlib" AR_FLAGS=-q \
159 RANLIB=/bin/true STRIP="$WATCOM/binl/wstrip" CFLAGS=-Wextra
165 Building Windows DLLs and C run-time (CRT) linkage issues
166 ---------------------------------------------------------
168 As a general rule, building a DLL with static CRT linkage is highly
169 discouraged, and intermixing CRTs in the same app is something to
172 Reading and comprehension of Microsoft Knowledge Base articles
173 KB94248 and KB140584 is a must for any Windows developer. Especially
174 important is full understanding if you are not going to follow the
177 KB94248 - How To Use the C Run-Time
178 http://support.microsoft.com/kb/94248/en-us
180 KB140584 - How to link with the correct C Run-Time (CRT) library
181 http://support.microsoft.com/kb/140584/en-us
183 KB190799 - Potential Errors Passing CRT Objects Across DLL Boundaries
184 http://msdn.microsoft.com/en-us/library/ms235460
186 If your app is misbehaving in some strange way, or it is suffering
187 from memory corruption, before asking for further help, please try
188 first to rebuild every single library your app uses as well as your
189 app using the debug multithreaded dynamic C runtime.
194 Make sure that MinGW32's bin dir is in the search path, for example:
196 set PATH=c:\mingw32\bin;%PATH%
198 then run 'mingw32-make mingw32' in the root dir. There are other
199 make targets available to build libcurl with more features, use:
200 'mingw32-make mingw32-zlib' to build with Zlib support;
201 'mingw32-make mingw32-ssl-zlib' to build with SSL and Zlib enabled;
202 'mingw32-make mingw32-ssh2-ssl-zlib' to build with SSH2, SSL, Zlib;
203 'mingw32-make mingw32-ssh2-ssl-sspi-zlib' to build with SSH2, SSL, Zlib
206 If you have any problems linking libraries or finding header files, be sure
207 to verify that the provided "Makefile.m32" files use the proper paths, and
208 adjust as necessary. It is also possible to override these paths with
209 environment variables, for example:
211 set ZLIB_PATH=c:\zlib-1.2.3
212 set OPENSSL_PATH=c:\openssl-0.9.8k
213 set LIBSSH2_PATH=c:\libssh2-1.1
215 ATTENTION: if you want to build with libssh2 support you have to use latest
216 version 0.17 - previous versions will NOT work with 7.17.0 and later!
217 Use 'mingw32-make mingw32-ssh2-ssl-zlib' to build with SSH2 and SSL enabled.
219 It is now also possible to build with other LDAP SDKs than MS LDAP;
220 currently it is possible to build with native Win32 OpenLDAP, or with the
221 Novell CLDAP SDK. If you want to use these you need to set these vars:
223 set LDAP_SDK=c:\openldap
224 set USE_LDAP_OPENLDAP=1
226 or for using the Novell SDK:
228 set USE_LDAP_NOVELL=1
230 If you want to enable LDAPS support then set LDAPS=1.
232 - optional MingW32-built OpenlDAP SDK available from:
233 http://www.gknw.net/mirror/openldap/
234 - optional recent Novell CLDAP SDK available from:
235 http://developer.novell.com/ndk/cldap.htm
241 Almost identical to the unix installation. Run the configure script in the
242 curl root with 'sh configure'. Make sure you have the sh executable in
243 /bin/ or you'll see the configure fail toward the end.
250 See the separate INSTALL.devcpp file for details.
255 If you use MSVC 6 it is required that you use the February 2003 edition PSDK:
256 http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm
258 Building any software with MSVC 6 without having PSDK installed is just
259 asking for trouble down the road once you have released it, you might notice
260 the problems in the first corner or ten miles ahead, depending mostly on your
261 choice of static vs dynamic runtime and third party libraries. Anyone using
262 software built in such way will at some point regret having done so.
264 When someone uses MSVC 6 without PSDK he is using a compiler back from 1998.
266 If the compiler has been updated with the installation of a service pack as
267 those mentioned in http://support.microsoft.com/kb/194022 the compiler can be
268 safely used to read source code, translate and make it object code.
270 But, even with the service packs mentioned above installed, the resulting
271 software generated in such an environment will be using outdated system
272 header files and libraries with bugs and security issues which have already
273 been addressed and fixed long time ago.
275 In order to make use of the updated system headers and fixed libraries
276 for MSVC 6, it is required that 'Platform SDK', PSDK from now onwards,
277 is installed. The specific PSDK that must be installed for MSVC 6 is the
278 February 2003 edition, which is the latest one supporting the MSVC 6 compiler,
279 this PSDK is also known as 'Windows Server 2003 PSDK' and can be downloaded
280 from http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm
282 So, building curl and libcurl with MSVC 6 without PSDK is absolutely
283 discouraged for the benefit of anyone using software built in such
284 environment. And it will not be supported in any way, as we could just
285 be hunting bugs which have already been fixed way back in 2003.
287 When building with MSVC 6 we attempt to detect if PSDK is not being used,
288 and if this is the case the build process will fail hard with an error
289 message stating that the February 2003 PSDK is required. This is done to
290 protect the unsuspecting and avoid PEBKAC issues.
292 Additionally it might happen that a die hard MSVC hacker still wants to
293 build curl and libcurl with MSVC 6 without PSDK installed, even knowing
294 that this is a highly discouraged and unsupported build environment. In
295 this case the brave of heart will be able to build in such an environment
296 with the requisite of defining preprocessor symbol ALLOW_MSVC6_WITHOUT_PSDK
297 in lib/config-win32.h and knowing that LDAP and IPv6 support will be missing.
299 MSVC from command line
300 ----------------------
302 Run the 'vcvars32.bat' file to get a proper environment. The
303 vcvars32.bat file is part of the Microsoft development environment and
304 you may find it in 'C:\Program Files\Microsoft Visual Studio\vc98\bin'
305 provided that you installed Visual C/C++ 6 in the default directory.
307 Then run 'nmake vc' in curl's root directory.
309 If you want to compile with zlib support, you will need to build
310 zlib (http://www.gzip.org/zlib/) as well. Please read the zlib
311 documentation on how to compile zlib. Define the ZLIB_PATH environment
312 variable to the location of zlib.h and zlib.lib, for example:
314 set ZLIB_PATH=c:\zlib-1.2.3
316 Then run 'nmake vc-zlib' in curl's root directory.
318 If you want to compile with SSL support you need the OpenSSL package.
319 Please read the OpenSSL documentation on how to compile and install
320 the OpenSSL libraries. The build process of OpenSSL generates the
321 libeay32.dll and ssleay32.dll files in the out32dll subdirectory in
322 the OpenSSL home directory. OpenSSL static libraries (libeay32.lib,
323 ssleay32.lib, RSAglue.lib) are created in the out32 subdirectory.
325 Before running nmake define the OPENSSL_PATH environment variable with
326 the root/base directory of OpenSSL, for example:
328 set OPENSSL_PATH=c:\openssl-0.9.8k
330 Then run 'nmake vc-ssl' or 'nmake vc-ssl-dll' in curl's root
331 directory. 'nmake vc-ssl' will create a libcurl static and dynamic
332 libraries in the lib subdirectory, as well as a statically linked
333 version of curl.exe in the src subdirectory. This statically linked
334 version is a standalone executable not requiring any DLL at
335 runtime. This make method requires that you have the static OpenSSL
336 libraries available in OpenSSL's out32 subdirectory.
337 'nmake vc-ssl-dll' creates the libcurl dynamic library and
338 links curl.exe against libcurl and OpenSSL dynamically.
339 This executable requires libcurl.dll and the OpenSSL DLLs
341 Run 'nmake vc-ssl-zlib' to build with both ssl and zlib support.
346 A minimal VC++ 6.0 reference workspace (vc6curl.dsw) is available with the
347 source distribution archive to allow proper building of the two included
348 projects, the libcurl library and the curl tool.
350 1) Open the vc6curl.dsw workspace with MSVC6's IDE.
351 2) Select 'Build' from top menu.
352 3) Select 'Batch Build' from dropdown menu.
353 4) Make sure that the eight project configurations are 'checked'.
354 5) Click on the 'Build' button.
355 6) Once the eight project configurations are built you are done.
357 Dynamic and static libcurl libraries are built in debug and release flavours,
358 and can be located each one in its own subdirectory, DLL-Debug, DLL-Release,
359 LIB-Debug and LIB-Release, all of them below the 'lib' subdirectory.
361 In the same way four curl executables are created, each using its respective
362 library. The resulting curl executables are located in its own subdirectory,
363 DLL-Debug, DLL-Release, LIB-Debug and LIB-Release, below the 'src' subdir.
365 These reference VC++ 6.0 configurations are generated using the dynamic CRT.
367 Intentionally, these reference VC++ 6.0 projects and configurations don't use
368 third party libraries, such as OpenSSL or Zlib, to allow proper compilation
369 and configuration for all new users without further requirements.
371 If you need something more 'involved' you might adjust them for your own use,
372 or explore the world of makefiles described above 'MSVC from command line'.
375 ---------------------
379 Make sure you include the paths to curl/include and openssl/inc32 in
382 eg : -I"c:\Bcc55\include;c:\path_curl\include;c:\path_openssl\inc32"
384 Check to make sure that all of the sources listed in lib/Makefile.b32
385 are present in the /path_to_curl/lib directory. (Check the src
386 directory for missing ones.)
388 Make sure the environment variable "BCCDIR" is set to the install
389 location for the compiler eg : c:\Borland\BCC55
392 make -f /path_to_curl/lib/Makefile-ssl.b32
394 compile simplessl.c with appropriate links
396 c:\curl\docs\examples\> bcc32 -L c:\path_to_curl\lib\libcurl.lib
397 -L c:\borland\bcc55\lib\psdk\ws2_32.lib
398 -L c:\openssl\out32\libeay32.lib
399 -L c:\openssl\out32\ssleay32.lib
405 If you use VC++, Borland or similar compilers. Include all lib source
406 files in a static lib "project" (all .c and .h files that is).
407 (you should name it libcurl or similar)
409 Make the sources in the src/ drawer be a "win32 console application"
410 project. Name it curl.
413 Disabling Specific Protocols in Win32 builds
414 --------------------------------------------
416 The configure utility, unfortunately, is not available for the Windows
417 environment, therefore, you cannot use the various disable-protocol
418 options of the configure utility on this platform.
420 However, you can use the following defines to disable specific
423 HTTP_ONLY disables all protocols except HTTP
424 CURL_DISABLE_FTP disables FTP
425 CURL_DISABLE_LDAP disables LDAP
426 CURL_DISABLE_TELNET disables TELNET
427 CURL_DISABLE_DICT disables DICT
428 CURL_DISABLE_FILE disables FILE
429 CURL_DISABLE_TFTP disables TFTP
430 CURL_DISABLE_HTTP disables HTTP
432 If you want to set any of these defines you have the following
435 - Modify lib/config-win32.h
437 - Modify lib/Makefile.vc6
438 - Add defines to Project/Settings/C/C++/General/Preprocessor Definitions
439 in the vc6libcurl.dsw/vc6libcurl.dsp Visual C++ 6 IDE project.
442 Important static libcurl usage note
443 -----------------------------------
445 When building an application that uses the static libcurl library, you must
446 add '-DCURL_STATICLIB' to your CFLAGS. Otherwise the linker will look for
447 dynamic import symbols.
452 Building under OS/2 is not much different from building under unix.
464 If you want to build with OpenSSL or OpenLDAP support, you'll need to
465 download those libraries, too. Dirk Ohme has done some work to port SSL
466 libraries under OS/2, but it looks like he doesn't care about emx. You'll
467 find his patches on: http://come.to/Dirk_Ohme
469 If during the linking you get an error about _errno being an undefined
470 symbol referenced from the text segment, you need to add -D__ST_MT_ERRNO__
473 If everything seems to work fine but there's no curl.exe, you need to add
474 -Zexe to your linker flags.
476 If you're getting huge binaries, probably your makefiles have the -g in
482 (The VMS section is in whole contributed by the friendly Nico Baggus)
484 Curl seems to work with FTP & HTTP other protocols are not tested. (the
485 perl http/ftp testing server supplied as testing too cannot work on VMS
486 because vms has no concept of fork(). [ I tried to give it a whack, but
489 SSL stuff has not been ported.
491 Telnet has about the same issues as for Win32. When the changes for Win32
492 are clear maybe they'll work for VMS too. The basic problem is that select
493 ONLY works for sockets.
495 Marked instances of fopen/[f]stat that might become a problem, especially
496 for non stream files. In this regard, the files opened for writing will be
497 created stream/lf and will thus be safe. Just keep in mind that non-binary
498 read/wring from/to files will have a records size limit of 32767 bytes
501 Stat to get the size of the files is again only safe for stream files &
502 fixed record files without implied CC.
504 -- My guess is that only allowing access to stream files is the quickest
505 way to get around the most issues. Therefore all files need to to be
506 checked to be sure they will be stream/lf before processing them. This is
507 the easiest way out, I know. The reason for this is that code that needs to
508 report the filesize will become a pain in the ass otherwise.
510 Exit status.... Well we needed something done here,
512 VMS has a structured exist status:
514 |1098|765432109876|5432109876543|210|
515 +----+------------+-------------+---+
516 |Ctrl| Facility | Error code |sev|
517 +----+------------+-------------+---+
519 With the Ctrl-bits an application can tell if part or the whole message has
520 already been printed from the program, DCL doesn't need to print it again.
522 Facility - basically the program ID. A code assigned to the program
523 the name can be fetched from external or internal message libraries
524 Error code - the err codes assigned by the application
525 Sev. - severity: Even = error, off = non error
533 This all presents itself with:
534 %<FACILITY>-<Sev>-<Errorname>, <Error message>
536 See also the src/curlmsg.msg file, it has the source for the messages In
537 src/main.c a section is devoted to message status values, the globalvalues
538 create symbols with certain values, referenced from a compiled message
539 file. Have all exit function use a exit status derived from a translation
540 table with the compiled message codes.
542 This was all compiled with:
544 Compaq C V6.2-003 on OpenVMS Alpha V7.1-1H2
546 So far for porting notes as of:
553 (This section was graciously brought to us by David Bentham)
555 As QNX is targeted for resource constrained environments, the QNX headers
556 set conservative limits. This includes the FD_SETSIZE macro, set by default
557 to 32. Socket descriptors returned within the CURL library may exceed this,
558 resulting in memory faults/SIGSEGV crashes when passed into select(..)
559 calls using fd_set macros.
561 A good all-round solution to this is to override the default when building
562 libcurl, by overriding CFLAGS during configure, example
563 # configure CFLAGS='-DFD_SETSIZE=64 -g -O2'
568 The library can be cross-compiled using gccsdk as follows:
570 CC=riscos-gcc AR=riscos-ar RANLIB='riscos-ar -s' ./configure \
571 --host=arm-riscos-aof --without-random --disable-shared
574 where riscos-gcc and riscos-ar are links to the gccsdk tools.
575 You can then link your program with curl/lib/.libs/libcurl.a
580 (This section was graciously brought to us by Diego Casorran)
582 To build cURL/libcurl on AmigaOS just type 'make amiga' ...
584 What you need is: (not tested with others versions)
586 GeekGadgets / gcc 2.95.3 (http://www.geekgadgets.org/)
588 AmiTCP SDK v4.3 (http://www.aminet.net/comm/tcp/AmiTCP-SDK-4.3.lha)
590 Native Developer Kit (http://www.amiga.com/3.9/download/NDK3.9.lha)
592 As no ixemul.library is required you will be able to build it for
593 WarpOS/PowerPC (not tested by me), as well a MorphOS version should be
594 possible with no problems.
596 To enable SSL support, you need a OpenSSL native version (without ixemul),
597 you can find a precompiled package at http://amiga.sourceforge.net/OpenSSL/
602 To compile curl.nlm / libcurl.nlm you need:
603 - either any gcc / nlmconv, or CodeWarrior 7 PDK 4 or later.
604 - gnu make and awk running on the platform you compile on;
605 native Win32 versions can be downloaded from:
606 http://www.gknw.net/development/prgtools/
607 - recent Novell LibC SDK available from:
608 http://developer.novell.com/ndk/libc.htm
609 - or recent Novell CLib SDK available from:
610 http://developer.novell.com/ndk/clib.htm
611 - optional recent Novell CLDAP SDK available from:
612 http://developer.novell.com/ndk/cldap.htm
613 - optional zlib sources (static or dynamic linking with zlib.imp);
614 sources with NetWare Makefile can be obtained from:
615 http://www.gknw.net/mirror/zlib/
616 - optional OpenSSL sources (version 0.9.8 or later build with BSD sockets);
617 you can find precompiled packages at:
618 http://www.gknw.net/development/ossl/netware/
619 for CLIB-based builds OpenSSL 0.9.8h or later is required - earlier versions
620 dont support buildunf with CLIB BSD sockets.
621 - optional SSH2 sources (version 0.17 or later);
623 Set a search path to your compiler, linker and tools; on Linux make
624 sure that the var OSTYPE contains the string 'linux'; set the var
625 NDKBASE to point to the base of your Novell NDK; and then type
626 'make netware' from the top source directory; other targets available
627 are 'netware-ssl', 'netware-ssl-zlib', 'netware-zlib' and 'netware-ares';
628 if you need other combinations you can control the build with the
629 environment variables WITH_SSL, WITH_ZLIB, WITH_ARES, WITH_SSH2, and
630 ENABLE_IPV6; you can set LINK_STATIC=1 to link curl.nlm statically.
631 By default LDAP support is enabled, however currently you will need a patch
632 in order to use the CLDAP NDK with BSD sockets (Novell Bug 300237):
633 http://www.gknw.net/test/curl/cldap_ndk/ldap_ndk.diff
634 I found on some Linux systems (RH9) that OS detection didn't work although
635 a 'set | grep OSTYPE' shows the var present and set; I simply overwrote it
636 with 'OSTYPE=linux-rh9-gnu' and the detection in the Makefile worked...
637 Any help in testing appreciated!
638 Builds automatically created 8 times a day from current git are here:
639 http://www.gknw.net/mirror/curl/autobuilds/
640 the status of these builds can be viewed at the autobuild table:
641 http://curl.haxx.se/auto/
646 curl does not use the eCos build system, so you must first build eCos
647 separately, then link curl to the resulting eCos library. Here's a sample
648 configure line to do so on an x86 Linux box targeting x86:
650 GCCLIB=`gcc -print-libgcc-file-name` && \
651 CFLAGS="-D__ECOS=1 -nostdinc -I$ECOS_INSTALL/include \
652 -I`dirname $GCCLIB`/include" \
653 LDFLAGS="-nostdlib -Wl,--gc-sections -Wl,-static \
654 -L$ECOS_INSTALL/lib -Ttarget.ld -ltarget" \
655 ./configure --host=i386 --disable-shared \
656 --without-ssl --without-zlib --disable-manual --disable-ldap
658 In most cases, eCos users will be using libcurl from within a custom
659 embedded application. Using the standard 'curl' executable from
660 within eCos means facing the limitation of the standard eCos C
661 startup code which does not allow passing arguments in main(). To
662 run 'curl' from eCos and have it do something useful, you will need
663 to either modify the eCos startup code to pass in some arguments, or
664 modify the curl application itself to retrieve its arguments from
665 some location set by the bootloader or hard-code them.
667 Something like the following patch could be used to hard-code some
668 arguments. The MTAB_ENTRY line mounts a RAM disk as the root filesystem
669 (without mounting some kind of filesystem, eCos errors out all file
670 operations which curl does not take to well). The next section synthesizes
671 some command-line arguments for curl to use, in this case to direct curl
672 to read further arguments from a file. It then creates that file on the
673 RAM disk and places within it a URL to download: a file: URL that
674 just happens to point to the configuration file itself. The results
675 of running curl in this way is the contents of the configuration file
676 printed to the console.
678 --- src/main.c 19 Jul 2006 19:09:56 -0000 1.363
679 +++ src/main.c 24 Jul 2006 21:37:23 -0000
680 @@ -4286,11 +4286,31 @@
685 +#include <cyg/fileio/fileio.h>
686 +MTAB_ENTRY( testfs_mte1,
693 int main(int argc, char *argv[])
696 struct Configurable config;
698 + char *args[] = {"ecos-curl", "-K", "curlconf.txt"};
700 + argc = sizeof(args)/sizeof(args[0]);
703 + f = fopen("curlconf.txt", "w");
705 + fprintf(f, "--url file:curlconf.txt");
709 memset(&config, 0, sizeof(struct Configurable));
711 config.errors = stderr; /* default errors to stderr */
716 curl can be compiled on Minix 3 using gcc or ACK (starting with
717 ver. 3.1.3). Ensure that GNU gawk and bash are both installed and
718 available in the PATH.
722 Increase the heap sizes of the compiler with the command:
726 then configure and compile curl with:
728 ./configure CC=cc LD=cc AR=/usr/bin/aal GREP=grep \
729 CPPFLAGS='-D_POSIX_SOURCE=1 -I/usr/local/include'
731 chmem =256000 src/curl
735 Make sure gcc is in your PATH with the command:
737 export PATH=/usr/gnu/bin:$PATH
739 then configure and compile curl with:
741 ./configure CC=gcc AR=/usr/gnu/bin/gar GREP=grep
743 chmem =256000 src/curl
748 The Symbian OS port uses the Symbian build system to compile. From the
749 packages/Symbian/group/ directory, run:
754 to compile and install curl and libcurl using SBSv1. If your Symbian
755 SDK doesn't include support for P.I.P.S., you will need to contact
756 your SDK vendor to obtain that first.
761 Build for VxWorks is performed using cross compilation.
762 That means you build on Windows machine using VxWorks tools and
763 run the built image on the VxWorks device.
765 To build libcurl for VxWorks you need:
767 - CYGWIN (free, http://cygwin.com/)
768 - Wind River Workbench (commercial)
770 If you have CYGWIN and Workbench installed on you machine
771 follow after next steps:
773 1. Open the Command Prompt window and change directory ('cd')
774 to the libcurl 'lib' folder.
775 2. Add CYGWIN 'bin' folder to the PATH environment variable.
776 For example, type 'set PATH=C:/embedded/cygwin/bin;%PATH%'.
777 3. Adjust environment variables defined in 'Environment' section
778 of the Makefile.vxworks file to point to your software folders.
779 4. Build the libcurl by typing 'make -f ./Makefile.vxworks'
781 As a result the libcurl.a library should be created in the 'lib' folder.
782 To clean the build results type 'make -f ./Makefile.vxworks clean'.
787 See the build notes in the Android.mk file.
792 (This section was graciously brought to us by Jim Duey, with additions by
795 Download and unpack the cURL package.
797 'cd' to the new directory. (e.g. cd curl-7.12.3)
799 Set environment variables to point to the cross-compile toolchain and call
800 configure with any options you need. Be sure and specify the '--host' and
801 '--build' parameters at configuration time. The following script is an
802 example of cross-compiling for the IBM 405GP PowerPC processor using the
803 toolchain from MonteVista for Hardhat Linux.
809 export PATH=$PATH:/opt/hardhat/devkit/ppc/405/bin
810 export CPPFLAGS="-I/opt/hardhat/devkit/ppc/405/target/usr/include"
814 export RANLIB=ppc_405-ranlib
815 export CC=ppc_405-gcc
818 ./configure --target=powerpc-hardhat-linux \
819 --host=powerpc-hardhat-linux \
820 --build=i586-pc-linux-gnu \
821 --prefix=/opt/hardhat/devkit/ppc/405/target/usr/local \
822 --exec-prefix=/usr/local
826 You may also need to provide a parameter like '--with-random=/dev/urandom'
827 to configure as it cannot detect the presence of a random number
828 generating device for a target system. The '--prefix' parameter
829 specifies where cURL will be installed. If 'configure' completes
830 successfully, do 'make' and 'make install' as usual.
832 In some cases, you may be able to simplify the above commands to as
835 ./configure --host=ARCH-OS
840 There are a number of configure options that can be used to reduce the
841 size of libcurl for embedded applications where binary size is an
842 important factor. First, be sure to set the CFLAGS variable when
843 configuring with any relevant compiler optimization flags to reduce the
844 size of the binary. For gcc, this would mean at minimum the -Os option,
845 and potentially the -march=X and -mdynamic-no-pic options as well, e.g.
847 ./configure CFLAGS='-Os' ...
849 Note that newer compilers often produce smaller code than older versions
850 due to improved optimization.
852 Be sure to specify as many --disable- and --without- flags on the configure
853 command-line as you can to disable all the libcurl features that you
854 know your application is not going to need. Besides specifying the
855 --disable-PROTOCOL flags for all the types of URLs your application
856 will not use, here are some other flags that can reduce the size of the
859 --disable-ares (disables support for the C-ARES DNS library)
860 --disable-cookies (disables support for HTTP cookies)
861 --disable-crypto-auth (disables HTTP cryptographic authentication)
862 --disable-ipv6 (disables support for IPv6)
863 --disable-manual (disables support for the built-in documentation)
864 --disable-proxy (disables support for HTTP and SOCKS proxies)
865 --disable-verbose (eliminates debugging strings and error code strings)
866 --enable-hidden-symbols (eliminates unneeded symbols in the shared library)
867 --without-libidn (disables support for the libidn DNS library)
868 --without-ssl (disables support for SSL/TLS)
869 --without-zlib (disables support for on-the-fly decompression)
871 The GNU compiler and linker have a number of options that can reduce the
872 size of the libcurl dynamic libraries on some platforms even further.
873 Specify them by providing appropriate CFLAGS and LDFLAGS variables on the
874 configure command-line:
875 CFLAGS="-ffunction-sections -fdata-sections" \
876 LDFLAGS="-Wl,-s -Wl,-Bsymbolic -Wl,--gc-sections"
878 Be sure also to strip debugging symbols from your binaries after
879 compiling using 'strip' (or the appropriate variant if cross-compiling).
880 If space is really tight, you may be able to remove some unneeded
881 sections of the shared library using the -R option to objcopy (e.g. the
884 Using these techniques it is possible to create a basic HTTP-only shared
885 libcurl library for i386 Linux platforms that is only 98 KiB in size, and
886 an FTP-only library that is 94 KiB in size (as of libcurl version 7.20.0,
889 You may find that statically linking libcurl to your application will
890 result in a lower total size than dynamically linking.
892 Note that the curl test harness can detect the use of some, but not all, of
893 the --disable statements suggested above. Use will cause tests relying on
894 those features to fail. The test harness can be manually forced to skip
895 the relevant tests by specifying certain key words on the runtests.pl
896 command line. Following is a list of appropriate key words:
898 --disable-cookies !cookies
899 --disable-crypto-auth !HTTP\ Digest\ auth !HTTP\ proxy\ Digest\ auth
900 --disable-manual !--manual
901 --disable-proxy !HTTP\ proxy !proxytunnel !SOCKS4 !SOCKS5
906 This is a probably incomplete list of known hardware and operating systems
907 that curl has been compiled for. If you know a system curl compiles and
908 runs on, that isn't listed, please let us know!
911 - Alpha Digital UNIX v3.2
912 - Alpha FreeBSD 4.1, 4.5
913 - Alpha Linux 2.2, 2.4
916 - Alpha OpenVMS V7.1-1H2
917 - Alpha Tru64 v5.0 5.1
919 - ARM Android 1.5, 2.1
924 - HP-PA HP-UX 9.X 10.X 11.X
931 - Pocket PC/Win CE 3.0
932 - Power AIX 3.2.5, 4.2, 4.3.1, 4.3.2, 5.1, 5.2
942 - Sparc Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8, 9, 10
944 - StrongARM (and other ARM) RISC OS 3.1, 4.02
945 - StrongARM/ARM7/ARM9 Linux 2.4, 2.6
946 - StrongARM NetBSD 1.4.1
947 - Symbian OS (P.I.P.S.) 9.x
958 - i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4, 2.6
961 - i386 Novell NetWare
967 - i386 Windows 95, 98, ME, NT, 2000, XP, 2003
968 - i486 ncr-sysv4.3.03 (NCR MP-RAS)
974 - m88k dg-dgux5.4R3.00
977 - XScale/PXA250 Linux 2.4
983 c-ares http://daniel.haxx.se/projects/c-ares/license.html
984 GNU GSS http://www.gnu.org/software/gss/
985 GnuTLS http://www.gnu.org/software/gnutls/
986 Heimdal http://www.pdc.kth.se/heimdal/
987 libidn http://www.gnu.org/software/libidn/
988 libssh2 http://www.libssh2.org
989 MingW http://www.mingw.org
990 MIT Kerberos http://web.mit.edu/kerberos/www/dist/
991 NSS http://www.mozilla.org/projects/security/pki/nss/
992 OpenLDAP http://www.openldap.org
993 OpenSSL http://www.openssl.org
994 PolarSSL http://polarssl.org
995 yassl http://www.yassl.com/
996 Zlib http://www.gzip.org/zlib/