summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-05-23 22:52:41 +0000
committerMike Frysinger <vapier@gentoo.org>2010-05-23 22:52:41 +0000
commite7676b1173c43e9bd1136d2f3b91c2c6920cf241 (patch)
treed852f48f4fa74ac837a77ef99347fe5dbaf41369 /eclass
parentVersion bump; cleanup old versions; use new syntax. (diff)
downloadhistorical-e7676b1173c43e9bd1136d2f3b91c2c6920cf241.tar.gz
historical-e7676b1173c43e9bd1136d2f3b91c2c6920cf241.tar.bz2
historical-e7676b1173c43e9bd1136d2f3b91c2c6920cf241.zip
run automake if the configure script requests it via AM_INIT_AUTOMAKE even if there are no .am files #311439
Diffstat (limited to 'eclass')
-rw-r--r--eclass/autotools.eclass26
1 files changed, 16 insertions, 10 deletions
diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index 8e99488c42af..384bacca98cb 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.97 2010/04/01 21:42:37 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.98 2010/05/23 22:52:41 vapier Exp $
# @ECLASS: autotools.eclass
# @MAINTAINER:
@@ -231,21 +231,27 @@ eautomake() {
local extra_opts
local makefile_name
- if [[ -f GNUmakefile.am ]]; then
- makefile_name="GNUmakefile"
- elif [[ -f Makefile.am ]]; then
- makefile_name="Makefile"
- else
- return 0
- fi
+ # Run automake if:
+ # - a Makefile.am type file exists
+ # - a Makefile.in type file exists and the configure
+ # script is using the AM_INIT_AUTOMAKE directive
+ for makefile_name in {GNUmakefile,{M,m}akefile}.{am,in} "" ; do
+ [[ -f ${makefile_name} ]] && break
+ done
+ [[ -z ${makefile_name} ]] && return 0
+
+ if [[ ${makefile_name} == *.in ]] ; then
+ if ! grep -qs AM_INIT_AUTOMAKE configure.?? ; then
+ return 0
+ fi
- if [[ -z ${FROM_EAUTORECONF} && -f ${makefile_name}.in ]]; then
+ elif [[ -z ${FROM_EAUTORECONF} && -f ${makefile_name%.am}.in ]]; then
local used_automake
local installed_automake
installed_automake=$(WANT_AUTOMAKE= automake --version | head -n 1 | \
sed -e 's:.*(GNU automake) ::')
- used_automake=$(head -n 1 < ${makefile_name}.in | \
+ used_automake=$(head -n 1 < ${makefile_name%.am}.in | \
sed -e 's:.*by automake \(.*\) from .*:\1:')
if [[ ${installed_automake} != ${used_automake} ]]; then