Lines 155-160
Link Here
|
155 |
|
155 |
|
156 |
AC_CHECK_HEADERS(vector ext/hash_map) |
156 |
AC_CHECK_HEADERS(vector ext/hash_map) |
157 |
|
157 |
|
158 |
dnl Checks for library functions. |
158 |
dnl Checks for library functions. |
159 |
|
159 |
|
|
|
160 |
AC_DEFUN([AC_COMPILE_STDCXX_0X], [ |
161 |
AC_CACHE_CHECK(if g++ supports C++0x features without additional flags, |
162 |
ac_cv_cxx_compile_cxx0x_native, |
163 |
[AC_LANG_SAVE |
164 |
AC_LANG_CPLUSPLUS |
165 |
AC_TRY_COMPILE([ |
166 |
template <typename T> |
167 |
struct check |
168 |
{ |
169 |
static_assert(sizeof(int) <= sizeof(T), "not big enough"); |
170 |
}; |
171 |
|
172 |
typedef check<check<bool>> right_angle_brackets; |
173 |
|
174 |
int a; |
175 |
decltype(a) b; |
176 |
|
177 |
typedef check<int> check_type; |
178 |
check_type c; |
179 |
check_type&& cr = c;],, |
180 |
ac_cv_cxx_compile_cxx0x_native=yes, ac_cv_cxx_compile_cxx0x_native=no) |
181 |
AC_LANG_RESTORE |
182 |
]) |
183 |
|
184 |
AC_CACHE_CHECK(if g++ supports C++0x features with -std=c++0x, |
185 |
ac_cv_cxx_compile_cxx0x_cxx, |
186 |
[AC_LANG_SAVE |
187 |
AC_LANG_CPLUSPLUS |
188 |
ac_save_CXXFLAGS="$CXXFLAGS" |
189 |
CXXFLAGS="$CXXFLAGS -std=c++0x" |
190 |
AC_TRY_COMPILE([ |
191 |
template <typename T> |
192 |
struct check |
193 |
{ |
194 |
static_assert(sizeof(int) <= sizeof(T), "not big enough"); |
195 |
}; |
196 |
|
197 |
typedef check<check<bool>> right_angle_brackets; |
198 |
|
199 |
int a; |
200 |
decltype(a) b; |
201 |
|
202 |
typedef check<int> check_type; |
203 |
check_type c; |
204 |
check_type&& cr = c;],, |
205 |
ac_cv_cxx_compile_cxx0x_cxx=yes, ac_cv_cxx_compile_cxx0x_cxx=no) |
206 |
CXXFLAGS="$ac_save_CXXFLAGS" |
207 |
AC_LANG_RESTORE |
208 |
]) |
209 |
|
210 |
AC_CACHE_CHECK(if g++ supports C++0x features with -std=gnu++0x, |
211 |
ac_cv_cxx_compile_cxx0x_gxx, |
212 |
[AC_LANG_SAVE |
213 |
AC_LANG_CPLUSPLUS |
214 |
ac_save_CXXFLAGS="$CXXFLAGS" |
215 |
CXXFLAGS="$CXXFLAGS -std=gnu++0x" |
216 |
AC_TRY_COMPILE([ |
217 |
template <typename T> |
218 |
struct check |
219 |
{ |
220 |
static_assert(sizeof(int) <= sizeof(T), "not big enough"); |
221 |
}; |
222 |
|
223 |
typedef check<check<bool>> right_angle_brackets; |
224 |
|
225 |
int a; |
226 |
decltype(a) b; |
227 |
|
228 |
typedef check<int> check_type; |
229 |
check_type c; |
230 |
check_type&& cr = c;],, |
231 |
ac_cv_cxx_compile_cxx0x_gxx=yes, ac_cv_cxx_compile_cxx0x_gxx=no) |
232 |
CXXFLAGS="$ac_save_CXXFLAGS" |
233 |
AC_LANG_RESTORE |
234 |
]) |
235 |
|
236 |
if test "$ac_cv_cxx_compile_cxx0x_native" = yes || |
237 |
test "$ac_cv_cxx_compile_cxx0x_cxx" = yes || |
238 |
test "$ac_cv_cxx_compile_cxx0x_gxx" = yes; then |
239 |
AC_DEFINE(HAVE_STDCXX_0X,,[Define if g++ supports C++0x features. ]) |
240 |
fi |
241 |
]) |
242 |
|
243 |
AC_COMPILE_STDCXX_0X |
244 |
|
245 |
AC_SUBST(cstd) |
246 |
cstd= |
247 |
if test "$ac_cv_cxx_compile_cxx0x_cxx" = yes; then |
248 |
cstd=-std=c++0x |
249 |
fi |
250 |
|
160 |
AC_OUTPUT(Makefile postal.h port.h postal.spec sun/pkginfo) |
251 |
AC_OUTPUT(Makefile postal.h port.h postal.spec sun/pkginfo) |
|
|
252 |
|