/[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.20
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.20 2014/01/15 12:12:41 mgorny Exp $
4 4
5# @ECLASS: autotools-multilib.eclass 5# @ECLASS: autotools-multilib.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Michał Górny <mgorny@gentoo.org> 7# Michał Górny <mgorny@gentoo.org>
8# @BLURB: autotools-utils wrapper for multilib builds 8# @BLURB: autotools-utils wrapper for multilib builds
9# @DESCRIPTION: 9# @DESCRIPTION:
10# The autotools-multilib.eclass is an autotools-utils.eclass(5) wrapper 10# The autotools-multilib.eclass is an autotools-utils.eclass(5) wrapper
11# introducing support for building for more than one ABI (multilib). 11# introducing support for building for more than one ABI (multilib).
12# 12#
13# Inheriting this eclass sets IUSE=multilib and exports autotools-utils 13# Inheriting this eclass sets the USE flags and exports autotools-utils
14# phase function wrappers which build the package for each supported ABI 14# phase function wrappers which build the package for each supported ABI
15# if the flag is enabled. Otherwise, it works like regular 15# when the relevant flag is enabled. Other than that, it works like
16# autotools-utils. 16# regular autotools-utils.
17#
18# The multilib phase functions can be overriden via defining multilib_*
19# phase functions as in multilib-minimal.eclass. In some cases you may
20# need to call the underlying autotools-utils_* phase though.
17# 21#
18# Note that the multilib support requires out-of-source builds to be 22# 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 23# enabled. Thus, it is impossible to use AUTOTOOLS_IN_SOURCE_BUILD with
20# it. 24# it.
21 25
22# EAPI=5 is required for meaningful MULTILIB_USEDEP. 26# EAPI=4 is required for meaningful MULTILIB_USEDEP.
23case ${EAPI:-0} in 27case ${EAPI:-0} in
24 5) ;; 28 4|5) ;;
25 *) die "EAPI=${EAPI} is not supported" ;; 29 *) die "EAPI=${EAPI} is not supported" ;;
26esac 30esac
27 31
28if [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then 32inherit autotools-utils eutils multilib-build multilib-minimal
29 die "${ECLASS}: multilib support requires out-of-source builds."
30fi
31 33
32inherit autotools-utils multilib-build 34EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
33 35
34EXPORT_FUNCTIONS src_configure src_compile src_test src_install 36# bug #485046
37_autotools-multilib_fix_multilib_minimal() {
38 src_conf=$(declare -f multilib-minimal_src_configure)
39 src_conf=${src_conf/multilib_foreach_abi/multilib_parallel_foreach_abi}
40 eval "${src_conf}"
41}
42_autotools-multilib_fix_multilib_minimal
43
44# Note: _at_args[@] passing is a backwards compatibility measure.
45# Don't use it in new packages.
46
47autotools-multilib_src_prepare() {
48 autotools-utils_src_prepare "${@}"
49
50 [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]] && multilib_copy_sources
51}
52
53multilib_src_configure() {
54 [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]] && local ECONF_SOURCE=${BUILD_DIR}
55 autotools-utils_src_configure "${_at_args[@]}"
56}
35 57
36autotools-multilib_src_configure() { 58autotools-multilib_src_configure() {
37 multilib_parallel_foreach_abi autotools-utils_src_configure 59 local _at_args=( "${@}" )
60
61 multilib-minimal_src_configure
62}
63
64multilib_src_compile() {
65 emake "${_at_args[@]}"
38} 66}
39 67
40autotools-multilib_src_compile() { 68autotools-multilib_src_compile() {
41 multilib_foreach_abi autotools-utils_src_compile 69 local _at_args=( "${@}" )
70
71 multilib-minimal_src_compile
72}
73
74multilib_src_test() {
75 autotools-utils_src_test "${_at_args[@]}"
42} 76}
43 77
44autotools-multilib_src_test() { 78autotools-multilib_src_test() {
45 multilib_foreach_abi autotools-utils_src_test 79 local _at_args=( "${@}" )
80
81 multilib-minimal_src_test
82}
83
84multilib_src_install() {
85 emake DESTDIR="${D}" "${_at_args[@]}" install
86}
87
88multilib_src_install_all() {
89 einstalldocs
90
91 # Remove libtool files and unnecessary static libs
92 local prune_ltfiles=${AUTOTOOLS_PRUNE_LIBTOOL_FILES}
93 if [[ ${prune_ltfiles} != none ]]; then
94 prune_libtool_files ${prune_ltfiles:+--${prune_ltfiles}}
95 fi
46} 96}
47 97
48autotools-multilib_src_install() { 98autotools-multilib_src_install() {
49 autotools-multilib_secure_install() { 99 local _at_args=( "${@}" )
50 autotools-utils_src_install
51 100
52 # Make sure all headers are the same for each ABI. 101 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} 102}

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

  ViewVC Help
Powered by ViewVC 1.1.20