Globally defined USE flags
The globally defined USE flags for the system is in /etc/make.conf.
For instance, to remove support for KDE and QT but add support for ldap, the following USE can be defined in /etc/make.conf:
USE="-kde -qt3 -qt4 ldap"
Locally defined USE flags for individual package
Sometimes you want to declare a certain USE flag for one (or a couple) of applications but not system-wide. To accomplish this, you will need to create the /etc/portage directory (if it doesn't exist yet) and edit /etc/portage/package.use. This is usually a single file, but can also be a directory; see man portage for more information. The following examples assume package.use is a single file.
For instance, if you don't want berkdb support globally but you do want it for mysql, you would add:
dev-db/mysql berkdb
You can of course also explicitly disable USE flags for a certain application. For instance, if you don't want java support in PHP:
dev-php/php -java
Temporarily customize the USE flag setting
As an example we will temporarily remove java from the USE setting during the installation of seamonkey.
USE="-java" emerge seamonkey
USE flag documents