-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
2107 lines (1912 loc) · 70 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
dnl source: configure.in
dnl Copyright Gerhard Rieger and contributors (see file CHANGES)
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"
elif test "$CC" = "clang"; then
CFLAGS="$CFLAGS -D_GNU_SOURCE -Wall -Wno-parentheses"
ERRONWARN="-Werror -O0"
#elif Sun Studio
# ERRONWARN="-errwarn"
else
ERRONWARN=
fi
export CFLAGS
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(stdbool.h)
AC_CHECK_HEADERS(inttypes.h)
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 poll.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_HEADER(net/if.h, AC_DEFINE(HAVE_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)
AC_CHECK_HEADER(linux/errqueue.h, AC_DEFINE(HAVE_LINUX_ERRQUEUE_H), [], [#include <sys/time.h>
#include <linux/types.h>])
AC_CHECK_HEADERS(sys/utsname.h sys/select.h sys/file.h)
AC_CHECK_HEADERS(util.h bsd/libutil.h libutil.h sys/stropts.h regex.h)
AC_CHECK_HEADERS(linux/fs.h linux/ext2_fs.h)
dnl Checks for setgrent, getgrent and endgrent.
AC_CHECK_FUNCS(setgrent getgrent endgrent)
dnl Checks for getgrouplist() /* BSD */
AC_CHECK_FUNCS(getgrouplist)
AC_CHECK_FUNCS(cfmakeraw)
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 function prototype and in lib
dnl arg1: function name
dnl arg2: required include files beyond sysincludes.h
define(AC_CHECK_PROTOTYPE_LIB,[
AC_MSG_CHECKING(for $1 prototype)
AC_CACHE_VAL(sc_cv_have_prototype_lib_$1,
[CFLAGS1="$CFLAGS"; CFLAGS="$ERRONWARN -Wall $CFLAGS1";
AC_TRY_LINK([#include "sysincludes.h"
$2],[return(&$1==(void *)&$1);],
[sc_cv_have_prototype_lib_$1=yes],
[sc_cv_have_prototype_lib_$1=no]);
CFLAGS="$CFLAGS1"])
if test $sc_cv_have_prototype_lib_$1 = yes; then
AC_DEFINE(HAVE_PROTOTYPE_LIB_$1)
fi
AC_MSG_RESULT($sc_cv_have_prototype_lib_$1)
])
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])
AC_CHECK_HEADERS(netinet6/in6.h) # found on OpenBSD and Lion, used for IPV6_*
AC_MSG_CHECKING(if __APPLE_USE_RFC_2292 is helpful)
AC_CACHE_VAL(ac_cv_apple_use_rfc_2292,
[AC_TRY_COMPILE(,[#ifndef IPV6_HOPOPTS
murks;
#endif],
[ac_cv_apple_use_rfc_2292=no],
[AC_TRY_COMPILE([#define __APPLE_USE_RFC_2292],
[#ifndef IPV6_HOPOPTS
murks;
#endif],
[ac_cv_apple_use_rfc_2292=yes],
[ac_cv_apple_use_rfc_2292=no]
)]
)])
if test "$ac_cv_apple_use_rfc_2292" = yes; then
AC_DEFINE(__APPLE_USE_RFC_2292)
fi
AC_MSG_RESULT($ac_cv_apple_use_rfc_2292)
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(genericsocket, [ --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 generic 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])],
[AC_INCLUDES_DEFAULT
#if HAVE_NET_IF_H && HAVE_NETINET_IN_H
#include <net/if.h>
#include <netinet/in.h>
#endif])
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 vsock support)
AC_ARG_ENABLE(vsock, [ --disable-vsock disable vsock support],
[case "$enableval" in
no) AC_MSG_RESULT(no); WITH_VSOCK= ;;
*) AC_MSG_RESULT(yes); WITH_VSOCK=1 ;;
esac],
[AC_MSG_RESULT(yes); WITH_VSOCK=1 ])
if test "$WITH_VSOCK"; then
AC_CHECK_HEADER(linux/vm_sockets.h,
AC_DEFINE(HAVE_LINUX_VM_SOCKETS_H),
[WITH_VSOCK=;
AC_MSG_WARN([include file linux/vm_sockets.h not found, disabling vsock])],
[AC_INCLUDES_DEFAULT
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
]
)
fi
if test "$WITH_VSOCK"; then
AC_DEFINE(WITH_VSOCK)
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 fs attributes support)
AC_ARG_ENABLE(fs, [ --disable-fs disable fs attributes support],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_FS) AC_MSG_RESULT(yes);;
esac],
[AC_DEFINE(WITH_FS) 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 ])
AC_ARG_ENABLE(openssl_base, [ --enable-openssl-base specify directory with include/ and lib/],
[ OPENSSL_BASE="$enableval" ],
[ unset OPENSSL_BASE ])
#
if test -n "$WITH_OPENSSL"; then
if test -n "$OPENSSL_BASE"; then
sc_cv_have_openssl_ssl_h=yes; OPENSSL_BASE="$D"
else
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_BASE=""; ],
[sc_cv_have_openssl_ssl_h=no
if [ "$OPENSSL_BASE" ]; then
s="$OPENSSL_BASE"
else
Ds="/sw /usr/local /opt/freeware /usr/sfw /usr/local/ssl"
fi
for D in $Ds; 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_BASE="$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
fi # end checking for openssl/ssl.h
#
#if test -n "$WITH_OPENSSL"; then
# AC_CHECK_FUNCS(OPENSSL_init_ssl, SSL_library_init)
#fi
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 and higher requires -lcrypto even on Linux.
AC_MSG_CHECKING(for libssl)
AC_CACHE_VAL(sc_cv_have_libssl,
[ LIBS0="$LIBS"
if test -n "$OPENSSL_BASE"; then
L="$OPENSSL_BASE/lib"; LIBS="$LIBS -L$L -lssl -lcrypto"
else
LIBS="$LIBS -lssl -lcrypto"
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
AC_CHECK_FUNCS(OPENSSL_init_ssl SSL_library_init)
#; sc_cv_have_SSL_library_init='yes'; AC_DEFINE(HAVE_SSL_library_init)
#if test -n "$WITH_OPENSSL"; then
# AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
# FOUND_SSL_LIB="no"
# AC_CHECK_LIB(ssl, OPENSSL_init_ssl, [FOUND_SSL_LIB="yes"])
# AC_CHECK_LIB(ssl, SSL_library_init, [FOUND_SSL_LIB="yes"])
# AS_IF([test "x$FOUND_SSL_LIB" = xno], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL; WITH_OPENSSL=])])
# AS_IF([test "x$FOUND_SSL_LIB" = xyes], [LIBS="$LIBS -L$L -lssl -lcrypto"])
#fi
if test -n "$WITH_OPENSSL"; then
AC_MSG_CHECKING(whether to include OpenSSL method option)
AC_ARG_ENABLE(openssl-method, [ --enable-openssl-method enable OpenSSL method option],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_OPENSSL_METHOD) WITH_OPENSSL_METHOD=1; AC_MSG_RESULT(yes);;
esac],
[AC_MSG_RESULT(no)])
fi
AC_MSG_CHECKING(whether to include deprecated resolver option)
AC_ARG_ENABLE(res-deprecated, [ --enable-res-deprecated enable deprecated resolver options],
[case "$enableval" in
no) AC_MSG_RESULT(no);;
*) AC_DEFINE(WITH_RES_DEPRECATED) WITH_RES_DEPRECATED=1; AC_MSG_RESULT(yes);;
esac],
[AC_MSG_RESULT(no)])
# check for fips support
AC_MSG_CHECKING(whether to include openssl fips support)
AC_ARG_ENABLE(fips, [ --enable-fips enable OpenSSL FIPS support],
[ case "$enableval" in
yes) AC_MSG_RESULT(yes); WITH_FIPS=1 ;;
*) AC_MSG_RESULT(no); WITH_FIPS= ;;
esac],
[ AC_MSG_RESULT(no); WITH_FIPS= ])
if test -n "$WITH_FIPS"; then
if test -n "$WITH_OPENSSL"; then
AC_CHECK_PROG(HAVE_FIPSLD, fipsld, 1)
if test "$sc_cv_have_openssl_ssl_h" != "yes" -o "$sc_cv_have_libssl" != "yes" -o ! "$HAVE_FIPSLD";
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_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 <stddef.h>
#include <openssl/fips.h>],[;],
[sc_cv_have_openssl_fips_h=yes; ],
[sv_cv_have_openssl_fips_h=no
if test -n "$OPENSSL_BASE"; then
I="$OPENSSL_BASE/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_BASE"; then
L="$OPENSSL_BASE/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
0|DEBUG|Debug|debug) AC_DEFINE(WITH_MSGLEVEL,0) AC_MSG_RESULT(debug);;
1|INFO|Info|info) AC_DEFINE(WITH_MSGLEVEL,1) AC_MSG_RESULT(info);;
2|NOTICE|Notice|notice) AC_DEFINE(WITH_MSGLEVEL,2) AC_MSG_RESULT(notice);;
3|WARN|Warn|warn) AC_DEFINE(WITH_MSGLEVEL,3) AC_MSG_RESULT(warn);;
4|ERROR|Error|error) AC_DEFINE(WITH_MSGLEVEL,4) AC_MSG_RESULT(error);;
5|FATAL|Fatal|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 pselect poll socket strtod strtol)
AC_CHECK_FUNCS(strtoul uname getpgid getsid gethostbyname getaddrinfo)
AC_CHECK_FUNCS(getprotobynumber getprotobynumber_r)
AC_CHECK_FUNCS(setgroups inet_aton)
AC_CHECK_FUNCS(grantpt unlockpt)
# GR AC_CHECK_FUNCS only checks linking, not prototype. This may lead to implicit
# function declarations and to SIGSEGV on systems with 32bit int and 64bit pointer
dnl Search for cfsetispeed(),cfgetispeed(),cfsetspeed(),cfgetospeed() functions
AC_CHECK_FUNCS(cfsetispeed cfgetispeed cfsetospeed cfgetospeed)
###################################
# check for prototype and existence of functions that return a pointer
# defines in config.h: HAVE_PROTOTYPE_LIB_$1
AC_CHECK_PROTOTYPE_LIB(posix_memalign)
AC_CHECK_PROTOTYPE_LIB(strdup)
AC_CHECK_PROTOTYPE_LIB(strerror)
AC_CHECK_PROTOTYPE_LIB(strstr)
AC_CHECK_PROTOTYPE_LIB(getipnodebyname)
AC_CHECK_PROTOTYPE_LIB(strndup)
AC_CHECK_PROTOTYPE_LIB(memrchr)
AC_CHECK_PROTOTYPE_LIB(if_indextoname)
AC_CHECK_PROTOTYPE_LIB(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)
AC_CHECK_TYPE(sig_atomic_t,AC_DEFINE(HAVE_TYPE_SIG_ATOMIC_T),,[#include "sysincludes.h"])
AC_MSG_CHECKING(for bool)
AC_CACHE_VAL(sc_cv_type_bool,
[AC_TRY_COMPILE([#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
#endif],
[bool b;],
[sc_cv_type_bool=yes],
[sc_cv_type_bool=no])])
if test $sc_cv_type_bool = yes; then
AC_DEFINE(HAVE_TYPE_BOOL)
fi
AC_MSG_RESULT($sc_cv_type_bool)
# 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);])