Project

General

Profile

Installing Wt on MinGW » History » Version 11

Roel Standaert, 08/01/2019 10:04 AM

1 1 Wim Dumon
h1. Installing Wt on MinGW
2
3
h2. MinGW requirements
4
5 7 Wim Dumon
This guide used the TDM-gcc (4.5.1-tdm-4). Verified with TDM-gcc 4.7.1.
6 1 Wim Dumon
7 8 Wim Dumon
The procedure also works for mingwbuild for a 64bit target, after working around some compilation/linking issues.
8 7 Wim Dumon
9 1 Wim Dumon
h2. Build Boost
10
11 7 Wim Dumon
Instructions to build boost may vary slightly from release to release.
12
13
You can choose between the 'MinGW Command prompt' and the 'MSYS shell' (msys.bat) to build boost.
14
15
h3. From MSYS shell of the TDM-gcc installation:
16
<pre>
17
cd boost_1_52_0
18
./bootstrap.sh --with-toolset=mingw
19
</pre>
20
21
This builds boost. Then edit project-config.jam and do a search and replace, to replace all mingw in gcc.
22
23
Build boost (the context library does not compile on boost 1.52, may be fixed in newer versions):
24
<pre>
25
./bjam.exe toolset=gcc link=static threading=multi --layout=versioned --prefix=c:/Boost --without-context install
26
</pre>
27
28
29
h3. From the 'MinGW Command Prompt' of the TDM-gcc installation
30
31
Since bootstrap.bat will always use msvs to compile bjam, you need an installed MS Visual Studio compiler to use this method.
32
33 1 Wim Dumon
First, bootstrap boost
34
<pre>
35
cd boost_1_43_0
36
bootstrap.bat
37 4 Jay Health
</pre>
38 2 Wim Dumon
39 1 Wim Dumon
Before building boost, consider to apply the two patches provided below. These are bugs that may be fixed in future versions of boost and cygwin, but compilation of Wt failed whith boost 1.44 and TDM-gcc 4.5.1-tdm-4.
40 2 Wim Dumon
41
Build the required libraries
42 1 Wim Dumon
<pre>
43 8 Wim Dumon
bjam.exe toolset=gcc link=static threading=multi --layout=versioned --prefix=c:/Boost --without-context install
44 1 Wim Dumon
</pre>
45
46 8 Wim Dumon
It will take a while before boost is installed. If the boost.random library does not exist for your boost version, then simply omit it from the bjam command line.
47 3 Wim Dumon
48 7 Wim Dumon
h3. General remarks on boost
49 1 Wim Dumon
50
Note: If you get link errors with boost.thread, Tomasz Kalicki points out that you may want to fix the boost header files. This is not necessarily required for Wt versions newer than 3.1.5 as those will define BOOST_THREAD_USE_LIB when not linking to a dynamic boost (-DBOOST_DYNAMIC=OFF), but you may want to use it anyway if you use boost.thread in your own application.
51
<pre>
52
--- oldconfig.hpp       2010-07-09 20:13:09.000000000 +0200
53
+++ config.hpp  2010-09-16 11:11:48.000000000 +0200
54
@@ -37,7 +37,7 @@
55
 #elif defined(BOOST_THREAD_USE_LIB)   //Use lib
56
 #else //Use default
57
 #   if defined(BOOST_THREAD_PLATFORM_WIN32)
58
-#       if defined(BOOST_MSVC) || defined(BOOST_INTEL_WIN)
59
+#       if defined(BOOST_MSVC) || defined(BOOST_INTEL_WIN) || defined(__MINGW32__)
60
            //For compilers supporting auto-tss cleanup
61
            //with Boost.Threads lib, use Boost.Threads lib
62
 #           define BOOST_THREAD_USE_LIB
63
</pre>
64
See https://svn.boost.org/trac/boost/ticket/4614
65
66 7 Wim Dumon
When setting up your own makefiles for use with mingw, think about setting BOOST_THREAD_USE_LIB properly on your project if you do not apply this patch.
67
68 1 Wim Dumon
<pre>
69
--- libs/thread/src/win32/tss_pe.cpp.orig       2010-09-16 15:46:01.375000000 +0200
70
+++ libs/thread/src/win32/tss_pe.cpp    2010-09-16 15:46:53.906250000 +0200
71
@@ -54,6 +54,7 @@
72
     PIMAGE_TLS_CALLBACK __crt_xl_end__ __attribute__ ((section(".CRT$XLZ"))) = 0;
73
 }
74
75
+#if 0
76
 extern "C" const IMAGE_TLS_DIRECTORY32 _tls_used __attribute__ ((section(".rdata$T"))) =
77
 {
78
         (DWORD) &__tls_start__,
79
@@ -63,6 +64,7 @@
80
         (DWORD) 0,
81
         (DWORD) 0
82
 };
83
+#endif
84
85
86
 #elif  defined(_MSC_VER) && !defined(UNDER_CE)
87
88
</pre>
89
90
See https://svn.boost.org/trac/boost/ticket/4258
91
92
h3. Build Wt
93
94 7 Wim Dumon
From MinGW Command Prompt:
95 1 Wim Dumon
<pre>
96 9 Wim Dumon
cmake c:/path/to/source/of/wt -G "MinGW Makefiles"
97 7 Wim Dumon
mingw32-make
98 1 Wim Dumon
</pre>
99
100 7 Wim Dumon
From MSYS unix-alike shell:
101 2 Wim Dumon
<pre>
102 9 Wim Dumon
cmake c:/path/to/source/of/wt -G "MSYS Makefiles"
103 7 Wim Dumon
make
104 1 Wim Dumon
</pre>
105
106 11 Roel Standaert
The Isapi connector is not built under MinGW because the httpext.h file provided with MinGW misses several declarations. I suspect that with a complete httpext.h header, it is possible to build the isapi connector without problems.
107 6 Wim Dumon
108 7 Wim Dumon
When setting up your own makefiles for use with mingw, think about setting BOOST_THREAD_USE_LIB properly on your project (see notes on boost above).