- [ac_cv_hash_map_has_resize=yes],
- [ac_cv_hash_map_has_resize=no])])
- AS_IF([test $ac_cv_hash_map_has_resize = yes],[
- AC_DEFINE(HASH_MAP_HAS_RESIZE, 1, [if hash_map<> hash resize method])
- ])
- AC_CACHE_CHECK(
- [whether to redefine hash<string>],
- [ac_cv_redefine_hash_string],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[
-#include HASH_SET_H
-#include <string>
-using namespace HASH_NAMESPACE;
-using namespace std;
- ]],[[
-string teststr("test");
-HASH_SET_CLASS<string> test_hash;
-HASH_SET_CLASS<string>::iterator iter= test_hash.find(teststr);
-if (iter != test_hash.end())
- return 1;
- ]])],
- [ac_cv_redefine_hash_string=no],
- [ac_cv_redefine_hash_string=yes])])
- AS_IF([test $ac_cv_redefine_hash_string = yes],[
- AC_DEFINE(REDEFINE_HASH_STRING, 1, [if hash<string> needs to be defined])
- ])
- AC_LANG_POP()
+ [pandora_cv_tr1_unordered="yes"],
+ [pandora_cv_tr1_unordered="no"])])
+ ])
+
+ AS_IF([test "x${pandora_cv_stl_unordered}" != "xyes" -a "x${pandora_cv_tr1_unordered}" != "xyes"],[
+ AC_CACHE_CHECK([for boost unordered_map],
+ [pandora_cv_boost_unordered],[
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <boost/unordered_map.hpp>]],
+ [[boost::unordered_map<int, int> t]])],
+ [pandora_cv_boost_unordered="yes"],
+ [pandora_cv_boost_unordered="no"])])
+ ])
+
+ CXXFLAGS="${save_CXXFLAGS}"
+ AC_LANG_POP()
+
+ AS_IF([test "x${pandora_cv_stl_unordered}" = "xyes"],[
+ AC_DEFINE(HAVE_STD_UNORDERED_MAP, 1,
+ [if the compiler has std::unordered_map])
+ AC_DEFINE(HAVE_STD_UNORDERED_SET, 1,
+ [if the compiler has std::unordered_set])
+ pandora_has_unordered=yes
+ ])
+ AS_IF([test "x${pandora_cv_tr1_unordered}" = "xyes"],[
+ AC_DEFINE(HAVE_TR1_UNORDERED_MAP, 1,
+ [if the compiler has std::tr1::unordered_map])
+ AC_DEFINE(HAVE_TR1_UNORDERED_SET, 1,
+ [if the compiler has std::tr1::unordered_set])
+ pandora_has_unordered=yes
+ ])
+ AS_IF([test "x${pandora_cv_boost_unordered}" = "xyes"],[
+ AC_DEFINE(HAVE_BOOST_UNORDERED_MAP, 1,
+ [if the compiler has boost::unordered_map])
+ AC_DEFINE(HAVE_BOOST_UNORDERED_SET, 1,
+ [if the compiler has boost::unordered_set])
+ pandora_has_unordered=yes
+ ])
+
+ AS_IF([test "x${pandora_has_unordered}" != "xyes"],[
+ AC_MSG_WARN([could not find an STL unordered_map])
+ ])
+])
+
+AC_DEFUN([PANDORA_HAVE_CXX_UNORDERED],[
+ AC_REQUIRE([PANDORA_CXX_STL_UNORDERED])
+])
+
+AC_DEFUN([PANDORA_REQUIRE_CXX_UNORDERED],[
+ AC_REQUIRE([PANDORA_HAVE_CXX_UNORDERED])
+ AS_IF([test "x${pandora_has_unordered}" != "xyes"],[
+ AC_MSG_ERROR([An STL compliant unordered_map is required for ${PACKAGE}.
+ Implementations can be found in Recent versions of gcc and in boost])
+ ])