/[gentoo-x86]/eclass/multilib.eclass
Gentoo

Diff of /eclass/multilib.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.45 Revision 1.50
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.45 2005/10/13 15:13:14 swegener Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.50 2006/06/20 08:48:24 eradicator 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.
100export LDFLAGS_default 100export LDFLAGS_default
101export CHOST_default=${CHOST_default:-${CHOST}} 101export CHOST_default=${CHOST_default:-${CHOST}}
102export CTARGET_default=${CTARGET_default:-${CTARGET:-${CHOST_default}}} 102export CTARGET_default=${CTARGET_default:-${CTARGET:-${CHOST_default}}}
103export LIBDIR_default=${CONF_LIBDIR:-"lib"} 103export LIBDIR_default=${CONF_LIBDIR:-"lib"}
104export CDEFINE_default="__unix__" 104export CDEFINE_default="__unix__"
105export KERNEL_ABI=${KERNEL_ABI:-${DEFAULT_ABI}}
105 106
106# has_multilib_profile() 107# has_multilib_profile()
107has_multilib_profile() { 108has_multilib_profile() {
108 [ -n "${MULTILIB_ABIS}" -a "${MULTILIB_ABIS}" != "${MULTILIB_ABIS/ /}" ] 109 [ -n "${MULTILIB_ABIS}" -a "${MULTILIB_ABIS}" != "${MULTILIB_ABIS/ /}" ]
109} 110}
190 local var="${flag}_${abi}" 191 local var="${flag}_${abi}"
191 echo ${!var} 192 echo ${!var}
192} 193}
193 194
194get_abi_CFLAGS() { get_abi_var CFLAGS "$@"; } 195get_abi_CFLAGS() { get_abi_var CFLAGS "$@"; }
196get_abi_ASFLAGS() { get_abi_var ASFLAGS "$@"; }
195get_abi_LDFLAGS() { get_abi_var LDFLAGS "$@"; } 197get_abi_LDFLAGS() { get_abi_var LDFLAGS "$@"; }
196get_abi_CHOST() { get_abi_var CHOST "$@"; } 198get_abi_CHOST() { get_abi_var CHOST "$@"; }
197get_abi_CTARGET() { get_abi_var CTARGET "$@"; }
198get_abi_FAKE_TARGETS() { get_abi_var FAKE_TARGETS "$@"; } 199get_abi_FAKE_TARGETS() { get_abi_var FAKE_TARGETS "$@"; }
199get_abi_CDEFINE() { get_abi_var CDEFINE "$@"; } 200get_abi_CDEFINE() { get_abi_var CDEFINE "$@"; }
200get_abi_LIBDIR() { get_abi_var LIBDIR "$@"; } 201get_abi_LIBDIR() { get_abi_var LIBDIR "$@"; }
201 202
202# Return a list of the ABIs we want to install for with 203# Return a list of the ABIs we want to install for with
266get_all_libdirs() { 267get_all_libdirs() {
267 local libdirs="lib" 268 local libdirs="lib"
268 local abi 269 local abi
269 local dir 270 local dir
270 271
271 if has_multilib_profile; then 272 # Remove when amd64's 2004.3 is purged.
273 if [[ -n "${CONF_LIBDIR}" ]]; then
274 for dir in ${CONF_LIBDIR} ${CONF_MULTILIBDIR:-lib32}; do
275 [ "${dir}" != "lib" ] && libdirs="${libdirs} ${dir}"
276 done
277 else
272 for abi in ${MULTILIB_ABIS}; do 278 for abi in ${MULTILIB_ABIS}; do
273 [ "$(get_abi_LIBDIR ${abi})" != "lib" ] && libdirs="${libdirs} $(get_abi_LIBDIR ${abi})" 279 [ "$(get_abi_LIBDIR ${abi})" != "lib" ] && libdirs="${libdirs} $(get_abi_LIBDIR ${abi})"
274 done
275 elif [ -n "${CONF_LIBDIR}" ]; then
276 for dir in ${CONF_LIBDIR} ${CONF_MULTILIBDIR:-lib32}; do
277 [ "${dir}" != "lib" ] && libdirs="${libdirs} ${dir}"
278 done 280 done
279 fi 281 fi
280 282
281 echo "${libdirs}" 283 echo "${libdirs}"
282} 284}
388# Ideas for this code came from debian's sparc-linux headers package. 390# Ideas for this code came from debian's sparc-linux headers package.
389# 391#
390# Example: 392# Example:
391# create_ml_includes /usr/include/asm __sparc__:/usr/include/asm-sparc __sparc64__:/usr/include/asm-sparc64 393# create_ml_includes /usr/include/asm __sparc__:/usr/include/asm-sparc __sparc64__:/usr/include/asm-sparc64
392# create_ml_includes /usr/include/asm __i386__:/usr/include/asm-i386 __x86_64__:/usr/include/asm-x86_64 394# create_ml_includes /usr/include/asm __i386__:/usr/include/asm-i386 __x86_64__:/usr/include/asm-x86_64
395#
396# Warning: Be careful with the ordering here. The default ABI has to be the
397# last, because it is always defined (by GCC)
393create_ml_includes() { 398create_ml_includes() {
394 local dest=$1 399 local dest=$1
395 shift 400 shift
396 local basedirs=$(create_ml_includes-listdirs "$@") 401 local basedirs=$(create_ml_includes-listdirs "$@")
397 402
591 export CHOST_n64=${CTARGET} 596 export CHOST_n64=${CTARGET}
592 export CTARGET_n64=${CHOST_n64} 597 export CTARGET_n64=${CHOST_n64}
593 export CDEFINE_n64="_MIPS_SIM == _ABI64" 598 export CDEFINE_n64="_MIPS_SIM == _ABI64"
594 export LIBDIR_n64="lib64" 599 export LIBDIR_n64="lib64"
595 600
596 export MULTILIB_ABIS="n64 n32" # o32 601 export MULTILIB_ABIS="n64 n32 o32"
597 export DEFAULT_ABI="n32" 602 export DEFAULT_ABI="n32"
598 ;; 603 ;;
599 powerpc64*) 604 powerpc64*)
600 export CFLAGS_ppc=${CFLAGS_ppc--m32} 605 export CFLAGS_ppc=${CFLAGS_ppc--m32}
601 export CHOST_ppc=${CTARGET/powerpc64/powerpc} 606 export CHOST_ppc=${CTARGET/powerpc64/powerpc}
648 export MULTILIB_ABIS="default" 653 export MULTILIB_ABIS="default"
649 export DEFAULT_ABI="default" 654 export DEFAULT_ABI="default"
650 ;; 655 ;;
651 esac 656 esac
652} 657}
658
659# This is for the single package in the tree whose maintainer believes it is so important to
660# provide a compiled-from-source version before portage is able to support it (app-emul/wine)
661multilib_toolchain_setup() {
662 export ABI=$1
663
664 # Binutils doesn't have wrappers for ld and as (yet). Eventually it
665 # will, and all this can just be handled with CHOST.
666 export LD="ld $(get_abi_LDFLAGS)"
667 export AS="as $(get_abi_ASFLAGS)"
668
669 export CHOST=$(get_abi_CHOST)
670 export CBUILD=$(get_abi_CHOST)
671}

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.50

  ViewVC Help
Powered by ViewVC 1.1.20