1 # We check two things: where the include file is for unordered_map, and
2 # what namespace unordered_map lives in within that include file. We
3 # include AC_COMPILE_IFELSE for all the combinations we've seen in the
4 # wild. We define HAVE_UNORDERED_MAP and HAVE_UNORDERED_SET if we have
5 # them, UNORDERED_MAP_H and UNORDERED_SET_H to their location and
6 # UNORDERED_NAMESPACE to be the namespace unordered_map is defined in.
8 AC_DEFUN([PANDORA_CXX_STL_UNORDERED],[
9 save_CXXFLAGS="${CXXFLAGS}"
10 CXXFLAGS="${AM_CXXFLAGS} ${CXXFLAGS}"
12 AC_CACHE_CHECK([for STL unordered_map],
13 [pandora_cv_stl_unordered],[
15 [AC_LANG_PROGRAM([[#include <unordered_map>]],
16 [[std::unordered_map<int, int> t]])],
17 [pandora_cv_stl_unordered="yes"],
18 [pandora_cv_stl_unordered="no"])])
20 AS_IF([test "x${pandora_cv_stl_unordered}" != "xyes"],[
21 AC_CACHE_CHECK([for tr1 unordered_map],
22 [pandora_cv_tr1_unordered],[
25 /* We put in this define because of a YACC symbol clash in Drizzle.
26 Seriously... I cannot believe the GCC guys defined a piece of the internals
27 of this named IF - and I can't believe that YACC generates a token define
31 #include <tr1/unordered_map>
33 std::tr1::unordered_map<int, int> t
35 [pandora_cv_tr1_unordered="yes"],
36 [pandora_cv_tr1_unordered="no"])])
39 AS_IF([test "x${pandora_cv_stl_unordered}" != "xyes" -a "x${pandora_cv_tr1_unordered}" != "xyes"],[
40 AC_CACHE_CHECK([for boost unordered_map],
41 [pandora_cv_boost_unordered],[
43 [AC_LANG_PROGRAM([[#include <boost/unordered_map.hpp>]],
44 [[boost::unordered_map<int, int> t]])],
45 [pandora_cv_boost_unordered="yes"],
46 [pandora_cv_boost_unordered="no"])])
49 CXXFLAGS="${save_CXXFLAGS}"
52 AS_IF([test "x${pandora_cv_stl_unordered}" = "xyes"],[
53 AC_DEFINE(HAVE_STD_UNORDERED_MAP, 1,
54 [if the compiler has std::unordered_map])
55 AC_DEFINE(HAVE_STD_UNORDERED_SET, 1,
56 [if the compiler has std::unordered_set])
57 pandora_has_unordered=yes
59 AS_IF([test "x${pandora_cv_tr1_unordered}" = "xyes"],[
60 AC_DEFINE(HAVE_TR1_UNORDERED_MAP, 1,
61 [if the compiler has std::tr1::unordered_map])
62 AC_DEFINE(HAVE_TR1_UNORDERED_SET, 1,
63 [if the compiler has std::tr1::unordered_set])
64 pandora_has_unordered=yes
66 AS_IF([test "x${pandora_cv_boost_unordered}" = "xyes"],[
67 AC_DEFINE(HAVE_BOOST_UNORDERED_MAP, 1,
68 [if the compiler has boost::unordered_map])
69 AC_DEFINE(HAVE_BOOST_UNORDERED_SET, 1,
70 [if the compiler has boost::unordered_set])
71 pandora_has_unordered=yes
74 AS_IF([test "x${pandora_has_unordered}" != "xyes"],[
75 AC_MSG_WARN([could not find an STL unordered_map])
79 AC_DEFUN([PANDORA_HAVE_CXX_UNORDERED],[
80 AC_REQUIRE([PANDORA_CXX_STL_UNORDERED])
83 AC_DEFUN([PANDORA_REQUIRE_CXX_UNORDERED],[
84 AC_REQUIRE([PANDORA_HAVE_CXX_UNORDERED])
85 AS_IF([test "x${pandora_has_unordered}" != "xyes"],[
86 AC_MSG_ERROR([An STL compliant unordered_map is required for ${PACKAGE}.
87 Implementations can be found in Recent versions of gcc and in boost])