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

Diff of /eclass/autotools-multilib.eclass

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

Revision 1.4 Revision 1.11
1# Copyright 1999-2013 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/autotools-multilib.eclass,v 1.4 2013/01/26 11:34:16 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-multilib.eclass,v 1.11 2013/02/27 21:46:31 mgorny Exp $
4 4
5# @ECLASS: autotools-multilib.eclass 5# @ECLASS: autotools-multilib.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Michał Górny <mgorny@gentoo.org> 7# Michał Górny <mgorny@gentoo.org>
8# @BLURB: autotools-utils wrapper for multilib builds 8# @BLURB: autotools-utils wrapper for multilib builds
9# @DESCRIPTION: 9# @DESCRIPTION:
10# The autotools-multilib.eclass is an autotools-utils.eclass(5) wrapper 10# The autotools-multilib.eclass is an autotools-utils.eclass(5) wrapper
11# introducing support for building for more than one ABI (multilib). 11# introducing support for building for more than one ABI (multilib).
12# 12#
13# Inheriting this eclass sets IUSE=multilib and exports autotools-utils 13# Inheriting this eclass sets the USE flags and exports autotools-utils
14# phase function wrappers which build the package for each supported ABI 14# phase function wrappers which build the package for each supported ABI
15# if the flag is enabled. Otherwise, it works like regular 15# when the relevant flag is enabled. Other than that, it works like
16# autotools-utils. 16# regular autotools-utils.
17# 17#
18# Note that the multilib support requires out-of-source builds to be 18# Note that the multilib support requires out-of-source builds to be
19# enabled. Thus, it is impossible to use AUTOTOOLS_IN_SOURCE_BUILD with 19# enabled. Thus, it is impossible to use AUTOTOOLS_IN_SOURCE_BUILD with
20# it. 20# it.
21 21
22# EAPI=5 is required for meaningful MULTILIB_USEDEP.
22case ${EAPI:-0} in 23case ${EAPI:-0} in
23 2|3|4|5) ;; 24 5) ;;
24 *) die "EAPI=${EAPI} is not supported" ;; 25 *) die "EAPI=${EAPI} is not supported" ;;
25esac 26esac
26 27
27if [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then 28if [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
28 die "${ECLASS}: multilib support requires out-of-source builds." 29 die "${ECLASS}: multilib support requires out-of-source builds."
29fi 30fi
30 31
31inherit autotools-utils multilib 32inherit autotools-utils multilib-build
32 33
33EXPORT_FUNCTIONS src_configure src_compile src_test src_install 34EXPORT_FUNCTIONS src_configure src_compile src_test src_install
34 35
35IUSE=multilib
36
37# @ECLASS-VARIABLE: MULTILIB_USEDEP
38# @DESCRIPTION:
39# The USE-dependency to be used on dependencies (libraries) needing
40# to support multilib as well.
41#
42# Example use:
43# @CODE
44# RDEPEND="dev-libs/libfoo[${MULTILIB_USEDEP}]
45# net-libs/libbar[ssl,${MULTILIB_USEDEP}]"
46# @CODE
47MULTILIB_USEDEP=multilib?
48
49# @FUNCTION: autotools-multilib_foreach_abi
50# @USAGE: argv...
51# @DESCRIPTION:
52# If multilib support is enabled, sets the toolchain up for each
53# supported ABI along with the ABI variable and correct BUILD_DIR,
54# and runs the given commands with them.
55#
56# If multilib support is disabled, it just runs the commands. No setup
57# is done.
58autotools-multilib_foreach_abi() {
59 local initial_dir=${BUILD_DIR:-${S}}
60
61 if use multilib; then
62 local ABI
63 for ABI in $(get_all_abis); do
64 multilib_toolchain_setup "${ABI}"
65 BUILD_DIR=${initial_dir%%/}-${ABI} "${@}"
66 done
67 else
68 "${@}"
69 fi
70}
71
72autotools-multilib_src_configure() { 36autotools-multilib_src_configure() {
73 autotools-multilib_foreach_abi autotools-utils_src_configure 37 multilib_parallel_foreach_abi autotools-utils_src_configure "${@}"
74} 38}
75 39
76autotools-multilib_src_compile() { 40autotools-multilib_src_compile() {
77 autotools-multilib_foreach_abi autotools-utils_src_compile 41 multilib_foreach_abi autotools-utils_src_compile "${@}"
78} 42}
79 43
80autotools-multilib_src_test() { 44autotools-multilib_src_test() {
81 autotools-multilib_foreach_abi autotools-utils_src_test 45 multilib_foreach_abi autotools-utils_src_test "${@}"
82} 46}
83 47
84autotools-multilib_src_install() { 48autotools-multilib_src_install() {
49 autotools-multilib_secure_install() {
50 autotools-utils_src_install "${@}"
51
52 # Make sure all headers are the same for each ABI.
53 multilib_check_headers
54 }
55
85 autotools-multilib_foreach_abi autotools-utils_src_install 56 multilib_foreach_abi autotools-multilib_secure_install "${@}"
86} 57}

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.20