How to compile on BeOS

Discussion among members of the development team.

Moderators: Forum Moderators, Developers

ahwayakchih
Posts: 79
Joined: February 6th, 2004, 12:41 pm
Location: Warszawa, Polska

How to compile on BeOS

Post by ahwayakchih »

To compile Wesnoth on BeOS You'll need:
- Installed GCC 3.4.x (get it from BeBits), because "standard" BeOS 5 compiler is too old for Wesnoth (it can't handle few "advanced" C++ things, and generates much slower code).
- Installed all required libraries (with header files - so they have to be "development editions").
- Patch attached to this post (this patch was made for Wesnoth 1.0! next and previous versions may need patch to be remade to handle changes in source code).
- Wesnoth's source package (of course ;)).

Now follow the steps:
- Unpack Wesnoth's source package.
- Unpack patch file to Wesnoth's directory (the one which You have just unpacked).
- Open Terminal and go to Wesnoth's directory (for example "cd /boot/home/wesnoth-1.0/").
- Type "patch -p1 -u < wesnoth-1.0-BeOS-gcc3.4.3.diff" (if You have patch file somewhere else then write it's name with full path, for example: "patch -p1 -u < /boot/home/wesnoth-1.0-BeOS-gcc3.4.3.diff") and hit ENTER.
- If something went wrong (for example, You got one or more messages containing: "Skipping patch."), then You have different version of Wesnoth (most probably) than the one the patch was made for. Stop here and go download proper version.
- If everything is ok, type "configure --prefix=/boot/home/config --enable-editor --enable-server --enable-campaign-server --enable-tools -disable-rpath CPPFLAGS=-I/boot/home/config/include CFLAGS=-O3 LDFLAGS=-L/boot/home/config/lib CXXFLAGS=-O3" and hit ENTER.
- Wait for it to finish. If there will be error messages then stop here, and check libraries and header files. If You don't know what to do, ask people on BeShare - usually there's someone who can help You.
- If everything is ok, type "make" and hit ENTER.
- After looooong time (depends on hardware, here it takes ~20 minutes, maybe less), if everything is ok, there should be file named "wesnoth" in "src" subdirectory. Move it to parent directory (for example "mv src/wesnoth ./wesnoth").
- Along with Wesnoth game, there are "src/wesnoth_editor", "src/server/wesnothd", "src/campaign_server/campaignd", "src/tools/cutter" and "src/tools/exploder". Move them to Wesnoth's directory the same way as You used for wesnoth (for example "mv src/wesnoth_editor ./wesnoth_editor").
- Type "wesnoth" and hit ENTER :).

Have a nice game of Wesnoth!

Additional info
Additional patches attached below - one for gcc 000224 (by Andrew Bachmann) and other for gcc 2010413 - will not be updated anymore, and are here just for historical record (and masochists trying to play Wesnoth built with gcc 2.x).
Attachments
wesnoth-0.7.10-BeOS-000224.diff.zip
Old patch for building 0.7.10 on BeOS using gcc 000224. First made for 0.7.8 by Andrew Bachmann.
(3.76 KiB) Downloaded 579 times
wesnoth-0.7.10-BeOS-20010413.diff.zip
Old patch for building 0.7.10 on BeOS using gcc 20010413.
(3.18 KiB) Downloaded 588 times
wesnoth-1.0-BeOS-gcc3.4.3.diff.zip
Patch for building 1.0 on BeOS using gcc 3.4.3. Includes tiny library wrapping few needed BeAPI functions. Includes resource files.
(39.98 KiB) Downloaded 929 times
Last edited by ahwayakchih on October 3rd, 2005, 9:24 pm, edited 55 times in total.

Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

Great work! Thanks for providing this! :)

Perhaps we should provide a working binary for BeOS?

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming

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

Post by miyo »

If you can provide pre-compiled binaries or installation package but don't have web space to host the files send me message with PM (Private Message, forum feature), email (miyo@iki.fi) or IRC and we can arrange uploading.

Binaries are listed here: http://wiki.wesnoth.org -> WesnothBinaries

- Miyo

ahwayakchih
Posts: 79
Joined: February 6th, 2004, 12:41 pm
Location: Warszawa, Polska

Post by ahwayakchih »

