cross compile with ./configure

Dear c.o.l.embedded I downloaded source of lrzsz and want to cross compile it. How do i make gnu build system understand this? ./configure CROSS_COMPILE=arm-unknown-linux-gnu- doesn't work. Do i need to find a way to handle everything by hand? Source tree doesn't seem complicated.

Reply to
Atilla
Loading thread data ...

did you try ./configure --help ?

f there was a CROSS_COMPILE option, it would be preceded with --, for example: --host=HOST cross-compile to build programs to run on HOST [BUILD]

Typically you can use the following environmental variables CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor

--host=HOST cross-compile to build programs to run on HOST [BUILD]

Reply to
AZ Nomad

did you install a toolchain for cross compiling (the appropriate gcc etc) ?

-Michael

Reply to
Michael Schnell

$./configure CC=arm-unknown-linux-gnu-gcc configure: warning: CC=arm-unknown-linux-gnu-gcc: invalid host type

$ CROSS_COMPILE=arm-unknown-linux-gnu- $ ./configure --host=i686-linux --target=arm-linux (script runs but make terminates with error)

$ CC=arm-unknown-linux-gnu- $ ./configure

... checking for gcc... (cached) gcc checking whether the C compiler (gcc ) works... yes checking whether the C compiler (gcc ) is a cross-compiler... no ...

So, each of these tries resulted in non working settings. My cross toolchain is installed and in my PATH.

Reply to
Atilla

You ought to post the error

It doesn't seem to work.

Configure is trying to tell you that your c compiler isn't capable of cross compilation.

Look into the configure script to see how it is performing it's test.

Reply to
AZ Nomad

OK, I got it working. Instead of "apt-get source", I downloaded the original source from freshmeat. Then issued:

$ CC=arm-unknown-linux-gnu-gcc ./configure --host=arm-unknown-linux-gnu

It configured and cross-compiled successfully.

Reply to
Atilla

Try $ CC=arm-unknown-linux-gnu-gcc ./configure --host=arm-unknown-linux-gnu

Kristof

Reply to
Kristof Provost

That setting of a variable won't be seen by teh configure script. Either export it as an environmental variable to be exported to spawned processes, or include it in the ./configure line thus:

$ CROSS_COMPILE=arm-unknown-linux-gnu- ./configure --host=i686-linux

--target=arm-linux

Ditto. Look up 'export' in your bash manpage.

Phil

--
Marijuana is indeed a dangerous drug.  
It causes governments to wage war against their own people.
 Click to see the full signature
Reply to
Phil Carmody

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.