]> granicus.if.org Git - imagemagick/blob - m4/cxx_have_std_libs.m4
(no commit message)
[imagemagick] / m4 / cxx_have_std_libs.m4
1 dnl @synopsis AC_CXX_HAVE_STD_LIBS
2 dnl
3 dnl If the compiler supports ISO C++ standard library (i.e., can
4 dnl include the files iostream, map, iomanip and cmath}), define
5 dnl HAVE_STD_LIBS.
6 dnl
7 dnl @category Cxx
8 dnl @author Todd Veldhuizen
9 dnl @author Luc Maisonobe <luc@spaceroots.org>
10 dnl @version 2004-02-04
11 dnl @license AllPermissive
12
13 AC_DEFUN([AC_CXX_HAVE_STD_LIBS],
14 [AC_CACHE_CHECK(whether the compiler supports ISO C++ standard library,
15 ac_cv_cxx_have_std_libs,
16 [AC_REQUIRE([AX_CXX_NAMESPACES])
17  AC_LANG_SAVE
18  AC_LANG_CPLUSPLUS
19  AC_TRY_COMPILE([#include <iostream>
20 #include <map>
21 #include <iomanip>
22 #include <cmath>
23 #ifdef HAVE_NAMESPACES
24 using namespace std;
25 #endif],[return 0;],
26  ac_cv_cxx_have_std_libs=yes, ac_cv_cxx_have_std_libs=no)
27  AC_LANG_RESTORE
28 ])
29 if test "$ac_cv_cxx_have_std_libs" = yes; then
30   AC_DEFINE(HAVE_STD_LIBS,,[define if the compiler supports ISO C++ standard library])
31 fi
32 ])