1. `./configure --build=mipsel-linux --host=mipsel-linux

--target=mipsel-linux' will build native mipsel-linux binutils on

mipsel-linux.

 

2. `./configure --build=i386-linux --host=mipsel-linux

--target=mipsel-linux' will cross-build native mipsel-linux binutils on

i386-linux.

 

3. `./configure --build=i386-linux --host=i386-linux

--target=mipsel-linux' will build mipsel-linux cross-binutils on

i386-linux.

 

4. `./configure --build=mipsel-linux --host=i386-linux

--target=mipsel-linux' will cross-build mipsel-linux cross-binutils for

i386-linux on mipsel-linux.

As you see, only if $build != $host a cross-compilation is performed.

 

   具体解释一下,build就是你正在使用的机器,host就是你编译好的程序可以运行的平台,target就是你编译的程序可以处理的平台.这个build和host比较好理解,但是target就不好办了,到底什么意思呢?一般来说,我们平时所说的交差编译用不到他target的,比如./configure --build=i386-linux,--host=arm-linux就可以了,在386的平台上编译可以运行在arm板的程序.但是,一般我们都是编译程序,而不是编译工具,如果我们编译工具,比如gcc,这个target就有用了.如果我们需要在一个我们的机器上为arm开发板编译一个可以处理mips程序的gcc,那么target就是mips。

举例来说,比如在使用SW申威处理器的服务器时,如果你需要编译源码,需要先使用uname -a 命令查看服务器的target信息,在获取target信息后,正常编译,但是需要加上 --bulid= target  (target内容为查出的具体信息)

--------------------- 

作者:一条有梦想的鱼