dev-qt/qttest: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / eclass / autotools-multilib.eclass
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 # @ECLASS: autotools-multilib.eclass
5 # @MAINTAINER:
6 # gx86-multilib team <multilib@gentoo.org>
7 # @AUTHOR:
8 # Author: Michał Górny <mgorny@gentoo.org>
9 # @SUPPORTED_EAPIS: 4 5
10 # @BLURB: autotools-utils wrapper for multilib builds
11 # @DESCRIPTION:
12 # The autotools-multilib.eclass provides a glue between
13 # autotools-utils.eclass(5) and multilib-minimal.eclass(5), aiming
14 # to provide a convenient way to build packages using autotools
15 # for multiple ABIs.
16 #
17 # Inheriting this eclass sets IUSE and exports default multilib_src_*()
18 # sub-phases that call autotools-utils phase functions for each ABI
19 # enabled. The multilib_src_*() functions can be defined in ebuild just
20 # like in multilib-minimal.
21
22 # EAPI=4 is required for meaningful MULTILIB_USEDEP.
23 case ${EAPI:-0} in
24         6) die "${ECLASS}.eclass is banned in EAPI ${EAPI}";;
25         4|5) ;;
26         *) die "EAPI=${EAPI} is not supported" ;;
27 esac
28
29 inherit autotools-utils eutils ltprune multilib-build multilib-minimal
30
31 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
32
33 # Note: _at_args[@] passing is a backwards compatibility measure.
34 # Don't use it in new packages.
35
36 autotools-multilib_src_prepare() {
37         autotools-utils_src_prepare "${@}"
38
39         [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]] && multilib_copy_sources
40 }
41
42 multilib_src_configure() {
43         [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]] && local ECONF_SOURCE=${BUILD_DIR}
44         autotools-utils_src_configure "${_at_args[@]}"
45 }
46
47 autotools-multilib_src_configure() {
48         local _at_args=( "${@}" )
49
50         multilib-minimal_src_configure
51 }
52
53 multilib_src_compile() {
54         emake "${_at_args[@]}"
55 }
56
57 autotools-multilib_src_compile() {
58         local _at_args=( "${@}" )
59
60         multilib-minimal_src_compile
61 }
62
63 multilib_src_test() {
64         autotools-utils_src_test "${_at_args[@]}"
65 }
66
67 autotools-multilib_src_test() {
68         local _at_args=( "${@}" )
69
70         multilib-minimal_src_test
71 }
72
73 multilib_src_install() {
74         emake DESTDIR="${D}" "${_at_args[@]}" install
75 }
76
77 multilib_src_install_all() {
78         einstalldocs
79
80         # Remove libtool files and unnecessary static libs
81         local prune_ltfiles=${AUTOTOOLS_PRUNE_LIBTOOL_FILES}
82         if [[ ${prune_ltfiles} != none ]]; then
83                 prune_libtool_files ${prune_ltfiles:+--${prune_ltfiles}}
84         fi
85 }
86
87 autotools-multilib_src_install() {
88         local _at_args=( "${@}" )
89
90         multilib-minimal_src_install
91 }