| 1 | # Copyright 1999-2007 Gentoo Foundation |
1 | # Copyright 1999-2007 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.60 2007/03/27 01:46:50 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.64 2008/05/02 04:07:38 vapier Exp $ |
| 4 | # |
4 | # |
| 5 | # Maintainer: amd64@gentoo.org / toolchain@gentoo.org |
5 | # Maintainer: amd64@gentoo.org / toolchain@gentoo.org |
| 6 | # |
6 | # |
| 7 | # This eclass is for all functions pertaining to handling multilib. |
7 | # This eclass is for all functions pertaining to handling multilib. |
| 8 | # configurations. |
8 | # configurations. |
| 9 | |
9 | |
| 10 | ___ECLASS_RECUR_MULTILIB="yes" |
10 | ___ECLASS_RECUR_MULTILIB="yes" |
| 11 | [[ -z ${___ECLASS_RECUR_TOOLCHAIN_FUNCS} ]] && inherit toolchain-funcs |
11 | [[ -z ${___ECLASS_RECUR_TOOLCHAIN_FUNCS} ]] && inherit toolchain-funcs |
| 12 | |
12 | |
| 13 | DESCRIPTION="Based on the ${ECLASS} eclass" |
|
|
| 14 | |
|
|
| 15 | # has_multilib_profile: |
13 | # has_multilib_profile: |
| 16 | # Return true if the current profile is a multilib profile and lists more than |
14 | # Return true if the current profile is a multilib profile and lists more than |
| 17 | # one abi in ${MULTILIB_ABIS}. You might want to use this like |
15 | # one abi in ${MULTILIB_ABIS}. When has_multilib_profile returns true, that |
| 18 | # 'use multilib || has_multilib_profile' until all profiles utilizing the |
16 | # profile should enable the 'multilib' use flag. This is so you can DEPEND on |
| 19 | # 'multilib' use flag are removed from portage |
17 | # a package only for multilib or not multilib. |
| 20 | |
18 | |
| 21 | # is_final_abi: |
19 | # is_final_abi: |
| 22 | # Return true if ${ABI} is the final abi to be installed (and thus we are |
20 | # Return true if ${ABI} is the final abi to be installed (and thus we are |
| 23 | # on our last run through a src_* function. |
21 | # on our last run through a src_* function. |
| 24 | |
22 | |
| … | |
… | |
| 212 | if [[ -z ${MULTILIB_ABIS} ]] ; then |
210 | if [[ -z ${MULTILIB_ABIS} ]] ; then |
| 213 | echo "default" |
211 | echo "default" |
| 214 | return 0 |
212 | return 0 |
| 215 | fi |
213 | fi |
| 216 | |
214 | |
| 217 | if hasq multilib-pkg-force ${RESTRICT} || |
215 | if [[ ${EMULTILIB_PKG} == "true" ]] ; then |
| 218 | { hasq multilib-pkg ${FEATURES} && hasq multilib-pkg ${RESTRICT}; }; then |
|
|
| 219 | for x in ${MULTILIB_ABIS} ; do |
216 | for x in ${MULTILIB_ABIS} ; do |
| 220 | if [[ ${x} != "${DEFAULT_ABI}" ]] ; then |
217 | if [[ ${x} != "${DEFAULT_ABI}" ]] ; then |
| 221 | hasq ${x} ${ABI_DENY} || ordera="${ordera} ${x}" |
218 | hasq ${x} ${ABI_DENY} || ordera="${ordera} ${x}" |
| 222 | fi |
219 | fi |
| 223 | done |
220 | done |
| … | |
… | |
| 536 | |
533 | |
| 537 | get_libname() { |
534 | get_libname() { |
| 538 | local libname |
535 | local libname |
| 539 | local ver=$1 |
536 | local ver=$1 |
| 540 | case ${CHOST} in |
537 | case ${CHOST} in |
|
|
538 | mingw*|*-mingw*) libname="dll";; |
| 541 | *-darwin*) libname="dylib";; |
539 | *-darwin*) libname="dylib";; |
| 542 | *) libname="so";; |
540 | *) libname="so";; |
| 543 | esac |
541 | esac |
| 544 | |
542 | |
| 545 | if [[ -z $@ ]] ; then |
543 | if [[ -z $* ]] ; then |
| 546 | echo ".${libname}" |
544 | echo ".${libname}" |
| 547 | else |
545 | else |
| 548 | for ver in "$@" ; do |
546 | for ver in "$@" ; do |
| 549 | case ${CHOST} in |
547 | case ${CHOST} in |
| 550 | *-darwin*) echo ".${ver}.${libname}";; |
548 | *-darwin*) echo ".${ver}.${libname}";; |