Installing DeSmuME from source on Mac OS X (Legacy Instructions)

From DeSmuME
(Difference between revisions)
Jump to: navigation, search

Revision as of 23:16, 22 February 2012

This is a guide to install DeSMuME from SVN on OS X 10.6 Snow Leopard, but should work for 10.5 aswell.

To install DeSmuME on OS X you will first need to install MacPorts, in order to install dependencies. Go to and follow the instructions there to install MacPorts.

A word of warning before you install any packages: if you're on Snow Leopard (OS X 10.6), your compiler will default to compiling for 64 bit processors. If you have libraries/frameworks compiled for 32 bit, you will get error messages while linking DeSmuME, because you have a mix of 32 and 64 bit binaries. You can avoid this by either compiling for 32 bit even on 64 bit machines (-m32 in compiler flags, later), or by installing universal packages with MacPorts. Universal packages contain 32 and 64 bit binaries at the same time and you can still decide to compile for 32 bit when shit hits the fan.

Ports you will need to install are glib2, libsdl, and wxWidgets. If I remember correctly, everything else is installed as a dependency of those. DeSmuME 0.9.6 (SVN) is moving towards wxWidgets as of now, so you probably won't want to bother with GTK etc, although they're still in the SVN repository.

Just for reference the full list of packages I installed:

 $ port installed
 autoconf @2.65_1 (active)
 automake @1.11.1_0+universal (active)
 expat @2.0.1_0+universal (active)
 freetype @2.3.12_0+macosx+universal (active)
 gettext @0.17_4+universal (active)
 glib2 @2.22.4_0+darwin+universal (active)
 gperf @3.0.4_0+universal (active)
 help2man @1.37.1_1+universal (active)
 jpeg @7_0+universal (active)
 libiconv @1.13.1_0+universal (active)
 libogg @1.1.4_0+universal (active)
 libpng @1.2.42_0+universal (active)
 libsdl @1.2.14_8+universal (active)
 libsdl_mixer @1.2.11_0+universal (active)
 libtool @2.2.6b_0+universal (active)
 libvorbis @1.2.3_0+universal (active)
 m4 @1.4.13_0+universal (active)
 ncurses @5.7_0+darwin_10
 ncurses @5.7_0+darwin_10+universal (active)
 ncursesw @5.7_0+darwin_10+universal (active)
 p5-locale-gettext @1.05_2 (active)
 perl5 @5.8.9_0 (active)
 perl5.8 @5.8.9_3+universal (active)
 pkgconfig @0.23_1+universal (active)
 smpeg @0.4.4_8+universal (active)
 tiff @3.9.2_2+macosx+universal (active)
 wxWidgets @2.8.9_1 (active)
 xorg-bigreqsproto @1.1.0_0 (active)
 xorg-inputproto @2.0_0 (active)
 xorg-kbproto @1.0.4_0 (active)
 xorg-libX11 @1.3.3_0+universal (active)
 xorg-libXau @1.0.5_0+universal (active)
 xorg-libXdmcp @1.0.3_0+universal (active)
 xorg-libXext @1.1.1_0+universal (active)
 xorg-libXrandr @1.3.0_1+universal (active)
 xorg-randrproto @1.3.1_0 (active)
 xorg-renderproto @0.11_0 (active)
 xorg-util-macros @1.6.0_0 (active)
 xorg-xcmiscproto @1.2.0_0 (active)
 xorg-xextproto @7.1.1_0 (active)
 xorg-xf86bigfontproto @1.2.0_0 (active)
 xorg-xproto @7.0.16_0 (active)
 xorg-xtrans @1.2.5_0 (active)
 xrender @0.9.5_0+universal (active)
 zlib @1.2.3_4+universal (active)

To install a package simply type "sudo port install libsdl +universal", for more info type "port info libsdl" or "port variants libsdl". To search a package type "port search sdl".

Another package you should install for the wxWidgets version is antigraingeometry. It's responsible for the HUD (messages on screen). Without it you won't be able to compile the wxWidgets port (although this dependency could be removed by developers, I guess). Sadly this package can't be built with MacPorts on Snow Leopard right now. However, you will be able to install the CLI (command line interface). I failed compiling antigraingeometry with MacPorts, but fink seems to work. On antigraingeometry's website you will only find a Makefile that produces a static library, sadly I was unable to compile DeSmuME with that one.

I didn't bother with OpenGL packages here, because it doesn't seem to be promoted by developers all that much, the software rasterizer is probably the better way to go.

Next is grabbing the source from the SVN. Fire up a terminal and go to the directory you want the source to be in, then call

 svn co desmume

After some time you should now have a directory called desmume, cd into desmume/trunk/desmume.

You can create a configure script by using ./ (if it's not executable, call chmod +x first). You can check out some compilation options with ./configure --help

Configure DeSmuME with:

 F="-march=core2 -fast"
 CFLAGS="$F" CXXFLAGS="$F" LDFLAGS="$F" ./configure --enable-wxwidgets

If you don't have an Intel Core 2 Duo (most Macs do, I think), look up the corresponding arch or leave it out. If you want to compile for 32 bit, add -m32 to F. If this is your first time compiling DeSmuME, you should stick to 32 bit first.

Further optimizations are -fomit-frame-pointer and the call "strip desmume" (or desmume-cli) to remove debug information from the binary and unncessary libs (for some reason stuff like OpenAL is added, although it wasn't chosen in configure). These optimizations will make it impossible to debug the program properly anymore, though.

Configure should complain about libagg, if you didn't solve that problem outside of MacPorts (which I personally didn't):

 configure: WARNING: Antigrain library not found, HUD will be disabled
 configure: WARNING: Antigrain library not found, wxWidgets frontend will be disabled

Now compile and install with

 make && sudo make install

You should now have desmume-cli in your path and play some pokemans with "desmume-cli pokemans.nds" and be sure to check out other options with desmume-cli -h.

Good luck! :)

Personal tools