1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 # @ECLASS: autotools-multilib.eclass
6 # gx86-multilib team <multilib@gentoo.org>
8 # Author: Michał Górny <mgorny@gentoo.org>
9 # @SUPPORTED_EAPIS: 4 5
10 # @BLURB: autotools-utils wrapper for multilib builds
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
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.
22 # EAPI=4 is required for meaningful MULTILIB_USEDEP.
24 6) die "${ECLASS}.eclass is banned in EAPI ${EAPI}";;
26 *) die "EAPI=${EAPI} is not supported" ;;
29 inherit autotools-utils eutils ltprune multilib-build multilib-minimal
31 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
33 # Note: _at_args[@] passing is a backwards compatibility measure.
34 # Don't use it in new packages.
36 autotools-multilib_src_prepare() {
37 autotools-utils_src_prepare "${@}"
39 [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]] && multilib_copy_sources
42 multilib_src_configure() {
43 [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]] && local ECONF_SOURCE=${BUILD_DIR}
44 autotools-utils_src_configure "${_at_args[@]}"
47 autotools-multilib_src_configure() {
48 local _at_args=( "${@}" )
50 multilib-minimal_src_configure
53 multilib_src_compile() {
54 emake "${_at_args[@]}"
57 autotools-multilib_src_compile() {
58 local _at_args=( "${@}" )
60 multilib-minimal_src_compile
64 autotools-utils_src_test "${_at_args[@]}"
67 autotools-multilib_src_test() {
68 local _at_args=( "${@}" )
70 multilib-minimal_src_test
73 multilib_src_install() {
74 emake DESTDIR="${D}" "${_at_args[@]}" install
77 multilib_src_install_all() {
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}}
87 autotools-multilib_src_install() {
88 local _at_args=( "${@}" )
90 multilib-minimal_src_install