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

Diff of /eclass/multilib-build.eclass

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

Revision 1.39 Revision 1.40
1# Copyright 1999-2014 Gentoo Foundation 1# Copyright 1999-2014 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-build.eclass,v 1.39 2014/04/22 20:12:53 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.40 2014/04/28 17:38:21 mgorny Exp $
4 4
5# @ECLASS: multilib-build.eclass 5# @ECLASS: multilib-build.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# gx86-multilib team <multilib@gentoo.org> 7# gx86-multilib team <multilib@gentoo.org>
8# @AUTHOR: 8# @AUTHOR:
392 fi 392 fi
393 393
394 mv "${root}/${f}" "${root}/${dir}/${CHOST}-${fn}" || die 394 mv "${root}/${f}" "${root}/${dir}/${CHOST}-${fn}" || die
395 395
396 # symlink the native one back 396 # symlink the native one back
397 if multilib_build_binaries; then 397 if multilib_is_native_abi; then
398 ln -s "${CHOST}-${fn}" "${root}/${f}" || die 398 ln -s "${CHOST}-${fn}" "${root}/${f}" || die
399 fi 399 fi
400 done 400 done
401} 401}
402 402
437# This function is not intended to be used directly. Please use 437# This function is not intended to be used directly. Please use
438# multilib_build_binaries instead. 438# multilib_build_binaries instead.
439multilib_is_native_abi() { 439multilib_is_native_abi() {
440 debug-print-function ${FUNCNAME} "${@}" 440 debug-print-function ${FUNCNAME} "${@}"
441 441
442 multilib_build_binaries "${@}" 442 [[ ${#} -eq 0 ]] || die "${FUNCNAME}: too many arguments"
443
444 [[ ${COMPLETE_MULTILIB} == yes || ${ABI} == ${DEFAULT_ABI} ]]
443} 445}
444 446
445# @FUNCTION: multilib_build_binaries 447# @FUNCTION: multilib_build_binaries
446# @DESCRIPTION: 448# @DESCRIPTION:
447# Determine whether to build binaries for the currently built ABI. 449# Determine whether to build binaries for the currently built ABI.
453# supposed to be disabled for multilib ABIs (like those used for 455# supposed to be disabled for multilib ABIs (like those used for
454# executables only). 456# executables only).
455multilib_build_binaries() { 457multilib_build_binaries() {
456 debug-print-function ${FUNCNAME} "${@}" 458 debug-print-function ${FUNCNAME} "${@}"
457 459
458 [[ ${#} -eq 0 ]] || die "${FUNCNAME}: too many arguments" 460 eqawarn "QA warning: multilib_build_binaries is deprecated. Please use the equivalent"
461 eqawarn "multilib_is_native_abi function instead."
459 462
460 [[ ${COMPLETE_MULTILIB} == yes || ${ABI} == ${DEFAULT_ABI} ]] 463 multilib_is_native_abi "${@}"
461} 464}
462 465
463# @FUNCTION: multilib_native_use_with 466# @FUNCTION: multilib_native_use_with
464# @USAGE: <flag> [<opt-name> [<opt-value>]] 467# @USAGE: <flag> [<opt-name> [<opt-value>]]
465# @DESCRIPTION: 468# @DESCRIPTION:
466# Output --with configure option alike use_with if USE <flag> is enabled 469# Output --with configure option alike use_with if USE <flag> is enabled
467# and executables are being built (multilib_build_binaries is true). 470# and executables are being built (multilib_is_native_abi is true).
468# Otherwise, outputs --without configure option. Arguments are the same 471# Otherwise, outputs --without configure option. Arguments are the same
469# as for use_with in the EAPI. 472# as for use_with in the EAPI.
470multilib_native_use_with() { 473multilib_native_use_with() {
471 if multilib_build_binaries; then 474 if multilib_is_native_abi; then
472 use_with "${@}" 475 use_with "${@}"
473 else 476 else
474 echo "--without-${2:-${1}}" 477 echo "--without-${2:-${1}}"
475 fi 478 fi
476} 479}
477 480
478# @FUNCTION: multilib_native_use_enable 481# @FUNCTION: multilib_native_use_enable
479# @USAGE: <flag> [<opt-name> [<opt-value>]] 482# @USAGE: <flag> [<opt-name> [<opt-value>]]
480# @DESCRIPTION: 483# @DESCRIPTION:
481# Output --enable configure option alike use_with if USE <flag> 484# Output --enable configure option alike use_with if USE <flag>
482# is enabled and executables are being built (multilib_build_binaries 485# is enabled and executables are being built (multilib_is_native_abi
483# is true). Otherwise, outputs --disable configure option. Arguments are 486# is true). Otherwise, outputs --disable configure option. Arguments are
484# the same as for use_enable in the EAPI. 487# the same as for use_enable in the EAPI.
485multilib_native_use_enable() { 488multilib_native_use_enable() {
486 if multilib_build_binaries; then 489 if multilib_is_native_abi; then
487 use_enable "${@}" 490 use_enable "${@}"
488 else 491 else
489 echo "--disable-${2:-${1}}" 492 echo "--disable-${2:-${1}}"
490 fi 493 fi
491} 494}
493# @FUNCTION: multilib_native_usex 496# @FUNCTION: multilib_native_usex
494# @USAGE: <flag> [<true1> [<false1> [<true2> [<false2>]]]] 497# @USAGE: <flag> [<true1> [<false1> [<true2> [<false2>]]]]
495# @DESCRIPTION: 498# @DESCRIPTION:
496# Output the concatenation of <true1> (or 'yes' if unspecified) 499# Output the concatenation of <true1> (or 'yes' if unspecified)
497# and <true2> if USE <flag> is enabled and executables are being built 500# and <true2> if USE <flag> is enabled and executables are being built
498# (multilib_build_binaries is true). Otherwise, output the concatenation 501# (multilib_is_native_abi is true). Otherwise, output the concatenation
499# of <false1> (or 'no' if unspecified) and <false2>. Arguments 502# of <false1> (or 'no' if unspecified) and <false2>. Arguments
500# are the same as for usex in the EAPI. 503# are the same as for usex in the EAPI.
501# 504#
502# Note: in EAPI 4 you need to inherit eutils to use this function. 505# Note: in EAPI 4 you need to inherit eutils to use this function.
503multilib_native_usex() { 506multilib_native_usex() {
504 if multilib_build_binaries; then 507 if multilib_is_native_abi; then
505 usex "${@}" 508 usex "${@}"
506 else 509 else
507 echo "${3-no}${5}" 510 echo "${3-no}${5}"
508 fi 511 fi
509} 512}

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40

  ViewVC Help
Powered by ViewVC 1.1.20