-
Notifications
You must be signed in to change notification settings - Fork 73
/
configure.ac
2077 lines (1818 loc) · 79.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
###############################################################################
## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved.
## Copyright (C) 2004-2023 Red Hat, Inc. All rights reserved.
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
## of the GNU General Public License v.2.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software Foundation,
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
################################################################################
AC_PREREQ(2.69)
################################################################################
dnl -- Process this file with autoconf to produce a configure script.
AC_INIT
CONFIGURE_LINE="$0 $@"
AC_CONFIG_SRCDIR([lib/device/dev-cache.h])
AC_CONFIG_HEADERS([include/configure.h])
################################################################################
dnl -- Setup the directory where autoconf has auxiliary files
AC_CONFIG_AUX_DIR(autoconf)
################################################################################
dnl -- Get system type
AC_CANONICAL_TARGET([])
AS_IF([test -z "$CFLAGS"], [COPTIMISE_FLAG="-O2"])
AS_CASE(["$host_os"],
[linux*], [
# equivalent to -rdynamic
ELDFLAGS="-Wl,--export-dynamic"
STATIC_LDFLAGS="-Wl,--no-export-dynamic"
# FIXME Generate list and use --dynamic-list=.dlopen.sym
CLDWHOLEARCHIVE="-Wl,-whole-archive"
CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
LIB_SUFFIX="so"
DEVMAPPER="yes"
ODIRECT="yes"
DM_IOCTLS="yes"
SELINUX="yes"
FSADM="yes"
LVMIMPORTVDO="yes"
BLKDEACTIVATE="yes"],
[darwin*], [
CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
ELDFLAGS=
CLDWHOLEARCHIVE="-all_load"
CLDNOWHOLEARCHIVE=
LIB_SUFFIX="dylib"
DEVMAPPER="yes"
ODIRECT="no"
DM_IOCTLS="no"
SELINUX="no"
FSADM="no"
LVMIMPORTVDO="no"
BLKDEACTIVATE="no"],
[])
################################################################################
dnl -- Checks for programs.
AC_PROG_SED
AC_PROG_AWK
save_CFLAGS=$CFLAGS
save_CXXFLAGS=$CXXFLAGS
AC_PROG_CC
AC_PROG_CXX
CFLAGS=$save_CFLAGS
CXXFLAGS=$save_CXXFLAGS
PATH_SBIN="$PATH:/usr/sbin:/sbin"
dnl probably no longer needed in 2008, but...
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_GREP
AC_PROG_EGREP
AC_PROG_MAKE_SET
AC_PROG_MKDIR_P
AC_PROG_RANLIB
AC_CHECK_TOOL([READELF], [readelf])
AC_CHECK_TOOL(AR, ar)
AC_PATH_TOOL(CFLOW_CMD, cflow)
AC_PATH_TOOL(CSCOPE_CMD, cscope)
AC_PATH_TOOL(CHMOD, chmod)
AC_PATH_TOOL(WC, wc)
AC_PATH_TOOL(SORT, sort)
################################################################################
dnl -- Check for header files.
AC_HEADER_DIRENT
AC_HEADER_MAJOR
AC_HEADER_STDBOOL
AC_CHECK_HEADERS([assert.h ctype.h dirent.h errno.h fcntl.h float.h \
getopt.h inttypes.h langinfo.h libgen.h limits.h locale.h paths.h \
signal.h stdarg.h stddef.h stdio.h stdlib.h string.h sys/file.h \
sys/ioctl.h syslog.h sys/mman.h sys/param.h sys/resource.h sys/stat.h \
sys/time.h sys/types.h sys/utsname.h sys/wait.h time.h \
unistd.h], , [AC_MSG_ERROR(bailing out)])
AC_CHECK_HEADERS(termios.h sys/statvfs.h sys/timerfd.h sys/vfs.h linux/magic.h linux/fiemap.h)
AC_CHECK_HEADERS(libaio.h,LVM_NEEDS_LIBAIO_WARN=,LVM_NEEDS_LIBAIO_WARN=y)
AS_CASE(["$host_os"],
[linux*], [AC_CHECK_HEADERS([asm/byteorder.h linux/fs.h malloc.h], [], [AC_MSG_ERROR(bailing out)])],
[darwin*], [AC_CHECK_HEADERS([machine/endian.h sys/disk.h], [], [AC_MSG_ERROR(bailing out)])])
################################################################################
dnl -- Check for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_CHECK_MEMBERS([struct stat.st_rdev])
AC_CHECK_TYPES([ptrdiff_t])
AC_STRUCT_ST_BLOCKS
AC_STRUCT_TM
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_MODE_T
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_SSIZE_T
AC_TYPE_UID_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AX_GCC_BUILTIN([__builtin_clz])
AX_GCC_BUILTIN([__builtin_clzll])
AX_GCC_BUILTIN([__builtin_ffs])
AC_DEFINE([_GNU_SOURCE], 1, [Define to get access to GNU/Linux extension])
AC_DEFINE([_REENTRANT], 1, [Define to use re-entrant thread safe versions])
################################################################################
dnl -- Check for functions
AC_CHECK_FUNCS([ftruncate gethostname getpagesize gettimeofday localtime_r \
memchr memset mkdir mkfifo munmap nl_langinfo pselect realpath rmdir setenv \
setlocale strcasecmp strchr strcspn strdup strerror strncasecmp strndup \
strrchr strspn strstr strtol strtoul uname], , [AC_MSG_ERROR(bailing out)])
AC_CHECK_FUNCS([ffs mallinfo2 prlimit versionsort])
AC_FUNC_ALLOCA
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_CHOWN
AC_FUNC_FORK
AC_FUNC_LSTAT
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MKTIME
AC_FUNC_MMAP
AC_FUNC_REALLOC
AC_FUNC_STAT
AC_FUNC_STRTOD
AC_FUNC_VPRINTF
################################################################################
dnl -- Disable dependency tracking
AC_MSG_CHECKING([whether to enable dependency tracking])
AC_ARG_ENABLE(dependency-tracking,
AS_HELP_STRING([--disable-dependency-tracking],
[speeds up one-time build.]),
USE_TRACKING=$enableval, USE_TRACKING="yes")
AC_MSG_RESULT([$USE_TRACKING])
################################################################################
dnl -- Disable silence rules
AC_MSG_CHECKING([whether to build silently])
AC_ARG_ENABLE(silent-rules,
AS_HELP_STRING([--disable-silent-rules], [disable silent building]),
SILENT_RULES=$enableval, SILENT_RULES="yes")
AC_MSG_RESULT([$SILENT_RULES])
################################################################################
dnl -- Enables statically-linked tools
AC_MSG_CHECKING([whether to use static linking])
AC_ARG_ENABLE(static_link,
AS_HELP_STRING([--enable-static_link],
[use this to link the tools to their libraries
statically (default is dynamic linking]),
STATIC_LINK=$enableval, STATIC_LINK="no")
AC_MSG_RESULT([$STATIC_LINK])
################################################################################
dnl -- Disables shared linking
AC_MSG_CHECKING([whether to use dynamic linking])
AC_ARG_ENABLE(shared,
AS_HELP_STRING([--disable-shared], [disable dynamic linking]),
SHARED_LINK=$enableval, SHARED_LINK="yes")
AC_MSG_RESULT([$SHARED_LINK])
################################################################################
dnl -- Check if compiler/linker supports PIE and RELRO
AC_TRY_CCFLAG([-pie], [HAVE_PIE], [], [])
AC_SUBST(HAVE_PIE)
AC_TRY_LDFLAGS([-Wl,-z,relro,-z,now,-z,pack-relative-relocs,--as-needed], [HAVE_FULL_RELRO], [], [])
AC_SUBST(HAVE_FULL_RELRO)
################################################################################
dnl -- Prefix is /usr by default, the exec_prefix default is setup later
AC_PREFIX_DEFAULT(/usr)
################################################################################
dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin
test "$exec_prefix" = "NONE" && test "$prefix" = "NONE" && exec_prefix=""
test "$prefix" = "NONE" && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
AC_ARG_WITH(blkid, [AS_HELP_STRING([--without-blkid], [do not build with blkid library])],
[], with_blkid="yes")
AC_ARG_WITH(systemd, [AS_HELP_STRING([--without-systemd], [do not build with systemd library])],
[], with_systemd="yes")
AC_ARG_WITH(udev, [AS_HELP_STRING([--without-udev], [do not build with udev library])],
[], with_udev="yes")
################################################################################
dnl -- Setup the ownership of the files
AC_MSG_CHECKING([file owner])
AC_ARG_WITH(user,
AS_HELP_STRING([--with-user=USER],
[set the owner of installed files [USER=]]),
OWNER=$withval)
AC_MSG_RESULT([$OWNER])
test -n "$OWNER" && INSTALL="$INSTALL -o $OWNER"
################################################################################
dnl -- Setup the group ownership of the files
AC_MSG_CHECKING([group owner])
AC_ARG_WITH(group,
AS_HELP_STRING([--with-group=GROUP],
[set the group owner of installed files [GROUP=]]),
GROUP=$withval)
AC_MSG_RESULT([$GROUP])
test -n "$GROUP" && INSTALL="$INSTALL -g $GROUP"
################################################################################
dnl -- Setup device node ownership
AC_MSG_CHECKING([device node uid])
AC_ARG_WITH(device-uid,
AS_HELP_STRING([--with-device-uid=UID],
[set the owner used for new device nodes [UID=0]]),
DM_DEVICE_UID=$withval, DM_DEVICE_UID=0)
AC_MSG_RESULT([$DM_DEVICE_UID])
AC_DEFINE_UNQUOTED([DM_DEVICE_UID], [$DM_DEVICE_UID], [Define default owner for device node])
################################################################################
dnl -- Setup device group ownership
AC_MSG_CHECKING([device node gid])
AC_ARG_WITH(device-gid,
AS_HELP_STRING([--with-device-gid=GID],
[set the group used for new device nodes [GID=0]]),
DM_DEVICE_GID=$withval, DM_DEVICE_GID=0)
AC_MSG_RESULT([$DM_DEVICE_GID])
AC_DEFINE_UNQUOTED([DM_DEVICE_GID], [$DM_DEVICE_GID], [Define default group for device node])
################################################################################
dnl -- Setup device mode
AC_MSG_CHECKING([device node mode])
AC_ARG_WITH(device-mode,
AS_HELP_STRING([--with-device-mode=MODE],
[set the mode used for new device nodes [MODE=0600]]),
DM_DEVICE_MODE=$withval, DM_DEVICE_MODE=0600)
AC_MSG_RESULT([$DM_DEVICE_MODE])
AC_DEFINE_UNQUOTED([DM_DEVICE_MODE], [$DM_DEVICE_MODE], [Define default mode for device node])
AC_MSG_CHECKING([when to create device nodes])
AC_ARG_WITH(device-nodes-on,
AS_HELP_STRING([--with-device-nodes-on=ON],
[create nodes on resume or create [ON=resume]]),
ADD_NODE=$withval, ADD_NODE=resume)
AS_CASE(["$ADD_NODE"],
[resume], [add_on=DM_ADD_NODE_ON_RESUME],
[create], [add_on=DM_ADD_NODE_ON_CREATE],
[AC_MSG_ERROR([--with-device-nodes-on parameter invalid])])
AC_MSG_RESULT([on $ADD_NODE])
AC_DEFINE_UNQUOTED([DEFAULT_DM_ADD_NODE], $add_on, [Define default node creation behavior with dmsetup create])
dnl -- Default settings for lvm.conf { devices/use_devicesfile }
AC_MSG_CHECKING([default for use_devicesfile])
AC_ARG_WITH(default-use-devices-file,
AS_HELP_STRING([--with-default-use-devices-file=ON], [default lvm.conf devices/use_devicesfile = [ON=0]]),
DEFAULT_USE_DEVICES_FILE=$withval, DEFAULT_USE_DEVICES_FILE=0)
AS_CASE(["$DEFAULT_USE_DEVICES_FILE"],
[0|1], [],
[AC_MSG_ERROR([--with-default-use-devices-file parameter invalid])])
AC_MSG_RESULT([$DEFAULT_USE_DEVICES_FILE])
AC_DEFINE_UNQUOTED(DEFAULT_USE_DEVICES_FILE, [$DEFAULT_USE_DEVICES_FILE],
[Default for lvm.conf use_devicesfile.])
AC_MSG_CHECKING([default name mangling])
AC_ARG_WITH(default-name-mangling,
AS_HELP_STRING([--with-default-name-mangling=MANGLING],
[default name mangling: auto/none/hex [auto]]),
MANGLING=$withval, MANGLING=auto)
AS_CASE(["$MANGLING"],
[auto], [mangling=DM_STRING_MANGLING_AUTO],
[no|none|disabled], [mangling=DM_STRING_MANGLING_NONE],
[hex], [mangling=DM_STRING_MANGLING_HEX],
[AC_MSG_ERROR([--with-default-name-mangling parameter invalid])])
AC_MSG_RESULT([$MANGLING])
AC_DEFINE_UNQUOTED([DEFAULT_DM_NAME_MANGLING], $mangling, [Define default name mangling behaviour])
AC_MSG_CHECKING([default for event_activation])
AC_ARG_WITH(default-event-activation,
AS_HELP_STRING([--with-default-event-activation=ON], [default lvm.conf global/event_activation = [ON=1]]),
DEFAULT_EVENT_ACTIVATION=$withval, DEFAULT_EVENT_ACTIVATION=1)
AS_CASE(["$DEFAULT_EVENT_ACTIVATION"],
[0|1], [],
[AC_MSG_ERROR([--with-default-event-activation parameter invalid])])
AC_MSG_RESULT([$DEFAULT_EVENT_ACTIVATION])
AC_DEFINE_UNQUOTED(DEFAULT_EVENT_ACTIVATION, [$DEFAULT_EVENT_ACTIVATION],
[Default for lvm.conf event_activation.])
################################################################################
dnl -- snapshots inclusion type
AC_MSG_CHECKING([whether to include snapshots])
AC_ARG_WITH(snapshots,
AS_HELP_STRING([--with-snapshots=TYPE],
[snapshot support: internal/none [internal]]),
SNAPSHOTS=$withval, SNAPSHOTS=internal)
AC_MSG_RESULT([$SNAPSHOTS])
AS_CASE(["$SNAPSHOTS"],
[no|none|shared], [],
[internal], [
AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.])],
[AC_MSG_ERROR([--with-snapshots parameter invalid])])
################################################################################
dnl -- mirrors inclusion type
AC_MSG_CHECKING([whether to include mirrors])
AC_ARG_WITH(mirrors,
AS_HELP_STRING([--with-mirrors=TYPE],
[mirror support: internal/none [internal]]),
MIRRORS=$withval, MIRRORS=internal)
AC_MSG_RESULT([$MIRRORS])
AS_CASE(["$MIRRORS"],
[no|none|shared], [],
[internal], [
AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.])],
[AC_MSG_ERROR([--with-mirrors parameter invalid])])
################################################################################
dnl -- raid inclusion type
AC_ARG_WITH(default-mirror-segtype,
AS_HELP_STRING([--with-default-mirror-segtype=TYPE],
[default mirror segtype: raid1/mirror [raid1]]),
DEFAULT_MIRROR_SEGTYPE=$withval, DEFAULT_MIRROR_SEGTYPE="raid1")
AC_ARG_WITH(default-raid10-segtype,
AS_HELP_STRING([--with-default-raid10-segtype=TYPE],
[default mirror segtype: raid10/mirror [raid10]]),
DEFAULT_RAID10_SEGTYPE=$withval, DEFAULT_RAID10_SEGTYPE="raid10")
AC_DEFINE([RAID_INTERNAL], 1,
[Define to 1 to include built-in support for raid.])
AC_DEFINE_UNQUOTED([DEFAULT_MIRROR_SEGTYPE], ["$DEFAULT_MIRROR_SEGTYPE"],
[Default segtype used for mirror volumes.])
AC_DEFINE_UNQUOTED([DEFAULT_RAID10_SEGTYPE], ["$DEFAULT_RAID10_SEGTYPE"],
[Default segtype used for raid10 volumes.])
################################################################################
AC_ARG_WITH(default-sparse-segtype,
AS_HELP_STRING([--with-default-sparse-segtype=TYPE], [default sparse segtype: thin/snapshot [thin]]), [
AS_CASE(["$withval"],
[thin|snapshot], [DEFAULT_SPARSE_SEGTYPE=$withval],
[AC_MSG_ERROR([--with-default-sparse-segtype parameter invalid])])
], [DEFAULT_SPARSE_SEGTYPE="thin"])
################################################################################
dnl -- thin provisioning
AC_MSG_CHECKING([whether to include thin provisioning])
AC_ARG_WITH(thin,
AS_HELP_STRING([--with-thin=TYPE],
[thin provisioning support: internal/none [internal]]),
THIN=$withval, THIN=internal)
AC_ARG_WITH(thin-check,
AS_HELP_STRING([--with-thin-check=PATH],
[thin_check tool: [autodetect]]),
THIN_CHECK_CMD=$withval, THIN_CHECK_CMD="autodetect")
AC_ARG_WITH(thin-dump,
AS_HELP_STRING([--with-thin-dump=PATH],
[thin_dump tool: [autodetect]]),
THIN_DUMP_CMD=$withval, THIN_DUMP_CMD="autodetect")
AC_ARG_WITH(thin-repair,
AS_HELP_STRING([--with-thin-repair=PATH],
[thin_repair tool: [autodetect]]),
THIN_REPAIR_CMD=$withval, THIN_REPAIR_CMD="autodetect")
AC_ARG_WITH(thin-restore,
AS_HELP_STRING([--with-thin-restore=PATH],
[thin_restore tool: [autodetect]]),
THIN_RESTORE_CMD=$withval, THIN_RESTORE_CMD="autodetect")
AC_MSG_RESULT([$THIN])
AS_CASE(["$THIN"],
[no|none], [test "$DEFAULT_SPARSE_SEGTYPE" = "thin" && DEFAULT_SPARSE_SEGTYPE="snapshot"],
[shared], [],
[internal], [
AC_DEFINE([THIN_INTERNAL], 1, [Define to 1 to include built-in support for thin provisioning.])],
[AC_MSG_ERROR([--with-thin parameter invalid ($THIN)])])
AC_DEFINE_UNQUOTED([DEFAULT_SPARSE_SEGTYPE], ["$DEFAULT_SPARSE_SEGTYPE"],
[Default segtype used for sparse volumes.])
dnl -- thin_check needs-check flag
AC_ARG_ENABLE(thin_check_needs_check,
AS_HELP_STRING([--disable-thin_check_needs_check],
[required if thin_check version is < 0.3.0]),
THIN_CHECK_NEEDS_CHECK=$enableval, THIN_CHECK_NEEDS_CHECK="yes")
# Test if necessary thin tools are available
# if not - use plain defaults and warn user
AS_CASE(["$THIN"],
[internal|shared], [
# Empty means a config way to ignore thin checking
AS_IF([test "$THIN_CHECK_CMD" = "autodetect"], [
AC_PATH_TOOL(THIN_CHECK_CMD, thin_check, [], [$PATH_SBIN])
AS_IF([test -z "$THIN_CHECK_CMD"], [
AC_MSG_WARN([thin_check not found in path $PATH_SBIN])
THIN_CHECK_CMD="/usr/sbin/thin_check"
THIN_CONFIGURE_WARN="y"
])
])
AS_IF([test "$THIN_CHECK_NEEDS_CHECK" = "yes" && test "$THIN_CONFIGURE_WARN" != "y"], [
THIN_CHECK_VSN=$("$THIN_CHECK_CMD" -V 2>/dev/null)
THIN_CHECK_VSN=${THIN_CHECK_VSN##* } # trim away all before the first space
THIN_CHECK_VSN_MAJOR=$(echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $1}')
THIN_CHECK_VSN_MINOR=$(echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $2}')
AS_IF([test -z "$THIN_CHECK_VSN_MAJOR" || test -z "$THIN_CHECK_VSN_MINOR"], [
AC_MSG_WARN([$THIN_CHECK_CMD: Bad version "$THIN_CHECK_VSN" found])
THIN_CHECK_VERSION_WARN="y"
THIN_CHECK_NEEDS_CHECK="no"
], [test "$THIN_CHECK_VSN_MAJOR" -eq 0 && test "$THIN_CHECK_VSN_MINOR" -lt 3], [
AC_MSG_WARN([$THIN_CHECK_CMD: Old version "$THIN_CHECK_VSN" found])
THIN_CHECK_VERSION_WARN="y"
THIN_CHECK_NEEDS_CHECK="no"
])
])
# Empty means a config way to ignore thin dumping
AS_IF([test "$THIN_DUMP_CMD" = "autodetect"], [
AC_PATH_TOOL(THIN_DUMP_CMD, thin_dump, [], [$PATH_SBIN])
AS_IF([test -z "$THIN_DUMP_CMD"], [
AC_MSG_WARN(["thin_dump not found in path $PATH_SBIN"])
THIN_DUMP_CMD="/usr/sbin/thin_dump"
THIN_CONFIGURE_WARN="y"
])
])
# Empty means a config way to ignore thin repairing
AS_IF([test "$THIN_REPAIR_CMD" = "autodetect"], [
AC_PATH_TOOL(THIN_REPAIR_CMD, thin_repair, [], [$PATH_SBIN])
AS_IF([test -z "$THIN_REPAIR_CMD"], [
AC_MSG_WARN(["thin_repair not found in path $PATH_SBIN"])
THIN_REPAIR_CMD="/usr/sbin/thin_repair"
THIN_CONFIGURE_WARN="y"
])
])
# Empty means a config way to ignore thin restoring
AS_IF([test "$THIN_RESTORE_CMD" = "autodetect"], [
AC_PATH_TOOL(THIN_RESTORE_CMD, thin_restore, [], [$PATH_SBIN])
AS_IF([test -z "$THIN_RESTORE_CMD"], [
AC_MSG_WARN(["thin_restore not found in path $PATH_SBIN"])
THIN_RESTORE_CMD="/usr/sbin/thin_restore"
THIN_CONFIGURE_WARN="y"
])
])
AC_MSG_CHECKING([whether $THIN_CHECK_CMD ($THIN_CHECK_VSN_MAJOR.$THIN_CHECK_VSN_MINOR) supports the needs-check flag])
AC_MSG_RESULT([$THIN_CHECK_NEEDS_CHECK])
AS_IF([test "$THIN_CHECK_NEEDS_CHECK" = "yes"], [
AC_DEFINE([THIN_CHECK_NEEDS_CHECK], 1, [Define to 1 if the external 'thin_check' tool requires the --clear-needs-check-flag option])
])
])
AC_DEFINE_UNQUOTED([THIN_CHECK_CMD], ["$THIN_CHECK_CMD"],
[The path to 'thin_check', if available.])
AC_DEFINE_UNQUOTED([THIN_DUMP_CMD], ["$THIN_DUMP_CMD"],
[The path to 'thin_dump', if available.])
AC_DEFINE_UNQUOTED([THIN_REPAIR_CMD], ["$THIN_REPAIR_CMD"],
[The path to 'thin_repair', if available.])
AC_DEFINE_UNQUOTED([THIN_RESTORE_CMD], ["$THIN_RESTORE_CMD"],
[The path to 'thin_restore', if available.])
################################################################################
dnl -- cache inclusion type
AC_MSG_CHECKING([whether to include cache])
AC_ARG_WITH(cache,
AS_HELP_STRING([--with-cache=TYPE],
[cache support: internal/none [internal]]),
CACHE=$withval, CACHE="internal")
AC_ARG_WITH(cache-check,
AS_HELP_STRING([--with-cache-check=PATH],
[cache_check tool: [autodetect]]),
CACHE_CHECK_CMD=$withval, CACHE_CHECK_CMD="autodetect")
AC_ARG_WITH(cache-dump,
AS_HELP_STRING([--with-cache-dump=PATH],
[cache_dump tool: [autodetect]]),
CACHE_DUMP_CMD=$withval, CACHE_DUMP_CMD="autodetect")
AC_ARG_WITH(cache-repair,
AS_HELP_STRING([--with-cache-repair=PATH],
[cache_repair tool: [autodetect]]),
CACHE_REPAIR_CMD=$withval, CACHE_REPAIR_CMD="autodetect")
AC_ARG_WITH(cache-restore,
AS_HELP_STRING([--with-cache-restore=PATH],
[cache_restore tool: [autodetect]]),
CACHE_RESTORE_CMD=$withval, CACHE_RESTORE_CMD="autodetect")
AC_MSG_RESULT([$CACHE])
AS_CASE(["$CACHE"],
[no|none|shared], [],
[internal], [
AC_DEFINE([CACHE_INTERNAL], 1, [Define to 1 to include built-in support for cache.])],
[AC_MSG_ERROR([--with-cache parameter invalid])])
dnl -- cache_check needs-check flag
AC_ARG_ENABLE(cache_check_needs_check,
AS_HELP_STRING([--disable-cache_check_needs_check],
[required if cache_check version is < 0.5]),
CACHE_CHECK_NEEDS_CHECK=$enableval, CACHE_CHECK_NEEDS_CHECK="yes")
# Test if necessary cache tools are available
# if not - use plain defaults and warn user
AS_CASE(["$CACHE"],
[internal|shared], [
# Empty means a config way to ignore cache checking
AS_IF([test "$CACHE_CHECK_CMD" = "autodetect"], [
AC_PATH_TOOL(CACHE_CHECK_CMD, cache_check, [], [$PATH_SBIN])
AS_IF([test -z "$CACHE_CHECK_CMD"], [
AC_MSG_WARN([cache_check not found in path $PATH_SBIN])
CACHE_CHECK_CMD="/usr/sbin/cache_check"
CACHE_CONFIGURE_WARN="y"
])
])
AS_IF([test "$CACHE_CHECK_NEEDS_CHECK" = "yes" && test "$CACHE_CONFIGURE_WARN" != "y"], [
"$CACHE_CHECK_CMD" -V 2>/dev/null >conftest.tmp
read -r CACHE_CHECK_VSN < conftest.tmp
IFS=.- read -r CACHE_CHECK_VSN_MAJOR CACHE_CHECK_VSN_MINOR CACHE_CHECK_VSN_PATCH LEFTOVER < conftest.tmp
rm -f conftest.tmp
# Require version >= 0.5.4 for --clear-needs-check-flag
CACHE_CHECK_VSN_MAJOR=${CACHE_CHECK_VSN_MAJOR##* }
AS_IF([test -z "$CACHE_CHECK_VSN_MAJOR" \
|| test -z "$CACHE_CHECK_VSN_MINOR" \
|| test -z "$CACHE_CHECK_VSN_PATCH"], [
AC_MSG_WARN([$CACHE_CHECK_CMD: Bad version "$CACHE_CHECK_VSN" found])
CACHE_CHECK_VERSION_WARN="y"
CACHE_CHECK_NEEDS_CHECK="no"
], [test "$CACHE_CHECK_VSN_MAJOR" -eq 0], [
AS_IF([test "$CACHE_CHECK_VSN_MINOR" -lt 5 \
|| ( test "$CACHE_CHECK_VSN_MINOR" -eq 5 && test "$CACHE_CHECK_VSN_PATCH" -lt 4 )], [
AC_MSG_WARN([$CACHE_CHECK_CMD: Old version "$CACHE_CHECK_VSN" found])
CACHE_CHECK_VERSION_WARN="y"
CACHE_CHECK_NEEDS_CHECK="no"
])
AS_IF([test "$CACHE_CHECK_VSN_MINOR" -lt 7], [
AC_MSG_WARN([$CACHE_CHECK_CMD: Old version "$CACHE_CHECK_VSN" does not support new cache format V2])
CACHE_CHECK_VERSION_WARN=y
])
])
])
# Empty means a config way to ignore cache dumping
AS_IF([test "$CACHE_DUMP_CMD" = "autodetect"], [
AC_PATH_TOOL(CACHE_DUMP_CMD, cache_dump, [], [$PATH_SBIN])
AS_IF([test -z "$CACHE_DUMP_CMD"], [
AC_MSG_WARN(["cache_dump not found in path $PATH_SBIN"])
CACHE_DUMP_CMD="/usr/sbin/cache_dump"
CACHE_CONFIGURE_WARN="y"
])
])
# Empty means a config way to ignore cache repairing
AS_IF([test "$CACHE_REPAIR_CMD" = "autodetect"], [
AC_PATH_TOOL(CACHE_REPAIR_CMD, cache_repair, [], [$PATH_SBIN])
AS_IF([test -z "$CACHE_REPAIR_CMD"], [
AC_MSG_WARN(["cache_repair not found in path $PATH_SBIN"])
CACHE_REPAIR_CMD="/usr/sbin/cache_repair"
CACHE_CONFIGURE_WARN="y"
])
])
# Empty means a config way to ignore cache restoring
AS_IF([test "$CACHE_RESTORE_CMD" = "autodetect"], [
AC_PATH_TOOL(CACHE_RESTORE_CMD, cache_restore, [], [$PATH_SBIN])
AS_IF([test -z "$CACHE_RESTORE_CMD"], [
AC_MSG_WARN(["cache_restore not found in path $PATH_SBIN"])
CACHE_RESTORE_CMD="/usr/sbin/cache_restore"
CACHE_CONFIGURE_WARN="y"
])
])
AC_MSG_CHECKING([whether $CACHE_CHECK_CMD ($CACHE_CHECK_VSN_MAJOR.$CACHE_CHECK_VSN_MINOR.$CACHE_CHECK_VSN_PATCH) supports the needs-check flag])
AC_MSG_RESULT([$CACHE_CHECK_NEEDS_CHECK])
AS_IF([test "$CACHE_CHECK_NEEDS_CHECK" = "yes"], [
AC_DEFINE([CACHE_CHECK_NEEDS_CHECK], 1, [Define to 1 if the external 'cache_check' tool requires the --clear-needs-check-flag option])
])
])
AC_DEFINE_UNQUOTED([CACHE_CHECK_CMD], ["$CACHE_CHECK_CMD"],
[The path to 'cache_check', if available.])
AC_DEFINE_UNQUOTED([CACHE_DUMP_CMD], ["$CACHE_DUMP_CMD"],
[The path to 'cache_dump', if available.])
AC_DEFINE_UNQUOTED([CACHE_REPAIR_CMD], ["$CACHE_REPAIR_CMD"],
[The path to 'cache_repair', if available.])
AC_DEFINE_UNQUOTED([CACHE_RESTORE_CMD], ["$CACHE_RESTORE_CMD"],
[The path to 'cache_restore', if available.])
################################################################################
dnl -- cache inclusion type
AC_MSG_CHECKING([whether to include vdo])
AC_ARG_WITH(vdo,
AS_HELP_STRING([--with-vdo=TYPE],
[vdo support: internal/none [internal]]),
VDO=$withval, VDO="internal")
AC_MSG_RESULT([$VDO])
AC_ARG_WITH(vdo-format,
AS_HELP_STRING([--with-vdo-format=PATH],
[vdoformat tool: [autodetect]]),
VDO_FORMAT_CMD=$withval, VDO_FORMAT_CMD="autodetect")
AS_CASE(["$VDO"],
[no|none], [],
[internal], [
AC_DEFINE([VDO_INTERNAL], 1, [Define to 1 to include built-in support for vdo.])
AS_IF([test "$VDO_FORMAT_CMD" = "autodetect"], [
AC_PATH_TOOL(VDO_FORMAT_CMD, vdoformat, [], [$PATH])
AS_IF([test -z "$VDO_FORMAT_CMD"], [
AC_MSG_WARN([vdoformat not found in path $PATH])
VDO_FORMAT_CMD="/usr/bin/vdoformat"
VDO_CONFIGURE_WARN=y
])
])],
[AC_MSG_ERROR([--with-vdo parameter invalid])])
AC_DEFINE_UNQUOTED([VDO_FORMAT_CMD], ["$VDO_FORMAT_CMD"],
[The path to 'vdoformat', if available.])
#
# Do we need to use the API??
# Do we want to link lvm2 with a big library for VDO formatting ?
#
#AC_ARG_WITH(vdo-include,
# AS_HELP_STRING([--with-vdo-include=PATH],
# [vdo support: Path to utils headers: [/usr/include/vdo/utils]]),
# VDO_INCLUDE=$withval, VDO_INCLUDE="/usr/include/vdo/utils")
#AC_MSG_RESULT([$VDO_INCLUDE])
#
#AC_ARG_WITH(vdo-lib,
# AS_HELP_STRING([--with-vdo-lib=PATH],
# [vdo support: Path to utils lib: [/usr/lib]]),
# VDO_LIB=$withval, VDO_LIB="/usr/lib")
#AC_MSG_RESULT([$VDO_LIB])
################################################################################
dnl -- writecache inclusion type
AC_MSG_CHECKING([whether to include writecache])
AC_ARG_WITH(writecache,
AS_HELP_STRING([--with-writecache=TYPE],
[writecache support: internal/none [internal]]),
WRITECACHE=$withval, WRITECACHE="internal")
AC_MSG_RESULT([$WRITECACHE])
AS_CASE(["$WRITECACHE"],
[no|none], [],
[internal], [
AC_DEFINE([WRITECACHE_INTERNAL], 1, [Define to 1 to include built-in support for writecache.])],
[AC_MSG_ERROR([--with-writecache parameter invalid])])
################################################################################
dnl -- integrity inclusion type
AC_MSG_CHECKING([whether to include integrity])
AC_ARG_WITH(integrity,
AS_HELP_STRING([--with-integrity=TYPE],
[integrity support: internal/none [internal]]),
INTEGRITY=$withval, INTEGRITY="internal")
AC_MSG_RESULT([$INTEGRITY])
AS_CASE(["$INTEGRITY"],
[no|none], [],
[internal], [
AC_DEFINE([INTEGRITY_INTERNAL], 1, [Define to 1 to include built-in support for integrity.])],
[AC_MSG_ERROR([--with-integrity parameter invalid])])
################################################################################
dnl -- Disable readline
AC_ARG_ENABLE([readline],
AS_HELP_STRING([--disable-readline], [disable readline support]),
READLINE=$enableval, READLINE="maybe")
################################################################################
dnl -- Disable editline
AC_ARG_ENABLE([editline],
AS_HELP_STRING([--enable-editline], [enable editline support]),
EDITLINE=$enableval, EDITLINE="no")
################################################################################
dnl -- Disable realtime clock support
AC_MSG_CHECKING([whether to enable realtime support])
AC_ARG_ENABLE(realtime,
AS_HELP_STRING([--disable-realtime], [disable realtime clock support]),
REALTIME=$enableval, REALTIME="yes")
AC_MSG_RESULT([$REALTIME])
################################################################################
dnl -- disable OCF resource agents
AC_MSG_CHECKING([whether to enable OCF resource agents])
AC_ARG_ENABLE(ocf,
AS_HELP_STRING([--enable-ocf],
[enable Open Cluster Framework (OCF) compliant resource agents]),
OCF=$enableval, OCF="no")
AC_MSG_RESULT([$OCF])
AC_ARG_WITH(ocfdir,
AS_HELP_STRING([--with-ocfdir=DIR],
[install OCF files in [PREFIX/lib/ocf/resource.d/lvm2]]),
OCFDIR=$withval, OCFDIR='${prefix}/lib/ocf/resource.d/lvm2')
################################################################################
AC_MSG_CHECKING([for default run directory])
RUN_DIR="/run"
AS_IF([test ! -d "$RUN_DIR"], [RUN_DIR="/var/run"])
AC_MSG_RESULT([$RUN_DIR])
dnl -- Set up pidfile and run directory
AH_TEMPLATE(DEFAULT_PID_DIR)
AC_ARG_WITH(default-pid-dir,
AS_HELP_STRING([--with-default-pid-dir=PID_DIR],
[default directory to keep PID files in [autodetect]]),
DEFAULT_PID_DIR="$withval", DEFAULT_PID_DIR=$RUN_DIR)
AC_DEFINE_UNQUOTED(DEFAULT_PID_DIR, ["$DEFAULT_PID_DIR"],
[Default directory to keep PID files in.])
AH_TEMPLATE(DEFAULT_DM_RUN_DIR, [Name of default DM run directory.])
AC_ARG_WITH(default-dm-run-dir,
AS_HELP_STRING([--with-default-dm-run-dir=DM_RUN_DIR],
[default DM run directory [autodetect]]),
DEFAULT_DM_RUN_DIR="$withval", DEFAULT_DM_RUN_DIR=$RUN_DIR)
AC_DEFINE_UNQUOTED(DEFAULT_DM_RUN_DIR, ["$DEFAULT_DM_RUN_DIR"],
[Default DM run directory.])
AH_TEMPLATE(DEFAULT_RUN_DIR, [Name of default LVM run directory.])
AC_ARG_WITH(default-run-dir,
AS_HELP_STRING([--with-default-run-dir=RUN_DIR],
[default LVM run directory [autodetect_run_dir/lvm]]),
DEFAULT_RUN_DIR="$withval", DEFAULT_RUN_DIR="$RUN_DIR/lvm")
AC_DEFINE_UNQUOTED(DEFAULT_RUN_DIR, ["$DEFAULT_RUN_DIR"],
[Default LVM run directory.])
################################################################################
dnl -- Build cluster mirror log daemon
AC_MSG_CHECKING([whether to build cluster mirror log daemon])
AC_ARG_ENABLE(cmirrord,
AS_HELP_STRING([--enable-cmirrord],
[enable the cluster mirror log daemon]),
BUILD_CMIRRORD=$enableval, BUILD_CMIRRORD="no")
AC_MSG_RESULT([$BUILD_CMIRRORD])
################################################################################
dnl -- cmirrord pidfile
AS_IF([test "$BUILD_CMIRRORD" = "yes"], [
AC_ARG_WITH(cmirrord-pidfile,
AS_HELP_STRING([--with-cmirrord-pidfile=PATH],
[cmirrord pidfile [PID_DIR/cmirrord.pid]]),
CMIRRORD_PIDFILE=$withval,
CMIRRORD_PIDFILE="$DEFAULT_PID_DIR/cmirrord.pid")
AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE, ["$CMIRRORD_PIDFILE"],
[Path to cmirrord pidfile.])
])
################################################################################
dnl -- Look for corosync libraries if required.
AS_IF([test "$BUILD_CMIRRORD" = "yes" && test "$HAVE_CPG" != "yes"], [
PKG_CHECK_MODULES([CPG], [libcpg])
])
################################################################################
dnl -- Enable debugging
AC_MSG_CHECKING([whether to enable debugging])
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [enable debugging]),
DEBUG=$enableval, DEBUG="no")
AC_MSG_RESULT([$DEBUG])
dnl -- Normally turn off optimisation for debug builds
AS_IF([test "$DEBUG" = "yes"], [COPTIMISE_FLAG=""], [CSCOPE_CMD=""])
dnl -- Check if compiler supports -Wjump-misses-init
AC_TRY_CCFLAG([-Wjump-misses-init], [HAVE_WJUMP], [], [])
AC_SUBST(HAVE_WJUMP)
AC_TRY_CCFLAG([-Wclobbered], [HAVE_WCLOBBERED], [], [])
AC_SUBST(HAVE_WCLOBBERED)
AC_TRY_CCFLAG([-Wsync-nand], [HAVE_WSYNCNAND], [], [])
AC_SUBST(HAVE_WSYNCNAND)
################################################################################
dnl -- Override optimisation
AC_MSG_CHECKING([for C optimisation flag])
AC_ARG_WITH(optimisation,
AS_HELP_STRING([--with-optimisation=OPT],
[C optimisation flag [OPT=-O2]]),
COPTIMISE_FLAG=$withval)
AC_MSG_RESULT([$COPTIMISE_FLAG])
################################################################################
dnl -- Symbol versioning
AC_MSG_CHECKING([whether to use symbol versioning])
AC_ARG_WITH(symvers,
AS_HELP_STRING([--with-symvers=STYLE],
[use symbol versioning of the shared library [default=gnu]]), [
AS_CASE(["$withval"],
[gnu|no], [symvers=$withval],
[AC_MSG_ERROR(--with-symvers parameter invalid)])],
[symvers="gnu"])
AC_MSG_RESULT([$symvers])
AS_IF([test "$GCC" = "yes" && test "$symvers" = "gnu"], [
AC_DEFINE(GNU_SYMVER, 1,
[Define to use GNU versioning in the shared library.])
AS_CASE(["$host_os"],
[linux*], [
CLDFLAGS="-Wl,--version-script,.export.sym"
LDDEPS="$LDDEPS .export.sym"])
])
################################################################################
dnl -- Enable profiling
AC_MSG_CHECKING([whether to gather gcov profiling data])
AC_ARG_ENABLE(profiling,
AS_HELP_STRING([--enable-profiling],
[gather gcov profiling data]),
PROFILING=$enableval, PROFILING="no")
AC_MSG_RESULT([$PROFILING])
AS_IF([test "$PROFILING" = "yes"], [
COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -fprofile-update=atomic -ftest-coverage"
AC_PATH_TOOL(LCOV, lcov)
AC_PATH_TOOL(GENHTML, genhtml)
AS_IF([test -z "$LCOV" || test -z "$GENHTML"], [
AC_MSG_ERROR([lcov and genhtml are required for profiling])
])
AC_PATH_TOOL(GENPNG, genpng)
AS_IF([test -n "$GENPNG"], [
AC_MSG_CHECKING([whether $GENPNG has all required modules])
AS_IF(["$GENPNG" --help > /dev/null 2>&1], [
AC_MSG_RESULT([ok])
GENHTML="$GENHTML --frames"
], [
AC_MSG_RESULT([not supported])
AC_MSG_WARN([GD.pm perl module is not installed])
GENPNG=
])
])
])
################################################################################
dnl -- Set LVM2 testsuite data
TESTSUITE_DATA='${datarootdir}/lvm2-testsuite'
# double eval needed ${datarootdir} -> ${prefix}/share -> real path
AC_DEFINE_UNQUOTED(TESTSUITE_DATA, ["$(eval echo $(eval echo $TESTSUITE_DATA))"], [Path to testsuite data])
################################################################################
dnl -- Enable valgrind awareness of memory pools
AC_MSG_CHECKING([whether to enable valgrind awareness of pools])
AC_ARG_ENABLE(valgrind_pool,
AS_HELP_STRING([--enable-valgrind-pool],
[enable valgrind awareness of pools]),
VALGRIND_POOL=$enableval, VALGRIND_POOL="no")
AC_MSG_RESULT([$VALGRIND_POOL])
PKG_CHECK_MODULES(VALGRIND, valgrind, [HAVE_VALGRIND="yes"], [
AS_IF([test "$VALGRIND_POOL" = "yes"], [AC_MSG_ERROR(bailing out)])
])
AC_SUBST(VALGRIND_CFLAGS)
AS_IF([test "$HAVE_VALGRIND" = "yes"], [
AC_DEFINE([HAVE_VALGRIND], 1, [valgrind.h found])
])
AS_IF([test "$VALGRIND_POOL" = "yes"], [
AC_DEFINE([VALGRIND_POOL], 1, [Enable a valgrind aware build of pool])
])
################################################################################
dnl -- Disable devmapper
AC_MSG_CHECKING([whether to use device-mapper])
AC_ARG_ENABLE(devmapper,
AS_HELP_STRING([--disable-devmapper],
[disable LVM2 device-mapper interaction]),
DEVMAPPER=$enableval)
AC_MSG_RESULT([$DEVMAPPER])
AS_IF([test "$DEVMAPPER" = "yes"], [
AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.])
])
################################################################################
dnl -- Build lvmpolld
AC_MSG_CHECKING([whether to build lvmpolld])
AC_ARG_ENABLE(lvmpolld,
AS_HELP_STRING([--enable-lvmpolld],
[enable the LVM Polling Daemon]),
BUILD_LVMPOLLD=$enableval, BUILD_LVMPOLLD="no")
AC_MSG_RESULT([$BUILD_LVMPOLLD])
################################################################################
BUILD_LVMLOCKD=no
dnl -- Build lvmlockdsanlock
AC_MSG_CHECKING([whether to build lvmlockdsanlock])
AC_ARG_ENABLE(lvmlockd-sanlock,
AS_HELP_STRING([--enable-lvmlockd-sanlock],
[enable the LVM lock daemon using sanlock]),
BUILD_LOCKDSANLOCK=$enableval, BUILD_LOCKDSANLOCK="no")
AC_MSG_RESULT([$BUILD_LOCKDSANLOCK])
dnl -- Look for sanlock libraries
AS_IF([test "$BUILD_LOCKDSANLOCK" = "yes"], [
PKG_CHECK_MODULES(LIBSANLOCKCLIENT, libsanlock_client >= 3.7.0, [BUILD_LVMLOCKD="yes"])
AC_DEFINE([LOCKDSANLOCK_SUPPORT], 1, [Define to 1 to include code that uses lvmlockd sanlock option.])
])
################################################################################
dnl -- Build lvmlockddlm
AC_MSG_CHECKING([whether to build lvmlockddlm])
AC_ARG_ENABLE(lvmlockd-dlm,
AS_HELP_STRING([--enable-lvmlockd-dlm],
[enable the LVM lock daemon using dlm]),
BUILD_LOCKDDLM=$enableval, BUILD_LOCKDDLM="no")
AC_MSG_RESULT([$BUILD_LOCKDDLM])
dnl -- Look for dlm libraries
AS_IF([test "$BUILD_LOCKDDLM" = "yes"], [
PKG_CHECK_MODULES(LIBDLM, libdlm_lt, [BUILD_LVMLOCKD="yes"])
AC_DEFINE([LOCKDDLM_SUPPORT], 1, [Define to 1 to include code that uses lvmlockd dlm option.])
AS_CASE(["$LIBDLM_LIBS"],
[*lpthread*], [
dnl -- pkg-config for libdlm_lt may give us libdlm with libpthread
AC_MSG_RESULT([replacing pkg-config --libs libdlm_lt "$LIBDLM_LIBS" with... -ldlm_lt])
LIBDLM_LIBS="${LIBDLM_LIBS%%ldlm*}ldlm_lt"])
])
################################################################################
dnl -- Build lvmlockddlmcontrol
AC_MSG_CHECKING([whether to build lvmlockddlmcontrol])
AC_ARG_ENABLE(lvmlockd-dlmcontrol,
AS_HELP_STRING([--enable-lvmlockd-dlmcontrol],
[enable lvmlockd remote refresh using libdlmcontrol]),
BUILD_LOCKDDLM_CONTROL=$enableval, BUILD_LOCKDDLM_CONTROL="no")
AC_MSG_RESULT([$BUILD_LOCKDDLM_CONTROL])
dnl -- Look for libdlmcontrol libraries
AS_IF([test "$BUILD_LOCKDDLM_CONTROL" = "yes"], [
PKG_CHECK_MODULES(LIBDLMCONTROL, [libdlmcontrol >= 3.2], [BUILD_LVMLOCKD="yes"])
AC_DEFINE([LOCKDDLM_CONTROL_SUPPORT], 1, [Define to 1 to include code that uses lvmlockd dlm control option.])
])
################################################################################
dnl -- Build lvmlockdidm
AC_MSG_CHECKING([whether to build lvmlockdidm])
AC_ARG_ENABLE(lvmlockd-idm,
AS_HELP_STRING([--enable-lvmlockd-idm],
[enable the LVM lock daemon using idm]),
BUILD_LOCKDIDM=$enableval, BUILD_LOCKDIDM="no")
AC_MSG_RESULT([$BUILD_LOCKDIDM])
dnl -- Look for Seagate IDM libraries
AS_IF([test "$BUILD_LOCKDIDM" = "yes"], [
PKG_CHECK_EXISTS(blkid >= 2.24, [
PKG_CHECK_MODULES(LIBSEAGATEILM, [libseagate_ilm >= 0.1.0], [BUILD_LVMLOCKD="yes"])
AC_DEFINE([LOCKDIDM_SUPPORT], 1, [Define to 1 to include code that uses lvmlockd IDM option.])
AS_IF([test -z "$LIBSEAGATEILM_LIBS"], [LIBSEAGATEILM_LIBS="-lseagate_ilm"])
], $bailout)
])
################################################################################
dnl -- Build lvmlockd
AC_MSG_CHECKING([whether to build lvmlockd])
AC_MSG_RESULT([$BUILD_LVMLOCKD])
DEFAULT_USE_LVMLOCKD=0
AS_IF([test "$BUILD_LVMLOCKD" = "yes"], [
AS_IF([test "$LVMPOLLD" = "no"], [AC_MSG_ERROR([cannot build lvmlockd with --disable-lvmpolld.])])