Bug 817 - DMX includes <linux/input.h> on non-Linux platforms
Summary: DMX includes <linux/input.h> on non-Linux platforms
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/other (show other bugs)
Version: git
Hardware: All Solaris
: high critical
Assignee: Kevin E. Martin
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-02 09:39 UTC by Alan Coopersmith
Modified: 2004-07-06 04:39 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch that allows dmxinput directory to build on Solaris (1.33 KB, patch)
2004-07-02 16:29 UTC, Alan Coopersmith
no flags Details | Splinter Review
Patch that allows complete Xorg tree build to finish on Solaris (4.06 KB, patch)
2004-07-02 19:17 UTC, Alan Coopersmith
no flags Details | Splinter Review

Description Alan Coopersmith 2004-07-02 09:39:57 UTC
Attempting to build the post-DMX-merge Xorg tree on Solaris fails in
xc/programs/Xserver/hw/dmx/input since it's not Linux and has no <linux/input.h>
header:

cc -c -xO4 -xbuiltin -xlibmil -xpentium -Xa -v     -I. -I..
-I../../../../../exports/include/X11 -I../../../../../include/fonts
-I../../../mi  -I../../../include -I../../../render
-I../../../../../include/extensions  -I../../../../../programs/Xserver/Xext
-I../../../../../programs/Xserver/Xi  -I../../../../..
-I../../../../../exports/include   -Dsun -Di386 -DSVR4 -D__EXTENSIONS__ -D__i386
-DSHAPE -DXINPUT -DXKB -DLBX -DXAPPGROUP -DXCSECURITY -DTOGCUP  -DXF86BIGFONT
-DDPMSExtension  -DPIXPRIV -DPANORAMIX  -DRENDER -DRANDR -DXFIXES -DDAMAGE
-DINCLUDE_ALLOCA_H -DAVOID_GLYPHBLT -DPIXPRIV -DSINGLEDEPTH -DXFreeXDGA
-DXvExtension -DXFree86LOADER -DDLOPEN_HACK -DXFree86Server -DXF86VIDMODE
-DXvMCExtension -DSMART_SCHEDULE -DBUILDDEBUG -DXResExtension
-DX_BYTE_ORDER=X_LITTLE_ENDIAN -DXORG_VERSION_CURRENT="(((6) * 10000000) + ((7)
* 100000) + ((0) * 1000) + 0)"
../../../../../programs/Xserver/hw/xfree86/os-support/sunos/ia32.il -D__SOL8__
-DNDEBUG      -DDDXOSINIT -DSERVER_LOCK -DDDXOSFATALERROR -DDDXOSVERRORF
-DMITMISC -DXTEST -DXTRAP -DXSYNC -DXCMISC -DXRECORD -DMITSHM -DBIGREQS
-DXF86VIDMODE -DXF86MISC -DDBE -DDPMSExtension -DEVI -DSCREENSAVER -DXV -DXVMC
-DGLXEXT  -DGLX_USE_MESA    -DRES -UBEZIER  -UPEXEXT  -UMULTIBUFFER  -UXV  -UXIE
 -UDBE  -UXF86VIDMODE  -UXF86MISC  -UXFreeXDGA  -UXF86DRI  -UMITSHM  -UTOGCUP 
-UDPSEXT  -UMITMISC  -USCREENSAVER  -URANDR  -UFONTCACHE  -UXFree86LOADER 
-DXVENDORNAME='"The X.Org Foundation"' -DXVENDORNAMESHORT='"X.Org"'  usb-keyboard.c
"usb-private.h", line 48: cannot find include file: <linux/input.h>
"usb-private.h", line 104: undefined symbol: EV_MAX
"usb-private.h", line 104: can not declare variably modified type at file scope
"usb-keyboard.c", line 265: incomplete struct/union/enum input_event: event
"usb-keyboard.c", line 270: improper member use: time
"usb-keyboard.c", line 270: warning: left operand of "." must be struct/union object
"usb-keyboard.c", line 271: improper member use: time
"usb-keyboard.c", line 271: warning: left operand of "." must be struct/union object
"usb-keyboard.c", line 271: cannot access member of non-struct/union object
"usb-keyboard.c", line 272: improper member use: type
"usb-keyboard.c", line 272: undefined symbol: EV_LED
"usb-keyboard.c", line 276: undefined struct/union member: code
"usb-keyboard.c", line 277: improper member use: value
"usb-keyboard.c", line 368: incomplete struct/union/enum input_event: raw
"usb-keyboard.c", line 375: undefined struct/union member: code
"usb-keyboard.c", line 375: improper member use: value

Looking in the Imakefile, usb-keyboard.c is included on all non-SGI platforms.
Either it should be limited to Linux platforms or #ifdef's put in to not use
Linux-only headers on non-Linux platforms.
Comment 1 Kevin E. Martin 2004-07-02 10:51:49 UTC
Does changing the #ifndef __sgi to #ifdef __linux__ in the Imakefile fix the
compilation problem?

Unfortunately, I don't have a Sun machine to compile/test DMX, so if you have
the time/desire, please let me know and I'll help you get things going.  I would
like to see it working on other OSs.
Comment 2 Kevin E. Martin 2004-07-02 12:23:11 UTC
adding filler comment since bugzilla won't let me assign bug to myself without one
Comment 3 Alan Coopersmith 2004-07-02 15:57:40 UTC
Yes, making the Imakefile use #ifdef __Linux__ fixes that problem.  The build 
then goes on to fail later - I'm looking into those now.
Comment 4 Alan Coopersmith 2004-07-02 16:29:35 UTC
Created attachment 435 [details] [review]
Patch that allows dmxinput directory to build on Solaris

Also had to fix two issues in dmxsigio.c to make it build on Solaris:
 - #include <fcntl.h> instead of <sys/fcntl.h>	(POSIX specifies <fcntl.h> as
   well so this should be safe for everyone)
 - Solaris 9 does not define either FASYNC or O_ASYNC
Comment 5 Alan Coopersmith 2004-07-02 19:17:02 UTC
Created attachment 436 [details] [review]
Patch that allows complete Xorg tree build to finish on Solaris

Additional fixes needed to build the entire tree successfully on Solaris with
the Sun compilers:
  - Change check for ANSI cpp from #if __STDC__ to #if defined(__STDC__) since
    Sun cc defines __STDC__ in all ANSI compatible modes, but only makes it 
    non-zero in strict ANSI conformance mode.  (The Xlibint.h header that this
    was modeled on has removed this check completely and assumes everyone is
    ANSI C compatible unless otherwise specified.)
  - only define GetTimeInMillis in dmxinit.c if DDXTIME is #defined - otherwise

    it conflicts with the one in Xserver/os/utils.c
  - Change #ifdef in dmxinputinit.c from #ifndef __sgi to #ifdef DMX_USB (which

    is now defined in makefile section with USB files) so the code won't try
    using USB code if it's not being built.  The two #ifdef __linux__ in a row
    in the makefile look weird, but hopefully the second one will soon become
    #if defined(__linux__) || <...other OS'es the USB support is ported to...>

No idea if Xdmx will work or not, but at least 'make World' can finish without
errors now so the rest of the Xorg tree can be used.
Comment 6 Rik Faith 2004-07-06 21:39:47 UTC
Checking in mostly similar changes.  Xdmx builds/runs on Linux/i386.  Will test
under Solaris and Irix later this week.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.