/[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.64 Revision 1.65
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 Gentoo Foundation
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.64 2004/07/22 15:29:10 agriffis Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.65 2004/07/27 19:25:49 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"
77 case "${ARCH}" in 77 case "${ARCH}" in
78 mips) ALLOWED_FLAGS="${ALLOWED_FLAGS} -mips1 -mips2 -mips3 -mips4 -mabi" ;; 78 mips) ALLOWED_FLAGS="${ALLOWED_FLAGS} -mips1 -mips2 -mips3 -mips4 -mabi" ;;
79 amd64) ALLOWED_FLAGS="${ALLOWED_FLAGS} -fPIC -m64" ;; 79 amd64) ALLOWED_FLAGS="${ALLOWED_FLAGS} -fPIC -m64" ;;
80 x86) ALLOWED_FLAGS="${ALLOWED_FLAGS} -m32" ;; 80 x86) ALLOWED_FLAGS="${ALLOWED_FLAGS} -m32" ;;
81 alpha) ALLOWED_FLAGS="${ALLOWED_FLAGS} -fPIC" ;; 81 alpha) ALLOWED_FLAGS="${ALLOWED_FLAGS} -fPIC" ;;
82 ia64) ALLOWED_FLAGS="${ALLOWED_FLAGS} -fPIC" ;; 82 ia64) ALLOWED_FLAGS="${ALLOWED_FLAGS} -fPIC" ;;
83 esac 83 esac
84 fi 84 fi
85 # allow a bunch of flags that negate features / control ABI
86 ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-stack-protector -fno-stack-protector-all"
87 case "${ARCH}" in
88 x86|amd64|ia64) ALLOWED_FLAGS="${ALLOWED_FLAGS} -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow" ;;
89 esac
90 ALLOWED_FLAGS="${ALLOWED_FLAGS} -mregparm -mno-app-regs -mapp-regs -msoft-float -mflat -mno-faster-structs -mfaster-structs -mlittle-endian -mbig-endian -mlive-g0 -mcmodel -mno-stack-bias -mstack-bias"
85 91
86 # C[XX]FLAGS that we are think is ok, but needs testing 92 # C[XX]FLAGS that we are think is ok, but needs testing
87 # NOTE: currently -Os have issues with gcc3 and K6* arch's 93 # NOTE: currently -Os have issues with gcc3 and K6* arch's
88 export UNSTABLE_FLAGS="-Os -O3 -freorder-blocks -fprefetch-loop-arrays" 94 export UNSTABLE_FLAGS="-Os -O3 -freorder-blocks -fprefetch-loop-arrays"
89 return 0 95 return 0
221 set -f # disable pathname expansion 227 set -f # disable pathname expansion
222 228
223 for x in ${CFLAGS}; do 229 for x in ${CFLAGS}; do
224 for y in ${ALLOWED_FLAGS}; do 230 for y in ${ALLOWED_FLAGS}; do
225 flag=${x%%=*} 231 flag=${x%%=*}
226 if [ "${flag%%${y}}" = "" ] || [ "${flag:0:5}" = "-fno-" ] || [ "${flag:0:5}" = "-mno-" ] ; then 232 if [ "${flag%%${y}}" = "" ] ; then
227 NEW_CFLAGS="${NEW_CFLAGS} ${x}" 233 NEW_CFLAGS="${NEW_CFLAGS} ${x}"
228 break 234 break
229 fi 235 fi
230 done 236 done
231 done 237 done
232 238
233 for x in ${CXXFLAGS}; do 239 for x in ${CXXFLAGS}; do
234 for y in ${ALLOWED_FLAGS}; do 240 for y in ${ALLOWED_FLAGS}; do
235 flag=${x%%=*} 241 flag=${x%%=*}
236 if [ "${flag%%${y}}" = "" ] || [ "${flag:0:5}" = "-fno-" ] || [ "${flag:0:5}" = "-mno-" ] ; then 242 if [ "${flag%%${y}}" = "" ] ; then
237 NEW_CXXFLAGS="${NEW_CXXFLAGS} ${x}" 243 NEW_CXXFLAGS="${NEW_CXXFLAGS} ${x}"
238 break 244 break
239 fi 245 fi
240 done 246 done
241 done 247 done

Legend:
Removed from v.1.64  
changed lines
  Added in v.1.65

  ViewVC Help
Powered by ViewVC 1.1.20