/[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.170 Revision 1.171
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2012 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.170 2012/05/26 02:55:02 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.171 2012/05/30 07:59:51 jlec Exp $
4 4
5# @ECLASS: flag-o-matic.eclass 5# @ECLASS: flag-o-matic.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# toolchain@gentoo.org 7# toolchain@gentoo.org
8# @BLURB: common functions to manipulate and query toolchain flags 8# @BLURB: common functions to manipulate and query toolchain flags
121 # _LARGEFILE64_SOURCE: enable support for 64bit variants (off64_t/fseeko64/etc...) 121 # _LARGEFILE64_SOURCE: enable support for 64bit variants (off64_t/fseeko64/etc...)
122 # _FILE_OFFSET_BITS: default to 64bit variants (off_t is defined as off64_t) 122 # _FILE_OFFSET_BITS: default to 64bit variants (off_t is defined as off64_t)
123 filter-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE 123 filter-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
124} 124}
125 125
126# @FUNCTION: filter-ldflags
127# @USAGE: <flags>
128# @DESCRIPTION:
129# Remove particular <flags> from LDFLAGS. Accepts shell globs.
130filter-ldflags() {
131 _filter-var LDFLAGS "$@"
132 return 0
133}
134
126# @FUNCTION: append-cppflags 135# @FUNCTION: append-cppflags
127# @USAGE: <flags> 136# @USAGE: <flags>
128# @DESCRIPTION: 137# @DESCRIPTION:
129# Add extra <flags> to the current CPPFLAGS. 138# Add extra <flags> to the current CPPFLAGS.
130append-cppflags() { 139append-cppflags() {
169# Add flags that enable Large File Support. 178# Add flags that enable Large File Support.
170append-lfs-flags() { 179append-lfs-flags() {
171 [[ $# -ne 0 ]] && die "append-lfs-flags takes no arguments" 180 [[ $# -ne 0 ]] && die "append-lfs-flags takes no arguments"
172 # see comments in filter-lfs-flags func for meaning of these 181 # see comments in filter-lfs-flags func for meaning of these
173 append-cppflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE 182 append-cppflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
183}
184
185# @FUNCTION: append-ldflags
186# @USAGE: <flags>
187# @DESCRIPTION:
188# Add extra <flags> to the current LDFLAGS.
189append-ldflags() {
190 [[ $# -eq 0 ]] && return 0
191 local flag
192 for flag in "$@"; do
193 [[ ${flag} == -l* ]] && \
194 ewarn "Appending a library link instruction (${flag}); libraries to link to should not be passed through LDFLAGS"
195 done
196
197 export LDFLAGS="${LDFLAGS} $*"
198 return 0
174} 199}
175 200
176# @FUNCTION: append-flags 201# @FUNCTION: append-flags
177# @USAGE: <flags> 202# @USAGE: <flags>
178# @DESCRIPTION: 203# @DESCRIPTION:
547 for flag in "$@"; do 572 for flag in "$@"; do
548 [[ ${flag} == -l* ]] && flag=${flag#-l} 573 [[ ${flag} == -l* ]] && flag=${flag#-l}
549 export LIBS="${LIBS} -l${flag}" 574 export LIBS="${LIBS} -l${flag}"
550 done 575 done
551 576
552 return 0
553}
554
555# @FUNCTION: append-ldflags
556# @USAGE: <flags>
557# @DESCRIPTION:
558# Add extra <flags> to the current LDFLAGS.
559append-ldflags() {
560 [[ $# -eq 0 ]] && return 0
561 local flag
562 for flag in "$@"; do
563 [[ ${flag} == -l* ]] && \
564 ewarn "Appending a library link instruction (${flag}); libraries to link to should not be passed through LDFLAGS"
565 done
566
567 export LDFLAGS="${LDFLAGS} $*"
568 return 0
569}
570
571# @FUNCTION: filter-ldflags
572# @USAGE: <flags>
573# @DESCRIPTION:
574# Remove particular <flags> from LDFLAGS. Accepts shell globs.
575filter-ldflags() {
576 _filter-var LDFLAGS "$@"
577 return 0 577 return 0
578} 578}
579 579
580# @FUNCTION: raw-ldflags 580# @FUNCTION: raw-ldflags
581# @USAGE: [flags] 581# @USAGE: [flags]

Legend:
Removed from v.1.170  
changed lines
  Added in v.1.171

  ViewVC Help
Powered by ViewVC 1.1.20