Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/config/auto_link.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children | c530137014c0 |
comparison
equal
deleted
inserted
replaced
15:663ca0da4350 | 16:2665513ce2d3 |
---|---|
1 // (C) Copyright John Maddock 2003. | |
2 // Use, modification and distribution are subject to the | |
3 // Boost Software License, Version 1.0. (See accompanying file | |
4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
5 | |
6 /* | |
7 * LOCATION: see http://www.boost.org for most recent version. | |
8 * FILE auto_link.hpp | |
9 * VERSION see <boost/version.hpp> | |
10 * DESCRIPTION: Automatic library inclusion for Borland/Microsoft compilers. | |
11 */ | |
12 | |
13 /************************************************************************* | |
14 | |
15 USAGE: | |
16 ~~~~~~ | |
17 | |
18 Before including this header you must define one or more of define the following macros: | |
19 | |
20 BOOST_LIB_NAME: Required: A string containing the basename of the library, | |
21 for example boost_regex. | |
22 BOOST_LIB_TOOLSET: Optional: the base name of the toolset. | |
23 BOOST_DYN_LINK: Optional: when set link to dll rather than static library. | |
24 BOOST_LIB_DIAGNOSTIC: Optional: when set the header will print out the name | |
25 of the library selected (useful for debugging). | |
26 BOOST_AUTO_LINK_NOMANGLE: Specifies that we should link to BOOST_LIB_NAME.lib, | |
27 rather than a mangled-name version. | |
28 BOOST_AUTO_LINK_TAGGED: Specifies that we link to libraries built with the --layout=tagged option. | |
29 This is essentially the same as the default name-mangled version, but without | |
30 the compiler name and version, or the Boost version. Just the build options. | |
31 | |
32 These macros will be undef'ed at the end of the header, further this header | |
33 has no include guards - so be sure to include it only once from your library! | |
34 | |
35 Algorithm: | |
36 ~~~~~~~~~~ | |
37 | |
38 Libraries for Borland and Microsoft compilers are automatically | |
39 selected here, the name of the lib is selected according to the following | |
40 formula: | |
41 | |
42 BOOST_LIB_PREFIX | |
43 + BOOST_LIB_NAME | |
44 + "_" | |
45 + BOOST_LIB_TOOLSET | |
46 + BOOST_LIB_THREAD_OPT | |
47 + BOOST_LIB_RT_OPT | |
48 "-" | |
49 + BOOST_LIB_VERSION | |
50 | |
51 These are defined as: | |
52 | |
53 BOOST_LIB_PREFIX: "lib" for static libraries otherwise "". | |
54 | |
55 BOOST_LIB_NAME: The base name of the lib ( for example boost_regex). | |
56 | |
57 BOOST_LIB_TOOLSET: The compiler toolset name (vc6, vc7, bcb5 etc). | |
58 | |
59 BOOST_LIB_THREAD_OPT: "-mt" for multithread builds, otherwise nothing. | |
60 | |
61 BOOST_LIB_RT_OPT: A suffix that indicates the runtime library used, | |
62 contains one or more of the following letters after | |
63 a hyphen: | |
64 | |
65 s static runtime (dynamic if not present). | |
66 g debug/diagnostic runtime (release if not present). | |
67 y Python debug/diagnostic runtime (release if not present). | |
68 d debug build (release if not present). | |
69 p STLport build. | |
70 n STLport build without its IOStreams. | |
71 | |
72 BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y. | |
73 | |
74 | |
75 ***************************************************************************/ | |
76 | |
77 #ifdef __cplusplus | |
78 # ifndef BOOST_CONFIG_HPP | |
79 # include <boost/config.hpp> | |
80 # endif | |
81 #elif defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__EDG_VERSION__) | |
82 // | |
83 // C language compatability (no, honestly) | |
84 // | |
85 # define BOOST_MSVC _MSC_VER | |
86 # define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X) | |
87 # define BOOST_DO_STRINGIZE(X) #X | |
88 #endif | |
89 // | |
90 // Only include what follows for known and supported compilers: | |
91 // | |
92 #if defined(BOOST_MSVC) \ | |
93 || defined(__BORLANDC__) \ | |
94 || (defined(__MWERKS__) && defined(_WIN32) && (__MWERKS__ >= 0x3000)) \ | |
95 || (defined(__ICL) && defined(_MSC_EXTENSIONS) && (_MSC_VER >= 1200)) | |
96 | |
97 #ifndef BOOST_VERSION_HPP | |
98 # include <boost/version.hpp> | |
99 #endif | |
100 | |
101 #ifndef BOOST_LIB_NAME | |
102 # error "Macro BOOST_LIB_NAME not set (internal error)" | |
103 #endif | |
104 | |
105 // | |
106 // error check: | |
107 // | |
108 #if defined(__MSVC_RUNTIME_CHECKS) && !defined(_DEBUG) | |
109 # pragma message("Using the /RTC option without specifying a debug runtime will lead to linker errors") | |
110 # pragma message("Hint: go to the code generation options and switch to one of the debugging runtimes") | |
111 # error "Incompatible build options" | |
112 #endif | |
113 // | |
114 // select toolset if not defined already: | |
115 // | |
116 #ifndef BOOST_LIB_TOOLSET | |
117 # if defined(BOOST_MSVC) && (BOOST_MSVC < 1200) | |
118 // Note: no compilers before 1200 are supported | |
119 # elif defined(BOOST_MSVC) && (BOOST_MSVC < 1300) | |
120 | |
121 # ifdef UNDER_CE | |
122 // eVC4: | |
123 # define BOOST_LIB_TOOLSET "evc4" | |
124 # else | |
125 // vc6: | |
126 # define BOOST_LIB_TOOLSET "vc6" | |
127 # endif | |
128 | |
129 # elif defined(BOOST_MSVC) && (BOOST_MSVC < 1310) | |
130 | |
131 // vc7: | |
132 # define BOOST_LIB_TOOLSET "vc7" | |
133 | |
134 # elif defined(BOOST_MSVC) && (BOOST_MSVC < 1400) | |
135 | |
136 // vc71: | |
137 # define BOOST_LIB_TOOLSET "vc71" | |
138 | |
139 # elif defined(BOOST_MSVC) && (BOOST_MSVC < 1500) | |
140 | |
141 // vc80: | |
142 # define BOOST_LIB_TOOLSET "vc80" | |
143 | |
144 # elif defined(BOOST_MSVC) && (BOOST_MSVC < 1600) | |
145 | |
146 // vc90: | |
147 # define BOOST_LIB_TOOLSET "vc90" | |
148 | |
149 # elif defined(BOOST_MSVC) && (BOOST_MSVC < 1700) | |
150 | |
151 // vc10: | |
152 # define BOOST_LIB_TOOLSET "vc100" | |
153 | |
154 # elif defined(BOOST_MSVC) && (BOOST_MSVC < 1800) | |
155 | |
156 // vc11: | |
157 # define BOOST_LIB_TOOLSET "vc110" | |
158 | |
159 # elif defined(BOOST_MSVC) | |
160 | |
161 // vc12: | |
162 # define BOOST_LIB_TOOLSET "vc120" | |
163 | |
164 # elif defined(__BORLANDC__) | |
165 | |
166 // CBuilder 6: | |
167 # define BOOST_LIB_TOOLSET "bcb" | |
168 | |
169 # elif defined(__ICL) | |
170 | |
171 // Intel C++, no version number: | |
172 # define BOOST_LIB_TOOLSET "iw" | |
173 | |
174 # elif defined(__MWERKS__) && (__MWERKS__ <= 0x31FF ) | |
175 | |
176 // Metrowerks CodeWarrior 8.x | |
177 # define BOOST_LIB_TOOLSET "cw8" | |
178 | |
179 # elif defined(__MWERKS__) && (__MWERKS__ <= 0x32FF ) | |
180 | |
181 // Metrowerks CodeWarrior 9.x | |
182 # define BOOST_LIB_TOOLSET "cw9" | |
183 | |
184 # endif | |
185 #endif // BOOST_LIB_TOOLSET | |
186 | |
187 // | |
188 // select thread opt: | |
189 // | |
190 #if defined(_MT) || defined(__MT__) | |
191 # define BOOST_LIB_THREAD_OPT "-mt" | |
192 #else | |
193 # define BOOST_LIB_THREAD_OPT | |
194 #endif | |
195 | |
196 #if defined(_MSC_VER) || defined(__MWERKS__) | |
197 | |
198 # ifdef _DLL | |
199 | |
200 # if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS)) | |
201 | |
202 # if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\ | |
203 && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON) | |
204 # define BOOST_LIB_RT_OPT "-gydp" | |
205 # elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG)) | |
206 # define BOOST_LIB_RT_OPT "-gdp" | |
207 # elif defined(_DEBUG)\ | |
208 && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON) | |
209 # define BOOST_LIB_RT_OPT "-gydp" | |
210 # pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1") | |
211 # error "Build options aren't compatible with pre-built libraries" | |
212 # elif defined(_DEBUG) | |
213 # define BOOST_LIB_RT_OPT "-gdp" | |
214 # pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1") | |
215 # error "Build options aren't compatible with pre-built libraries" | |
216 # else | |
217 # define BOOST_LIB_RT_OPT "-p" | |
218 # endif | |
219 | |
220 # elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) | |
221 | |
222 # if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\ | |
223 && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON) | |
224 # define BOOST_LIB_RT_OPT "-gydpn" | |
225 # elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG)) | |
226 # define BOOST_LIB_RT_OPT "-gdpn" | |
227 # elif defined(_DEBUG)\ | |
228 && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON) | |
229 # define BOOST_LIB_RT_OPT "-gydpn" | |
230 # pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1") | |
231 # error "Build options aren't compatible with pre-built libraries" | |
232 # elif defined(_DEBUG) | |
233 # define BOOST_LIB_RT_OPT "-gdpn" | |
234 # pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1") | |
235 # error "Build options aren't compatible with pre-built libraries" | |
236 # else | |
237 # define BOOST_LIB_RT_OPT "-pn" | |
238 # endif | |
239 | |
240 # else | |
241 | |
242 # if defined(_DEBUG) && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON) | |
243 # define BOOST_LIB_RT_OPT "-gyd" | |
244 # elif defined(_DEBUG) | |
245 # define BOOST_LIB_RT_OPT "-gd" | |
246 # else | |
247 # define BOOST_LIB_RT_OPT | |
248 # endif | |
249 | |
250 # endif | |
251 | |
252 # else | |
253 | |
254 # if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS)) | |
255 | |
256 # if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\ | |
257 && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON) | |
258 # define BOOST_LIB_RT_OPT "-sgydp" | |
259 # elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG)) | |
260 # define BOOST_LIB_RT_OPT "-sgdp" | |
261 # elif defined(_DEBUG)\ | |
262 && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON) | |
263 # define BOOST_LIB_RT_OPT "-sgydp" | |
264 # pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1") | |
265 # error "Build options aren't compatible with pre-built libraries" | |
266 # elif defined(_DEBUG) | |
267 # define BOOST_LIB_RT_OPT "-sgdp" | |
268 # pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1") | |
269 # error "Build options aren't compatible with pre-built libraries" | |
270 # else | |
271 # define BOOST_LIB_RT_OPT "-sp" | |
272 # endif | |
273 | |
274 # elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) | |
275 | |
276 # if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\ | |
277 && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON) | |
278 # define BOOST_LIB_RT_OPT "-sgydpn" | |
279 # elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG)) | |
280 # define BOOST_LIB_RT_OPT "-sgdpn" | |
281 # elif defined(_DEBUG)\ | |
282 && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON) | |
283 # define BOOST_LIB_RT_OPT "-sgydpn" | |
284 # pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1") | |
285 # error "Build options aren't compatible with pre-built libraries" | |
286 # elif defined(_DEBUG) | |
287 # define BOOST_LIB_RT_OPT "-sgdpn" | |
288 # pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1") | |
289 # error "Build options aren't compatible with pre-built libraries" | |
290 # else | |
291 # define BOOST_LIB_RT_OPT "-spn" | |
292 # endif | |
293 | |
294 # else | |
295 | |
296 # if defined(_DEBUG)\ | |
297 && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON) | |
298 # define BOOST_LIB_RT_OPT "-sgyd" | |
299 # elif defined(_DEBUG) | |
300 # define BOOST_LIB_RT_OPT "-sgd" | |
301 # else | |
302 # define BOOST_LIB_RT_OPT "-s" | |
303 # endif | |
304 | |
305 # endif | |
306 | |
307 # endif | |
308 | |
309 #elif defined(__BORLANDC__) | |
310 | |
311 // | |
312 // figure out whether we want the debug builds or not: | |
313 // | |
314 #if __BORLANDC__ > 0x561 | |
315 #pragma defineonoption BOOST_BORLAND_DEBUG -v | |
316 #endif | |
317 // | |
318 // sanity check: | |
319 // | |
320 #if defined(__STL_DEBUG) || defined(_STLP_DEBUG) | |
321 #error "Pre-built versions of the Boost libraries are not provided in STLport-debug form" | |
322 #endif | |
323 | |
324 # ifdef _RTLDLL | |
325 | |
326 # if defined(BOOST_BORLAND_DEBUG)\ | |
327 && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON) | |
328 # define BOOST_LIB_RT_OPT "-yd" | |
329 # elif defined(BOOST_BORLAND_DEBUG) | |
330 # define BOOST_LIB_RT_OPT "-d" | |
331 # elif defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON) | |
332 # define BOOST_LIB_RT_OPT -y | |
333 # else | |
334 # define BOOST_LIB_RT_OPT | |
335 # endif | |
336 | |
337 # else | |
338 | |
339 # if defined(BOOST_BORLAND_DEBUG)\ | |
340 && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON) | |
341 # define BOOST_LIB_RT_OPT "-syd" | |
342 # elif defined(BOOST_BORLAND_DEBUG) | |
343 # define BOOST_LIB_RT_OPT "-sd" | |
344 # elif defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON) | |
345 # define BOOST_LIB_RT_OPT "-sy" | |
346 # else | |
347 # define BOOST_LIB_RT_OPT "-s" | |
348 # endif | |
349 | |
350 # endif | |
351 | |
352 #endif | |
353 | |
354 // | |
355 // select linkage opt: | |
356 // | |
357 #if (defined(_DLL) || defined(_RTLDLL)) && defined(BOOST_DYN_LINK) | |
358 # define BOOST_LIB_PREFIX | |
359 #elif defined(BOOST_DYN_LINK) | |
360 # error "Mixing a dll boost library with a static runtime is a really bad idea..." | |
361 #else | |
362 # define BOOST_LIB_PREFIX "lib" | |
363 #endif | |
364 | |
365 // | |
366 // now include the lib: | |
367 // | |
368 #if defined(BOOST_LIB_NAME) \ | |
369 && defined(BOOST_LIB_PREFIX) \ | |
370 && defined(BOOST_LIB_TOOLSET) \ | |
371 && defined(BOOST_LIB_THREAD_OPT) \ | |
372 && defined(BOOST_LIB_RT_OPT) \ | |
373 && defined(BOOST_LIB_VERSION) | |
374 | |
375 #ifdef BOOST_AUTO_LINK_TAGGED | |
376 # pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib") | |
377 # ifdef BOOST_LIB_DIAGNOSTIC | |
378 # pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib") | |
379 # endif | |
380 #elif defined(BOOST_AUTO_LINK_NOMANGLE) | |
381 # pragma comment(lib, BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib") | |
382 # ifdef BOOST_LIB_DIAGNOSTIC | |
383 # pragma message ("Linking to lib file: " BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib") | |
384 # endif | |
385 #else | |
386 # pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib") | |
387 # ifdef BOOST_LIB_DIAGNOSTIC | |
388 # pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib") | |
389 # endif | |
390 #endif | |
391 | |
392 #else | |
393 # error "some required macros where not defined (internal logic error)." | |
394 #endif | |
395 | |
396 | |
397 #endif // _MSC_VER || __BORLANDC__ | |
398 | |
399 // | |
400 // finally undef any macros we may have set: | |
401 // | |
402 #ifdef BOOST_LIB_PREFIX | |
403 # undef BOOST_LIB_PREFIX | |
404 #endif | |
405 #if defined(BOOST_LIB_NAME) | |
406 # undef BOOST_LIB_NAME | |
407 #endif | |
408 // Don't undef this one: it can be set by the user and should be the | |
409 // same for all libraries: | |
410 //#if defined(BOOST_LIB_TOOLSET) | |
411 //# undef BOOST_LIB_TOOLSET | |
412 //#endif | |
413 #if defined(BOOST_LIB_THREAD_OPT) | |
414 # undef BOOST_LIB_THREAD_OPT | |
415 #endif | |
416 #if defined(BOOST_LIB_RT_OPT) | |
417 # undef BOOST_LIB_RT_OPT | |
418 #endif | |
419 #if defined(BOOST_LIB_LINK_OPT) | |
420 # undef BOOST_LIB_LINK_OPT | |
421 #endif | |
422 #if defined(BOOST_LIB_DEBUG_OPT) | |
423 # undef BOOST_LIB_DEBUG_OPT | |
424 #endif | |
425 #if defined(BOOST_DYN_LINK) | |
426 # undef BOOST_DYN_LINK | |
427 #endif | |
428 | |
429 |