CROSS COMPILE
=============
(This section was graciously brought to us by Jim Duey, with additions by
Dan Fandrich)
Download and unpack the cURL package. Version should be 7.9.1 or later.
'cd' to the new directory. (e.g. cd curl-7.12.3)
Set environment variables to point to the cross-compile toolchain and call
configure with any options you need. Be sure and specify the '--host' and
'--build' parameters at configuration time. The following script is an
example of cross-compiling for the IBM 405GP PowerPC processor using the
toolchain from MonteVista for Hardhat Linux.
(begin script)
#! /bin/sh
export PATH=$PATH:/opt/hardhat/devkit/ppc/405/bin
export CPPFLAGS="-I/opt/hardhat/devkit/ppc/405/target/usr/include"
export AR=ppc_405-ar
export AS=ppc_405-as
export LD=ppc_405-ld
export RANLIB=ppc_405-ranlib
export CC=ppc_405-gcc
export NM=ppc_405-nm
./configure --target=powerpc-hardhat-linux
--host=powerpc-hardhat-linux
--build=i586-pc-linux-gnu
--prefix=/opt/hardhat/devkit/ppc/405/target/usr/local
--exec-prefix=/usr/local
(end script)
You may also need to provide a parameter like '--with-random=/dev/urandom'
to configure as it cannot detect the presence of a random number
generating device for a target system. The '--prefix' parameter
specifies where cURL will be installed. If 'configure' completes
successfully, do 'make' and 'make install' as usual.
In some cases, you may be able to simplify the above commands to as
little as:
./configure --host=ARCH-OS
There are a number of configure options that can be used to reduce the
size of libcurl for embedded applications where binary size is an
important factor. First, be sure to set the CFLAGS environment variable
when configuring with any compiler optimization flags to reduce the
size of the binary. For gcc, this would mean at minimum:
env CFLAGS='-Os' ./configure ...
Be sure to specify as many --disable- and --without- flags on the configure
command-line as you can to disable all the libcurl features that you
know your application is not going to need. Besides specifying the
--disable-PROTOCOL flags for all the types of URLs your application
will not use, here are some other flags that can reduce the size of the
library:
--disable-ares (disables support for the ARES DNS library)
--disable-cookies (disables support for HTTP cookies)
--disable-crypto-auth (disables HTTP cryptographic authentication)
--disable-ipv6 (disables support for IPv6)
--disable-verbose (eliminates debugging strings and error code strings)
--without-libidn (disables support for the libidn DNS library)
--without-ssl (disables support for SSL/TLS)
--without-zlib (disables support for on-the-fly decompression)
You may find that statically linking libcurl to your application will
result in a lower total size.
PORTS
=====
This is a probably incomplete list of known hardware and operating systems
that curl has been compiled for. If you know a system curl compiles and
runs on, that isn't listed, please let us know!
- Alpha DEC OSF 4
- Alpha Digital UNIX v3.2
- Alpha FreeBSD 4.1, 4.5
- Alpha Linux 2.2, 2.4
- Alpha NetBSD 1.5.2
- Alpha OpenBSD 3.0
- Alpha OpenVMS V7.1-1H2
- Alpha Tru64 v5.0 5.1
- HP-PA HP-UX 9.X 10.X 11.X
- HP-PA Linux
- HP3000 MPE/iX
- MIPS IRIX 6.2, 6.5
- MIPS Linux
- Pocket PC/Win CE 3.0
- Power AIX 3.2.5, 4.2, 4.3.1, 4.3.2, 5.1, 5.2
- PowerPC Darwin 1.0
- PowerPC Linux
- PowerPC Mac OS 9
- PowerPC Mac OS X
- SINIX-Z v5
- Sparc Linux
- Sparc Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8, 9, 10
- Sparc SunOS 4.1.X
- StrongARM (and other ARM) RISC OS 3.1, 4.02
- StrongARM/ARM7/ARM9 Linux 2.4, 2.6
- StrongARM NetBSD 1.4.1
- Ultrix 4.3a
- i386 BeOS
- i386 DOS
- i386 Esix 4.1
- i386 FreeBSD
- i386 HURD
- i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4, 2.6
- i386 NetBSD
- i386 Novell NetWare
- i386 OS/2
- i386 OpenBSD
- i386 SCO unix
- i386 Solaris 2.7
- i386 Windows 95, 98, ME, NT, 2000, XP, 2003
- i386 QNX 6
- i486 ncr-sysv4.3.03 (NCR MP-RAS)
- ia64 Linux 2.3.99
- m68k AmigaOS 3
- m68k Linux
- m68k OpenBSD
- m88k dg-dgux5.4R3.00
- s390 Linux
- XScale/PXA250 Linux 2.4
阅读(2966) | 评论(0) | 转发(0) |