/[gentoo-x86]/eclass/autotools.eclass
Gentoo

Diff of /eclass/autotools.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.48 Revision 1.66
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2007 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.48 2006/10/16 08:12:01 flameeyes Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.66 2007/05/30 15:45:01 cardoe Exp $
4# 4#
5# Author: Diego Pettenò <flameeyes@gentoo.org> 5# Maintainer: base-system@gentoo.org
6# Enhancements: Martin Schlemmer <azarah@gentoo.org>
7# 6#
8# This eclass is for handling autotooled software packages that 7# This eclass is for handling autotooled software packages that
9# needs to regenerate their build scripts. 8# needs to regenerate their build scripts.
10# 9#
11# NB: If you add anything, please comment it! 10# NB: If you add anything, please comment it!
12 11
13inherit eutils libtool 12inherit eutils libtool
14 13
14[[ -z ${WANT_AUTOCONF} ]] && WANT_AUTOCONF="latest"
15[[ -z ${WANT_AUTOMAKE} ]] && WANT_AUTOMAKE="latest"
16
15_automake_atom="sys-devel/automake" 17_automake_atom="sys-devel/automake"
16_autoconf_atom="sys-devel/autoconf" 18_autoconf_atom="sys-devel/autoconf"
17if [[ -n ${WANT_AUTOMAKE} ]] && [[ ${WANT_AUTOMAKE} != "latest" ]]; then 19if [[ -n ${WANT_AUTOMAKE} ]]; then
20 case ${WANT_AUTOMAKE} in
21 # workaround while we have different versions of automake in arch and ~arch
22 none) _automake_atom="" ;; # some packages don't require automake at all
23 latest) _automake_atom="=sys-devel/automake-1.10*" ;;
18 _automake_atom="=sys-devel/automake-${WANT_AUTOMAKE}*" 24 *) _automake_atom="=sys-devel/automake-${WANT_AUTOMAKE}*" ;;
25 esac
26 [[ ${WANT_AUTOMAKE} == "latest" ]] && WANT_AUTOMAKE="1.10"
27 export WANT_AUTOMAKE
19fi 28fi
20 29
21if [[ -n ${WANT_AUTOCONF} ]] ; then 30if [[ -n ${WANT_AUTOCONF} ]] ; then
22 case ${WANT_AUTOCONF} in 31 case ${WANT_AUTOCONF} in
23 2.1) _autoconf_atom="=sys-devel/autoconf-${WANT_AUTOCONF}*" ;; 32 2.1) _autoconf_atom="=sys-devel/autoconf-${WANT_AUTOCONF}*" ;;
24 2.5) _autoconf_atom=">=sys-devel/autoconf-2.59" ;; 33 latest | 2.5) _autoconf_atom=">=sys-devel/autoconf-2.59" ;;
25 esac 34 esac
35 [[ ${WANT_AUTOCONF} == "latest" ]] && WANT_AUTOCONF="2.5"
36 export WANT_AUTOCONF
26fi 37fi
27DEPEND="${_automake_atom} 38DEPEND="${_automake_atom}
28 ${_autoconf_atom} 39 ${_autoconf_atom}
29 sys-devel/libtool" 40 sys-devel/libtool"
30RDEPEND="" 41RDEPEND=""
33# Variables: 44# Variables:
34# 45#
35# AT_M4DIR - Additional director(y|ies) aclocal should search 46# AT_M4DIR - Additional director(y|ies) aclocal should search
36# AM_OPTS - Additional options to pass to automake during 47# AM_OPTS - Additional options to pass to automake during
37# eautoreconf call. 48# eautoreconf call.
49# AT_NOELIBTOOLIZE - Don't run elibtoolize command if set to 'yes',
50# useful when elibtoolize needs to be ran with
51# particular options
38 52
39# Functions: 53# Functions:
40# 54#
41# eautoreconf() - Should do a full autoreconf - normally what most people 55# eautoreconf() - Should do a full autoreconf - normally what most people
42# will be interested in. Also should handle additional 56# will be interested in. Also should handle additional
48# eautoconf - Runs autoconf. 62# eautoconf - Runs autoconf.
49# eautoheader - Runs autoheader. 63# eautoheader - Runs autoheader.
50# eautomake - Runs automake 64# eautomake - Runs automake
51# 65#
52 66
53# XXX: M4DIR should be depreciated 67# XXX: M4DIR should be deprecated
54AT_M4DIR=${AT_M4DIR:-${M4DIR}} 68AT_M4DIR=${AT_M4DIR:-${M4DIR}}
55AT_GNUCONF_UPDATE="no" 69AT_GNUCONF_UPDATE="no"
56 70
57 71
58# This function mimes the behavior of autoreconf, but uses the different 72# This function mimes the behavior of autoreconf, but uses the different
110 ;; 124 ;;
111 esac 125 esac
112 done 126 done
113 fi 127 fi
114 128
115 autotools_set_versions
116 [[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \ 129 [[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \
117 autotools_run_tool aclocal "$@" ${aclocal_opts} 130 autotools_run_tool aclocal "$@" ${aclocal_opts}
118} 131}
119 132
120_elibtoolize() { 133_elibtoolize() {
136} 149}
137 150
138eautoheader() { 151eautoheader() {
139 # Check if we should run autoheader 152 # Check if we should run autoheader
140 [[ -n $(autotools_check_macro "AC_CONFIG_HEADERS") ]] || return 0 153 [[ -n $(autotools_check_macro "AC_CONFIG_HEADERS") ]] || return 0
141 autotools_set_versions
142 autotools_run_tool autoheader "$@" 154 NO_FAIL=1 autotools_run_tool autoheader "$@"
143} 155}
144 156
145eautoconf() { 157eautoconf() {
146 if [[ ! -f configure.ac && ! -f configure.in ]] ; then 158 if [[ ! -f configure.ac && ! -f configure.in ]] ; then
147 echo 159 echo
148 eerror "No configure.{ac,in} present in '$(pwd | sed -e 's:.*/::')'!" 160 eerror "No configure.{ac,in} present in '$(pwd | sed -e 's:.*/::')'!"
149 echo 161 echo
150 die "No configure.{ac,in} present!" 162 die "No configure.{ac,in} present!"
151 fi 163 fi
152 164
153 autotools_set_versions
154 autotools_run_tool autoconf "$@" 165 autotools_run_tool autoconf "$@"
155} 166}
156 167
157eautomake() { 168eautomake() {
158 local extra_opts 169 local extra_opts
159 170
160 [[ -f Makefile.am ]] || return 0 171 [[ -f Makefile.am ]] || return 0
161 172
162 autotools_set_versions
163 if [[ -z ${FROM_EAUTORECONF} && -f Makefile.in ]]; then 173 if [[ -z ${FROM_EAUTORECONF} && -f Makefile.in ]]; then
164 local used_automake 174 local used_automake
165 local installed_automake 175 local installed_automake
166 176
167 installed_automake=$(automake --version | head -n 1 | \ 177 installed_automake=$(automake --version | head -n 1 | \
182 192
183 # --force-missing seems not to be recognized by some flavours of automake 193 # --force-missing seems not to be recognized by some flavours of automake
184 autotools_run_tool automake --add-missing --copy ${extra_opts} "$@" 194 autotools_run_tool automake --add-missing --copy ${extra_opts} "$@"
185} 195}
186 196
187autotools_set_versions() {
188 [[ -n ${autotools_version_sets} ]] && return 0
189
190 if [[ -n ${WANT_AUTOCONF} ]]; then
191 [[ ${WANT_AUTOCONF} == "latest" ]] && WANT_AUTOCONF="2.5"
192 export WANT_AUTOCONF
193 einfo "Requested autoconf ${WANT_AUTOCONF}"
194 einfo "Using $(autoconf --version 2>/dev/null | head -n 1)"
195 einfo "Using $(autoheader --version 2>/dev/null | head -n 1)"
196 fi
197
198 if [[ -n ${WANT_AUTOMAKE} ]]; then
199 if [[ ${WANT_AUTOMAKE} == "latest" ]]; then
200 # Consider starting from 1.9, as that is stable everywhere.
201 has_version '~sys-devel/automake-1.9' && WANT_AUTOMAKE="1.9"
202 has_version '~sys-devel/automake-1.10' && WANT_AUTOMAKE="1.10"
203 fi
204 export WANT_AUTOMAKE
205 einfo "Requested automake ${WANT_AUTOMAKE}"
206 einfo "Using $(automake --version 2>/dev/null | head -n 1)"
207 einfo "Using $(aclocal --version 2>/dev/null | head -n 1)"
208 fi
209
210 autotools_version_sets="yes"
211}
212
213# Internal function to run an autotools' tool 197# Internal function to run an autotools' tool
214autotools_run_tool() { 198autotools_run_tool() {
215 local STDERR_TARGET="${T}/$$.out" 199 local STDERR_TARGET="${T}/$$.out"
216 local PATCH_TARGET="${T}/$$.patch"
217 local ris 200 local ris
218 201
219 echo "***** $1 *****" > ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/} 202 echo "***** $1 *****" > ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/}
220 echo >> ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/} 203 echo >> ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/}
221 204
222 ebegin "Running $@" 205 ebegin "Running $@"
223 $@ >> ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/} 2>&1 206 $@ >> ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/} 2>&1
224 ris=$? 207 ris=$?
225 eend ${ris} 208 eend ${ris}
226 209
227 if [[ ${ris} != 0 ]]; then 210 if [[ ${ris} != 0 && ${NO_FAIL} != 1 ]]; then
228 echo 211 echo
229 eerror "Failed Running $1 !" 212 eerror "Failed Running $1 !"
230 eerror 213 eerror
231 eerror "Include in your bugreport the contents of:" 214 eerror "Include in your bugreport the contents of:"
232 eerror 215 eerror

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.66

  ViewVC Help
Powered by ViewVC 1.1.20