INSTALL 37 KB

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