1132718Skan@c Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
290075Sobrien@c This is part of the GCC manual.
390075Sobrien@c For copying conditions, see the file gcc.texi.
490075Sobrien
590075Sobrien@node Configure Terms
690075Sobrien@section Configure Terms and History
790075Sobrien@cindex configure terms
890075Sobrien@cindex canadian
990075Sobrien
1090075SobrienThe configure and build process has a long and colorful history, and can
1190075Sobrienbe confusing to anyone who doesn't know why things are the way they are.
1290075SobrienWhile there are other documents which describe the configuration process
1390075Sobrienin detail, here are a few things that everyone working on GCC should
1490075Sobrienknow.
1590075Sobrien
1690075SobrienThere are three system names that the build knows about: the machine you
1790075Sobrienare building on (@dfn{build}), the machine that you are building for
1890075Sobrien(@dfn{host}), and the machine that GCC will produce code for
1990075Sobrien(@dfn{target}).  When you configure GCC, you specify these with
2090075Sobrien@option{--build=}, @option{--host=}, and @option{--target=}.
2190075Sobrien
2290075SobrienSpecifying the host without specifying the build should be avoided, as
2390075Sobrien@command{configure} may (and once did) assume that the host you specify
2490075Sobrienis also the build, which may not be true.
2590075Sobrien
2690075SobrienIf build, host, and target are all the same, this is called a
2790075Sobrien@dfn{native}.  If build and host are the same but target is different,
2890075Sobrienthis is called a @dfn{cross}.  If build, host, and target are all
2990075Sobriendifferent this is called a @dfn{canadian} (for obscure reasons dealing
3090075Sobrienwith Canada's political party and the background of the person working
3190075Sobrienon the build at that time).  If host and target are the same, but build
3290075Sobrienis different, you are using a cross-compiler to build a native for a
3390075Sobriendifferent system.  Some people call this a @dfn{host-x-host},
3490075Sobrien@dfn{crossed native}, or @dfn{cross-built native}.  If build and target
3590075Sobrienare the same, but host is different, you are using a cross compiler to
3690075Sobrienbuild a cross compiler that produces code for the machine you're
37132718Skanbuilding on.  This is rare, so there is no common way of describing it.
38132718SkanThere is a proposal to call this a @dfn{crossback}.
3990075Sobrien
4090075SobrienIf build and host are the same, the GCC you are building will also be
4190075Sobrienused to build the target libraries (like @code{libstdc++}).  If build and host
4290075Sobrienare different, you must have already build and installed a cross
4390075Sobriencompiler that will be used to build the target libraries (if you
4490075Sobrienconfigured with @option{--target=foo-bar}, this compiler will be called
4590075Sobrien@command{foo-bar-gcc}).
4690075Sobrien
4790075SobrienIn the case of target libraries, the machine you're building for is the
4890075Sobrienmachine you specified with @option{--target}.  So, build is the machine
4990075Sobrienyou're building on (no change there), host is the machine you're
5090075Sobrienbuilding for (the target libraries are built for the target, so host is
5190075Sobrienthe target you specified), and target doesn't apply (because you're not
5290075Sobrienbuilding a compiler, you're building libraries).  The configure/make
5390075Sobrienprocess will adjust these variables as needed.  It also sets
5490075Sobrien@code{$with_cross_host} to the original @option{--host} value in case you
5590075Sobrienneed it.
5690075Sobrien
5790075SobrienThe @code{libiberty} support library is built up to three times: once
5890075Sobrienfor the host, once for the target (even if they are the same), and once
5990075Sobrienfor the build if build and host are different.  This allows it to be
6090075Sobrienused by all programs which are generated in the course of the build
6190075Sobrienprocess.
62