| 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.34 2012/01/14 14:41:10 mgorny Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.35 2012/01/14 14:50:05 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> |
| … | |
… | |
| 374 | debug-print-function ${FUNCNAME} "$@" |
374 | debug-print-function ${FUNCNAME} "$@" |
| 375 | |
375 | |
| 376 | [[ -z ${myeconfargs+1} || $(declare -p myeconfargs) == 'declare -a'* ]] \ |
376 | [[ -z ${myeconfargs+1} || $(declare -p myeconfargs) == 'declare -a'* ]] \ |
| 377 | || die 'autotools-utils.eclass: myeconfargs has to be an array.' |
377 | || die 'autotools-utils.eclass: myeconfargs has to be an array.' |
| 378 | |
378 | |
|
|
379 | [[ ${EAPI} == 2 ]] && ! use prefix && EPREFIX= |
|
|
380 | |
| 379 | # Common args |
381 | # Common args |
| 380 | local econfargs=() |
382 | local econfargs=( |
|
|
383 | --docdir="${EPREFIX}/usr/share/doc/${PF}" |
|
|
384 | ) |
| 381 | |
385 | |
| 382 | # Handle static-libs found in IUSE, disable them by default |
386 | # Handle static-libs found in IUSE, disable them by default |
| 383 | if in_iuse static-libs; then |
387 | if in_iuse static-libs; then |
| 384 | econfargs+=( |
388 | econfargs+=( |
| 385 | --enable-shared |
389 | --enable-shared |
| … | |
… | |
| 422 | |
426 | |
| 423 | _check_build_dir |
427 | _check_build_dir |
| 424 | pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null |
428 | pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null |
| 425 | emake DESTDIR="${D}" "$@" install || die "emake install failed" |
429 | emake DESTDIR="${D}" "$@" install || die "emake install failed" |
| 426 | popd > /dev/null |
430 | popd > /dev/null |
|
|
431 | |
|
|
432 | # Move docs installed by autotools (in EAPI < 4). |
|
|
433 | if [[ ${EAPI} == [23] && -d ${D}${EPREFIX}/usr/share/doc/${PF} ]]; then |
|
|
434 | mkdir "${T}"/temp-docdir |
|
|
435 | mv "${D}${EPREFIX}"/usr/share/doc/${PF}/* "${T}"/temp-docdir/ \ |
|
|
436 | || die "moving docs to tempdir failed" |
|
|
437 | |
|
|
438 | local f |
|
|
439 | for f in "${T}"/temp-docdir/*; do |
|
|
440 | [[ -d ${f} ]] \ |
|
|
441 | && die "directories in docdir require at least EAPI 4" |
|
|
442 | done |
|
|
443 | |
|
|
444 | dodoc "${T}"/temp-docdir/* || die "docdir dodoc failed" |
|
|
445 | rm -r "${T}"/temp-docdir || die |
|
|
446 | fi |
| 427 | |
447 | |
| 428 | # XXX: support installing them from builddir as well? |
448 | # XXX: support installing them from builddir as well? |
| 429 | if [[ ${DOCS} ]]; then |
449 | if [[ ${DOCS} ]]; then |
| 430 | dodoc "${DOCS[@]}" || die "dodoc failed" |
450 | dodoc "${DOCS[@]}" || die "dodoc failed" |
| 431 | else |
451 | else |