| 1 | # Copyright 1999-2004 Gentoo Foundation |
1 | # Copyright 1999-2004 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.39 2005/10/07 03:39:15 eradicator Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.41 2005/10/09 04:40:14 vapier Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Jeremy Huddleston <eradicator@gentoo.org> |
5 | # Author: Jeremy Huddleston <eradicator@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. |
| … | |
… | |
| 242 | # Return a list of the ABIs supported by this profile. |
242 | # Return a list of the ABIs supported by this profile. |
| 243 | # the last one in the list being the default. |
243 | # the last one in the list being the default. |
| 244 | get_all_abis() { |
244 | get_all_abis() { |
| 245 | local order="" |
245 | local order="" |
| 246 | |
246 | |
| 247 | if [ -z "${MULTILIB_ABIS}" ]; then |
247 | if [[ -z ${MULTILIB_ABIS} ]] ; then |
| 248 | echo "default" |
248 | echo "default" |
| 249 | return 0 |
249 | return 0 |
| 250 | fi |
250 | fi |
| 251 | |
251 | |
| 252 | for x in ${MULTILIB_ABIS}; do |
252 | for x in ${MULTILIB_ABIS}; do |
| 253 | if [ "${x}" != "${DEFAULT_ABI}" ]; then |
253 | if [[ ${x} != ${DEFAULT_ABI} ]] ; then |
| 254 | order="${order:+${order }}${x}" |
254 | order="${order:+${order} }${x}" |
| 255 | fi |
255 | fi |
| 256 | done |
256 | done |
| 257 | order="${order:+${order} }${DEFAULT_ABI}" |
257 | order="${order:+${order} }${DEFAULT_ABI}" |
| 258 | |
258 | |
| 259 | echo ${order} |
259 | echo ${order} |
| … | |
… | |
| 550 | } |
550 | } |
| 551 | |
551 | |
| 552 | # This is for the toolchain to setup profile variables when pulling in |
552 | # This is for the toolchain to setup profile variables when pulling in |
| 553 | # a crosscompiler (and thus they aren't set in the profile) |
553 | # a crosscompiler (and thus they aren't set in the profile) |
| 554 | multilib_env() { |
554 | multilib_env() { |
| 555 | local CTARGET=$1 |
555 | local CTARGET=${1:-${CTARGET}} |
| 556 | local CTARGET_post=${CTARGET#*-} |
556 | local CTARGET_post=${CTARGET#*-} |
| 557 | |
557 | |
| 558 | case ${CTARGET} in |
558 | case ${CTARGET} in |
| 559 | x86_64*) |
559 | x86_64*) |
| 560 | export CFLAGS_x86=${CFLAGS_x86--m32} |
560 | export CFLAGS_x86=${CFLAGS_x86--m32} |
| … | |
… | |
| 589 | export CHOST_n64=mips64-${CTARGET_post} |
589 | export CHOST_n64=mips64-${CTARGET_post} |
| 590 | export CTARGET_n64=mips64-${CTARGET_post} |
590 | export CTARGET_n64=mips64-${CTARGET_post} |
| 591 | export CDEFINE_n64="_MIPS_SIM == _ABI64" |
591 | export CDEFINE_n64="_MIPS_SIM == _ABI64" |
| 592 | export LIBDIR_n64="lib64" |
592 | export LIBDIR_n64="lib64" |
| 593 | |
593 | |
| 594 | export MULTILIB_ABIS="n64 n32 o32" |
594 | export MULTILIB_ABIS="n64 n32" # o32 |
| 595 | export DEFAULT_ABI="n32" |
595 | export DEFAULT_ABI="n32" |
| 596 | ;; |
596 | ;; |
| 597 | powerpc64*) |
597 | powerpc64*) |
| 598 | export CFLAGS_ppc=${CFLAGS_ppc--m32} |
598 | export CFLAGS_ppc=${CFLAGS_ppc--m32} |
| 599 | export CHOST_ppc=powerpc-${CTARGET_post} |
599 | export CHOST_ppc=powerpc-${CTARGET_post} |
| 600 | export CTARGET_ppc=powerpc-${CTARGET_post} |
600 | export CTARGET_ppc=powerpc-${CTARGET_post} |