If (user) patches modify either configure.{ac,in} or Makefile.am files,
autoreconfigure the package for user.
---
 eclass/autotools-utils.eclass |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 87f8b4d..1b19ed2 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -99,6 +99,11 @@ esac
 # Set to a non-empty value in order to enable running autoreconf
 # in src_prepare() and adding autotools dependencies.
 #
+# This is usually necessary when using live sources or applying patches
+# modifying configure.ac or Makefile.am files. Note that in the latter case
+# setting this variable is obligatory even though the eclass will work without
+# it (to add the necessary dependencies).
+#
 # The eclass will try to determine the correct autotools to run including a few
 # external tools: gettext, glib-gettext, intltool, gtk-doc, gnome-doc-prepare.
 # If your tool is not supported, please open a bug and we'll add support for 
it.
@@ -354,8 +359,19 @@ autotools-utils_src_prepare() {
 
        local want_autoreconf=${AUTOTOOLS_AUTORECONF}
 
+       touch "${T}"/.autotools-utils.timestamp || die
        [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
        epatch_user
+       if [[ ! ${want_autoreconf} ]]; then
+               if [[ $(find . -newer "${T}"/.autotools-utils.timestamp \
+                               -a '(' -name 'Makefile.am' \
+                               -o -name 'configure.ac' \
+                               -o -name 'configure.in' ')' \
+                               -print -quit) ]]; then
+                       einfo 'Will autoreconfigure due to patches applied.'
+                       want_autoreconf=yep
+               fi
+       fi
 
        [[ ${want_autoreconf} ]] && autotools-utils_autoreconf
        elibtoolize --patch-only
-- 
1.7.8.2


Reply via email to