Difference between revisions of "Build Win32 Minetest including all required libraries"

From Minetest Developer Wiki
Jump to navigation Jump to search
(17 intermediate revisions by 5 users not shown)
Line 1: Line 1:
=Common=
+
= Common =
==cmake (windows version)==
+
== CMake (Windows version) ==
You need to install cmake for all versions. I recommend using gui.
+
You need to install CMake for all versions. It is recommended to use the GUI.
  
=Mingw32 build=
+
= Mingw32 build =
==mingw32 (tested 0.6.2-beta-20131004-1)==
+
== mingw32 (tested 0.6.2-beta-20131004-1) ==
*select following packages:
+
* Select following packages:
**mingw32-base
+
** mingw32-base
**mingw32-gcc-g++
+
** mingw32-gcc-g++
**msys-base
+
** msys-base
**mingw32-libz-dev
+
** mingw32-libz-dev
**mingw32-gettext-(dev/bin/dll)
+
** mingw32-gettext-(dev/bin/dll)
**mingw32-iconv-(dev/bin/dll)
+
** mingw32-iconv-(dev/bin/dll) aka mingw32-libiconv-(dev/bin/dll)
**msys-patch
+
** msys-patch
**msys-w32api
+
** msys-w32api
* make sure C:\mingw\bin is in system path variable
+
* Make sure C:\mingw\bin is in system path variable
  
==curl-7.33.0==
+
==Libidn 2.0.9 (dependency only for curl 7.36)==
 +
* Extract package
 +
* Open msys console
 +
* Enter package path
 +
./configure
 +
make
 +
make install
 +
 
 +
== cURL library (different versions) ==
 +
 
 +
=== curl-7.33.0 ===
 +
 
 +
* Extract package
 +
* Open msys console
 +
* Enter package path
 
  ./configure --prefix=/mingw --with-winssl --enable-ipv6
 
  ./configure --prefix=/mingw --with-winssl --enable-ipv6
 
  make
 
  make
==gettext==
 
use version from mingw
 
  
==libogg-1.3.1==
+
=== curl-7.36.0 ===
 +
 
 +
* Make sure you have libidn installed
 +
* Download and install Openssl sdk package 1.0.1g or newer
 +
* Open msys console
 +
* Add OPENSLL_PATH as environment variable pointed to openssl sdk build folder
 +
export OPENSLL_PATH='C:\Program Files (x86)\OpenSSL-Win32'
 +
* Enter package path
 +
./configure --prefix=/mingw --with-winssl --enable-ipv6
 +
cd lib
 +
make -f Makefile.m32 SSL=1 IP6=1
 +
 
 +
== gettext ==
 +
 
 +
Use version from MinGW.
 +
 
 +
== libogg-1.3.1 ==
 +
 
 +
* Extract package
 +
* Open msys console
 +
* Enter package path
 
  ./configure --prefix=/mingw
 
  ./configure --prefix=/mingw
 
  make
 
  make
 
  make install
 
  make install
  
==libvorbis-1.3.3==
+
== libvorbis-1.3.3 ==
 +
* Extract package
 +
* Open msys console
 +
* Enter package path
 
  ./configure --prefix=/mingw
 
  ./configure --prefix=/mingw
 
  make
 
  make
 
  make install
 
  make install
  
==Luajit-2.0.2==
+
== luajit-2.0.2 ==
1) preparation: apply patch
+
 
 +
* Extract package
 +
* Open msys console
 +
* Enter package path
 +
1) Preparation: apply patch
 
  diff -Naur LuaJIT-2.0.2/src/lib_package.c LuaJIT-2.0.2-old//src/lib_package.c
 
  diff -Naur LuaJIT-2.0.2/src/lib_package.c LuaJIT-2.0.2-old//src/lib_package.c
 
  --- LuaJIT-2.0.2/src/lib_package.c 2013-10-20 16:11:52 +0000
 
  --- LuaJIT-2.0.2/src/lib_package.c 2013-10-20 16:11:52 +0000
Line 49: Line 88:
 
   static void setprogdir(lua_State *L)
 
   static void setprogdir(lua_State *L)
  
2) build
+
2) Build
 
  make
 
  make
  
==zlib==
+
== zlib ==
use mingw version!
 
  
1) fix serialization.cpp to not set ZLIB_WINAPI in case of __MINGW32__ is defined
+
Use MinGW version.
  
