/[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.7 Revision 1.8
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/multilib-build.eclass,v 1.7 2013/03/02 18:18:13 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.8 2013/03/04 19:30:28 mgorny Exp $
4 4
5# @ECLASS: multilib-build.eclass 5# @ECLASS: multilib-build.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Michał Górny <mgorny@gentoo.org> 7# Michał Górny <mgorny@gentoo.org>
8# @BLURB: flags and utility functions for building multilib packages 8# @BLURB: flags and utility functions for building multilib packages
21case ${EAPI:-0} in 21case ${EAPI:-0} in
22 5) ;; 22 5) ;;
23 *) die "EAPI=${EAPI} is not supported" ;; 23 *) die "EAPI=${EAPI} is not supported" ;;
24esac 24esac
25 25
26inherit multilib multiprocessing 26inherit multibuild multilib
27 27
28# @ECLASS-VARIABLE: _MULTILIB_FLAGS 28# @ECLASS-VARIABLE: _MULTILIB_FLAGS
29# @INTERNAL 29# @INTERNAL
30# @DESCRIPTION: 30# @DESCRIPTION:
31# The list of multilib flags and corresponding ABI values. 31# The list of multilib flags and corresponding ABI values.
89 debug-print "${FUNCNAME}: ABI=${ABI}, DEFAULT_ABI=${DEFAULT_ABI}" 89 debug-print "${FUNCNAME}: ABI=${ABI}, DEFAULT_ABI=${DEFAULT_ABI}"
90 echo ${abi} 90 echo ${abi}
91 fi 91 fi
92} 92}
93 93
94# @FUNCTION: _multilib_multibuild_wrapper
95# @USAGE: <argv>...
96# @INTERNAL
97# @DESCRIPTION:
98# Initialize the environment for ABI selected for multibuild.
99_multilib_multibuild_wrapper() {
100 debug-print-function ${FUNCNAME} "${@}"
101
102 local ABI=${MULTIBUILD_VARIANT}
103 multilib_toolchain_setup "${ABI}"
104 "${@}"
105}
106
94# @FUNCTION: multilib_foreach_abi 107# @FUNCTION: multilib_foreach_abi
95# @USAGE: <argv>... 108# @USAGE: <argv>...
96# @DESCRIPTION: 109# @DESCRIPTION:
97# If multilib support is enabled, sets the toolchain up for each 110# If multilib support is enabled, sets the toolchain up for each
98# supported ABI along with the ABI variable and correct BUILD_DIR, 111# supported ABI along with the ABI variable and correct BUILD_DIR,
99# and runs the given commands with them. 112# and runs the given commands with them.
100# 113#
101# If multilib support is disabled, it just runs the commands. No setup 114# If multilib support is disabled, it just runs the commands. No setup
102# is done. 115# is done.
103multilib_foreach_abi() { 116multilib_foreach_abi() {
104 local initial_dir=${BUILD_DIR:-${S}} 117 debug-print-function ${FUNCNAME} "${@}"
105 118
106 local abis=( $(multilib_get_enabled_abis) ) 119 local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abis) )
107 local ABI 120 multibuild_foreach_variant _multilib_multibuild_wrapper "${@}"
108 for ABI in "${abis[@]}"; do
109 multilib_toolchain_setup "${ABI}"
110 BUILD_DIR=${initial_dir%%/}-${ABI} "${@}"
111 done
112} 121}
113 122
114# @FUNCTION: multilib_parallel_foreach_abi 123# @FUNCTION: multilib_parallel_foreach_abi
115# @USAGE: <argv>... 124# @USAGE: <argv>...
116# @DESCRIPTION: 125# @DESCRIPTION:
122# If multilib support is disabled, it just runs the commands. No setup 131# If multilib support is disabled, it just runs the commands. No setup
123# is done. 132# is done.
124# 133#
125# Useful for running configure scripts. 134# Useful for running configure scripts.
126multilib_parallel_foreach_abi() { 135multilib_parallel_foreach_abi() {
127 local initial_dir=${BUILD_DIR:-${S}} 136 debug-print-function ${FUNCNAME} "${@}"
128 137
129 multijob_init
130
131 local abis=( $(multilib_get_enabled_abis) ) 138 local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abis) )
132 local ABI 139 multibuild_parallel_foreach_variant _multilib_multibuild_wrapper "${@}"
133 for ABI in "${abis[@]}"; do
134 (
135 multijob_child_init
136
137 multilib_toolchain_setup "${ABI}"
138 BUILD_DIR=${initial_dir%%/}-${ABI}
139 "${@}"
140 ) &
141
142 multijob_post_fork
143 done
144
145 multijob_finish
146} 140}
147 141
148# @FUNCTION: multilib_check_headers 142# @FUNCTION: multilib_check_headers
149# @DESCRIPTION: 143# @DESCRIPTION:
150# Check whether the header files are consistent between ABIs. 144# Check whether the header files are consistent between ABIs.

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20