Compiling Mac OS X 10.9.2 Mavericks

For all the help you need with Armagetron!
Post Reply
User avatar
LittleSteps
Core Dumper
Posts: 157
Joined: Thu Apr 12, 2012 2:30 am

Compiling Mac OS X 10.9.2 Mavericks

Post by LittleSteps »

Compiling Mac OS X 10.9.2 Mavericks
Hello fellow tronners! I probably have asked this problem once before but got minimal help due to my lack of understanding of some things.

Well, I have been trying to compile the branch Armagetron Experimental 0.4 but having issues figuring out how. I cannot find the old wiki post that was once up telling people how, but I am sure I remember it being out of date, due to bazaar being only available for Snow leopard (Probably being a PowerPC Application). I do have some experience with Xcode, but still have yet to figure out how to compile.

Any help is appreciated!

Mac Specs.
Mac mini Server
Mid 2011
Processor 2 GHz Intel Core i7
Memory 8 GB 1333 MHz DDR3
Graphics Intel HD Graphics 3000 512 MB
Software OS X 10.9.2 (13C64) Mavericks
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Re: Compiling Mac OS X 10.9.2 Mavericks

Post by dlh »

The instructions are in the confusingly named README-Subversion file included with the source.
User avatar
LittleSteps
Core Dumper
Posts: 157
Joined: Thu Apr 12, 2012 2:30 am

Re: Compiling Mac OS X 10.9.2 Mavericks

Post by LittleSteps »

dlh wrote:The instructions are in the confusingly named README-Subversion file included with the source.
Hey, I opened up Armagetron Advanced.xcodeproj in MacOS, I seem to be having many errors, but not sure how to see what the problem is. So I ended up clicking update to recommended settings which fixxed them.
Image

I then applied my changes and tried to build the application but ended up gettings this.

Code: Select all

The scheme 'Armagetron Advanced' contains no buildables that can be built for the SDKs supported by the run destination My Mac 64–bit. Make sure your targets all specify SDKs that are supported by this version of Xcode.
Image

Could this be the issue?

Image


Thank you very much for your help!
User avatar
voodoo
Core Dumper
Posts: 124
Joined: Wed Sep 27, 2006 11:51 am

Re: Compiling Mac OS X 10.9.2 Mavericks

Post by voodoo »

Forget the xcode project, it is outdated. Grab source code from launchpad, as well as dlh's os-x-toolkit, and use command line as for linux (i.e. classical sequence, bootstrap.sh, configure, make, make install...) as stated in readme file dlh pointed out to you.
User avatar
LittleSteps
Core Dumper
Posts: 157
Joined: Thu Apr 12, 2012 2:30 am

Re: Compiling Mac OS X 10.9.2 Mavericks

Post by LittleSteps »

voodoo wrote:Forget the xcode project, it is outdated. Grab source code from launchpad, as well as dlh's os-x-toolkit, and use command line as for linux (i.e. classical sequence, bootstrap.sh, configure, make, make install...) as stated in readme file dlh pointed out to you.
I have Xcode, the command line tools, automake and autocof, and the OS X toolkit, but I am just not sure how to use them. How would I use the OS X toolkit folder in the compiling? Also, The makefile found in the OS x toolkit folder wouldnt open in anything but a texteditor.

I understand it said to follow the unix vanilla, but Im not sure if i would need to cd to a folder first?

Code: Select all

Last login: Fri May  9 17:14:22 on ttys000
NCs-Mac-mini:~ NC$ cd /Users/NC/Desktop/\ arm\ source\ retry/armagetronad-experimental-0.4_alpha_z2069 
NCs-Mac-mini:armagetronad-experimental-0.4_alpha_z2069 NC$ sh ./bootstrap.sh
Copying license...
cp: COPYING.txt: No such file or directory
Running aclocal...
./bootstrap.sh: line 20: aclocal: command not found
NCs-Mac-mini:armagetronad-experimental-0.4_alpha_z2069 NC$ 

User avatar
voodoo
Core Dumper
Posts: 124
Joined: Wed Sep 27, 2006 11:51 am

Re: Compiling Mac OS X 10.9.2 Mavericks

Post by voodoo »

Ok, let's make it step by step, everything in a terminal. I'll assume you've already install bzr and auto tools.

1. download and build os-x-tools
This first step take care of downloading and building all dependencies, thanks to dlh.

Code: Select all

bzr co lp:~dlh/armagetronad/os-x-toolkit
cd os-x-toolkit
vi Makefile # optional. I'm using vi as a text editor, use the one you like. See below about the changes to make.
make build-all
cd ..
before throwing make build-all, you might want to edit Makefile first lines and adjust settings to use 10.9 (mavericks) sdk. Otherwise, You'll have to download corresponding sdk.

Code: Select all

ARCH ?= i386,x86_64
SDK ?= /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
VERSION_MIN ?= 10.9
2. download and build Armagetron Advances 0.4
This second step is very similar to vanilla unix. There's just a few parameters to pass to configure in order to specify where to find os-x-toolkit. I've passed more than necessary but in 1 of my comp, I had to do that to make it compiles smoothly.

