/[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.5
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.5 2013/01/26 11:35:38 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
26 26
27if [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then 27if [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
28 die "${ECLASS}: multilib support requires out-of-source builds." 28 die "${ECLASS}: multilib support requires out-of-source builds."
29fi 29fi
30 30
31inherit autotools-utils multilib 31inherit autotools-utils multilib multiprocessing
32 32
33EXPORT_FUNCTIONS src_configure src_compile src_test src_install 33EXPORT_FUNCTIONS src_configure src_compile src_test src_install
34 34
35IUSE=multilib 35IUSE=multilib
36 36
67 else 67 else
68 "${@}" 68 "${@}"
69 fi 69 fi
70} 70}
71 71
72# @FUNCTION: autotools-multilib_parallel_foreach_abi
73# @USAGE: argv...
74# @DESCRIPTION:
75# If multilib support is enabled, sets the toolchain up for each
76# supported ABI along with the ABI variable and correct BUILD_DIR,
77# and runs the given commands with them. The commands are run
78# in parallel with number of jobs being determined from MAKEOPTS.
79#
80# If multilib support is disabled, it just runs the commands. No setup
81# is done.
82#
83# Useful for running configure scripts.
84autotools-multilib_parallel_foreach_abi() {
85 local initial_dir=${BUILD_DIR:-${S}}
86
87 if use multilib; then
88 multijob_init
89
90 local ABI
91 for ABI in $(get_all_abis); do
92 (
93 multijob_child_init
94
95 multilib_toolchain_setup "${ABI}"
96 BUILD_DIR=${initial_dir%%/}-${ABI}
97 "${@}"
98 ) &
99
100 multijob_post_fork
101 done
102
103 multijob_finish
104 else
105 "${@}"
106 fi
107}
108
72autotools-multilib_src_configure() { 109autotools-multilib_src_configure() {
73 autotools-multilib_foreach_abi autotools-utils_src_configure 110 autotools-multilib_parallel_foreach_abi autotools-utils_src_configure
74} 111}
75 112
76autotools-multilib_src_compile() { 113autotools-multilib_src_compile() {
77 autotools-multilib_foreach_abi autotools-utils_src_compile 114 autotools-multilib_foreach_abi autotools-utils_src_compile
78} 115}

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

  ViewVC Help
Powered by ViewVC 1.1.20