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

Diff of /eclass/autotools-utils.eclass

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

Revision 1.27 Revision 1.29
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-utils.eclass,v 1.27 2011/11/26 20:43:55 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.29 2011/11/27 09:57:20 mgorny Exp $
4 4
5# @ECLASS: autotools-utils.eclass 5# @ECLASS: autotools-utils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Maciej Mrozowski <reavertm@gentoo.org> 7# Maciej Mrozowski <reavertm@gentoo.org>
8# Michał Górny <mgorny@gentoo.org> 8# Michał Górny <mgorny@gentoo.org>
9# @BLURB: common ebuild functions for autotools-based packages 9# @BLURB: common ebuild functions for autotools-based packages
10# @DESCRIPTION: 10# @DESCRIPTION:
11# autotools-utils.eclass is autotools.eclass(5) and base.eclass(5) wrapper 11# autotools-utils.eclass is autotools.eclass(5) and base.eclass(5) wrapper
12# providing all inherited features along with econf arguments as Bash array, 12# providing all inherited features along with econf arguments as Bash array,
13# out of source build with overridable build dir location, static archives 13# out of source build with overridable build dir location, static archives
14# handling, libtool files removal, enable/disable debug handling. 14# handling, libtool files removal.
15#
16# Please note note that autotools-utils does not support mixing of its phase
17# functions with regular econf/emake calls. If necessary, please call
18# autotools-utils_src_compile instead of the latter.
15# 19#
16# @EXAMPLE: 20# @EXAMPLE:
17# Typical ebuild using autotools-utils.eclass: 21# Typical ebuild using autotools-utils.eclass:
18# 22#
19# @CODE 23# @CODE
199 if [[ ${removing} ]]; then 203 if [[ ${removing} ]]; then
200 einfo "Removing unnecessary ${f#${D%/}} (${removing})" 204 einfo "Removing unnecessary ${f#${D%/}} (${removing})"
201 rm -f "${f}" || die 205 rm -f "${f}" || die
202 fi 206 fi
203 done 207 done
208
209 # check for invalid eclass use
210 # this is the most commonly used function, so do it here
211 _check_build_dir
212 if [[ ! -d "${AUTOTOOLS_BUILD_DIR}" ]]; then
213 eqawarn "autotools-utils used but autotools-utils_src_configure was never called."
214 eqawarn "This is not supported and never was. Please report a bug against"
215 eqawarn "the offending ebuild. This will become a fatal error in a near future."
216 fi
204} 217}
205 218
206# @FUNCTION: autotools-utils_src_prepare 219# @FUNCTION: autotools-utils_src_prepare
207# @DESCRIPTION: 220# @DESCRIPTION:
208# The src_prepare function. 221# The src_prepare function.
244 # Append user args 257 # Append user args
245 econfargs+=("${myeconfargs[@]}") 258 econfargs+=("${myeconfargs[@]}")
246 259
247 _check_build_dir 260 _check_build_dir
248 mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed" 261 mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed"
249 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die 262 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
250 base_src_configure "${econfargs[@]}" "$@" 263 base_src_configure "${econfargs[@]}" "$@"
251 popd > /dev/null || die 264 popd > /dev/null
252} 265}
253 266
254# @FUNCTION: autotools-utils_src_compile 267# @FUNCTION: autotools-utils_src_compile
255# @DESCRIPTION: 268# @DESCRIPTION:
256# The autotools src_compile function, invokes emake in specified AUTOTOOLS_BUILD_DIR. 269# The autotools src_compile function, invokes emake in specified AUTOTOOLS_BUILD_DIR.
257autotools-utils_src_compile() { 270autotools-utils_src_compile() {
258 debug-print-function ${FUNCNAME} "$@" 271 debug-print-function ${FUNCNAME} "$@"
259 272
260 _check_build_dir 273 _check_build_dir
261 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die 274 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
262 base_src_compile "$@" 275 base_src_compile "$@"
263 popd > /dev/null || die 276 popd > /dev/null
264} 277}
265 278
266# @FUNCTION: autotools-utils_src_install 279# @FUNCTION: autotools-utils_src_install
267# @DESCRIPTION: 280# @DESCRIPTION:
268# The autotools src_install function. Runs emake install, unconditionally 281# The autotools src_install function. Runs emake install, unconditionally
273# DOCS and HTML_DOCS arrays are supported. See base.eclass(5) for reference. 286# DOCS and HTML_DOCS arrays are supported. See base.eclass(5) for reference.
274autotools-utils_src_install() { 287autotools-utils_src_install() {
275 debug-print-function ${FUNCNAME} "$@" 288 debug-print-function ${FUNCNAME} "$@"
276 289
277 _check_build_dir 290 _check_build_dir
278 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die 291 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
279 base_src_install "$@" 292 base_src_install "$@"
280 popd > /dev/null || die 293 popd > /dev/null
281 294
282 # Remove libtool files and unnecessary static libs 295 # Remove libtool files and unnecessary static libs
283 remove_libtool_files 296 remove_libtool_files
284} 297}
285 298
288# The autotools src_test function. Runs emake check in build directory. 301# The autotools src_test function. Runs emake check in build directory.
289autotools-utils_src_test() { 302autotools-utils_src_test() {
290 debug-print-function ${FUNCNAME} "$@" 303 debug-print-function ${FUNCNAME} "$@"
291 304
292 _check_build_dir 305 _check_build_dir
293 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die 306 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
294 # Run default src_test as defined in ebuild.sh 307 # Run default src_test as defined in ebuild.sh
295 default_src_test 308 default_src_test
296 popd > /dev/null || die 309 popd > /dev/null
297} 310}

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.29

  ViewVC Help
Powered by ViewVC 1.1.20