forked from gluster/glusterfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
1960 lines (1728 loc) · 68.7 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 Copyright (c) 2006-2016 Red Hat, Inc. <http://www.redhat.com>
dnl This file is part of GlusterFS.
dnl
dnl This file is licensed to you under your choice of the GNU Lesser
dnl General Public License, version 3 or any later version (LGPLv3 or
dnl later), or the GNU General Public License, version 2 (GPLv2), in all
dnl cases as published by the Free Software Foundation.
// clang-format off
AC_INIT([glusterfs],[m4_esyscmd([build-aux/pkg-version --version])],[[email protected]],[],[https://github.com/gluster/glusterfs.git])
AC_SUBST([PACKAGE_RELEASE],
[m4_esyscmd([build-aux/pkg-version --release])])
AM_INIT_AUTOMAKE([tar-pax foreign])
# Removes warnings when using automake 1.14 around (...but option 'subdir-objects' is disabled )
#but libglusterfs fails to build with contrib (Then are not set up that way?)
#AM_INIT_AUTOMAKE([subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)])
AC_CONFIG_HEADERS([config.h site.h])
AC_CONFIG_FILES([Makefile
libglusterfs/Makefile
libglusterfs/src/Makefile
geo-replication/src/peer_gsec_create
geo-replication/src/peer_mountbroker
geo-replication/src/peer_mountbroker.py
geo-replication/src/peer_georep-sshkey.py
extras/peer_add_secret_pub
geo-replication/syncdaemon/conf.py
geo-replication/gsyncd.conf
extras/snap_scheduler/conf.py
glusterfsd/Makefile
glusterfsd/src/Makefile
rpc/Makefile
rpc/rpc-lib/Makefile
rpc/rpc-lib/src/Makefile
rpc/rpc-transport/Makefile
rpc/rpc-transport/socket/Makefile
rpc/rpc-transport/socket/src/Makefile
rpc/xdr/Makefile
rpc/xdr/src/Makefile
xlators/Makefile
xlators/meta/Makefile
xlators/meta/src/Makefile
xlators/mount/Makefile
xlators/mount/fuse/Makefile
xlators/mount/fuse/src/Makefile
xlators/mount/fuse/utils/mount.glusterfs
xlators/mount/fuse/utils/mount_glusterfs
xlators/mount/fuse/utils/Makefile
xlators/storage/Makefile
xlators/storage/posix/Makefile
xlators/storage/posix/src/Makefile
xlators/cluster/Makefile
xlators/cluster/afr/Makefile
xlators/cluster/afr/src/Makefile
xlators/cluster/dht/Makefile
xlators/cluster/dht/src/Makefile
xlators/cluster/ec/Makefile
xlators/cluster/ec/src/Makefile
xlators/performance/Makefile
xlators/performance/write-behind/Makefile
xlators/performance/write-behind/src/Makefile
xlators/performance/read-ahead/Makefile
xlators/performance/read-ahead/src/Makefile
xlators/performance/readdir-ahead/Makefile
xlators/performance/readdir-ahead/src/Makefile
xlators/performance/io-threads/Makefile
xlators/performance/io-threads/src/Makefile
xlators/performance/io-cache/Makefile
xlators/performance/io-cache/src/Makefile
xlators/performance/quick-read/Makefile
xlators/performance/quick-read/src/Makefile
xlators/performance/open-behind/Makefile
xlators/performance/open-behind/src/Makefile
xlators/performance/md-cache/Makefile
xlators/performance/md-cache/src/Makefile
xlators/performance/nl-cache/Makefile
xlators/performance/nl-cache/src/Makefile
xlators/debug/Makefile
xlators/debug/sink/Makefile
xlators/debug/sink/src/Makefile
xlators/debug/trace/Makefile
xlators/debug/trace/src/Makefile
xlators/debug/error-gen/Makefile
xlators/debug/error-gen/src/Makefile
xlators/debug/delay-gen/Makefile
xlators/debug/delay-gen/src/Makefile
xlators/debug/io-stats/Makefile
xlators/debug/io-stats/src/Makefile
xlators/protocol/Makefile
xlators/protocol/auth/Makefile
xlators/protocol/auth/addr/Makefile
xlators/protocol/auth/addr/src/Makefile
xlators/protocol/auth/login/Makefile
xlators/protocol/auth/login/src/Makefile
xlators/protocol/client/Makefile
xlators/protocol/client/src/Makefile
xlators/protocol/server/Makefile
xlators/protocol/server/src/Makefile
xlators/features/Makefile
xlators/features/arbiter/Makefile
xlators/features/arbiter/src/Makefile
xlators/features/thin-arbiter/Makefile
xlators/features/thin-arbiter/src/Makefile
xlators/features/changelog/Makefile
xlators/features/changelog/src/Makefile
xlators/features/changelog/lib/Makefile
xlators/features/changelog/lib/src/Makefile
xlators/features/locks/Makefile
xlators/features/locks/src/Makefile
xlators/features/simple-quota/Makefile
xlators/features/simple-quota/src/Makefile
xlators/features/quota/Makefile
xlators/features/quota/src/Makefile
xlators/features/marker/Makefile
xlators/features/marker/src/Makefile
xlators/features/selinux/Makefile
xlators/features/selinux/src/Makefile
xlators/features/sdfs/Makefile
xlators/features/sdfs/src/Makefile
xlators/features/read-only/Makefile
xlators/features/read-only/src/Makefile
xlators/features/compress/Makefile
xlators/features/compress/src/Makefile
xlators/features/namespace/Makefile
xlators/features/namespace/src/Makefile
xlators/features/quiesce/Makefile
xlators/features/quiesce/src/Makefile
xlators/features/barrier/Makefile
xlators/features/barrier/src/Makefile
xlators/features/index/Makefile
xlators/features/index/src/Makefile
xlators/features/gfid-access/Makefile
xlators/features/gfid-access/src/Makefile
xlators/features/trash/Makefile
xlators/features/trash/src/Makefile
xlators/features/snapview-server/Makefile
xlators/features/snapview-server/src/Makefile
xlators/features/snapview-client/Makefile
xlators/features/snapview-client/src/Makefile
xlators/features/upcall/Makefile
xlators/features/upcall/src/Makefile
xlators/features/shard/Makefile
xlators/features/shard/src/Makefile
xlators/features/bit-rot/Makefile
xlators/features/bit-rot/src/Makefile
xlators/features/bit-rot/src/stub/Makefile
xlators/features/bit-rot/src/bitd/Makefile
xlators/features/leases/Makefile
xlators/features/leases/src/Makefile
xlators/features/cloudsync/Makefile
xlators/features/cloudsync/src/Makefile
xlators/features/utime/Makefile
xlators/features/utime/src/Makefile
xlators/features/cloudsync/src/cloudsync-plugins/Makefile
xlators/features/cloudsync/src/cloudsync-plugins/src/Makefile
xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/Makefile
xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/Makefile
xlators/features/cloudsync/src/cloudsync-plugins/src/cvlt/Makefile
xlators/features/cloudsync/src/cloudsync-plugins/src/cvlt/src/Makefile
xlators/features/metadisp/Makefile
xlators/features/metadisp/src/Makefile
xlators/playground/Makefile
xlators/playground/template/Makefile
xlators/playground/template/src/Makefile
xlators/system/Makefile
xlators/system/posix-acl/Makefile
xlators/system/posix-acl/src/Makefile
xlators/nfs/Makefile
xlators/nfs/server/Makefile
xlators/nfs/server/src/Makefile
xlators/mgmt/Makefile
xlators/mgmt/glusterd/Makefile
xlators/mgmt/glusterd/src/Makefile
cli/Makefile
cli/src/Makefile
doc/Makefile
extras/Makefile
extras/glusterd.vol
extras/cliutils/Makefile
extras/init.d/Makefile
extras/init.d/glusterd.plist
extras/init.d/glusterd-Debian
extras/init.d/glusterd-Redhat
extras/init.d/glusterd-FreeBSD
extras/init.d/glusterd-SuSE
extras/init.d/glustereventsd-Debian
extras/init.d/glustereventsd-Redhat
extras/init.d/glustereventsd-FreeBSD
extras/ganesha/Makefile
extras/ganesha/config/Makefile
extras/ganesha/scripts/Makefile
extras/ganesha/ocf/Makefile
extras/systemd/Makefile
extras/systemd/glusterd.service
extras/systemd/glustereventsd.service
extras/systemd/glusterfssharedstorage.service
extras/systemd/gluster-ta-volume.service
extras/run-gluster.tmpfiles
extras/benchmarking/Makefile
extras/command-completion/Makefile
extras/hook-scripts/Makefile
extras/ocf/Makefile
extras/ocf/glusterd
extras/ocf/volume
extras/LinuxRPM/Makefile
extras/geo-rep/Makefile
extras/geo-rep/schedule_georep.py
extras/firewalld/Makefile
extras/hook-scripts/add-brick/Makefile
extras/hook-scripts/add-brick/pre/Makefile
extras/hook-scripts/add-brick/post/Makefile
extras/hook-scripts/create/Makefile
extras/hook-scripts/create/post/Makefile
extras/hook-scripts/delete/Makefile
extras/hook-scripts/delete/pre/Makefile
extras/hook-scripts/start/Makefile
extras/hook-scripts/start/post/Makefile
extras/hook-scripts/set/Makefile
extras/hook-scripts/set/post/Makefile
extras/hook-scripts/stop/Makefile
extras/hook-scripts/stop/pre/Makefile
extras/hook-scripts/reset/Makefile
extras/hook-scripts/reset/post/Makefile
extras/hook-scripts/reset/pre/Makefile
extras/python/Makefile
extras/snap_scheduler/Makefile
events/Makefile
events/src/Makefile
events/src/eventsapiconf.py
events/tools/Makefile
contrib/fuse-util/Makefile
contrib/umountd/Makefile
glusterfs-api.pc
libgfchangelog.pc
api/Makefile
api/src/Makefile
api/examples/Makefile
geo-replication/Makefile
geo-replication/src/Makefile
geo-replication/syncdaemon/Makefile
tools/Makefile
tools/gfind_missing_files/Makefile
heal/Makefile
heal/src/Makefile
glusterfs.spec
tools/glusterfind/src/tool.conf
tools/glusterfind/glusterfind
tools/glusterfind/Makefile
tools/glusterfind/src/Makefile
tools/setgfid2path/Makefile
tools/setgfid2path/src/Makefile])
AC_CANONICAL_HOST
AC_PROG_CC
AC_DISABLE_STATIC
LT_INIT
AC_SUBST([shrext_cmds])
AC_CHECK_PROG([RPCGEN], [rpcgen], [yes], [no])
if test "x$RPCGEN" = "xno"; then
AC_MSG_ERROR([`rpcgen` not found, glusterfs needs `rpcgen` exiting..])
fi
# Force 'char' type to be signed
CFLAGS="${CFLAGS} -fsigned-char"
# Initialize CFLAGS before usage
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug],[Enable debug build options.]))
if test "x$enable_debug" = "xyes"; then
BUILD_DEBUG=yes
GF_CFLAGS="${GF_CFLAGS} -g -O0 -DDEBUG"
else
BUILD_DEBUG=no
fi
SANITIZER=none
AC_ARG_ENABLE([asan],
AS_HELP_STRING([--enable-asan],[Enable Address Sanitizer support]))
if test "x$enable_asan" = "xyes"; then
SANITIZER=asan
AC_CHECK_LIB([asan], [_init], ,
[AC_MSG_ERROR([--enable-asan requires libasan.so, exiting])])
if test "x$ac_cv_lib_asan__init" = xyes; then
AC_MSG_CHECKING([whether asan API can be used])
saved_CFLAGS=${CFLAGS}
CFLAGS="${CFLAGS} -fsanitize=address"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([
[#include <sanitizer/common_interface_defs.h>]],
[[__sanitizer_finish_switch_fiber(0, 0, 0)]])],
[ASAN_API=yes], [ASAN_API=no])
AC_MSG_RESULT([$ASAN_API])
if test x$ASAN_API = "xyes"; then
AC_DEFINE(HAVE_ASAN_API, 1, [Define if asan API can be used.])
fi
CFLAGS=${saved_CFLAGS}
fi
GF_CFLAGS="${GF_CFLAGS} -O2 -g -fsanitize=address -fno-omit-frame-pointer"
dnl See: https://groups.google.com/d/msg/address-sanitizer/SD590XDinfQ/NMUPj_G0BgAJ
GF_LDFLAGS="${GF_LDFLAGS} -fsanitize=address"
fi
AC_ARG_ENABLE([tsan],
AS_HELP_STRING([--enable-tsan],[Enable Thread Sanitizer support]))
if test "x$enable_tsan" = "xyes"; then
if test "x$SANITIZER" != "xnone"; then
AC_MSG_ERROR([only one sanitizer can be enabled at once])
fi
SANITIZER=tsan
AC_CHECK_LIB([tsan], [_init], ,
[AC_MSG_ERROR([--enable-tsan requires libtsan.so, exiting])])
if test "x$ac_cv_lib_tsan__init" = xyes; then
AC_MSG_CHECKING([whether tsan API can be used])
saved_CFLAGS=${CFLAGS}
CFLAGS="${CFLAGS} -fsanitize=thread"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([
[#include <sanitizer/tsan_interface.h>]],
[[__tsan_create_fiber(0)]])],
[TSAN_API=yes], [TSAN_API=no])
AC_MSG_RESULT([$TSAN_API])
if test x$TSAN_API = "xyes"; then
AC_DEFINE(HAVE_TSAN_API, 1, [Define if tsan API can be used.])
fi
CFLAGS=${saved_CFLAGS}
fi
GF_CFLAGS="${GF_CFLAGS} -O2 -g -fsanitize=thread -fno-omit-frame-pointer"
GF_LDFLAGS="${GF_LDFLAGS} -fsanitize=thread"
fi
AC_ARG_ENABLE([ubsan],
AS_HELP_STRING([--enable-ubsan],[Enable Undefined Behavior Sanitizer support]))
if test "x$enable_ubsan" = "xyes"; then
if test "x$SANITIZER" != "xnone"; then
AC_MSG_ERROR([only one sanitizer can be enabled at once])
fi
SANITIZER=ubsan
AC_CHECK_LIB([ubsan], [_init], ,
[AC_MSG_ERROR([--enable-ubsan requires libubsan.so, exiting])])
GF_CFLAGS="${GF_CFLAGS} -O2 -g -fsanitize=undefined -fno-omit-frame-pointer"
GF_LDFLAGS="${GF_LDFLAGS} -fsanitize=undefined"
fi
# Initialize CFLAGS before usage
BUILD_TCMALLOC=no
USE_MEMPOOL=yes
AC_ARG_WITH([tcmalloc],
[AS_HELP_STRING([--without-tcmalloc],[Use gluster based mempool])],
[with_tcmalloc="no"], [with_tcmalloc="yes"])
if test "x$with_tcmalloc" = "xyes"; then
AC_CHECK_LIB([tcmalloc_minimal], [malloc], [],
[AC_MSG_ERROR([tcmalloc library needs to be present])])
BUILD_TCMALLOC=yes
GF_CFLAGS="${GF_CFLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free"
GF_LDFLAGS="-ltcmalloc_minimal ${GF_LDFLAGS}"
AC_DEFINE(GF_DISABLE_MEMPOOL, 1, [Disable the Gluster memory pooler.])
USE_MEMPOOL=no
fi
dnl When possible, prefer libtirpc over glibc rpc.
dnl
dnl On newer linux with only libtirpc, use libtirpc. (Specifying
dnl --without-libtirpc is an error.)
dnl
dnl on older linux with glibc rpc and WITH libtirpc, use libtirpc
dnl by default except when configured with --without-libtirpc.
dnl
dnl on old linux with glibc rpc and WITHOUT libtirpc, default to
dnl use glibc rpc.
dnl
AC_ARG_WITH([libtirpc],
[AS_HELP_STRING([--without-libtirpc],[Use legacy glibc RPC.])],
[with_libtirpc="no"], [with_libtirpc="yes"])
dnl For --without-libtirpc, check whether legacy glibc rpc is available.
if test "x$with_libtirpc" = "xno"; then
AC_CHECK_HEADER([rpc/types.h], ,
AC_MSG_ERROR([Your C library lacks support for RPC. Please use libtirpc instead.]))
fi
dnl ipv6-default is off by default
dnl
dnl ipv6-default requires libtirpc. (glibc rpc does not support IPv6.)
dnl ipv6-default can only be enabled if libtipc is enabled.
dnl
AC_ARG_WITH([ipv6-default],
AS_HELP_STRING([--with-ipv6-default],[Set IPv6 as default.]),
[with_ipv6_default=${with_libtirpc}], [with_ipv6_default="no"])
if test x$cross_compiling != xyes; then
AC_CHECK_FILE([/etc/centos-release])
if test "x$ac_cv_file__etc_centos_release" = "xyes"; then
if grep "release 6" /etc/centos-release; then
with_ipv6_default="no"
fi
fi
fi
dnl On some distributions '-ldl' isn't automatically added to LIBS
AC_CHECK_LIB([dl], [dlopen], [LIB_DL=-ldl])
AC_SUBST(LIB_DL)
AC_ARG_ENABLE([privport_tracking],
AS_HELP_STRING([--disable-privport_tracking],[Disable internal tracking of privileged ports.]))
TRACK_PRIVPORTS="yes"
if test x"$enable_privport_tracking" = x"no"; then
TRACK_PRIVPORTS="no"
AC_DEFINE(GF_DISABLE_PRIVPORT_TRACKING, 1,
[Disable internal tracking of privileged ports.])
fi
case $host_os in
darwin*)
# macOS version checking became a bit complicated since 11.x
# It is preferred to match against kernel version now instead of product version
# Darwin kernel is versioned as A.B.C where
# A = Kernel Version Major, starts from 5 (OS X Puma), incremented by 1 for each new release
# B = Kernel Version Minor
# C = Kernel Version Patch
# Should be greater than OS X Lion i.e. KernelMajor 11
DARWIN_KERNEL_MAJOR="`/usr/bin/uname -r | cut -d . -f 1`"
if ! test $DARWIN_KERNEL_MAJOR -ge 11; then
AC_MSG_ERROR([You need at least OS X 10.7 (Lion) to build Glusterfs])
fi
# OSX version lesser than 9 has llvm/clang optimization issues which leads to various segfaults
# If OS X Mavericks or lower i.e KernelMajor = 13
if test $DARWIN_KERNEL_MAJOR -lt 13; then
GF_CFLAGS="${GF_CFLAGS} -g -O0 -DDEBUG"
fi
;;
esac
# --enable-valgrind prevents calling dlclose(), this leaks memory
AC_ARG_ENABLE([valgrind],
AS_HELP_STRING([--enable-valgrind@<:@=memcheck,drd@:>@],[Enable valgrind for resource leak (memcheck, which is
the default) or thread synchronization (drd) debugging.]))
case x$enable_valgrind in
xmemcheck|xyes)
AC_DEFINE(RUN_WITH_MEMCHECK, 1,
[Define if all processes should run under 'valgrind --tool=memcheck'.])
VALGRIND_TOOL=memcheck
;;
xdrd)
AC_DEFINE(RUN_WITH_DRD, 1,
[Define if all processes should run under 'valgrind --tool=drd'.])
VALGRIND_TOOL=drd
;;
x|xno)
VALGRIND_TOOL=no
;;
*)
AC_MSG_ERROR([Please specify --enable-valgrind@<:@=memcheck,drd@:>@])
;;
esac
if test "x$VALGRIND_TOOL" != xno; then
AC_MSG_CHECKING([whether valgrind API can be used])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([
[#include <valgrind/valgrind.h>]],
[[VALGRIND_STACK_DEREGISTER(VALGRIND_STACK_REGISTER(0, 0))]])],
[HAVE_VALGRIND_API=yes], [HAVE_VALGRIND_API=no])
AC_MSG_RESULT([$HAVE_VALGRIND_API])
if test x$HAVE_VALGRIND_API = "xyes"; then
AC_DEFINE(HAVE_VALGRIND_API, 1, [Define if valgrind API can be used.])
fi
fi
AC_ARG_WITH([previous-options],
[AS_HELP_STRING([--with-previous-options],
[read config.status for configure options])
],
[ if test -r ./config.status && \
args=$(grep 'ac_cs_config=' config.status | \
sed -e 's/.*"\(.*\)".*/\1/' -e "s/'//g" -e "s/--with-previous-options//g") ; then
echo "###"
echo "### Rerunning as '$0 $args'"
echo "###"
exec $0 $args
fi
])
AC_ARG_WITH(pkgconfigdir,
[ --with-pkgconfigdir=DIR pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@],
[pkgconfigdir=$withval],
[pkgconfigdir='${libdir}/pkgconfig'])
AC_SUBST(pkgconfigdir)
AC_ARG_WITH(mountutildir,
[ --with-mountutildir=DIR mount helper utility in DIR @<:@/sbin@:>@],
[mountutildir=$withval],
[mountutildir='/sbin'])
AC_SUBST(mountutildir)
AC_ARG_WITH(systemddir,
[ --with-systemddir=DIR systemd service files in DIR @<:@PREFIX/lib/systemd/system@:>@],
[systemddir=$withval],
[systemddir='${prefix}/lib/systemd/system'])
AC_SUBST(systemddir)
AM_CONDITIONAL([USE_SYSTEMD], test [ -d '/usr/lib/systemd/system' ])
AC_ARG_WITH(initdir,
[ --with-initdir=DIR init.d scripts in DIR @<:@/etc/init.d@:>@],
[initdir=$withval],
[initdir='/etc/init.d'])
AC_SUBST(initdir)
AC_ARG_WITH(launchddir,
[ --with-launchddir=DIR launchd services in DIR @<:@/Library/LaunchDaemons@:>@],
[launchddir=$withval],
[launchddir='/Library/LaunchDaemons'])
AC_SUBST(launchddir)
AC_ARG_WITH(tmpfilesdir,
AS_HELP_STRING([--with-tmpfilesdir=DIR],[tmpfiles config in DIR, disabled by default]),
[tmpfilesdir=$withval],
[tmpfilesdir=''])
AC_SUBST(tmpfilesdir)
AC_ARG_WITH([ocf],
[AS_HELP_STRING([--without-ocf], [build OCF-compliant cluster resource agents])],
,
[OCF_SUBDIR='ocf'],
)
AC_SUBST(OCF_SUBDIR)
AC_ARG_WITH([server],
[AS_HELP_STRING([--without-server], [do not build server components])],
[with_server=$withval],
[with_server='yes'],
)
AM_CONDITIONAL([WITH_SERVER], [test x$with_server = xyes])
# LEX needs a check
AC_PROG_LEX([noyywrap])
if test "x${LEX}" != "xflex" -a "x${FLEX}" != "xlex"; then
AC_MSG_ERROR([Flex or lex required to build glusterfs.])
fi
dnl
dnl Word sizes...
dnl
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
SIZEOF_SHORT=$ac_cv_sizeof_short
SIZEOF_INT=$ac_cv_sizeof_int
SIZEOF_LONG=$ac_cv_sizeof_long
SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
AC_SUBST(SIZEOF_SHORT)
AC_SUBST(SIZEOF_INT)
AC_SUBST(SIZEOF_LONG)
AC_SUBST(SIZEOF_LONG_LONG)
# size of time_t
AC_CHECK_SIZEOF(time_t)
SIZEOF_TIME_T=$ac_cv_sizeof_time_t
AC_SUBST(SIZEOF_TIME_T)
# YACC needs a check
AC_PROG_YACC
if test "x${YACC}" = "xbyacc" -o "x${YACC}" = "xyacc" -o "x${YACC}" = "x"; then
AC_MSG_ERROR([GNU Bison required to build glusterfs.])
fi
AC_CHECK_TOOL([LD],[ld])
AC_CHECK_LIB([crypto], [MD5], , AC_MSG_ERROR([OpenSSL crypto library is required to build glusterfs]))
AC_CHECK_LIB([pthread], [pthread_mutex_init], , AC_MSG_ERROR([Posix threads library is required to build glusterfs]))
AC_CHECK_FUNC([dlopen], [has_dlopen=yes], AC_CHECK_LIB([dl], [dlopen], , AC_MSG_ERROR([Dynamic linking library required to build glusterfs])))
AC_CHECK_LIB([intl], [gettext])
AC_CHECK_HEADERS([sys/xattr.h])
AC_CHECK_HEADERS([sys/ioctl.h], AC_DEFINE(HAVE_IOCTL_IN_SYS_IOCTL_H, 1, [have sys/ioctl.h]))
AC_CHECK_HEADERS([sys/extattr.h])
AC_CHECK_HEADERS([openssl/dh.h])
AC_CHECK_HEADERS([openssl/ecdh.h])
AC_CHECK_LIB([ssl], [SSL_CTX_get0_param], [AC_DEFINE([HAVE_SSL_CTX_GET0_PARAM], [1], [define if found OpenSSL SSL_CTX_get0_param])])
dnl Math library
AC_CHECK_LIB([m], [pow], [MATH_LIB='-lm'], [MATH_LIB=''])
AC_SUBST(MATH_LIB)
dnl depend on libuuid.so
PKG_CHECK_MODULES([UUID], [uuid],
[have_uuid=yes
AC_DEFINE(HAVE_LIBUUID, 1, [have libuuid.so])
PKGCONFIG_UUID=uuid],
[have_uuid=no])
AM_CONDITIONAL([HAVE_LIBUUID], [test x$have_uuid = xyes])
dnl older version of libuuid (from e2fsprogs) require including uuid/uuid.h
saved_CFLAGS=${CFLAGS}
CFLAGS="${CFLAGS} ${UUID_CFLAGS}"
AC_CHECK_HEADER([uuid.h], [], [AC_CHECK_HEADER([uuid/uuid.h])],
[[#if HAVE_UUID_H
#include <uuid.h>
#endif
]])
CFLAGS=${saved_CFLAGS}
if test "x$ac_cv_header_uuid_uuid_h" = "xyes"; then
UUID_CFLAGS="${UUID_CFLAGS} -I$(pkg-config --variable=includedir uuid)/uuid"
have_uuid=yes
fi
if test "x$have_uuid" != "xyes"; then
case $host_os in
*freebsd*)
AC_MSG_ERROR([e2fsprogs-libuuid is required to build glusterfs])
;;
linux*)
AC_MSG_ERROR([libuuid is required to build glusterfs])
;;
*)
AC_MSG_ERROR([a Linux compatible libuuid is required to build glusterfs])
;;
esac
fi
dnl libglusterfs needs uuid.h, practically everything depends on it
GF_CFLAGS="${GF_CFLAGS} ${UUID_CFLAGS}"
dnl PKGCONFIG_UUID is used for the dependency in *.pc.in files
AC_SUBST(PKGCONFIG_UUID)
dnl Check for xxhash library.
PKG_CHECK_MODULES([XXHASH], [libxxhash],
[have_libxxhash=yes
AC_DEFINE(HAVE_LIBXXHASH, 1, [Define to 1 if you have libxxhash.so.])],
[have_libxxhash=no])
AM_CONDITIONAL([HAVE_LIBXXHASH], [test x$have_libxxhash = xyes])
dnl Note xxhsum binary is required to run gfid2path tests.
if test "x$have_libxxhash" = "xyes"; then
AC_CHECK_PROG([XXHSUM], [xxhsum], [yes], [no])
if test "x$XXHSUM" = "xno"; then
AC_MSG_WARN([install 'xxhsum' binary if you plan to run the tests.])
fi
GF_CFLAGS="${GF_CFLAGS} ${XXHASH_CFLAGS}"
fi
dnl NetBSD does not support POSIX ACLs :-(
case $host_os in
*netbsd* | darwin*)
AC_MSG_WARN([platform does not support POSIX ACLs... disabling them])
ACL_LIBS=''
USE_POSIX_ACLS='0'
BUILD_POSIX_ACLS='no'
;;
*)
AC_CHECK_HEADERS([sys/acl.h], ,
AC_MSG_ERROR([Support for POSIX ACLs is required]))
USE_POSIX_ACLS='1'
BUILD_POSIX_ACLS='yes'
case $host_os in
linux*)
ACL_LIBS='-lacl'
;;
solaris*)
ACL_LIBS='-lsec'
;;
*freebsd*)
ACL_LIBS='-lc'
;;
darwin*)
ACL_LIBS='-lc'
;;
esac
if test "x${ACL_LIBS}" = "x-lacl"; then
AC_CHECK_HEADERS([acl/libacl.h], , AC_MSG_ERROR([libacl is required for building on ${host_os}]))
fi
;;
esac
AC_SUBST(ACL_LIBS)
AC_SUBST(USE_POSIX_ACLS)
# libglusterfs/checksum
AC_CHECK_HEADERS([openssl/md5.h])
# Zlib is used by libglusterfs checksum and cdc xlator.
PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.0], [have_zlib=yes], [have_zlib=no])
if test x$have_zlib = xyes; then
AC_DEFINE(HAVE_ZLIB, 1, [Define if zlib is found.])
AC_SUBST([ZLIB_CFLAGS])
AC_SUBST([ZLIB_LIBS])
else
AC_MSG_ERROR([zlib is required to build glusterfs])
fi
AC_CHECK_HEADERS([linux/falloc.h])
AC_CHECK_HEADERS([linux/oom.h], AC_DEFINE(HAVE_LINUX_OOM_H, 1, [have linux/oom.h]))
dnl some os may not have GNU defined strnlen function
AC_CHECK_FUNC([strnlen], [have_strnlen=yes])
if test "x${have_strnlen}" = "xyes"; then
AC_DEFINE(HAVE_STRNLEN, 1, [define if found strnlen])
fi
AC_SUBST(HAVE_STRNLEN)
AC_CHECK_FUNC([setfsuid], [have_setfsuid=yes])
AC_CHECK_FUNC([setfsgid], [have_setfsgid=yes])
if test "x${have_setfsuid}" = "xyes" -a "x${have_setfsgid}" = "xyes"; then
AC_DEFINE(HAVE_SET_FSID, 1, [define if found setfsuid setfsgid])
fi
dnl test umount2 function
AC_CHECK_FUNC([umount2], [have_umount2=yes])
if test "x${have_umount2}" = "xyes"; then
AC_DEFINE(HAVE_UMOUNT2, 1, [define if found umount2])
fi
dnl Check Python Availability
have_python=no
dnl if the user has not specified a python, pick one
if test -z "${PYTHON}"; then
case $host_os in
freebsd*)
if test -x /usr/local/bin/python3; then
PYTHON=/usr/local/bin/python3
else
PYTHON=/usr/local/bin/python2
fi
;;
*)
if test -x /usr/bin/python3; then
PYTHON=/usr/bin/python3
else
PYTHON=/usr/bin/python2
fi
;;
esac
fi
AM_PATH_PYTHON([2.6],,[:])
if test -n "${PYTHON}"; then
have_python=yes
fi
AM_CONDITIONAL(HAVE_PYTHON, test "x$have_python" = "xyes")
dnl Use pkg-config to get runtime search path missing from ${PYTHON}-config
dnl Just do "true" on failure so that configure does not bail out
dnl Note: python 2.6's devel pkg (e.g. in CentOS/RHEL 6) does not have
dnl pkg-config files, so this work-around instead
if test "x${PYTHON_VERSION}" = "x2.6"; then
PYTHON_CFLAGS=$(python-config --includes)
PYTHON_LIBS=$(python-config --libs)
else
PKG_CHECK_MODULES([PYTHON], "python-${PYTHON_VERSION}",,true)
fi
PYTHON_CFLAGS=$(echo ${PYTHON_CFLAGS} | sed -e 's|-I|-isystem |')
BUILD_PYTHON_SITE_PACKAGES=${pythondir}
AC_SUBST(BUILD_PYTHON_SITE_PACKAGES)
# Eval two times to expand fully. First eval replaces $exec_prefix into $prefix
# Second eval will expand $prefix
build_python_site_packages_temp="${pythondir}"
eval build_python_site_packages_temp=\"${build_python_site_packages_temp}\"
eval build_python_site_packages_temp=\"${build_python_site_packages_temp}\"
BUILD_PYTHON_SITE_PACKAGES_EXPANDED=${build_python_site_packages_temp}
AC_SUBST(BUILD_PYTHON_SITE_PACKAGES_EXPANDED)
# FUSE section
AC_ARG_ENABLE([fuse-client],
AS_HELP_STRING([--disable-fuse-client],[Do not build the fuse client. NOTE: you cannot mount glusterfs without the client]))
BUILD_FUSE_CLIENT=no
if test "x$enable_fuse_client" != "xno"; then
FUSE_CLIENT_SUBDIR=fuse
BUILD_FUSE_CLIENT="yes"
fi
AC_SUBST(FUSE_CLIENT_SUBDIR)
AC_ARG_ENABLE([fuse-notifications],
AS_HELP_STRING([--disable-fuse-notifications], [Disable FUSE notifications]))
AS_IF([test "x$enable_fuse_notifications" != "xno"], [
AC_DEFINE([HAVE_FUSE_NOTIFICATIONS], [1], [Use FUSE notifications])
])
# end FUSE section
dnl Find out OpenSSL trusted certificates path
AC_MSG_CHECKING([for OpenSSL trusted certificates path])
SSL_CERT_PATH=$(openssl version -d | sed -e 's|OPENSSLDIR: "\(.*\)".*|\1|')
if test -d "${SSL_CERT_PATH}" 1>/dev/null 2>&1; then
AC_MSG_RESULT([$SSL_CERT_PATH])
AC_DEFINE_UNQUOTED(SSL_CERT_PATH, ["$SSL_CERT_PATH"], [Path to OpenSSL trusted certificates.])
AC_SUBST(SSL_CERT_PATH)
else
AC_MSG_ERROR([Unable to detect path to OpenSSL trusted certificates])
fi
AC_CHECK_LIB([ssl], TLS_method, [HAVE_OPENSSL_1_1="yes"], [HAVE_OPENSSL_1_1="no"])
if test "x$HAVE_OPENSSL_1_1" = "xyes"; then
AC_DEFINE([HAVE_TLS_METHOD], [1], [Using OpenSSL-1.1 TLS_method])
else
AC_CHECK_LIB([ssl], TLSv1_2_method, [AC_DEFINE([HAVE_TLSV1_2_METHOD], [1], [Using OpenSSL-1.0 TLSv1_2_method])])
fi
# FUSERMOUNT section
AC_ARG_ENABLE([fusermount],
AS_HELP_STRING([--disable-fusermount],[Use system's fusermount]))
BUILD_FUSERMOUNT="yes"
if test "x$enable_fusermount" = "xno"; then
BUILD_FUSERMOUNT="no"
else
AC_DEFINE(GF_FUSERMOUNT, 1, [Use our own fusermount])
FUSERMOUNT_SUBDIR="contrib/fuse-util"
fi
AC_SUBST(FUSERMOUNT_SUBDIR)
#end FUSERMOUNT section
# EPOLL section
AC_ARG_ENABLE([epoll],
AS_HELP_STRING([--disable-epoll],[Use poll instead of epoll.]))
BUILD_EPOLL=no
if test "x$enable_epoll" != "xno"; then
AC_CHECK_HEADERS([sys/epoll.h],
[BUILD_EPOLL=yes],
[BUILD_EPOLL=no])
fi
# end EPOLL section
# SYNCDAEMON section
AC_ARG_ENABLE([georeplication],
AS_HELP_STRING([--disable-georeplication],[Do not install georeplication components]))
BUILD_SYNCDAEMON=no
case $host_os in
freebsd*)
#do nothing
;;
linux*)
#do nothing
;;
netbsd*)
#do nothing
;;
*)
#disabling geo replication for non-linux platforms
enable_georeplication=no
;;
esac
SYNCDAEMON_COMPILE=0
if test "x${with_server}" = "xyes" -a "x${enable_georeplication}" != "xno"; then
if test "x${have_python}" = "xno" ; then
AC_MSG_ERROR([only python 2 and 3 are supported])
else
SYNCDAEMON_SUBDIR=geo-replication
SYNCDAEMON_COMPILE=1
BUILD_SYNCDAEMON="yes"
AC_MSG_CHECKING([if python has ctypes support...])
if "${PYTHON}" -c 'import ctypes' 2>/dev/null; then
AC_MSG_RESULT("yes")
else
AC_MSG_ERROR([python does not have ctypes support])
fi
fi
fi
AC_SUBST(SYNCDAEMON_COMPILE)
AC_SUBST(SYNCDAEMON_SUBDIR)
# end SYNCDAEMON section
# only install scripts from extras/geo-rep when enabled
if test "x${with_server}" = "xyes" -a "x$enable_georeplication" != "xno"; then
GEOREP_EXTRAS_SUBDIR=geo-rep
fi
AC_SUBST(GEOREP_EXTRAS_SUBDIR)
AM_CONDITIONAL(USE_GEOREP, test "x$enable_georeplication" != "xno")
# METADISP section
AC_ARG_ENABLE([metadisp],
AS_HELP_STRING([--enable-metadisp],[Enable the metadata dispersal xlator]))
BUILD_METADISP=no
if test "x${enable_metadisp}" = "xyes"; then
BUILD_METADISP=yes
fi
AM_CONDITIONAL([BUILD_METADISP], [test "x$BUILD_METADISP" = "xyes"])
# end METADISP section
# Events section
AC_ARG_ENABLE([events],
AS_HELP_STRING([--disable-events],[Do not install Events components]))
BUILD_EVENTS=no
EVENTS_ENABLED=0
EVENTS_SUBDIR=
if test "x$enable_events" != "xno"; then
EVENTS_SUBDIR=events
EVENTS_ENABLED=1
BUILD_EVENTS="yes"
if test "x${have_python}" = "xno"; then
if test "x${enable_events}" = "xyes"; then
AC_MSG_ERROR([python 2 or 3 required. exiting.])
fi
AC_MSG_WARN([python not found, disabling events])
EVENTS_SUBDIR=
EVENTS_ENABLED=0
BUILD_EVENTS="no"
else
AC_DEFINE(USE_EVENTS, 1, [define if events enabled])
fi
fi
AC_SUBST(EVENTS_ENABLED)
AC_SUBST(EVENTS_SUBDIR)
AM_CONDITIONAL([BUILD_EVENTS], [test "x${BUILD_EVENTS}" = "xyes"])
# end Events section
#start firewalld section
BUILD_FIREWALLD="no"
AC_ARG_ENABLE([firewalld],
AS_HELP_STRING([--enable-firewalld],[enable installation configuration for firewalld]),
[BUILD_FIREWALLD="${enableval}"], [BUILD_FIREWALLD="no"])
if test "x${with_server}" = "xyes" -a "x${BUILD_FIREWALLD}" = "xyes"; then
if !(test -d /usr/lib/firewalld/services 1>/dev/null 2>&1) ; then
BUILD_FIREWALLD="no (firewalld not installed)"
fi
fi
AM_CONDITIONAL([USE_FIREWALLD],test ["x${BUILD_FIREWALLD}" = "xyes"])
#endof firewald section
# xml-output
AC_ARG_ENABLE([xml-output],
AS_HELP_STRING([--disable-xml-output],[Disable the xml output]))
BUILD_XML_OUTPUT="yes"
if test "x$enable_xml_output" != "xno"; then
PKG_CHECK_MODULES([XML], [libxml-2.0], [], [no_xml="yes"])
if test "x${no_xml}" = "x"; then
AC_DEFINE([HAVE_LIB_XML], [1], [Define to 1 if using libxml2.])
else
if test "x$enable_georeplication" != "xno"; then
AC_MSG_ERROR([libxml2 devel libraries not found])
else
AC_MSG_WARN([libxml2 devel libraries not found disabling XML support])
BUILD_XML_OUTPUT="no"
fi
fi
else
if test "x$enable_georeplication" != "xno"; then
AC_MSG_ERROR([geo-replication requires xml output])
fi
BUILD_XML_OUTPUT="no"
fi
# end of xml-output
dnl cloudsync section
BUILD_CLOUDSYNC="no"
AC_CHECK_LIB([curl], [curl_easy_setopt], [LIBCURL="-lcurl"])
if test -n "$LIBCURL";then
HAVE_LIBCURL="yes"
fi
AC_CHECK_HEADERS([openssl/hmac.h openssl/evp.h openssl/bio.h openssl/buffer.h], [HAVE_OPENSSL="yes"])
if test "x$HAVE_LIBCURL" = "xyes" -a "x$HAVE_OPENSSL" = "xyes";then
HAVE_AMAZONS3="yes"
fi
AM_CONDITIONAL([BUILD_AMAZONS3_PLUGIN], [test "x$HAVE_AMAZONS3" = "xyes"])
if test "x$HAVE_AMAZONS3" = "xyes";then
BUILD_CLOUDSYNC="yes"
fi
BUILD_CVLT_PLUGIN="no"
case $host_os in
#enable cvlt plugin only for linux platforms
linux*)