File: cxx_features.m4

package info (click to toggle)
nurbs++ 3.0.11-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,012 kB
  • ctags: 3,023
  • sloc: cpp: 26,461; sh: 16,989; makefile: 317; ansic: 27
file content (190 lines) | stat: -rw-r--r-- 4,263 bytes parent folder | download | duplicates (2)
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 CXX_HAVE_TEMPLATE_OF_TEMPLATE
dnl ---------------------------------------
dnl
dnl If the C++ compiler supports templates of templates,
dnl define `HAVE_TEMPLATE_OF_TEMPLATE'.
dnl
AC_DEFUN(CXX_HAVE_TEMPLATE_OF_TEMPLATE,
[
AC_REQUIRE([AC_PROG_CXX])
AC_MSG_CHECKING(whether ${CXX} supports template of templates)
AC_CACHE_VAL(cxx_have_template_of_template,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
template <class T, int N> struct Pointer { T data[N]; };
template <class T> void fcn(const Pointer<T,3>&a) ;
], [/* empty */],
cxx_have_template_of_template=yes,
cxx_have_template_of_template=no)
AC_LANG_RESTORE
])
AC_MSG_RESULT($cxx_have_template_of_template)
if test "$cxx_have_template_of_template" = yes; then
AC_DEFINE(HAVE_TEMPLATE_OF_TEMPLATE)
fi
])dnl

dnl CXX_HAVE_NAMESPACE
dnl ---------------------------------------
dnl
dnl If the C++ compiler supports templates of templates,
dnl define `HAVE_NAMESPACE'.
dnl
AC_DEFUN(CXX_HAVE_NAMESPACE,
[
AC_REQUIRE([AC_PROG_CXX])
AC_MSG_CHECKING(whether ${CXX} supports namespaces)
AC_CACHE_VAL(cxx_have_namespace,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
namespace TestNamespace {
  int f() ; 
}
typedef TestNamespace::f g ; 
], [/* empty */],
cxx_have_namespace=yes,
cxx_have_namespace=no)
AC_LANG_RESTORE
])
AC_MSG_RESULT($cxx_have_namespace)
if test "$cxx_have_namespace" = yes; then
AC_DEFINE(HAVE_NAMESPACE)
fi
])dnl


dnl CXX_MUST_HAVE_NAMESPACE
dnl ---------------------------------------
dnl
dnl If the C++ compiler supports templates of templates,
dnl define `HAVE_NAMESPACE' and allow the program to continue
dnl
AC_DEFUN(CXX_MUST_HAVE_NAMESPACE,
[
AC_REQUIRE([AC_PROG_CXX])
AC_MSG_CHECKING(whether ${CXX} supports namespaces)
AC_CACHE_VAL(cxx_have_namespace,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
namespace TestNamespace {
  int f() ; 
  class A ; 
}
typedef TestNamespace::A B ; 
], [/* empty */],
cxx_have_namespace=yes,
cxx_have_namespace=no)
AC_LANG_RESTORE
])
AC_MSG_RESULT($cxx_have_namespace)
if test "$cxx_have_namespace" = yes; then
AC_DEFINE(HAVE_NAMESPACE)
else
echo "\nThis program requires a C++ compiler that can handle namespaces."
echo "please upgrade your current compiler or talk to your vendor."
echo "The problem might also be caused because configure is using "
echo "the wrong C++ compiler, make sure the CXX variable is properl set.\n"
exit 1
fi
])dnl


dnl CXX_HAVE_ISO_FRIEND_DECL
dnl ---------------------------------------
dnl
dnl If the C++ compiler supports templates of templates,
dnl define `HAVE_ISO_FRIEND_DECL'.
dnl
AC_DEFUN(CXX_HAVE_ISO_FRIEND_DECL,
[
AC_REQUIRE([AC_PROG_CXX])
AC_MSG_CHECKING(whether ${CXX} uses ISO friend declarations)
AC_CACHE_VAL(cxx_have_iso_friend_decl,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
template <class T> void f();
template <class T>
class A {
  friend void f<>() ;
};
], [/* empty */],
cxx_have_iso_friend_decl=yes,
cxx_have_iso_friend_decl=no)
AC_LANG_RESTORE
])
AC_MSG_RESULT($cxx_have_iso_friend_decl)
if test "$cxx_have_iso_friend_decl" = yes; then
AC_DEFINE(HAVE_ISO_FRIEND_DECL)
fi
])dnl



dnl CXX_HAVE_ISO_FRIEND_DECL
dnl ---------------------------------------
dnl
dnl If the C++ compiler supports templates of templates,
dnl define `HAVE_ISO_FRIEND_DECL'.
dnl
AC_DEFUN(CXX_HAVE_COMPLEX_FCNS,
[
AC_REQUIRE([AC_PROG_CXX])

AC_MSG_CHECKING(whether ${CXX} defines abs for the Complex type)
AC_CACHE_VAL(cxx_have_complex_abs,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
#include <complex>
using std::complex;
typedef std::complex<double> Complex ;
void f(){
  Complex c;
  double a=abs(c);
};
], [/* empty */],
cxx_have_complex_abs=yes,
cxx_have_complex_abs=no)
AC_LANG_RESTORE
])
AC_MSG_RESULT($cxx_have_complex_abs)
if test "$cxx_have_complex_abs" = yes; then
AC_DEFINE(HAS_COMPLEX_ABS)
fi

AC_MSG_CHECKING(whether ${CXX} defines conj for the Complex type)
AC_CACHE_VAL(cxx_have_complex_conj,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
#include <complex>
using std::complex;
typedef std::complex<double> Complex ;
void f(){
  Complex c;
  Complex a=conj(c);
};
], [/* empty */],
cxx_have_complex_conj=yes,
cxx_have_complex_conj=no)
AC_LANG_RESTORE
])
AC_MSG_RESULT($cxx_have_complex_conj)
if test "$cxx_have_complex_conj" = yes; then
AC_DEFINE(HAS_COMPLEX_CONJ)
fi



])dnl