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


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.


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.


See this news item.

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


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

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


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.

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


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.


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.

Layman versions <2.3.0 still use it.




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


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

See also

External resources