1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 # @ECLASS: toolchain-autoconf.eclass
6 # <base-system@gentoo.org>
7 # @BLURB: Common code for sys-devel/autoconf ebuilds
9 # This eclass contains the common phase functions migrated from
10 # sys-devel/autoconf eblits.
14 die "${ECLASS} is banned in EAPI ${EAPI:-0}"
19 die "Unknown EAPI ${EAPI:-0}"
23 if [[ -z ${_TOOLCHAIN_AUTOCONF_ECLASS} ]]; then
25 EXPORT_FUNCTIONS src_prepare src_configure src_install
27 toolchain-autoconf_src_prepare() {
28 find -name Makefile.in -exec sed -i '/^pkgdatadir/s:$:-@VERSION@:' {} + || die
32 toolchain-autoconf_src_configure() {
33 # Disable Emacs in the build system since it is in a separate package.
35 econf --program-suffix="-${PV}" || die
36 # econf updates config.{sub,guess} which forces the manpages
37 # to be regenerated which we dont want to do #146621
41 # slot the info pages. do this w/out munging the source so we don't have
42 # to depend on texinfo to regen things. #464146 (among others)
44 [[ ${SLOT} == "0" ]] && return
46 pushd "${ED}"/usr/share/info >/dev/null || die
49 # Rewrite all the references to other pages.
50 # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
51 # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
52 local p pages=( *.info ) args=()
53 for p in "${pages[@]/%.info}" ; do
55 -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
56 -e "s:(${p}):(${p}-${SLOT}):g"
59 sed -i "${args[@]}" * || die
61 # Rewrite all the file references, and rename them in the process.
64 d=${f/.info/-${SLOT}.info}
65 mv "${f}" "${d}" || die
66 sed -i -e "s:${f}:${d}:g" * || die
69 popd >/dev/null || die
72 toolchain-autoconf_src_install() {
77 _TOOLCHAIN_AUTOCONF_ECLASS=1