Reid Spencer | b15e69a | 2004-09-07 06:56:14 +0000 | [diff] [blame] | 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]) |
Reid Spencer | 70eca35 | 2004-09-19 22:31:49 +0000 | [diff] [blame^] | 7 | AC_LANG_PUSH([C++]) |
| 8 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ext/hash_map> |
Reid Spencer | b15e69a | 2004-09-07 06:56:14 +0000 | [diff] [blame] | 9 | #ifdef HAVE_NAMESPACES |
| 10 | using namespace std; |
Reid Spencer | 70eca35 | 2004-09-19 22:31:49 +0000 | [diff] [blame^] | 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]) |
| 12 | AC_LANG_POP([C++])]) |
Reid Spencer | b15e69a | 2004-09-07 06:56:14 +0000 | [diff] [blame] | 13 | HAVE_STD_EXT_HASH_MAP=0 |
| 14 | if test "$ac_cv_cxx_have_std_ext_hash_map" = yes |
| 15 | then |
| 16 | HAVE_STD_EXT_HASH_MAP=1 |
| 17 | fi |
| 18 | AC_SUBST(HAVE_STD_EXT_HASH_MAP)]) |
| 19 | |
| 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]) |
Reid Spencer | 70eca35 | 2004-09-19 22:31:49 +0000 | [diff] [blame^] | 24 | AC_LANG_PUSH([C++]) |
| 25 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ext/hash_map> |
Reid Spencer | b15e69a | 2004-09-07 06:56:14 +0000 | [diff] [blame] | 26 | #ifdef HAVE_NAMESPACES |
| 27 | using namespace __gnu_cxx; |
Reid Spencer | 70eca35 | 2004-09-19 22:31:49 +0000 | [diff] [blame^] | 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]) |
| 29 | AC_LANG_POP([C++])]) |
Reid Spencer | b15e69a | 2004-09-07 06:56:14 +0000 | [diff] [blame] | 30 | HAVE_GNU_EXT_HASH_MAP=0 |
| 31 | if test "$ac_cv_cxx_have_gnu_ext_hash_map" = yes |
| 32 | then |
| 33 | HAVE_GNU_EXT_HASH_MAP=1 |
| 34 | fi |
| 35 | AC_SUBST(HAVE_GNU_EXT_HASH_MAP)]) |
| 36 | |
| 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]) |
Reid Spencer | 70eca35 | 2004-09-19 22:31:49 +0000 | [diff] [blame^] | 41 | AC_LANG_PUSH([C++]) |
| 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]) |
| 43 | AC_LANG_POP([C++])]) |
Reid Spencer | b15e69a | 2004-09-07 06:56:14 +0000 | [diff] [blame] | 44 | HAVE_GLOBAL_HASH_MAP=0 |
| 45 | if test "$ac_cv_cxx_have_global_hash_map" = yes |
| 46 | then |
| 47 | HAVE_GLOBAL_HASH_MAP=1 |
| 48 | fi |
| 49 | AC_SUBST(HAVE_GLOBAL_HASH_MAP)]) |
| 50 | |
| 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]) |
| 55 | |
| 56 | |