| 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/multilib.eclass,v 1.93 2011/10/14 22:54:35 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.94 2011/10/17 19:14:14 vapier Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: multilib.eclass |
5 | # @ECLASS: multilib.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # amd64@gentoo.org |
7 | # amd64@gentoo.org |
| 8 | # toolchain@gentoo.org |
8 | # toolchain@gentoo.org |
| … | |
… | |
| 71 | # If <ABI> is not specified, ${ABI} is used. |
71 | # If <ABI> is not specified, ${ABI} is used. |
| 72 | # If <ABI> is not specified and ${ABI} is not defined, ${DEFAULT_ABI} is used. |
72 | # If <ABI> is not specified and ${ABI} is not defined, ${DEFAULT_ABI} is used. |
| 73 | # If <ABI> is not specified and ${ABI} and ${DEFAULT_ABI} are not defined, we return an empty string. |
73 | # If <ABI> is not specified and ${ABI} and ${DEFAULT_ABI} are not defined, we return an empty string. |
| 74 | get_abi_var() { |
74 | get_abi_var() { |
| 75 | local flag=$1 |
75 | local flag=$1 |
| 76 | local abi |
76 | local abi=${2:-${ABI:-${DEFAULT_ABI:-default}}} |
| 77 | if [ $# -gt 1 ]; then |
|
|
| 78 | abi=${2} |
|
|
| 79 | elif [ -n "${ABI}" ]; then |
|
|
| 80 | abi=${ABI} |
|
|
| 81 | elif [ -n "${DEFAULT_ABI}" ]; then |
|
|
| 82 | abi=${DEFAULT_ABI} |
|
|
| 83 | else |
|
|
| 84 | abi="default" |
|
|
| 85 | fi |
|
|
| 86 | |
|
|
| 87 | local var="${flag}_${abi}" |
77 | local var="${flag}_${abi}" |
| 88 | echo ${!var} |
78 | echo ${!var} |
| 89 | } |
79 | } |
| 90 | |
80 | |
| 91 | # @FUNCTION: get_abi_CFLAGS |
81 | # @FUNCTION: get_abi_CFLAGS |