1 |
On Friday 17 October 2008 20:11:21 ann kok wrote: |
2 |
> hi all |
3 |
> |
4 |
> why we have to put the following flags in the make.conf |
5 |
> |
6 |
> what are the purpose? |
7 |
> |
8 |
> CFLAGS="-O2 -pipe" |
9 |
> CXXFLAGS="-O2 -pipe" |
10 |
> CHOST="x86_64-pc-linux-gnu" |
11 |
|
12 |
It's so that the compiler knows how to build stuff.... |
13 |
|
14 |
It doesn't know what you want if you don't tell it. CHOST for example tells |
15 |
the compiler which machine architecture the output binaries must be built |
16 |
for. There's nothing to stop you using an amd64 machine to build binaries |
17 |
that will run on a Sun sparc, and relying on the current machine architecture |
18 |
for the default is an especially stupid idea. A more sensible example is how |
19 |
Ubuntu does it. Their master build machines are probably the latest fancy |
20 |
Dual Cores, yet the code is built for i586 or i686 machines. CHOST controls |
21 |
|
22 |
CFLAGS are actually optional. -O is the optimization level and it's pretty |
23 |
normal and safe to use -O2. -pipe is an instruction to gcc on how to operate |
24 |
when it's compiling stuff. It makes the build go faster and reduce disk |
25 |
activity while doing it. |
26 |
|
27 |
But all of this is in the Gentoo Handbook. Did you read it? |
28 |
|
29 |
|
30 |
-- |
31 |
alan dot mckinnon at gmail dot com |