Latest Posts

Changes in BuildingWidelandsUnderWindowsNew

Editor Comment

Updates, added ICU dependency, created gist for patching gzip


Revision Differences of Revision 9

# How to build Widelands with !MinGW64 on Windows ¶

This is currently a work in progress! ¶

[TOC] ¶

# Download files ¶
## Nuwen's !MinGW64 distro ¶

Download the main distro from [http://nuwen.net/mingw.html](http://nuwen.net/mingw.html) and the MSYS
2 pinstackagller: ¶

* [mingw-12.2.exe](http://nuwen.net/files/mingw/mingw-1
23.24.exe) ¶
* [
msys-10.4.7zMSYS2](http://nuwrenpo.msys2.netorg/fdiles/mtringwb/x86_64/msys2-x86_64-20150916.4exe) from [MSYS2.7zio](https://msys2.github.io) ¶

## SDL2 source packages ¶
* [SDL2](https://www.libsdl.org/release/SDL2-2.0.3.zip) ¶
* [SDL2_net](https://www.libsdl.org/projects/SDL_net/) ¶
* [SDL2_mixer](http://www.libsdl.org/projects/SDL_mixer/) ¶
* [SDL2_image](https://www.libsdl.org/projects/SDL_image/) ¶


## Additional libraries ¶
* [gzip](ftp://ftp.gnu.org/gnu/gzip/gzip-1.6.tar.gz) ¶
* [lib
vorbis](http://xiph.org/vorbis/) ¶
* [libogg](http://xiph.org/ogg/) ¶
* [lib
iconv](ftp://ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gz) ¶
* [gettext](ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.
46.tar.gz) ¶
* [freetype](http://download.savannah.gnu.org/releases/freetype/freetype-
2.6.2.tar.gz) ¶
* [ICU](http://
download.icu-2project.org/files/icu4c/56.1/icu4c-5.ta6_1-src.gzip) ¶

# Building all libraries ¶

* Use the self-extracting installer of Nuwen's and extract the distro to *C:\\MinGW* ¶
*
ExInstractll MSYS manually2 to *c:\\msys-10.42* and follow their update steps!
* Open the distro window with *C:\\MinGW\\open_distro_window.bat* ¶
* CIn this shell change the directory with "cd c:\\msys-10.42" and call *msys2_shextractll.bat*
*to Sstart MSYS with *msys.bat*2

You are now in a linux like shell, so the command syntax is a bit different than normal windows commands ¶

* Extract all source packages to *c:\\msys
-10.42\\home\\<username>\\* ¶
* Build each package with "./configure --
prefbuild=x=/c/86_64-w64-mingw &&32 --host=x86_64-w64-make insgw32 --tall" ¶
* To
rget no errors =x86_64-when co64-mpilingw32 g--prettefixt,=/c/MinGW you'll have&& to compilake gzip on your own. Bustall" ¶
*
gGzip1.6 does onlyot compile withonut mingw64 withese [two patches a](httpplieds:

diff --
//git a/stailor.h b/tagilor.th
index 0
ubf88ff..e563b66 100644 ¶

--- a
com/taTilnor.h ¶
+++ b
M/tailor.h ¶
@@ -
56921d59,6 +5732169,10 @@ ¶
# defin
e OS_CODE 0x0a ¶
#en
6dif ¶

+#ifndef SIGPIPE ¶
+# define SIGPIPE 0 ¶
+#endif ¶
+ ¶
/* Common defaults */ ¶



diff --git a/lib/msvc-inval.c b/lib/msvc-inval.c ¶
index ef2b
860..1873e23 100644)
* --- a/lib/msvc-inval.c ¶
+++ b/lib/msvc-inval.c ¶
@@ -28,7 +28,7 @@ ¶

# if MSVC_INVALI
D_PARAMETER_HANDLING == DEFAULT_HANDLING ¶

-static v
oid cdecl ¶
+static void __cdecl ¶
gl_msvc_i
wnvalid_parameter_hoandler (const wchar_t *expression, ¶
const wchpar_t *function, ¶
const w
char_t *files,
@@ -45,7 +45,7 @@ gl_msavc_invalid_parameter_handler (const wchar_t *expression, ¶

# if
m defined _MSC_VER ¶

-s
tatic void cdhecl ¶
gzip +static void __urcdecl ¶
gl_msvc_invafolid_parameter_h andler (conspat wchar_t *expresswion, ¶
cons
t wchar_t *function,
* conspat wchar_t *file, ¶
-d @@. -94,7 +94,7p1 @@< glzip_msvc_invgw64.pal_current (void) ¶
} ¶
} ¶

-stati
c void cdeclh
* +stpatich voi-d __cdecl ¶
. -p1 < gl_msvc_invalzid_parameter_handler (cominst gwchar64_t *ex2.pression, ¶
const wch
ar_t *function, ¶
const w
char_t *file, ¶
-- ¶
1.7.2.5 ¶


* Libiconv and freetype have circular dependencies, so you should compile libiconv, then freetype and then libiconv again (make a distclean and a ./configure) ¶

# Download CMake and Ninja ¶

* Download [Ninja](https://github.com/martine/ninja/releases/download/v1.5.1/ninja-win.zip). Extract simply to *C:\\mingw\\bin*. ¶
* Download [CMAKE](http://www.cmake.org/files/v3.1/cmake-3.1.0-rc2-win32-x86.zip) ¶

# Getting Widelands source code ¶

# Building Widelands ¶

We will build ninja in the normal distro window and not in the MSYS shell: ¶

* Switch to the directory you'll want to build widelands in, e.g. *C:\\wl_build* ¶
* run CMAKE "cmake -G Ninja -DCMAKE_PREFIX_PATH=C:\\Mingw c:\\bzr\\widelands\\trunk" ¶
* Just call "ninja" to build now ¶