How to compile Wesnoth on Mac OS X

Get help with compiling or installing the game, and discuss announcements of new official releases.

Moderators: Forum Moderators, Developers

Locked
Sithrandel
Posts: 537
Joined: September 15th, 2003, 2:54 pm
Location: Sheffield (UK)
Contact:

How to compile Wesnoth on Mac OS X

Post by Sithrandel »

OK... this is a quick rundown on how to compile Wesnoth on a Mac.

Things you will need:

* A compiler. This really should be Apple's free XCode. Available from developer.apple.com . Please note the Apple tools use gcc the same cross platform compiler used to develop Wesnoth.

* The Wesnoth sources, either from the CVS or as a tarball. Unpack these into a directory. The cvs creates a "wesnoth" directory, so I shall use that for the example.

* Get the MacOS X Compile stuff from. This is included in all binaries built by Sithrandel.

* Make sure you have both the standard and the development SDL libraries installed (SDL, SDL_net, SDL_image, SDL_ttf, SDL_mixer) these can be downloaded from http://www.libsdl.org (Please note that in some cases, if the Mac package can't be found you may need to dowload a slightly earlier version. You can do this be adding "/release" to the URL of the relevant library.)

Preparation...

* Copy the Battle For Wesnoth.xcode file and the MacOSX folder into the wesnoth directory (they need to be at the same level as the src folder).

How To....
* Launch XCode.

* Open the project file.

* Clean Target in XCode.

* Just double click on the project builder bundle then click on build. This should create a new directory called build. Inside this the base application will be created.

* Run the application from within the build directory. This will install all the data / sound / image / etc files.

* You can now move it anywhere and it should still run.

Problems
The source code is constantly being updated, so you might well run into the problem of the source and project files being out of sync. This will normally be visible as unidentified symbols at link time. The name of the symbols will be a clue as to the name of new source files. Just add these to the project then recompile until it works :)

NOTES

* Don't try to compile using the command line by running ./configure. If you are using MacOSX then use the Mac OSX tools and SDL on Mac OSX as it is meant to be used. If you try you will hit lots of problems. So do youself a favour and try it the easy way :D. Of course. if you frown on MacOSX in favour of pure Darwin... do as you please :D

* Pure vs Good Mac Behaviour. My personal philosopy is I want Wesnoth to become a well behaved Mac application which looks as if it was intended for the Mac all along. I also don't want to alter Wesnoth itself, merely the polish so that prefs are in the expected places, data files are in the application bundle, there is an application icon, and standard behaviour is preserved. If you want to compile Wesnoth so that none of these Mac flavours are incorporated then just create a new SDL Application project from within Project Builder and add the Wesnoth source files to it.


CVS On The Mac
To use the cvs (to get the latest versions) you have to use the terminal. So if you don't want to do that, skip this part.

1. Open the Terminal.

2. Type:

Code: Select all

pico .tcshrc
This will open the pico text editor

3. Type the following in the editor:

Code: Select all

setenv CVS_RSH ssh
4. Type cntrl+x to exit the editor. It will ask if you want to save the modified buffer. Type Y for yes. Then hit return to confirm the filename.

5. Type:

Code: Select all

cvs -z3 -d:ext:anoncvs@savannah.nongnu.org:/cvsroot/wesnoth co wesnoth
This will download the data for the first time.


Updating

1. Type:

Code: Select all

cd wesnoth
cvs update -dP
Last edited by Iris on October 20th, 2013, 10:13 pm, edited 7 times in total.
Reason: Retiring obsolete sticky.

DragonLord
Posts: 56
Joined: November 11th, 2003, 12:44 am

Post by DragonLord »

Thank you to the infinite...
Fate is like an unpopular restaurant in which odd waiters come and give you things you didn't ask for and don't always like.

Blades

Post by Blades »

I'm back! Sorry I've been gone for awhile, went on vacation and forgot to post a notice, then thanksgiving, and now I'm back in school, with a paper due thursday that I haven't started and I'm here!

Anyway, Sith, I'm incompetant at this compiling business. When I try to build it, I get two errors stating that the file sstream is not present.

Help me!
*cries*

I tried updating the source via CVS, and have yet to try a tarball. I think I'll just wait till you respond.

Thanks in advance!

miyo
Posts: 2201
Joined: August 19th, 2003, 4:28 pm
Location: Finland

Post by miyo »

Blades wrote: I tried updating the source via CVS, and have yet to try a tarball.
Maybe this helps - http://wesnoth.whitevine.net/forum/phpB ... .php?t=331

