/[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.6 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.6 2013/02/27 23:23:11 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.
79 fi 79 fi
80 done 80 done
81 done 81 done
82 82
83 if [[ ! ${found} ]]; then 83 if [[ ! ${found} ]]; then
84 # ${ABI} can be used to override the fallback (multilib-portage),
85 # ${DEFAULT_ABI} is the safe fallback.
86 local abi=${ABI:-${DEFAULT_ABI}}
87
84 debug-print "${FUNCNAME}: no ABIs enabled, fallback to ${DEFAULT_ABI}" 88 debug-print "${FUNCNAME}: no ABIs enabled, fallback to ${abi}"
85 echo ${DEFAULT_ABI} 89 debug-print "${FUNCNAME}: ABI=${ABI}, DEFAULT_ABI=${DEFAULT_ABI}"
90 echo ${abi}
86 fi 91 fi
92}
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 "${@}"
87} 105}
88 106
89# @FUNCTION: multilib_foreach_abi 107# @FUNCTION: multilib_foreach_abi
90# @USAGE: <argv>... 108# @USAGE: <argv>...
91# @DESCRIPTION: 109# @DESCRIPTION:
94# and runs the given commands with them. 112# and runs the given commands with them.
95# 113#
96# 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
97# is done. 115# is done.
98multilib_foreach_abi() { 116multilib_foreach_abi() {
99 local initial_dir=${BUILD_DIR:-${S}} 117 debug-print-function ${FUNCNAME} "${@}"
100 118
101 local ABI 119 local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abis) )
102 for ABI in $(multilib_get_enabled_abis); do 120 multibuild_foreach_variant _multilib_multibuild_wrapper "${@}"
103 multilib_toolchain_setup "${ABI}"
104 BUILD_DIR=${initial_dir%%/}-${ABI} "${@}"
105 done
106} 121}
107 122
108# @FUNCTION: multilib_parallel_foreach_abi 123# @FUNCTION: multilib_parallel_foreach_abi
109# @USAGE: <argv>... 124# @USAGE: <argv>...
110# @DESCRIPTION: 125# @DESCRIPTION:
116# 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
117# is done. 132# is done.
118# 133#
119# Useful for running configure scripts. 134# Useful for running configure scripts.
120multilib_parallel_foreach_abi() { 135multilib_parallel_foreach_abi() {
121 local initial_dir=${BUILD_DIR:-${S}} 136 debug-print-function ${FUNCNAME} "${@}"
122 137
123 multijob_init 138 local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abis) )
124 139 multibuild_parallel_foreach_variant _multilib_multibuild_wrapper "${@}"
125 local ABI
126 for ABI in $(multilib_get_enabled_abis); do
127 (
128 multijob_child_init
129
130 multilib_toolchain_setup "${ABI}"
131 BUILD_DIR=${initial_dir%%/}-${ABI}
132 "${@}"
133 ) &
134
135 multijob_post_fork
136 done
137
138 multijob_finish
139} 140}
140 141
141# @FUNCTION: multilib_check_headers 142# @FUNCTION: multilib_check_headers
142# @DESCRIPTION: 143# @DESCRIPTION:
143# Check whether the header files are consistent between ABIs. 144# Check whether the header files are consistent between ABIs.

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

  ViewVC Help
Powered by ViewVC 1.1.20