/[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.65 Revision 1.67
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.65 2004/07/27 19:25:49 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.67 2004/08/07 04:24:41 agriffis 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"
174 174
175is-flag() { 175is-flag() {
176 local x 176 local x
177 177
178 for x in ${CFLAGS} ${CXXFLAGS} ; do 178 for x in ${CFLAGS} ${CXXFLAGS} ; do
179 # Note this should work with globs like -mcpu=ultrasparc*
179 if [ "${x}" == "$1" ] ; then 180 if [[ ${x} == ${1} ]]; then
180 echo true 181 echo true
181 return 0 182 return 0
182 fi 183 fi
183 done 184 done
184 return 1 185 return 1
410 411
411etexec-flags() { 412etexec-flags() {
412 # if you're not using a hardened compiler you wont need this 413 # if you're not using a hardened compiler you wont need this
413 # PIC/no-pic kludge in the first place. 414 # PIC/no-pic kludge in the first place.
414 has_hardened || return 0 415 has_hardened || return 0
416 # this kludge breaks on amd64, and probably other -fPIC dependant
417 # archs.
418 use amd64 && return 0
415 419
416 if has_pie || has_pic; then 420 if has_pie || has_pic; then
417 [ -z "`is-flag -fno-pic`" ] && 421 [ -z "`is-flag -fno-pic`" ] &&
418 export CFLAGS="${CFLAGS} `test_flag -fno-pic`" 422 export CFLAGS="${CFLAGS} `test_flag -fno-pic`"
419 [ -z "`is-flag -nopie`" ] && 423 [ -z "`is-flag -nopie`" ] &&

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

  ViewVC Help
Powered by ViewVC 1.1.20