BWAPI
|
00001 // This header file is a copy of "boost/config/auto_link.hpp" 00002 // from boost version 1.33.1 00003 // but slightly modified to accomodate CGAL libraries. 00004 //-------------------------------------------------------------------------------------- 00005 // 00006 // (C) Copyright John Maddock 2003. 00007 // Use, modification and distribution are subject to the 00008 // Boost Software License, Version 1.0. (See accompanying file 00009 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 00010 //-------------------------------------------------------------------------------------- 00011 // Copyright (C) 2007 GeometryFactory (France) 00012 // 00013 // This file is part of CGAL (www.cgal.org); you can redistribute it and/or 00014 // modify it under the terms of the GNU Lesser General Public License as 00015 // published by the Free Software Foundation; version 2.1 of the License. 00016 // See the file LICENSE.LGPL distributed with CGAL. 00017 // 00018 // Licensees holding a valid commercial license may use this file in 00019 // accordance with the commercial license agreement provided with the software. 00020 // 00021 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00022 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00023 // 00024 // $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.5-branch/Installation/include/CGAL/auto_link/auto_link.h $ 00025 // $Id: auto_link.h 42798 2008-04-08 19:24:28Z fcacciola $ 00026 // 00027 // Author(s) : Fernando Cacciola (fernando.cacciola@geometryfactory.com) 00028 /************************************************************************* 00029 00030 USAGE: 00031 ~~~~~~ 00032 00033 Before including this header you must define one or more of define the following macros: 00034 00035 CGAL_LIB_NAME: Required: A string containing the basename of the library, 00036 for example boost_regex. 00037 CGAL_LIB_TOOLSET: Optional: the base name of the toolset. 00038 CGAL_LIB_DIAGNOSTIC: Optional: when set the header will print out the name 00039 of the library selected (useful for debugging). 00040 CGAL_AUTO_LINK_NOMANGLE: Specifies that we should link to CGAL_LIB_NAME.lib, 00041 rather than a mangled-name version. 00042 00043 ALL these macros will be undef'ed at the end of the header, even though they are defined from the outside. 00044 That means you must always define them before including this. 00045 00046 Further, this header has no include guards because you can reuse it several times with different 00047 macros (arguments) in order to link different libraries. 00048 Be sure to include it only once for each target library! 00049 00050 Algorithm: 00051 ~~~~~~~~~~ 00052 00053 Libraries for Borland and Microsoft compilers are automatically 00054 selected here, the name of the lib is selected according to the following 00055 formula: 00056 00057 CGAL_LIB_NAME 00058 + "_" 00059 + CGAL_LIB_TOOLSET 00060 + CGAL_LIB_THREAD_OPT 00061 + CGAL_LIB_RT_OPT 00062 00063 These are defined as: 00064 00065 CGAL_LIB_NAME: The base name of the lib ( for example boost_regex). 00066 00067 CGAL_LIB_TOOLSET: The compiler toolset name (vc71, vc80 etc). 00068 00069 CGAL_LIB_THREAD_OPT: "-mt" for multithread builds, otherwise nothing. 00070 00071 CGAL_LIB_RT_OPT: A suffix that indicates the runtime library used, 00072 contains one or more of the following letters after 00073 a hiphen: 00074 00075 s static runtime (dynamic if not present). 00076 d debug build (release if not present). 00077 g debug/diagnostic runtime (release if not present). 00078 p STLPort Build. 00079 00080 00081 ***************************************************************************/ 00082 00083 #ifndef CGAL_NO_AUTOLINK 00084 00085 #ifdef __cplusplus 00086 # ifndef BOOST_CONFIG_HPP 00087 # include <boost/config.hpp> 00088 # endif 00089 #elif defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__EDG_VERSION__) 00090 // 00091 // C language compatability (no, honestly) 00092 // 00093 # define BOOST_MSVC _MSC_VER 00094 # define BOOST_STRINGIZEIZE(X) BOOST_DO_STRINGIZE(X) 00095 # define BOOST_DO_STRINGIZE(X) #X 00096 #endif 00097 // 00098 // Only include what follows for known and supported compilers: 00099 // 00100 #if defined(BOOST_MSVC) \ 00101 || defined(__BORLANDC__) \ 00102 || (defined(__MWERKS__) && defined(_WIN32) && (__MWERKS__ >= 0x3000)) \ 00103 || (defined(__ICL) && defined(_MSC_EXTENSIONS) && (_MSC_VER >= 1200)) 00104 00105 #ifndef CGAL_LIB_NAME 00106 # error "Macro CGAL_LIB_NAME not set (internal error)" 00107 #endif 00108 00109 // 00110 // error check: 00111 // 00112 #if defined(__MSVC_RUNTIME_CHECKS) && !defined(_DEBUG) 00113 # pragma message("Using the /RTC option without specifying a debug runtime will lead to linker errors") 00114 # pragma message("Hint: go to the code generation options and switch to one of the debugging runtimes") 00115 # error "Incompatible build options" 00116 #endif 00117 // 00118 // select toolset if not defined already: 00119 // 00120 #ifndef CGAL_LIB_TOOLSET 00121 #if defined(BOOST_MSVC) && (BOOST_MSVC == 1200) 00122 00123 // vc6: 00124 # define CGAL_LIB_TOOLSET "vc6" 00125 00126 #elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300) 00127 00128 // vc7: 00129 # define CGAL_LIB_TOOLSET "vc7" 00130 00131 #elif defined(BOOST_MSVC) && (BOOST_MSVC == 1310) 00132 00133 // vc71: 00134 # define CGAL_LIB_TOOLSET "vc71" 00135 00136 #elif defined(BOOST_MSVC) && (BOOST_MSVC == 1400) 00137 00138 // vc80: 00139 # define CGAL_LIB_TOOLSET "vc80" 00140 00141 #elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1500) 00142 00143 // vc90: 00144 # define CGAL_LIB_TOOLSET "vc90" 00145 00146 #elif defined(__BORLANDC__) 00147 00148 // CBuilder 6: 00149 # define CGAL_LIB_TOOLSET "bcb" 00150 00151 #elif defined(__ICL) 00152 00153 // Intel C++, no version number: 00154 # define CGAL_LIB_TOOLSET "iw" 00155 00156 #elif defined(__MWERKS__) && (__MWERKS__ <= 0x31FF ) 00157 00158 // Metrowerks CodeWarrior 8.x 00159 # define CGAL_LIB_TOOLSET "cw8" 00160 00161 #elif defined(__MWERKS__) && (__MWERKS__ <= 0x32FF ) 00162 00163 // Metrowerks CodeWarrior 9.x 00164 # define CGAL_LIB_TOOLSET "cw9" 00165 00166 #endif 00167 #endif // CGAL_LIB_TOOLSET 00168 00169 // 00170 // select thread opt: 00171 // 00172 #if defined(_MT) || defined(__MT__) 00173 # define CGAL_LIB_THREAD_OPT "-mt" 00174 #else 00175 # define CGAL_LIB_THREAD_OPT 00176 #endif 00177 00178 #if defined(_MSC_VER) || defined(__MWERKS__) 00179 00180 # ifdef _DLL 00181 00182 # if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS)) 00183 00184 # if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG)) 00185 # define CGAL_LIB_RT_OPT "-gdp" 00186 # elif defined(_DEBUG) 00187 # define CGAL_LIB_RT_OPT "-gdp" 00188 # pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1") 00189 # error "Build options aren't compatible with pre-built libraries" 00190 # else 00191 # define CGAL_LIB_RT_OPT "-p" 00192 # endif 00193 00194 # elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) 00195 00196 # if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG)) 00197 # define CGAL_LIB_RT_OPT "-gdpn" 00198 # elif defined(_DEBUG) 00199 # define CGAL_LIB_RT_OPT "-gdpn" 00200 # pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1") 00201 # error "Build options aren't compatible with pre-built libraries" 00202 # else 00203 # define CGAL_LIB_RT_OPT "-pn" 00204 # endif 00205 00206 # else 00207 00208 # if defined(_DEBUG) 00209 # define CGAL_LIB_RT_OPT "-gd" 00210 # else 00211 # define CGAL_LIB_RT_OPT 00212 # endif 00213 00214 # endif 00215 00216 # else 00217 00218 # if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS)) 00219 00220 # if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG)) 00221 # define CGAL_LIB_RT_OPT "-sgdp" 00222 # elif defined(_DEBUG) 00223 # define CGAL_LIB_RT_OPT "-sgdp" 00224 # pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1") 00225 # error "Build options aren't compatible with pre-built libraries" 00226 # else 00227 # define CGAL_LIB_RT_OPT "-sp" 00228 # endif 00229 00230 # elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) 00231 00232 # if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG)) 00233 # define CGAL_LIB_RT_OPT "-sgdpn" 00234 # elif defined(_DEBUG) 00235 # define CGAL_LIB_RT_OPT "-sgdpn" 00236 # pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1") 00237 # error "Build options aren't compatible with pre-built libraries" 00238 # else 00239 # define CGAL_LIB_RT_OPT "-spn" 00240 # endif 00241 00242 # else 00243 00244 # if defined(_DEBUG) 00245 # define CGAL_LIB_RT_OPT "-sgd" 00246 # else 00247 # define CGAL_LIB_RT_OPT "-s" 00248 # endif 00249 00250 # endif 00251 00252 # endif 00253 00254 #elif defined(__BORLANDC__) 00255 00256 // 00257 // figure out whether we want the debug builds or not: 00258 // 00259 #if __BORLANDC__ > 0x561 00260 #pragma defineonoption CGAL_BORLAND_DEBUG -v 00261 #endif 00262 // 00263 // sanity check: 00264 // 00265 #if defined(__STL_DEBUG) || defined(_STLP_DEBUG) 00266 #error "Pre-built versions of the CGAL libraries are not provided in STLPort-debug form" 00267 #endif 00268 00269 # ifdef _RTLDLL 00270 00271 # ifdef CGAL_BORLAND_DEBUG 00272 # define CGAL_LIB_RT_OPT "-d" 00273 # else 00274 # define CGAL_LIB_RT_OPT 00275 # endif 00276 00277 # else 00278 00279 # ifdef CGAL_BORLAND_DEBUG 00280 # define CGAL_LIB_RT_OPT "-sd" 00281 # else 00282 # define CGAL_LIB_RT_OPT "-s" 00283 # endif 00284 00285 # endif 00286 00287 #endif 00288 00289 // 00290 // now include the lib: 00291 // 00292 #if defined(CGAL_LIB_NAME) \ 00293 && defined(CGAL_LIB_TOOLSET) \ 00294 && defined(CGAL_LIB_THREAD_OPT) \ 00295 && defined(CGAL_LIB_RT_OPT) \ 00296 00297 #ifndef CGAL_AUTO_LINK_NOMANGLE 00298 # define CGAL_LIB_FULL_NAME BOOST_STRINGIZE(CGAL_LIB_NAME) "-" CGAL_LIB_TOOLSET CGAL_LIB_THREAD_OPT CGAL_LIB_RT_OPT ".lib" 00299 #else 00300 # define CGAL_LIB_FULL_NAME BOOST_STRINGIZE(CGAL_LIB_NAME) ".lib" 00301 #endif 00302 00303 #pragma comment(lib, CGAL_LIB_FULL_NAME ) 00304 #ifdef CGAL_LIB_DIAGNOSTIC 00305 # pragma message ("Linking to lib file: " CGAL_LIB_FULL_NAME ) 00306 #endif 00307 00308 #else 00309 # error "some required macros where not defined (internal logic error)." 00310 #endif 00311 00312 00313 #endif // _MSC_VER || __BORLANDC__ 00314 00315 #endif // CGAL_NO_AUTOLINK 00316 00317 // 00318 // finally undef any macros we may have set: 00319 // 00320 #if defined(CGAL_LIB_NAME) 00321 # undef CGAL_LIB_NAME 00322 #endif 00323 #if defined(CGAL_LIB_TOOLSET) 00324 # undef CGAL_LIB_TOOLSET 00325 #endif 00326 #if defined(CGAL_LIB_THREAD_OPT) 00327 # undef CGAL_LIB_THREAD_OPT 00328 #endif 00329 #if defined(CGAL_LIB_RT_OPT) 00330 # undef CGAL_LIB_RT_OPT 00331 #endif 00332 #if defined(CGAL_LIB_LINK_OPT) 00333 # undef CGAL_LIB_LINK_OPT 00334 #endif 00335 #if defined(CGAL_AUTO_LINK_NOMANGLE) 00336 # undef CGAL_AUTO_LINK_NOMANGLE 00337 #endif 00338 #if defined(CGAL_LIB_FULL_NAME) 00339 # undef CGAL_LIB_FULL_NAME 00340 #endif 00341