1 # Copyright 1999-2017 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.
12 if [[ -z ${_TOOLCHAIN_AUTOCONF_ECLASS} ]]; then
16 EXPORT_FUNCTIONS src_prepare src_configure src_install
18 toolchain-autoconf_src_prepare() {
19 find -name Makefile.in -exec sed -i '/^pkgdatadir/s:$:-@VERSION@:' {} + || die
21 [[ ${#PATCHES[@]} -gt 0 ]] && epatch "${PATCHES[@]}"
24 toolchain-autoconf_src_configure() {
25 # Disable Emacs in the build system since it is in a separate package.
27 econf --program-suffix="-${PV}" || die
28 # econf updates config.{sub,guess} which forces the manpages
29 # to be regenerated which we dont want to do #146621
33 # slot the info pages. do this w/out munging the source so we don't have
34 # to depend on texinfo to regen things. #464146 (among others)
36 [[ ${SLOT} == "0" ]] && return
38 pushd "${ED}"/usr/share/info >/dev/null || die
41 # Rewrite all the references to other pages.
42 # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
43 # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
44 local p pages=( *.info ) args=()
45 for p in "${pages[@]/%.info}" ; do
47 -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
48 -e "s:(${p}):(${p}-${SLOT}):g"
51 sed -i "${args[@]}" * || die
53 # Rewrite all the file references, and rename them in the process.
56 d=${f/.info/-${SLOT}.info}
57 mv "${f}" "${d}" || die
58 sed -i -e "s:${f}:${d}:g" * || die
61 popd >/dev/null || die
64 toolchain-autoconf_src_install() {
69 _TOOLCHAIN_AUTOCONF_ECLASS=1