fi
])
-#
# Check for hash_map extension. This is from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_map.html
-#
AC_DEFUN([AC_CXX_HAVE_STD_EXT_HASH_MAP],
[AC_CACHE_CHECK([whether the compiler has <ext/hash_map> defining template class std::hash_map],
ac_cv_cxx_have_std_ext_hash_map,
#endif],[hash_map<int, int> t;],
[ac_cv_cxx_have_std_ext_hash_map=yes], [ac_cv_cxx_have_std_ext_hash_map=no])
AC_LANG_RESTORE])
- if test "$ac_cv_cxx_have_std_ext_hash_map" = yes; then
- AC_DEFINE(HAVE_STD_EXT_HASH_MAP,,[Define if the compiler has a header <ext/hash_map> that defines template class std::hash_map.])
- fi])
+ HAVE_STD_EXT_HASH_MAP=0
+ if test "$ac_cv_cxx_have_std_ext_hash_map" = yes
+ then
+ HAVE_STD_EXT_HASH_MAP=1
+ fi
+ AC_SUBST(HAVE_STD_EXT_HASH_MAP)])
AC_DEFUN([AC_CXX_HAVE_GNU_EXT_HASH_MAP],
[AC_CACHE_CHECK([whether the compiler has <ext/hash_map> defining template class __gnu_cxx::hash_map],
#endif],[hash_map<int,int> t; ],
[ac_cv_cxx_have_gnu_ext_hash_map=yes],[ac_cv_cxx_have_gnu_ext_hash_map=no])
AC_LANG_RESTORE])
- if test "$ac_cv_cxx_have_gnu_ext_hash_map" = yes; then
- AC_DEFINE(HAVE_GNU_EXT_HASH_MAP,,[Define if the compiler has a header <ext/hash_map> that defines template class __gnu_cxx::hash_map.])
- fi])
+ HAVE_GNU_EXT_HASH_MAP=0
+ if test "$ac_cv_cxx_have_gnu_ext_hash_map" = yes
+ then
+ HAVE_GNU_EXT_HASH_MAP=1
+ fi
+ AC_SUBST(HAVE_GNU_EXT_HASH_MAP)])
AC_DEFUN([AC_CXX_HAVE_GLOBAL_HASH_MAP],
[AC_CACHE_CHECK([whether the compiler has <hash_map> defining template class ::hash_map],
AC_TRY_COMPILE([#include <hash_map>],[hash_map<int,int> t; ],
[ac_cv_cxx_have_global_hash_map=yes], [ac_cv_cxx_have_global_hash_map=no])
AC_LANG_RESTORE])
- if test "$ac_cv_cxx_have_global_hash_map" = yes; then
- AC_DEFINE(HAVE_GLOBAL_HASH_MAP,,[Define if the compiler has a header <hash_map> that defines template class ::hash_map.])
- fi])
+ HAVE_GLOBAL_HASH_MAP=0
+ if test "$ac_cv_cxx_have_global_hash_map" = yes
+ then
+ HAVE_GLOBAL_HASH_MAP=1
+ fi
+ AC_SUBST(HAVE_GLOBAL_HASH_MAP)])
AC_DEFUN([AC_CXX_HAVE_HASH_MAP],
[AC_CXX_HAVE_STD_EXT_HASH_MAP
AC_CXX_HAVE_GNU_EXT_HASH_MAP
AC_CXX_HAVE_GLOBAL_HASH_MAP])
-#
+
# Check for hash_set extension. This is modified from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html
-#
AC_DEFUN([AC_CXX_HAVE_STD_EXT_HASH_SET],
[AC_CACHE_CHECK([whether the compiler has <ext/hash_set> defining template class std::hash_set],
ac_cv_cxx_have_std_ext_hash_set,
#endif],[hash_set<int> t; ],
[ac_cv_cxx_have_std_ext_hash_set=yes], [ac_cv_cxx_have_std_ext_hash_set=no])
AC_LANG_RESTORE])
- if test "$ac_cv_cxx_have_std_ext_hash_set" = yes; then
- AC_DEFINE(HAVE_STD_EXT_HASH_SET,,[Define if the compiler has a header <ext/hash_set> that defines template class std::hash_set.])
- fi])
+ HAVE_STD_EXT_HASH_SET=0
+ if test "$ac_cv_cxx_have_std_ext_hash_set" = yes
+ then
+ HAVE_STD_EXT_HASH_SET=1
+ fi
+ AC_SUBST(HAVE_STD_EXT_HASH_SET)])
AC_DEFUN([AC_CXX_HAVE_GNU_EXT_HASH_SET],
[AC_CACHE_CHECK(
#endif],[hash_set<int> t; ],
[ac_cv_cxx_have_gnu_ext_hash_set=yes], [ac_cv_cxx_have_gnu_ext_hash_set=no])
AC_LANG_RESTORE])
- if test "$ac_cv_cxx_have_gnu_ext_hash_set" = yes; then
- AC_DEFINE(HAVE_GNU_EXT_HASH_SET,,[Define if the compiler has a header <ext/hash_set> that defines template class __gnu_cxx::hash_set.])
- fi])
+ HAVE_GNU_EXT_HASH_SET=0
+ if test "$ac_cv_cxx_have_gnu_ext_hash_set" = yes
+ then
+ HAVE_GNU_EXT_HASH_SET=1
+ fi
+ AC_SUBST(HAVE_GNU_EXT_HASH_SET)])
AC_DEFUN([AC_CXX_HAVE_GLOBAL_HASH_SET],
[AC_CACHE_CHECK([whether the compiler has <hash_set> defining template class ::hash_set],
AC_TRY_COMPILE([#include <hash_set>],[hash_set<int> t; return 0;],
[ac_cv_cxx_have_global_hash_set=yes], [ac_cv_cxx_have_global_hash_set=no])
AC_LANG_RESTORE])
- if test "$ac_cv_cxx_have_global_hash_set" = yes; then
- AC_DEFINE(HAVE_GLOBAL_HASH_SET,,[Define if the compiler has a header <hash_set> that defines template class ::hash_set.])
- fi])
+ HAVE_GLOBAL_HASH_SET=0
+ if test "$ac_cv_cxx_have_global_hash_set" = yes
+ then
+ HAVE_GLOBAL_HASH_SET=1
+ fi
+ AC_SUBST(HAVE_GLOBAL_HASH_SET)])
AC_DEFUN([AC_CXX_HAVE_HASH_SET],
[AC_CXX_HAVE_STD_EXT_HASH_SET
AC_CXX_HAVE_GNU_EXT_HASH_SET
AC_CXX_HAVE_GLOBAL_HASH_SET])
-#
# Check for standard iterator extension. This is modified from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html
-#
AC_DEFUN([AC_CXX_HAVE_STD_ITERATOR],
[AC_CACHE_CHECK(whether the compiler has the standard iterator,
ac_cv_cxx_have_std_iterator,
ac_cv_cxx_have_std_iterator=yes, ac_cv_cxx_have_std_iterator=no)
AC_LANG_RESTORE
])
-if test "$ac_cv_cxx_have_std_iterator" = yes; then
- AC_DEFINE(HAVE_STD_ITERATOR,,[define if the compiler has STL iterators])
+HAVE_STD_ITERATOR=0
+if test "$ac_cv_cxx_have_std_iterator" = yes
+then
+ HAVE_STD_ITERATOR=1
fi
-])
+AC_SUBST(HAVE_STD_ITERATOR)])
#
# Check for bidirectional iterator extension. This is modified from
ac_cv_cxx_have_bi_iterator=yes, ac_cv_cxx_have_bi_iterator=no)
AC_LANG_RESTORE
])
-if test "$ac_cv_cxx_have_bi_iterator" = yes; then
- AC_DEFINE(HAVE_BI_ITERATOR,,[define if the compiler has bidirectional iterator])
+HAVE_BI_ITERATOR=0
+if test "$ac_cv_cxx_have_bi_iterator" = yes
+then
+ HAVE_BI_ITERATOR=1
fi
-])
+AC_SUBST(HAVE_BI_ITERATOR)])
-#
# Check for forward iterator extension. This is modified from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html
-#
AC_DEFUN([AC_CXX_HAVE_FWD_ITERATOR],
[AC_CACHE_CHECK(whether the compiler has forward iterators,
ac_cv_cxx_have_fwd_iterator,
ac_cv_cxx_have_fwd_iterator=yes, ac_cv_cxx_have_fwd_iterator=no)
AC_LANG_RESTORE
])
-if test "$ac_cv_cxx_have_fwd_iterator" = yes; then
- AC_DEFINE(HAVE_FWD_ITERATOR,,[define if the compiler has STL iterators])
-fi
-])
-
-#
-# Check for slist extension. This is from
-# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html
-#
-AC_DEFUN([AC_CXX_HAVE_EXT_SLIST],
-[AC_CACHE_CHECK(whether the compiler has ext/slist,
-ac_cv_cxx_have_ext_slist,
-[AC_REQUIRE([AC_CXX_NAMESPACES])
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <ext/slist>
-#ifdef HAVE_NAMESPACES
-using namespace std;
-#endif],[slist<int> s; return 0;],
- ac_cv_cxx_have_ext_slist=std, ac_cv_cxx_have_ext_slist=no)
- AC_TRY_COMPILE([#include <ext/slist>
-#ifdef HAVE_NAMESPACES
-using namespace __gnu_cxx;
-#endif],[slist<int> s; return 0;],
- ac_cv_cxx_have_ext_slist=gnu, ac_cv_cxx_have_ext_slist=no)
-
- AC_LANG_RESTORE
-])
-if test "$ac_cv_cxx_have_ext_slist" = std; then
- AC_DEFINE(HAVE_EXT_SLIST,std,[define if the compiler has ext/slist])
-fi
-if test "$ac_cv_cxx_have_ext_slist" = gnu; then
- AC_DEFINE(HAVE_EXT_SLIST,gnu,[define if the compiler has ext/slist])
+HAVE_FWD_ITERATOR=0
+if test "$ac_cv_cxx_have_fwd_iterator" = yes
+then
+ HAVE_FWD_ITERATOR=1
fi
-])
+AC_SUBST(HAVE_FWD_ITERATOR)])
#
# Check for FLEX. This is modified from
# Check for Bison. This is modified from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_namespaces.html
#
+# This macro verifies that Bison is installed. If successful, then
+# 1) YACC is set to bison -y (to emulate YACC calls)
+# 2) BISON is set to bison
+#
AC_DEFUN([AC_PROG_BISON],
[AC_CACHE_CHECK(,
ac_cv_has_bison,
if test "$YACC" != "bison -y"; then
AC_MSG_ERROR([bison not found but required])
else
- AC_SUBST(YACC,[bison],[location of bison])
+ AC_SUBST(BISON,[bison],[location of bison])
fi
])
AC_DEFINE([HAVE_LINK_R],[1],[Define if you can use -Wl,-R. to pass -R. to the linker, in order to add the current directory to the dynamic linker search path.])
fi
])
+
+
+dnl AC_SINGLE_CXX_CHECK(DEFINEVAR, CACHEVAR, FUNCTION, HEADER, PROGRAM)
+dnl $1, $2, $3, $4, $5
+dnl
+AC_DEFUN([AC_SINGLE_CXX_CHECK],
+[AC_CACHE_CHECK([for $3 in $4], [$2],
+ [AC_LANG_PUSH(C++)
+ AC_COMPILE_IFELSE(AC_LANG_SOURCE([$5]),[$2=yes],[$2=no])
+ AC_LANG_POP(C++)])
+ if test "$$2" = "yes"
+ then
+ AC_DEFINE($1, 1, [Define to 1 if your compiler defines $3 in the $4
+ header file.])
+ fi])
+
+AC_DEFUN([AC_FUNC_ISNAN],[
+AC_SINGLE_CXX_CHECK([HAVE_ISNAN_IN_MATH_H], [ac_cv_func_isnan_in_math_h],
+ [isnan], [<math.h>],
+ [#include <math.h>
+ int foo(float f) {return isnan(f);}])
+AC_SINGLE_CXX_CHECK([HAVE_ISNAN_IN_CMATH], [ac_cv_func_isnan_in_cmath],
+ [isnan], [<cmath>],
+ [#include <cmath>
+ int foo(float f) {return isnan(f);}])
+AC_SINGLE_CXX_CHECK([HAVE_STD_ISNAN_IN_CMATH], [ac_cv_func_std_isnan_in_cmath],
+ [std::isnan], [<cmath>],
+ [#include <cmath>
+ using std::isnan; int foo(float f) {return isnan(f);}])
+])
+