We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 802

Summary: SDL_x11gl.c fails to build on some OS X systems, patch attached
Product: SDL Reporter: Max Horn <max>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 1.2.14   
Hardware: PowerPC   
OS: Mac OS X (All)   
Attachments: Patch adding #include <GL/glxtokens.h>

Description Max Horn 2009-09-21 12:34:37 UTC
The attached patch is taken from the Fink SDL package. It works around a build issue in SDL_x11gl.c on some systems, apparently caused by differences in the OpenGL headers (possibly caused by a newer/older X11 version being presented on affected systems).

I cannot test this elsewhere, but maybe this could be included in SDL 1.2.14 ?
Comment 1 Max Horn 2009-09-21 12:35:03 UTC
Created attachment 369 [details]
Patch adding #include <GL/glxtokens.h>
Comment 2 Sam Lantinga 2009-09-23 00:12:29 UTC
I think I already fixed this.  Is the build issue present with the current SDL 1.2 snapshot?
Comment 3 Max Horn 2009-09-23 03:07:18 UTC
Hard to tell for me, as I never could reproduce the issue, but some users could. All of them had XQuartz installed, which updates the X11 installation.

The error used to be:

 gcc -g -O2 -I/sw/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -I/usr/X11R6/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/video/x11/SDL_x11gamma.c -o build/SDL_x11gamma.o >/dev/null 2>&1
/bin/sh ./libtool --mode=compile gcc -g -O2 -I/sw/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden  -I/usr/X11R6/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/video/x11/SDL_x11gl.c  -o build/SDL_x11gl.lo
 gcc -g -O2 -I/sw/include -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -I/usr/X11R6/include -DXTHREADS -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings -c ./src/video/x11/SDL_x11gl.c  -fno-common -DPIC -o build/.libs/SDL_x11gl.o
./src/video/x11/SDL_x11gl.c: In function 'X11_GL_GetVisual':
./src/video/x11/SDL_x11gl.c:188: error: 'GLX_NONE_EXT' undeclared (first use in this function)
./src/video/x11/SDL_x11gl.c:188: error: (Each undeclared identifier is reported only once
./src/video/x11/SDL_x11gl.c:188: error: for each function it appears in.)
make: *** [build/SDL_x11gl.lo] Error 1
Comment 4 Sam Lantinga 2009-09-23 23:27:32 UTC
Oh yeah, this is fixed in subversion.  Thanks!