Code: Select all

bzr co lp:armagetronad/0.4
cd 0.4
./bootstrap.sh
mkdir build; cd build
../configure --with-os-x-toolkit=/path/to/os-x-toolkit -with-os-x-arch=x86_64 --with-os-x-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk --with-os-x-version-min=10.9 SDL_CONFIG=/path/to/Sources/os-x-toolkit/libraries/bin/sdl-config CPPFLAGS=-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include LDFLAGS=-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib
make install
just replace your desired architecture (i386 or x86_64) and /path/to/ by yours and here come your Armagetron Advanced.app (in the build directory).

Have fun :)
User avatar
LittleSteps
Core Dumper
Posts: 157
Joined: Thu Apr 12, 2012 2:30 am

Re: Compiling Mac OS X 10.9.2 Mavericks

Post by LittleSteps »

Hey, thanks for the very detailed response! I installed the os tool kit succesfully but i got this error when trying to compile 0.4 after making me edits

Code: Select all

NCs-Mac-mini:~ NC$ bzr co lp:armagetronad/0.4
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data.  See "bzr help launchpad-login".
NCs-Mac-mini:~ NC$ cd 0.4                                             
NCs-Mac-mini:0.4 NC$ ./bootstrap.sh
Generating version...
Copying license...
Running aclocal...
./bootstrap.sh: line 20: aclocal: command not found
rm: aclocal.m4: No such file or directory
NCs-Mac-mini:0.4 NC$ 

What is in my bootstrap.sh

Code: Select all

#!/bin/sh

test $ACLOCAL    || ACLOCAL=aclocal
test $AUTOHEADER || AUTOHEADER=autoheader
test $AUTOCONF   || AUTOCONF=autoconf
test $AUTOMAKE   || AUTOMAKE=automake

# set -x

test -r ChangeLog || touch -t 198001010000 ChangeLog

MYDIR=`dirname $0`
if test -r batch/make/version; then
    echo "Generating version..."
    echo "m4_define(AUTOMATIC_VERSION,["`sh batch/make/version $MYDIR`"])" > version || exit 1
fi
echo "Copying license..."
cp COPYING.txt COPYING
echo "Running aclocal..." # Line 20
$ACLOCAL || { rm aclocal.m4; exit 1; }

echo "Running autoheader..."
rm -f config.h.in
$AUTOHEADER || { rm aa_config.h.in; exit 1; }

echo "Running autoconf..."
$AUTOCONF || { rm configure; exit 1; }

echo "Running automake..."
$AUTOMAKE -a -Wno-portability || { echo "Automake failed"; exit 1; }

