forked from cminyard/gensio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
832 lines (762 loc) · 20.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
AC_INIT([gensio],[2.4.0-rc4],[[email protected]])
AC_SUBST(gensio_VERSION_MAJOR, 2)
AC_SUBST(gensio_VERSION_MINOR, 4)
AC_SUBST(gensio_VERSION_PATCH, 0)
AC_SUBST(gensio_VERSION_STRING, ${PACKAGE_VERSION})
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([-Wall])
AC_CONFIG_HEADERS([config.h])
AC_PROG_CC
AC_PROG_CXX
AM_PROG_AR
LT_INIT
CXXFLAGS="$CXXFLAGS -I\$(top_srcdir)/c++/include"
# defaults
uucp_locking_flag=yes
UUCP_LOCK_DIR=/var/spool/lock
USE_FILE_STDIO=0
broken_pselect=no
system_type=unix
case $target_os in
mingw*)
LIBS="$LIBS -lws2_32 -liphlpapi -lgdi32 -lbcrypt"
uucp_locking_flag=no
system_type=windows
USE_FILE_STDIO=1
;;
cygwin*)
uucp_locking_flag=no
;;
linux*)
UUCP_LOCK_DIR=/var/lock
LIBS="-lpam"
;;
darwin*)
broken_pselect=yes
uucp_locking_flag=no
;;
*bsd* | *BSD*)
broken_pselect=yes
;;
*)
# Defaults, maybe it will work
;;
esac
AC_ARG_WITH(uucp-locking,
[AS_HELP_STRING([--with-uucp-locking], [Enable UUCP-style locking with yes/no, or set the uucp lock directory otherwise])],
uucp_locking_flag="$withval")
case "$uucp_locking_flag" in
yes)
USE_UUCP_LOCKING=1
;;
no)
USE_UUCP_LOCKING=0
;;
*)
USE_UUCP_LOCKING=1
UUCP_LOCK_DIR="$uucp_locking_flag"
;;
esac
AC_DEFINE_UNQUOTED([USE_UUCP_LOCKING], [$USE_UUCP_LOCKING],
[Enable device locking])
AC_DEFINE_UNQUOTED([UUCP_LOCK_DIR], ["$UUCP_LOCK_DIR"],
[Directory holding UUCP locks])
AC_ARG_WITH(broken-pselect,
[AS_HELP_STRING([--with-broken-pselect], [pselect is not atomic, work around it])],
broken_pselect="$withval")
case "$broken_pselect" in
yes)
AC_DEFINE([BROKEN_PSELECT], [], [PSELECT call is not atomic])
;;
*)
;;
esac
AC_ARG_WITH(tcp-wrappers,
[AS_HELP_STRING([--with-tcp-wrappers], [Enable tcpwrappers support])],
tcp_wrappers="$withval",
tcp_wrappers="no")
if test "$tcp_wrappers" != "no"
then
AC_CHECK_HEADERS([tcpd.h])
AC_CHECK_LIB(wrap,main)
fi
AC_ARG_ENABLE([doc],
[AS_HELP_STRING([--disable=doc], [disable building and installing docs])],
[],
[enable_doc="yes"])
AM_CONDITIONAL([INSTALL_DOC], [test "x$enable_doc" != "xno"])
AX_HAVE_EPOLL_PWAIT(
[AX_CONFIG_FEATURE_ENABLE(epoll_pwait)],
[AX_CONFIG_FEATURE_DISABLE(epoll_pwait)])
AX_CONFIG_FEATURE(
[epoll_pwait], [This platform supports epoll(7) with epoll_pwait(2)],
[HAVE_EPOLL_PWAIT], [This platform supports epoll(7) with epoll_pwait(2).])
tryopenipmi=yes
AC_ARG_WITH(openipmi,
[AS_HELP_STRING([--with-openipmi=yes|no], [Look for openipmi])],
if test "x$withval" = "xyes"; then
tryopenipmi=yes
elif test "x$withval" = "xno"; then
tryopenipmi=no
fi,
)
trysctp=yes
AC_ARG_WITH(sctp,
[AS_HELP_STRING([--with-sctp=yes|no], [Look for sctp])],
if test "x$withval" = "xyes"; then
trysctp=yes
elif test "x$withval" = "xno"; then
trysctp=no
fi,
)
if test "x$system_type" = "xunix"; then
use_pthreads=yes
else
use_pthreads=no
fi
use_pthreads_set=false
AC_ARG_WITH(pthreads,
[AS_HELP_STRING([--with-pthreads=yes|no], [Use pthreads or not])],
use_pthreads_set=true
if test "x$withval" = "xyes"; then
use_pthreads=yes
elif test "x$withval" = "xno"; then
use_pthreads=no
fi,
)
if test "x$use_pthreads" != "xno"; then
AX_PTHREAD(
[LIBS="$LIBS $PTHREAD_LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
AC_DEFINE([USE_PTHREADS], [], [Enable multithreaded support])],
[if $use_pthreads_set; then
AC_MSG_FAILURE([--with-pthreads was given, but no working pthread library was found])
fi])
fi
if test "x$system_type" = "xunix"; then
tryglib=yes
trytcl=yes
else
tryglib=no
trytcl=no
fi
AC_ARG_WITH(glib,
[AS_HELP_STRING([--with-glib=yes|no], [Look for glib.])],
if test "x$withval" = "xyes"; then
if test "x$tryglib" = "xno"; then
AC_MSG_FAILURE([glib only support on Unix systems for now])
fi
elif test "x$withval" = "xno"; then
tryglib=no
fi,
)
glibcflags=
AC_ARG_WITH(glibcflags,
[AS_HELP_STRING([--with-glibcflags=flags],
[Set the flags to compile with glib.])],
glibcflags="$withval",
)
gliblibs=
AC_ARG_WITH(gliblibs,
[AS_HELP_STRING([--with-gliblibs=libs],
[Set the libraries to link with glib.])],
gliblibs="$withval",
)
AC_ARG_WITH(cplusplus,
[AS_HELP_STRING([--with-cplusplus=yes|no],
[Enable or disable C++ support.])],
cplusplus="$withval",
[if test -z "$CXX"; then
cplusplus=no
else
cplusplus=yes
fi]
)
AC_ARG_WITH(cplusplus-ver,
[AS_HELP_STRING([--with-cplusplus-ver=],
[Set the C++ version, same as the value of __cplusplus.])],
cplusplusver="$withval",
[if test "$cplusplus" = "yes"; then
AC_LANG_PUSH([C++])
AC_MSG_CHECKING([for C++ version support])
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Version: __cplusplus
_ACEOF
cplusplusver=`(eval "$ac_cpp conftest.$ac_ext") | grep '^Version:'`
if test $? -ne 0; then
AC_MSG_RESULT([check faied])
cplusplus=no
else
cplusplusver=`echo $cplusplusver | sed 's/^Version: //'`
cplusplusver=`echo $cplusplusver | sed 's/L$//'`
AC_MSG_RESULT([$cplusplusver])
fi
rm -f conftest.$ac_ext
AC_LANG_POP([C++])
else
cplusplusver=0
fi]
)
CPLUSPLUS_DIR=
if test "$cplusplus" = "yes"; then
if test "$cplusplusver" -ge 201103; then
CPLUSPLUS_DIR="c++"
else
AC_MSG_RESULT([C++ version $cplusplusver is too old, need at least 201102, disabling c++])
fi
fi
AC_SUBST(CPLUSPLUS_DIR)
# Find pkg-config
pkgprog=
AC_PATH_PROG(pkgprog, pkg-config)
# Handle GLIB support
haveglib=no
if test "x$glibcflags" = "x" -o "x$gliblibs" = "x"; then
glibprog=
if test "x$tryglib" != "xno"; then
if test "x$pkgprog" != "x"; then
glibprog=$pkgprog
fi
fi
GLIB_CFLAGS=
GLIB_LIBS=
if test "x$glibprog" != "x"; then
GLIB_CFLAGS=`$glibprog --cflags gthread-2.0 2>/dev/null`
if test $? = 0; then
haveglib=yes
GLIB_LIBS=`$glibprog --libs gthread-2.0 2>/dev/null`
fi
fi
else
haveglib=yes
GLIB_CFLAGS="$glibcflags"
GLIB_LIBS="$gliblibs"
fi
echo "checking for glib... $haveglib"
AM_CONDITIONAL([HAVE_GLIB], [test "x$haveglib" = "xyes"])
if test "x$haveglib" = "xyes"; then
AC_DEFINE([HAVE_GLIB], [], [Have GLIB libraries])
GLIB_LIB='$(top_builddir)/glib/libgensioglib.la'
GLIB_DIR=glib
else
GLIB_LIB=
GLIB_DIR=
fi
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
AC_SUBST(GLIB_LIB)
AC_SUBST(GLIB_DIR)
AC_ARG_WITH(tcl,
[ --with-tcl=yes|no Look for tcl.],
if test "x$withval" = "xyes"; then
trytcl=yes
elif test "x$withval" = "xno"; then
trytcl=no
fi,
)
tclcflags=
AC_ARG_WITH(tclcflags,
[ --with-tclcflags=flags Set the flags to compile with tcl.],
tclcflags="$withval",
)
tcllibs=
AC_ARG_WITH(tcllibs,
[ --with-tcllibs=libs Set the libraries to link with tcl.],
tcllibs="$withval",
)
# Handle TCL support
TCL_LIBS=
TCL_CFLAGS=
havetcl=no
if test "x$trytcl" != "xno"; then
FOUND_TCL_HEADER=no
ver=`echo 'puts \$tcl_version' | tclsh`
if test "x$tclcflags" = "x"; then
AC_CHECK_HEADER(tcl/tcl.h, FOUND_TCL_HEADER=yes; )
if test "x$FOUND_TCL_HEADER" != "xyes"; then
AC_CHECK_HEADER(tcl/tcl.h, FOUND_TCL_HEADER=yes; )
if test "x$FOUND_TCL_HEADER" = "xyes"; then
tclcflags="-I /usr/include/tcl$ver"
TCL_CFLAGS="$tclcflags"
fi
else
tclcflags="-I /usr/include/tcl"
TCL_CFLAGS="$tclcflags"
fi
else
TCL_CFLAGS="$tclcflags"
FOUND_TCL_HEADER=yes
fi
if test "x$tcllibs" = "x"; then
if test "x$FOUND_TCL_HEADER" = "xyes"; then
AC_CHECK_LIB(tcl, Tcl_CancelIdleCall, TCL_LIBS=-ltcl)
if test "x$TCL_LIBS" = "x"; then
AC_CHECK_LIB(tcl$ver, Tcl_DoOneEvent, TCL_LIBS=-ltcl$ver)
fi
fi
else
TCL_LIBS="$tcllibs"
fi
if test "x$FOUND_TCL_HEADER" = "xyes" -a "x$TCL_LIBS" != "x"; then
havetcl=yes
fi
fi
if test "x$havetcl" = "xyes"; then
AC_DEFINE([HAVE_TCL], [], [Have TCL libraries])
TCL_LIB='$(top_builddir)/tcl/libgensiotcl.la'
TCL_DIR=tcl
else
TCL_LIB=
TCL_DIR=
fi
AC_SUBST(TCL_CFLAGS)
AC_SUBST(TCL_LIBS)
AC_SUBST(TCL_LIB)
AC_SUBST(TCL_DIR)
AC_ARG_WITH(openipmiflags,
[AS_HELP_STRING([--with-openipmiflags=flags],
[Set the flags to compile with OpenIPMI.])],
CPPFLAGS="$CPPFLAGS $withval"
)
AC_ARG_WITH(openipmilibs,
[AS_HELP_STRING([--with-openipmilibs=libs],
[Set the libraries to link with OpenIPMI.])],
LIBS="$LIBS $withval"
)
# Handle OpenIPMI support
HAVE_OPENIPMI=no
if test "x$tryopenipmi" != "xno"; then
found_ipmiif=no
AC_CHECK_HEADER(OpenIPMI/ipmiif.h, found_ipmiif=yes; )
if test "x$found_ipmiif" = "xyes"; then
AC_CHECK_LIB(OpenIPMI, ipmi_alloc_os_handler, HAVE_OPENIPMI=yes)
fi
fi
if test "x$HAVE_OPENIPMI" != "xno"; then
if test "x$ax_pthread_ok" = "xyes"; then
LIBS="$LIBS -lOpenIPMI -lOpenIPMIpthread -lOpenIPMIutils"
else
LIBS="$LIBS -lOpenIPMI -lOpenIPMIposix -lOpenIPMIutils"
fi
HAVE_OPENIPMI=1
else
HAVE_OPENIPMI=0
fi
AC_DEFINE_UNQUOTED([HAVE_OPENIPMI], [$HAVE_OPENIPMI],
[Set to 1 to enable IPMI support through OpenIPMI, 0 to disable])
AC_SUBST(HAVE_OPENIPMI)
tryssl=yes
AC_ARG_WITH(ssl,
[AS_HELP_STRING([--with-ssl[[=yes|no]]],
[Look for ssl.])],
if test "x$withval" = "x"; then
tryssl=yes
elif test "x$withval" = "xyes"; then
tryssl=yes
elif test "x$withval" = "xno"; then
tryssl=no
fi,
)
HAVE_OPENSSL=0
if test $tryssl = yes; then
AX_CHECK_OPENSSL([HAVE_OPENSSL=1
LIBS="$LIBS $OPENSSL_LIBS"
LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
CPPFLAGS="$CPPFLAGS $OPENSSL_INCLUDES"], [HAVE_OPENSSL=0])
fi
AC_DEFINE_UNQUOTED([HAVE_OPENSSL], [$HAVE_OPENSSL],
[Set to 1 to enable SSL support through OpenSSL, 0 to disable])
AC_SUBST(HAVE_OPENSSL)
tryswig=yes
swigprog=
AC_ARG_WITH(swig,
[AS_HELP_STRING([--with-swig[[=yes|no|PATH]]],
[Look for swig, with the optional path.])],
if test "x$withval" = "x"; then
tryswig=yes
elif test "x$withval" = "xyes"; then
tryswig=yes
elif test "x$withval" = "xno"; then
tryswig=no
else
swigprog=$withval
fi,
)
trypython=yes
AC_ARG_WITH(python,
[AS_HELP_STRING([--with-python[[=yes|no|PATH]]],
[Look for python, with the optional path.])],
if test "x$withval" = "x"; then
trypython=yes
elif test "x$withval" = "xyes"; then
trypython=yes
elif test "x$withval" = "xno"; then
trypython=no
else
pythonprog="$withval"
trypython=yes
fi,
)
AC_ARG_WITH(pythoninstall,
[AS_HELP_STRING([--with-pythoninstall=PATH],
[Install python modules in the given location.])],
pythoninstalldir="$withval",
)
AC_ARG_WITH(pythoninstalllib,
[AS_HELP_STRING([--with-pythoninstalllib=PATH],
[Install python libraries in the given location.])],
pythoninstalllibdir="$withval",
)
AC_ARG_WITH(pythoncflags,
[AS_HELP_STRING([--with-pythoncflags=PATH],
[Use the given flags when compiling python parts.])],
pythoncflags="$withval",
)
AC_ARG_WITH(pythonusepthreads,
[AS_HELP_STRING([--with-pythonusepthreads[[=yes|no]]],
[Use threads with python.])],
if test "x$withval" = "xyes"; then
pythonusepthreads="yes"
elif test "x$withval" = "xno"; then
pythonusepthreads="no"
elif test "x$withval" = "x"; then
pythonusepthreads="yes"
fi,
)
AC_SEARCH_LIBS([clock_gettime], [rt posix4])
# Handle RS485 support
AC_CHECK_DECLS([TIOCSRS485], [], [], [[#include <sys/ioctl.h>]])
# enable silent build
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_MACRO_DIR([m4])
AC_CHECK_LIB(nsl,main)
trymdns=yes
AC_ARG_WITH(mdns,
[AS_HELP_STRING([--with-mdns[[=yes|no]]],
[Look for mdns.])],
if test "x$withval" = "x"; then
trymdns=yes
elif test "x$withval" = "xyes"; then
trymdns=yes
elif test "x$withval" = "xno"; then
trymdns=no
fi,
)
HAVE_AVAHI=0
if test $trymdns = yes; then
AC_CHECK_LIB(avahi-client, avahi_client_new,
[AC_DEFINE([HAVE_AVAHI], [1], [Have avahi installed])
HAVE_AVAHI=1
LIBS="-lavahi-client -lavahi-common $LIBS"])
fi
AC_SUBST(HAVE_AVAHI)
GMDNS=
GMDNSMAN=
if test "x$HAVE_AVAHI" = "x1"; then
GMDNS=gmdns
GMDNSMAN=gmdns.1
fi
AC_SUBST(GMDNS)
AC_SUBST(GMDNSMAN)
# Now check for swig
SWIG_DIR=
SWIG=
if test "x$tryswig" = "xyes"; then
if test "x$swigprog" != "x"; then
SWIG="$swigprog"
fi
AX_PKG_SWIG([1.3.21])
if test "x$SWIG" != "x"; then
AC_DEFINE([HAVE_SWIG], [], [Have swig installed])
SWIG_DIR=swig
fi
fi
AC_SUBST(SWIG_DIR)
AC_SUBST(SWIG)
# Handle PYTHON support
PYTHON_DIR=
PYGENSIO_DIR=
PYTHON_INSTALL_DIR=
PYTHON_INSTALL_LIB_DIR=
PYTHON_SWIG_FLAGS=
if test "x$trypython" = "xyes"; then
if test "x$pythonprog" != "x"; then
PYTHON="$pythonprog"
fi
if test "x$pythoncflags" != "x"; then
PYTHON_CPPFLAGS="$pythoncflags"
fi
AX_PYTHON_DEVEL
fi
if test "x$PYTHON" != "x"; then
AX_PROG_PYTHON_VERSION([3.0.0],
[
PYTHON_SWIG_FLAGS=-py3
PYGENSIO_DIR=pygensio
], [])
PYTHON_DIR=python
if test "x$pythoninstalldir" = "x"; then
PYTHON_INSTALL_DIR="$PYTHON_SITE_PKG"
else
PYTHON_INSTALL_DIR="$pythoninstalldir"
fi
if test "x$pythoninstalllibdir" = "x"; then
PYTHON_INSTALL_LIB_DIR="$PYTHON_INSTALL_DIR"
else
PYTHON_INSTALL_LIB_DIR="$pythoninstalllibdir"
fi
if test "x$pythonusepthreads" = "x"; then
cat - <<_ACEOF >conftest.py
try:
import threading
print('yes')
except:
print('no')
_ACEOF
pythonusepthreads=`$PYTHON conftest.py`
rm -f conftest.py
fi
echo "checking for python threads... $pythonusepthreads"
if test "x$pythonusepthreads" = "xyes"; then
PYTHON_HAS_THREADS=1
else
PYTHON_HAS_THREADS=0
fi
fi
AC_SUBST(PYTHON_DIR)
AC_SUBST(PYGENSIO_DIR)
AC_SUBST(PYTHON_INSTALL_DIR)
AC_SUBST(PYTHON_INSTALL_LIB_DIR)
AC_SUBST(PYTHON_HAS_THREADS)
AC_SUBST(PYTHON_SWIG_FLAGS)
PYTHON_EXECUTABLE="${PYTHON}"
AC_SUBST(PYTHON_EXECUTABLE)
trygo=yes
GOPROG=
AC_ARG_WITH(go,
[AS_HELP_STRING([--with-go[[=yes|no|PATH]]],
[Look for go, with the optional path.])],
if test "x$withval" = "x"; then
trygo=yes
elif test "x$withval" = "xyes"; then
trygo=yes
elif test "x$withval" = "xno"; then
trygo=no
else
GOPROG="$withval"
trygo=yes
fi,
)
GODIR=
if test $trygo = yes; then
if test "x$GOPROG" = "x"; then
AC_CHECK_TOOL([GOPROG], [go], [])
fi
fi
if test "x$GOPROG" != "x"; then
AC_DEFINE([HAVE_GO], [], [Have go installed])
GO_DIR=go
fi
AC_SUBST(GOPROG)
AC_SUBST(GO_DIR)
HAVE_LIBSCTP=0
if test "x$trysctp" != "xno"; then
AC_CHECK_LIB(sctp, sctp_bindx,
[HAVE_LIBSCTP=1; LIBS="$LIBS -lsctp"])
fi
AC_DEFINE_UNQUOTED([HAVE_LIBSCTP], [$HAVE_LIBSCTP],
[Set to 1 to enable SCTP, 0 to disable])
AC_SUBST(HAVE_LIBSCTP)
HAVE_SCTP_SENDV=0
if test "$HAVE_LIBSCTP" = "1"; then
AC_CHECK_LIB(sctp, sctp_sendv, [HAVE_SCTP_SENDV=1])
fi
AC_DEFINE_UNQUOTED([HAVE_SCTP_SENDV], [$HAVE_SCTP_SENDV],
[Set to 1 if sctp_sendv() is available, 0 if not])
AC_CHECK_LIB(pam, pam_start, [HAVE_PAM=1], [HAVE_PAM=0])
if test $HAVE_PAM -eq 1; then
AC_DEFINE([HAVE_LIBPAM], [1], [PAM libraries are present])
PAMLIB=-lpam
fi
AC_SUBST(PAMLIB)
# python annoyingly defined HAVE_GETRANDOM
AC_CHECK_FUNC(getrandom, [AC_DEFINE([HAVE_GETRANDOM_FUNC], [1],
[Define if getrandom is available.])])
AC_CHECK_FUNC(ptsname_r, [HAVE_PTSNAME_R=1], [HAVE_PTSNAME_R=0])
AC_DEFINE_UNQUOTED([HAVE_PTSNAME_R], [$HAVE_PTSNAME_R],
[Set to 1 if ptsname_r is available, 0 if not])
AC_SUBST(HAVE_PTSNAME_R)
AC_CHECK_FUNCS(cfmakeraw)
AC_CHECK_FUNCS(signalfd)
AC_CHECK_FUNCS(regexec)
AC_CHECK_FUNCS(fnmatch)
case $host_os in
linux*) HAVE_WORKING_PORT0=1 ;;
*) HAVE_WORKING_PORT0=0 ;;
esac
AC_DEFINE_UNQUOTED([HAVE_WORKING_PORT0], [$HAVE_WORKING_PORT0],
[Set to 1 if binding with port 0 picks an ephemeral address])
AC_SUBST(HAVE_WORKING_PORT0)
GTLSSH=
GTLSSYNC=
GTLSSHD=
GTLSSH_KEYGEN=
GTLSSHMAN=
GTLSSYNCMAN=
GTLSSHDMAN=
GTLSSH_KEYGENMAN=
if test $HAVE_OPENSSL -eq 1; then
if test $HAVE_PAM -eq 1; then
GTLSSHD="gtlsshd\$(EXEEXT)"
GTLSSHDMAN=gtlsshd.8
fi
GTLSSH="gtlssh\$(EXEEXT)"
GTLSSHMAN=gtlssh.1
if test ${system_type} = unix; then
GTLSSYNC=gtlssync
GTLSSYNCMAN=gtlssync.1
fi
GTLSSH_KEYGEN="gtlssh-keygen\$(EXEEXT)"
GTLSSH_KEYGENMAN=gtlssh-keygen.1
fi
AC_SUBST(GTLSSHD)
AC_SUBST(GTLSSH)
AC_SUBST(GTLSSYNC)
AC_SUBST(GTLSSH_KEYGEN)
AC_SUBST(GTLSSHDMAN)
AC_SUBST(GTLSSHMAN)
AC_SUBST(GTLSSYNCMAN)
AC_SUBST(GTLSSH_KEYGENMAN)
AC_CHECK_MEMBER([struct termios2.c_ispeed],
[AC_DEFINE([HAVE_TERMIOS2], [1], [termios2 is present])],
[], [[#include <asm/termios.h>]])
AC_ARG_ENABLE([internal-trace],
[AS_HELP_STRING([--enable-internal-trace[[=yes|no]]],
[Enable internal tracing of states and data])],
[
case $enableval in
"" | y | ye | yes)
enable_internal_trace=yes
;;
"" | n | no)
enable_internal_trace=no
;;
*)
AC_MSG_ERROR([Invalid --enable-internal-trace option])
;;
esac
],
[enable_internal_trace=no])
if test "x$enable_internal_trace" != xno; then
AC_DEFINE([ENABLE_INTERNAL_TRACE], [1], [Enable internal tracing])
ENABLE_INTERNAL_TRACE=1
else
ENABLE_INTERNAL_TRACE=0
fi
AM_CONDITIONAL([ENABLE_INTERNAL_TRACE], [test ${enable_internal_trace} != no])
HAVE_UNIX=0
AC_CHECK_HEADER(sys/un.h, [HAVE_UNIX=1] )
AC_SUBST(HAVE_UNIX)
AC_DEFINE_UNQUOTED([HAVE_UNIX], [$HAVE_UNIX], [Enable unix socket handling])
HAVE_PTY=0
AC_CHECK_FUNCS(posix_openpt, [HAVE_PTY=1])
AC_SUBST(HAVE_PTY)
AC_DEFINE_UNQUOTED([HAVE_PTY], [$HAVE_PTY], [Enable PTY gensio])
AM_CONDITIONAL([HAVE_UNIX_OS], [test ${system_type} != windows])
AM_CONDITIONAL([HAVE_WINDOWS_OS], [test ${system_type} = windows])
AC_ARG_WITH(file-stdio,
[AS_HELP_STRING([--with-file-stdio[[=yes|no]]],
[Use stdio instead of unix files for the file gensio.])],
if test "x$withval" = "xyes"; then
USE_FILE_STDIO=1
elif test "x$withval" = "xno"; then
USE_FILE_STDIO=0
elif test "x$withval" = "x"; then
USE_FILE_STDIO=1
fi,
)
AC_DEFINE_UNQUOTED([USE_FILE_STDIO], [$USE_FILE_STDIO],
[Use stdio for the file gensio])
AC_LANG(C)
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [
static int counter = 0;
int val;
__atomic_load(&counter, &val, __ATOMIC_SEQ_CST);
return val;])],
[HAVE_GCC_ATOMICS=1],
[HAVE_GCC_ATOMICS=0])
AC_DEFINE_UNQUOTED([HAVE_GCC_ATOMICS], [$HAVE_GCC_ATOMICS],
[Are GCC atomic operations available])
AC_CHECK_FUNCS(sendmsg)
AC_CHECK_FUNCS(recvmsg)
AC_CHECK_FUNCS(isatty)
AC_CHECK_FUNCS(strcasecmp)
AC_CHECK_FUNCS(strncasecmp)
AC_CHECK_FUNCS(prctl)
AC_CHECK_DECLS([SIGWINCH], [], [], [#include <signal.h>])
CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/include -I\$(top_builddir)/include"
AC_CONFIG_FILES([Makefile
lib/libgensio.pc
lib/Makefile
swig/Makefile
swig/python/libgensio_python_swig.pc
swig/python/Makefile
swig/include/gensio/Makefile
swig/include/Makefile
c++/Makefile
c++/include/Makefile
c++/include/gensio/Makefile
c++/lib/Makefile
c++/lib/libgensiocpp.pc
c++/tests/Makefile
c++/examples/Makefile
c++/swig/Makefile
c++/swig/include/Makefile
c++/swig/pygensio/Makefile
c++/swig/pygensio/include/Makefile
c++/swig/pygensio/include/gensio/Makefile
c++/swig/pygensio/tests/Makefile
c++/swig/pygensio/tests/runtest
c++/swig/go/Makefile
c++/swig/go/gensio/Makefile
c++/swig/go/examples/Makefile
c++/swig/go/tests/Makefile
c++/swig/go/tests/runtest
c++/swig/go/tests/testbase/Makefile
glib/libgensioglib.pc
glib/Makefile
glib/include/Makefile
glib/include/gensio/Makefile
glib/swig/Makefile
glib/swig/python/Makefile
glib/c++/Makefile
glib/c++/include/Makefile
glib/c++/include/gensio/Makefile
glib/c++/tests/Makefile
glib/c++/swig/Makefile
glib/c++/swig/pygensio/Makefile
tcl/libgensiotcl.pc
tcl/Makefile
tcl/include/Makefile
tcl/include/gensio/Makefile
tcl/swig/Makefile
tcl/swig/python/Makefile
tcl/c++/Makefile
tcl/c++/include/Makefile
tcl/c++/include/gensio/Makefile
tcl/c++/tests/Makefile
tcl/c++/swig/Makefile
tcl/c++/swig/pygensio/Makefile
include/Makefile
include/gensio/Makefile
include/gensio/gensio_version.h
tests/Makefile
tools/Makefile
man/Makefile
examples/Makefile
tests/runtest
tests/gensios_enabled.py
tests/reflector.py])
AC_OUTPUT