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 219

Summary: X11 detection is broken on Mac OS X
Product: SDL Reporter: Anders F Bj <afb>
Component: buildAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 1.2   
Hardware: PowerPC   
OS: Mac OS X (All)   

Description Anders F Bj 2006-05-09 07:08:53 UTC
It seems that the autotools discovery of X11 isn't working with the setup that the Apple X11 has, since it doesn't find the correct paths/settings without guidance.


The first curveball is that the symlink /usr/include/X11 -> ../X11R6/include/X11 messes with the "includes" detection, the second is when it fails to see GLX.

Here are the results from ../configure:
checking for X... libraries /usr/X11R6/lib, headers 
checking for OpenGL (GLX) support... no

And here is what you get when you help it:
checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include
checking for OpenGL (GLX) support... yes


But I had to use an explicit workaround to make it see the proper config:
CFLAGS="-O2 -g -pipe -I/usr/X11R6/include" ../configure --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib

I think it should be possible to tweak the autotools so that it can configure the available libraries ? Like add the x-includes to the GLX test program ?
Comment 1 Sam Lantinga 2006-05-10 01:19:03 UTC
This is fixed in subversion, thanks!
Comment 2 Anders F Bj 2006-05-10 04:39:44 UTC
# /opt/local/bin/svn update  
?\195?\132r p?\195?\165 revision 2373.
# ./autogen.sh                                                                                    
Generating build information using autoconf
This may take a while ...
Now you are ready to run ./configure
# cd cocoa-build
# ../configure --enable-video-cocoa --disable-video-carbon
[...]
checking for X... libraries /usr/X11R6/lib, headers 
checking for OpenGL (GLX) support... no
[...]

i.e. No difference, as far as I can tell ? (reopening bug)
Comment 3 Anders F Bj 2006-05-10 04:46:19 UTC
"No difference" wasn't fair, this worked:
../configure --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib


So now it's more a matter of getting autoconf to understand that
/usr/include/X11 is a symlink, and that it needs to dig deeper
in order to get the *real* location of the other X11 headers...

Adding a hardcoded default for Darwin isn't unreasonable,
I have *no* idea why they include a symlink for "X11" -
but do not include a symlink for "GL" ? (to the OpenGL fw)
Comment 4 Sam Lantinga 2006-05-10 10:58:59 UTC
Added hardcoded /usr/X11R6 path so GLX detection works.