summaryrefslogtreecommitdiff
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
commit40974c0b9210ac51393be04db42e8eda74d5fe14 (patch)
treea7dde9c560d3794e46ba44345b65d67196dc3d60 /eclass/autotools.eclass
parentVersion bump; cleanup old versions; use new syntax. (diff)
downloadgentoo-2-40974c0b9210ac51393be04db42e8eda74d5fe14.tar.gz
gentoo-2-40974c0b9210ac51393be04db42e8eda74d5fe14.tar.bz2
gentoo-2-40974c0b9210ac51393be04db42e8eda74d5fe14.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/autotools.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