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
MadMax
Posts: 1792
Joined: June 6th, 2004, 3:29 pm
Location: Weldyn, Wesnoth

Post by MadMax »

Thanks, although I already compiled it in the Terminal.

EDIT: where in the window would it be listed? I have unintelligable (to me at least) data.
EDIT2: never mind.
"ILLEGITIMIS NON CARBORUNDUM"

Father of Flight to Freedom
http://www.wesnoth.org/wiki/FlightToFreedom

lwa
Inactive Developer
Posts: 271
Joined: June 11th, 2005, 8:19 am
Location: Paris, France

Post by lwa »

I've made a kit to build Wesnoth and disk images for Mac OS X.
Due to Xcode new format, it only works on Tiger with Xcode 2.1.

You may download (and test it) at

ftp://victor.teaser.fr/pub/lwa/wesnoth/ ... .6.tar.bz2

(size: 1Mb)

Once you got the SDL frameworks, all you have to do is to
move the directory into the sources, open the Project
and build "Disk Image" target. It should be able to build CVS snapshots too, but I havn't tried it yet.

The result will be a bug fixed and improved application
with respect to the official build. Also, efforts have been to to make the application compatible with Mac OS X 10.2.

User avatar
appleide
Posts: 1003
Joined: November 8th, 2003, 10:03 pm
Location: Sydney,OZ

Post by appleide »

To newbies (and commandline newbies):

Use the command line, its easier. :wink:
Wiki wrote:Outline of Steps
Get OS X 10.3 or 10.4
Install XCode
Download Fink
Download a copy of the SVN repository
Use Fink to install the latest versions of the following:
Automake
SDL
SDL-mixer
SDL-image
SDL-net
freetype2
freetype2-dev
Then, these are the steps you repeat every time you want to compile wesnoth:
Get an up-to-date copy of the game source and resources - usually by running svn update.
change the working directory (using the cd command) to the bottom/"root" folder of those game files
execute the command ./autogen.sh
execute the command ./configure --bindir=/sw/bin --datadir=datadir --with-libintl-prefix=/sw --with-libiconv-prefix=/sw
add --enable-editor to the end of this line to compile the map editor

****datadir is the absolutepath to where you want to save your wesnoth data. eg /Users/Myname/Documents/WesnothData


****You will get error messages about not having the sdl libraries even if you downloaded from libsdl.org. Download them from fink, use the command line for fink too.

http://fink.sourceforge.net/faq/usage-fink.php#unstable
Follow the instructions and try again:
Q5.8: There's this package in unstable that I want to install, but the fink command just says 'no package found'. How can I install it?

A: First make sure you understand what 'unstable' means. Packages in the unstable tree are not in stable for any number of reasons. It could be because there are known issues, validation errors, or just not enough people giving feedback that the package works for them. For that reason, Fink doesn't search the unstable tree by default.

