| 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.16 |
# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-multilib.eclass,v 1.15 2013/04/07 16:56:14 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 |
|
|
# 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
|
| 20 |
|
|
# it.
|
| 21 |
|
|
|
| 22 |
mgorny |
1.16 |
# EAPI=4 is required for meaningful MULTILIB_USEDEP.
|
| 23 |
mgorny |
1.1 |
case ${EAPI:-0} in
|
| 24 |
mgorny |
1.16 |
4|5) ;;
|
| 25 |
mgorny |
1.1 |
*) die "EAPI=${EAPI} is not supported" ;;
|
| 26 |
|
|
esac
|
| 27 |
|
|
|
| 28 |
|
|
if [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
|
| 29 |
|
|
die "${ECLASS}: multilib support requires out-of-source builds."
|
| 30 |
|
|
fi
|
| 31 |
|
|
|
| 32 |
mgorny |
1.8 |
inherit autotools-utils multilib-build
|
| 33 |
mgorny |
1.1 |
|
| 34 |
mgorny |
1.12 |
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
|
| 35 |
|
|
|
| 36 |
|
|
autotools-multilib_src_prepare() {
|
| 37 |
|
|
autotools-utils_src_prepare "${@}"
|
| 38 |
|
|
}
|
| 39 |
mgorny |
1.1 |
|
| 40 |
|
|
autotools-multilib_src_configure() {
|
| 41 |
mgorny |
1.10 |
multilib_parallel_foreach_abi autotools-utils_src_configure "${@}"
|
| 42 |
mgorny |
1.1 |
}
|
| 43 |
|
|
|
| 44 |
|
|
autotools-multilib_src_compile() {
|
| 45 |
mgorny |
1.10 |
multilib_foreach_abi autotools-utils_src_compile "${@}"
|
| 46 |
mgorny |
1.1 |
}
|
| 47 |
|
|
|
| 48 |
|
|
autotools-multilib_src_test() {
|
| 49 |
mgorny |
1.10 |
multilib_foreach_abi autotools-utils_src_test "${@}"
|
| 50 |
mgorny |
1.1 |
}
|
| 51 |
|
|
|
| 52 |
|
|
autotools-multilib_src_install() {
|
| 53 |
mgorny |
1.8 |
autotools-multilib_secure_install() {
|
| 54 |
mgorny |
1.10 |
autotools-utils_src_install "${@}"
|
| 55 |
mgorny |
1.8 |
|
| 56 |
mgorny |
1.15 |
multilib_prepare_wrappers
|
| 57 |
mgorny |
1.8 |
# Make sure all headers are the same for each ABI.
|
| 58 |
mgorny |
1.9 |
multilib_check_headers
|
| 59 |
mgorny |
1.8 |
}
|
| 60 |
|
|
|
| 61 |
mgorny |
1.10 |
multilib_foreach_abi autotools-multilib_secure_install "${@}"
|
| 62 |
mgorny |
1.13 |
|
| 63 |
mgorny |
1.15 |
# merge the wrappers
|
| 64 |
|
|
multilib_install_wrappers
|
| 65 |
mgorny |
1.1 |
}
|