INSTALL 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  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. you can run configure like this:
  42. ./configure --with-ssl=/opt/OpenSSL
  43. If you insist on forcing a build without SSL support, even though you may
  44. have OpenSSL installed in your system, you can run configure like this:
  45. ./configure --without-ssl
  46. If you have OpenSSL installed, but with the libraries in one place and the
  47. header files somewhere else, you have to set the LDFLAGS and CPPFLAGS
  48. environment variables prior to running configure. Something like this
  49. should work:
  50. (with the Bourne shell and its clones):
  51. CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \
  52. ./configure
  53. (with csh, tcsh and their clones):
  54. env CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \
  55. ./configure
  56. If your SSL library was compiled with rsaref (usually for use in the United
  57. States), you may also need to set:
  58. LIBS=-lRSAglue -lrsaref
  59. (as suggested by Doug Kaufman)
  60. MORE OPTIONS
  61. To force configure to use the standard cc compiler if both cc and gcc are
  62. present, run configure like
  63. CC=cc ./configure
  64. or
  65. env Cc=cc ./configure
  66. To force a static library compile, disable the shared library creation
  67. by running configure like:
  68. ./configure --disable-shared
  69. To tell the configure script to skip searching for thread-safe functions,
  70. add an option like:
  71. ./configure --disable-thread
  72. To build curl with kerberos4 support enabled, curl requires the krb4 libs
  73. and headers installed. You can then use a set of options to tell
  74. configure where those are:
  75. --with-krb4-includes[=DIR] Specify location of kerberos4 headers
  76. --with-krb4-libs[=DIR] Specify location of kerberos4 libs
  77. --with-krb4[=DIR] where to look for Kerberos4
  78. In most cases, /usr/athena is the install prefix and then it works with
  79. ./configure --with-krb4=/usr/athena
  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. Win32
  83. =====
  84. Without SSL:
  85. MingW32 (GCC-2.95) style
  86. ------------------------
  87. Run the 'mingw32.bat' file to get the proper environment variables
  88. set, then run 'make mingw32' in the root dir.
  89. If you have any problems linking libraries or finding header files, be
  90. sure to verify that the provided "Makefile.m32" files use the proper
  91. paths, and adjust as necessary.
  92. Cygwin style
  93. ------------
  94. Almost identical to the unix installation. Run the configure script in
  95. the curl root with 'sh configure'. Make sure you have the sh
  96. executable in /bin/ or you'll see the configure fail towards the end.
  97. Run 'make'
  98. Microsoft command line style
  99. ----------------------------
  100. Run the 'vcvars32.bat' file to get the proper environment variables
  101. set, then run 'nmake vc' in the root dir.
  102. The vcvars32.bat file is part of the Microsoft development
  103. environment.
  104. IDE-style
  105. -------------------------
  106. If you use VC++, Borland or similar compilers. Include all lib source
  107. files in a static lib "project" (all .c and .h files that is).
  108. (you should name it libcurl or similar)
  109. Make the sources in the src/ drawer be a "win32 console application"
  110. project. Name it curl.
  111. With VC++, add 'ws2_32.lib' to the link libs when you build curl!
  112. Borland seems to do that itself magically. Of course you have to make
  113. sure it links with the libcurl too!
  114. For VC++ 6, there's an included Makefile.vc6 that should be possible
  115. to use out-of-the-box.
  116. Microsoft note: add /Zm200 to the compiler options to increase the
  117. compiler's memory allocation limit, as the hugehelp.c won't compile
  118. due to "too long puts string".
  119. With SSL:
  120. MingW32 (GCC-2.95) style
  121. ------------------------
  122. Run the 'mingw32.bat' file to get the proper environment variables
  123. set, then run 'make mingw32-ssl' in the root dir.
  124. If you have any problems linking libraries or finding header files, be
  125. sure to look at the provided "Makefile.m32" files for the proper
  126. paths, and adjust as necessary.
  127. Cygwin style
  128. ------------
  129. Haven't done, nor got any reports on how to do. It should although be
  130. identical to the unix setup for the same purpose. See above.
  131. Microsoft command line style
  132. ----------------------------
  133. Please read the OpenSSL documentation on how to compile and install
  134. the OpenSSL libraries. The build process of OpenSSL generates the
  135. libeay32.dll and ssleay32.dll files in the out32dll subdirectory in
  136. the OpenSSL home directory. OpenSSL static libraries (libeay32.lib,
  137. ssleay32.lib, RSAglue.lib) are created in the out32 subdirectory.
  138. Run the 'vcvars32.bat' file to get a proper environment. The
  139. vcvars32.bat file is part of the Microsoft development environment and
  140. you may find it in 'C:\Program Files\Microsoft Visual Studio\vc98\bin'
  141. provided that you installed Visual C/C++ 6 in the default directory.
  142. Before running nmake define the OPENSSL_PATH environment variable with
  143. the root/base directory of OpenSSL, for example:
  144. set OPENSSL_PATH=c:\openssl-0.9.7a
  145. lib/Makefile.vc6 depends on zlib (http://www.gzip.org/zlib/) as well.
  146. Please read the zlib documentation on how to compile zlib. Define the
  147. ZLIB_PATH environment variable to the location of zlib.h and zlib.lib,
  148. for example:
  149. set ZLIB_PATH=c:\zlib-1.1.4
  150. Then run 'nmake vc-ssl' or 'nmake vc-ssl-dll' in curl's root
  151. directory. 'nmake vc-ssl' will create a libcurl static and dynamic
  152. libraries in the lib subdirectory, as well as a statically linked
  153. version of curl.exe in the src subdirectory. This statically linked
  154. version is a standalone executable not requiring any DLL at
  155. runtime. This make method requires that you have the static OpenSSL
  156. libraries available in OpenSSL's out32 subdirectory.
  157. 'nmake vc-ssl-dll' creates the libcurl dynamic library and
  158. links curl.exe against libcurl and OpenSSL dynamically.
  159. This executable requires libcurl.dll and the OpenSSL DLLs
  160. at runtime.
  161. Microsoft / Borland style
  162. -------------------------
  163. If you have OpenSSL, and want curl to take advantage of it, edit your
  164. project properties to use the SSL include path, link with the SSL libs
  165. and define the USE_SSLEAY symbol.
  166. Using Borland C++ compiler version 5.5.1 (available as free download
  167. from Borland's site)
  168. ---------------------------------------------------------------------
  169. compile openssl
  170. Make sure you include the paths to curl/include and openssl/inc32 in
  171. your bcc32.cnf file
  172. eg : -I"c:\Bcc55\include;c:\path_curl\include;c:\path_openssl\inc32"
  173. Check to make sure that all of the sources listed in lib/Makefile.b32
  174. are present in the /path_to_curl/lib directory. (Check the src
  175. directory for missing ones.)
  176. Make sure the environment variable "BCCDIR" is set to the install
  177. location for the compiler eg : c:\Borland\BCC55
  178. command line:
  179. make -f /path_to_curl/lib/Makefile-ssl.b32
  180. compile simplessl.c with appropriate links
  181. c:\curl\docs\examples\> bcc32 -L c:\path_to_curl\lib\libcurl.lib
  182. -L c:\borland\bcc55\lib\psdk\ws2_32.lib
  183. -L c:\openssl\out32\libeay32.lib
  184. -L c:\openssl\out32\ssleay32.lib
  185. simplessl.c
  186. Disabling Specific Protocols:
  187. The configure utility, unfortunately, is not available for the Windows
  188. environment, therefore, you cannot use the various disable-protocol
  189. options of the configure utility on this platform.
  190. However, you can use the following defines to disable specific
  191. protocols:
  192. HTTP_ONLY disables all protocols except HTTP
  193. CURL_DISABLE_FTP disables FTP
  194. CURL_DISABLE_LDAP disables LDAP
  195. CURL_DISABLE_TELNET disables TELNET
  196. CURL_DISABLE_DICT disables DICT
  197. CURL_DISABLE_FILE disables FILE
  198. CURL_DISABLE_GOPHER disables GOPHER
  199. If you want to set any of these defines you have the following
  200. possibilities:
  201. - Modify lib/setup.h
  202. - Modify lib/Makefile.vc6
  203. - Add defines to Project/Settings/C/C++/General/Preprocessor Definitions
  204. in the curllib.dsw/curllib.dsp Visual C++ 6 IDE project.
  205. IBM OS/2
  206. ========
  207. Building under OS/2 is not much different from building under unix.
  208. You need:
  209. - emx 0.9d
  210. - GNU make
  211. - GNU patch
  212. - ksh
  213. - GNU bison
  214. - GNU file utilities
  215. - GNU sed
  216. - autoconf 2.13
  217. If you want to build with OpenSSL or OpenLDAP support, you'll need to
  218. download those libraries, too. Dirk Ohme has done some work to port SSL
  219. libraries under OS/2, but it looks like he doesn't care about emx. You'll
  220. find his patches on: http://come.to/Dirk_Ohme
  221. If during the linking you get an error about _errno being an undefined
  222. symbol referenced from the text segment, you need to add -D__ST_MT_ERRNO__
  223. in your definitions.
  224. If everything seems to work fine but there's no curl.exe, you need to add
  225. -Zexe to your linker flags.
  226. If you're getting huge binaries, probably your makefiles have the -g in
  227. CFLAGS.
  228. VMS
  229. ===
  230. (The VMS section is in whole contributed by the friendly Nico Baggus)
  231. Curl seems to work with FTP & HTTP other protocols are not tested. (the
  232. perl http/ftp testing server supplied as testing too cannot work on VMS
  233. because vms has no concept of fork(). [ I tried to give it a whack, but
  234. thats of no use.
  235. SSL stuff has not been ported.
  236. Telnet has about the same issues as for Win32. When the changes for Win32
  237. are clear maybe they'll work for VMS too. The basic problem is that select
  238. ONLY works for sockets.
  239. Marked instances of fopen/[f]stat that might become a problem, especially
  240. for non stream files. In this regard, the files opened for writing will be
  241. created stream/lf and will thus be safe. Just keep in mind that non-binary
  242. read/wring from/to files will have a records size limit of 32767 bytes
  243. imposed.
  244. Stat to get the size of the files is again only safe for stream files &
  245. fixed record files without implied CC.
  246. -- My guess is that only allowing access to stream files is the quickest
  247. way to get around the most issues. Therefore all files need to to be
  248. checked to be sure they will be stream/lf before processing them. This is
  249. the easiest way out, I know. The reason for this is that code that needs to
  250. report the filesize will become a pain in the ass otherwise.
  251. Exit status.... Well we needed something done here,
  252. VMS has a structured exist status:
  253. | 3 | 2 | 1 | 0|
  254. |1098|765432109876|5432109876543|210|
  255. +----+------------+-------------+---+
  256. |Ctrl| Facility | Error code |sev|
  257. +----+------------+-------------+---+
  258. With the Ctrl-bits an application can tell if part or the whole message has
  259. allready been printed from the program, DCL doesn't need to print it again.
  260. Facility - basicaly the program ID. A code assigned to the program
  261. the name can be fetched from external or internal message libraries
  262. Errorcode - the errodes assigned by the application
  263. Sev. - severity: Even = error, off = non error
  264. 0 = Warning
  265. 1 = Success
  266. 2 = Error
  267. 3 = Information
  268. 4 = Fatal
  269. <5-7> reserved.
  270. This all presents itself with:
  271. %<FACILITY>-<SeV>-<Errorname>, <Error message>
  272. See also the src/curlmsg.msg file, it has the source for the messages In
  273. src/main.c a section is devoted to message status values, the globalvalues
  274. create symbols with certain values, referenced from a compiled message
  275. file. Have all exit function use a exit status derived from a translation
  276. table with the compiled message codes.
  277. This was all compiled with:
  278. Compaq C V6.2-003 on OpenVMS Alpha V7.1-1H2
  279. So far for porting notes as of:
  280. 13-jul-2001
  281. N. Baggus
  282. QNX
  283. ===
  284. (This section was graciously brought to us by David Bentham)
  285. As QNX is targetted for resource constrained environments, the QNX headers
  286. set conservative limits. This includes the FD_SETSIZE macro, set by default
  287. to 32. Socket descriptors returned within the CURL library may exceed this,
  288. resulting in memory faults/SIGSEGV crashes when passed into select(..)
  289. calls using fd_set macros.
  290. A good all-round solution to this is to override the default when building
  291. libcurl, by overriding CFLAGS during configure, example
  292. # configure CFLAGS='-DFD_SETSIZE=64 -g -O2'
  293. CROSS COMPILE
  294. =============
  295. (This section was graciously brought to us by Jim Duey, 23-oct-2001)
  296. Download and unpack the cURL package. Version should be 7.9.1 or later.
  297. 'cd' to the new directory. (ie. curl-7.9.1-pre4)
  298. Set environment variables to point to the cross-compile toolchain and call
  299. configure with any options you need. Be sure and specify the '--host' and
  300. '--build' parameters at configuration time. The following script is an
  301. example of cross-compiling for the IBM 405GP PowerPC processor using the
  302. toolchain from MonteVista for Hardhat Linux.
  303. (begin script)
  304. #! /bin/sh
  305. export PATH=$PATH:/opt/hardhat/devkit/ppc/405/bin
  306. export CPPFLAGS="-I/opt/hardhat/devkit/ppc/405/target/usr/include"
  307. export AR=ppc_405-ar
  308. export AS=ppc_405-as
  309. export LD=ppc_405-ld
  310. export RANLIB=ppc_405-ranlib
  311. export CC=ppc_405-gcc
  312. export NM=ppc_405-nm
  313. configure --target=powerpc-hardhat-linux \
  314. --host=powerpc-hardhat-linux \
  315. --build=i586-pc-linux-gnu \
  316. --prefix=/opt/hardhat/devkit/ppc/405/target/usr/local \
  317. --exec-prefix=/usr/local
  318. (end script)
  319. The '--prefix' parameter specifies where cURL will be installed. If
  320. 'configure' completes successfully, do 'make' and 'make install' as usual.
  321. RISC OS
  322. =======
  323. The library can be cross-compiled using gccsdk as follows:
  324. CC=riscos-gcc AR=riscos-ar RANLIB='riscos-ar -s' ./configure \
  325. --host=arm-riscos-aof --without-random --disable-shared
  326. make
  327. where riscos-gcc and riscos-ar are links to the gccsdk tools.
  328. You can then link your program with curl/lib/.libs/libcurl.a
  329. AmigaOS
  330. =======
  331. (This section was graciously brought to us by Diego Casorran)
  332. To build cURL/libcurl on AmigaOS just type 'make amiga' ...
  333. What you need is: (not tested with others versions)
  334. GeekGadgets / gcc 2.95.3 (http://www.geekgadgets.org/)
  335. AmiTCP SDK v4.3 (http://www.aminet.net/comm/tcp/AmiTCP-SDK-4.3.lha)
  336. Native Developer Kit (http://www.amiga.com/3.9/download/NDK3.9.lha)
  337. As no ixemul.library is required you will be able to build it for
  338. WarpOS/PowerPC (not tested by me), as well a MorphOS version should be
  339. possible with no problems.
  340. To enable SSL support, you need a OpenSSL native version (without ixemul),
  341. you can find a precompiled package at http://amiga.sourceforge.net/OpenSSL/
  342. PORTS
  343. =====
  344. This is a probably incomplete list of known hardware and operating systems
  345. that curl has been compiled for. If you know a system curl compiles and
  346. runs on, that isn't listed, please let us know!
  347. - Alpha DEC OSF 4
  348. - Alpha Digital UNIX v3.2
  349. - Alpha FreeBSD 4.1, 4.5
  350. - Alpha Linux 2.2, 2.4
  351. - Alpha NetBSD 1.5.2
  352. - Alpha OpenBSD 3.0
  353. - Alpha OpenVMS V7.1-1H2
  354. - Alpha Tru64 v5.0 5.1
  355. - HP-PA HP-UX 9.X 10.X 11.X
  356. - HP-PA Linux
  357. - HP3000 MPE/iX
  358. - MIPS IRIX 6.2, 6.5
  359. - MIPS Linux
  360. - Pocket PC/Win CE 3.0
  361. - Power AIX 3.2.5, 4.2, 4.3.1, 4.3.2, 5.1
  362. - PowerPC Darwin 1.0
  363. - PowerPC Linux
  364. - PowerPC Mac OS 9
  365. - PowerPC Mac OS X
  366. - SINIX-Z v5
  367. - Sparc Linux
  368. - Sparc Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8
  369. - Sparc SunOS 4.1.X
  370. - StrongARM (and other ARM) RISC OS 3.1, 4.02
  371. - StrongARM Linux 2.4
  372. - StrongARM NetBSD 1.4.1
  373. - Ultrix 4.3a
  374. - i386 BeOS
  375. - i386 DOS
  376. - i386 FreeBSD
  377. - i386 HURD
  378. - i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4
  379. - i386 NetBSD
  380. - i386 Novell NetWare
  381. - i386 OS/2
  382. - i386 OpenBSD
  383. - i386 SCO unix
  384. - i386 Solaris 2.7
  385. - i386 Windows 95, 98, ME, NT, 2000
  386. - i386 QNX 6
  387. - i486 ncr-sysv4.3.03 (NCR MP-RAS)
  388. - ia64 Linux 2.3.99
  389. - m68k AmigaOS 3
  390. - m68k Linux
  391. - m68k OpenBSD
  392. - m88k dg-dgux5.4R3.00
  393. - s390 Linux
  394. - XScale/PXA250 Linux 2.4
  395. OpenSSL
  396. =======
  397. You'll find OpenSSL information at:
  398. http://www.openssl.org
  399. MingW32/Cygwin
  400. ==============
  401. You'll find MingW32 and Cygwin information at:
  402. http://www.mingw.org
  403. OpenLDAP
  404. ========
  405. You'll find OpenLDAP information at:
  406. http://www.openldap.org