==irrlicht engine (different versions)==
+
1) Fix serialization.cpp to not set ZLIB_WINAPI in case of __MINGW32__ is defined.
===directx sdk===
 
download direct x sdk from microsoft and install
 
  
===irrlicht-1.8===
+
== Irrlicht engine (different versions) ==
1) edit irrlicht makefile
 
  
1.1) add directx sdk inc path to CXXINCS using -I"path"
+
=== DirectX SDK (tested with June 2010 version) ===
  
1.2) add directx sdk lib path to CXXINCS using -L"path"
+
Download the DirectX SDK from Microsoft and install it.
  
1.3) enable direct x by commenting the line with NO_IRR_COMPILE_WITH_DIRECT3D_9_
+
=== Irrlicht 1.8.1 ===
  
1.4) add -ldinput8 and -ldxguid to win32 LDFLAGS
+
Download the official SDK, as it contains precompiled builds.
  
1.4) replace -ld3dx9d by d3dx9
+
=== Irrlicht 1.8 ===
  
2) build
+
* Extract package
 +
 
 +
1) Edit Irrlicht's Makefile
 +
 
 +
1.1) Add DirectX SDK include path to CXXINCS using -I"path"
 +
 
 +
1.2) Add DirectX SDK library path to CXXINCS using -L"path"
 +
 
 +
1.3) Enable DirectX by commenting the line with NO_IRR_COMPILE_WITH_DIRECT3D_9_
 +
 
 +
1.4) Add -ldinput8 and -ldxguid to win32 LDFLAGS
 +
 
 +
1.4) Replace -ld3dx9d by d3dx9
 +
 
 +
2) Build
 +
 
 +
* Open msys console
 +
* Enter package path
 
  cd irrlicht-1.8/source/Irrlicht
 
  cd irrlicht-1.8/source/Irrlicht
 
  make win32 NDEBUG=1
 
  make win32 NDEBUG=1
  
===irrlicht-1.7.3===
+
=== Irrlicht 1.7.3 ===
1) edit irrlicht makefile
+
* Extract package
 +
1) Edit Irrlicht's Makefile
  
1.1) add directx sdk inc path to CXXINCS using -I"path"
+
1.1) add DirectX SDK include path to CXXINCS using -I"path"
  
1.2) add directx sdk lib path to CXXINCS using -L"path"
+
1.2) add DirectX SDK library path to CXXINCS using -L"path"
  
1.3) enable direct x by commenting the line with NO_IRR_COMPILE_WITH_DIRECT3D_9_
+
1.3) Enable DirectX by commenting the line with NO_IRR_COMPILE_WITH_DIRECT3D_9_
  
1.4) add -ldinput8 and -ldxguid to win32 LDFLAGS
+
1.4) Add -ldinput8 and -ldxguid to win32 LDFLAGS
  
1.4) replace -ld3dx9d by d3dx9
+
1.4) Replace -ld3dx9d by d3dx9
  
1.5) remove -Wl,--no-export-all-symbols from LDFLAGS
+
1.5) Remove -Wl,--no-export-all-symbols from LDFLAGS
  
1.6) open IrrCompileConfig.h in include folder and comment #define _IRR_COMPILE_WITH_DIRECT3D_8_
+
1.6) Open IrrCompileConfig.h in include folder and comment #define _IRR_COMPILE_WITH_DIRECT3D_8_
  
2) build
+
2) Build
 +
 
 +
* Open msys console
 +
* Enter package path
 
  cd irrlicht-1.7.3/source/Irrlicht
 
  cd irrlicht-1.7.3/source/Irrlicht
 
  make win32 NDEBUG=1
 
  make win32 NDEBUG=1
  
==libpng-1.6.6==
+
== libpng-1.6.10 ==
Make sure you have installed libz-dev from mingw
+
 
 +
