/[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.44
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.44 2012/01/19 21:49:38 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>
282 # Override this func to not require unnecessary eaclocal calls. 282 # Override this func to not require unnecessary eaclocal calls.
283 autotools_check_macro() { 283 autotools_check_macro() {
284 local x 284 local x
285 285
286 # Add a few additional variants as we don't get expansions. 286 # Add a few additional variants as we don't get expansions.
287 [[ ${1} = AC_CONFIG_HEADERS ]] && set -- "${@}" AC_CONFIG_HEADER 287 [[ ${1} = AC_CONFIG_HEADERS ]] && set -- "${@}" \
288 AC_CONFIG_HEADER AM_CONFIG_HEADER
288 289
289 for x; do 290 for x; do
290 grep -h "^${x}" configure.{ac,in} 2>/dev/null 291 grep -h "^${x}" configure.{ac,in} 2>/dev/null
291 done 292 done
292 } 293 }
393 || die 'autotools-utils.eclass: myeconfargs has to be an array.' 394 || die 'autotools-utils.eclass: myeconfargs has to be an array.'
394 395
395 [[ ${EAPI} == 2 ]] && ! use prefix && EPREFIX= 396 [[ ${EAPI} == 2 ]] && ! use prefix && EPREFIX=
396 397
397 # Common args 398 # Common args
398 local econfargs=( 399 local econfargs=()
400
401 _check_build_dir
402 if "${ECONF_SOURCE}"/configure --help 2>&1 | grep -q '^ *--docdir='; then
403 econfargs+=(
399 --docdir="${EPREFIX}/usr/share/doc/${PF}" 404 --docdir="${EPREFIX}"/usr/share/doc/${PF}
400 ) 405 )
406 fi
401 407
402 # Handle static-libs found in IUSE, disable them by default 408 # Handle static-libs found in IUSE, disable them by default
403 if in_iuse static-libs; then 409 if in_iuse static-libs; then
404 econfargs+=( 410 econfargs+=(
405 --enable-shared 411 --enable-shared
408 fi 414 fi
409 415
410 # Append user args 416 # Append user args
411 econfargs+=("${myeconfargs[@]}") 417 econfargs+=("${myeconfargs[@]}")
412 418
413 _check_build_dir
414 mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed" 419 mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed"
415 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null 420 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
416 econf "${econfargs[@]}" "$@" 421 econf "${econfargs[@]}" "$@"
417 popd > /dev/null 422 popd > /dev/null
418} 423}
444 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null 449 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
445 emake DESTDIR="${D}" "$@" install || die "emake install failed" 450 emake DESTDIR="${D}" "$@" install || die "emake install failed"
446 popd > /dev/null 451 popd > /dev/null
447 452
448 # Move docs installed by autotools (in EAPI < 4). 453 # Move docs installed by autotools (in EAPI < 4).
449 if [[ ${EAPI} == [23] && -d ${D}${EPREFIX}/usr/share/doc/${PF} ]]; then 454 if [[ ${EAPI} == [23] ]] \
455 && path_exists "${D}${EPREFIX}"/usr/share/doc/${PF}/*; then
456 if [[ $(find "${D}${EPREFIX}"/usr/share/doc/${PF}/* -type d) ]]; then
457 eqawarn "autotools-utils: directories in docdir require at least EAPI 4"
458 else
450 mkdir "${T}"/temp-docdir 459 mkdir "${T}"/temp-docdir
451 mv "${D}${EPREFIX}"/usr/share/doc/${PF}/* "${T}"/temp-docdir/ \ 460 mv "${D}${EPREFIX}"/usr/share/doc/${PF}/* "${T}"/temp-docdir/ \
452 || die "moving docs to tempdir failed" 461 || die "moving docs to tempdir failed"
453 462
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" 463 dodoc "${T}"/temp-docdir/* || die "docdir dodoc failed"
461 rm -r "${T}"/temp-docdir || die 464 rm -r "${T}"/temp-docdir || die
465 fi
462 fi 466 fi
463 467
464 # XXX: support installing them from builddir as well? 468 # XXX: support installing them from builddir as well?
465 if [[ ${DOCS} ]]; then 469 if [[ ${DOCS} ]]; then
466 dodoc "${DOCS[@]}" || die "dodoc failed" 470 dodoc "${DOCS[@]}" || die "dodoc failed"

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

  ViewVC Help
Powered by ViewVC 1.1.20