If you do enable unstable, please remember to e-mail the maintainer if something works (or even if it doesn't). Feedback from users like you is what we use to determine if something is ready for stable! To find out the maintainer of a package, run fink info packagename.

To configure Fink to use unstable, edit /sw/etc/fink.conf, add unstable/main and unstable/crypto to the Trees: line, and then run fink selfupdate; fink index; fink scanpackages.

Also note, if you don't want to install any more from unstable than your specific packages and their dependencies, don't use the update-all command until you turn the unstable tree back off.
then in terminal:

Code: Select all

fink install SDL SDL-mixer SDL-image SDL-net
and try ./configure again.


execute the command make
execute the command sudo make install
At this point, you can run wesnoth by typing wesnoth in the command line.
wesnoth_editor will run the map editor
Why did the fish laugh? Because the sea weed.

GarethBeaumains
Posts: 19
Joined: May 22nd, 2005, 8:54 am

Urgh.

Post by GarethBeaumains »

This is far from easy.

Why are they not simply doing a .dmg posting like one would expect?

Doing this either by command line or via Xcode is arduous, problematic and counter-Mac-cultural.

• I tried from the command line. No dice.

• I got SDL 1.2.11, but ran into problems. Even after installing it I got the message: configure: error: *** SDL not found! Get SDL from http://www.libsdl.org. It's in Library/Frameworks. Err... What do I need to do?

• I got Fink 0.8.1. And... what the heck do I do?

None of the above makes sense, and it's a mish-mash of posts since 2004 to the present.

This needs to be a good self-installing .dmg game, or it needs to have realistic step-by-step instructions.

I don't have any Wesnoth project in Xcode. How do I start/create/open one?

Why did the Wesnothian powers-that-be stop supporting downloadable, playable versions of the game?

EDIT: I found the "Mac Compile" and xprojfile under an older version of Wesnoth I had installed. 1.0.2. I didn't see the that there was a new Mac Compile file for the latest 1.1.13.

I finally got that installed, and got the following build warnings and errors:
Building target “intl� of project “BattleForWesnoth� — (4 warnings)
cd /Applications/wesnoth-1.1.13/src
/usr/bin/gcc-4.0 -x c -arch ppc -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O3 -fmessage-length=0 -mmacosx-version-min=10.4 -I/Applications/wesnoth-1.1.13/src/build/BattleForWesnoth.build/Wesnoth/intl.build/wesnoth-intl.hmap -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/Applications/wesnoth-1.1.13/src/build/Wesnoth -I/Applications/wesnoth-1.1.13/src/build/Wesnoth/include -I/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers -I/Applications/wesnoth-1.1.13/src/build/BattleForWesnoth.build/Wesnoth/intl.build/DerivedSources -isysroot /Developer/SDKs/MacOSX10.4u.sdk -DHAVE_CONFIG_H -DIN_LIBINTL -c /Applications/wesnoth-1.1.13/src/MacOSX/gettext-runtime/intl/os2compat.c -o /Applications/wesnoth-1.1.13/src/build/BattleForWesnoth.build/Wesnoth/intl.build/Objects-normal/ppc/os2compat.o
/Applications/wesnoth-1.1.13/src/MacOSX/gettext-runtime/intl/os2compat.c: In function '_nl_getenv':
/Applications/wesnoth-1.1.13/src/MacOSX/gettext-runtime/intl/os2compat.c:35: warning: pointer targets in passing argument 1 of 'DosScanEnv' differ in signedness
/Applications/wesnoth-1.1.13/src/MacOSX/gettext-runtime/intl/os2compat.c:38: warning: pointer targets in return differ in signedness
/Applications/wesnoth-1.1.13/src/MacOSX/gettext-runtime/intl/os2compat.c:35: warning: pointer targets in passing argument 1 of 'DosScanEnv' differ in signedness
/Applications/wesnoth-1.1.13/src/MacOSX/gettext-runtime/intl/os2compat.c:38: warning: pointer targets in return differ in signedness
cd /Applications/wesnoth-1.1.13/src
/usr/bin/gcc-4.0 -x c -arch i386 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O3 -fmessage-length=0 -mmacosx-version-min=10.4 -I/Applications/wesnoth-1.1.13/src/build/BattleForWesnoth.build/Wesnoth/intl.build/wesnoth-intl.hmap -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/Applications/wesnoth-1.1.13/src/build/Wesnoth -I/Applications/wesnoth-1.1.13/src/build/Wesnoth/include -I/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers -I/Applications/wesnoth-1.1.13/src/build/BattleForWesnoth.build/Wesnoth/intl.build/DerivedSources -isysroot /Developer/SDKs/MacOSX10.4u.sdk -DHAVE_CONFIG_H -DIN_LIBINTL -c /Applications/wesnoth-1.1.13/src/MacOSX/gettext-runtime/intl/os2compat.c -o /Applications/wesnoth-1.1.13/src/build/BattleForWesnoth.build/Wesnoth/intl.build/Objects-normal/i386/os2compat.o
/Applications/wesnoth-1.1.13/src/MacOSX/gettext-runtime/intl/os2compat.c: In function '_nl_getenv':
/Applications/wesnoth-1.1.13/src/MacOSX/gettext-runtime/intl/os2compat.c:35: warning: pointer targets in passing argument 1 of 'DosScanEnv' differ in signedness
/Applications/wesnoth-1.1.13/src/MacOSX/gettext-runtime/intl/os2compat.c:38: warning: pointer targets in return differ in signedness
/Applications/wesnoth-1.1.13/src/MacOSX/gettext-runtime/intl/os2compat.c:35: warning: pointer targets in passing argument 1 of 'DosScanEnv' differ in signedness
/Applications/wesnoth-1.1.13/src/MacOSX/gettext-runtime/intl/os2compat.c:38: warning: pointer targets in return differ in signedness
Building target “msgfmt� of project “BattleForWesnoth� — (1 error, 2 warnings)
cd /Applications/wesnoth-1.1.13/src
/usr/bin/gcc-4.0 -o /Applications/wesnoth-1.1.13/src/build/BattleForWesnoth.build/Wesnoth/msgfmt.build/Objects-normal/ppc/msgfmt -L/Applications/wesnoth-1.1.13/src/build/Wesnoth -F/Applications/wesnoth-1.1.13/src/build/Wesnoth -filelist /Applications/wesnoth-1.1.13/src/build/BattleForWesnoth.build/Wesnoth/msgfmt.build/Objects-normal/ppc/msgfmt.LinkFileList -lwesnoth-intl -framework CoreFoundation -arch ppc -prebind -mmacosx-version-min=10.4 -Wl,-dead_strip -isysroot /Developer/SDKs/MacOSX10.4u.sdk
/usr/bin/ld: warning -prebind ignored because MACOSX_DEPLOYMENT_TARGET environment variable greater or equal to 10.4
/usr/bin/ld: table of contents for archive: /Applications/wesnoth-1.1.13/src/build/Wesnoth/libwesnoth-intl.a is out of date; rerun ranlib(1) (can't load from it)
/usr/bin/ld: warning multiple definitions of symbol _asprintf$LDBL128
/Applications/wesnoth-1.1.13/src/build/BattleForWesnoth.build/Wesnoth/msgfmt.build/Objects-normal/ppc/vasprintf.o private external definition of _asprintf$LDBL128 in section (__TEXT,__text)
/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/../../../libSystem.dylib(asprintf.So) definition of _asprintf$LDBL128
collect2: ld returned 1 exit status
/usr/bin/ld: warning -prebind ignored because MACOSX_DEPLOYMENT_TARGET environment variable greater or equal to 10.4
/usr/bin/ld: table of contents for archive: /Applications/wesnoth-1.1.13/src/build/Wesnoth/libwesnoth-intl.a is out of date; rerun ranlib(1) (can't load from it)
/usr/bin/ld: warning multiple definitions of symbol _asprintf$LDBL128
collect2: ld returned 1 exit status
Build failed (1 error, 6 warnings)
Which I have no idea what it means.

DraconicBlessing
Posts: 71
Joined: October 21st, 2006, 8:40 pm
Location: Chch, New Zealand

Re: Urgh.

Post by DraconicBlessing »

GarethBeaumains wrote:Why did the Wesnothian powers-that-be stop supporting downloadable, playable versions of the game?
There are downloadable, playable versions of the game readily available.
The Past never was.
The Future never will be.
There is only Now.

User avatar
appleide
Posts: 1003
Joined: November 8th, 2003, 10:03 pm
Location: Sydney,OZ

Re: Urgh.

Post by appleide »

GarethBeaumains wrote: • I got SDL 1.2.11, but ran into problems. Even after installing it I got the message: configure: error: *** SDL not found! Get SDL from http://www.libsdl.org. It's in Library/Frameworks. Err... What do I need to do?
Appleide wrote: ****You will get error messages about not having the sdl libraries even if you downloaded from libsdl.org. Download them from fink, use the command line for fink too.
GarethBeaumains wrote:• I got Fink 0.8.1. And... what the heck do I do?
EDIT: go to your applications folder, get to "fink commander" or search for it. Open the app. wait for it to load/connect to server. When it finish, type in the search box for "SDL" and download the appropriate items.
GarethBeaumains wrote: bunch of random warnings, then
Which I have no idea what it means.
Neither. Yet i figured out how to install the 'trunk' (one step ahead of the latest unstable binary version.)
Why did the fish laugh? Because the sea weed.

GarethBeaumains
Posts: 19
Joined: May 22nd, 2005, 8:54 am

Post by GarethBeaumains »

Alright. Launching FinkCommander, I see the following version of SDL: 1.2.9-1001.

Is that downrev from 1.2.11? If so, does this make a difference?
flagged status name installed version binary category summary local
NO sdl 1.2.9-1001 1.2.9-1001 games Cross-platform multimedia library
NO sdl-image 1.2.3-1002 1.2.3-1002 games SDL image file loading library
NO sdl-image-shlibs 1.2.3-1002 1.2.3-1002 games SDL image file loading library
NO sdl-mixer 1.2.6-1013 1.2.6-1013 games SDL multi-channel audio mixer library
NO sdl-mixer-shlibs 1.2.6-1013 1.2.6-1013 games SDL multi-channel audio mixer library
NO sdl-shlibs 1.2.9-1001 1.2.9-1001 games Cross-platform multimedia library
NO sdl-ttf 2.0.6-1016 2.0.6-1016 games SDL TrueType font library
NO sdl-ttf-shlibs 2.0.6-1016 2.0.6-1016 games SDL TrueType font library
Again, this process for compiling seems poorly documented.

If there is a downloadable binary, already-compiled version of the game -- where is it? Link please?

User avatar
appleide
Posts: 1003
Joined: November 8th, 2003, 10:03 pm
Location: Sydney,OZ

Post by appleide »

http://prdownloads.sourceforge.net/wesn ... g?download

This link is on the front page... (http://www.wesnoth.org) :? I can't believe you missed it. :P

The binary has around 30 times more people on its multiplayer server than the 'trunk'.
Why did the fish laugh? Because the sea weed.

wsultzbach
Posts: 245
Joined: November 28th, 2006, 12:42 am

Post by wsultzbach »

I was trying to compile wesnoth with Xcode on Mac OS X. I have all the SDL libraries installed in /Library/Frameworks. But I get these errors:

Code: Select all

grep: /wesnoth-1.2/../po/Makefile.am: No such file or directory 


powerpc-apple-darwin8-gcc-4.0.1: /wesnoth-1.2/../src/language.cpp: No such file or directory 
powerpc-apple-darwin8-gcc-4.0.1: warning: '-x c++' after last input file has no effect 
powerpc-apple-darwin8-gcc-4.0.1: no input files 


powerpc-apple-darwin8-gcc-4.0.1: /wesnoth-1.2/../src/zipios++/xcoll.cpp: No such file or directory 
powerpc-apple-darwin8-gcc-4.0.1: warning: '-x c++' after last input file has no effect 
powerpc-apple-darwin8-gcc-4.0.1: no input files
What am I missing?
What's this annoying thing that appears at the bottom of every one of my posts?

lwa
Inactive Developer
Posts: 271
Joined: June 11th, 2005, 8:19 am
Location: Paris, France

Post by lwa »

Do you compile directly in the root of your hard disk?
What's the command you typed?

wsultzbach
Posts: 245
Joined: November 28th, 2006, 12:42 am

Post by wsultzbach »

lwa wrote:Do you compile directly in the root of your hard disk?
Yes. I tried it in my home folder to.
lwa wrote:What's the command you typed?
I don't know, I was using Xcode.
What's this annoying thing that appears at the bottom of every one of my posts?

User avatar
anakayub
Moderator Emeritus
Posts: 518
Joined: May 3rd, 2007, 12:44 pm
Location: Malaysia
Contact:

Post by anakayub »

This is my first attempt at compiling anything, using XCode 3.0 on Leopard. The SDL libraries are installed in /Library/Frameworks and Amir/Library/Frameworks. I received literally hundreds (109) of errors when trying to compile BfW only without the Map Editor.

I installed the SDL libraries by using the binaries, then reinstalled with Fink for good measure. I have no idea where is it that I'm not following the instructions as written by Sithrandel in this sticky. I'm clueless as to where I went wrong. Any suggestions? Or should i post the whole error messages?

And just to be sure - Am I supposed to put the MacCompileStuff into the expanded source, or am I just supposed to copy the contents into that folder.

And a question about Python - Should I have those frameworks installed? When I looked into the Frameworks sidebar it was highlighted in red. Thanks.

Edit: I tried as well to compile the program using Terminal, but I received the "you don't have SDL installed". I already updated and installed all of the SDL libraries by Fink and Fink Commander prior to and after each attempt.

Edit 2: There were some missing files when I tried to compile Map Editor from XCode, not found in Leopard SDK, so I just copied them over from 10.4uSDK. Went fine, until I received a g++-4.0 exit code error. Trying to solve this, but it'll take a while.

Edit 3: Now another warning, which I don't know how to solve: ld: warning in /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation, file is not of required architecture
ld: warning in /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libSystem.dylib, file is not of required architecture
Undefined symbols:...In the end I'm still stuck, at both using XCode and using the Terminal. Please help, thanks . :)
Take a breath.

ulissesroc
Posts: 70
Joined: December 28th, 2007, 12:02 pm
Location: Amsterdam
Contact:

Post by ulissesroc »

anakayub wrote: And just to be sure - Am I supposed to put the MacCompileStuff into the expanded source, or am I just supposed to copy the contents into that folder.
Yes, the howto.txt says that you're supposed to put everything in the wesnoth directory

And you're supposed to have also python.framework install. You can get it from the python website.

But, anyway, I am having the same problem as wsultzbach: can't find the Makefile.am

and can't find language.cpp


Don't know if someone else is also stucked here. Or..please, packager, publish the binaries of 1.3.14


Edit: now these errors seem to be gone, since I was following the instruction in the front page, which is different from the one in the howto.txt present in the maccompiled stuff directory.

Currently I am compiling 110 out of 156 source files. Let's see.

User avatar
anakayub
Moderator Emeritus
Posts: 518
Joined: May 3rd, 2007, 12:44 pm
Location: Malaysia
Contact:

Post by anakayub »

Ah, I've been able to compile only after using the compile files from the official binaries, not from my own work. I've installed python, SDL etc, as well as boost 1.34.1 in my home folder. Though I needed to use the newest compile files provided in the official versions, it worked for 1.3.12 and 1.3.13 without a hitch.

However, for this version, I've been getting permission errors, which confounds me. I get these on the official sources as well as the SVN sources. Tried permission repairs, but didn't work. Googling it up didn't help much, as they suggest recompiling, which in itself led me to the errors. And so I've given up for compiling 1.3.14. :D
Take a breath.

lwa
Inactive Developer
Posts: 271
Joined: June 11th, 2005, 8:19 am
Location: Paris, France

Post by lwa »

As far as I know, you already have the right python framework on Leopart (in
/System/Library/Frameworks/Python.framework/Versions/) so you can skip the python installation step.

Also, I had trouble to compile an universal binary with Xcode 3.0, since many new errors occured (which can be fixed individualy with flags here and there) and the png library is not linked with universal library stuff. So I downgraded to Xcode 2.5 which works well.

Locked