jryan has asked for the
wisdom of the Perl Monks concerning the following question:

I'm trying to get SDL_Perl to build on my Win2k machine, and I've completely lost hope on it.

Unfortunately, SDL_Perl uses Module::Build, which means its pretty much game over for me. The make script relies on sdl-config, which doesn't come with the binary release of SDL 1.2. However, since the build process uses Module::Build (and I've never *EVER* gotten a Perl module that uses Module::Build to build on any Windows box) I can't manually configure the make file.

I'm tearing my hair out here. I'd really like to be able to use Perl to this project, but for that to happen, I need SDL_Perl to work. Has anyone ever gotten SDL_Perl to build on a Windows box? If so, could I have a binary copy? :)

(Update: I've found a copy of SDL_Perl in crazyinsomniac's ppm repository, but it seems to be compiled for an earlier version of Perl, as it segfaults my machine as well as a friend's.)

The problem is not Module::Build. The problem is that Windows is such a hostile environment for compiling that no one who's looked can answer a handful of questions:

How can the installer tell if the system has OpenGL installed?

If the system has OpenGL installed, who is the vendor? (Answers include Microsoft, a video card manufacturer, and Mesa.)

Where are the SDL headers?

Which additional SDL libraries are present?

In seven or eight months of trying, I've personally never found a sensible answer to any of these questions. Fortunately, using Module::Build makes it easy to hide platform-specific configuration code behind a sane interface, a phrase that only a deranged lunatic even the fine people of Innsmouth would shun (and rightly so) could possibly apply to MakeMaker.

I don't think you can install SDL_Perl without having at least the SDL development files installed, and I think that includes the sdl_config file, but that will leave you with several other questions to answer.

If you do make any progress, I'd love to hear about it on the sdl-devel list.

In seven or eight months of trying, I've personally never found a sensible answer to any of these questions.

Most of those questions you can answer progamatically
(and some you don't even have to answer),
but asking the user sounds sensible to me
(with shortcuts like perl Build.PL --opengl=-lmesa --smpeg --gfx ...).

That is needless death right there (besides, its always LIB and only optionally LIBS).
Since sdl-config won't exist on win32 (when dealing with MSVS),
makes no sense to die if it doesn't exist,
especially if SDL.h/SDL.lib area already in the include/lib path.

MJDsays "you can't just make shit up and expect the computer to know what you mean, retardo!"

Every "recent" version of Win32 (that is, Windows 98, Windows ME, Windows NT, 2000 and Windows XP) has OpenGL installed by default, for Windows 95, OpenGL.org points to a download. This is, of course, only the SGI/Microsoft software renderer, but that is enough for a start.

The official way to query the OpenGL vendor is to load the OpenGL libary and then use the glGetString call to get the vendor string. Win32::API can easily load shared libraries and call functions in it, not unlike a module you wrote for Linux (I think). Finding the fitting OpenGL library headers is somewhat harder, as they first must be installed and second the script must find them - I would let the user specify that.

The SDL headers and additional SDL libraries should simply be inquired from the user if a sane set of defaults doesn't fit. Please do not enter into an infinite loop if there is no user present to answer your question, but bail out of the build script.

I don't know. I know that Windows isn't the greatest environment to build stuff, but thats the platform that I have to use here.

My problem with Module::Build is that when something wrong happens, I haven't a clue what I need to do to fix it. Its so frustrating! At least with MakeMaker I can look at the makefile and try to config stuff manually, by hand. I can see the dependencies. I can see which information it needs to build. I can see that it requires header files to install. A build system that requires me to be intimately familiar with its internals is useless to me.

I mean, dammit! I don't care how the thing builds, I just want to use it! I'm even very willing to spend lots of time trying to get it to install, because I need it. Its just when the build system says essentially says "sorry, the automatic configure system isn't working", and thats all the output I get, I... its just... AARRRRRGHHH!

I sympathise with you. I recently try to build SDL_Perl on Mac OS X, and was equally unsuccessful. I sent a detailed report to the mailing list, but didn't receive any reply so far. Seems the project is not very active right now.

When putting a smiley right before a closing parenthesis, do you:

Use two parentheses: (Like this: :) )
Use one parenthesis: (Like this: :)
Reverse direction of the smiley: (Like this: (: )
Use angle/square brackets instead of parentheses
Use C-style commenting to set the smiley off from the closing parenthesis
Make the smiley a dunce: (:>
I disapprove of emoticons
Other