public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] autotools-multilib: wrapper eclass for multilib builds.
@ 2012-09-22 21:24 Michał Górny
  2012-09-22 21:44 ` Luca Barbato
                   ` (3 more replies)
  0 siblings, 4 replies; 54+ messages in thread
From: Michał Górny @ 2012-09-22 21:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

It is a simple eclass using autotools out-of-source builds to build
packages for multiple ABIs when multilib is supported.

Use case: xorg packages, ask Matt.
---
 gx86/eclass/autotools-multilib.eclass | 72 +++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 gx86/eclass/autotools-multilib.eclass

diff --git a/gx86/eclass/autotools-multilib.eclass b/gx86/eclass/autotools-multilib.eclass
new file mode 100644
index 0000000..1a345a1
--- /dev/null
+++ b/gx86/eclass/autotools-multilib.eclass
@@ -0,0 +1,72 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+# @ECLASS: autotools-multilib.eclass
+# @MAINTAINER:
+# Michał Górny <mgorny@gentoo.org>
+# @BLURB: autotools-utils wrapper for multilib builds
+# @DESCRIPTION:
+# The autotools-multilib.eclass is an autotools-utils.eclass(5) wrapper
+# introducing support for building for more than one ABI (multilib).
+#
+# Inheriting this eclass sets IUSE=multilib and exports autotools-utils
+# phase function wrappers which build the package for each supported ABI
+# if the flag is enabled. Otherwise, it works like regular
+# autotools-utils.
+#
+# Note that the multilib support requires out-of-source builds to be
+# enabled. Thus, it is impossible to use AUTOTOOLS_IN_SOURCE_BUILD with
+# it.
+
+case ${EAPI:-0} in
+	2|3|4) ;;
+	*) die "EAPI=${EAPI} is not supported" ;;
+esac
+
+if [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
+	die "${ECLASS}: multilib support requires out-of-source builds."
+fi
+
+inherit autotools-utils multilib
+
+EXPORT_FUNCTIONS src_configure src_compile src_test src_install
+
+IUSE=multilib
+
+# @FUNCTION: autotools-multilib_foreach_abi
+# @USAGE: argv...
+# @DESCRIPTION:
+# If multilib support is enabled, sets the toolchain up for each
+# supported ABI along with the ABI variable and correct
+# AUTOTOOLS_BUILD_DIR, and runs the given commands with them.
+#
+# If multilib support is disabled, it just runs the commands. No setup
+# is done.
+autotools-multilib_foreach_abi() {
+	if use multilib; then
+		local ABI
+		for ABI in $(get_all_abis); do
+			multilib_toolchain_setup "${ABI}"
+			AUTOTOOLS_BUILD_DIR=${S%%/}-${ABI} "${@}"
+		done
+	else
+		"${@}"
+	fi
+}
+
+autotools-multilib_src_configure() {
+	autotools-multilib_foreach_abi autotools-utils_src_configure
+}
+
+autotools-multilib_src_compile() {
+	autotools-multilib_foreach_abi autotools-utils_src_compile
+}
+
+autotools-multilib_src_test() {
+	autotools-multilib_foreach_abi autotools-utils_src_test
+}
+
+autotools-multilib_src_install() {
+	autotools-multilib_foreach_abi autotools-utils_src_install
+}
-- 
1.7.12



^ permalink raw reply related	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2013-01-14 18:45 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-22 21:24 [gentoo-dev] [PATCH] autotools-multilib: wrapper eclass for multilib builds Michał Górny
2012-09-22 21:44 ` Luca Barbato
2012-09-22 22:02   ` Michał Górny
2012-09-23  0:46 ` Alexis Ballier
2012-09-23  7:21   ` Michał Górny
2012-09-23 15:47     ` Alexis Ballier
2012-09-23 16:31       ` Michał Górny
2012-09-24 15:17         ` Alexis Ballier
2012-09-24 17:32           ` Michał Górny
2012-09-24 17:53             ` Alexis Ballier
2012-09-24 18:12               ` Michał Górny
2012-09-24 19:16                 ` Alexis Ballier
2012-09-24 20:47                   ` Michał Górny
2012-09-24 21:19                     ` Alexis Ballier
2012-09-24 21:51                       ` Michał Górny
2012-09-24 21:59                         ` Alexis Ballier
2012-09-24 22:10                           ` Michał Górny
2012-09-24 22:22                             ` Alexis Ballier
2012-09-25  0:44                               ` Matt Turner
2012-09-25 11:37                                 ` Alexis Ballier
2012-09-23  1:54 ` Matt Turner
2012-09-23  1:59   ` Diego Elio Pettenò
2012-09-23  3:42     ` Matt Turner
2012-09-23 16:07       ` Diego Elio Pettenò
2012-09-23 16:57         ` Matt Turner
2012-09-23  9:07   ` Thomas Sachau
2012-09-23  9:56     ` Michał Górny
2012-09-23 10:02       ` hasufell
2012-09-23 10:40         ` Michał Górny
2012-09-23 12:05           ` hasufell
2012-09-23 12:30             ` Michał Górny
2012-09-23 17:01         ` Matt Turner
2012-09-23 19:16         ` Zac Medico
2012-09-23 10:33       ` Pacho Ramos
2012-09-23 10:40         ` Michał Górny
2012-09-23 11:03           ` Pacho Ramos
2012-09-23 11:13             ` Michał Górny
2012-09-23 11:30               ` Pacho Ramos
2012-09-23 11:57                 ` Michał Górny
2012-09-23 14:26               ` Peter Stuge
2012-09-23 16:32                 ` Michał Górny
2012-09-24  3:18           ` Ben de Groot
2012-09-23 11:52         ` Thomas Sachau
2012-09-23 12:18           ` Pacho Ramos
2012-09-23 14:49             ` Thomas Sachau
2012-09-25 13:21               ` Alexis Ballier
2013-01-02 23:25                 ` Pacho Ramos
2013-01-03 10:44                   ` Thomas Sachau
2013-01-14 18:04                     ` Alexis Ballier
2013-01-14 18:45                       ` Michał Górny
2013-01-03  0:14                 ` Peter Stuge
2012-09-23 17:07     ` Matt Turner
2012-09-23 12:30 ` Pacho Ramos
2012-09-23 17:10   ` Matt Turner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox