summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2012-12-01 16:26:03 +0000
committerMichał Górny <mgorny@gentoo.org>2012-12-01 16:26:03 +0000
commit8e6d3852a3d1632d16d848b0cb7fdd67f6b69392 (patch)
tree08dba0be9797ef638c79b4307d0f8b842ad4e8a8
parentstable arm ppc64, bug #444672 (diff)
downloadgentoo-2-8e6d3852a3d1632d16d848b0cb7fdd67f6b69392.tar.gz
gentoo-2-8e6d3852a3d1632d16d848b0cb7fdd67f6b69392.tar.bz2
gentoo-2-8e6d3852a3d1632d16d848b0cb7fdd67f6b69392.zip
Use a common BUILD_DIR variable. Acked by scarabeus.
-rw-r--r--eclass/ChangeLog6
-rw-r--r--eclass/autotools-multilib.eclass10
-rw-r--r--eclass/autotools-utils.eclass32
-rw-r--r--eclass/cmake-utils.eclass35
4 files changed, 50 insertions, 33 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 9bd09c335829..afa37bf6c109 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for eclass directory
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.537 2012/12/01 10:54:50 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.538 2012/12/01 16:26:03 mgorny Exp $
+
+ 01 Dec 2012; Michał Górny <mgorny@gentoo.org> autotools-multilib.eclass,
+ autotools-utils.eclass, cmake-utils.eclass:
+ Use a common BUILD_DIR variable. Acked by scarabeus.
01 Dec 2012; Michał Górny <mgorny@gentoo.org> distutils-r1.eclass:
Support parallel builds using multiprocessing eclass.
diff --git a/eclass/autotools-multilib.eclass b/eclass/autotools-multilib.eclass
index f6d1feb3051c..fe6372d42267 100644
--- a/eclass/autotools-multilib.eclass
+++ b/eclass/autotools-multilib.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-multilib.eclass,v 1.1 2012/10/08 18:44:30 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-multilib.eclass,v 1.2 2012/12/01 16:26:03 mgorny Exp $
# @ECLASS: autotools-multilib.eclass
# @MAINTAINER:
@@ -38,17 +38,19 @@ IUSE=multilib
# @USAGE: argv...
# @DESCRIPTION:
# If multilib support is enabled, sets the toolchain up for each
-# supported ABI along with the ABI variable and correct
-# AUTOTOOLS_BUILD_DIR, and runs the given commands with them.
+# supported ABI along with the ABI variable and correct BUILD_DIR,
+# and runs the given commands with them.
#
# If multilib support is disabled, it just runs the commands. No setup
# is done.
autotools-multilib_foreach_abi() {
+ local initial_dir=${BUILD_DIR:-${S}}
+
if use multilib; then
local ABI
for ABI in $(get_all_abis); do
multilib_toolchain_setup "${ABI}"
- AUTOTOOLS_BUILD_DIR=${S%%/}-${ABI} "${@}"
+ BUILD_DIR=${initial_dir%%/}-${ABI} "${@}"
done
else
"${@}"
diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index b035dc5907be..b17b6d3992b2 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.57 2012/09/27 16:35:41 axs Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.58 2012/12/01 16:26:03 mgorny Exp $
# @ECLASS: autotools-utils.eclass
# @MAINTAINER:
@@ -76,10 +76,10 @@
# }
#
# src_install() {
-# use doc && HTML_DOCS=("${AUTOTOOLS_BUILD_DIR}/apidocs/html/")
+# use doc && HTML_DOCS=("${BUILD_DIR}/apidocs/html/")
# autotools-utils_src_install
# if use examples; then
-# dobin "${AUTOTOOLS_BUILD_DIR}"/foo_example{1,2,3} \\
+# dobin "${BUILD_DIR}"/foo_example{1,2,3} \\
# || die 'dobin examples failed'
# fi
# }
@@ -117,11 +117,14 @@ inherit autotools eutils libtool
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
-# @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR
+# @ECLASS-VARIABLE: BUILD_DIR
# @DEFAULT_UNSET
# @DESCRIPTION:
# Build directory, location where all autotools generated files should be
# placed. For out of source builds it defaults to ${WORKDIR}/${P}_build.
+#
+# This variable has been called AUTOTOOLS_BUILD_DIR formerly.
+# It is set under that name for compatibility.
# @ECLASS-VARIABLE: AUTOTOOLS_IN_SOURCE_BUILD
# @DEFAULT_UNSET
@@ -183,11 +186,14 @@ EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
_check_build_dir() {
: ${ECONF_SOURCE:=${S}}
if [[ -n ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
- AUTOTOOLS_BUILD_DIR="${ECONF_SOURCE}"
+ BUILD_DIR="${ECONF_SOURCE}"
else
- : ${AUTOTOOLS_BUILD_DIR:=${WORKDIR}/${P}_build}
+ : ${BUILD_DIR:=${AUTOTOOLS_BUILD_DIR:-${WORKDIR}/${P}_build}}
fi
- echo ">>> Working in BUILD_DIR: \"$AUTOTOOLS_BUILD_DIR\""
+
+ # Backwards compatibility.
+ AUTOTOOLS_BUILD_DIR=${BUILD_DIR}
+ echo ">>> Working in BUILD_DIR: \"${BUILD_DIR}\""
}
# @FUNCTION: remove_libtool_files
@@ -413,20 +419,20 @@ autotools-utils_src_configure() {
# Append user args
econfargs+=("${myeconfargs[@]}")
- mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed"
- pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
+ mkdir -p "${BUILD_DIR}" || die
+ pushd "${BUILD_DIR}" > /dev/null || die
econf "${econfargs[@]}" "$@"
popd > /dev/null || die
}
# @FUNCTION: autotools-utils_src_compile
# @DESCRIPTION:
-# The autotools src_compile function, invokes emake in specified AUTOTOOLS_BUILD_DIR.
+# The autotools src_compile function, invokes emake in specified BUILD_DIR.
autotools-utils_src_compile() {
debug-print-function ${FUNCNAME} "$@"
_check_build_dir
- pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
+ pushd "${BUILD_DIR}" > /dev/null || die
emake "$@" || die 'emake failed'
popd > /dev/null || die
}
@@ -443,7 +449,7 @@ autotools-utils_src_install() {
debug-print-function ${FUNCNAME} "$@"
_check_build_dir
- pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
+ pushd "${BUILD_DIR}" > /dev/null || die
emake DESTDIR="${D}" "$@" install || die "emake install failed"
popd > /dev/null || die
@@ -490,7 +496,7 @@ autotools-utils_src_test() {
debug-print-function ${FUNCNAME} "$@"
_check_build_dir
- pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
+ pushd "${BUILD_DIR}" > /dev/null || die
# Run default src_test as defined in ebuild.sh
default_src_test
popd > /dev/null || die
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index 2129ebf0740a..8424b4e9a917 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.85 2012/10/25 12:48:58 scarabeus Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.86 2012/12/01 16:26:03 mgorny Exp $
# @ECLASS: cmake-utils.eclass
# @MAINTAINER:
@@ -114,12 +114,15 @@ _use_me_now_inverted() {
fi
}
-# @ECLASS-VARIABLE: CMAKE_BUILD_DIR
+# @ECLASS-VARIABLE: BUILD_DIR
# @DESCRIPTION:
# Build directory where all cmake processed files should be generated.
# For in-source build it's fixed to ${CMAKE_USE_DIR}.
# For out-of-source build it can be overriden, by default it uses
# ${WORKDIR}/${P}_build.
+#
+# This variable has been called CMAKE_BUILD_DIR formerly.
+# It is set under that name for compatibility.
# @ECLASS-VARIABLE: CMAKE_BUILD_TYPE
# @DESCRIPTION:
@@ -163,12 +166,14 @@ _check_build_dir() {
: ${CMAKE_USE_DIR:=${S}}
if [[ -n ${CMAKE_IN_SOURCE_BUILD} ]]; then
# we build in source dir
- CMAKE_BUILD_DIR="${CMAKE_USE_DIR}"
+ BUILD_DIR="${CMAKE_USE_DIR}"
else
- : ${CMAKE_BUILD_DIR:=${WORKDIR}/${P}_build}
+ : ${BUILD_DIR:=${CMAKE_BUILD_DIR:-${WORKDIR}/${P}_build}}
fi
- mkdir -p "${CMAKE_BUILD_DIR}"
- echo ">>> Working in BUILD_DIR: \"$CMAKE_BUILD_DIR\""
+ CMAKE_BUILD_DIR=${BUILD_DIR}
+
+ mkdir -p "${BUILD_DIR}"
+ echo ">>> Working in BUILD_DIR: \"$BUILD_DIR\""
}
# Determine which generator to use
@@ -328,7 +333,7 @@ enable_cmake-utils_src_configure() {
fi
# Prepare Gentoo override rules (set valid compiler, append CPPFLAGS etc.)
- local build_rules=${CMAKE_BUILD_DIR}/gentoo_rules.cmake
+ local build_rules=${BUILD_DIR}/gentoo_rules.cmake
cat > "${build_rules}" <<- _EOF_
SET (CMAKE_AR $(type -P $(tc-getAR)) CACHE FILEPATH "Archive manager" FORCE)
SET (CMAKE_C_COMPILER $(type -P $(tc-getCC)) CACHE FILEPATH "C compiler" FORCE)
@@ -364,7 +369,7 @@ enable_cmake-utils_src_configure() {
fi
# Common configure parameters (invariants)
- local common_config=${CMAKE_BUILD_DIR}/gentoo_common_config.cmake
+ local common_config=${BUILD_DIR}/gentoo_common_config.cmake
local libdir=$(get_libdir)
cat > "${common_config}" <<- _EOF_
SET (LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE)
@@ -396,7 +401,7 @@ enable_cmake-utils_src_configure() {
"${MYCMAKEARGS}"
)
- pushd "${CMAKE_BUILD_DIR}" > /dev/null
+ pushd "${BUILD_DIR}" > /dev/null
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}"
echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}"
"${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed"
@@ -418,7 +423,7 @@ cmake-utils_src_make() {
debug-print-function ${FUNCNAME} "$@"
_check_build_dir
- pushd "${CMAKE_BUILD_DIR}" > /dev/null
+ pushd "${BUILD_DIR}" > /dev/null
if [[ $(_generator_to_use) = Ninja ]]; then
# first check if Makefile exist otherwise die
[[ -e build.ninja ]] || die "Makefile not found. Error during configure stage."
@@ -444,7 +449,7 @@ enable_cmake-utils_src_install() {
debug-print-function ${FUNCNAME} "$@"
_check_build_dir
- pushd "${CMAKE_BUILD_DIR}" > /dev/null
+ pushd "${BUILD_DIR}" > /dev/null
if [[ $(_generator_to_use) = Ninja ]]; then
DESTDIR=${D} ninja install "$@" || die "died running ninja install"
base_src_install_docs
@@ -467,7 +472,7 @@ enable_cmake-utils_src_test() {
local ctestargs
_check_build_dir
- pushd "${CMAKE_BUILD_DIR}" > /dev/null
+ pushd "${BUILD_DIR}" > /dev/null
[[ -e CTestTestfile.cmake ]] || { echo "No tests found. Skipping."; return 0 ; }
[[ -n ${TEST_VERBOSE} ]] && ctestargs="--extra-verbose --output-on-failure"
@@ -479,13 +484,13 @@ enable_cmake-utils_src_test() {
else
if [[ -n "${CMAKE_YES_I_WANT_TO_SEE_THE_TEST_LOG}" ]] ; then
# on request from Diego
- eerror "Tests failed. Test log ${CMAKE_BUILD_DIR}/Testing/Temporary/LastTest.log follows:"
+ eerror "Tests failed. Test log ${BUILD_DIR}/Testing/Temporary/LastTest.log follows:"
eerror "--START TEST LOG--------------------------------------------------------------"
- cat "${CMAKE_BUILD_DIR}/Testing/Temporary/LastTest.log"
+ cat "${BUILD_DIR}/Testing/Temporary/LastTest.log"
eerror "--END TEST LOG----------------------------------------------------------------"
die "Tests failed."
else
- die "Tests failed. When you file a bug, please attach the following file: \n\t${CMAKE_BUILD_DIR}/Testing/Temporary/LastTest.log"
+ die "Tests failed. When you file a bug, please attach the following file: \n\t${BUILD_DIR}/Testing/Temporary/LastTest.log"
fi
# die might not die due to nonfatal