2 # Copyright (c) 1998 Etienne Bernard
3 # Copyright (c) 2002 Clinton Ebadi
6 # Check if we have a decent C++ compiler
7 # that supports Standard Template Library (STL)
10 AC_MSG_CHECKING([for STL support])
12 AC_CACHE_VAL(ac_cv_cpp_stl,
15 cat > conftest.$ac_ext <<EOF
24 if AC_TRY_EVAL(ac_link) && test -s conftest; then
25 ac_cv_cpp_stl="have_stl=yes"
27 ac_cv_cpp_stl="have_stl=no"
33 AC_MSG_RESULT([$have_stl])
35 if test "$have_stl" != "yes"; then
36 AC_MSG_ERROR([Sorry, you need STL support with your compiler])
41 # Check is compiler has ios_base
42 AC_DEFUN([AC_CPP_STL_IOSBASE],
44 AC_MSG_CHECKING([for std::ios_base in iostreams])
46 AC_CACHE_VAL(ac_cv_cpp_iosbase,
49 cat > conftest.$ac_ext <<EOF
53 std::ifstream file ("README", std::ios_base::in);
58 if AC_TRY_EVAL(ac_link) && test -s conftest; then
59 ac_cv_cpp_iosbase="have_iosbase=yes"
61 ac_cv_cpp_iosbase="have_iosbase=no"
65 eval "$ac_cv_cpp_iosbase"
67 AC_MSG_RESULT([$have_iosbase])
69 if test "$have_iosbase" = "yes"; then
70 HAVE_IOSBASE="-DHAVE_IOSBASE"
71 AC_DEFINE(HAVE_IOSBASE,1, [std::ios_base])
73 AC_DEFINE(HAVE_IOSBASE,0)
77 # Check if STL elements support the clear() method
78 AC_DEFUN([AC_CPP_STL_CLEAR],
80 AC_MSG_CHECKING([for clear() method in STL objects])
82 AC_CACHE_VAL(ac_cv_cpp_stl_clear,
85 cat > conftest.$ac_ext <<EOF
88 std::map<int, int, std::less<int> > m;
94 if AC_TRY_EVAL(ac_link) && test -s conftest; then
95 ac_cv_cpp_stl_clear="have_stl_clear=yes"
97 ac_cv_cpp_stl_clear="have_stl_clear=no"
101 eval "$ac_cv_cpp_stl_clear"
103 AC_MSG_RESULT([$have_stl_clear])
105 if test "$have_stl_clear" = "yes"; then
106 HAVE_STL_CLEAR="-DHAVE_STL_CLEAR"
107 AC_DEFINE(HAVE_STL_CLEAR,1, [STL Objects have a clear method])