Import fmit upstream version 0.97.6
[fmit.git] / m4 / ac_cxx_have_stl.m4
1 dnl @synopsis AC_CXX_HAVE_STL
2 dnl
3 dnl If the compiler supports the Standard Template Library, define HAVE_STL.
4 dnl
5 dnl @version $Id: ac_cxx_have_stl.m4,v 1.1 2005/01/07 02:52:49 norwin Exp $
6 dnl @author Todd Veldhuizen and Luc Maisonobe <luc@spaceroots.org>
7 dnl
8 AC_DEFUN([AC_CXX_HAVE_STL],
9 [AC_CACHE_CHECK(whether the compiler supports Standard Template Library,
10 ac_cv_cxx_have_stl,
11 [AC_REQUIRE([AC_CXX_NAMESPACES])
12  AC_LANG_SAVE
13  AC_LANG_CPLUSPLUS
14  AC_TRY_COMPILE([#include <list>
15 #include <deque>
16 #ifdef HAVE_NAMESPACES
17 using namespace std;
18 #endif],[list<int> x; x.push_back(5);
19 list<int>::iterator iter = x.begin(); if (iter != x.end()) ++iter; return 0;],
20  ac_cv_cxx_have_stl=yes, ac_cv_cxx_have_stl=no)
21  AC_LANG_RESTORE
22 ])
23 if test "$ac_cv_cxx_have_stl" = yes; then
24   AC_DEFINE(HAVE_STL,,[define if the compiler supports Standard Template Library])
25 fi
26 ])