First post, by emendelson
Everything in this post was worked out by Dominus, not by me, but I thought it might be useful to put all the details together in one place. Here how to build a standalone version of DOSBox SVN using the revised SDL 1.2 code that works correctly under Lion. This assumes that you already have DOSBox SVN code on your system.
EDIT: These instructions create a standalone build that can be used on any other Lion system, not just your own. (Dominus spells this out in one of his replies.) I needed to do this because I've build a downloadable application around DOSBox that I distribute freely.
1. Install MacPorts from http://www.macports.org
2. To make this version of DOSBox portable, and if (like me) you don't need sdl_net or sdl_sound, then install these items only:
sudo port install libsdl +universal +no_x11
sudo port install libpng +universal
sudo port install pkgconfig +universal
3. Install Mercurial for OS X (find via Google), and then download the latest SDL 1.2 source code by using the hg clone command described on this page: http://www.libsdl.org/hg.php
4. Examine the downloaded code, and (if this has not been fixed by the time you do this), revert the change described on this page: http://hg.libsdl.org/SDL/rev/8e0dd46ad0e0
5. Create the following script in your SDL-1.2 folder and make it executable (chmod +x filename.sh):
#!/bin/sh
export CC='/usr/bin/gcc-4.2 -arch i386'
export CXX='/usr/bin/g++-4.2 -arch i386'
export GCOV='/usr/bin/gcov-4.2 -arch i386'
./autogen.sh
## I didn't need joystick or cdrom, but they're easy to restore using the strings below
# ./configure --enable-static --enable-joystick --enable-cdrom --disable-video-x11 --enable-video-cocoa --enable-video-opengl --without-x --prefix=/path/for/SDL/binaries
## REPLACE path shown below with correct path for current system
./configure --enable-static --disable-video-x11 --enable-video-cocoa --without-x --prefix=/path/for/SDL/binaries
make clean
make
make install
Of course, replace "/path/for/SDL/binaries" with a path that can actually exist on your system. The path should either not exist, or be empty. It should not be the same path that contains the SDL 1.2 source code.
6. Run the script that you created, and see whether the SDL binaries were created in the path that you specified in the --prefix string. If successful, proceed to building DOSBox.
7. In your DOSBox SVN directory, create the following script and make it executable. Replace "/path/for/SDL/binaries" with the actual path that you specfied in step 5.
#!/bin/sh
export CC='/usr/bin/gcc-4.2 -arch i386'
export CXX='/usr/bin/g++-4.2 -arch i386'
export GCOV='/usr/bin/gcov-4.2 -arch i386'
./autogen.sh
./configure --prefix=/opt/local --with-sdl-prefix=/path/for/SDL/binaries
make clean
sed -i.old -e "s@-L/path/for/SDL/binaries/lib -lSDLmain -lSDL -Wl,-framework,Cocoa@-L/path/for/SDL/binaries/lib/ /path/for/SDL/binaries/lib/libSDLmain.a /path/for/SDL/binaries/lib/libSDL.a -Wl,-framework,OpenGL -Wl,-framework,Cocoa -Wl,-framework,ApplicationServices -Wl,-framework,Carbon -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,IOKit@g" Makefile
cd src
sed -i.old -e "s@-L/path/for/SDL/binaries/lib -lSDLmain -lSDL -Wl,-framework,Cocoa@-L/path/for/SDL/binaries/lib/ /path/for/SDL/binaries/lib/libSDLmain.a /path/for/SDL/binaries/lib/libSDL.a -Wl,-framework,OpenGL -Wl,-framework,Cocoa -Wl,-framework,ApplicationServices -Wl,-framework,Carbon -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,IOKit@g" Makefile
cd ..
make
8. Run the script. Test the resulting dosbox executable on a system that does not have MacPorts installed.
If anything is wildly wrong here, I hope someone will correct it. As I said, Dominus worked out every detail of this, and I just put it all together in one post.
PS One further note: I've tested this only with my patched version of SVN, but if it works with my patched version, it should probably work with plain SVN.