Compiling Packages for an embedded Linux with cross compiler ?

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi,


Most of the open source packages one get in a tar ball, one compiles
with the following:

./configure
make
make install.

Now If I have a cross compiler on a Linux box. Say RH9 (x86) and my
target is an ARM7 based board with Linux. How does one tell configure
that it should use the cross compiler for the build ?
The specific package I am interested in at the moment is CDK (Curses
Development Kit).

Regards
   Anton Erasmus

Re: Compiling Packages for an embedded Linux with cross compiler ?
Quoted text here. Click to load it

./configure --prefix=/tmp/embedded-target-root/usr --host=arm-linux
make
make install

Sometimes you need more "stuff" on the configure line,
like setting environment variables CC=arm-linux-gcc,
RANLIB=arm-linux-ranlib, or CXX=arm-linux-g++.  In recent
versions of autoconf, the --host=arm-linux is supposed to
take care of all this for you.

It's also generally recommended to build in a separate
directory from pristine sources, e.g.,

tar -xvzf foo.tar.gz
mkdir foo-arm
cd foo-arm
CC=arm-linux-gcc ../foo/configure --prefix=/tmp/embedded-target-root/usr
make
make install

There is also sometimes trickery to distinguish between the
path of the actual install directory (/tmp/embedded-target-root/usr)
and the directory that will show up as on the target system
(/usr).  When building glibc, for instance, you really configure
with --prefix="", then
   make install_root=/tmp/embedded-target install

These are general guidelines only.  Many open source packages
are put out by people who have never cross-compiled in their life,
and there's no end of troubles that can crop up.  It takes practice.
The more complex the package, the more issues you may have to dig
through.

    - Larry

Site Timeline