FLAG-O-MATIC.ECLASS

Section: portage (5)
Updated: Jun 2003
 

NAME

flag-o-matic - manipulate CFLAGS/CXXFLAGS easily and reliably  

DESCRIPTION

The flag-o-matic eclass contains a suite of functions to manipulate the CFLAGS/CXXFLAGS variables.  

FUNCTIONS

append-flags <flags>
Add extra flags to the current CFLAGS/CXXFLAGS.
filter-flags <flags>
Remove particular flags from CFLAGS/CXXFLAGS. This function will only match complete flags.
replace-flags <orig-flag> <new-flag>
Replace all occurences of original flag with new flag.
replace-cpu-flags <old cpus> <new cpu>
Replace all -march, -mcpu, and -mtune flags which contain old cpus with -march, -mcpu, and -mtune flags which contain new cpu.
get-flag <flag>
If flag is prefixed with -, then the whole flag will be echoed. If just the flag name is specified, and the flag has a setting, the value for the flag will be echoed instead.

Examples:
CFLAGS="-march=i586 -ffast-math"
`get-flag -march` == "-march=i586"
`get-flag march` == "i586"
`get-flag -ffast-math` == "-ffast-math"
`get-flag ffast-math` == "-ffast-math"

is-flag <flag>
Returns true if flag is in CFLAGS or CXXFLAGS.
filter-mfpmath <math types>
Remove specified math types from the selected fpmath units. If the user has -mfpmath=sse,386, running `filter-mfpmath sse` will leave the user with -mfpmath=386.
append-ldflags <flags>
Add extra flags to the current LDFLAGS.
strip-flags
Strip CFLAGS/CXXFLAGS of everything except for flags known to be good flags. Users of stable profile are limited to these flags:
-O -O1 -O2 -mcpu -march -mtune -fstack-protector -pipe -g
Users of unstable profile are allowed the above flags and these flags:
-Os -O3 -freorder-blocks -fprefetch-loop-arrays
 

REPORTING BUGS

Please report bugs via http://bugs.gentoo.org/  

SEE ALSO

ebuild(5), make.conf(5)  

FILES

/usr/portage/eclass/flag-o-matic.eclass  

AUTHORS

Mike Frysinger <vapier@gentoo.org>  

CVS HEADER

$Header: /var/cvsroot/gentoo-src/portage/man/flag-o-matic.eclass.5,v 1.5 2004/09/25 07:37:12 vapier Exp $


 

Index

NAME
DESCRIPTION
FUNCTIONS
REPORTING BUGS
SEE ALSO
FILES
AUTHORS
CVS HEADER