configure.info: CCross in Make
Go backward to CCross in Configure
Go up to Supporting Canadian Cross
Go to the top op configure
Supporting Canadian Cross in Makefiles.
The main Canadian Cross issue in a `Makefile' arises when you want
to use a subsidiary program to generate code or data which you will then
include in your real program.
If you compile this subsidiary program using `$(CC)' in the usual
way, you will not be able to run it. This is because `$(CC)' will
build a program for the host system, but the program is being built on
the build system.
You must instead use a compiler for the build system, rather than the
host system. In the Cygnus tree, this make variable `$(CC_FOR_BUILD)'
will hold a compiler for the build system.
Note that you should not include `config.h' in a file you are
compiling with `$(CC_FOR_BUILD)'. The `configure' script will build
`config.h' with information for the host system. However, you are
compiling the file using a compiler for the build system (a native
compiler). Subsidiary programs are normally simple filters which do no
user interaction, and it is normally possible to write them in a highly
portable fashion so that the absence of `config.h' is not crucial.
The gcc `Makefile.in' shows a complex situation in which certain
files, such as `rtl.c', must be compiled into both subsidiary programs
run on the build system and into the final program. This approach may
be of interest for advanced build system hackers. Note that the build
system compiler is rather confusingly called `HOST_CC'.
Created Wed Sep 1 16:42:00 2004 on bee with info_to_html version 0.9.6.