I could make binary package but:
- Edge (the one who made Wesnoth 4.x build for BeOS, and has Wesnoth's account on BeBits) promised he'll make package for stable release, and i don't want to start yet another fight in BeOS community (which IMHO is now broken enough).
- I'm waiting for SDL_net CVS to be updated (or not ;)) so users can have official library build working (multpilayer Wesnoth depends on non-blocking sockets, which are not available on current SDL_net for BeOS). Sam Lantinga is currently busy with release of SDL 1.2.7 so we have to wait :).

ziberpunk

Post by ziberpunk »

DCODE is necessary to compile in BeOS? Looking to the patch doesn't seem so.

ahwayakchih
Posts: 79
Joined: February 6th, 2004, 12:41 pm
Location: Warszawa, Polska

Post by ahwayakchih »

DCODE is necessary to compile in BeOS? Looking to the patch doesn't seem so.
Yes, it is necessary because BeOS std lib/compiler has bug which crashes application as soon as it prints floating point value to stream (std::cerr << "value is: " << floating_point_value;). That's why i needed to "comment out" few such lines.
I used DCODE trick because i thought it's cleaner to use than #ifdef DEBUG ... #endif (or even worse: #ifndef __BEOS__ ... #endif), and i hoped it will be accepted to official source. I also thought that it could be used for every "debug" output in sourcecode (not only those few lines with floats), because IMHO output isn't needed for end-users, and DCODE could be easy way to remove output in stable ("official") builds (...and in cases like the one with BeOS ;)).

ahwayakchih
Posts: 79
Joined: February 6th, 2004, 12:41 pm
Location: Warszawa, Polska

Topic updated

Post by ahwayakchih »

I've updated topic to support Wesnoth 0.6.99.4.
I also tried to make it a bit cleaner (more readable) and remove few "language bugs" (i'm not english native speaker and my english skill isn't too good).
Maybe one of admins could make it "sticky" topic (like with compiling on mac)? :)

ahwayakchih
Posts: 79
Joined: February 6th, 2004, 12:41 pm
Location: Warszawa, Polska

BeOS binaries available

Post by ahwayakchih »

Just wanted to let You know that BeOS binary package was updated on BeBits :).
I'll try to update Wiki as soon as someone else will stop keeping it edited ;).

drake

-p4 and bebits

Post by drake »

The current link on bebits does not work. To get the above patch to work you need -p4 not -p0. Compiling on Zeta cant find sstreeam header file.

drake

bebits updated

Post by drake »

Seems that the bebits link got taken down due to a reported issue. It is working now. Would still like advice on the sstream issue though.

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

Post by Sithrandel »

Download sstream from the GNU pages. I had this problem on the Mac until I left GCC 2.91 behind.

ahwayakchih
Posts: 79
Joined: February 6th, 2004, 12:41 pm
Location: Warszawa, Polska

Re: bebits updated

Post by ahwayakchih »

I'm sorry for slow answering.
drake wrote:To get the above patch to work you need -p4 not -p0. Compiling on Zeta cant find sstreeam header file.
On r5 it's -p0 (i checked it and it works ok, -p4 doesn't :)).
drake wrote:Seems that the bebits link got taken down due to a reported issue. It is working now.
I removed download yesterday and put new version (recompiled) today. I hope there's no more "stream << float" things there (i played for a short time and all works well so far).
drake wrote:Would still like advice on the sstream issue though
I've attached sstream i used. It's the one from official gcc 2.95.3 source package. I forgot that, by default, it's missing on BeOS.

ahwayakchih
Posts: 79
Joined: February 6th, 2004, 12:41 pm
Location: Warszawa, Polska

Re: bebits updated

Post by ahwayakchih »

ahwayakchih wrote:
drake wrote:To get the above patch to work you need -p4 not -p0. Compiling on Zeta cant find sstreeam header file.
On r5 it's -p0 (i checked it and it works ok, -p4 doesn't :)).
OK, i'm stupid. You're right, it's -p4 not -p0. It worked here, because it's the same environment as the diff was made on :).
Sorry, and THX for correcting me.

--- edit ---

hmm... tried -p4 again and it didn't work, but -p5 works. it's the second path (writtend in diff file) which must be truncated, right? that would explain why -p5 worked here (because first path is "old" file, second is "new" file - and patch applies new one i guess).

drake

gcc 2.95.3

Post by drake »

This does not seem to be available at bebbits aanymore any ideass barr waiting for the zeta release which is supposed to have a v3 toolchain?

ahwayakchih
Posts: 79
Joined: February 6th, 2004, 12:41 pm
Location: Warszawa, Polska

Re: gcc 2.95.3

Post by ahwayakchih »

drake wrote:This does not seem to be available at bebbits aanymore any ideass barr waiting for the zeta release which is supposed to have a v3 toolchain?
Compiler is back on BeBits. It was invisible, but it's not anymore :).
As for Zeta, don't ask me.

Post Reply