Making Sense of Gentoo's USE Flags


One of the best features of the Gentoo Linux Distribution is the fact that you can customize it to suit whatever needs your Operating System should provide. This stems from the fact that, because it is a "source-based" distribution, you can enable or disable different features in certain programs before the source code gets built into "binaries".

For example, say you need to use Samba to connect to a Windows based computer, you probably do not need to have LDAP support built into Samba (which would be used as a database backend to hold user accounts, passwords, etc. if you want to use Samba as a Primary Domain Controller). So when you build Samba on a Gentoo Linux System, you "tell" it to build it without LDAP support to make the resultant binaries both smaller in size and possibly a little more robust.

Unfortunately, most Gentoo users don't take the time to tackle various USE flags, which results in a very unorganized /etc/make.conf file, as well as a system that either has too much "bloat" or doesn't provide all the features that are possibly available to the user.

USE Flags Overview

Gentoo Linux provides a few "different" use flags, which are set in various different places. In order to fully grap USE flags and maintain control of your Gentoo system, you should have at least a basic understanding of these flags.

To get started, there are mainly two kinds of USE flags, Global and Local. Global USE flags are used for mainly libraries and are used to set certain functions for your entire system. While Local USE flags are mainly used for certain applications.

Overall there is no difference in Global and Local USE flags, they can both be set in the /etc/make.conf file and they both do the same thing, set certain compile-time options for the resultant binaries. What *should* be different is where you actually set these USE flags.

Setting USE Flags

The two places that you can set USE flags is the "/etc/make.conf" file and the "/etc/portage/package.use" file. Because of this, I normally set all "System-Wide" USE Flags in the /etc/make.conf file and any "Local" Use Flags in the /etc/portage/package.use file. NOTE: there are a few applications available to handle your USE Flags, Profuse being the one I use, however I only use it to see what each USE Flag does, whether it is a Global or Local USE Flag and what packages can take advantage of the USE Flag. Under no circumstances do I use it to actually set any USE Flags simply because it would totally "mess up" my system.

Example /etc/make.conf USE Flags

Here is a current list of what I set in the /etc/make.conf file. I will try to keep it updated as I deploy Gentoo Linux.

You can download this file here (Updated 31May2006).

### Gentoo Linux System Use Flags

USE="3dnow 3dnowext a52 aac aalib acpi audiofile bash_completion bonobo bzip2 \
 cairo cdr curl dbus dga doc dts dv dvd dvdr dvdread esd examples ffmpeg firefox \
 flac gd gphoto2 gnutls hal howl idn ieee1394 jack java joystick jpeg2k \
 kdeenablefinal lcms libcaca mmx mmxext nptl odbc openal portaudio ppds \
 samba scanner slp sndfile speex sse sse2 svg svga tcltk tetex theora tidy \
 tiff usb wifi win32codecs wmf xine xinerama xml xvid"

###### NOTE: try to set local use flags in /etc/portage/package.use
# All use flags above except "cairo" are global use flags
# To avoid plugins stepping on each other, set the "nsplugin" use flag
# in the /etc/portage/package.use file
###### Misc other use flags you may want to set (if not already set)
# Video Card Use flags: 3dfx ( other video card local use flags: nvidia, i8x0 )
# Processor Use flags: 3dnow, 3dnowext, mmx, mmxext, sse, sse2
# CD/DVD Burner Use flags: cdr, dvdr
# Misc hardware Use flags: ieee1394, lm_senors, v4l, v4l2, wifi, xinerama
# Peripheral Use flags: joystick, lirc, pda, scanner 
# Video output Use flags: aalib, dga, directfb, dxr3, fbcon, ggi, libcaca
# Network services Use flags: apache2, kerberos, krb4, krb5, ldap, mysql, postgres, samba
# Advanced Use flags: acl, gcj, emacs
# Laptop/Notebook Use flags: acpi, pcmcia
# Extra Documentation Use flags: doc, examples
# If you want to run Mono programs: mono

Example /etc/portage/package.use file

To keep my /etc/make.conf file neat and orderly, I set nearly all my local USE Flags in the /etc/portage/package.use file. This allows me to maintain control of all my Gentoo installations.

You can download this file here (Updated 31May2006).

app-admin/gnome-system-tools nfs
app-cdr/k3b css musepack musicbrainz vcd
app-text/acroread nsplugin
app-text/evince dvi nautilus t1lib
app-office/openoffice binfilter
dev-java/blackdown-jre nsplugin
dev-lang/swig guile
dev-libs/libcdio cddb
dev-python/gnome-python gtkhtml
dev-python/pycairo numeric
games-emulation/xmame expat
gnome-base/librsvg nsplugin
gnome-extra/gnome-games artworkextra guile
kde-base/kdeartwork xscreensaver
kde-base/kdeartwork-kscreensaver xscreensaver
kde-base/kdebase openexr
kde-base/kdegraphics povray openexr
kde-base/kdegraphics-meta povray
kde-base/kdelibs jpeg2k openexr zeroconf
kde-base/kdemultimedia musicbrainz
kde-base/kdenetwork rdesktop
kde-base/krdc rdesktop
mail-client/mozilla-thunderbird mozsvg
media-gfx/blender blender-game
media-gfx/gimp gimpprint gtkhtml mng
media-gfx/imagemagick fpx graphviz gs jbig
media-gfx/inkscape effects inkjar plugin
media-gfx/xsane gimp
media-libs/a52dec djbfft
media-libs/gd fontconfig xpm
media-libs/libgphoto2 exif
media-libs/libvorbis aotuv
media-libs/sdl-mixer timidity
media-libs/urt gs
media-libs/xine-lib asf cle266 dts imagemagick mng modplug vcd vidix xvmc
media-libs/win32codecs real
media-sound/amarok musicbrainz visualization
media-sound/audacious modplug musepack sid timidity wma
media-sound/banshee ipod
media-sound/rhythmbox ipod musicbrainz tagwriting
media-video/mjpegtools yv12
media-video/mplayer cdparanoia dts edl encode live lzo matroska real rtc xanim xvmc
media-video/realplayer nsplugin
media-video/totem nsplugin
media-video/transcode extrafilters fame imagemagick lzo mjpeg
net-libs/gecko-sdk mozdevelop mozsvg
net-misc/curl ares
sci-visualization/gnuplot gd
sys-block/gparted fat hfs jfs ntfs reiser4 reiserfs xfs
#### enable for gnustep enviornment #### sys-devel/gcc objc
sys-libs/glibc userlocales
x11-base/xorg-x11 sdk
x11-misc/rss-glx xscreensaver
x11-misc/xscreensaver new-login
x11-libs/cairo glitz
x11-terms/xterm toolbar
#### enable for gnustep enviornment #### x11-wm/windowmaker gnustep
www-client/mozilla mozdevelop mozsvg
www-client/mozilla-firefox mozdevelop mozsvg