!!! WARNING !!!This guide is effectively
OBSOLETE and is not supported anymore. Please, use it for historical purposes only - to possibly get a better idea how the process works, but not for the actual compiling itself.
To succeed with you own build, follow the new guide instead -
https://openxcom.ninex.info/forum/index.php?topic=127.0-------
After some fiddling with XCode on my native 64-bit Snow Leopard (10.6.3) I've finally succeeded in building the source. There were (and still are) some peculiarities though. So, how did I do that?
First of all, you need the prerequisites installed. Those would be:
* SDL.framework
* SDL_mixer.framework
* SDL_gfx.framework
You can fetch the first and second one here:
https://www.libsdl.org/release/SDL-1.2.14.dmghttps://www.libsdl.org/release/SDL-devel-1.2.14-extras.dmghttps://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.11.dmgThe problem, however, lies with SDL_gfx, for there is no official precompiled package - you have to create it yourself. However, if you find the process dull or intimidating - here is a precompiled latest version (SVN r45) built by me -
https://www.mediafire.com/?h4gor8qrggcc2nwAlso, after the r104 release of OpenXcom - it turned out that 64-bit support in most of those frameworks was kind of messed up, so I had to manually recompile them to get things working again. If you happen to stumble upon the same issues - here goes a bundle of everything you might need -
https://www.mediafire.com/?8c69mvblmzod73wAfter you have finally got all three frameworks installed (presumably in /Library/Frameworks/) - create a new project in Xcode and select
User Templates > Application > SDL Application. Name it "openxcom" (without quotes of course).
Now we have to configure access to SVN-repository so we can stay up to date with project's contributions.
Go to
SCM > Configure SCM Repositories > + and enter a name (I chose "OpenXcom") and type (Subversion) for your new repo. Now the tricky part!!! Add THIS address to the URL field -
https:https://openxcom.svn.sourceforge.net/svnroot/openxcom. For some reason the URL given by SupSuper didn't quite work - showed an error.
Once the repo is set up, click
SCM > Repositories > "newly added repo" and you should automatically connect to it. Click on "trunk" folder and then execute "Checkout" command from the toolbar. Save the "trunk" folder inside your project folder (that would be "openxcom").
Next, go to
Project > Select Project Settings > General and click "Configure Roots & SCM". Under "Root" tab enter "trunk" (without quotes) and your repo will be suggested automatically. Ok.
Right-click on "openxcom" project tree in the left pane of main window and select
Add > Existing Files > path to "openxcom" > trunk.
Ok, SVN is set and in sync, now you have to add yet missing frameworks to your project. Right-click on
Frameworks > Linked Frameworks folder in the left pane and select
Add > Existing Frameworks > SDL_mixer.framework and then follow the same procedure to import
SDL_gfx.framework. Next, drag-n-copy those frameworks from "Linked Frameworks" to "Targets > openxcom > Copy Frameworks into .app bundle" to make the bundle self-sustainable.
Then, go to
Project > Edit Project Settings > Build and make sure that in "Search Paths" section you have the following strings:
Corresponding to "Header Search Paths" you should add "$(HOME)/Library/Frameworks/SDL_mixer.framework/Headers", "/Library/Frameworks/SDL_mixer.framework/Headers", "$(HOME)/Library/Frameworks/SDL_gfx.framework/Headers", "/Library/Frameworks/SDL_gfx.framework/Headers".
One more thing - go up the list in this tab, select "All Configurations" from the "Configuration" drop-down menu, and corresponding to "Base SDK" key choose "Mac OS X 10.6" value. This will make sure that your program will use the latest features provided by OS X. However, if you want your app to be reasonably backwards-compatible make sure to select earlier target value (my recommendation would be
10.5.) corresponding to "Mac OS X Deployment Target" key.
Now we want to make sure that the original game data we feed to this engine will be read from within the bundle's "Resources/DATA" folder, so our game is fully self-contained OSX-style. You have to edit "SDLMain.m" file (click on "Classes" folder in the left pane of you Xcode project window) as described here
https://meandmark.com/blog/2009/12/sdl-tips-for-mac-os-x/.
Ok, now you can choose "Build" command from the menu and hopefully see everything compile without a hitch (due to many reasons your experience may vary, of course
Find your newly built app, open it (right click on it > Show Package Contents > Contents > Resources > DATA) and put the original UFO Defense data folder tree (I had the Windows version, but DOS data should work as well) there and you are done.
Now you can click on your app, and if everything was done right - you should experience some oldschool wonder. Enjoy!
P.S. For those of you who have troubles with this setup - here is a precompiled binary (constantly updated), created by following the aforementioned step-by-step guide.
v. 0.1 (upd) (SVN r214) -
https://www.mediafire.com/?p1wh3l7195kfpqr