This repository has been archived by the owner on Feb 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
configure.ac
1496 lines (1308 loc) · 38.6 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
dnl Pawe³ Pa³ucha <[email protected]>
dnl
dnl $Id$
dnl
AC_PREREQ(2.54)
AC_INIT(szarp, 3.1, [email protected])
AC_CONFIG_MACRO_DIR([m4])
# Cross compilation - this must be early in configure.in
AC_CANONICAL_TARGET
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([-Wno-portability subdir-objects])
AC_CONFIG_HEADERS(config.h)
# Set default prefix
AC_PREFIX_DEFAULT([/opt/szarp])
# Sets prefix where libraries are stored. This is designed for cross complatoin
# where we usualy want to set --prefix=/usr/<arch> but this also affects installation
# directory. This option only sets where to search libraries. So cross compilation
# can be simply configured using:
#
# ./configure --host=arm-linux-gnueabi --with-prefix=/usr/arm-linux-gnueabi
#
AC_ARG_WITH([prefix],
AC_HELP_STRING([--with-prefix=<dir>],
[Set default path where libraries are stored. Defult is /usr/]),
[
if test "$withval" = "no" ; then
lib_prefix="/usr/"
else
lib_prefix="$withval"
fi
], [lib_prefix="/usr/"])
# Debugging of configure script
AC_ARG_ENABLE([debug-config],
AC_HELP_STRING([--enable-debug-config],
[Print some configure script debbuging info (for
maintainers only)]),
debug_config=yes, )
# Locales
ALL_LINGUAS="pl"
# Compilers
# default CFLAGS and CXXFLAGS to empty
: ${CFLAGS=""}
: ${CXXFLAGS=""}
# use AM_FLAGS for default CXXFLAGS
#TODO: switch to C14 macro, when all distributions support it
: ${AM_CXXFLAGS="-O2 -g -Wall -std=c++14"}
AC_SUBST([AM_CXXFLAGS])
AC_CHECK_PROG([CCACHE],[ccache],[ccache],[])
AC_PROG_CC
AC_PROG_CXX
if test "x${CCACHE}" = "xccache" ;then
CC="$CCACHE $CC"
CXX="$CCACHE $CXX"
fi
# C++ preprocesor (sets CXXCPP)
AC_PROG_CXXCPP
#libtool
AC_PROG_LIBTOOL
#enable exe extensions in conditionaly built programs on pre 2.50 autoconf's
AC_EXEEXT
# we use pkg-config for configure, so check it first
PKG_PROG_PKG_CONFIG
if test "x$PKG_CONFIG" = "x" ; then
AC_MSG_ERROR([pkg-config is needed for configuring Szarp])
fi
# Programs needed for build.
# flex (sets LEX and LEXLIB)
AC_PROG_LEX
# check if function yylex_destroy is available (define HAVE_YYLEX_DESTROY)
AC_CHECK_YYLEX_DESTROY()
# ln -s (sets LN_S)
AC_PROG_LN_S
# bison (sets YACC)
AC_CHECK_PROG([YACC], [bison], [bison], [])
if test "x$YACC" = "x" ; then
AC_MSG_WARN([
bison program is needed for compiling Szarp
])
fi
AC_CHECK_PROG([DIALOG], [dialog], [dialog], [])
if test "x$DIALOG" = "x" ; then
AC_MSG_WARN([
dialog program is needed for configuring Szarp
])
fi
AC_CHECK_PROG([PROTOC], [protoc], [protoc], [])
if test "x$PROTOC" = "x" ; then
AC_MSG_WARN([
protoc compiler not present, it is needed
for compiling Szarp4 components
])
fi
AC_CHECK_PROG([ICONV], [iconv], [iconv], [])
if test "x$ICONV" = "x" ; then
AC_MSG_WARN([
iconv program not found, you will have problems but
we'll try to proceed...
])
fi
AC_CHECK_PROGS([JADE], [jade openjade], [])
if test "x$JADE" = "x" ; then
AC_MSG_WARN([
jade program not found - docs generation won't work
])
fi
AC_SUBST(JADE)
AC_CHECK_PROG([CONVERT], [convert], [convert], [])
if test "x$CONVERT" = "x" ; then
AC_MSG_WARN([
convert program not found - docs generation won't work
])
fi
AC_CHECK_PROG([KONWERT], [konwert], [konwert], [])
if test "x$KONWERT" = "x" ; then
AC_MSG_WARN([
konwert program not found - docs generation won't work
])
fi
AC_CHECK_PROG([PDFJADETEX], [pdfjadetex], [pdfjadetex], [])
if test "x$PDFJADETEX" = "x" ; then
AC_MSG_WARN([
pdfjadetex program not found - PDF docs generation won't work
])
fi
AC_CHECK_PROG([PYBABEL], [pybabel], [pybabel], [])
if test "x$PYBABEL" = "x" ; then
AC_MSG_WARN([
pybabel program not found - pylons apps will not be included
])
fi
#ICU
no_icu=
AX_CHECK_ICU([3], [ no_icu="no" ], [ no_icu="yes" ])
if test $no_icu = "yes"; then
AC_MSG_WARN([icu libarary not found. SZARP won't compile])
fi
# Headers
# Standard headers - stdlib.h and so on (sets STDC_HEADERS)
AC_HEADER_STDC
AC_UNISTD_H
# obsolete types
AC_CHECK_TYPE(uchar, unsigned char)
AC_CHECK_TYPE(ushort, unsigned short)
AC_CHECK_TYPE(ulong, unsigned long)
# return type for signal handlers, defines RETSIGTYPE
AC_TYPE_SIGNAL
AC_CHECK_LIB(gen, main)
AC_CHECK_LIB(m, sin)
AC_SEARCH_LIBS(fmodq, quadmath)
# Check endianness
big_endian=
AC_C_BIGENDIAN([big_endian=true],[],[])
if test -n "$big_endian" ; then
AC_DEFINE(SZARP_BIG_ENDIAN, 1, [Define to 1 if current architecture is big-endian])
fi
# Workaround for Moxa UC7410/7420 glibc bug.
# TODO: make a real check for this bug.
if test "$host_cpu" = "xscale" ; then
AC_MSG_WARN([Included workaround for arm/xscale glibc atomicitiy.h bug])
AC_DEFINE(ARM_ATOMICITY_BUG, 1, [Define to 1 if arm/xscale glibc bug is detected])
fi
if test "$build_os" != "linux-gnu" ; then
AC_MSG_WARN([
The only supported and tested build platform is
linux-gnu. Anything else is not supposed to work.
])
fi
AC_ARG_WITH([mingw32], AC_HELP_STRING([--with-mingw32],
[compile for mingw32 platform]), [
if test "$withval" = "no" ; then
with_mingw32="no"
else
with_mingw32="yes"
fi
], [with_mingw32="no"])
if test "$host_os" = "mingw32" -o "$host_os" = "mingw32msvc"; then
with_mingw32="yes"
fi
if test "$host_os" != "linux-gnu" -a "$with_mingw32" != "yes" ; then
AC_MSG_WARN([
The only supported and tested target platform are
linux-gnu and mingw-32. Anything else is not supposed
to work.
])
fi
AM_CONDITIONAL(MINGW32_OPT, test "x$with_mingw32" = "xyes")
#TODO: unlock if all distributions support this macro
# ( jessie support is dropped )
#if test "$with_mingw32" != "yes" ; then
# AX_CXX_COMPILE_STDCXX_14([],[mandatory])
#fi
# posix thread switches
if test "$with_mingw32" != "yes" ; then
AX_PTHREAD
fi
# Check for Python
no_python=""
AC_ARG_WITH([python], AC_HELP_STRING([--without-python], [do not use python]),
[
if test "$withval" = "no" ; then
no_python="yes"
else
no_python=""
fi
],)
if test "$no_python" != "yes" ; then
AM_PATH_PYTHON([2.4], [no_python=], [no_python="yes"])
if test "$no_python" = "yes" ; then
AC_MSG_WARN([
Python not found.
Check if 'python' program in installed in
your path.
])
fi
fi
# X windows tests (sets 'X_CFLAGS', 'X_PRE_LIBS', 'X_LIBS' and
# 'X_EXTRA_LIBS)
if test "$with_mingw32" != "yes" ; then
# X includes (sets 'x_libraries' or 'no_x', checks for '--without-x' option)
AC_PATH_X
# Extra X options (sets X_CFLAGS, X_LIBS, X_EXTRA_LIBS, X_PRE_LIBS)
AC_PATH_XTRA
X_LIBS="$X_EXTRA_LIBS $X_LIBS $X_PRE_LIBS"
if test -n "$x_includes" ; then
X_CFLAGS="$X_CFLAGS -I$x_includes"
fi
else
no_x=yes
fi
if test x$no_x != xyes ; then
no_x="yes"
PKG_CHECK_MODULES(X11, x11, no_x="no", [AC_MSG_RESULT([
x11-dev library not found on your system,
configuring without X Windows, error is: $X11_PKG_ERRORS
])
])
X_LIBS="$X11_LIBS $X_LIBS"
X_CFLAGS="$X11_CFLAGS $X_CFLAGS"
fi
if test x$no_x != xyes ; then
no_x="yes"
PKG_CHECK_MODULES(XT, xt, no_x="no", [AC_MSG_RESULT([
xt-dev library not found on your system,
configuring without X Windows, error is: $XT_PKG_ERRORS
])
])
X_LIBS="$XT_LIBS $X_LIBS"
X_CFLAGS="$XT_CFLAGS $X_CFLAGS"
fi
if test x$no_x != xyes ; then
no_x="yes"
PKG_CHECK_MODULES(SM, sm, no_x="no", [AC_MSG_RESULT([
sm-dev library not found on your system,
configuring without X Windows, error is: $SM_PKG_ERRORS
])
])
X_LIBS="$SM_LIBS $X_LIBS"
X_CFLAGS="$SM_CFLAGS $X_CFLAGS"
fi
if test x$no_x != xyes ; then
no_x="yes"
PKG_CHECK_MODULES(ICE, ice, no_x="no", [AC_MSG_RESULT([
ice-dev library not found on your system,
configuring without X Windows, error is: $ICE_PKG_ERRORS
])
])
X_LIBS="$ICE_LIBS $X_LIBS"
X_CFLAGS="$ICE_CFLAGS $X_CFLAGS"
fi
if test x$no_x != xyes ; then
no_x="yes"
PKG_CHECK_MODULES(XEXT, xext, no_x="no", [AC_MSG_RESULT([
xext-dev library not found on your system,
configuring without X Windows, error is: $XEXT_PKG_ERRORS
])
])
X_LIBS="$XEXT_LIBS $X_LIBS"
X_CFLAGS="$XEXT_CFLAGS $X_CFLAGS"
fi
if test x$no_x != xyes ; then
no_x="yes"
PKG_CHECK_MODULES(XPM, xpm, no_x="no", [AC_MSG_RESULT([
xpm-dev library not found on your system,
configuring without X Windows, error is: $XPM_PKG_ERRORS
])
])
X_LIBS="$XPM_LIBS $X_LIBS"
X_CFLAGS="$XPM_CFLAGS $X_CFLAGS"
fi
no_protobuf="yes"
if test x$with_mingw32 = xno; then
PKG_CHECK_MODULES(PROTOBUF, protobuf, no_protobuf="no", [AC_MSG_RESULT([
libprotobuf-dev library not found on your system,
it is required to build Szarp 4 components
])
])
fi
no_zmq="yes"
if test x$with_mingw32 = xno; then
PKG_CHECK_MODULES(ZMQ, libzmq, no_zmq="no", [AC_MSG_RESULT([
libzmq-dev library not found on your system,
it is required to build Szarp 4 components
])
])
fi
AH_VERBATIM([_GNU_SOURCE],
[/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif])
AH_VERBATIM([strfind],[
#define strfind(a,b) (strstr(a,b) ? (char *)(strstr(a,b)-a) : (char*) -1) /* This suxx...*/])
# wxWidgets options
AC_ARG_WITH([wx], AC_HELP_STRING([--without-wx], [do not use wxWidgets]),
[
if test "$withval" = "no" ; then
no_wx="yes"
else
no_wx=""
fi
], no_wx="" )
if test "x$no_x" = "xyes" -a "$with_mingw32" != "yes" ; then
no_wx="yes"
fi
# check for wxWidgets (sets WX_CPPFLAGS, WX_CXXFLAGS, WX_CFLAGS_ONLY, WX_LIBS)
AM_OPTIONS_WXCONFIG
wc_config_prefix="${lib_prefix}"
if test "$no_wx" != "yes" ; then
AM_PATH_WXCONFIG(3.0.2, [], [no_wx=yes])
if test ${WX_VERSION:0:1} != 3 ; then
AC_MSG_WARN([
Cannot build SZARP with wx version: $WX_VERSION (3.0.2 required)
Configuring without wxWidgets.
])
fi
if test "$no_wx" = "yes" ; then
AC_MSG_WARN([
wxWidgets must be installed on your system but wx-config
script couldn't be found.
Please check that wx-config is in path, the directory
where wxWidgets libraries are installed (returned by
'wx-config --libs' command) is in LD_LIBRARY_PATH or
equivalent variable and wxWidgets version is 3.0.2 or
above.
Configuring without wxWidgets.
])
fi
# Check for msgfmt to compile po files.
if test "x$no_wx" != "xyes" ; then
AC_PATH_PROG([MSGFMT], [msgfmt])
if test "x$MSGFMT" = "x" ; then
AC_MSG_WARN([
msgfmt program must be installed on your system
but couldn't be found.
Please check that getext package is properly
installed. Configuring without wxWidgets.
])
no_wx="yes"
fi
fi
if test "x$no_wx" != "xyes" ; then
AC_PATH_PROG([XGETTEXT], [xgettext])
if test "x$XGETTEXT" = "x" ; then
AC_MSG_WARN([
xgettext program must be installed on your system
but couldn't be found.
Please check that getext package is properly
installed. Configuring without wxWidgets.
])
no_wx="yes"
fi
fi
if test "x$no_wx" != "xyes" ; then
AC_PATH_PROG([MSGMERGE], [msgmerge])
if test "x$MSGMERGE" = "x" ; then
AC_MSG_WARN([
msgmerge program must be installed on your system
but couldn't be found.
Please check that getext package is properly
installed. Configuring without wxWidgets.
])
no_wx="yes"
fi
fi
if test "x$no_wx" != "xyes" ; then
AC_PATH_PROG([WXRC], [wxrc])
if test "x$WXRC" = "x" ; then
AC_MSG_WARN([
wxrc program couldn't be found. ])
fi
fi
if test "x$no_wx" != "xyes" ; then
AM_WX_GLCANVAS(no_wxglcanvas=no, no_wxglcanvas=yes)
if test "x$no_wxglcanvas" = "xyes" ; then
AC_MSG_WARN([
wxWidgets is configured without OpenGL support, disabling wx support.
])
AC_DEFINE(HAVE_GLCANVAS, 0, [Define to 1 when wxWidgets is compiled with GL support])
no_wx=yes
else
AC_DEFINE(HAVE_GLCANVAS, 1, [Define to 1 when wxWidgets is compiled with GL support])
fi
fi
fi
if test "$no_wx" != "yes" -a "$with_mingw32" = "yes" ; then
AC_CHECK_TARGET_TOOL([WINDRES], [windres])
fi
AC_SUBST(MSGFMT)
AC_SUBST(XGETTEXT)
AC_SUBST(MSGMERGE)
AC_SUBST(WINDRES)
if test "$with_mingw32" = "yes" ; then
CFLAGS="$CFLAGS -D__GNUWIN32__ -D__WIN32_IE=0x400 -D_WIN32_WINT=0x0502"
CXXFLAGS="$CXXFLAGS -D__GNUWIN32__ -D__WIN32_IE=0x400 -D_WIN32_WINNT=0x0502"
WX_CXXFLAGS="$WX_CXXFLAGS -DwxUSE_OWNER_DRAWN=1 -DwxUSE_GRAPHICS_CONTEXT=1"
MINGW32_LIBS="-lwsock32 -lshlwapi -liphlpapi -lws2_32 -liconv -lexpat"
AC_DEFINE(MINGW32, 1, [Define to 1 when compiling under mingw32
enviroment])
fi
AC_SUBST(MINGW32_LIBS)
# check for libxml2 (sets XML_CLAGS and XML_LIBS)
PKG_CHECK_MODULES([XML], [libxml-2.0], [no_xml=], [no_xml="yes"])
if test "$no_xml" = "yes" ; then
AC_MSG_WARN([
libxml2 must be installed on your system but xml2-config
script couldn't be found.
Please check that xml2-config is in path, the directory
where libxml2 libraries are installed (returned by
'xml2-config --libs' command) is in LD_LIBRARY_PATH or
equivalent variable and libxml2 version is 2.6.5 or
above.
Aborting configure.
])
fi
AC_PROG_XSLTPROC()
AC_CHECK_PROG([XMLLINT], [xmllint], [xmllint], [])
PKG_CHECK_MODULES([XSLT], [libxslt], [no_xslt=], [no_xslt="yes"])
if test "$no_xslt" = "yes" ; then
AC_MSG_WARN([
libxslt must be installed on your system but xslt-config
script couldn't be found.
Please check that xslt-config is in path, the directory
where libxslt libraries are installed (returned by
'xslt-config --libs' command) is in LD_LIBRARY_PATH or
equivalent variable and libxslt version is 1.1.0 or
above.
Aborting configure..
])
fi
# check for newt library
no_newt=""
AC_ARG_WITH([newt], AC_HELP_STRING([--without-newt], [do not use newt library]),
[
if test "$withval" = "no" ; then
no_newt="yes"
else
no_newt=""
fi
],[no_newt=""])
if test "$no_newt" != "yes" ; then
AC_LIB_NEWT( [], [no_newt=yes] )
if test x$no_newt = xyes ; then
AC_MSG_WARN([
newt library not found on your system, check if
libnewt development package is installed;
configuring without
])
fi
fi
if test "x$no_newt" = "xyes" ; then
AC_DEFINE(NO_NEWT, 1, [Define to 1 if libnewt library is not available])
fi
# Check for OpenSSL library
no_ssl=""
AC_ARG_WITH([ssl], AC_HELP_STRING([--without-ssl], [do not use OpenSSL library]),
[
if test "$withval" = "no" ; then
no_ssl="yes"
else
no_ssl=""
fi
],)
if test "$no_ssl" != "yes" ; then
AC_CHECK_LIB(ssl, SSL_new, [], [no_ssl=yes])
AC_CHECK_LIB([crypto], [CRYPTO_get_ex_data], [], [no_ssl=yes])
# check for older version, OpenSSL1.0
if test x$no_ssl = xyes; then
AC_PATH_SSL( [], [no_ssl=yes] )
fi
if test x$no_ssl = xyes ; then
AC_MSG_WARN([
OpenSSL library not found on your system, check if
libssl development package is installed;
configuring without
])
fi
fi
if test "x$no_ssl" = "xyes" ; then
AC_DEFINE(NO_SSL, 1, [Define to 1 if OpenSSL library is not available])
fi
# Check for c-ares library
no_cares="yes"
PKG_CHECK_MODULES(CARES, libcares, no_cares="no", [AC_MSG_RESULT([
c-ares library not found on your system, check if
c-ares development package is installed;
configuring without
])
])
if test "x$no_cares" = "xyes" ; then
AC_DEFINE(NO_CARES, 1, [Define to 1 if c-ares library is not available])
fi
no_xmlrpc_epi=""
AC_ARG_WITH([xmlrpc_epi], AC_HELP_STRING([--without-xmlrpc-epi], [do not use xmlrpc-epi library]),
[
if test "$withval" = "no" ; then
no_xmlrpc_epi="yes"
fi
],)
if test "$no_xmlrpc_epi" != "yes" ; then
AC_PATH_XMLRPC_EPI( [], [no_xmlrpc_epi=yes] )
if test x$no_xmlrpc_epi = xyes ; then
AC_MSG_WARN([
xmlrpc-epi library not found on your system, check if
xmlrpc-epi development package is installed;
configuring without
])
fi
fi
if test "x$no_xmlrpc_epi" = "xyes" ; then
AC_DEFINE(NO_XMLRPC_EPI, 1, [Define to 1 if xmlrpc-epi library is not available])
fi
# Check for PAM library
no_pam=""
AC_ARG_WITH([pam], AC_HELP_STRING([--without-pam], [do not use PAM library]),
[
if test "$withval" = "no" ; then
no_pam="yes"
else
no_pam=""
fi
],[no_pam=""])
if test "$no_pam" != "yes" ; then
AC_LIB_PAM( [], [no_pam=yes] )
if test x$no_pam = xyes ; then
AC_MSG_WARN([
PAM library not found on your system, check if
libpam development package is installed;
configuring without
])
fi
fi
if test "x$no_pam" = "xyes" ; then
AC_DEFINE(NO_PAM, 1, [Define to 1 if PAM library is not available])
fi
# curl options
AC_ARG_WITH([curl], AC_HELP_STRING([--without-curl], [do not use curl library]),
[
if test "$withval" = "no" ; then
no_curl="yes"
else
no_curl=""
fi
], [no_curl=""])
if test "$no_curl" != "yes" ; then
no_curl="yes"
PKG_CHECK_MODULES(CURL, libcurl, no_curl="no",[
AC_MSG_WARN([
curl library not found on your system, check if
libcurl development package is installed;
configuring without
])
])
fi
AM_CONDITIONAL(HAVE_CURL, test x$no_curl != xyes)
# Check for librsync library
no_rsync=""
AC_ARG_WITH([rsync], AC_HELP_STRING([--without-rsync], [do not use librsync library]),
[
if test "$withval" = "no" ; then
no_rsync="yes"
else
no_rsync=""
fi
],)
if test "$no_rsync" != "yes" ; then
AC_PATH_RSYNC( [], [no_rsync=yes] )
if test x$no_rsync = xyes ; then
AC_MSG_WARN([
librsync library not found on your system, check if
librsync development package is installed;
configuring without
])
fi
fi
if test "x$no_rsync" = "xyes" ; then
AC_DEFINE(NO_RSYNC, 1, [Define to 1 if librsync library is not available])
fi
# Check for lua library
no_lua=""
AC_ARG_WITH([luajit], AC_HELP_STRING([--without-luajit], [do not try to use LuaJIT]),
[
if test "$withval" = "no"; then
no_luajit="yes"
else
no_luajit=""
fi
],)
AC_ARG_WITH([lua], AC_HELP_STRING([--without-lua], [do not use lua]),
[
if test "$withval" = "no" ; then
no_lua="yes"
else
no_lua=""
fi
],)
if test "$no_luajit" != "yes"; then
no_luajit="yes"
PKG_CHECK_MODULES(LUA, luajit, no_luajit="no", [AC_MSG_RESULT([
LuaJIT not found on your system, will search for liblua
])
])
fi
if test "$no_lua" != "yes" -a "$no_luajit" != "no"; then
no_lua="yes"
PKG_CHECK_MODULES(LUA, lua5.1, no_lua="no", [AC_MSG_RESULT([
liblua library not found on your system,
configuring without
])
])
fi
if test "x$no_lua" = "xyes" ; then
AC_DEFINE(NO_LUA, 1, [Define to 1 if lua is not available])
fi
AM_CONDITIONAL(NO_LUA, test x$no_lua = xyes)
# Check for ldap library
no_ldap=""
AC_ARG_WITH([ldap], AC_HELP_STRING([--without-ldap], [do not use ldap]),
[
if test "$withval" = "no" ; then
no_ldap="yes"
else
no_ldap=""
fi
],)
if test "$no_ldap" != "yes" ; then
AC_PATH_LDAP( [], [no_ldap=yes] )
if test x$no_ldap = xyes ; then
AC_MSG_WARN([
ldap library not found on your system,
configuring without
])
fi
fi
# Check for lber library
no_lber=""
AC_ARG_WITH([lber], AC_HELP_STRING([--without-lber], [do not use lber]),
[
if test "$withval" = "no" ; then
no_lber="yes"
else
no_lber=""
fi
],)
if test "$no_lber" != "yes" ; then
AC_CHECK_HEADER(lber.h, [], [no_lber=yes])
if test x$no_lber != xyes; then
AC_CHECK_LIB(lber, ber_printf, [LBER_LIBS=-llber], [no_lber=yes])
fi
if test x$no_lber = xyes ; then
AC_MSG_WARN([
lber library not found on your system,
configuring without
])
fi
fi
AM_CONDITIONAL(NO_LBER, test x$no_lber = xyes)
AC_SUBST(LBER_LIBS)
#Check for FTGL library
AC_PATH_FREETYPE()
no_ftgl="yes"
AC_PATH_FTGL(no_ftgl="no", no_ftgl="yes")
if test "x$no_ftgl" != "xyes" ; then
AC_DEFINE(HAVE_FTGL, 1, [Define to 1 if ftgl is available])
fi
has_boost_base="no"
ac_boost_path="${lib_prefix}"
AX_BOOST_BASE_LOCAL([1.54.0], [has_boost_base="yes"], [has_boost_base="no"])
if test "x$has_boost_base" = "xyes" ; then
AX_BOOST_FILESYSTEM
AX_BOOST_DATE_TIME
AX_BOOST_THREAD
AX_BOOST_SYSTEM
AX_BOOST_PROGRAM_OPTIONS
AX_BOOST_LOCALE
if test "$with_mingw32" != "yes" ; then
AX_BOOST_ASIO
AX_BOOST_SIGNALS
AX_BOOST_REGEX
AX_PYTHON
AX_BOOST_PYTHON
fi
fi
has_boost_filesystem=${link_filesystem:-no}
has_boost_datetime=${link_date_time:-no}
has_boost_regex=${link_regex:-no}
has_boost_thread=${link_thread:-no}
has_boost_system=${link_system:-no}
has_boost_program_options=${link_program_options:-no}
has_boost_locale=${link_locale:-no}
#Check for LIBEVENT
no_libevent=""
AC_ARG_WITH([event], AC_HELP_STRING([--without-libevent], [do not use libevent library]),
[
if test "$withval" = "no" ; then
no_libevent="yes"
else
no_libevent=""
fi
],)
if test "x$no_libevent" != "xyes"; then
AC_CHECK_LIB(event, event_dispatch, [ EVENT_LIBS=-levent], [no_libevent=yes])
if test "x$no_libevent" = "xyes"; then
AC_MSG_WARN([
libevent library is not available, some programs will not be built
])
fi
fi
AC_SUBST(EVENT_LIBS)
#Check for glib library
no_glib="yes";
if test "x$with_mingw32" != "xyes"; then
PKG_CHECK_MODULES(GLIB, glib, no_glib="no", [AC_MSG_RESULT(no)])
fi
#Check for GDK library
no_gdk="yes";
if test "x$with_mingw32" != "xyes"; then
PKG_CHECK_MODULES(GDK, gdk-2.0, no_gdk="no", [AC_MSG_RESULT(no)])
fi
#Check for gtk library
no_gtk20="yes";
if test "x$with_mingw32" != "xyes"; then
PKG_CHECK_MODULES(GTK, gtk+-2.0, no_gtk20="no", [AC_MSG_RESULT(no)])
fi
#Check for wnck library
no_wnck="yes"
AC_ARG_WITH([wnck], AC_HELP_STRING([--with-wnck],
[compile with WNCK library]), [
if test "$withval" = "no" ; then
with_wnck="no"
else
with_wnck="yes"
fi
], with_wnck="no")
if test "x$with_wnck" = "xyes" ; then
PKG_CHECK_MODULES(WNCK, libwnck-1.0, no_wnck="no", [AC_MSG_RESULT([
libwnck library is not available, some programs will not be built
])])
fi
AM_CONDITIONAL(HAVE_WNCK, test x$no_wnck != xyes)
#Check for LIBSNAP7
no_snap7=""
AC_ARG_WITH([snap7], AC_HELP_STRING([--without-snap7], [do not use libsnap7 library]),
[
if test "$withval" = "no" ; then
no_libsnap7="yes"
else
no_libsnap7=""
fi
],)
if test "x$no_libsnap7" != "xyes"; then
AC_CHECK_LIB(snap7, Cli_Create, [ SNAP7_LIBS=-lsnap7], [no_libsnap7=yes])
if test "x$no_libsnap7" = "xyes"; then
AC_MSG_WARN([
libsnap7 library is not available, some programs will not be built
])
fi
fi
AC_SUBST(SNAP7_LIBS)
AM_CONDITIONAL([WANT_SNAP7DMN], [test "x$no_libsnap7" != "xyes"])
#Check for sqlite library
no_sqlite="yes";
PKG_CHECK_MODULES(SQLITE3, sqlite3, no_sqlite="no", [AC_MSG_RESULT([
sqllite3 library not found on your system,
configuring without
])
])
if test "x$no_sqlite" = "xyes"; then
AC_DEFINE(NO_SQLITE3, 1, [ Define to 1 if sqlite3 is not available ])
fi
# Check for libzip library
no_zip="yes"
PKG_CHECK_MODULES(ZIP, libzip, no_zip="no", [AC_MSG_RESULT([
libzip-dev library not found on your system,
configuring without libzip, error is $ZIP_PKG_ERRORS
])
])
# Debian packages building
AC_ARG_ENABLE([deb-build],
AC_HELP_STRING([--enable-deb-build],
[Configure for .deb packages build (creates slightly
modified install targets)]),
deb_build=yes, )
AM_CONDITIONAL(DEB_BUILD, test x$deb_build = xyes)
# xmlTextReader conditional building
AC_ARG_WITH([xmldom],
AC_HELP_STRING([--with-xmldom],
[Use legacy XML DOM instead of xmlTextReader]),
yes_xmldom=yes, )
if test "x$yes_xmldom" != "xyes"
then
AC_DEFINE(USE_XMLREADER, 1, [ Define to 1 when use xmlTextReader instead of XML DOM])
fi
# Debian packages building
AC_CHECK_FUNCS(index rindex scandir alphasort asprintf localtime_r gmtime_r timegm dirname basename pow10)
AH_VERBATIM([index],
[
#ifndef HAVE_INDEX
#define index strchr
#endif
#ifndef HAVE_RINDEX
#define rindex strrchr
#endif
])
AC_CHECK_HEADERS(libgen.h)
no_sys_queue=""
AC_CHECK_HEADERS(sys/queue.h, [no_sys_queue="no"], [no_sys_queue="yes"])
if test $no_sys_queue = "no"; then
AC_MSG_CHECKING(for TAILQ_FOREACH in sys/queue.h)
AC_EGREP_CPP(yes,
[
#include <sys/queue.h>
#ifdef TAILQ_FOREACH
yes
#endif
], [AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_TAILQFOREACH, 1,
[Define if TAILQ_FOREACH is defined in <sys/queue.h>])],
[AC_MSG_RESULT(no)]
)
fi
AH_VERBATIM([tailq],
[
#ifndef HAVE_TAILQFOREACH
#define TAILQ_FIRST(head) ((head)->tqh_first)
#define TAILQ_END(head) NULL
#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
#define TAILQ_FOREACH(var, head, field) \
for((var) = TAILQ_FIRST(head); \
(var) != TAILQ_END(head); \
(var) = TAILQ_NEXT(var, field))
#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
(elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
(elm)->field.tqe_next = (listelm); \
*(listelm)->field.tqe_prev = (elm); \
(listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
} while (0)
#endif /* TAILQ_FOREACH */
])
#############################################################################
# FOR DEVELOPERS
#############################################################################
# Subdirs included.
# Each subdir is tested for inclusion (some are always included).
# Every optional program has defined value PROGRAM_NAME. If program has to be
# compiled, PROGRAM_NAME value is set to program_name. Otherwise it is empty.
# Example:
# if test x$compile_optional_program = xyes ; then
# OPTIONAL_PROGRAM=optional_program
# fi
# AC_SUBST(OPTIONAL_PROGRAM)
# In Makefile.am use something like this:
# bin_PROGRAMS = @OPTIONAL_PROGRAM@
# EXTRA_PROGRAMS = optional_program
# Add subdirs
SUBDIRS=""