Page 1 of 3

Mac SVN/Compile instructions

Posted: Thu Nov 29, 2007 7:31 pm
by optic delusion
When Apple switched to intel processors, we had to do a lot of funny things with SDL in order to compile BZFlag, because SDL was not yet a universal library. Now it's almost 2 years later and SDL has been updated. The entire process is much easier.
Get SDL-1.2.12.dmg from this page.http://www.libsdl.org/download-1.2.php
Copy SDL.framework to /Library/Frameworks

Of course you also need Apple's DevTools including X-Code to be installed.
EDIT You'll need Xcode 2.4.1... but xcode 2.5 will not work on OSX 10.4)

The BZFlag Developers have switched from CVS version control to SVN. There are many subversion clients, but unless you are going to be uploading you don't need a front-end.
I installed this package http://metissian.com/projects/macosx/subversion/
It is an easy install, just double click and follow the installer directions, but to make it work, you have to do ONE of these two things.
1. Every time you are ready to use svn, run this command first.. export PATH=$PATH:/usr/local/bin
2. Or you could edit /etc/profile including the path to subversion permanently. PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:"

Alright, now we are ready to download and compile, open your bash terminal and do these.
1. Do one of the two steps above so that bash knows where to find subversion.
2. To get BZflag version 2.99 use this command svn checkout https://bzflag.svn.sourceforge.net/svnr ... unk/bzflag
2a. To get the latest 2.0 compatible bzflag use this command svn checkout https://bzflag.svn.sourceforge.net/svnr ... nch/bzflag
3. cd bzflag
4. ./autogen.sh
5. ./configure
6. xcodebuild

BZFlag.app is located at /bzflag/build/Default
You can move it to wherever you like.


After some amount of time, you are going to want to get the latest changes that have happened. It's easy.
export PATH=$PATH:/usr/local/bin
cd bzflag
svn up
xcodebuild

xcodebuild error

Posted: Sun Dec 02, 2007 3:08 am
by selmoatse
I am running Mac OS X v10.5.1 and Xcode v3.0. This is what I did (mostly following your instructions):

1. Downloaded SDL-1.2.12.dmg and copied the SDL.framework directory to /Library/Frameworks.
2. svn checkout https://bzflag.svn.sourceforge.net/svnr ... nch/bzflag
3. cd bzflag
4. ./autogen.sh
5. ./configure --enable-optimized [I also tried ./configure, and the xcodebuild fails similarly.]
6. xcodebuild

I'm just curious as to what's going wrong and how to fix the problem(s).

EDIT: If I run "make" and "sudo make install" instead of "xcodebuild", bzflag compiles and installs fine and I can run bzflag 2.0.11 by executing "bzflag" in a command prompt. BZFlag can search for servers, but when I try to connect to any of them the program reports "Server not found". It would still be nice to have a Bzflag.app file (that can connect to servers) that I could contribute to the community.

Attached are the output from "./configure --enable-optimized" and "xcodebuild".

Posted: Sun Dec 02, 2007 5:41 am
by optic delusion
Looks like you need to update your devtools, you're on an Intel Mac but MacOSX10.4u.sdk/ is a PPC file. Maybe this problem is OSX 10.5 specific?

Looking at your edit.. If you were able to build without xcode, you did not get a full application. and all the sounds/fonts/images are not in the package. You need to tell the bzflag.app where the resources file is. Open bzflag with the -directory option. The command will look something like this
./Users/Micheal/bzflag/default/BZFlag -directory /Users/Micheal/bzflag/data
Moving the data into a resources folder (where it looks like it should go) does not work.

Try to build trunk with xcodebuild. If you do not use xcodebuild, you will never get a full application.

Posted: Sun Dec 02, 2007 6:57 am
by selmoatse
Interestingly enough, /Developer/SDKs/MacOSX10.5sdk/ is present but apparently isn't used?

Attached are the output of "./configure --enable-optimized" with trunk and "xcodebuild". A warning about something called FreeType seems to be causing some problems. I have FreeType v2.3.5 installed.

Posted: Sun Dec 02, 2007 4:47 pm
by temporal distraction
http://bzflag.pastebin.ca/803757

I also had the build fail at that point (FTVectoriser)

Building trunk - I tried both xcodebuild and make.

Posted: Sun Jan 27, 2008 6:49 pm
by zaphod
idem .... my build failed at FTVectoriser too ....
is it a 10.5 problem?
anyone tried with 10.4?

Code: Select all

