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

Diff of /eclass/autotools.eclass

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

Revision 1.75 Revision 1.76
1# Copyright 1999-2008 Gentoo Foundation 1# Copyright 1999-2008 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.75 2008/04/24 03:15:43 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.76 2008/06/01 01:43:06 vapier Exp $
4# 4
5# @ECLASS: autotools.eclass
6# @MAINTAINER:
5# Maintainer: base-system@gentoo.org 7# base-system@gentoo.org
6# 8# @BLURB: Regenerates auto* build scripts
9# @DESCRIPTION:
7# This eclass is for handling autotooled software packages that 10# This eclass is for safely handling autotooled software packages that need to
8# needs to regenerate their build scripts. 11# regenerate their build scripts. All functions will abort in case of errors.
9# 12#
10# NB: If you add anything, please comment it! 13# NB: If you add anything, please comment it!
11 14
12inherit eutils libtool 15inherit eutils libtool
13 16
17# @ECLASS-VARIABLE: WANT_AUTOCONF
18# @DESCRIPTION:
19# The major version of autoconf your package needs
14[[ -z ${WANT_AUTOCONF} ]] && WANT_AUTOCONF="latest" 20[[ -z ${WANT_AUTOCONF} ]] && WANT_AUTOCONF="latest"
21
22# @ECLASS-VARIABLE: WANT_AUTOMAKE
23# @DESCRIPTION:
24# The major version of automake your package needs
15[[ -z ${WANT_AUTOMAKE} ]] && WANT_AUTOMAKE="latest" 25[[ -z ${WANT_AUTOMAKE} ]] && WANT_AUTOMAKE="latest"
16 26
17_automake_atom="sys-devel/automake" 27_automake_atom="sys-devel/automake"
18_autoconf_atom="sys-devel/autoconf" 28_autoconf_atom="sys-devel/autoconf"
19if [[ -n ${WANT_AUTOMAKE} ]]; then 29if [[ -n ${WANT_AUTOMAKE} ]]; then
40 ${_autoconf_atom} 50 ${_autoconf_atom}
41 sys-devel/libtool" 51 sys-devel/libtool"
42RDEPEND="" 52RDEPEND=""
43unset _automake_atom _autoconf_atom 53unset _automake_atom _autoconf_atom
44 54
45# Variables: 55# @ECLASS-VARIABLE: AM_OPTS
46# 56# @DESCRIPTION:
47# AT_M4DIR - Additional director(y|ies) aclocal should search
48# AM_OPTS - Additional options to pass to automake during 57# Additional options to pass to automake during
49# eautoreconf call. 58# eautoreconf call.
59
60# @ECLASS-VARIABLE: AT_NOELIBTOOLIZE
61# @DESCRIPTION:
50# AT_NOELIBTOOLIZE - Don't run elibtoolize command if set to 'yes', 62# Don't run elibtoolize command if set to 'yes',
51# useful when elibtoolize needs to be ran with 63# useful when elibtoolize needs to be ran with
52# particular options 64# particular options
53
54# Functions:
55#
56# eautoreconf() - Should do a full autoreconf - normally what most people
57# will be interested in. Also should handle additional
58# directories specified by AC_CONFIG_SUBDIRS.
59# eaclocal() - Runs aclocal. Respects AT_M4DIR for additional directories
60# to search for macro's.
61# _elibtoolize() - Runs libtoolize. Note the '_' prefix .. to not collide
62# with elibtoolize() from libtool.eclass
63# eautoconf - Runs autoconf.
64# eautoheader - Runs autoheader.
65# eautomake - Runs automake
66#
67 65
68# XXX: M4DIR should be deprecated 66# XXX: M4DIR should be deprecated
67# @ECLASS-VARIABLE: AT_M4DIR
68# @DESCRIPTION:
69# Additional director(y|ies) aclocal should search
69AT_M4DIR=${AT_M4DIR:-${M4DIR}} 70AT_M4DIR=${AT_M4DIR:-${M4DIR}}
70AT_GNUCONF_UPDATE="no" 71AT_GNUCONF_UPDATE="no"
71 72
72 73
74# @FUNCTION: eautoreconf
75# @DESCRIPTION:
73# This function mimes the behavior of autoreconf, but uses the different 76# This function mimes the behavior of autoreconf, but uses the different
74# eauto* functions to run the tools. It doesn't accept parameters, but 77# eauto* functions to run the tools. It doesn't accept parameters, but
75# the directory with include files can be specified with AT_M4DIR variable. 78# the directory with include files can be specified with AT_M4DIR variable.
79#
80# Should do a full autoreconf - normally what most people will be interested in.
81# Also should handle additional directories specified by AC_CONFIG_SUBDIRS.
76eautoreconf() { 82eautoreconf() {
77 local pwd=$(pwd) x auxdir 83 local pwd=$(pwd) x auxdir
78 84
79 if [[ -z ${AT_NO_RECURSIVE} ]]; then 85 if [[ -z ${AT_NO_RECURSIVE} ]]; then
80 # Take care of subdirs 86 # Take care of subdirs
108 elibtoolize 114 elibtoolize
109 115
110 return 0 116 return 0
111} 117}
112 118
119# @FUNCTION: eaclocal
120# @DESCRIPTION:
113# These functions runs the autotools using autotools_run_tool with the 121# These functions runs the autotools using autotools_run_tool with the
114# specified parametes. The name of the tool run is the same of the function 122# specified parametes. The name of the tool run is the same of the function
115# without e prefix. 123# without e prefix.
116# They also force installing the support files for safety. 124# They also force installing the support files for safety.
125# Respects AT_M4DIR for additional directories to search for macro's.
117eaclocal() { 126eaclocal() {
118 local aclocal_opts 127 local aclocal_opts
119 128
120 local amflags_file 129 local amflags_file
121 for amflags_file in GNUmakefile.am Makefile.am GNUmakefile.in Makefile.in ; do 130 for amflags_file in GNUmakefile.am Makefile.am GNUmakefile.in Makefile.in ; do
141 150
142 [[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \ 151 [[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \
143 autotools_run_tool aclocal "$@" ${aclocal_opts} 152 autotools_run_tool aclocal "$@" ${aclocal_opts}
144} 153}
145 154
155# @FUNCTION: _elibtoolize
156# @DESCRIPTION:
157# Runs libtoolize. Note the '_' prefix .. to not collide with elibtoolize() from
158# libtool.eclass.
146_elibtoolize() { 159_elibtoolize() {
147 local opts 160 local opts
148 local lttest 161 local lttest
149 162
150 # Check if we should run libtoolize (AM_PROG_LIBTOOL is an older macro, 163 # Check if we should run libtoolize (AM_PROG_LIBTOOL is an older macro,
159 172
160 # Need to rerun aclocal 173 # Need to rerun aclocal
161 eaclocal 174 eaclocal
162} 175}
163 176
177# @FUNCTION: eautoheader
178# @DESCRIPTION:
179# Runs autoheader.
164eautoheader() { 180eautoheader() {
165 # Check if we should run autoheader 181 # Check if we should run autoheader
166 [[ -n $(autotools_check_macro "AC_CONFIG_HEADERS") ]] || return 0 182 [[ -n $(autotools_check_macro "AC_CONFIG_HEADERS") ]] || return 0
167 NO_FAIL=1 autotools_run_tool autoheader "$@" 183 NO_FAIL=1 autotools_run_tool autoheader "$@"
168} 184}
169 185
186# @FUNCTION: eautoconf
187# @DESCRIPTION:
188# Runs autoconf.
170eautoconf() { 189eautoconf() {
171 if [[ ! -f configure.ac && ! -f configure.in ]] ; then 190 if [[ ! -f configure.ac && ! -f configure.in ]] ; then
172 echo 191 echo
173 eerror "No configure.{ac,in} present in '$(pwd | sed -e 's:.*/::')'!" 192 eerror "No configure.{ac,in} present in '$(pwd | sed -e 's:.*/::')'!"
174 echo 193 echo
176 fi 195 fi
177 196
178 autotools_run_tool autoconf "$@" 197 autotools_run_tool autoconf "$@"
179} 198}
180 199
200# @FUNCTION: eautomake
201# @DESCRIPTION:
202# Runs automake.
181eautomake() { 203eautomake() {
182 local extra_opts 204 local extra_opts
183 local makefile_name 205 local makefile_name
184 206
185 if [[ -f GNUmakefile.am ]]; then 207 if [[ -f GNUmakefile.am ]]; then

Legend:
Removed from v.1.75  
changed lines
  Added in v.1.76

  ViewVC Help
Powered by ViewVC 1.1.20