cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Cross-compiling cURL

From: Jim Duey <jduey_at_ccc-dcs.com>
Date: Tue, 23 Oct 2001 15:10:06 -0500

Daniel,

I downloaded 7.9.1-pre4 and it cross-compiled fine. Here's the technique I
used. It might provide a starting point for something to include in the
manual.

To compile cURL for a different architecture where both run are running Linux:

Download and unpack the cURL package. Version should be 7.9.1 or later.

'cd' to the new directory. (ie. curl-7.9.1-pre4)

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)

The '--prefix' parameter specifies where cURL will be installed. If
'configure' completes successfully, do 'make' and 'make install' as usual.

jim
Received on 2001-10-23