-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
1713 lines (1519 loc) · 55.9 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
###############################################################################
## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved.
## Copyright (C) 2004-2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
################################################################################
AC_PREREQ(2.61)
################################################################################
dnl -- Process this file with autoconf to produce a configure script.
AC_INIT
AC_CONFIG_SRCDIR([lib/device/dev-cache.h])
AC_CONFIG_HEADERS([lib/misc/configure.h])
################################################################################
dnl -- Setup the directory where autoconf has auxilary files
AC_CONFIG_AUX_DIR(autoconf)
################################################################################
dnl -- Get system type
AC_CANONICAL_TARGET([])
case "$host_os" in
linux*)
CFLAGS="$CFLAGS"
COPTIMISE_FLAG="-O2"
CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
ELDFLAGS="-Wl,--export-dynamic"
# FIXME Generate list and use --dynamic-list=.dlopen.sym
CLDWHOLEARCHIVE="-Wl,-whole-archive"
CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
LDDEPS="$LDDEPS .export.sym"
LIB_SUFFIX=so
DEVMAPPER=yes
LVMETAD=no
ODIRECT=yes
DM_IOCTLS=yes
SELINUX=yes
CLUSTER=internal
FSADM=yes
BLKDEACTIVATE=yes
;;
darwin*)
CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
COPTIMISE_FLAG="-O2"
CLDFLAGS="$CLDFLAGS"
ELDFLAGS=
CLDWHOLEARCHIVE="-all_load"
CLDNOWHOLEARCHIVE=
LIB_SUFFIX=dylib
DEVMAPPER=yes
ODIRECT=no
DM_IOCTLS=no
SELINUX=no
CLUSTER=none
FSADM=no
BLKDEACTIVATE=no
;;
esac
################################################################################
dnl -- Checks for programs.
AC_PROG_SED
AC_PROG_AWK
AC_PROG_CC
dnl probably no longer needed in 2008, but...
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_MKDIR_P
AC_PROG_RANLIB
AC_PATH_PROG(CFLOW_CMD, cflow)
AC_PATH_PROG(CSCOPE_CMD, cscope)
################################################################################
dnl -- Check for header files.
AC_HEADER_DIRENT
AC_HEADER_MAJOR
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_CHECK_HEADERS([locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \
langinfo.h libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h \
sys/wait.h time.h], ,
[AC_MSG_ERROR(bailing out)])
case "$host_os" in
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)) ;;
esac
AC_CHECK_HEADERS([ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h \
stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h \
sys/types.h unistd.h], , [AC_MSG_ERROR(bailing out)])
AC_CHECK_HEADERS(termios.h sys/statvfs.h)
################################################################################
dnl -- Check for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_CHECK_MEMBERS([struct stat.st_rdev])
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIGNAL
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
AC_CHECK_MEMBERS([struct stat.st_rdev])
AC_STRUCT_TM
################################################################################
dnl -- Check for functions
AC_CHECK_FUNCS([ftruncate gethostname getpagesize \
gettimeofday memset mkdir mkfifo rmdir munmap nl_langinfo setenv setlocale \
strcasecmp strchr strcspn strspn strdup strncasecmp strerror strrchr \
strstr strtol strtoul uname], , [AC_MSG_ERROR(bailing out)])
AC_CHECK_FUNCS(siginterrupt)
AC_FUNC_ALLOCA
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_CHOWN
AC_FUNC_FORK
AC_FUNC_LSTAT
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_REALLOC
AC_FUNC_STAT
AC_FUNC_STRTOD
AC_FUNC_VPRINTF
################################################################################
dnl -- Enables statically-linked tools
AC_MSG_CHECKING(whether to use static linking)
AC_ARG_ENABLE(static_link,
AC_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 -- Prefix is /usr by default, the exec_prefix default is setup later
AC_PREFIX_DEFAULT(/usr)
################################################################################
dnl -- Setup the ownership of the files
AC_MSG_CHECKING(file owner)
AC_ARG_WITH(user,
AC_HELP_STRING([--with-user=USER],
[set the owner of installed files [[USER=]]]),
OWNER=$withval)
AC_MSG_RESULT($OWNER)
if test x$OWNER != x; then
INSTALL="$INSTALL -o $OWNER"
fi
################################################################################
dnl -- Setup the group ownership of the files
AC_MSG_CHECKING(group owner)
AC_ARG_WITH(group,
AC_HELP_STRING([--with-group=GROUP],
[set the group owner of installed files [[GROUP=]]]),
GROUP=$withval)
AC_MSG_RESULT($GROUP)
if test x$GROUP != x; then
INSTALL="$INSTALL -g $GROUP"
fi
################################################################################
dnl -- Setup device node ownership
AC_MSG_CHECKING(device node uid)
AC_ARG_WITH(device-uid,
AC_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)
################################################################################
dnl -- Setup device group ownership
AC_MSG_CHECKING(device node gid)
AC_ARG_WITH(device-gid,
AC_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)
################################################################################
dnl -- Setup device mode
AC_MSG_CHECKING(device node mode)
AC_ARG_WITH(device-mode,
AC_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_MSG_CHECKING(when to create device nodes)
AC_ARG_WITH(device-nodes-on,
AC_HELP_STRING([--with-device-nodes-on=ON],
[create nodes on resume or create [[ON=resume]]]),
ADD_NODE=$withval, ADD_NODE=resume)
case "$ADD_NODE" in
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]);;
esac
AC_MSG_RESULT(on $ADD_NODE)
AC_DEFINE_UNQUOTED([DEFAULT_DM_ADD_NODE], $add_on, [Define default node creation behavior with dmsetup create])
AC_MSG_CHECKING(default name mangling)
AC_ARG_WITH(default-name-mangling,
AC_HELP_STRING([--with-default-name-mangling=MANGLING],
[default name mangling: auto/none/hex [[MANGLING=auto]]]),
MANGLING=$withval, MANGLING=auto)
case "$MANGLING" in
auto) mangling=DM_STRING_MANGLING_AUTO;;
disabled) mangling=DM_STRING_MANGLING_NONE;;
hex) mangling=DM_STRING_MANGLING_HEX;;
*) AC_MSG_ERROR([--with-default-name-mangling parameter invalid]);;
esac
AC_MSG_RESULT($MANGLING)
AC_DEFINE_UNQUOTED([DEFAULT_DM_NAME_MANGLING], $mangling, [Define default name mangling behaviour])
################################################################################
dnl -- LVM1 tool fallback option
AC_MSG_CHECKING(whether to enable lvm1 fallback)
AC_ARG_ENABLE(lvm1_fallback,
AC_HELP_STRING([--enable-lvm1_fallback],
[use this to fall back and use LVM1 binaries if
device-mapper is missing from the kernel]),
LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no)
AC_MSG_RESULT($LVM1_FALLBACK)
if test x$LVM1_FALLBACK = xyes; then
AC_DEFINE([LVM1_FALLBACK], 1, [Define to 1 if 'lvm' should fall back to using LVM1 binaries if device-mapper is missing from the kernel])
fi
################################################################################
dnl -- format1 inclusion type
AC_MSG_CHECKING(whether to include support for lvm1 metadata)
AC_ARG_WITH(lvm1,
AC_HELP_STRING([--with-lvm1=TYPE],
[LVM1 metadata support: internal/shared/none
[[TYPE=internal]]]),
LVM1=$withval, LVM1=internal)
AC_MSG_RESULT($LVM1)
if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]];
then AC_MSG_ERROR(
--with-lvm1 parameter invalid
)
fi;
if test x$LVM1 = xinternal; then
AC_DEFINE([LVM1_INTERNAL], 1, [Define to 1 to include built-in support for LVM1 metadata.])
fi
################################################################################
dnl -- format_pool inclusion type
AC_MSG_CHECKING(whether to include support for GFS pool metadata)
AC_ARG_WITH(pool,
AC_HELP_STRING([--with-pool=TYPE],
[GFS pool read-only support: internal/shared/none
[[TYPE=internal]]]),
POOL=$withval, POOL=internal)
AC_MSG_RESULT($POOL)
if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]];
then AC_MSG_ERROR(
--with-pool parameter invalid
)
fi;
if test x$POOL = xinternal; then
AC_DEFINE([POOL_INTERNAL], 1, [Define to 1 to include built-in support for GFS pool metadata.])
fi
################################################################################
dnl -- cluster_locking inclusion type
AC_MSG_CHECKING(whether to include support for cluster locking)
AC_ARG_WITH(cluster,
AC_HELP_STRING([--with-cluster=TYPE],
[cluster LVM locking support: internal/shared/none
[[TYPE=internal]]]),
CLUSTER=$withval)
AC_MSG_RESULT($CLUSTER)
if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]];
then AC_MSG_ERROR(
--with-cluster parameter invalid
)
fi;
if test x$CLUSTER = xinternal; then
AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1, [Define to 1 to include built-in support for clustered LVM locking.])
fi
################################################################################
dnl -- snapshots inclusion type
AC_MSG_CHECKING(whether to include snapshots)
AC_ARG_WITH(snapshots,
AC_HELP_STRING([--with-snapshots=TYPE],
[snapshot support: internal/shared/none
[[TYPE=internal]]]),
SNAPSHOTS=$withval, SNAPSHOTS=internal)
AC_MSG_RESULT($SNAPSHOTS)
if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]];
then AC_MSG_ERROR(
--with-snapshots parameter invalid
)
fi;
if test x$SNAPSHOTS = xinternal; then
AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.])
fi
################################################################################
dnl -- mirrors inclusion type
AC_MSG_CHECKING(whether to include mirrors)
AC_ARG_WITH(mirrors,
AC_HELP_STRING([--with-mirrors=TYPE],
[mirror support: internal/shared/none
[[TYPE=internal]]]),
MIRRORS=$withval, MIRRORS=internal)
AC_MSG_RESULT($MIRRORS)
if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]];
then AC_MSG_ERROR(
--with-mirrors parameter invalid
)
fi;
if test x$MIRRORS = xinternal; then
AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.])
fi
################################################################################
dnl -- raid inclusion type
AC_MSG_CHECKING(whether to include raid)
AC_ARG_WITH(raid,
AC_HELP_STRING([--with-raid=TYPE],
[mirror support: internal/shared/none
[[TYPE=internal]]]),
RAID=$withval, RAID=internal)
AC_MSG_RESULT($RAID)
if [[ "x$RAID" != xnone -a "x$RAID" != xinternal -a "x$RAID" != xshared ]];
then AC_MSG_ERROR(
--with-raid parameter invalid
)
fi;
if test x$RAID = xinternal; then
AC_DEFINE([RAID_INTERNAL], 1, [Define to 1 to include built-in support for raid.])
fi
################################################################################
dnl -- asynchronous volume replicator inclusion type
AC_MSG_CHECKING(whether to include replicators)
AC_ARG_WITH(replicators,
AC_HELP_STRING([--with-replicators=TYPE],
[replicator support: internal/shared/none
[[TYPE=none]]]),
REPLICATORS=$withval, REPLICATORS=none)
AC_MSG_RESULT($REPLICATORS)
case "$REPLICATORS" in
none|shared) ;;
internal) AC_DEFINE([REPLICATOR_INTERNAL], 1,
[Define to 1 to include built-in support for replicators.]) ;;
*) AC_MSG_ERROR([--with-replicators parameter invalid ($REPLICATORS)]) ;;
esac
################################################################################
dnl -- thin provisioning
AC_MSG_CHECKING(whether to include thin provisioning)
AC_ARG_WITH(thin,
AC_HELP_STRING([--with-thin=TYPE],
[thin provisioning support: internal/shared/none
[[TYPE=none]]]),
THIN=$withval, THIN=none)
AC_MSG_RESULT($THIN)
case "$THIN" in
none|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)]) ;;
esac
case "$THIN" in
internal|shared)
AC_ARG_WITH(thin-check,
AC_HELP_STRING([--with-thin-check=PATH],
[thin_check tool: [[autodetect]]]),
THIN_CHECK_CMD=$withval, THIN_CHECK_CMD="autodetect")
# Empty means a config way to ignore thin checking
if test "$THIN_CHECK_CMD" = "autodetect"; then
AC_PATH_PROG(THIN_CHECK_CMD, thin_check)
test -z "$THIN_CHECK_CMD" && AC_MSG_ERROR(thin_check not found in path $PATH)
fi
;;
esac
AC_DEFINE_UNQUOTED([THIN_CHECK_CMD], ["$THIN_CHECK_CMD"],
[The path to 'thin_check', if available.])
################################################################################
dnl -- Disable readline
AC_MSG_CHECKING(whether to enable readline)
AC_ARG_ENABLE([readline],
AC_HELP_STRING([--disable-readline], [disable readline support]),
READLINE=$enableval, READLINE=maybe)
AC_MSG_RESULT($READLINE)
################################################################################
dnl -- Disable realtime clock support
AC_MSG_CHECKING(whether to enable realtime support)
AC_ARG_ENABLE(realtime,
AC_HELP_STRING([--enable-realtime], [enable realtime clock support]),
REALTIME=$enableval)
AC_MSG_RESULT($REALTIME)
################################################################################
dnl -- disable OCF resource agents
AC_MSG_CHECKING(whether to enable OCF resource agents)
AC_ARG_ENABLE(ocf,
AC_HELP_STRING([--enable-ocf],
[enable Open Cluster Framework (OCF) compliant resource agents]),
OCF=$enableval, OCF=no)
AC_MSG_RESULT($OCF)
AC_ARG_WITH(ocfdir,
AC_HELP_STRING([--with-ocfdir=DIR],
[install OCF files in DIR [[PREFIX/lib/ocf/resource.d/lvm2]]]),
OCFDIR=$withval, OCFDIR='${prefix}/lib/ocf/resource.d/lvm2')
################################################################################
dnl -- Init pkg-config with dummy invokation:
dnl -- this is required because PKG_CHECK_MODULES macro is expanded
dnl -- to initialize the pkg-config environment only at the first invokation,
dnl -- that would be conditional in this configure.in.
pkg_config_init() {
PKG_CHECK_MODULES(PKGCONFIGINIT, pkgconfiginit, [],
[AC_MSG_RESULT([pkg-config initialized])])
PKGCONFIG_INIT=1
}
################################################################################
dnl -- Set up pidfile and run directory
AH_TEMPLATE(DEFAULT_PID_DIR)
AC_ARG_WITH(default-pid-dir,
AC_HELP_STRING([--with-default-pid-dir=PID_DIR],
[Default directory to keep PID files in. [[/var/run]]]),
DEFAULT_PID_DIR="$withval", DEFAULT_PID_DIR="/var/run")
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,
AC_HELP_STRING([--with-default-dm-run-dir=DM_RUN_DIR],
[ Default DM run directory. [[/var/run]]]),
DEFAULT_DM_RUN_DIR="$withval", DEFAULT_DM_RUN_DIR="/var/run")
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,
AC_HELP_STRING([--with-default-run-dir=RUN_DIR],
[Default LVM run directory. [[/var/run/lvm]]]),
DEFAULT_RUN_DIR="$withval", DEFAULT_RUN_DIR="/var/run/lvm")
AC_DEFINE_UNQUOTED(DEFAULT_RUN_DIR, ["$DEFAULT_RUN_DIR"],
[Default LVM run directory.])
################################################################################
dnl -- Build cluster LVM daemon
AC_MSG_CHECKING(whether to build cluster LVM daemon)
AC_ARG_WITH(clvmd,
[ --with-clvmd=TYPE build cluster LVM Daemon
The following cluster manager combinations are valid:
* cman (RHEL5 or equivalent)
* cman,corosync,openais (or selection of them)
* singlenode (localhost only)
* all (autodetect)
* none (disable build)
[[TYPE=none]]],
CLVMD=$withval, CLVMD=none)
if test x$CLVMD = xyes; then
CLVMD=all
fi
AC_MSG_RESULT($CLVMD)
dnl -- If clvmd enabled without cluster locking, automagically include it
if test x$CLVMD != xnone && test x$CLUSTER = xnone; then
CLUSTER=internal
fi
dnl -- init pkgconfig if required
if test x$CLVMD != xnone && test x$PKGCONFIG_INIT != x1; then
pkg_config_init
fi
dnl -- Express clvmd init script Required-Start / Required-Stop
CLVMD_CMANAGERS=""
dnl -- On RHEL4/RHEL5, qdiskd is started from a separate init script.
dnl -- Enable if we are build for cman.
CLVMD_NEEDS_QDISKD=no
dnl -- define build types
if [[ `expr x"$CLVMD" : '.*gulm.*'` != 0 ]]; then
AC_MSG_ERROR([Since version 2.02.87 GULM locking is no longer supported.]);
fi
if [[ `expr x"$CLVMD" : '.*cman.*'` != 0 ]]; then
BUILDCMAN=yes
CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman"
CLVMD_NEEDS_QDISKD=yes
fi
if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
BUILDCOROSYNC=yes
CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync"
fi
if [[ `expr x"$CLVMD" : '.*openais.*'` != 0 ]]; then
BUILDOPENAIS=yes
CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais"
fi
if test x$CLVMD_NEEDS_QDISKD != xno; then
CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd"
fi
dnl -- define a soft bailout if we are autodetecting
soft_bailout() {
NOTFOUND=1
}
hard_bailout() {
AC_MSG_ERROR([bailing out])
}
dnl -- if clvmd=all then set soft_bailout (we don't want to error)
dnl -- and set all builds to yes. We need to do this here
dnl -- to skip the openais|corosync sanity check above.
if test x$CLVMD = xall; then
bailout=soft_bailout
BUILDCMAN=yes
BUILDCOROSYNC=yes
BUILDOPENAIS=yes
else
bailout=hard_bailout
fi
dnl -- helper macro to check libs without adding them to LIBS
check_lib_no_libs() {
lib_no_libs_arg1=$1
shift
lib_no_libs_arg2=$1
shift
lib_no_libs_args=$@
AC_CHECK_LIB([$lib_no_libs_arg1],
[$lib_no_libs_arg2],,
[$bailout],
[$lib_no_libs_args])
LIBS=$ac_check_lib_save_LIBS
}
dnl -- Look for cman libraries if required.
if test x$BUILDCMAN = xyes; then
PKG_CHECK_MODULES(CMAN, libcman, [HAVE_CMAN=yes],
[NOTFOUND=0
AC_CHECK_HEADERS(libcman.h,,$bailout)
check_lib_no_libs cman cman_init
if test $NOTFOUND = 0; then
AC_MSG_RESULT([no pkg for libcman, using -lcman])
CMAN_LIBS="-lcman"
HAVE_CMAN=yes
fi])
CHECKCONFDB=yes
CHECKDLM=yes
fi
dnl -- Look for corosync that's required also for openais build
dnl -- only enough recent version of corosync ship pkg-config files.
dnl -- We can safely rely on that to detect the correct bits.
if test x$BUILDCOROSYNC = xyes || \
test x$BUILDOPENAIS = xyes; then
PKG_CHECK_MODULES(COROSYNC, corosync, [HAVE_COROSYNC=yes], $bailout)
CHECKCONFDB=yes
CHECKCMAP=yes
fi
dnl -- Look for corosync libraries if required.
if test x$BUILDCOROSYNC = xyes; then
PKG_CHECK_MODULES(QUORUM, libquorum, [HAVE_QUORUM=yes], $bailout)
CHECKCPG=yes
CHECKDLM=yes
fi
dnl -- Look for openais libraries if required.
if test x$BUILDOPENAIS = xyes; then
PKG_CHECK_MODULES(SALCK, libSaLck, [HAVE_SALCK=yes], $bailout)
CHECKCPG=yes
fi
dnl -- Below are checks for libraries common to more than one build.
dnl -- Check confdb library.
dnl -- mandatory for corosync < 2.0 build.
dnl -- optional for openais/cman build.
if test x$CHECKCONFDB = xyes; then
PKG_CHECK_MODULES(CONFDB, libconfdb,
[HAVE_CONFDB=yes],
[HAVE_CONFDB=no])
AC_CHECK_HEADERS(corosync/confdb.h,
[HAVE_CONFDB_H=yes],
[HAVE_CONFDB_H=no])
if test x$HAVE_CONFDB != xyes && \
test x$HAVE_CONFDB_H = xyes; then
check_lib_no_libs confdb confdb_initialize
AC_MSG_RESULT([no pkg for confdb, using -lconfdb])
CONFDB_LIBS="-lconfdb"
HAVE_CONFDB=yes
fi
fi
dnl -- Check cmap library
dnl -- mandatory for corosync >= 2.0 build.
if test x$CHECKCMAP = xyes; then
PKG_CHECK_MODULES(CMAP, libcmap,
[HAVE_CMAP=yes],
[HAVE_CMAP=no])
AC_CHECK_HEADERS(corosync/cmap.h,
[HAVE_CMAP_H=yes],
[HAVE_CMAP_H=no])
if test x$HAVE_CMAP != xyes && \
test x$HAVE_CMAP_H = xyes; then
check_lib_no_libs cmap cmap_initialize
AC_MSG_RESULT([no pkg for cmap, using -lcmap])
CMAP_LIBS="-lcmap"
HAVE_CMAP=yes
fi
fi
if test x$BUILDCOROSYNC = xyes; then
if test x$HAVE_CMAP != xyes && \
test x$HAVE_CONFDB != xyes && \
test x$CLVMD != xall; then
AC_MSG_ERROR([bailing out... cmap (corosync >= 2.0) or confdb (corosync < 2.0) library is required])
fi
fi
dnl -- Check cpg library.
if test x$CHECKCPG = xyes; then
PKG_CHECK_MODULES(CPG, libcpg, [HAVE_CPG=yes], $bailout)
fi
dnl -- Check dlm library.
if test x$CHECKDLM = xyes; then
PKG_CHECK_MODULES(DLM, libdlm, [HAVE_DLM=yes],
[NOTFOUND=0
AC_CHECK_HEADERS(libdlm.h,,$bailout)
check_lib_no_libs dlm dlm_lock -lpthread
if test $NOTFOUND = 0; then
AC_MSG_RESULT([no pkg for libdlm, using -ldlm])
DLM_LIBS="-ldlm -lpthread"
HAVE_DLM=yes
fi])
fi
dnl -- If we are autodetecting, we need to re-create
dnl -- the depedencies checks and set a proper CLVMD,
dnl -- together with init script Required-Start/Stop entries.
if test x$CLVMD = xall; then
CLVMD=none
CLVMD_CMANAGERS=""
CLVMD_NEEDS_QDISKD=no
if test x$HAVE_CMAN = xyes && \
test x$HAVE_DLM = xyes; then
AC_MSG_RESULT([Enabling clvmd cman cluster manager])
CLVMD="$CLVMD,cman"
CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman"
CLVMD_NEEDS_QDISKD=yes
fi
if test x$HAVE_COROSYNC = xyes && \
test x$HAVE_QUORUM = xyes && \
test x$HAVE_CPG = xyes && \
test x$HAVE_DLM = xyes; then
if test x$HAVE_CONFDB = xyes || test x$HAVE_CMAP = xyes; then
AC_MSG_RESULT([Enabling clvmd corosync cluster manager])
CLVMD="$CLVMD,corosync"
CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync"
fi
fi
if test x$HAVE_COROSYNC = xyes && \
test x$HAVE_CPG = xyes && \
test x$HAVE_SALCK = xyes; then
AC_MSG_RESULT([Enabling clvmd openais cluster manager])
CLVMD="$CLVMD,openais"
CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais"
fi
if test x$CLVMD_NEEDS_QDISKD != xno; then
CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd"
fi
if test x$CLVMD = xnone; then
AC_MSG_RESULT([Disabling clvmd build. No cluster manager detected.])
fi
fi
dnl -- Fixup CLVMD_CMANAGERS with new corosync
dnl -- clvmd built with corosync >= 2.0 needs dlm (either init or systemd service)
dnl -- to be started.
if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
if test x$HAVE_CMAP = xyes; then
CLVMD_CMANAGERS="$CLVMD_CMANAGERS dlm"
fi
fi
################################################################################
dnl -- clvmd pidfile
if test "x$CLVMD" != xnone; then
AC_ARG_WITH(clvmd-pidfile,
AC_HELP_STRING([--with-clvmd-pidfile=PATH],
[clvmd pidfile [[PID_DIR/clvmd.pid]]]),
CLVMD_PIDFILE=$withval,
CLVMD_PIDFILE="$DEFAULT_PID_DIR/clvmd.pid")
AC_DEFINE_UNQUOTED(CLVMD_PIDFILE, ["$CLVMD_PIDFILE"],
[Path to clvmd pidfile.])
fi
################################################################################
dnl -- Disable sd_notify
AC_MSG_CHECKING(whether to enable sd_notify)
AC_ARG_ENABLE([sd_notify],
AC_HELP_STRING([--disable-sd-notify],
[disable sd_notify support in clvmd]),
[SD_NOTIFY=$enableval], [SD_NOTIFY=auto])
AC_MSG_RESULT($SD_NOTIFY)
if test x$SD_NOTIFY != xno ; then
if test x$PKGCONFIG_INIT != x1; then
pkg_config_init
fi
PKG_CHECK_MODULES([LIBSYSTEMD_DAEMON], [libsystemd-daemon],
[SD_NOTIFY=yes], [
if test x$SD_NOTIFY = yes ; then
AC_MSG_ERROR([bailing out])
else
SD_NOTIFY=no
fi
])
fi
AC_SUBST([SD_NOTIFY])
if test x$SD_NOTIFY = xyes; then
AC_DEFINE([ENABLE_SD_NOTIFY], [1],
[Define to 1 to include sd_notify() support in clvmd])
fi
################################################################################
dnl -- Build cluster mirror log daemon
AC_MSG_CHECKING(whether to build cluster mirror log daemon)
AC_ARG_ENABLE(cmirrord,
AC_HELP_STRING([--enable-cmirrord],
[enable the cluster mirror log daemon]),
CMIRRORD=$enableval, CMIRRORD=no)
AC_MSG_RESULT($CMIRRORD)
BUILD_CMIRRORD=$CMIRRORD
################################################################################
dnl -- cmirrord pidfile
if test "x$BUILD_CMIRRORD" = xyes; then
AC_ARG_WITH(cmirrord-pidfile,
AC_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.])
fi
################################################################################
dnl -- Look for corosync libraries if required.
if [[ "x$BUILD_CMIRRORD" = xyes ]]; then
dnl -- init pkgconfig if required
if test x$PKGCONFIG_INIT != x1; then
pkg_config_init
fi
AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 1, [Define to 1 to include libSaCkpt.])
PKG_CHECK_MODULES(SACKPT, libSaCkpt, [HAVE_SACKPT=yes],
[AC_MSG_RESULT([no libSaCkpt, compiling without it])
AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 0, [Define to 0 to exclude libSaCkpt.])])
if test x$HAVE_CPG != xyes; then
PKG_CHECK_MODULES(CPG, libcpg)
fi
fi
################################################################################
dnl -- Enable debugging
AC_MSG_CHECKING(whether to enable debugging)
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable debugging]),
DEBUG=$enableval, DEBUG=no)
AC_MSG_RESULT($DEBUG)
dnl -- Normally turn off optimisation for debug builds
if test x$DEBUG = xyes; then
COPTIMISE_FLAG=
else
CSCOPE_CMD=
fi
################################################################################
dnl -- Override optimisation
AC_MSG_CHECKING(for C optimisation flag)
AC_ARG_WITH(optimisation,
AC_HELP_STRING([--with-optimisation=OPT],
[C optimisation flag [[OPT=-O2]]]),
COPTIMISE_FLAG=$withval)
AC_MSG_RESULT($COPTIMISE_FLAG)
################################################################################
dnl -- Enable profiling
AC_MSG_CHECKING(whether to gather gcov profiling data)
AC_ARG_ENABLE(profiling,
AC_HELP_STRING(--enable-profiling, [gather gcov profiling data]),
PROFILING=$enableval, PROFILING=no)
AC_MSG_RESULT($PROFILING)
if test "x$PROFILING" = xyes; then
COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage"
AC_PATH_PROG(LCOV, lcov)
AC_PATH_PROG(GENHTML, genhtml)
if test -z "$LCOV" -o -z "$GENHTML"; then
AC_MSG_ERROR([lcov and genhtml are required for profiling])
fi
AC_PATH_PROG(GENPNG, genpng)
if test -n "$GENPNG"; then
AC_MSG_CHECKING([whether $GENPNG has all required modules])
if $GENPNG --help > /dev/null 2>&1 ; then
AC_MSG_RESULT(ok)
GENHTML="$GENHTML --frames"
else
AC_MSG_RESULT(not supported)
AC_MSG_WARN([GD.pm perl module is not installed])
GENPNG=
fi
fi
fi
################################################################################
dnl -- Enable testing
AC_MSG_CHECKING(whether to enable unit testing)
AC_ARG_ENABLE(testing,
AC_HELP_STRING(--enable-testing, [enable testing targets in the makefile]),
TESTING=$enableval, TESTING=no)
AC_MSG_RESULT($TESTING)
if test "$TESTING" = yes; then
if test x$PKGCONFIG_INIT != x1; then
pkg_config_init
fi
PKG_CHECK_MODULES(CUNIT, cunit >= 2.0)
fi
################################################################################
dnl -- Enable valgrind awareness of memory pools
AC_MSG_CHECKING(whether to enable valgrind awareness of pools)
AC_ARG_ENABLE(valgrind_pool,
AC_HELP_STRING(--enable-valgrind-pool, [enable valgrind awareness of pools]),
VALGRIND_POOL=$enableval, VALGRIND_POOL=no)
AC_MSG_RESULT($VALGRIND_POOL)
if test "$VALGRIND_POOL" = yes; then
PKG_CHECK_MODULES(VALGRIND, valgrind, [], [AC_MSG_ERROR(bailing out)])
AC_DEFINE([VALGRIND_POOL], 1, [Enable a valgrind aware build of pool])
AC_SUBST(VALGRIND_POOL)
AC_SUBST(VALGRIND_CFLAGS)
fi
################################################################################
dnl -- Disable devmapper
AC_MSG_CHECKING(whether to use device-mapper)
AC_ARG_ENABLE(devmapper,
AC_HELP_STRING([--disable-devmapper],
[disable LVM2 device-mapper interaction]),
DEVMAPPER=$enableval)
AC_MSG_RESULT($DEVMAPPER)
if test x$DEVMAPPER = xyes; then
AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.])
fi
################################################################################
dnl -- Build lvmetad
AC_MSG_CHECKING(whether to build LVMetaD)
AC_ARG_ENABLE(lvmetad,
AC_HELP_STRING([--enable-lvmetad],
[enable the LVM Metadata Daemon]),
LVMETAD=$enableval)
AC_MSG_RESULT($LVMETAD)
BUILD_LVMETAD=$LVMETAD
if test x$BUILD_LVMETAD = xyes; then
AC_DEFINE([LVMETAD_SUPPORT], 1, [Define to 1 to include code that uses lvmetad.])
AC_ARG_WITH(lvmetad-pidfile,
AC_HELP_STRING([--with-lvmetad-pidfile=PATH],
[lvmetad pidfile [[PID_DIR/lvmetad.pid]]]),
LVMETAD_PIDFILE=$withval,
LVMETAD_PIDFILE="$DEFAULT_PID_DIR/lvmetad.pid")
AC_DEFINE_UNQUOTED(LVMETAD_PIDFILE, ["$LVMETAD_PIDFILE"],
[Path to lvmetad pidfile.])
fi
################################################################################
dnl -- Enable udev synchronisation
AC_MSG_CHECKING(whether to enable synchronisation with udev processing)
AC_ARG_ENABLE(udev_sync,
AC_HELP_STRING([--enable-udev_sync],
[enable synchronisation with udev processing]),
UDEV_SYNC=$enableval, UDEV_SYNC=no)
AC_MSG_RESULT($UDEV_SYNC)
if test x$UDEV_SYNC = xyes; then
dnl -- init pkgconfig if required
if test x$PKGCONFIG_INIT != x1; then
pkg_config_init
fi
PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
fi
dnl -- Enable udev rules
AC_MSG_CHECKING(whether to enable installation of udev rules required for synchronisation)
AC_ARG_ENABLE(udev_rules,
AC_HELP_STRING([--enable-udev_rules],
[install rule files needed for udev synchronisation]),
UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC)
AC_MSG_RESULT($UDEV_RULES)
AC_MSG_CHECKING(whether to enable executable path detection in udev rules)
AC_ARG_ENABLE(udev_rule_exec_detection,
AC_HELP_STRING([--enable-udev-rule-exec-detection],
[enable executable path detection in udev rules]),
UDEV_RULE_EXEC_DETECTION=$enableval, UDEV_RULE_EXEC_DETECTION=no)
AC_MSG_RESULT($UDEV_RULE_EXEC_DETECTION)
dnl -- Check support for built-in blkid against target udev version
AC_MSG_CHECKING(whether udev supports built-in blkid)
test x$PKGCONFIG_INIT != x1 && pkg_config_init
if $($PKG_CONFIG --atleast-version=176 libudev); then
UDEV_HAS_BUILTIN_BLKID=yes
else
UDEV_HAS_BUILTIN_BLKID=no
fi
AC_MSG_RESULT($UDEV_HAS_BUILTIN_BLKID)
################################################################################
dnl -- Compatibility mode
AC_ARG_ENABLE(compat,
AC_HELP_STRING([--enable-compat],
[enable support for old device-mapper versions]),
DM_COMPAT=$enableval, DM_COMPAT=no)
if test x$DM_COMPAT = xyes; then
AC_MSG_ERROR(
[--enable-compat is not currently supported.
Since device-mapper version 1.02.66, only one version (4) of the device-mapper
ioctl protocol is supported.]