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

Diff of /eclass/autotools.eclass

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

Revision 1.106 Revision 1.110
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 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.106 2011/08/22 19:39:52 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.110 2011/11/14 17:08:49 vapier Exp $
4 4
5# @ECLASS: autotools.eclass 5# @ECLASS: autotools.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# base-system@gentoo.org 7# base-system@gentoo.org
8# @BLURB: Regenerates auto* build scripts 8# @BLURB: Regenerates auto* build scripts
9# @DESCRIPTION: 9# @DESCRIPTION:
10# This eclass is for safely handling autotooled software packages that need to 10# This eclass is for safely handling autotooled software packages that need to
11# regenerate their build scripts. All functions will abort in case of errors. 11# regenerate their build scripts. All functions will abort in case of errors.
12#
13# NB: If you add anything, please comment it!
14 12
15inherit eutils libtool 13inherit eutils libtool
16 14
17# @ECLASS-VARIABLE: WANT_AUTOCONF 15# @ECLASS-VARIABLE: WANT_AUTOCONF
18# @DESCRIPTION: 16# @DESCRIPTION:
146 144
147 [[ ${AT_NOELIBTOOLIZE} == "yes" ]] && return 0 145 [[ ${AT_NOELIBTOOLIZE} == "yes" ]] && return 0
148 146
149 # Call it here to prevent failures due to elibtoolize called _before_ 147 # Call it here to prevent failures due to elibtoolize called _before_
150 # eautoreconf. We set $S because elibtoolize runs on that #265319 148 # eautoreconf. We set $S because elibtoolize runs on that #265319
151 S=${PWD} elibtoolize 149 S=${PWD} elibtoolize --force
152 150
153 return 0 151 return 0
152}
153
154# @FUNCTION: eaclocal_amflags
155# @DESCRIPTION:
156# Extract the ACLOCAL_AMFLAGS value from the Makefile.am and try to handle
157# (most) of the crazy crap that people throw at us.
158eaclocal_amflags() {
159 local aclocal_opts amflags_file
160
161 for amflags_file in GNUmakefile.am Makefile.am GNUmakefile.in Makefile.in ; do
162 [[ -e ${amflags_file} ]] || continue
163 # setup the env in case the pkg does something crazy
164 # in their ACLOCAL_AMFLAGS. like run a shell script
165 # which turns around and runs autotools. #365401
166 # or split across multiple lines. #383525
167 autotools_env_setup
168 aclocal_opts=$(sed -n \
169 "/^ACLOCAL_AMFLAGS[[:space:]]*=/{ \
170 # match the first line
171 s:[^=]*=::p; \
172 # then gobble up all escaped lines
173 : nextline /\\\\$/{ n; p; b nextline; } \
174 }" ${amflags_file})
175 eval aclocal_opts=\""${aclocal_opts}"\"
176 break
177 done
178
179 echo ${aclocal_opts}
154} 180}
155 181
156# @FUNCTION: eaclocal 182# @FUNCTION: eaclocal
157# @DESCRIPTION: 183# @DESCRIPTION:
158# These functions runs the autotools using autotools_run_tool with the 184# These functions runs the autotools using autotools_run_tool with the
159# specified parametes. The name of the tool run is the same of the function 185# specified parametes. The name of the tool run is the same of the function
160# without e prefix. 186# without e prefix.
161# They also force installing the support files for safety. 187# They also force installing the support files for safety.
162# Respects AT_M4DIR for additional directories to search for macro's. 188# Respects AT_M4DIR for additional directories to search for macro's.
163eaclocal() { 189eaclocal() {
164 local aclocal_opts
165
166 local amflags_file
167 for amflags_file in GNUmakefile.am Makefile.am GNUmakefile.in Makefile.in ; do
168 [[ -e ${amflags_file} ]] || continue
169 # setup the env in case the pkg does something crazy
170 # in their ACLOCAL_AMFLAGS. like run a shell script
171 # which turns around and runs autotools #365401
172 autotools_env_setup
173 aclocal_opts=$(sed -n '/^ACLOCAL_AMFLAGS[[:space:]]*=/s:[^=]*=::p' ${amflags_file})
174 eval aclocal_opts=\"${aclocal_opts}\"
175 break
176 done
177
178 [[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \ 190 [[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \
179 autotools_run_tool aclocal $(autotools_m4dir_include) "$@" ${aclocal_opts} 191 autotools_run_tool aclocal $(autotools_m4dir_include) "$@" $(eaclocal_amflags)
180} 192}
181 193
182# @FUNCTION: _elibtoolize 194# @FUNCTION: _elibtoolize
183# @DESCRIPTION: 195# @DESCRIPTION:
184# Runs libtoolize. Note the '_' prefix .. to not collide with elibtoolize() from 196# Runs libtoolize. Note the '_' prefix .. to not collide with elibtoolize() from
258 eautoreconf 270 eautoreconf
259 return 0 271 return 0
260 fi 272 fi
261 fi 273 fi
262 274
263 [[ -f INSTALL && -f AUTHORS && -f ChangeLog && -f NEWS ]] \ 275 [[ -f INSTALL && -f AUTHORS && -f ChangeLog && -f NEWS && -f README ]] \
264 || extra_opts="${extra_opts} --foreign" 276 || extra_opts="${extra_opts} --foreign"
265 277
266 # --force-missing seems not to be recognized by some flavours of automake 278 # --force-missing seems not to be recognized by some flavours of automake
267 autotools_run_tool automake --add-missing --copy ${extra_opts} "$@" 279 autotools_run_tool automake --add-missing --copy ${extra_opts} "$@"
268} 280}

Legend:
Removed from v.1.106  
changed lines
  Added in v.1.110

  ViewVC Help
Powered by ViewVC 1.1.20