The script ./configure
accepts 3 options --build
, --host
and --target
. I'm confusing their roles. What's the difference and semantics of them?
相关问题
- X-I.: command not found, and failed to build certa
- Query pkg-config variable through autotools
- Cross compiling Qt 5
- Cross compiling Gnu Radio for Openwrt
- Build m4, autoconf, automake, libtool on unix
相关文章
- Add selected attribute to option in select menu wi
- What is config.log on osx and where does it live?
- Why does Rust need the `if let` syntax?
- Raspberry Pi crosscompile on Ubuntu 13.10 “libstdc
- argument order in cygwin gcc 4.3 matters when link
- including static library to ./configure
- CMake CMAKE_AUTOMOC in cross compilation
- How to choose value from an option list using PyQt
Note: Argument
--target
makes sense only when building compiler (e.g. GCC). When runningconfigure
before building GCC:--build
: the machine you are building on--host
: the machine you are building for--target
: the machine that GCC will produce binary forFrom the GCC documentation (Host/Target specific installation notes):
As noted in this blog post and alluded to in the GCC Configure Terms,
--target
only applies when you are compiling toolchains. When you are doing normal cross-compilation of a library or binary you useHowever, when you are building toolchains, things can get more complicated. I think that the following is correct (though I can't say I've ever manually compiled a cross-debugger):
Lets say that you have:
You would configure and build your debugging server (eg gdbserver) to run on your embedded device with
so that you could putty on to your embedded device and run "gdbserver :1234 a.out" to start debugging and listen on port 1234.
You would then build your debugging client (which connects to and controls the gdbserver) with
which you would copy to your x86 laptop so that in the field you could run "gdbclient embedded.device:1234" in order to debug your a.out program.
This all applies to compilers too for which you might want to look at the GCC link above or this section about the Canadian cross compile.
Also note that, in practice, you might not see build, host or target specified because, according to this Autoconf manual page, "target defaults to host, host to build, and build to the result of config.guess."
In a word, build the code on
--build
, run it on--host
with--target
architecture environment.