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

Diff of /eclass/multilib.eclass

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

Revision 1.98 Revision 1.102
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2013 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.98 2012/06/03 08:27:53 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.102 2013/01/21 19:22:25 mgorny 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
119# @FUNCTION: get_install_abis 119# @FUNCTION: get_install_abis
120# @DESCRIPTION: 120# @DESCRIPTION:
121# Return a list of the ABIs we want to install for with 121# Return a list of the ABIs we want to install for with
122# the last one in the list being the default. 122# the last one in the list being the default.
123get_install_abis() { 123get_install_abis() {
124 local order="" 124 local x order=""
125 125
126 if [[ -z ${MULTILIB_ABIS} ]] ; then 126 if [[ -z ${MULTILIB_ABIS} ]] ; then
127 echo "default" 127 echo "default"
128 return 0 128 return 0
129 fi 129 fi
160# @FUNCTION: get_all_abis 160# @FUNCTION: get_all_abis
161# @DESCRIPTION: 161# @DESCRIPTION:
162# Return a list of the ABIs supported by this profile. 162# Return a list of the ABIs supported by this profile.
163# the last one in the list being the default. 163# the last one in the list being the default.
164get_all_abis() { 164get_all_abis() {
165 local order="" mvar dvar 165 local x order="" mvar dvar
166 166
167 mvar="MULTILIB_ABIS" 167 mvar="MULTILIB_ABIS"
168 dvar="DEFAULT_ABI" 168 dvar="DEFAULT_ABI"
169 if [[ -n $1 ]] ; then 169 if [[ -n $1 ]] ; then
170 mvar="$1_${mvar}" 170 mvar="$1_${mvar}"
191# @DESCRIPTION: 191# @DESCRIPTION:
192# Returns a list of all the libdirs used by this profile. This includes 192# Returns a list of all the libdirs used by this profile. This includes
193# those that might not be touched by the current ebuild and always includes 193# those that might not be touched by the current ebuild and always includes
194# "lib". 194# "lib".
195get_all_libdirs() { 195get_all_libdirs() {
196 local libdirs 196 local libdirs abi
197 local abi
198 local dir
199 197
200 for abi in ${MULTILIB_ABIS}; do 198 for abi in ${MULTILIB_ABIS}; do
201 libdirs+=" $(get_abi_LIBDIR ${abi})" 199 libdirs+=" $(get_abi_LIBDIR ${abi})"
202 done 200 done
203 [[ " ${libdirs} " != *" lib "* ]] && libdirs+=" lib" 201 [[ " ${libdirs} " != *" lib "* ]] && libdirs+=" lib"
285 283
286 case ${CTARGET} in 284 case ${CTARGET} in
287 x86_64*) 285 x86_64*)
288 export CFLAGS_x86=${CFLAGS_x86--m32} 286 export CFLAGS_x86=${CFLAGS_x86--m32}
289 export CHOST_x86=${CTARGET/x86_64/i686} 287 export CHOST_x86=${CTARGET/x86_64/i686}
288 CHOST_x86=${CHOST_x86/%-gnux32/-gnu}
290 export CTARGET_x86=${CHOST_x86} 289 export CTARGET_x86=${CHOST_x86}
291 if [[ ${SYMLINK_LIB} == "yes" ]] ; then 290 if [[ ${SYMLINK_LIB} == "yes" ]] ; then
292 export LIBDIR_x86="lib32" 291 export LIBDIR_x86="lib32"
293 else 292 else
294 export LIBDIR_x86="lib" 293 export LIBDIR_x86="lib"
295 fi 294 fi
296 295
297 export CFLAGS_amd64=${CFLAGS_amd64--m64} 296 export CFLAGS_amd64=${CFLAGS_amd64--m64}
298 export CHOST_amd64=${CTARGET} 297 export CHOST_amd64=${CTARGET/%-gnux32/-gnu}
299 export CTARGET_amd64=${CHOST_amd64} 298 export CTARGET_amd64=${CHOST_amd64}
300 export LIBDIR_amd64="lib64" 299 export LIBDIR_amd64="lib64"
301 300
302 export CFLAGS_x32=${CFLAGS_x32--mx32} 301 export CFLAGS_x32=${CFLAGS_x32--mx32}
303 export CHOST_x32=${CTARGET} 302 export CHOST_x32=${CTARGET/%-gnu/-gnux32}
304 export CTARGET_x32=${CHOST_x32} 303 export CTARGET_x32=${CHOST_x32}
305 export LIBDIR_x32="libx32" 304 export LIBDIR_x32="libx32"
306 305
306 case ${CTARGET} in
307 *-gnux32)
308 : ${MULTILIB_ABIS=x32 amd64 x86}
309 : ${DEFAULT_ABI=x32}
310 ;;
311 *)
307 : ${MULTILIB_ABIS=amd64 x86} 312 : ${MULTILIB_ABIS=amd64 x86}
308 : ${DEFAULT_ABI=amd64} 313 : ${DEFAULT_ABI=amd64}
314 ;;
315 esac
309 ;; 316 ;;
310 mips64*) 317 mips64*)
311 export CFLAGS_o32=${CFLAGS_o32--mabi=32} 318 export CFLAGS_o32=${CFLAGS_o32--mabi=32}
312 export CHOST_o32=${CTARGET/mips64/mips} 319 export CHOST_o32=${CTARGET/mips64/mips}
313 export CTARGET_o32=${CHOST_o32} 320 export CTARGET_o32=${CHOST_o32}
352 export LIBDIR_s390x="lib64" 359 export LIBDIR_s390x="lib64"
353 360
354 : ${MULTILIB_ABIS=s390x s390} 361 : ${MULTILIB_ABIS=s390x s390}
355 : ${DEFAULT_ABI=s390x} 362 : ${DEFAULT_ABI=s390x}
356 ;; 363 ;;
357 sparc*) 364 sparc64*)
358 export CFLAGS_sparc32=${CFLAGS_sparc32--m32} 365 export CFLAGS_sparc32=${CFLAGS_sparc32--m32}
359 export CHOST_sparc32=${CTARGET/sparc64/sparc} 366 export CHOST_sparc32=${CTARGET/sparc64/sparc}
360 export CTARGET_sparc32=${CHOST_sparc32} 367 export CTARGET_sparc32=${CHOST_sparc32}
361 export LIBDIR_sparc32="lib" 368 export LIBDIR_sparc32="lib"
362 369
386 393
387 export ABI=$1 394 export ABI=$1
388 395
389 # First restore any saved state we have laying around. 396 # First restore any saved state we have laying around.
390 if [[ ${__DEFAULT_ABI_SAVED} == "true" ]] ; then 397 if [[ ${__DEFAULT_ABI_SAVED} == "true" ]] ; then
391 for v in CHOST CBUILD AS CC CXX LD ; do 398 for v in CHOST CBUILD AS CC CXX LD PKG_CONFIG_{LIBDIR,PATH} ; do
392 vv="__abi_saved_${v}" 399 vv="__abi_saved_${v}"
393 export ${v}="${!vv}" 400 export ${v}="${!vv}"
394 unset ${vv} 401 unset ${vv}
395 done 402 done
396 unset __DEFAULT_ABI_SAVED 403 unset __DEFAULT_ABI_SAVED
398 405
399 # We want to avoid the behind-the-back magic of gcc-config as it 406 # We want to avoid the behind-the-back magic of gcc-config as it
400 # screws up ccache and distcc. See #196243 for more info. 407 # screws up ccache and distcc. See #196243 for more info.
401 if [[ ${ABI} != ${DEFAULT_ABI} ]] ; then 408 if [[ ${ABI} != ${DEFAULT_ABI} ]] ; then
402 # Back that multilib-ass up so we can restore it later 409 # Back that multilib-ass up so we can restore it later
403 for v in CHOST CBUILD AS CC CXX LD ; do 410 for v in CHOST CBUILD AS CC CXX LD PKG_CONFIG_{LIBDIR,PATH} ; do
404 export __abi_saved_${v}="${!v}" 411 export __abi_saved_${v}="${!v}"
405 done 412 done
406 export __DEFAULT_ABI_SAVED="true" 413 export __DEFAULT_ABI_SAVED="true"
407 414
408 # Set the CHOST native first so that we pick up the native 415 # Set the CHOST native first so that we pick up the native
411 export CC="$(tc-getCC) $(get_abi_CFLAGS)" 418 export CC="$(tc-getCC) $(get_abi_CFLAGS)"
412 export CXX="$(tc-getCXX) $(get_abi_CFLAGS)" 419 export CXX="$(tc-getCXX) $(get_abi_CFLAGS)"
413 export LD="$(tc-getLD) $(get_abi_LDFLAGS)" 420 export LD="$(tc-getLD) $(get_abi_LDFLAGS)"
414 export CHOST=$(get_abi_CHOST $1) 421 export CHOST=$(get_abi_CHOST $1)
415 export CBUILD=$(get_abi_CHOST $1) 422 export CBUILD=$(get_abi_CHOST $1)
423 export PKG_CONFIG_LIBDIR=${EPREFIX}/usr/$(get_libdir)/pkgconfig
424 export PKG_CONFIG_PATH=${EPREFIX}/usr/share/pkgconfig
416 fi 425 fi
417} 426}
418 427
419fi 428fi

Legend:
Removed from v.1.98  
changed lines
  Added in v.1.102

  ViewVC Help
Powered by ViewVC 1.1.20