INSTALL 42 KB

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