/[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.58 Revision 1.59
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.58 2004/06/10 15:28:56 agriffis Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.59 2004/06/25 00:18: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"
105 CFLAGS="${CFLAGS// ${x} / }" 105 CFLAGS="${CFLAGS// ${x} / }"
106 CXXFLAGS="${CXXFLAGS// ${x} / }" 106 CXXFLAGS="${CXXFLAGS// ${x} / }"
107 done 107 done
108 CFLAGS="${CFLAGS:1:${#CFLAGS}-2}" 108 CFLAGS="${CFLAGS:1:${#CFLAGS}-2}"
109 CXXFLAGS="${CXXFLAGS:1:${#CXXFLAGS}-2}" 109 CXXFLAGS="${CXXFLAGS:1:${#CXXFLAGS}-2}"
110 export CFLAGS CXXFLAGS
110 return 0 111 return 0
111} 112}
112 113
113filter-lfs-flags() { 114filter-lfs-flags() {
114 filter-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE 115 filter-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
133 CXXFLAGS=" ${CXXFLAGS} " 134 CXXFLAGS=" ${CXXFLAGS} "
134 CFLAGS="${CFLAGS// ${1} / ${2} }" 135 CFLAGS="${CFLAGS// ${1} / ${2} }"
135 CXXFLAGS="${CXXFLAGS// ${1} / ${2} }" 136 CXXFLAGS="${CXXFLAGS// ${1} / ${2} }"
136 CFLAGS="${CFLAGS:1:${#CFLAGS}-2}" 137 CFLAGS="${CFLAGS:1:${#CFLAGS}-2}"
137 CXXFLAGS="${CXXFLAGS:1:${#CXXFLAGS}-2}" 138 CXXFLAGS="${CXXFLAGS:1:${#CXXFLAGS}-2}"
139 export CFLAGS CXXFLAGS
138 return 0 140 return 0
139} 141}
140 142
141replace-cpu-flags() { 143replace-cpu-flags() {
142 local oldcpu newcpu="$1" ; shift 144 local oldcpu newcpu="$1" ; shift
229 if [ "${CXXFLAGS/-O}" != "${CXXFLAGS}" -a "${NEW_CXXFLAGS/-O}" = "${NEW_CXXFLAGS}" ]; then 231 if [ "${CXXFLAGS/-O}" != "${CXXFLAGS}" -a "${NEW_CXXFLAGS/-O}" = "${NEW_CXXFLAGS}" ]; then
230 NEW_CXXFLAGS="${NEW_CXXFLAGS} -O2" 232 NEW_CXXFLAGS="${NEW_CXXFLAGS} -O2"
231 fi 233 fi
232 234
233 set +f # re-enable pathname expansion 235 set +f # re-enable pathname expansion
234
235 useq debug \
236 && einfo "CFLAGS=\"${NEW_CFLAGS}\"" \
237 && einfo "CXXFLAGS=\"${NEW_CXXFLAGS}\""
238 236
239 export CFLAGS="${NEW_CFLAGS}" 237 export CFLAGS="${NEW_CFLAGS}"
240 export CXXFLAGS="${NEW_CXXFLAGS}" 238 export CXXFLAGS="${NEW_CXXFLAGS}"
241 return 0 239 return 0
242} 240}
345 else 343 else
346 for x in ${SPARC64_CPUS}; do 344 for x in ${SPARC64_CPUS}; do
347 CXXFLAGS="${CXXFLAGS/-mcpu=${x}/-mcpu=v8 -mtune=${x}}" 345 CXXFLAGS="${CXXFLAGS/-mcpu=${x}/-mcpu=v8 -mtune=${x}}"
348 done 346 done
349 fi 347 fi
348
349 export CFLAGS CXXFLAGS
350} 350}
351 351
352append-ldflags() { 352append-ldflags() {
353 LDFLAGS="${LDFLAGS} $*" 353 export LDFLAGS="${LDFLAGS} $*"
354 return 0 354 return 0
355} 355}
356 356
357filter-ldflags() { 357filter-ldflags() {
358 local x 358 local x
362 LDFLAGS=" ${LDFLAGS} " 362 LDFLAGS=" ${LDFLAGS} "
363 for x in "$@" ; do 363 for x in "$@" ; do
364 LDFLAGS="${LDFLAGS// ${x} / }" 364 LDFLAGS="${LDFLAGS// ${x} / }"
365 done 365 done
366 LDFLAGS="${LDFLAGS:1:${#LDFLAGS}-2}" 366 LDFLAGS="${LDFLAGS:1:${#LDFLAGS}-2}"
367 export LDFLAGS
367 return 0 368 return 0
368} 369}
369 370
370etexec-flags() { 371etexec-flags() {
371 # if you're not using a hardened compiler you wont need this 372 # if you're not using a hardened compiler you wont need this

Legend:
Removed from v.1.58  
changed lines
  Added in v.1.59

  ViewVC Help
Powered by ViewVC 1.1.20