vapier 15/06/02 04:27:35 Modified: linux-info.eclass Log: fix looking up output dir when cross-compiling (fix by Nam Nguyen from Chromium OS)
Revision Changes Path 1.106 eclass/linux-info.eclass file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.106&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.106&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.105&r2=1.106 Index: linux-info.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v retrieving revision 1.105 retrieving revision 1.106 diff -u -r1.105 -r1.106 --- linux-info.eclass 9 May 2015 08:03:40 -0000 1.105 +++ linux-info.eclass 2 Jun 2015 04:27:35 -0000 1.106 @@ -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 @@ # 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}"
