diff mbox

[7/9] Fix fragile kernelsourcedir construction

Message ID 20090925161801.3328.31043.stgit@mchn012c.ww002.siemens.net (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kiszka Sept. 25, 2009, 4:18 p.m. UTC
So far, passing --kerneldir=/some/kernel/build could cause broken kernel
source paths as '/build' was incorrectly cut off. Use a smarter
approach.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 configure |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/configure b/configure
index e01ba98..533313e 100755
--- a/configure
+++ b/configure
@@ -91,7 +91,10 @@  arch=${arch%%-*}
 
 # see if we have split build and source directories
 if [ -d "$kerneldir/include2" ]; then
-    kernelsourcedir=${kerneldir%/*}/source
+    kernelsourcedir=$kerneldir/source
+    if [ ! -L "$kernelsourcedir" ]; then
+        kernelsourcedir=${kerneldir%/build*}/source
+    fi
 fi
 
 if [ -n "$no_uname" -a "$want_module" ]; then