How to compile Wesnoth on Mac OS X
Moderator: Forum Moderators
-
- Posts: 537
- Joined: September 15th, 2003, 2:54 pm
- Location: Sheffield (UK)
- Contact:
How to compile Wesnoth on Mac OS X
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 . Of course. if you frown on MacOSX in favour of pure Darwin... do as you please
* 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:
This will open the pico text editor
3. Type the following in the editor:
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:
This will download the data for the first time.
Updating
1. Type:
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 . Of course. if you frown on MacOSX in favour of pure Darwin... do as you please
* 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
3. Type the following in the editor:
Code: Select all
setenv CVS_RSH ssh
5. Type:
Code: Select all
cvs -z3 -d:ext:anoncvs@savannah.nongnu.org:/cvsroot/wesnoth co wesnoth
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.
Reason: Retiring obsolete sticky.
-
- Posts: 56
- Joined: November 11th, 2003, 12:44 am
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!
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!
Maybe this helps - http://wesnoth.whitevine.net/forum/phpB ... .php?t=331Blades wrote: I tried updating the source via CVS, and have yet to try a tarball.
- Miyo
-
- Posts: 537
- Joined: September 15th, 2003, 2:54 pm
- Location: Sheffield (UK)
- Contact:
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.
http://gcc.gnu.org/ml/libstdc++/2000-q2 ... 00/sstream
Hope this helps.
Re: How To Compile On A Mac
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?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
...
Thank you!
-
- Posts: 537
- Joined: September 15th, 2003, 2:54 pm
- Location: Sheffield (UK)
- Contact:
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
That would mean doing a configure install for all the SDL libraries, then for Wesnoth.
Choice is yours
http://wesnoth.whitevine.net/forum/phpB ... .php?t=979Gafgarion wrote:Any ETA on a 0.7 Mac Binary? 0.7 source wont compile for me even with the dev SDLs.
- Miyo
-
- Posts: 537
- Joined: September 15th, 2003, 2:54 pm
- Location: Sheffield (UK)
- Contact:
-
- Posts: 110
- Joined: April 6th, 2004, 10:06 am
- Location: North Norfolk, UK
Aarrrrgghh...now, that was mean! I've been quite happy with 10.2.8.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.
Oh, well, I guess I'll just have to buy Panther...sigh...
-
- Posts: 537
- Joined: September 15th, 2003, 2:54 pm
- Location: Sheffield (UK)
- Contact:
Classic Mac OS 8/9?
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
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
Carbon or Cocoa?
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?