-
Notifications
You must be signed in to change notification settings - Fork 11
/
configure.ac
2526 lines (2300 loc) · 92.1 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT([nordugrid-arc],m4_normalize(m4_include(VERSION)),[http://bugzilla.nordugrid.org/])
dnl serial-tests is not recognized before 1.12, and required after 1.13
m4_define([serial_tests], [
m4_esyscmd([case `${AUTOMAKE:-automake} --version | head -n 1` in
*1.11.*|*1.10.*|*1.9.*);;
*) echo serial-tests;;
esac])
])
AM_INIT_AUTOMAKE([foreign 1.9 tar-pax] serial_tests)
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
baseversion=`echo $VERSION | sed 's/[[^0-9.]].*//'`
preversion=`echo $VERSION | sed 's/^[[0-9.]]*//'`
if test "x$baseversion" = "x" ; then
baseversion=$VERSION
preversion=""
fi
if test "x$preversion" = "x" ; then
fedorarelease="1"
fedorasetupopts="-q"
debianversion="$baseversion"
else
fedorarelease="0.$preversion"
fedorasetupopts="-q -n %{name}-%{version}$preversion"
debianversion="$baseversion~$preversion"
fi
# numeric ARC_VERSION_* used for API fall back to current release seriese (e.g. when 'master' is specified in VESRION file, the "6.0.0" will be used)
ARC_VERSION_MAJOR=`echo $VERSION | awk -F. '{print match($1, /^[[0-9]]+$/) ? $1 : "6"}'`
ARC_VERSION_MINOR=`echo $VERSION | awk -F. '{print match($2, /[[^ ]]/) ? $2 : "0"}'`
ARC_VERSION_PATCH=`echo $VERSION | awk -F. '{print match($3, /[[^ ]]/) ? $3 : "0"}'`
ARC_VERSION_NUM=`printf "0x%02x%02x%02x" $ARC_VERSION_MAJOR $ARC_VERSION_MINOR $ARC_VERSION_PATCH`
ARC_VERSION=`echo $ARC_VERSION_MAJOR.$ARC_VERSION_MINOR.$ARC_VERSION_PATCH`
AC_SUBST(baseversion)
AC_SUBST(preversion)
AC_SUBST(fedorarelease)
AC_SUBST(fedorasetupopts)
AC_SUBST(debianversion)
AC_SUBST(ARC_VERSION_MAJOR)
AC_SUBST(ARC_VERSION_MINOR)
AC_SUBST(ARC_VERSION_PATCH)
AC_SUBST(ARC_VERSION_NUM)
AC_SUBST(ARC_VERSION)
# This macro was introduced in autoconf 2.57g? but we currently only require 2.56
m4_ifdef([AC_CONFIG_MACRO_DIR], [AC_CONFIG_MACRO_DIR([m4])])
m4_pattern_allow([AC_PATH_PROG])
m4_pattern_allow([AC_MSG_WARN])
AC_PROG_CXX
AC_PROG_CC_STDC
AC_PROG_CPP
AC_GNU_SOURCE
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_DISABLE_STATIC
AM_PROG_LIBTOOL
AC_PATH_PROG(PERL, perl, /usr/bin/perl, :)
# EL-5 compatibility. $(mkdir_p) is now obsolete.
test -n "$MKDIR_P" || MKDIR_P="$mkdir_p"
AC_SUBST([MKDIR_P])
# Use arc for "pkgdir" instead of nordugrid-arc (@PACKAGE@)
pkgdatadir='${datadir}/arc'
pkgincludedir='${includedir}/arc'
pkglibdir='${libdir}/arc'
extpkglibdir='${libdir}/arc/external'
pkglibexecdir='${libexecdir}/arc'
AC_SUBST(pkgdatadir)
AC_SUBST(pkgincludedir)
AC_SUBST(pkglibdir)
AC_SUBST(extpkglibdir)
AC_SUBST(pkglibexecdir)
ARC_API
ARC_RELATIVE_PATHS
AC_ARG_WITH(systemd-units-location,
AC_HELP_STRING([--with-systemd-units-location=<PATH>], [Location of the systemd unit files. [[None]]]),
[ unitsdir="$withval" ],
[ unitsdir= ]
)
AC_MSG_RESULT($unitsdir)
AC_SUBST(unitsdir)
AM_CONDITIONAL([SYSTEMD_UNITS_ENABLED],[test "x$unitsdir" != "x"])
AC_ARG_WITH(sysv-scripts-location,
AC_HELP_STRING([--with-sysv-scripts-location=<PATH>], [Location of the SYSV init scripts. [[autodetect]]]),
[
initddirauto="no"
initddir="$withval"
],
[
initddirauto="yes"
initddir=
case "${host}" in
*linux* | *kfreebsd* | *gnu* )
for i in init.d rc.d/init.d rc.d; do
if test -d "/etc/$i" -a ! -h "/etc/$i" ; then
initddir="$sysconfdir/$i"
break
fi
done
if test -z "$initddir"; then
AC_MSG_WARN(could not find a suitable location for the SYSV init scripts - not installing)
fi
;;
esac
]
)
AC_MSG_RESULT($initddir)
AC_SUBST(initddir)
AM_CONDITIONAL([SYSV_SCRIPTS_ENABLED],[ ( test "x$initddirauto" == "xno" || test "x$unitsdir" = "x" ) && test "x$initddir" != "x"])
AC_ARG_WITH(cron-scripts-prefix,
AC_HELP_STRING([--with-cron-scripts-prefix=<PATH>], [Specify the location of the cron directory. [[SYSCONFDIR/cron.d]]]),
[ cronddir="$withval" ],
[ cronddir="$sysconfdir/cron.d" ]
)
AC_SUBST(cronddir)
# gettext
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.17])
[[ -r $srcdir/po/POTFILES.in ]] || touch $srcdir/po/POTFILES.in
# Portable 64bit file offsets
AC_SYS_LARGEFILE
# pkg-config needed for many checks
AC_PATH_TOOL(PKG_CONFIG, pkg-config, no)
if test "x$PKG_CONFIG" = "xno"; then
AC_MSG_ERROR([ *** pkg-config not found])
else
pkgconfigdir=${libdir}/pkgconfig
AC_SUBST(pkgconfigdir)
fi
# Default enable/disable switches
# Features
enables_ldap=yes
enables_mysql=no
enables_systemd=no
enables_swig_python=yes
# Features directly related to components
enables_cppunit=yes
enables_python=yes
enables_altpython=yes
enables_pylint=yes
enables_mock_dmc=no
enables_gfal=no
enables_s3=no
enables_xrootd=yes
enables_argus=no
enables_xmlsec1=yes
enables_dbjstore=yes
enables_sqlitejstore=yes
enables_ldns=yes
# Libraries and plugins
# Currently no fine-grained choice is supported.
# Also this variable is used to check if source
# build is needed at all because no component can
# be built without HED.
enables_hed=yes
# Services
enables_a_rex_service=yes
enables_internal=no
enables_gridftpd_service=yes
enables_ldap_service=yes
enables_candypond=yes
enables_datadelivery_service=yes
enables_monitor=yes
# Clients
enables_compute_client=yes
enables_credentials_client=yes
enables_data_client=yes
enables_emies_client=yes
enables_arcrest_client=yes
# Documentation
enables_doc=yes
# ACIX cache index
enables_acix=yes
# Handle group enable/disable switches
AC_ARG_ENABLE(all, AC_HELP_STRING([--disable-all], [disables all buildable components. Can be overwritten with --enable-* for group or specific component. It is also possible to use --enable-all to overwrite defaults for most of components.]),
[
enables_a_rex_service=$enableval
enables_internal=$enableval
enables_gridftpd_service=$enableval
enables_ldap_service=$enableval
enables_monitor=$enableval
enables_candypond=$enableval
enables_datadelivery_service=$enableval
enables_compute_client=$enableval
enables_credentials_client=$enableval
enables_echo_client=$enableval
enables_data_client=$enableval
enables_emies_client=$enableval
enables_arcrest_client=$enableval
enables_hed=$enableval
enables_python=$enableval
enables_altpython=$enableval
enables_pylint=$enableval
enables_mock_dmc=$enableval
enables_gfal=$enableval
enables_s3=$enableval
enables_xrootd=$enableval
enables_xmlsec1=$enableval
enables_argus=$enableval
enables_cppunit=$enableval
enables_doc=$enableval
enables_acix=$enableval
enables_dbjstore=$enableval
enables_sqlitejstore=$enableval
enables_ldns=$enableval
],
[])
AC_ARG_ENABLE(all-clients, AC_HELP_STRING([--disable-all-clients], [disables all buildable client components. Can be overwritten with --enable-* for specific component. It is also possible to use --enable-all-clients to overwrite defaults and --enable-all.]),
[
enables_compute_client=$enableval
enables_credentials_client=$enableval
enables_echo_client=$enableval
enables_data_client=$enableval
enables_emies_client=$enableval
enables_arcrest_client=$enableval
enables_doc=$enableval
],
[])
AC_ARG_ENABLE(all-data-clients, AC_HELP_STRING([--disable-all-data-clients], [disables all buildable client components providing data handling abilities. Can be overwritten with --enable-* for specific component. It is also possible to use --enable-all-data-clients to overwrite defaults, --enable-all and --enable-all-clients.]),
[
enables_data_client=$enableval
],
[])
AC_ARG_ENABLE(all-services, AC_HELP_STRING([--disable-all-services], [disables all buildable service componets. Can be overwritten with --enable-* for specific component. It is also possible to use --enable-all-services to overwrite defaults and --enable-all.]),
[
enables_a_rex_service=$enableval
enables_gridftpd_service=$enableval
enables_ldap_service=$enableval
enables_monitor=$enableval
enables_candypond=$enableval
enables_datadelivery_service=$enableval
enables_acix=$enableval
],
[])
# Be pedantic about compiler warnings.
AC_ARG_ENABLE(pedantic-compile, AC_HELP_STRING([--enable-pedantic-compile], [add pedantic compiler flags]),
[enables_pedantic_compile="yes"], [enables_pedantic_compile="no"])
if test "x$enables_pedantic_compile" = "xyes"; then
# This check need to be enhanced. It won't work in case of cross-compilation
# and if path to compiler is explicitly specified.
if test x"$CXX" = x"g++"; then
# GNU C/C++ flags
AM_CXXFLAGS="-Wall -Wextra -Werror -Wno-sign-compare -Wno-unused"
SAVE_CPPFLAGS=$CPPFLAGS
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
CPPFLAGS="$CPPFLAGS -Wno-unused-result"
AC_TRY_COMPILE([],[], [
AM_CXXFLAGS="$AM_CXXFLAGS -Wno-unused-result"
], [
AC_MSG_NOTICE([compilation flag -Wno-unused-result is not supported])
]
)
AC_LANG_RESTORE
CPPFLAGS=$SAVE_CPPFLAGS
else
# TODO: set generic flags for generic compiler
AM_CXXFLAGS=""
fi
AC_SUBST(AM_CXXFLAGS)
fi
AM_CONDITIONAL([PEDANTIC_COMPILE], [test "x$enables_pedantic_compile" = "xyes"])
# Enable/disable switches for third-party.
# Swig
AC_ARG_ENABLE(swig-python, AC_HELP_STRING([--disable-swig-python], [disable SWIG python bindings]),
[enables_swig_python=$enableval],[])
AC_ARG_ENABLE(swig, AC_HELP_STRING([--disable-swig], [disable all bindings through SWIG]),
[enables_swig_python=$enableval],[])
if test "$enables_swig_python" = "yes"; then
AC_PATH_PROGS(SWIG, swig)
if test "x$SWIG" = "x"; then
enables_swig="no"
else
swigver=`$SWIG -version 2>&1 | grep Version | sed 's/.* //'`
swigver1=`echo $swigver | cut -d. -f1`
swigver2=`echo $swigver | cut -d. -f2`
swigver3=`echo $swigver | cut -d. -f3`
if test $swigver1 -lt 1 || ( test $swigver1 -eq 1 && ( \
test $swigver2 -lt 3 || ( test $swigver2 -eq 3 && ( \
test $swigver3 -lt 25 ) ) ) ) ; then
AC_MSG_NOTICE([swig is too old (< 1.3.25)])
SWIG=""
enables_swig="no"
elif test $swigver1 -eq 1 && test $swigver2 -eq 3 && test $swigver3 -eq 38 ; then
AC_MSG_NOTICE([swig version 1.3.38 has bug which prevents it from being used for this software. Please upgrade or downgrade.])
SWIG=""
enables_swig="no"
else
SWIG2="no"
if test $swigver1 -ge 2
then
SWIG2="yes"
fi
AC_SUBST(SWIG2)
SWIG_PYTHON_NAMING="SwigPy"
# In SWIG version 1.3.37 naming was changed from "PySwig" to "SwigPy".
if test $swigver1 -lt 1 || ( test $swigver1 -eq 1 && ( \
test $swigver2 -lt 3 || ( test $swigver2 -eq 3 && ( \
test $swigver3 -lt 37 ) ) ) ) ; then
SWIG_PYTHON_NAMING="PySwig"
fi
AC_SUBST(SWIG_PYTHON_NAMING)
fi
fi
else
SWIG=""
fi
AM_CONDITIONAL([SWIG_ENABLED],[test "x$enables_swig" = "xyes"])
AC_ARG_ENABLE(hed, AC_HELP_STRING([--disable-hed], [disable building HED libraries and plugins. Do not do that unless You do not want to build anything. Even in that case better use --disable-all.]),
[enables_hed=$enableval],[])
# Python
if test "$enables_hed" = "yes"; then
AC_ARG_ENABLE(python,
AC_HELP_STRING([--disable-python], [disable Python components]),
[enables_python=$enableval
enables_swig_python=$enableval], [])
if test "$enables_python" = "yes"; then
AC_ARG_WITH(python, AC_HELP_STRING([--with-python=(PYTHON)],
[specify python program from PATH]))
# We do not look for python binary when cross-compiling
# but we need to make the variable non-empty
if test "${build}" = "${host}"; then
AC_PATH_PROGS(PYTHON, $with_python python)
else
PYTHON=/usr/bin/python
fi
if test "X$PYTHON" != "X"; then
PYNAME=`basename $PYTHON`
PKG_CHECK_MODULES(PYTHON, $PYNAME-embed, [
PYTHON_VERSION=`$PKG_CONFIG --modversion $PYNAME-embed`
PYTHON_MAJOR=`echo $PYTHON_VERSION|cut -f1 -d.`
],[
PKG_CHECK_MODULES(PYTHON, $PYNAME, [
PYTHON_VERSION=`$PKG_CONFIG --modversion $PYNAME`
PYTHON_MAJOR=`echo $PYTHON_VERSION|cut -f1 -d.`
],[
PYNAME=python-`$PYTHON -c 'import sys; print(".".join(sys.version.split(" ")[[0]].split(".")[[:2]]))'`
PKG_CHECK_MODULES(PYTHON, $PYNAME-embed, [
PYTHON_VERSION=`$PKG_CONFIG --modversion $PYNAME-embed`
PYTHON_MAJOR=`echo $PYTHON_VERSION|cut -f1 -d.`
],[
PKG_CHECK_MODULES(PYTHON, $PYNAME, [
PYTHON_VERSION=`$PKG_CONFIG --modversion $PYNAME`
PYTHON_MAJOR=`echo $PYTHON_VERSION|cut -f1 -d.`
],[
PYTHON_VERSION=`$PYTHON -c 'import sys; print(".".join(sys.version.split(" ")[[0]].split(".")[[:2]]))'`
PYTHON_MAJOR=`$PYTHON -c 'import sys; print(sys.version_info[[0]])'`
PYTHON_CFLAGS=-I`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_inc())'`
PY_LIBS=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_config_vars().get('LIBS'))" | sed s/None//`
PY_SYSLIBS=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_config_vars().get('SYSLIBS'))" | sed s/None//`
PY_LIBDEST=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_config_vars().get('LIBDEST'))" | sed s/None//`
PYTHON_LIBS="$PY_LIBS $PY_SYSLIBS"
SAVE_LDFLAGS=$LDFLAGS
LDFLAGS="$PYTHON_LIBS $LDFLAGS"
AC_CHECK_LIB([python$PYTHON_VERSION], [Py_Initialize],[
AC_MSG_NOTICE([No additional path to python library needed])
PYTHON_LIBS="-lpython$PYTHON_VERSION $PYTHON_LIBS"],[
LDFLAGS="-L$PY_LIBDEST/config $LDFLAGS"
# check a different symbol or else configure will used cached value
AC_CHECK_LIB([python$PYTHON_VERSION], [Py_Finalize],[
AC_MSG_NOTICE([Adding path to python library])
PYTHON_LIBS="-L$PY_LIBDEST/config -lpython$PYTHON_VERSION $PYTHON_LIBS"],[
PYTHON_LIBS=""])])
LDFLAGS=$SAVE_LDFLAGS
])])])])
AC_SUBST(PYTHON_VERSION)
AC_SUBST(PYTHON_CFLAGS)
AC_SUBST(PYTHON_LIBS)
if test "${build}" = "${host}"; then
PYTHON_EXT_SUFFIX=`$PYTHON -c "from distutils import sysconfig; v = sysconfig.get_config_vars(); print(v.get('EXT_SUFFIX', v.get('SO')))" | sed s/None//`
else
PYTHON_EXT_SUFFIX=""
fi
AC_SUBST(PYTHON_EXT_SUFFIX)
AC_ARG_WITH(python-site-arch, AC_HELP_STRING([--with-python-site-arch=directory], [Direcory where Python modules will be installed - defaults is to query the Python binary]))
if test "X$PYTHON_SITE_ARCH" = "X"; then
if test "${build}" = "${host}"; then
PYTHON_SITE_ARCH=`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(1,0,"${prefix}"))'`
else
PYTHON_SITE_ARCH="${libdir}/python${PYTHON_VERSION}/site-packages"
fi
fi
AC_SUBST(PYTHON_SITE_ARCH)
AC_ARG_WITH(python-site-lib, AC_HELP_STRING([--with-python-site-lib=directory], [Direcory where Python modules will be installed - defaults is to query the Python binary]))
if test "X$PYTHON_SITE_LIB" = "X"; then
if test "${build}" = "${host}"; then
PYTHON_SITE_LIB=`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(0,0,"${prefix}"))'`
else
PYTHON_SITE_LIB="${libdir}/python${PYTHON_VERSION}/site-packages"
fi
fi
AC_SUBST(PYTHON_SITE_LIB)
SAVE_LDFLAGS=$LDFLAGS
SAVE_CPPFLAGS=$CPPFLAGS
LDFLAGS="$LDFLAGS $PYTHON_LIBS"
CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
AC_CHECK_HEADER(Python.h, [pythonh="yes"], [pythonh="no"])
AC_TRY_COMPILE([#include <Python.h>], [Py_InitializeEx(0)],[
AC_MSG_NOTICE([Python includes functionality of skipping initialization registration of signal handlers])
AC_DEFINE(HAVE_PYTHON_INITIALIZE_EX, 1,
[Define if you have Py_InitializeEx function])
enables_python_service="yes"
],[
AC_MSG_NOTICE([Python does not include functionality of skipping initialization registration of signal handlers, since its version is below 2.4])
enables_python_service="no"
])
LDFLAGS=$SAVE_LDFLAGS
CPPFLAGS=$SAVE_CPPFLAGS
fi
if test "X$PYTHON" = "X"; then
AC_MSG_NOTICE([Missing Python - skipping Python components])
enables_python=no
elif test "X$PYTHON_SITE_ARCH" = "X" || test "X$PYTHON_SITE_LIB" = "X"; then
AC_MSG_NOTICE([Missing python site packages location - skipping Python components])
enables_python=no
else
AC_MSG_NOTICE([Python available: $PYTHON_VERSION])
fi
if test "x$enables_python" != "xyes"; then
AC_MSG_NOTICE([Missing Python - skipping Python bindings])
enables_swig_python=no
elif test "X$PYTHON_LIBS" = "X"; then
AC_MSG_NOTICE([Missing Python library - skipping Python bindings])
enables_swig_python=no
elif test "X$pythonh" != "Xyes"; then
AC_MSG_NOTICE([Missing Python header - skipping Python bindings])
enables_swig_python=no
elif ! test -f python/arc_wrap.cpp && test "x$enables_swig_python" != "xyes"; then
AC_MSG_NOTICE([Missing pre-compiled Python wrapper and SWIG - skipping Python bindings])
enables_swig_python=no
fi
fi
fi
AC_MSG_NOTICE([Python enabled: $enables_python])
AC_MSG_NOTICE([Python SWIG bindings enabled: $enables_swig_python])
AM_CONDITIONAL([PYTHON_ENABLED],[test "x$enables_python" = "xyes"])
AM_CONDITIONAL([PYTHON3], [test "x$enables_python" = "xyes" && test "x$PYTHON_MAJOR" = "x3"])
AM_CONDITIONAL([PYTHON_SWIG_ENABLED],[test "x$enables_swig_python" = "xyes"])
AM_CONDITIONAL([PYTHON_SERVICE],[test "x$enables_swig_python" = "xyes" &&
test "x$enables_python_service" = "xyes"])
# Alternative Python
if test "$enables_hed" = "yes"; then
AC_ARG_ENABLE(altpython,
AC_HELP_STRING([--disable-altpython], [enable alternative Python binding]),
[enables_altpython=$enableval], [])
if test "$enables_altpython" = "yes"; then
AC_ARG_WITH(altpython, AC_HELP_STRING([--with-altpython=(PYTHON)],
[specify alternative python program from PATH]))
AC_PATH_PROGS(ALTPYTHON, $with_altpython)
if test "X$ALTPYTHON" != "X"; then
ALTPYNAME=`basename $ALTPYTHON`
PKG_CHECK_MODULES(ALTPYTHON, $ALTPYNAME-embed, [
ALTPYTHON_VERSION=`$PKG_CONFIG --modversion $ALTPYNAME-embed`
ALTPYTHON_MAJOR=`echo $ALTPYTHON_VERSION|cut -f1 -d.`
],[
PKG_CHECK_MODULES(ALTPYTHON, $ALTPYNAME, [
ALTPYTHON_VERSION=`$PKG_CONFIG --modversion $ALTPYNAME`
ALTPYTHON_MAJOR=`echo $ALTPYTHON_VERSION|cut -f1 -d.`
],[
ALTPYNAME=python-`$ALTPYTHON -c 'import sys; print(".".join(sys.version.split(" ")[[0]].split(".")[[:2]]))'`
PKG_CHECK_MODULES(ALTPYTHON, $ALTPYNAME-embed, [
ALTPYTHON_VERSION=`$PKG_CONFIG --modversion $ALTPYNAME-embed`
ALTPYTHON_MAJOR=`echo $ALTPYTHON_VERSION|cut -f1 -d.`
],[
PKG_CHECK_MODULES(ALTPYTHON, $ALTPYNAME, [
ALTPYTHON_VERSION=`$PKG_CONFIG --modversion $ALTPYNAME`
ALTPYTHON_MAJOR=`echo $ALTPYTHON_VERSION|cut -f1 -d.`
],[
ALTPYTHON_VERSION=`$ALTPYTHON -c 'import sys; print(".".join(sys.version.split(" ")[[0]].split(".")[[:2]]))'`
ALTPYTHON_MAJOR=`$ALTPYTHON -c 'import sys; print(sys.version_info[[0]])'`
ALTPYTHON_CFLAGS=-I`$ALTPYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_inc())'`
ALTPY_LIBS=`$ALTPYTHON -c "from distutils import sysconfig; print(sysconfig.get_config_vars().get('LIBS'))" | sed s/None//`
ALTPY_SYSLIBS=`$ALTPYTHON -c "from distutils import sysconfig; print(sysconfig.get_config_vars().get('SYSLIBS'))" | sed s/None//`
ALTPY_LIBDEST=`$ALTPYTHON -c "from distutils import sysconfig; print(sysconfig.get_config_vars().get('LIBDEST'))" | sed s/None//`
ALTPYTHON_LIBS="$ALTPY_LIBS $ALTPY_SYSLIBS"
SAVE_LDFLAGS=$LDFLAGS
LDFLAGS="$ALTPYTHON_LIBS $LDFLAGS"
AC_CHECK_LIB([python$ALTPYTHON_VERSION], [Py_Initialize],[
AC_MSG_NOTICE([No additional path to python library needed])
ALTPYTHON_LIBS="-lpython$ALTPYTHON_VERSION $ALTPYTHON_LIBS"],[
LDFLAGS="-L$ALTPY_LIBDEST/config $LDFLAGS"
# check a different symbol or else configure will used cached value
AC_CHECK_LIB([python$ALTPYTHON_VERSION], [Py_Finalize],[
AC_MSG_NOTICE([Adding path to python library])
ALTPYTHON_LIBS="-L$ALTPY_LIBDEST/config -lpython$ALTPYTHON_VERSION $ALTPYTHON_LIBS"],[
ALTPYTHON_LIBS=""])])
LDFLAGS=$SAVE_LDFLAGS
])])])])
AC_SUBST(ALTPYTHON_VERSION)
AC_SUBST(ALTPYTHON_CFLAGS)
AC_SUBST(ALTPYTHON_LIBS)
ALTPYTHON_EXT_SUFFIX=`$ALTPYTHON -c "from distutils import sysconfig; v = sysconfig.get_config_vars(); print(v.get('EXT_SUFFIX', v.get('SO')))" | sed s/None//`
AC_SUBST(ALTPYTHON_EXT_SUFFIX)
AC_ARG_WITH(altpython-site-arch, AC_HELP_STRING([--with-altpython-site-arch=directory], [Direcory where Python modules will be installed - defaults is to query the Python binary]))
if test "X$ALTPYTHON_SITE_ARCH" = "X"; then
ALTPYTHON_SITE_ARCH=`$ALTPYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(1,0,"${prefix}"))'`
fi
AC_SUBST(ALTPYTHON_SITE_ARCH)
AC_ARG_WITH(altpython-site-lib, AC_HELP_STRING([--with-altpython-site-lib=directory], [Direcory where Python modules will be installed - defaults is to query the Python binary]))
if test "X$ALTPYTHON_SITE_LIB" = "X"; then
ALTPYTHON_SITE_LIB=`$ALTPYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(0,0,"${prefix}"))'`
fi
AC_SUBST(ALTPYTHON_SITE_LIB)
SAVE_LDFLAGS=$LDFLAGS
SAVE_CPPFLAGS=$CPPFLAGS
LDFLAGS="$LDFLAGS $ALTPYTHON_LIBS"
CPPFLAGS="$CPPFLAGS $ALTPYTHON_CFLAGS"
AC_CHECK_HEADER(Python.h, [altpythonh="yes"], [altpythonh="no"])
LDFLAGS=$SAVE_LDFLAGS
CPPFLAGS=$SAVE_CPPFLAGS
fi
if test "X$ALTPYTHON" = "X"; then
AC_MSG_NOTICE([Missing alternative Python - skipping alternative Python])
enables_altpython=no
elif test "X$ALTPYTHON_LIBS" = "X"; then
AC_MSG_NOTICE([Missing alternative Python library - skipping alternative Python bindings])
enables_altpython=no
elif test "X$altpythonh" != "Xyes"; then
AC_MSG_NOTICE([Missing alternative Python header - skipping alternative Python bindings])
enables_altpython=no
elif test "X$ALTPYTHON_SITE_ARCH" = "X" || test "X$ALTPYTHON_SITE_LIB" = "X"; then
AC_MSG_NOTICE([Missing python site packages location - skipping Python bindings])
enables_altpython=no
else
AC_MSG_NOTICE([Alternative Python available: $ALTPYTHON_VERSION])
fi
if test "x$enables_altpython" != "xyes"; then
AC_MSG_NOTICE([Missing alternative Python - skipping alternative Python bindings])
enables_altpython=no
elif ! test -f python/arc_wrap.cpp && test "x$enables_swig_python" != "xyes"; then
AC_MSG_NOTICE([Missing pre-compiled Python wrapper and SWIG - skipping alternative Python bindings])
enables_altpython=no
fi
fi
fi
AC_MSG_NOTICE([Alternative Python enabled: $enables_altpython])
AM_CONDITIONAL([ALTPYTHON_ENABLED],[test "x$enables_altpython" = "xyes"])
AM_CONDITIONAL([ALTPYTHON3], [test "x$enables_altpython" = "xyes" && test "x$ALTPYTHON_MAJOR" = "x3"])
# check for pylint
dnl Check if pylint is explicitly disabled.
if test "$enables_hed" = "yes"; then
AC_ARG_ENABLE(pylint, AC_HELP_STRING([--disable-pylint], [disable python example checking using pylint]),
[enables_pylint=$enableval],[])
AC_PATH_PROGS(PYLINT, pylint)
if test "x$PYLINT" = "x"; then
enables_pylint="no"
else
PYLINT_VERSION=`$PYLINT --version 2> /dev/null | sed -n 's/^pylint \([[0-9.]]*\).*/\1/p'`
# Check if pylint supports the following arguments, otherwise disable pylint (python example checking).
# Do not generate report
# Disable convention and recommendation messages - we are only interested in fatals, errors and warnings.
PYLINT_ARGS="--reports=no --disable=C,R"
if $PYLINT $PYLINT_ARGS /dev/null > /dev/null 2>&1 ; then
AC_MSG_NOTICE([pylint version $PYLINT_VERSION found - version ok])
enables_pylint="yes"
else
AC_MSG_NOTICE([pylint version $PYLINT_VERSION found - bad version])
enables_pylint="no"
PYLINT_ARGS=""
fi
AC_SUBST(PYLINT_ARGS)
fi
# Check if the --disable=W0221 option is supported
# W0221: Disable arguments differ messages since Swig uses tuple syntax (*args).
if test "$enables_pylint" = "yes"; then
PYLINT_ARGS_ARGUMENTS_DIFFER="--disable=W0221"
if ! $PYLINT $PYLINT_ARGS $PYLINT_ARGS_ARGUMENTS_DIFFER /dev/null > /dev/null 2>&1 ; then
PYLINT_ARGS_ARGUMENTS_DIFFER=""
fi
AC_SUBST(PYLINT_ARGS_ARGUMENTS_DIFFER)
fi
fi
AM_CONDITIONAL([PYLINT_ENABLED], [test "x$enables_pylint" = "xyes"])
AC_MSG_NOTICE([Python example checking with pylint enabled: $enables_pylint])
# check systemd daemon integration
AC_ARG_ENABLE(systemd, AC_HELP_STRING([--enable-systemd], [enable use of the systemd daemon integration features]),[enables_systemd="$enableval"],[])
if test "x$enables_systemd" = "xyes"; then
systemd_daemon_save_LIBS=$LIBS
LIBS=
AC_SEARCH_LIBS(sd_listen_fds,[systemd systemd-daemon],
[have_sd_listen_fds=yes],[have_sd_listen_fds=no],$systemd_daemon_save_LIBS)
AC_SEARCH_LIBS(sd_notify,[systemd systemd-daemon],
[have_sd_notify=yes],[have_sd_notify=no],$systemd_daemon_save_LIBS)
AC_CHECK_HEADERS(systemd/sd-daemon.h,
[have_systemd_sd_daemon_h=yes],[have_systemd_sd_daemon_h=no])
if test x"$have_sd_listen_fds" = x"yes" && \
test x"$have_sd_notify" = x"yes" && \
test x"$have_systemd_sd_daemon_h" = x"yes"; then
AC_DEFINE([HAVE_SYSTEMD_DAEMON],[1],[Define if you have systemd daemon])
SYSTEMD_DAEMON_LIBS=$LIBS
else
AC_MSG_FAILURE([--enable-systemd was given, but test for systemd libraries had failed])
fi
LIBS=$systemd_daemon_save_LIBS
fi
AC_SUBST(SYSTEMD_DAEMON_LIBS)
# check gthread
if test "$enables_hed" = "yes"; then
PKG_CHECK_MODULES(GTHREAD, [gthread-2.0 >= 2.4.7])
AC_SUBST(GTHREAD_CFLAGS)
AC_SUBST(GTHREAD_LIBS)
fi
# check glibmm
# check for giomm which became a part of glibmm as of version 2.16
if test "$enables_hed" = "yes"; then
"$PKG_CONFIG" giomm-2.4
if test "$?" = '1'; then
PKG_CHECK_MODULES(GLIBMM, [glibmm-2.4 >= 2.4.7])
else
PKG_CHECK_MODULES(GLIBMM, [giomm-2.4])
AC_DEFINE(HAVE_GIOMM, 1, [define if giomm is supported in glibmm])
fi
AC_SUBST(GLIBMM_CFLAGS)
AC_SUBST(GLIBMM_LIBS)
SAVE_CPPFLAGS=$CPPFLAGS
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
CPPFLAGS="$CPPFLAGS $GLIBMM_CFLAGS"
AC_CHECK_HEADER([glibmm/optioncontext.h], [
AC_TRY_COMPILE([#include <glibmm/optioncontext.h>],
[Glib::OptionContext ctx; ctx.set_summary("summary")], [
AC_DEFINE(HAVE_GLIBMM_OPTIONCONTEXT_SET_SUMMARY, 1,
[define if glibmm has Glib::OptionContext::set_summary()])
AC_MSG_NOTICE([using glibmm command line parsing])
], [
AC_MSG_NOTICE([using getopt_long command line parsing])
]
)
AC_TRY_COMPILE([#include <glibmm/optioncontext.h>],
[Glib::OptionContext ctx; ctx.get_help();],[
AC_DEFINE(HAVE_GLIBMM_OPTIONCONTEXT_GET_HELP, 1,
[define if glibmm has Glib::OptionContext::get_help()])
], [
]
)
])
AC_TRY_COMPILE([#include <glibmm.h>],[Glib::ModuleFlags flags = Glib::MODULE_BIND_LOCAL;],[glibmm_bind_local=yes],[glibmm_bind_local=no])
if test "$glibmm_bind_local" = yes; then
AC_DEFINE(HAVE_GLIBMM_BIND_LOCAL, 1,
[define if glibmm have support local symbol resolution in shared libraries])
else
AC_MSG_NOTICE([WARNING: glibmm has no way to limit scope of symbols of shared libraries. Make sure external libraries used by plugins have no conflicting symbols. HINT: use Globus compiled against system OpenSSL library.])
fi
AC_TRY_COMPILE([#include <glibmm/miscutils.h>],[Glib::getenv("");],[glibmm_getenv=yes],[glibmm_getenv=no])
if test "$glibmm_getenv" = yes; then
AC_DEFINE(HAVE_GLIBMM_GETENV, 1, [define if glibmm have getenv operations])
else
AC_MSG_NOTICE([WARNING: glibmm has no support for getenv. Usage of libc getenv is unsafe in multi-threaded applications.])
fi
AC_TRY_COMPILE([#include <glibmm/miscutils.h>],[Glib::setenv("", "");],[glibmm_setenv=yes],[glibmm_setenv=no])
if test "$glibmm_setenv" = yes; then
AC_DEFINE(HAVE_GLIBMM_SETENV, 1, [define if glibmm have setenv operations])
else
AC_MSG_NOTICE([WARNING: glibmm has no support for setenv. Usage of libc setenv may be unsafe in multi-threaded applications.])
fi
AC_TRY_COMPILE([#include <glibmm/miscutils.h>],[Glib::unsetenv("");],[glibmm_unsetenv=yes],[glibmm_unsetenv=no])
if test "$glibmm_unsetenv" = yes; then
AC_DEFINE(HAVE_GLIBMM_UNSETENV, 1, [define if glibmm have unsetenv operations])
else
AC_MSG_NOTICE([WARNING: glibmm has no support for unsetenv. Usage of libc unsetenv may be unsafe in multi-threaded applications.])
fi
AC_TRY_COMPILE([#include <glibmm/miscutils.h>],[Glib::listenv();],[glibmm_listenv=yes],[glibmm_listenv=no])
if test "$glibmm_listenv" = yes; then
AC_DEFINE(HAVE_GLIBMM_LISTENV, 1, [define if glibmm have listenv operations])
else
AC_MSG_NOTICE([WARNING: glibmm has no support for listenv. Usage of libc environ is unsafe in multi-threaded applications.])
fi
AC_LANG_RESTORE
CPPFLAGS=$SAVE_CPPFLAGS
fi
# check libxml
if test "$enables_hed" = "yes"; then
PKG_CHECK_MODULES(LIBXML2, [libxml-2.0 >= 2.4.0])
AC_SUBST(LIBXML2_CFLAGS)
AC_SUBST(LIBXML2_LIBS)
fi
# check openssl
if test "$enables_hed" = "yes"; then
PKG_CHECK_MODULES(OPENSSL, [openssl >= 1.0.0])
PKG_CHECK_MODULES(OPENSSL_1_1, [openssl >= 1.1.0], [
OPENSSL_CFLAGS="$OPENSSL_CFLAGS -DOPENSSL_API_COMPAT=0x10100000L"
AC_MSG_NOTICE([Forcing off deprecated functions for OpenSSL >= 1.1])
], [
AC_MSG_NOTICE([OpenSSL is pre-1.1])
])
AC_SUBST(OPENSSL_CFLAGS)
AC_SUBST(OPENSSL_LIBS)
fi
# Check for available *_method functions in OpenSSL
SAVE_CPPFLAGS=$CPPFLAGS
SAVE_LIBS=$LIBS
CPPFLAGS="$CPPFLAGS $OPENSSL_CFLAGS"
LIBS="$LIBS $OPENSSL_LIBS"
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <openssl/ssl.h>
void _test(void) { (void)SSLv3_method(); }
]])],
[AC_DEFINE(HAVE_SSLV3_METHOD,1,[define if SSLv3_method is available])],
[AC_MSG_NOTICE([No SSLv3_method function avialable])])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <openssl/ssl.h>
void _test(void) { (void)TLSv1_method(); }
]])],
[AC_DEFINE(HAVE_TLSV1_METHOD,1,[define if TLSv1_method is available])],
[AC_MSG_NOTICE([No TLSv1_method function avialable])])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <openssl/ssl.h>
void _test(void) { (void)TLSv1_1_method(); }
]])],
[AC_DEFINE(HAVE_TLSV1_1_METHOD,1,[define if TLSv1_1_method is available])],
[AC_MSG_NOTICE([No TLSv1_1_method function avialable])])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <openssl/ssl.h>
void _test(void) { (void)TLSv1_2_method(); }
]])],
[AC_DEFINE(HAVE_TLSV1_2_METHOD,1,[define if TLSv1_2_method is available])],
[AC_MSG_NOTICE([No TLSv1_2_method function avialable])])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <openssl/ssl.h>
void _test(void) { (void)TLS_method(); }
]])],
[AC_DEFINE(HAVE_TLS_METHOD,1,[define if TLS_method is available])],
[AC_MSG_NOTICE([No TLS_method function avialable])])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <openssl/ssl.h>
void _test(void) { (void)DTLSv1_method(); }
]])],
[AC_DEFINE(HAVE_DTLSV1_METHOD,1,[define if DTLSv1_method is available])],
[AC_MSG_NOTICE([No DTLSv1_method function avialable])])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <openssl/ssl.h>
void _test(void) { (void)DTLSv1_2_method(); }
]])],
[AC_DEFINE(HAVE_DTLSV1_2_METHOD,1,[define if DTLSv1_2_method is available])],
[AC_MSG_NOTICE([No DTLSv1_2_method function avialable])])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <openssl/ssl.h>
void _test(void) { (void)DTLS_method(); }
]])],
[AC_DEFINE(HAVE_DTLS_METHOD,1,[define if DTLS_method is available])],
[AC_MSG_NOTICE([No DTLS_method function avialable])])
AC_LANG_POP([C++])
CPPFLAGS=$SAVE_CPPFLAGS
LIBS=$SAVE_LIBS
#check mozilla nss
enables_nss=yes
NSS_INSTALLED=no
dnl Check if nss lib is explicitly enabled, default is disable.
AC_ARG_ENABLE(nss, AC_HELP_STRING([--disable-nss], [disable use of the mozilla nss library]),[enables_nss="$enableval"],[])
if test "$enables_nss" = "yes"; then
PKG_CHECK_MODULES(NSS, [nss >= 3.10], [NSS_INSTALLED=yes] , [
AC_MSG_WARN([Cannot locate nss lib])
NSS_INSTALLED=no
enables_nss=no
])
if test "x$NSS_INSTALLED" = "xyes" ; then
AC_DEFINE(HAVE_NSS, 1, [define if NSS is enabled and available])
fi
fi
AC_SUBST(NSS_CFLAGS)
AC_SUBST(NSS_LIBS)
AM_CONDITIONAL([NSS_ENABLED], test x$NSS_INSTALLED = xyes)
#check SQLite
SQLITE_INSTALLED=no
PKG_CHECK_MODULES(SQLITE, [sqlite3 >= 3.6], [SQLITE_INSTALLED=yes] , [
AC_MSG_WARN([Cannot locate SQLite newer than 3.6])
SQLITE_INSTALLED=no
])
if test "x$SQLITE_INSTALLED" = "xyes" ; then
AC_DEFINE(HAVE_SQLITE, 1, [define if SQLite is available])
# Check for function available since 3.8
SAVE_CFLAGS=$CFLAGS
SAVE_LIBS=$LIBS
CFLAGS="$CFLAGS $SQLITE_CFLAGS"
LIBS="$LIBS $SQLITE_LIBS"
AC_CHECK_FUNCS(sqlite3_errstr)
CFLAGS=$SAVE_CFLAGS
LIBS=$SAVE_LIBS
fi
AC_SUBST(SQLITE_CFLAGS)
AC_SUBST(SQLITE_LIBS)
AM_CONDITIONAL([SQLITE_ENABLED], test x$SQLITE_INSTALLED = xyes)
# check cppunit
if test "$enables_hed" = "yes"; then
AC_ARG_ENABLE(cppunit, AC_HELP_STRING([--disable-cppunit], [disable cppunit-based UNIT testing of code]),[enables_cppunit=$enableval],[])
if test "$enables_cppunit" = "yes"; then
PKG_CHECK_MODULES(CPPUNIT, [cppunit],[],
[AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no)
if test "x$CPPUNIT_CONFIG" = "xno"; then
AC_MSG_WARN([cppunit-config not found - no UNIT testing will be performed])
CPPUNIT_CFLAGS=
CPPUNIT_LIBS=
enables_cppunit="no"
else
CPPUNIT_CFLAGS="`$CPPUNIT_CONFIG --cflags`"
CPPUNIT_LIBS="`$CPPUNIT_CONFIG --libs`"
fi])
if test "x$CPPUNIT_CONFIG" != "xno" || test "x$CPPUNIT_PKG_ERRORS" != "x"
then
TEST_DIR=test
else
enables_cppunit=no
TEST_DIR=
fi
fi
AC_SUBST(CPPUNIT_CFLAGS)
AC_SUBST(CPPUNIT_LIBS)
AC_SUBST(TEST_DIR)
else
enables_cppunit="no"
fi
# check ldns library
if test "$enables_compute_client" = "yes"; then
AC_ARG_ENABLE(ldns, AC_HELP_STRING([--disable-ldns], [disable ldns library usage (makes ARCHERY client unavailable) ]),[enables_ldns=$enableval],[])
if test "$enables_ldns" = "yes"; then
PKG_CHECK_MODULES(LDNS, [ldns],[],
[AC_PATH_PROG(LDNS_CONFIG, ldns-config, no)
if test "x$LDNS_CONFIG" = "xno"; then
AC_CHECK_HEADER([ldns/ldns.h],
[AC_CHECK_LIB([ldns], [ldns_dname_new_frm_str],
[
LDNS_CFLAGS="$LDNS_CFLAGS"
LDNS_LIBS="$LDNS_LIBS -lldns"
],
[enables_ldns="no"])
],[enables_ldns="no"])
else
LDNS_CFLAGS="`$LDNS_CONFIG --cflags`"
LDNS_LIBS="`$LDNS_CONFIG --libs`"
fi
])
if test "$enables_ldns" = "no"; then
AC_MSG_WARN([ldns library was not found. Compute clients will be built without ARCHERY support.])
fi
fi
else
enables_ldns="no"
fi
if test "x$enables_ldns" = "xyes" ; then
AC_DEFINE(HAVE_LDNS, 1, [define if LDNS is enabled and available])
else
LDNS_CFLAGS=
LDNS_LIBS=
fi
AC_SUBST(LDNS_CFLAGS)
AC_SUBST(LDNS_LIBS)
AM_CONDITIONAL(LDNS_ENABLED, test "x$enables_ldns" = "xyes")
##############################
#
# Check xmlsec1
#
#############################
MACOSX=""
case "${host}" in
*darwin*)
MACOSX="yes"
;;
esac
if test "x$MACOSX" = "xyes"; then
AC_DEFINE(_MACOSX, 1, [Define if compiling for MacOSX])
fi
AM_CONDITIONAL([MACOSX], [ test "x$MACOSX" = "xyes"])
if test "$enables_hed" = "yes"; then
XMLSEC_MIN_VERSION="1.2.4"
XMLSEC_OPENSSL_MIN_VERSION="1.2.4"
XMLSEC_CONFIG="${XMLSEC1_CONFIG:-xmlsec1-config}"
XMLSEC_CFLAGS=""
XMLSEC_LIBS=""
XMLSEC_INSTALLED=no
dnl Check if xmlsec1 is explicitly disabled, default is enable.
AC_ARG_ENABLE(xmlsec1, AC_HELP_STRING([--disable-xmlsec1], [disable features which need xmlsec1 library]),[enables_xmlsec1=$enableval],[])
if test "x$enables_xmlsec1" = "xyes"; then
AC_ARG_WITH(xmlsec1, [ --with-xmlsec1=(PATH) xmlsec1 location])
if test "x$with_xmlsec1" = "x" ; then
PKG_CHECK_MODULES(XMLSEC, [xmlsec1 >= $XMLSEC_MIN_VERSION],
[XMLSEC_INSTALLED=yes], [XMLSEC_INSTALLED=no])
if test "x$XMLSEC_INSTALLED" = "xyes" ; then
PKG_CHECK_MODULES(XMLSEC_OPENSSL, [xmlsec1-openssl >= $XMLSEC_OPENSSL_MIN_VERSION],
[XMLSEC_INSTALLED=yes],[XMLSEC_INSTALLED=no])
fi
# Find number of backslashes in XMLSEC_CFLAGS
n=$(echo $XMLSEC_CFLAGS|sed 's/.*-DXMLSEC_CRYPTO=\([[^ ]]*\).*/\1/'|tr -d '[[A-Za-z0-1\n"]]'| wc -c)
# Fixes due to bugs in pkg-config and/or xmlsec1
#
# 0: Indicates a bug in pkg-config which removes the escaping of the quotes
# 2: Correct value with escaped quotes
# 6: Old xmlsec1 version which used 3 back-slashes to escape quotes
# See eg. https://bugzilla.redhat.com/show_bug.cgi?id=675334
# Make sure that the quotes are escaped with single backslash
if test $n = 0 -o $n = 6; then
AC_MSG_NOTICE([Working around bad combination of pkgconfig and xmlsec1 with $n back-slashes])
XMLSEC_CFLAGS=$(echo $XMLSEC_CFLAGS|sed 's/\(.*-DXMLSEC_CRYPTO=\)\\*"\([[^ \\"]]*\)\\*" \(.*\)/\1\\"\2\\" \3/')