blob: 6a0d990abce8f8b58cf430ed83367403fb49fa1f [file] [log] [blame]
Jeff Thompsonf7d49942013-08-01 16:47:40 -07001// (C) Copyright John Maddock 2001.
2// (C) Copyright Jens Maurer 2001.
3// Use, modification and distribution are subject to the
4// Boost Software License, Version 1.0. (See accompanying file
5// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
7// See http://www.boost.org for most recent version.
8
9// config for libstdc++ v3
10// not much to go in here:
11
Jeff Thompson3d613fd2013-10-15 15:39:04 -070012#define NDNBOOST_GNU_STDLIB 1
Jeff Thompsonf7d49942013-08-01 16:47:40 -070013
14#ifdef __GLIBCXX__
Jeff Thompson3d613fd2013-10-15 15:39:04 -070015#define NDNBOOST_STDLIB "GNU libstdc++ version " NDNBOOST_STRINGIZE(__GLIBCXX__)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070016#else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070017#define NDNBOOST_STDLIB "GNU libstdc++ version " NDNBOOST_STRINGIZE(__GLIBCPP__)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070018#endif
19
20#if !defined(_GLIBCPP_USE_WCHAR_T) && !defined(_GLIBCXX_USE_WCHAR_T)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070021# define NDNBOOST_NO_CWCHAR
22# define NDNBOOST_NO_CWCTYPE
23# define NDNBOOST_NO_STD_WSTRING
24# define NDNBOOST_NO_STD_WSTREAMBUF
Jeff Thompsonf7d49942013-08-01 16:47:40 -070025#endif
26
27#if defined(__osf__) && !defined(_REENTRANT) \
28 && ( defined(_GLIBCXX_HAVE_GTHR_DEFAULT) || defined(_GLIBCPP_HAVE_GTHR_DEFAULT) )
29// GCC 3 on Tru64 forces the definition of _REENTRANT when any std lib header
30// file is included, therefore for consistency we define it here as well.
31# define _REENTRANT
32#endif
33
34#ifdef __GLIBCXX__ // gcc 3.4 and greater:
35# if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
36 || defined(_GLIBCXX__PTHREADS) \
37 || defined(_GLIBCXX_HAS_GTHREADS) \
Jeff Thompsona28eed82013-08-22 16:21:10 -070038 || defined(_WIN32) \
39 || defined(_AIX)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070040 //
41 // If the std lib has thread support turned on, then turn it on in Boost
42 // as well. We do this because some gcc-3.4 std lib headers define _REENTANT
43 // while others do not...
44 //
Jeff Thompson3d613fd2013-10-15 15:39:04 -070045# define NDNBOOST_HAS_THREADS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070046# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070047# define NDNBOOST_DISABLE_THREADS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070048# endif
49#elif defined(__GLIBCPP__) \
50 && !defined(_GLIBCPP_HAVE_GTHR_DEFAULT) \
51 && !defined(_GLIBCPP__PTHREADS)
52 // disable thread support if the std lib was built single threaded:
Jeff Thompson3d613fd2013-10-15 15:39:04 -070053# define NDNBOOST_DISABLE_THREADS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070054#endif
55
56#if (defined(linux) || defined(__linux) || defined(__linux__)) && defined(__arm__) && defined(_GLIBCPP_HAVE_GTHR_DEFAULT)
57// linux on arm apparently doesn't define _REENTRANT
58// so just turn on threading support whenever the std lib is thread safe:
Jeff Thompson3d613fd2013-10-15 15:39:04 -070059# define NDNBOOST_HAS_THREADS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070060#endif
61
62#if !defined(_GLIBCPP_USE_LONG_LONG) \
63 && !defined(_GLIBCXX_USE_LONG_LONG)\
Jeff Thompson3d613fd2013-10-15 15:39:04 -070064 && defined(NDNBOOST_HAS_LONG_LONG)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070065// May have been set by compiler/*.hpp, but "long long" without library
66// support is useless.
Jeff Thompson3d613fd2013-10-15 15:39:04 -070067# undef NDNBOOST_HAS_LONG_LONG
Jeff Thompsonf7d49942013-08-01 16:47:40 -070068#endif
69
70// Apple doesn't seem to reliably defined a *unix* macro
71#if !defined(CYGWIN) && ( defined(__unix__) \
72 || defined(__unix) \
73 || defined(unix) \
74 || defined(__APPLE__) \
75 || defined(__APPLE) \
76 || defined(APPLE))
77# include <unistd.h>
78#endif
79
80#if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0
Jeff Thompson3d613fd2013-10-15 15:39:04 -070081# define NDNBOOST_STD_EXTENSION_NAMESPACE __gnu_cxx
82# define NDNBOOST_HAS_SLIST
83# define NDNBOOST_HAS_HASH
84# define NDNBOOST_SLIST_HEADER <ext/slist>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070085# if !defined(__GNUC__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070086# define NDNBOOST_HASH_SET_HEADER <ext/hash_set>
87# define NDNBOOST_HASH_MAP_HEADER <ext/hash_map>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070088# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070089# define NDNBOOST_HASH_SET_HEADER <backward/hash_set>
90# define NDNBOOST_HASH_MAP_HEADER <backward/hash_map>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070091# endif
92#endif
93
94// stdlibc++ C++0x support is detected via __GNUC__, __GNUC_MINOR__, and possibly
95// __GNUC_PATCHLEVEL__ at the suggestion of Jonathan Wakely, one of the stdlibc++
96// developers. He also commented:
97//
98// "I'm not sure how useful __GLIBCXX__ is for your purposes, for instance in
99// GCC 4.2.4 it is set to 20080519 but in GCC 4.3.0 it is set to 20080305.
100// Although 4.3.0 was released earlier than 4.2.4, it has better C++0x support
101// than any release in the 4.2 series."
102//
103// Another resource for understanding stdlibc++ features is:
104// http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#manual.intro.status.standard.200x
105
106// C++0x headers in GCC 4.3.0 and later
107//
108#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700109# define NDNBOOST_NO_CXX11_HDR_ARRAY
110# define NDNBOOST_NO_CXX11_HDR_REGEX
111# define NDNBOOST_NO_CXX11_HDR_TUPLE
112# define NDNBOOST_NO_CXX11_HDR_UNORDERED_MAP
113# define NDNBOOST_NO_CXX11_HDR_UNORDERED_SET
114# define NDNBOOST_NO_CXX11_HDR_FUNCTIONAL
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700115#endif
116
117// C++0x headers in GCC 4.4.0 and later
118//
119#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700120# define NDNBOOST_NO_CXX11_HDR_CONDITION_VARIABLE
121# define NDNBOOST_NO_CXX11_HDR_FORWARD_LIST
122# define NDNBOOST_NO_CXX11_HDR_INITIALIZER_LIST
123# define NDNBOOST_NO_CXX11_HDR_MUTEX
124# define NDNBOOST_NO_CXX11_HDR_RATIO
125# define NDNBOOST_NO_CXX11_HDR_SYSTEM_ERROR
126# define NDNBOOST_NO_CXX11_SMART_PTR
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700127#else
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700128# define NDNBOOST_HAS_TR1_COMPLEX_INVERSE_TRIG
129# define NDNBOOST_HAS_TR1_COMPLEX_OVERLOADS
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700130#endif
131
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700132#if (!defined(_GLIBCXX_HAS_GTHREADS) || !defined(_GLIBCXX_USE_C99_STDINT_TR1)) && (!defined(NDNBOOST_NO_CXX11_HDR_CONDITION_VARIABLE) || !defined(NDNBOOST_NO_CXX11_HDR_MUTEX))
133# define NDNBOOST_NO_CXX11_HDR_CONDITION_VARIABLE
134# define NDNBOOST_NO_CXX11_HDR_MUTEX
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700135#endif
136
137// C++0x features in GCC 4.5.0 and later
138//
139#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700140# define NDNBOOST_NO_CXX11_NUMERIC_LIMITS
141# define NDNBOOST_NO_CXX11_HDR_FUTURE
142# define NDNBOOST_NO_CXX11_HDR_RANDOM
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700143#endif
144
145// C++0x features in GCC 4.6.0 and later
146//
147#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700148# define NDNBOOST_NO_CXX11_HDR_TYPEINDEX
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700149#endif
150
151// C++0x features in GCC 4.7.0 and later
152//
153#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
154// Note that although <chrono> existed prior to 4.7, "stead_clock" is spelled "monotonic_clock"
155// so 4.7.0 is the first truely conforming one.
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700156# define NDNBOOST_NO_CXX11_HDR_CHRONO
157# define NDNBOOST_NO_CXX11_ALLOCATOR
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700158#endif
159// C++0x headers not yet (fully!) implemented
160//
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700161# define NDNBOOST_NO_CXX11_HDR_THREAD
162# define NDNBOOST_NO_CXX11_HDR_TYPE_TRAITS
163# define NDNBOOST_NO_CXX11_HDR_CODECVT
164# define NDNBOOST_NO_CXX11_ATOMIC_SMART_PTR
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700165
166// --- end ---