]> sourceware.org Git - lvm2.git/blame - configure.in
Refer to details of snapshot of raid problem.
[lvm2.git] / configure.in
CommitLineData
d0191583 1###############################################################################
ad6254c5 2## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved.
b6d7a484 3## Copyright (C) 2004-2012 Red Hat, Inc. All rights reserved.
795ca3e5 4##
ad6254c5
AK
5## This copyrighted material is made available to anyone wishing to use,
6## modify, copy, or redistribute it subject to the terms and conditions
7## of the GNU General Public License v.2.
795ca3e5 8##
ad6254c5
AK
9## You should have received a copy of the GNU General Public License
10## along with this program; if not, write to the Free Software Foundation,
11## Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
795ca3e5
AK
12################################################################################
13
e24fb506 14AC_PREREQ(2.61)
80992638 15################################################################################
8ce0cbda 16dnl -- Process this file with autoconf to produce a configure script.
7a197a62
AK
17AC_INIT
18AC_CONFIG_SRCDIR([lib/device/dev-cache.h])
d0191583 19AC_CONFIG_HEADERS([lib/misc/configure.h])
72b2cb61 20
80992638 21################################################################################
ad6254c5 22dnl -- Setup the directory where autoconf has auxilary files
d3a356b4 23AC_CONFIG_AUX_DIR(autoconf)
795ca3e5 24
80992638 25################################################################################
8ce0cbda 26dnl -- Get system type
7a197a62 27AC_CANONICAL_TARGET([])
b896caa1
AK
28
29case "$host_os" in
30 linux*)
7f54ef36 31 CFLAGS="$CFLAGS"
8ce0cbda 32 COPTIMISE_FLAG="-O2"
80992638 33 CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
bf09a320
AK
34 ELDFLAGS="-Wl,--export-dynamic"
35 # FIXME Generate list and use --dynamic-list=.dlopen.sym
8106cdd5
AK
36 CLDWHOLEARCHIVE="-Wl,-whole-archive"
37 CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
80992638 38 LDDEPS="$LDDEPS .export.sym"
d0191583 39 LIB_SUFFIX=so
8106cdd5 40 DEVMAPPER=yes
615534d3 41 LVMETAD=no
1a9ea74d 42 ODIRECT=yes
d0191583 43 DM_IOCTLS=yes
80992638 44 SELINUX=yes
d3c8211f 45 CLUSTER=internal
f6fc418d 46 FSADM=yes
d0191583 47 ;;
8106cdd5 48 darwin*)
80992638 49 CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
8ce0cbda 50 COPTIMISE_FLAG="-O2"
80992638 51 CLDFLAGS="$CLDFLAGS"
bf09a320 52 ELDFLAGS=
8106cdd5
AK
53 CLDWHOLEARCHIVE="-all_load"
54 CLDNOWHOLEARCHIVE=
d0191583 55 LIB_SUFFIX=dylib
a653923f 56 DEVMAPPER=yes
1a9ea74d 57 ODIRECT=no
d0191583 58 DM_IOCTLS=no
80992638 59 SELINUX=no
d3c8211f 60 CLUSTER=none
d0191583
JM
61 FSADM=no
62 ;;
b896caa1
AK
63esac
64
3d962ed6
AK
65VERITYSETUP=no
66
80992638 67################################################################################
8ce0cbda 68dnl -- Checks for programs.
162aefe8 69AC_PROG_SED
8ce0cbda
AK
70AC_PROG_AWK
71AC_PROG_CC
d0191583
JM
72
73dnl probably no longer needed in 2008, but...
74AC_PROG_GCC_TRADITIONAL
8ce0cbda
AK
75AC_PROG_INSTALL
76AC_PROG_LN_S
77AC_PROG_MAKE_SET
162aefe8 78AC_PROG_MKDIR_P
5556819a 79AC_PROG_RANLIB
8a2fc586
AK
80AC_PATH_PROG(CFLOW_CMD, cflow)
81AC_PATH_PROG(CSCOPE_CMD, cscope)
8ce0cbda
AK
82
83################################################################################
d0191583 84dnl -- Check for header files.
80992638 85AC_HEADER_DIRENT
d911ec67 86AC_HEADER_MAJOR
80992638 87AC_HEADER_STDC
ad6254c5
AK
88AC_HEADER_SYS_WAIT
89AC_HEADER_TIME
90
d0191583 91AC_CHECK_HEADERS([locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \
d911ec67
AK
92 langinfo.h libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h \
93 sys/wait.h time.h], ,
d0191583 94 [AC_MSG_ERROR(bailing out)])
ad6254c5
AK
95
96case "$host_os" in
97 linux*)
98 AC_CHECK_HEADERS(asm/byteorder.h linux/fs.h malloc.h,,AC_MSG_ERROR(bailing out)) ;;
99 darwin*)
100 AC_CHECK_HEADERS(machine/endian.h sys/disk.h,,AC_MSG_ERROR(bailing out)) ;;
101esac
80992638 102
d0191583
JM
103AC_CHECK_HEADERS([ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h \
104 stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h \
105 sys/types.h unistd.h], , [AC_MSG_ERROR(bailing out)])
106AC_CHECK_HEADERS(termios.h sys/statvfs.h)
107
80992638 108################################################################################
d0191583 109dnl -- Check for typedefs, structures, and compiler characteristics.
80992638
AK
110AC_C_CONST
111AC_C_INLINE
d0191583 112AC_CHECK_MEMBERS([struct stat.st_rdev])
80992638
AK
113AC_TYPE_OFF_T
114AC_TYPE_PID_T
d0191583 115AC_TYPE_SIGNAL
80992638 116AC_TYPE_SIZE_T
ad6254c5 117AC_TYPE_MODE_T
d911ec67
AK
118AC_TYPE_INT8_T
119AC_TYPE_INT16_T
120AC_TYPE_INT32_T
121AC_TYPE_INT64_T
122AC_TYPE_SSIZE_T
123AC_TYPE_UID_T
124AC_TYPE_UINT8_T
125AC_TYPE_UINT16_T
126AC_TYPE_UINT32_T
127AC_TYPE_UINT64_T
7a197a62 128AC_CHECK_MEMBERS([struct stat.st_rdev])
ad6254c5
AK
129AC_STRUCT_TM
130
131################################################################################
132dnl -- Check for functions
7c9fd3ea 133AC_CHECK_FUNCS([ftruncate gethostname getpagesize \
d911ec67
AK
134 gettimeofday memset mkdir mkfifo rmdir munmap nl_langinfo setenv setlocale \
135 strcasecmp strchr strcspn strspn strdup strncasecmp strerror strrchr \
136 strstr strtol strtoul uname], , [AC_MSG_ERROR(bailing out)])
a0f9708e 137AC_CHECK_FUNCS(siginterrupt)
ad6254c5
AK
138AC_FUNC_ALLOCA
139AC_FUNC_CLOSEDIR_VOID
d911ec67 140AC_FUNC_CHOWN
ad6254c5
AK
141AC_FUNC_FORK
142AC_FUNC_LSTAT
143AC_FUNC_MALLOC
144AC_FUNC_MEMCMP
145AC_FUNC_MMAP
d911ec67 146AC_FUNC_REALLOC
ad6254c5
AK
147AC_FUNC_STAT
148AC_FUNC_STRTOD
d0191583 149AC_FUNC_VPRINTF
80992638 150
9c961554
MB
151################################################################################
152dnl -- Enables statically-linked tools
153AC_MSG_CHECKING(whether to use static linking)
154AC_ARG_ENABLE(static_link,
71082be4
ZK
155 AC_HELP_STRING([--enable-static_link],
156 [use this to link the tools to their libraries
157 statically (default is dynamic linking]),
158 STATIC_LINK=$enableval, STATIC_LINK=no)
9c961554
MB
159AC_MSG_RESULT($STATIC_LINK)
160
80992638 161################################################################################
8ce0cbda 162dnl -- Prefix is /usr by default, the exec_prefix default is setup later
795ca3e5
AK
163AC_PREFIX_DEFAULT(/usr)
164
80992638 165################################################################################
8ce0cbda 166dnl -- Setup the ownership of the files
ad6254c5 167AC_MSG_CHECKING(file owner)
795ca3e5 168AC_ARG_WITH(user,
71082be4
ZK
169 AC_HELP_STRING([--with-user=USER],
170 [set the owner of installed files [[USER=]]]),
171 OWNER=$withval)
ad6254c5 172AC_MSG_RESULT($OWNER)
a38df97f
AK
173
174if test x$OWNER != x; then
23b059e7 175 INSTALL="$INSTALL -o $OWNER"
a38df97f 176fi
795ca3e5 177
80992638 178################################################################################
8ce0cbda 179dnl -- Setup the group ownership of the files
ad6254c5 180AC_MSG_CHECKING(group owner)
795ca3e5 181AC_ARG_WITH(group,
71082be4
ZK
182 AC_HELP_STRING([--with-group=GROUP],
183 [set the group owner of installed files [[GROUP=]]]),
184 GROUP=$withval)
ad6254c5 185AC_MSG_RESULT($GROUP)
a38df97f
AK
186
187if test x$GROUP != x; then
23b059e7 188 INSTALL="$INSTALL -g $GROUP"
a38df97f 189fi
795ca3e5 190
0782ad50
AK
191################################################################################
192dnl -- Setup device node ownership
193AC_MSG_CHECKING(device node uid)
194
195AC_ARG_WITH(device-uid,
71082be4
ZK
196 AC_HELP_STRING([--with-device-uid=UID],
197 [set the owner used for new device nodes [[UID=0]]]),
198 DM_DEVICE_UID=$withval, DM_DEVICE_UID=0)
0782ad50
AK
199AC_MSG_RESULT($DM_DEVICE_UID)
200
201################################################################################
202dnl -- Setup device group ownership
203AC_MSG_CHECKING(device node gid)
204
205AC_ARG_WITH(device-gid,
71082be4
ZK
206 AC_HELP_STRING([--with-device-gid=GID],
207 [set the group used for new device nodes [[GID=0]]]),
208 DM_DEVICE_GID=$withval, DM_DEVICE_GID=0)
0782ad50
AK
209AC_MSG_RESULT($DM_DEVICE_GID)
210
f6fc418d
AK
211################################################################################
212dnl -- Setup device mode
213AC_MSG_CHECKING(device node mode)
214
215AC_ARG_WITH(device-mode,
71082be4
ZK
216 AC_HELP_STRING([--with-device-mode=MODE],
217 [set the mode used for new device nodes [[MODE=0600]]]),
218 DM_DEVICE_MODE=$withval, DM_DEVICE_MODE=0600)
f6fc418d
AK
219AC_MSG_RESULT($DM_DEVICE_MODE)
220
d0df875d
ZK
221AC_MSG_CHECKING(when to create device nodes)
222AC_ARG_WITH(device-nodes-on,
223 AC_HELP_STRING([--with-device-nodes-on=ON],
224 [create nodes on resume or create [[ON=resume]]]),
225 ADD_NODE=$withval, ADD_NODE=resume)
226case "$ADD_NODE" in
227 resume) add_on=DM_ADD_NODE_ON_RESUME;;
228 create) add_on=DM_ADD_NODE_ON_CREATE;;
229 *) AC_MSG_ERROR([--with-device-nodes-on parameter invalid]);;
230esac
231AC_MSG_RESULT(on $ADD_NODE)
232AC_DEFINE_UNQUOTED([DEFAULT_DM_ADD_NODE], $add_on, [Define default node creation behavior with dmsetup create])
233
53f3ebce
PR
234AC_MSG_CHECKING(default name mangling)
235AC_ARG_WITH(default-name-mangling,
236 AC_HELP_STRING([--with-default-name-mangling=MANGLING],
237 [default name mangling: auto/none/hex [[MANGLING=auto]]]),
238 MANGLING=$withval, MANGLING=auto)
239case "$MANGLING" in
240 auto) mangling=DM_STRING_MANGLING_AUTO;;
241 disabled) mangling=DM_STRING_MANGLING_NONE;;
242 hex) mangling=DM_STRING_MANGLING_HEX;;
243 *) AC_MSG_ERROR([--with-default-name-mangling parameter invalid]);;
244esac
245AC_MSG_RESULT($MANGLING)
246AC_DEFINE_UNQUOTED([DEFAULT_DM_NAME_MANGLING], $mangling, [Define default name mangling behaviour])
247
80992638 248################################################################################
7d1552c9 249dnl -- LVM1 tool fallback option
ad6254c5 250AC_MSG_CHECKING(whether to enable lvm1 fallback)
71082be4
ZK
251AC_ARG_ENABLE(lvm1_fallback,
252 AC_HELP_STRING([--enable-lvm1_fallback],
253 [use this to fall back and use LVM1 binaries if
254 device-mapper is missing from the kernel]),
255 LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no)
ad6254c5 256AC_MSG_RESULT($LVM1_FALLBACK)
7d1552c9
AK
257
258if test x$LVM1_FALLBACK = xyes; then
72b2cb61 259 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])
7d1552c9
AK
260fi
261
80992638 262################################################################################
5a52dca9 263dnl -- format1 inclusion type
ad6254c5 264AC_MSG_CHECKING(whether to include support for lvm1 metadata)
5a52dca9 265AC_ARG_WITH(lvm1,
71082be4
ZK
266 AC_HELP_STRING([--with-lvm1=TYPE],
267 [LVM1 metadata support: internal/shared/none
268 [[TYPE=internal]]]),
269 LVM1=$withval, LVM1=internal)
ad6254c5 270AC_MSG_RESULT($LVM1)
5a52dca9
AK
271
272if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]];
273 then AC_MSG_ERROR(
274--with-lvm1 parameter invalid
275)
5a52dca9
AK
276fi;
277
b896caa1 278if test x$LVM1 = xinternal; then
72b2cb61 279 AC_DEFINE([LVM1_INTERNAL], 1, [Define to 1 to include built-in support for LVM1 metadata.])
b896caa1
AK
280fi
281
80992638 282################################################################################
d8ac0fbc 283dnl -- format_pool inclusion type
ad6254c5 284AC_MSG_CHECKING(whether to include support for GFS pool metadata)
d8ac0fbc 285AC_ARG_WITH(pool,
71082be4
ZK
286 AC_HELP_STRING([--with-pool=TYPE],
287 [GFS pool read-only support: internal/shared/none
288 [[TYPE=internal]]]),
289 POOL=$withval, POOL=internal)
ad6254c5 290AC_MSG_RESULT($POOL)
d8ac0fbc
AK
291
292if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]];
293 then AC_MSG_ERROR(
294--with-pool parameter invalid
295)
d8ac0fbc
AK
296fi;
297
298if test x$POOL = xinternal; then
72b2cb61 299 AC_DEFINE([POOL_INTERNAL], 1, [Define to 1 to include built-in support for GFS pool metadata.])
d8ac0fbc
AK
300fi
301
80992638 302################################################################################
d3c8211f 303dnl -- cluster_locking inclusion type
ad6254c5 304AC_MSG_CHECKING(whether to include support for cluster locking)
d3c8211f 305AC_ARG_WITH(cluster,
71082be4
ZK
306 AC_HELP_STRING([--with-cluster=TYPE],
307 [cluster LVM locking support: internal/shared/none
308 [[TYPE=internal]]]),
309 CLUSTER=$withval)
ad6254c5 310AC_MSG_RESULT($CLUSTER)
d3c8211f
AK
311
312if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]];
313 then AC_MSG_ERROR(
314--with-cluster parameter invalid
315)
d3c8211f
AK
316fi;
317
318if test x$CLUSTER = xinternal; then
72b2cb61 319 AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1, [Define to 1 to include built-in support for clustered LVM locking.])
d3c8211f 320fi
d8ac0fbc 321
80992638 322################################################################################
4922197a 323dnl -- snapshots inclusion type
ad6254c5 324AC_MSG_CHECKING(whether to include snapshots)
4922197a 325AC_ARG_WITH(snapshots,
71082be4
ZK
326 AC_HELP_STRING([--with-snapshots=TYPE],
327 [snapshot support: internal/shared/none
328 [[TYPE=internal]]]),
329 SNAPSHOTS=$withval, SNAPSHOTS=internal)
ad6254c5 330AC_MSG_RESULT($SNAPSHOTS)
4922197a
AK
331
332if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]];
333 then AC_MSG_ERROR(
334--with-snapshots parameter invalid
335)
4922197a
AK
336fi;
337
338if test x$SNAPSHOTS = xinternal; then
72b2cb61 339 AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.])
4922197a
AK
340fi
341
80992638 342################################################################################
4922197a 343dnl -- mirrors inclusion type
ad6254c5 344AC_MSG_CHECKING(whether to include mirrors)
4922197a 345AC_ARG_WITH(mirrors,
71082be4
ZK
346 AC_HELP_STRING([--with-mirrors=TYPE],
347 [mirror support: internal/shared/none
348 [[TYPE=internal]]]),
349 MIRRORS=$withval, MIRRORS=internal)
ad6254c5 350AC_MSG_RESULT($MIRRORS)
4922197a
AK
351
352if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]];
353 then AC_MSG_ERROR(
354--with-mirrors parameter invalid
355)
4922197a
AK
356fi;
357
358if test x$MIRRORS = xinternal; then
72b2cb61 359 AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.])
4922197a
AK
360fi
361
cac52ca4
JEB
362################################################################################
363dnl -- raid inclusion type
364AC_MSG_CHECKING(whether to include raid)
365AC_ARG_WITH(raid,
366 AC_HELP_STRING([--with-raid=TYPE],
367 [mirror support: internal/shared/none
368 [[TYPE=internal]]]),
369 RAID=$withval, RAID=internal)
370AC_MSG_RESULT($RAID)
371
372if [[ "x$RAID" != xnone -a "x$RAID" != xinternal -a "x$RAID" != xshared ]];
373 then AC_MSG_ERROR(
374--with-raid parameter invalid
375)
376fi;
377
378if test x$RAID = xinternal; then
379 AC_DEFINE([RAID_INTERNAL], 1, [Define to 1 to include built-in support for raid.])
380fi
381
8fea97b7
ZK
382################################################################################
383dnl -- asynchronous volume replicator inclusion type
384AC_MSG_CHECKING(whether to include replicators)
71082be4
ZK
385AC_ARG_WITH(replicators,
386 AC_HELP_STRING([--with-replicators=TYPE],
387 [replicator support: internal/shared/none
388 [[TYPE=none]]]),
389 REPLICATORS=$withval, REPLICATORS=none)
8fea97b7
ZK
390AC_MSG_RESULT($REPLICATORS)
391
392case "$REPLICATORS" in
393 none|shared) ;;
394 internal) AC_DEFINE([REPLICATOR_INTERNAL], 1,
395 [Define to 1 to include built-in support for replicators.]) ;;
396 *) AC_MSG_ERROR([--with-replicators parameter invalid ($REPLICATORS)]) ;;
397esac
398
3ba4a195
ZK
399################################################################################
400dnl -- thin provisioning
401AC_MSG_CHECKING(whether to include thin provisioning)
402AC_ARG_WITH(thin,
403 AC_HELP_STRING([--with-thin=TYPE],
404 [thin provisioning support: internal/shared/none
405 [[TYPE=none]]]),
406 THIN=$withval, THIN=none)
407AC_MSG_RESULT($THIN)
408
409case "$THIN" in
410 none|shared) ;;
411 internal) AC_DEFINE([THIN_INTERNAL], 1,
412 [Define to 1 to include built-in support for thin provisioning.]) ;;
413 *) AC_MSG_ERROR([--with-thin parameter invalid ($THIN)]) ;;
414esac
415
f61cacad
ZK
416case "$THIN" in
417 internal|shared)
418 AC_ARG_WITH(thin-check,
419 AC_HELP_STRING([--with-thin-check=PATH],
420 [thin_check tool: [[autodetect]]]),
421 THIN_CHECK_CMD=$withval, THIN_CHECK_CMD="autodetect")
422 # Empty means a config way to ignore thin checking
423 if test "$THIN_CHECK_CMD" = "autodetect"; then
424 AC_PATH_PROG(THIN_CHECK_CMD, thin_check)
425 test -z "$THIN_CHECK_CMD" && AC_MSG_ERROR(thin_check not found in path $PATH)
426 fi
f61cacad
ZK
427 ;;
428esac
429
909887be
ZK
430AC_DEFINE_UNQUOTED([THIN_CHECK_CMD], ["$THIN_CHECK_CMD"],
431 [The path to 'thin_check', if available.])
432
f61cacad 433
80992638 434################################################################################
1b523347 435dnl -- Disable readline
ad6254c5 436AC_MSG_CHECKING(whether to enable readline)
2c189a57 437AC_ARG_ENABLE([readline],
71082be4
ZK
438 AC_HELP_STRING([--disable-readline], [disable readline support]),
439 READLINE=$enableval, READLINE=maybe)
ad6254c5 440AC_MSG_RESULT($READLINE)
795ca3e5 441
8b1a3214
AK
442################################################################################
443dnl -- Disable realtime clock support
444AC_MSG_CHECKING(whether to enable realtime support)
71082be4
ZK
445AC_ARG_ENABLE(realtime,
446 AC_HELP_STRING([--enable-realtime], [enable realtime clock support]),
447 REALTIME=$enableval)
8b1a3214
AK
448AC_MSG_RESULT($REALTIME)
449
e40d44be
ZK
450################################################################################
451dnl -- disable OCF resource agents
452AC_MSG_CHECKING(whether to enable OCF resource agents)
453AC_ARG_ENABLE(ocf,
454 AC_HELP_STRING([--enable-ocf],
455 [enable Open Cluster Framework (OCF) compliant resource agents]),
456 OCF=$enableval, OCF=no)
457AC_MSG_RESULT($OCF)
349da06c
ZK
458AC_ARG_WITH(ocfdir,
459 AC_HELP_STRING([--with-ocfdir=DIR],
460 [install OCF files in DIR [[PREFIX/lib/ocf/resource.d/lvm2]]]),
461 OCFDIR=$withval, OCFDIR='${prefix}/lib/ocf/resource.d/lvm2')
e40d44be 462
90c80887
AK
463################################################################################
464dnl -- Init pkg-config with dummy invokation:
465dnl -- this is required because PKG_CHECK_MODULES macro is expanded
466dnl -- to initialize the pkg-config environment only at the first invokation,
467dnl -- that would be conditional in this configure.in.
468pkg_config_init() {
469 PKG_CHECK_MODULES(PKGCONFIGINIT, pkgconfiginit, [],
470 [AC_MSG_RESULT([pkg-config initialized])])
471 PKGCONFIG_INIT=1
472}
473
80992638 474################################################################################
8ce0cbda 475dnl -- Build cluster LVM daemon
ad6254c5 476AC_MSG_CHECKING(whether to build cluster LVM daemon)
a266258f 477AC_ARG_WITH(clvmd,
71082be4 478 [ --with-clvmd=TYPE build cluster LVM Daemon
8c222979 479 The following cluster manager combinations are valid:
a946372e
AK
480 * cman (RHEL5 or equivalent)
481 * cman,corosync,openais (or selection of them)
649c4507 482 * singlenode (localhost only)
a946372e
AK
483 * all (autodetect)
484 * none (disable build)
71082be4
ZK
485 [[TYPE=none]]],
486 CLVMD=$withval, CLVMD=none)
a266258f 487if test x$CLVMD = xyes; then
5c7fc7c4 488 CLVMD=all
b1098701 489fi
ad6254c5 490AC_MSG_RESULT($CLVMD)
80992638 491
8ce0cbda 492dnl -- If clvmd enabled without cluster locking, automagically include it
a266258f 493if test x$CLVMD != xnone && test x$CLUSTER = xnone; then
d3c8211f
AK
494 CLUSTER=internal
495fi
d3c8211f 496
90c80887 497dnl -- init pkgconfig if required
34b6075d 498if test x$CLVMD != xnone && test x$PKGCONFIG_INIT != x1; then
90c80887
AK
499 pkg_config_init
500fi
501
34b6075d
FDN
502dnl -- Express clvmd init script Required-Start / Required-Stop
503CLVMD_CMANAGERS=""
504dnl -- On RHEL4/RHEL5, qdiskd is started from a separate init script.
7cf60770 505dnl -- Enable if we are build for cman.
34b6075d 506CLVMD_NEEDS_QDISKD=no
90c80887 507
a946372e
AK
508dnl -- define build types
509if [[ `expr x"$CLVMD" : '.*gulm.*'` != 0 ]]; then
7cf60770 510 AC_MSG_ERROR([Since version 2.02.87 GULM locking is no longer supported.]);
34b6075d
FDN
511fi
512if [[ `expr x"$CLVMD" : '.*cman.*'` != 0 ]]; then
513 BUILDCMAN=yes
514 CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman"
515 CLVMD_NEEDS_QDISKD=yes
a946372e
AK
516fi
517if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
518 BUILDCOROSYNC=yes
34b6075d 519 CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync"
a946372e
AK
520fi
521if [[ `expr x"$CLVMD" : '.*openais.*'` != 0 ]]; then
522 BUILDOPENAIS=yes
34b6075d 523 CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais"
a946372e 524fi
34b6075d
FDN
525if test x$CLVMD_NEEDS_QDISKD != xno; then
526 CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd"
a946372e
AK
527fi
528
a946372e
AK
529dnl -- define a soft bailout if we are autodetecting
530soft_bailout() {
531 NOTFOUND=1
532}
533
534hard_bailout() {
535 AC_MSG_ERROR([bailing out])
536}
537
538dnl -- if clvmd=all then set soft_bailout (we don't want to error)
539dnl -- and set all builds to yes. We need to do this here
7cf60770 540dnl -- to skip the openais|corosync sanity check above.
a946372e
AK
541if test x$CLVMD = xall; then
542 bailout=soft_bailout
a946372e
AK
543 BUILDCMAN=yes
544 BUILDCOROSYNC=yes
545 BUILDOPENAIS=yes
546else
547 bailout=hard_bailout
548fi
549
550dnl -- helper macro to check libs without adding them to LIBS
551check_lib_no_libs() {
552 lib_no_libs_arg1=$1
553 shift
554 lib_no_libs_arg2=$1
555 shift
556 lib_no_libs_args=$@
557 AC_CHECK_LIB([$lib_no_libs_arg1],
558 [$lib_no_libs_arg2],,
559 [$bailout],
560 [$lib_no_libs_args])
561 LIBS=$ac_check_lib_save_LIBS
562}
563
a946372e
AK
564dnl -- Look for cman libraries if required.
565if test x$BUILDCMAN = xyes; then
566 PKG_CHECK_MODULES(CMAN, libcman, [HAVE_CMAN=yes],
567 [NOTFOUND=0
568 AC_CHECK_HEADERS(libcman.h,,$bailout)
569 check_lib_no_libs cman cman_init
570 if test $NOTFOUND = 0; then
571 AC_MSG_RESULT([no pkg for libcman, using -lcman])
572 CMAN_LIBS="-lcman"
573 HAVE_CMAN=yes
574 fi])
575 CHECKCONFDB=yes
576 CHECKDLM=yes
577fi
578
579dnl -- Look for corosync that's required also for openais build
580dnl -- only enough recent version of corosync ship pkg-config files.
581dnl -- We can safely rely on that to detect the correct bits.
582if test x$BUILDCOROSYNC = xyes || \
583 test x$BUILDOPENAIS = xyes; then
584 PKG_CHECK_MODULES(COROSYNC, corosync, [HAVE_COROSYNC=yes], $bailout)
585 CHECKCONFDB=yes
b6d7a484 586 CHECKCMAP=yes
a946372e
AK
587fi
588
edf47283 589dnl -- Look for corosync libraries if required.
a946372e
AK
590if test x$BUILDCOROSYNC = xyes; then
591 PKG_CHECK_MODULES(QUORUM, libquorum, [HAVE_QUORUM=yes], $bailout)
592 CHECKCPG=yes
593 CHECKDLM=yes
594fi
595
596dnl -- Look for openais libraries if required.
597if test x$BUILDOPENAIS = xyes; then
598 PKG_CHECK_MODULES(SALCK, libSaLck, [HAVE_SALCK=yes], $bailout)
599 CHECKCPG=yes
600fi
601
602dnl -- Below are checks for libraries common to more than one build.
603
604dnl -- Check confdb library.
b6d7a484 605dnl -- mandatory for corosync < 2.0 build.
a946372e
AK
606dnl -- optional for openais/cman build.
607
608if test x$CHECKCONFDB = xyes; then
609 PKG_CHECK_MODULES(CONFDB, libconfdb,
610 [HAVE_CONFDB=yes],
611 [HAVE_CONFDB=no])
612
613 AC_CHECK_HEADERS(corosync/confdb.h,
614 [HAVE_CONFDB_H=yes],
615 [HAVE_CONFDB_H=no])
616
617 if test x$HAVE_CONFDB != xyes && \
618 test x$HAVE_CONFDB_H = xyes; then
619 check_lib_no_libs confdb confdb_initialize
620 AC_MSG_RESULT([no pkg for confdb, using -lconfdb])
621 CONFDB_LIBS="-lconfdb"
622 HAVE_CONFDB=yes
623 fi
b6d7a484
AK
624fi
625
626dnl -- Check cmap library
627dnl -- mandatory for corosync >= 2.0 build.
628
629if test x$CHECKCMAP = xyes; then
630 PKG_CHECK_MODULES(CMAP, libcmap,
631 [HAVE_CMAP=yes],
632 [HAVE_CMAP=no])
a946372e 633
b6d7a484
AK
634 AC_CHECK_HEADERS(corosync/cmap.h,
635 [HAVE_CMAP_H=yes],
636 [HAVE_CMAP_H=no])
637
638 if test x$HAVE_CMAP != xyes && \
639 test x$HAVE_CMAP_H = xyes; then
640 check_lib_no_libs cmap cmap_initialize
641 AC_MSG_RESULT([no pkg for cmap, using -lcmap])
642 CMAP_LIBS="-lcmap"
643 HAVE_CMAP=yes
644 fi
645fi
646
647if test x$BUILDCOROSYNC = xyes; then
648 if test x$HAVE_CMAP != xyes && \
649 test x$HAVE_CONFDB != xyes && \
a946372e 650 test x$CLVMD != xall; then
b6d7a484 651 AC_MSG_ERROR([bailing out... cmap (corosync >= 2.0) or confdb (corosync < 2.0) library is required])
a946372e
AK
652 fi
653fi
654
655dnl -- Check cpg library.
656if test x$CHECKCPG = xyes; then
657 PKG_CHECK_MODULES(CPG, libcpg, [HAVE_CPG=yes], $bailout)
658fi
659
660dnl -- Check dlm library.
661if test x$CHECKDLM = xyes; then
662 PKG_CHECK_MODULES(DLM, libdlm, [HAVE_DLM=yes],
663 [NOTFOUND=0
664 AC_CHECK_HEADERS(libdlm.h,,$bailout)
665 check_lib_no_libs dlm dlm_lock -lpthread
666 if test $NOTFOUND = 0; then
667 AC_MSG_RESULT([no pkg for libdlm, using -ldlm])
668 DLM_LIBS="-ldlm -lpthread"
669 HAVE_DLM=yes
670 fi])
671fi
672
673dnl -- If we are autodetecting, we need to re-create
34b6075d
FDN
674dnl -- the depedencies checks and set a proper CLVMD,
675dnl -- together with init script Required-Start/Stop entries.
a946372e 676if test x$CLVMD = xall; then
8c222979 677 CLVMD=none
34b6075d
FDN
678 CLVMD_CMANAGERS=""
679 CLVMD_NEEDS_QDISKD=no
a946372e
AK
680 if test x$HAVE_CMAN = xyes && \
681 test x$HAVE_DLM = xyes; then
8c222979
FDN
682 AC_MSG_RESULT([Enabling clvmd cman cluster manager])
683 CLVMD="$CLVMD,cman"
34b6075d
FDN
684 CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman"
685 CLVMD_NEEDS_QDISKD=yes
a946372e
AK
686 fi
687 if test x$HAVE_COROSYNC = xyes && \
688 test x$HAVE_QUORUM = xyes && \
689 test x$HAVE_CPG = xyes && \
b6d7a484
AK
690 test x$HAVE_DLM = xyes; then
691 if test x$HAVE_CONFDB = xyes || test x$HAVE_CMAP = xyes; then
8c222979
FDN
692 AC_MSG_RESULT([Enabling clvmd corosync cluster manager])
693 CLVMD="$CLVMD,corosync"
34b6075d 694 CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync"
b6d7a484 695 fi
a946372e
AK
696 fi
697 if test x$HAVE_COROSYNC = xyes && \
698 test x$HAVE_CPG = xyes && \
699 test x$HAVE_SALCK = xyes; then
8c222979
FDN
700 AC_MSG_RESULT([Enabling clvmd openais cluster manager])
701 CLVMD="$CLVMD,openais"
34b6075d
FDN
702 CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais"
703 fi
704 if test x$CLVMD_NEEDS_QDISKD != xno; then
705 CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd"
8c222979
FDN
706 fi
707 if test x$CLVMD = xnone; then
708 AC_MSG_RESULT([Disabling clvmd build. No cluster manager detected.])
a946372e 709 fi
edf47283
AK
710fi
711
94424fab
FDN
712dnl -- Fixup CLVMD_CMANAGERS with new corosync
713dnl -- clvmd built with corosync >= 2.0 needs dlm (either init or systemd service)
714dnl -- to be started.
715if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
716 if test x$HAVE_CMAP = xyes; then
717 CLVMD_CMANAGERS="$CLVMD_CMANAGERS dlm"
718 fi
719fi
720
8c4e8a18
FDN
721################################################################################
722dnl -- clvmd pidfile
723if test "x$CLVMD" != xnone; then
724 AC_ARG_WITH(clvmd-pidfile,
725 AC_HELP_STRING([--with-clvmd-pidfile=PATH],
726 [clvmd pidfile [[/var/run/clvmd.pid]]]),
727 CLVMD_PIDFILE=$withval,
728 CLVMD_PIDFILE="/var/run/clvmd.pid")
729 AC_DEFINE_UNQUOTED(CLVMD_PIDFILE, ["$CLVMD_PIDFILE"],
730 [Path to clvmd pidfile.])
731fi
732
3c14bcca 733################################################################################
66fd4529
AK
734dnl -- Build cluster mirror log daemon
735AC_MSG_CHECKING(whether to build cluster mirror log daemon)
71082be4
ZK
736AC_ARG_ENABLE(cmirrord,
737 AC_HELP_STRING([--enable-cmirrord],
738 [enable the cluster mirror log daemon]),
739 CMIRRORD=$enableval, CMIRRORD=no)
66fd4529 740AC_MSG_RESULT($CMIRRORD)
3c14bcca 741
66fd4529
AK
742BUILD_CMIRRORD=$CMIRRORD
743
744################################################################################
745dnl -- cmirrord pidfile
66fd4529
AK
746if test "x$BUILD_CMIRRORD" = xyes; then
747 AC_ARG_WITH(cmirrord-pidfile,
71082be4
ZK
748 AC_HELP_STRING([--with-cmirrord-pidfile=PATH],
749 [cmirrord pidfile [[/var/run/cmirrord.pid]]]),
750 CMIRRORD_PIDFILE=$withval,
751 CMIRRORD_PIDFILE="/var/run/cmirrord.pid")
752 AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE, ["$CMIRRORD_PIDFILE"],
753 [Path to cmirrord pidfile.])
66fd4529
AK
754fi
755
756################################################################################
3c14bcca 757dnl -- Look for corosync libraries if required.
66fd4529 758if [[ "x$BUILD_CMIRRORD" = xyes ]]; then
90c80887
AK
759 dnl -- init pkgconfig if required
760 if test x$PKGCONFIG_INIT != x1; then
761 pkg_config_init
762 fi
62e38da1
JEB
763
764 AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 1, [Define to 1 to include libSaCkpt.])
765 PKG_CHECK_MODULES(SACKPT, libSaCkpt, [HAVE_SACKPT=yes],
766 [AC_MSG_RESULT([no libSaCkpt, compiling without it])
767 AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 0, [Define to 0 to exclude libSaCkpt.])])
768
90c80887
AK
769 if test x$HAVE_CPG != xyes; then
770 PKG_CHECK_MODULES(CPG, libcpg)
771 fi
3c14bcca
JEB
772fi
773
80992638 774################################################################################
8ce0cbda 775dnl -- Enable debugging
ad6254c5 776AC_MSG_CHECKING(whether to enable debugging)
71082be4
ZK
777AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable debugging]),
778 DEBUG=$enableval, DEBUG=no)
ad6254c5 779AC_MSG_RESULT($DEBUG)
8ef2b021 780
8ce0cbda
AK
781dnl -- Normally turn off optimisation for debug builds
782if test x$DEBUG = xyes; then
783 COPTIMISE_FLAG=
8a2fc586
AK
784else
785 CSCOPE_CMD=
8ce0cbda
AK
786fi
787
788################################################################################
789dnl -- Override optimisation
ad6254c5 790AC_MSG_CHECKING(for C optimisation flag)
8ce0cbda 791AC_ARG_WITH(optimisation,
71082be4
ZK
792 AC_HELP_STRING([--with-optimisation=OPT],
793 [C optimisation flag [[OPT=-O2]]]),
794 COPTIMISE_FLAG=$withval)
ad6254c5 795AC_MSG_RESULT($COPTIMISE_FLAG)
8ce0cbda 796
fddafd51
ZK
797################################################################################
798dnl -- Enable profiling
5556819a 799AC_MSG_CHECKING(whether to gather gcov profiling data)
fddafd51 800AC_ARG_ENABLE(profiling,
71082be4
ZK
801 AC_HELP_STRING(--enable-profiling, [gather gcov profiling data]),
802 PROFILING=$enableval, PROFILING=no)
5556819a
AK
803AC_MSG_RESULT($PROFILING)
804
805if test "x$PROFILING" = xyes; then
806 COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage"
fd4728e1
ZK
807 AC_PATH_PROG(LCOV, lcov)
808 AC_PATH_PROG(GENHTML, genhtml)
809 if test -z "$LCOV" -o -z "$GENHTML"; then
b145d876
ZK
810 AC_MSG_ERROR([lcov and genhtml are required for profiling])
811 fi
fd4728e1
ZK
812 AC_PATH_PROG(GENPNG, genpng)
813 if test -n "$GENPNG"; then
814 AC_MSG_CHECKING([whether $GENPNG has all required modules])
815 if $GENPNG --help > /dev/null 2>&1 ; then
816 AC_MSG_RESULT(ok)
817 GENHTML="$GENHTML --frames"
818 else
819 AC_MSG_RESULT(not supported)
820 AC_MSG_WARN([GD.pm perl module is not installed])
821 GENPNG=
822 fi
823 fi
5556819a 824fi
fddafd51 825
1033d120
JT
826################################################################################
827dnl -- Enable testing
828AC_MSG_CHECKING(whether to enable unit testing)
829AC_ARG_ENABLE(testing,
830 AC_HELP_STRING(--enable-testing, [enable testing targets in the makefile]),
831 TESTING=$enableval, TESTING=no)
832AC_MSG_RESULT($TESTING)
833
834if test "$TESTING" = yes; then
5da88e5b 835 PKG_CHECK_MODULES(CUNIT, cunit >= 2.0)
1033d120
JT
836fi
837
52e1564f
JT
838################################################################################
839dnl -- Enable valgrind awareness of memory pools
840AC_MSG_CHECKING(whether to enable valgrind awareness of pools)
841AC_ARG_ENABLE(valgrind_pool,
842 AC_HELP_STRING(--enable-valgrind-pool, [enable valgrind awareness of pools]),
843 VALGRIND_POOL=$enableval, VALGRIND_POOL=no)
844AC_MSG_RESULT($VALGRIND_POOL)
845
846if test "$VALGRIND_POOL" = yes; then
847 AC_CHECK_HEADERS([valgrind/memcheck.h], , [AC_MSG_ERROR(bailing out)])
848 AC_DEFINE([VALGRIND_POOL], 1, [Enable a valgrind aware build of pool])
849fi
850
80992638 851################################################################################
8ce0cbda 852dnl -- Disable devmapper
ad6254c5 853AC_MSG_CHECKING(whether to use device-mapper)
71082be4
ZK
854AC_ARG_ENABLE(devmapper,
855 AC_HELP_STRING([--disable-devmapper],
856 [disable LVM2 device-mapper interaction]),
857 DEVMAPPER=$enableval)
ad6254c5 858AC_MSG_RESULT($DEVMAPPER)
199e490e 859
b896caa1 860if test x$DEVMAPPER = xyes; then
f6fc418d 861 AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.])
b896caa1
AK
862fi
863
615534d3
PR
864################################################################################
865dnl -- Build lvmetad
866AC_MSG_CHECKING(whether to build LVMetaD)
867AC_ARG_ENABLE(lvmetad,
d38de32b
AK
868 AC_HELP_STRING([--enable-lvmetad],
869 [enable the LVM Metadata Daemon]),
615534d3
PR
870 LVMETAD=$enableval)
871AC_MSG_RESULT($LVMETAD)
872
873BUILD_LVMETAD=$LVMETAD
874
832a1e73
AK
875if test x$BUILD_LVMETAD = xyes; then
876 AC_DEFINE([LVMETAD_SUPPORT], 1, [Define to 1 to include code that uses lvmetad.])
877fi
878
5d518f1f
AK
879################################################################################
880dnl -- Enable udev synchronisation
881AC_MSG_CHECKING(whether to enable synchronisation with udev processing)
71082be4
ZK
882AC_ARG_ENABLE(udev_sync,
883 AC_HELP_STRING([--enable-udev_sync],
884 [enable synchronisation with udev processing]),
885 UDEV_SYNC=$enableval, UDEV_SYNC=no)
5d518f1f
AK
886AC_MSG_RESULT($UDEV_SYNC)
887
888if test x$UDEV_SYNC = xyes; then
86ba564a
AK
889 dnl -- init pkgconfig if required
890 if test x$PKGCONFIG_INIT != x1; then
891 pkg_config_init
892 fi
71b29ddc 893 PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
5d518f1f
AK
894 AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
895fi
896
897dnl -- Enable udev rules
898AC_MSG_CHECKING(whether to enable installation of udev rules required for synchronisation)
71082be4
ZK
899AC_ARG_ENABLE(udev_rules,
900 AC_HELP_STRING([--enable-udev_rules],
901 [install rule files needed for udev synchronisation]),
902 UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC)
5d518f1f
AK
903AC_MSG_RESULT($UDEV_RULES)
904
b559a1e6
PR
905if test x$UDEV_RULES = xyes; then
906 AC_MSG_CHECKING(whether udev supports builtin blkid)
907 udev_version=$(udevadm info --version 2>/dev/null)
908 if test -n "$udev_version" && test "$udev_version" -ge 176; then
909 UDEV_HAS_BUILTIN_BLKID=yes
910 else
911 UDEV_HAS_BUILTIN_BLKID=no
912 fi
913 AC_MSG_RESULT($UDEV_HAS_BUILTIN_BLKID)
914fi
915
f6fc418d
AK
916################################################################################
917dnl -- Compatibility mode
71082be4
ZK
918AC_ARG_ENABLE(compat,
919 AC_HELP_STRING([--enable-compat],
920 [enable support for old device-mapper versions]),
921 DM_COMPAT=$enableval, DM_COMPAT=no)
f6fc418d 922
2061c0ec
AK
923if test x$DM_COMPAT = xyes; then
924 AC_MSG_ERROR(
925 [--enable-compat is not currently supported.
926Since device-mapper version 1.02.66, only one version (4) of the device-mapper
927ioctl protocol is supported.]
928 )
929fi
930
95eaa683
AK
931################################################################################
932dnl -- Compatible units suffix mode
933AC_ARG_ENABLE(units-compat,
71082be4
ZK
934 AC_HELP_STRING([--enable-units-compat],
935 [enable output compatibility with old versions that
936 that do not use KiB-style unit suffixes]),
937 UNITS_COMPAT=$enableval, UNITS_COMPAT=no)
95eaa683
AK
938
939if test x$UNITS_COMPAT = xyes; then
940 AC_DEFINE([DEFAULT_SI_UNIT_CONSISTENCY], 0, [Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes.])
941fi
942
f6fc418d
AK
943################################################################################
944dnl -- Disable ioctl
71082be4
ZK
945AC_ARG_ENABLE(ioctl,
946 AC_HELP_STRING([--disable-driver],
947 [disable calls to device-mapper in the kernel]),
948 DM_IOCTLS=$enableval)
f6fc418d 949
80992638 950################################################################################
8ce0cbda 951dnl -- Disable O_DIRECT
ad6254c5 952AC_MSG_CHECKING(whether to enable O_DIRECT)
71082be4
ZK
953AC_ARG_ENABLE(o_direct,
954 AC_HELP_STRING([--disable-o_direct], [disable O_DIRECT]),
955 ODIRECT=$enableval)
ad6254c5 956AC_MSG_RESULT($ODIRECT)
2dc95e1c
AK
957
958if test x$ODIRECT = xyes; then
72b2cb61 959 AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.])
2dc95e1c
AK
960fi
961
572fefeb
AK
962################################################################################
963dnl -- Enable liblvm2app.so
964AC_MSG_CHECKING(whether to build liblvm2app.so application library)
965AC_ARG_ENABLE(applib,
71082be4
ZK
966 AC_HELP_STRING([--enable-applib], [build application library]),
967 APPLIB=$enableval, APPLIB=no)
572fefeb
AK
968AC_MSG_RESULT($APPLIB)
969AC_SUBST([LVM2APP_LIB])
970test x$APPLIB = xyes \
971 && LVM2APP_LIB=-llvm2app \
972 || LVM2APP_LIB=
973
80992638 974################################################################################
8ce0cbda 975dnl -- Enable cmdlib
ad6254c5 976AC_MSG_CHECKING(whether to compile liblvm2cmd.so)
71082be4
ZK
977AC_ARG_ENABLE(cmdlib,
978 AC_HELP_STRING([--enable-cmdlib], [build shared command library]),
979 CMDLIB=$enableval, CMDLIB=no)
ad6254c5 980AC_MSG_RESULT($CMDLIB)
aa4d1e31 981AC_SUBST([LVM2CMD_LIB])
2a9a80c9 982test x$CMDLIB = xyes \
aa4d1e31
JM
983 && LVM2CMD_LIB=-llvm2cmd \
984 || LVM2CMD_LIB=
8106cdd5 985
f6fc418d
AK
986################################################################################
987dnl -- Enable pkg-config
71082be4
ZK
988AC_ARG_ENABLE(pkgconfig,
989 AC_HELP_STRING([--enable-pkgconfig], [install pkgconfig support]),
990 PKGCONFIG=$enableval, PKGCONFIG=no)
2a9a80c9 991
23b059e7
ZK
992################################################################################
993dnl -- Enable installation of writable files by user
71082be4
ZK
994AC_ARG_ENABLE(write_install,
995 AC_HELP_STRING([--enable-write_install],
996 [install user writable files]),
997 WRITE_INSTALL=$enableval, WRITE_INSTALL=no)
23b059e7 998
80992638 999################################################################################
8ce0cbda 1000dnl -- Enable fsadm
1995c9ff 1001AC_MSG_CHECKING(whether to install fsadm)
71082be4
ZK
1002AC_ARG_ENABLE(fsadm, AC_HELP_STRING([--disable-fsadm], [disable fsadm]),
1003 FSADM=$enableval)
ad6254c5 1004AC_MSG_RESULT($FSADM)
809fae91 1005
06f62ad1
AK
1006################################################################################
1007dnl -- enable dmeventd handling
1008AC_MSG_CHECKING(whether to use dmeventd)
71082be4
ZK
1009AC_ARG_ENABLE(dmeventd, AC_HELP_STRING([--enable-dmeventd],
1010 [enable the device-mapper event daemon]),
1011 DMEVENTD=$enableval)
06f62ad1
AK
1012AC_MSG_RESULT($DMEVENTD)
1013
f6fc418d
AK
1014BUILD_DMEVENTD=$DMEVENTD
1015
06f62ad1 1016dnl -- dmeventd currently requires internal mirror support
2a9a80c9
PR
1017if test x$DMEVENTD = xyes; then
1018 if test x$MIRRORS != xinternal; then
1019 AC_MSG_ERROR(
1020 --enable-dmeventd currently requires --with-mirrors=internal
1021 )
1022 fi
1023 if test x$CMDLIB = xno; then
1024 AC_MSG_ERROR(
1025 --enable-dmeventd requires --enable-cmdlib to be used as well
1026 )
1027 fi
06f62ad1
AK
1028fi
1029
15d91f5a 1030if test x$DMEVENTD = xyes; then
72b2cb61 1031 AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.])
15d91f5a 1032fi
f6fc418d 1033
3d962ed6
AK
1034################################################################################
1035dnl -- enable veritysetup
1036AC_MSG_CHECKING(whether to install veritysetup)
1037AC_ARG_WITH(veritysetup, AC_HELP_STRING([--with-veritysetup=TYPE], [build veritysetup using openssl/nss/gcrypt]),
1038 VERITYSETUP=$withval)
1039AC_MSG_RESULT($VERITYSETUP)
1040
1041if test x$VERITYSETUP != xno -a x$VERITYSETUP != x; then
1042 if test x$PKGCONFIG_INIT != x1; then
1043 pkg_config_init
1044 fi
1045
1046 dnl Test OPENSSL
1047 if test -z "$VERITYSETUP_CFLAGS" && test x$VERITYSETUP = xyes -o x$VERITYSETUP = xopenssl; then
1048 PKG_CHECK_MODULES(OPENSSL, openssl, [
1049 AC_DEFINE([CRYPT_OPENSSL], 1, [Define to 1 if OpenSSL encryption is to be used.])
1050 VERITYSETUP_CFLAGS="$OPENSSL_CFLAGS"
1051 VERITYSETUP_LIBS="`echo "$OPENSSL_LIBS" | sed 's/-lssl\>//'`"
1052 ], [
1053 AC_CHECK_LIB(crypto, EVP_get_digestbyname, [
1054 AC_CHECK_HEADER(openssl/evp.h, [
1055 AC_DEFINE([CRYPT_OPENSSL], 1, [Define to 1 if OpenSSL encryption is to be used.])
1056 VERITYSETUP_CFLAGS=
1057 VERITYSETUP_LIBS="-lcrypto"
1058 ])
1059 ])
1060 ])
1061 fi
1062
1063 dnl Test NSS
1064 if test -z "$VERITYSETUP_CFLAGS" && test x$VERITYSETUP = xyes -o x$VERITYSETUP = xnss; then
1065 PKG_CHECK_MODULES(NSS, nss, [
1066 AC_DEFINE([CRYPT_NSS], 1, [Define to 1 if nss encryption is to be used.])
1067 VERITYSETUP_CFLAGS="$NSS_CFLAGS"
1068 VERITYSETUP_LIBS="`echo "$NSS_LIBS" | sed 's/-lsmime3\>//' | sed 's/-lssl3\>//'`"
1069 ], true)
1070 fi
1071
1072 dnl Test GCRYPT
1073 if test -z "$VERITYSETUP_CFLAGS" && test x$VERITYSETUP = xyes -o x$VERITYSETUP = xgcrypt; then
1074 AC_CHECK_LIB(gcrypt, gcry_md_map_name, [
1075 AC_CHECK_HEADER(gcrypt.h, [
1076 AC_DEFINE([CRYPT_GCRYPT], 1, [Define to 1 if gcrpyt encryption is to be used.])
1077 VERITYSETUP_CFLAGS=
1078 VERITYSETUP_LIBS="-lgcrypt"
1079 ])
1080 ])
1081 fi
1082
1083 if test -z "$VERITYSETUP_LIBS"; then
1084 AC_MSG_ERROR(No cryptographic library for veritysetup found)
1085 fi
1086 AC_CHECK_LIB(popt, poptGetContext, true, [
1087 AC_MSG_ERROR(popt library was not found)
1088 ])
1089 AC_CHECK_HEADER(popt.h, true, [
1090 AC_MSG_ERROR(popt.h was not found)
1091 ])
1092 VERITYSETUP_LIBS="$VERITYSETUP_LIBS -lpopt"
1093 AC_SUBST(VERITYSETUP_CFLAGS)
1094 AC_SUBST(VERITYSETUP_LIBS)
1095 VERITYSETUP=yes
1096fi
1097AC_SUBST(VERITYSETUP)
1098
f6fc418d
AK
1099################################################################################
1100dnl -- getline included in recent libc
1101
1102AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1,
1103 [Define to 1 if getline is available.]))
1104
1105################################################################################
1106dnl -- canonicalize_file_name included in recent libc
1107
1108AC_CHECK_LIB(c, canonicalize_file_name,
1109 AC_DEFINE([HAVE_CANONICALIZE_FILE_NAME], 1,
1110 [Define to 1 if canonicalize_file_name is available.]))
1111
80992638 1112################################################################################
d0191583 1113dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin
795ca3e5
AK
1114if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
1115 then exec_prefix="";
1116fi;
1117
80992638 1118################################################################################
8ce0cbda 1119dnl -- Check for dlopen
19a2c6e0 1120AC_CHECK_LIB(dl, dlopen, [
72b2cb61 1121 AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.])
19a2c6e0
ZK
1122 DL_LIBS="-ldl"
1123 HAVE_LIBDL=yes ], [
1124 DL_LIBS=
1125 HAVE_LIBDL=no ])
26e7f2e0 1126
80992638 1127################################################################################
8ce0cbda 1128dnl -- Check for shared/static conflicts
80992638
AK
1129if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \
1130 -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \
cac52ca4 1131 -o "x$RAID" = xshared \
4922197a 1132 \) -a "x$STATIC_LINK" = xyes ]];
d68a82ec 1133 then AC_MSG_ERROR(
036f273a 1134Features cannot be 'shared' when building statically
d68a82ec 1135)
036f273a
AK
1136fi
1137
f30875db
ZK
1138################################################################################
1139if [[ "$DMEVENTD" = yes -o "$CLVMD" != none ]] ; then
1140 AC_CHECK_LIB([pthread], [pthread_mutex_lock],
1141 [PTHREAD_LIBS="-lpthread"], hard_bailout)
1142fi
1143
d0191583
JM
1144################################################################################
1145dnl -- Disable selinux
1146AC_MSG_CHECKING(whether to enable selinux support)
71082be4
ZK
1147AC_ARG_ENABLE(selinux,
1148 AC_HELP_STRING([--disable-selinux], [disable selinux support]),
1149 SELINUX=$enableval)
d0191583
JM
1150AC_MSG_RESULT($SELINUX)
1151
80992638 1152################################################################################
8a2fc586 1153dnl -- Check for selinux
80992638 1154if test x$SELINUX = xyes; then
f8f6ec92
ZK
1155 AC_CHECK_LIB([sepol], [sepol_check_context], [
1156 AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
1157 SELINUX_LIBS="-lsepol"])
8a2fc586 1158
f8f6ec92
ZK
1159 AC_CHECK_LIB([selinux], [is_selinux_enabled], [
1160 AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
7dfce0e4 1161 AC_CHECK_HEADERS([selinux/label.h])
72b2cb61 1162 AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
e1b8a236 1163 SELINUX_LIBS="-lselinux $SELINUX_LIBS"
f7f0854e 1164 SELINUX_PC="libselinux"
f8f6ec92 1165 HAVE_SELINUX=yes ], [
ad6254c5 1166 AC_MSG_WARN(Disabling selinux)
f8f6ec92 1167 SELINUX_LIBS=
f7f0854e 1168 SELINUX_PC=
f8f6ec92 1169 HAVE_SELINUX=no ])
036f273a 1170fi
d68a82ec 1171
8b1a3214
AK
1172################################################################################
1173dnl -- Check for realtime clock support
1174if test x$REALTIME = xyes; then
8b1a3214 1175 AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no)
8b1a3214
AK
1176
1177 if test x$HAVE_REALTIME = xyes; then
1178 AC_DEFINE([HAVE_REALTIME], 1, [Define to 1 to include support for realtime clock.])
1179 LIBS="-lrt $LIBS"
1180 else
1181 AC_MSG_WARN(Disabling realtime clock)
1182 fi
1183fi
1184
80992638 1185################################################################################
8ce0cbda 1186dnl -- Check for getopt
d0191583 1187AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.]))
b896caa1 1188
80992638 1189################################################################################
8ce0cbda 1190dnl -- Check for readline (Shamelessly copied from parted 1.4.17)
ea7cfb00 1191if test x$READLINE != xno; then
539f4a77
ZK
1192 lvm_saved_libs=$LIBS
1193 AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib],
1194 READLINE_LIBS=$ac_cv_search_tgetent, [
1195 if test "$READLINE" = yes; then
1196 AC_MSG_ERROR(
1197[termcap could not be found which is required for the
1198--enable-readline option (which is enabled by default). Either disable readline
1199support with --disable-readline or download and install termcap from:
1200 ftp.gnu.org/gnu/termcap
1201Note: if you are using precompiled packages you will also need the development
1202 package as well (which may be called termcap-devel or something similar).
1203Note: (n)curses also seems to work as a substitute for termcap. This was
1204 not found either - but you could try installing that as well.])
1205 fi])
1206 dnl -- Old systems may need extra termcap dependency explicitly in LIBS
1207 AC_CHECK_LIB([readline], [readline], [
1208 AC_DEFINE([READLINE_SUPPORT], 1,
1209 [Define to 1 to include the LVM readline shell.])
1210 dnl -- Try only with -lreadline and check for different symbol
1211 LIBS=$lvm_saved_libs
1212 AC_CHECK_LIB([readline], [rl_line_buffer],
1213 [ READLINE_LIBS="-lreadline" ], [
1214 AC_MSG_RESULT([linking -lreadline with $READLINE_LIBS needed])
1215 READLINE_LIBS="-lreadline $READLINE_LIBS"
1216 ]) ], [
1217 READLINE_LIBS=
1218 if test "$READLINE" = yes; then
1219 AC_MSG_ERROR(
1220[GNU Readline could not be found which is required for the
795ca3e5
AK
1221--enable-readline option (which is enabled by default). Either disable readline
1222support with --disable-readline or download and install readline from:
1223 ftp.gnu.org/gnu/readline
1224Note: if you are using precompiled packages you will also need the development
539f4a77
ZK
1225package as well (which may be called readline-devel or something similar).])
1226 fi ])
1227 LIBS="$READLINE_LIBS $lvm_saved_libs"
1228 AC_CHECK_FUNCS([rl_completion_matches])
1229 LIBS=$lvm_saved_libs
795ca3e5
AK
1230fi
1231
80992638 1232################################################################################
8ce0cbda 1233dnl -- Internationalisation stuff
ad6254c5 1234AC_MSG_CHECKING(whether to enable internationalisation)
71082be4
ZK
1235AC_ARG_ENABLE(nls,
1236 AC_HELP_STRING([--enable-nls], [enable Native Language Support]),
1237 INTL=$enableval, INTL=no)
ad6254c5 1238AC_MSG_RESULT($INTL)
69792976
AK
1239
1240if test x$INTL = xyes; then
f6fc418d 1241# FIXME - Move this - can be device-mapper too
69792976
AK
1242 INTL_PACKAGE="lvm2"
1243 AC_PATH_PROG(MSGFMT, msgfmt)
1244 if [[ "x$MSGFMT" == x ]];
1245 then AC_MSG_ERROR(
1246 msgfmt not found in path $PATH
1247 )
69792976
AK
1248 fi;
1249
1250 AC_ARG_WITH(localedir,
71082be4
ZK
1251 AC_HELP_STRING([--with-localedir=DIR],
1252 [translation files in DIR
1253 [[PREFIX/share/locale]]]),
1254 LOCALEDIR=$withval, LOCALEDIR='${prefix}/share/locale')
69792976
AK
1255fi
1256
80992638 1257################################################################################
4a7f3eb2 1258AC_ARG_WITH(confdir,
71082be4
ZK
1259 AC_HELP_STRING([--with-confdir=DIR],
1260 [configuration files in DIR [[/etc]]]),
1261 CONFDIR=$withval, CONFDIR="/etc")
0a62c911
AK
1262
1263AC_ARG_WITH(staticdir,
71082be4
ZK
1264 AC_HELP_STRING([--with-staticdir=DIR],
1265 [static binaries in DIR [[EPREFIX/sbin]]]),
1266 STATICDIR=$withval, STATICDIR='${exec_prefix}/sbin')
0a62c911 1267
68f2de6d 1268AC_ARG_WITH(usrlibdir,
71082be4
ZK
1269 AC_HELP_STRING([--with-usrlibdir=DIR],
1270 [usrlib in DIR [[PREFIX/lib]]]),
1271 usrlibdir=$withval, usrlibdir='${prefix}/lib')
68f2de6d
AK
1272
1273AC_ARG_WITH(usrsbindir,
71082be4
ZK
1274 AC_HELP_STRING([--with-usrsbindir=DIR],
1275 [usrsbin executables in DIR [[PREFIX/sbin]]]),
1276 usrsbindir=$withval, usrsbindir='${prefix}/sbin')
68f2de6d 1277
5d518f1f
AK
1278################################################################################
1279AC_ARG_WITH(udev_prefix,
71082be4
ZK
1280 AC_HELP_STRING([--with-udev-prefix=UPREFIX],
1281 [install udev rule files in UPREFIX [[EPREFIX]]]),
1282 udev_prefix=$withval, udev_prefix='${exec_prefix}')
5d518f1f 1283
78ce7acc 1284AC_ARG_WITH(udevdir,
71082be4
ZK
1285 AC_HELP_STRING([--with-udevdir=DIR],
1286 [udev rules in DIR [[UPREFIX/lib/udev/rules.d]]]),
1287 udevdir=$withval, udevdir='${udev_prefix}/lib/udev/rules.d')
5d518f1f 1288
e587cb6a
PR
1289################################################################################
1290dnl -- Get the systemd system unit dir value from pkg_config automatically if value not given explicitly.
1291dnl -- This follows the recommendation for systemd integration best practices mentioned in daemon(7) manpage.
1292AC_ARG_WITH(systemdsystemunitdir,
1293 AC_HELP_STRING([--with-systemdsystemunitdir=DIR],
1294 [systemd service files in DIR]),
1295 systemdsystemunitdir=$withval,
767ce95a
ZK
1296 dnl -- init pkgconfig if required
1297 test x$PKGCONFIG_INIT != x1 && pkg_config_init
e587cb6a
PR
1298 pkg_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd))
1299
1300if test -n "$pkg_systemdsystemunitdir"; then
1301 systemdsystemunitdir=$pkg_systemdsystemunitdir;
1302fi
1303
1304if test -z "$systemdsystemunitdir"; then
1305 systemdsystemunitdir='/lib/systemd/system';
1306fi
ad6254c5 1307################################################################################
4417a8bd
PR
1308AC_ARG_WITH(tmpfilesdir,
1309 AC_HELP_STRING([--with-tmpfilesdir=DIR],
1310 [install configuration files for management of volatile files and directories in DIR [[SYSCONFDIR/tmpfiles.d]]]),
1311 tmpfilesdir=$withval, tmpfilesdir='${sysconfdir}/tmpfiles.d')
1312################################################################################
ad6254c5
AK
1313dnl -- Ensure additional headers required
1314if test x$READLINE = xyes; then
1315 AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out))
1316fi
1317
5c7fc7c4 1318if test x$CLVMD != xnone; then
ad6254c5
AK
1319 AC_CHECK_HEADERS(mntent.h netdb.h netinet/in.h pthread.h search.h sys/mount.h sys/socket.h sys/uio.h sys/un.h utmpx.h,,AC_MSG_ERROR(bailing out))
1320 AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,AC_MSG_ERROR(bailing out))
1321 AC_FUNC_GETMNTENT
ad6254c5
AK
1322 AC_FUNC_SELECT_ARGTYPES
1323fi
1324
ad6254c5
AK
1325if test x$CLUSTER != xnone; then
1326 AC_CHECK_HEADERS(sys/socket.h sys/un.h,,AC_MSG_ERROR(bailing out))
1327 AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out))
1328fi
1329
d911ec67
AK
1330if test x$DMEVENTD = xyes; then
1331 AC_CHECK_HEADERS(arpa/inet.h,,AC_MSG_ERROR(bailing out))
1332fi
1333
ad6254c5
AK
1334if test x$HAVE_LIBDL = xyes; then
1335 AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out))
1336fi
1337
1338if test x$INTL = xyes; then
1339 AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out))
1340fi
1341
5d518f1f
AK
1342if test x$UDEV_SYNC = xyes; then
1343 AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,AC_MSG_ERROR(bailing out))
1344fi
1345
a653923f
AK
1346################################################################################
1347AC_PATH_PROG(MODPROBE_CMD, modprobe)
1348
1349if test x$MODPROBE_CMD != x; then
72b2cb61 1350 AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.])
a653923f
AK
1351fi
1352
a9b601e2
ZK
1353
1354lvm_exec_prefix=$exec_prefix
1355test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$prefix
1356test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$ac_default_prefix
d2c11605
ZK
1357LVM_PATH="$lvm_exec_prefix/sbin/lvm"
1358AC_DEFINE_UNQUOTED(LVM_PATH, ["$LVM_PATH"], [Path to lvm binary.])
b5c2529b
ZK
1359
1360if test "$CLVMD" != none; then
1361 clvmd_prefix=$ac_default_prefix
d2c11605 1362 CLVMD_PATH="$clvmd_prefix/sbin/clvmd"
b5c2529b 1363 test "$prefix" != NONE && clvmd_prefix=$prefix
d2c11605 1364 AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$CLVMD_PATH"], [Path to clvmd binary.])
b5c2529b
ZK
1365fi
1366
80992638 1367################################################################################
f6fc418d 1368dnl -- dmeventd pidfile and executable path
f6fc418d
AK
1369if test "$BUILD_DMEVENTD" = yes; then
1370 AC_ARG_WITH(dmeventd-pidfile,
71082be4
ZK
1371 AC_HELP_STRING([--with-dmeventd-pidfile=PATH],
1372 [dmeventd pidfile [[/var/run/dmeventd.pid]]]),
1373 DMEVENTD_PIDFILE=$withval,
1374 DMEVENTD_PIDFILE="/var/run/dmeventd.pid")
1375 AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE, ["$DMEVENTD_PIDFILE"],
1376 [Path to dmeventd pidfile.])
f6fc418d
AK
1377fi
1378
f6fc418d 1379if test "$BUILD_DMEVENTD" = yes; then
f6fc418d 1380 AC_ARG_WITH(dmeventd-path,
71082be4
ZK
1381 AC_HELP_STRING([--with-dmeventd-path=PATH],
1382 [dmeventd path [[EPREFIX/sbin/dmeventd]]]),
1383 DMEVENTD_PATH=$withval,
1384 DMEVENTD_PATH="$lvm_exec_prefix/sbin/dmeventd")
1385 AC_DEFINE_UNQUOTED(DMEVENTD_PATH, ["$DMEVENTD_PATH"],
1386 [Path to dmeventd binary.])
f6fc418d
AK
1387fi
1388
8bae0a1e
AK
1389AH_TEMPLATE(DEFAULT_RUN_DIR, [Name of default run directory.])
1390AC_ARG_WITH(default-run-dir,
1391 [ --with-default-run-dir=DIR Default run directory [[/var/run/lvm]] ],
1392 [ DEFAULT_RUN_DIR="$withval" ],
1393 [ DEFAULT_RUN_DIR="/var/run/lvm" ])
1394AC_DEFINE_UNQUOTED(DEFAULT_RUN_DIR,["$DEFAULT_RUN_DIR"] )
1395
3399ae32
AK
1396################################################################################
1397dnl -- various defaults
3399ae32 1398AC_ARG_WITH(default-system-dir,
71082be4
ZK
1399 AC_HELP_STRING([--with-default-system-dir=DIR],
1400 [default LVM system directory [[/etc/lvm]]]),
1401 DEFAULT_SYS_DIR=$withval, DEFAULT_SYS_DIR="/etc/lvm")
1402AC_DEFINE_UNQUOTED(DEFAULT_SYS_DIR, ["$DEFAULT_SYS_DIR"],
1403 [Path to LVM system directory.])
3399ae32 1404
3399ae32 1405AC_ARG_WITH(default-archive-subdir,
71082be4
ZK
1406 AC_HELP_STRING([--with-default-archive-subdir=SUBDIR],
1407 [default metadata archive subdir [[archive]]]),
1408 DEFAULT_ARCHIVE_SUBDIR=$withval, DEFAULT_ARCHIVE_SUBDIR=archive)
1409AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE_SUBDIR, ["$DEFAULT_ARCHIVE_SUBDIR"],
1410 [Name of default metadata archive subdirectory.])
3399ae32 1411
3399ae32 1412AC_ARG_WITH(default-backup-subdir,
71082be4
ZK
1413 AC_HELP_STRING([--with-default-backup-subdir=SUBDIR],
1414 [default metadata backup subdir [[backup]]]),
1415 DEFAULT_BACKUP_SUBDIR=$withval, DEFAULT_BACKUP_SUBDIR=backup)
1416AC_DEFINE_UNQUOTED(DEFAULT_BACKUP_SUBDIR, ["$DEFAULT_BACKUP_SUBDIR"],
1417 [Name of default metadata backup subdirectory.])
3399ae32 1418
3399ae32 1419AC_ARG_WITH(default-cache-subdir,
71082be4
ZK
1420 AC_HELP_STRING([--with-default-cache-subdir=SUBDIR],
1421 [default metadata cache subdir [[cache]]]),
1422 DEFAULT_CACHE_SUBDIR=$withval, DEFAULT_CACHE_SUBDIR=cache)
1423AC_DEFINE_UNQUOTED(DEFAULT_CACHE_SUBDIR, ["$DEFAULT_CACHE_SUBDIR"],
1424 [Name of default metadata cache subdirectory.])
3399ae32 1425
3399ae32 1426AC_ARG_WITH(default-locking-dir,
71082be4
ZK
1427 AC_HELP_STRING([--with-default-locking-dir=DIR],
1428 [default locking directory [[/var/lock/lvm]]]),
1429 DEFAULT_LOCK_DIR=$withval, DEFAULT_LOCK_DIR="/var/lock/lvm")
1430AC_DEFINE_UNQUOTED(DEFAULT_LOCK_DIR, ["$DEFAULT_LOCK_DIR"],
1431 [Name of default locking directory.])
3399ae32 1432
7063efe1
MS
1433################################################################################
1434dnl -- Setup default data alignment
1435AC_ARG_WITH(default-data-alignment,
1436 AC_HELP_STRING([--with-default-data-alignment=NUM],
1437 [set the default data alignment in MiB [[1]]]),
1438 DEFAULT_DATA_ALIGNMENT=$withval, DEFAULT_DATA_ALIGNMENT=1)
1439AC_DEFINE_UNQUOTED(DEFAULT_DATA_ALIGNMENT, [$DEFAULT_DATA_ALIGNMENT],
1440 [Default data alignment.])
1441
f6fc418d
AK
1442################################################################################
1443dnl -- which kernel interface to use (ioctl only)
1444AC_MSG_CHECKING(for kernel interface choice)
1445AC_ARG_WITH(interface,
71082be4
ZK
1446 AC_HELP_STRING([--with-interface=IFACE],
1447 [choose kernel interface (ioctl) [[ioctl]]]),
1448 interface=$withval, interface=ioctl)
f6fc418d
AK
1449if [[ "x$interface" != xioctl ]];
1450then
1451 AC_MSG_ERROR(--with-interface=ioctl required. fs no longer supported.)
1452fi
1453AC_MSG_RESULT($interface)
1454
1455################################################################################
db8b5af9 1456DM_LIB_VERSION="\"`cat "$srcdir"/VERSION_DM 2>/dev/null || echo Unknown`\""
f58b35b5
AK
1457AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version])
1458
db8b5af9 1459DM_LIB_PATCHLEVEL=`cat "$srcdir"/VERSION_DM | $AWK -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'`
597c3f8e 1460
db8b5af9 1461LVM_VERSION="\"`cat "$srcdir"/VERSION 2>/dev/null || echo Unknown`\""
fae0c576 1462
db8b5af9 1463VER=`cat "$srcdir"/VERSION`
bf456146 1464LVM_RELEASE_DATE="\"`echo $VER | $SED 's/.* (//;s/).*//'`\""
ec6a6fbe
AK
1465VER=`echo "$VER" | $AWK '{print $1}'`
1466LVM_RELEASE="\"`echo "$VER" | $AWK -F '-' '{print $2}'`\""
1467VER=`echo "$VER" | $AWK -F '-' '{print $1}'`
1468LVM_MAJOR=`echo "$VER" | $AWK -F '.' '{print $1}'`
1469LVM_MINOR=`echo "$VER" | $AWK -F '.' '{print $2}'`
bf456146
AK
1470LVM_PATCHLEVEL=`echo "$VER" | $AWK -F '[[(.]]' '{print $3}'`
1471LVM_LIBAPI=`echo "$VER" | $AWK -F '[[()]]' '{print $2}'`
ec6a6fbe 1472
80992638 1473################################################################################
572fefeb 1474AC_SUBST(APPLIB)
aaa2e046 1475AC_SUBST(AWK)
66fd4529 1476AC_SUBST(BUILD_CMIRRORD)
d0191583 1477AC_SUBST(BUILD_DMEVENTD)
615534d3 1478AC_SUBST(BUILD_LVMETAD)
b896caa1 1479AC_SUBST(CFLAGS)
d0191583 1480AC_SUBST(CFLOW_CMD)
8106cdd5 1481AC_SUBST(CLDFLAGS)
8106cdd5 1482AC_SUBST(CLDNOWHOLEARCHIVE)
d0191583
JM
1483AC_SUBST(CLDWHOLEARCHIVE)
1484AC_SUBST(CLUSTER)
1485AC_SUBST(CLVMD)
34b6075d 1486AC_SUBST(CLVMD_CMANAGERS)
d2c11605 1487AC_SUBST(CLVMD_PATH)
a946372e
AK
1488AC_SUBST(CMAN_CFLAGS)
1489AC_SUBST(CMAN_LIBS)
b6d7a484
AK
1490AC_SUBST(CMAP_CFLAGS)
1491AC_SUBST(CMAP_LIBS)
d0191583 1492AC_SUBST(CMDLIB)
edf47283
AK
1493AC_SUBST(CONFDB_CFLAGS)
1494AC_SUBST(CONFDB_LIBS)
1495AC_SUBST(CONFDIR)
d0191583 1496AC_SUBST(COPTIMISE_FLAG)
edf47283
AK
1497AC_SUBST(CPG_CFLAGS)
1498AC_SUBST(CPG_LIBS)
d0191583 1499AC_SUBST(CSCOPE_CMD)
8ef2b021 1500AC_SUBST(DEBUG)
3399ae32
AK
1501AC_SUBST(DEFAULT_SYS_DIR)
1502AC_SUBST(DEFAULT_ARCHIVE_SUBDIR)
1503AC_SUBST(DEFAULT_BACKUP_SUBDIR)
1504AC_SUBST(DEFAULT_CACHE_SUBDIR)
7063efe1 1505AC_SUBST(DEFAULT_DATA_ALIGNMENT)
3399ae32 1506AC_SUBST(DEFAULT_LOCK_DIR)
b1f08e51 1507AC_SUBST(DEFAULT_RUN_DIR)
199e490e 1508AC_SUBST(DEVMAPPER)
a946372e
AK
1509AC_SUBST(DLM_CFLAGS)
1510AC_SUBST(DLM_LIBS)
19a2c6e0 1511AC_SUBST(DL_LIBS)
d0191583 1512AC_SUBST(DMEVENTD)
d1e8046f 1513AC_SUBST(DMEVENTD_PATH)
d0191583
JM
1514AC_SUBST(DM_COMPAT)
1515AC_SUBST(DM_DEVICE_GID)
1516AC_SUBST(DM_DEVICE_MODE)
1517AC_SUBST(DM_DEVICE_UID)
1518AC_SUBST(DM_IOCTLS)
1519AC_SUBST(DM_LIB_VERSION)
597c3f8e 1520AC_SUBST(DM_LIB_PATCHLEVEL)
bf09a320 1521AC_SUBST(ELDFLAGS)
d0191583 1522AC_SUBST(FSADM)
26e7f2e0 1523AC_SUBST(HAVE_LIBDL)
8b1a3214 1524AC_SUBST(HAVE_REALTIME)
d0191583
JM
1525AC_SUBST(INTL)
1526AC_SUBST(INTL_PACKAGE)
1527AC_SUBST(JOBS)
1528AC_SUBST(LDDEPS)
1529AC_SUBST(LIBS)
1530AC_SUBST(LIB_SUFFIX)
69792976 1531AC_SUBST(LOCALEDIR)
d0191583
JM
1532AC_SUBST(LVM1)
1533AC_SUBST(LVM1_FALLBACK)
d0191583 1534AC_SUBST(LVM_VERSION)
bf456146 1535AC_SUBST(LVM_LIBAPI)
ec6a6fbe
AK
1536AC_SUBST(LVM_MAJOR)
1537AC_SUBST(LVM_MINOR)
1538AC_SUBST(LVM_PATCHLEVEL)
d2c11605 1539AC_SUBST(LVM_PATH)
ec6a6fbe
AK
1540AC_SUBST(LVM_RELEASE)
1541AC_SUBST(LVM_RELEASE_DATE)
d0191583 1542AC_SUBST(MIRRORS)
cac52ca4 1543AC_SUBST(MSGFMT)
e40d44be 1544AC_SUBST(OCF)
349da06c 1545AC_SUBST(OCFDIR)
d0191583
JM
1546AC_SUBST(PKGCONFIG)
1547AC_SUBST(POOL)
f30875db 1548AC_SUBST(PTHREAD_LIBS)
edf47283
AK
1549AC_SUBST(QUORUM_CFLAGS)
1550AC_SUBST(QUORUM_LIBS)
cac52ca4 1551AC_SUBST(RAID)
539f4a77 1552AC_SUBST(READLINE_LIBS)
cac52ca4 1553AC_SUBST(REPLICATORS)
90c80887
AK
1554AC_SUBST(SACKPT_CFLAGS)
1555AC_SUBST(SACKPT_LIBS)
a946372e
AK
1556AC_SUBST(SALCK_CFLAGS)
1557AC_SUBST(SALCK_LIBS)
e1b8a236 1558AC_SUBST(SELINUX_LIBS)
f7f0854e 1559AC_SUBST(SELINUX_PC)
d0191583 1560AC_SUBST(SNAPSHOTS)
0a62c911 1561AC_SUBST(STATICDIR)
d0191583 1562AC_SUBST(STATIC_LINK)
1033d120 1563AC_SUBST(TESTING)
3ba4a195 1564AC_SUBST(THIN)
f61cacad 1565AC_SUBST(THIN_CHECK_CMD)
db724a44 1566AC_SUBST(UDEV_LIBS)
f7f0854e 1567AC_SUBST(UDEV_PC)
5d518f1f 1568AC_SUBST(UDEV_RULES)
4df024c4 1569AC_SUBST(UDEV_SYNC)
b559a1e6 1570AC_SUBST(UDEV_HAS_BUILTIN_BLKID)
5da88e5b
PR
1571AC_SUBST(CUNIT_LIBS)
1572AC_SUBST(CUNIT_CFLAGS)
23b059e7 1573AC_SUBST(WRITE_INSTALL)
395d204d 1574AC_SUBST(DMEVENTD_PIDFILE)
f6fc418d
AK
1575AC_SUBST(interface)
1576AC_SUBST(kerneldir)
1577AC_SUBST(missingkernel)
1578AC_SUBST(kernelvsn)
1579AC_SUBST(tmpdir)
5d518f1f
AK
1580AC_SUBST(udev_prefix)
1581AC_SUBST(udevdir)
e587cb6a 1582AC_SUBST(systemdsystemunitdir)
4417a8bd 1583AC_SUBST(tmpfilesdir)
68f2de6d
AK
1584AC_SUBST(usrlibdir)
1585AC_SUBST(usrsbindir)
8106cdd5 1586
80992638 1587################################################################################
d3a356b4 1588dnl -- First and last lines should not contain files to generate in order to
8ce0cbda 1589dnl -- keep utility scripts running properly
d3a356b4
JM
1590AC_CONFIG_FILES([
1591Makefile
1592make.tmpl
1593daemons/Makefile
1594daemons/clvmd/Makefile
5d311afb 1595daemons/cmirrord/Makefile
f6fc418d
AK
1596daemons/dmeventd/Makefile
1597daemons/dmeventd/libdevmapper-event.pc
b7edb5bf 1598daemons/dmeventd/plugins/Makefile
d3d98fdc 1599daemons/dmeventd/plugins/lvm2/Makefile
3041b72f 1600daemons/dmeventd/plugins/raid/Makefile
f6fc418d
AK
1601daemons/dmeventd/plugins/mirror/Makefile
1602daemons/dmeventd/plugins/snapshot/Makefile
2bc1d759 1603daemons/dmeventd/plugins/thin/Makefile
615534d3 1604daemons/lvmetad/Makefile
d3a356b4 1605doc/Makefile
da05c479 1606doc/example.conf
db8b5af9 1607include/.symlinks
f6fc418d
AK
1608include/Makefile
1609lib/Makefile
d3a356b4
JM
1610lib/format1/Makefile
1611lib/format_pool/Makefile
1612lib/locking/Makefile
1613lib/mirror/Makefile
8fea97b7 1614lib/replicator/Makefile
ec6a6fbe 1615lib/misc/lvm-version.h
40dbaac8 1616lib/raid/Makefile
d3a356b4 1617lib/snapshot/Makefile
3ba4a195 1618lib/thin/Makefile
832a1e73
AK
1619libdaemon/Makefile
1620libdaemon/client/Makefile
1621libdaemon/server/Makefile
f6fc418d
AK
1622libdm/Makefile
1623libdm/libdevmapper.pc
e0c64c6c 1624liblvm/Makefile
70046623 1625liblvm/liblvm2app.pc
f6fc418d
AK
1626man/Makefile
1627po/Makefile
2de38033 1628scripts/clvmd_init_red_hat
81410c8f 1629scripts/cmirrord_init_red_hat
a30491b2 1630scripts/lvm2_lvmetad_init_red_hat
dac3c36f 1631scripts/lvm2_lvmetad_systemd_red_hat.socket
da532741 1632scripts/lvm2_lvmetad_systemd_red_hat.service
595eaf92 1633scripts/lvm2_monitoring_init_red_hat
395d204d
PR
1634scripts/dm_event_systemd_red_hat.service
1635scripts/lvm2_monitoring_systemd_red_hat.service
4417a8bd 1636scripts/lvm2_tmpfiles_red_hat.conf
d3a356b4 1637scripts/Makefile
f6fc418d 1638test/Makefile
c7e363f9 1639test/api/Makefile
d4fed285 1640test/unit/Makefile
d3a356b4 1641tools/Makefile
5d518f1f 1642udev/Makefile
66392e66 1643unit-tests/datastruct/Makefile
15106c50 1644unit-tests/regex/Makefile
52e1564f 1645unit-tests/mm/Makefile
6bbbcf42 1646verity/Makefile
7a197a62
AK
1647])
1648AC_OUTPUT
2dc95e1c
AK
1649
1650if test x$ODIRECT != xyes; then
ad6254c5 1651 AC_MSG_WARN(Warning: O_DIRECT disabled: low-memory pvmove may lock up)
2dc95e1c 1652fi
This page took 0.292417 seconds and 5 git commands to generate.