diff options
author | 2015-06-02 04:27:35 +0000 | |
---|---|---|
committer | 2015-06-02 04:27:35 +0000 | |
commit | 04e5e719072c96d40da1121a503192cf00fdcb05 (patch) | |
tree | 81d5bfee62a0516b5c302bd16fcdfde663fb78ba /eclass/linux-info.eclass | |
parent | add slot dep for repoman (diff) | |
download | historical-04e5e719072c96d40da1121a503192cf00fdcb05.tar.gz historical-04e5e719072c96d40da1121a503192cf00fdcb05.tar.bz2 historical-04e5e719072c96d40da1121a503192cf00fdcb05.zip |
fix looking up output dir when cross-compiling (fix by Nam Nguyen from Chromium OS)
Diffstat (limited to 'eclass/linux-info.eclass')
-rw-r--r-- | eclass/linux-info.eclass | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass index 1ad84f4bd612..3a766a588f94 100644 --- a/eclass/linux-info.eclass +++ b/eclass/linux-info.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.105 2015/05/09 08:03:40 ulm Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.106 2015/06/02 04:27:35 vapier Exp $ # @ECLASS: linux-info.eclass # @MAINTAINER: @@ -529,7 +529,15 @@ get_version() { # but before we do this, we need to find if we use a different object directory. # This *WILL* break if the user is using localversions, but we assume it was # caught before this if they are. - OUTPUT_DIR="${OUTPUT_DIR:-/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build}" + if [[ -z ${OUTPUT_DIR} ]] ; then + # Try to locate a kernel that is most relevant for us. + for OUTPUT_DIR in "${SYROOT}" "${ROOT}" "" ; do + OUTPUT_DIR+="/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build" + if [[ -e ${OUTPUT_DIR} ]] ; then + break + fi + done + fi [ -h "${OUTPUT_DIR}" ] && KV_OUT_DIR="$(readlink -f ${OUTPUT_DIR})" [ -d "${OUTPUT_DIR}" ] && KV_OUT_DIR="${OUTPUT_DIR}" |