From Gentoo Wiki
/etc/portage(Redirected from Make.conf)
Jump to: navigation, search
This page contains changes which are not marked for translation.

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


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 deprecated 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.


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
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.


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 value.


For example:

FILE /etc/portage/make.conf
CFLAGS="-march=native -O2 -pipe"

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


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 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.


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

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


FILE /etc/portage/make.conf

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 the mirrorselect command to find the fastest mirror server.

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


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 is done via -jN, which will allow make to spawn up to N threads per invocation (job). A widely used rule of thumb for N is to take the number of available cores (hyperthreaded cores count as 2) and add one. So a hyperthreaded dual-core would use a value of 5 for N. This rule is optimized for a single job running at a time with a large number of threads.

This value may need to be changed if EMERGE_DEFAULT_OPTS job control is used. See below.


Entries here are appended to the emerge command line. Two particular options are of interest, specifically --jobs N and --load-average X.Y, which run parallel emerge jobs subject to the load-average limit.

--jobs N (short form: -jN), 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 up to three jobs in parallel:

root #emerge --jobs 3 package/atom

A typical value for N would be equal to the number of cores. (see below)

When used with --load-average X.Y (short form -lX.Y), emerge will try to keep the load average of the system less than X.Y, a floating point number. If --jobs is set as well, then it will run up to the limit indicated by that parameter.

The load average value is the same as displayed by top and for an N-core system, a load average of N.0 would be a 100% load. Another rule of thumb here is to set X.Y=(cores)*0.9 which will limit the load to 90%, thus maintaining responsiveness.

NOTE: When MAKEOPTS="-jN" is used with EMERGE_DEFAULT_OPTS="--jobs K --load-average X.Y" the number of possible threads created would be up to N*K threads. Therefore, both variables need to be set with each other in mind as they create up to K jobs each with up to N threads.

These two settings are better suited for long emerges including multiple files to make the most of the --jobs parameter. They can also cause emerge errors in some cases, so use with caution and be prepared to comment these out if problems arise.


The PORTAGE_TMPDIR variable defines the location of the temporary build directories. The value defaults to /var/tmp.

FILE /etc/portage/make.conf

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


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


This variable has been deprecated in favor of settings in repos.conf.

Versions < 2.3.0 of Layman still use the PORTDIR_OVERLAY variable.




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.


FILE /etc/portage/make.confTo accept all licenses on all packages (not a good idea)
FILE /etc/portage/make.confTo accept free software only


The USE_EXPAND list is set in profiles/base/make.defaults as of Portage[1]


See this news item. and CPU_FLAGS_X86.

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


For possible values of this USE_EXPAND variable see 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


See LINGUAS in the Localization guide. For possible values of this USE_EXPAND variable see LINGUAS.

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


For possible values of this USE_EXPAND variable see 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

For the average user, if a graphical desktop environment is to be used this variable should be explicitly defined. For further information see Xorg/Guide#make.conf_configuration.

See also

External resources