public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] make.conf
@ 2008-10-17 18:11 ann kok
  2008-10-17 18:37 ` Patric Schmitz
  2008-10-17 21:30 ` Alan McKinnon
  0 siblings, 2 replies; 3+ messages in thread
From: ann kok @ 2008-10-17 18:11 UTC (permalink / raw
  To: gentoo-user

hi all

why we have to put the following flags in the make.conf

what are the purpose?

CFLAGS="-O2 -pipe"
CXXFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"

Thank you

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] make.conf
  2008-10-17 18:11 [gentoo-user] make.conf ann kok
@ 2008-10-17 18:37 ` Patric Schmitz
  2008-10-17 21:30 ` Alan McKinnon
  1 sibling, 0 replies; 3+ messages in thread
From: Patric Schmitz @ 2008-10-17 18:37 UTC (permalink / raw
  To: gentoo-user

On Fri, 17 Oct 2008 11:11:21 -0700 (PDT)
ann kok <annkok2001@yahoo.com> wrote:

> hi all

Hello, 

> why we have to put the following flags in the make.conf
> 
> what are the purpose?
> 
> CFLAGS="-O2 -pipe"
> CXXFLAGS="-O2 -pipe"
> CHOST="x86_64-pc-linux-gnu"

These are parameters for the gcc compiler. On a Gentoo system, you
compile all (or most of) your software from source, instead of simply
installing a precompiled binary package, as in most other distributions.

These parameters influence the compiler, the software which actually
builds the program from the source code. Their exact meaning is
documented in gcc's manual page (man gcc).

-O2 instructs the compiler to perform second level optimizations on the
code (note 'O', not '0').
-pipe tells gcc to use unix pipes for communication during the compile
process, which might speed up things.

CFLAGS specifies the options when compiling a C source file, CXXFLAGS
is for C++ files.

CHOST specifies your machine architecture and operating system type.
This stems from the GNU config package which is used by the
automake/autoconf build system which is used for most software.
According to config.sub from autoconf, the format of this target
specification is:

#       CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
#       CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM

Cheers,
Patric



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] make.conf
  2008-10-17 18:11 [gentoo-user] make.conf ann kok
  2008-10-17 18:37 ` Patric Schmitz
@ 2008-10-17 21:30 ` Alan McKinnon
  1 sibling, 0 replies; 3+ messages in thread
From: Alan McKinnon @ 2008-10-17 21:30 UTC (permalink / raw
  To: gentoo-user

On Friday 17 October 2008 20:11:21 ann kok wrote:
> hi all
>
> why we have to put the following flags in the make.conf
>
> what are the purpose?
>
> CFLAGS="-O2 -pipe"
> CXXFLAGS="-O2 -pipe"
> CHOST="x86_64-pc-linux-gnu"

It's so that the compiler knows how to build stuff....

It doesn't know what you want if you don't tell it. CHOST for example tells 
the compiler which machine architecture the output binaries must be built 
for. There's nothing to stop you using an amd64 machine to build binaries 
that will run on a Sun sparc, and relying on the current machine architecture 
for the default is an especially stupid idea. A more sensible example is how 
Ubuntu does it. Their master build machines are probably the latest fancy 
Dual Cores, yet the code is built for i586 or i686 machines. CHOST controls 

CFLAGS are actually optional. -O is the optimization level and it's pretty 
normal and safe to use -O2. -pipe is an instruction to gcc on how to operate 
when it's compiling stuff. It makes the build go faster and reduce disk 
activity while doing it.

But all of this is in the Gentoo Handbook. Did you read it?


-- 
alan dot mckinnon at gmail dot com



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-10-17 21:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-17 18:11 [gentoo-user] make.conf ann kok
2008-10-17 18:37 ` Patric Schmitz
2008-10-17 21:30 ` Alan McKinnon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox