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

Diff of /eclass/multilib.eclass

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

Revision 1.97 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.97 2011/12/14 18:15:09 slyfox 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="" 165 local x order="" mvar dvar
166 166
167 if [[ -z ${MULTILIB_ABIS} ]] ; then 167 mvar="MULTILIB_ABIS"
168 dvar="DEFAULT_ABI"
169 if [[ -n $1 ]] ; then
170 mvar="$1_${mvar}"
171 dvar="$1_${dvar}"
172 fi
173
174 if [[ -z ${!mvar} ]] ; then
168 echo "default" 175 echo "default"
169 return 0 176 return 0
170 fi 177 fi
171 178
172 for x in ${MULTILIB_ABIS}; do 179 for x in ${!mvar}; do
173 if [[ ${x} != ${DEFAULT_ABI} ]] ; then 180 if [[ ${x} != ${!dvar} ]] ; then
174 order="${order:+${order} }${x}" 181 order="${order:+${order} }${x}"
175 fi 182 fi
176 done 183 done
177 order="${order:+${order} }${DEFAULT_ABI}" 184 order="${order:+${order} }${!dvar}"
178 185
179 echo ${order} 186 echo ${order}
180 return 0 187 return 0
181} 188}
182 189
184# @DESCRIPTION: 191# @DESCRIPTION:
185# 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
186# 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
187# "lib". 194# "lib".
188get_all_libdirs() { 195get_all_libdirs() {
189 local libdirs 196 local libdirs abi
190 local abi
191 local dir
192 197
193 for abi in ${MULTILIB_ABIS}; do 198 for abi in ${MULTILIB_ABIS}; do
194 libdirs+=" $(get_abi_LIBDIR ${abi})" 199 libdirs+=" $(get_abi_LIBDIR ${abi})"
195 done 200 done
196 [[ " ${libdirs} " != *" lib "* ]] && libdirs+=" lib" 201 [[ " ${libdirs} " != *" lib "* ]] && libdirs+=" lib"
278 283
279 case ${CTARGET} in 284 case ${CTARGET} in
280 x86_64*) 285 x86_64*)
281 export CFLAGS_x86=${CFLAGS_x86--m32} 286 export CFLAGS_x86=${CFLAGS_x86--m32}
282 export CHOST_x86=${CTARGET/x86_64/i686} 287 export CHOST_x86=${CTARGET/x86_64/i686}
288 CHOST_x86=${CHOST_x86/%-gnux32/-gnu}
283 export CTARGET_x86=${CHOST_x86} 289 export CTARGET_x86=${CHOST_x86}
284 if [[ ${SYMLINK_LIB} == "yes" ]] ; then 290 if [[ ${SYMLINK_LIB} == "yes" ]] ; then
285 export LIBDIR_x86="lib32" 291 export LIBDIR_x86="lib32"
286 else 292 else
287 export LIBDIR_x86="lib" 293 export LIBDIR_x86="lib"
288 fi 294 fi
289 295
290 export CFLAGS_amd64=${CFLAGS_amd64--m64} 296 export CFLAGS_amd64=${CFLAGS_amd64--m64}
291 export CHOST_amd64=${CTARGET} 297 export CHOST_amd64=${CTARGET/%-gnux32/-gnu}
292 export CTARGET_amd64=${CHOST_amd64} 298 export CTARGET_amd64=${CHOST_amd64}
293 export LIBDIR_amd64="lib64" 299 export LIBDIR_amd64="lib64"
294 300
295 export CFLAGS_x32=${CFLAGS_x32--mx32} 301 export CFLAGS_x32=${CFLAGS_x32--mx32}
296 export CHOST_x32=${CTARGET} 302 export CHOST_x32=${CTARGET/%-gnu/-gnux32}
297 export CTARGET_x32=${CHOST_x32} 303 export CTARGET_x32=${CHOST_x32}
298 export LIBDIR_x32="libx32" 304 export LIBDIR_x32="libx32"
299 305
306 case ${CTARGET} in
307 *-gnux32)
308 : ${MULTILIB_ABIS=x32 amd64 x86}
309 : ${DEFAULT_ABI=x32}
310 ;;
311 *)
300 : ${MULTILIB_ABIS=amd64 x86} 312 : ${MULTILIB_ABIS=amd64 x86}
301 : ${DEFAULT_ABI=amd64} 313 : ${DEFAULT_ABI=amd64}
314 ;;
315 esac
302 ;; 316 ;;
303 mips64*) 317 mips64*)
304 export CFLAGS_o32=${CFLAGS_o32--mabi=32} 318 export CFLAGS_o32=${CFLAGS_o32--mabi=32}
305 export CHOST_o32=${CTARGET/mips64/mips} 319 export CHOST_o32=${CTARGET/mips64/mips}
306 export CTARGET_o32=${CHOST_o32} 320 export CTARGET_o32=${CHOST_o32}
345 export LIBDIR_s390x="lib64" 359 export LIBDIR_s390x="lib64"
346 360
347 : ${MULTILIB_ABIS=s390x s390} 361 : ${MULTILIB_ABIS=s390x s390}
348 : ${DEFAULT_ABI=s390x} 362 : ${DEFAULT_ABI=s390x}
349 ;; 363 ;;
350 sparc*) 364 sparc64*)
351 export CFLAGS_sparc32=${CFLAGS_sparc32--m32} 365 export CFLAGS_sparc32=${CFLAGS_sparc32--m32}
352 export CHOST_sparc32=${CTARGET/sparc64/sparc} 366 export CHOST_sparc32=${CTARGET/sparc64/sparc}
353 export CTARGET_sparc32=${CHOST_sparc32} 367 export CTARGET_sparc32=${CHOST_sparc32}
354 export LIBDIR_sparc32="lib" 368 export LIBDIR_sparc32="lib"
355 369
379 393
380 export ABI=$1 394 export ABI=$1
381 395
382 # First restore any saved state we have laying around. 396 # First restore any saved state we have laying around.
383 if [[ ${__DEFAULT_ABI_SAVED} == "true" ]] ; then 397 if [[ ${__DEFAULT_ABI_SAVED} == "true" ]] ; then
384 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
385 vv="__abi_saved_${v}" 399 vv="__abi_saved_${v}"
386 export ${v}="${!vv}" 400 export ${v}="${!vv}"
387 unset ${vv} 401 unset ${vv}
388 done 402 done
389 unset __DEFAULT_ABI_SAVED 403 unset __DEFAULT_ABI_SAVED
391 405
392 # 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
393 # screws up ccache and distcc. See #196243 for more info. 407 # screws up ccache and distcc. See #196243 for more info.
394 if [[ ${ABI} != ${DEFAULT_ABI} ]] ; then 408 if [[ ${ABI} != ${DEFAULT_ABI} ]] ; then
395 # Back that multilib-ass up so we can restore it later 409 # Back that multilib-ass up so we can restore it later
396 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
397 export __abi_saved_${v}="${!v}" 411 export __abi_saved_${v}="${!v}"
398 done 412 done
399 export __DEFAULT_ABI_SAVED="true" 413 export __DEFAULT_ABI_SAVED="true"
400 414
401 # 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
404 export CC="$(tc-getCC) $(get_abi_CFLAGS)" 418 export CC="$(tc-getCC) $(get_abi_CFLAGS)"
405 export CXX="$(tc-getCXX) $(get_abi_CFLAGS)" 419 export CXX="$(tc-getCXX) $(get_abi_CFLAGS)"
406 export LD="$(tc-getLD) $(get_abi_LDFLAGS)" 420 export LD="$(tc-getLD) $(get_abi_LDFLAGS)"
407 export CHOST=$(get_abi_CHOST $1) 421 export CHOST=$(get_abi_CHOST $1)
408 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
409 fi 425 fi
410} 426}
411 427
412fi 428fi

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

  ViewVC Help
Powered by ViewVC 1.1.20