| 1 |
# Copyright 1999-2005 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.194 2005/08/09 22:40:39 vapier Exp $
|
| 4 |
#
|
| 5 |
# Author: Diego Pettenò <flameeyes@gentoo.org>
|
| 6 |
#
|
| 7 |
# This eclass is for handling autotooled software packages that
|
| 8 |
# needs to regenerate their build scripts.
|
| 9 |
#
|
| 10 |
# NB: If you add anything, please comment it!
|
| 11 |
|
| 12 |
inherit eutils gnuconfig
|
| 13 |
|
| 14 |
DELEND="sys-devel/automake
|
| 15 |
sys-devel/autoconf
|
| 16 |
sys-devel/libtool"
|
| 17 |
|
| 18 |
# Internal function to run an autotools' tool
|
| 19 |
autotools_run_tool() {
|
| 20 |
local STDERR_TARGET="${T}/$$.out"
|
| 21 |
local PATCH_TARGET="${T}/$$.patch"
|
| 22 |
local ris
|
| 23 |
|
| 24 |
echo "***** $1 *****" > ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/}
|
| 25 |
echo >> ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/}
|
| 26 |
|
| 27 |
ebegin "Running $1"
|
| 28 |
$@ >> ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/} 2>&1
|
| 29 |
ris=$?
|
| 30 |
eend $ris
|
| 31 |
|
| 32 |
if [[ $ris != 0 ]]; then
|
| 33 |
echo
|
| 34 |
eerror "Failed Running $1 !"
|
| 35 |
eerror
|
| 36 |
eerror "Include in your bugreport the contents of:"
|
| 37 |
eerror
|
| 38 |
eerror " ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/}"
|
| 39 |
echo
|
| 40 |
die "Failed Running $1 !"
|
| 41 |
fi
|
| 42 |
}
|
| 43 |
|
| 44 |
# These functions runs the autotools using autotools_run_tool with the
|
| 45 |
# specified parametes. The name of the tool run is the same of the function
|
| 46 |
# without e prefix.
|
| 47 |
# They also force installing the support files for safety.
|
| 48 |
eaclocal() {
|
| 49 |
autotools_run_tool aclocal "$@"
|
| 50 |
}
|
| 51 |
|
| 52 |
eautoheader() {
|
| 53 |
autotools_run_tool autoheader "$@"
|
| 54 |
}
|
| 55 |
|
| 56 |
eautoconf() {
|
| 57 |
autotools_run_tool autoconf "$@"
|
| 58 |
}
|
| 59 |
|
| 60 |
eautomake() {
|
| 61 |
autotools_run_tool automake --add-missing --force-missing --copy "$@"
|
| 62 |
}
|
| 63 |
|
| 64 |
# This function mimes the behavior of autoreconf, but uses the different
|
| 65 |
# eauto* functions to run the tools. It doesn't accept parameters, but
|
| 66 |
# the directory with include files can be specified with M4DIR variable.
|
| 67 |
#
|
| 68 |
# Note: doesn't run autopoint right now, but runs gnuconfig_update.
|
| 69 |
eautoreconf() {
|
| 70 |
local aclocal_opts
|
| 71 |
|
| 72 |
[[ -n ${M4DIR} ]] && aclocal_opts="-I ${M4DIR}"
|
| 73 |
|
| 74 |
eaclocal $aclocal_opts
|
| 75 |
eautoconf
|
| 76 |
eautoheader
|
| 77 |
eautomake
|
| 78 |
gnuconfig_update
|
| 79 |
|
| 80 |
autotools_run_tool libtoolize --copy --force
|
| 81 |
}
|