Added new macro BOOST_LIB_VERSION to version.hpp so that auto-linking code knows what version suffix to append to library file names.

Updated auto-linking headers to match new Boost.Install code.


[SVN r20602]
This commit is contained in:
John Maddock
2003-11-02 11:43:56 +00:00
parent a2c5a2a065
commit f4d59657b9
2 changed files with 157 additions and 60 deletions

View File

@ -15,10 +15,10 @@
USAGE: USAGE:
~~~~~~ ~~~~~~
Before including this header you must one or more of define the following macros: Before including this header you must define one or more of define the following macros:
BOOST_LIB_NAME: Required: A string containing the basename of the library, BOOST_LIB_NAME: Required: A string containing the basename of the library,
for example "boost_regex". for example boost_regex.
BOOST_DYN_LINK: Optional: when set link to dll rather than static library. BOOST_DYN_LINK: Optional: when set link to dll rather than static library.
BOOST_LIB_DIAGNOSTIC: Optional: when set the header will print out the name BOOST_LIB_DIAGNOSTIC: Optional: when set the header will print out the name
of the library selected (useful for debugging). of the library selected (useful for debugging).
@ -37,10 +37,10 @@ BOOST_LIB_PREFIX
+ BOOST_LIB_NAME + BOOST_LIB_NAME
+ "_" + "_"
+ BOOST_LIB_TOOLSET + BOOST_LIB_TOOLSET
+ "_"
+ BOOST_LIB_THREAD_OPT + BOOST_LIB_THREAD_OPT
+ BOOST_LIB_RT_OPT + BOOST_LIB_RT_OPT
+ BOOST_LIB_DEBUG_OPT "-"
+ BOOST_LIB_VERSION
These are defined as: These are defined as:
@ -50,51 +50,56 @@ BOOST_LIB_NAME: The base name of the lib ( for example boost_regex).
BOOST_LIB_TOOLSET: The compiler toolset name (vc6, vc7, bcb5 etc). BOOST_LIB_TOOLSET: The compiler toolset name (vc6, vc7, bcb5 etc).
BOOST_LIB_THREAD_OPT: "s" for single thread builds, BOOST_LIB_THREAD_OPT: "-mt" for multithread builds, otherwise nothing.
"m" for multithread builds.
BOOST_LIB_RT_OPT: "s" for static runtime, BOOST_LIB_RT_OPT: A suffix that indicates the runtime library used,
"d" for dynamic runtime. contains one or more of the following letters after
a hiphen:
s static runtime (dynamic if not present).
d debug build (release if not present).
g debug/diagnostic runtime (release if not present).
p STLPort Build.
BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
BOOST_LIB_DEBUG_OPT: nothing for release builds,
"d" for debug builds,
"dd" for debug-diagnostic builds (_STLP_DEBUG).
***************************************************************************/ ***************************************************************************/
#if defined(_MSC_VER) || defined(__BORLANDC__) #if defined(_MSC_VER) || defined(__BORLANDC__)
#ifndef BOOST_CONFIG_HPP
# include <boost/config.hpp>
#endif
#ifndef BOOST_VERSION_HPP
# include <boost/version.hpp>
#endif
#ifndef BOOST_LIB_NAME #ifndef BOOST_LIB_NAME
# error "Macro BOOST_LIB_NAME not set (internal error)" # error "Macro BOOST_LIB_NAME not set (internal error)"
#endif #endif
//
// error check:
//
#if defined(__MSVC_RUNTIME_CHECKS) && !defined(_DEBUG)
# pragma message("Using the /RTC option without specifying a debug runtime will lead to linker errors")
# pragma message("Hint: go to the code generation options and switch to one of the debugging runtimes")
# error "Incompatible build options"
#endif
// //
// select toolset: // select toolset:
// //
#if defined(BOOST_MSVC) && (BOOST_MSVC == 1200) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) #if defined(BOOST_MSVC) && (BOOST_MSVC == 1200)
// vc6-stlport:
# define BOOST_LIB_TOOLSET "vc6-stlport"
#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1200)
// vc6: // vc6:
# define BOOST_LIB_TOOLSET "vc6" # define BOOST_LIB_TOOLSET "vc6"
#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
// vc6-stlport:
# define BOOST_LIB_TOOLSET "vc7-stlport"
#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300) #elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300)
// vc7: // vc7:
# define BOOST_LIB_TOOLSET "vc7" # define BOOST_LIB_TOOLSET "vc7"
#elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1310) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
// vc71-stlport:
# define BOOST_LIB_TOOLSET "vc71-stlport"
#elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1310) #elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1310)
// vc71: // vc71:
@ -103,36 +108,131 @@ BOOST_LIB_DEBUG_OPT: nothing for release builds,
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x560)
// CBuilder 6: // CBuilder 6:
# define BOOST_LIB_TOOLSET "bcb6" # define BOOST_LIB_TOOLSET "bcb"
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550) #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
// CBuilder 6: // CBuilder 5:
# define BOOST_LIB_TOOLSET "bcb5" # define BOOST_LIB_TOOLSET "bcb5"
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x540)
// CBuilder 6:
# define BOOST_LIB_TOOLSET "bcb4"
#endif #endif
// //
// select thread opt: // select thread opt:
// //
#if defined(_MT) || defined(__MT__) #if defined(_MT) || defined(__MT__)
# define BOOST_LIB_THREAD_OPT "m" # define BOOST_LIB_THREAD_OPT "-mt"
#else #else
# define BOOST_LIB_THREAD_OPT "s" # define BOOST_LIB_THREAD_OPT
#endif #endif
#ifdef _MSC_VER
# ifdef _DLL
# if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS))
# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
# define BOOST_LIB_RT_OPT "-gdp"
# elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-gdp"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
# error "Build options aren't compatible with pre-built libraries"
# else
# define BOOST_LIB_RT_OPT "-p"
# endif
# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
# define BOOST_LIB_RT_OPT "-gdpn"
# elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-gdpn"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
# error "Build options aren't compatible with pre-built libraries"
# else
# define BOOST_LIB_RT_OPT "-pn"
# endif
# else
# if defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-gd"
# else
# define BOOST_LIB_RT_OPT
# endif
# endif
# else
# if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS))
# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
# define BOOST_LIB_RT_OPT "-sgdp"
# elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-sgdp"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
# error "Build options aren't compatible with pre-built libraries"
# else
# define BOOST_LIB_RT_OPT "-sp"
# endif
# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
# define BOOST_LIB_RT_OPT "-sgdpn"
# elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-sgdpn"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
# error "Build options aren't compatible with pre-built libraries"
# else
# define BOOST_LIB_RT_OPT "-spn"
# endif
# else
# if defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-sgd"
# else
# define BOOST_LIB_RT_OPT "-s"
# endif
# endif
# endif
#elif defined(__BORLANDC__)
// //
// select runtime opt: // figure out whether we want the debug builds or not:
// //
#if defined(_DLL) || defined(_RTLDLL) #pragma defineonoption BOOST_BORLAND_DEBUG -v
# define BOOST_LIB_RT_OPT "d" //
#else // sanity check:
# define BOOST_LIB_RT_OPT "s" //
#if defined(__STL_DEBUG) || defined(_STLP_DEBUG)
#error "Pre-built versions of the Boost libraries are not provided in STLPort-debug form"
#endif
# ifdef _RTLDLL
# ifdef BOOST_BORLAND_DEBUG
# define BOOST_LIB_RT_OPT "-d"
# else
# define BOOST_LIB_RT_OPT
# endif
# else
# ifdef BOOST_BORLAND_DEBUG
# define BOOST_LIB_RT_OPT "-sd"
# else
# define BOOST_LIB_RT_OPT "-s"
# endif
# endif
#endif #endif
// //
@ -146,19 +246,6 @@ BOOST_LIB_DEBUG_OPT: nothing for release builds,
# define BOOST_LIB_PREFIX "lib" # define BOOST_LIB_PREFIX "lib"
#endif #endif
//
// select debug opt:
//
#if defined(BOOST_MSVC) && defined(_DEBUG) && (defined(_STLP_DEBUG) || defined(__STL_DEBUG))
# define BOOST_LIB_DEBUG_OPT "dd"
#elif defined(BOOST_MSVC) && defined(_DEBUG)
# define BOOST_LIB_DEBUG_OPT "d"
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (defined(_STLP_DEBUG) || defined(__STL_DEBUG))
# define BOOST_LIB_DEBUG_OPT "dd"
#else
# define BOOST_LIB_DEBUG_OPT
#endif
// //
// now include the lib: // now include the lib:
// //
@ -167,15 +254,20 @@ BOOST_LIB_DEBUG_OPT: nothing for release builds,
&& defined(BOOST_LIB_TOOLSET) \ && defined(BOOST_LIB_TOOLSET) \
&& defined(BOOST_LIB_THREAD_OPT) \ && defined(BOOST_LIB_THREAD_OPT) \
&& defined(BOOST_LIB_RT_OPT) \ && defined(BOOST_LIB_RT_OPT) \
&& defined(BOOST_LIB_DEBUG_OPT) && defined(BOOST_LIB_VERSION)
# pragma comment(lib, BOOST_LIB_PREFIX BOOST_LIB_NAME "_" BOOST_LIB_TOOLSET "_" BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT BOOST_LIB_DEBUG_OPT ".lib") # 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")
#ifdef BOOST_LIB_DIAGNOSTIC #ifdef BOOST_LIB_DIAGNOSTIC
# pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_LIB_NAME "_" BOOST_LIB_TOOLSET "_" BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT BOOST_LIB_DEBUG_OPT ".lib") # 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")
#endif #endif
#else
# error "some required macros where not defined (internal logic error)."
#endif #endif
#endif // _MSC_VER || __BORLANDC__
// //
// finally undef any macros we may have set: // finally undef any macros we may have set:
// //
@ -201,9 +293,6 @@ BOOST_LIB_DEBUG_OPT: nothing for release builds,
# undef BOOST_DYN_LINK # undef BOOST_DYN_LINK
#endif #endif
#endif // _MSC_VER || __BORLANDC__

View File

@ -22,5 +22,13 @@
#define BOOST_VERSION 103100 #define BOOST_VERSION 103100
//
// BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION
// but as a *string* in the form "x_y" where x is the major version
// number and y is the minor version number. This is used by
// <config/auto_link.hpp> to select which library version to link to.
#define BOOST_LIB_VERSION "1_31"
#endif #endif