-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jamfile
executable file
·200 lines (180 loc) · 5.35 KB
/
Jamfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
import testing ;
import os ;
import common ;
import toolset ;
import feature ;
import builtin ;
import property-set ;
import option ;
rule suppress-warnings ( properties * )
{
local vc-ver = [
MATCH "^<toolset-msvc:version>([0-9]+)[.]" : $(properties)
] ;
if $(vc-ver) && $(vc-ver) >= 8
{
return <cxxflags>-wd4819 <cxxflags>-wd4996 ;
}
}
rule check-wstring ( properties * )
{
local gcc-ver = [
MATCH "^<toolset-gcc:version>([0-9]+)[.]" : $(properties)
] ;
local targ = [ feature.get-values target-os : $(properties) ] ;
if $(targ) = cygwin && $(gcc-ver) && $(gcc-ver) < 4
{
return <define>NO_WSTRING=1 <define>OLD_CYGWIN=1 ;
}
}
rule select-platform-obj ( properties * )
{
switch [ feature.get-values target-os : $(properties) ]
{
case cygwin : { return <source>compat/cygwin.cc <source>compat/unix-path.cc <source>compat/encode-iconv.cc ; }
case windows : { return <source>compat/mingw.cc ; }
case linux : { return <source>compat/linux.cc <source>compat/unix-path.cc <source>compat/encode-iconv.cc ; }
case solaris : { return <source>compat/solaris.cc <source>compat/unix-path.cc <source>compat/encode-iconv.cc ; }
case freebsd : { return <source>compat/freebsd.cc <source>compat/unix-path.cc <source>compat/encode-iconv.cc ; }
}
}
rule select-path-sep ( properties * )
{
switch [ feature.get-values target-os : $(properties) ]
{
case windows : { return <define>PATH_SEP_BACKSLASH=1 ; }
}
}
rule check-home-env-enable ( properties * )
{
switch [ feature.get-values target-os : $(properties) ]
{
case windows : { return <define>IGNORE_HOME_ENV=1 ; }
}
}
rule gcc-cygwin-450-test-workaround ( properties * ) {
local link = [ feature.get-values link : $(properties) ] ;
local variant = [ feature.get-values variant : $(properties) ] ;
local gcc-ver = [ MATCH "^<toolset-gcc:version>([0-9].[0-9].[0-9])" : $(properties) ] ;
local targ = [ feature.get-values target-os : $(properties) ] ;
if $(link) = shared && $(variant) = debug && $(targ) = cygwin && $(gcc-ver) && $(gcc-ver) = 4.5.0 {
echo enabling workaround for gcc-cygwin-4.5.0 broken unit-test dll. ;
return <define>MGIT_TEST_WITH_HEADERS=1 ;
}
}
project mgit
: requirements
<toolset>msvc:<target-os>windows
<toolset>gcc:<cxxflags>-Wno-long-long
<toolset>gcc,<toolset-gcc:flavor>mingw:<target-os>windows
<toolset>gcc,<toolset-gcc:flavor>cygwin:<target-os>cygwin
<target-os>windows,<toolset>gcc,<address-model>64:<link>static
<target-os>windows,<toolset>gcc,<address-model>64:<runtime-link>static
<link>shared:<define>MGIT_DYN_LINK=1
<link>shared:<define>BOOST_TEST_DYN_LINK=1
<target-os>cygwin:<linkflags>-liconv
<target-os>solaris:<linkflags>-liconv
<target-os>freebsd:<linkflags>-liconv
<library>/boost//headers
<conditional>@suppress-warnings
<conditional>@check-wstring
<conditional>@select-path-sep
<conditional>@check-home-env-enable
<define>BOOST_ALL_NO_LIB=1
<include>.
: usage-requirements
<define>BOOST_TEST_NO_AUTO_LINK=1
<link>shared:<define>MGIT_DYN_LINK=1
: build-dir bin
: default-build
<address-model>32
;
lib gitobjs
:
[ path.glob . : *.cc : mgitmain.cc ]
[ path.glob builtin : *.cc ]
:
<conditional>@select-platform-obj
<toolset>gcc:<c++-template-depth>200
<link>shared:<define>MGIT_SOURCE=1
<library>/boost/system//boost_system
<library>/boost/program_options//boost_program_options
;
exe git
:
mgitmain.cc gitobjs
:
;
local test_sources = [ GLOB testsuite : *.cc ] ;
local test_names = $(test_sources:B) ;
for name in $(test_names)
{
local input-files ;
if $(name) = config_test { input-files += test.cfg ; }
run testsuite/$(name).cc
gitobjs
:
:
$(input-files)
:
<conditional>@gcc-cygwin-450-test-workaround
<library>/boost/test//boost_unit_test_framework
:
$(name)
;
explicit $(name) ;
}
alias test : $(test_names) ;
local prefix = [ option.get prefix ] ;
if [ os.name ] = NT
{
prefix ?= C:\\mgit ;
}
else
{
prefix ?= /usr/local/mgit ;
}
rule select-bin-type ( properties * )
{
switch [ feature.get-values target-os : $(properties) ]
{
case cygwin : return <install-type>EXE <install-type>SHARED_LIB ;
case windows : return <install-type>EXE <install-type>SHARED_LIB ;
case * : return <install-type>EXE ;
}
}
rule select-lib-type ( properties * )
{
switch [ feature.get-values target-os : $(properties) ]
{
case cygwin : return <install-type>STATIC_LIB ;
case windows : return <install-type>STATIC_LIB ;
case * : return <install-type>LIB ;
}
}
explicit install ;
install install-bin
:
git
:
<location>$(prefix)/bin
<dll-path>$(prefix)/lib
<install-dependencies>on
<conditional>@select-bin-type
;
install install-lib
:
git
:
<location>$(prefix)/lib
<install-dependencies>on
<conditional>@select-lib-type
;
install install-inc
:
[ GLOB . : *.hpp ]
:
<location>$(prefix)/include
;
alias install : install-bin install-lib install-inc ;
explicit install-bin install-lib install-inc install ;