summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2013-02-01 21:39:50 +0000
committerMichał Górny <mgorny@gentoo.org>2013-02-01 21:39:50 +0000
commitd0d16e031f9059739709fa6756a40e4ac2b59980 (patch)
treea176ba1bd42de1da5d3c50f0ed5dfc8e230191bc /eclass/autotools-multilib.eclass
parentRemove old. (diff)
downloadgentoo-2-d0d16e031f9059739709fa6756a40e4ac2b59980.tar.gz
gentoo-2-d0d16e031f9059739709fa6756a40e4ac2b59980.tar.bz2
gentoo-2-d0d16e031f9059739709fa6756a40e4ac2b59980.zip
Introduce a common multilib-build eclass to help building packages for multilib, and use the new ABI_X86 flags in it.
Diffstat (limited to 'eclass/autotools-multilib.eclass')
-rw-r--r--eclass/autotools-multilib.eclass120
1 files changed, 40 insertions, 80 deletions
diff --git a/eclass/autotools-multilib.eclass b/eclass/autotools-multilib.eclass
index 90f7beee840d..97abfe65e0ed 100644
--- a/eclass/autotools-multilib.eclass
+++ b/eclass/autotools-multilib.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-multilib.eclass,v 1.7 2013/01/26 11:39:41 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-multilib.eclass,v 1.8 2013/02/01 21:39:50 mgorny Exp $
# @ECLASS: autotools-multilib.eclass
# @MAINTAINER:
@@ -29,96 +29,56 @@ if [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
die "${ECLASS}: multilib support requires out-of-source builds."
fi
-inherit autotools-utils multilib multiprocessing
+inherit autotools-utils multilib-build
EXPORT_FUNCTIONS src_configure src_compile src_test src_install
-IUSE=multilib
-
-# @ECLASS-VARIABLE: MULTILIB_USEDEP
-# @DESCRIPTION:
-# The USE-dependency to be used on dependencies (libraries) needing
-# to support multilib as well.
-#
-# Example use:
-# @CODE
-# RDEPEND="dev-libs/libfoo[${MULTILIB_USEDEP}]
-# net-libs/libbar[ssl,${MULTILIB_USEDEP}]"
-# @CODE
-MULTILIB_USEDEP='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 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() {
- local initial_dir=${BUILD_DIR:-${S}}
-
- if use multilib; then
- local ABI
- for ABI in $(get_all_abis); do
- multilib_toolchain_setup "${ABI}"
- BUILD_DIR=${initial_dir%%/}-${ABI} "${@}"
- done
- else
- "${@}"
- fi
-}
-
-# @FUNCTION: autotools-multilib_parallel_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 BUILD_DIR,
-# and runs the given commands with them. The commands are run
-# in parallel with number of jobs being determined from MAKEOPTS.
-#
-# If multilib support is disabled, it just runs the commands. No setup
-# is done.
-#
-# Useful for running configure scripts.
-autotools-multilib_parallel_foreach_abi() {
- local initial_dir=${BUILD_DIR:-${S}}
-
- if use multilib; then
- multijob_init
-
- local ABI
- for ABI in $(get_all_abis); do
- (
- multijob_child_init
-
- multilib_toolchain_setup "${ABI}"
- BUILD_DIR=${initial_dir%%/}-${ABI}
- "${@}"
- ) &
-
- multijob_post_fork
- done
-
- multijob_finish
- else
- "${@}"
- fi
-}
-
autotools-multilib_src_configure() {
- autotools-multilib_parallel_foreach_abi autotools-utils_src_configure
+ multilib_parallel_foreach_abi autotools-utils_src_configure
}
autotools-multilib_src_compile() {
- autotools-multilib_foreach_abi autotools-utils_src_compile
+ multilib_foreach_abi autotools-utils_src_compile
}
autotools-multilib_src_test() {
- autotools-multilib_foreach_abi autotools-utils_src_test
+ multilib_foreach_abi autotools-utils_src_test
}
autotools-multilib_src_install() {
- autotools-multilib_foreach_abi autotools-utils_src_install
+ autotools-multilib_secure_install() {
+ autotools-utils_src_install
+
+ # Make sure all headers are the same for each ABI.
+ autotools-multilib_cksum() {
+ find "${ED}"usr/include -type f \
+ -exec cksum {} + | sort -k2
+ }
+
+ local cksum=$(autotools-multilib_cksum)
+ local cksum_file=${T}/.autotools-multilib_cksum
+
+ if [[ -f ${cksum_file} ]]; then
+ local cksum_prev=$(< "${cksum_file}")
+
+ if [[ ${cksum} != ${cksum_prev} ]]; then
+ echo "${cksum}" > "${cksum_file}.new"
+
+ eerror "Header files have changed between ABIs."
+
+ if type -p diff &>/dev/null; then
+ eerror "$(diff -du "${cksum_file}" "${cksum_file}.new")"
+ else
+ eerror "Old checksums in: ${cksum_file}"
+ eerror "New checksums in: ${cksum_file}.new"
+ fi
+
+ die "Header checksum mismatch, aborting."
+ fi
+ else
+ echo "${cksum}" > "${cksum_file}"
+ fi
+ }
+
+ multilib_foreach_abi autotools-multilib_secure_install
}