forked from willamowius/gnugk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
1537 lines (1307 loc) · 43.5 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
AC_INIT(gk.h)
AC_PROG_CXX
dnl ########################################################################
dnl Check if recv call supports MSG_NOSIGNAL flag
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
],
[recv(0,NULL,1,MSG_NOSIGNAL);], HAS_MSG_NOSIGNAL=1, HAS_MSG_NOSIGNAL=0)
if test "$HAS_MSG_NOSIGNAL" = 0 ; then
AC_MSG_RESULT(MSG_NOSIGNAL not supported by recv() call)
else
AC_MSG_RESULT(MSG_NOSIGNAL supported by recv() call)
STDCCFLAGS="-DHAS_MSG_NOSIGNAL=1 $STDCCFLAGS"
fi
dnl ########################################################################
dnl look for ptlib, use a preference order of explicit PTLIBDIR, directory
dnl at same level, home directory, /usr/local or /usr.
if test "${PTLIBDIR:-unset}" != "unset" ; then
if test -d ${PTLIBDIR}; then
AC_CHECK_FILE(${PTLIBDIR}/make/unix.mak, HAS_PTLIB=1)
fi
if test "${HAS_PTLIB:-unset}" != "unset" ; then
AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , ${PTLIBDIR}/make)
fi
fi
if test "${HAS_PTLIB:-unset}" = "unset" ; then
if test -d ${HOME}/ptlib/include; then
AC_CHECK_FILE(${HOME}/ptlib/include/ptlib.h, HAS_PTLIB=1)
fi
if test "${HAS_PTLIB:-unset}" != "unset" ; then
PTLIBDIR="${HOME}/ptlib"
AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , ${PTLIBDIR}/make)
else
if test -d ../ptlib; then
AC_CHECK_FILE(../ptlib/include/ptlib.h, HAS_PTLIB=1)
fi
if test "${HAS_PTLIB:-unset}" != "unset" ; then
PTLIBDIR="../ptlib"
AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , ${PTLIBDIR}/make)
else
if test -d /usr/local/include; then
AC_CHECK_FILE(/usr/local/include/ptlib.h, HAS_PTLIB=1)
fi
if test "${HAS_PTLIB:-unset}" != "unset" ; then
AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/local/share/ptlib/make:/usr/local/bin:/usr/bin)
else
if test -d /usr/include; then
AC_CHECK_FILE(/usr/include/ptlib.h, HAS_PTLIB=1)
fi
if test "${HAS_PTLIB:-unset}" != "unset" ; then
AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/share/ptlib/make/)
fi
fi
fi
fi
fi
if test "${HAS_PTLIB:-unset}" = "unset" ; then
echo "Cannot find PTLib - please install or set PTLIBDIR and try again"
exit
fi
if test "${PTLIBDIR:-unset}" = "unset" ; then
if test "${PTLIB_CONFIG:-unset}" = "unset" ; then
echo "Cannot find ptlib-config - please install and try again"
exit
fi
PTLIBDIR=`$PTLIB_CONFIG --prefix`
fi
echo "PTLib prefix set to $PTLIBDIR"
AC_SUBST(PTLIBDIR)
dnl ########################################################################
dnl extract the PTLIB version
if test "${PTLIB_CONFIG:-unset}" = "unset"; then
AC_CHECK_FILE(${PTLIBDIR}/version.h, HAS_PTLIB_VERSION_FILE=1)
if test "${HAS_PTLIB_VERSION_FILE:-unset}" != "unset"; then
PTLIB_MAJOR_VERSION=`cat ${PTLIBDIR}/version.h | grep MAJOR_VERSION | cut -f3 -d' '`
PTLIB_MINOR_VERSION=`cat ${PTLIBDIR}/version.h | grep MINOR_VERSION | cut -f3 -d' '`
PTLIB_BUILD_NUMBER=`cat ${PTLIBDIR}/version.h | grep BUILD_NUMBER | cut -f3 -d' '`
PTLIB_VERSION="${PTLIB_MAJOR_VERSION}.${PTLIB_MINOR_VERSION}.${PTLIB_BUILD_NUMBER}"
else
AC_CHECK_FILE(${PTLIBDIR}/ptbuildopts.h, HAS_PTLIB_VERSION_FILE=1)
if test "${HAS_PTLIB_VERSION_FILE:-unset}" != "unset"; then
PTLIB_MAJOR_VERSION=`cat ${PTLIBDIR}/ptbuildopts.h | grep PTLIB_MAJOR | cut -f3 -d' '`
PTLIB_MINOR_VERSION=`cat ${PTLIBDIR}/ptbuildopts.h | grep PTLIB_MINOR | cut -f3 -d' '`
PTLIB_BUILD_NUMBER=`cat ${PTLIBDIR}/ptbuildopts.h | grep PTLIB_BUILD | cut -f3 -d' '`
PTLIB_VERSION="${PTLIB_MAJOR_VERSION}.${PTLIB_MINOR_VERSION}.${PTLIB_BUILD_NUMBER}"
fi
fi
else
PTLIB_VERSION=`${PTLIB_CONFIG} --version`
PTLIB_MAJOR_VERSION=[`echo "${PTLIB_VERSION}" | sed -e "s/\([0-9]*\)\.[0-9]*\.[0-9]*.*/\1/"`]
PTLIB_MINOR_VERSION=[`echo "${PTLIB_VERSION}" | sed -e 's/[0-9]*\.\([0-9]*\)\.[0-9]*.*/\1/'`]
PTLIB_BUILD_NUMBER=[`echo "${PTLIB_VERSION}" | sed -e 's/[0-9]*\.[0-9]*\.\([0-9]*\).*/\1/'`]
fi
if test "${PTLIB_VERSION:-unset}" = "unset" -o "${PTLIB_VERSION}" = ".."; then
echo "Error: could not determine PWLib version"
exit
fi
echo "PTLib version is ${PTLIB_VERSION}"
if test ${PTLIB_MAJOR_VERSION} -lt 1; then
echo "Error: at leat PWLib version 1.7.5.2 (Pandora) required"
exit
fi
if test ${PTLIB_MAJOR_VERSION} -eq 1; then
if test ${PTLIB_MINOR_VERSION} -lt 7; then
echo "Error: at leat PWLib version 1.7.5.2 (Pandora) required"
exit
elif test ${PTLIB_MINOR_VERSION} -eq 7; then
if test ${PTLIB_BUILD_NUMBER} -lt 5; then
echo "Error: at leat PWLib version 1.7.5.2 (Pandora) required"
exit
fi
fi
fi
AC_SUBST(PTLIB_VERSION)
dnl ########################################################################
dnl look for OpenH323/H323plus, use a preference order of explicit OPENH323DIR, directory
dnl at same level, home directory, /usr/local or /usr.
NEEDOPENH323PREFIX=0
if test "${OPENH323DIR:-unset}" != "unset" ; then
if test -d ${OPENH323DIR}; then
AC_CHECK_FILE(${OPENH323DIR}/openh323u.mak, HAS_OPENH323=1)
fi
fi
if test "${HAS_OPENH323:-unset}" = "unset" ; then
if test -d ${PTLIBDIR}/../h323plus; then
AC_CHECK_FILE(${PTLIBDIR}/../h323plus/version.h, HAS_OPENH323=1)
fi
if test "${HAS_OPENH323:-unset}" != "unset" ; then
OPENH323DIR="${PTLIBDIR}/../h323plus"
else
if test -d ${HOME}/h323plus/include; then
AC_CHECK_FILE(${HOME}/h323plus/include/h323.h, HAS_OPENH323=1)
fi
if test "${HAS_OPENH323:-unset}" != "unset" ; then
OPENH323DIR="${HOME}/h323plus"
else
if test -d /usr/local/include/openh323; then
AC_CHECK_FILE(/usr/local/include/openh323/h323.h, HAS_OPENH323=1)
fi
if test "${HAS_OPENH323:-unset}" != "unset" ; then
OPENH323DIR="/usr/local"
OPENH323INSTALLPREFIX="/usr/local"
NEEDOPENH323PREFIX=1
else
if test -d /usr/include/openh323; then
AC_CHECK_FILE(/usr/include/openh323/h323.h, HAS_OPENH323=1)
fi
if test "${HAS_OPENH323:-unset}" != "unset" ; then
OPENH323DIR="/usr"
OPENH323INSTALLPREFIX="/usr"
NEEDOPENH323PREFIX=1
fi
fi
fi
fi
fi
if test "${HAS_OPENH323:-unset}" = "unset" ; then
echo "Cannot find OpenH323/H323Plus - please install or set OPENH323DIR and try again"
exit
fi
if test -d "${OPENH323DIR}/share/openh323"; then
OPENH323MAKEDIR=${OPENH323DIR}/share/openh323/
fi
echo "OpenH323/H323Plus prefix set to $OPENH323DIR"
if test "${OPENH323MAKEDIR:-unset}" = "unset"; then
OPENH323MAKEDIR=${OPENH323DIR}
fi
AC_SUBST(OPENH323DIR)
AC_SUBST(OPENH323MAKEDIR)
dnl ########################################################################
dnl extract the OpenH323/H323Plus version
if test -d ${OPENH323DIR}; then
AC_CHECK_FILE(${OPENH323DIR}/version.h, HAS_OPENH323_VERSIONFILE=1)
if test "${HAS_OPENH323_VERSIONFILE:-unset}" != "unset"; then
OPENH323_VERSION_FILE=${OPENH323DIR}/version.h
OPENH323_MAJOR_VERSION=`cat ${OPENH323_VERSION_FILE} | grep MAJOR_VERSION | cut -f3 -d' '`
OPENH323_MINOR_VERSION=`cat ${OPENH323_VERSION_FILE} | grep MINOR_VERSION | cut -f3 -d' '`
OPENH323_BUILD_NUMBER=`cat ${OPENH323_VERSION_FILE} | grep BUILD_NUMBER | cut -f3 -d' '`
BUILDOPTS="${OPENH323DIR}/include/openh323buildopts.h"
else
AC_CHECK_FILE(${OPENH323MAKEDIR}/openh323buildopts.h, HAS_OPENH323_VERSIONFILE=1)
if test "${HAS_OPENH323_VERSIONFILE:-unset}" != "unset"; then
OPENH323_VERSION_FILE=${OPENH323MAKEDIR}/openh323buildopts.h
OPENH323_MAJOR_VERSION=`cat ${OPENH323_VERSION_FILE} | grep "#define OPENH323_MAJOR" | cut -f3 -d' '`
OPENH323_MINOR_VERSION=`cat ${OPENH323_VERSION_FILE} | grep "#define OPENH323_MINOR" | cut -f3 -d' '`
OPENH323_BUILD_NUMBER=`cat ${OPENH323_VERSION_FILE} | grep "#define OPENH323_BUILD " | cut -f3 -d' '`
BUILDOPTS="${OPENH323MAKEDIR}/openh323buildopts.h"
else
AC_CHECK_FILE(${OPENH323MAKEDIR}/../../include/openh323/openh323buildopts.h, HAS_OPENH323_VERSIONFILE=1)
if test "${HAS_OPENH323_VERSIONFILE:-unset}" != "unset"; then
OPENH323_VERSION_FILE=${OPENH323MAKEDIR}/../../include/openh323/openh323buildopts.h
OPENH323_MAJOR_VERSION=`cat ${OPENH323_VERSION_FILE} | grep "#define OPENH323_MAJOR" | cut -f3 -d' '`
OPENH323_MINOR_VERSION=`cat ${OPENH323_VERSION_FILE} | grep "#define OPENH323_MINOR" | cut -f3 -d' '`
OPENH323_BUILD_NUMBER=`cat ${OPENH323_VERSION_FILE} | grep "#define OPENH323_BUILD " | cut -f3 -d' '`
BUILDOPTS="${OPENH323MAKEDIR}/../../include/openh323/openh323buildopts.h"
fi
fi
fi
fi
if test "${HAS_OPENH323_VERSIONFILE:-unset}" != "unset"; then
if test "${OPENH323_MAJOR_VERSION}" = ""; then
echo "Error: Could not determine OpenH323/H323Plus version"
exit
fi
OPENH323_VERSION="${OPENH323_MAJOR_VERSION}.${OPENH323_MINOR_VERSION}.${OPENH323_BUILD_NUMBER}"
echo "OpenH323/H323Plus version is ${OPENH323_VERSION}"
else
echo "Error: Could not determine OpenH323/H323Plus version"
exit
fi
if test ${OPENH323_MAJOR_VERSION} -lt 1; then
echo "Error: at leat OpenH323/H323Plus version 1.14.4.2 (Pandora) required"
exit
fi
if test ${OPENH323_MAJOR_VERSION} -eq 1; then
if test ${OPENH323_MINOR_VERSION} -lt 14; then
echo "Error: at leat OpenH323/H323Plus version 1.14.4.2 (Pandora) required"
exit
elif test ${OPENH323_MINOR_VERSION} -eq 14; then
if test ${OPENH323_BUILD_NUMBER} -lt 4; then
echo "Error: at leat OpenH323/H323Plus version 1.14.4.2 (Pandora) required"
exit
fi
fi
fi
AC_SUBST(OPENH323_VERSION)
dnl ########################################################################
dnl set the PREFIX accordingly
if test "x$prefix" = "xNONE"; then
INSTALLPREFIX="/usr/local"
else
INSTALLPREFIX="${prefix}"
fi
AC_SUBST(INSTALLPREFIX)
dnl ########################################################################
dnl check for H.460.17
dnl ########################################################################
dnl MSWIN_DISPLAY h46017,H.460.17 support
dnl MSWIN_DEFINE h46017,HAS_H46017
AC_ARG_ENABLE(h46017,
[ --enable-h46017 enable H.460.17 support (default=yes)],
[ h46017="${enableval}" ], [h46017="yes"]
)
H460SUPPORT=`cat ${BUILDOPTS} | grep 'define H323_H460'`
if test "${H460SUPPORT:-unset}" = "unset" ; then
if test "x${h46017}" != "xno" ; then
AC_MSG_RESULT(No H.460 support available)
fi
h46017="no"
fi
if test "x${h46017}" != "xno" ; then
HAS_H46017=1
AC_DEFINE(HAS_H46017, 1)
STDCCFLAGS="-DHAS_H46017=1 $STDCCFLAGS"
echo "H.460.17 support enabled"
else
echo "H.460.17 support disabled"
HAS_H46017=0
fi
AC_SUBST(HAS_H46017)
dnl ########################################################################
dnl Switch for H.460.18 / .19
dnl ########################################################################
dnl MSWIN_DISPLAY h46018,H.460.18/.19 support (check patent license)
dnl MSWIN_DEFAULT h46018,Disabled
dnl MSWIN_DEFINE h46018,HAS_H46018
AC_ARG_ENABLE(h46018,
[ --enable-h46018 enable H.460.18 / H.460.19 support (default=no) check patent license before enabling],
[ h46018="${enableval}" ], [h46018="no"]
)
H460SUPPORT=`cat ${BUILDOPTS} | grep 'define H323_H460'`
if test "${H460SUPPORT:-unset}" = "unset" ; then
if test "x${h46018}" != "xno" ; then
AC_MSG_RESULT(No H.460 support available)
fi
h46018="no"
fi
if test "x${h46018}" != "xno" ; then
HAS_H46018=1
AC_DEFINE(HAS_H46018, 1)
STDCCFLAGS="-DHAS_H46018=1 $STDCCFLAGS"
echo "H.460.18 / H.460.19 support enabled"
else
echo "H.460.18 / H.460.19 support disabled"
HAS_H46018=0
fi
AC_SUBST(HAS_H46018)
dnl ########################################################################
dnl check for H.460.23 / .24
dnl ########################################################################
dnl MSWIN_DISPLAY h46023,H.460.23/.24 support
dnl MSWIN_DEFINE h46023,HAS_H46023
AC_ARG_ENABLE(h46023,
[ --enable-h46023 enable H.460.23 / H.460.24 support (default=yes)],
[ h46023="${enableval}" ], [h46023="yes"]
)
H460SUPPORT=`cat ${BUILDOPTS} | grep 'define H323_H460'`
if test "${H460SUPPORT:-unset}" = "unset" ; then
if test "x${h46023}" != "xno" ; then
AC_MSG_RESULT(No H.460 support available)
fi
h46023="no"
fi
if test "x${h46023}" != "xno" ; then
HAS_H46023=1
AC_DEFINE(HAS_H46023, 1)
STDCCFLAGS="-DHAS_H46023=1 $STDCCFLAGS"
echo "H.460.23 / H.460.24 support enabled"
else
echo "H.460.23 / H.460.24 support disabled"
HAS_H46023=0
fi
AC_SUBST(HAS_H46023)
dnl #########################################################################
dnl Check for RADIUS
dnl ########################################################################
dnl MSWIN_DISPLAY radius,RADIUS
dnl MSWIN_DEFAULT radius,Disabled
dnl MSWIN_DEFINE radius,HAS_RADIUS=1
AC_ARG_ENABLE(radius,
[ --enable-radius enable RADIUS support (default=no)],
[ radius="${enableval}" ], [radius="no"]
)
if test "x${radius}" != "xno" ; then
HAS_RADIUS=1
AC_DEFINE(HAS_RADIUS, 1)
STDCCFLAGS="-DHAS_RADIUS=1 $STDCCFLAGS"
SOURCES="$SOURCES radproto.cxx radauth.cxx radacct.cxx"
HEADERS="$HEADERS radproto.h radauth.h radacct.h"
echo "RADIUS support enabled"
else
echo "RADIUS support disabled"
HAS_RADIUS=0
fi
AC_SUBST(HAS_RADIUS)
dnl #########################################################################
dnl Check for LARGE FDSET
dnl ########################################################################
dnl MSWIN_DISPLAY large-fdset,LARGE_FDSET
dnl MSWIN_DEFAULT large-fdset,Disabled
dnl MSWIN_DEFINE large-fdset,LARGE_FDSET=1
AC_ARG_ENABLE(large-fdset,
[ --enable-large-fdset support large number of sockets (default=no)],
[ largefdset="${enableval}" ], [largefdset="no"]
)
if test "x${largefdset}" != "xno" ; then
LARGE_FDSET=1
AC_DEFINE(LARGE_FDSET, 1)
STDCCFLAGS="-DLARGE_FDSET=1 $STDCCFLAGS"
echo "LARGE FDSET support enabled"
else
LARGE_FDSET=0
echo "LARGE FDSET support disabled"
fi
AC_SUBST(LARGE_FDSET)
dnl #########################################################################
dnl Check for MySQL
dnl ########################################################################
dnl MSWIN_DISPLAY mysql,MySQL
dnl MSWIN_CHECK_FILE mysql,include\mysql.h,HAS_MYSQL=1
dnl MSWIN_DIR_SYMBOL mysql,MYSQL_DIR
dnl MSWIN_CHECK_DIR mysql,\Program Files\MySQL\MySQL Server 5.0
AC_ARG_ENABLE(mysql,
[ --enable-mysql enable MySQL support (default=yes)],
[ mysql="${enableval}" ], [ mysql="yes" ]
)
AC_ARG_WITH(mysql-include-dir,
[ --with-mysql-include-dir=DIR directory where the MySQL includes may be found ],
[ mysql_include_dir="$withval" ]
)
AC_ARG_WITH(mysql-dir,
[ --with-mysql-dir=DIR base directory where MySQL is installed ],
[ mysql_include_dir="$withval/include/mysql"
]
)
if test "x${mysql}" != "xno"; then
AC_CHECK_LIB(z, compress, MYSQL_LIBS=" -lz")
AC_MSG_CHECKING([for mysql.h])
AC_TRY_COMPILE([#include <mysql.h>], [int a = 1;],
MYSQL_INCLUDE=" ",
MYSQL_INCLUDE=
)
if test "x$MYSQL_INCLUDE" = "x"; then
old_CFLAGS="$CFLAGS"
for try in /usr/include/mysql /usr/local/include/mysql /usr/local/mysql/include/mysql $mysql_include_dir/mysql; do
if test -d $try; then
CFLAGS="$old_CFLAGS -I$try"
AC_TRY_COMPILE([#include <mysql.h>], [int a = 1;],
MYSQL_INCLUDE="-I$try",
MYSQL_INCLUDE=
)
if test "x$MYSQL_INCLUDE" != "x"; then
break;
fi
fi
done
CFLAGS="$old_CFLAGS"
fi
if test "x$MYSQL_INCLUDE" = "x"; then
AC_MSG_RESULT(no)
AC_MSG_WARN([mysql headers not found. Use --with-mysql-include-dir=<path>])
mysql="no"
else
sql_mysql_cflags="${sql_mysql_cflags} ${MYSQL_INCLUDE}"
AC_MSG_RESULT(yes)
fi
if test "x$mysql" = "xno"; then
AC_MSG_WARN([MySQL disabled])
fi
else
mysql="no"
fi
if test "x$mysql" != "xno"; then
HAS_MYSQL=1
AC_DEFINE(HAS_MYSQL, 1)
SOURCES="$SOURCES gksql_mysql.cxx"
STDCCFLAGS="${sql_mysql_cflags} -DHAS_MYSQL=1 $STDCCFLAGS"
echo "MySQL support enabled"
else
echo "MySQL support disabled"
HAS_MYSQL=0
fi
AC_SUBST(HAS_MYSQL)
dnl #########################################################################
dnl Check for PostgreSQL
dnl ########################################################################
dnl MSWIN_DISPLAY pgsql,PostgreSQL
dnl MSWIN_CHECK_FILE pgsql,\include\libpq-fe.h,HAS_PGSQL=1
dnl MSWIN_DIR_SYMBOL pgsql,PGSQL_DIR
dnl MSWIN_CHECK_DIR pgsql,\postgresql\libpq\
AC_ARG_ENABLE(pgsql,
[ --enable-pgsql enable PostgreSQL support (default=yes)],
[ pgsql="${enableval}" ], [ pgsql="yes" ]
)
AC_ARG_WITH(pgsql-include-dir,
[ --with-pgsql-include-dir=DIR directory where the PostgreSQL includes may be found ],
[ pgsql_include_dir="$withval" ]
)
AC_ARG_WITH(pgsql-dir,
[ --with-pgsql-dir=DIR base directory where PostgreSQL is installed ],
[ pgsql_include_dir="$withval/include"
]
)
if test "x${pgsql}" != "xno"; then
AC_MSG_CHECKING([for libpq-fe.h])
AC_TRY_COMPILE([#include <libpq-fe.h>], [int a = 1;],
PGSQL_INCLUDE=" ",
PGSQL_INCLUDE=
)
if test "x$PGSQL_INCLUDE" = "x"; then
old_CFLAGS="$CFLAGS"
for try in /usr/include/postgresql /usr/include/pgsql /usr/local/include /usr/local/include/pgsql /usr/local/pgsql/include $pgsql_include_dir; do
if test -d $try; then
CFLAGS="$old_CFLAGS -I$try"
AC_TRY_COMPILE([#include <libpq-fe.h>], [int a = 1;],
PGSQL_INCLUDE="-I$try",
PGSQL_INCLUDE=
)
if test "x$PGSQL_INCLUDE" != "x"; then
break;
fi
fi
done
CFLAGS="$old_CFLAGS"
fi
if test "x$PGSQL_INCLUDE" = "x"; then
AC_MSG_RESULT(no)
AC_MSG_WARN([pgsql headers not found. Use --with-pgsql-include-dir=<path>])
pgsql="no"
else
sql_pgsql_cflags="${sql_pgsql_cflags} ${PGSQL_INCLUDE}"
AC_MSG_RESULT(yes)
fi
if test "x$pgsql" = "xno"; then
AC_MSG_WARN([PostgreSQL disabled])
fi
else
pgsql="no"
fi
if test "x$pgsql" != "xno"; then
HAS_PGSQL=1
AC_DEFINE(HAS_PGSQL, 1)
SOURCES="$SOURCES gksql_pgsql.cxx"
STDCCFLAGS="${sql_pgsql_cflags} -DHAS_PGSQL=1 $STDCCFLAGS"
echo "PostgreSQL support enabled"
else
echo "PostgreSQL support disabled"
HAS_PGSQL=0
fi
AC_SUBST(HAS_PGSQL)
dnl #########################################################################
dnl Check for Firebird
dnl ########################################################################
dnl MSWIN_DISPLAY firebird,Firebird
dnl MSWIN_CHECK_FILE firebird,include\ibase.h,HAS_FIREBIRD=1
dnl MSWIN_DIR_SYMBOL firebird,FIREBIRD_DIR
AC_ARG_ENABLE(firebird,
[ --enable-firebird enable Interbase/Firebird support (default=yes)],
[ firebird="${enableval}" ], [ firebird="yes" ]
)
AC_ARG_WITH(firebird-include-dir,
[ --with-firebird-include-dir=DIR directory where Firebird includes may be found ],
[ firebird_include_dir="$withval" ]
)
AC_ARG_WITH(firebird-dir,
[ --with-firebird-dir=DIR base directory where Firebird is installed ],
[ firebird_include_dir="$withval/include"
]
)
if test "x${firebird}" != "xno"; then
AC_MSG_CHECKING([for ibase.h])
AC_TRY_COMPILE([#include <ibase.h>], [int a = 1;],
FIREBIRD_INCLUDE=" ",
FIREBIRD_INCLUDE=
)
if test "x$FIREBIRD_INCLUDE" = "x"; then
old_CFLAGS="$CFLAGS"
for try in /usr/include/firebird /usr/local/include /usr/local/include/firebird /usr/local/firebird/include $firebird_include_dir; do
if test -d $try; then
CFLAGS="$old_CFLAGS -I$try"
AC_TRY_COMPILE([#include <ibase.h>], [int a = 1;],
FIREBIRD_INCLUDE="-I$try",
FIREBIRD_INCLUDE=
)
if test "x$FIREBIRD_INCLUDE" != "x"; then
break;
fi
fi
done
CFLAGS="$old_CFLAGS"
fi
if test "x$FIREBIRD_INCLUDE" = "x"; then
AC_MSG_RESULT(no)
AC_MSG_WARN([Firebird headers not found. Use --with-firebird-include-dir=<path>])
firebird="no"
else
sql_firebird_cflags="${sql_firebird_cflags} ${FIREBIRD_INCLUDE}"
AC_MSG_RESULT(yes)
fi
if test "x$firebird" = "xno"; then
AC_MSG_WARN([Firebird disabled])
fi
else
firebird="no"
fi
if test "x$firebird" != "xno"; then
HAS_FIREBIRD=1
AC_DEFINE(HAS_FIREBIRD, 1)
SOURCES="$SOURCES gksql_firebird.cxx"
STDCCFLAGS="${sql_firebird_cflags} -DHAS_FIREBIRD=1 $STDCCFLAGS"
echo "Firebird support enabled"
else
echo "Firebird support disabled"
HAS_FIREBIRD=0
fi
AC_SUBST(HAS_FIREBIRD)
dnl #########################################################################
dnl Check for unixODBC
dnl ########################################################################
dnl MSWIN_DISPLAY odbc,ODBC support
dnl MSWIN_CHECK_FILE odbc,include\odbcinst.h,HAS_ODBC=1
dnl MSWIN_DIR_SYMBOL odbc,ODBC_DIR
dnl MSWIN_CHECK_DIR odbc,\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\
dnl MSWIN_CHECK_DIR odbc,\Program Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\
dnl MSWIN_CHECK_DIR odbc,\Program Files\Microsoft SDK\include\
dnl MSWIN_CHECK_DIR odbc,\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\
AC_ARG_ENABLE(unixodbc,
[ --enable-unixodbc enable unixODBC support (default=yes)],
[ unixodbc="${enableval}" ], [ unixodbc="yes" ]
)
AC_ARG_WITH(unixodbc-include-dir,
[ --with-unixodbc-include-dir=DIR directory where unixODBC includes may be found ],
[ unixodbc_include_dir="$withval" ]
)
AC_ARG_WITH(unixodbc-dir,
[ --with-unixodbc-dir=DIR base directory where unixODBC is installed ],
[ unixodbc_lib_dir="$withval/lib"
unixodbc_include_dir="$withval/include"
]
)
if test "x${unixodbc}" != "xno"; then
AC_MSG_CHECKING([for sqlext.h])
AC_TRY_COMPILE([#include <sqlext.h>], [int a = 1;],
UNIXODBC_INCLUDE=" ",
UNIXODBC_INCLUDE=
)
if test "x$UNIXODBC_INCLUDE" = "x"; then
old_CFLAGS="$CFLAGS"
for try in /usr/include/unixodbc /usr/local/include /usr/local/include/unixodbc /usr/local/unixodbc/include $unixodbc_include_dir; do
if test -d $try; then
CFLAGS="$old_CFLAGS -I$try"
AC_TRY_COMPILE([#include <sqlext.h>], [int a = 1;],
UNIXODBC_INCLUDE="-I$try",
UNIXODBC_INCLUDE=
)
if test "x$UNIXODBC_INCLUDE" != "x"; then
break;
fi
fi
done
CFLAGS="$old_CFLAGS"
fi
if test "x$UNIXODBC_INCLUDE" = "x"; then
AC_MSG_RESULT(no)
AC_MSG_WARN([unixODBC headers not found. Use --with-unixodbc-include-dir=<path>])
unixodbc="no"
else
sql_unixodbc_cflags="${sql_unixodbc_cflags} ${UNIXODBC_INCLUDE}"
AC_MSG_RESULT(yes)
fi
if test "x$unixodbc" = "xno"; then
AC_MSG_WARN([unixODBC disabled])
fi
else
unixodbc="no"
fi
if test "x$unixodbc" != "xno"; then
HAS_ODBC=1
AC_DEFINE(HAS_ODBC, 1)
SOURCES="$SOURCES gksql_odbc.cxx"
STDCCFLAGS="${sql_unixodbc_cflags} -DHAS_ODBC=1 $STDCCFLAGS"
echo "unixODBC support enabled"
else
echo "unixODBC support disabled"
HAS_ODBC=0
fi
AC_SUBST(HAS_ODBC)
dnl #########################################################################
dnl Check for SQLite
dnl ########################################################################
dnl MSWIN_DISPLAY sqlite,SQLite
dnl MSWIN_CHECK_FILE sqlite,sqlite3.h,HAS_SQLITE=1
dnl MSWIN_DIR_SYMBOL sqlite,SQLITE_DIR
dnl MSWIN_CHECK_DIR sqlite,\sqlite\
AC_ARG_ENABLE(sqlite,
[ --enable-sqlite enable SQLite support (default=yes)],
[ sqlite="${enableval}" ], [ sqlite="yes" ]
)
AC_ARG_WITH(sqlite-include-dir,
[ --with-sqlite-include-dir=DIR directory where SQLite includes may be found ],
[ sqlite_include_dir="$withval" ]
)
AC_ARG_WITH(sqlite-dir,
[ --with-sqlite-dir=DIR base directory where SQLite is installed ],
[ sqlite_include_dir="$withval/include"
]
)
if test "x${sqlite}" != "xno"; then
AC_MSG_CHECKING([for sqlite3.h])
AC_TRY_COMPILE([#include <sqlite3.h>], [int a = 1;],
SQLITE_INCLUDE=" ",
SQLITE_INCLUDE=
)
if test "x$SQLITE_INCLUDE" = "x"; then
old_CFLAGS="$CFLAGS"
for try in /usr/include/sqlite /usr/local/include /usr/local/include/sqlite $sqlite_include_dir; do
if test -d $try; then
CFLAGS="$old_CFLAGS -I$try"
AC_TRY_COMPILE([#include <sqlite3.h>], [int a = 1;],
SQLITE_INCLUDE="-I$try",
SQLITE_INCLUDE=
)
if test "x$SQLITE_INCLUDE" != "x"; then
break;
fi
fi
done
CFLAGS="$old_CFLAGS"
fi
if test "x$SQLITE_INCLUDE" = "x"; then
AC_MSG_RESULT(no)
AC_MSG_WARN([SQLite headers not found. Use --with-sqlite-include-dir=<path>])
sqlite="no"
else
sql_sqlite_cflags="${sql_sqlite_cflags} ${SQLITE_INCLUDE}"
AC_MSG_RESULT(yes)
fi
if test "x$sqlite" = "xno"; then
AC_MSG_WARN([SQLite disabled])
fi
else
sqlite="no"
fi
if test "x$sqlite" != "xno"; then
HAS_SQLITE=1
AC_DEFINE(HAS_SQLITE, 1)
SOURCES="$SOURCES gksql_sqlite.cxx"
STDCCFLAGS="${sql_sqlite_cflags} -DHAS_SQLITE=1 $STDCCFLAGS"
echo "SQLite support enabled"
else
echo "SQLite support disabled"
HAS_SQLITE=0
fi
AC_SUBST(HAS_SQLITE)
dnl #########################################################################
dnl Check for redis
dnl ########################################################################
dnl MSWIN_DISPLAY redis,redis
dnl MSWIN_CHECK_FILE redis,hiredis.h,HAS_REDIS=1
dnl MSWIN_DIR_SYMBOL redis,REDIS_DIR
dnl MSWIN_CHECK_DIR redis,\redis\
AC_ARG_ENABLE(redis,
[ --enable-redis enable redis support (default=yes)],
[ redis="${enableval}" ], [ redis="yes" ]
)
AC_ARG_WITH(redis-include-dir,
[ --with-redis-include-dir=DIR directory where redis includes may be found ],
[ redis_include_dir="$withval" ]
)
AC_ARG_WITH(redis-dir,
[ --with-redis-dir=DIR base directory where redis is installed ],
[ redis_include_dir="$withval/include"
]
)
if test "x${redis}" != "xno"; then
AC_MSG_CHECKING([for hiredis.h])
AC_TRY_COMPILE([#include <hiredis.h>], [int a = 1;],
REDIS_INCLUDE=" ",
REDIS_INCLUDE=
)
if test "x$REDIS_INCLUDE" = "x"; then
old_CFLAGS="$CFLAGS"
for try in /usr/include/hiredis /usr/local/include /usr/local/include/hiredis $redis_include_dir; do
if test -d $try; then
CFLAGS="$old_CFLAGS -I$try"
AC_TRY_COMPILE([#include <hiredis.h>], [int a = 1;],
REDIS_INCLUDE="-I$try",
REDIS_INCLUDE=
)
if test "x$REDIS_INCLUDE" != "x"; then
break;
fi
fi
done
CFLAGS="$old_CFLAGS"
fi
if test "x$REDIS_INCLUDE" = "x"; then
AC_MSG_RESULT(no)
AC_MSG_WARN([redis headers not found. Use --with-redis-include-dir=<path>])
redis="no"
else
sql_redis_cflags="${sql_redis_cflags} ${REDIS_INCLUDE}"
AC_MSG_RESULT(yes)
fi
if test "x$redis" = "xno"; then
AC_MSG_WARN([redis disabled])
fi
else
redis="no"
fi
if test "x$redis" != "xno"; then
HAS_REDIS=1
AC_DEFINE(HAS_REDIS, 1)
SOURCES="$SOURCES gksql_redis.cxx"
STDCCFLAGS="${sql_redis_cflags} -DHAS_REDIS=1 $STDCCFLAGS"
ENDLDLIBS="-lhiredis $ENDLDLIBS"
echo "redis support enabled"
else
echo "redis support disabled"
HAS_REDIS=0
fi
AC_SUBST(HAS_REDIS)
dnl ########################################################################
dnl enable sqlauth, sqlacc if any DB present
dnl ########################################################################
if test "x$pgsql" != "xno" -o "x$mysql" != "xno" -o "x$firebird" != "xno" -o "x$unixodbc" != "xno" -o "x$sqlite" != "xno" -o "x$redis" != "xno"; then
SOURCES="$SOURCES sqlauth.cxx sqlacct.cxx gksql.cxx"
HEADERS="$HEADERS sqlacct.h gksql.h"
fi
dnl ########################################################################
dnl Check for libssh
dnl ########################################################################
dnl MSWIN_DISPLAY libssh,libSSH
dnl MSWIN_CHECK_FILE libssh,include\libssh\server.h,HAS_LIBSSH=1
dnl MSWIN_DIR_SYMBOL libssh,LIBSSH_DIR
dnl MSWIN_CHECK_DIR libssh,\libssh\
AC_ARG_ENABLE(libssh,
[ --enable-libssh enable libssh support (default=yes)],
[ libssh="${enableval}" ], [ libssh="yes" ]
)
AC_ARG_WITH(libssh-include-dir,
[ --with-libssh-include-dir=DIR directory where libssh includes may be found ],
[ libssh_include_dir="$withval" ]
)
AC_ARG_WITH(libssh-lib-dir,
[ --with-libssh-lib-dir=DIR directory where libssh libraries may be found ],
[ libssh_lib_dir="$withval" ]
)
AC_ARG_WITH(libssh-dir,
[ --with-libssh-dir=DIR base directory where libssh is installed ],
[ libssh_lib_dir="$withval/lib"
libssh_include_dir="$withval/include"
]
)
if test "x${libssh}" != "xno"; then
AC_MSG_CHECKING([for libssh/server.h])
old_CFLAGS="$CFLAGS"
for try in /usr/include /usr/local/include $libssh_include_dir; do
if test -d $try; then
CFLAGS="$old_CFLAGS -I$try"
AC_TRY_COMPILE([#include <libssh/libssh.h>], [int a = 1;],
LIBSSH_INCLUDE="-I$try",
LIBSSH_INCLUDE=
)
fi
done
CFLAGS="$old_CFLAGS"
if test "x$LIBSSH_INCLUDE" = "x"; then
AC_MSG_RESULT(no)
AC_MSG_WARN([libssh headers not found. Use --with-libssh-include-dir=<path>])
libssh="no"
else
libssh_cflags="${libssh_cflags} ${LIBSSH_INCLUDE}"
AC_MSG_RESULT(yes)
AC_MSG_CHECKING([for ssh_handle_key_exchange()/ssh_blocking_flush() in libssh])
old_LIBS="$LIBS"
GSSAPI_LIBS=`krb5-config --libs gssapi 2> /dev/null`
for try in /usr/lib /usr/local/lib $libssh_lib_dir; do
if test -d $try; then
LIBS="$old_LIBS -L$try -lssh -lcrypto -lz $GSSAPI_LIBS"
if test `uname` != "OpenBSD"; then
LIBS="$LIBS -lrt"
fi
AC_TRY_LINK([extern ssh_handle_key_exchange(); extern ssh_blocking_flush();], [ssh_handle_key_exchange(); ssh_blocking_flush();],
[ LIBSSH_LIBS="-lssh -lcrypto -lz $GSSAPI_LIBS"
LIBSSH_LDFLAGS="-L$try"
]
)
if test "x$LIBSSH_LDFLAGS" != "x"; then
break;
fi
fi
done
LIBS="$old_LIBS"
if test "x$LIBSSH_LDFLAGS" = "x"; then
AC_MSG_RESULT(no)
LIBSSH_INCLUDE=
AC_MSG_WARN([libssh lib not found. Use --with-libssh-lib-dir=<path>])
libssh="no"
else
AC_MSG_RESULT(yes)
libssh_ldflags="$libssh_ldflags $LIBSSH_LDFLAGS"
fi
fi
libssh_ldflags="$libssh_ldflags $LIBS"
if test "x$libssh" = "xno"; then
AC_MSG_WARN([libssh disabled])
fi