Make sure you have installed libz-dev from MinGW and downloaded libpng pack for GNU/Linux (Windows one don't contains ./configure file)
 +
* Extract package
 +
* Open msys console
 +
* Enter package path
 
  ./configure --prefix=/mingw --enable-shared
 
  ./configure --prefix=/mingw --enable-shared
 
  make
 
  make
 
  make install
 
  make install
  
==freetype-2.5.0 (requires libpng)==
+
== freetype-2.5.3 (requires libpng) ==
 +
 
 +
* Extract package
 +
* Open msys console
 +
* Enter package path
 
  ./configure --prefix=/mingw
 
  ./configure --prefix=/mingw
 +
make
 +
make install
  
Open builds/unix/unix-cc.mk and remove "-ansi" from ANSIFLAGS
+
== OpenAL SDK ==
  
make
+
Install the official SDK, version 1.1.
make install
 
  
==openal sdk==
+
== Minetest ==
install official sdk 1.1
 
  
==minetest==
+
* Run CMake and configure correctly
*run cmake and configure correctly
+
* Open commandline and enter the following command (if it fails check path, make sure mingw/bin is in there)
*open commandline and enter following command (if it fails check path, make sure mingw/bin is in there)
 
 
  mingw32-make
 
  mingw32-make
  
Line 125: Line 188:
  
  
=Mingw64 Build=
+
= MinGW64 Build =
==mingw64==
 
download
 
install
 
 
 
==msys from mingw32==
 
copy e.g. from mingw32
 
make sure path for you msys shell is set to mingw64 compiler!
 
  
==TODO all other libs==
+
== MinGW64 ==
  
 +
Download and install.
  
 +
== msys from mingw32 ==
  
 +
Copy e.g. from mingw32 and make sure path for your msys shell is set to mingw64 compiler!
  
 +
<!--== TODO all other libs ==-->
  
 +
<br>
 
=VS2012 Build=
 
=VS2012 Build=
 
==Install VS Express 2012==
 
==Install VS Express 2012==
 +
* Download from Microsoft and install
 
==Irrlicht 1.8==
 
==Irrlicht 1.8==
* open sln v11 file
+
* Open sln v11 file
* build release
+
* Build release
 +
 
 +
== libogg ==
  
==libogg==
+
* Open sln v10 file
* open sln v10 file
+
* Convert
* convert
+
* Build release
* build release
 
  
==libvorbis==
+
== libvorbis ==
* open sln v10 file
 
* convert
 
* add libogg include path
 
* add libogg lib path
 
* build release (libvorbis/libvorbisfile)
 
  
==luajit-2.0.2==
+
* Open sln v10 file
* extract
+
* Convert
* build (open vs2012 developer console)
+
* Add libogg include path
 +
* Add libogg library path
 +
* Build release (libvorbis/libvorbisfile)
 +
 
 +
== luajit-2.0.2 ==
 +
 
 +
* Extract
 +
* Build (open vs2012 developer console)
 
  cd src
 
  cd src
 
  msvcbuild.bat
 
  msvcbuild.bat
  
==zlib-1.2.8==
+
== zlib-1.2.8 ==
* extract
+
 
* navigate to the /contrib/masmx86 folder.  
+
* Extract
 +
* Navigate to the /contrib/masmx86 folder.  
 
** Open the “bld_ml32.bat” file in a text editor.
 
** Open the “bld_ml32.bat” file in a text editor.
 
** Add the “/safeseh” switch to both lines in that file (e.g. “ml /safeseh /coff /Zi /c /Flmatch686.lst match686.asm”).
 
** Add the “/safeseh” switch to both lines in that file (e.g. “ml /safeseh /coff /Zi /c /Flmatch686.lst match686.asm”).
** zLib uses a Version number declaration that can cause the build process to fail. To fix this, go back to the Solution Explorer, then navigate to zlibvc -> zlibvc.def. Double-click to open.
+
** zlib uses a Version number declaration that can cause the build process to fail. To fix this, go back to the Solution Explorer, then navigate to zlibvc -> zlibvc.def. Double-click to open.
 
** Change the line that reads “VERSION 1.2.8″ to read “VERSION 1.28″.
 
** Change the line that reads “VERSION 1.2.8″ to read “VERSION 1.28″.
 
** edit iowin32.c comment line "#define IOWIN32_USING_WINRT_API 1"
 
** edit iowin32.c comment line "#define IOWIN32_USING_WINRT_API 1"
  
==curl-7.33.0==
+
== curl-7.33.0 ==
* extract
+
 
* build
+
* Extract
 +
* Build
 
  cd winbuild
 
  cd winbuild
 
  nmake /f Makefile.vc mode=dll ENABLE_WINSSL=yes ENABLE_IPV6=yes
 
  nmake /f Makefile.vc mode=dll ENABLE_WINSSL=yes ENABLE_IPV6=yes
* your new build as well as headers is in builds subfolder
+
* Your new build as well as headers is in builds subfolder
  
==freetype-2.5.0==
+
== freetype-2.5.0 ==
* extract
+
 
* open solution in builds\win32\vc2010
+
* Extract
* convert
+
* Open solution in builds\win32\vc2010
* switch "Configuration type" to "dynamic link library"
+
* Convert
* change target extension
+
* Switch "Configuration type" to "dynamic link library"
* open include/freetype/config/ftconfig.h
+
* Change target extension
* add following lines in MSVC block
+
* Open include/freetype/config/ftconfig.h
 +
* Add following lines in MSVC block
 
  #define FT_EXPORT(x) __declspec(dllexport) x
 
  #define FT_EXPORT(x) __declspec(dllexport) x
 
  #define FT_BASE(x) __declspec(dllexport) x
 
  #define FT_BASE(x) __declspec(dllexport) x
* build release
+
* Build release
 +
 
 +
== gettext (requires libiconv) ==
 +
 
 +
Use the official GNU gettext 0.13.1 win32 build.
 +
 
 +
== libiconv ==
  
==gettext (requires libiconv)==
+
Use the official GNU libiconv 1.9.1 win32 build.
use official gnu gettext 0.13.1 win32 build
 
  
==libiconv==
+
== Minetest ==
use official gnu libiconv 1.9.1 win32 build
 
  
==minetest==
+
* Run CMake GUI and configure correctly
*run cmake gui and configure correctly
+
* Open msvc developer console and enter mintest base path
*open msvc developer console and enter mintest base path
 
 
  msbuild minetest.sln /p:Configuration=Release /t:Clean,Build
 
  msbuild minetest.sln /p:Configuration=Release /t:Clean,Build
 +
[[Category:Compiling Minetest]]

Revision as of 14:25, 4 September 2017

Common

CMake (Windows version)

You need to install CMake for all versions. It is recommended to use the GUI.

Mingw32 build

mingw32 (tested 0.6.2-beta-20131004-1)

  • Select following packages:
    • mingw32-base
    • mingw32-gcc-g++
    • msys-base
    • mingw32-libz-dev
    • mingw32-gettext-(dev/bin/dll)
    • mingw32-iconv-(dev/bin/dll) aka mingw32-libiconv-(dev/bin/dll)
    • msys-patch
    • msys-w32api
  • Make sure C:\mingw\bin is in system path variable

Libidn 2.0.9 (dependency only for curl 7.36)

  • Extract package
  • Open msys console
  • Enter package path
./configure
make
make install

cURL library (different versions)

curl-7.33.0

  • Extract package
  • Open msys console
  • Enter package path
./configure --prefix=/mingw --with-winssl --enable-ipv6
make

curl-7.36.0

  • Make sure you have libidn installed
  • Download and install Openssl sdk package 1.0.1g or newer
  • Open msys console
  • Add OPENSLL_PATH as environment variable pointed to openssl sdk build folder
export OPENSLL_PATH='C:\Program Files (x86)\OpenSSL-Win32'
  • Enter package path
./configure --prefix=/mingw --with-winssl --enable-ipv6
cd lib
make -f Makefile.m32 SSL=1 IP6=1

gettext

Use version from MinGW.

libogg-1.3.1

  • Extract package
  • Open msys console
  • Enter package path
./configure --prefix=/mingw
make
make install

libvorbis-1.3.3

  • Extract package
  • Open msys console
  • Enter package path
./configure --prefix=/mingw
make
make install

luajit-2.0.2

  • Extract package
  • Open msys console
  • Enter package path

1) Preparation: apply patch

