The Linux Wacom Project Logo

Linux Wacom Project HOWTO

3.3 - Building wacom.c

To build the wacom.ko kernel module, you need to configure wacom as a kernel module under your kernel source tree first. The kernel sources are required as described on the configuration page.

Then, you need to configure the package with --enable-wacom option. Here's how the configuration should generally look:

[jej@ayukawa linuxwacom]$ ./configure --enable-wacom
checking for valid kernel source tree... ok
       architecture - i686
       linux kernel - yes 2.6.9
  module versioning - yes
             kernel - yes /usr/src/linux
            XFree86 - no
               XLib - yes /usr/X11R6
                TCL - yes /usr
                 TK - yes /usr
            ncurses - yes
                GTK - 2.0.6

            wacom.o - yes
            wacdump - yes
             xidump - yes
        libwacomcfg - yes
         libwacomxi - yes
          xsetwacom - yes
              hid.o - no
        wacom_drv.o - no

As shown above, the kernel directory was detected and the wacom kernel module will be built. If the kernel option shows "no", you will need to specify the --with-kernel option and the correct directory.

For those who feel comfortable to build everything from the source tree, please skip the make and install steps below. Scroll down to the end of this page to see the steps with light blue background.

If you wanted to build the kernel driver and you do not see the yes after "wacom.o -" in the the "BUILD OPTIONS:", run 'make oldconfig; make prepare; make' on your kernel source should fix the issue.

To build the driver, just run make.

If everything works properly, you'll see the following from the make:

[jej@ayukawa linuxwacom]$ make
Making all in 2.6.9
make[3]: Entering directory `/home/jej/linuxwacom/src/2.6.9'
    Building linuxwacom drivers for 2.6 kernel.
make -C /usr/src/linux M=/home/jej/linuxwacom/src/2.6.9
make[4]: Entering directory `/home/jej/linux-2.6.9'
  LD      /home/jej/linuxwacom/src/2.6.9/built-in.o
  CC [M]  /home/jej/linuxwacom/src/2.6.9/wacom.o
  Building modules, stage 2.
  CC      /home/jej/linuxwacom/src/2.6.9/wacom.mod.o
  LD [M]  /home/jej/linuxwacom/src/2.6.9/wacom.ko
make[4]: Leaving directory `/usr/src/linux'
make[3]: Leaving directory `/home/jej/linuxwacom/src/2.6.9'

This part is for those who want to manually build the wacom kernel driver in source tree. If you already followed the steps above, you can move on to next page.

Please backup wacom.c in your kernel tree first. Then copy wacom.c (or wacom_wac.c, wacom_wac.h, wacom_sys.c, and wacom.h if defined) from the related linuxwacom directory to the source tree (if 4 files were copies, you need to add wacom-objs := wacom_sys.o wacom_wac.o to the Makefile under your kernel source input directory) and rebuild the kernel. An example for kernel 2.6.9 is as following:

[jej@ayukawa linuxwacom]$ cp /usr/src/linux/drivers/usb/input/wacom.c /usr/src/linux/drivers/usb/input/wacom.c.2.6.9 	 
[jej@ayukawa linuxwacom]$ cp src/2.6.9/wacom.c /usr/src/linux/drivers/usb/input/ 	 
[jej@ayukawa linuxwacom]$ cd /usr/src/linux 	 
[jej@ayukawa linux]$ make 	 
[jej@ayukawa linux]$ su 	 
[jej@ayukawa linux]#make install 	 
[jej@ayukawa linux]#make modules_install 	 
[jej@ayukawa linux]#reboot 	 

Copyright (C) 2002-2011 - LinuxWacom -Last updated July 23, 2012
This website and its contents are licensed under the GNU GENERAL PUBLIC LICENSE.