/etc/portage/make.conf

From Gentoo Wiki
< /etc/portage(Redirected from Make.conf)
Jump to: navigation, search

The /etc/portage/make.conf (formerly /etc/make.conf) file is used to customize the Portage environment on a global level. Settings here will apply to every package that is emerged; they control many elements of Portage functionality such as global USE flags, language (linguas) options, Portage mirrors, etc.

An example setup can be found at /usr/share/portage/config/make.conf.example

Precedence

Portage configuration is not limited to make.conf, global settings defined in this file are refined on a per-package basis in the /etc/portage/package.* files, as well as the local environment.

make.conf may exist as /etc/portage/make.conf or /etc/make.conf, however the latter is depreciated for the former. Therefore if settings exist in /etc/make.conf should be migrated to /etc/portage/make.conf. Settings from /etc/portage/make.conf precedence over those in /etc/make.conf.

Variables

There are many possible variables to customize in make.conf, but only the most commonly used are explained in detail within this article. For more information, and the full list of variables, consult the make.conf man page by running:

user $man make.conf
Note
Different configurations will require different variables to be set up. Do not treat the following examples as a definitive list, or a minimum set of requirements.

CHOST

This variable is passed through the configure step of ebuilds to set the build-host of the system. See the CHOST article. Note that the profile already should have defined the appropriate CHOST.

CFLAGS and CXXFLAGS

For example:

FILE /etc/portage/make.conf
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"

For details see the CFLAGS article and Handbook:Parts/Installation/Stage#CFLAGS_and_CXXFLAGS.

CPU_FLAGS_X86

FILE /etc/portage/make.conf
CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3"

CONFIG_PROTECT

The CONFIG_PROTECT variable contains a space-delimited list of directories where Portage will not blindly copy over new versions of files, but instead treat the files as configuration files where the user should manually check if the changes are needed and valid or not.

The CONFIG_PROTECT variable is managed by Portage and contains entries from the users' profile, system environment (which is often used by applications that update the variable through their /etc/env.d file) and the users' /etc/portage/make.conf setting.

For more information, see Configuration File Protect in the Gentoo Handbook.


FEATURES

The FEATURES variable contains a list of Portage features that the user wants enabled on the system, effectively setting Portage behavior.

The FEATURES variable is set by default via the system profile, but can be easily updated through /etc/portage/make.conf. Since this is an incremental variable, FEATURES values can be added without directly overriding the ones implemented through the system profile.

FILE /etc/portage/make.confAdding keepwork to FEATURES in Portage
FEATURES="keepwork"

For more information, please see Portage Features in the Gentoo Handbook. For a complete list of available features, see man 5 make.conf.

GENTOO_MIRRORS

FILE /etc/portage/make.conf
GENTOO_MIRRORS="URIs"

This variable defines a list of Gentoo mirrors to check before downloading from the source defined in the ebuild. Properly chosen mirrors will generally be able to offer faster download speeds. Try using mirrorselect to find the fastest mirror server.

See the Mirrors page on the main site for available URLs.

INPUT_DEVICES

FILE /etc/portage/make.confSet INPUT_DEVICES
INPUT_DEVICES="evdev synaptics"

After setting the INPUT_DEVICES variable remember to update the system using the following command so the changes take effect:

root #emerge --ask --changed-use --deep world


LINGUAS

FILE /etc/portage/make.conf
LINGUAS="de pt_BR en en_US en_GB"

MAKEOPTS

This variable is used to specify arguments passed to make when packages are built from source. Make can be told to run multiple jobs in parallel (a potentially substantial speed increase, depending on processor). This can be done either through --jobs N (short form: -jN), which runs N (number) jobs at a time (without an argument, -j will flood the processor with as many jobs as possible, and is not recommended). For example, to run three jobs:

root #emerge --jobs 3 package/atom

Another option is --load-average N (short form -lN), which will have make keep the load average of the system to N, however many parallel tasks that ends up being or up to limit set by --jobs if it is set as well.

PORTAGE_TMPDIR

PORTAGE_TMPDIR defines the location of the temporary build directories. Defaults to /var/tmp.

FILE /etc/portage/make.conf
PORTAGE_TMPDIR="/var/tmp"

PORTAGE_TMPDIR should not be set to point anywhere under the location of a repository.

PORTDIR

The PORTDIR variable has been deprecated in favor of settings in repos.conf

PORTDIR_OVERLAY

This variable has been deprecated in favor of settings in repos.conf.
Layman versions <2.3.0 still use it.

SYNC

VIDEO_CARDS

FILE /etc/portage/make.confSet VIDEO_CARDS
VIDEO_CARDS="intel nvidia radeon vesa"

After setting the VIDEO_CARDS variable remember to update the system using the following command so the changes take effect:

root #emerge --ask --changed-use --deep world

USE

The USE variable allows the system wide setting or deactivation of USE flags in a space separated list.

FILE /etc/portage/make.confExample
USE="-kde -qt4 ldap"

For a fine grained per package control of USE flags, the file /etc/portage/package.use should be used instead.

Licenses

FILE /etc/portage/make.confTo accept all licenses on all packages (not a good idea)
ACCEPT_LICENSE="*"
FILE /etc/portage/make.confTo accept free software only
ACCEPT_LICENSE="-* @FREE"

See also