Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#15130 closed defect (fixed)

py-game 1.8.0 build failure on Tiger, error in SDL_syswm.h

Reported by: jmroot (Joshua Root) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: pygame SDL 10.4 Cc: cpettitt@…, nox@…, jmroot (Joshua Root), simon@…
Port:

Description

Originally reported in #15123. Parse errors in SDL_syswm.h, which is included from pygame's display.c:

--->  Building py-game with target build
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py-game/work/pygame-1.8.0release" && /opt/local/bin/python2.4 setup.py build " returned error 1
Command output: /opt/local/include/SDL/SDL_syswm.h:86: warning: no semicolon at end of struct or union
/opt/local/include/SDL/SDL_syswm.h:87: warning: type defaults to 'int' in declaration of 'window'
/opt/local/include/SDL/SDL_syswm.h:87: warning: data definition has no type or storage class
/opt/local/include/SDL/SDL_syswm.h:98: error: parse error before 'fswindow'
/opt/local/include/SDL/SDL_syswm.h:98: warning: type defaults to 'int' in declaration of 'fswindow'
/opt/local/include/SDL/SDL_syswm.h:98: warning: data definition has no type or storage class
/opt/local/include/SDL/SDL_syswm.h:99: error: parse error before 'wmwindow'
/opt/local/include/SDL/SDL_syswm.h:99: warning: type defaults to 'int' in declaration of 'wmwindow'
/opt/local/include/SDL/SDL_syswm.h:99: warning: data definition has no type or storage class
/opt/local/include/SDL/SDL_syswm.h:102: error: parse error before '*' token
/opt/local/include/SDL/SDL_syswm.h:102: warning: type defaults to 'int' in declaration of 'gfxdisplay'
/opt/local/include/SDL/SDL_syswm.h:102: warning: data definition has no type or storage class
/opt/local/include/SDL/SDL_syswm.h:103: error: parse error before '}' token
/opt/local/include/SDL/SDL_syswm.h:103: warning: type defaults to 'int' in declaration of 'x11'
/opt/local/include/SDL/SDL_syswm.h:103: warning: data definition has no type or storage class
/opt/local/include/SDL/SDL_syswm.h:104: error: parse error before '}' token
/opt/local/include/SDL/SDL_syswm.h:104: warning: type defaults to 'int' in declaration of 'info'
/opt/local/include/SDL/SDL_syswm.h:104: warning: data definition has no type or storage class
/opt/local/include/SDL/SDL_syswm.h:105: error: parse error before '}' token
/opt/local/include/SDL/SDL_syswm.h:105: warning: type defaults to 'int' in declaration of 'SDL_SysWMinfo'
/opt/local/include/SDL/SDL_syswm.h:105: warning: data definition has no type or storage class
/opt/local/include/SDL/SDL_syswm.h:205: error: parse error before '*' token
/opt/local/include/SDL/SDL_syswm.h:205: warning: function declaration isn't a prototype
src/display.c: In function 'get_wm_info':
src/display.c:310: error: parse error before 'info'
src/display.c:314: error: request for member 'version' in something not a structure or union
src/display.c:314: error: request for member 'version' in something not a structure or union
src/display.c:314: error: request for member 'version' in something not a structure or union
src/display.c:309: warning: unused variable 'tmp'
error: command '/usr/bin/gcc-4.0' failed with exit status 1

Error: Status 1 encountered during processing.

Change History (8)

comment:1 Changed 16 years ago by cpettitt@…

For what it's worth, I'm not able to repro this on a very similar Tiger computer, so I suspect this is an environmental issue. It can probably be closed.

comment:2 Changed 16 years ago by afb@…

The error above is what you get when you try to use SDL-for-X11 without X11 installed...

This is a duplicate of #15123, and the gentoo patch suggested there is a proper fix: http://bugs.gentoo.org/attachment.cgi?id=124726&action=view

But the code in SDL_syswm.h should only be included with SDL_VIDEO_DRIVER_X11 defined, so there seems to be something wrong with the SDL installation not matching the system ?

comment:3 Changed 16 years ago by afb@…

Seems like the error message was cut off, for not running the original build with port -d.

Here's what I get when I remove the /usr/X11R6/include headers before trying to build py-game:

In file included from src/display.c:29:
/opt/local/include/SDL/SDL_syswm.h:55:22: error: X11/Xlib.h: No such file or directory
/opt/local/include/SDL/SDL_syswm.h:56:23: error: X11/Xatom.h: No such file or directory
In file included from src/display.c:29:
/opt/local/include/SDL/SDL_syswm.h:73: error: parse error before 'XEvent'
/opt/local/include/SDL/SDL_syswm.h:73: warning: no semicolon at end of struct or union
/opt/local/include/SDL/SDL_syswm.h:73: warning: no semicolon at end of struct or union
/opt/local/include/SDL/SDL_syswm.h:74: warning: type defaults to 'int' in declaration of 'event'
/opt/local/include/SDL/SDL_syswm.h:74: warning: data definition has no type or storage class
/opt/local/include/SDL/SDL_syswm.h:75: error: parse error before '}' token
/opt/local/include/SDL/SDL_syswm.h:86: error: parse error before 'Display'
/opt/local/include/SDL/SDL_syswm.h:86: warning: no semicolon at end of struct or union
/opt/local/include/SDL/SDL_syswm.h:86: warning: no semicolon at end of struct or union
/opt/local/include/SDL/SDL_syswm.h:86: warning: no semicolon at end of struct or union
/opt/local/include/SDL/SDL_syswm.h:87: warning: type defaults to 'int' in declaration of 'window'
/opt/local/include/SDL/SDL_syswm.h:87: warning: data definition has no type or storage class

comment:4 Changed 16 years ago by simon@…

Cc: simon@… added

I got the same error on Mac OS X 10.4.11. The following patch fixes it for me:

--- Portfile    (revision 36602)
+++ Portfile    (working copy)
@@ -37,6 +37,12 @@
 configure.env-append LOCALBASE=${prefix}
 configure.cmd   ${python.bin} config.py
 
+post-configure {
+    # Make sure the X11 include directory is found.
+    reinplace "s|-Ddarwin  -lSDL|-Ddarwin -lSDL -I${x11prefix}/include|g" \
+        ${worksrcpath}/Setup
+}
+
 platform darwin 9 {
     depends_lib-delete port:py-pyobjc
     depends_lib-append port:py-pyobjc2 port:py-pyobjc2-cocoa

I don't know why the path to ${x11prefix} is not automatically added to -I and why it works for some installations. This change should also fix #10642.

If there are no objections I would commit it and also add it to py25-game.

Simon

comment:5 Changed 16 years ago by jmroot (Joshua Root)

Could the reason it sometimes works be due to libsdl's quartz variant being selected or not? Anyway, I don't think the patch should break anything, so go ahead and commit it. Maybe we need a quartz or no_x11 variant as well, as Anders suggested?

comment:6 Changed 16 years ago by nox@…

I've removed the quartz variant from libsdl in r36732.

comment:7 Changed 16 years ago by simon@…

Cc: jmr@… added
Resolution: fixed
Status: newclosed

This should be fixed in r36726.

I'm not sure, it works fine for me with the patch. I haven't tried using libsdl with quartz so I don't know how this works. As nox just removed the quartz variant from libsdl I'm not sure what we should do.

Thanks,

Simon

comment:8 Changed 15 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.