blob: 95cb4ab95a6abdbb5fc4a79f1fc9aed480626e86 [file] [log] [blame]
Jeff Thompsonf7d49942013-08-01 16:47:40 -07001// (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
Jeff Thompson2277ce52013-08-01 17:34:11 -07009 * VERSION see <ndnboost/version.hpp>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070010 * DESCRIPTION: Automatic library inclusion for Borland/Microsoft compilers.
11 */
12
13/*************************************************************************
14
15USAGE:
16~~~~~~
17
18Before including this header you must define one or more of define the following macros:
19
Jeff Thompson3d613fd2013-10-15 15:39:04 -070020NDNBOOST_LIB_NAME: Required: A string containing the basename of the library,
Jeff Thompsonf7d49942013-08-01 16:47:40 -070021 for example boost_regex.
Jeff Thompson3d613fd2013-10-15 15:39:04 -070022NDNBOOST_LIB_TOOLSET: Optional: the base name of the toolset.
23NDNBOOST_DYN_LINK: Optional: when set link to dll rather than static library.
24NDNBOOST_LIB_DIAGNOSTIC: Optional: when set the header will print out the name
Jeff Thompsonf7d49942013-08-01 16:47:40 -070025 of the library selected (useful for debugging).
Jeff Thompson3d613fd2013-10-15 15:39:04 -070026NDNBOOST_AUTO_LINK_NOMANGLE: Specifies that we should link to NDNBOOST_LIB_NAME.lib,
Jeff Thompsonf7d49942013-08-01 16:47:40 -070027 rather than a mangled-name version.
Jeff Thompson3d613fd2013-10-15 15:39:04 -070028NDNBOOST_AUTO_LINK_TAGGED: Specifies that we link to libraries built with the --layout=tagged option.
Jeff Thompsonf7d49942013-08-01 16:47:40 -070029 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
32These macros will be undef'ed at the end of the header, further this header
33has no include guards - so be sure to include it only once from your library!
34
35Algorithm:
36~~~~~~~~~~
37
38Libraries for Borland and Microsoft compilers are automatically
39selected here, the name of the lib is selected according to the following
40formula:
41
Jeff Thompson3d613fd2013-10-15 15:39:04 -070042NDNBOOST_LIB_PREFIX
43 + NDNBOOST_LIB_NAME
Jeff Thompsonf7d49942013-08-01 16:47:40 -070044 + "_"
Jeff Thompson3d613fd2013-10-15 15:39:04 -070045 + NDNBOOST_LIB_TOOLSET
46 + NDNBOOST_LIB_THREAD_OPT
47 + NDNBOOST_LIB_RT_OPT
Jeff Thompsonf7d49942013-08-01 16:47:40 -070048 "-"
Jeff Thompson3d613fd2013-10-15 15:39:04 -070049 + NDNBOOST_LIB_VERSION
Jeff Thompsonf7d49942013-08-01 16:47:40 -070050
51These are defined as:
52
Jeff Thompson3d613fd2013-10-15 15:39:04 -070053NDNBOOST_LIB_PREFIX: "lib" for static libraries otherwise "".
Jeff Thompsonf7d49942013-08-01 16:47:40 -070054
Jeff Thompson3d613fd2013-10-15 15:39:04 -070055NDNBOOST_LIB_NAME: The base name of the lib ( for example boost_regex).
Jeff Thompsonf7d49942013-08-01 16:47:40 -070056
Jeff Thompson3d613fd2013-10-15 15:39:04 -070057NDNBOOST_LIB_TOOLSET: The compiler toolset name (vc6, vc7, bcb5 etc).
Jeff Thompsonf7d49942013-08-01 16:47:40 -070058
Jeff Thompson3d613fd2013-10-15 15:39:04 -070059NDNBOOST_LIB_THREAD_OPT: "-mt" for multithread builds, otherwise nothing.
Jeff Thompsonf7d49942013-08-01 16:47:40 -070060
Jeff Thompson3d613fd2013-10-15 15:39:04 -070061NDNBOOST_LIB_RT_OPT: A suffix that indicates the runtime library used,
Jeff Thompsonf7d49942013-08-01 16:47:40 -070062 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
Jeff Thompson3d613fd2013-10-15 15:39:04 -070072NDNBOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
Jeff Thompsonf7d49942013-08-01 16:47:40 -070073
74
75***************************************************************************/
76
77#ifdef __cplusplus
Jeff Thompson3d613fd2013-10-15 15:39:04 -070078# ifndef NDNBOOST_CONFIG_HPP
Jeff Thompson2277ce52013-08-01 17:34:11 -070079# include <ndnboost/config.hpp>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070080# endif
81#elif defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__EDG_VERSION__)
82//
83// C language compatability (no, honestly)
84//
Jeff Thompson3d613fd2013-10-15 15:39:04 -070085# define NDNBOOST_MSVC _MSC_VER
86# define NDNBOOST_STRINGIZE(X) NDNBOOST_DO_STRINGIZE(X)
87# define NDNBOOST_DO_STRINGIZE(X) #X
Jeff Thompsonf7d49942013-08-01 16:47:40 -070088#endif
89//
90// Only include what follows for known and supported compilers:
91//
Jeff Thompson3d613fd2013-10-15 15:39:04 -070092#if defined(NDNBOOST_MSVC) \
Jeff Thompsonf7d49942013-08-01 16:47:40 -070093 || defined(__BORLANDC__) \
94 || (defined(__MWERKS__) && defined(_WIN32) && (__MWERKS__ >= 0x3000)) \
95 || (defined(__ICL) && defined(_MSC_EXTENSIONS) && (_MSC_VER >= 1200))
96
Jeff Thompson3d613fd2013-10-15 15:39:04 -070097#ifndef NDNBOOST_VERSION_HPP
Jeff Thompson2277ce52013-08-01 17:34:11 -070098# include <ndnboost/version.hpp>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070099#endif
100
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700101#ifndef NDNBOOST_LIB_NAME
102# error "Macro NDNBOOST_LIB_NAME not set (internal error)"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700103#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//
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700116#ifndef NDNBOOST_LIB_TOOLSET
117# if defined(NDNBOOST_MSVC) && (NDNBOOST_MSVC < 1200)
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700118 // Note: no compilers before 1200 are supported
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700119# elif defined(NDNBOOST_MSVC) && (NDNBOOST_MSVC < 1300)
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700120
121# ifdef UNDER_CE
122 // eVC4:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700123# define NDNBOOST_LIB_TOOLSET "evc4"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700124# else
125 // vc6:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700126# define NDNBOOST_LIB_TOOLSET "vc6"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700127# endif
128
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700129# elif defined(NDNBOOST_MSVC) && (NDNBOOST_MSVC < 1310)
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700130
131 // vc7:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700132# define NDNBOOST_LIB_TOOLSET "vc7"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700133
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700134# elif defined(NDNBOOST_MSVC) && (NDNBOOST_MSVC < 1400)
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700135
136 // vc71:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700137# define NDNBOOST_LIB_TOOLSET "vc71"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700138
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700139# elif defined(NDNBOOST_MSVC) && (NDNBOOST_MSVC < 1500)
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700140
141 // vc80:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700142# define NDNBOOST_LIB_TOOLSET "vc80"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700143
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700144# elif defined(NDNBOOST_MSVC) && (NDNBOOST_MSVC < 1600)
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700145
146 // vc90:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700147# define NDNBOOST_LIB_TOOLSET "vc90"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700148
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700149# elif defined(NDNBOOST_MSVC) && (NDNBOOST_MSVC < 1700)
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700150
151 // vc10:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700152# define NDNBOOST_LIB_TOOLSET "vc100"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700153
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700154# elif defined(NDNBOOST_MSVC)
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700155
156 // vc11:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700157# define NDNBOOST_LIB_TOOLSET "vc110"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700158
159# elif defined(__BORLANDC__)
160
161 // CBuilder 6:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700162# define NDNBOOST_LIB_TOOLSET "bcb"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700163
164# elif defined(__ICL)
165
166 // Intel C++, no version number:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700167# define NDNBOOST_LIB_TOOLSET "iw"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700168
169# elif defined(__MWERKS__) && (__MWERKS__ <= 0x31FF )
170
171 // Metrowerks CodeWarrior 8.x
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700172# define NDNBOOST_LIB_TOOLSET "cw8"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700173
174# elif defined(__MWERKS__) && (__MWERKS__ <= 0x32FF )
175
176 // Metrowerks CodeWarrior 9.x
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700177# define NDNBOOST_LIB_TOOLSET "cw9"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700178
179# endif
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700180#endif // NDNBOOST_LIB_TOOLSET
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700181
182//
183// select thread opt:
184//
185#if defined(_MT) || defined(__MT__)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700186# define NDNBOOST_LIB_THREAD_OPT "-mt"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700187#else
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700188# define NDNBOOST_LIB_THREAD_OPT
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700189#endif
190
191#if defined(_MSC_VER) || defined(__MWERKS__)
192
193# ifdef _DLL
194
195# if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS))
196
197# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700198 && defined(NDNBOOST_DEBUG_PYTHON) && defined(NDNBOOST_LINKING_PYTHON)
199# define NDNBOOST_LIB_RT_OPT "-gydp"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700200# elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700201# define NDNBOOST_LIB_RT_OPT "-gdp"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700202# elif defined(_DEBUG)\
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700203 && defined(NDNBOOST_DEBUG_PYTHON) && defined(NDNBOOST_LINKING_PYTHON)
204# define NDNBOOST_LIB_RT_OPT "-gydp"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700205# 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# elif defined(_DEBUG)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700208# define NDNBOOST_LIB_RT_OPT "-gdp"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700209# pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1")
210# error "Build options aren't compatible with pre-built libraries"
211# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700212# define NDNBOOST_LIB_RT_OPT "-p"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700213# endif
214
215# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
216
217# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700218 && defined(NDNBOOST_DEBUG_PYTHON) && defined(NDNBOOST_LINKING_PYTHON)
219# define NDNBOOST_LIB_RT_OPT "-gydpn"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700220# elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700221# define NDNBOOST_LIB_RT_OPT "-gdpn"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700222# elif defined(_DEBUG)\
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700223 && defined(NDNBOOST_DEBUG_PYTHON) && defined(NDNBOOST_LINKING_PYTHON)
224# define NDNBOOST_LIB_RT_OPT "-gydpn"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700225# pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1")
226# error "Build options aren't compatible with pre-built libraries"
227# elif defined(_DEBUG)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700228# define NDNBOOST_LIB_RT_OPT "-gdpn"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700229# pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1")
230# error "Build options aren't compatible with pre-built libraries"
231# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700232# define NDNBOOST_LIB_RT_OPT "-pn"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700233# endif
234
235# else
236
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700237# if defined(_DEBUG) && defined(NDNBOOST_DEBUG_PYTHON) && defined(NDNBOOST_LINKING_PYTHON)
238# define NDNBOOST_LIB_RT_OPT "-gyd"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700239# elif defined(_DEBUG)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700240# define NDNBOOST_LIB_RT_OPT "-gd"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700241# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700242# define NDNBOOST_LIB_RT_OPT
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700243# endif
244
245# endif
246
247# else
248
249# if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS))
250
251# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700252 && defined(NDNBOOST_DEBUG_PYTHON) && defined(NDNBOOST_LINKING_PYTHON)
253# define NDNBOOST_LIB_RT_OPT "-sgydp"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700254# elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700255# define NDNBOOST_LIB_RT_OPT "-sgdp"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700256# elif defined(_DEBUG)\
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700257 && defined(NDNBOOST_DEBUG_PYTHON) && defined(NDNBOOST_LINKING_PYTHON)
258# define NDNBOOST_LIB_RT_OPT "-sgydp"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700259# pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1")
260# error "Build options aren't compatible with pre-built libraries"
261# elif defined(_DEBUG)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700262# define NDNBOOST_LIB_RT_OPT "-sgdp"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700263# pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1")
264# error "Build options aren't compatible with pre-built libraries"
265# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700266# define NDNBOOST_LIB_RT_OPT "-sp"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700267# endif
268
269# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
270
271# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700272 && defined(NDNBOOST_DEBUG_PYTHON) && defined(NDNBOOST_LINKING_PYTHON)
273# define NDNBOOST_LIB_RT_OPT "-sgydpn"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700274# elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700275# define NDNBOOST_LIB_RT_OPT "-sgdpn"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700276# elif defined(_DEBUG)\
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700277 && defined(NDNBOOST_DEBUG_PYTHON) && defined(NDNBOOST_LINKING_PYTHON)
278# define NDNBOOST_LIB_RT_OPT "-sgydpn"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700279# pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1")
280# error "Build options aren't compatible with pre-built libraries"
281# elif defined(_DEBUG)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700282# define NDNBOOST_LIB_RT_OPT "-sgdpn"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700283# pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1")
284# error "Build options aren't compatible with pre-built libraries"
285# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700286# define NDNBOOST_LIB_RT_OPT "-spn"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700287# endif
288
289# else
290
291# if defined(_DEBUG)\
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700292 && defined(NDNBOOST_DEBUG_PYTHON) && defined(NDNBOOST_LINKING_PYTHON)
293# define NDNBOOST_LIB_RT_OPT "-sgyd"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700294# elif defined(_DEBUG)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700295# define NDNBOOST_LIB_RT_OPT "-sgd"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700296# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700297# define NDNBOOST_LIB_RT_OPT "-s"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700298# endif
299
300# endif
301
302# endif
303
304#elif defined(__BORLANDC__)
305
306//
307// figure out whether we want the debug builds or not:
308//
309#if __BORLANDC__ > 0x561
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700310#pragma defineonoption NDNBOOST_BORLAND_DEBUG -v
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700311#endif
312//
313// sanity check:
314//
315#if defined(__STL_DEBUG) || defined(_STLP_DEBUG)
316#error "Pre-built versions of the Boost libraries are not provided in STLport-debug form"
317#endif
318
319# ifdef _RTLDLL
320
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700321# if defined(NDNBOOST_BORLAND_DEBUG)\
322 && defined(NDNBOOST_DEBUG_PYTHON) && defined(NDNBOOST_LINKING_PYTHON)
323# define NDNBOOST_LIB_RT_OPT "-yd"
324# elif defined(NDNBOOST_BORLAND_DEBUG)
325# define NDNBOOST_LIB_RT_OPT "-d"
326# elif defined(NDNBOOST_DEBUG_PYTHON) && defined(NDNBOOST_LINKING_PYTHON)
327# define NDNBOOST_LIB_RT_OPT -y
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700328# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700329# define NDNBOOST_LIB_RT_OPT
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700330# endif
331
332# else
333
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700334# if defined(NDNBOOST_BORLAND_DEBUG)\
335 && defined(NDNBOOST_DEBUG_PYTHON) && defined(NDNBOOST_LINKING_PYTHON)
336# define NDNBOOST_LIB_RT_OPT "-syd"
337# elif defined(NDNBOOST_BORLAND_DEBUG)
338# define NDNBOOST_LIB_RT_OPT "-sd"
339# elif defined(NDNBOOST_DEBUG_PYTHON) && defined(NDNBOOST_LINKING_PYTHON)
340# define NDNBOOST_LIB_RT_OPT "-sy"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700341# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700342# define NDNBOOST_LIB_RT_OPT "-s"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700343# endif
344
345# endif
346
347#endif
348
349//
350// select linkage opt:
351//
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700352#if (defined(_DLL) || defined(_RTLDLL)) && defined(NDNBOOST_DYN_LINK)
353# define NDNBOOST_LIB_PREFIX
354#elif defined(NDNBOOST_DYN_LINK)
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700355# error "Mixing a dll boost library with a static runtime is a really bad idea..."
356#else
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700357# define NDNBOOST_LIB_PREFIX "lib"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700358#endif
359
360//
361// now include the lib:
362//
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700363#if defined(NDNBOOST_LIB_NAME) \
364 && defined(NDNBOOST_LIB_PREFIX) \
365 && defined(NDNBOOST_LIB_TOOLSET) \
366 && defined(NDNBOOST_LIB_THREAD_OPT) \
367 && defined(NDNBOOST_LIB_RT_OPT) \
368 && defined(NDNBOOST_LIB_VERSION)
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700369
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700370#ifdef NDNBOOST_AUTO_LINK_TAGGED
371# pragma comment(lib, NDNBOOST_LIB_PREFIX NDNBOOST_STRINGIZE(NDNBOOST_LIB_NAME) NDNBOOST_LIB_THREAD_OPT NDNBOOST_LIB_RT_OPT ".lib")
372# ifdef NDNBOOST_LIB_DIAGNOSTIC
373# pragma message ("Linking to lib file: " NDNBOOST_LIB_PREFIX NDNBOOST_STRINGIZE(NDNBOOST_LIB_NAME) NDNBOOST_LIB_THREAD_OPT NDNBOOST_LIB_RT_OPT ".lib")
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700374# endif
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700375#elif defined(NDNBOOST_AUTO_LINK_NOMANGLE)
376# pragma comment(lib, NDNBOOST_STRINGIZE(NDNBOOST_LIB_NAME) ".lib")
377# ifdef NDNBOOST_LIB_DIAGNOSTIC
378# pragma message ("Linking to lib file: " NDNBOOST_STRINGIZE(NDNBOOST_LIB_NAME) ".lib")
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700379# endif
380#else
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700381# pragma comment(lib, NDNBOOST_LIB_PREFIX NDNBOOST_STRINGIZE(NDNBOOST_LIB_NAME) "-" NDNBOOST_LIB_TOOLSET NDNBOOST_LIB_THREAD_OPT NDNBOOST_LIB_RT_OPT "-" NDNBOOST_LIB_VERSION ".lib")
382# ifdef NDNBOOST_LIB_DIAGNOSTIC
383# pragma message ("Linking to lib file: " NDNBOOST_LIB_PREFIX NDNBOOST_STRINGIZE(NDNBOOST_LIB_NAME) "-" NDNBOOST_LIB_TOOLSET NDNBOOST_LIB_THREAD_OPT NDNBOOST_LIB_RT_OPT "-" NDNBOOST_LIB_VERSION ".lib")
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700384# endif
385#endif
386
387#else
388# error "some required macros where not defined (internal logic error)."
389#endif
390
391
392#endif // _MSC_VER || __BORLANDC__
393
394//
395// finally undef any macros we may have set:
396//
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700397#ifdef NDNBOOST_LIB_PREFIX
398# undef NDNBOOST_LIB_PREFIX
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700399#endif
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700400#if defined(NDNBOOST_LIB_NAME)
401# undef NDNBOOST_LIB_NAME
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700402#endif
403// Don't undef this one: it can be set by the user and should be the
404// same for all libraries:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700405//#if defined(NDNBOOST_LIB_TOOLSET)
406//# undef NDNBOOST_LIB_TOOLSET
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700407//#endif
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700408#if defined(NDNBOOST_LIB_THREAD_OPT)
409# undef NDNBOOST_LIB_THREAD_OPT
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700410#endif
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700411#if defined(NDNBOOST_LIB_RT_OPT)
412# undef NDNBOOST_LIB_RT_OPT
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700413#endif
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700414#if defined(NDNBOOST_LIB_LINK_OPT)
415# undef NDNBOOST_LIB_LINK_OPT
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700416#endif
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700417#if defined(NDNBOOST_LIB_DEBUG_OPT)
418# undef NDNBOOST_LIB_DEBUG_OPT
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700419#endif
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700420#if defined(NDNBOOST_DYN_LINK)
421# undef NDNBOOST_DYN_LINK
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700422#endif
423