Reid Spencer | 491f681 | 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 | 12de17d | 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 | 491f681 | 2004-09-07 06:56:14 +0000 | [diff] [blame] | 9 | #ifdef HAVE_NAMESPACES |
| 10 | using namespace std; |
Reid Spencer | 12de17d | 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 | 491f681 | 2004-09-07 06:56:14 +0000 | [diff] [blame] | 13 | if test "$ac_cv_cxx_have_std_ext_hash_map" = yes |
| 14 | then |
John Criswell | 9f01186 | 2004-09-24 18:28:00 +0000 | [diff] [blame] | 15 | AC_DEFINE(HAVE_STD_EXT_HASH_MAP,1,[Have ext/hash_map>]) |
| 16 | else |
| 17 | AC_DEFINE(HAVE_STD_EXT_HASH_MAP,0,[Does not have ext/hash_map>]) |
Reid Spencer | 491f681 | 2004-09-07 06:56:14 +0000 | [diff] [blame] | 18 | fi |
John Criswell | 9f01186 | 2004-09-24 18:28:00 +0000 | [diff] [blame] | 19 | ]) |
Reid Spencer | 491f681 | 2004-09-07 06:56:14 +0000 | [diff] [blame] | 20 | |
| 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]) |
Reid Spencer | 12de17d | 2004-09-19 22:31:49 +0000 | [diff] [blame] | 25 | AC_LANG_PUSH([C++]) |
| 26 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ext/hash_map> |
Reid Spencer | 491f681 | 2004-09-07 06:56:14 +0000 | [diff] [blame] | 27 | #ifdef HAVE_NAMESPACES |
| 28 | using namespace __gnu_cxx; |
Reid Spencer | 12de17d | 2004-09-19 22:31:49 +0000 | [diff] [blame] | 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]) |
| 30 | AC_LANG_POP([C++])]) |
Reid Spencer | 491f681 | 2004-09-07 06:56:14 +0000 | [diff] [blame] | 31 | if test "$ac_cv_cxx_have_gnu_ext_hash_map" = yes |
| 32 | then |
John Criswell | 9f01186 | 2004-09-24 18:28:00 +0000 | [diff] [blame] | 33 | AC_DEFINE(HAVE_GNU_EXT_HASH_MAP,1,[Have ext/hash_map]) |
| 34 | else |
| 35 | AC_DEFINE(HAVE_GNU_EXT_HASH_MAP,0,[Does not have ext/hash_map]) |
Reid Spencer | 491f681 | 2004-09-07 06:56:14 +0000 | [diff] [blame] | 36 | fi |
John Criswell | 9f01186 | 2004-09-24 18:28:00 +0000 | [diff] [blame] | 37 | ]) |
Reid Spencer | 491f681 | 2004-09-07 06:56:14 +0000 | [diff] [blame] | 38 | |
| 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]) |
Reid Spencer | 12de17d | 2004-09-19 22:31:49 +0000 | [diff] [blame] | 43 | AC_LANG_PUSH([C++]) |
| 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]) |
| 45 | AC_LANG_POP([C++])]) |
Reid Spencer | 491f681 | 2004-09-07 06:56:14 +0000 | [diff] [blame] | 46 | if test "$ac_cv_cxx_have_global_hash_map" = yes |
| 47 | then |
John Criswell | 9f01186 | 2004-09-24 18:28:00 +0000 | [diff] [blame] | 48 | AC_DEFINE(HAVE_GLOBAL_HASH_MAP,1,[Have <hash_map>]) |
| 49 | else |
| 50 | AC_DEFINE(HAVE_GLOBAL_HASH_MAP,0,[Does not have <hash_map>]) |
Reid Spencer | 491f681 | 2004-09-07 06:56:14 +0000 | [diff] [blame] | 51 | fi |
John Criswell | 9f01186 | 2004-09-24 18:28:00 +0000 | [diff] [blame] | 52 | ]) |
Reid Spencer | 491f681 | 2004-09-07 06:56:14 +0000 | [diff] [blame] | 53 | |
| 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]) |
| 58 | |
| 59 | |