- Miyo

Sithrandel
Posts: 537
Joined: September 15th, 2003, 2:54 pm
Location: Sheffield (UK)
Contact:

Post by Sithrandel »

OK... sstream is not included in GCC2.95.2 and can be found at:

http://gcc.gnu.org/ml/libstdc++/2000-q2 ... 00/sstream

Hope this helps.

Ades

Re: How To Compile On A Mac

Post by Ades »

Sithrandel wrote:[Updated 2004-02-28]

OK... this is a quick rundown on how to compile Wesnoth on a Mac.

Things you will need:

...

* Make sure you have the development SDL libraries installed (SDL, SDL_net, SDL_image, SDL_ttf, SDL_mixer) these can be downloaded from http://www.libsdl.org
...
I am trying to compile last CVS version of BfW, but I don't find an Mac OS X versión of the SDL library. Wich one should I use? Mac Clasic's one or perhaps the linux ppc one?

Thank you!

Sithrandel
Posts: 537
Joined: September 15th, 2003, 2:54 pm
Location: Sheffield (UK)
Contact:

Post by Sithrandel »

For some reason they have pulled the Mac development binary from the SDL pages. That gives you a couple of choices... PM me and I can let you have the SDL dev binary I downloaded, or else you could go down the Un*x compilation route.

That would mean doing a configure install for all the SDL libraries, then for Wesnoth.

Choice is yours :D

User avatar
Gafgarion
Posts: 607
Joined: February 26th, 2004, 10:48 pm

Post by Gafgarion »

Any ETA on a 0.7 Mac Binary? 0.7 source wont compile for me even with the dev SDLs.
-Gafgarion
Elvish Pillager wrote:Normal Trolls use clubs, not ostriches.
"Language is the source of misunderstandings." -Antoine de Saint-Exupéry

miyo
Posts: 2201
Joined: August 19th, 2003, 4:28 pm
Location: Finland

Post by miyo »

Gafgarion wrote:Any ETA on a 0.7 Mac Binary? 0.7 source wont compile for me even with the dev SDLs.
http://wesnoth.whitevine.net/forum/phpB ... .php?t=979

- Miyo

Sithrandel
Posts: 537
Joined: September 15th, 2003, 2:54 pm
Location: Sheffield (UK)
Contact:

Post by Sithrandel »

BTW As of the cvs after 0.7.5 Wesnoth won't compile under 10.2, it now needs XCode and 10.3. This is unrelated to the previous messages, where the issue was tweaks to the project file which were needed.

Star Gazer
Posts: 110
Joined: April 6th, 2004, 10:06 am
Location: North Norfolk, UK

Post by Star Gazer »

Sithrandel wrote:BTW As of the cvs after 0.7.5 Wesnoth won't compile under 10.2, it now needs XCode and 10.3. This is unrelated to the previous messages, where the issue was tweaks to the project file which were needed.
Aarrrrgghh...now, that was mean! I've been quite happy with 10.2.8. :(

Oh, well, I guess I'll just have to buy Panther...sigh...

Sithrandel
Posts: 537
Joined: September 15th, 2003, 2:54 pm
Location: Sheffield (UK)
Contact:

Post by Sithrandel »

Star Gazer wrote:Aarrrrgghh...now, that was mean! I've been quite happy with 10.2.8. :(
Not my fault, blame basic_string :-(

Panther is lovely though, worth getting. The problem is my main compile machine is a G3 and not quite as fast as Panther would like. There is a definite slow down not it is on 10.3

cassie21

Classic Mac OS 8/9?

Post by cassie21 »

Hi!

Is there a version for the Classic Mac OS (8 or 9)? Or is there a way to compile it for the Classic Mac OS?

Thanks!
Cassie :)

fmunoz
Founding Artist
Posts: 1469
Joined: August 17th, 2003, 10:04 am
Location: Spain
Contact:

Post by fmunoz »

1st get a good c++ compiler.
Get all libraries needed (SDL, SDL_image, SDL_net, SDL_mixer, SDL_ttf and maybe others) I dont know if all are avalaible to clasic mac.
Create a "makefile like" proyect if needed by the compiler.
Compile :-)

cassie21

Carbon or Cocoa?

Post by cassie21 »

If BFW is a cocoa app right now for Mac OS X, can't it be compiled as a Carbon one using Apple's compilers, so both OS X and OS 9 users can play?

:)

Locked