Fixed bad configure behavior with complex kernel version strings.
authorFlorian Pose <fp@igh-essen.com>
Mon, 15 Jan 2007 09:49:07 +0000
changeset 537 c715766e0f81
parent 536 330f7f8da979
child 538 84beb49d1b11
Fixed bad configure behavior with complex kernel version strings.
configure.ac
--- a/configure.ac	Fri Jan 12 15:18:11 2007 +0000
+++ b/configure.ac	Mon Jan 15 09:49:07 2007 +0000
@@ -50,10 +50,10 @@
 fi
 
 # Try to get kernel release string
-if test -r ${sourcedir}/.kernelrelease; then
+if test -r ${sourcedir}/include/config/kernel.release; then
+    kernelrelease=`cat $sourcedir/include/config/kernel.release`
+elif test -r ${sourcedir}/.kernelrelease; then
     kernelrelease=`cat $sourcedir/.kernelrelease`
-elif test -r ${sourcedir}/include/config/kernel.release; then
-    kernelrelease=`cat $sourcedir/include/config/kernel.release`
 elif test -r ${sourcedir}/include/linux/utsrelease.h; then
     hdr=${sourcedir}/include/linux/utsrelease.h
     kernelrelease=`grep UTS_RELEASE $hdr | cut -d " " -f 3- | tr -d \"`
@@ -68,7 +68,7 @@
 fi
 
 # Extract three numbers from kernel release string
-linuxversion=`echo $kernelrelease | grep -oE [[0-9]]+\.[[0-9]]+\.[[0-9]]+`
+linuxversion=`echo $kernelrelease | grep -oE "^[[0-9]]+\.[[0-9]]+\.[[0-9]]+"`
 
 AC_SUBST(LINUX_SOURCE_DIR,[$sourcedir])
 AC_SUBST(LINUX_KERNEL_RELEASE,[$kernelrelease])