Old macintosh compile discussion
Posted: Wed Jun 21, 2006 7:41 am
EDIT: As far as i know, these instructions still work,but this was from the early days of intel macs. and before BZFlag switched from CVS to SVN. This post is in need of serious updating.
I would do it myself, but I was pretty motivated to have an intel-client at the time, and have done next-to-zero compiles since this time.
If anyone would like to make a new thread, with new instructions,
GO FOR IT!
This assumes you have a spanking-new intel-mac
These compile instructions have only been tested on an Intel macintosh. I have a sneaky suspicion that they will work on a PPC Mac, but I have not seen proof of this, so use extreme care, there are no guarantees. Compiling is not for everyone, and if you get lost in here, you should just forget about the whole thing.
I have included instructions for compiling BZFlag version 2.0.8 from the source tarball located here, http://sourceforge.net/project/showfile ... ge_id=3165 There is no real reason for you to compile 2.0.8 from this source. The pre-built application is available here.
http://sourceforge.net/projects/bzflag/ for PPC
http://eidotter.de/~alexx/bzflag/ for intel mac
Now the real reason to compile BZFlag is to see the latest updates from the devs. For that you need to get version 2.1 from cvs. I have included instructions for this, but I strongly suggest you compile 2.0.8 first, to test that your build environment is set up correctly. At any one moment CVS can be broken, and you will need to know it's not because of something you did. So...
First I'll discuss the build environment, then compiling from the known good 2.0.8 source, then I'll talk about compiling version 2.1 from CVS.
The Build environment is key, without this setup perfectly, you'll go nowhere.
1. Start with a fully updated OSX version 10.4
2. Install Devtools and X-11 from your Apple-supplied disk. Or you can get it from Apple via download. If you can not do this without help, Stop reading, and forget you ever saw these instructions.
3. Run mac software update to get the most current devtools updates. Right now, that's X-Code 2.2.1.
4. Now you need one more thing, Simple DirectMedia Layer, or more specifically, SDL-1.2.10.tar.gz, get it here http://www.libsdl.org/index.php
4a. Double-click on SDL-1.2.10.tar.gz, this will expand the file and produce a folder named SDL-1.2.10
4b. Open your terminal and cd into this folder. If you can't do this, go get yourself a copy of "macintosh for dummies", and spend the next six weeks reading.
4c. Configure SDL with a prefix and to build static libs: (in SDL-dir)
./configure --enable-static --disable-shared --prefix=/Users/your_name/local
4d. Build and install SDL:
make
make install
4e. Now compile the framework-stuff (something OSX-specific, don't really know much about it.., README helps): (in SDL-dir)
tar xzf XCode.tar.gz
cd XCode/SDL
xcodebuild
4f. xcodebuild just magically builds all (or the only one?) XCode-projects in the current directory. So in this case it builds SDL.xcodeproj
After that, there should be a directory build/Default/SDL.framework. This should be moved to /Library/Frameworks, so that it can be found later.
I first tried to copy it, but there must be some strange permissions in this dir which cp ignores without some special parameters. I didn't look them up, because mv just works..
mv build/Default/SDL.framework /Library/Frameworks
4g. SDL is done! on to BZFlag
Compile BZFlag 2.0.8. This should be done before you try CVS to test your build environment.
1. get bzflag-2.0.8.tar.gz from http://sourceforge.net/project/showfile ... ge_id=3165
2. expand it to a folder named BZFlag-2.0.8. then cd into that folder
3. ./autogen.sh
4. Configure BZFlag with the prefix for SDL used above: ./configure --with-sdl-prefix=/Users/your_name/local
4a. If you want BZFS to have plugins use this instead ./configure --with-sdl-prefix=/Users/your_name/local --enable-plugins --enable-shared
5. Now we symlink the SDL-includes into the same directory: This is the step that eluded me for six months.
cd src/platform/MacOSX
ln -s /Users/your-name/local/include/SDL SDL
6. Now cd back to the root of the bzflag-dir and run xcodebuild. This should run without errors.
7. Finally, copy the game-resources into the application-package:
cp -R data/* build/Default/BZFlag.app/Contents/Resources/
8. That's it.. the final application is in build/Default/BZFlag.app You can drag it anywhere you want.
Now before we move on to version 2.1, I'm gonna say a couple things about server plugins. Please refer to step 4 above.
0. If you don't plan on running a server, or if your server won't need plugins, you can skip all of the --enable-stuff.
1. If you have any additional plugins, maybe one you made yourself, add the source for that plugin (including a makefile), to the /bzflag/plugins folder, before running ./configure.
2. for version 2.0.8 use both of these configure options. --enable-plugins --enable-shared
2a. for version 2.1 you only need one option --enable-plugins
3. Most makefiles are designed for Linux. The makefiles provided in the source plugins will build. No guarantee that added plugins will build. I've had mixed results.
Compiling BZFlag 2.1. You don't need the SDL symlink provided above. Use this configure.
1. Get the CVS using instruction posted in another post. Maybe I'll edit this in later.
./autogen.sh
./configure --with-sdl-prefix=...
xcodebuild
cp -R data/* build/Default/BZFlag.app/Contents/Resources/
2. that's it.
P.S.
I hope I don't have egg on my face, and this works for you as well as it did for me. If you try it on a PPC, please let me know what happened, good or bad.
Thanks again for the heads-up Matt?
I would do it myself, but I was pretty motivated to have an intel-client at the time, and have done next-to-zero compiles since this time.
If anyone would like to make a new thread, with new instructions,
GO FOR IT!
This assumes you have a spanking-new intel-mac
These compile instructions have only been tested on an Intel macintosh. I have a sneaky suspicion that they will work on a PPC Mac, but I have not seen proof of this, so use extreme care, there are no guarantees. Compiling is not for everyone, and if you get lost in here, you should just forget about the whole thing.
I have included instructions for compiling BZFlag version 2.0.8 from the source tarball located here, http://sourceforge.net/project/showfile ... ge_id=3165 There is no real reason for you to compile 2.0.8 from this source. The pre-built application is available here.
http://sourceforge.net/projects/bzflag/ for PPC
http://eidotter.de/~alexx/bzflag/ for intel mac
Now the real reason to compile BZFlag is to see the latest updates from the devs. For that you need to get version 2.1 from cvs. I have included instructions for this, but I strongly suggest you compile 2.0.8 first, to test that your build environment is set up correctly. At any one moment CVS can be broken, and you will need to know it's not because of something you did. So...
First I'll discuss the build environment, then compiling from the known good 2.0.8 source, then I'll talk about compiling version 2.1 from CVS.
The Build environment is key, without this setup perfectly, you'll go nowhere.
1. Start with a fully updated OSX version 10.4
2. Install Devtools and X-11 from your Apple-supplied disk. Or you can get it from Apple via download. If you can not do this without help, Stop reading, and forget you ever saw these instructions.
3. Run mac software update to get the most current devtools updates. Right now, that's X-Code 2.2.1.
4. Now you need one more thing, Simple DirectMedia Layer, or more specifically, SDL-1.2.10.tar.gz, get it here http://www.libsdl.org/index.php
4a. Double-click on SDL-1.2.10.tar.gz, this will expand the file and produce a folder named SDL-1.2.10
4b. Open your terminal and cd into this folder. If you can't do this, go get yourself a copy of "macintosh for dummies", and spend the next six weeks reading.
4c. Configure SDL with a prefix and to build static libs: (in SDL-dir)
./configure --enable-static --disable-shared --prefix=/Users/your_name/local
4d. Build and install SDL:
make
make install
4e. Now compile the framework-stuff (something OSX-specific, don't really know much about it.., README helps): (in SDL-dir)
tar xzf XCode.tar.gz
cd XCode/SDL
xcodebuild
4f. xcodebuild just magically builds all (or the only one?) XCode-projects in the current directory. So in this case it builds SDL.xcodeproj
After that, there should be a directory build/Default/SDL.framework. This should be moved to /Library/Frameworks, so that it can be found later.
I first tried to copy it, but there must be some strange permissions in this dir which cp ignores without some special parameters. I didn't look them up, because mv just works..
mv build/Default/SDL.framework /Library/Frameworks
4g. SDL is done! on to BZFlag
Compile BZFlag 2.0.8. This should be done before you try CVS to test your build environment.
1. get bzflag-2.0.8.tar.gz from http://sourceforge.net/project/showfile ... ge_id=3165
2. expand it to a folder named BZFlag-2.0.8. then cd into that folder
3. ./autogen.sh
4. Configure BZFlag with the prefix for SDL used above: ./configure --with-sdl-prefix=/Users/your_name/local
4a. If you want BZFS to have plugins use this instead ./configure --with-sdl-prefix=/Users/your_name/local --enable-plugins --enable-shared
5. Now we symlink the SDL-includes into the same directory: This is the step that eluded me for six months.
cd src/platform/MacOSX
ln -s /Users/your-name/local/include/SDL SDL
6. Now cd back to the root of the bzflag-dir and run xcodebuild. This should run without errors.
7. Finally, copy the game-resources into the application-package:
cp -R data/* build/Default/BZFlag.app/Contents/Resources/
8. That's it.. the final application is in build/Default/BZFlag.app You can drag it anywhere you want.
Now before we move on to version 2.1, I'm gonna say a couple things about server plugins. Please refer to step 4 above.
0. If you don't plan on running a server, or if your server won't need plugins, you can skip all of the --enable-stuff.
1. If you have any additional plugins, maybe one you made yourself, add the source for that plugin (including a makefile), to the /bzflag/plugins folder, before running ./configure.
2. for version 2.0.8 use both of these configure options. --enable-plugins --enable-shared
2a. for version 2.1 you only need one option --enable-plugins
3. Most makefiles are designed for Linux. The makefiles provided in the source plugins will build. No guarantee that added plugins will build. I've had mixed results.
Compiling BZFlag 2.1. You don't need the SDL symlink provided above. Use this configure.
1. Get the CVS using instruction posted in another post. Maybe I'll edit this in later.
./autogen.sh
./configure --with-sdl-prefix=...
xcodebuild
cp -R data/* build/Default/BZFlag.app/Contents/Resources/
2. that's it.
P.S.
I hope I don't have egg on my face, and this works for you as well as it did for me. If you try it on a PPC, please let me know what happened, good or bad.
Thanks again for the heads-up Matt?