diff -Naur LuaJIT-2.0.2/src/lib_package.c LuaJIT-2.0.2-old//src/lib_package.c
--- LuaJIT-2.0.2/src/lib_package.c	2013-10-20 16:11:52 +0000
+++ LuaJIT-2.0.2-old//src/lib_package.c	2013-10-20 16:13:28 +0000
@@ -76,9 +76,8 @@
 #ifndef GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
 #define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS  4
 #define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT  2
-BOOL WINAPI GetModuleHandleExA(DWORD, LPCSTR, HMODULE*);
 #endif
-
+WINBASEAPI BOOL WINAPI GetModuleHandleExA(DWORD, LPCSTR, HMODULE*);
 #undef setprogdir
 
 static void setprogdir(lua_State *L)

2) Build

make

zlib

Use MinGW version.

1) Fix serialization.cpp to not set ZLIB_WINAPI in case of __MINGW32__ is defined.

Irrlicht engine (different versions)

DirectX SDK (tested with June 2010 version)

Download the DirectX SDK from Microsoft and install it.

Irrlicht 1.8.1

Download the official SDK, as it contains precompiled builds.

Irrlicht 1.8

  • Extract package

1) Edit Irrlicht's Makefile

1.1) Add DirectX SDK include path to CXXINCS using -I"path"

