summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-02-10 07:53:31 +0000
committerMike Frysinger <vapier@gentoo.org>2013-02-10 07:53:31 +0000
commit5fda18984ef60a779c5fab434a3df10f447e9a0f (patch)
tree4ba1ae756a4874a6b32913fc2bdb06a2129a61d3 /eclass
parentDrop old (diff)
downloadhistorical-5fda18984ef60a779c5fab434a3df10f447e9a0f.tar.gz
historical-5fda18984ef60a779c5fab434a3df10f447e9a0f.tar.bz2
historical-5fda18984ef60a779c5fab434a3df10f447e9a0f.zip
if KERNEL_DIR is pointing to the object output, figure out the source dir and setup KBUILD_OUTPUT automatically #454294 by Łukasz Stelmach
Diffstat (limited to 'eclass')
-rw-r--r--eclass/linux-info.eclass11
1 files changed, 9 insertions, 2 deletions
diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
index ec922250f92b..b39acbfb1a23 100644
--- a/eclass/linux-info.eclass
+++ b/eclass/linux-info.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.99 2013/02/10 06:20:10 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.100 2013/02/10 07:53:31 vapier Exp $
# @ECLASS: linux-info.eclass
# @MAINTAINER:
@@ -462,6 +462,13 @@ get_version() {
return 1
fi
+ # See if the kernel dir is actually an output dir. #454294
+ if [ -z "${KBUILD_OUTPUT}" -a -L "${KERNEL_DIR}/source" ]; then
+ KBUILD_OUTPUT=${KERNEL_DIR}
+ KERNEL_DIR=$(readlink -f "${KERNEL_DIR}/source")
+ KV_DIR=${KERNEL_DIR}
+ fi
+
if [ -z "${get_version_warning_done}" ]; then
qeinfo "Found kernel source directory:"
qeinfo " ${KV_DIR}"
@@ -481,7 +488,7 @@ get_version() {
# KBUILD_OUTPUT, and we need this for .config and localversions-*
# so we better find it eh?
# do we pass KBUILD_OUTPUT on the CLI?
- OUTPUT_DIR="${OUTPUT_DIR:-${KBUILD_OUTPUT}}"
+ local OUTPUT_DIR=${KBUILD_OUTPUT}
# keep track of it
KERNEL_MAKEFILE="${KV_DIR}/Makefile"