Difference between revisions of "Compiling using MSYS"

From OdaWiki
m (Compiling with on Windows with Makefile moved to Compiling using MinGW)
Line 65: Line 65:
  
 
- If all steps were followed correctly, Code::Blocks should output a binary into the /Bin dir of your odamex svn folder.
 
- If all steps were followed correctly, Code::Blocks should output a binary into the /Bin dir of your odamex svn folder.
 +
 +
== Cygwin ==
 +
 +
[[Image:Cygwin.png|thumb|Screenshot of Odamex in Cygwin]]
 +
 +
Cygwin does not appear to have any sort of standard place where the development libraries can go
 +
 +
 +
===Step 1: Installing Cygwin===
 +
 +
Download and run the setup.exe file avalable from [http://www.cygwin.com/ here].  Make sure that the make, gcc and subversion (if you are going to download the source via svn) packages are selected to be installed.
 +
 +
===Step 2: Required Libraries ===
 +
 +
For ODAMEX to successfully compile, you must obtain some libraries for it, which are:
 +
 +
<b>SDL Development Libraries</b>
 +
 +
You can get the latest version of SDL [http://www.libsdl.org/download-1.2.php  here].  Extract the archive where you think it's approprite.  If you don't know where to put it, your home directory should work nicely.
 +
 +
<b>SDL_mixer Development Libraries</b>
 +
 +
You can get the latest version of SDL_mixer [http://www.libsdl.org/projects/SDL_mixer/ here].  Extract the archive where you think it's approprite.  If you don't know where to put it, your home directory should work nicely.
 +
 +
===Step 3: Patch SDL_config_minimal.h===
 +
 +
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;
 +
 +
===Step 4: Getting the source code for ODAMEX===
 +
 +
The source code can be obtained through the [http://odamex.net website] or from the [[SVN]] repository using cygwin's svn client.
 +
 +
===Step 5: Modifying your makefile===
 +
 +
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.
 +
 +
===Step 5: Compiling the ODAMEX source code===
 +
 +
Finally, you can '''make''', and the client and server and master server should compile sucessfully.
 +
 +
===Step 6: Obtaining the runtime libraries===
 +
 +
Once its all built (and no errors have occurred), you should find some binary files located in the '''trunk''' directory.  The only thing that you're likely missing is the SDL and SDL_Mixer runtime libraries.  Download the Win32 library from [http://www.libsdl.org/download-1.2.php here] and [http://www.libsdl.org/projects/SDL_mixer/ here].

Revision as of 16:40, 10 November 2006

Overview:


This guide contains information on how to compile Odamex using a MakeFile.

Download SVN Utility

- Download tortoisesvn and install, then restart.

Download MingW Files

- Get the following MinGW files:


NOTE: Use a program like 7-zip to extract tar.gz files.

Unpack Files

- Untar ALL MinGW files from the archives you just downloaded into a single directory, then right click on My Computer->Properties->Go to Advanced Tab->Environment Variables->System Variables and scroll down till you find the Path variable, click edit and add the following line:

;drive:\mingwdir\bin

drive:\ being the drive you installed mingw to (eg c:\)
mingwdir is self-explanatory (eg mingw\)

NOTE: Include the semi-colon at the start, or else it won't work. NOTE: In your mingw/bin dir, you should see a file named i386-mingw32-msvc-sdl-config, rename this to sdl-config.

Download SDL Packages

- Download the following SDL packages and untar/zip them to your MinGW dir.

Download MSYS

- You will need MSYS. You will need to add an environment variable to point to its bin dir aswell.

NOTE: You need MSYS, because gnu make and windows mkdir don't get on well together, not because you need sdl-config.

Create a Directory for Code

- Create a new dir somewhere, right click inside it and click SVN Checkout, type in svn://odamex.net:2000/ in the url field and click OK, wait until it says Completed in the Action column of the window.

Compile with Makefile

- Open a command prompt and go to your odamex trunk dir and type: make -f Makefile.win all

HINT: To get help on the makefile, type make -f Makefile.win help

Result

- If all steps were followed correctly, Code::Blocks should output a binary into the /Bin dir of your odamex svn folder.

Cygwin

Screenshot of Odamex in Cygwin

Cygwin does not appear to have any sort of standard place where the development libraries can go


Step 1: Installing Cygwin

Download and run the setup.exe file avalable from here. Make sure that the make, gcc and subversion (if you are going to download the source via svn) packages are selected to be installed.

Step 2: Required Libraries

For ODAMEX to successfully compile, you must obtain some libraries for it, which are:

SDL Development Libraries

You can get the latest version of SDL here. Extract the archive where you think it's approprite. If you don't know where to put it, your home directory should work nicely.

SDL_mixer Development Libraries

You can get the latest version of SDL_mixer here. Extract the archive where you think it's approprite. If you don't know where to put it, your home directory should work nicely.

Step 3: Patch SDL_config_minimal.h

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;

Step 4: Getting the source code for ODAMEX

The source code can be obtained through the website or from the SVN repository using cygwin's svn client.

Step 5: Modifying your makefile

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.

Step 5: Compiling the ODAMEX source code

Finally, you can make, and the client and server and master server should compile sucessfully.

Step 6: Obtaining the runtime libraries

Once its all built (and no errors have occurred), you should find some binary files located in the trunk directory. The only thing that you're likely missing is the SDL and SDL_Mixer runtime libraries. Download the Win32 library from here and here.