-
Notifications
You must be signed in to change notification settings - Fork 181
/
configure.in
1562 lines (1411 loc) · 50.3 KB
/
configure.in
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
nl source: configure.in
dnl Copyright Gerhard Rieger 2001-2009
dnl Published under the GNU General Public License V.2, see file COPYING
dnl Process this file with autoconf to produce a configure script.
AC_INIT(socat.c)
AC_CONFIG_HEADER(config.h)
if test -f /usr/xpg4/bin/fgrep; then
FGREP=/usr/xpg4/bin/fgrep # Solaris
else
FGREP=fgrep
fi
# find out which defines gcc passes to cpp, so makedepend does not run into
# (harmless) "error architecture not supported"
AC_MSG_CHECKING(which defines needed for makedepend)
__cpp_defs=`gcc -v -E - </dev/null 2>&1 |$FGREP -e '/cpp ' -e '/cc1 '`
SYSDEFS=`aa=; for a in $__cpp_defs
do case "$a" in -D*) aa="$aa $a";; esac; done; echo "$aa"`
AC_SUBST(SYSDEFS)
AC_MSG_RESULT($SYSDEFS)
# this must come before AC_PROG_CC
if test -z "$CFLAGS"; then
# if CFLAGS is not set, we preset it to -O
# with this setting, we prevent autoconf from defaulting to "-g -O2"
export CFLAGS=-O
fi
dnl Checks for programs.
AC_PROG_INSTALL(install)
AC_PROG_CC
AC_PROG_RANLIB
AC_SUBST(AR)
AC_CHECK_PROG(AR, ar, ar, gar)
#
# we need to explicitely call this here; otherwise, with --disable-libwrap we
# fail
AC_LANG_COMPILER_REQUIRE()
if test "$GCC" = yes; then
CFLAGS="$CFLAGS -D_GNU_SOURCE -Wall -Wno-parentheses"
ERRONWARN="-Werror -O0"
else
# Sun Studio?
ERRONWARN="-errwarn"
fi
export CFLAGS
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/param.h sys/ioctl.h sys/time.h syslog.h unistd.h)
AC_CHECK_HEADERS(pwd.h grp.h stdint.h sys/types.h sys/poll.h sys/socket.h sys/uio.h sys/stat.h netdb.h sys/un.h)
AC_CHECK_HEADERS(pty.h)
AC_CHECK_HEADERS(netinet/in.h netinet/in_systm.h)
AC_CHECK_HEADERS(netinet/ip.h, [], [], [AC_INCLUDES_DEFAULT
#if HAVE_NETINET_IN_H && HAVE_NETINET_IN_SYSTM_H
#include <netinet/in.h>
#include <netinet/in_systm.h>
#endif]) # Solaris prerequisites for netinet/ip.h
AC_CHECK_HEADERS(netinet/tcp.h)
AC_CHECK_HEADERS(netinet6/in6.h) # found on OpenBSD, used for IPV6_*
AC_CHECK_HEADER(net/if.h, [], [], [AC_INCLUDES_DEFAULT
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif]) # Mac OS X requires including sys/socket.h
AC_CHECK_HEADERS(arpa/nameser.h)
AC_HEADER_RESOLV()
AC_CHECK_HEADERS(termios.h linux/if_tun.h)
AC_CHECK_HEADERS(net/if_dl.h)
AC_CHECK_HEADERS(linux/types.h linux/errqueue.h)
AC_CHECK_HEADERS(sys/utsname.h sys/select.h sys/file.h)
AC_CHECK_HEADERS(util.h libutil.h sys/stropts.h regex.h)
AC_CHECK_HEADERS(linux/fs.h linux/ext2_fs.h)
dnl Link libresolv if necessary (for Mac OS X)
AC_SEARCH_LIBS([res_9_init], [resolv])
dnl Check for extra socket library (for Solaris)
AC_CHECK_FUNC(hstrerror, , AC_CHECK_LIB(resolv, hstrerror, [LIBS="$LIBS -lresolv"; AC_DEFINE(HAVE_HSTRERROR)]))
AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
dnl Check for hstrerror prototype
AC_MSG_CHECKING(for hstrerror prototype)
AC_CACHE_VAL(sc_cv_have_prototype_hstrerror,
[CFLAGS1="$CFLAGS"; CFLAGS="$ERRONWARN $(echo "$CFLAGS1" | sed -e 's@-Wall@@g')";
AC_TRY_COMPILE([#include <netdb.h>],[hstrerror();],
[sc_cv_have_prototype_hstrerror=no],
[sc_cv_have_prototype_hstrerror=yes]);
CFLAGS="$CFLAGS1"])
if test $sc_cv_have_prototype_hstrerror = yes; then
AC_DEFINE(HAVE_PROTOTYPE_HSTRERROR)
fi
AC_MSG_RESULT($sc_cv_have_prototype_hstrerror)
AC_MSG_CHECKING(whether to include help)
AC_ARG_ENABLE(help, [ --disable-help disable help],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_HELP) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_HELP) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include STDIO support)
AC_ARG_ENABLE(stdio, [ --disable-stdio disable STDIO support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_STDIO) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_STDIO) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include FD-number support)
AC_ARG_ENABLE(fdnum, [ --disable-fdnum disable FD-number support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_FDNUM) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_FDNUM) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include direct file support)
AC_ARG_ENABLE(file, [ --disable-file disable direct file support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_FILE) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_FILE) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include direct create support)
AC_ARG_ENABLE(creat, [ --disable-creat disable direct create support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_CREAT) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_CREAT) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include gopen support)
AC_ARG_ENABLE(gopen, [ --disable-gopen disable open for UNIX socket support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_GOPEN) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_GOPEN) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include explicit pipe support)
AC_ARG_ENABLE(pipe, [ --disable-pipe disable pipe support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_PIPE) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_PIPE) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include explicit termios support)
AC_ARG_ENABLE(termios, [ --disable-termios disable termios support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_TERMIOS) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_TERMIOS) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include UNIX socket support)
AC_ARG_ENABLE(unix, [ --disable-unix disable UNIX domain socket support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_UNIX) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_UNIX) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include abstract UNIX socket support)
AC_ARG_ENABLE(abstract_unixsocket, [ --disable-abstract-unixsocket disable abstract UNIX domain socket support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_ABSTRACT_UNIXSOCKET) AC_MSG_RESULT(yes);;
esac],
[ case "`uname`" in
Linux)
AC_DEFINE(WITH_ABSTRACT_UNIXSOCKET) AC_MSG_RESULT(yes);;
*)
AC_MSG_RESULT(no);;
esac])
AC_MSG_CHECKING(whether to include IPv4 support)
AC_ARG_ENABLE(ip4, [ --disable-ip4 disable IPv4 support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_IP4) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_IP4) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include IPv6 support)
AC_ARG_ENABLE(ip6, [ --disable-ip6 disable IPv6 support],
[case "$enableval" in
no) AC_MSG_RESULT(no); WITH_IP6= ;;
*) AC_MSG_RESULT(yes); WITH_IP6=1 ;;
esac],
[ AC_MSG_RESULT(yes); WITH_IP6=1 ])
if test "$WITH_IP6"; then
AC_CHECK_HEADERS([netinet/ip6.h],
[AC_DEFINE(HAVE_NETINET_IP6_H) AC_DEFINE(WITH_IP6)],
[AC_MSG_WARN([include file netinet/ip6.h not found, disabling IP6])],
[AC_INCLUDES_DEFAULT
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif])
fi
AC_MSG_CHECKING(whether to include raw IP support)
AC_ARG_ENABLE(rawip, [ --disable-rawip disable raw IP support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_RAWIP) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_RAWIP) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include generic socket support)
AC_ARG_ENABLE(rawsocket, [ --disable-genericsocket disable generic socket support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_GENERICSOCKET) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_GENERICSOCKET) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include raw network interface support)
AC_ARG_ENABLE(interface, [ --disable-interface disable network interface support],
[case "$enableval" in
no) AC_MSG_RESULT(no); WITH_INTERFACE= ;;
*) AC_MSG_RESULT(yes); WITH_INTERFACE=1 ;;
esac],
[AC_MSG_RESULT(yes); WITH_INTERFACE=1 ])
if test "$WITH_INTERFACE"; then
AC_CHECK_HEADER(netpacket/packet.h,
AC_DEFINE(HAVE_NETPACKET_PACKET_H),
[WITH_INTERFACE=;
AC_MSG_WARN([include file netpacket/packet.h not found, disabling interface])])
fi
if test "$WITH_INTERFACE"; then
AC_CHECK_HEADER(netinet/if_ether.h,
AC_DEFINE(HAVE_NETINET_IF_ETHER_H),
[WITH_INTERFACE=;
AC_MSG_WARN([include file netinet/if_ether.h not found, disabling interface])])
fi
if test "$WITH_INTERFACE"; then
AC_DEFINE(WITH_INTERFACE)
fi
AC_MSG_CHECKING(whether to include TCP support)
AC_ARG_ENABLE(tcp, [ --disable-tcp disable TCP support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_TCP) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_TCP) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include UDP support)
AC_ARG_ENABLE(udp, [ --disable-udp disable UDP support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_UDP) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_UDP) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include SCTP support)
AC_ARG_ENABLE(sctp, [ --disable-sctp disable SCTP support],
[case "$enableval" in
no) AC_MSG_RESULT(no); WITH_SCTP= ;;
*) AC_MSG_RESULT(yes); WITH_SCTP=1 ;;
esac],
[AC_MSG_RESULT(yes); WITH_SCTP=1 ])
if test -n "$WITH_SCTP"; then
AC_MSG_CHECKING(for IPPROTO_SCTP)
AC_CACHE_VAL(sc_cv_define_ipproto_sctp,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <netinet/in.h>],
[IPPROTO_SCTP;],
[sc_cv_define_ipproto_sctp=yes],
[sc_cv_define_ipproto_sctp=no])])
AC_MSG_RESULT($sc_cv_define_ipproto_sctp)
if test $sc_cv_define_ipproto_sctp = yes; then
AC_DEFINE(WITH_SCTP)
else
AC_MSG_WARN([IPPROTO_SCTP undefined, disabling SCTP support])
fi
fi
AC_MSG_CHECKING(whether to include listen support)
AC_ARG_ENABLE(listen, [ --disable-listen disable listen support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_LISTEN) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_LISTEN) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include socks4 support)
AC_ARG_ENABLE(socks4, [ --disable-socks4 disable socks4 support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_SOCKS4) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_SOCKS4) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include socks4a support)
AC_ARG_ENABLE(socks4a, [ --disable-socks4a disable socks4a support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_SOCKS4A) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_SOCKS4A) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include proxy connect support)
AC_ARG_ENABLE(proxy, [ --disable-proxy disable proxy connect support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_PROXY) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_PROXY) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include exec support)
AC_ARG_ENABLE(exec, [ --disable-exec disable exec support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_EXEC) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_EXEC) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING([whether to include system (shell) support])
AC_ARG_ENABLE(system, [ --disable-system disable system (shell) support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_SYSTEM) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_SYSTEM) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include pty address support)
AC_ARG_ENABLE(pty, [ --disable-pty disable pty support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_PTY) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_PTY) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include ext2 fs attributes support)
AC_ARG_ENABLE(ext2, [ --disable-ext2 disable ext2 fs attributes support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_EXT2) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_EXT2) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(whether to include readline support)
AC_ARG_ENABLE(readline, [ --disable-readline disable readline support],
[case "$enableval" in
no) AC_MSG_RESULT(no); WITH_READLINE= ;;
*) AC_MSG_RESULT(yes); WITH_READLINE=1 ;;
esac],
[AC_MSG_RESULT(yes); WITH_READLINE=1 ])
if test -n "$WITH_READLINE"; then
CPPFLAGS_ORIG=$CPPFLAGS
CFLAGS_ORIG=$CFLAGS
LIBS_ORIG=$LIBS
sc_usable_readline_found=
for D in "" "/usr/local" "/opt/local" "/sw" "/opt/freeware" "/usr/sfw"; do
if test -n "$D" ; then
CPPFLAGS="$CPPFLAGS -I$D/include"
CFLAGS="$CFLAGS -L$D/lib"
DLOC="in location $D"
else
DLOC="in default location"
fi
AC_MSG_CHECKING(for usable readline $DLOC)
# Some systems require -lcurses, some require -lncurses.
# Mac OS X 10.4 (and others) ships with libedit masquerading as readline,
# but it doesn't work well with socat. It can be recognized by the absence
# of append_history.
for L in "" "-lcurses" "-lncurses"; do
LIBS="$LIBS_ORIG -lreadline $L"
AC_TRY_LINK(
[ #include <stdio.h>
#include <readline/readline.h>
#include <readline/history.h>],
[ readline(NULL);
append_history(0, NULL); ],
[ sc_usable_readline_found=1
break ])
done
if test -n "$sc_usable_readline_found"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_READLINE_READLINE_H,1)
AC_DEFINE(HAVE_READLINE_HISTORY_H,1)
AC_DEFINE(HAVE_LIBREADLINE,1)
AC_DEFINE(WITH_READLINE,1)
break
else
AC_MSG_RESULT(no)
CPPFLAGS=$CPPFLAGS_ORIG
CFLAGS=$CFLAGS_ORIG
LIBS=$LIBS_ORIG
fi
done
if test -z "$sc_usable_readline_found"; then
AC_MSG_WARN([no suitable version of readline found; perhaps you need to install a newer version])
fi
fi
AC_MSG_CHECKING(whether to include openssl support)
AC_ARG_ENABLE(openssl, [ --disable-openssl disable OpenSSL support],
[ case "$enableval" in
no) AC_MSG_RESULT(no); WITH_OPENSSL= ;;
*) AC_MSG_RESULT(yes); WITH_OPENSSL=1 ;;
esac],
[ AC_MSG_RESULT(yes); WITH_OPENSSL=1 ])
#
if test -n "$WITH_OPENSSL"; then
AC_MSG_NOTICE(checking for components of OpenSSL)
# first, we need to find the include file <openssl/ssl.h>
AC_CACHE_VAL(sc_cv_have_openssl_ssl_h,
[AC_TRY_COMPILE([#include <openssl/ssl.h>],[;],
[sc_cv_have_openssl_ssl_h=yes; OPENSSL_ROOT=""; ],
[sc_cv_have_openssl_ssl_h=no
for D in "/sw" "/usr/local" "/opt/freeware" "/usr/sfw" "/usr/local/ssl"; do
I="$D/include"
i="$I/openssl/ssl.h"
if test -r "$i"; then
#V_INCL="$V_INCL -I$I"
CPPFLAGS="$CPPFLAGS -I$I"
AC_MSG_NOTICE(found $i)
sc_cv_have_openssl_ssl_h=yes; OPENSSL_ROOT="$D"
break;
fi
done])
])
if test "$sc_cv_have_openssl_ssl_h" = "yes"; then
AC_DEFINE(HAVE_OPENSSL_SSL_H)
fi
AC_MSG_NOTICE(checked for openssl/ssl.h... $sc_cv_have_openssl_ssl_h)
fi # end checking for openssl/ssl.h
#
if test -n "$WITH_OPENSSL" -a "$sc_cv_have_openssl_ssl_h" = 'yes'; then
# next, we search for the openssl library (libssl.*)
# interesting: Linux only requires -lssl, FreeBSD requires -lssl -lcrypto
# Note, version OpenSSL 0.9.7j requires -lcrypto even on Linux.
AC_MSG_CHECKING(for libssl)
AC_CACHE_VAL(sc_cv_have_libssl,
[ LIBS0="$LIBS"
if test -n "$OPENSSL_ROOT"; then
L="$OPENSSL_ROOT/lib"; LIBS="$LIBS -L$L -lssl"
else
LIBS="$LIBS -lssl"
fi
AC_TRY_LINK([#include <openssl/ssl.h>],
[SSL_library_init();ERR_error_string()],
[sc_cv_have_libssl='yes'],
[ LIBS="$LIBS -lcrypto"
AC_TRY_LINK([#include <openssl/ssl.h>],
[SSL_library_init()],
[sc_cv_have_libssl='yes'],
[sc_cv_have_libssl='no'])
])
if test "$sc_cv_have_libssl" != 'yes'; then
LIBS="$LIBS0"
fi
]
)
if test "$sc_cv_have_libssl" = 'yes'; then
AC_DEFINE(HAVE_LIBSSL)
fi
AC_MSG_RESULT($sc_cv_have_libssl)
fi
#
# # a possible location for openssl (on Sourceforge/Solaris)
# AC_CHECK_FILE(/usr/local/ssl/lib, LIBS="$LIBS -L/usr/local/ssl/lib/")
# # sometimes on Solaris:
# AC_CHECK_FILE(/pkgs/lib, LIBS="$LIBS -L/pkgs/lib/")
# # for AIX 5.1 with Linux toolbox:
# AC_CHECK_FILE(/opt/freeware/lib, LIBS="$LIBS -L/opt/freeware/lib/")
#
# AC_CHECK_LIB(crypto, main)
# AC_CHECK_LIB(ssl, main)
#
# # MacOSX has openssl includes in another directory
# if test -d /sw/include/; then
# V_INCL="$V_INCL -I/sw/include"
# # and Solaris at sourceforge here:
# elif test -d /usr/local/ssl/include/; then
# V_INCL="$V_INCL -I/usr/local/ssl/include"
# # and AIX 5.1 with Linux toolbox:
# elif test -d /opt/freeware/include; then
# V_INCL="$V_INCL -I/opt/freeware/include"
# fi
#fi
if test -n "$WITH_OPENSSL"; then
if test "$sc_cv_have_openssl_ssl_h" = "yes" -a "$sc_cv_have_libssl" = "yes"; then
AC_DEFINE(WITH_OPENSSL)
else
AC_MSG_WARN([not all components of OpenSSL found, disabling it]);
fi
fi
# check for fips support
AC_MSG_CHECKING(whether to include openssl fips support)
AC_ARG_ENABLE(fips, [ --disable-fips disable OpenSSL FIPS support],
[ case "$enableval" in
no) AC_MSG_RESULT(no); WITH_FIPS= ;;
*) AC_MSG_RESULT(yes); WITH_FIPS=1 ;;
esac],
[ AC_MSG_RESULT(yes); WITH_FIPS=1 ])
if test -n "$WITH_FIPS"; then
if test -n "$WITH_OPENSSL"; then
if test "$sc_cv_have_openssl_ssl_h" != "yes" -o "$sc_cv_have_libssl" != "yes"; then
AC_MSG_WARN([not all components of OpenSSL found, disabling FIPS]);
WITH_FIPS=
fi
else
AC_MSG_WARN([must enable OpenSSL to enable FIPS; use --enable-openssl]);
fi
fi
if test -n "$WITH_FIPS"; then
AC_MSG_NOTICE(checking for components of OpenSSL FIPS)
# first, we need to find the include file <openssl/fips.h>
AC_CACHE_VAL(sc_cv_have_openssl_fips_h,
[AC_TRY_COMPILE([#define OPENSSL_FIPS
#include <openssl/fips.h>],[;],
[sc_cv_have_openssl_fips_h=yes; ],
[sv_cv_have_openssl_fips_h=no
if test -n "$OPENSSL_ROOT"; then
I="$OPENSSL_ROOT/include"
i="$I/openssl/fips.h"
if test -r "$i"; then
AC_MSG_NOTICE(found $i)
sc_cv_have_openssl_fips_h=yes;
fi
fi
]
)]
)
if test "$sv_cv_have_openssl_fips_h" = "yes"; then
AC_DEFINE(HAVE_OPENSSL_FIPS_H)
fi
AC_MSG_NOTICE(checked for openssl/fips.h... $sc_cv_have_openssl_ssl_h)
fi
if test -n "$WITH_FIPS" -a "$sc_cv_have_openssl_fips_h" = 'yes'; then
# check for the libcrypto library with fips support
AC_MSG_CHECKING(for libcrypto with FIPS support)
AC_CACHE_VAL(sc_cv_have_libcrypto,
[ LIBS0="$LIBS"
echo $LIBS | grep -q "\-lcrypto"
if test $? -ne 0; then
if test -n "$OPENSSL_ROOT"; then
L="$OPENSSL_ROOT/lib"; LIBS="$LIBS -L$L -lcrypto"
else
LIBS="$LIBS -lcrypto"
fi
fi
AC_TRY_LINK([#define OPENSSL_FIPS
#include <openssl/ssl.h>
#include <openssl/fips.h>],
[int res = FIPS_mode_set(1);],
[sc_cv_have_libcrypto='yes'],
[sc_cv_have_libcrypto='no']
)
if test "$sc_cv_have_libcrypto" != 'yes'; then
LIBS="$LIBS0"
fi
]
)
if test "$sc_cv_have_libcrypto" = 'yes'; then
AC_DEFINE(HAVE_LIBCRYPTO)
fi
AC_MSG_RESULT($sc_cv_have_libcrypto)
fi
if test -n "$WITH_FIPS"; then
if test "$sc_cv_have_openssl_fips_h" = 'yes' -a "$sc_cv_have_libcrypto" = 'yes'; then
AC_DEFINE(WITH_FIPS)
AC_DEFINE(OPENSSL_FIPS)
else
AC_MSG_WARN([not all components of OpenSSL FIPS found, disabling it]);
fi
fi
AC_MSG_CHECKING(whether to include tun/tap address support)
AC_ARG_ENABLE(tun, [ --disable-tun disable TUN/TAP support],
[case "$enableval" in
no) AC_MSG_RESULT(no); WITH_TUN= ;;
*) AC_MSG_RESULT(yes); WITH_TUN=1 ;;
esac],
[AC_MSG_RESULT(yes); WITH_TUN=1 ])
#
if ! test "$ac_cv_header_linux_if_tun_h" = 'yes'; then
AC_MSG_WARN(include file linux/if_tun.h not found, disabling TUN)
WITH_TUN=
fi
#
if test -n "$WITH_TUN"; then
AC_DEFINE(WITH_TUN)
fi
AC_MSG_CHECKING(whether to include system call tracing)
AC_ARG_ENABLE(sycls, [ --disable-sycls disable system call tracing],
[case "$enableval" in
no) SYCLS=""; SSLCLS=""; AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_SYCLS)
SYCLS="sycls.c"; SSLCLS="sslcls.c"; AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_SYCLS)
SYCLS="sycls.c"; SSLCLS="sslcls.c"; AC_MSG_RESULT(yes)])
AC_SUBST(SYCLS)
AC_SUBST(SSLCLS)
AC_MSG_CHECKING(whether to include file descriptor analyzer)
AC_ARG_ENABLE(filan, [ --disable-filan disable file descriptor analyzer],
[case "$enableval" in
no) FILAN=""; AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_FILAN) FILAN="filan.c"; AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_FILAN) FILAN="filan.c"; AC_MSG_RESULT(yes)])
AC_SUBST(FILAN)
AC_MSG_CHECKING(whether to include retry support)
AC_ARG_ENABLE(retry, [ --disable-retry disable retry support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_RETRY) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_RETRY) AC_MSG_RESULT(yes)])
AC_MSG_CHECKING(included message level)
AC_ARG_ENABLE(msglevel, [ --enable-msglevel=N set max verbosity to debug,info,notice,warn,error,fatal],
[case "$enableval" in
debug) AC_DEFINE(WITH_MSGLEVEL,0) AC_MSG_RESULT(debug);;
info) AC_DEFINE(WITH_MSGLEVEL,1) AC_MSG_RESULT(info);;
notice) AC_DEFINE(WITH_MSGLEVEL,2) AC_MSG_RESULT(notice);;
warn) AC_DEFINE(WITH_MSGLEVEL,3) AC_MSG_RESULT(warn);;
error) AC_DEFINE(WITH_MSGLEVEL,4) AC_MSG_RESULT(error);;
fatal) AC_DEFINE(WITH_MSGLEVEL,5) AC_MSG_RESULT(fatal);;
*) AC_DEFINE(WITH_MSGLEVEL,0) AC_MSG_RESULT(debug);;
esac],
[AC_DEFINE(WITH_MSGLEVEL,0) AC_MSG_RESULT(debug)])
#AC_SUBST(V_INCL)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_ST_BLKSIZE
AC_STRUCT_ST_BLOCKS
AC_STRUCT_ST_RDEV
AC_HEADER_TIME
dnl Check for extra realtime library (for Solaris)
AC_CHECK_FUNC(nanosleep, AC_DEFINE(HAVE_NANOSLEEP), AC_CHECK_LIB(rt, nanosleep, [LIBS="-lrt $LIBS"; AC_DEFINE(HAVE_NANOSLEEP)]))
#AC_CHECK_FUNC(nanosleep, , AC_CHECK_LIB(rt, nanosleep))
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(putenv select poll socket strdup strerror strstr strtod strtol)
AC_CHECK_FUNCS(strtoul uname getpgid getsid getaddrinfo)
AC_CHECK_FUNCS(getipnodebyname setgroups inet_aton memrchr)
AC_CHECK_FUNCS(if_indextoname)
AC_CHECK_FUNCS(grantpt unlockpt ptsname)
AC_MSG_CHECKING(for long long)
AC_CACHE_VAL(sc_cv_type_longlong,
[AC_TRY_COMPILE([],[long long s;],
[sc_cv_type_longlong=yes],
[sc_cv_type_longlong=no])])
if test $sc_cv_type_longlong = yes; then
AC_DEFINE(HAVE_TYPE_LONGLONG)
fi
AC_MSG_RESULT($sc_cv_type_longlong)
# following builtin macro does not check unistd.h and sys/socket.h where
# socklen_t might be defined
#AC_CHECK_TYPE(socklen_t, int)
#
AC_MSG_CHECKING(for socklen_t)
AC_CACHE_VAL(sc_cv_type_socklen,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>],[socklen_t s;],
[sc_cv_type_socklen=yes],
[sc_cv_type_socklen=no])])
if test $sc_cv_type_socklen = yes; then
AC_DEFINE(HAVE_TYPE_SOCKLEN)
fi
AC_MSG_RESULT($sc_cv_type_socklen)
AC_MSG_CHECKING(for struct stat64)
AC_CACHE_VAL(sc_cv_type_stat64,
[AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 s;],
[sc_cv_type_stat64=yes],
[sc_cv_type_stat64=no])])
if test $sc_cv_type_stat64 = yes; then
AC_DEFINE(HAVE_TYPE_STAT64)
fi
AC_MSG_RESULT($sc_cv_type_stat64)
AC_MSG_CHECKING(for off64_t)
AC_CACHE_VAL(sc_cv_type_off64,
[AC_TRY_COMPILE([#include <unistd.h>],[off64_t s;],
[sc_cv_type_off64=yes],
[sc_cv_type_off64=no])])
if test $sc_cv_type_off64 = yes; then
AC_DEFINE(HAVE_TYPE_OFF64)
fi
AC_MSG_RESULT($sc_cv_type_off64)
AC_MSG_CHECKING(for sighandler_t)
AC_CACHE_VAL(sc_cv_type_sighandler,
[AC_TRY_COMPILE([#include <signal.h>],[sighandler_t s;],
[sc_cv_type_sighandler=yes],
[sc_cv_type_sighandler=no])])
if test $sc_cv_type_sighandler = yes; then
AC_DEFINE(HAVE_TYPE_SIGHANDLER)
fi
AC_MSG_RESULT($sc_cv_type_socklen)
AC_MSG_CHECKING(for uint8_t)
AC_CACHE_VAL(sc_cv_type_uint8,
[AC_TRY_COMPILE([#include <sys/types.h>
#if HAVE_STDINT_H
#include <stdint.h>
#endif
/* Tru64 has uint8_t etc from netdb.h */
#if HAVE_NETDB_H
#include <netdb.h>
#endif
#include <unistd.h>],[uint8_t s;],
[sc_cv_type_uint8=yes],
[sc_cv_type_uint8=no])])
if test $sc_cv_type_uint8 = yes; then
AC_DEFINE(HAVE_TYPE_UINT8)
fi
AC_MSG_RESULT($sc_cv_type_uint8)
AC_MSG_CHECKING(for uint16_t)
AC_CACHE_VAL(sc_cv_type_uint16,
[AC_TRY_COMPILE([#include <sys/types.h>
#if HAVE_STDINT_H
#include <stdint.h>
#endif
/* Tru64 has uint16_t etc from netdb.h */
#if HAVE_NETDB_H
#include <netdb.h>
#endif
#include <unistd.h>],[uint16_t s;],
[sc_cv_type_uint16=yes],
[sc_cv_type_uint16=no])])
if test $sc_cv_type_uint16 = yes; then
AC_DEFINE(HAVE_TYPE_UINT16)
fi
AC_MSG_RESULT($sc_cv_type_uint16)
AC_MSG_CHECKING(for uint32_t)
AC_CACHE_VAL(sc_cv_type_uint32,
[AC_TRY_COMPILE([#include <sys/types.h>
#if HAVE_STDINT_H
#include <stdint.h>
#endif
/* Tru64 has uint32_t etc from netdb.h */
#if HAVE_NETDB_H
#include <netdb.h>
#endif
#include <unistd.h>],[uint32_t s;],
[sc_cv_type_uint32=yes],
[sc_cv_type_uint32=no])])
if test $sc_cv_type_uint32 = yes; then
AC_DEFINE(HAVE_TYPE_UINT32)
fi
AC_MSG_RESULT($sc_cv_type_uint32)
AC_MSG_CHECKING(for uint64_t)
AC_CACHE_VAL(sc_cv_type_uint64,
[AC_TRY_COMPILE([#include <sys/types.h>
#if HAVE_STDINT_H
#include <stdint.h>
#endif
/* Tru64 has uint32_t etc from netdb.h */
#if HAVE_NETDB_H
#include <netdb.h>
#endif
#include <unistd.h>],[uint64_t s;],
[sc_cv_type_uint64=yes],
[sc_cv_type_uint64=no])])
if test $sc_cv_type_uint64 = yes; then
AC_DEFINE(HAVE_TYPE_UINT64)
fi
AC_MSG_RESULT($sc_cv_type_uint64)
### AIX 4.1 needs _XOPEN_EXTENDED_SOURCE for syslog headers,
# but then gets problems with 3rd arg of getsockaddr...
#AC_MSG_CHECKING(for _XOPEN_EXTENDED_SOURCE requirement)
#CFLAGS="-Werror -Wall"
#AC_TRY_COMPILE([#include <sys/syslog.h>],
#[syslog(0," ");],
#[AC_MSG_RESULT(no)],
#[AC_MSG_RESULT(required); AC_DEFINE(_XOPEN_EXTENDED_SOURCE)])
### fds_bits
AC_MSG_CHECKING(for fdset->fds_bits)
AC_TRY_COMPILE([#include <sys/types.h>
#if HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif],
[fd_set s; s.fds_bits[0]=0;],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FDS_BITS)],
[AC_MSG_RESULT(no);])
AC_MSG_CHECKING(for sa_family_t)
AC_CACHE_VAL(sc_cv_type_sa_family_t,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <netinet/in.h>],[sa_family_t s;],
[sc_cv_type_sa_family_t=yes],
[sc_cv_type_sa_family_t=no])])
if test $sc_cv_type_sa_family_t = yes; then
AC_DEFINE(HAVE_TYPE_SA_FAMILY_T)
fi
AC_MSG_RESULT($sc_cv_type_sa_family_t)
AC_MSG_CHECKING(for struct sigaction.sa_sigaction)
AC_CACHE_VAL(sc_cv_struct_sigaction_sa_sigaction,
[AC_TRY_COMPILE([#include <signal.h>],[struct sigaction s;s.sa_sigaction=0;],
[sc_cv_struct_sigaction_sa_sigaction=yes],
[sc_cv_struct_sigaction_sa_sigaction=no])])
if test $sc_cv_struct_sigaction_sa_sigaction = yes; then
AC_DEFINE(HAVE_STRUCT_SIGACTION_SA_SIGACTION)
fi
AC_MSG_RESULT($sc_cv_struct_sigaction_sa_sigaction)
### struct termios .c_ispeed
AC_MSG_CHECKING(for termios.c_ispeed)
AC_CACHE_VAL(sc_cv_termios_ispeed,
[AC_TRY_COMPILE([#include <termios.h>],
[struct termios t; t.c_ispeed=0;],
[sc_cv_termios_ispeed=yes],
[sc_cv_termios_ispeed=no])])
if test $sc_cv_termios_ispeed = yes; then
AC_DEFINE(HAVE_TERMIOS_ISPEED)
fi
AC_MSG_RESULT($sc_cv_termios_ispeed)
if test $sc_cv_termios_ispeed = yes; then
AC_MSG_CHECKING(for offset of c_ispeed in struct termios)
LIBS1="$LIBS"; LIBS="" # avoid libwrap allow_severity undefined
AC_CACHE_VAL(ac_cv_ispeed_offset,
[conftestspeedoff="conftestspeedoff.out"
AC_TRY_RUN([
#include <errno.h>
#include <stdio.h>
#include <termios.h>
#include <string.h>
main(){
struct termios t;
FILE *f;
if ((f=fopen("$conftestspeedoff","w"))==NULL){
fprintf(stderr,"\\"$conftestspeedoff\\": %s\n",strerror(errno)); exit(-1);
}
fprintf(f, "%d", ((char*)&t.c_ispeed-(char*)&t)/sizeof(speed_t));
exit(0);
}
],
[ac_cv_ispeed_offset=`cat $conftestspeedoff`],
[ac_cv_ispeed_offset=-1],
[ac_cv_ispeed_offset=-1] #!
)])
LIBS="$LIBS1"
AC_MSG_RESULT($ac_cv_ispeed_offset)
if test $ac_cv_ispeed_offset -ge 0; then
AC_DEFINE_UNQUOTED(ISPEED_OFFSET, $ac_cv_ispeed_offset)
fi
fi
# there is another issue with termios: OSR requires "#define _SVID3 ..."
# for reasonable termios support. We check this situation using IMAXBEL
AC_MSG_CHECKING(if _SVID3 is helpful)
AC_CACHE_VAL(ac_cv_svid3,
[AC_TRY_COMPILE([#include <termios.h>],
[int i=IMAXBEL],
[ac_cv_svid3=no],
[AC_TRY_COMPILE([#define _SVID3 1
#include <termios.h>],
[int i=IMAXBEL],
[ac_cv_svid3=yes],
[ac_cv_svid3=no]
)]
)])
if test $ac_cv_svid3 = yes; then
AC_DEFINE(_SVID3)
fi
AC_MSG_RESULT($ac_cv_svid3)
# struct timespec
AC_MSG_CHECKING(for struct timespec)
AC_CACHE_VAL(sc_cv_struct_timespec,
[AC_TRY_COMPILE([#include <time.h>
#if HAVE_SYS_TIME_H
#include <sys/time.h>
#endif],[struct timespec s;],
[sc_cv_struct_timespec=yes],
[sc_cv_struct_timespec=no])])
if test $sc_cv_struct_timespec = yes; then
AC_DEFINE(HAVE_STRUCT_TIMESPEC)
fi
AC_MSG_RESULT($sc_cv_struct_timespec)
# struct linger; FreeBSD requires sys/types.h for sys/socket.h
AC_MSG_CHECKING(for struct linger)
AC_CACHE_VAL(sc_cv_struct_linger,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>],[struct linger s;],
[sc_cv_struct_linger=yes],
[sc_cv_struct_linger=no])])
if test $sc_cv_struct_linger = yes; then
AC_DEFINE(HAVE_STRUCT_LINGER)
fi
AC_MSG_RESULT($sc_cv_struct_linger)
# struct ip_mreq (for multicasting options)
AC_MSG_CHECKING(for struct ip_mreq)
AC_CACHE_VAL(sc_cv_struct_ip_mreq,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>],[struct ip_mreq s;],
[sc_cv_struct_ip_mreq=yes],
[sc_cv_struct_ip_mreq=no])])
if test $sc_cv_struct_ip_mreq = yes; then
AC_DEFINE(HAVE_STRUCT_IP_MREQ)
fi
AC_MSG_RESULT($sc_cv_struct_ip_mreq)
# struct ip_mreqn (for multicasting options)
AC_MSG_CHECKING(for struct ip_mreqn)
AC_CACHE_VAL(sc_cv_struct_ip_mreqn,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/ip.h>],[struct ip_mreqn s;],
[sc_cv_struct_ip_mreqn=yes],
[sc_cv_struct_ip_mreqn=no])])
if test $sc_cv_struct_ip_mreqn = yes; then
AC_DEFINE(HAVE_STRUCT_IP_MREQN)
fi
AC_MSG_RESULT($sc_cv_struct_ip_mreqn)
# struct ipv6_mreq (for multicasting options)
AC_MSG_CHECKING(for struct ipv6_mreq)
AC_CACHE_VAL(sc_cv_struct_ipv6_mreq,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>],[struct ipv6_mreq s;],
[sc_cv_struct_ipv6_mreq=yes],
[sc_cv_struct_ipv6_mreq=no])])
if test $sc_cv_struct_ipv6_mreq = yes; then
AC_DEFINE(HAVE_STRUCT_IPV6_MREQ)
fi
AC_MSG_RESULT($sc_cv_struct_ipv6_mreq)
# struct ifreq (for network interfaces)
AC_MSG_CHECKING(for struct ifreq)
AC_CACHE_VAL(sc_cv_struct_ifreq,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>],[struct ifreq s;],
[sc_cv_struct_ifreq=yes],
[sc_cv_struct_ifreq=no])])
if test $sc_cv_struct_ifreq = yes; then