/[gentoo-x86]/eclass/autotools-multilib.eclass
Gentoo

Diff of /eclass/autotools-multilib.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.8 Revision 1.23
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2014 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-multilib.eclass,v 1.8 2013/02/01 21:39:50 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-multilib.eclass,v 1.23 2014/05/02 16:16:37 mgorny Exp $
4 4
5# @ECLASS: autotools-multilib.eclass 5# @ECLASS: autotools-multilib.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# gx86-multilib team <multilib@gentoo.org>
8# @AUTHOR:
7# Michał Górny <mgorny@gentoo.org> 9# Author: Michał Górny <mgorny@gentoo.org>
8# @BLURB: autotools-utils wrapper for multilib builds 10# @BLURB: autotools-utils wrapper for multilib builds
9# @DESCRIPTION: 11# @DESCRIPTION:
10# The autotools-multilib.eclass is an autotools-utils.eclass(5) wrapper 12# The autotools-multilib.eclass provides a glue between
11# introducing support for building for more than one ABI (multilib). 13# autotools-utils.eclass(5) and multilib-minimal.eclass(5), aiming
14# to provide a convenient way to build packages using autotools
15# for multiple ABIs.
12# 16#
13# Inheriting this eclass sets IUSE=multilib and exports autotools-utils 17# Inheriting this eclass sets IUSE and exports default multilib_src_*()
14# phase function wrappers which build the package for each supported ABI 18# sub-phases that call autotools-utils phase functions for each ABI
15# if the flag is enabled. Otherwise, it works like regular 19# enabled. The multilib_src_*() functions can be defined in ebuild just
16# autotools-utils. 20# like in multilib-minimal.
17#
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 21
22# EAPI=5 is required for meaningful MULTILIB_USEDEP. 22# EAPI=4 is required for meaningful MULTILIB_USEDEP.
23case ${EAPI:-0} in 23case ${EAPI:-0} in
24 5) ;; 24 4|5) ;;
25 *) die "EAPI=${EAPI} is not supported" ;; 25 *) die "EAPI=${EAPI} is not supported" ;;
26esac 26esac
27 27
28if [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then 28inherit autotools-utils eutils multilib-build multilib-minimal
29 die "${ECLASS}: multilib support requires out-of-source builds."
30fi
31 29
32inherit autotools-utils multilib-build 30EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
33 31
34EXPORT_FUNCTIONS src_configure src_compile src_test src_install 32# Note: _at_args[@] passing is a backwards compatibility measure.
33# Don't use it in new packages.
34
35autotools-multilib_src_prepare() {
36 autotools-utils_src_prepare "${@}"
37
38 [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]] && multilib_copy_sources
39}
40
41multilib_src_configure() {
42 [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]] && local ECONF_SOURCE=${BUILD_DIR}
43 autotools-utils_src_configure "${_at_args[@]}"
44}
35 45
36autotools-multilib_src_configure() { 46autotools-multilib_src_configure() {
37 multilib_parallel_foreach_abi autotools-utils_src_configure 47 local _at_args=( "${@}" )
48
49 multilib-minimal_src_configure
50}
51
52multilib_src_compile() {
53 emake "${_at_args[@]}"
38} 54}
39 55
40autotools-multilib_src_compile() { 56autotools-multilib_src_compile() {
41 multilib_foreach_abi autotools-utils_src_compile 57 local _at_args=( "${@}" )
58
59 multilib-minimal_src_compile
60}
61
62multilib_src_test() {
63 autotools-utils_src_test "${_at_args[@]}"
42} 64}
43 65
44autotools-multilib_src_test() { 66autotools-multilib_src_test() {
45 multilib_foreach_abi autotools-utils_src_test 67 local _at_args=( "${@}" )
68
69 multilib-minimal_src_test
70}
71
72multilib_src_install() {
73 emake DESTDIR="${D}" "${_at_args[@]}" install
74}
75
76multilib_src_install_all() {
77 einstalldocs
78
79 # Remove libtool files and unnecessary static libs
80 local prune_ltfiles=${AUTOTOOLS_PRUNE_LIBTOOL_FILES}
81 if [[ ${prune_ltfiles} != none ]]; then
82 prune_libtool_files ${prune_ltfiles:+--${prune_ltfiles}}
83 fi
46} 84}
47 85
48autotools-multilib_src_install() { 86autotools-multilib_src_install() {
49 autotools-multilib_secure_install() { 87 local _at_args=( "${@}" )
50 autotools-utils_src_install
51 88
52 # Make sure all headers are the same for each ABI. 89 multilib-minimal_src_install
53 autotools-multilib_cksum() {
54 find "${ED}"usr/include -type f \
55 -exec cksum {} + | sort -k2
56 }
57
58 local cksum=$(autotools-multilib_cksum)
59 local cksum_file=${T}/.autotools-multilib_cksum
60
61 if [[ -f ${cksum_file} ]]; then
62 local cksum_prev=$(< "${cksum_file}")
63
64 if [[ ${cksum} != ${cksum_prev} ]]; then
65 echo "${cksum}" > "${cksum_file}.new"
66
67 eerror "Header files have changed between ABIs."
68
69 if type -p diff &>/dev/null; then
70 eerror "$(diff -du "${cksum_file}" "${cksum_file}.new")"
71 else
72 eerror "Old checksums in: ${cksum_file}"
73 eerror "New checksums in: ${cksum_file}.new"
74 fi
75
76 die "Header checksum mismatch, aborting."
77 fi
78 else
79 echo "${cksum}" > "${cksum_file}"
80 fi
81 }
82
83 multilib_foreach_abi autotools-multilib_secure_install
84} 90}

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.23

  ViewVC Help
Powered by ViewVC 1.1.20