INSTALL 41 KB

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