October 7th, 2009

beartato phd

(no subject)

Cygwin discovery of the day.

If you ever find yourself wanting to build SDL under cygwin to use X11 rather than native Windows windows, first of all, God help you, second of all, the following may work:

Get the SDL source distribution.
Edit the configure script by grepping for "Win9x" and changing the line above it
to be "*)" rather than "cygwin* | mingw*)".
./configure --build=i686-linux --host=i686-linux --with-x --enable-joystick=no --enable-cdrom=no
make install

The critical trick seems to be lying to the build system and saying you're on i686-linux rather than i686-cygwin. The bizarre-looking edit above is to keep the windows workaround for a configuration test that is known to mysteriously blow up on windows.

Then a typical compile line might look like

gcc -I /usr/local/include/SDL -L /usr/local/lib sdlapp.c -lSDL -lX11 -lXext -lXrandr -lesd

I used http://friedspace.com/SDLTest.c as a quick test.

You might need to install whatever cygwin package installs esd, the sound daemon. And maybe the other X packages. I seemed to have them already.