Mention that P.I.P.S. is needed for Symbian.
[platform/upstream/curl.git] / docs / INSTALL
1                                   _   _ ____  _
2                               ___| | | |  _ \| |
3                              / __| | | | |_) | |
4                             | (__| |_| |  _ <| |___
5                              \___|\___/|_| \_\_____|
6
7                                 How To Compile
8
9 Installing Binary Packages
10 ==========================
11
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.
16
17 UNIX
18 ====
19    A normal unix installation is made in three or four steps (after you've
20    unpacked the source archive):
21
22         ./configure
23         make
24         make test (optional)
25         make install
26
27    You probably need to be root when doing the last command.
28
29    If you have checked out the sources from the CVS repository, read the
30    CVS-INFO on how to proceed.
31
32    Get a full listing of all available configure options by invoking it like:
33
34         ./configure --help
35
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:
38
39         ./configure --prefix=/path/to/curl/tree
40
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:
44
45         ./configure --prefix=$HOME
46         make
47         make install
48
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:
53
54         ./configure --with-ssl
55
56    If you have OpenSSL installed somewhere else (for example, /opt/OpenSSL,)
57    you can run configure like this:
58
59         ./configure --with-ssl=/opt/OpenSSL
60
61    If you insist on forcing a build without SSL support, even though you may
62    have OpenSSL installed in your system, you can run configure like this:
63
64         ./configure --without-ssl
65
66    If you have OpenSSL installed, but with the libraries in one place and the
67    header files somewhere else, you have to set the LDFLAGS and CPPFLAGS
68    environment variables prior to running configure.  Something like this
69    should work:
70
71      (with the Bourne shell and its clones):
72
73        CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \
74            ./configure
75
76      (with csh, tcsh and their clones):
77
78        env CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \
79        ./configure
80
81    If you have shared SSL libs installed in a directory where your run-time
82    linker doesn't find them (which usually causes configure failures), you can
83    provide the -R option to ld on some operating systems to set a hard-coded
84    path to the run-time linker:
85
86         LDFLAGS=-R/usr/local/ssl/lib ./configure --with-ssl
87
88    MORE OPTIONS
89
90      To force configure to use the standard cc compiler if both cc and gcc are
91      present, run configure like
92
93        CC=cc ./configure
94          or
95        env CC=cc ./configure
96
97      To force a static library compile, disable the shared library creation
98      by running configure like:
99
100        ./configure --disable-shared
101
102      To tell the configure script to skip searching for thread-safe functions,
103      add an option like:
104
105        ./configure --disable-thread
106
107      To build curl with kerberos4 support enabled, curl requires the krb4 libs
108      and headers installed. You can then use a set of options to tell
109      configure where those are:
110
111           --with-krb4-includes[=DIR]   Specify location of kerberos4 headers
112           --with-krb4-libs[=DIR]       Specify location of kerberos4 libs
113           --with-krb4[=DIR]            where to look for Kerberos4
114
115      In most cases, /usr/athena is the install prefix and then it works with
116
117        ./configure --with-krb4=/usr/athena
118
119      If you're a curl developer and use gcc, you might want to enable more
120      debug options with the --enable-debug option.
121
122      curl can be built to use a whole range of libraries to provide various
123      useful services, and configure will try to auto-detect a decent
124      default. But if you want to alter it, you can select how to deal with
125      each individual library.
126
127      To build with GnuTLS support instead of OpenSSL for SSL/TLS, note that
128      you need to use both --without-ssl and --with-gnutls.
129
130      To build with yassl support instead of OpenSSL or GunTLS, you must build
131      yassl with its OpenSSL emulation enabled and point to that directory root
132      with configure --with-ssl.
133
134      To build with NSS support instead of OpenSSL for SSL/TLS, note that
135      you need to use both --without-ssl and --with-nss.
136
137      To get GSSAPI support, build with --with-gssapi and have the MIT or
138      Heimdal Kerberos 5 packages installed.
139
140      To get support for SCP and SFTP, build with --with-libssh2 and have
141      libssh2 0.16 or later installed.
142      
143
144 Win32
145 =====
146
147    Building Windows DLLs and C run-time (CRT) linkage issues
148    ---------------------------------------------------------
149
150    As a general rule, building a DLL with static CRT linkage is highly
151    discouraged, and intermixing CRTs in the same app is something to
152    avoid at any cost.
153
154    Reading and comprehension of Microsoft Knowledge Base articles
155    KB94248 and KB140584 is a must for any Windows developer. Especially
156    important is full understanding if you are not going to follow the
157    advice given above.
158
159    KB94248  - How To Use the C Run-Time
160               http://support.microsoft.com/kb/94248/en-us
161
162    KB140584 - How to link with the correct C Run-Time (CRT) library
163               http://support.microsoft.com/kb/140584/en-us
164
165    If your app is misbehaving in some strange way, or it is suffering
166    from memory corruption, before asking for further help, please try
167    first to rebuild every single library your app uses as well as your
168    app using the debug multithreaded dynamic C runtime.
169
170    MingW32
171    -------
172
173    Make sure that MinGW32's bin dir is in the search path, for example:
174
175      set PATH=c:\mingw32\bin;%PATH%
176
177    then run 'mingw32-make mingw32' in the root dir. There are other
178    make targets available to build libcurl with more features, use:
179    'mingw32-make mingw32-zlib' to build with Zlib support;
180    'mingw32-make mingw32-ssl-zlib' to build with SSL and Zlib enabled;
181    'mingw32-make mingw32-ssh2-ssl-zlib' to build with SSH2, SSL, Zlib;
182    'mingw32-make mingw32-ssh2-ssl-sspi-zlib' to build with SSH2, SSL, Zlib
183    and SSPI support.
184
185    If you have any problems linking libraries or finding header files, be sure
186    to verify that the provided "Makefile.m32" files use the proper paths, and
187    adjust as necessary. It is also possible to override these paths with 
188    environment variables, for example:
189
190      set ZLIB_PATH=c:\zlib-1.2.3
191      set OPENSSL_PATH=c:\openssl-0.9.8g
192      set LIBSSH2_PATH=c:\libssh2-0.17
193
194    ATTENTION: if you want to build with libssh2 support you have to use latest
195    version 0.17 - previous versions will NOT work with 7.17.0 and later!
196    Use 'mingw32-make mingw32-ssh2-ssl-zlib' to build with SSH2 and SSL enabled.
197
198    It is now also possible to build with other LDAP SDKs than MS LDAP;
199    currently it is possible to build with native Win32 OpenLDAP, or with the
200    Novell CLDAP SDK. If you want to use these you need to set these vars:
201
202      set LDAP_SDK=c:\openldap
203      set USE_LDAP_OPENLDAP=1
204
205    or for using the Novell SDK:
206
207      set USE_LDAP_NOVELL=1
208
209    If you want to enable LDAPS support then set LDAPS=1.
210
211    - optional MingW32-built OpenlDAP SDK available from:
212      http://www.gknw.net/mirror/openldap/
213    - optional recent Novell CLDAP SDK available from:
214      http://developer.novell.com/ndk/cldap.htm
215
216
217    Cygwin
218    ------
219
220    Almost identical to the unix installation. Run the configure script in the
221    curl root with 'sh configure'. Make sure you have the sh executable in
222    /bin/ or you'll see the configure fail toward the end.
223
224    Run 'make'
225
226    Dev-Cpp
227    -------
228
229    See the separate INSTALL.devcpp file for details.
230
231    MSVC from command line
232    ----------------------
233
234    Run the 'vcvars32.bat' file to get a proper environment. The
235    vcvars32.bat file is part of the Microsoft development environment and
236    you may find it in 'C:\Program Files\Microsoft Visual Studio\vc98\bin'
237    provided that you installed Visual C/C++ 6 in the default directory.
238
239    Then run 'nmake vc' in curl's root directory.
240
241    If you want to compile with zlib support, you will need to build
242    zlib (http://www.gzip.org/zlib/) as well. Please read the zlib
243    documentation on how to compile zlib. Define the ZLIB_PATH environment
244    variable to the location of zlib.h and zlib.lib, for example:
245
246      set ZLIB_PATH=c:\zlib-1.2.3
247
248    Then run 'nmake vc-zlib' in curl's root directory.
249
250    If you want to compile with SSL support you need the OpenSSL package.
251    Please read the OpenSSL documentation on how to compile and install
252    the OpenSSL libraries.  The build process of OpenSSL generates the
253    libeay32.dll and ssleay32.dll files in the out32dll subdirectory in
254    the OpenSSL home directory.  OpenSSL static libraries (libeay32.lib,
255    ssleay32.lib, RSAglue.lib) are created in the out32 subdirectory.
256
257    Before running nmake define the OPENSSL_PATH environment variable with
258    the root/base directory of OpenSSL, for example:
259
260      set OPENSSL_PATH=c:\openssl-0.9.8g
261
262    Then run 'nmake vc-ssl' or 'nmake vc-ssl-dll' in curl's root
263    directory.  'nmake vc-ssl' will create a libcurl static and dynamic
264    libraries in the lib subdirectory, as well as a statically linked
265    version of curl.exe in the src subdirectory.  This statically linked
266    version is a standalone executable not requiring any DLL at
267    runtime. This make method requires that you have the static OpenSSL
268    libraries available in OpenSSL's out32 subdirectory.
269    'nmake vc-ssl-dll' creates the libcurl dynamic library and
270    links curl.exe against libcurl and OpenSSL dynamically.
271    This executable requires libcurl.dll and the OpenSSL DLLs
272    at runtime.
273    Run 'nmake vc-ssl-zlib' to build with both ssl and zlib support.
274
275    Borland C++ compiler
276    ---------------------
277
278    compile openssl
279
280    Make sure you include the paths to curl/include and openssl/inc32 in
281    your bcc32.cnf file
282
283    eg : -I"c:\Bcc55\include;c:\path_curl\include;c:\path_openssl\inc32"
284
285    Check to make sure that all of the sources listed in lib/Makefile.b32
286    are present in the /path_to_curl/lib directory. (Check the src
287    directory for missing ones.)
288
289    Make sure the environment variable "BCCDIR" is set to the install
290    location for the compiler eg : c:\Borland\BCC55
291
292    command line:
293    make -f /path_to_curl/lib/Makefile-ssl.b32
294
295    compile simplessl.c with appropriate links
296
297    c:\curl\docs\examples\> bcc32 -L c:\path_to_curl\lib\libcurl.lib
298                                  -L c:\borland\bcc55\lib\psdk\ws2_32.lib
299                                  -L c:\openssl\out32\libeay32.lib
300                                  -L c:\openssl\out32\ssleay32.lib
301                                  simplessl.c
302
303
304    MSVC IDE
305    --------
306
307    If you use VC++, Borland or similar compilers. Include all lib source
308    files in a static lib "project" (all .c and .h files that is).
309    (you should name it libcurl or similar)
310
311    Make the sources in the src/ drawer be a "win32 console application"
312    project. Name it curl.
313
314    For VC++ 6, there's an included Makefile.vc6 that should be possible
315    to use out-of-the-box.
316
317
318    Disabling Specific Protocols in Win32 builds
319    --------------------------------------------
320
321    The configure utility, unfortunately, is not available for the Windows
322    environment, therefore, you cannot use the various disable-protocol
323    options of the configure utility on this platform.
324
325    However, you can use the following defines to disable specific
326    protocols:
327
328    HTTP_ONLY             disables all protocols except HTTP
329    CURL_DISABLE_FTP      disables FTP
330    CURL_DISABLE_LDAP     disables LDAP
331    CURL_DISABLE_TELNET   disables TELNET
332    CURL_DISABLE_DICT     disables DICT
333    CURL_DISABLE_FILE     disables FILE
334    CURL_DISABLE_TFTP     disables TFTP
335
336    If you want to set any of these defines you have the following
337    possibilities:
338
339    - Modify lib/setup.h
340    - Modify lib/Makefile.vc6
341    - Add defines to Project/Settings/C/C++/General/Preprocessor Definitions
342      in the curllib.dsw/curllib.dsp Visual C++ 6 IDE project.
343
344
345    Important static libcurl usage note
346    -----------------------------------
347
348    When building an application that uses the static libcurl library, you must
349    add '-DCURL_STATICLIB' to your CFLAGS.  Otherwise the linker will look for
350    dynamic import symbols.
351
352
353 IBM OS/2
354 ========
355    Building under OS/2 is not much different from building under unix.
356    You need:
357
358       - emx 0.9d
359       - GNU make
360       - GNU patch
361       - ksh
362       - GNU bison
363       - GNU file utilities
364       - GNU sed
365       - autoconf 2.13
366
367    If you want to build with OpenSSL or OpenLDAP support, you'll need to
368    download those libraries, too. Dirk Ohme has done some work to port SSL
369    libraries under OS/2, but it looks like he doesn't care about emx.  You'll
370    find his patches on: http://come.to/Dirk_Ohme
371
372    If during the linking you get an error about _errno being an undefined
373    symbol referenced from the text segment, you need to add -D__ST_MT_ERRNO__
374    in your definitions.
375
376    If everything seems to work fine but there's no curl.exe, you need to add
377    -Zexe to your linker flags.
378
379    If you're getting huge binaries, probably your makefiles have the -g in
380    CFLAGS.
381
382
383 VMS
384 ===
385    (The VMS section is in whole contributed by the friendly Nico Baggus)
386
387    Curl seems to work with FTP & HTTP other protocols are not tested.  (the
388    perl http/ftp testing server supplied as testing too cannot work on VMS
389    because vms has no concept of fork(). [ I tried to give it a whack, but
390    thats of no use.
391
392    SSL stuff has not been ported.
393
394    Telnet has about the same issues as for Win32. When the changes for Win32
395    are clear maybe they'll work for VMS too. The basic problem is that select
396    ONLY works for sockets.
397
398    Marked instances of fopen/[f]stat that might become a problem, especially
399    for non stream files. In this regard, the files opened for writing will be
400    created stream/lf and will thus be safe. Just keep in mind that non-binary
401    read/wring from/to files will have a records size limit of 32767 bytes
402    imposed.
403
404    Stat to get the size of the files is again only safe for stream files &
405    fixed record files without implied CC.
406
407    -- My guess is that only allowing access to stream files is the quickest
408    way to get around the most issues. Therefore all files need to to be
409    checked to be sure they will be stream/lf before processing them.  This is
410    the easiest way out, I know. The reason for this is that code that needs to
411    report the filesize will become a pain in the ass otherwise.
412
413    Exit status.... Well we needed something done here,
414
415    VMS has a structured exist status:
416    | 3  |       2    |     1       |  0|
417    |1098|765432109876|5432109876543|210|
418    +----+------------+-------------+---+
419    |Ctrl|  Facility  | Error code  |sev|
420    +----+------------+-------------+---+
421
422    With the Ctrl-bits an application can tell if part or the whole message has
423    already been printed from the program, DCL doesn't need to print it again.
424
425    Facility - basically the program ID. A code assigned to the program
426    the name can be fetched from external or internal message libraries
427    Error code - the err codes assigned by the application
428    Sev. - severity: Even = error, off = non error
429       0 = Warning
430       1 = Success
431       2 = Error
432       3 = Information
433       4 = Fatal
434       <5-7> reserved.
435
436    This all presents itself with:
437    %<FACILITY>-<Sev>-<Errorname>, <Error message>
438
439    See also the src/curlmsg.msg file, it has the source for the messages In
440    src/main.c a section is devoted to message status values, the globalvalues
441    create symbols with certain values, referenced from a compiled message
442    file. Have all exit function use a exit status derived from a translation
443    table with the compiled message codes.
444
445    This was all compiled with:
446
447       Compaq C V6.2-003 on OpenVMS Alpha V7.1-1H2
448
449    So far for porting notes as of:
450    13-jul-2001
451    N. Baggus
452
453
454 QNX
455 ===
456    (This section was graciously brought to us by David Bentham)
457
458    As QNX is targeted for resource constrained environments, the QNX headers
459    set conservative limits. This includes the FD_SETSIZE macro, set by default
460    to 32. Socket descriptors returned within the CURL library may exceed this,
461    resulting in memory faults/SIGSEGV crashes when passed into select(..)
462    calls using fd_set macros.
463
464    A good all-round solution to this is to override the default when building
465    libcurl, by overriding CFLAGS during configure, example
466    #  configure CFLAGS='-DFD_SETSIZE=64 -g -O2'
467
468
469 RISC OS
470 =======
471    The library can be cross-compiled using gccsdk as follows:
472
473         CC=riscos-gcc AR=riscos-ar RANLIB='riscos-ar -s' ./configure \
474              --host=arm-riscos-aof --without-random --disable-shared
475         make
476
477    where riscos-gcc and riscos-ar are links to the gccsdk tools.
478    You can then link your program with curl/lib/.libs/libcurl.a
479
480
481 AmigaOS
482 =======
483    (This section was graciously brought to us by Diego Casorran)
484
485    To build cURL/libcurl on AmigaOS just type 'make amiga' ...
486
487    What you need is:    (not tested with others versions)
488
489         GeekGadgets / gcc 2.95.3 (http://www.geekgadgets.org/)
490
491         AmiTCP SDK v4.3 (http://www.aminet.net/comm/tcp/AmiTCP-SDK-4.3.lha)
492
493         Native Developer Kit (http://www.amiga.com/3.9/download/NDK3.9.lha)
494
495    As no ixemul.library is required you will be able to build it for
496    WarpOS/PowerPC (not tested by me), as well a MorphOS version should be
497    possible with no problems.
498
499    To enable SSL support, you need a OpenSSL native version (without ixemul),
500    you can find a precompiled package at http://amiga.sourceforge.net/OpenSSL/
501
502
503 NetWare
504 =======
505    To compile curl.nlm / libcurl.nlm you need:
506    - either any gcc / nlmconv, or CodeWarrior 7 PDK 4 or later.
507    - gnu make and awk running on the platform you compile on;
508      native Win32 versions can be downloaded from:
509      http://www.gknw.net/development/prgtools/
510    - recent Novell LibC SDK available from:
511      http://developer.novell.com/ndk/libc.htm
512    - or recent Novell CLib SDK available from:
513      http://developer.novell.com/ndk/clib.htm
514    - optional recent Novell CLDAP SDK available from:
515      http://developer.novell.com/ndk/cldap.htm
516    - optional zlib sources (static or dynamic linking with zlib.imp);
517      sources with NetWare Makefile can be obtained from:
518      http://www.gknw.net/mirror/zlib/
519    - optional OpenSSL sources (version 0.9.8 or later build with BSD sockets);
520      you can find precompiled packages at:
521      http://www.gknw.net/development/ossl/netware/
522      for CLIB-based builds OpenSSL needs to be patched to build with BSD
523      sockets (currently only a winsock-based CLIB build is supported):
524      http://www.gknw.net/development/ossl/netware/patches/v_0.9.8g/openssl-0.9.8g.diff
525    - optional SSH2 sources (version 0.17 or later);
526
527    Set a search path to your compiler, linker and tools; on Linux make
528    sure that the var OSTYPE contains the string 'linux'; set the var
529    NDKBASE to point to the base of your Novell NDK; and then type
530    'make netware' from the top source directory; other targets available
531    are 'netware-ssl', 'netware-ssl-zlib', 'netware-zlib' and 'netware-ares';
532    if you need other combinations you can control the build with the
533    environment variables WITH_SSL, WITH_ZLIB, WITH_ARES, WITH_SSH2, and
534    ENABLE_IPV6; you can set LINK_STATIC=1 to link curl.nlm statically.
535    By default LDAP support is enabled, however currently you will need a patch
536    in order to use the CLDAP NDK with BSD sockets (Novell Bug 300237):
537    http://www.gknw.net/test/curl/cldap_ndk/ldap_ndk.diff
538    I found on some Linux systems (RH9) that OS detection didn't work although
539    a 'set | grep OSTYPE' shows the var present and set; I simply overwrote it
540    with 'OSTYPE=linux-rh9-gnu' and the detection in the Makefile worked...
541    Any help in testing appreciated!
542    Builds automatically created 8 times a day from current CVS are here:
543    http://www.gknw.net/mirror/curl/autobuilds/
544    the status of these builds can be viewed at the autobuild table:
545    http://curl.haxx.se/auto/
546
547
548 eCos
549 ====
550    curl does not use the eCos build system, so you must first build eCos
551    separately, then link curl to the resulting eCos library.  Here's a sample
552    configure line to do so on an x86 Linux box targeting x86:
553
554    GCCLIB=`gcc -print-libgcc-file-name` && \
555    CFLAGS="-D__ECOS=1 -nostdinc -I$ECOS_INSTALL/include \
556     -I`dirname $GCCLIB`/include" \
557    LDFLAGS="-nostdlib -Wl,--gc-sections -Wl,-static \
558     -L$ECOS_INSTALL/lib -Ttarget.ld -ltarget" \
559    ./configure --host=i386 --disable-shared \
560     --without-ssl --without-zlib --disable-manual --disable-ldap
561
562    In most cases, eCos users will be using libcurl from within a custom
563    embedded application.  Using the standard 'curl' executable from
564    within eCos means facing the limitation of the standard eCos C
565    startup code which does not allow passing arguments in main().  To
566    run 'curl' from eCos and have it do something useful, you will need
567    to either modify the eCos startup code to pass in some arguments, or
568    modify the curl application itself to retrieve its arguments from
569    some location set by the bootloader or hard-code them.
570
571    Something like the following patch could be used to hard-code some
572    arguments.  The MTAB_ENTRY line mounts a RAM disk as the root filesystem
573    (without mounting some kind of filesystem, eCos errors out all file
574    operations which curl does not take to well).  The next section synthesizes
575    some command-line arguments for curl to use, in this case to direct curl
576    to read further arguments from a file.  It then creates that file on the
577    RAM disk and places within it a URL to download: a file: URL that
578    just happens to point to the configuration file itself.  The results
579    of running curl in this way is the contents of the configuration file
580    printed to the console.
581
582 --- src/main.c  19 Jul 2006 19:09:56 -0000      1.363
583 +++ src/main.c  24 Jul 2006 21:37:23 -0000
584 @@ -4286,11 +4286,31 @@
585  }
586  
587  
588 +#ifdef __ECOS
589 +#include <cyg/fileio/fileio.h>
590 +MTAB_ENTRY( testfs_mte1,
591 +                   "/",
592 +                   "ramfs",
593 +                   "",
594 +                   0);
595 +#endif
596  
597  int main(int argc, char *argv[])
598  {
599    int res;
600    struct Configurable config;
601 +#ifdef __ECOS
602 +  char *args[] = {"ecos-curl", "-K", "curlconf.txt"};
603 +  FILE *f;
604 +  argc = sizeof(args)/sizeof(args[0]);
605 +  argv = args;
606 +
607 +  f = fopen("curlconf.txt", "w");
608 +  if (f) {
609 +    fprintf(f, "--url file:curlconf.txt");
610 +    fclose(f);
611 +  }
612 +#endif
613    memset(&config, 0, sizeof(struct Configurable));
614  
615    config.errors = stderr; /* default errors to stderr */
616
617
618 Minix
619 =====
620    curl can be compiled on Minix 3 using gcc or ACK (starting with
621    ver. 3.1.3).  The default heap size allocated to several required
622    programs is inadequate for configuring and compiling curl and will
623    result in strange errors unless fixed (which only needs to be done
624    once).
625    
626    ACK
627    ---
628    Increase heap sizes with the commands:
629
630      chmem =1024000 /usr/lib/em_cemcom.ansi
631      chmem =512000 /usr/lib/i386/as
632
633    If you have bash installed:
634
635      chmem =2048000 /usr/local/bin/bash
636
637    Configure and compile with:
638
639      ./configure CC=cc LD=cc GREP=grep CPPFLAGS=-D_POSIX_SOURCE=1
640      make
641
642    GCC
643    ---
644    If you have bash installed:
645
646      chmem =2048000 /usr/local/bin/bash
647
648    Make sure gcc is in your PATH with the command:
649    
650      export PATH=/usr/gnu/bin:$PATH
651    
652    then configure and compile curl with:
653
654      ./configure CC=gcc GREP=grep AR=/usr/gnu/bin/gar
655      make
656
657
658 Symbian OS
659 ==========
660    The Symbian OS port uses the Symbian build system to compile.  From the
661    packages/Symbian/group/ directory, run:
662
663       bldmake bldfiles
664       abld build
665
666    to compile and install curl and libcurl. If your Symbian SDK doesn't
667    include support for P.I.P.S., you will need to contact your SDK vendor
668    to obtain that first.
669
670
671 CROSS COMPILE
672 =============
673    (This section was graciously brought to us by Jim Duey, with additions by
674    Dan Fandrich)
675
676    Download and unpack the cURL package.  Version should be 7.9.1 or later.
677
678    'cd' to the new directory. (e.g. cd curl-7.12.3)
679
680    Set environment variables to point to the cross-compile toolchain and call
681    configure with any options you need.  Be sure and specify the '--host' and
682    '--build' parameters at configuration time.  The following script is an
683    example of cross-compiling for the IBM 405GP PowerPC processor using the
684    toolchain from MonteVista for Hardhat Linux.
685
686    (begin script)
687
688    #! /bin/sh
689
690    export PATH=$PATH:/opt/hardhat/devkit/ppc/405/bin
691    export CPPFLAGS="-I/opt/hardhat/devkit/ppc/405/target/usr/include"
692    export AR=ppc_405-ar
693    export AS=ppc_405-as
694    export LD=ppc_405-ld
695    export RANLIB=ppc_405-ranlib
696    export CC=ppc_405-gcc
697    export NM=ppc_405-nm
698
699    ./configure --target=powerpc-hardhat-linux \
700         --host=powerpc-hardhat-linux \
701         --build=i586-pc-linux-gnu \
702         --prefix=/opt/hardhat/devkit/ppc/405/target/usr/local \
703         --exec-prefix=/usr/local
704
705    (end script)
706
707    You may also need to provide a parameter like '--with-random=/dev/urandom'
708    to configure as it cannot detect the presence of a random number
709    generating device for a target system.  The '--prefix' parameter
710    specifies where cURL will be installed.  If 'configure' completes
711    successfully, do 'make' and 'make install' as usual.
712
713    In some cases, you may be able to simplify the above commands to as
714    little as:
715
716        ./configure --host=ARCH-OS
717
718
719 REDUCING SIZE
720 =============
721    There are a number of configure options that can be used to reduce the
722    size of libcurl for embedded applications where binary size is an
723    important factor.  First, be sure to set the CFLAGS variable when
724    configuring with any relevant compiler optimization flags to reduce the
725    size of the binary.  For gcc, this would mean at minimum the -Os option,
726    potentially the -march=X and -mdynamic-no-pic options as well, e.g.:
727
728       ./configure CFLAGS='-Os' ...
729
730    Note that newer compilers often produce smaller code than older versions
731    due to better optimization.
732
733    Be sure to specify as many --disable- and --without- flags on the configure
734    command-line as you can to disable all the libcurl features that you
735    know your application is not going to need.  Besides specifying the
736    --disable-PROTOCOL flags for all the types of URLs your application
737    will not use, here are some other flags that can reduce the size of the
738    library:
739
740      --disable-ares (disables support for the ARES DNS library)
741      --disable-cookies (disables support for HTTP cookies)
742      --disable-crypto-auth (disables HTTP cryptographic authentication)
743      --disable-ipv6 (disables support for IPv6)
744      --disable-verbose (eliminates debugging strings and error code strings)
745      --enable-hidden-symbols (eliminates unneeded symbols in the shared library)
746      --without-libidn (disables support for the libidn DNS library)
747      --without-ssl (disables support for SSL/TLS)
748      --without-zlib (disables support for on-the-fly decompression)
749
750    The GNU linker has a number of options to reduce the size of the libcurl
751    dynamic libraries on some platforms even further. Specify them by giving
752    the options -Wl,-Bsymbolic and -Wl,-s on the gcc command-line.  
753    Be sure also to strip debugging symbols from your binaries after
754    compiling using 'strip' (or the appropriate variant if cross-compiling).
755    If space is really tight, you may be able to remove some unneeded
756    sections of the shared library using the -R option to objcopy (e.g. the
757    .comment section).
758
759    Using these techniques it is possible to create an HTTP-only shared libcurl
760    library for i386 Linux platforms that is only 96 KiB in size (as of libcurl
761    version 7.17.1, using gcc 4.2.2).
762
763    You may find that statically linking libcurl to your application will
764    result in a lower total size.
765
766
767 PORTS
768 =====
769    This is a probably incomplete list of known hardware and operating systems
770    that curl has been compiled for. If you know a system curl compiles and
771    runs on, that isn't listed, please let us know!
772
773         - Alpha DEC OSF 4
774         - Alpha Digital UNIX v3.2
775         - Alpha FreeBSD 4.1, 4.5
776         - Alpha Linux 2.2, 2.4
777         - Alpha NetBSD 1.5.2
778         - Alpha OpenBSD 3.0
779         - Alpha OpenVMS V7.1-1H2
780         - Alpha Tru64 v5.0 5.1
781         - HP-PA HP-UX 9.X 10.X 11.X
782         - HP-PA Linux
783         - HP3000 MPE/iX
784         - MIPS IRIX 6.2, 6.5
785         - MIPS Linux
786         - OS/400
787         - Pocket PC/Win CE 3.0
788         - Power AIX 3.2.5, 4.2, 4.3.1, 4.3.2, 5.1, 5.2
789         - PowerPC Darwin 1.0
790         - PowerPC Linux
791         - PowerPC Mac OS 9
792         - PowerPC Mac OS X
793         - SuperH4 Linux 2.6.X
794         - SINIX-Z v5
795         - Sparc Linux
796         - Sparc Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8, 9, 10
797         - Sparc SunOS 4.1.X
798         - StrongARM (and other ARM) RISC OS 3.1, 4.02
799         - StrongARM/ARM7/ARM9 Linux 2.4, 2.6
800         - StrongARM NetBSD 1.4.1
801         - Symbian OS (P.I.P.S.)
802         - TPF
803         - Ultrix 4.3a
804         - UNICOS 9.0
805         - i386 BeOS
806         - i386 DOS
807         - i386 eCos 1.3.1
808         - i386 Esix 4.1
809         - i386 FreeBSD
810         - i386 HURD
811         - i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4, 2.6
812         - i386 MINIX 3.1
813         - i386 NetBSD
814         - i386 Novell NetWare
815         - i386 OS/2
816         - i386 OpenBSD
817         - i386 SCO unix
818         - i386 Solaris 2.7
819         - i386 Windows 95, 98, ME, NT, 2000, XP, 2003
820         - i386 QNX 6
821         - i486 ncr-sysv4.3.03 (NCR MP-RAS)
822         - ia64 Linux 2.3.99
823         - m68k AmigaOS 3
824         - m68k Linux
825         - m68k uClinux
826         - m68k OpenBSD
827         - m88k dg-dgux5.4R3.00
828         - s390 Linux
829         - XScale/PXA250 Linux 2.4
830         - Nios II uClinux
831
832 Useful URLs
833 ===========
834
835 OpenSSL   http://www.openssl.org
836 MingW     http://www.mingw.org
837 OpenLDAP  http://www.openldap.org
838 Zlib      http://www.gzip.org/zlib/
839 libssh2   http://www.libssh2.org
840
841