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 HAVE_STD_EXT_HASH_MAP=0
14 if test "$ac_cv_cxx_have_std_ext_hash_map" = yes
16 HAVE_STD_EXT_HASH_MAP=1
18 AC_SUBST(HAVE_STD_EXT_HASH_MAP)])
20 AC_DEFUN([AC_CXX_HAVE_GNU_EXT_HASH_MAP],
21 [AC_CACHE_CHECK([whether the compiler has <ext/hash_map> defining template class __gnu_cxx::hash_map],
22 ac_cv_cxx_have_gnu_ext_hash_map,
23 [AC_REQUIRE([AC_CXX_NAMESPACES])
25 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ext/hash_map>
26 #ifdef HAVE_NAMESPACES
27 using namespace __gnu_cxx;
28 #endif]], [[hash_map<int,int> t; ]])],[ac_cv_cxx_have_gnu_ext_hash_map=yes],[ac_cv_cxx_have_gnu_ext_hash_map=no])
30 HAVE_GNU_EXT_HASH_MAP=0
31 if test "$ac_cv_cxx_have_gnu_ext_hash_map" = yes
33 HAVE_GNU_EXT_HASH_MAP=1
35 AC_SUBST(HAVE_GNU_EXT_HASH_MAP)])
37 AC_DEFUN([AC_CXX_HAVE_GLOBAL_HASH_MAP],
38 [AC_CACHE_CHECK([whether the compiler has <hash_map> defining template class ::hash_map],
39 ac_cv_cxx_have_global_hash_map,
40 [AC_REQUIRE([AC_CXX_NAMESPACES])
42 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])
44 HAVE_GLOBAL_HASH_MAP=0
45 if test "$ac_cv_cxx_have_global_hash_map" = yes
47 HAVE_GLOBAL_HASH_MAP=1
49 AC_SUBST(HAVE_GLOBAL_HASH_MAP)])
51 AC_DEFUN([AC_CXX_HAVE_HASH_MAP],
52 [AC_CXX_HAVE_STD_EXT_HASH_MAP
53 AC_CXX_HAVE_GNU_EXT_HASH_MAP
54 AC_CXX_HAVE_GLOBAL_HASH_MAP])