Gentoo Archives: gentoo-dev

From: Luca Barbato <lu_zero@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] autotools-multilib: wrapper eclass for multilib builds.
Date: Sat, 22 Sep 2012 21:46:05
Message-Id: 1ae887dd-5ef3-4b57-92c3-0d0ba0230fac@email.android.com
In Reply to: [gentoo-dev] [PATCH] autotools-multilib: wrapper eclass for multilib builds. by "Michał Górny"
1 "Michał Górny" <mgorny@g.o> wrote:
2
3 >It is a simple eclass using autotools out-of-source builds to build
4 >packages for multiple ABIs when multilib is supported.
5 >
6 >Use case: xorg packages, ask Matt.
7 >---
8 >gx86/eclass/autotools-multilib.eclass | 72
9 >+++++++++++++++++++++++++++++++++++
10 > 1 file changed, 72 insertions(+)
11 > create mode 100644 gx86/eclass/autotools-multilib.eclass
12 >
13 >diff --git a/gx86/eclass/autotools-multilib.eclass
14 >b/gx86/eclass/autotools-multilib.eclass
15 >new file mode 100644
16 >index 0000000..1a345a1
17 >--- /dev/null
18 >+++ b/gx86/eclass/autotools-multilib.eclass
19 >@@ -0,0 +1,72 @@
20 >+# Copyright 1999-2012 Gentoo Foundation
21 >+# Distributed under the terms of the GNU General Public License v2
22 >+# $Header: $
23 >+
24 >+# @ECLASS: autotools-multilib.eclass
25 >+# @MAINTAINER:
26 >+# Michał Górny <mgorny@g.o>
27 >+# @BLURB: autotools-utils wrapper for multilib builds
28 >+# @DESCRIPTION:
29 >+# The autotools-multilib.eclass is an autotools-utils.eclass(5)
30 >wrapper
31 >+# introducing support for building for more than one ABI (multilib).
32 >+#
33 >+# Inheriting this eclass sets IUSE=multilib and exports
34 >autotools-utils
35 >+# phase function wrappers which build the package for each supported
36 >ABI
37 >+# if the flag is enabled. Otherwise, it works like regular
38 >+# autotools-utils.
39 >+#
40 >+# Note that the multilib support requires out-of-source builds to be
41 >+# enabled. Thus, it is impossible to use AUTOTOOLS_IN_SOURCE_BUILD
42 >with
43 >+# it.
44 >+
45 >+case ${EAPI:-0} in
46 >+ 2|3|4) ;;
47 >+ *) die "EAPI=${EAPI} is not supported" ;;
48 >+esac
49 >+
50 >+if [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
51 >+ die "${ECLASS}: multilib support requires out-of-source builds."
52 >+fi
53 >+
54 >+inherit autotools-utils multilib
55 >+
56 >+EXPORT_FUNCTIONS src_configure src_compile src_test src_install
57 >+
58 >+IUSE=multilib
59 >+
60 >+# @FUNCTION: autotools-multilib_foreach_abi
61 >+# @USAGE: argv...
62 >+# @DESCRIPTION:
63 >+# If multilib support is enabled, sets the toolchain up for each
64 >+# supported ABI along with the ABI variable and correct
65 >+# AUTOTOOLS_BUILD_DIR, and runs the given commands with them.
66 >+#
67 >+# If multilib support is disabled, it just runs the commands. No setup
68 >+# is done.
69 >+autotools-multilib_foreach_abi() {
70 >+ if use multilib; then
71 >+ local ABI
72 >+ for ABI in $(get_all_abis); do
73 >+ multilib_toolchain_setup "${ABI}"
74 >+ AUTOTOOLS_BUILD_DIR=${S%%/}-${ABI} "${@}"
75 >+ done
76 >+ else
77 >+ "${@}"
78 >+ fi
79 >+}
80 >+
81 >+autotools-multilib_src_configure() {
82 >+ autotools-multilib_foreach_abi autotools-utils_src_configure
83 >+}
84 >+
85 >+autotools-multilib_src_compile() {
86 >+ autotools-multilib_foreach_abi autotools-utils_src_compile
87 >+}
88 >+
89 >+autotools-multilib_src_test() {
90 >+ autotools-multilib_foreach_abi autotools-utils_src_test
91 >+}
92 >+
93 >+autotools-multilib_src_install() {
94 >+ autotools-multilib_foreach_abi autotools-utils_src_install
95 >+}
96
97 How docs and nonbinaries get managed?

Replies