/[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.14 Revision 1.56
1# Copyright 1999-2013 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.14 2013/06/28 02:37:52 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.56 2014/06/08 13:57:02 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>
8# @AUTHOR:
7# Michał Górny <mgorny@gentoo.org> 9# Author: Michał Górny <mgorny@gentoo.org>
8# @BLURB: flags and utility functions for building multilib packages 10# @BLURB: flags and utility functions for building multilib packages
9# @DESCRIPTION: 11# @DESCRIPTION:
10# The multilib-build.eclass exports USE flags and utility functions 12# The multilib-build.eclass exports USE flags and utility functions
11# necessary to build packages for multilib in a clean and uniform 13# necessary to build packages for multilib in a clean and uniform
12# manner. 14# manner.
26inherit multibuild multilib 28inherit multibuild multilib
27 29
28# @ECLASS-VARIABLE: _MULTILIB_FLAGS 30# @ECLASS-VARIABLE: _MULTILIB_FLAGS
29# @INTERNAL 31# @INTERNAL
30# @DESCRIPTION: 32# @DESCRIPTION:
31# The list of multilib flags and corresponding ABI values. 33# The list of multilib flags and corresponding ABI values. If the same
34# flag is reused for multiple ABIs (e.g. x86 on Linux&FreeBSD), multiple
35# ABIs may be separated by commas.
36#
37# Please contact multilib before modifying this list. This way we can
38# ensure that every *preliminary* work is done and the multilib can be
39# extended safely.
32_MULTILIB_FLAGS=( 40_MULTILIB_FLAGS=(
33 abi_x86_32:x86 41 abi_x86_32:x86,x86_fbsd
34 abi_x86_64:amd64 42 abi_x86_64:amd64,amd64_fbsd
35 abi_x86_x32:x32 43 abi_x86_x32:x32
44 abi_mips_n32:n32
45 abi_mips_n64:n64
46 abi_mips_o32:o32
36) 47)
48
49# @ECLASS-VARIABLE: MULTILIB_COMPAT
50# @DEFAULT_UNSET
51# @DESCRIPTION:
52# List of multilib ABIs supported by the ebuild. If unset, defaults to
53# all ABIs supported by the eclass.
54#
55# This variable is intended for use in prebuilt multilib packages that
56# can provide binaries only for a limited set of ABIs. If ABIs need to
57# be limited due to a bug in source code, package.use.mask is
58# recommended instead.
59#
60# Example use:
61# @CODE
62# # Upstream provides binaries for x86 & amd64 only
63# MULTILIB_COMPAT=( abi_x86_{32,64} )
64# @CODE
37 65
38# @ECLASS-VARIABLE: MULTILIB_USEDEP 66# @ECLASS-VARIABLE: MULTILIB_USEDEP
39# @DESCRIPTION: 67# @DESCRIPTION:
40# The USE-dependency to be used on dependencies (libraries) needing 68# The USE-dependency to be used on dependencies (libraries) needing
41# to support multilib as well. 69# to support multilib as well.
44# @CODE 72# @CODE
45# RDEPEND="dev-libs/libfoo[${MULTILIB_USEDEP}] 73# RDEPEND="dev-libs/libfoo[${MULTILIB_USEDEP}]
46# net-libs/libbar[ssl,${MULTILIB_USEDEP}]" 74# net-libs/libbar[ssl,${MULTILIB_USEDEP}]"
47# @CODE 75# @CODE
48 76
77# @ECLASS-VARIABLE: MULTILIB_ABI_FLAG
78# @DEFAULT_UNSET
79# @DESCRIPTION:
80# The complete ABI name. Resembles the USE flag name.
81#
82# This is set within multilib_foreach_abi(),
83# multilib_parallel_foreach_abi() and multilib-minimal sub-phase
84# functions.
85#
86# It may be null (empty) when the build is done on ABI not controlled
87# by a USE flag (e.g. on non-multilib arch or when using multilib
88# portage). The build will always be done for a single ABI then.
89#
90# Example value:
91# @CODE
92# abi_x86_64
93# @CODE
94
49_multilib_build_set_globals() { 95_multilib_build_set_globals() {
50 local flags=( "${_MULTILIB_FLAGS[@]%:*}" ) 96 local flags=( "${_MULTILIB_FLAGS[@]%:*}" )
97
98 if [[ ${MULTILIB_COMPAT[@]} ]]; then
99 # Validate MULTILIB_COMPAT and filter out the flags.
100 local f
101 for f in "${MULTILIB_COMPAT[@]}"; do
102 if ! has "${f}" "${flags[@]}"; then
103 die "Invalid value in MULTILIB_COMPAT: ${f}"
104 fi
105 done
106
107 flags=( "${MULTILIB_COMPAT[@]}" )
108 fi
109
51 local usedeps=${flags[@]/%/(-)?} 110 local usedeps=${flags[@]/%/(-)?}
52 111
53 IUSE=${flags[*]} 112 IUSE=${flags[*]}
54 MULTILIB_USEDEP=${usedeps// /,} 113 MULTILIB_USEDEP=${usedeps// /,}
55} 114}
63# If multilib is disabled, the default ABI will be returned 122# If multilib is disabled, the default ABI will be returned
64# in order to enforce consistent testing with multilib code. 123# in order to enforce consistent testing with multilib code.
65multilib_get_enabled_abis() { 124multilib_get_enabled_abis() {
66 debug-print-function ${FUNCNAME} "${@}" 125 debug-print-function ${FUNCNAME} "${@}"
67 126
127 local pairs=( $(multilib_get_enabled_abi_pairs) )
128 echo "${pairs[@]#*.}"
129}
130
131# @FUNCTION: multilib_get_enabled_abi_pairs
132# @DESCRIPTION:
133# Return the ordered list of enabled <use-flag>.<ABI> pairs
134# if multilib builds are enabled. The best (most preferred)
135# ABI will come last.
136#
137# If multilib is disabled, the default ABI will be returned
138# along with empty <use-flag>.
139multilib_get_enabled_abi_pairs() {
140 debug-print-function ${FUNCNAME} "${@}"
141
68 local abis=( $(get_all_abis) ) 142 local abis=( $(get_all_abis) )
69 143
70 local abi i found 144 local abi i found
71 for abi in "${abis[@]}"; do 145 for abi in "${abis[@]}"; do
72 for i in "${_MULTILIB_FLAGS[@]}"; do 146 for i in "${_MULTILIB_FLAGS[@]}"; do
73 local m_abi=${i#*:} 147 local m_abis=${i#*:} m_abi
74 local m_flag=${i%:*} 148 local m_flag=${i%:*}
75 149
150 # split on ,; we can't switch IFS for function scope because
151 # paludis is broken (bug #486592), and switching it locally
152 # for the split is more complex than cheating like this
153 for m_abi in ${m_abis//,/ }; do
76 if [[ ${m_abi} == ${abi} ]] && use "${m_flag}"; then 154 if [[ ${m_abi} == ${abi} ]] && use "${m_flag}"; then
77 echo "${abi}" 155 echo "${m_flag}.${abi}"
78 found=1 156 found=1
157 break 2
79 fi 158 fi
159 done
80 done 160 done
81 done 161 done
82 162
83 if [[ ! ${found} ]]; then 163 if [[ ! ${found} ]]; then
84 # ${ABI} can be used to override the fallback (multilib-portage), 164 # ${ABI} can be used to override the fallback (multilib-portage),
85 # ${DEFAULT_ABI} is the safe fallback. 165 # ${DEFAULT_ABI} is the safe fallback.
86 local abi=${ABI:-${DEFAULT_ABI}} 166 local abi=${ABI:-${DEFAULT_ABI}}
87 167
88 debug-print "${FUNCNAME}: no ABIs enabled, fallback to ${abi}" 168 debug-print "${FUNCNAME}: no ABIs enabled, fallback to ${abi}"
89 debug-print "${FUNCNAME}: ABI=${ABI}, DEFAULT_ABI=${DEFAULT_ABI}" 169 debug-print "${FUNCNAME}: ABI=${ABI}, DEFAULT_ABI=${DEFAULT_ABI}"
90 echo ${abi} 170 echo ".${abi}"
91 fi 171 fi
92} 172}
93 173
94# @FUNCTION: _multilib_multibuild_wrapper 174# @FUNCTION: _multilib_multibuild_wrapper
95# @USAGE: <argv>... 175# @USAGE: <argv>...
97# @DESCRIPTION: 177# @DESCRIPTION:
98# Initialize the environment for ABI selected for multibuild. 178# Initialize the environment for ABI selected for multibuild.
99_multilib_multibuild_wrapper() { 179_multilib_multibuild_wrapper() {
100 debug-print-function ${FUNCNAME} "${@}" 180 debug-print-function ${FUNCNAME} "${@}"
101 181
102 local ABI=${MULTIBUILD_VARIANT} 182 local ABI=${MULTIBUILD_VARIANT#*.}
183 local MULTILIB_ABI_FLAG=${MULTIBUILD_VARIANT%.*}
184
103 multilib_toolchain_setup "${ABI}" 185 multilib_toolchain_setup "${ABI}"
104 "${@}" 186 "${@}"
105} 187}
106 188
107# @FUNCTION: multilib_foreach_abi 189# @FUNCTION: multilib_foreach_abi
114# If multilib support is disabled, it just runs the commands. No setup 196# If multilib support is disabled, it just runs the commands. No setup
115# is done. 197# is done.
116multilib_foreach_abi() { 198multilib_foreach_abi() {
117 debug-print-function ${FUNCNAME} "${@}" 199 debug-print-function ${FUNCNAME} "${@}"
118 200
119 local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abis) ) 201 local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abi_pairs) )
120 multibuild_foreach_variant _multilib_multibuild_wrapper "${@}" 202 multibuild_foreach_variant _multilib_multibuild_wrapper "${@}"
121} 203}
122 204
123# @FUNCTION: multilib_parallel_foreach_abi 205# @FUNCTION: multilib_parallel_foreach_abi
124# @USAGE: <argv>... 206# @USAGE: <argv>...
133# 215#
134# Useful for running configure scripts. 216# Useful for running configure scripts.
135multilib_parallel_foreach_abi() { 217multilib_parallel_foreach_abi() {
136 debug-print-function ${FUNCNAME} "${@}" 218 debug-print-function ${FUNCNAME} "${@}"
137 219
138 local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abis) ) 220 local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abi_pairs) )
139 multibuild_parallel_foreach_variant _multilib_multibuild_wrapper "${@}" 221 multibuild_parallel_foreach_variant _multilib_multibuild_wrapper "${@}"
140} 222}
141 223
142# @FUNCTION: multilib_for_best_abi 224# @FUNCTION: multilib_for_best_abi
143# @USAGE: <argv>... 225# @USAGE: <argv>...
144# @DESCRIPTION: 226# @DESCRIPTION:
145# Runs the given command with setup for the 'best' (usually native) ABI. 227# Runs the given command with setup for the 'best' (usually native) ABI.
146multilib_for_best_abi() { 228multilib_for_best_abi() {
147 debug-print-function ${FUNCNAME} "${@}" 229 debug-print-function ${FUNCNAME} "${@}"
148 230
231 eqawarn "QA warning: multilib_for_best_abi() function is deprecated and should"
232 eqawarn "not be used. The multilib_is_native_abi() check may be used instead."
233
149 local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abis) ) 234 local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abi_pairs) )
150 235
151 multibuild_for_best_variant _multilib_multibuild_wrapper "${@}" 236 multibuild_for_best_variant _multilib_multibuild_wrapper "${@}"
152} 237}
153 238
154# @FUNCTION: multilib_check_headers 239# @FUNCTION: multilib_check_headers
198# to ABI-specific build directory matching BUILD_DIR used by 283# to ABI-specific build directory matching BUILD_DIR used by
199# multilib_foreach_abi(). 284# multilib_foreach_abi().
200multilib_copy_sources() { 285multilib_copy_sources() {
201 debug-print-function ${FUNCNAME} "${@}" 286 debug-print-function ${FUNCNAME} "${@}"
202 287
203 local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abis) ) 288 local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abi_pairs) )
204 multibuild_copy_sources 289 multibuild_copy_sources
205} 290}
206 291
207# @ECLASS-VARIABLE: MULTILIB_WRAPPED_HEADERS 292# @ECLASS-VARIABLE: MULTILIB_WRAPPED_HEADERS
208# @DESCRIPTION: 293# @DESCRIPTION:
224# MULTILIB_WRAPPED_HEADERS=( 309# MULTILIB_WRAPPED_HEADERS=(
225# /usr/include/foobar/config.h 310# /usr/include/foobar/config.h
226# ) 311# )
227# @CODE 312# @CODE
228 313
314# @ECLASS-VARIABLE: MULTILIB_CHOST_TOOLS
315# @DESCRIPTION:
316# A list of tool executables to preserve for each multilib ABI.
317# The listed executables will be renamed to ${CHOST}-${basename},
318# and the native variant will be symlinked to the generic name.
319#
320# This variable has to be a bash array. Paths shall be relative to
321# installation root (${ED}), and name regular files or symbolic
322# links to regular files. Recursive wrapping is not supported.
323#
324# If symbolic link is passed, both symlink path and symlink target
325# will be changed. As a result, the symlink target is expected
326# to be wrapped as well (either by listing in MULTILIB_CHOST_TOOLS
327# or externally).
328#
329# Please note that tool wrapping is *discouraged*. It is preferred to
330# install pkg-config files for each ABI, and require reverse
331# dependencies to use that.
332#
333# Packages that search for tools properly (e.g. using AC_PATH_TOOL
334# macro) will find the wrapper executables automatically. Other packages
335# will need explicit override of tool paths.
336#
337# Example:
338# @CODE
339# MULTILIB_CHOST_TOOLS=(
340# /usr/bin/foo-config
341# )
342
343# @CODE
229# @FUNCTION: multilib_prepare_wrappers 344# @FUNCTION: multilib_prepare_wrappers
230# @USAGE: [<install-root>] 345# @USAGE: [<install-root>]
231# @DESCRIPTION: 346# @DESCRIPTION:
232# Perform the preparation of all kinds of wrappers for the current ABI. 347# Perform the preparation of all kinds of wrappers for the current ABI.
233# This function shall be called once per each ABI, after installing 348# This function shall be called once per each ABI, after installing
249 [[ ${#} -le 1 ]] || die "${FUNCNAME}: too many arguments" 364 [[ ${#} -le 1 ]] || die "${FUNCNAME}: too many arguments"
250 365
251 local root=${1:-${ED}} 366 local root=${1:-${ED}}
252 local f 367 local f
253 368
369 if [[ ${COMPLETE_MULTILIB} == yes ]]; then
370 # symlink '${CHOST}-foo -> foo' to support abi-wrapper while
371 # keeping ${CHOST}-foo calls correct.
372
373 for f in "${MULTILIB_CHOST_TOOLS[@]}"; do
374 # drop leading slash if it's there
375 f=${f#/}
376
377 local dir=${f%/*}
378 local fn=${f##*/}
379
380 ln -s "${fn}" "${root}/${dir}/${CHOST}-${fn}" || die
381 done
382
383 return
384 fi
385
254 for f in "${MULTILIB_WRAPPED_HEADERS[@]}"; do 386 for f in "${MULTILIB_CHOST_TOOLS[@]}"; do
255 # drop leading slash if it's there 387 # drop leading slash if it's there
256 f=${f#/} 388 f=${f#/}
257 389
258 if [[ ${f} != usr/include/* ]]; then 390 local dir=${f%/*}
259 die "Wrapping headers outside of /usr/include is not supported at the moment." 391 local fn=${f##*/}
392
393 if [[ -L ${root}/${f} ]]; then
394 # rewrite the symlink target
395 local target=$(readlink "${root}/${f}")
396 local target_dir
397 local target_fn=${target##*/}
398
399 [[ ${target} == */* ]] && target_dir=${target%/*}
400
401 ln -f -s "${target_dir+${target_dir}/}${CHOST}-${target_fn}" \
402 "${root}/${f}" || die
260 fi 403 fi
404
405 mv "${root}/${f}" "${root}/${dir}/${CHOST}-${fn}" || die
406
407 # symlink the native one back
408 if multilib_is_native_abi; then
409 ln -s "${CHOST}-${fn}" "${root}/${f}" || die
410 fi
411 done
412
413 if [[ ${MULTILIB_WRAPPED_HEADERS[@]} ]]; then
414 # If abi_flag is unset, then header wrapping is unsupported on
415 # this ABI. This means the arch doesn't support multilib at all
416 # -- in this case, the headers are not wrapped and everything
417 # works as expected.
418
419 if [[ ${MULTILIB_ABI_FLAG} ]]; then
420 for f in "${MULTILIB_WRAPPED_HEADERS[@]}"; do
421 # drop leading slash if it's there
422 f=${f#/}
423
424 if [[ ${f} != usr/include/* ]]; then
425 die "Wrapping headers outside of /usr/include is not supported at the moment."
426 fi
261 # and then usr/include 427 # and then usr/include
262 f=${f#usr/include} 428 f=${f#usr/include}
263 429
264 local dir=${f%/*} 430 local dir=${f%/*}
265 431
266 # $CHOST shall be set by multilib_toolchain_setup 432 # Some ABIs may have install less files than others.
267 dodir "/tmp/multilib-include/${CHOST}${dir}" 433 if [[ -f ${root}/usr/include${f} ]]; then
268 mv "${root}/usr/include${f}" "${ED}/tmp/multilib-include/${CHOST}${dir}/" || die 434 local wrapper=${ED}/tmp/multilib-include${f}
269 435
270 if [[ ! -f ${ED}/tmp/multilib-include${f} ]]; then 436 if [[ ! -f ${ED}/tmp/multilib-include${f} ]]; then
271 dodir "/tmp/multilib-include${dir}" 437 dodir "/tmp/multilib-include${dir}"
272 # a generic template 438 # a generic template
273 cat > "${ED}/tmp/multilib-include${f}" <<_EOF_ 439 cat > "${wrapper}" <<_EOF_
274/* This file is auto-generated by multilib-build.eclass 440/* This file is auto-generated by multilib-build.eclass
275 * as a multilib-friendly wrapper. For the original content, 441 * as a multilib-friendly wrapper. For the original content,
276 * please see the files that are #included below. 442 * please see the files that are #included below.
277 */ 443 */
278 444
282# else /* 64-bit ABI */ 448# else /* 64-bit ABI */
283# error "abi_x86_64 not supported by the package." 449# error "abi_x86_64 not supported by the package."
284# endif 450# endif
285#elif defined(__i386__) /* plain x86 */ 451#elif defined(__i386__) /* plain x86 */
286# error "abi_x86_32 not supported by the package." 452# error "abi_x86_32 not supported by the package."
453#elif defined(__mips__)
454# if(_MIPS_SIM == _ABIN32) /* n32 */
455# error "abi_mips_n32 not supported by the package."
456# elif(_MIPS_SIM == _ABI64) /* n64 */
457# error "abi_mips_n64 not supported by the package."
458# elif(_MIPS_SIM == _ABIO32) /* o32 */
459# error "abi_mips_o32 not supported by the package."
460# endif
461#elif defined(__sparc__)
462# if defined(__arch64__)
463# error "abi_sparc_64 not supported by the package."
464# else
465# error "abi_sparc_32 not supported by the package."
466# endif
467#elif defined(__s390__)
468# if defined(__s390x__)
469# error "abi_s390_64 not supported by the package."
470# else
471# error "abi_s390_32 not supported by the package."
472# endif
473#elif defined(__powerpc__)
474# if defined(__powerpc64__)
475# error "abi_ppc_64 not supported by the package."
476# else
477# error "abi_ppc_32 not supported by the package."
478# endif
479#elif defined(SWIG) /* https://sourceforge.net/p/swig/bugs/799/ */
480# error "Native ABI not supported by the package."
287#else 481#else
288# error "No ABI matched, please report a bug to bugs.gentoo.org" 482# error "No ABI matched, please report a bug to bugs.gentoo.org"
289#endif 483#endif
290_EOF_ 484_EOF_
485 fi
486
487 if ! grep -q "${MULTILIB_ABI_FLAG} " "${wrapper}"
488 then
489 die "Flag ${MULTILIB_ABI_FLAG} not listed in wrapper template. Please report a bug to https://bugs.gentoo.org."
490 fi
491
492 # $CHOST shall be set by multilib_toolchain_setup
493 dodir "/tmp/multilib-include/${CHOST}${dir}"
494 mv "${root}/usr/include${f}" "${ED}/tmp/multilib-include/${CHOST}${dir}/" || die
495
496 # Note: match a space afterwards to avoid collision potential.
497 sed -e "/${MULTILIB_ABI_FLAG} /s&error.*&include <${CHOST}${f}>&" \
498 -i "${wrapper}" || die
499
500 # Hack for emul-linux-x86 compatibility.
501 # It assumes amd64 will come after x86, and will use amd64
502 # headers if no specific x86 headers were installed.
503 if [[ ${ABI} == amd64 ]]; then
504 sed -e "/abi_x86_32 /s&error.*&include <${CHOST}${f}>&" \
505 -i "${wrapper}" || die
506 fi
507
508 # Needed for swig.
509 if multilib_is_native_abi; then
510 sed -e "/Native ABI/s&error.*&include <${CHOST}${f}>&" \
511 -i "${wrapper}" || die
512 fi
513 fi
514 done
291 fi 515 fi
292 516 fi
293 # XXX: get abi_* directly
294 local abi_flag
295 case "${ABI}" in
296 amd64)
297 abi_flag=abi_x86_64;;
298 x86)
299 abi_flag=abi_x86_32;;
300 x32)
301 abi_flag=abi_x86_x32;;
302 *)
303 die "Header wrapping for ${ABI} not supported yet";;
304 esac
305
306 # Note: match a space afterwards to avoid collision potential.
307 sed -e "/${abi_flag} /s&error.*&include <${CHOST}${f}>&" \
308 -i "${ED}/tmp/multilib-include${f}" || die
309 done
310} 517}
311 518
312# @FUNCTION: multilib_install_wrappers 519# @FUNCTION: multilib_install_wrappers
313# @USAGE: [<install-root>] 520# @USAGE: [<install-root>]
314# @DESCRIPTION: 521# @DESCRIPTION:
326multilib_install_wrappers() { 533multilib_install_wrappers() {
327 debug-print-function ${FUNCNAME} "${@}" 534 debug-print-function ${FUNCNAME} "${@}"
328 535
329 [[ ${#} -le 1 ]] || die "${FUNCNAME}: too many arguments" 536 [[ ${#} -le 1 ]] || die "${FUNCNAME}: too many arguments"
330 537
538 [[ ${COMPLETE_MULTILIB} == yes ]] && return
539
331 local root=${1:-${ED}} 540 local root=${1:-${ED}}
332 541
333 if [[ -d "${ED}"/tmp/multilib-include ]]; then 542 if [[ -d "${ED}"/tmp/multilib-include ]]; then
334 multibuild_merge_root \ 543 multibuild_merge_root \
335 "${ED}"/tmp/multilib-include "${root}"/usr/include 544 "${ED}"/tmp/multilib-include "${root}"/usr/include
336 # it can fail if something else uses /tmp 545 # it can fail if something else uses /tmp
337 rmdir "${ED}"/tmp &>/dev/null 546 rmdir "${ED}"/tmp &>/dev/null
338 fi 547 fi
339} 548}
340 549
550# @FUNCTION: multilib_is_native_abi
551# @DESCRIPTION:
552# Determine whether the currently built ABI is the profile native.
553# Return true status (0) if that is true, otherwise false (1).
554#
555# This function is not intended to be used directly. Please use
556# multilib_build_binaries instead.
557multilib_is_native_abi() {
558 debug-print-function ${FUNCNAME} "${@}"
559
560 [[ ${#} -eq 0 ]] || die "${FUNCNAME}: too many arguments"
561
562 [[ ${COMPLETE_MULTILIB} == yes || ${ABI} == ${DEFAULT_ABI} ]]
563}
564
565# @FUNCTION: multilib_build_binaries
566# @DESCRIPTION:
567# Determine whether to build binaries for the currently built ABI.
568# Returns true status (0) if the currently built ABI is the profile
569# native or COMPLETE_MULTILIB variable is set to 'yes', otherwise
570# false (1).
571#
572# This is often useful for configure calls when some of the options are
573# supposed to be disabled for multilib ABIs (like those used for
574# executables only).
575multilib_build_binaries() {
576 debug-print-function ${FUNCNAME} "${@}"
577
578 eqawarn "QA warning: multilib_build_binaries is deprecated. Please use the equivalent"
579 eqawarn "multilib_is_native_abi function instead."
580
581 multilib_is_native_abi "${@}"
582}
583
584# @FUNCTION: multilib_native_use_with
585# @USAGE: <flag> [<opt-name> [<opt-value>]]
586# @DESCRIPTION:
587# Output --with configure option alike use_with if USE <flag> is enabled
588# and executables are being built (multilib_is_native_abi is true).
589# Otherwise, outputs --without configure option. Arguments are the same
590# as for use_with in the EAPI.
591multilib_native_use_with() {
592 if multilib_is_native_abi; then
593 use_with "${@}"
594 else
595 echo "--without-${2:-${1}}"
596 fi
597}
598
599# @FUNCTION: multilib_native_use_enable
600# @USAGE: <flag> [<opt-name> [<opt-value>]]
601# @DESCRIPTION:
602# Output --enable configure option alike use_with if USE <flag>
603# is enabled and executables are being built (multilib_is_native_abi
604# is true). Otherwise, outputs --disable configure option. Arguments are
605# the same as for use_enable in the EAPI.
606multilib_native_use_enable() {
607 if multilib_is_native_abi; then
608 use_enable "${@}"
609 else
610 echo "--disable-${2:-${1}}"
611 fi
612}
613
614# @FUNCTION: multilib_native_usex
615# @USAGE: <flag> [<true1> [<false1> [<true2> [<false2>]]]]
616# @DESCRIPTION:
617# Output the concatenation of <true1> (or 'yes' if unspecified)
618# and <true2> if USE <flag> is enabled and executables are being built
619# (multilib_is_native_abi is true). Otherwise, output the concatenation
620# of <false1> (or 'no' if unspecified) and <false2>. Arguments
621# are the same as for usex in the EAPI.
622#
623# Note: in EAPI 4 you need to inherit eutils to use this function.
624multilib_native_usex() {
625 if multilib_is_native_abi; then
626 usex "${@}"
627 else
628 echo "${3-no}${5}"
629 fi
630}
631
341_MULTILIB_BUILD=1 632_MULTILIB_BUILD=1
342fi 633fi

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.56

  ViewVC Help
Powered by ViewVC 1.1.20