/[gentoo-x86]/eclass/flag-o-matic.eclass
Gentoo

Diff of /eclass/flag-o-matic.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.24 Revision 1.26
1# Copyright 1999-2003 Gentoo Technologies, Inc. 1# Copyright 1999-2003 Gentoo Technologies, Inc.
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.24 2003/07/22 12:48:11 aliz Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.26 2003/09/15 15:21:04 vapier Exp $
4# 4#
5# Author Bart Verwilst <verwilst@gentoo.org> 5# Author Bart Verwilst <verwilst@gentoo.org>
6 6
7ECLASS=flag-o-matic 7ECLASS=flag-o-matic
8INHERITED="$INHERITED $ECLASS" 8INHERITED="$INHERITED $ECLASS"
31# 31#
32#### replace-sparc64-flags #### 32#### replace-sparc64-flags ####
33# Sets mcpu to v8 and uses the original value 33# Sets mcpu to v8 and uses the original value
34# as mtune if none specified. 34# as mtune if none specified.
35# 35#
36 36#### filter-mfpmath <math types> ####
37# Remove specified math types from the fpmath specification
38# If the user has -mfpmath=sse,386, running `filter-mfpmath sse`
39# will leave the user with -mfpmath=386
37 40
38# C[XX]FLAGS that we allow in strip-flags 41# C[XX]FLAGS that we allow in strip-flags
39ALLOWED_FLAGS="-O -O1 -O2 -mcpu -march -mtune -fstack-protector -pipe -g" 42ALLOWED_FLAGS="-O -O1 -O2 -mcpu -march -mtune -fstack-protector -pipe -g"
40case "${ARCH}" in 43case "${ARCH}" in
41 mips) ALLOWED_FLAGS="${ALLOWED_FLAGS} -mips1 -mips2 -mips3 -mips4 -mabi" ;; 44 mips) ALLOWED_FLAGS="${ALLOWED_FLAGS} -mips1 -mips2 -mips3 -mips4 -mabi" ;;
42 amd64) ALLOWED_FLAGS="${ALLOWED_FLAGS} -fPIC" ;; 45 amd64) ALLOWED_FLAGS="${ALLOWED_FLAGS} -fPIC" ;;
46 alpha) ALLOWED_FLAGS="${ALLOWED_FLAGS} -fPIC" ;;
43esac 47esac
44 48
45# C[XX]FLAGS that we are think is ok, but needs testing 49# C[XX]FLAGS that we are think is ok, but needs testing
46# NOTE: currently -Os have issues with gcc3 and K6* arch's 50# NOTE: currently -Os have issues with gcc3 and K6* arch's
47UNSTABLE_FLAGS="-Os -O3 -freorder-blocks -fprefetch-loop-arrays" 51UNSTABLE_FLAGS="-Os -O3 -freorder-blocks -fprefetch-loop-arrays"
67} 71}
68 72
69filter-flags() { 73filter-flags() {
70 # we do this fancy spacing stuff so as to not filter 74 # we do this fancy spacing stuff so as to not filter
71 # out part of a flag ... we want flag atoms ! :D 75 # out part of a flag ... we want flag atoms ! :D
72 export CFLAGS=" ${CFLAGS} " 76 CFLAGS=" ${CFLAGS} "
73 export CXXFLAGS=" ${CXXFLAGS} " 77 CXXFLAGS=" ${CXXFLAGS} "
74 for x in $@ ; do 78 for x in $@ ; do
75 export CFLAGS="${CFLAGS/ ${x} / }" 79 CFLAGS="${CFLAGS/ ${x} / }"
76 export CXXFLAGS="${CXXFLAGS/ ${x} / }" 80 CXXFLAGS="${CXXFLAGS/ ${x} / }"
77 done 81 done
78 export CFLAGS="${CFLAGS:1:${#CFLAGS}-2}" 82 CFLAGS="${CFLAGS:1:${#CFLAGS}-2}"
79 export CXXFLAGS="${CXXFLAGS:1:${#CXXFLAGS}-2}" 83 CXXFLAGS="${CXXFLAGS:1:${#CXXFLAGS}-2}"
80} 84}
81 85
82append-flags() { 86append-flags() {
83 CFLAGS="${CFLAGS} $@" 87 CFLAGS="${CFLAGS} $@"
84 CXXFLAGS="${CXXFLAGS} $@" 88 CXXFLAGS="${CXXFLAGS} $@"

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.26

  ViewVC Help
Powered by ViewVC 1.1.20