Bummer...
Forgot to attach file in question.

-- 
regards
MM
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

# @ECLASS: autotools-utils.eclass
# @MAINTAINER:
# reave...@gentoo.org
# @DESCRIPTION:
# autotools.eclass and base.eclass wrapper providing all inherited features 
along with:
# - myeconfargs - econf arguments as Bash array
# - out of source build (enabled by default) with overridable build dir location
# - static archives handling (static-libs in IUSE)
# - libtool archives removal (depending on static-libs USE flag)
# - enable/disable debug handling (debug in IUSE)

# Keep variable names synced with cmake-utils and the other way around!

case ${EAPI:-0} in
        2|3|4) ;;
        *) DEPEND="EAPI-TOO-OLD" ;;
esac

inherit autotools base

EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test

# Determine using IN or OUT source build
_check_build_dir() {
        # @ECLASS-VARIABLE: ECONF_SOURCE
        # @DESCRIPTION:
        # Sets the directory where we are working with autotools.
        # By default it uses ${S}.
        : ${ECONF_SOURCE:=${S}}

        # @ECLASS-VARIABLE: AUTOTOOLS_IN_SOURCE_BUILD
        # @DESCRIPTION:
        # Set to enable in-source build.
        if [[ -n ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
                # @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR
                # @DESCRIPTION:
                # Specify the build directory where all autotools generated
                # files should be located.
                # For installing binary doins "${AUTOTOOLS_BUILD_DIR}/somefile"
                AUTOTOOLS_BUILD_DIR="${ECONF_SOURCE}"
        else
                : ${AUTOTOOLS_BUILD_DIR:=${WORKDIR}/${P}_build}
        fi
        echo ">>> Working in BUILD_DIR: \"$AUTOTOOLS_BUILD_DIR\""
}

# @FUNCTION: autotools-utils_src_prepare
# @DESCRIPTION:
# The src_prepare function, which is exported EAPI is greater or equal to 2.
autotools-utils_src_prepare() {
        debug-print-function $FUNCNAME "$@"

        # TODO Maybe some smart patching and automatic eautoreconf call?
        base_src_prepare
}

# @FUNCTION: autotools-utils_src_configure
# @DESCRIPTION:
# The src_configure function, which is exported when EAPI is greater or equal
# to 2. Runs basic econf. Here the PATCHES array is evaluated.
autotools-utils_src_configure() {
        debug-print-function $FUNCNAME "$@"

        # @ECLASS-VARIABLE: myeconfargs
        # @DESCRIPTION:
        # econf arguments as Bash array
        local econfargs=(
                ${myeconfar...@]}
        )

        # Handle debug found in IUSE
        if has debug ${IUSE//+}; then
                econfargs+=($(use_enable debug))
        fi

        # Handle static-libs found in IUSE, disable them by default
        if has static-libs ${IUSE//+}; then
                econfargs+=(
                        --enable-shared
                        $(use_enable static-libs static)
                )
        fi

        _check_build_dir
        mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir 
'${AUTOTOOLS_BUILD_DIR}' failed"
        pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
        base_src_configure "${econfar...@]}"
        popd > /dev/null
}

# @FUNCTION: autotools-utils_src_compile
# @DESCRIPTION:
# The autotools src_compile function, calls src_configure with EAPI older
# than 2.
autotools-utils_src_compile() {
        debug-print-function $FUNCNAME "$@"

        _check_build_dir
        pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
        base_src_compile "$@"
        popd > /dev/null
}

# @FUNCTION: autotools-utils_src_install
# @DESCRIPTION:
# The autotools src_install function. Runs make install and removes libtool 
files.
autotools-utils_src_install() {
        debug-print-function $FUNCNAME "$@"

        _check_build_dir
        pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
        base_src_install
        popd > /dev/null

        # Remove libtool archives
        if has static-libs ${IUSE//+} && ! use static-libs; then
                find "${D}" -type f -name '*.la' -exec rm -f {} + \
                        || die 'libtool archive removal failed'
        fi
}

# @FUNCTION: autotools-utils_src_test
# @DESCRIPTION:
# The autotools src_test function. Runs emake check in source directory.
autotools-utils_src_test() {
        debug-print-function ${FUNCNAME} "$@"

        _check_build_dir
        pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
        default_src_test
        popd > /dev/null
}

Reply via email to