Spring on MacOSX: Difference between revisions

From Spring
Jump to navigationJump to search
No edit summary
No edit summary
Line 50: Line 50:
Original Source code in Util.cpp:
Original Source code in Util.cpp:


<code>#else
#else
  __asm__ __volatile__(
  __asm__ __volatile__(
     "pushl %%ebx\n\t"
     "pushl %%ebx\n\t"
Line 59: Line 59:
     : "0" (*a)
     : "0" (*a)
   );
   );
#endif</code
#endif


Alter it like this:
Alter it like this:
<code>
#else
#else
   __asm__ __volatile__(
   __asm__ __volatile__(
Line 72: Line 71:
     : "0" (*a)
     : "0" (*a)
   );
   );
#endif </nocode>
#endif


Secondly, there is no command specified to create an error winnow during the game, so the compiler with complain about an unknown function.
Secondly, there is no command specified to create an error winnow during the game, so the compiler with complain about an unknown function.
Line 79: Line 78:
#elsif defined(__APPLE__)
#elsif defined(__APPLE__)
MacMessageBox(msg, caption, flags);
MacMessageBox(msg, caption, flags);
CAN SOMONE PUT THE CODE IN CODE TAGS, I TRIED BUT IT DIDNT WORK?


Now Spring will use the X Window system (x11) for displaying error windows, that might look ugly because its not using Apple's Aqua GUI style but it works and you wont experience much errors during gameplay anyway ;)
Now Spring will use the X Window system (x11) for displaying error windows, that might look ugly because its not using Apple's Aqua GUI style but it works and you wont experience much errors during gameplay anyway ;)

Revision as of 12:14, 4 December 2009

Because all needed libraries are available for OsX as well, you can compile a working version of Spring for Mac. But Unitsync will only work between Intel Macs and PCs, but not between those and PPC, and due to Apple's switch from PPC to Intel and due to the astronomical amount of effort it would take to to make them sync, there is no PPC port under development.

There's also a working lobby client for Mac OsX, follow the instruction below to compile it.

Install Sping from source on an Intel Mac

The following guide was created and tested in a 2,53 Ghz 13" MacBook Pro, 4 GB RAM Nvidia GeForce 9400M and a MacPro Xenon Quadcore ATI Radeon HD 4870.

Dependencies:

U will need the following dependencies to compile:

Programs necessary to build
   * Xcode Tools
   * cmake (included in Xcode tools)
   * zip
Libraries
   * SDL
   * boost (version 1.35 or later recommended)
   * DeviL (IL, ILU)
   * OpenAL (comes with Xcode tools)
   * OpenGL headers (mesa, glew, etc.) (comes with Xcode tools)
   * zlib
   * freetype
   * ogg,vorbis and vorbisfile 
   * Python (2.5) 

Download and install Macports (http://www.macports.org) You will need to be administrator to complete the following. Open the Terminal and copy and paste the first command and wait until it is completed, do continue one-by-one with the others (you will be asked for the admin passwort each time).

sudo port install cmake sudo port install libsdl sudo port install libsdl-framework sudo port install boost sudo port install boost-jam sudo port install libpng sudo port install jpeg sudo port install tiff sudo port install libogg sudo port install libvorbis sudo port install python25 sudo port install libdevil

This will take some time and disk space, but should complete without problems. If you experience any errors, download the dependencies' source and compile it.

Fixes

Download the latest spring source from the download page. If you try to compile now, you will experience some error, and therefor you will have to apply 2 fixes:

Firstly, there is an assembler code in Until.cpp you need to change: Original Source code in Util.cpp:

  1. else
__asm__ __volatile__(
   "pushl %%ebx\n\t"
   "cpuid\n\t"
   "movl %%ebx, %1\n\t"
   "popl %%ebx"
   : "=a" (*a), "=r" (*b), "=c" (*c), "=d" (*d)
   : "0" (*a)
 );
  1. endif

Alter it like this:

  1. else
 __asm__ __volatile__(
   "pushq %%rbx\n\t"
   "cpuid\n\t"
   "movl %%ebx, %1\n\t"
   "popq %%rbx"
   : "=a" (*a), "=r" (*b), "=c" (*c), "=d" (*d)
   : "0" (*a)
 );
  1. endif

Secondly, there is no command specified to create an error winnow during the game, so the compiler with complain about an unknown function. DELETE this part of the code in ErrorHandler.cpp:

  1. elsif defined(__APPLE__)

MacMessageBox(msg, caption, flags);

CAN SOMONE PUT THE CODE IN CODE TAGS, I TRIED BUT IT DIDNT WORK?

Now Spring will use the X Window system (x11) for displaying error windows, that might look ugly because its not using Apple's Aqua GUI style but it works and you wont experience much errors during gameplay anyway ;)

Compiling:

Open the Terminal, change into the Spring source folder (e.g.: "cd Desktop/spring_0_80_5_2/") and follow the interactions below: (You will be asked for the admin passwort)

type "sudo cmake ." (the dot and the gap is important) type "sudo make" (this will take some time) type "sumo make install"

Result Now, you will have a a Unix Executalbe File called "spring" in your source directory and a "spring" directory in "usr/local/share/games/" (you need to make hidden folders visible to see it). Create a folder called "maps" and a folder called "mods" there. (This is where Spring will check for maps/mods). You can double click on the spring file (mod+map needed) and test if everything is right.

Compiling the Lobby You will need to get a lobby client (e.g.: SpringLobby: http://springlobby.info) and the dependencies to compile it from source following this GUIDE. This Chapter will be extended soon.

--Grapefruit 11:08, 4 December 2009 (UTC)