/[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.38 Revision 1.41
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.38 2012/01/14 15:18:05 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.41 2012/01/15 14:05:14 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>
393 || die 'autotools-utils.eclass: myeconfargs has to be an array.' 393 || die 'autotools-utils.eclass: myeconfargs has to be an array.'
394 394
395 [[ ${EAPI} == 2 ]] && ! use prefix && EPREFIX= 395 [[ ${EAPI} == 2 ]] && ! use prefix && EPREFIX=
396 396
397 # Common args 397 # Common args
398 local econfargs=( 398 local econfargs=()
399
400 _check_build_dir
401 if "${ECONF_SOURCE}"/configure --help 2>&1 | grep docdir; then
402 econfargs+=(
399 --docdir="${EPREFIX}/usr/share/doc/${PF}" 403 --docdir="${EPREFIX}"/usr/share/doc/${PF}
400 ) 404 )
405 fi
401 406
402 # Handle static-libs found in IUSE, disable them by default 407 # Handle static-libs found in IUSE, disable them by default
403 if in_iuse static-libs; then 408 if in_iuse static-libs; then
404 econfargs+=( 409 econfargs+=(
405 --enable-shared 410 --enable-shared
408 fi 413 fi
409 414
410 # Append user args 415 # Append user args
411 econfargs+=("${myeconfargs[@]}") 416 econfargs+=("${myeconfargs[@]}")
412 417
413 _check_build_dir
414 mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed" 418 mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed"
415 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null 419 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
416 econf "${econfargs[@]}" "$@" 420 econf "${econfargs[@]}" "$@"
417 popd > /dev/null 421 popd > /dev/null
418} 422}
444 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null 448 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
445 emake DESTDIR="${D}" "$@" install || die "emake install failed" 449 emake DESTDIR="${D}" "$@" install || die "emake install failed"
446 popd > /dev/null 450 popd > /dev/null
447 451
448 # Move docs installed by autotools (in EAPI < 4). 452 # Move docs installed by autotools (in EAPI < 4).
449 if [[ ${EAPI} == [23] && -d ${D}${EPREFIX}/usr/share/doc/${PF} ]]; then 453 if [[ ${EAPI} == [23] ]] \
454 && path_exists "${D}${EPREFIX}"/usr/share/doc/${PF}/*; then
455 if [[ $(find "${D}${EPREFIX}"/usr/share/doc/${PF}/* -type d) ]]; then
456 eqawarn "autotools-utils: directories in docdir require at least EAPI 4"
457 else
450 mkdir "${T}"/temp-docdir 458 mkdir "${T}"/temp-docdir
451 mv "${D}${EPREFIX}"/usr/share/doc/${PF}/* "${T}"/temp-docdir/ \ 459 mv "${D}${EPREFIX}"/usr/share/doc/${PF}/* "${T}"/temp-docdir/ \
452 || die "moving docs to tempdir failed" 460 || die "moving docs to tempdir failed"
453 461
454 local f
455 for f in "${T}"/temp-docdir/*; do
456 [[ -d ${f} ]] \
457 && die "directories in docdir require at least EAPI 4"
458 done
459
460 dodoc "${T}"/temp-docdir/* || die "docdir dodoc failed" 462 dodoc "${T}"/temp-docdir/* || die "docdir dodoc failed"
461 rm -r "${T}"/temp-docdir || die 463 rm -r "${T}"/temp-docdir || die
464 fi
462 fi 465 fi
463 466
464 # XXX: support installing them from builddir as well? 467 # XXX: support installing them from builddir as well?
465 if [[ ${DOCS} ]]; then 468 if [[ ${DOCS} ]]; then
466 dodoc "${DOCS[@]}" || die "dodoc failed" 469 dodoc "${DOCS[@]}" || die "dodoc failed"

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.41

  ViewVC Help
Powered by ViewVC 1.1.20