Difference between revisions of "Compiling for Mac OS X"

From The Powder Toy
Jump to: navigation, search
(talk)
m (1 revision)
(No difference)

Revision as of 19:28, 28 September 2011

Copy paster from forum thread. Clarify where needed

Ok I don't know if this is where it goes but I *think* I finally grasped the idea, with whatever methods, to compile as efficiently as I could. Thanks to some people at this Mac forum, and to flarn2006 who helped me I guess for the last step, even though I didn't get it at first but then when this dude explained it to me at those forums it clicked lol.


Ok so.

First step you need to take is install XCode/Developer Tools, even though the method we compile with in this guide is through the Terminal/command line, I'm sure there is a way to compile with XCode as well, hopefully in the future someone can find out :P.

Download XCode from here: [1]

Also let's install SDL, the PROPER way, so you don't get any errors during compiling.

First, get this file:

[2]

Next, open up your console (terminal) and change to the directory that you downloaded this file to. Probably 'Downloads' in your user folder. Next, type in:

tar xzf SDL-1.2.14.tar.gz

This will extract all the files into a folder called SDL-1.2.14. Go to this folder by typing:

cd SDL-1.2.14

There's a configure and a makefile in this folder. You'll have to run both.

./configure && make

It'll check that you can compile then a bunch of stuff. After it's done, you have one more step:

sudo make install

---

Second step, after all that's done, in the Terminal, you need to cd to the powdertoy source folder, so we can start compiling.

Type in cd, like in this picture: \\ Template:Http://i55.tinypic.com/2hzr0nq.png

Next, what I would usually do is just drag the folder into the Terminal window to make the linking easy.

Should end up like this:\\ {{http:i54.tinypic.com/96hyds.png]http:i54.tinypic.com/96hyds.png}}

Click enter, and after that do "make powder-x". It should start writing a bunch of things, warnings and stuff, which are fine. Towards the end when it's done, it usually says 'strip powder-x' like in this picture: \\Template:Http://i55.tinypic.com/2qlqu7q.png

Now you should have 2 files in the folder, the important one being 'powder-x' which is a "unix executable file", therefore it only runs from the command line, which we don't want, here is a pic of the outcome:\\ Template:Http://i53.tinypic.com/29aryhk.png

---

Now since we want to actually have a complete stand alone application rather than a crappy command line based one, so we can share with our buddies and show off in the forums, there is a third step to do that, and here I explain my method on it.

Now notice in one of the pics I had a Powder.app next to the folder, yes, now I will explain what to do.

1) Right click on the Powder.app > "Show package contents" >/Contents/MacOS, you will notice something familiar...it's a powder-x file!

2) Go to the source folder, mine is cracker, since he is an awesome modder, and drag the powder-x in the source folder, into the one in the Powder.app one, replacing the one in there. Here is a pic for dummies:\\ Template:Http://i56.tinypic.com/xc3mz9.png?600

3) Open Powder.app now, and voila! Perfect, complete app, just like the one on the website :) with the icons and everything, no command line launching needed! Share to your hearts content, I hope this long overdue guide helped all of you fill those gaps that were left for us OS X users :( now we can enjoy powder toy fun too!

4) Here is another picture for the lulz:\\ Template:Http://i52.tinypic.com/jb67va.png?600

Credits:

Dudes at MacRumors. Dudes here, and I guess flarn2006. Cracker for his awesome mod. I'm proud to be a 'crack' head :) get it? Crackhead? harharharhar....I am so funny... -___-. AntB for doing the wiki formatting (Self-promotion FTW!)