diff options
author | Michał Górny <mgorny@gentoo.org> | 2014-04-21 07:17:55 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2014-04-21 07:17:55 +0000 |
commit | b4fc8be8887e0776ff363abeeb1de657452dbea3 (patch) | |
tree | a34c1f7f0683b48ea964d90f906ec53dead2eb6e /eclass | |
parent | USE=threads is mandatory on postgresql-base for the tests to pass, fixing bug... (diff) | |
download | gentoo-2-b4fc8be8887e0776ff363abeeb1de657452dbea3.tar.gz gentoo-2-b4fc8be8887e0776ff363abeeb1de657452dbea3.tar.bz2 gentoo-2-b4fc8be8887e0776ff363abeeb1de657452dbea3.zip |
Introduce extra multilib_native_use* wrappers encapulsating multilib_build_binaries & use* functions.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 6 | ||||
-rw-r--r-- | eclass/multilib-build.eclass | 50 |
2 files changed, 54 insertions, 2 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index ce6fbf735386..e6bca3549dc7 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for eclass directory # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1214 2014/04/21 00:08:15 mpagano Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1215 2014/04/21 07:17:55 mgorny Exp $ + + 21 Apr 2014; Michał Górny <mgorny@gentoo.org> multilib-build.eclass: + Introduce extra multilib_native_use* wrappers encapulsating + multilib_build_binaries & use* functions. 21 Apr 2014; Michael Pagano <mpagano@gentoo.org> kernel-2.eclass: Update 3.15-rcX temporary fix. See bug #507656. diff --git a/eclass/multilib-build.eclass b/eclass/multilib-build.eclass index 77e7573fc44f..15994c558b64 100644 --- a/eclass/multilib-build.eclass +++ b/eclass/multilib-build.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.34 2014/04/03 22:09:36 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.35 2014/04/21 07:17:55 mgorny Exp $ # @ECLASS: multilib-build.eclass # @MAINTAINER: @@ -462,5 +462,53 @@ multilib_build_binaries() { [[ ${COMPLETE_MULTILIB} == yes ]] || multilib_is_native_abi } +# @FUNCTION: multilib_native_use_with +# @USAGE: <flag> [<opt-name> [<opt-value>]] +# @DESCRIPTION: +# Output --with configure option alike use_with if USE <flag> is enabled +# and executables are being built (multilib_build_binaries is true). +# Otherwise, outputs --without configure option. Arguments are the same +# as for use_with in the EAPI. +multilib_native_use_with() { + if multilib_build_binaries; then + use_with "${@}" + else + echo "--without-${2:-${1}}" + fi +} + +# @FUNCTION: multilib_native_use_enable +# @USAGE: <flag> [<opt-name> [<opt-value>]] +# @DESCRIPTION: +# Output --enable configure option alike use_with if USE <flag> +# is enabled and executables are being built (multilib_build_binaries +# is true). Otherwise, outputs --disable configure option. Arguments are +# the same as for use_enable in the EAPI. +multilib_native_use_enable() { + if multilib_build_binaries; then + use_enable "${@}" + else + echo "--disable-${2:-${1}}" + fi +} + +# @FUNCTION: multilib_native_usex +# @USAGE: <flag> [<true1> [<false1> [<true2> [<false2>]]]] +# @DESCRIPTION: +# Output the concatenation of <true1> (or 'yes' if unspecified) +# and <true2> if USE <flag> is enabled and executables are being built +# (multilib_build_binaries is true). Otherwise, output the concatenation +# of <false1> (or 'no' if unspecified) and <false2>. Arguments +# are the same as for usex in the EAPI. +# +# Note: in EAPI 4 you need to inherit eutils to use this function. +multilib_native_usex() { + if multilib_build_binaries; then + usex "${@}" + else + echo "${3-no}${5}" + fi +} + _MULTILIB_BUILD=1 fi |