1.2) Add DirectX SDK library path to CXXINCS using -L"path"

1.3) Enable DirectX by commenting the line with NO_IRR_COMPILE_WITH_DIRECT3D_9_

1.4) Add -ldinput8 and -ldxguid to win32 LDFLAGS

1.4) Replace -ld3dx9d by d3dx9

2) Build

  • Open msys console
  • Enter package path
cd irrlicht-1.8/source/Irrlicht
make win32 NDEBUG=1

Irrlicht 1.7.3

  • Extract package

1) Edit Irrlicht's Makefile

1.1) add DirectX SDK include path to CXXINCS using -I"path"

1.2) add DirectX SDK library path to CXXINCS using -L"path"

1.3) Enable DirectX by commenting the line with NO_IRR_COMPILE_WITH_DIRECT3D_9_

1.4) Add -ldinput8 and -ldxguid to win32 LDFLAGS

1.4) Replace -ld3dx9d by d3dx9

1.5) Remove -Wl,--no-export-all-symbols from LDFLAGS

1.6) Open IrrCompileConfig.h in include folder and comment #define _IRR_COMPILE_WITH_DIRECT3D_8_

2) Build

  • Open msys console
  • Enter package path
cd irrlicht-1.7.3/source/Irrlicht
make win32 NDEBUG=1

libpng-1.6.10

Make sure you have installed libz-dev from MinGW and downloaded libpng pack for GNU/Linux (Windows one don't contains ./configure file)

  • Extract package
  • Open msys console
  • Enter package path
./configure --prefix=/mingw --enable-shared
make
make install

freetype-2.5.3 (requires libpng)

  • Extract package
  • Open msys console
  • Enter package path
./configure --prefix=/mingw
make
make install

OpenAL SDK

Install the official SDK, version 1.1.

Minetest

  • Run CMake and configure correctly
  • Open commandline and enter the following command (if it fails check path, make sure mingw/bin is in there)
mingw32-make



MinGW64 Build

MinGW64

Download and install.

msys from mingw32

Copy e.g. from mingw32 and make sure path for your msys shell is set to mingw64 compiler!



VS2012 Build

Install VS Express 2012

  • Download from Microsoft and install

Irrlicht 1.8

  • Open sln v11 file
  • Build release

libogg

  • Open sln v10 file
  • Convert
  • Build release

libvorbis

  • Open sln v10 file
  • Convert
  • Add libogg include path
  • Add libogg library path
  • Build release (libvorbis/libvorbisfile)

luajit-2.0.2

  • Extract
  • Build (open vs2012 developer console)
cd src
msvcbuild.bat

zlib-1.2.8

  • Extract
  • Navigate to the /contrib/masmx86 folder.
    • Open the “bld_ml32.bat” file in a text editor.
    • Add the “/safeseh” switch to both lines in that file (e.g. “ml /safeseh /coff /Zi /c /Flmatch686.lst match686.asm”).
    • zlib uses a Version number declaration that can cause the build process to fail. To fix this, go back to the Solution Explorer, then navigate to zlibvc -> zlibvc.def. Double-click to open.
    • Change the line that reads “VERSION 1.2.8″ to read “VERSION 1.28″.
    • edit iowin32.c comment line "#define IOWIN32_USING_WINRT_API 1"

curl-7.33.0

  • Extract
  • Build
cd winbuild
nmake /f Makefile.vc mode=dll ENABLE_WINSSL=yes ENABLE_IPV6=yes
  • Your new build as well as headers is in builds subfolder

freetype-2.5.0

  • Extract
  • Open solution in builds\win32\vc2010
  • Convert
  • Switch "Configuration type" to "dynamic link library"
  • Change target extension
  • Open include/freetype/config/ftconfig.h
  • Add following lines in MSVC block
#define FT_EXPORT(x) __declspec(dllexport) x
#define FT_BASE(x) __declspec(dllexport) x
  • Build release

gettext (requires libiconv)

Use the official GNU gettext 0.13.1 win32 build.

libiconv

Use the official GNU libiconv 1.9.1 win32 build.

Minetest

  • Run CMake GUI and configure correctly
  • Open msvc developer console and enter mintest base path
msbuild minetest.sln /p:Configuration=Release /t:Clean,Build