]> git.lyx.org Git - lyx.git/blob - boost/boost/config/auto_link.hpp
more PCH_FLAGS work
[lyx.git] / boost / boost / config / auto_link.hpp
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_DYN_LINK:       Optional: when set link to dll rather than static library.
23 BOOST_LIB_DIAGNOSTIC: Optional: when set the header will print out the name
24                       of the library selected (useful for debugging).
25
26 These macros will be undef'ed at the end of the header, further this header
27 has no include guards - so be sure to include it only once from your library!
28
29 Algorithm:
30 ~~~~~~~~~~
31
32 Libraries for Borland and Microsoft compilers are automatically
33 selected here, the name of the lib is selected according to the following
34 formula:
35
36 BOOST_LIB_PREFIX
37    + BOOST_LIB_NAME
38    + "_"
39    + BOOST_LIB_TOOLSET
40    + BOOST_LIB_THREAD_OPT
41    + BOOST_LIB_RT_OPT
42    "-"
43    + BOOST_LIB_VERSION
44
45 These are defined as:
46
47 BOOST_LIB_PREFIX:     "lib" for static libraries otherwise "".
48
49 BOOST_LIB_NAME:       The base name of the lib ( for example boost_regex).
50
51 BOOST_LIB_TOOLSET:    The compiler toolset name (vc6, vc7, bcb5 etc).
52
53 BOOST_LIB_THREAD_OPT: "-mt" for multithread builds, otherwise nothing.
54
55 BOOST_LIB_RT_OPT:     A suffix that indicates the runtime library used,
56                       contains one or more of the following letters after
57                       a hiphen:
58
59                       s      static runtime (dynamic if not present).
60                       d      debug build (release if not present).
61                       g      debug/diagnostic runtime (release if not present).
62                       p      STLPort Build.
63
64 BOOST_LIB_VERSION:    The Boost version, in the form x_y, for Boost version x.y.
65
66
67 ***************************************************************************/
68
69 #ifdef __cplusplus
70 #  ifndef BOOST_CONFIG_HPP
71 #     include <boost/config.hpp>
72 #  endif
73 #elif defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__EDG_VERSION__)
74 //
75 // C language compatability (no, honestly)
76 //
77 #  define BOOST_MSVC _MSC_VER
78 #  define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X)
79 #  define BOOST_DO_STRINGIZE(X) #X
80 #endif
81 //
82 // Only include what follows for known and supported compilers:
83 //
84 #if defined(BOOST_MSVC) \
85     || defined(__BORLANDC__) \
86     || (defined(__MWERKS__) && defined(_WIN32) && (__MWERKS__ >= 0x3000)) \
87     || (defined(__ICL) && defined(_MSC_EXTENSIONS) && (_MSC_VER >= 1200))
88
89 #ifndef BOOST_VERSION_HPP
90 #  include <boost/version.hpp>
91 #endif
92
93 #ifndef BOOST_LIB_NAME
94 #  error "Macro BOOST_LIB_NAME not set (internal error)"
95 #endif
96
97 //
98 // error check:
99 //
100 #if defined(__MSVC_RUNTIME_CHECKS) && !defined(_DEBUG)
101 #  pragma message("Using the /RTC option without specifying a debug runtime will lead to linker errors")
102 #  pragma message("Hint: go to the code generation options and switch to one of the debugging runtimes")
103 #  error "Incompatible build options"
104 #endif
105 //
106 // select toolset:
107 //
108 #if defined(BOOST_MSVC) && (BOOST_MSVC == 1200)
109
110    // vc6:
111 #  define BOOST_LIB_TOOLSET "vc6"
112
113 #elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300)
114
115    // vc7:
116 #  define BOOST_LIB_TOOLSET "vc7"
117
118 #elif defined(BOOST_MSVC) && (BOOST_MSVC == 1310)
119
120    // vc71:
121 #  define BOOST_LIB_TOOLSET "vc71"
122
123 #elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1400)
124
125    // vc80:
126 #  define BOOST_LIB_TOOLSET "vc80"
127
128 #elif defined(__BORLANDC__)
129
130    // CBuilder 6:
131 #  define BOOST_LIB_TOOLSET "bcb"
132
133 #elif defined(__ICL)
134
135    // Intel C++, no version number:
136 #  define BOOST_LIB_TOOLSET "iw"
137
138 #elif defined(__MWERKS__) && (__MWERKS__ <= 0x31FF )
139
140    // Metrowerks CodeWarrior 8.x
141 #  define BOOST_LIB_TOOLSET "cw8"
142
143 #elif defined(__MWERKS__) && (__MWERKS__ <= 0x32FF )
144
145    // Metrowerks CodeWarrior 9.x
146 #  define BOOST_LIB_TOOLSET "cw9"
147
148 #endif
149
150 //
151 // select thread opt:
152 //
153 #if defined(_MT) || defined(__MT__)
154 #  define BOOST_LIB_THREAD_OPT "-mt"
155 #else
156 #  define BOOST_LIB_THREAD_OPT
157 #endif
158
159 #if defined(_MSC_VER) || defined(__MWERKS__)
160
161 #  ifdef _DLL
162
163 #     if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS))
164
165 #        if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
166 #            define BOOST_LIB_RT_OPT "-gdp"
167 #        elif defined(_DEBUG)
168 #            define BOOST_LIB_RT_OPT "-gdp"
169 #            pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
170 #            error "Build options aren't compatible with pre-built libraries"
171 #        else
172 #            define BOOST_LIB_RT_OPT "-p"
173 #        endif
174
175 #     elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
176
177 #        if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
178 #            define BOOST_LIB_RT_OPT "-gdpn"
179 #        elif defined(_DEBUG)
180 #            define BOOST_LIB_RT_OPT "-gdpn"
181 #            pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
182 #            error "Build options aren't compatible with pre-built libraries"
183 #        else
184 #            define BOOST_LIB_RT_OPT "-pn"
185 #        endif
186
187 #     else
188
189 #        if defined(_DEBUG)
190 #            define BOOST_LIB_RT_OPT "-gd"
191 #        else
192 #            define BOOST_LIB_RT_OPT
193 #        endif
194
195 #     endif
196
197 #  else
198
199 #     if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS))
200
201 #        if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
202 #            define BOOST_LIB_RT_OPT "-sgdp"
203 #        elif defined(_DEBUG)
204 #             define BOOST_LIB_RT_OPT "-sgdp"
205 #            pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
206 #            error "Build options aren't compatible with pre-built libraries"
207 #        else
208 #            define BOOST_LIB_RT_OPT "-sp"
209 #        endif
210
211 #     elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
212
213 #        if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
214 #            define BOOST_LIB_RT_OPT "-sgdpn"
215 #        elif defined(_DEBUG)
216 #             define BOOST_LIB_RT_OPT "-sgdpn"
217 #            pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
218 #            error "Build options aren't compatible with pre-built libraries"
219 #        else
220 #            define BOOST_LIB_RT_OPT "-spn"
221 #        endif
222
223 #     else
224
225 #        if defined(_DEBUG)
226 #             define BOOST_LIB_RT_OPT "-sgd"
227 #        else
228 #            define BOOST_LIB_RT_OPT "-s"
229 #        endif
230
231 #     endif
232
233 #  endif
234
235 #elif defined(__BORLANDC__)
236
237 //
238 // figure out whether we want the debug builds or not:
239 //
240 #pragma defineonoption BOOST_BORLAND_DEBUG -v
241 //
242 // sanity check:
243 //
244 #if defined(__STL_DEBUG) || defined(_STLP_DEBUG)
245 #error "Pre-built versions of the Boost libraries are not provided in STLPort-debug form"
246 #endif
247
248 #  ifdef _RTLDLL
249
250 #     ifdef BOOST_BORLAND_DEBUG
251 #         define BOOST_LIB_RT_OPT "-d"
252 #     else
253 #         define BOOST_LIB_RT_OPT
254 #     endif
255
256 #  else
257
258 #     ifdef BOOST_BORLAND_DEBUG
259 #         define BOOST_LIB_RT_OPT "-sd"
260 #     else
261 #         define BOOST_LIB_RT_OPT "-s"
262 #     endif
263
264 #  endif
265
266 #endif
267
268 //
269 // select linkage opt:
270 //
271 #if (defined(_DLL) || defined(_RTLDLL)) && defined(BOOST_DYN_LINK)
272 #  define BOOST_LIB_PREFIX
273 #elif defined(BOOST_DYN_LINK)
274 #  error "Mixing a dll boost library with a static runtime is a really bad idea..."
275 #else
276 #  define BOOST_LIB_PREFIX "lib"
277 #endif
278
279 //
280 // now include the lib:
281 //
282 #if defined(BOOST_LIB_NAME) \
283       && defined(BOOST_LIB_PREFIX) \
284       && defined(BOOST_LIB_TOOLSET) \
285       && defined(BOOST_LIB_THREAD_OPT) \
286       && defined(BOOST_LIB_RT_OPT) \
287       && defined(BOOST_LIB_VERSION)
288
289 #  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")
290 #ifdef BOOST_LIB_DIAGNOSTIC
291 #  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")
292 #endif
293
294 #else
295 #  error "some required macros where not defined (internal logic error)."
296 #endif
297
298
299 #endif // _MSC_VER || __BORLANDC__
300
301 //
302 // finally undef any macros we may have set:
303 //
304 #ifdef BOOST_LIB_PREFIX
305 #  undef BOOST_LIB_PREFIX
306 #endif
307 #if defined(BOOST_LIB_NAME)
308 #  undef BOOST_LIB_NAME
309 #endif
310 #if defined(BOOST_LIB_TOOLSET)
311 #  undef BOOST_LIB_TOOLSET
312 #endif
313 #if defined(BOOST_LIB_THREAD_OPT)
314 #  undef BOOST_LIB_THREAD_OPT
315 #endif
316 #if defined(BOOST_LIB_RT_OPT)
317 #  undef BOOST_LIB_RT_OPT
318 #endif
319 #if defined(BOOST_LIB_LINK_OPT)
320 #  undef BOOST_LIB_LINK_OPT
321 #endif
322 #if defined(BOOST_LIB_DEBUG_OPT)
323 #  undef BOOST_LIB_DEBUG_OPT
324 #endif
325 #if defined(BOOST_DYN_LINK)
326 #  undef BOOST_DYN_LINK
327 #endif
328
329
330
331
332
333
334
335
336