INSTALL 44 KB

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