The 2.6.30 kernel introduces several definitions (BTN_TOOL_QUADTAP,
ABS_MT_POSITION_X, ABS_MT_POSITION_Y) which prevent the "2.6.30" driver
from compiling on earlier kernels. Clean up the version checking code
and error out when attempting to build against an earlier kernel.

Fixes https://sourceforge.net/p/linuxwacom/bugs/298/
Fixes https://github.com/linuxwacom/input-wacom/issues/10

Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
---
 configure.ac | 38 +++++++++++++-------------------------
 1 file changed, 13 insertions(+), 25 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2e3af9d..7e93906 100644
--- a/configure.ac
+++ b/configure.ac
@@ -108,32 +108,20 @@ WCM_ENV_KERNEL="yes"
 
 
 dnl Check which version of the driver we should compile
-MINOR=`echo $MODUTS | sed 's/[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\).*/\1/'`
-if echo $MODUTS | grep "^2.4" >/dev/null; then
-       AC_MSG_ERROR([kernel 2.4.x is not supported])
-elif echo $MODUTS | grep "^2.6" >/dev/null; then
-       if test $MINOR -ge 26; then
-               case $MINOR in
-                       26|27|28|29|30|31|32|33|34|35) WCM_KERNEL_VER="2.6.30";;
-                       36|37) WCM_KERNEL_VER="2.6.36";;
-                       *) WCM_KERNEL_VER="2.6.38";;
-               esac
-       else
-               AC_MSG_ERROR([use the kernel driver included in the 
'linuxwacom' package for kernels older than 2.6.26])
-       fi
-elif echo $MODUTS | grep "^3." >/dev/null; then
-       MINOR=`echo $MODUTS | sed 's/[[0-9]]*\.\([[0-9]]*\).*/\1/'`
-       if test $MINOR -ge 17; then
-               WCM_KERNEL_VER="3.17"
-       elif test $MINOR -ge 7; then
-               WCM_KERNEL_VER="3.7"
-       else
-               WCM_KERNEL_VER="2.6.38"
-       fi
-elif echo $MODUTS | grep "^4." >/dev/null; then
-       WCM_KERNEL_VER="3.17"
+AC_DEFUN([WCM_EXPLODE], [$(echo "$1" | awk '{split($[0],x,"[[^0-9]]"); 
printf("%03d%03d%03d\n",x[[1]],x[[2]],x[[3]]);}')])
+EXPLODED_VER="WCM_EXPLODE($MODUTS)"
+if test "$EXPLODED_VER" -lt "WCM_EXPLODE(2.6.30)"; then
+       AC_MSG_ERROR([use the kernel driver included in the 'linuxwacom' 
package for kernels older than 2.6.30])
+elif test "$EXPLODED_VER" -lt "WCM_EXPLODE(2.6.36)"; then
+       WCM_KERNEL_VER="2.6.30"
+elif test "$EXPLODED_VER" -lt "WCM_EXPLODE(2.6.38)"; then
+       WCM_KERNEL_VER="2.6.36"
+elif test "$EXPLODED_VER" -lt "WCM_EXPLODE(3.7)"; then
+       WCM_KERNEL_VER="2.6.38"
+elif test "$EXPLODED_VER" -lt "WCM_EXPLODE(3.17)"; then
+       WCM_KERNEL_VER="3.7"
 else
-       AC_MSG_ERROR(kernel version $MODUTS not supported)
+       WCM_KERNEL_VER="3.17"
 fi
 
 dnl Separate test output from file-generation output
-- 
2.6.2


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to