/[gentoo-x86]/eclass/autotools-multilib.eclass
Gentoo

Contents of /eclass/autotools-multilib.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.19 - (hide annotations) (download)
Sun Nov 24 10:53:43 2013 UTC (9 months, 1 week ago) by mgorny
Branch: MAIN
Changes since 1.18: +4 -1 lines
Support in-source builds.

1 mgorny 1.3 # Copyright 1999-2013 Gentoo Foundation
2 mgorny 1.1 # Distributed under the terms of the GNU General Public License v2
3 mgorny 1.19 # $Header: /var/cvsroot/gentoo-x86/eclass/autotools-multilib.eclass,v 1.18 2013/11/24 10:25:52 mgorny Exp $
4 mgorny 1.1
5     # @ECLASS: autotools-multilib.eclass
6     # @MAINTAINER:
7     # Michał Górny <mgorny@gentoo.org>
8     # @BLURB: autotools-utils wrapper for multilib builds
9     # @DESCRIPTION:
10     # The autotools-multilib.eclass is an autotools-utils.eclass(5) wrapper
11     # introducing support for building for more than one ABI (multilib).
12     #
13 mgorny 1.11 # Inheriting this eclass sets the USE flags and exports autotools-utils
14 mgorny 1.1 # phase function wrappers which build the package for each supported ABI
15 mgorny 1.11 # when the relevant flag is enabled. Other than that, it works like
16     # regular autotools-utils.
17 mgorny 1.1 #
18 mgorny 1.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.
21     #
22 mgorny 1.1 # Note that the multilib support requires out-of-source builds to be
23     # enabled. Thus, it is impossible to use AUTOTOOLS_IN_SOURCE_BUILD with
24     # it.
25    
26 mgorny 1.16 # EAPI=4 is required for meaningful MULTILIB_USEDEP.
27 mgorny 1.1 case ${EAPI:-0} in
28 mgorny 1.16 4|5) ;;
29 mgorny 1.1 *) die "EAPI=${EAPI} is not supported" ;;
30     esac
31    
32     if [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
33     die "${ECLASS}: multilib support requires out-of-source builds."
34     fi
35    
36 mgorny 1.18 inherit autotools-utils eutils multilib-build multilib-minimal
37 mgorny 1.1
38 mgorny 1.12 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
39    
40 mgorny 1.18 # 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.
50    
51 mgorny 1.12 autotools-multilib_src_prepare() {
52     autotools-utils_src_prepare "${@}"
53 mgorny 1.19
54     [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]] && multilib_copy_sources
55 mgorny 1.12 }
56 mgorny 1.1
57 mgorny 1.18 multilib_src_configure() {
58 mgorny 1.19 [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]] && local ECONF_SOURCE=${BUILD_DIR}
59 mgorny 1.18 autotools-utils_src_configure "${_at_args[@]}"
60     }
61    
62 mgorny 1.1 autotools-multilib_src_configure() {
63 mgorny 1.18 local _at_args=( "${@}" )
64    
65     multilib-minimal_src_configure
66     }
67    
68     multilib_src_compile() {
69     emake "${_at_args[@]}"
70 mgorny 1.1 }
71    
72     autotools-multilib_src_compile() {
73 mgorny 1.18 local _at_args=( "${@}" )
74    
75     multilib-minimal_src_compile
76     }
77    
78     multilib_src_test() {
79     autotools-utils_src_test "${_at_args[@]}"
80 mgorny 1.1 }
81    
82     autotools-multilib_src_test() {
83 mgorny 1.18 local _at_args=( "${@}" )
84    
85     multilib-minimal_src_test
86 mgorny 1.1 }
87    
88 mgorny 1.18 multilib_src_install() {
89     emake DESTDIR="${D}" "${_at_args[@]}" install
90     }
91    
92     multilib_src_install_all() {
93     einstalldocs
94 mgorny 1.8
95 mgorny 1.18 # Remove libtool files and unnecessary static libs
96     local prune_ltfiles=${AUTOTOOLS_PRUNE_LIBTOOL_FILES}
97     if [[ ${prune_ltfiles} != none ]]; then
98     prune_libtool_files ${prune_ltfiles:+--${prune_ltfiles}}
99     fi
100     }
101 mgorny 1.8
102 mgorny 1.18 autotools-multilib_src_install() {
103     local _at_args=( "${@}" )
104 mgorny 1.13
105 mgorny 1.18 multilib-minimal_src_install
106 mgorny 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20