Project

General

Profile

Installing Wt on MinGW » History » Version 7

Wim Dumon, 07/30/2013 03:31 PM

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 7 Wim Dumon
8 1 Wim Dumon
h2. Build Boost
9
10 7 Wim Dumon
Instructions to build boost may vary slightly from release to release.
11
12
You can choose between the 'MinGW Command prompt' and the 'MSYS shell' (msys.bat) to build boost.
13
14
h3. From MSYS shell of the TDM-gcc installation:
15
<pre>
16
cd boost_1_52_0
17
./bootstrap.sh --with-toolset=mingw
18
</pre>
19
20
This builds boost. Then edit project-config.jam and do a search and replace, to replace all mingw in gcc.
21
22
Build boost (the context library does not compile on boost 1.52, may be fixed in newer versions):
23
<pre>
24
./bjam.exe toolset=gcc link=static threading=multi --layout=versioned --prefix=c:/Boost --without-context install
25
</pre>
26
27
28
h3. From the 'MinGW Command Prompt' of the TDM-gcc installation
29
30
Since bootstrap.bat will always use msvs to compile bjam, you need an installed MS Visual Studio compiler to use this method.
31
32 1 Wim Dumon
First, bootstrap boost
33
<pre>
34
cd boost_1_43_0
35
bootstrap.bat
36 4 Jay Health
</pre>
37 2 Wim Dumon
38 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.
39 2 Wim Dumon
40
Build the required libraries
41 1 Wim Dumon
<pre>
42 7 Wim Dumon
bjam --prefix=c:/Boost link=static threading=multi --layout=versioned toolset=gcc --with-date_time --with-filesystem --with-program_options --wit-random --with-regex --with-signals --with-system --with-thread install
43 1 Wim Dumon
</pre>
44
45
This only builds the required libraries. 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.
46 3 Wim Dumon
47 7 Wim Dumon
h3. General remarks on boost
48 1 Wim Dumon
49
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.
50
<pre>
51
--- oldconfig.hpp       2010-07-09 20:13:09.000000000 +0200
52
+++ config.hpp  2010-09-16 11:11:48.000000000 +0200
53
@@ -37,7 +37,7 @@
54
 #elif defined(BOOST_THREAD_USE_LIB)   //Use lib
55
 #else //Use default
56
 #   if defined(BOOST_THREAD_PLATFORM_WIN32)
57
-#       if defined(BOOST_MSVC) || defined(BOOST_INTEL_WIN)
58
+#       if defined(BOOST_MSVC) || defined(BOOST_INTEL_WIN) || defined(__MINGW32__)
59
            //For compilers supporting auto-tss cleanup
60
            //with Boost.Threads lib, use Boost.Threads lib
61
 #           define BOOST_THREAD_USE_LIB
62
</pre>
63
See https://svn.boost.org/trac/boost/ticket/4614
64
65 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.
66
67 1 Wim Dumon
<pre>
68
--- libs/thread/src/win32/tss_pe.cpp.orig       2010-09-16 15:46:01.375000000 +0200
69
+++ libs/thread/src/win32/tss_pe.cpp    2010-09-16 15:46:53.906250000 +0200
70
@@ -54,6 +54,7 @@
71
     PIMAGE_TLS_CALLBACK __crt_xl_end__ __attribute__ ((section(".CRT$XLZ"))) = 0;
72
 }
73
74
+#if 0
75
 extern "C" const IMAGE_TLS_DIRECTORY32 _tls_used __attribute__ ((section(".rdata$T"))) =
76
 {
77
         (DWORD) &__tls_start__,
78
@@ -63,6 +64,7 @@
79
         (DWORD) 0,
80
         (DWORD) 0
81
 };
82
+#endif
83
84
85
 #elif  defined(_MSC_VER) && !defined(UNDER_CE)
86
87
</pre>
88
89
See https://svn.boost.org/trac/boost/ticket/4258
90
91
h3. Build Wt
92
93 7 Wim Dumon
From MinGW Command Prompt:
94 1 Wim Dumon
<pre>
95 7 Wim Dumon
cmake c:/cygwin/home/Wim/projects/wt-git/wt -G "MinGW Makefiles"
96
mingw32-make
97 1 Wim Dumon
</pre>
98
99 7 Wim Dumon
From MSYS unix-alike shell:
100 2 Wim Dumon
<pre>
101 7 Wim Dumon
cmake c:/cygwin/home/Wim/projects/wt-git/wt -G "MSYS Makefiles"
102
make
103 1 Wim Dumon
</pre>
104
105 5 Wim Dumon
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.
106 6 Wim Dumon
107 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).