Skip to content
INSTALL 43.5 KiB
Newer Older
                                  _   _ ____  _
                              ___| | | |  _ \| |
                             / __| | | | |_) | |
                            | (__| |_| |  _ <| |___
                             \___|\___/|_| \_\_____|

                                How To Compile

Installing Binary Packages
==========================
   Lots of people download binary distributions of curl and libcurl. This
   document does not describe how to install curl or libcurl using such a
   binary package. This document describes how to compile, build and install
   curl and libcurl from source code.
Building from git
=================

   If you get your code off a git repository, see the GIT-INFO file in the
   root directory for specific instructions on how to proceed.

   A normal unix installation is made in three or four steps (after you've
   unpacked the source archive):
   You probably need to be root when doing the last command.

   If you have checked out the sources from the git repository, read the
   GIT-INFO on how to proceed.
   Get a full listing of all available configure options by invoking it like:

        ./configure --help

   If you want to install curl in a different file hierarchy than /usr/local,
   you need to specify that already when running configure:

        ./configure --prefix=/path/to/curl/tree

   If you happen to have write permission in that directory, you can do 'make
   install' without being root. An example of this would be to make a local
   install in your own home directory:

        ./configure --prefix=$HOME
        make
        make install

   The configure script always tries to find a working SSL library unless
   explicitly told not to. If you have OpenSSL installed in the default search
   path for your compiler/linker, you don't need to do anything special. If
Daniel Stenberg's avatar
Daniel Stenberg committed
   you have OpenSSL installed in /usr/local/ssl, you can run configure like:
        ./configure --with-ssl
   If you have OpenSSL installed somewhere else (for example, /opt/OpenSSL)
   and you have pkg-config installed, set the pkg-config path first, like this:

        env PKG_CONFIG_PATH=/opt/OpenSSL/lib/pkgconfig ./configure --with-ssl

   Without pkg-config installed, use this:
        ./configure --with-ssl=/opt/OpenSSL
Daniel Stenberg's avatar
Daniel Stenberg committed
   If you insist on forcing a build without SSL support, even though you may
   have OpenSSL installed in your system, you can run configure like this:

        ./configure --without-ssl

   If you have OpenSSL installed, but with the libraries in one place and the
Daniel Stenberg's avatar
Daniel Stenberg committed
   header files somewhere else, you have to set the LDFLAGS and CPPFLAGS
   environment variables prior to running configure.  Something like this
   should work:

     (with the Bourne shell and its clones):

        CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \
           ./configure

     (with csh, tcsh and their clones):
        env CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \
           ./configure
   If you have shared SSL libs installed in a directory where your run-time
   linker doesn't find them (which usually causes configure failures), you can
   provide the -R option to ld on some operating systems to set a hard-coded
   path to the run-time linker:

        env LDFLAGS=-R/usr/local/ssl/lib ./configure --with-ssl
Daniel Stenberg's avatar
Daniel Stenberg committed
     To force configure to use the standard cc compiler if both cc and gcc are
     present, run configure like

       CC=cc ./configure
         or
     To force a static library compile, disable the shared library creation
     by running configure like:

       ./configure --disable-shared

     To tell the configure script to skip searching for thread-safe functions,
     add an option like:

       ./configure --disable-thread

     To build curl with kerberos4 support enabled, curl requires the krb4 libs
     and headers installed. You can then use a set of options to tell
     configure where those are:

          --with-krb4-includes[=DIR]   Specify location of kerberos4 headers
          --with-krb4-libs[=DIR]       Specify location of kerberos4 libs
          --with-krb4[=DIR]            where to look for Kerberos4

     In most cases, /usr/athena is the install prefix and then it works with

       ./configure --with-krb4=/usr/athena
     If you're a curl developer and use gcc, you might want to enable more
     debug options with the --enable-debug option.

Daniel Stenberg's avatar
Daniel Stenberg committed
     curl can be built to use a whole range of libraries to provide various
     useful services, and configure will try to auto-detect a decent
     default. But if you want to alter it, you can select how to deal with
     each individual library.

     To build with GnuTLS for SSL/TLS, use both --without-ssl and
     --with-gnutls.
     To build with Cyassl for SSL/TLS, use both --without-ssl and
     --with-cyassl.
     To build with NSS for SSL/TLS, use both --without-ssl and --with-nss.
     To build with PolarSSL for SSL/TLS, use both --without-ssl and
     --with-polarssl.
     To build with axTLS for SSL/TLS, use both --without-ssl and --with-axtls.
     To get GSSAPI support, build with --with-gssapi and have the MIT or
     Heimdal Kerberos 5 packages installed.

     To get support for SCP and SFTP, build with --with-libssh2 and have
     libssh2 0.16 or later installed.
Yang Tse's avatar
 
Yang Tse committed

     To get Metalink support, build with --with-libmetalink and have the
     libmetalink packages installed.

   SPECIAL CASES
   -------------
   Some versions of uClibc require configuring with CPPFLAGS=-D_GNU_SOURCE=1
   to get correct large file support.

   The Open Watcom C compiler on Linux requires configuring with the variables:

       ./configure CC=owcc AR="$WATCOM/binl/wlib" AR_FLAGS=-q \
           RANLIB=/bin/true STRIP="$WATCOM/binl/wstrip" CFLAGS=-Wextra
   Building Windows DLLs and C run-time (CRT) linkage issues
   ---------------------------------------------------------

   As a general rule, building a DLL with static CRT linkage is highly
   discouraged, and intermixing CRTs in the same app is something to
   avoid at any cost.

   Reading and comprehension of Microsoft Knowledge Base articles
   KB94248 and KB140584 is a must for any Windows developer. Especially
   important is full understanding if you are not going to follow the
   advice given above.

   KB94248  - How To Use the C Run-Time
              http://support.microsoft.com/kb/94248/en-us

   KB140584 - How to link with the correct C Run-Time (CRT) library
              http://support.microsoft.com/kb/140584/en-us

   KB190799 - Potential Errors Passing CRT Objects Across DLL Boundaries
              http://msdn.microsoft.com/en-us/library/ms235460

   If your app is misbehaving in some strange way, or it is suffering
   from memory corruption, before asking for further help, please try
   first to rebuild every single library your app uses as well as your
   app using the debug multithreaded dynamic C runtime.

   If you get linkage errors read section 5.7 of the FAQ document.
Loading
Loading full blame…