Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/mgorny:master commit in: eclass/
Date: Sat, 07 Jan 2012 22:36:58
Message-Id: 07d1b26c5e93402b270c7746ea92955edc3f4479.mgorny@gentoo
1 commit: 07d1b26c5e93402b270c7746ea92955edc3f4479
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 6 21:57:27 2012 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 6 22:06:23 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=07d1b26c
7
8 Autoreconfigure packages when user patches need it.
9
10 If (user) patches modify either configure.{ac,in} or Makefile.am files,
11 autoreconfigure the package for user.
12
13 ---
14 eclass/autotools-utils.eclass | 16 ++++++++++++++++
15 1 files changed, 16 insertions(+), 0 deletions(-)
16
17 diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
18 index 87f8b4d..1b19ed2 100644
19 --- a/eclass/autotools-utils.eclass
20 +++ b/eclass/autotools-utils.eclass
21 @@ -99,6 +99,11 @@ esac
22 # Set to a non-empty value in order to enable running autoreconf
23 # in src_prepare() and adding autotools dependencies.
24 #
25 +# This is usually necessary when using live sources or applying patches
26 +# modifying configure.ac or Makefile.am files. Note that in the latter case
27 +# setting this variable is obligatory even though the eclass will work without
28 +# it (to add the necessary dependencies).
29 +#
30 # The eclass will try to determine the correct autotools to run including a few
31 # external tools: gettext, glib-gettext, intltool, gtk-doc, gnome-doc-prepare.
32 # If your tool is not supported, please open a bug and we'll add support for it.
33 @@ -354,8 +359,19 @@ autotools-utils_src_prepare() {
34
35 local want_autoreconf=${AUTOTOOLS_AUTORECONF}
36
37 + touch "${T}"/.autotools-utils.timestamp || die
38 [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
39 epatch_user
40 + if [[ ! ${want_autoreconf} ]]; then
41 + if [[ $(find . -newer "${T}"/.autotools-utils.timestamp \
42 + -a '(' -name 'Makefile.am' \
43 + -o -name 'configure.ac' \
44 + -o -name 'configure.in' ')' \
45 + -print -quit) ]]; then
46 + einfo 'Will autoreconfigure due to patches applied.'
47 + want_autoreconf=yep
48 + fi
49 + fi
50
51 [[ ${want_autoreconf} ]] && autotools-utils_autoreconf
52 elibtoolize --patch-only