1 | # Copyright 1999-2011 Gentoo Foundation |
1 | # Copyright 1999-2011 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/qt4-build.eclass,v 1.110 2011/12/26 11:59:19 pesa Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.111 2011/12/27 16:04:27 pesa Exp $ |
4 | |
4 | |
5 | # @ECLASS: qt4-build.eclass |
5 | # @ECLASS: qt4-build.eclass |
6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
7 | # Qt herd <qt@gentoo.org> |
7 | # Qt herd <qt@gentoo.org> |
8 | # @BLURB: Eclass for Qt4 split ebuilds. |
8 | # @BLURB: Eclass for Qt4 split ebuilds. |
… | |
… | |
724 | } |
724 | } |
725 | |
725 | |
726 | # @FUNCTION: qt_use |
726 | # @FUNCTION: qt_use |
727 | # @USAGE: < flag > [ feature ] [ enableval ] |
727 | # @USAGE: < flag > [ feature ] [ enableval ] |
728 | # @DESCRIPTION: |
728 | # @DESCRIPTION: |
729 | # This will echo "${enableval}-${feature}" if <flag> is enabled, or |
729 | # This will echo "-${enableval}-${feature}" if <flag> is enabled, or |
730 | # "-no-${feature} if the flag is disabled. If [feature] is not specified <flag> |
730 | # "-no-${feature}" if it's disabled. If [feature] is not specified, <flag> |
731 | # will be used for that. If [enableval] is not specified, it omits the |
731 | # will be used for that. If [enableval] is not specified, it omits the |
732 | # assignment part. |
732 | # "-${enableval}" part. |
733 | qt_use() { |
733 | qt_use() { |
734 | local flag=$1 |
734 | use "$1" && echo "${3:+-$3}-${2:-$1}" || echo "-no-${2:-$1}" |
735 | local feature=$1 |
|
|
736 | local enableval= |
|
|
737 | |
|
|
738 | [[ -n $2 ]] && feature=$2 |
|
|
739 | [[ -n $3 ]] && enableval=-$3 |
|
|
740 | |
|
|
741 | if use ${flag}; then |
|
|
742 | echo "${enableval}-${feature}" |
|
|
743 | else |
|
|
744 | echo "-no-${feature}" |
|
|
745 | fi |
|
|
746 | } |
735 | } |
747 | |
736 | |
748 | # @FUNCTION: qt_mkspecs_dir |
737 | # @FUNCTION: qt_mkspecs_dir |
749 | # @RETURN: the specs-directory w/o path |
738 | # @RETURN: the specs-directory w/o path |
750 | # @DESCRIPTION: |
739 | # @DESCRIPTION: |