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

Diff of /eclass/autotools.eclass

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

Revision 1.62 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.62 2007/01/08 23:04:49 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
13
14[[ -z ${WANT_AUTOCONF} ]] && WANT_AUTOCONF="latest"
15[[ -z ${WANT_AUTOMAKE} ]] && WANT_AUTOMAKE="latest"
14 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} ]]; then 19if [[ -n ${WANT_AUTOMAKE} ]]; then
18 case ${WANT_AUTOMAKE} in 20 case ${WANT_AUTOMAKE} in
19 # workaround while we have different versions of automake in arch and ~arch 21 # workaround while we have different versions of automake in arch and ~arch
20 none) _automake_atom="" ;; # some packages don't require automake at all 22 none) _automake_atom="" ;; # some packages don't require automake at all
21 latest) _automake_atom="|| ( =sys-devel/automake-1.10* =sys-devel/automake-1.9* )" ;; 23 latest) _automake_atom="=sys-devel/automake-1.10*" ;;
22 *) _automake_atom="=sys-devel/automake-${WANT_AUTOMAKE}*" ;; 24 *) _automake_atom="=sys-devel/automake-${WANT_AUTOMAKE}*" ;;
23 esac 25 esac
26 [[ ${WANT_AUTOMAKE} == "latest" ]] && WANT_AUTOMAKE="1.10"
27 export WANT_AUTOMAKE
24fi 28fi
25 29
26if [[ -n ${WANT_AUTOCONF} ]] ; then 30if [[ -n ${WANT_AUTOCONF} ]] ; then
27 case ${WANT_AUTOCONF} in 31 case ${WANT_AUTOCONF} in
28 2.1) _autoconf_atom="=sys-devel/autoconf-${WANT_AUTOCONF}*" ;; 32 2.1) _autoconf_atom="=sys-devel/autoconf-${WANT_AUTOCONF}*" ;;
29 latest | 2.5) _autoconf_atom=">=sys-devel/autoconf-2.59" ;; 33 latest | 2.5) _autoconf_atom=">=sys-devel/autoconf-2.59" ;;
30 esac 34 esac
35 [[ ${WANT_AUTOCONF} == "latest" ]] && WANT_AUTOCONF="2.5"
36 export WANT_AUTOCONF
31fi 37fi
32DEPEND="${_automake_atom} 38DEPEND="${_automake_atom}
33 ${_autoconf_atom} 39 ${_autoconf_atom}
34 sys-devel/libtool" 40 sys-devel/libtool"
35RDEPEND="" 41RDEPEND=""
56# eautoconf - Runs autoconf. 62# eautoconf - Runs autoconf.
57# eautoheader - Runs autoheader. 63# eautoheader - Runs autoheader.
58# eautomake - Runs automake 64# eautomake - Runs automake
59# 65#
60 66
61# XXX: M4DIR should be depreciated 67# XXX: M4DIR should be deprecated
62AT_M4DIR=${AT_M4DIR:-${M4DIR}} 68AT_M4DIR=${AT_M4DIR:-${M4DIR}}
63AT_GNUCONF_UPDATE="no" 69AT_GNUCONF_UPDATE="no"
64 70
65 71
66# This function mimes the behavior of autoreconf, but uses the different 72# This function mimes the behavior of autoreconf, but uses the different
118 ;; 124 ;;
119 esac 125 esac
120 done 126 done
121 fi 127 fi
122 128
123 autotools_set_versions
124 [[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \ 129 [[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \
125 autotools_run_tool aclocal "$@" ${aclocal_opts} 130 autotools_run_tool aclocal "$@" ${aclocal_opts}
126} 131}
127 132
128_elibtoolize() { 133_elibtoolize() {
144} 149}
145 150
146eautoheader() { 151eautoheader() {
147 # Check if we should run autoheader 152 # Check if we should run autoheader
148 [[ -n $(autotools_check_macro "AC_CONFIG_HEADERS") ]] || return 0 153 [[ -n $(autotools_check_macro "AC_CONFIG_HEADERS") ]] || return 0
149 autotools_set_versions
150 NO_FAIL=1 autotools_run_tool autoheader "$@" 154 NO_FAIL=1 autotools_run_tool autoheader "$@"
151} 155}
152 156
153eautoconf() { 157eautoconf() {
154 if [[ ! -f configure.ac && ! -f configure.in ]] ; then 158 if [[ ! -f configure.ac && ! -f configure.in ]] ; then
156 eerror "No configure.{ac,in} present in '$(pwd | sed -e 's:.*/::')'!" 160 eerror "No configure.{ac,in} present in '$(pwd | sed -e 's:.*/::')'!"
157 echo 161 echo
158 die "No configure.{ac,in} present!" 162 die "No configure.{ac,in} present!"
159 fi 163 fi
160 164
161 autotools_set_versions
162 autotools_run_tool autoconf "$@" 165 autotools_run_tool autoconf "$@"
163} 166}
164 167
165eautomake() { 168eautomake() {
166 local extra_opts 169 local extra_opts
167 170
168 [[ -f Makefile.am ]] || return 0 171 [[ -f Makefile.am ]] || return 0
169 172
170 autotools_set_versions
171 if [[ -z ${FROM_EAUTORECONF} && -f Makefile.in ]]; then 173 if [[ -z ${FROM_EAUTORECONF} && -f Makefile.in ]]; then
172 local used_automake 174 local used_automake
173 local installed_automake 175 local installed_automake
174 176
175 installed_automake=$(automake --version | head -n 1 | \ 177 installed_automake=$(automake --version | head -n 1 | \
190 192
191 # --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
192 autotools_run_tool automake --add-missing --copy ${extra_opts} "$@" 194 autotools_run_tool automake --add-missing --copy ${extra_opts} "$@"
193} 195}
194 196
195autotools_set_versions() {
196 [[ -n ${autotools_version_sets} ]] && return 0
197
198 if [[ -n ${WANT_AUTOCONF} ]]; then
199 [[ ${WANT_AUTOCONF} == "latest" ]] && WANT_AUTOCONF="2.5"
200 export WANT_AUTOCONF
201 einfo "Requested autoconf ${WANT_AUTOCONF}"
202 einfo "Using $(autoconf --version 2>/dev/null | head -n 1)"
203 einfo "Using $(autoheader --version 2>/dev/null | head -n 1)"
204 else
205 ewarn "QA Notice: \${WANT_AUTOCONF} variable unset. Please report on http://bugs.gentoo.org/"
206 fi
207
208 if [[ -n ${WANT_AUTOMAKE} ]]; then
209 local latest_automake
210 if [[ ${WANT_AUTOMAKE} == "latest" ]]; then
211 latest_automake="latest: "
212 for amver in 1.10 1.9 1.8 1.7 1.6; do
213 WANT_AUTOMAKE="${amver}"
214 ROOT=/ has_version =sys-devel/automake-${amver}* && break
215 done
216 fi
217
218 # Don't do stuff if no autoamke is requested/required
219 if [[ ${WANT_AUTOMAKE} != "none" ]]; then
220 export WANT_AUTOMAKE
221 einfo "Requested automake ${latest_automake}${WANT_AUTOMAKE}"
222 einfo "Using $(automake --version 2>/dev/null | head -n 1)"
223 einfo "Using $(aclocal --version 2>/dev/null | head -n 1)"
224 fi
225 else
226 ewarn "QA Notice: \${WANT_AUTOMAKE} variable unset. Please report on http://bugs.gentoo.org/"
227 fi
228
229 autotools_version_sets="yes"
230}
231
232# Internal function to run an autotools' tool 197# Internal function to run an autotools' tool
233autotools_run_tool() { 198autotools_run_tool() {
234 local STDERR_TARGET="${T}/$$.out" 199 local STDERR_TARGET="${T}/$$.out"
235 local ris 200 local ris
236 201

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

  ViewVC Help
Powered by ViewVC 1.1.20