System Type Triplets

来源:互联网 发布:手机搭建云免流软件 编辑:程序博客网 时间:2024/06/03 15:05

System Type Triplets

The Need for System Identification

As mentioned in Cross Compilation Quickstart, the Autotoolsgenerated configure script used to simplify cross compilation creates aMakefilecustomized to your platform and development needs. The configure script tries it'sbest to figure out what to do, in part, by working with it's friendsconfig.guessand config.sub to guess your platform type.

While the whole process is rather clever and tends to work automagically in many cases,there are situations such as cross compiling where you need to helpconfigure by explicitlyidentifying your system type. You identify your system type by settingconfigure's --build,--host, and (sometimes) --target arguments to the correcttarget triplet values.

Target Triplets and the Configure Script

The target triplet has the form cpu-vendor-os whereos can take the formof system or kernel-system. The three command lineconfigure options used tospecify system type are:

--build=type

the type of the system used to configure and build the package. Defaults to output ofconfig.guess.

--host=type

the type of the system on which the built package executes. Defaults to the same type as thebuild system and enables cross compilation mode.

--target=type

used for building compiler tools for cross compiling. The type of the system for which anycompiler tools built from the package produce code for. Defaults to the same type as the host.

To see what configure thinks is the triplet for your build system, simply execute theconfig.guess script from any source package you may have extracted to your system. For example,on my Windows 7 32-bit Ultimate system with aMSYS Unix-like shell environmentinstalled, theconfigure used by libxml2, by default, will identify my build system asi686-pc-mingw32.

C:\Users\Jon\Documents\libxml2-2.7.8>sh -c "./config.guess"i686-pc-mingw32

If you do need to override config.guess, provide a value to configure's--build argument not --host sinceusing --host will causeconfigure to enter cross compilation mode.

In many cases configure can recognize short aliases for common system type triplets asconfigure uses theconfig.sub helper script to canonicalize system type aliases. To see the canonical triplet for a given alias,try something similar to

C:\Users\Jon\Documents>sh -c "./config.sub xbox"i686-pc-mingw32C:\Users\Jon\Documents>sh -c "./config.sub mingw32"i386-pc-mingw32C:\Users\Jon\Documents>sh -c "./config.sub mac"m68k-apple-macos

Triplets and MinGW-w64

When using the MinGW-w64 cross compilers, while you may need to use different --build triplets, you willonly use the --host triplets i686-w64-mingw32 orx86_64-w64-mingw32. Use i686-w64-mingw32 whenbuilding for 32-bit Windows platforms, andx86_64-w64-mingw32 when building for 64-bit Windows platforms.When using the MinGW-w64 native compilers, you typically do not need to provideconfigure any type tripletinformation .

Other

http://sourceforge.net/apps/trac/mingw-w64/wiki/TypeTriplets


原创粉丝点击