Compiling - OSX

Questions or HOWTOs about the above? Post 'em here...
Post Reply
stestagg
Private
Private
Posts: 1
Joined: Thu May 25, 2006 11:28 pm

Compiling - OSX

Post by stestagg » Thu Jul 06, 2006 12:12 am

I've just compiled BZ 2.0.8 on Mac OSX 10.4(.7) using the xCode project file. (it's pretty easy btw. but the documentation is sparse!)

The Problem
Once I'd downloaded the SDL framework etc... It all built fine but the resulting BZFlag.app wouldn't run. The icon appeared in the dock but then died. :(

Running in the terminal gave some fonts not found error.

Resolution
To resolve it, I had to copy the contents of the {SRC_ROOT}/data folder into the compiled BZFlag.app/Contents/Resources folder. This seems to have resolved the issue (It runs and looks OK).

My Point?
For anyone else having the same problem: here's the solution.
For the maintainers/developers: can this action be included in the xcode build script?

Thanks

Stephen

User avatar
Skeeve
Private First Class
Private First Class
Posts: 122
Joined: Sun Jun 04, 2006 3:27 pm
Location: Near Aix La Chappel

Re: Compiling - OSX

Post by Skeeve » Tue Jul 11, 2006 8:11 am

stestagg wrote:I've just compiled BZ 2.0.8 on Mac OSX 10.4(.7) using the xCode project file. (it's pretty easy btw. but the documentation is sparse!)
Yes? I didn't find that easy. I found it impossible. I failed with an error in info.plist. Did you simply start the XCODE file? I did so and it complained about it being an old file and I have to update. I confirmed that and clicking on build gave me the error :(

Update Where can I get the SDL framework? Commandline mkae fails with a missing SDL/SDL.h

Update 2 I found it, but I simply use the precompiled SDL framework that's coming with the precompiled bzflag.
Avatar created with South Park Studio

Don't you hate it when your posts get deleted without any note?

User avatar
optic delusion
Special Forces
Special Forces
Posts: 991
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Post by optic delusion » Mon Jul 31, 2006 5:15 pm

This has ben a problem for a long time. SDL just doesnt install where BZFlag expects it to be.
You need to do this the first time you install SDL, or it's borked forever. Mine was so screwed up from repeatedly attempting to fix it, that I wiped my entire disk and reinstalled OSX and devtools, then immediately installed SDL with these configure options. Never had any problems after that.
By the way... FINK is a bad thing, if you havent already, dont install fink, but you *should* be ok with it.

NOTE: I only tested this on an intel mac, but it should be the same on a PPC. If it works for you on PPC, please post, so I know.
Configure SDL with a prefix and to build static libs: (in SDL-dir)
./configure --enable-static --disable-shared --prefix=/Users/your_name/local
This is known as a symlink.


http://my.bzflag.org/bb/viewtopic.php?t=8356
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.

Enigma
Private First Class
Private First Class
Posts: 211
Joined: Sat Apr 23, 2005 3:13 am

Re: Compiling - OSX

Post by Enigma » Tue Aug 08, 2006 12:57 am

Skeeve wrote:
stestagg wrote:I've just compiled BZ 2.0.8 on Mac OSX 10.4(.7) using the xCode project file. (it's pretty easy btw. but the documentation is sparse!)
Yes? I didn't find that easy. I found it impossible. I failed with an error in info.plist. Did you simply start the XCODE file? I did so and it complained about it being an old file and I have to update. I confirmed that and clicking on build gave me the error :(

Update Where can I get the SDL framework? Commandline mkae fails with a missing SDL/SDL.h

Update 2 I found it, but I simply use the precompiled SDL framework that's coming with the precompiled bzflag.
The problem is one of the build script phases looks for the bzflag.app folder in bzflag/build, while Xcode places bzflag.app in bzflag/build/<development | default | deployment | custom build configuration>. I'm almost positive versions of Xcode prior to version 2.0.0 used the .xcode extension, while 2.*.* uses .xcodeproj, so either the Xcode project hasn't been updated in a while, or whoever maintains the Xcode project is using an old Mac OS, as I'm almost positive Xcode 2.0.0 or later only works on Mac OS 10.4.*. Previous versions of Xcode may have placed any builds directly in the builds/ folder(i don't remember).

You can get SDL at libsdl.org. Remember, Google is your friend. If you googled SDL, you would have found what you were looking for in less than one second.
A Delusion wrote:This has ben a problem for a long time. SDL just doesnt install where BZFlag expects it to be.
You need to do this the first time you install SDL, or it's borked forever. Mine was so screwed up from repeatedly attempting to fix it, that I wiped my entire disk and reinstalled OSX and devtools, then immediately installed SDL with these configure options. Never had any problems after that.
By the way... FINK is a bad thing, if you havent already, dont install fink, but you *should* be ok with it.

NOTE: I only tested this on an intel mac, but it should be the same on a PPC. If it works for you on PPC, please post, so I know.
Configure SDL with a prefix and to build static libs: (in SDL-dir)
./configure --enable-static --disable-shared --prefix=/Users/your_name/local
This is known as a symlink.
/me wonders why you wanted to install a static library instead of a framework.

All you had to do is copy SDL.framework to /library/frameworks. /system/library/frameworks is reserved for Apple.

User avatar
optic delusion
Special Forces
Special Forces
Posts: 991
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Post by optic delusion » Tue Aug 08, 2006 1:37 am

from http://my.bzflag.org/bb/viewtopic.php?t=8356

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.. :lol-old:
mv build/Default/SDL.framework /Library/Frameworks
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.

Post Reply