/etc/portage/make.conf

make.conf is one of the ways to customize the Portage environment on a global level. This configuration will apply to every package that is emerged, and controls many elements of Portage's functionality, such as global USE flags, language options, Portage mirrors, and so on.

An example setup can be found at.

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

may exist as or  (or both), with the settings from  taking precedence.

Variables
There are many possible variables to customize in make.conf, but only the most commonly used are explained in detail here. For more information, and the full list of variables, consult the make.conf manpage.

CFLAGS / CXXFLAGS
These flags are given when C/C++ packages are compiled to modify the behavior of the compiler. Not all packages will utilize these variables, as some programs require a specific set of compilation flags to compile.

While setting proper CFLAGS can increase the speed and stability of the system, absurd settings (e.g. -O3 -fast-math -funroll-all-loops) will more likely leave you with a crippled system than a blazing fast one.

CHOST
This variable is passed through the configure step of ebuilds to set the build-host of the system.

See also:
 * CHOST
 * Changing the CHOST variable guide on gentoo.org

GENTOO_MIRRORS
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 also http://www.gentoo.org/main/en/mirrors2.xml

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 #' (short form: '-j#'), which runs '#' jobs at a time (without an argument, '-j' will flood the processor with as many jobs as possible, and is not recommended). Another option is '--load-average #' (short form '-l#'), which will have make keep the load average of the system to '#', however many parallel tasks that ends up being.

PORTDIR_OVERLAY
Defines locations of local Portage overlays. Ebuilds included in the listed overlays will be installable as usual through emerge.

To use Layman overlays, the following should be included in make.conf:

USE
The USE variable allows the setting of a common set of USE flags for all packages. These are flags for a common set of package functionality desired (such as X11 or PulseAudio capability), or system capabilities, like SSE or MMX instruction support.

Don't set package-specific USE flags here, those should be set instead in.

For a list of the available global USE flags to be set in make.conf, see http://www.gentoo.org/dyn/use-index.xml and.