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
markus_2
Posts: 30
Joined: April 4th, 2005, 7:39 am
Location: Germany

Post by markus_2 »

Apologies for the necromancy, but could those in the know please elaborate on the SDL libraries one is supposed to get?
For one, I can't find SDL proper, but even without that, what exactly am I supposed to download and where should the stuff go?

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

Post by Sithrandel »

markus_2 wrote:Apologies for the necromancy, but could those in the know please elaborate on the SDL libraries one is supposed to get?
For one, I can't find SDL proper, but even without that, what exactly am I supposed to download and where should the stuff go?
Not quite necromancy, as the main post is occasionally updated :)

Follow the SDL link on the initial post, then download the libraries mentioned. SDL proper can be downloaded from the downloads section (go for v1.2).

Once downloaded, just install the packages.

markus_2
Posts: 30
Joined: April 4th, 2005, 7:39 am
Location: Germany

Post by markus_2 »

Sithrandel wrote:Follow the SDL link on the initial post, then download the libraries mentioned. SDL proper can be downloaded from the downloads section (go for v1.2).
Once downloaded, just install the packages.

Thanks for the quick response.
Yes, I got the main SDL by now and installed it successfully. It came as a binary.
Unfortunately SDL_mixer, SDL_image and SDL_ttf apparently don't. I followed the advice from (IIRC) the second page and appended /release/to the URL, but that just gives me a page full of funny files, with no idea which one I need.
Alternatively I can download the source, and watch it sitting on my harddrive in all its glory and without having the slightest idea what to do with it. So, if you could give details on that "just install" from your post, that would help enormously.

Grignr
Posts: 8
Joined: June 10th, 2005, 4:42 am

What's needed to compile on OS 10.2?

Post by Grignr »

I'm running Mac OS 10.2.1, and I'd like to try my hand at creating a build of Wesnoth 0.9.2. The only trouble is that I'm completely new to this kind of thing and I don't know which application(s) I should be using, aside of that Project Builder is one of them. If anyone could give me a rundown of what I need to get before I start building-- that is, assuming it's possible to compile 0.9.2 on this OS at all; from some earlier posts in this thread it looks like it might not be-- I would really appreciate it. Thanks in advance.

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

Post by Sithrandel »

My advice would be to wait until a few issues have been sorted out... though if anyone else out there has got 0.9.2 working on 10.2.x compiled in XCode 2.1 I'd love to hear about it :)

ott
Inactive Developer
Posts: 838
Joined: September 28th, 2004, 10:20 am

Post by ott »

For reference, see also what is needed for a Mac OS X compilation using the commandline: http://wesnoth.slack.it/?CompilingWesnoth and http://wesnoth.slack.it/?CompilingWesnothOnMacOSX
This quote is not attributable to Antoine de Saint-Exupéry.

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

Post by Sithrandel »

Sorted out XCode 2.1, which seemed to do *lots* of silly things to my system... and have managed to get it to build. We just need to see whether that version works before updating How to Compile info.

User avatar
Ankka
Posts: 594
Joined: January 2nd, 2005, 2:40 pm
Location: Finland

Post by Ankka »

Sithrandel wrote:Sorted out XCode 2.1, which seemed to do *lots* of silly things to my system... and have managed to get it to build. We just need to see whether that version works before updating How to Compile info.
Downloaded and installed, works so far.

Although as usual some user-made campaigns and scenarios give errors..

aelius
Posts: 497
Joined: August 30th, 2004, 8:07 pm
Location: Virginia, USA

Post by aelius »

I'm trying to compile 0.9.3 for the first time in xCode 2.1 running Tiger. I think I've finally got all of the libraries installed (a bit of a trick).

These appear to be the right libraries:

http://www.libsdl.org/release/SDL-1.2.8.pkg.tar.gz
http://www.libsdl.org/projects/SDL_mixer
http://www.libsdl.org/projects/SDL_image
http://www.libsdl.org/projects/SDL_net
http://www.libsdl.org/projects/SDL_ttf

It doesn't look like it's necessary to do anything with gettext (?).

Now when I attempt to build the project, xCode returns 4 errors:

Missing file or directory: src/sdl_ttf/.cvsignore
Missing file or directory: src/serialization/.cvsignore
Missing file or directory: src/zipios++/.cvsignore
Missing file or directory: src/zip/.cvsignore

Any ideas?

edit: Right. That problem's sorted, and I got 290 more for my trouble.

SDL.h is not compiling because xCode claims that:

Code: Select all

/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/include/stdint.h:100: error: duplicate 'unsigned'
in stdint.h (line 100). Any ideas on that one? How do you break stdint.h? Sheesh...

- b.
La perfection est atteinte non quand il ne reste rien à ajouter, mais quand il ne reste rien à enlever. - Antoine de Saint Exupery (of course)

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

Post by fmunoz »

.cvsignore are the files that CVS use to store what files need to ignore when uploading to the central repository... seems that the makefile (or equivalent) you are using got autogenerated from somebody who compiled the CVS version.
As a no Mac user I'm just giving theorical advice...
Just create a 0 bit files ("touch .cvsignore" in each directory from the console will do) as they are not important to the compilation.
OTOH you can also fix the project (or makefile or whaever file gives you the list of what files to compile) file.

