autosetup is designed to make cross compiling very easy. If you have a toolchain installed with the standard GNU naming convention, cross compiling should “just work”.
For example, if you have
then building with this toolchain is as simple as:
$ ./configure --host=arm-linux
If specific options need to be passed to the compiler, they
can be set by overriding
$ ./configure --host=arm-linux CC="arm-linux-gcc -mbig-endian"
Note that this approach is preferred rather than setting
as it allows the user to override
CFLAGS at build time.
Overriding the cross compiler prefix
--host should be used to specify the toolchain prefix.
However it may be desirable to override the toolchain prefix. This is
possible with the
CROSS environment variable. For example:
$ ./configure --host=arm-linux CROSS=my-
This will use the C compiler,
my-gcc, the archive tool,