1 ###############################################################################
2 ## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved.
3 ## Copyright (C) 2004-2012 Red Hat, Inc. All rights reserved.
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.
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
12 ################################################################################
15 ################################################################################
16 dnl -- Process this file with autoconf to produce a configure script.
18 AC_CONFIG_SRCDIR([lib/device/dev-cache.h])
19 AC_CONFIG_HEADERS([lib/misc/configure.h])
21 ################################################################################
22 dnl -- Setup the directory where autoconf has auxilary files
23 AC_CONFIG_AUX_DIR(autoconf)
25 ################################################################################
26 dnl -- Get system type
27 AC_CANONICAL_TARGET([])
33 CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
34 ELDFLAGS="-Wl,--export-dynamic"
35 # FIXME Generate list and use --dynamic-list=.dlopen.sym
36 CLDWHOLEARCHIVE="-Wl,-whole-archive"
37 CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
38 LDDEPS="$LDDEPS .export.sym"
49 CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
53 CLDWHOLEARCHIVE="-all_load"
65 ################################################################################
66 dnl -- Checks for programs.
71 dnl probably no longer needed in 2008, but...
72 AC_PROG_GCC_TRADITIONAL
78 AC_PATH_PROG(CFLOW_CMD, cflow)
79 AC_PATH_PROG(CSCOPE_CMD, cscope)
81 ################################################################################
82 dnl -- Check for header files.
89 AC_CHECK_HEADERS([locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \
90 langinfo.h libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h \
92 [AC_MSG_ERROR(bailing out)])
96 AC_CHECK_HEADERS(asm/byteorder.h linux/fs.h malloc.h,,AC_MSG_ERROR(bailing out)) ;;
98 AC_CHECK_HEADERS(machine/endian.h sys/disk.h,,AC_MSG_ERROR(bailing out)) ;;
101 AC_CHECK_HEADERS([ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h \
102 stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h \
103 sys/types.h unistd.h], , [AC_MSG_ERROR(bailing out)])
104 AC_CHECK_HEADERS(termios.h sys/statvfs.h)
106 ################################################################################
107 dnl -- Check for typedefs, structures, and compiler characteristics.
110 AC_CHECK_MEMBERS([struct stat.st_rdev])
126 AC_CHECK_MEMBERS([struct stat.st_rdev])
129 ################################################################################
130 dnl -- Check for functions
131 AC_CHECK_FUNCS([ftruncate gethostname getpagesize \
132 gettimeofday memset mkdir mkfifo rmdir munmap nl_langinfo setenv setlocale \
133 strcasecmp strchr strcspn strspn strdup strncasecmp strerror strrchr \
134 strstr strtol strtoul uname], , [AC_MSG_ERROR(bailing out)])
135 AC_CHECK_FUNCS(siginterrupt)
137 AC_FUNC_CLOSEDIR_VOID
149 ################################################################################
150 dnl -- Enables statically-linked tools
151 AC_MSG_CHECKING(whether to use static linking)
152 AC_ARG_ENABLE(static_link,
153 AC_HELP_STRING([--enable-static_link],
154 [use this to link the tools to their libraries
155 statically (default is dynamic linking]),
156 STATIC_LINK=$enableval, STATIC_LINK=no)
157 AC_MSG_RESULT($STATIC_LINK)
159 ################################################################################
160 dnl -- Prefix is /usr by default, the exec_prefix default is setup later
161 AC_PREFIX_DEFAULT(/usr)
163 ################################################################################
164 dnl -- Setup the ownership of the files
165 AC_MSG_CHECKING(file owner)
167 AC_HELP_STRING([--with-user=USER],
168 [set the owner of installed files [[USER=]]]),
170 AC_MSG_RESULT($OWNER)
172 if test x$OWNER != x; then
173 INSTALL="$INSTALL -o $OWNER"
176 ################################################################################
177 dnl -- Setup the group ownership of the files
178 AC_MSG_CHECKING(group owner)
180 AC_HELP_STRING([--with-group=GROUP],
181 [set the group owner of installed files [[GROUP=]]]),
183 AC_MSG_RESULT($GROUP)
185 if test x$GROUP != x; then
186 INSTALL="$INSTALL -g $GROUP"
189 ################################################################################
190 dnl -- Setup device node ownership
191 AC_MSG_CHECKING(device node uid)
193 AC_ARG_WITH(device-uid,
194 AC_HELP_STRING([--with-device-uid=UID],
195 [set the owner used for new device nodes [[UID=0]]]),
196 DM_DEVICE_UID=$withval, DM_DEVICE_UID=0)
197 AC_MSG_RESULT($DM_DEVICE_UID)
199 ################################################################################
200 dnl -- Setup device group ownership
201 AC_MSG_CHECKING(device node gid)
203 AC_ARG_WITH(device-gid,
204 AC_HELP_STRING([--with-device-gid=GID],
205 [set the group used for new device nodes [[GID=0]]]),
206 DM_DEVICE_GID=$withval, DM_DEVICE_GID=0)
207 AC_MSG_RESULT($DM_DEVICE_GID)
209 ################################################################################
210 dnl -- Setup device mode
211 AC_MSG_CHECKING(device node mode)
213 AC_ARG_WITH(device-mode,
214 AC_HELP_STRING([--with-device-mode=MODE],
215 [set the mode used for new device nodes [[MODE=0600]]]),
216 DM_DEVICE_MODE=$withval, DM_DEVICE_MODE=0600)
217 AC_MSG_RESULT($DM_DEVICE_MODE)
219 AC_MSG_CHECKING(when to create device nodes)
220 AC_ARG_WITH(device-nodes-on,
221 AC_HELP_STRING([--with-device-nodes-on=ON],
222 [create nodes on resume or create [[ON=resume]]]),
223 ADD_NODE=$withval, ADD_NODE=resume)
225 resume) add_on=DM_ADD_NODE_ON_RESUME;;
226 create) add_on=DM_ADD_NODE_ON_CREATE;;
227 *) AC_MSG_ERROR([--with-device-nodes-on parameter invalid]);;
229 AC_MSG_RESULT(on $ADD_NODE)
230 AC_DEFINE_UNQUOTED([DEFAULT_DM_ADD_NODE], $add_on, [Define default node creation behavior with dmsetup create])
232 AC_MSG_CHECKING(default name mangling)
233 AC_ARG_WITH(default-name-mangling,
234 AC_HELP_STRING([--with-default-name-mangling=MANGLING],
235 [default name mangling: auto/none/hex [[MANGLING=auto]]]),
236 MANGLING=$withval, MANGLING=auto)
238 auto) mangling=DM_STRING_MANGLING_AUTO;;
239 disabled) mangling=DM_STRING_MANGLING_NONE;;
240 hex) mangling=DM_STRING_MANGLING_HEX;;
241 *) AC_MSG_ERROR([--with-default-name-mangling parameter invalid]);;
243 AC_MSG_RESULT($MANGLING)
244 AC_DEFINE_UNQUOTED([DEFAULT_DM_NAME_MANGLING], $mangling, [Define default name mangling behaviour])
246 ################################################################################
247 dnl -- LVM1 tool fallback option
248 AC_MSG_CHECKING(whether to enable lvm1 fallback)
249 AC_ARG_ENABLE(lvm1_fallback,
250 AC_HELP_STRING([--enable-lvm1_fallback],
251 [use this to fall back and use LVM1 binaries if
252 device-mapper is missing from the kernel]),
253 LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no)
254 AC_MSG_RESULT($LVM1_FALLBACK)
256 if test x$LVM1_FALLBACK = xyes; then
257 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])
260 ################################################################################
261 dnl -- format1 inclusion type
262 AC_MSG_CHECKING(whether to include support for lvm1 metadata)
264 AC_HELP_STRING([--with-lvm1=TYPE],
265 [LVM1 metadata support: internal/shared/none
267 LVM1=$withval, LVM1=internal)
270 if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]];
272 --with-lvm1 parameter invalid
276 if test x$LVM1 = xinternal; then
277 AC_DEFINE([LVM1_INTERNAL], 1, [Define to 1 to include built-in support for LVM1 metadata.])
280 ################################################################################
281 dnl -- format_pool inclusion type
282 AC_MSG_CHECKING(whether to include support for GFS pool metadata)
284 AC_HELP_STRING([--with-pool=TYPE],
285 [GFS pool read-only support: internal/shared/none
287 POOL=$withval, POOL=internal)
290 if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]];
292 --with-pool parameter invalid
296 if test x$POOL = xinternal; then
297 AC_DEFINE([POOL_INTERNAL], 1, [Define to 1 to include built-in support for GFS pool metadata.])
300 ################################################################################
301 dnl -- cluster_locking inclusion type
302 AC_MSG_CHECKING(whether to include support for cluster locking)
304 AC_HELP_STRING([--with-cluster=TYPE],
305 [cluster LVM locking support: internal/shared/none
308 AC_MSG_RESULT($CLUSTER)
310 if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]];
312 --with-cluster parameter invalid
316 if test x$CLUSTER = xinternal; then
317 AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1, [Define to 1 to include built-in support for clustered LVM locking.])
320 ################################################################################
321 dnl -- snapshots inclusion type
322 AC_MSG_CHECKING(whether to include snapshots)
323 AC_ARG_WITH(snapshots,
324 AC_HELP_STRING([--with-snapshots=TYPE],
325 [snapshot support: internal/shared/none
327 SNAPSHOTS=$withval, SNAPSHOTS=internal)
328 AC_MSG_RESULT($SNAPSHOTS)
330 if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]];
332 --with-snapshots parameter invalid
336 if test x$SNAPSHOTS = xinternal; then
337 AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.])
340 ################################################################################
341 dnl -- mirrors inclusion type
342 AC_MSG_CHECKING(whether to include mirrors)
344 AC_HELP_STRING([--with-mirrors=TYPE],
345 [mirror support: internal/shared/none
347 MIRRORS=$withval, MIRRORS=internal)
348 AC_MSG_RESULT($MIRRORS)
350 if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]];
352 --with-mirrors parameter invalid
356 if test x$MIRRORS = xinternal; then
357 AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.])
360 ################################################################################
361 dnl -- raid inclusion type
362 AC_MSG_CHECKING(whether to include raid)
364 AC_HELP_STRING([--with-raid=TYPE],
365 [mirror support: internal/shared/none
367 RAID=$withval, RAID=internal)
370 if [[ "x$RAID" != xnone -a "x$RAID" != xinternal -a "x$RAID" != xshared ]];
372 --with-raid parameter invalid
376 if test x$RAID = xinternal; then
377 AC_DEFINE([RAID_INTERNAL], 1, [Define to 1 to include built-in support for raid.])
380 ################################################################################
381 dnl -- asynchronous volume replicator inclusion type
382 AC_MSG_CHECKING(whether to include replicators)
383 AC_ARG_WITH(replicators,
384 AC_HELP_STRING([--with-replicators=TYPE],
385 [replicator support: internal/shared/none
387 REPLICATORS=$withval, REPLICATORS=none)
388 AC_MSG_RESULT($REPLICATORS)
390 case "$REPLICATORS" in
392 internal) AC_DEFINE([REPLICATOR_INTERNAL], 1,
393 [Define to 1 to include built-in support for replicators.]) ;;
394 *) AC_MSG_ERROR([--with-replicators parameter invalid ($REPLICATORS)]) ;;
397 ################################################################################
398 dnl -- thin provisioning
399 AC_MSG_CHECKING(whether to include thin provisioning)
401 AC_HELP_STRING([--with-thin=TYPE],
402 [thin provisioning support: internal/shared/none
404 THIN=$withval, THIN=none)
409 internal) AC_DEFINE([THIN_INTERNAL], 1,
410 [Define to 1 to include built-in support for thin provisioning.]) ;;
411 *) AC_MSG_ERROR([--with-thin parameter invalid ($THIN)]) ;;
416 AC_ARG_WITH(thin-check,
417 AC_HELP_STRING([--with-thin-check=PATH],
418 [thin_check tool: [[autodetect]]]),
419 THIN_CHECK_CMD=$withval, THIN_CHECK_CMD="autodetect")
420 # Empty means a config way to ignore thin checking
421 if test "$THIN_CHECK_CMD" = "autodetect"; then
422 AC_PATH_PROG(THIN_CHECK_CMD, thin_check)
423 test -z "$THIN_CHECK_CMD" && AC_MSG_ERROR(thin_check not found in path $PATH)
428 AC_DEFINE_UNQUOTED([THIN_CHECK_CMD], ["$THIN_CHECK_CMD"],
429 [The path to 'thin_check', if available.])
432 ################################################################################
433 dnl -- Disable readline
434 AC_MSG_CHECKING(whether to enable readline)
435 AC_ARG_ENABLE([readline],
436 AC_HELP_STRING([--disable-readline], [disable readline support]),
437 READLINE=$enableval, READLINE=maybe)
438 AC_MSG_RESULT($READLINE)
440 ################################################################################
441 dnl -- Disable realtime clock support
442 AC_MSG_CHECKING(whether to enable realtime support)
443 AC_ARG_ENABLE(realtime,
444 AC_HELP_STRING([--enable-realtime], [enable realtime clock support]),
446 AC_MSG_RESULT($REALTIME)
448 ################################################################################
449 dnl -- disable OCF resource agents
450 AC_MSG_CHECKING(whether to enable OCF resource agents)
452 AC_HELP_STRING([--enable-ocf],
453 [enable Open Cluster Framework (OCF) compliant resource agents]),
454 OCF=$enableval, OCF=no)
457 AC_HELP_STRING([--with-ocfdir=DIR],
458 [install OCF files in DIR [[PREFIX/lib/ocf/resource.d/lvm2]]]),
459 OCFDIR=$withval, OCFDIR='${prefix}/lib/ocf/resource.d/lvm2')
461 ################################################################################
462 dnl -- Init pkg-config with dummy invokation:
463 dnl -- this is required because PKG_CHECK_MODULES macro is expanded
464 dnl -- to initialize the pkg-config environment only at the first invokation,
465 dnl -- that would be conditional in this configure.in.
467 PKG_CHECK_MODULES(PKGCONFIGINIT, pkgconfiginit, [],
468 [AC_MSG_RESULT([pkg-config initialized])])
472 ################################################################################
473 dnl -- Build cluster LVM daemon
474 AC_MSG_CHECKING(whether to build cluster LVM daemon)
476 [ --with-clvmd=TYPE build cluster LVM Daemon
477 The following cluster manager combinations are valid:
478 * cman (RHEL5 or equivalent)
479 * cman,corosync,openais (or selection of them)
480 * singlenode (localhost only)
482 * none (disable build)
484 CLVMD=$withval, CLVMD=none)
485 if test x$CLVMD = xyes; then
488 AC_MSG_RESULT($CLVMD)
490 dnl -- If clvmd enabled without cluster locking, automagically include it
491 if test x$CLVMD != xnone && test x$CLUSTER = xnone; then
495 dnl -- init pkgconfig if required
496 if test x$CLVMD != xnone && test x$PKGCONFIG_INIT != x1; then
500 dnl -- Express clvmd init script Required-Start / Required-Stop
502 dnl -- On RHEL4/RHEL5, qdiskd is started from a separate init script.
503 dnl -- Enable if we are build for cman.
504 CLVMD_NEEDS_QDISKD=no
506 dnl -- define build types
507 if [[ `expr x"$CLVMD" : '.*gulm.*'` != 0 ]]; then
508 AC_MSG_ERROR([Since version 2.02.87 GULM locking is no longer supported.]);
510 if [[ `expr x"$CLVMD" : '.*cman.*'` != 0 ]]; then
512 CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman"
513 CLVMD_NEEDS_QDISKD=yes
515 if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
517 CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync"
519 if [[ `expr x"$CLVMD" : '.*openais.*'` != 0 ]]; then
521 CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais"
523 if test x$CLVMD_NEEDS_QDISKD != xno; then
524 CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd"
527 dnl -- define a soft bailout if we are autodetecting
533 AC_MSG_ERROR([bailing out])
536 dnl -- if clvmd=all then set soft_bailout (we don't want to error)
537 dnl -- and set all builds to yes. We need to do this here
538 dnl -- to skip the openais|corosync sanity check above.
539 if test x$CLVMD = xall; then
548 dnl -- helper macro to check libs without adding them to LIBS
549 check_lib_no_libs() {
555 AC_CHECK_LIB([$lib_no_libs_arg1],
556 [$lib_no_libs_arg2],,
559 LIBS=$ac_check_lib_save_LIBS
562 dnl -- Look for cman libraries if required.
563 if test x$BUILDCMAN = xyes; then
564 PKG_CHECK_MODULES(CMAN, libcman, [HAVE_CMAN=yes],
566 AC_CHECK_HEADERS(libcman.h,,$bailout)
567 check_lib_no_libs cman cman_init
568 if test $NOTFOUND = 0; then
569 AC_MSG_RESULT([no pkg for libcman, using -lcman])
577 dnl -- Look for corosync that's required also for openais build
578 dnl -- only enough recent version of corosync ship pkg-config files.
579 dnl -- We can safely rely on that to detect the correct bits.
580 if test x$BUILDCOROSYNC = xyes || \
581 test x$BUILDOPENAIS = xyes; then
582 PKG_CHECK_MODULES(COROSYNC, corosync, [HAVE_COROSYNC=yes], $bailout)
587 dnl -- Look for corosync libraries if required.
588 if test x$BUILDCOROSYNC = xyes; then
589 PKG_CHECK_MODULES(QUORUM, libquorum, [HAVE_QUORUM=yes], $bailout)
594 dnl -- Look for openais libraries if required.
595 if test x$BUILDOPENAIS = xyes; then
596 PKG_CHECK_MODULES(SALCK, libSaLck, [HAVE_SALCK=yes], $bailout)
600 dnl -- Below are checks for libraries common to more than one build.
602 dnl -- Check confdb library.
603 dnl -- mandatory for corosync < 2.0 build.
604 dnl -- optional for openais/cman build.
606 if test x$CHECKCONFDB = xyes; then
607 PKG_CHECK_MODULES(CONFDB, libconfdb,
611 AC_CHECK_HEADERS(corosync/confdb.h,
615 if test x$HAVE_CONFDB != xyes && \
616 test x$HAVE_CONFDB_H = xyes; then
617 check_lib_no_libs confdb confdb_initialize
618 AC_MSG_RESULT([no pkg for confdb, using -lconfdb])
619 CONFDB_LIBS="-lconfdb"
624 dnl -- Check cmap library
625 dnl -- mandatory for corosync >= 2.0 build.
627 if test x$CHECKCMAP = xyes; then
628 PKG_CHECK_MODULES(CMAP, libcmap,
632 AC_CHECK_HEADERS(corosync/cmap.h,
636 if test x$HAVE_CMAP != xyes && \
637 test x$HAVE_CMAP_H = xyes; then
638 check_lib_no_libs cmap cmap_initialize
639 AC_MSG_RESULT([no pkg for cmap, using -lcmap])
645 if test x$BUILDCOROSYNC = xyes; then
646 if test x$HAVE_CMAP != xyes && \
647 test x$HAVE_CONFDB != xyes && \
648 test x$CLVMD != xall; then
649 AC_MSG_ERROR([bailing out... cmap (corosync >= 2.0) or confdb (corosync < 2.0) library is required])
653 dnl -- Check cpg library.
654 if test x$CHECKCPG = xyes; then
655 PKG_CHECK_MODULES(CPG, libcpg, [HAVE_CPG=yes], $bailout)
658 dnl -- Check dlm library.
659 if test x$CHECKDLM = xyes; then
660 PKG_CHECK_MODULES(DLM, libdlm, [HAVE_DLM=yes],
662 AC_CHECK_HEADERS(libdlm.h,,$bailout)
663 check_lib_no_libs dlm dlm_lock -lpthread
664 if test $NOTFOUND = 0; then
665 AC_MSG_RESULT([no pkg for libdlm, using -ldlm])
666 DLM_LIBS="-ldlm -lpthread"
671 dnl -- If we are autodetecting, we need to re-create
672 dnl -- the depedencies checks and set a proper CLVMD,
673 dnl -- together with init script Required-Start/Stop entries.
674 if test x$CLVMD = xall; then
677 CLVMD_NEEDS_QDISKD=no
678 if test x$HAVE_CMAN = xyes && \
679 test x$HAVE_DLM = xyes; then
680 AC_MSG_RESULT([Enabling clvmd cman cluster manager])
682 CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman"
683 CLVMD_NEEDS_QDISKD=yes
685 if test x$HAVE_COROSYNC = xyes && \
686 test x$HAVE_QUORUM = xyes && \
687 test x$HAVE_CPG = xyes && \
688 test x$HAVE_DLM = xyes; then
689 if test x$HAVE_CONFDB = xyes || test x$HAVE_CMAP = xyes; then
690 AC_MSG_RESULT([Enabling clvmd corosync cluster manager])
691 CLVMD="$CLVMD,corosync"
692 CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync"
695 if test x$HAVE_COROSYNC = xyes && \
696 test x$HAVE_CPG = xyes && \
697 test x$HAVE_SALCK = xyes; then
698 AC_MSG_RESULT([Enabling clvmd openais cluster manager])
699 CLVMD="$CLVMD,openais"
700 CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais"
702 if test x$CLVMD_NEEDS_QDISKD != xno; then
703 CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd"
705 if test x$CLVMD = xnone; then
706 AC_MSG_RESULT([Disabling clvmd build. No cluster manager detected.])
710 dnl -- Fixup CLVMD_CMANAGERS with new corosync
711 dnl -- clvmd built with corosync >= 2.0 needs dlm (either init or systemd service)
712 dnl -- to be started.
713 if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
714 if test x$HAVE_CMAP = xyes; then
715 CLVMD_CMANAGERS="$CLVMD_CMANAGERS dlm"
719 ################################################################################
721 if test "x$CLVMD" != xnone; then
722 AC_ARG_WITH(clvmd-pidfile,
723 AC_HELP_STRING([--with-clvmd-pidfile=PATH],
724 [clvmd pidfile [[/var/run/clvmd.pid]]]),
725 CLVMD_PIDFILE=$withval,
726 CLVMD_PIDFILE="/var/run/clvmd.pid")
727 AC_DEFINE_UNQUOTED(CLVMD_PIDFILE, ["$CLVMD_PIDFILE"],
728 [Path to clvmd pidfile.])
731 ################################################################################
732 dnl -- Build cluster mirror log daemon
733 AC_MSG_CHECKING(whether to build cluster mirror log daemon)
734 AC_ARG_ENABLE(cmirrord,
735 AC_HELP_STRING([--enable-cmirrord],
736 [enable the cluster mirror log daemon]),
737 CMIRRORD=$enableval, CMIRRORD=no)
738 AC_MSG_RESULT($CMIRRORD)
740 BUILD_CMIRRORD=$CMIRRORD
742 ################################################################################
743 dnl -- cmirrord pidfile
744 if test "x$BUILD_CMIRRORD" = xyes; then
745 AC_ARG_WITH(cmirrord-pidfile,
746 AC_HELP_STRING([--with-cmirrord-pidfile=PATH],
747 [cmirrord pidfile [[/var/run/cmirrord.pid]]]),
748 CMIRRORD_PIDFILE=$withval,
749 CMIRRORD_PIDFILE="/var/run/cmirrord.pid")
750 AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE, ["$CMIRRORD_PIDFILE"],
751 [Path to cmirrord pidfile.])
754 ################################################################################
755 dnl -- Look for corosync libraries if required.
756 if [[ "x$BUILD_CMIRRORD" = xyes ]]; then
757 dnl -- init pkgconfig if required
758 if test x$PKGCONFIG_INIT != x1; then
762 AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 1, [Define to 1 to include libSaCkpt.])
763 PKG_CHECK_MODULES(SACKPT, libSaCkpt, [HAVE_SACKPT=yes],
764 [AC_MSG_RESULT([no libSaCkpt, compiling without it])
765 AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 0, [Define to 0 to exclude libSaCkpt.])])
767 if test x$HAVE_CPG != xyes; then
768 PKG_CHECK_MODULES(CPG, libcpg)
772 ################################################################################
773 dnl -- Enable debugging
774 AC_MSG_CHECKING(whether to enable debugging)
775 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable debugging]),
776 DEBUG=$enableval, DEBUG=no)
777 AC_MSG_RESULT($DEBUG)
779 dnl -- Normally turn off optimisation for debug builds
780 if test x$DEBUG = xyes; then
786 ################################################################################
787 dnl -- Override optimisation
788 AC_MSG_CHECKING(for C optimisation flag)
789 AC_ARG_WITH(optimisation,
790 AC_HELP_STRING([--with-optimisation=OPT],
791 [C optimisation flag [[OPT=-O2]]]),
792 COPTIMISE_FLAG=$withval)
793 AC_MSG_RESULT($COPTIMISE_FLAG)
795 ################################################################################
796 dnl -- Enable profiling
797 AC_MSG_CHECKING(whether to gather gcov profiling data)
798 AC_ARG_ENABLE(profiling,
799 AC_HELP_STRING(--enable-profiling, [gather gcov profiling data]),
800 PROFILING=$enableval, PROFILING=no)
801 AC_MSG_RESULT($PROFILING)
803 if test "x$PROFILING" = xyes; then
804 COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage"
805 AC_PATH_PROG(LCOV, lcov)
806 AC_PATH_PROG(GENHTML, genhtml)
807 if test -z "$LCOV" -o -z "$GENHTML"; then
808 AC_MSG_ERROR([lcov and genhtml are required for profiling])
810 AC_PATH_PROG(GENPNG, genpng)
811 if test -n "$GENPNG"; then
812 AC_MSG_CHECKING([whether $GENPNG has all required modules])
813 if $GENPNG --help > /dev/null 2>&1 ; then
815 GENHTML="$GENHTML --frames"
817 AC_MSG_RESULT(not supported)
818 AC_MSG_WARN([GD.pm perl module is not installed])
824 ################################################################################
825 dnl -- Enable testing
826 AC_MSG_CHECKING(whether to enable unit testing)
827 AC_ARG_ENABLE(testing,
828 AC_HELP_STRING(--enable-testing, [enable testing targets in the makefile]),
829 TESTING=$enableval, TESTING=no)
830 AC_MSG_RESULT($TESTING)
832 if test "$TESTING" = yes; then
833 PKG_CHECK_MODULES(CUNIT, cunit >= 2.0)
836 ################################################################################
837 dnl -- Enable valgrind awareness of memory pools
838 AC_MSG_CHECKING(whether to enable valgrind awareness of pools)
839 AC_ARG_ENABLE(valgrind_pool,
840 AC_HELP_STRING(--enable-valgrind-pool, [enable valgrind awareness of pools]),
841 VALGRIND_POOL=$enableval, VALGRIND_POOL=no)
842 AC_MSG_RESULT($VALGRIND_POOL)
844 if test "$VALGRIND_POOL" = yes; then
845 AC_CHECK_HEADERS([valgrind/memcheck.h], , [AC_MSG_ERROR(bailing out)])
846 AC_DEFINE([VALGRIND_POOL], 1, [Enable a valgrind aware build of pool])
849 ################################################################################
850 dnl -- Disable devmapper
851 AC_MSG_CHECKING(whether to use device-mapper)
852 AC_ARG_ENABLE(devmapper,
853 AC_HELP_STRING([--disable-devmapper],
854 [disable LVM2 device-mapper interaction]),
855 DEVMAPPER=$enableval)
856 AC_MSG_RESULT($DEVMAPPER)
858 if test x$DEVMAPPER = xyes; then
859 AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.])
862 ################################################################################
864 AC_MSG_CHECKING(whether to build LVMetaD)
865 AC_ARG_ENABLE(lvmetad,
866 AC_HELP_STRING([--enable-lvmetad],
867 [enable the LVM Metadata Daemon]),
869 AC_MSG_RESULT($LVMETAD)
871 BUILD_LVMETAD=$LVMETAD
873 if test x$BUILD_LVMETAD = xyes; then
874 AC_DEFINE([LVMETAD_SUPPORT], 1, [Define to 1 to include code that uses lvmetad.])
877 ################################################################################
878 dnl -- Enable udev synchronisation
879 AC_MSG_CHECKING(whether to enable synchronisation with udev processing)
880 AC_ARG_ENABLE(udev_sync,
881 AC_HELP_STRING([--enable-udev_sync],
882 [enable synchronisation with udev processing]),
883 UDEV_SYNC=$enableval, UDEV_SYNC=no)
884 AC_MSG_RESULT($UDEV_SYNC)
886 if test x$UDEV_SYNC = xyes; then
887 dnl -- init pkgconfig if required
888 if test x$PKGCONFIG_INIT != x1; then
891 PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
892 AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
895 dnl -- Enable udev rules
896 AC_MSG_CHECKING(whether to enable installation of udev rules required for synchronisation)
897 AC_ARG_ENABLE(udev_rules,
898 AC_HELP_STRING([--enable-udev_rules],
899 [install rule files needed for udev synchronisation]),
900 UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC)
901 AC_MSG_RESULT($UDEV_RULES)
903 if test x$UDEV_RULES = xyes; then
904 AC_MSG_CHECKING(whether udev supports builtin blkid)
905 udev_version=$(udevadm info --version 2>/dev/null)
906 if test -n "$udev_version" && test "$udev_version" -ge 176; then
907 UDEV_HAS_BUILTIN_BLKID=yes
909 UDEV_HAS_BUILTIN_BLKID=no
911 AC_MSG_RESULT($UDEV_HAS_BUILTIN_BLKID)
914 ################################################################################
915 dnl -- Compatibility mode
916 AC_ARG_ENABLE(compat,
917 AC_HELP_STRING([--enable-compat],
918 [enable support for old device-mapper versions]),
919 DM_COMPAT=$enableval, DM_COMPAT=no)
921 if test x$DM_COMPAT = xyes; then
923 [--enable-compat is not currently supported.
924 Since device-mapper version 1.02.66, only one version (4) of the device-mapper
925 ioctl protocol is supported.]
929 ################################################################################
930 dnl -- Compatible units suffix mode
931 AC_ARG_ENABLE(units-compat,
932 AC_HELP_STRING([--enable-units-compat],
933 [enable output compatibility with old versions that
934 that do not use KiB-style unit suffixes]),
935 UNITS_COMPAT=$enableval, UNITS_COMPAT=no)
937 if test x$UNITS_COMPAT = xyes; then
938 AC_DEFINE([DEFAULT_SI_UNIT_CONSISTENCY], 0, [Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes.])
941 ################################################################################
944 AC_HELP_STRING([--disable-driver],
945 [disable calls to device-mapper in the kernel]),
946 DM_IOCTLS=$enableval)
948 ################################################################################
949 dnl -- Disable O_DIRECT
950 AC_MSG_CHECKING(whether to enable O_DIRECT)
951 AC_ARG_ENABLE(o_direct,
952 AC_HELP_STRING([--disable-o_direct], [disable O_DIRECT]),
954 AC_MSG_RESULT($ODIRECT)
956 if test x$ODIRECT = xyes; then
957 AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.])
960 ################################################################################
961 dnl -- Enable liblvm2app.so
962 AC_MSG_CHECKING(whether to build liblvm2app.so application library)
963 AC_ARG_ENABLE(applib,
964 AC_HELP_STRING([--enable-applib], [build application library]),
965 APPLIB=$enableval, APPLIB=no)
966 AC_MSG_RESULT($APPLIB)
967 AC_SUBST([LVM2APP_LIB])
968 test x$APPLIB = xyes \
969 && LVM2APP_LIB=-llvm2app \
972 ################################################################################
974 AC_MSG_CHECKING(whether to compile liblvm2cmd.so)
975 AC_ARG_ENABLE(cmdlib,
976 AC_HELP_STRING([--enable-cmdlib], [build shared command library]),
977 CMDLIB=$enableval, CMDLIB=no)
978 AC_MSG_RESULT($CMDLIB)
979 AC_SUBST([LVM2CMD_LIB])
980 test x$CMDLIB = xyes \
981 && LVM2CMD_LIB=-llvm2cmd \
984 ################################################################################
985 dnl -- Enable pkg-config
986 AC_ARG_ENABLE(pkgconfig,
987 AC_HELP_STRING([--enable-pkgconfig], [install pkgconfig support]),
988 PKGCONFIG=$enableval, PKGCONFIG=no)
990 ################################################################################
991 dnl -- Enable installation of writable files by user
992 AC_ARG_ENABLE(write_install,
993 AC_HELP_STRING([--enable-write_install],
994 [install user writable files]),
995 WRITE_INSTALL=$enableval, WRITE_INSTALL=no)
997 ################################################################################
999 AC_MSG_CHECKING(whether to install fsadm)
1000 AC_ARG_ENABLE(fsadm, AC_HELP_STRING([--disable-fsadm], [disable fsadm]),
1002 AC_MSG_RESULT($FSADM)
1004 ################################################################################
1005 dnl -- enable dmeventd handling
1006 AC_MSG_CHECKING(whether to use dmeventd)
1007 AC_ARG_ENABLE(dmeventd, AC_HELP_STRING([--enable-dmeventd],
1008 [enable the device-mapper event daemon]),
1009 DMEVENTD=$enableval)
1010 AC_MSG_RESULT($DMEVENTD)
1012 BUILD_DMEVENTD=$DMEVENTD
1014 dnl -- dmeventd currently requires internal mirror support
1015 if test x$DMEVENTD = xyes; then
1016 if test x$MIRRORS != xinternal; then
1018 --enable-dmeventd currently requires --with-mirrors=internal
1021 if test x$CMDLIB = xno; then
1023 --enable-dmeventd requires --enable-cmdlib to be used as well
1028 if test x$DMEVENTD = xyes; then
1029 AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.])
1032 ################################################################################
1033 dnl -- getline included in recent libc
1035 AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1,
1036 [Define to 1 if getline is available.]))
1038 ################################################################################
1039 dnl -- canonicalize_file_name included in recent libc
1041 AC_CHECK_LIB(c, canonicalize_file_name,
1042 AC_DEFINE([HAVE_CANONICALIZE_FILE_NAME], 1,
1043 [Define to 1 if canonicalize_file_name is available.]))
1045 ################################################################################
1046 dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin
1047 if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
1048 then exec_prefix="";
1051 ################################################################################
1052 dnl -- Check for dlopen
1053 AC_CHECK_LIB(dl, dlopen, [
1054 AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.])
1060 ################################################################################
1061 dnl -- Check for shared/static conflicts
1062 if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \
1063 -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \
1064 -o "x$RAID" = xshared \
1065 \) -a "x$STATIC_LINK" = xyes ]];
1067 Features cannot be 'shared' when building statically
1071 ################################################################################
1072 if [[ "$DMEVENTD" = yes -o "$CLVMD" != none ]] ; then
1073 AC_CHECK_LIB([pthread], [pthread_mutex_lock],
1074 [PTHREAD_LIBS="-lpthread"], hard_bailout)
1077 ################################################################################
1078 dnl -- Disable selinux
1079 AC_MSG_CHECKING(whether to enable selinux support)
1080 AC_ARG_ENABLE(selinux,
1081 AC_HELP_STRING([--disable-selinux], [disable selinux support]),
1083 AC_MSG_RESULT($SELINUX)
1085 ################################################################################
1086 dnl -- Check for selinux
1087 if test x$SELINUX = xyes; then
1088 AC_CHECK_LIB([sepol], [sepol_check_context], [
1089 AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
1090 SELINUX_LIBS="-lsepol"])
1092 AC_CHECK_LIB([selinux], [is_selinux_enabled], [
1093 AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
1094 AC_CHECK_HEADERS([selinux/label.h])
1095 AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
1096 SELINUX_LIBS="-lselinux $SELINUX_LIBS"
1097 SELINUX_PC="libselinux"
1098 HAVE_SELINUX=yes ], [
1099 AC_MSG_WARN(Disabling selinux)
1105 ################################################################################
1106 dnl -- Check for realtime clock support
1107 if test x$REALTIME = xyes; then
1108 AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no)
1110 if test x$HAVE_REALTIME = xyes; then
1111 AC_DEFINE([HAVE_REALTIME], 1, [Define to 1 to include support for realtime clock.])
1114 AC_MSG_WARN(Disabling realtime clock)
1118 ################################################################################
1119 dnl -- Check for getopt
1120 AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.]))
1122 ################################################################################
1123 dnl -- Check for readline (Shamelessly copied from parted 1.4.17)
1124 if test x$READLINE != xno; then
1125 lvm_saved_libs=$LIBS
1126 AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib],
1127 READLINE_LIBS=$ac_cv_search_tgetent, [
1128 if test "$READLINE" = yes; then
1130 [termcap could not be found which is required for the
1131 --enable-readline option (which is enabled by default). Either disable readline
1132 support with --disable-readline or download and install termcap from:
1133 ftp.gnu.org/gnu/termcap
1134 Note: if you are using precompiled packages you will also need the development
1135 package as well (which may be called termcap-devel or something similar).
1136 Note: (n)curses also seems to work as a substitute for termcap. This was
1137 not found either - but you could try installing that as well.])
1139 dnl -- Old systems may need extra termcap dependency explicitly in LIBS
1140 AC_CHECK_LIB([readline], [readline], [
1141 AC_DEFINE([READLINE_SUPPORT], 1,
1142 [Define to 1 to include the LVM readline shell.])
1143 dnl -- Try only with -lreadline and check for different symbol
1144 LIBS=$lvm_saved_libs
1145 AC_CHECK_LIB([readline], [rl_line_buffer],
1146 [ READLINE_LIBS="-lreadline" ], [
1147 AC_MSG_RESULT([linking -lreadline with $READLINE_LIBS needed])
1148 READLINE_LIBS="-lreadline $READLINE_LIBS"
1151 if test "$READLINE" = yes; then
1153 [GNU Readline could not be found which is required for the
1154 --enable-readline option (which is enabled by default). Either disable readline
1155 support with --disable-readline or download and install readline from:
1156 ftp.gnu.org/gnu/readline
1157 Note: if you are using precompiled packages you will also need the development
1158 package as well (which may be called readline-devel or something similar).])
1160 LIBS="$READLINE_LIBS $lvm_saved_libs"
1161 AC_CHECK_FUNCS([rl_completion_matches])
1162 LIBS=$lvm_saved_libs
1165 ################################################################################
1166 dnl -- Internationalisation stuff
1167 AC_MSG_CHECKING(whether to enable internationalisation)
1169 AC_HELP_STRING([--enable-nls], [enable Native Language Support]),
1170 INTL=$enableval, INTL=no)
1171 AC_MSG_RESULT($INTL)
1173 if test x$INTL = xyes; then
1174 # FIXME - Move this - can be device-mapper too
1176 AC_PATH_PROG(MSGFMT, msgfmt)
1177 if [[ "x$MSGFMT" == x ]];
1179 msgfmt not found in path $PATH
1183 AC_ARG_WITH(localedir,
1184 AC_HELP_STRING([--with-localedir=DIR],
1185 [translation files in DIR
1186 [[PREFIX/share/locale]]]),
1187 LOCALEDIR=$withval, LOCALEDIR='${prefix}/share/locale')
1190 ################################################################################
1191 AC_ARG_WITH(confdir,
1192 AC_HELP_STRING([--with-confdir=DIR],
1193 [configuration files in DIR [[/etc]]]),
1194 CONFDIR=$withval, CONFDIR="/etc")
1196 AC_ARG_WITH(staticdir,
1197 AC_HELP_STRING([--with-staticdir=DIR],
1198 [static binaries in DIR [[EPREFIX/sbin]]]),
1199 STATICDIR=$withval, STATICDIR='${exec_prefix}/sbin')
1201 AC_ARG_WITH(usrlibdir,
1202 AC_HELP_STRING([--with-usrlibdir=DIR],
1203 [usrlib in DIR [[PREFIX/lib]]]),
1204 usrlibdir=$withval, usrlibdir='${prefix}/lib')
1206 AC_ARG_WITH(usrsbindir,
1207 AC_HELP_STRING([--with-usrsbindir=DIR],
1208 [usrsbin executables in DIR [[PREFIX/sbin]]]),
1209 usrsbindir=$withval, usrsbindir='${prefix}/sbin')
1211 ################################################################################
1212 AC_ARG_WITH(udev_prefix,
1213 AC_HELP_STRING([--with-udev-prefix=UPREFIX],
1214 [install udev rule files in UPREFIX [[EPREFIX]]]),
1215 udev_prefix=$withval, udev_prefix='${exec_prefix}')
1217 AC_ARG_WITH(udevdir,
1218 AC_HELP_STRING([--with-udevdir=DIR],
1219 [udev rules in DIR [[UPREFIX/lib/udev/rules.d]]]),
1220 udevdir=$withval, udevdir='${udev_prefix}/lib/udev/rules.d')
1222 ################################################################################
1223 dnl -- Get the systemd system unit dir value from pkg_config automatically if value not given explicitly.
1224 dnl -- This follows the recommendation for systemd integration best practices mentioned in daemon(7) manpage.
1225 AC_ARG_WITH(systemdsystemunitdir,
1226 AC_HELP_STRING([--with-systemdsystemunitdir=DIR],
1227 [systemd service files in DIR]),
1228 systemdsystemunitdir=$withval,
1229 pkg_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd))
1231 if test -n "$pkg_systemdsystemunitdir"; then
1232 systemdsystemunitdir=$pkg_systemdsystemunitdir;
1235 if test -z "$systemdsystemunitdir"; then
1236 systemdsystemunitdir='/lib/systemd/system';
1238 ################################################################################
1239 AC_ARG_WITH(tmpfilesdir,
1240 AC_HELP_STRING([--with-tmpfilesdir=DIR],
1241 [install configuration files for management of volatile files and directories in DIR [[SYSCONFDIR/tmpfiles.d]]]),
1242 tmpfilesdir=$withval, tmpfilesdir='${sysconfdir}/tmpfiles.d')
1243 ################################################################################
1244 dnl -- Ensure additional headers required
1245 if test x$READLINE = xyes; then
1246 AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out))
1249 if test x$CLVMD != xnone; then
1250 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))
1251 AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,AC_MSG_ERROR(bailing out))
1253 AC_FUNC_SELECT_ARGTYPES
1256 if test x$CLUSTER != xnone; then
1257 AC_CHECK_HEADERS(sys/socket.h sys/un.h,,AC_MSG_ERROR(bailing out))
1258 AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out))
1261 if test x$DMEVENTD = xyes; then
1262 AC_CHECK_HEADERS(arpa/inet.h,,AC_MSG_ERROR(bailing out))
1265 if test x$HAVE_LIBDL = xyes; then
1266 AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out))
1269 if test x$INTL = xyes; then
1270 AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out))
1273 if test x$UDEV_SYNC = xyes; then
1274 AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,AC_MSG_ERROR(bailing out))
1277 ################################################################################
1278 AC_PATH_PROG(MODPROBE_CMD, modprobe)
1280 if test x$MODPROBE_CMD != x; then
1281 AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.])
1285 lvm_exec_prefix=$exec_prefix
1286 test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$prefix
1287 test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$ac_default_prefix
1288 LVM_PATH="$lvm_exec_prefix/sbin/lvm"
1289 AC_DEFINE_UNQUOTED(LVM_PATH, ["$LVM_PATH"], [Path to lvm binary.])
1291 if test "$CLVMD" != none; then
1292 clvmd_prefix=$ac_default_prefix
1293 CLVMD_PATH="$clvmd_prefix/sbin/clvmd"
1294 test "$prefix" != NONE && clvmd_prefix=$prefix
1295 AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$CLVMD_PATH"], [Path to clvmd binary.])
1298 ################################################################################
1299 dnl -- dmeventd pidfile and executable path
1300 if test "$BUILD_DMEVENTD" = yes; then
1301 AC_ARG_WITH(dmeventd-pidfile,
1302 AC_HELP_STRING([--with-dmeventd-pidfile=PATH],
1303 [dmeventd pidfile [[/var/run/dmeventd.pid]]]),
1304 DMEVENTD_PIDFILE=$withval,
1305 DMEVENTD_PIDFILE="/var/run/dmeventd.pid")
1306 AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE, ["$DMEVENTD_PIDFILE"],
1307 [Path to dmeventd pidfile.])
1310 if test "$BUILD_DMEVENTD" = yes; then
1311 AC_ARG_WITH(dmeventd-path,
1312 AC_HELP_STRING([--with-dmeventd-path=PATH],
1313 [dmeventd path [[EPREFIX/sbin/dmeventd]]]),
1314 DMEVENTD_PATH=$withval,
1315 DMEVENTD_PATH="$lvm_exec_prefix/sbin/dmeventd")
1316 AC_DEFINE_UNQUOTED(DMEVENTD_PATH, ["$DMEVENTD_PATH"],
1317 [Path to dmeventd binary.])
1320 AH_TEMPLATE(DEFAULT_RUN_DIR, [Name of default run directory.])
1321 AC_ARG_WITH(default-run-dir,
1322 [ --with-default-run-dir=DIR Default run directory [[/var/run/lvm]] ],
1323 [ DEFAULT_RUN_DIR="$withval" ],
1324 [ DEFAULT_RUN_DIR="/var/run/lvm" ])
1325 AC_DEFINE_UNQUOTED(DEFAULT_RUN_DIR,["$DEFAULT_RUN_DIR"] )
1327 ################################################################################
1328 dnl -- various defaults
1329 AC_ARG_WITH(default-system-dir,
1330 AC_HELP_STRING([--with-default-system-dir=DIR],
1331 [default LVM system directory [[/etc/lvm]]]),
1332 DEFAULT_SYS_DIR=$withval, DEFAULT_SYS_DIR="/etc/lvm")
1333 AC_DEFINE_UNQUOTED(DEFAULT_SYS_DIR, ["$DEFAULT_SYS_DIR"],
1334 [Path to LVM system directory.])
1336 AC_ARG_WITH(default-archive-subdir,
1337 AC_HELP_STRING([--with-default-archive-subdir=SUBDIR],
1338 [default metadata archive subdir [[archive]]]),
1339 DEFAULT_ARCHIVE_SUBDIR=$withval, DEFAULT_ARCHIVE_SUBDIR=archive)
1340 AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE_SUBDIR, ["$DEFAULT_ARCHIVE_SUBDIR"],
1341 [Name of default metadata archive subdirectory.])
1343 AC_ARG_WITH(default-backup-subdir,
1344 AC_HELP_STRING([--with-default-backup-subdir=SUBDIR],
1345 [default metadata backup subdir [[backup]]]),
1346 DEFAULT_BACKUP_SUBDIR=$withval, DEFAULT_BACKUP_SUBDIR=backup)
1347 AC_DEFINE_UNQUOTED(DEFAULT_BACKUP_SUBDIR, ["$DEFAULT_BACKUP_SUBDIR"],
1348 [Name of default metadata backup subdirectory.])
1350 AC_ARG_WITH(default-cache-subdir,
1351 AC_HELP_STRING([--with-default-cache-subdir=SUBDIR],
1352 [default metadata cache subdir [[cache]]]),
1353 DEFAULT_CACHE_SUBDIR=$withval, DEFAULT_CACHE_SUBDIR=cache)
1354 AC_DEFINE_UNQUOTED(DEFAULT_CACHE_SUBDIR, ["$DEFAULT_CACHE_SUBDIR"],
1355 [Name of default metadata cache subdirectory.])
1357 AC_ARG_WITH(default-locking-dir,
1358 AC_HELP_STRING([--with-default-locking-dir=DIR],
1359 [default locking directory [[/var/lock/lvm]]]),
1360 DEFAULT_LOCK_DIR=$withval, DEFAULT_LOCK_DIR="/var/lock/lvm")
1361 AC_DEFINE_UNQUOTED(DEFAULT_LOCK_DIR, ["$DEFAULT_LOCK_DIR"],
1362 [Name of default locking directory.])
1364 ################################################################################
1365 dnl -- Setup default data alignment
1366 AC_ARG_WITH(default-data-alignment,
1367 AC_HELP_STRING([--with-default-data-alignment=NUM],
1368 [set the default data alignment in MiB [[1]]]),
1369 DEFAULT_DATA_ALIGNMENT=$withval, DEFAULT_DATA_ALIGNMENT=1)
1370 AC_DEFINE_UNQUOTED(DEFAULT_DATA_ALIGNMENT, [$DEFAULT_DATA_ALIGNMENT],
1371 [Default data alignment.])
1373 ################################################################################
1374 dnl -- which kernel interface to use (ioctl only)
1375 AC_MSG_CHECKING(for kernel interface choice)
1376 AC_ARG_WITH(interface,
1377 AC_HELP_STRING([--with-interface=IFACE],
1378 [choose kernel interface (ioctl) [[ioctl]]]),
1379 interface=$withval, interface=ioctl)
1380 if [[ "x$interface" != xioctl ]];
1382 AC_MSG_ERROR(--with-interface=ioctl required. fs no longer supported.)
1384 AC_MSG_RESULT($interface)
1386 ################################################################################
1387 DM_LIB_VERSION="\"`cat "$srcdir"/VERSION_DM 2>/dev/null || echo Unknown`\""
1388 AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version])
1390 DM_LIB_PATCHLEVEL=`cat "$srcdir"/VERSION_DM | $AWK -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'`
1392 LVM_VERSION="\"`cat "$srcdir"/VERSION 2>/dev/null || echo Unknown`\""
1394 VER=`cat "$srcdir"/VERSION`
1395 LVM_RELEASE_DATE="\"`echo $VER | $SED 's/.* (//;s/).*//'`\""
1396 VER=`echo "$VER" | $AWK '{print $1}'`
1397 LVM_RELEASE="\"`echo "$VER" | $AWK -F '-' '{print $2}'`\""
1398 VER=`echo "$VER" | $AWK -F '-' '{print $1}'`
1399 LVM_MAJOR=`echo "$VER" | $AWK -F '.' '{print $1}'`
1400 LVM_MINOR=`echo "$VER" | $AWK -F '.' '{print $2}'`
1401 LVM_PATCHLEVEL=`echo "$VER" | $AWK -F '[[(.]]' '{print $3}'`
1402 LVM_LIBAPI=`echo "$VER" | $AWK -F '[[()]]' '{print $2}'`
1404 ################################################################################
1407 AC_SUBST(BUILD_CMIRRORD)
1408 AC_SUBST(BUILD_DMEVENTD)
1409 AC_SUBST(BUILD_LVMETAD)
1413 AC_SUBST(CLDNOWHOLEARCHIVE)
1414 AC_SUBST(CLDWHOLEARCHIVE)
1417 AC_SUBST(CLVMD_CMANAGERS)
1418 AC_SUBST(CLVMD_PATH)
1419 AC_SUBST(CMAN_CFLAGS)
1421 AC_SUBST(CMAP_CFLAGS)
1424 AC_SUBST(CONFDB_CFLAGS)
1425 AC_SUBST(CONFDB_LIBS)
1427 AC_SUBST(COPTIMISE_FLAG)
1428 AC_SUBST(CPG_CFLAGS)
1430 AC_SUBST(CSCOPE_CMD)
1432 AC_SUBST(DEFAULT_SYS_DIR)
1433 AC_SUBST(DEFAULT_ARCHIVE_SUBDIR)
1434 AC_SUBST(DEFAULT_BACKUP_SUBDIR)
1435 AC_SUBST(DEFAULT_CACHE_SUBDIR)
1436 AC_SUBST(DEFAULT_DATA_ALIGNMENT)
1437 AC_SUBST(DEFAULT_LOCK_DIR)
1438 AC_SUBST(DEFAULT_RUN_DIR)
1440 AC_SUBST(DLM_CFLAGS)
1444 AC_SUBST(DMEVENTD_PATH)
1446 AC_SUBST(DM_DEVICE_GID)
1447 AC_SUBST(DM_DEVICE_MODE)
1448 AC_SUBST(DM_DEVICE_UID)
1450 AC_SUBST(DM_LIB_VERSION)
1451 AC_SUBST(DM_LIB_PATCHLEVEL)
1454 AC_SUBST(HAVE_LIBDL)
1455 AC_SUBST(HAVE_REALTIME)
1457 AC_SUBST(INTL_PACKAGE)
1461 AC_SUBST(LIB_SUFFIX)
1464 AC_SUBST(LVM1_FALLBACK)
1465 AC_SUBST(LVM_VERSION)
1466 AC_SUBST(LVM_LIBAPI)
1469 AC_SUBST(LVM_PATCHLEVEL)
1471 AC_SUBST(LVM_RELEASE)
1472 AC_SUBST(LVM_RELEASE_DATE)
1479 AC_SUBST(PTHREAD_LIBS)
1480 AC_SUBST(QUORUM_CFLAGS)
1481 AC_SUBST(QUORUM_LIBS)
1483 AC_SUBST(READLINE_LIBS)
1484 AC_SUBST(REPLICATORS)
1485 AC_SUBST(SACKPT_CFLAGS)
1486 AC_SUBST(SACKPT_LIBS)
1487 AC_SUBST(SALCK_CFLAGS)
1488 AC_SUBST(SALCK_LIBS)
1489 AC_SUBST(SELINUX_LIBS)
1490 AC_SUBST(SELINUX_PC)
1493 AC_SUBST(STATIC_LINK)
1496 AC_SUBST(THIN_CHECK_CMD)
1499 AC_SUBST(UDEV_RULES)
1501 AC_SUBST(UDEV_HAS_BUILTIN_BLKID)
1502 AC_SUBST(CUNIT_LIBS)
1503 AC_SUBST(CUNIT_CFLAGS)
1504 AC_SUBST(WRITE_INSTALL)
1505 AC_SUBST(DMEVENTD_PIDFILE)
1508 AC_SUBST(missingkernel)
1511 AC_SUBST(udev_prefix)
1513 AC_SUBST(systemdsystemunitdir)
1514 AC_SUBST(tmpfilesdir)
1516 AC_SUBST(usrsbindir)
1518 ################################################################################
1519 dnl -- First and last lines should not contain files to generate in order to
1520 dnl -- keep utility scripts running properly
1525 daemons/clvmd/Makefile
1526 daemons/cmirrord/Makefile
1527 daemons/dmeventd/Makefile
1528 daemons/dmeventd/libdevmapper-event.pc
1529 daemons/dmeventd/plugins/Makefile
1530 daemons/dmeventd/plugins/lvm2/Makefile
1531 daemons/dmeventd/plugins/raid/Makefile
1532 daemons/dmeventd/plugins/mirror/Makefile
1533 daemons/dmeventd/plugins/snapshot/Makefile
1534 daemons/dmeventd/plugins/thin/Makefile
1535 daemons/lvmetad/Makefile
1541 lib/format1/Makefile
1542 lib/format_pool/Makefile
1543 lib/locking/Makefile
1545 lib/replicator/Makefile
1546 lib/misc/lvm-version.h
1548 lib/snapshot/Makefile
1551 libdaemon/client/Makefile
1552 libdaemon/server/Makefile
1554 libdm/libdevmapper.pc
1556 liblvm/liblvm2app.pc
1559 scripts/clvmd_init_red_hat
1560 scripts/cmirrord_init_red_hat
1561 scripts/lvm2_lvmetad_init_red_hat
1562 scripts/lvm2_lvmetad_systemd_red_hat.socket
1563 scripts/lvm2_lvmetad_systemd_red_hat.service
1564 scripts/lvm2_monitoring_init_red_hat
1565 scripts/dm_event_systemd_red_hat.service
1566 scripts/lvm2_monitoring_systemd_red_hat.service
1567 scripts/lvm2_tmpfiles_red_hat.conf
1574 unit-tests/datastruct/Makefile
1575 unit-tests/regex/Makefile
1576 unit-tests/mm/Makefile
1580 if test x$ODIRECT != xyes; then
1581 AC_MSG_WARN(Warning: O_DIRECT disabled: low-memory pvmove may lock up)