Synesis Software STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ...

pantheios/implicit_link/implicit_link_base_.h

Go to the documentation of this file.
00001 /* /////////////////////////////////////////////////////////////////////////
00002  * File:    pantheios/implicit_link/implicit_link_base_.h
00003  *
00004  * Purpose: Implicit linking for the Pantheios libraries
00005  *
00006  * Created: 18th July 2005
00007  * Updated: 9th March 2010
00008  *
00009  * Home:    http://pantheios.org/
00010  *
00011  * Copyright (c) 2005-2010, Matthew Wilson and Synesis Software
00012  * All rights reserved.
00013  *
00014  * Redistribution and use in source and binary forms, with or without
00015  * modification, are permitted provided that the following conditions are
00016  * met:
00017  *
00018  * - Redistributions of source code must retain the above copyright notice,
00019  *   this list of conditions and the following disclaimer.
00020  * - Redistributions in binary form must reproduce the above copyright
00021  *   notice, this list of conditions and the following disclaimer in the
00022  *   documentation and/or other materials provided with the distribution.
00023  * - Neither the names of Matthew Wilson and Synesis Software nor the names
00024  *   of any contributors may be used to endorse or promote products derived
00025  *   from this software without specific prior written permission.
00026  *
00027  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
00028  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00029  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00030  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00031  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00032  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00033  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00034  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00035  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00036  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00037  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038  *
00039  * ////////////////////////////////////////////////////////////////////// */
00040 
00041 
00047 #ifndef PANTHEIOS_INCL_PANTHEIOS_IMPLICIT_LINK_H_IMPLICIT_LINK_BASE_
00048 #define PANTHEIOS_INCL_PANTHEIOS_IMPLICIT_LINK_H_IMPLICIT_LINK_BASE_
00049 
00050 /* /////////////////////////////////////////////////////////////////////////
00051  * Version information
00052  */
00053 
00054 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00055 # define PANTHEIOS_VER_PANTHEIOS_IMPLICIT_LINK_H_IMPLICIT_LINK_BASE__MAJOR      1
00056 # define PANTHEIOS_VER_PANTHEIOS_IMPLICIT_LINK_H_IMPLICIT_LINK_BASE__MINOR      7
00057 # define PANTHEIOS_VER_PANTHEIOS_IMPLICIT_LINK_H_IMPLICIT_LINK_BASE__REVISION   1
00058 # define PANTHEIOS_VER_PANTHEIOS_IMPLICIT_LINK_H_IMPLICIT_LINK_BASE__EDIT       18
00059 #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
00060 
00061 /* /////////////////////////////////////////////////////////////////////////
00062  * Includes
00063  */
00064 
00065 #ifndef PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS
00066 # include <pantheios/pantheios.h>
00067 #endif /* !PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS */
00068 
00069 #include <platformstl/platformstl.h>
00070 
00071 /* /////////////////////////////////////////////////////////////////////////
00072  * Exception support
00073  */
00074 
00075 #if defined(__MWERKS__)
00076 # if __option(exceptions)
00077 # else /* ? exceptions */
00078 #  define PANTHEIOS_CF_NOX
00079 # endif /* exceptions */
00080 #elif defined(__WATCOMC__) || \
00081       defined(__VECTORC)
00082 # if defined(__CPPUNWIND)
00083 # else /* ? __CPPUNWIND */
00084 #  define PANTHEIOS_CF_NOX
00085 # endif /* __CPPUNWIND */
00086 #elif defined(__DMC__) || \
00087       defined(__INTEL_COMPILER) || \
00088       defined(_MSC_VER)
00089 # if defined(_CPPUNWIND)
00090 # else /* ? _CPPUNWIND */
00091 #  define PANTHEIOS_CF_NOX
00092 # endif /* _CPPUNWIND */
00093 #endif /* compiler */
00094 
00095 /* /////////////////////////////////////////////////////////////////////////
00096  * Implicit linking
00097  */
00098 
00099 #if defined(_WIN32) || \
00100     defined(_WIN64)
00101 
00102 # if defined(__BORLANDC__) || \
00103      /* defined(__DMC__) || */ \
00104      defined(__INTEL_COMPILER) || \
00105      defined(__MWERKS__) || \
00106      defined(_MSC_VER)
00107 #  if !defined(__COMO__)
00108 #   define PANTHEIOS_IMPLICIT_LINK_SUPPORT
00109 #  endif /* compiler */
00110 # endif /* compiler */
00111 
00112 #if defined(PANTHEIOS_IMPLICIT_LINK_SUPPORT) && \
00113     defined(PANTHEIOS_NO_IMPLICIT_LINK)
00114 # undef PANTHEIOS_IMPLICIT_LINK_SUPPORT
00115 #endif /* PANTHEIOS_IMPLICIT_LINK_SUPPORT && PANTHEIOS_NO_IMPLICIT_LINK */
00116 
00117 # if defined(PANTHEIOS_IMPLICIT_LINK_SUPPORT)
00118 
00119   /* prefix */
00120 
00121 #  define PANTHEIOS_IMPL_LINK_PREFIX
00122 
00123   /* library basename */
00124 
00125 #  define PANTHEIOS_IMPL_LINK_LIBRARY_BASENAME          "pantheios"
00126 
00127   /* major version */
00128 
00129 #  define PANTHEIOS_IMPL_LINK_MAJOR_VERSION             "." STLSOFT_STRINGIZE(PANTHEIOS_VER_MAJOR)
00130 
00131   /* module name */
00132 
00133    /* This is not defined here. Each module uses PANTHEIOS_IMPL_LINK_LIBRARY_NAME_() as base for generating its name */
00134 
00135   /* compiler tag */
00136 
00137 #  if defined(__BORLANDC__)
00138 #   if __BORLANDC__ == 0x0550
00139 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "bc55"
00140 #   elif (__BORLANDC__ == 0x0551)
00141 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "bc551"
00142 #   elif (__BORLANDC__ == 0x0560)
00143 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "bc56"
00144 #   elif (__BORLANDC__ == 0x0564)
00145 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "bc564"
00146 #   elif (__BORLANDC__ == 0x0582)
00147 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "bc582"
00148 #   elif (0x0590 == (__BORLANDC__ & 0xfff0))
00149 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "bc59x"
00150 #   elif (0x0610 == (__BORLANDC__ & 0xfff0))
00151 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "bc61x"
00152 #   else /* ? __BORLANDC__ */
00153 #    error Unrecognised value of __BORLANDC__
00154 #   endif /* __BORLANDC__ */
00155 
00156 /*
00157 #  elif defined(__DMC__)
00158 #   define PANTHEIOS_IMPL_LINK_COMPILER_NAME            "dm"
00159  */
00160 
00161 #  elif defined(__INTEL_COMPILER)
00162 #   if __INTEL_COMPILER == 600
00163 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "icl6"
00164 #   elif __INTEL_COMPILER == 700
00165 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "icl7"
00166 #   elif __INTEL_COMPILER == 800
00167 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "icl8"
00168 #   elif __INTEL_COMPILER == 900
00169 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "icl9"
00170 #   elif __INTEL_COMPILER == 1000
00171 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "icl10"
00172 #   elif __INTEL_COMPILER == 1100
00173 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "icl11"
00174 #   else /* ? __INTEL_COMPILER */
00175 #    error Intel C/C++ version not supported
00176 #   endif /* __INTEL_COMPILER */
00177 
00178 #  elif defined(__MWERKS__)
00179 #   if ((__MWERKS__ & 0xFF00) == 0x2400)
00180 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "cw7"
00181 #   elif ((__MWERKS__ & 0xFF00) == 0x3000)
00182 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "cw8"
00183 #   elif ((__MWERKS__ & 0xFF00) == 0x3200)
00184 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "cw9"
00185 #   else /* ? __MWERKS__ */
00186 #    error CodeWarrior version not supported
00187 #   endif /* __MWERKS__ */
00188 
00189 #  elif defined(_MSC_VER)
00190 #   if _MSC_VER == 1000
00191 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "vc4"
00192 #   elif _MSC_VER == 1020
00193 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "vc42"
00194 #   elif _MSC_VER == 1100
00195 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "vc5"
00196 #   elif _MSC_VER == 1200
00197 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "vc6"
00198 #   elif _MSC_VER == 1300
00199 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "vc7"
00200 #   elif _MSC_VER == 1310
00201 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "vc71"
00202 #   elif _MSC_VER == 1400
00203 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "vc8"
00204 #   elif _MSC_VER == 1500
00205 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "vc9"
00206 #   elif _MSC_VER == 1600
00207 #    define PANTHEIOS_IMPL_LINK_COMPILER_NAME           "vc10"
00208 #   else /* ? _MSC_VER */
00209 #    error Visual C++ version not supported
00210 #   endif /* _MSC_VER */
00211 
00212 #  else /* ? compiler */
00213 #   error Unrecognised compiler
00214 #  endif /* compiler */
00215 
00216 
00217   /* operating system tag */
00218 
00219 #  if defined(_STLSOFT_FORCE_ANY_COMPILER) && \
00220       defined(PLATFORMSTL_OS_IS_UNIX) && \
00221       defined(_WIN32)
00222 #   define PANTHEIOS_IMPL_LINK_OS_TAG                   ".unix"
00223 #  endif /* pseudo UNIX */
00224 
00225 #  if !defined(PANTHEIOS_IMPL_LINK_OS_TAG)
00226 #   define PANTHEIOS_IMPL_LINK_OS_TAG                   ""
00227 #  endif /* !PANTHEIOS_IMPL_LINK_OS_TAG */
00228 
00229 
00230   /* architecture tag */
00231 
00232 #  if defined(PLATFORMSTL_ARCH_IS_X86)
00233 #   define PANTHEIOS_IMPL_LINK_ARCH_TAG                 ""
00234 #  elif defined(PLATFORMSTL_ARCH_IS_X64)
00235 #   define PANTHEIOS_IMPL_LINK_ARCH_TAG                 ".x64"
00236 #  elif defined(PLATFORMSTL_ARCH_IS_IA64)
00237 #   define PANTHEIOS_IMPL_LINK_ARCH_TAG                 ".ia64"
00238 #  endif /* arch */
00239 
00240 #  if !defined(PANTHEIOS_IMPL_LINK_ARCH_TAG)
00241 #   define PANTHEIOS_IMPL_LINK_ARCH_TAG                 ""
00242 #  endif /* !PANTHEIOS_IMPL_LINK_ARCH_TAG */
00243 
00244 
00245   /* encoding tag */
00246 
00247 #  if defined(PANTHEIOS_USE_WIDE_STRINGS)
00248 #   define PANTHEIOS_IMPL_LINK_ENCODING_TAG             ".widestring"
00249 #  else /* ? PANTHEIOS_USE_WIDE_STRINGS */
00250 #   define PANTHEIOS_IMPL_LINK_ENCODING_TAG             ""
00251 #  endif /* PANTHEIOS_USE_WIDE_STRINGS */
00252 
00253 
00254   /* threading tag */
00255 
00256 #  if defined(__MT__) || \
00257       defined(_REENTRANT) || \
00258       defined(_MT)
00259 #   if defined(_DLL) || \
00260        defined(__DLL)
00261 #    define PANTHEIOS_IMPL_LINK_THREADING_TAG           ".dll"
00262 #   else /* ? dll */
00263 #    define PANTHEIOS_IMPL_LINK_THREADING_TAG           ".mt"
00264 #   endif /* dll */
00265 #  else /* ? mt */
00266 #    define PANTHEIOS_IMPL_LINK_THREADING_TAG           ""
00267 #  endif /* mt */
00268 
00269 
00270   /* NoX */
00271 
00272 #  if defined(PANTHEIOS_CF_NOX)
00273 #   define PANTHEIOS_IMPL_LINK_NOX_TYPE                 ".nox"
00274 #  else /* ? PANTHEIOS_CF_NOX */
00275 #   define PANTHEIOS_IMPL_LINK_NOX_TYPE                 ""
00276 #  endif /* PANTHEIOS_CF_NOX */
00277 
00278 
00279   /* debug tag */
00280 
00281 #  if !defined(NDEBUG) && \
00282       defined(_DEBUG)
00283 #   define PANTHEIOS_IMPL_LINK_DEBUG_TAG                ".debug"
00284 #  else /* ? debug */
00285 #   define PANTHEIOS_IMPL_LINK_DEBUG_TAG                ""
00286 #  endif /* debug */
00287 
00288 
00289   /* suffix */
00290 
00291 #  define PANTHEIOS_IMPL_LINK_SUFFIX                    ".lib"
00292 
00293 
00294    /* Library name is:
00295     *
00296     * [lib]<library-basename>.<major-version>.<module-name>.<compiler-name>[.<os-arch-tag>][.<char-encoding-tag>][.<threading-tag>][.<nox-tag>][.<debug-tag>].{a|lib}
00297     */
00298 
00299 #  define PANTHEIOS_IMPL_LINK_LIBRARY_NAME_(name)       PANTHEIOS_IMPL_LINK_PREFIX \
00300                                                         PANTHEIOS_IMPL_LINK_LIBRARY_BASENAME \
00301                                                         PANTHEIOS_IMPL_LINK_MAJOR_VERSION \
00302                                                         "." name \
00303                                                         "." PANTHEIOS_IMPL_LINK_COMPILER_NAME \
00304                                                         PANTHEIOS_IMPL_LINK_OS_TAG \
00305                                                         PANTHEIOS_IMPL_LINK_ARCH_TAG \
00306                                                         PANTHEIOS_IMPL_LINK_ENCODING_TAG \
00307                                                         PANTHEIOS_IMPL_LINK_THREADING_TAG \
00308                                                         PANTHEIOS_IMPL_LINK_NOX_TYPE \
00309                                                         PANTHEIOS_IMPL_LINK_DEBUG_TAG \
00310                                                         PANTHEIOS_IMPL_LINK_SUFFIX
00311 
00312 #  pragma message("Implicit linking to Pantheios libraries: (" PANTHEIOS_IMPL_LINK_LIBRARY_NAME_("$(XXXX)") "")
00313 
00314 # endif /* PANTHEIOS_IMPLICIT_LINK_SUPPORT */
00315 
00316 #endif /* Win-32 || Win-64 */
00317 
00318 /* ////////////////////////////////////////////////////////////////////// */
00319 
00320 #endif /* !PANTHEIOS_INCL_PANTHEIOS_IMPLICIT_LINK_H_IMPLICIT_LINK_BASE_ */
00321 
00322 /* ///////////////////////////// end of file //////////////////////////// */

pantheios Library documentation © Matthew Wilson & Synesis Software, 2006-2011 SourceForge.net Logo