echo "Flagging scripts as executable..."
chmod a+x $MYDIR/*.sh || exit 1
echo "Done!  You may now run configure and start building."
Looked like a automake problem so I thought about trying to reinstall automake and remember getting this before.

Code: Select all

cd $build
Last login: Sat May 10 12:23:17 on ttys000
NCs-Mac-mini:~ NC$ cd $build
NCs-Mac-mini:~ NC$ curl -OL http://ftpmirror.gnu.org/automake/automake-1.11.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   347  100   347    0     0   1208      0 --:--:-- --:--:-- --:--:--  1209
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 1339k  100 1339k    0     0   441k      0  0:00:03  0:00:03 --:--:--  552k
NCs-Mac-mini:~ NC$ tar xzf automake-1.11.tar.gz
NCs-Mac-mini:~ NC$ cd automake-1.11
NCs-Mac-mini:automake-1.11 NC$ ./configure --prefix=/usr/local
checking build system type... i386-apple-darwin13.1.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... lib/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for perl... /usr/bin/perl
checking whether /usr/bin/perl supports ithreads... yes
checking for tex... no
checking whether autoconf is installed... no
configure: error: Autoconf 2.60 or better is required.
    Please make sure it is installed and in your PATH.
NCs-Mac-mini:automake-1.11 NC$ make
make: *** No targets specified and no makefile found.  Stop.
NCs-Mac-mini:automake-1.11 NC$ sudo make install
Password:
Sorry, try again.
Password:
make: Nothing to be done for `install'.
NCs-Mac-mini:automake-1.11 NC$ 
Last edited by LittleSteps on Sat May 10, 2014 6:09 pm, edited 1 time in total.
User avatar
voodoo
Core Dumper
Posts: 124
Joined: Wed Sep 27, 2006 11:51 am

Re: Compiling Mac OS X 10.9.2 Mavericks

Post by voodoo »

Most likeky, you must update auto tools (autoconf, automaker, lib tools)
User avatar
LittleSteps
Core Dumper
Posts: 157
Joined: Thu Apr 12, 2012 2:30 am

Re: Compiling Mac OS X 10.9.2 Mavericks

Post by LittleSteps »

voodoo wrote:Most likeky, you must update auto tools (autoconf, automaker, lib tools)

I updated autoconf, automaker, and lib tools, so I tried to compile again and got this error

Code: Select all

Last login: Sat May 10 13:20:26 on ttys003
NCs-Mac-mini:~ NC$ cd 0.4
NCs-Mac-mini:0.4 NC$ ./bootstrap.sh
Generating version...
Copying license...
Running aclocal...
Running autoheader...
Running autoconf...
Running automake...
Flagging scripts as executable...
Done!  You may now run configure and start building.
NCs-Mac-mini:0.4 NC$ mkdir build; cd build
mkdir: build: File exists
NCs-Mac-mini:build NC$ ../configure --with-os-x-toolkit=/Users/NC/os-x-toolkit -with-os-x-arch=x86_64 --with-os-x-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk --with-os-x-version-min=10.9 SDL_CONFIG=/path/to/Sources/os-x-toolkit/libraries/bin/sdl-config CPPFLAGS=-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include LDFLAGS=-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib
checking build system type... i386-apple-darwin13.1.0
checking host system type... i386-apple-darwin13.1.0
checking target system type... i386-apple-darwin13.1.0
checking for ranlib... ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ../install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '501' is supported by ustar format... yes
checking whether GID '20' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether ln -s works... yes
checking for bison... bison -y
checking for m4... true
checking for style of include used by make... GNU
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking CXXFLAGS for gcc -nobodyreadsconfigureoutputanyway... no, unknown
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking dependency style of g++... (cached) gcc3
checking how to run the C++ preprocessor... g++ -E
checking for g++... g++
checking whether we are using the GNU Objective C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the Objective C++ preprocessor... g++ -E
checking for gmake... no
checking for bash... yes
checking for boostlib >= 1.33.1... yes
checking whether make understands sinclude... yes
checking for socklen_t... yes
checking for xmlParseMemory in -lxml2... yes
checking for xmlParserInputBufferCreateFilenameDefault... yes
checking for _ZN5boost6system15system_categoryEv in -lboost_system... yes
checking for _ZN5boost11this_thread5yieldEv in -lboost_thread... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for sys/stat.h... (cached) yes
checking for protoc... /Users/NC/os-x-toolkit/libraries/x86_64/bin/protoc
checking for _ZN6google8protobuf7MessageD2Ev in -lprotobuf... yes
checking google/protobuf/message.h usability... yes
checking google/protobuf/message.h presence... yes
checking for google/protobuf/message.h... yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking for clock_gettime in -lrt... no
checking whether SDL is installed... ../configure: line 12143: /path/to/Sources/os-x-toolkit/libraries/bin/sdl-config: No such file or directory
../configure: line 12148: /path/to/Sources/os-x-toolkit/libraries/bin/sdl-config: No such file or directory
checking for SDL_GL_SetAttribute... no
configure: error: You need the library SDL to compile Armagetron Advanced. Read the file doc/installation.txt.
NCs-Mac-mini:build NC$ make install
make: *** No rule to make target `install'.  Stop.
NCs-Mac-mini:build NC$ 

Could not find doc/installation.txt
I tried both architectures
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Re: Compiling Mac OS X 10.9.2 Mavericks

Post by dlh »

Try:

Code: Select all

$ ../configure --with-os-x-toolkit=/Users/NC/os-x-toolkit
The --with-os-x-(arch, sdk, version-min) options aren't required¹. Also, you shouldn't need to set SDL_CONFIG , CPPFLAGS or LDFLAGS.

1. The SDK and version-min setting will default to whatever OS X version you're running. Arch will default to i386.
User avatar
LittleSteps
Core Dumper
Posts: 157
Joined: Thu Apr 12, 2012 2:30 am

Re: Compiling Mac OS X 10.9.2 Mavericks

Post by LittleSteps »

dlh wrote:Try:

Code: Select all

$ ../configure --with-os-x-toolkit=/Users/NC/os-x-toolkit
The --with-os-x-(arch, sdk, version-min) options aren't required¹. Also, you shouldn't need to set SDL_CONFIG , CPPFLAGS or LDFLAGS.

1. The SDK and version-min setting will default to whatever OS X version you're running. Arch will default to i386.

It worked! Thank you so much for all your help guys!
*16
Core Dumper
Posts: 173
Joined: Wed Jun 02, 2010 12:59 pm

Re: Compiling Mac OS X 10.9.2 Mavericks

Post by *16 »

Code: Select all

NCs-Mac-mini:~ NC$ bzr co lp:armagetronad/0.4
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data.  See "bzr help launchpad-login".
NCs-Mac-mini:~ NC$ cd 0.4                                             
NCs-Mac-mini:0.4 NC$ ./bootstrap.sh
Generating version...
Copying license...
Running aclocal...
./bootstrap.sh: line 20: aclocal: command not found
rm: aclocal.m4: No such file or directory
NCs-Mac-mini:0.4 NC$ 
I have the same problem as LittleSteps here above, but I don't seem to find how to update automake properly. I tried multiple ways updating and the problem stayed. Any ideas or a correct way to update automake?

EDIT: Never mind, for some reason it kept going to an older version. After deleting all and reinstalling it did work.
Image
Post Reply