54
54
./configure --with-ssl
56
If you have OpenSSL installed somewhere else (for example, /opt/OpenSSL,)
57
you can run configure like this:
56
If you have OpenSSL installed somewhere else (for example, /opt/OpenSSL)
57
and you have pkg-config installed, set the pkg-config path first, like this:
59
env PKG_CONFIG_PATH=/opt/OpenSSL/lib/pkgconfig ./configure --with-ssl
61
Without pkg-config installed, use this:
59
63
./configure --with-ssl=/opt/OpenSSL
71
75
(with the Bourne shell and its clones):
73
CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \
77
CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \
76
80
(with csh, tcsh and their clones):
78
env CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \
82
env CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \
81
85
If you have shared SSL libs installed in a directory where your run-time
82
86
linker doesn't find them (which usually causes configure failures), you can
83
87
provide the -R option to ld on some operating systems to set a hard-coded
84
88
path to the run-time linker:
86
LDFLAGS=-R/usr/local/ssl/lib ./configure --with-ssl
90
env LDFLAGS=-R/usr/local/ssl/lib ./configure --with-ssl
90
95
To force configure to use the standard cc compiler if both cc and gcc are
91
96
present, run configure like
127
132
To build with GnuTLS support instead of OpenSSL for SSL/TLS, note that
128
133
you need to use both --without-ssl and --with-gnutls.
130
To build with yassl support instead of OpenSSL or GunTLS, you must build
135
To build with yassl support instead of OpenSSL or GnuTLS, you must build
131
136
yassl with its OpenSSL emulation enabled and point to that directory root
132
137
with configure --with-ssl.
140
145
To get support for SCP and SFTP, build with --with-libssh2 and have
141
146
libssh2 0.16 or later installed.
150
Some versions of uClibc require configuring with CPPFLAGS=-D_GNU_SOURCE=1
151
to get correct large file support.
153
The Open Watcom C compiler on Linux requires configuring with the variables:
155
./configure CC=owcc AR="$WATCOM/binl/wlib" AR_FLAGS=-q \
156
RANLIB=/bin/true STRIP="$WATCOM/binl/wstrip" CFLAGS=-Wextra
273
288
Run 'nmake vc-ssl-zlib' to build with both ssl and zlib support.
293
A minimal VC++ 6.0 reference workspace (vc6curl.dsw) is available with the
294
source distribution archive to allow proper building of the two included
295
projects, the libcurl library and the curl tool.
297
1) Open the vc6curl.dsw workspace with MSVC6's IDE.
298
2) Select 'Build' from top menu.
299
3) Select 'Batch Build' from dropdown menu.
300
4) Make sure that the eight project configurations are 'checked'.
301
5) Click on the 'Build' button.
302
6) Once the eight project configurations are built you are done.
304
Dynamic and static libcurl libraries are built in debug and release flavours,
305
and can be located each one in its own subdirectory, DLL-Debug, DLL-Release,
306
LIB-Debug and LIB-Release, all of them below the 'lib' subdirectory.
308
In the same way four curl executables are created, each using its respective
309
library. The resulting curl executables are located in its own subdirectory,
310
DLL-Debug, DLL-Release, LIB-Debug and LIB-Release, below the 'src' subdir.
312
These reference VC++ 6.0 configurations are generated using the dynamic CRT.
314
Intentionally, these reference VC++ 6.0 projects and configurations don't use
315
third party libraries, such as OpenSSL or Zlib, to allow proper compilation
316
and configuration for all new users without further requirements.
318
If you need something more 'involved' you might adjust them for your own use,
319
or explore the world of makefiles described above 'MSVC from command line'.
275
321
Borland C++ compiler
276
322
---------------------
332
374
CURL_DISABLE_DICT disables DICT
333
375
CURL_DISABLE_FILE disables FILE
334
376
CURL_DISABLE_TFTP disables TFTP
377
CURL_DISABLE_HTTP disables HTTP
336
379
If you want to set any of these defines you have the following
382
- Modify lib/config-win32.h
339
383
- Modify lib/setup.h
340
384
- Modify lib/Makefile.vc6
341
385
- Add defines to Project/Settings/C/C++/General/Preprocessor Definitions
342
in the curllib.dsw/curllib.dsp Visual C++ 6 IDE project.
386
in the libcurl.dsw/libcurl.dsp Visual C++ 6 IDE project.
345
389
Important static libcurl usage note
620
664
curl can be compiled on Minix 3 using gcc or ACK (starting with
621
ver. 3.1.3). The default heap size allocated to several required
622
programs is inadequate for configuring and compiling curl and will
623
result in strange errors unless fixed (which only needs to be done
628
Increase heap sizes with the commands:
630
chmem =1024000 /usr/lib/em_cemcom.ansi
631
chmem =512000 /usr/lib/i386/as
633
If you have bash installed:
635
chmem =2048000 /usr/local/bin/bash
669
Increase the heap sizes of the compiler with the command:
637
673
Configure and compile with:
639
./configure CC=cc LD=cc GREP=grep CPPFLAGS=-D_POSIX_SOURCE=1
675
./configure CONFIG_SHELL=/bin/bigsh CC=cc LD=cc AR=/usr/bin/aal \
676
GREP=grep CPPFLAGS='-D_POSIX_SOURCE=1 -I/usr/local/include'
678
chmem =256000 src/curl
644
If you have bash installed:
646
chmem =2048000 /usr/local/bin/bash
648
682
Make sure gcc is in your PATH with the command:
650
684
export PATH=/usr/gnu/bin:$PATH
652
686
then configure and compile curl with:
654
./configure CC=gcc GREP=grep AR=/usr/gnu/bin/gar
688
./configure CONFIG_SHELL=/bin/bigsh CC=gcc AR=/usr/gnu/bin/gar GREP=grep
690
chmem =256000 src/curl
723
758
important factor. First, be sure to set the CFLAGS variable when
724
759
configuring with any relevant compiler optimization flags to reduce the
725
760
size of the binary. For gcc, this would mean at minimum the -Os option,
726
potentially the -march=X and -mdynamic-no-pic options as well, e.g.:
761
and potentially the -march=X and -mdynamic-no-pic options as well, e.g.
728
763
./configure CFLAGS='-Os' ...
730
765
Note that newer compilers often produce smaller code than older versions
731
due to better optimization.
766
due to improved optimization.
733
768
Be sure to specify as many --disable- and --without- flags on the configure
734
769
command-line as you can to disable all the libcurl features that you
737
772
will not use, here are some other flags that can reduce the size of the
740
--disable-ares (disables support for the ARES DNS library)
775
--disable-ares (disables support for the C-ARES DNS library)
741
776
--disable-cookies (disables support for HTTP cookies)
742
777
--disable-crypto-auth (disables HTTP cryptographic authentication)
743
778
--disable-ipv6 (disables support for IPv6)
779
--disable-manual (disables support for the built-in documentation)
780
--disable-proxy (disables support for HTTP and SOCKS proxies)
744
781
--disable-verbose (eliminates debugging strings and error code strings)
745
782
--enable-hidden-symbols (eliminates unneeded symbols in the shared library)
746
783
--without-libidn (disables support for the libidn DNS library)
747
784
--without-ssl (disables support for SSL/TLS)
748
785
--without-zlib (disables support for on-the-fly decompression)
750
The GNU linker has a number of options to reduce the size of the libcurl
751
dynamic libraries on some platforms even further. Specify them by giving
752
the options -Wl,-Bsymbolic and -Wl,-s on the gcc command-line.
787
The GNU compiler and linker have a number of options that can reduce the
788
size of the libcurl dynamic libraries on some platforms even further.
789
Specify them by providing appropriate CFLAGS and LDFLAGS variables on the
790
configure command-line:
791
CFLAGS="-ffunction-sections -fdata-sections" \
792
LDFLAGS="-Wl,-s -Wl,-Bsymbolic -Wl,--gc-sections"
753
794
Be sure also to strip debugging symbols from your binaries after
754
795
compiling using 'strip' (or the appropriate variant if cross-compiling).
755
796
If space is really tight, you may be able to remove some unneeded
756
797
sections of the shared library using the -R option to objcopy (e.g. the
757
798
.comment section).
759
Using these techniques it is possible to create an HTTP-only shared libcurl
760
library for i386 Linux platforms that is only 96 KiB in size (as of libcurl
761
version 7.17.1, using gcc 4.2.2).
800
Using these techniques it is possible to create a basic HTTP-only shared
801
libcurl library for i386 Linux platforms that is only 94 KiB in size, and
802
an FTP-only library that is 87 KiB in size (as of libcurl version 7.19.1,
763
805
You may find that statically linking libcurl to your application will
764
result in a lower total size.
806
result in a lower total size than dynamically linking.
808
Note that the curl test harness can detect the use of some, but not all, of
809
the --disable statements suggested above. Use will cause tests relying on
810
those features to fail. The test harness can be manually forced to skip
811
the relevant tests by specifying certain key words on the runtests.pl
812
command line. Following is a list of appropriate key words:
814
--disable-cookies !cookies
815
--disable-crypto-auth !HTTP\ Digest\ auth !HTTP\ proxy\ Digest\ auth
816
--disable-manual !--manual
817
--disable-proxy !HTTP\ proxy !proxytunnel !SOCKS4 !SOCKS5