File: acinclude.m4

package info (click to toggle)
zipios%2B%2B 0.1.7-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 952 kB
  • sloc: cpp: 4,150; ansic: 148; makefile: 132; sh: 1
file content (190 lines) | stat: -rw-r--r-- 5,049 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
dnl @synopsis AC_CXX_HAVE_STL
dnl
dnl If the compiler supports the Standard Template Library, define HAVE_STL.
dnl
dnl @version $Id: acinclude.m4,v 1.4 2007/01/29 01:37:18 heikoh Exp $
dnl @author Luc Maisonobe
dnl
AC_DEFUN([AC_CXX_HAVE_STL], [
  AC_CACHE_CHECK(
    [whether the Standard Template Library is available],
    [ac_cv_cxx_have_stl],
    [
      AC_REQUIRE([AC_CXX_NAMESPACES])
      AC_LANG_PUSH([C++])
      AC_COMPILE_IFELSE(
        [
          AC_LANG_PROGRAM(
            [
              #include <list>
              #include <deque>
              #ifdef HAVE_NAMESPACES
              using namespace std;
              #endif
            ], [
              list<int> x; x.push_back(5);
              list<int>::iterator iter(x.begin());
              if (iter != x.end()) ++iter;
              return 0;
            ]
          )
        ],
        [ac_cv_cxx_have_stl=yes],
        [ac_cv_cxx_have_stl=no]
      )
      AC_LANG_POP([C++])
    ]
  )
  if test "$ac_cv_cxx_have_stl" = yes ; then
    AC_DEFINE([HAVE_STL],, [define if the Standard Template Library is available])
  fi
])
dnl @synopsis AC_CXX_HAVE_STD
dnl
dnl If the compiler supports ISO C++ standard library (i.e., can include the
dnl files iostream, map, iomanip and cmath}), define HAVE_STD.
dnl
dnl @version $Id: acinclude.m4,v 1.4 2007/01/29 01:37:18 heikoh Exp $
dnl @author Luc Maisonobe
dnl
AC_DEFUN([AC_CXX_HAVE_STD], [
  AC_CACHE_CHECK(
    [whether the compiler supports ISO C++ standard library],
    [ac_cv_cxx_have_std],
    [
      AC_REQUIRE([AC_CXX_NAMESPACES])
      AC_LANG_PUSH([C++])
      AC_COMPILE_IFELSE(
        [
          AC_LANG_PROGRAM(
            [
              #include <iostream>
              #include <map>
              #include <iomanip>
              #include <cmath>
              #ifdef HAVE_NAMESPACES
              using namespace std;
              #endif
            ], [
              return 0;
            ]
          )
        ],
        [ac_cv_cxx_have_std=yes],
        [ac_cv_cxx_have_std=no]
      )
      AC_LANG_POP([C++])
    ]
  )
  if test "$ac_cv_cxx_have_std" = yes; then
    AC_DEFINE([HAVE_STD],, [define if the compiler supports ISO C++ standard library])
  fi
])
dnl @synopsis AC_CXX_NAMESPACES
dnl
dnl If the compiler can prevent names clashes using namespaces, define
dnl HAVE_NAMESPACES.
dnl
dnl @version $Id: acinclude.m4,v 1.4 2007/01/29 01:37:18 heikoh Exp $
dnl @author Luc Maisonobe
dnl
AC_DEFUN([AC_CXX_NAMESPACES], [
  AC_CACHE_CHECK(
    [whether the compiler implements namespaces],
    [ac_cv_cxx_namespaces],
    [
      AC_LANG_PUSH([C++])
      AC_COMPILE_IFELSE(
        [
          namespace Outer { namespace Inner { int i = 0; } }
          using namespace Outer::Inner;
          int main() { return i; }
        ],
        [ac_cv_cxx_namespaces=yes],
        [ac_cv_cxx_namespaces=no]
      )
      AC_LANG_POP([C++])
    ]
  )
  if test "$ac_cv_cxx_namespaces" = "yes" ; then
    AC_DEFINE([HAVE_NAMESPACES],, [define if the compiler implements namespaces])
  fi
])
dnl @synopsis AC_CXX_HAVE_SSTREAM
dnl
dnl If sstream (part of Standard C++ Library) exists
dnl define HAVE_SSTREAM.
dnl
dnl @version ac_cxx_have_std.m4 Tue Mar 28 18:20:26 CEST 2000
dnl @author Thomas Sondergaard thomass@deltadata.dk
dnl
AC_DEFUN([AC_CXX_HAVE_SSTREAM], [
  AC_CACHE_CHECK(
    [for sstream],
    [ac_cv_cxx_have_sstream],
    [
      AC_REQUIRE([AC_CXX_NAMESPACES])
      AC_LANG_PUSH([C++])
      AC_COMPILE_IFELSE(
        [
          AC_LANG_PROGRAM(
            [
              #include <sstream>
              #ifdef HAVE_NAMESPACES
              using namespace std;
              #endif
            ], [
              return 0;
            ]
          )
        ],
        [ac_cv_cxx_have_sstream=yes],
        [ac_cv_cxx_have_sstream=no]
      )
      AC_LANG_POP([C++])
    ]
  )
  if test "$ac_cv_cxx_have_sstream" = yes ; then
    AC_DEFINE([HAVE_SSTREAM], [1], [define if the compiler supports sstream])
  fi
])
dnl @synopsis AC_CXX_HAVE_STD_IOSTREAM
dnl
dnl If std iostream (part of Standard C++ Library) exists
dnl define HAVE_STD_IOSTREAM.
dnl
dnl @version ac_cxx_have_std.m4 Tue Mar 28 18:20:26 CEST 2000
dnl @author Thomas Sondergaard thomass@deltadata.dk
dnl
AC_DEFUN([AC_CXX_HAVE_STD_IOSTREAM], [
  AC_CACHE_CHECK(
    [for std iostream],
    [ac_cv_cxx_have_std_iostream],
    [
      AC_REQUIRE([AC_CXX_NAMESPACES])
      AC_LANG_PUSH([C++])
      AC_COMPILE_IFELSE(
        [
          AC_LANG_PROGRAM(
            [
              #include <sstream>
              #include <streambuf>
              #include <ios>
              #ifdef HAVE_NAMESPACES
              using namespace std;
              #endif
            ], [
              return 0;
            ]
          )
        ],
        [ac_cv_cxx_have_std_iostream=yes],
        [ac_cv_cxx_have_std_iostream=no]
      )
      AC_LANG_POP([C++])
    ]
  )
  if test "$ac_cv_cxx_have_std_iostream" = yes ; then
    AC_DEFINE([HAVE_STD_IOSTREAM],, [define if the compiler has std compliant iostream library])
  fi
])