-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathacinclude.m4
646 lines (600 loc) · 18.1 KB
/
acinclude.m4
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
dnl
dnl omniORB specific tests
dnl
AC_DEFUN([OMNI_OPENSSL_ROOT],
[AC_CACHE_CHECK(for OpenSSL root,
omni_cv_openssl_root,
[AC_ARG_WITH(openssl,
AC_HELP_STRING([--with-openssl],
[OpenSSL root directory (default none)]),
omni_cv_openssl_root=$withval,
omni_cv_openssl_root=no)
])
dnl Hairy logic to work out OpenSSL path and options.
dnl
dnl If the option is "no", do nothing.
dnl
dnl If the option is "yes", try pkg-config, failing that use prefix.
dnl
dnl If the option is a path, and <path>/lib/pkgconfig exists, try to
dnl use pkg-config based on that directory, failing that just use
dnl the directory/
if test "$omni_cv_openssl_root" = "no"; then
:
else
if test "$PKG_CONFIG" != "no" ; then
set_pkg_config_path=no
if test "$omni_cv_openssl_root" = "yes"; then
do_pkg_config=yes
else
if test -d $omni_cv_openssl_root/lib/pkgconfig; then
saved_pkg_config_libdir="$PKG_CONFIG_LIBDIR"
saved_pkg_config_path="$PKG_CONFIG_PATH"
PKG_CONFIG_LIBDIR=$omni_cv_openssl_root/lib/pkgconfig
PKG_CONFIG_PATH=
export PKG_CONFIG_LIBDIR
export PKG_CONFIG_PATH
do_pkg_config=yes
set_pkg_config_path=yes
else
do_pkg_config=no
fi
fi
if test "$do_pkg_config" = "yes"; then
PKG_CHECK_MODULES(OPENSSL, openssl,
[open_ssl_root=`$PKG_CONFIG --variable=prefix openssl`
open_ssl_cppflags="$OPENSSL_CFLAGS"
open_ssl_lib="$OPENSSL_LIBS"
open_ssl_pkgconfig="yes"
omni_cv_openssl_root="$open_ssl_root"
],
[open_ssl_pkgconfig="no"])
fi
if test "$set_pkg_config_path" = "yes"; then
if test "x$saved_pkg_config_libdir" = "x"; then
unset PKG_CONFIG_LIBDIR
else
PKG_CONFIG_LIBDIR=$saved_pkg_config_libdir
export PKG_CONFIG_LIBDIR
fi
if test "x$saved_pkg_config_path" = "x"; then
unset PKG_CONFIG_PATH
else
PKG_CONFIG_PATH=$saved_pkg_config_path
export PKG_CONFIG_PATH
fi
fi
fi
if test "$omni_cv_openssl_root" = "yes"; then
if test "x$prefix" != "xNONE"; then
omni_cv_openssl_root=$prefix
else
omni_cv_openssl_root=$ac_default_prefix
fi
if test -d $omni_cv_openssl_root/openssl/lib; then
omni_cv_openssl_root=$omni_cv_openssl_root/openssl
elif test -d $omni_cv_openssl_root/lib; then
:
else
AC_MSG_ERROR(Can't find OpenSSL in '$omni_cv_openssl_root'. Please give me the full path or leave out --with-openssl.)
omni_cv_openssl_root=no
fi
fi
fi
open_ssl_root=$omni_cv_openssl_root
if test "$open_ssl_root" = "no"; then
open_ssl_root=""
open_ssl_cppflags=""
open_ssl_lib=""
else
if test "x$open_ssl_pkgconfig" = "xyes"; then
:
else
open_ssl_cppflags="-I$open_ssl_root/include"
open_ssl_lib="-L$open_ssl_root/lib -lssl -lcrypto"
fi
fi
AC_SUBST(OPEN_SSL_ROOT, $open_ssl_root)
AC_SUBST(OPEN_SSL_CPPFLAGS, $open_ssl_cppflags)
AC_SUBST(OPEN_SSL_LIB, $open_ssl_lib)
])
AC_DEFUN([OMNI_CXX_CATCH_BY_BASE],
[AC_CACHE_CHECK(whether exceptions can be caught by base class,
omni_cv_cxx_catch_by_base,
[AC_REQUIRE([AC_CXX_EXCEPTIONS])
AC_LANG_PUSH(C++)
AC_TRY_RUN([
class A {
public:
A() {}
};
class B : public virtual A {
public:
B() {}
};
int main() {
try {
throw B();
}
catch (A&) {
return 0;
}
catch (...) {
return 1;
}
return 2;
}
],
omni_cv_cxx_catch_by_base=yes, omni_cv_cxx_catch_by_base=no,
omni_cv_cxx_catch_by_base=yes)
AC_LANG_POP(C++)
])
if test "$omni_cv_cxx_catch_by_base" = yes; then
AC_DEFINE(HAVE_CATCH_BY_BASE,,
[define if the compiler can catch exceptions by base class])
fi
])
AC_DEFUN([OMNI_CXX_NEED_FQ_BASE_CTOR],
[AC_CACHE_CHECK(whether base constructors have to be fully-qualified,
omni_cv_cxx_need_fq_base_ctor,
[AC_LANG_PUSH(C++)
AC_TRY_COMPILE([
/* Test sub-classes */
class A {
public:
class B {
public:
B(int i) {}
};
};
class C : public A::B {
public:
C() : B(5) {}
};
/* Test namespaces */
namespace P { class R {}; };
namespace Q { class R : public P::R {}; };
class S : public Q::R {
public:
S(): R() {}
};
],
[C c; S s;],
omni_cv_cxx_need_fq_base_ctor=no, omni_cv_cxx_need_fq_base_ctor=yes)
AC_LANG_POP(C++)
])
if test "$omni_cv_cxx_need_fq_base_ctor" = yes; then
AC_DEFINE(OMNI_REQUIRES_FQ_BASE_CTOR,,
[define if base constructors have to be fully qualified])
fi
])
AC_DEFUN([OMNI_CXX_COVARIANT_RETURNS],
[AC_CACHE_CHECK(whether the compiler supports covariant return types,
omni_cv_cxx_covariant_returns,
[AC_LANG_PUSH(C++)
AC_TRY_COMPILE([
class A {};
class B : public virtual A {};
class C {
public:
virtual A* test();
};
class D : public virtual C {
public:
virtual B* test();
};
],
[D d;],
omni_cv_cxx_covariant_returns=yes, omni_cv_cxx_covariant_returns=no)
AC_LANG_POP(C++)
])
if test "$omni_cv_cxx_covariant_returns" = yes; then
AC_DEFINE(OMNI_HAVE_COVARIANT_RETURNS,,
[define if the compiler supports covariant return types])
fi
])
AC_DEFUN([OMNI_CXX_LONG_IS_INT],
[AC_CACHE_CHECK(whether long is the same type as int,
omni_cv_cxx_long_is_int,
[AC_LANG_PUSH(C++)
AC_TRY_COMPILE([
int f(int x){return 1;}
int f(long x){return 1;}
],[long l = 5; return f(l);],
omni_cv_cxx_long_is_int=no, omni_cv_cxx_long_is_int=yes)
AC_LANG_POP(C++)
])
if test "$omni_cv_cxx_long_is_int" = yes; then
AC_DEFINE(OMNI_LONG_IS_INT,,[define if long is the same type as int])
fi
])
AC_DEFUN([OMNI_HAVE_SIG_IGN],
[AC_CACHE_CHECK(whether SIG_IGN is available,
omni_cv_sig_ign_available,
[AC_LANG_PUSH(C++)
AC_TRY_COMPILE([
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#else
die here
#endif
#ifndef HAVE_SIGACTION
extern "C" int sigaction(int, const struct sigaction *, struct sigaction *);
#endif
],[
struct sigaction act;
sigemptyset(&act.sa_mask);
act.sa_handler = SIG_IGN;
],
omni_cv_sig_ign_available=yes, omni_cv_sig_ign_available=no)
AC_LANG_POP(C++)
])
if test "$omni_cv_sig_ign_available" = yes; then
AC_DEFINE(HAVE_SIG_IGN,,[define if SIG_IGN is available])
fi
])
AC_DEFUN([OMNI_GETTIMEOFDAY_TIMEZONE],
[AC_CACHE_CHECK(whether gettimeofday() takes a timezone argument,
omni_cv_gettimeofday_timezone,
[AC_LANG_PUSH(C++)
AC_TRY_COMPILE([
#ifdef HAVE_GETTIMEOFDAY
#include <sys/time.h>
#else
die here
#endif
],[
struct timeval v;
gettimeofday(&v, 0);
],
omni_cv_gettimeofday_timezone=yes, omni_cv_gettimeofday_timezone=no)
AC_LANG_POP(C++)
])
if test "$omni_cv_gettimeofday_timezone" = yes; then
AC_DEFINE(GETTIMEOFDAY_TIMEZONE,,
[define if gettimeofday() takes a timezone argument])
fi
])
AC_DEFUN([OMNI_HAVE_ISNANORINF],
[AC_CACHE_CHECK(for IsNANorINF,
omni_cv_have_isnanorinf,
[AC_LANG_PUSH(C++)
AC_TRY_COMPILE([
#include <math.h>
#include <nan.h>
],[
double d = 1.23;
int i = IsNANorINF(d);
],
omni_cv_have_isnanorinf=yes, omni_cv_have_isnanorinf=no)
AC_LANG_POP(C++)
])
if test "$omni_cv_have_isnanorinf" = yes; then
AC_DEFINE(HAVE_ISNANORINF,,
[Define if you have the `IsNANorINF' function])
fi
])
AC_DEFUN([OMNI_SOCKNAME_ARG],
[AC_MSG_CHECKING([third argument of getsockname])
omni_cv_sockname_size_t=no
AC_LANG_PUSH(C++)
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
],[
socklen_t l;
getsockname(0, 0, &l);
],
omni_cv_sockname_size_t=socklen_t)
if test "$omni_cv_sockname_size_t" = no; then
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
],[
size_t l;
getsockname(0, 0, &l);
],
omni_cv_sockname_size_t=size_t, omni_cv_sockname_size_t=int)
fi
AC_DEFINE_UNQUOTED(OMNI_SOCKNAME_SIZE_T, $omni_cv_sockname_size_t,
[Define to the type of getsockname's third argument])
AC_MSG_RESULT([$omni_cv_sockname_size_t])
])
AC_DEFUN([OMNI_CONFIG_FILE],
[AC_CACHE_CHECK(omniORB config file location,
omni_cv_omniorb_config,
[AC_ARG_WITH(omniORB-config,
AC_HELP_STRING([--with-omniORB-config],
[location of omniORB config file (default /etc/omniORB.cfg)]),
omni_cv_omniorb_config=$withval,
omni_cv_omniorb_config="/etc/omniORB.cfg")
])
if test "$omni_cv_omniorb_config" = "no" || test "$omni_cv_omniorb_config" = "yes"; then
echo "*** invalid omniORB config file '$omni_cv_omniorb_config'; using '/etc/omniORB.cfg'"
omni_cv_omniorb_config="/etc/omniORB.cfg"
fi
AC_SUBST(OMNIORB_CONFIG, $omni_cv_omniorb_config)
])
AC_DEFUN([OMNI_OMNINAMES_LOGDIR],
[AC_CACHE_CHECK(omniNames log directory,
omni_cv_omninames_logdir,
[AC_ARG_WITH(omniNames-logdir,
AC_HELP_STRING([--with-omniNames-logdir],
[location of omniNames log directory (default /var/omninames)]),
omni_cv_omninames_logdir=$withval,
omni_cv_omninames_logdir="/var/omninames")
])
if test "$omni_cv_omninames_logdir" = "no" || test "$omni_cv_omninames_logdir" = "yes"; then
echo "*** invalid omniNames log directory '$omni_cv_omninames_logdir'; using '/var/omninames'"
omni_cv_omninames_logdir="/var/omninames"
fi
AC_SUBST(OMNINAMES_LOGDIR, $omni_cv_omninames_logdir)
])
AC_DEFUN([OMNI_DISABLE_STATIC],
[AC_CACHE_CHECK(whether to build static libraries,
omni_cv_enable_static,
[AC_ARG_ENABLE(static,
AC_HELP_STRING([--disable-static],
[disable build of static libraries (default enable-static)]),
omni_cv_enable_static=$enableval,
omni_cv_enable_static=yes)
])
AC_SUBST(ENABLE_STATIC, $omni_cv_enable_static)
])
dnl Lock tracing
AC_DEFUN([OMNI_DISABLE_THREAD_TRACING],
[AC_CACHE_CHECK(whether to trace threads and locking,
omni_cv_enable_thread_tracing,
[AC_ARG_ENABLE(thread-tracing,
AC_HELP_STRING([--enable-thread-tracing],
[enable thread and mutex tracing (default disable-thread-tracing)]),
omni_cv_enable_thread_tracing=$enableval,
omni_cv_enable_thread_tracing=no)
])
if test "$omni_cv_enable_thread_tracing" = "yes"; then
AC_DEFINE(OMNIORB_ENABLE_LOCK_TRACES,,[define if you want mutexes to be traced])
fi
])
dnl Allow IPv6 to be disabled on platforms that look like they support
dnl it, but where it doesn't work.
AC_DEFUN([OMNI_DISABLE_IPV6_CHECK],
[AC_CACHE_CHECK(whether to support IPv6,
omni_cv_enable_ipv6,
[AC_ARG_ENABLE(ipv6,
AC_HELP_STRING([--disable-ipv6],
[disable IPv6 support (default enable-ipv6)]),
omni_cv_enable_ipv6=$enableval,
omni_cv_enable_ipv6=yes)
])
if test "$omni_cv_enable_ipv6" = "no"; then
AC_DEFINE(OMNI_DISABLE_IPV6,,[define if you want to disable IPv6 support])
fi
])
dnl Support for platforms where we just can't get alloca to work
AC_DEFUN([OMNI_DISABLE_ALLOCA],
[AC_CACHE_CHECK(whether alloca should be used in omnicpp,
omni_cv_enable_alloca,
[AC_ARG_ENABLE(alloca,
AC_HELP_STRING([--disable-alloca],
[disable use of alloca in omnicpp (default enable-alloca)]),
omni_cv_enable_alloca=$enableval,
omni_cv_enable_alloca=yes)
])
if test "$omni_cv_enable_alloca" = "no"; then
AC_DEFINE(OMNIORB_DISABLE_ALLOCA,,[define if you want to avoid use of alloca])
fi
])
dnl Disable support for long double even if the toolchain claims to support it.
AC_DEFUN([OMNI_DISABLE_LONGDOUBLE],
[AC_CACHE_CHECK(whether to support long double,
omni_cv_enable_longdouble,
[AC_ARG_ENABLE(longdouble,
AC_HELP_STRING([--disable-longdouble],
[disable long double support (default enable-longdouble)]),
omni_cv_enable_longdouble=$enableval,
omni_cv_enable_longdouble=yes)
])
if test "$omni_cv_enable_longdouble" = "no"; then
AC_DEFINE(OMNIORB_DISABLE_LONGDOUBLE,,[define if you want to disable long double support])
fi
AC_SUBST(ENABLE_LONGDOUBLE, $omni_cv_enable_longdouble)
])
dnl Enable ZIOP
AC_DEFUN([OMNI_ENABLE_ZIOP],
[AC_CHECK_LIB(z,compressBound,omni_cv_enable_ziop=yes,omni_cv_enable_ziop=no)
AC_SUBST(ENABLE_ZIOP, $omni_cv_enable_ziop)])
dnl Atomic operations
AC_DEFUN([OMNI_SYNC_ADD_SUB_FETCH],
[AC_CACHE_CHECK(whether __sync_add_and_fetch and __sync_sub_and_fetch are present,
omni_cv_sync_add_and_fetch,
[AC_LANG_PUSH(C++)
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
int a = 1;
int b = __sync_add_and_fetch(&a, 1);
int c = __sync_sub_and_fetch(&b, 1);
]])],
[omni_cv_sync_add_and_fetch=yes],
[omni_cv_sync_add_and_fetch=no])
AC_LANG_POP(C++)
])
if test "$omni_cv_sync_add_and_fetch" = yes; then
AC_DEFINE(OMNI_HAVE_SYNC_ADD_AND_FETCH,,
[define if __sync_add_and_fetch and __sync_sub_and_fetch are available])
fi
])
dnl Disable support for atomic operations even if they look like they
dnl are available
AC_DEFUN([OMNI_DISABLE_ATOMIC],
[AC_CACHE_CHECK(whether to use atomic operations when possible,
omni_cv_enable_atomic,
[AC_ARG_ENABLE(atomic,
AC_HELP_STRING([--disable-atomic],
[disable atomic operations (default enable-atomic)]),
omni_cv_enable_atomic=$enableval,
omni_cv_enable_atomic=yes)
])
if test "$omni_cv_enable_atomic" = "no"; then
AC_DEFINE(OMNI_DISABLE_ATOMIC_OPS,,[define if you want to disable atomic operations])
fi
])
dnl Mac / iOS CFNetwork
AC_DEFUN([OMNI_ENABLE_CFNETWORK],
[AC_CACHE_CHECK(whether to use CFNetwork,
omni_cv_enable_cfnetwork,
[AC_ARG_ENABLE(cfnetwork,
AC_HELP_STRING([--enable-cfnetwork],
[enable use of Mac / iOS CFNetwork (default disable-cfnetwork)]),
omni_cv_enable_cfnetwork=$enableval,
omni_cv_enable_cfnetwork=no)
])
if test "$omni_cv_enable_cfnetwork" = "yes"; then
AC_DEFINE(OMNI_USE_CFNETWORK_CONNECT,,[define if you want to use CFNetwork])
fi
AC_SUBST(OMNI_USE_CFNETWORK_CONNECT, $omni_cv_enable_cfnetwork)
])
dnl
dnl Tests from http://www.gnu.org/software/ac-archive/
dnl
AC_DEFUN([AC_CXX_EXCEPTIONS],
[AC_CACHE_CHECK(whether the compiler supports exceptions,
ac_cv_cxx_exceptions,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE(,[try { throw 1; } catch (int i) { return i; }],
ac_cv_cxx_exceptions=yes, ac_cv_cxx_exceptions=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_exceptions" = yes; then
AC_DEFINE(HAVE_EXCEPTIONS,,[define if the compiler supports exceptions])
fi
])
AC_DEFUN([AC_CXX_BOOL],
[AC_CACHE_CHECK(whether the compiler recognizes bool as a built-in type,
ac_cv_cxx_bool,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
int f(int x){return 1;}
int f(char x){return 1;}
int f(bool x){return 1;}
],[bool b = true; return f(b);],
ac_cv_cxx_bool=yes, ac_cv_cxx_bool=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_bool" = yes; then
AC_DEFINE(HAVE_BOOL,,[define if bool is a built-in type])
fi
])
AC_DEFUN([AC_CXX_CONST_CAST],
[AC_CACHE_CHECK(whether the compiler supports const_cast<>,
ac_cv_cxx_const_cast,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE(,[int x = 0;const int& y = x;int& z = const_cast<int&>(y);return z;],
ac_cv_cxx_const_cast=yes, ac_cv_cxx_const_cast=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_const_cast" = yes; then
AC_DEFINE(HAVE_CONST_CAST,,[define if the compiler supports const_cast<>])
fi
])
AC_DEFUN([AC_CXX_DYNAMIC_CAST],
[AC_CACHE_CHECK(whether the compiler supports dynamic_cast<>,
ac_cv_cxx_dynamic_cast,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <typeinfo>
class Base { public : Base () {} virtual void f () = 0;};
class Derived : public Base { public : Derived () {} virtual void f () {} };],[
Derived d; Base& b=d; return dynamic_cast<Derived*>(&b) ? 0 : 1;],
ac_cv_cxx_dynamic_cast=yes, ac_cv_cxx_dynamic_cast=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_dynamic_cast" = yes; then
AC_DEFINE(HAVE_DYNAMIC_CAST,,[define if the compiler supports dynamic_cast<>])
fi
])
AC_DEFUN([AC_CXX_REINTERPRET_CAST],
[AC_CACHE_CHECK(whether the compiler supports reinterpret_cast<>,
ac_cv_cxx_reinterpret_cast,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <typeinfo>
class Base { public : Base () {} virtual void f () = 0;};
class Derived : public Base { public : Derived () {} virtual void f () {} };
class Unrelated { public : Unrelated () {} };
int g (Unrelated&) { return 0; }],[
Derived d;Base& b=d;Unrelated& e=reinterpret_cast<Unrelated&>(b);return g(e);],
ac_cv_cxx_reinterpret_cast=yes, ac_cv_cxx_reinterpret_cast=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_reinterpret_cast" = yes; then
AC_DEFINE(HAVE_REINTERPRET_CAST,,
[define if the compiler supports reinterpret_cast<>])
fi
])
AC_DEFUN([AC_CXX_NAMESPACES],
[AC_CACHE_CHECK(whether the compiler implements namespaces,
ac_cv_cxx_namespaces,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
[using namespace Outer::Inner; return i;],
ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_namespaces" = yes; then
AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])
fi
])
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_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#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_RESTORE
])
if test "$ac_cv_cxx_have_std" = yes; then
AC_DEFINE(HAVE_STD,,[define if the compiler supports ISO C++ standard library])
fi
])
AC_DEFUN([AC_CXX_MEMBER_CONSTANTS],
[AC_CACHE_CHECK(whether the compiler supports member constants,
ac_cv_cxx_member_constants,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([class C {public: static const int i = 0;}; const int C::i;],
[return C::i;],
ac_cv_cxx_member_constants=yes, ac_cv_cxx_member_constants=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_member_constants" = yes; then
AC_DEFINE(HAVE_MEMBER_CONSTANTS,,[define if the compiler supports member constants])
fi
])
AC_DEFUN([OMNI_CHECK_NO_UNIT_AT_A_TIME],
[AC_CACHE_CHECK(whether $CC accepts -fno-unit-at-a-time,
omni_cv_no_unit_at_a_time,
[
AC_LANG_PUSH(C)
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -fno-unit-at-a-time"
AC_COMPILE_IFELSE(AC_LANG_PROGRAM(,), omni_cv_no_unit_at_a_time="yes", omni_cv_no_unit_at_a_time="no")
CFLAGS=$save_CFLAGS
AC_LANG_POP
])])