Difference between revisions of "Compiling with MinGW (OpenXcom)"

From UFOpaedia
Jump to navigation Jump to search
m
Line 35: Line 35:
 
== MXE ==
 
== MXE ==
 
Michal uses a different setup for his own builds and gitbuilder, based on [http://mxe.cc/ MXE]. I haven't tried MXE myself but supposedly its compiler rejects the -msse2 flag. On the other hand, it looks like it'll build all the libraries for you!
 
Michal uses a different setup for his own builds and gitbuilder, based on [http://mxe.cc/ MXE]. I haven't tried MXE myself but supposedly its compiler rejects the -msse2 flag. On the other hand, it looks like it'll build all the libraries for you!
 +
 +
[[Category:OpenXcom]]

Revision as of 14:29, 5 May 2013

Compiling on Ubuntu 12.10 or 12.04LTS

Install the cross-compiler

`apt-get install g++-mingw-w64-i686`

This is the compiler targeting Win32/x86. If you want to build a 64-bit binary, you're on your own for libraries.

Grab the source

e.g., `git clone https://github.com/SupSuper/OpenXcom.git`

Don't have git installed? Install it with `apt-get install git`.

Download the prerequisite libraries

Building all the prerequisites from source is a good way to waste a day of your life. Some of them are availalbe in the stock package repositries, such as libsdl and libogg, but the majority are not. I recommend downloading the tarball of static libraries I've compiled.

Supposing that you've downloaded the file to ~/Downloads, install the contents with the following commands: `cd / ; tar xvJf ~/Downloads/OXC-mingw32-cross-tools.tar.xz`. This will place a bunch of files in /usr/local/cross-tools/i386-mingw32.

This fileset includes a 64-bit pkg-config binary. If you need a 32-bit one, build it with the following steps:

apt-get source pkg-config
cd pkg-config-*
./configure --prefix=/usr/local/cross-tools/i386-mingw32
make
sudo make install

Get the Makefile and make

Download my Makefile. It's based on Makefile.simple and Michal's gitbuilder file. Place the file in OpenXcom/src and `make`!

Note: -lws2_32 is only needed for ntohl(), used by the FLAC library iirc.


MXE

Michal uses a different setup for his own builds and gitbuilder, based on MXE. I haven't tried MXE myself but supposedly its compiler rejects the -msse2 flag. On the other hand, it looks like it'll build all the libraries for you!