public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [RFC] autotools support eclass
@ 2005-08-27 12:00 Diego 'Flameeyes' Pettenò
  2005-08-27 14:24 ` Martin Schlemmer
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Diego 'Flameeyes' Pettenò @ 2005-08-27 12:00 UTC (permalink / raw
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 1310 bytes --]

I was wondering last night with az about the handling of autotools.
They not always require to be re-run by scratch, but when you have to run 
aclocal you usually have to run everything after that.
Every ebuild handles them in a different way, some ebuilds run them in a && 
list and then || die, others runs them one-by-one.
Some force updating of support files and some don't.
Some adds code to let them print the status to the screen, some hides the 
actual output and some don't.

Attached there's an "autotools" eclass, it's basically a way to give more 
information to the user while providing an epatch-like die message.
the eauto* calls are directly calls to the original command, without black 
magic, with the only exception of automake that is called with -afc options 
to let it update the support files.

eautoreconf  instead is way different from autoreconf as it simply calls the 
tools one after the other, adding the -I options to eaclocal when requested. 
The sequence is aclocal, autoconf, autoheader, automake, gnuconfig_update and 
libtoolize --copy --force (this seems to be needed quite everytime you run 
aclocal.

Comments?

-- 
Diego "Flameeyes" Pettenò
Gentoo Developer - http://dev.gentoo.org/~flameeyes/
(Gentoo/FreeBSD, Video, Gentoo/AMD64, Sound, PAM)

[-- Attachment #1.2: autotools.eclass --]
[-- Type: text/plain, Size: 2164 bytes --]

# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.194 2005/08/09 22:40:39 vapier Exp $
#
# Author: Diego Pettenò <flameeyes@gentoo.org>
#
# This eclass is for handling autotooled software packages that
# needs to regenerate their build scripts.
#
# NB:  If you add anything, please comment it!

inherit eutils gnuconfig

DELEND="sys-devel/automake
	sys-devel/autoconf
	sys-devel/libtool"

# Internal function to run an autotools' tool
autotools_run_tool() {
	local STDERR_TARGET="${T}/$$.out"
	local PATCH_TARGET="${T}/$$.patch"
	local ris

	echo "***** $1 *****" > ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/}
	echo >> ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/}

	ebegin "Running $1"
	$@ >> ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/} 2>&1
	ris=$?
	eend $ris

	if [[ $ris != 0 ]]; then
		echo
		eerror "Failed Running $1 !"
		eerror
		eerror "Include in your bugreport the contents of:"
		eerror
		eerror "  ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/}"
		echo
		die "Failed Running $1 !"
	fi
}

# These functions runs the autotools using autotools_run_tool with the
# specified parametes. The name of the tool run is the same of the function
# without e prefix.
# They also force installing the support files for safety.
eaclocal() {
	autotools_run_tool aclocal "$@"
}

eautoheader() {
	autotools_run_tool autoheader "$@"
}

eautoconf() {
	autotools_run_tool autoconf "$@"
}

eautomake() {
	autotools_run_tool automake --add-missing --force-missing --copy "$@"
}

# This function mimes the behavior of autoreconf, but uses the different
# eauto* functions to run the tools. It doesn't accept parameters, but
# the directory with include files can be specified with M4DIR variable.
#
# Note: doesn't run autopoint right now, but runs gnuconfig_update.
eautoreconf() {
	local aclocal_opts

	[[ -n ${M4DIR} ]] && aclocal_opts="-I ${M4DIR}"

	eaclocal $aclocal_opts
	eautoconf
	eautoheader
	eautomake
	gnuconfig_update

	autotools_run_tool libtoolize --copy --force
}

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2005-08-28 18:12 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-27 12:00 [gentoo-dev] [RFC] autotools support eclass Diego 'Flameeyes' Pettenò
2005-08-27 14:24 ` Martin Schlemmer
2005-08-27 14:40   ` Martin Schlemmer
2005-08-27 15:51   ` Maurice van der Pot
2005-08-27 16:36     ` Martin Schlemmer
2005-08-27 15:53 ` Ciaran McCreesh
2005-08-27 16:05   ` Diego 'Flameeyes' Pettenò
2005-08-27 16:11     ` Ciaran McCreesh
2005-08-27 16:19       ` Diego 'Flameeyes' Pettenò
2005-08-27 18:37 ` Mike Frysinger
2005-08-27 18:58   ` Martin Schlemmer
2005-08-27 19:11     ` Mike Frysinger
2005-08-27 19:38       ` Martin Schlemmer
2005-08-28  5:59         ` Mike Frysinger
2005-08-28 11:28           ` Martin Schlemmer
2005-08-28 16:50             ` Mike Frysinger
2005-08-28 17:43               ` Martin Schlemmer
2005-08-28 17:54                 ` Mike Frysinger
2005-08-28 18:11                   ` Martin Schlemmer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox