Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 291191 - x11-drivers/linuxwacom-0.8.4_p1 fails to compile against x11-base/xorg-server-1.7.1: MAX_BUTTONS redefined
Summary: x11-drivers/linuxwacom-0.8.4_p1 fails to compile against x11-base/xorg-server...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Robert Buchholz (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on: 290730
Blocks:
  Show dependency tree
 
Reported: 2009-10-30 17:24 UTC by Martin von Gagern
Modified: 2009-11-01 14:43 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Adjust to Xorg 1.7 API (linuxwacom-xorg-1.7.patch,10.11 KB, patch)
2009-10-30 18:08 UTC, Martin von Gagern
Details | Diff
Changes to ebuild (bug291191a.patch,479 bytes, patch)
2009-10-30 18:11 UTC, Martin von Gagern
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2009-10-30 17:24:55 UTC
In file included from ./xf86Wacom.h:159,
                 from ./wcmSerial.c:20:
./xf86WacomDefs.h:129:1: warning: "MAX_BUTTONS" redefined
In file included from /usr/include/xorg/xf86str.h:38,
                 from /usr/include/xorg/xf86.h:46,
                 from ./xf86Wacom.h:68,
                 from ./wcmSerial.c:20:
/usr/include/xorg/input.h:79:1: warning: this is the location of the previous definition
make[2]: Leaving directory `/var/tmp/portage/x11-drivers/linuxwacom-0.8.4_p1/work/linuxwacom-0.8.4-1/src/xdrv'

The definitions of MAX_BUTTONS in these files are indeed different:
/usr/include/xorg/input.h:#define MAX_BUTTONS 256 /* completely arbitrarily chosen */
xdrv/xf86WacomDefs.h:#define MAX_BUTTONS		32	/* maximum number of tablet buttons */
Comment 1 Martin von Gagern 2009-10-30 17:42:12 UTC
If I rename all occurrences of MAX_BUTTONS, I get the same thing for a different symbol:

In file included from ./xf86Wacom.h:27,
                 from ./xf86Wacom.c:91:
/usr/include/xorg/xorg-server.h:183:1: warning: "XFree86LOADER" redefined
In file included from ./xf86Wacom.h:25,
                 from ./xf86Wacom.c:91:
./../include/xdrv-config.h:105:1: warning: this is the location of the previous 
definition

Again the definitions differ: one is 1 the other an empty comment.

Renaming that as well, I get a bunch of errors like this:
error: too few arguments to function ‘InitValuatorAxisStruct’

Judging from /usr/include/xorg/xf86Xinput.h I assume that there is a third argument "Atom label" expected by the new API but not present in the linuxwacom driver.
Comment 2 Martin von Gagern 2009-10-30 18:08:15 UTC
Created attachment 208753 [details, diff]
Adjust to Xorg 1.7 API

This is an adaptation of a patch I found at RedHat, by Jarod Wilson:
http://www.redhat.com/archives/fedora-extras-commits/2009-August/msg05215.html

It fixes the missing argument issue but doesn't seem to take care of the preprocessor macros.
Comment 3 Martin von Gagern 2009-10-30 18:11:11 UTC
Created attachment 208755 [details, diff]
Changes to ebuild

These changes to the ebuild made things compile for me. Whether they actually do work I'll know after my next reboot.

I chose a sed instead of a patch because in theory upstream might introduce other occurrences of these macros one day. If they do, the sed will spot and handle them, whereas a patch might miss them, and as the patch catches the definition, the compiler won't complain either. So sed seems safer to me.
Comment 4 Martin von Gagern 2009-10-30 18:14:25 UTC
Don't forget that unmodified linuxwacom ebuilds (in case you only want to fix the latest one) should at least get their dependencies adjusted, so that they block >=xorg-server-1.7.
Comment 5 Mike Auty (RETIRED) gentoo-dev 2009-11-01 14:43:40 UTC
Thanks for that.  I've adjusted the ebuilds in the tree and my overlay.  Linuxwacom does not support >=xorg-server-1.7, if you wish to use this version of the xorg-server, please install xf86-input-wacom instead.  See bug 290730 for further information...