summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2012-12-03 09:29:09 +0000
committerMichał Górny <mgorny@gentoo.org>2012-12-03 09:29:09 +0000
commit06f9af451ed8c080d359a185ae8ac1b7493f0ff5 (patch)
tree409e8eef551b140dcae895563a080fd4099408f1 /eclass
parentBumping to 1.1, cleaning up, fixing bug #445730 (diff)
downloadgentoo-2-06f9af451ed8c080d359a185ae8ac1b7493f0ff5.tar.gz
gentoo-2-06f9af451ed8c080d359a185ae8ac1b7493f0ff5.tar.bz2
gentoo-2-06f9af451ed8c080d359a185ae8ac1b7493f0ff5.zip
Fix respecting AUTOTOOLS_BUILD_DIR and CMAKE_BUILD_DIR. Acked by scarabeus.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog6
-rw-r--r--eclass/autotools-utils.eclass20
-rw-r--r--eclass/cmake-utils.eclass20
3 files changed, 40 insertions, 6 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 33cf6ec6b09d..2e3a901f31b8 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.541 2012/12/02 17:16:20 eva Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.542 2012/12/03 09:29:09 mgorny Exp $
+
+ 03 Dec 2012; Michał Górny <mgorny@gentoo.org> autotools-utils.eclass,
+ cmake-utils.eclass:
+ Fix respecting AUTOTOOLS_BUILD_DIR and CMAKE_BUILD_DIR. Acked by scarabeus.
02 Dec 2012; Gilles Dartiguelongue <eva@gentoo.org> gst-plugins-bad.eclass,
gst-plugins-base.eclass, gst-plugins-good.eclass, gst-plugins-ugly.eclass,
diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index b17b6d3992b2..3bdb9abe1a73 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.58 2012/12/01 16:26:03 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.59 2012/12/03 09:29:09 mgorny Exp $
# @ECLASS: autotools-utils.eclass
# @MAINTAINER:
@@ -188,10 +188,24 @@ _check_build_dir() {
if [[ -n ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
BUILD_DIR="${ECONF_SOURCE}"
else
- : ${BUILD_DIR:=${AUTOTOOLS_BUILD_DIR:-${WORKDIR}/${P}_build}}
+ # Respect both the old variable and the new one, depending
+ # on which one was set by the ebuild.
+ if [[ ! ${BUILD_DIR} && ${AUTOTOOLS_BUILD_DIR} ]]; then
+ eqawarn "The AUTOTOOLS_BUILD_DIR variable has been renamed to BUILD_DIR."
+ eqawarn "Please migrate the ebuild to use the new one."
+
+ # In the next call, both variables will be set already
+ # and we'd have to know which one takes precedence.
+ _RESPECT_AUTOTOOLS_BUILD_DIR=1
+ fi
+ if [[ ${_RESPECT_AUTOTOOLS_BUILD_DIR} ]]; then
+ BUILD_DIR=${AUTOTOOLS_BUILD_DIR}
+ fi
+
+ : ${BUILD_DIR:=${WORKDIR}/${P}_build}
fi
- # Backwards compatibility.
+ # Backwards compatibility for getting the value.
AUTOTOOLS_BUILD_DIR=${BUILD_DIR}
echo ">>> Working in BUILD_DIR: \"${BUILD_DIR}\""
}
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index 8424b4e9a917..9f1b8bacf8c1 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.86 2012/12/01 16:26:03 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.87 2012/12/03 09:29:09 mgorny Exp $
# @ECLASS: cmake-utils.eclass
# @MAINTAINER:
@@ -168,8 +168,24 @@ _check_build_dir() {
# we build in source dir
BUILD_DIR="${CMAKE_USE_DIR}"
else
- : ${BUILD_DIR:=${CMAKE_BUILD_DIR:-${WORKDIR}/${P}_build}}
+ # Respect both the old variable and the new one, depending
+ # on which one was set by the ebuild.
+ if [[ ! ${BUILD_DIR} && ${AUTOTOOLS_BUILD_DIR} ]]; then
+ eqawarn "The AUTOTOOLS_BUILD_DIR variable has been renamed to BUILD_DIR."
+ eqawarn "Please migrate the ebuild to use the new one."
+
+ # In the next call, both variables will be set already
+ # and we'd have to know which one takes precedence.
+ _RESPECT_AUTOTOOLS_BUILD_DIR=1
+ fi
+ if [[ ${_RESPECT_AUTOTOOLS_BUILD_DIR} ]]; then
+ BUILD_DIR=${AUTOTOOLS_BUILD_DIR}
+ fi
+
+ : ${BUILD_DIR:=${WORKDIR}/${P}_build}
fi
+
+ # Backwards compatibility for getting the value.
CMAKE_BUILD_DIR=${BUILD_DIR}
mkdir -p "${BUILD_DIR}"