c/FTVectoriser.cpp' || echo './'`src/FTVectoriser.cpp
src/FTVectoriser.cpp: In member function 'void FTVectoriser::MakeMesh(FTGL_DOUBLE)':
src/FTVectoriser.cpp:186: error: invalid conversion from 'GLvoid (*)(...)' to 'GLvoid (*)()'
src/FTVectoriser.cpp:186: error:   initializing argument 3 of 'void gluTessCallback(GLUtesselator*, GLenum, GLvoid (*)())'
src/FTVectoriser.cpp:187: error: invalid conversion from 'GLvoid (*)(...)' to 'GLvoid (*)()'
src/FTVectoriser.cpp:187: error:   initializing argument 3 of 'void gluTessCallback(GLUtesselator*, GLenum, GLvoid (*)())'
src/FTVectoriser.cpp:188: error: invalid conversion from 'GLvoid (*)(...)' to 'GLvoid (*)()'
src/FTVectoriser.cpp:188: error:   initializing argument 3 of 'void gluTessCallback(GLUtesselator*, GLenum, GLvoid (*)())'
src/FTVectoriser.cpp:189: error: invalid conversion from 'GLvoid (*)(...)' to 'GLvoid (*)()'
src/FTVectoriser.cpp:189: error:   initializing argument 3 of 'void gluTessCallback(GLUtesselator*, GLenum, GLvoid (*)())'
src/FTVectoriser.cpp:190: error: invalid conversion from 'GLvoid (*)(...)' to 'GLvoid (*)()'
src/FTVectoriser.cpp:190: error:   initializing argument 3 of 'void gluTessCallback(GLUtesselator*, GLenum, GLvoid (*)())'
make[3]: *** [FTVectoriser.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
ERROR: make failed -- aborting
** BUILD FAILED **

Posted: Mon Jan 28, 2008 8:54 pm
by Enigma
According to the plug-in releases forum, you want to build version 2.0.11, correct? You checked out version 2.1, which isn't what you want.

The svn command to get 2.0.11 is...

Code: Select all

svn co https://bzflag.svn.sourceforge.net/svnroot/bzflag/branches/v2_0branch/bzflag
There are also issues with compiling bzflag2.0.11 on Mac OS 10.5, so it would be easiest to only build bzfs and the plugins by disabling the client and bzadmin:

Code: Select all

./configure --enable-shared --enable-plugins --disable-client --disable-bzadmin
. This is what I do, as I can get the latest changes to the bzfs plugin API.

I was able to compile the client and bzadmin, but the client crashes nonstop. I think I had to restart the client 10 times while on lasermania, so I gave up and went back to 2.0.10. You can still compile plugins and bzfs without problems.

Posted: Tue Jan 29, 2008 9:04 am
by zaphod
as you suggested, i got the v2_0branch version through SVN ...
then:
cd to bzflag ::: ./autogen.sh ::: ./configure ::: xcodebuild
and got that error at the end ....!
(same with ./configure --enable-shared --enable-plugins --disable-client --disable-bzadmin)

Code: Select all

ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib for architecture i386
collect2: ld returned 1 exit status
ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib for architecture ppc
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/jA/jAWs+VUxH2m8+pmbS4SutU+++TI/-Tmp-//ccy6FkEY.out (No such file or directory)
make[2]: *** [bzfs] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
** BUILD FAILED **
any idea what could be the problem?
is it a permission issue?

Posted: Tue Jan 29, 2008 9:44 pm
by macsforme
zaphod wrote:

Code: Select all

ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib for architecture i386
collect2: ld returned 1 exit status
ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib for architecture ppc
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/jA/jAWs+VUxH2m8+pmbS4SutU+++TI/-Tmp-//ccy6FkEY.out (No such file or directory)
make[2]: *** [bzfs] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
** BUILD FAILED **
Are you intentionally trying to build a Universal Binary?

Posted: Wed Jan 30, 2008 1:09 am
by Enigma
To get bzfs to compile, you can enter

Code: Select all

export LDFLAGS=${LDFLAGS}-L/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries
into the terminal before running configure. Make sure you use the same shell for both commands.

This will get rid of the error from ld:

Code: Select all

ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib

Posted: Sat May 10, 2008 3:39 am
by blast
tz. wrote:am i doing something teh noob?

Code: Select all

BZFlag-2.0.10.20080510 with the following:
     curses: -lncurses
     SDL
     no bzadmin client binary!
     no bzflag client binary!
You'd have to read any error up higher on the output to see what the problem is. And you might even have to review the config.log file to see the real error.

Posted: Sun Sep 14, 2008 8:37 pm
by Skeeve
After installing XCode 2.5 on my PPC OS X 10.4 and checking out bzflag, I get an Error with autogen.sh

Code: Select all

$ ./autogen.sh 
Preparing the BZFlag build system...please wait

Found GNU Autoconf version 2.59
Found GNU Automake version 1.6.3
Found GNU Libtool version 1.5

Automatically preparing build ... Warning: autoreconf failed
Attempting to run the preparation steps individually

Preparing build ... ERROR: libtoolize failed
What can I do now?

Posted: Mon Sep 15, 2008 4:43 am
by A Meteorite
Skeeve wrote:After installing XCode 2.5 on my PPC OS X 10.4 and checking out bzflag, I get an Error with autogen.sh

Code: Select all

$ ./autogen.sh 
Preparing the BZFlag build system...please wait

Found GNU Autoconf version 2.59
Found GNU Automake version 1.6.3
Found GNU Libtool version 1.5

Automatically preparing build ... Warning: autoreconf failed
Attempting to run the preparation steps individually

Preparing build ... ERROR: libtoolize failed
What can I do now?
Please run autogen.sh with the --verbose flag and either paste it here or pastebin it.

Posted: Mon Sep 15, 2008 4:52 am
by Skeeve
A Meteorite wrote: Please run autogen.sh with the --verbose flag and either paste it here or pastebin it.
Thanks for the hint. The problem seems to lie in libtoolize:

"libtoolize: cannot list files in `/usr/share/libtool'"

Posted: Mon Sep 15, 2008 5:57 am
by Enigma
Skeeve wrote:
A Meteorite wrote: Please run autogen.sh with the --verbose flag and either paste it here or pastebin it.
Thanks for the hint. The problem seems to lie in libtoolize:

"libtoolize: cannot list files in `/usr/share/libtool'"

Code: Select all

sudo ln -s /usr/bin/glibtoolize /usr/bin/libtoolize

Posted: Mon Sep 15, 2008 7:41 am
by Skeeve
Enigma wrote:
Skeeve wrote:
A Meteorite wrote:

Code: Select all

sudo ln -s /usr/bin/glibtoolize /usr/bin/libtoolize
That didn't help because I already did that before running autogen.sh --verbose.

Posted: Mon Sep 15, 2008 8:10 am
by Skeeve
It seems XCode 2.5 isn't that much compatible :-( Everything seems to be installed under /Developer. But I have no idea how to fix it.

Just found this info:
Xcode 2.5 no longer provides /usr/share/libtool so the solution is to use the MacPorts libtool port instead. The attached patch makes this change. Please let me know if I may commit this change to your port. Thanks.
Does this help? Do I need to go back to XCode 2.4?

Posted: Mon Sep 15, 2008 7:36 pm
by macsforme
Skeeve wrote:Does this help? Do I need to go back to XCode 2.4?
Why are you using such an old version of Xcode? The current version of Xcode is 3.1.

On my system, /usr/share/libtool/ exists and is a directory, so I'm not sure what the problem is.

Posted: Mon Sep 15, 2008 8:22 pm
by Skeeve
Constitution wrote:Why are you using such an old version of Xcode? The current version of Xcode is 3.1.
This release (XCode 3.1) provides additional GCC and LLVM compiler options, general bug fixes, and must be installed on Leopard, Mac OS X 10.5.0 and higher.
Skeeve wrote: After installing XCode 2.5 on my PPC OS X 10.4 and
Enough quoted?

Posted: Mon Sep 15, 2008 8:26 pm
by JeffM
he actualy has libtool, as the autogen detects, the problem seems that it dosn't work the way the makefile expects it.

Honestly, since it's such an old version, it sounds like apple just busted something in 2.5. If it works with 2.4 then just use that, I doubt you'll be getting any major advantage out of 2.5

Posted: Mon Sep 15, 2008 8:38 pm
by Skeeve
JeffM wrote:I doubt you'll be getting any major advantage out of 2.5
Just downloading it. MacPORTS wanted to install too much so I removed it before it even finished. I think 2.4 will work because it did before.

Posted: Mon Sep 15, 2008 9:24 pm
by Skeeve
Okay… No libtool problem in in autogen with XCode 2.4.1. Still configuring.

Update: xcodebuild on commandline fails. Starting xcode and building using the gui succeeds.

If anyone is interested in messages to investigate for the reason of the failure, just tell me.

Re: Mac SVN/Compile instructions

Posted: Thu Jul 09, 2009 1:00 am
by jpenguin
Ya, 2.5 is broken. My laptop, runs leopard, has xcode 3.x and build bzflag fine

Re: Mac SVN/Compile instructions

Posted: Thu Jul 09, 2009 6:45 pm
by fluffy mcduff
i have a problem compiling on my mac....

i have a white macbook running loepard 10.5.7, xcode 3.1.3, and im trying to compile bzflag 2.0.12
i downloaded SDL 1.2.13, and put it in the System/Library/Frameworks folder. i then ran these commands:

cd /Applications/bzflag-2.0.12 (i keep the source folder in applications)
./autogen.sh (worked fine)
./configure (also worked fine)
make (ERROR!!!!1!!)

this is the error i got:

Code: Select all

ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [bzflag] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
whats wrong?

Re: Mac SVN/Compile instructions

Posted: Thu Jul 09, 2009 6:57 pm
by blast
That's not the error. Look above the stuff you posted.

Is there a reason that the 2.0.10 binary package doesn't work for you? Version 2.0.12 was released just to fix issues building on Linux, so it won't give you any new features.