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