README.macosx ------------- About SDL Perl for Mac OS X --------------------------- This distribution has been modified to compile and install properly under Mac OS X. It owes a great debt to bob@redivi.com, since he did the initial port work for SDL Perl 1.1.19 as part of making Frozen Bubble available for Mac OS X. It is based on a port that I did for SDL Perl 1.20.3, so many of the changes may look familiar. For more information on Frozen Bubble for Mac OS X, please see http://redivi.com/~bob/frozenbubble.html This distribution is based on SDL Perl 2.0, with the changes from the original port merged into the latest distribution, and cleaned up a bit. This README.macosx file has been added to document how to get this module working. Prerequisites ------------- Before SDL Perl will work, the following prerequisites need to be observed: 1.) Upgrade the OS and developer tools to their latest versions. I can't stress this enough. The platform is evolving in subtle ways, and bugs are being fixed. Having older developer tools or an older version of the OS is just asking for trouble. I know this distribution works under Mac OS X 10.2.6 with the December 2002 Developer tools from Apple. 2.) Download the Kitchen sink distribution (which includes this SDL Perl directory) or download and install the developers edition of the following Frameworks: SDL (www.libsdl.org) SDL_mixer (www.libsdl.org) SDL_image (www.libsdl.org) SDL_ttf (www.libsdl.org) To support these frameworks, the following also need to be downloaded and installed: smpeg (www.icculus.org/smpeg) (1) libvorbis (www.xiph.org) (2) libpng (www.libpng.org/pub/png/libpng.html) (3) libjpeg (www.ijg.org) (3) (1) The smpeg CVS has a Project Builder directory that will build a developers framework. There is no binary framework download from the site however. You only need this if you want SDL_Mixer to work with MP3 files. NOTE: So far I have not been able to make this work with SDL Perl, so you might want to skip this one. (2) The binaries for Mac OS X don't come in a framework, so the libs and headers need to be in the search path listed in Makefile.darwin. You only need this if you want to be able to play OGG encoded music using SDL_Mixer. (3) These libraries need to be built and placed where they can be found by Makefile.darwin. The builds that I did from the direct sources worked pretty well out of the box, though I had to run 'ranlib' on library .a files afterward to make everyone happy. NOTE: The Makefile.darwin script is very picky about where files are installed. The developers frameworks are installed (by default) in ~/Library/Frameworks, but the script is expecting them in /System/Library/Frameworks. You can either adjust the script paths to reflect your own personal Frameworks directory, or move the installed frameworks to /System/Library/Frameworks. Your choice. NOTE: If you install the libraries in a custom directory (or you're getting "dlyd" errors, you need to add your library directory to the DYLD_LIBRARY_PATH. The easiest way to do this is to add the following to your .cshrc (adapt if you use a different shell): setenv DYLD_LIBRARY_PATH $DYLD_LIBRARY_PATH:/path/to/lib 3.) With the frameworks and supporting libraries installed, you can build the perl modules: perl Makefile.PL make make test make install NOTE: The script does not (yet) honor flags like --prefix, and will install the perl modules in /Library/Perl/darwin. The first step will show you what modules have been successfully detected and used in building the module. Mine looks like: Enabled GL yes Enabled GLU yes Enabled SDL_console no Enabled SDL_gfx no Enabled SDL_image yes Enabled SDL_mixer yes Enabled SDL_net no Enabled SDL_ttf yes Enabled jpeg yes Enabled png yes Enabled smpeg no Detecting GLU Version Checking if your kit is complete... Looks good Note (probably harmless): No library found for -lSDL_image Note (probably harmless): No library found for -lSDL_mixer Note (probably harmless): No library found for -lSDL_ttf Writing Makefile for SDL_perl Your mileage may vary, but it shouldn't be too far from the above. After the install is done, you should be able to use SDL in perl! Known Issues: ------------- + The Makefile is incredibly picky about paths. A better script is needed, and should be available soon. + Generating the Application window in SDL spews a large number of errors to the console, like: 2003-05-09 14:31:08.325 perl[15385] *** _NSAutoreleaseNoPool(): Object 0x18bb050 of class NSBitmapImageRep autoreleased with no pool in place - just leaking My best guess is that since it's not wrapped with ObjectC/Cocoa, there are some issues with garbage collection. However, this does not stop programs from running, so it seems to be a minor issue. + smpeg support does not work. The current smpeg distribution states that there is no longer explicit support for SDL_Mixer, and offers alternative (C) code for using smpeg with SDL. If someone figures out how to make this work, let me know. Until then, I know SDL_Mixer will work with OGG and WAV files. -- Thomas Tongue , 5/21/03