aelius
Posts: 497
Joined: August 30th, 2004, 8:07 pm
Location: Virginia, USA

Post by aelius »

Yep. I fixed my project for the .cvsignore problem. Now another more serious one has cropped up. It looks like there's a conflict between one of the SDL libraries and stdint.h (they're both trying to make the same typedef?):

Code: Select all

In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:21,
                 from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:34,
                 from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:20,
                 from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:21,
                 from /System/Library/Frameworks/carbon.framework/Headers/carbon.h:20,
                 from MacOSX/SDLMacOSXMain.m:14:
/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/include/stdint.h:100: error: duplicate 'unsigned'
/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/include/stdint.h:100: error: 'long long long' is too long for GCC
MacOSX/SDLMacOSXMain.m:17:16: error: SDL.h: No such file or directory
Any ideas anyone?

- b.
La perfection est atteinte non quand il ne reste rien à ajouter, mais quand il ne reste rien à enlever. - Antoine de Saint Exupery (of course)

Hellrider
Posts: 81
Joined: July 22nd, 2005, 9:57 am

Post by Hellrider »

These are the errors i get when compiling 0.9.5 following sith's instructions:

Code: Select all

SDLMacOSXMain.m:17: SDL.h: No such file or directory
SDLMacOSXMain.m:62: error: parse error before "event"
SDLMacOSXMain.m:62: error: `SDL_Event' undeclared (first use in this function)  (Each undeclared identifier is reported only once for each function it appears in.)
SDLMacOSXMain.m:63: error: `SDL_QUIT' undeclared (first use in this function)
SDLMacOSXMain.m:63: error: `event' undeclared (first use in this function)
SDLMacOSXMain.m:64: implicit declaration of function `SDL_PushEvent'
SDLMacOSXMain.m:243: error: parse error before "event"
SDLMacOSXMain.m:243: error: `SDL_Event' undeclared (first use in this function)
SDLMacOSXMain.m:245: error: `SDL_KEYDOWN' undeclared (first use in this function)
SDLMacOSXMain.m:245: error: `event' undeclared (first use in this function)
SDLMacOSXMain.m:247: error: `SDL_PRESSED' undeclared (first use in this function)
SDLMacOSXMain.m:248: error: `KMOD_CTRL' undeclared (first use in this function)
SDLMacOSXMain.m:249: error: `SDLK_p' undeclared (first use in this function)
SDLMacOSXMain.m:708: implicit declaration of function `SDL_main'
SDLMacOSXMain.m:814: passing arg 2 of `NSApplicationMain' from incompatible pointer type
These seem to be easy-to-fix errors but i am not into programming enough to do this by myself :roll: Any ideas?

scott
Posts: 5242
Joined: May 12th, 2004, 12:35 am
Location: Alexandria, VA

Post by scott »

Hellrider:

I had a similar problem, stemming back to the fact that it can't find SDL.h

In the project file, go to "Targets" in the side bar, double click on Battle for Wesnoth, then under Summary > Settings > Search Paths, and make sure all of the paths to your SDL files are there. For example, I had the developer libraries installed in /Library rather than ~/Library.

Now I'm having a problem finding out how to install SDL_net with fink. Does anyone know?
Hope springs eternal.
Wesnoth acronym guide.

Hellrider
Posts: 81
Joined: July 22nd, 2005, 9:57 am

Post by Hellrider »

Thanks Scott, i did as you suggested, the result now is that those 12 errors are now changed into these 3.. :wink:

Code: Select all

about.cpp:314: error: `gettext' undeclared (first use this function)  (Each undeclared identifier is reported only once for each function it appears in.)
gettext.hpp:19: libintl.h: No such file or directory
SDLMacOSXMain.m:814: passing arg 2 of `NSApplicationMain' from incompatible pointer type

User avatar
ivanovic
Lord of Translations
Posts: 1146
Joined: September 28th, 2004, 10:10 pm
Location: Germany

Post by ivanovic »

To install sdl-net via fink you need to switch in fink to use unstable. Than you can compile the whole bunch. If you do install the stuff with fink anyway (you do have to) it is easier to do a complete commandline build. You can just install all the needed SDL-libs with fink and you upgrade gettext to use libgettext3-dev. If you did this it gets very easy even to build the cvs version of wesnoth. If you install a recent version of autoconf and automake (I do use autoconf2.5 and automake1.9) it is really no problem to build wesnoth via commandline. After compiling you only need to make wesnoth_bundle to create a correct .app file. There is only one thing I had to take care of:
I had to add something to configure so that it finds the correct version of gettext. My configure lie looks like this afterwards:

Code: Select all

./configure --with-libintl-prefix=/sw --with-libiconv-prefix=/sw
You can simply follow the instructions on this page in the wiki: http://www.wesnoth.org/wiki/CompilingWesnothOnMacOSX

I hope you are now able to compile Wesnoth using MacOS.

Locked