Difference between revisions of "Compiling using MSYS"

From OdaWiki
Line 2: Line 2:
  
  
==MinGW and MSYS==
+
This document assumes that you want to use MSYS in order to parse the Windows-based makefile and compile with MinGW.  If you don't want to bother downloading an IDE, you've come to the right place.
===Ensure you have the proper files===
+
Get the following <b>MinGW</b> files:
+
  
* [http://prdownloads.sf.net/mingw/gcc-core-3.4.2-20040916-1.tar.gz?download gcc-core-3.4.2-20040916-1.tar.gz]
+
==Step 1: Getting MSYS==
* [http://prdownloads.sf.net/mingw/gcc-g++-3.4.2-20040916-1.tar.gz?download gcc-g++-3.4.2-20040916-1.tar.gz]
+
You can download Code::Blocks from its website here: [http://www.codeblocks.org/ MinGW - Minimal SYStem]. It doesn't matter where you install MSYS, but be sure and add MSYS's /bin/ directory to your $PATH$ environment variables, which you can find in System Properties -> Advanced.
* [http://prdownloads.sf.net/mingw/mingw-runtime-3.9.tar.gz?download mingw-runtime-3.9.tar.gz]
+
 
* [http://prdownloads.sf.net/mingw/w32api-3.6.tar.gz?download w32api-3.6.tar.gz]
+
==Step 2: Setting up the Compiler==
* [http://prdownloads.sf.net/mingw/binutils-2.15.91-20040904-1.tar.gz?download binutils-2.15.91-20040904-1.tar.gz]
+
You need the latest version of MinGW from [http://www.mingw.org/download.shtml this website]. You need the latest stable versions of the following packages...
* [http://prdownloads.sf.net/mingw/mingw32-make-3.80.0-3.exe?download mingw32-make-3.80.0-3.exe]
+
* mingw-runtime
* [http://prdownloads.sf.net/mingw/gdb-5.2.1-1.exe?download gdb-5.2.1-1.exe]
+
* mingw32-make
<BR>
+
* w32api
In addition, you will need the latest version of MSYS:
+
* binutils
* [http://prdownloads.sourceforge.net/mingw/MSYS-1.0.10.exe?download MSYS-1.0.10.exe]
+
* gcc
<b><u>NOTE:</u></b> Use a program like 7-zip to extract tar.gz files.
+
* g++
 +
 
 +
Download all of them and extract them to C:\mingw. If you're using Windows and don't have an archiver capable of handling tar.gz files, stop living in the stone age and download [http://www.7-zip.org/ 7-Zip]. If you are compiling ODAMEX for the purpose of debugging, grab gdb as well.
  
===Unpack Files===
+
==Step 3: Unpack Files==
 
- Untar <b>ALL MinGW</b> files from the archives you just downloaded into a single directory, then right click on <i>My Computer->Properties->Go to Advanced Tab->Environment Variables->System Variables</i> and scroll down till you find the Path variable, click edit and add the following line:<BR>
 
- Untar <b>ALL MinGW</b> files from the archives you just downloaded into a single directory, then right click on <i>My Computer->Properties->Go to Advanced Tab->Environment Variables->System Variables</i> and scroll down till you find the Path variable, click edit and add the following line:<BR>
 
<BR>
 
<BR>
Line 29: Line 29:
 
<b><u>NOTE:</u></b> In your mingw/bin dir, you should see a file named <b>i386-mingw32-msvc-sdl-config</b>, rename this to <b>sdl-config</b>.
 
<b><u>NOTE:</u></b> In your mingw/bin dir, you should see a file named <b>i386-mingw32-msvc-sdl-config</b>, rename this to <b>sdl-config</b>.
  
===Download SDL Packages===
+
==Step 4: Download SDL Packages==
  
 
- Download the following SDL packages and untar/zip them to your MinGW dir.
 
- Download the following SDL packages and untar/zip them to your MinGW dir.
Line 36: Line 36:
  
 
* [http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-devel-1.2.6-VC6.zip SDL_mixer-devel-1.2.6-VC6.zip]
 
* [http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-devel-1.2.6-VC6.zip SDL_mixer-devel-1.2.6-VC6.zip]
 
===Download MSYS===
 
 
- You will need [http://prdownloads.sf.net/mingw/MSYS-1.0.10.exe?download MSYS.] You will need to add an environment variable to point to its bin dir aswell.
 
 
<b><u>NOTE:</u></b> 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 Directory for Code===
 
 
- Create a new dir somewhere, right click inside it and click <b>SVN Checkout</b>, type in <b>svn://odamex.net:2000/</b> in the url field and click OK, wait until it says <b>Completed</b> in the Action column of the window.
 
- Create a new dir somewhere, right click inside it and click <b>SVN Checkout</b>, type in <b>svn://odamex.net:2000/</b> in the url field and click OK, wait until it says <b>Completed</b> in the Action column of the window.
  
 
===Compile with Makefile===
 
===Compile with Makefile===
 
 
- Open a command prompt and go to your odamex trunk dir and type: <b>make -f Makefile.win all</b>
 
- Open a command prompt and go to your odamex trunk dir and type: <b>make -f Makefile.win all</b>
  
Line 54: Line 46:
  
 
===Result===
 
===Result===
 
 
- 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.

Revision as of 04:09, 19 January 2007