CatfishMan (talk | contribs) |
CatfishMan (talk | contribs) |
||
Line 1: | Line 1: | ||
== 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 [http://guichan.sourceforge.net/forum/read.php?3,240 here]. | |||
'''Configure command:''' | |||
<pre> | |||
./configure --prefix=$HOME --disable-shared \ | |||
--enable-force-sdl --enable-force-sdlimage --enable-force-opengl \ | |||
CXXFLAGS="-I/Users/bjorn/include -I/Users/bjorn/include/SDL" | |||
</pre> | |||
=== 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:''' | |||
<pre> | |||
./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" | |||
</pre> | |||
== 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: | |||
<pre> | |||
./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" | |||
</pre> | |||
== Making it more Mac-like == | |||
Raw binaries, data files in folders, and .zip distributions are all nontypical for Mac applications. The source code for a Cocoa wrapper-program for tmw can be found here: http://home.comcast.net/~Catfish_Man/ManaWorld.zip | |||
Place the tmw binary and data folder in the project folder, open ManaWorld.xcode (or .xcodeproj for Xcode 2.1 and later users. It can automatically convert between the two formats), and click build. You should get a copy of ManaWorld.app located in the build folder. Since it's built in development mode, this won't work except on the computer it's built on. To switch to deployment mode go to the build menu, choose build results, and change the active build configuration to Deployment. | |||
<further instructions on changing the app name, adding an icon, etc... should go here later. It's the same as for any normal Cocoa app> |
Revision as of 21:42, 9 July 2005
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"
Making it more Mac-like
Raw binaries, data files in folders, and .zip distributions are all nontypical for Mac applications. The source code for a Cocoa wrapper-program for tmw can be found here: http://home.comcast.net/~Catfish_Man/ManaWorld.zip
Place the tmw binary and data folder in the project folder, open ManaWorld.xcode (or .xcodeproj for Xcode 2.1 and later users. It can automatically convert between the two formats), and click build. You should get a copy of ManaWorld.app located in the build folder. Since it's built in development mode, this won't work except on the computer it's built on. To switch to deployment mode go to the build menu, choose build results, and change the active build configuration to Deployment.
<further instructions on changing the app name, adding an icon, etc... should go here later. It's the same as for any normal Cocoa app>