/[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.57 Revision 1.58
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 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.57 2012/09/27 16:35:41 axs Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.58 2012/12/01 16:26:03 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>
74# autotools-utils_src_compile 74# autotools-utils_src_compile
75# use doc && autotools-utils_src_compile docs 75# use doc && autotools-utils_src_compile docs
76# } 76# }
77# 77#
78# src_install() { 78# src_install() {
79# use doc && HTML_DOCS=("${AUTOTOOLS_BUILD_DIR}/apidocs/html/") 79# use doc && HTML_DOCS=("${BUILD_DIR}/apidocs/html/")
80# autotools-utils_src_install 80# autotools-utils_src_install
81# if use examples; then 81# if use examples; then
82# dobin "${AUTOTOOLS_BUILD_DIR}"/foo_example{1,2,3} \\ 82# dobin "${BUILD_DIR}"/foo_example{1,2,3} \\
83# || die 'dobin examples failed' 83# || die 'dobin examples failed'
84# fi 84# fi
85# } 85# }
86# 86#
87# @CODE 87# @CODE
115 115
116inherit autotools eutils libtool 116inherit autotools eutils libtool
117 117
118EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test 118EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
119 119
120# @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR 120# @ECLASS-VARIABLE: BUILD_DIR
121# @DEFAULT_UNSET 121# @DEFAULT_UNSET
122# @DESCRIPTION: 122# @DESCRIPTION:
123# Build directory, location where all autotools generated files should be 123# Build directory, location where all autotools generated files should be
124# placed. For out of source builds it defaults to ${WORKDIR}/${P}_build. 124# placed. For out of source builds it defaults to ${WORKDIR}/${P}_build.
125#
126# This variable has been called AUTOTOOLS_BUILD_DIR formerly.
127# It is set under that name for compatibility.
125 128
126# @ECLASS-VARIABLE: AUTOTOOLS_IN_SOURCE_BUILD 129# @ECLASS-VARIABLE: AUTOTOOLS_IN_SOURCE_BUILD
127# @DEFAULT_UNSET 130# @DEFAULT_UNSET
128# @DESCRIPTION: 131# @DESCRIPTION:
129# Set to enable in-source build. 132# Set to enable in-source build.
181 184
182# Determine using IN or OUT source build 185# Determine using IN or OUT source build
183_check_build_dir() { 186_check_build_dir() {
184 : ${ECONF_SOURCE:=${S}} 187 : ${ECONF_SOURCE:=${S}}
185 if [[ -n ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then 188 if [[ -n ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
186 AUTOTOOLS_BUILD_DIR="${ECONF_SOURCE}" 189 BUILD_DIR="${ECONF_SOURCE}"
187 else 190 else
188 : ${AUTOTOOLS_BUILD_DIR:=${WORKDIR}/${P}_build} 191 : ${BUILD_DIR:=${AUTOTOOLS_BUILD_DIR:-${WORKDIR}/${P}_build}}
189 fi 192 fi
193
194 # Backwards compatibility.
195 AUTOTOOLS_BUILD_DIR=${BUILD_DIR}
190 echo ">>> Working in BUILD_DIR: \"$AUTOTOOLS_BUILD_DIR\"" 196 echo ">>> Working in BUILD_DIR: \"${BUILD_DIR}\""
191} 197}
192 198
193# @FUNCTION: remove_libtool_files 199# @FUNCTION: remove_libtool_files
194# @USAGE: [all] 200# @USAGE: [all]
195# @DESCRIPTION: 201# @DESCRIPTION:
411 fi 417 fi
412 418
413 # Append user args 419 # Append user args
414 econfargs+=("${myeconfargs[@]}") 420 econfargs+=("${myeconfargs[@]}")
415 421
416 mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed" 422 mkdir -p "${BUILD_DIR}" || die
417 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die 423 pushd "${BUILD_DIR}" > /dev/null || die
418 econf "${econfargs[@]}" "$@" 424 econf "${econfargs[@]}" "$@"
419 popd > /dev/null || die 425 popd > /dev/null || die
420} 426}
421 427
422# @FUNCTION: autotools-utils_src_compile 428# @FUNCTION: autotools-utils_src_compile
423# @DESCRIPTION: 429# @DESCRIPTION:
424# The autotools src_compile function, invokes emake in specified AUTOTOOLS_BUILD_DIR. 430# The autotools src_compile function, invokes emake in specified BUILD_DIR.
425autotools-utils_src_compile() { 431autotools-utils_src_compile() {
426 debug-print-function ${FUNCNAME} "$@" 432 debug-print-function ${FUNCNAME} "$@"
427 433
428 _check_build_dir 434 _check_build_dir
429 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die 435 pushd "${BUILD_DIR}" > /dev/null || die
430 emake "$@" || die 'emake failed' 436 emake "$@" || die 'emake failed'
431 popd > /dev/null || die 437 popd > /dev/null || die
432} 438}
433 439
434# @FUNCTION: autotools-utils_src_install 440# @FUNCTION: autotools-utils_src_install
441# DOCS and HTML_DOCS arrays are supported. See base.eclass(5) for reference. 447# DOCS and HTML_DOCS arrays are supported. See base.eclass(5) for reference.
442autotools-utils_src_install() { 448autotools-utils_src_install() {
443 debug-print-function ${FUNCNAME} "$@" 449 debug-print-function ${FUNCNAME} "$@"
444 450
445 _check_build_dir 451 _check_build_dir
446 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die 452 pushd "${BUILD_DIR}" > /dev/null || die
447 emake DESTDIR="${D}" "$@" install || die "emake install failed" 453 emake DESTDIR="${D}" "$@" install || die "emake install failed"
448 popd > /dev/null || die 454 popd > /dev/null || die
449 455
450 # Move docs installed by autotools (in EAPI < 4). 456 # Move docs installed by autotools (in EAPI < 4).
451 if [[ ${EAPI} == [23] ]] \ 457 if [[ ${EAPI} == [23] ]] \
488# The autotools src_test function. Runs emake check in build directory. 494# The autotools src_test function. Runs emake check in build directory.
489autotools-utils_src_test() { 495autotools-utils_src_test() {
490 debug-print-function ${FUNCNAME} "$@" 496 debug-print-function ${FUNCNAME} "$@"
491 497
492 _check_build_dir 498 _check_build_dir
493 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die 499 pushd "${BUILD_DIR}" > /dev/null || die
494 # Run default src_test as defined in ebuild.sh 500 # Run default src_test as defined in ebuild.sh
495 default_src_test 501 default_src_test
496 popd > /dev/null || die 502 popd > /dev/null || die
497} 503}

Legend:
Removed from v.1.57  
changed lines
  Added in v.1.58

  ViewVC Help
Powered by ViewVC 1.1.20