From The Mana World

Introduction

The following is the result of a lot of hacking and working around small problems, and certainly not complete yet nor probably the way you should actually be building TMW for Mac.

Note that TMW and all libraries are being installed to /Users/bjorn, you should probably use your own home directory. ;-)

Dependencies

All dependencies except the OpenGL library were statically linked.

OpenGL

On Tiger, we found the OpenGL headers in:

/System/Library/Frameworks/OpenGL.framework/Headers

These were copied to:

/Users/bjorn/include/GL

This is in order for Guichan and TMW to find "GL/gl.h".

libpng

libpng 1.2.8 does not use GNU autotools. We used "scripts/makefile.darwin" after modifying it to change the install prefix. Static libraries were installed by "make -f makefile.darwin install-static".

libogg

libvorbis

While the vorbis.com download page is still listing libvorbis 1.0.1, this version failed on Mac so libvorbis 1.1.1 was used which compiled fine.

libxml2

SDL

After installing SDL, make sure sdl-config is in your path (like add /Users/bjorn/bin to the PATH environment variable). This ensures dependent packages can find the SDL headers and libraries.

SDL_image

SDL_mixer

Guichan

We took the Guichan 0.4.0 release and applied one small fix to get transparency to work right on the big endian system. This fix can be found here.

Configure command:

./configure --prefix=$HOME --disable-shared \
  --enable-force-sdl --enable-force-sdlimage --enable-force-opengl \
  CXXFLAGS="-I/Users/bjorn/include -I/Users/bjorn/include/SDL"

PhysFS

PhysFS 1.0.0 needed a -lreadline added to its test_physfs_LDFLAGS in Makefile.in line 280.

The Mana World

The src/Makefile.in file had to be modified to include net/win2mac.cpp.

Configure command:

./configure --prefix=$HOME --with-opengl \
  CXXFLAGS="-I/Users/bjorn/include -I/Users/bjorn/include/SDL -I/Users/bjorn/include/libxml2 -DMACOSX" \
  LIBS="-L/Users/bjorn/lib -L/System/Library/Frameworks/OpenGL.framework/Libraries -lSDL -lpng"

Problems

There seems to be a crash involving attacking (possibly only certain creatures) Performance could use some improvement (drawing windows like the chat window appears to be the main CPU hog

Suggestions

Try --enable-static-link configure option and -static linker option.

Managed to build a segfaulting static binary of TMW on Linux with following command:

./configure --prefix=$HOME --with-opengl LDFLAGS="-static" LIBS="-L/usr/X11R6/lib/ -lssl -lcrypto \
  -lpng -lmikmod -lSDL -ljpeg -lvorbisfile -lvorbis -logg -lz -lXext -lX11 -lpthread -ldl"