Home | History | Annotate | Download | only in docs
      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 Building from git
     18 =================
     19 
     20    If you get your code off a git repository, see the GIT-INFO file in the
     21    root directory for specific instructions on how to proceed.
     22 
     23 Unix
     24 ====
     25 
     26    A normal Unix installation is made in three or four steps (after you've
     27    unpacked the source archive):
     28 
     29         ./configure
     30         make
     31         make test (optional)
     32         make install
     33 
     34    You probably need to be root when doing the last command.
     35 
     36    If you have checked out the sources from the git repository, read the
     37    GIT-INFO on how to proceed.
     38 
     39    Get a full listing of all available configure options by invoking it like:
     40 
     41         ./configure --help
     42 
     43    If you want to install curl in a different file hierarchy than /usr/local,
     44    you need to specify that already when running configure:
     45 
     46         ./configure --prefix=/path/to/curl/tree
     47 
     48    If you happen to have write permission in that directory, you can do 'make
     49    install' without being root. An example of this would be to make a local
     50    install in your own home directory:
     51 
     52         ./configure --prefix=$HOME
     53         make
     54         make install
     55 
     56    The configure script always tries to find a working SSL library unless
     57    explicitly told not to. If you have OpenSSL installed in the default search
     58    path for your compiler/linker, you don't need to do anything special. If
     59    you have OpenSSL installed in /usr/local/ssl, you can run configure like:
     60 
     61         ./configure --with-ssl
     62 
     63    If you have OpenSSL installed somewhere else (for example, /opt/OpenSSL)
     64    and you have pkg-config installed, set the pkg-config path first, like this:
     65 
     66         env PKG_CONFIG_PATH=/opt/OpenSSL/lib/pkgconfig ./configure --with-ssl
     67 
     68    Without pkg-config installed, use this:
     69 
     70         ./configure --with-ssl=/opt/OpenSSL
     71 
     72    If you insist on forcing a build without SSL support, even though you may
     73    have OpenSSL installed in your system, you can run configure like this:
     74 
     75         ./configure --without-ssl
     76 
     77    If you have OpenSSL installed, but with the libraries in one place and the
     78    header files somewhere else, you have to set the LDFLAGS and CPPFLAGS
     79    environment variables prior to running configure.  Something like this
     80    should work:
     81 
     82      (with the Bourne shell and its clones):
     83 
     84         CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \
     85            ./configure
     86 
     87      (with csh, tcsh and their clones):
     88 
     89         env CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \
     90            ./configure
     91 
     92    If you have shared SSL libs installed in a directory where your run-time
     93    linker doesn't find them (which usually causes configure failures), you can
     94    provide the -R option to ld on some operating systems to set a hard-coded
     95    path to the run-time linker:
     96 
     97         env LDFLAGS=-R/usr/local/ssl/lib ./configure --with-ssl
     98 
     99    MORE OPTIONS
    100    ------------
    101 
    102      To force configure to use the standard cc compiler if both cc and gcc are
    103      present, run configure like
    104 
    105        CC=cc ./configure
    106          or
    107        env CC=cc ./configure
    108 
    109      To force a static library compile, disable the shared library creation
    110      by running configure like:
    111 
    112        ./configure --disable-shared
    113 
    114      To tell the configure script to skip searching for thread-safe functions,
    115      add an option like:
    116 
    117        ./configure --disable-thread
    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 for SSL/TLS, use both --without-ssl and
    128      --with-gnutls.
    129 
    130      To build with Cyassl for SSL/TLS, use both --without-ssl and
    131      --with-cyassl.
    132 
    133      To build with NSS for SSL/TLS, use both --without-ssl and --with-nss.
    134 
    135      To build with PolarSSL for SSL/TLS, use both --without-ssl and
    136      --with-polarssl.
    137 
    138      To build with axTLS for SSL/TLS, use both --without-ssl and --with-axtls.
    139 
    140      To build with GSS-API support, use --with-gssapi and have the MIT Kerberos
    141      or Heimdal packages installed.
    142 
    143      To get support for SCP and SFTP, build with --with-libssh2 and have
    144      libssh2 0.16 or later installed.
    145 
    146      To get Metalink support, build with --with-libmetalink and have the
    147      libmetalink packages installed.
    148 
    149    SPECIAL CASES
    150    -------------
    151 
    152    Some versions of uClibc require configuring with CPPFLAGS=-D_GNU_SOURCE=1
    153    to get correct large file support.
    154 
    155    The Open Watcom C compiler on Linux requires configuring with the variables:
    156 
    157        ./configure CC=owcc AR="$WATCOM/binl/wlib" AR_FLAGS=-q \
    158            RANLIB=/bin/true STRIP="$WATCOM/binl/wstrip" CFLAGS=-Wextra
    159 
    160 Win32
    161 =====
    162 
    163    Building Windows DLLs and C run-time (CRT) linkage issues
    164    ---------------------------------------------------------
    165 
    166    As a general rule, building a DLL with static CRT linkage is highly
    167    discouraged, and intermixing CRTs in the same app is something to
    168    avoid at any cost.
    169 
    170    Reading and comprehension of Microsoft Knowledge Base articles
    171    KB94248 and KB140584 is a must for any Windows developer. Especially
    172    important is full understanding if you are not going to follow the
    173    advice given above.
    174 
    175    KB94248  - How To Use the C Run-Time
    176               https://support.microsoft.com/kb/94248/en-us
    177 
    178    KB140584 - How to link with the correct C Run-Time (CRT) library
    179               https://support.microsoft.com/kb/140584/en-us
    180 
    181    KB190799 - Potential Errors Passing CRT Objects Across DLL Boundaries
    182               https://msdn.microsoft.com/en-us/library/ms235460
    183 
    184    If your app is misbehaving in some strange way, or it is suffering
    185    from memory corruption, before asking for further help, please try
    186    first to rebuild every single library your app uses as well as your
    187    app using the debug multithreaded dynamic C runtime.
    188 
    189    If you get linkage errors read section 5.7 of the FAQ document.
    190 
    191    MingW32
    192    -------
    193 
    194    Make sure that MinGW32's bin dir is in the search path, for example:
    195 
    196      set PATH=c:\mingw32\bin;%PATH%
    197 
    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
    204    and SSPI support.
    205 
    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:
    210 
    211      set ZLIB_PATH=c:\zlib-1.2.8
    212      set OPENSSL_PATH=c:\openssl-1.0.2c
    213      set LIBSSH2_PATH=c:\libssh2-1.6.0
    214 
    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.
    218 
    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:
    222 
    223      set LDAP_SDK=c:\openldap
    224      set USE_LDAP_OPENLDAP=1
    225 
    226    or for using the Novell SDK:
    227 
    228      set USE_LDAP_NOVELL=1
    229 
    230    If you want to enable LDAPS support then set LDAPS=1.
    231 
    232    - optional MingW32-built OpenLDAP SDK available from:
    233      http://www.gknw.net/mirror/openldap/
    234    - optional recent Novell CLDAP SDK available from:
    235      https://www.novell.com/developer/ndk/ldap_libraries_for_c.html
    236 
    237    Cygwin
    238    ------
    239 
    240    Almost identical to the unix installation. Run the configure script in the
    241    curl root with 'sh configure'. Make sure you have the sh executable in
    242    /bin/ or you'll see the configure fail toward the end.
    243 
    244    Run 'make'
    245 
    246    Dev-Cpp
    247    -------
    248 
    249    See the separate INSTALL.devcpp file for details.
    250 
    251    MSVC 6 caveats
    252    --------------
    253 
    254    If you use MSVC 6 it is required that you use the February 2003 edition of
    255    the 'Platform SDK' which can be downloaded from:
    256 
    257    https://www.microsoft.com/en-us/download/details.aspx?id=12261
    258 
    259    Building any software with MSVC 6 without having PSDK installed is just
    260    asking for trouble down the road once you have released it, you might notice
    261    the problems in the first corner or ten miles ahead, depending mostly on your
    262    choice of static vs dynamic runtime and third party libraries. Anyone using
    263    software built in such way will at some point regret having done so.
    264 
    265    If the compiler has been updated with the installation of a service pack as
    266    those mentioned in https://support.microsoft.com/kb/194022 the compiler can be
    267    safely used to read source code, translate and make it object code.
    268 
    269    But, even with the service packs mentioned above installed, the resulting
    270    software generated in such an environment will be using outdated system
    271    header files and libraries with bugs and security issues which have already
    272    been addressed and fixed long time ago.
    273 
    274    So, building curl and libcurl with MSVC 6 without PSDK is absolutely
    275    discouraged for the benefit of anyone using software built in such
    276    environment. And it will not be supported in any way, as we could just
    277    be hunting bugs which have already been fixed way back in 2003.
    278 
    279    When building with MSVC 6 we attempt to detect if PSDK is not being used,
    280    and if this is the case the build process will fail hard with an error
    281    message stating that the February 2003 PSDK is required. This is done to
    282    protect the unsuspecting and avoid PEBKAC issues.
    283 
    284    Additionally it might happen that a die hard MSVC hacker still wants to
    285    build curl and libcurl with MSVC 6 without PSDK installed, even knowing
    286    that this is a highly discouraged and unsupported build environment. In
    287    this case the brave of heart will be able to build in such an environment
    288    with the requisite of defining preprocessor symbol ALLOW_MSVC6_WITHOUT_PSDK
    289    in lib/config-win32.h and knowing that LDAP and IPv6 support will be missing.
    290 
    291    MSVC from command line
    292    ----------------------
    293 
    294    Run the 'vcvars32.bat' file to get a proper environment. The
    295    vcvars32.bat file is part of the Microsoft development environment and
    296    you may find it in 'C:\Program Files\Microsoft Visual Studio\vc98\bin'
    297    provided that you installed Visual C/C++ 6 in the default directory.
    298 
    299    Then run 'nmake vc' in curl's root directory.
    300 
    301    If you want to compile with zlib support, you will need to build
    302    zlib (http://www.zlib.net/) as well. Please read the zlib
    303    documentation on how to compile zlib. Define the ZLIB_PATH environment
    304    variable to the location of zlib.h and zlib.lib, for example:
    305 
    306      set ZLIB_PATH=c:\zlib-1.2.8
    307 
    308    Then run 'nmake vc-zlib' in curl's root directory.
    309 
    310    If you want to compile with SSL support you need the OpenSSL package.
    311    Please read the OpenSSL documentation on how to compile and install
    312    the OpenSSL libraries.  The build process of OpenSSL generates the
    313    libeay32.dll and ssleay32.dll files in the out32dll subdirectory in
    314    the OpenSSL home directory.  OpenSSL static libraries (libeay32.lib,
    315    ssleay32.lib, RSAglue.lib) are created in the out32 subdirectory.
    316 
    317    Before running nmake define the OPENSSL_PATH environment variable with
    318    the root/base directory of OpenSSL, for example:
    319 
    320      set OPENSSL_PATH=c:\openssl-0.9.8zc
    321 
    322    Then run 'nmake vc-ssl' or 'nmake vc-ssl-dll' in curl's root
    323    directory.  'nmake vc-ssl' will create a libcurl static and dynamic
    324    libraries in the lib subdirectory, as well as a statically linked
    325    version of curl.exe in the src subdirectory.  This statically linked
    326    version is a standalone executable not requiring any DLL at
    327    runtime. This make method requires that you have the static OpenSSL
    328    libraries available in OpenSSL's out32 subdirectory.
    329    'nmake vc-ssl-dll' creates the libcurl dynamic library and
    330    links curl.exe against libcurl and OpenSSL dynamically.
    331    This executable requires libcurl.dll and the OpenSSL DLLs
    332    at runtime.
    333    Run 'nmake vc-ssl-zlib' to build with both ssl and zlib support.
    334 
    335    MSVC IDE
    336    --------
    337 
    338    A fairly comprehensive set of Visual Studio project files are available for
    339    v6.0 through v12.0 and are located in the projects folder to allow proper
    340    building of both the libcurl library as well as the curl tool.
    341 
    342    For more information about these projects and building via Visual Studio
    343    please see the README file located in the projects folder.
    344 
    345    Borland C++ compiler
    346    --------------------
    347 
    348    Ensure that your build environment is properly set up to use the compiler
    349    and associated tools. PATH environment variable must include the path to
    350    bin subdirectory of your compiler installation, eg: c:\Borland\BCC55\bin
    351 
    352    It is advisable to set environment variable BCCDIR to the base path of
    353    the compiler installation.
    354 
    355      set BCCDIR=c:\Borland\BCC55
    356 
    357    In order to build a plain vanilla version of curl and libcurl run the
    358    following command from curl's root directory:
    359 
    360      make borland
    361 
    362    To build curl and libcurl with zlib and OpenSSL support set environment
    363    variables ZLIB_PATH and OPENSSL_PATH to the base subdirectories of the
    364    already built zlib and OpenSSL libraries and from curl's root directory
    365    run command:
    366 
    367      make borland-ssl-zlib
    368 
    369    libcurl library will be built in 'lib' subdirectory while curl tool
    370    is built in 'src' subdirectory. In order to use libcurl library it is
    371    advisable to modify compiler's configuration file bcc32.cfg located
    372    in c:\Borland\BCC55\bin to reflect the location of libraries include
    373    paths for example the '-I' line could result in something like:
    374 
    375      -I"c:\Borland\BCC55\include;c:\curl\include;c:\openssl\inc32"
    376 
    377    bcc3.cfg '-L' line could also be modified to reflect the location of
    378    of libcurl library resulting for example:
    379 
    380      -L"c:\Borland\BCC55\lib;c:\curl\lib;c:\openssl\out32"
    381 
    382    In order to build sample program 'simple.c' from the docs\examples
    383    subdirectory run following command from mentioned subdirectory:
    384 
    385      bcc32 simple.c libcurl.lib cw32mt.lib
    386 
    387    In order to build sample program simplessl.c an SSL enabled libcurl
    388    is required, as well as the OpenSSL libeay32.lib and ssleay32.lib
    389    libraries.
    390 
    391    OTHER MSVC IDEs
    392    ---------------
    393 
    394    If you use VC++, Borland or similar compilers. Include all lib source
    395    files in a static lib "project" (all .c and .h files that is).
    396    (you should name it libcurl or similar)
    397 
    398    Make the sources in the src/ drawer be a "win32 console application"
    399    project. Name it curl.
    400 
    401    Disabling Specific Protocols in Win32 builds
    402    --------------------------------------------
    403 
    404    The configure utility, unfortunately, is not available for the Windows
    405    environment, therefore, you cannot use the various disable-protocol
    406    options of the configure utility on this platform.
    407 
    408    However, you can use the following defines to disable specific
    409    protocols:
    410 
    411    HTTP_ONLY             disables all protocols except HTTP
    412    CURL_DISABLE_FTP      disables FTP
    413    CURL_DISABLE_LDAP     disables LDAP
    414    CURL_DISABLE_TELNET   disables TELNET
    415    CURL_DISABLE_DICT     disables DICT
    416    CURL_DISABLE_FILE     disables FILE
    417    CURL_DISABLE_TFTP     disables TFTP
    418    CURL_DISABLE_HTTP     disables HTTP
    419    CURL_DISABLE_IMAP     disables IMAP
    420    CURL_DISABLE_POP3     disables POP3
    421    CURL_DISABLE_SMTP     disables SMTP
    422 
    423    If you want to set any of these defines you have the following options:
    424 
    425    - Modify lib/config-win32.h
    426    - Modify lib/curl_setup.h
    427    - Modify lib/Makefile.vc6
    428    - Modify the "Preprocessor Definitions" in the libcurl project
    429 
    430    Note: The pre-processor settings can be found using the Visual Studio IDE
    431    under "Project -> Settings -> C/C++ -> General" in VC6 and "Project ->
    432    Properties -> Configuration Properties -> C/C++ -> Preprocessor" in later
    433    versions.
    434 
    435    Using BSD-style lwIP instead of Winsock TCP/IP stack in Win32 builds
    436    --------------------------------------------------------------------
    437 
    438    In order to compile libcurl and curl using BSD-style lwIP TCP/IP stack
    439    it is necessary to make definition of preprocessor symbol USE_LWIPSOCK
    440    visible to libcurl and curl compilation processes. To set this definition
    441    you have the following alternatives:
    442 
    443    - Modify lib/config-win32.h and src/config-win32.h
    444    - Modify lib/Makefile.vc6
    445    - Modify the "Preprocessor Definitions" in the libcurl project
    446 
    447    Note: The pre-processor settings can be found using the Visual Studio IDE
    448    under "Project -> Settings -> C/C++ -> General" in VC6 and "Project ->
    449    Properties -> Configuration Properties -> C/C++ -> Preprocessor" in later
    450    versions.
    451 
    452    Once that libcurl has been built with BSD-style lwIP TCP/IP stack support,
    453    in order to use it with your program it is mandatory that your program
    454    includes lwIP header file <lwip/opt.h> (or another lwIP header that includes
    455    this) before including any libcurl header. Your program does not need the
    456    USE_LWIPSOCK preprocessor definition which is for libcurl internals only.
    457 
    458    Compilation has been verified with lwIP 1.4.0 and contrib-1.4.0 from:
    459 
    460    http://download.savannah.gnu.org/releases/lwip/lwip-1.4.0.zip
    461    http://download.savannah.gnu.org/releases/lwip/contrib-1.4.0.zip
    462 
    463    This BSD-style lwIP TCP/IP stack support must be considered experimental
    464    given that it has been verified that lwIP 1.4.0 still needs some polish,
    465    and libcurl might yet need some additional adjustment, caveat emptor.
    466 
    467    Important static libcurl usage note
    468    -----------------------------------
    469 
    470    When building an application that uses the static libcurl library, you must
    471    add '-DCURL_STATICLIB' to your CFLAGS.  Otherwise the linker will look for
    472    dynamic import symbols.
    473 
    474    Legacy Windows and SSL
    475    ----------------------
    476 
    477    WinSSL (specifically SChannel from Windows SSPI), is the native SSL library
    478    in Windows. However, WinSSL in Windows <= XP is unable to connect to servers
    479    that no longer support the legacy handshakes and algorithms used by those
    480    versions. If you will be using curl in one of those earlier versions of
    481    Windows you should choose another SSL backend such as OpenSSL.
    482 
    483 Apple iOS and Mac OS X
    484 ======================
    485 
    486    On recent Apple operating systems, curl can be built to use Apple's
    487    SSL/TLS implementation, Secure Transport, instead of OpenSSL. To build with
    488    Secure Transport for SSL/TLS, use the configure option --with-darwinssl. (It
    489    is not necessary to use the option --without-ssl.) This feature requires iOS
    490    5.0 or later, or OS X 10.5 ("Leopard") or later.
    491 
    492    When Secure Transport is in use, the curl options --cacert and --capath and
    493    their libcurl equivalents, will be ignored, because Secure Transport uses
    494    the certificates stored in the Keychain to evaluate whether or not to trust
    495    the server. This, of course, includes the root certificates that ship with
    496    the OS. The --cert and --engine options, and their libcurl equivalents, are
    497    currently unimplemented in curl with Secure Transport.
    498 
    499    For OS X users: In OS X 10.8 ("Mountain Lion"), Apple made a major
    500    overhaul to the Secure Transport API that, among other things, added
    501    support for the newer TLS 1.1 and 1.2 protocols. To get curl to support
    502    TLS 1.1 and 1.2, you must build curl on Mountain Lion or later, or by
    503    using the equivalent SDK. If you set the MACOSX_DEPLOYMENT_TARGET
    504    environmental variable to an earlier version of OS X prior to building curl,
    505    then curl will use the new Secure Transport API on Mountain Lion and later,
    506    and fall back on the older API when the same curl binary is executed on
    507    older cats. For example, running these commands in curl's directory in the
    508    shell will build the code such that it will run on cats as old as OS X 10.6
    509    ("Snow Leopard") (using bash):
    510 
    511       export MACOSX_DEPLOYMENT_TARGET="10.6"
    512       ./configure --with-darwinssl
    513       make
    514 
    515 IBM OS/2
    516 ========
    517 
    518    Building under OS/2 is not much different from building under unix.
    519    You need:
    520 
    521       - emx 0.9d
    522       - GNU make
    523       - GNU patch
    524       - ksh
    525       - GNU bison
    526       - GNU file utilities
    527       - GNU sed
    528       - autoconf 2.13
    529 
    530    If you want to build with OpenSSL or OpenLDAP support, you'll need to
    531    download those libraries, too. Dirk Ohme has done some work to port SSL
    532    libraries under OS/2, but it looks like he doesn't care about emx.  You'll
    533    find his patches on: http://come.to/Dirk_Ohme
    534 
    535    If during the linking you get an error about _errno being an undefined
    536    symbol referenced from the text segment, you need to add -D__ST_MT_ERRNO__
    537    in your definitions.
    538 
    539    If everything seems to work fine but there's no curl.exe, you need to add
    540    -Zexe to your linker flags.
    541 
    542    If you're getting huge binaries, probably your makefiles have the -g in
    543    CFLAGS.
    544 
    545 VMS
    546 ===
    547 
    548    (The VMS section is in whole contributed by the friendly Nico Baggus)
    549 
    550    Curl seems to work with FTP & HTTP other protocols are not tested.  (the
    551    perl http/ftp testing server supplied as testing too cannot work on VMS
    552    because vms has no concept of fork(). [ I tried to give it a whack, but
    553    that's of no use.
    554 
    555    SSL stuff has not been ported.
    556 
    557    Telnet has about the same issues as for Win32. When the changes for Win32
    558    are clear maybe they'll work for VMS too. The basic problem is that select
    559    ONLY works for sockets.
    560 
    561    Marked instances of fopen/[f]stat that might become a problem, especially
    562    for non stream files. In this regard, the files opened for writing will be
    563    created stream/lf and will thus be safe. Just keep in mind that non-binary
    564    read/wring from/to files will have a records size limit of 32767 bytes
    565    imposed.
    566 
    567    Stat to get the size of the files is again only safe for stream files &
    568    fixed record files without implied CC.
    569 
    570    -- My guess is that only allowing access to stream files is the quickest
    571    way to get around the most issues. Therefore all files need to to be
    572    checked to be sure they will be stream/lf before processing them.  This is
    573    the easiest way out, I know. The reason for this is that code that needs to
    574    report the filesize will become a pain in the ass otherwise.
    575 
    576    Exit status.... Well we needed something done here,
    577 
    578    VMS has a structured exist status:
    579    | 3  |       2    |     1       |  0|
    580    |1098|765432109876|5432109876543|210|
    581    +----+------------+-------------+---+
    582    |Ctrl|  Facility  | Error code  |sev|
    583    +----+------------+-------------+---+
    584 
    585    With the Ctrl-bits an application can tell if part or the whole message has
    586    already been printed from the program, DCL doesn't need to print it again.
    587 
    588    Facility - basically the program ID. A code assigned to the program
    589    the name can be fetched from external or internal message libraries
    590    Error code - the err codes assigned by the application
    591    Sev. - severity: Even = error, off = non error
    592 
    593       0 = Warning
    594       1 = Success
    595       2 = Error
    596       3 = Information
    597       4 = Fatal
    598       <5-7> reserved.
    599 
    600    This all presents itself with:
    601    %<FACILITY>-<Sev>-<Errorname>, <Error message>
    602 
    603    See also the src/curlmsg.msg file, it has the source for the messages In
    604    src/main.c a section is devoted to message status values, the globalvalues
    605    create symbols with certain values, referenced from a compiled message
    606    file. Have all exit function use a exit status derived from a translation
    607    table with the compiled message codes.
    608 
    609    This was all compiled with:
    610 
    611       Compaq C V6.2-003 on OpenVMS Alpha V7.1-1H2
    612 
    613    So far for porting notes as of:
    614 
    615    13-jul-2001
    616    N. Baggus
    617 
    618 QNX
    619 ===
    620 
    621    (This section was graciously brought to us by David Bentham)
    622 
    623    As QNX is targeted for resource constrained environments, the QNX headers
    624    set conservative limits. This includes the FD_SETSIZE macro, set by default
    625    to 32. Socket descriptors returned within the CURL library may exceed this,
    626    resulting in memory faults/SIGSEGV crashes when passed into select(..)
    627    calls using fd_set macros.
    628 
    629    A good all-round solution to this is to override the default when building
    630    libcurl, by overriding CFLAGS during configure, example
    631 
    632    #  configure CFLAGS='-DFD_SETSIZE=64 -g -O2'
    633 
    634 RISC OS
    635 =======
    636 
    637    The library can be cross-compiled using gccsdk as follows:
    638 
    639         CC=riscos-gcc AR=riscos-ar RANLIB='riscos-ar -s' ./configure \
    640              --host=arm-riscos-aof --without-random --disable-shared
    641         make
    642 
    643    where riscos-gcc and riscos-ar are links to the gccsdk tools.
    644    You can then link your program with curl/lib/.libs/libcurl.a
    645 
    646 AmigaOS
    647 =======
    648 
    649    (This section was graciously brought to us by Diego Casorran)
    650 
    651    To build cURL/libcurl on AmigaOS just type 'make amiga' ...
    652 
    653    What you need is:    (not tested with others versions)
    654 
    655         GeekGadgets / gcc 2.95.3 (http://www.geekgadgets.org/)
    656 
    657         AmiTCP SDK v4.3 (http://www.aminet.net/comm/tcp/AmiTCP-SDK-4.3.lha)
    658 
    659         Native Developer Kit (http://www.amiga.com/3.9/download/NDK3.9.lha)
    660 
    661    As no ixemul.library is required you will be able to build it for
    662    WarpOS/PowerPC (not tested by me), as well a MorphOS version should be
    663    possible with no problems.
    664 
    665    To enable SSL support, you need a OpenSSL native version (without ixemul),
    666    you can find a precompiled package at http://amiga.sourceforge.net/OpenSSL/
    667 
    668 NetWare
    669 =======
    670 
    671    To compile curl.nlm / libcurl.nlm you need:
    672 
    673    - either any gcc / nlmconv, or CodeWarrior 7 PDK 4 or later.
    674    - gnu make and awk running on the platform you compile on;
    675      native Win32 versions can be downloaded from:
    676      http://www.gknw.net/development/prgtools/
    677    - recent Novell LibC or Novell CLib SDK available from:
    678      https://www.novell.com/developer/ndk/
    679    - optional recent Novell CLDAP SDK available from:
    680      https://www.novell.com/developer/ndk/ldap_libraries_for_c.html
    681    - optional zlib sources (static or dynamic linking with zlib.imp);
    682      sources with NetWare Makefile can be obtained from:
    683      http://www.gknw.net/mirror/zlib/
    684    - optional OpenSSL sources (version 0.9.8 or later build with BSD sockets);
    685      you can find precompiled packages at:
    686      http://www.gknw.net/development/ossl/netware/
    687      for CLIB-based builds OpenSSL 0.9.8h or later is required  - earlier versions
    688      don't support building with CLIB BSD sockets.
    689    - optional SSH2 sources (version 0.17 or later);
    690 
    691    Set a search path to your compiler, linker and tools; on Linux make
    692    sure that the var OSTYPE contains the string 'linux'; set the var
    693    NDKBASE to point to the base of your Novell NDK; and then type
    694    'make netware' from the top source directory; other targets available
    695    are 'netware-ssl', 'netware-ssl-zlib', 'netware-zlib' and 'netware-ares';
    696    if you need other combinations you can control the build with the
    697    environment variables WITH_SSL, WITH_ZLIB, WITH_ARES, WITH_SSH2, and
    698    ENABLE_IPV6; you can set LINK_STATIC=1 to link curl.nlm statically.
    699    By default LDAP support is enabled, however currently you will need a patch
    700    in order to use the CLDAP NDK with BSD sockets (Novell Bug 300237):
    701    http://www.gknw.net/test/curl/cldap_ndk/ldap_ndk.diff
    702    I found on some Linux systems (RH9) that OS detection didn't work although
    703    a 'set | grep OSTYPE' shows the var present and set; I simply overwrote it
    704    with 'OSTYPE=linux-rh9-gnu' and the detection in the Makefile worked...
    705    Any help in testing appreciated!
    706    Builds automatically created 8 times a day from current git are here:
    707    http://www.gknw.net/mirror/curl/autobuilds/
    708    the status of these builds can be viewed at the autobuild table:
    709    https://curl.haxx.se/dev/builds.html
    710 
    711 eCos
    712 ====
    713 
    714    curl does not use the eCos build system, so you must first build eCos
    715    separately, then link curl to the resulting eCos library.  Here's a sample
    716    configure line to do so on an x86 Linux box targeting x86:
    717 
    718    GCCLIB=`gcc -print-libgcc-file-name` && \
    719    CFLAGS="-D__ECOS=1 -nostdinc -I$ECOS_INSTALL/include \
    720     -I`dirname $GCCLIB`/include" \
    721    LDFLAGS="-nostdlib -Wl,--gc-sections -Wl,-static \
    722     -L$ECOS_INSTALL/lib -Ttarget.ld -ltarget" \
    723    ./configure --host=i386 --disable-shared \
    724     --without-ssl --without-zlib --disable-manual --disable-ldap
    725 
    726    In most cases, eCos users will be using libcurl from within a custom
    727    embedded application.  Using the standard 'curl' executable from
    728    within eCos means facing the limitation of the standard eCos C
    729    startup code which does not allow passing arguments in main().  To
    730    run 'curl' from eCos and have it do something useful, you will need
    731    to either modify the eCos startup code to pass in some arguments, or
    732    modify the curl application itself to retrieve its arguments from
    733    some location set by the bootloader or hard-code them.
    734 
    735    Something like the following patch could be used to hard-code some
    736    arguments.  The MTAB_ENTRY line mounts a RAM disk as the root filesystem
    737    (without mounting some kind of filesystem, eCos errors out all file
    738    operations which curl does not take to well).  The next section synthesizes
    739    some command-line arguments for curl to use, in this case to direct curl
    740    to read further arguments from a file.  It then creates that file on the
    741    RAM disk and places within it a URL to download: a file: URL that
    742    just happens to point to the configuration file itself.  The results
    743    of running curl in this way is the contents of the configuration file
    744    printed to the console.
    745 
    746 --- src/main.c  19 Jul 2006 19:09:56 -0000    1.363
    747 +++ src/main.c  24 Jul 2006 21:37:23 -0000
    748 @@ -4286,11 +4286,31 @@
    749  }
    750 
    751 
    752 +#ifdef __ECOS
    753 +#include <cyg/fileio/fileio.h>
    754 +MTAB_ENTRY( testfs_mte1,
    755 +                   "/",
    756 +                   "ramfs",
    757 +                   "",
    758 +                   0);
    759 +#endif
    760 
    761  int main(int argc, char *argv[])
    762  {
    763    int res;
    764    struct Configurable config;
    765 +#ifdef __ECOS
    766 +  char *args[] = {"ecos-curl", "-K", "curlconf.txt"};
    767 +  FILE *f;
    768 +  argc = sizeof(args)/sizeof(args[0]);
    769 +  argv = args;
    770 +
    771 +  f = fopen("curlconf.txt", "w");
    772 +  if (f) {
    773 +    fprintf(f, "--url file:curlconf.txt");
    774 +    fclose(f);
    775 +  }
    776 +#endif
    777    memset(&config, 0, sizeof(struct Configurable));
    778 
    779    config.errors = stderr; /* default errors to stderr */
    780 
    781 Minix
    782 =====
    783 
    784    curl can be compiled on Minix 3 using gcc or ACK (starting with
    785    ver. 3.1.3).  Ensure that GNU gawk and bash are both installed and
    786    available in the PATH.
    787 
    788    ACK
    789    ---
    790    Increase the heap sizes of the compiler with the command:
    791 
    792      binsizes xxl
    793 
    794    then configure and compile curl with:
    795 
    796      ./configure CC=cc LD=cc AR=/usr/bin/aal GREP=grep \
    797       CPPFLAGS='-D_POSIX_SOURCE=1 -I/usr/local/include'
    798      make
    799      chmem =256000 src/curl
    800 
    801    GCC
    802    ---
    803    Make sure gcc is in your PATH with the command:
    804 
    805      export PATH=/usr/gnu/bin:$PATH
    806 
    807    then configure and compile curl with:
    808 
    809      ./configure CC=gcc AR=/usr/gnu/bin/gar GREP=grep
    810      make
    811      chmem =256000 src/curl
    812 
    813 Symbian OS
    814 ==========
    815 
    816    The Symbian OS port uses the Symbian build system to compile.  From the
    817    packages/Symbian/group/ directory, run:
    818 
    819       bldmake bldfiles
    820       abld build
    821 
    822    to compile and install curl and libcurl using SBSv1. If your Symbian
    823    SDK doesn't include support for P.I.P.S., you will need to contact
    824    your SDK vendor to obtain that first.
    825 
    826 VxWorks
    827 ========
    828 
    829    Build for VxWorks is performed using cross compilation.
    830    That means you build on Windows machine using VxWorks tools and
    831    run the built image on the VxWorks device.
    832 
    833    To build libcurl for VxWorks you need:
    834 
    835       - CYGWIN (free, https://cygwin.com/)
    836       - Wind River Workbench (commercial)
    837 
    838    If you have CYGWIN and Workbench installed on you machine
    839    follow after next steps:
    840 
    841     1. Open the Command Prompt window and change directory ('cd')
    842        to the libcurl 'lib' folder.
    843     2. Add CYGWIN 'bin' folder to the PATH environment variable.
    844        For example, type 'set PATH=C:/embedded/cygwin/bin;%PATH%'.
    845     3. Adjust environment variables defined in 'Environment' section
    846        of the Makefile.vxworks file to point to your software folders.
    847     4. Build the libcurl by typing 'make -f ./Makefile.vxworks'
    848 
    849    As a result the libcurl.a library should be created in the 'lib' folder.
    850    To clean the build results type 'make -f ./Makefile.vxworks clean'.
    851 
    852 Android
    853 =======
    854 
    855    Method using the static makefile:
    856 
    857       - see the build notes in the packages/Android/Android.mk file.
    858 
    859    Method using a configure cross-compile (tested with Android NDK r7c, r8):
    860 
    861       - prepare the toolchain of the Android NDK for standalone use; this can
    862         be done by invoking the script:
    863         ./build/tools/make-standalone-toolchain.sh
    864         which creates a usual cross-compile toolchain. Lets assume that you put
    865         this toolchain below /opt then invoke configure with something like:
    866         export PATH=/opt/arm-linux-androideabi-4.4.3/bin:$PATH
    867         ./configure --host=arm-linux-androideabi [more configure options]
    868         make
    869       - if you want to compile directly from our GIT repo you might run into
    870         this issue with older automake stuff:
    871         checking host system type...
    872         Invalid configuration `arm-linux-androideabi':
    873         system `androideabi' not recognized
    874         configure: error: /bin/sh ./config.sub arm-linux-androideabi failed
    875         this issue can be fixed with using more recent versions of config.sub
    876         and config.guess which can be obtained here:
    877         http://git.savannah.gnu.org/gitweb/?p=config.git;a=tree
    878         you need to replace your system-own versions which usually can be
    879         found in your automake folder:
    880         find /usr -name config.sub
    881 
    882    Wrapper for pkg-config:
    883 
    884       - In order to make proper use of pkg-config so that configure is able to
    885         find all dependencies you should create a wrapper script for pkg-config;
    886         file /opt/arm-linux-androideabi-4.4.3/bin/arm-linux-androideabi-pkg-config:
    887 
    888         #!/bin/sh
    889         SYSROOT=$(dirname ${0%/*})/sysroot
    890         export PKG_CONFIG_DIR=
    891         export PKG_CONFIG_LIBDIR=${SYSROOT}/usr/local/lib/pkgconfig:${SYSROOT}/usr/share/pkgconfig
    892         export PKG_CONFIG_SYSROOT_DIR=${SYSROOT}
    893         exec pkg-config "$@"
    894 
    895         also create a copy or symlink with name arm-unknown-linux-androideabi-pkg-config.
    896 
    897 CROSS COMPILE
    898 =============
    899 
    900    (This section was graciously brought to us by Jim Duey, with additions by
    901    Dan Fandrich)
    902 
    903    Download and unpack the cURL package.
    904 
    905    'cd' to the new directory. (e.g. cd curl-7.12.3)
    906 
    907    Set environment variables to point to the cross-compile toolchain and call
    908    configure with any options you need.  Be sure and specify the '--host' and
    909    '--build' parameters at configuration time.  The following script is an
    910    example of cross-compiling for the IBM 405GP PowerPC processor using the
    911    toolchain from MonteVista for Hardhat Linux.
    912 
    913    (begin script)
    914 
    915    #! /bin/sh
    916 
    917    export PATH=$PATH:/opt/hardhat/devkit/ppc/405/bin
    918    export CPPFLAGS="-I/opt/hardhat/devkit/ppc/405/target/usr/include"
    919    export AR=ppc_405-ar
    920    export AS=ppc_405-as
    921    export LD=ppc_405-ld
    922    export RANLIB=ppc_405-ranlib
    923    export CC=ppc_405-gcc
    924    export NM=ppc_405-nm
    925 
    926    ./configure --target=powerpc-hardhat-linux \
    927         --host=powerpc-hardhat-linux \
    928         --build=i586-pc-linux-gnu \
    929         --prefix=/opt/hardhat/devkit/ppc/405/target/usr/local \
    930         --exec-prefix=/usr/local
    931 
    932    (end script)
    933 
    934    You may also need to provide a parameter like '--with-random=/dev/urandom'
    935    to configure as it cannot detect the presence of a random number
    936    generating device for a target system.  The '--prefix' parameter
    937    specifies where cURL will be installed.  If 'configure' completes
    938    successfully, do 'make' and 'make install' as usual.
    939 
    940    In some cases, you may be able to simplify the above commands to as
    941    little as:
    942 
    943        ./configure --host=ARCH-OS
    944 
    945 REDUCING SIZE
    946 =============
    947 
    948    There are a number of configure options that can be used to reduce the
    949    size of libcurl for embedded applications where binary size is an
    950    important factor.  First, be sure to set the CFLAGS variable when
    951    configuring with any relevant compiler optimization flags to reduce the
    952    size of the binary.  For gcc, this would mean at minimum the -Os option,
    953    and potentially the -march=X, -mdynamic-no-pic and -flto options as well,
    954    e.g.
    955 
    956       ./configure CFLAGS='-Os' LDFLAGS='-Wl,-Bsymbolic'...
    957 
    958    Note that newer compilers often produce smaller code than older versions
    959    due to improved optimization.
    960 
    961    Be sure to specify as many --disable- and --without- flags on the configure
    962    command-line as you can to disable all the libcurl features that you
    963    know your application is not going to need.  Besides specifying the
    964    --disable-PROTOCOL flags for all the types of URLs your application
    965    will not use, here are some other flags that can reduce the size of the
    966    library:
    967 
    968      --disable-ares (disables support for the C-ARES DNS library)
    969      --disable-cookies (disables support for HTTP cookies)
    970      --disable-crypto-auth (disables HTTP cryptographic authentication)
    971      --disable-ipv6 (disables support for IPv6)
    972      --disable-manual (disables support for the built-in documentation)
    973      --disable-proxy (disables support for HTTP and SOCKS proxies)
    974      --disable-unix-sockets (disables support for UNIX sockets)
    975      --disable-verbose (eliminates debugging strings and error code strings)
    976      --disable-versioned-symbols (disables support for versioned symbols)
    977      --enable-hidden-symbols (eliminates unneeded symbols in the shared library)
    978      --without-libidn (disables support for the libidn DNS library)
    979      --without-librtmp (disables support for RTMP)
    980      --without-ssl (disables support for SSL/TLS)
    981      --without-zlib (disables support for on-the-fly decompression)
    982 
    983    The GNU compiler and linker have a number of options that can reduce the
    984    size of the libcurl dynamic libraries on some platforms even further.
    985    Specify them by providing appropriate CFLAGS and LDFLAGS variables on the
    986    configure command-line, e.g.
    987 
    988      CFLAGS="-Os -ffunction-sections -fdata-sections \
    989              -fno-unwind-tables -fno-asynchronous-unwind-tables -flto" \
    990      LDFLAGS="-Wl,-s -Wl,-Bsymbolic -Wl,--gc-sections"
    991 
    992    Be sure also to strip debugging symbols from your binaries after
    993    compiling using 'strip' (or the appropriate variant if cross-compiling).
    994    If space is really tight, you may be able to remove some unneeded
    995    sections of the shared library using the -R option to objcopy (e.g. the
    996    .comment section).
    997 
    998    Using these techniques it is possible to create a basic HTTP-only shared
    999    libcurl library for i386 Linux platforms that is only 109 KiB in size, and
   1000    an FTP-only library that is 109 KiB in size (as of libcurl version 7.45.0,
   1001    using gcc 4.9.2).
   1002 
   1003    You may find that statically linking libcurl to your application will
   1004    result in a lower total size than dynamically linking.
   1005 
   1006    Note that the curl test harness can detect the use of some, but not all, of
   1007    the --disable statements suggested above. Use will cause tests relying on
   1008    those features to fail.  The test harness can be manually forced to skip
   1009    the relevant tests by specifying certain key words on the runtests.pl
   1010    command line.  Following is a list of appropriate key words:
   1011 
   1012      --disable-cookies          !cookies
   1013      --disable-manual           !--manual
   1014      --disable-proxy            !HTTP\ proxy !proxytunnel !SOCKS4 !SOCKS5
   1015 
   1016 PORTS
   1017 =====
   1018 
   1019    This is a probably incomplete list of known hardware and operating systems
   1020    that curl has been compiled for. If you know a system curl compiles and
   1021    runs on, that isn't listed, please let us know!
   1022 
   1023         - Alpha DEC OSF 4
   1024         - Alpha Digital UNIX v3.2
   1025         - Alpha FreeBSD 4.1, 4.5
   1026         - Alpha Linux 2.2, 2.4
   1027         - Alpha NetBSD 1.5.2
   1028         - Alpha OpenBSD 3.0
   1029         - Alpha OpenVMS V7.1-1H2
   1030         - Alpha Tru64 v5.0 5.1
   1031         - AVR32 Linux
   1032         - ARM Android 1.5, 2.1, 2.3, 3.2, 4.x
   1033         - ARM INTEGRITY
   1034         - ARM iOS
   1035         - Cell Linux
   1036         - Cell Cell OS
   1037         - HP-PA HP-UX 9.X 10.X 11.X
   1038         - HP-PA Linux
   1039         - HP3000 MPE/iX
   1040         - MicroBlaze uClinux
   1041         - MIPS IRIX 6.2, 6.5
   1042         - MIPS Linux
   1043         - OS/400
   1044         - Pocket PC/Win CE 3.0
   1045         - Power AIX 3.2.5, 4.2, 4.3.1, 4.3.2, 5.1, 5.2
   1046         - PowerPC Darwin 1.0
   1047         - PowerPC INTEGRITY
   1048         - PowerPC Linux
   1049         - PowerPC Mac OS 9
   1050         - PowerPC Mac OS X
   1051         - SH4 Linux 2.6.X
   1052         - SH4 OS21
   1053         - SINIX-Z v5
   1054         - Sparc Linux
   1055         - Sparc Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8, 9, 10
   1056         - Sparc SunOS 4.1.X
   1057         - StrongARM (and other ARM) RISC OS 3.1, 4.02
   1058         - StrongARM/ARM7/ARM9 Linux 2.4, 2.6
   1059         - StrongARM NetBSD 1.4.1
   1060         - Symbian OS (P.I.P.S.) 9.x
   1061         - TPF
   1062         - Ultrix 4.3a
   1063         - UNICOS 9.0
   1064         - i386 BeOS
   1065         - i386 DOS
   1066         - i386 eCos 1.3.1
   1067         - i386 Esix 4.1
   1068         - i386 FreeBSD
   1069         - i386 HURD
   1070         - i386 Haiku OS
   1071         - i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4, 2.6
   1072         - i386 Mac OS X
   1073         - i386 MINIX 3.1
   1074         - i386 NetBSD
   1075         - i386 Novell NetWare
   1076         - i386 OS/2
   1077         - i386 OpenBSD
   1078         - i386 QNX 6
   1079         - i386 SCO unix
   1080         - i386 Solaris 2.7
   1081         - i386 Windows 95, 98, ME, NT, 2000, XP, 2003
   1082         - i486 ncr-sysv4.3.03 (NCR MP-RAS)
   1083         - ia64 Linux 2.3.99
   1084         - m68k AmigaOS 3
   1085         - m68k Linux
   1086         - m68k uClinux
   1087         - m68k OpenBSD
   1088         - m88k dg-dgux5.4R3.00
   1089         - s390 Linux
   1090         - x86_64 Linux
   1091         - XScale/PXA250 Linux 2.4
   1092         - Nios II uClinux
   1093 
   1094 Useful URLs
   1095 ===========
   1096 
   1097 axTLS        http://axtls.sourceforge.net/
   1098 c-ares       http://c-ares.haxx.se/
   1099 GNU GSS      https://www.gnu.org/software/gss/
   1100 GnuTLS       https://www.gnu.org/software/gnutls/
   1101 Heimdal      http://www.h5l.org/
   1102 libidn       https://www.gnu.org/software/libidn/
   1103 libmetalink  https://launchpad.net/libmetalink/
   1104 libssh2      https://www.libssh2.org/
   1105 MIT Kerberos http://web.mit.edu/kerberos/www/dist/
   1106 NSS          https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS
   1107 OpenLDAP     http://www.openldap.org/
   1108 OpenSSL      https://www.openssl.org/
   1109 PolarSSL     https://tls.mbed.org/
   1110 wolfSSL      https://www.wolfssl.com/wolfSSL/
   1111 Zlib         http://www.zlib.net/
   1112 
   1113 MingW        http://www.mingw.org/
   1114 MinGW-w64    http://mingw-w64.sourceforge.net/
   1115 OpenWatcom   http://www.openwatcom.org/
   1116