summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog5
-rw-r--r--eclass/cmake-multilib.eclass56
2 files changed, 60 insertions, 1 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index b99adbe81491..c2f401768fb2 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for eclass directory
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.671 2013/02/10 11:44:00 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.672 2013/02/10 11:44:55 mgorny Exp $
+
+ 10 Feb 2013; Michał Górny <mgorny@gentoo.org> +cmake-multilib.eclass:
+ Introduce cmake-utils wrapper eclass for multilib.
10 Feb 2013; Michał Górny <mgorny@gentoo.org> autotools-multilib.eclass,
multilib-build.eclass:
diff --git a/eclass/cmake-multilib.eclass b/eclass/cmake-multilib.eclass
new file mode 100644
index 000000000000..5484f9e42820
--- /dev/null
+++ b/eclass/cmake-multilib.eclass
@@ -0,0 +1,56 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-multilib.eclass,v 1.1 2013/02/10 11:44:55 mgorny Exp $
+
+# @ECLASS: cmake-multilib.eclass
+# @MAINTAINER:
+# Michał Górny <mgorny@gentoo.org>
+# @BLURB: cmake-utils wrapper for multilib builds
+# @DESCRIPTION:
+# The cmake-multilib.eclass is a cmake-utils.eclass(5) wrapper
+# introducing support for building for more than one ABI (multilib).
+#
+# Inheriting this eclass sets IUSE and exports cmake-utils phase
+# function wrappers which build the package for each supported ABI
+# if the appropriate flag is enabled.
+#
+# Note that the multilib support requires out-of-source builds to be
+# enabled. Thus, it is impossible to use CMAKE_IN_SOURCE_BUILD with
+# it.
+
+# EAPI=5 is required for meaningful MULTILIB_USEDEP.
+case ${EAPI:-0} in
+ 5) ;;
+ *) die "EAPI=${EAPI} is not supported" ;;
+esac
+
+if [[ ${CMAKE_IN_SOURCE_BUILD} ]]; then
+ die "${ECLASS}: multilib support requires out-of-source builds."
+fi
+
+inherit cmake-utils multilib-build
+
+EXPORT_FUNCTIONS src_configure src_compile src_test src_install
+
+cmake-multilib_src_configure() {
+ multilib_parallel_foreach_abi cmake-utils_src_configure
+}
+
+cmake-multilib_src_compile() {
+ multilib_foreach_abi cmake-utils_src_compile
+}
+
+cmake-multilib_src_test() {
+ multilib_foreach_abi cmake-utils_src_test
+}
+
+cmake-multilib_src_install() {
+ cmake-multilib_secure_install() {
+ cmake-utils_src_install
+
+ # Make sure all headers are the same for each ABI.
+ multilib_check_headers
+ }
+
+ multilib_foreach_abi cmake-multilib_secure_install
+}