forked from svedm/yate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
1907 lines (1799 loc) · 57.2 KB
/
configure.ac
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
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Process this file with autoconf to produce a configure script.
AC_INIT(Yate, 6.2.1)
AC_CONFIG_SRCDIR([README])
AC_PREREQ(2.52)
if echo "$ac_confdir/$ac_pwd" | grep -q '[[[:space:]\\\$\"'\'']]'; then
AC_ERROR([Unsupported character(s) in source or current directory name])
fi
PACKAGE_RELEASE="1"
PACKAGE_STATUS="devel"
PACKAGE_REVISION=`cd "$srcdir"; LANG=C LC_MESSAGES=C svn info 2>/dev/null | sed -n 's,^Last Changed Rev: *,,p'`
test -z "$PACKAGE_REVISION" && PACKAGE_REVISION=`cat "$srcdir/packing/revision.txt" 2>/dev/null`
AC_ARG_WITH(status,AC_HELP_STRING([--with-status=NAME],[use NAME as package status]),[PACKAGE_STATUS=$withval])
PACKAGE_VERSION_MAJOR="${PACKAGE_VERSION%%.*}"
PACKAGE_VERSION_MINOR="${PACKAGE_VERSION#*.}"
PACKAGE_VERSION_MINOR="${PACKAGE_VERSION_MINOR%.*}"
PACKAGE_VERSION_BUILD="${PACKAGE_VERSION##*.}"
PACKAGE_VERSION_RELEASE="$((0+${PACKAGE_RELEASE}))"
AC_SUBST(PACKAGE_VERSION_MAJOR)
AC_SUBST(PACKAGE_VERSION_MINOR)
AC_SUBST(PACKAGE_VERSION_BUILD)
AC_SUBST(PACKAGE_VERSION_RELEASE)
AC_SUBST(PACKAGE_RELEASE)
AC_SUBST(PACKAGE_STATUS)
AC_SUBST(PACKAGE_REVISION)
# We may need the host OS type but avoid the overhead of AC_CANONICAL_SYSTEM
AC_MSG_CHECKING([for local operating system type])
uname_os=`uname -s`
test -x "$uname_os" && uname_os=Unknown
AC_MSG_RESULT([$uname_os])
# Check if we should look for alternate library names
AC_ARG_WITH(archlib,AC_HELP_STRING([--with-archlib=NAME],[use NAME as library directory name]),[ac_cv_use_archlib=$withval])
AC_MSG_CHECKING([for libraries directory name])
archname=`dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null`
test -z "$archname" && archname=`uname -m 2>/dev/null`
test -z "$archname" && archname=`arch -k 2>/dev/null`
test -z "$archname" && archname=`arch 2>/dev/null`
ARCHLIB=""
case "x$archname" in
x*-*-*)
test -d "/usr/lib/$archname" && ARCHLIB="lib/$archname"
;;
esac
if [[ -z "$ARCHLIB" ]]; then
case "x$archname" in
x*x86_64*|xppc64*|xaarch64)
ARCHLIB="lib64"
;;
*)
ARCHLIB="lib"
esac
fi
case "x$ac_cv_use_archlib" in
x|xyes)
;;
xno)
ARCHLIB="lib"
;;
*)
ARCHLIB="$ac_cv_use_archlib"
esac
test -d "/usr/$ARCHLIB" || ARCHLIB="lib"
AC_MSG_RESULT([$ARCHLIB])
AC_SUBST(ARCHLIB)
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_AWK
AC_MSG_CHECKING([for sed command to use])
# sed expression to convert version into something comparable lexicographically
csed='sed'
vsed='s/\(^\|\.\)\([[0-9]]\)\($\|\.\)/\10\2\3/g'
if [[ -n "`echo a | sed 's/a\|b//'`" ]]; then
csed='sed -E'
vsed='s/(^|\.)([[0-9]])($|\.)/\10\2\3/g'
fi
AC_MSG_RESULT([$csed])
AC_C_BIGENDIAN([CFLAGS="$CFLAGS -DBIGENDIAN"])
# Check if gcc style printf argument check is supported
HAVE_GCC_FORMAT_CHECK=""
AC_MSG_CHECKING([for gcc printf format typechecks])
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Werror"
AC_TRY_COMPILE([],[void f(void*x,const char*f,...) __attribute__((format(printf,2,3))); ],[ac_cv_format_checks=yes],[ac_cv_format_checks=no])
CFLAGS="$SAVE_CFLAGS"
if [[ "x$ac_cv_format_checks" = "xyes" ]]; then
HAVE_GCC_FORMAT_CHECK="-DHAVE_GCC_FORMAT_CHECK"
fi
AC_MSG_RESULT([$ac_cv_format_checks])
# Check if disabling warnings for overloaded virtual functions is available
HAVE_NO_OVERLOAD_VIRT_WARN=""
AC_MSG_CHECKING([for -Wno-overloaded-virtual flag])
SAVE_CFLAGS="$CFLAGS"
CFLAGS="-Wno-overloaded-virtual -Werror"
AC_TRY_COMPILE([],[],
[ac_cv_no_overload_virt=yes],[ac_cv_no_overload_virt=no])
CFLAGS="$SAVE_CFLAGS"
if [[ "x$ac_cv_no_overload_virt" = "xyes" ]]; then
HAVE_NO_OVERLOAD_VIRT_WARN="-Wno-overloaded-virtual"
fi
AC_MSG_RESULT([$ac_cv_no_overload_virt])
GCC_UNRESOLVED_SYMBOLS="-Wl,--unresolved-symbols=ignore-in-shared-libs"
ld_unresolved_symbols=no
AC_MSG_CHECKING([if ld supports reporting unresolved symbols])
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Werror $GCC_UNRESOLVED_SYMBOLS"
AC_TRY_LINK([],[],[ld_unresolved_symbols=yes],[GCC_UNRESOLVED_SYMBOLS=""])
CFLAGS="$SAVE_CFLAGS"
AC_MSG_RESULT([$ld_unresolved_symbols])
# Check if { instruction } blocks can return a value
HAVE_BLOCK_RETURN=no
AC_ARG_ENABLE(strings,AC_HELP_STRING([--enable-strings],[Create static Strings (default: yes)]),want_strings=$enableval,want_strings=yes)
if [[ "x$want_strings" = "xyes" ]]; then
AC_MSG_CHECKING([if instruction blocks return values])
AC_TRY_COMPILE([],[return ({static int ret = 1; ret;});],HAVE_BLOCK_RETURN="yes")
AC_MSG_RESULT([$HAVE_BLOCK_RETURN])
fi
if [[ "x$HAVE_BLOCK_RETURN" = "xyes" ]]; then
HAVE_BLOCK_RETURN="-DHAVE_BLOCK_RETURN"
else
HAVE_BLOCK_RETURN=""
fi
AC_SUBST(HAVE_BLOCK_RETURN)
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h semaphore.h arpa/inet.h netdb.h netinet/in.h sys/ioctl.h sys/socket.h sys/time.h], , [AC_MSG_ERROR([This header file is required.])])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_HEADER_TIME
# Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([malloc gettimeofday inet_ntoa memmove strerror], , [AC_MSG_ERROR([This function is required.])])
HAVE_GETCWD=""
AC_CHECK_FUNCS([getcwd], [HAVE_GETCWD="-DHAVE_GETCWD"])
AC_SUBST(HAVE_GETCWD)
HAVE_PRCTL=""
AC_MSG_CHECKING([for prctl])
have_prctl="no"
AC_TRY_COMPILE([
#include <unistd.h>
#include <sys/prctl.h>
],[
prctl(1,2,3,4,5);
],have_prctl="yes")
AC_MSG_RESULT([$have_prctl])
if [[ "$have_prctl" = "yes" ]]; then
HAVE_PRCTL="-DHAVE_PRCTL"
fi
AC_SUBST(HAVE_PRCTL)
HAVE_SOCKADDR_LEN=""
AC_MSG_CHECKING([for sockaddr.sa_len presence])
AC_TRY_COMPILE([
#include <sys/socket.h>
],[
struct sockaddr saddr;
saddr.sa_len = sizeof(struct sockaddr);
],
have_sockaddr_len="yes",
have_sockaddr_len="no"
)
if [[ "$have_sockaddr_len" = "yes" ]]; then
HAVE_SOCKADDR_LEN="-DHAVE_SOCKADDR_LEN"
fi
AC_SUBST(HAVE_SOCKADDR_LEN)
AC_MSG_RESULT([$have_sockaddr_len])
HAVE_GMTOFF=""
AC_MSG_CHECKING([for tm.tm_gmtoff presence])
have_gmtoff="no"
AC_TRY_COMPILE([
#include <time.h>
],[
struct tm t;
t.tm_gmtoff = 3600;
],have_gmtoff="yes")
AC_MSG_RESULT([$have_gmtoff])
if [[ "$have_gmtoff" = "yes" ]]; then
HAVE_GMTOFF="-DHAVE_GMTOFF"
fi
AC_SUBST(HAVE_GMTOFF)
HAVE_INT_TZ=""
AC_MSG_CHECKING([for integer timezone variable])
have_tzint="no"
AC_TRY_COMPILE([
#include <time.h>
],[
long tz = -timezone;
],have_tzint="yes")
AC_MSG_RESULT([$have_tzint])
if [[ "$have_tzint" = "yes" ]]; then
HAVE_INT_TZ="-DHAVE_INT_TZ"
fi
AC_SUBST(HAVE_INT_TZ)
HAVE_POLL=no
AC_ARG_ENABLE(poll,AC_HELP_STRING([--enable-poll],[Use poll() on sockets (default: yes)]),want_poll=$enableval,want_poll=yes)
if [[ "x$want_poll" = "xyes" ]]; then
AC_MSG_CHECKING([for poll])
AC_TRY_COMPILE([#include <poll.h>
],[
struct pollfd fds;
poll(&fds,1,1);
],HAVE_POLL=yes)
AC_MSG_RESULT([$HAVE_POLL])
fi
AC_SUBST(HAVE_POLL)
AC_CACHE_SAVE
SAVE_LIBS="$LIBS"
# Checks for required libraries.
THREAD_LIB=""
AC_CHECK_LIB([pthread], [pthread_mutexattr_settype], [THREAD_LIB="-lpthread"])
if [[ "x$THREAD_LIB" = "x" ]]; then
AC_CHECK_LIB([c], [pthread_mutexattr_settype], , [AC_MSG_ERROR([This function is required.])])
fi
AC_SUBST(THREAD_LIB)
AC_MSG_CHECKING([for dlopen in default libs])
AC_LANG_SAVE
AC_LANG_C
AC_TRY_LINK([#include <dlfcn.h>],[dlopen("",0);],[have_dl=yes],[have_dl=no])
AC_LANG_RESTORE
AC_MSG_RESULT([$have_dl])
if [[ "x$have_dl" != "xyes" ]]; then
AC_CHECK_LIB([dl], [dlopen], , [AC_MSG_ERROR([This function is required.])])
DLOPEN_LIB="-ldl"
fi
AC_SUBST(DLOPEN_LIB)
# Restore the system libs
LIBS="$SAVE_LIBS"
MUTEX_HACK=""
AC_LANG_SAVE
AC_LANG_C
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Werror"
SAVE_LIBS="$LIBS"
LIBS="$LIBS $THREAD_LIB"
AC_MSG_CHECKING([for pthread_mutexattr_settype declaration])
AC_TRY_COMPILE([
#include <unistd.h>
#include <pthread.h>
],[
pthread_mutexattr_t attr;
pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE_NP);
],
have_mutex_settype="yes",
have_mutex_settype="no"
)
if [[ "$have_mutex_settype" = "no" ]]; then
MUTEX_HACK="-DMUTEX_HACK"
fi
AC_MSG_RESULT([$have_mutex_settype])
AC_MSG_CHECKING([for pthread_mutex_timedlock])
AC_TRY_LINK([
#include <unistd.h>
#include <pthread.h>
#include <time.h>
],[
pthread_mutex_t mutex;
struct timespec tout;
pthread_mutex_timedlock(&mutex,&tout);
],
have_mutex_timedlock="yes",
have_mutex_timedlock="no"
)
if [[ "$have_mutex_timedlock" = "yes" ]]; then
MUTEX_HACK="$MUTEX_HACK -DHAVE_TIMEDLOCK"
fi
AC_MSG_RESULT([$have_mutex_timedlock])
AC_MSG_CHECKING([for sem_timedwait])
AC_TRY_LINK([
#include <semaphore.h>
#include <time.h>
],[
sem_t sem;
struct timespec tout;
sem_timedwait(&sem,&tout);
],
have_sem_timedwait="yes",
have_sem_timedwait="no"
)
if [[ "$have_sem_timedwait" = "yes" ]]; then
MUTEX_HACK="$MUTEX_HACK -DHAVE_TIMEDWAIT"
fi
AC_MSG_RESULT([$have_sem_timedwait])
CFLAGS="$SAVE_CFLAGS"
LIBS="$SAVE_LIBS"
AC_LANG_RESTORE
AC_SUBST(MUTEX_HACK)
NETDB_FLAGS=""
AC_CHECK_FUNC([inet_ntop],[NETDB_FLAGS="$NETDB_FLAGS -DHAVE_NTOP"])
AC_CHECK_FUNC([inet_pton],[NETDB_FLAGS="$NETDB_FLAGS -DHAVE_PTON"])
AC_CHECK_FUNC([gethostbyname_r],[NETDB_FLAGS="$NETDB_FLAGS -DHAVE_GHBN_R"])
AC_CHECK_FUNC([gethostbyname2_r],[NETDB_FLAGS="$NETDB_FLAGS -DHAVE_GHBN2_R"])
AC_CHECK_FUNC([gethostbyname2],[NETDB_FLAGS="$NETDB_FLAGS -DHAVE_GHBN2"])
AC_SUBST(NETDB_FLAGS)
THREAD_KILL=""
AC_MSG_CHECKING([for pthread_kill_other_threads_np declaration])
AC_LANG_SAVE
AC_LANG_C
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Werror"
AC_TRY_COMPILE([
#include <unistd.h>
#include <pthread.h>
],[
pthread_kill_other_threads_np();
],
have_pthread_kill="yes",
have_pthread_kill="no"
)
CFLAGS="$SAVE_CFLAGS"
AC_LANG_RESTORE
if [[ "$have_pthread_kill" = "yes" ]]; then
THREAD_KILL="-DTHREAD_KILL"
fi
AC_MSG_RESULT([$have_pthread_kill])
AC_SUBST(THREAD_KILL)
THREAD_AFFINITY=""
AC_MSG_CHECKING([for pthread_setaffinity_np declaration])
AC_LANG_SAVE
AC_LANG_C
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Werror"
AC_TRY_COMPILE([
#define _GNU_SOURCE
#include <pthread.h>
],[
cpu_set_t cpuset;
pthread_setaffinity_np(pthread_self(),sizeof(cpuset),&cpuset);
],
have_pthread_affinity="yes",
have_pthread_affinity="no"
)
AC_MSG_RESULT([$have_pthread_affinity])
if [[ "x$have_pthread_affinity" = "xyes" ]]; then
THREAD_AFFINITY="-DTHREAD_AFFINITY"
else
AC_MSG_CHECKING([for sched_setaffinity declaration])
AC_TRY_COMPILE([
#define _GNU_SOURCE
#include <sched.h>
],[
cpu_set_t cpuset;
sched_setaffinity(0,sizeof(cpuset),&cpuset);
],
have_sched_affinity="yes",
have_sched_affinity="no"
)
if [[ "x$have_sched_affinity" = "xyes" ]]; then
THREAD_AFFINITY="-DSCHED_AFFINITY"
fi
AC_MSG_RESULT([$have_sched_affinity])
fi
CFLAGS="$SAVE_CFLAGS"
AC_LANG_RESTORE
AC_SUBST(THREAD_AFFINITY)
# Check for compile options
INLINE_FLAGS=""
AC_ARG_ENABLE(inline,AC_HELP_STRING([--enable-inline],[Enable inlining of functions]),want_inline=$enableval,want_inline=auto)
AC_MSG_CHECKING([whether to use inline functions])
case "x$want_inline" in
xyes)
INLINE_FLAGS="-finline -Winline"
;;
xno)
INLINE_FLAGS="-fno-inline"
;;
xauto)
;;
*)
AC_ERROR([Invalid argument passed to --enable-inline])
;;
esac
AC_MSG_RESULT([$want_inline])
AC_SUBST(INLINE_FLAGS)
# Check for atomic integer operations
ATOMIC_OPS=""
AC_ARG_ENABLE(atomics,AC_HELP_STRING([--enable-atomics],[Enable atomic integer operations (default: yes)]),want_atomics=$enableval,want_atomics=yes)
if [[ "x$want_atomics" != "xno" ]]; then
AC_MSG_CHECKING([whether to use atomic integer operations])
AC_LANG_SAVE
AC_LANG_C
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Werror"
AC_TRY_LINK([],[
int i = 0;
int j = __sync_add_and_fetch(&i,1);
return __sync_fetch_and_sub(&j,1);
],
ATOMIC_OPS="-DATOMIC_OPS",
want_atomics="no (missing -march ?)"
)
CFLAGS="$SAVE_CFLAGS"
AC_LANG_RESTORE
AC_MSG_RESULT([$want_atomics])
fi
AC_SUBST(ATOMIC_OPS)
# Check for sse2 operations
SSE2_OPS=no
AC_ARG_ENABLE(sse2,AC_HELP_STRING([--enable-sse2],[Enable sse2 operations (default: no)]),want_sse2=$enableval,want_sse2=no)
AC_MSG_CHECKING([whether to use sse2 operations])
if [[ "x$want_sse2" != "xno" ]]; then
AC_LANG_SAVE
AC_LANG_C
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Werror -msse2"
AC_TRY_LINK([#include <stdint.h>
#include <math.h>
#include<emmintrin.h>
],[
float ef[2][2];
const __m128 k1e_10f = _mm_set1_ps(1e-10f);
_mm_storeu_ps(&ef[0][0], k1e_10f);
return (int) ef[0][0];
],
SSE2_OPS="yes",
want_sse2="no (missing -march ?)"
)
CFLAGS="$SAVE_CFLAGS"
AC_LANG_RESTORE
fi
AC_MSG_RESULT([$want_sse2])
AC_SUBST(SSE2_OPS)
FDSIZE_HACK=""
AC_ARG_WITH(fdsize,AC_HELP_STRING([--with-fdsize=NNNN],[set FD_SIZE to NNNN (default 8192)]),[ac_cv_use_fdsize=$withval],[ac_cv_use_fdsize=8192])
if [[ "x$ac_cv_use_fdsize" != "xno" ]]; then
FDSIZE_HACK="-DFDSIZE_HACK=$ac_cv_use_fdsize"
AC_LANG_SAVE
AC_LANG_C
AC_TRY_COMPILE([#include <features.h>
#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
#include <bits/types.h>
#else
#error FD_SETSIZE cannot be set
#endif],[if (__FD_SETSIZE>10) return 0;],[],[FDSIZE_HACK=""])
AC_LANG_RESTORE
if [[ "x$FDSIZE_HACK" = "x" -a "x$HAVE_POLL" != "xyes" ]]; then
AC_ERROR([Cannot set FD_SETSIZE on this platform, use --without-fdsize])
fi
fi
if [[ "x$HAVE_POLL" = "xyes" ]]; then
FDSIZE_HACK="-DHAVE_POLL $FDSIZE_HACK"
fi
AC_SUBST(FDSIZE_HACK)
HAVE_SCTP=no
HAVE_SCTP_NETINET=no
SCTP_FLAGS=""
AC_ARG_ENABLE(sctp,AC_HELP_STRING([--enable-sctp],[Enable SCTP sockets (default: yes)]),want_sctp=$enableval,want_sctp=yes)
if [[ "x$want_sctp" = "xyes" ]]; then
AC_LANG_SAVE
AC_LANG_C
AC_MSG_CHECKING([for basic SCTP support])
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>],[int fd = socket(PF_INET,SOCK_SEQPACKET,IPPROTO_SCTP);],[HAVE_SCTP=yes])
AC_MSG_RESULT([$HAVE_SCTP])
AC_MSG_CHECKING([for netinet/sctp.h usability])
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/sctp.h>],[sctp_assoc_t assoc; int fd = socket(PF_INET,SOCK_SEQPACKET,IPPROTO_SCTP); assoc = 1;],[HAVE_SCTP_NETINET=yes])
AC_MSG_RESULT([$HAVE_SCTP_NETINET])
if [[ "x$HAVE_SCTP_NETINET" != "xno" ]]; then
# including netinet/sctp.h fixes SCTP support so enable it
HAVE_SCTP=yes
SCTP_FLAGS="-DHAVE_SCTP -DHAVE_SCTP_NETINET"
sctp_connectx_new=no
AC_MSG_CHECKING([whether sctp_connectx has 4 arguments])
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/sctp.h>],[sctp_connectx(0,0,0,0);],[sctp_connectx_new=yes])
AC_MSG_RESULT([$sctp_connectx_new])
if [[ "x$sctp_connectx_new" = "xyes" ]]; then
SCTP_FLAGS="$SCTP_FLAGS -DHAVE_SCTP_CONNECTX_4"
fi
sctp_setadaptation=no
AC_MSG_CHECKING([whether sctp_setadaptation struct is present])
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/sctp.h>],[struct sctp_setadaptation sctp_adapt;],[sctp_setadaptation=yes])
AC_MSG_RESULT([$sctp_setadaptation])
if [[ "x$sctp_setadaptation" = "xyes" ]]; then
SCTP_FLAGS="$SCTP_FLAGS -DHAVE_SETADAPTATION_STRUCT"
fi
sctp_sack_info=no
AC_MSG_CHECKING([whether sctp_sack_info struct is present])
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/sctp.h>],[struct sctp_sack_info assoc_value;],[sctp_sack_info=yes])
AC_MSG_RESULT([$sctp_sack_info])
if [[ "x$sctp_sack_info" = "xyes" ]]; then
SCTP_FLAGS="$SCTP_FLAGS -DHAVE_SACK_INFO_STRUCT"
else
sctp_assoc_value=no
AC_MSG_CHECKING([whether sctp_assoc_value struct is present])
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/sctp.h>],[struct sctp_assoc_value assoc_value;],[sctp_assoc_value=yes])
AC_MSG_RESULT([$sctp_assoc_value])
if [[ "x$sctp_assoc_value" = "xyes" ]]; then
SCTP_FLAGS="$SCTP_FLAGS -DHAVE_ASSOC_VALUE_STRUCT"
fi
fi
# Check for SCTP_UNCONFIRMED enum value presence
# Added in lksctp-tools 1.0.7
sctp_have_unconfirmed=no
AC_MSG_CHECKING([whether SCTP_UNCONFIRMED is present])
AC_TRY_COMPILE([#include <netinet/sctp.h>],[int val = SCTP_UNCONFIRMED;],[sctp_have_unconfirmed=yes])
AC_MSG_RESULT([$sctp_have_unconfirmed])
if [[ "x$sctp_have_unconfirmed" = "xyes" ]]; then
SCTP_FLAGS="$SCTP_FLAGS -DHAVE_SCTP_UNCONFIRMED"
fi
# Check for SCTP_PF enum value presence
sctp_have_pf=no
AC_MSG_CHECKING([whether SCTP_PF is present])
AC_TRY_COMPILE([#include <netinet/sctp.h>],[int val = SCTP_PF;],[sctp_have_pf=yes])
AC_MSG_RESULT([$sctp_have_unconfirmed])
if [[ "x$sctp_have_pf" = "xyes" ]]; then
SCTP_FLAGS="$SCTP_FLAGS -DHAVE_SCTP_PF"
fi
else
if [[ "x$HAVE_SCTP" != "xno" ]]; then
SCTP_FLAGS="-DHAVE_SCTP"
fi
fi
AC_LANG_RESTORE
fi
AC_SUBST(HAVE_SCTP)
AC_SUBST(HAVE_SCTP_NETINET)
AC_SUBST(SCTP_FLAGS)
# Checks for optional libraries.
HAVE_RESOLV=no
RESOLV_INC="-DNO_RESOLV"
RESOLV_LIB=""
AC_ARG_ENABLE(resolver,AC_HELP_STRING([--enable-resolver],[Use resolver if available (default: yes)]),want_resolver=$enableval,want_resolver=yes)
if [[ "x$want_resolver" = "xyes" ]]; then
AC_MSG_CHECKING([for resolver library])
AC_LANG_SAVE
AC_LANG_C
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Werror $GCC_UNRESOLVED_SYMBOLS"
SAVE_LIBS="$LIBS"
AC_TRY_LINK([#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>],[res_init();],[HAVE_RESOLV=yes])
if [[ "x$HAVE_RESOLV" = "xno" ]]; then
LIBS="$LIBS -lresolv"
AC_TRY_LINK([#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>],[res_init();],
[HAVE_RESOLV=yes RESOLV_LIB=-lresolv])
fi
LIBS="$SAVE_LIBS"
if [[ "x$HAVE_RESOLV" != "xno" -a "x$RESOLV_LIB" = "x" ]]; then
AC_TRY_LINK([#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>],[unsigned char x[2]; res_query("",0,0,x,0);],[],[RESOLV_LIB=-lresolv])
fi
CFLAGS="$SAVE_CFLAGS"
AC_LANG_RESTORE
AC_MSG_RESULT([$HAVE_RESOLV $RESOLV_LIB])
if [[ "x$HAVE_RESOLV" = "xyes" ]]; then
RESOLV_INC="-DNO_DN_SKIPNAME"
HAVE_DN_SKIPNAME="no"
AC_MSG_CHECKING([for dn_skipname])
AC_LANG_SAVE
AC_LANG_C
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Werror $GCC_UNRESOLVED_SYMBOLS"
SAVE_LIBS="$LIBS"
LIBS="$LIBS $RESOLV_LIB"
AC_TRY_LINK([#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>],[unsigned char*p=0; dn_skipname(p,p);],
[HAVE_DN_SKIPNAME=yes RESOLV_INC=""])
LIBS="$SAVE_LIBS"
CFLAGS="$SAVE_CFLAGS"
AC_LANG_RESTORE
AC_MSG_RESULT([$HAVE_DN_SKIPNAME])
fi
fi
AC_SUBST(HAVE_RESOLV)
AC_SUBST(RESOLV_INC)
AC_SUBST(RESOLV_LIB)
INTERNAL_REGEX=yes
AC_ARG_ENABLE(internalregex,AC_HELP_STRING([--enable-internalregex],[Use internal regexp library (default: not on Linux)]),want_internalregex=$enableval,want_internalregex=auto)
AC_MSG_CHECKING([whether to use the internal regexp library])
case "x$want_internalregex" in
xno|xdisable|xnot)
INTERNAL_REGEX=no
;;
xyes|xenable)
;;
xauto)
if [[ "x$uname_os" = "xLinux" ]]; then
INTERNAL_REGEX=no
fi
;;
*)
AC_ERROR([Invalid argument passed to --enable-internalregex])
;;
esac
AC_MSG_RESULT([$INTERNAL_REGEX])
if [[ "x$INTERNAL_REGEX" != "xyes" ]]; then
AC_CHECK_FUNCS([regcomp], , [INTERNAL_REGEX=yes])
fi
AC_SUBST(INTERNAL_REGEX)
# check for Mac OS X Support
MACOSX_INC=""
HAVE_MACOSX_SUPPORT=no
OBJCFLAGS=""
if [[ "x$uname_os" = "xDarwin" ]]; then
save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -x objective-c++"
AC_MSG_CHECKING([for Mac OS X Objective-C support])
AC_TRY_COMPILE([#import <Foundation/Foundation.h>],
[
[NSFileManager defaultManager]
],
[
HAVE_MACOSX_SUPPORT="yes"
OBJCFLAGS="-x objective-c++"
MACOSX_INC="-DHAVE_MACOSX_SUPPORT"],[]
)
AC_MSG_RESULT([$HAVE_MACOSX_SUPPORT])
CPPFLAGS=$save_CPPFLAGS
fi
AC_SUBST(MACOSX_INC)
AC_SUBST(HAVE_MACOSX_SUPPORT)
AC_SUBST(OBJCFLAGS)
HAVE_PGSQL=no
PGSQL_INC=""
PGSQL_LIB=""
AC_ARG_WITH(libpq,AC_HELP_STRING([--with-libpq=DIR],[use Postgress SQL from DIR (default /usr)]),[ac_cv_use_libpq=$withval],[ac_cv_use_libpq=/usr])
if [[ "x$ac_cv_use_libpq" != "xno" ]]; then
AC_MSG_CHECKING([for Postgress SQL in $ac_cv_use_libpq])
local_lib="$ARCHLIB"
libpq="$ac_cv_use_libpq/$local_lib/libpq.so"
if [[ "x$local_lib" != "xlib" -a ! -f "$libpq" ]]; then
local_lib="lib"
libpq="$ac_cv_use_libpq/$local_lib/libpq.so"
fi
if [[ "x$ac_cv_use_libpq" != "x/usr" ]]; then
PGSQL_LIB="-L$ac_cv_use_libpq/$local_lib -lpq"
else
PGSQL_LIB="-lpq"
fi
for i in include include/pgsql pgsql/include include/postgresql; do
incpq="$ac_cv_use_libpq/$i"
test -f "$incpq/libpq-fe.h" && break
done
if [[ ! -f "$incpq/libpq-fe.h" ]]; then
incpq="$incpq/pgsql"
fi
if [[ -f "$incpq/libpq-fe.h" ]]; then
if [[ -f "$libpq" ]]; then
HAVE_PGSQL=yes
else
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -I$incpq"
SAVE_LIBS="$LIBS"
LIBS="$LIBS -lpq"
AC_TRY_LINK([#include <libpq-fe.h>],[PQconnectStart("");],[HAVE_PGSQL=yes])
LIBS="$SAVE_LIBS"
CFLAGS="$SAVE_CFLAGS"
fi
if [[ "x$HAVE_PGSQL" = "xyes" ]]; then
PGSQL_INC="-I$incpq"
fi
fi
AC_MSG_RESULT([$HAVE_PGSQL])
fi
AC_SUBST(HAVE_PGSQL)
AC_SUBST(PGSQL_INC)
AC_SUBST(PGSQL_LIB)
HAVE_MYSQL=no
MYSQL_INC=""
MYSQL_LIB=""
MYSQL_VER=""
AC_ARG_WITH(mysql,AC_HELP_STRING([--with-mysql=DIR],[use MySQL client library from DIR]),[ac_cv_use_mysql=$withval],[ac_cv_use_mysql=yes])
if [[ "x$ac_cv_use_mysql" != "xno" ]]; then
if [[ "x$ac_cv_use_mysql" = "xyes" ]]; then
AC_MSG_CHECKING([for MySQL using mysql_config])
MYSQL_INC=`(mysql_config --include) 2>/dev/null`
MYSQL_LIB=`(mysql_config --libs_r) 2>/dev/null`
MYSQL_VER=`(mysql_config --version) 2>/dev/null`
if [[ x`echo "$MYSQL_INC $MYSQL_LIB $MYSQL_VER" | wc -l | sed 's/^ *//g'` != "x1" ]]; then
MYSQL_INC=""
fi
if [[ ! -f `echo "$MYSQL_INC" | sed -n 's,^-I\([^ ]\+\)\( .*\)\?$,\1/mysql.h,p'` ]]; then
MYSQL_INC=""
fi
if [[ "x$MYSQL_INC" != "x" -a "x$MYSQL_LIB" != "x" -a "x$MYSQL_VER" != "x" ]]; then
HAVE_MYSQL=yes
else
MYSQL_INC=""
MYSQL_LIB=""
MYSQL_VER=""
fi
else
AC_MSG_CHECKING([for MySQL in $ac_cv_use_mysql])
local_lib="$ARCHLIB"
if [[ "x$local_lib" != "xlib" -a ! -d "$ac_cv_use_mysql/$local_lib/mysql" ]]; then
local_lib="lib"
fi
if [[ -f "$ac_cv_use_mysql/include/mysql/mysql.h" -a -d "$ac_cv_use_mysql/$local_lib/mysql" ]]; then
MYSQL_INC="-I$ac_cv_use_mysql/include/mysql"
MYSQL_LIB="-L$ac_cv_use_mysql/$local_lib/mysql -lmysqlclient_r -lpthread -lz -lcrypt -lnsl -lm"
MYSQL_VER=`sed -n 's/^.*MYSQL_SERVER_VERSION[[^"]]*"\([[^"]]*\).*$/\1/p' "$ac_cv_use_mysql/include/mysql/mysql_version.h"`
HAVE_MYSQL=yes
fi
fi
AC_MSG_RESULT([$HAVE_MYSQL $MYSQL_VER])
if test "$HAVE_MYSQL" = "yes"; then
save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $MYSQL_INC"
AC_CHECK_DECLS([MYSQL_OPT_RECONNECT],[MYSQL_INC="$MYSQL_INC -DMYSQL_OPT_RECONNECT=MYSQL_OPT_RECONNECT"],,[#include<mysql.h>])
AC_CHECK_DECLS([MYSQL_OPT_READ_TIMEOUT],[MYSQL_INC="$MYSQL_INC -DMYSQL_OPT_READ_TIMEOUT=MYSQL_OPT_READ_TIMEOUT"],,[#include<mysql.h>])
AC_CHECK_DECLS([MYSQL_OPT_WRITE_TIMEOUT],[MYSQL_INC="$MYSQL_INC -DMYSQL_OPT_WRITE_TIMEOUT=MYSQL_OPT_WRITE_TIMEOUT"],,[#include<mysql.h>])
AC_CHECK_DECLS([mysql_set_character_set],[MYSQL_INC="$MYSQL_INC -DHAVE_MYSQL_SET_CHARSET"],,[#include<mysql.h>])
CPPFLAGS=$save_CPPFLAGS
fi
fi
AC_SUBST(HAVE_MYSQL)
AC_SUBST(MYSQL_INC)
AC_SUBST(MYSQL_LIB)
AC_SUBST(MYSQL_VER)
HAVE_SQLITE=no
SQLITE_INC=""
SQLITE_LIB=""
AC_ARG_WITH(sqlite,AC_HELP_STRING([--with-sqlite=DIR],[use SQLite library from DIR]),[ac_cv_use_sqlite=$withval],[ac_cv_use_sqlite=yes])
if [[ "x$ac_cv_use_sqlite" != "xno" ]]; then
if [[ "x$ac_cv_use_sqlite" = "xyes" ]]; then
AC_MSG_CHECKING([for SQLite using pkg-config])
SQLITE_INC=`(pkg-config --cflags sqlite3) 2>/dev/null`
SQLITE_LIB=`(pkg-config --libs sqlite3) 2>/dev/null`
if [[ "x$SQLITE_INC$SQLITE_LIB" = "x" ]]; then
SQLITE_INC=""
SQLITE_LIB=""
else
HAVE_SQLITE=yes
fi
else
AC_MSG_CHECKING([for SQLite in $ac_cv_use_sqlite])
if [[ -f "$ac_cv_use_sqlite/sqlite3.h" ]]; then
SQLITE_INC="-I$ac_cv_use_sqlite"
SQLITE_LIB="-lsqlite3"
HAVE_SQLITE=yes
fi
fi
AC_MSG_RESULT([$HAVE_SQLITE])
fi
AC_SUBST(HAVE_SQLITE)
AC_SUBST(SQLITE_INC)
AC_SUBST(SQLITE_LIB)
HAVE_ZAP=no
ZAP_FLAGS=""
AC_ARG_ENABLE(dahdi,AC_HELP_STRING([--enable-dahdi],[Enable Dahdi driver (default: yes)]),want_dahdi=$enableval,want_dahdi=yes)
if [[ "x$want_dahdi" = "xyes" ]]; then
AC_MSG_CHECKING([for Dahdi generic headers])
AC_TRY_COMPILE([
#include <dahdi/user.h>
],[],
HAVE_ZAP="yes"
)
AC_MSG_RESULT([$HAVE_ZAP])
if [[ "x$HAVE_ZAP" = "xno" ]]; then
AC_ARG_ENABLE(zaptel,AC_HELP_STRING([--enable-zaptel],[Enable Zaptel driver (default: yes)]),want_zaptel=$enableval,want_zaptel=yes)
if [[ "x$want_zaptel" = "xyes" ]]; then
AC_MSG_CHECKING([for Zaptel generic headers])
AC_TRY_COMPILE([
#include <zaptel/zaptel.h>
#include <sys/ioctl.h>
],[ioctl(0,ZT_GETVERSION,(void*)0)],
HAVE_ZAP="yes"
ZAP_FLAGS="-DNEW_ZAPTEL_LOCATION -DHAVE_ZAP"
)
AC_MSG_RESULT([$HAVE_ZAP])
if [[ "x$HAVE_ZAP" = "xno" ]]; then
AC_MSG_CHECKING([for Zaptel linux headers])
AC_TRY_COMPILE([
#include <linux/zaptel.h>
#include <sys/ioctl.h>
],[ioctl(0,ZT_GETVERSION,(void*)0)],
HAVE_ZAP="yes"
ZAP_FLAGS="-DHAVE_ZAP"
)
AC_MSG_RESULT([$HAVE_ZAP])
fi
fi
fi
fi
AC_SUBST(HAVE_ZAP)
AC_SUBST(ZAP_FLAGS)
AC_ARG_ENABLE(wpcard,AC_HELP_STRING([--enable-wpcard],[Enable Wanpipe card driver (default: yes)]),BUILD_WPCARD=$enableval,BUILD_WPCARD=yes)
AC_ARG_ENABLE(tdmcard,AC_HELP_STRING([--enable-tdmcard],[Enable TDMV API card driver (default: yes)]),BUILD_TDMCARD=$enableval,BUILD_TDMCARD=yes)
AC_SUBST(BUILD_WPCARD)
AC_SUBST(BUILD_TDMCARD)
HAVE_WANPIPE=no
WANPIPE_FLAGS=""
AC_ARG_ENABLE(wanpipe,AC_HELP_STRING([--enable-wanpipe],[Enable Wanpipe support (default: yes)]),want_wanpipe=$enableval,want_wanpipe=yes)
if [[ "x$want_wanpipe" = "xyes" ]]; then
AC_MSG_CHECKING([for Wanpipe new generic headers])
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -I/usr/include/wanpipe"
AC_TRY_COMPILE([
#define __LINUX__
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <if_wanpipe.h>
#include <wanpipe_defines.h>
#include <wanpipe_cfg.h>
#include <wanpipe.h>
#include <aft_core.h>
],[],
HAVE_WANPIPE="yes"
)
CFLAGS="$SAVE_CFLAGS"
AC_MSG_RESULT([$HAVE_WANPIPE])
if [[ "x$HAVE_WANPIPE" = "xyes" ]]; then
WANPIPE_FLAGS="-DNEW_WANPIPE_API"
else
AC_MSG_CHECKING([for Wanpipe old generic headers])
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -I/usr/include/wanpipe"
AC_TRY_COMPILE([
#define __LINUX__
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <if_wanpipe.h>
#include <wanpipe_defines.h>
#include <wanpipe_cfg.h>
#include <wanpipe.h>
#include <sdla_aft_te1.h>
],[],
HAVE_WANPIPE="yes"
)
CFLAGS="$SAVE_CFLAGS"
AC_MSG_RESULT([$HAVE_WANPIPE])
fi
if [[ "x$HAVE_WANPIPE" = "xyes" ]]; then
WANPIPE_FLAGS="-DHAVE_WANPIPE_API -I/usr/include/wanpipe $WANPIPE_FLAGS"
else
AC_MSG_CHECKING([for Wanpipe linux headers])
AC_TRY_COMPILE([
#define __LINUX__
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <linux/if_wanpipe.h>
#include <linux/if.h>
#include <linux/wanpipe_defines.h>
#include <linux/wanpipe_cfg.h>
#include <linux/wanpipe.h>
#include <linux/sdla_aft_te1.h>
],[],
HAVE_WANPIPE="yes"
)
AC_MSG_RESULT([$HAVE_WANPIPE])
fi
fi
AC_SUBST(HAVE_WANPIPE)
HAVE_WANPIPE_TDM="no"
if [[ "x$HAVE_WANPIPE" = "xyes" ]]; then
AC_MSG_CHECKING([for Wanpipe TDM])
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -I/usr/include/wanpipe"
AC_TRY_COMPILE([
#define __LINUX__
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <wanpipe.h>
],[wanpipe_api_t tdm;],
HAVE_WANPIPE_TDM="yes"
)
CFLAGS="$SAVE_CFLAGS"
AC_MSG_RESULT([$HAVE_WANPIPE_TDM])
fi
AC_SUBST(HAVE_WANPIPE_TDM)
AC_ARG_WITH(wphwec,AC_HELP_STRING([--with-wphwec=DIR],[use Wanpipe/Octasic headers from DIR]),[ac_cv_use_wphwec=$withval],[ac_cv_use_wphwec=/usr/include/wanpipe])
if [[ "x$HAVE_WANPIPE" = "xyes" ]]; then
if [[ "x$ac_cv_use_wphwec" != "xno" ]]; then
AC_MSG_CHECKING([for Wanpipe/Octasic headers])
if [[ -f "$ac_cv_use_wphwec/wanec_iface.h" -a -f "$ac_cv_use_wphwec/oct6100_api/oct6100api/oct6100_api.h" ]]; then
WANPIPE_FLAGS="-DHAVE_WANPIPE_HWEC -I$ac_cv_use_wphwec/oct6100_api $WANPIPE_FLAGS"
if [[ -f "$ac_cv_use_wphwec/wanec_iface_api.h" ]]; then
WANPIPE_FLAGS="-DHAVE_WANPIPE_HWEC_API $WANPIPE_FLAGS"
fi
ac_cv_use_wphwec=yes
else
ac_cv_use_wphwec=no
fi
AC_MSG_RESULT([$ac_cv_use_wphwec])
fi
fi
AC_SUBST(WANPIPE_FLAGS)
HAVE_SOUNDCARD=no
AC_MSG_CHECKING([for sound card headers])
AC_TRY_COMPILE([
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <string.h>
#include <fcntl.h>
#if defined(__linux__)
#include <linux/soundcard.h>
#elif defined (__FreeBSD__)
#include <sys/soundcard.h>
#else
#include <soundcard.h>
#endif
],[],
HAVE_SOUNDCARD="yes"
)
AC_MSG_RESULT([$HAVE_SOUNDCARD])
AC_SUBST(HAVE_SOUNDCARD)
HAVE_ALSA=no
AC_MSG_CHECKING([for ALSA headers])
AC_TRY_COMPILE([
#if defined(__linux__)
#include <linux/soundcard.h>
#elif defined (__FreeBSD__)
#include <sys/soundcard.h>
#else
#include <soundcard.h>
#endif
#define ALSA_PCM_NEW_HW_PARAMS_API
#include <alsa/asoundlib.h>
],[],
HAVE_ALSA="yes"
)
AC_MSG_RESULT([$HAVE_ALSA])
AC_SUBST(HAVE_ALSA)
# check for Mac OS X audio headers
HAVE_COREAUDIO=no