/[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.17 Revision 1.18
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.17 2013/06/28 12:42:48 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-multilib.eclass,v 1.18 2013/11/24 10:25:52 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
12# 12#
13# Inheriting this eclass sets the USE flags 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# when the relevant flag is enabled. Other than that, it works like 15# when the relevant flag is enabled. Other than that, it works like
16# regular autotools-utils. 16# regular autotools-utils.
17#
18# The multilib phase functions can be overriden via defining multilib_*
19# phase functions as in multilib-minimal.eclass. In some cases you may
20# need to call the underlying autotools-utils_* phase though.
17# 21#
18# Note that the multilib support requires out-of-source builds to be 22# 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 23# enabled. Thus, it is impossible to use AUTOTOOLS_IN_SOURCE_BUILD with
20# it. 24# it.
21 25
27 31
28if [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then 32if [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
29 die "${ECLASS}: multilib support requires out-of-source builds." 33 die "${ECLASS}: multilib support requires out-of-source builds."
30fi 34fi
31 35
32inherit autotools-utils multilib-build 36inherit autotools-utils eutils multilib-build multilib-minimal
33 37
34EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install 38EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
39
40# bug #485046
41_autotools-multilib_fix_multilib_minimal() {
42 src_conf=$(declare -f multilib-minimal_src_configure)
43 src_conf=${src_conf/multilib_foreach_abi/multilib_parallel_foreach_abi}
44 eval "${src_conf}"
45}
46_autotools-multilib_fix_multilib_minimal
47
48# Note: _at_args[@] passing is a backwards compatibility measure.
49# Don't use it in new packages.
35 50
36autotools-multilib_src_prepare() { 51autotools-multilib_src_prepare() {
37 autotools-utils_src_prepare "${@}" 52 autotools-utils_src_prepare "${@}"
38} 53}
39 54
55multilib_src_configure() {
56 autotools-utils_src_configure "${_at_args[@]}"
57}
58
40autotools-multilib_src_configure() { 59autotools-multilib_src_configure() {
41 multilib_parallel_foreach_abi autotools-utils_src_configure "${@}" 60 local _at_args=( "${@}" )
61
62 multilib-minimal_src_configure
63}
64
65multilib_src_compile() {
66 emake "${_at_args[@]}"
42} 67}
43 68
44autotools-multilib_src_compile() { 69autotools-multilib_src_compile() {
45 multilib_foreach_abi autotools-utils_src_compile "${@}" 70 local _at_args=( "${@}" )
71
72 multilib-minimal_src_compile
73}
74
75multilib_src_test() {
76 autotools-utils_src_test "${_at_args[@]}"
46} 77}
47 78
48autotools-multilib_src_test() { 79autotools-multilib_src_test() {
49 multilib_foreach_abi autotools-utils_src_test "${@}" 80 local _at_args=( "${@}" )
81
82 multilib-minimal_src_test
83}
84
85multilib_src_install() {
86 emake DESTDIR="${D}" "${_at_args[@]}" install
87}
88
89multilib_src_install_all() {
90 einstalldocs
91
92 # Remove libtool files and unnecessary static libs
93 local prune_ltfiles=${AUTOTOOLS_PRUNE_LIBTOOL_FILES}
94 if [[ ${prune_ltfiles} != none ]]; then
95 prune_libtool_files ${prune_ltfiles:+--${prune_ltfiles}}
96 fi
50} 97}
51 98
52autotools-multilib_src_install() { 99autotools-multilib_src_install() {
53 autotools-multilib_secure_install() { 100 local _at_args=( "${@}" )
54 autotools-utils_src_install "${@}"
55 101
56 # Do multilib magic only when >1 ABI is used. 102 multilib-minimal_src_install
57 if [[ ${#MULTIBUILD_VARIANTS[@]} -gt 1 ]]; then
58 multilib_prepare_wrappers
59 # Make sure all headers are the same for each ABI.
60 multilib_check_headers
61 fi
62 }
63
64 multilib_foreach_abi autotools-multilib_secure_install "${@}"
65
66 # merge the wrappers
67 multilib_install_wrappers
68} 103}

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.20