Project

General

Profile

Feature #3910 » minGW - building boost.txt

build boost with minGW w.r.t. Wt - Стойчо Стефанов Stoycho Stefanov, 03/27/2015 09:42 AM

 
1
#builing BOOST for minGW (boost 1_55)
2
# extract boost packige in C:\MinGW\msys\1.0\
3
#in windows cmd propt (as Administrator):
4
	cd C:\MinGW\msys\1.0\boost_1_55_0
5
	./bootstrap.bat mingw
6
#Edit the file project-config.jam and replace 'mingw' by 'gcc'
7
#Then launch bjam.exe and it should work
8

    
9
BOOST patch for mingw
10

    
11
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.
12

    
13
in boost_1_55_0\boost\thread\detail\config.hpp:
14
--- oldconfig.hpp       2010-07-09 20:13:09.000000000 +0200
15
+++ config.hpp  2010-09-16 11:11:48.000000000 +0200
16
@@ -37,7 +37,7 @@
17
 #elif defined(BOOST_THREAD_USE_LIB)   //Use lib
18
 #else //Use default
19
 #   if defined(BOOST_THREAD_PLATFORM_WIN32)
20
-#       if defined(BOOST_MSVC) || defined(BOOST_INTEL_WIN)
21
+#       if defined(BOOST_MSVC) || defined(BOOST_INTEL_WIN) || defined(__MINGW32__)
22
            //For compilers supporting auto-tss cleanup
23
            //with Boost.Threads lib, use Boost.Threads lib
24
 #           define BOOST_THREAD_USE_LIB
25

    
26
See https://svn.boost.org/trac/boost/ticket/4614
27

    
28
in boost_1_55_0\libs\thread\src\win32\tss_pe.cpp
29

    
30
--- libs/thread/src/win32/tss_pe.cpp.orig       2010-09-16 15:46:01.375000000 +0200
31
+++ libs/thread/src/win32/tss_pe.cpp    2010-09-16 15:46:53.906250000 +0200
32
@@ -54,6 +54,7 @@
33
     PIMAGE_TLS_CALLBACK __crt_xl_end__ __attribute__ ((section(".CRT$XLZ"))) = 0;
34
 }
35

    
36
+#if 0
37
 extern "C" const IMAGE_TLS_DIRECTORY32 _tls_used __attribute__ ((section(".rdata$T"))) =
38
 {
39
         (DWORD) &__tls_start__,
40
@@ -63,6 +64,7 @@
41
         (DWORD) 0,
42
         (DWORD) 0
43
 };
44
+#endif
45

    
46
 #elif  defined(_MSC_VER) && !defined(UNDER_CE)
47

    
48

    
49
See https://svn.boost.org/trac/boost/ticket/4258
50

    
51
dll:
52
	bjam --toolset=gcc --build-dir="c:/boost-build" --prefix="c:/minGW_libs" --stagedir="c:/stage" --with-date_time --with-filesystem --with-program_options --with-random --with-regex --with-signals --with-system --with-thread --layout=system variant=release link=shared threading=multi stage
53
	bjam --toolset=gcc --build-dir="c:/boost-build" --prefix="c:/minGW_libs" --stagedir="c:/stage" --with-date_time --with-filesystem --with-program_options --with-random --with-regex --with-signals --with-system --with-thread --layout=system variant=release link=shared threading=multi install
54
	
55
a:
56

    
57
	bjam --toolset=gcc --build-dir="c:/boost-build" --prefix="c:/minGW_libs" --stagedir="c:/stage" --with-date_time --with-filesystem --with-program_options --with-random --with-regex --with-signals --with-system --with-thread --layout=system variant=release link=static threading=multi stage
58
	bjam --toolset=gcc --build-dir="c:/boost-build" --prefix="c:/minGW_libs" --stagedir="c:/stage" --with-date_time --with-filesystem --with-program_options --with-random --with-regex --with-signals --with-system --with-thread --layout=system variant=release link=static threading=multi install
(1-1/2)