Difference between revisions of "Compiling using GCC"

From OdaWiki
(Cygwin)
Line 21: Line 21:
 
Then, substitue '''gmake''' for '''make''', respectively.
 
Then, substitue '''gmake''' for '''make''', respectively.
  
== Cygwin ==
+
===Cygwin===
Odamex does not compile natively under Cygwin at this timeHowever, you can still use Cygwin to compile Odamex as a MinGW programPlease see the appropraite article for details.
+
Unfortunately, SDL does not always play ball with cygwin's headers. The biggest offender has been a conflict between <SDL_config_minimal.h> and <stdint.h>. You may need to edit the following two lines in <SDL_config_minimal.h>:
 +
 
 +
* typedef signed int int32_t;
 +
* typedef unsigned int uint32_t;
 +
 
 +
To read:
 +
 
 +
* typedef signed long int int32_t;
 +
* typedef unsigned long int uint32_t;
 +
 
 +
Also there is one extra step you have to do before compilingYou must edit the makefile in the root of the branch you want to compile.  The two things you must change are SDL_LOCATION and SDL_MIXER_LOCATION, and you have to modify these two lines to point to the directories where you extracted your SDL and SDL_Mixer development libraries, respectively.

Revision as of 04:52, 13 November 2006

GCC is the official GNU C Compiler which is bundled with many Unix and Linux distributions. This article assumes that you are planning to build Odamex at the command line. If you are using an IDE that uses GCC as its compiler, please refer to the IDE's documentation in this wiki on how to compile Odamex.


Compiling in a nutshell

Compiling using GCC is simple. Simply go to the root directory of the branch that you want to compile and type:

make

This will compile the client, the server and the master, one after another. If you want to compile them one at a time, simply use one of the following commands:

make client
make server
make master

That's it!

FreeBSD

FreeBSD has their own version of make, which is not compatable with Odamex. In order to compile under FreeBSD, you must install gmake from the ports collection:

Then, substitue gmake for make, respectively.

Cygwin

Unfortunately, SDL does not always play ball with cygwin's headers. The biggest offender has been a conflict between <SDL_config_minimal.h> and <stdint.h>. You may need to edit the following two lines in <SDL_config_minimal.h>:

  • typedef signed int int32_t;
  • typedef unsigned int uint32_t;

To read:

  • typedef signed long int int32_t;
  • typedef unsigned long int uint32_t;

Also there is one extra step you have to do before compiling. You must edit the makefile in the root of the branch you want to compile. The two things you must change are SDL_LOCATION and SDL_MIXER_LOCATION, and you have to modify these two lines to point to the directories where you extracted your SDL and SDL_Mixer development libraries, respectively.