1 # Check for hash_map extension. This is from
2 # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_map.html
3 AC_DEFUN([AC_CXX_HAVE_STD_EXT_HASH_MAP],
4 [AC_CACHE_CHECK([whether the compiler has <ext/hash_map> defining template class std::hash_map],
5 ac_cv_cxx_have_std_ext_hash_map,
6 [AC_REQUIRE([AC_CXX_NAMESPACES])
8 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ext/hash_map>
11 #endif]], [[hash_map<int, int> t;]])],[ac_cv_cxx_have_std_ext_hash_map=yes],[ac_cv_cxx_have_std_ext_hash_map=no])
13 if test "$ac_cv_cxx_have_std_ext_hash_map" = yes
15 AC_DEFINE(HAVE_STD_EXT_HASH_MAP,1,[Have ext/hash_map>])
17 AC_DEFINE(HAVE_STD_EXT_HASH_MAP,0,[Does not have ext/hash_map>])
21 AC_DEFUN([AC_CXX_HAVE_GNU_EXT_HASH_MAP],
22 [AC_CACHE_CHECK([whether the compiler has <ext/hash_map> defining template class __gnu_cxx::hash_map],
23 ac_cv_cxx_have_gnu_ext_hash_map,
24 [AC_REQUIRE([AC_CXX_NAMESPACES])
26 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ext/hash_map>
27 #ifdef HAVE_NAMESPACES
28 using namespace __gnu_cxx;
29 #endif]], [[hash_map<int,int> t; ]])],[ac_cv_cxx_have_gnu_ext_hash_map=yes],[ac_cv_cxx_have_gnu_ext_hash_map=no])
31 if test "$ac_cv_cxx_have_gnu_ext_hash_map" = yes
33 AC_DEFINE(HAVE_GNU_EXT_HASH_MAP,1,[Have ext/hash_map])
35 AC_DEFINE(HAVE_GNU_EXT_HASH_MAP,0,[Does not have ext/hash_map])
39 AC_DEFUN([AC_CXX_HAVE_GLOBAL_HASH_MAP],
40 [AC_CACHE_CHECK([whether the compiler has <hash_map> defining template class ::hash_map],
41 ac_cv_cxx_have_global_hash_map,
42 [AC_REQUIRE([AC_CXX_NAMESPACES])
44 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <hash_map>]], [[hash_map<int,int> t; ]])],[ac_cv_cxx_have_global_hash_map=yes],[ac_cv_cxx_have_global_hash_map=no])
46 if test "$ac_cv_cxx_have_global_hash_map" = yes
48 AC_DEFINE(HAVE_GLOBAL_HASH_MAP,1,[Have <hash_map>])
50 AC_DEFINE(HAVE_GLOBAL_HASH_MAP,0,[Does not have <hash_map>])
54 AC_DEFUN([AC_CXX_HAVE_HASH_MAP],
55 [AC_CXX_HAVE_STD_EXT_HASH_MAP
56 AC_CXX_HAVE_GNU_EXT_HASH_MAP
57 AC_CXX_HAVE_GLOBAL_HASH_MAP])