Skip to content

Compilation guide (OS X)

Themaister edited this page Jan 5, 2012 · 12 revisions

Compilation on OS X is mostly MacPorts based. Dependencies can be build from MacPorts.

Dependencies

MacPorts installed
pkgconfig
libsdl 1.2 (1.3 devel might work, but is not advised)
git-core - To pull the sources :D

Important note for OSX 10.7+ (Lion) users

OSX 10.6 deprecated some calls used by SDL, and was removed in 10.7, causing fullscreen modes to fail. If you are on 10.7 you should build SDL from latest mercurial checkout, which has a fix for this. MacPorts are not currently building with the important patch applied, so, if regular MacPorts SDL fails for you, this should do the trick:

### If you have not installed mercurial/Hg yet.
sudo port install mercurial
###
hg clone -u SDL-1.2 http://hg.libsdl.org/SDL SDL-1.2
cd SDL-1.2
./autogen.sh
./configure --prefix=/opt/local
make
sudo make install

As this conflicts with the installed MacPorts SDL, it is recommended to disable updates for SDL if possible (unless new updates have fixes applied :D).

Optional dependencies

libxml2 - XML shaders and cheat support
freetype - TTF font rendering

Building libsnes

By default XCode ships with GCC 4.2.1 as latest available compiler. This cannot build bSNES libsnes directly, so if you haven't installed GCC 4.5 or better with MacPorts, you have to use the libsnes C++98 repo, instructions here will assume you will use the C++98 port:

git clone git://github.com/Themaister/libsnes.git
cd libsnes
make profile=performance prefix=/opt/local # You can use compatibility or accuracy if desired.
sudo make install prefix=/opt/local

Building SSNES

Standard Unix fare now that the dependencies are in place:

git clone git://github.com/Themaister/SSNES.git
cd SSNES
./configure --prefix=/opt/local # Script will autodetect features. Refer to --help if you want to override anything.
make
sudo make install

Building GUI

If you want to build the GUI, GCC 4.5 or more recent is required, so I hope you have a powerful CPU! :D You'll also need to install qt4-mac from MacPorts. Qt could also be downloaded directly from their home pages and installed that way.

git clone git://github.com/Themaister/SSNES-Phoenix.git
cd SSNES-Phoenix
make # If you downloaded Qt from their homepage.
make MACPORTS_QT=1 # If you built Qt from MacPorts.

You should now have an SSNES-Phoenix.app which should work. Enjoy! :)

Clone this wiki locally