FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 10-17-2008, 06:37 PM
Patric Schmitz
 
Default make.conf

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
 
Old 10-17-2008, 09:30 PM
Alan McKinnon
 
Default make.conf

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
 

Thread Tools




All times are GMT. The time now is 04:41 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org