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

Diff of /eclass/autotools.eclass

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

Revision 1.99 Revision 1.102
1# Copyright 1999-2010 Gentoo Foundation 1# Copyright 1999-2010 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.99 2010/07/06 18:55:50 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.102 2011/04/06 03:52:08 flameeyes 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
23# @DESCRIPTION: 23# @DESCRIPTION:
24# The major version of automake your package needs 24# The major version of automake your package needs
25: ${WANT_AUTOMAKE:=latest} 25: ${WANT_AUTOMAKE:=latest}
26 26
27# @ECLASS-VARIABLE: _LATEST_AUTOMAKE 27# @ECLASS-VARIABLE: _LATEST_AUTOMAKE
28# @INTERNAL
28# @DESCRIPTION: 29# @DESCRIPTION:
29# CONSTANT! 30# CONSTANT!
30# The latest major version/slot of automake available on each arch. 31# The latest major version/slot of automake available on each arch.
31# If a newer version is stable on any arch, and is NOT reflected in this list, 32# If a newer version is stable on any arch, and is NOT reflected in this list,
32# then circular dependencies may arise during emerge @system bootstraps. 33# then circular dependencies may arise during emerge @system bootstraps.
72fi 73fi
73 74
74unset _automake_atom _autoconf_atom 75unset _automake_atom _autoconf_atom
75 76
76# @ECLASS-VARIABLE: AM_OPTS 77# @ECLASS-VARIABLE: AM_OPTS
78# @DEFAULT_UNSET
77# @DESCRIPTION: 79# @DESCRIPTION:
78# Additional options to pass to automake during 80# Additional options to pass to automake during
79# eautoreconf call. 81# eautoreconf call.
80 82
81# @ECLASS-VARIABLE: AT_NOELIBTOOLIZE 83# @ECLASS-VARIABLE: AT_NOELIBTOOLIZE
84# @DEFAULT_UNSET
82# @DESCRIPTION: 85# @DESCRIPTION:
83# Don't run elibtoolize command if set to 'yes', 86# Don't run elibtoolize command if set to 'yes',
84# useful when elibtoolize needs to be ran with 87# useful when elibtoolize needs to be ran with
85# particular options 88# particular options
86 89
87# XXX: M4DIR should be deprecated 90# XXX: M4DIR should be deprecated
88# @ECLASS-VARIABLE: AT_M4DIR 91# @ECLASS-VARIABLE: AT_M4DIR
89# @DESCRIPTION: 92# @DESCRIPTION:
90# Additional director(y|ies) aclocal should search 93# Additional director(y|ies) aclocal should search
91: ${AT_M4DIR:=${M4DIR}} 94: ${AT_M4DIR:=${M4DIR}}
92AT_GNUCONF_UPDATE="no"
93
94 95
95# @FUNCTION: eautoreconf 96# @FUNCTION: eautoreconf
96# @DESCRIPTION: 97# @DESCRIPTION:
97# This function mimes the behavior of autoreconf, but uses the different 98# This function mimes the behavior of autoreconf, but uses the different
98# eauto* functions to run the tools. It doesn't accept parameters, but 99# eauto* functions to run the tools. It doesn't accept parameters, but
154 aclocal_opts=$(sed -n '/^ACLOCAL_AMFLAGS[[:space:]]*=/s:[^=]*=::p' ${amflags_file}) 155 aclocal_opts=$(sed -n '/^ACLOCAL_AMFLAGS[[:space:]]*=/s:[^=]*=::p' ${amflags_file})
155 eval aclocal_opts=\"${aclocal_opts}\" 156 eval aclocal_opts=\"${aclocal_opts}\"
156 break 157 break
157 done 158 done
158 159
159 if [[ -n ${AT_M4DIR} ]] ; then
160 for x in ${AT_M4DIR} ; do
161 case "${x}" in
162 "-I")
163 # We handle it below
164 ;;
165 *)
166 [[ ! -d ${x} ]] && ewarn "eaclocal: '${x}' does not exist"
167 aclocal_opts="${aclocal_opts} -I ${x}"
168 ;;
169 esac
170 done
171 fi
172
173 [[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \ 160 [[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \
174 autotools_run_tool aclocal "$@" ${aclocal_opts} 161 autotools_run_tool aclocal $(autotools_m4dir_include) "$@" ${aclocal_opts}
175} 162}
176 163
177# @FUNCTION: _elibtoolize 164# @FUNCTION: _elibtoolize
178# @DESCRIPTION: 165# @DESCRIPTION:
179# Runs libtoolize. Note the '_' prefix .. to not collide with elibtoolize() from 166# Runs libtoolize. Note the '_' prefix .. to not collide with elibtoolize() from
198# @DESCRIPTION: 185# @DESCRIPTION:
199# Runs autoheader. 186# Runs autoheader.
200eautoheader() { 187eautoheader() {
201 # Check if we should run autoheader 188 # Check if we should run autoheader
202 [[ -n $(autotools_check_macro "AC_CONFIG_HEADERS") ]] || return 0 189 [[ -n $(autotools_check_macro "AC_CONFIG_HEADERS") ]] || return 0
203 NO_FAIL=1 autotools_run_tool autoheader "$@" 190 NO_FAIL=1 autotools_run_tool autoheader $(autotools_m4dir_include) "$@"
204} 191}
205 192
206# @FUNCTION: eautoconf 193# @FUNCTION: eautoconf
207# @DESCRIPTION: 194# @DESCRIPTION:
208# Runs autoconf. 195# Runs autoconf.
212 eerror "No configure.{ac,in} present in '${PWD}'!" 199 eerror "No configure.{ac,in} present in '${PWD}'!"
213 echo 200 echo
214 die "No configure.{ac,in} present!" 201 die "No configure.{ac,in} present!"
215 fi 202 fi
216 203
217 autotools_run_tool autoconf "$@" 204 autotools_run_tool autoconf $(autotools_m4dir_include) "$@"
218} 205}
219 206
220# @FUNCTION: eautomake 207# @FUNCTION: eautomake
221# @DESCRIPTION: 208# @DESCRIPTION:
222# Runs automake. 209# Runs automake.
317# Internal function to check for support 304# Internal function to check for support
318autotools_check_macro() { 305autotools_check_macro() {
319 [[ -f configure.ac || -f configure.in ]] || return 0 306 [[ -f configure.ac || -f configure.in ]] || return 0
320 local macro 307 local macro
321 for macro ; do 308 for macro ; do
322 WANT_AUTOCONF="2.5" autoconf --trace="${macro}" 2>/dev/null 309 WANT_AUTOCONF="2.5" autoconf $(autotools_m4dir_include) --trace="${macro}" 2>/dev/null
323 done 310 done
324 return 0 311 return 0
325} 312}
326 313
327# Internal function to get additional subdirs to configure 314# Internal function to get additional subdirs to configure
352 print res[1] 339 print res[1]
353 }' | uniq 340 }' | uniq
354 341
355 return 0 342 return 0
356} 343}
344
345autotools_m4dir_include() {
346 [[ -n ${AT_M4DIR} ]] || return
347
348 local include_opts=
349
350 for x in ${AT_M4DIR} ; do
351 case "${x}" in
352 "-I")
353 # We handle it below
354 ;;
355 *)
356 [[ ! -d ${x} ]] && ewarn "autotools.eclass: '${x}' does not exist"
357 include_opts="${include_opts} -I ${x}"
358 ;;
359 esac
360 done
361
362 echo $include_opts
363}

Legend:
Removed from v.1.99  
changed lines
  Added in v.1.102

  ViewVC Help
Powered by ViewVC 1.1.20