summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-10-26 23:27:16 +0000
committerMike Frysinger <vapier@gentoo.org>2011-10-26 23:27:16 +0000
commit5965d188e63ce63b04bd9d7d559ca7cba51c1d37 (patch)
treee519cdaf4a9cfb65703d0b58c7bbdaa3366cd072 /eclass
parentVersion bump for stable channel release. (diff)
downloadhistorical-5965d188e63ce63b04bd9d7d559ca7cba51c1d37.tar.gz
historical-5965d188e63ce63b04bd9d7d559ca7cba51c1d37.tar.bz2
historical-5965d188e63ce63b04bd9d7d559ca7cba51c1d37.zip
pull out huse() from toolchain.eclass and into use_if_iuse() in eutils.eclass as this is generally useful
Diffstat (limited to 'eclass')
-rw-r--r--eclass/eutils.eclass13
-rw-r--r--eclass/toolchain.eclass25
2 files changed, 22 insertions, 16 deletions
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index ac6f6849490b..96d562baee8f 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.366 2011/09/30 16:51:01 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.367 2011/10/26 23:27:16 vapier Exp $
# @ECLASS: eutils.eclass
# @MAINTAINER:
@@ -2047,6 +2047,17 @@ in_iuse() {
has "${flag}" "${liuse[@]#[+-]}"
}
+# @FUNCTION: use_if_iuse
+# @USAGE: <flag>
+# @DESCRIPTION:
+# Return true if the given flag is in USE and IUSE.
+#
+# Note that this function should not be used in the global scope.
+use_if_iuse() {
+ in_iuse $1 || return 1
+ use $1
+}
+
# @FUNCTION: usex
# @USAGE: <USE flag> [true output] [false output] [true suffix] [false suffix]
# @DESCRIPTION:
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index e8ef0778fde4..5d1686ff26ce 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.474 2011/10/26 18:54:07 zorry Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.475 2011/10/26 23:27:16 vapier Exp $
#
# Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
@@ -764,9 +764,9 @@ toolchain_pkg_setup() {
unset GCC_SPECS
if use nocxx ; then
- huse go && ewarn 'Go requires a C++ compiler, disabled due to USE="nocxx"'
- huse objc++ && ewarn 'Obj-C++ requires a C++ compiler, disabled due to USE="nocxx"'
- huse gcj && ewarn 'GCJ requires a C++ compiler, disabled due to USE="nocxx"'
+ use_if_iuse go && ewarn 'Go requires a C++ compiler, disabled due to USE="nocxx"'
+ use_if_iuse objc++ && ewarn 'Obj-C++ requires a C++ compiler, disabled due to USE="nocxx"'
+ use_if_iuse gcj && ewarn 'GCJ requires a C++ compiler, disabled due to USE="nocxx"'
fi
want_libssp && libc_has_ssp && \
@@ -2348,11 +2348,6 @@ is_multilib() {
use multilib
}
-huse() {
- has $1 ${IUSE} || return 1
- use $1
-}
-
is_cxx() {
gcc-lang-supported 'c++' || return 1
! use nocxx
@@ -2360,7 +2355,7 @@ is_cxx() {
is_d() {
gcc-lang-supported d || return 1
- huse d
+ use_if_iuse d
}
is_f77() {
@@ -2380,26 +2375,26 @@ is_fortran() {
is_gcj() {
gcc-lang-supported java || return 1
- ! use nocxx && huse gcj
+ ! use nocxx && use_if_iuse gcj
}
is_go() {
gcc-lang-supported go || return 1
- ! use nocxx && huse go
+ ! use nocxx && use_if_iuse go
}
is_libffi() {
- huse libffi
+ use_if_iuse libffi
}
is_objc() {
gcc-lang-supported objc || return 1
- huse objc
+ use_if_iuse objc
}
is_objcxx() {
gcc-lang-supported 'obj-c++' || return 1
- ! use nocxx && huse objc++
+ ! use nocxx && use_if_iuse objc++
}
is_ada() {