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

Contents of /eclass/autotools-multilib.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.20 - (show annotations) (download)
Wed Jan 15 12:12:41 2014 UTC (7 months, 1 week ago) by mgorny
Branch: MAIN
Changes since 1.19: +2 -6 lines
Actually enable in-source build support.

1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/autotools-multilib.eclass,v 1.19 2013/11/24 10:53:43 mgorny Exp $
4
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 # Inheriting this eclass sets the USE flags and exports autotools-utils
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
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.
21 #
22 # 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 # EAPI=4 is required for meaningful MULTILIB_USEDEP.
27 case ${EAPI:-0} in
28 4|5) ;;
29 *) die "EAPI=${EAPI} is not supported" ;;
30 esac
31
32 inherit autotools-utils eutils multilib-build multilib-minimal
33
34 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
35
36 # bug #485046
37 _autotools-multilib_fix_multilib_minimal() {
38 src_conf=$(declare -f multilib-minimal_src_configure)
39 src_conf=${src_conf/multilib_foreach_abi/multilib_parallel_foreach_abi}
40 eval "${src_conf}"
41 }
42 _autotools-multilib_fix_multilib_minimal
43
44 # Note: _at_args[@] passing is a backwards compatibility measure.
45 # Don't use it in new packages.
46
47 autotools-multilib_src_prepare() {
48 autotools-utils_src_prepare "${@}"
49
50 [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]] && multilib_copy_sources
51 }
52
53 multilib_src_configure() {
54 [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]] && local ECONF_SOURCE=${BUILD_DIR}
55 autotools-utils_src_configure "${_at_args[@]}"
56 }
57
58 autotools-multilib_src_configure() {
59 local _at_args=( "${@}" )
60
61 multilib-minimal_src_configure
62 }
63
64 multilib_src_compile() {
65 emake "${_at_args[@]}"
66 }
67
68 autotools-multilib_src_compile() {
69 local _at_args=( "${@}" )
70
71 multilib-minimal_src_compile
72 }
73
74 multilib_src_test() {
75 autotools-utils_src_test "${_at_args[@]}"
76 }
77
78 autotools-multilib_src_test() {
79 local _at_args=( "${@}" )
80
81 multilib-minimal_src_test
82 }
83
84 multilib_src_install() {
85 emake DESTDIR="${D}" "${_at_args[@]}" install
86 }
87
88 multilib_src_install_all() {
89 einstalldocs
90
91 # Remove libtool files and unnecessary static libs
92 local prune_ltfiles=${AUTOTOOLS_PRUNE_LIBTOOL_FILES}
93 if [[ ${prune_ltfiles} != none ]]; then
94 prune_libtool_files ${prune_ltfiles:+--${prune_ltfiles}}
95 fi
96 }
97
98 autotools-multilib_src_install() {
99 local _at_args=( "${@}" )
100
101 multilib-minimal_src_install
102 }

  ViewVC Help
Powered by ViewVC 1.1.20