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