Gentoo:make.conf

From Linux 101, The beginner's guide to all things Linux.

Jump to: navigation, search

First and foremost, there is a man page on make.conf. You should read it. It is more updated than this website and contains all of the potential configuration items.

[edit] What is make.conf?

make.conf is a file that portage uses to configure how things are compiled on your system and the settings to use to those ends.

[edit] Example make.conf

USE="3dnow acpi dedicated ethereal faad ffmpeg firebird freetype gtkhtml \
     apache2 xsl mysql mng openssh tiff -arts -kde -qt eds gd dba"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -Os -pipe -fstack-protector"
CXXFLAGS="${CFLAGS}"
ACCEPT_KEYWORDS="~x86"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
DISTDIR="${PORTDIR}/distfiles"
PKGDIR="${PORTDIR}/packages"
MAKEOPTS="-j2"
AUTOCLEAN="yes"
FEATURES="sandbox ccache"
GENTOO_MIRRORS="ftp://ftp-mirror.internap.com/pub/gentoo/ http://www.gtlib.cc.gatech.edu/pub/gentoo \ 
                ftp://ftp.ussg.iu.edu/pub/linux/gentoo ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ \ 
                http://gentoo.mirrors.pair.com/ http://gentoo.seren.com/gentoo"

Note: The entire file is not documented here, but follow the external link below to the man page, which does document the file in its entirety.


USE 
Use flags are covered on another page.
CHOST 
Depending on your architecture, you can use different CHOST values. The Gentoo Installation handbook has an excellent listing of possible CHOST values. [1]
CFLAGS 
These are command-line arguments supplied to gcc when it runs for every emerge on your system. These are also discussed on another page.
CXXFLAGS 
The same as CFLAGS but for when you run g++, the C++ compiler. This example has it set to the same value as CFLAGS, which is a very reasonable idea.
ACCEPT_KEYWORDS 
This tells portage to use stable or unstable packages. It also tells portage what architecture your machine is running on.
PORTDIR 
This is the directory where the portage tree resides.
PORTAGE_TMPDIR 
Compiling programs requires scratch space to put your current emerge's compiled files (.o files). This directory is where portage will do that.
DISTDIR 
When portage downloads compressed packages, this is the directory where it stores those files.
PKGDIR 
This is where portage will store (or read from) binary package files.

Note: The *DIR configurations are useful when you have multiple partitions and wish to specify locations other than the defaults for the above.

MAKEOPTS 
Just like gcc and g++, the program "make" also has command-line arguments. This is usually set to "-j<the number of CPUs you are working with+1>" for efficency. What really is happening here is that the -j option specifies the number of parallel processes of gcc/g++ to run. It is effecient to run twice as many as the processors you have because while one process is loading up (takes processor time), the other is unloading (takes hard drive time), so since these are two different tasks we can run them in parallel for better performance while compiling.
AUTOCLEAN 
The temporary space in PORTAGE_TMPDIR is not erased after the emerge is completed by default. This will do that for us. The benefit is to not waste hard drive space on no longer needed intermediate files. However, it may also get rid of useful information when attempting to figure out an issue while emerging.
FEATURES 
Features are discussed in the man page for make.conf. If you are advanced enough to need these, then you are capable of handling the information found in the man page.
GENTOO_MIRRORS 
This is a listing of http/ftp locations where portage can obtain the compressed packages that will be stored in PKGDIR.

[edit] External Resources

The Portage Articles Series

portage | emerge | make.conf | use flags | cflags | Overlays


Navigation: Gentoo Index
Personal tools