configure.ac
changeset 2389 02f32b78f79d
parent 2229 97c7c202fa78
child 2393 5d7d2722dfaa
--- a/configure.ac	Tue Apr 10 18:56:50 2012 +0200
+++ b/configure.ac	Tue Apr 10 19:09:16 2012 +0200
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------
 #
-#  $Id$
+#  $Id: configure.ac,v 97c7c202fa78 2012/01/09 14:16:40 fp $
 #
 #  Copyright (C) 2006-2009  Florian Pose, Ingenieurgemeinschaft IgH
 #
@@ -92,8 +92,14 @@
     AC_MSG_ERROR([Failed to extract Linux kernel version!])
 fi
 
-# Extract three numbers from kernel release string
-linuxversion=`echo $kernelrelease | grep -oE "^[[0-9]]+\.[[0-9]]+\.[[0-9]]+"`
+if test ${kernelrelease%%.*} -gt 2; then
+    regex="^[[0-9]]+\.[[0-9]]+"
+else
+    regex="^[[0-9]]+\.[[0-9]]+\.[[0-9]]+"
+fi
+
+# Extract numbers from kernel release
+linuxversion=`echo $kernelrelease | grep -oE "$regex"`
 
 AC_SUBST(LINUX_SOURCE_DIR,[$sourcedir])
 AC_MSG_RESULT([$LINUX_SOURCE_DIR (Kernel $linuxversion)])