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