1 ###############################################################################
2 ## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved.
3 ## Copyright (C) 2004-2011 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 ################################################################################
233 dnl -- LVM1 tool fallback option
234 AC_MSG_CHECKING(whether to enable lvm1 fallback)
235 AC_ARG_ENABLE(lvm1_fallback,
236 AC_HELP_STRING([--enable-lvm1_fallback],
237 [use this to fall back and use LVM1 binaries if
238 device-mapper is missing from the kernel]),
239 LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no)
240 AC_MSG_RESULT($LVM1_FALLBACK)
242 if test x$LVM1_FALLBACK = xyes; then
243 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])
246 ################################################################################
247 dnl -- format1 inclusion type
248 AC_MSG_CHECKING(whether to include support for lvm1 metadata)
250 AC_HELP_STRING([--with-lvm1=TYPE],
251 [LVM1 metadata support: internal/shared/none
253 LVM1=$withval, LVM1=internal)
256 if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]];
258 --with-lvm1 parameter invalid
262 if test x$LVM1 = xinternal; then
263 AC_DEFINE([LVM1_INTERNAL], 1, [Define to 1 to include built-in support for LVM1 metadata.])
266 ################################################################################
267 dnl -- format_pool inclusion type
268 AC_MSG_CHECKING(whether to include support for GFS pool metadata)
270 AC_HELP_STRING([--with-pool=TYPE],
271 [GFS pool read-only support: internal/shared/none
273 POOL=$withval, POOL=internal)
276 if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]];
278 --with-pool parameter invalid
282 if test x$POOL = xinternal; then
283 AC_DEFINE([POOL_INTERNAL], 1, [Define to 1 to include built-in support for GFS pool metadata.])
286 ################################################################################
287 dnl -- cluster_locking inclusion type
288 AC_MSG_CHECKING(whether to include support for cluster locking)
290 AC_HELP_STRING([--with-cluster=TYPE],
291 [cluster LVM locking support: internal/shared/none
294 AC_MSG_RESULT($CLUSTER)
296 if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]];
298 --with-cluster parameter invalid
302 if test x$CLUSTER = xinternal; then
303 AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1, [Define to 1 to include built-in support for clustered LVM locking.])
306 ################################################################################
307 dnl -- snapshots inclusion type
308 AC_MSG_CHECKING(whether to include snapshots)
309 AC_ARG_WITH(snapshots,
310 AC_HELP_STRING([--with-snapshots=TYPE],
311 [snapshot support: internal/shared/none
313 SNAPSHOTS=$withval, SNAPSHOTS=internal)
314 AC_MSG_RESULT($SNAPSHOTS)
316 if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]];
318 --with-snapshots parameter invalid
322 if test x$SNAPSHOTS = xinternal; then
323 AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.])
326 ################################################################################
327 dnl -- mirrors inclusion type
328 AC_MSG_CHECKING(whether to include mirrors)
330 AC_HELP_STRING([--with-mirrors=TYPE],
331 [mirror support: internal/shared/none
333 MIRRORS=$withval, MIRRORS=internal)
334 AC_MSG_RESULT($MIRRORS)
336 if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]];
338 --with-mirrors parameter invalid
342 if test x$MIRRORS = xinternal; then
343 AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.])
346 ################################################################################
347 dnl -- raid inclusion type
348 AC_MSG_CHECKING(whether to include raid)
350 AC_HELP_STRING([--with-raid=TYPE],
351 [mirror support: internal/shared/none
353 RAID=$withval, RAID=internal)
356 if [[ "x$RAID" != xnone -a "x$RAID" != xinternal -a "x$RAID" != xshared ]];
358 --with-raid parameter invalid
362 if test x$RAID = xinternal; then
363 AC_DEFINE([RAID_INTERNAL], 1, [Define to 1 to include built-in support for raid.])
366 ################################################################################
367 dnl -- asynchronous volume replicator inclusion type
368 AC_MSG_CHECKING(whether to include replicators)
369 AC_ARG_WITH(replicators,
370 AC_HELP_STRING([--with-replicators=TYPE],
371 [replicator support: internal/shared/none
373 REPLICATORS=$withval, REPLICATORS=none)
374 AC_MSG_RESULT($REPLICATORS)
376 case "$REPLICATORS" in
378 internal) AC_DEFINE([REPLICATOR_INTERNAL], 1,
379 [Define to 1 to include built-in support for replicators.]) ;;
380 *) AC_MSG_ERROR([--with-replicators parameter invalid ($REPLICATORS)]) ;;
383 ################################################################################
384 dnl -- thin provisioning
385 AC_MSG_CHECKING(whether to include thin provisioning)
387 AC_HELP_STRING([--with-thin=TYPE],
388 [thin provisioning support: internal/shared/none
390 THIN=$withval, THIN=none)
395 internal) AC_DEFINE([THIN_INTERNAL], 1,
396 [Define to 1 to include built-in support for thin provisioning.]) ;;
397 *) AC_MSG_ERROR([--with-thin parameter invalid ($THIN)]) ;;
400 ################################################################################
401 dnl -- Disable readline
402 AC_MSG_CHECKING(whether to enable readline)
403 AC_ARG_ENABLE([readline],
404 AC_HELP_STRING([--disable-readline], [disable readline support]),
405 READLINE=$enableval, READLINE=maybe)
406 AC_MSG_RESULT($READLINE)
408 ################################################################################
409 dnl -- Disable realtime clock support
410 AC_MSG_CHECKING(whether to enable realtime support)
411 AC_ARG_ENABLE(realtime,
412 AC_HELP_STRING([--enable-realtime], [enable realtime clock support]),
414 AC_MSG_RESULT($REALTIME)
416 ################################################################################
417 dnl -- disable OCF resource agents
418 AC_MSG_CHECKING(whether to enable OCF resource agents)
420 AC_HELP_STRING([--enable-ocf],
421 [enable Open Cluster Framework (OCF) compliant resource agents]),
422 OCF=$enableval, OCF=no)
425 AC_HELP_STRING([--with-ocfdir=DIR],
426 [install OCF files in DIR [[PREFIX/lib/ocf/resource.d/lvm2]]]),
427 OCFDIR=$withval, OCFDIR='${prefix}/lib/ocf/resource.d/lvm2')
429 ################################################################################
430 dnl -- Init pkg-config with dummy invokation:
431 dnl -- this is required because PKG_CHECK_MODULES macro is expanded
432 dnl -- to initialize the pkg-config environment only at the first invokation,
433 dnl -- that would be conditional in this configure.in.
435 PKG_CHECK_MODULES(PKGCONFIGINIT, pkgconfiginit, [],
436 [AC_MSG_RESULT([pkg-config initialized])])
440 ################################################################################
441 dnl -- Build cluster LVM daemon
442 AC_MSG_CHECKING(whether to build cluster LVM daemon)
444 [ --with-clvmd=TYPE build cluster LVM Daemon
445 The following cluster manager combinations are valid:
446 * cman (RHEL5 or equivalent)
447 * cman,corosync,openais (or selection of them)
448 * singlenode (localhost only)
450 * none (disable build)
452 CLVMD=$withval, CLVMD=none)
453 if test x$CLVMD = xyes; then
456 AC_MSG_RESULT($CLVMD)
458 dnl -- If clvmd enabled without cluster locking, automagically include it
459 if test x$CLVMD != xnone && test x$CLUSTER = xnone; then
463 dnl -- init pkgconfig if required
464 if test x$CLVMD != xnone && test x$PKGCONFIG_INIT != x1; then
468 dnl -- Express clvmd init script Required-Start / Required-Stop
470 dnl -- On RHEL4/RHEL5, qdiskd is started from a separate init script.
471 dnl -- Enable if we are build for cman.
472 CLVMD_NEEDS_QDISKD=no
474 dnl -- define build types
475 if [[ `expr x"$CLVMD" : '.*gulm.*'` != 0 ]]; then
476 AC_MSG_ERROR([Since version 2.02.87 GULM locking is no longer supported.]);
478 if [[ `expr x"$CLVMD" : '.*cman.*'` != 0 ]]; then
480 CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman"
481 CLVMD_NEEDS_QDISKD=yes
483 if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
485 CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync"
487 if [[ `expr x"$CLVMD" : '.*openais.*'` != 0 ]]; then
489 CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais"
491 if test x$CLVMD_NEEDS_QDISKD != xno; then
492 CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd"
495 dnl -- define a soft bailout if we are autodetecting
501 AC_MSG_ERROR([bailing out])
504 dnl -- if clvmd=all then set soft_bailout (we don't want to error)
505 dnl -- and set all builds to yes. We need to do this here
506 dnl -- to skip the openais|corosync sanity check above.
507 if test x$CLVMD = xall; then
516 dnl -- helper macro to check libs without adding them to LIBS
517 check_lib_no_libs() {
523 AC_CHECK_LIB([$lib_no_libs_arg1],
524 [$lib_no_libs_arg2],,
527 LIBS=$ac_check_lib_save_LIBS
530 dnl -- Look for cman libraries if required.
531 if test x$BUILDCMAN = xyes; then
532 PKG_CHECK_MODULES(CMAN, libcman, [HAVE_CMAN=yes],
534 AC_CHECK_HEADERS(libcman.h,,$bailout)
535 check_lib_no_libs cman cman_init
536 if test $NOTFOUND = 0; then
537 AC_MSG_RESULT([no pkg for libcman, using -lcman])
545 dnl -- Look for corosync that's required also for openais build
546 dnl -- only enough recent version of corosync ship pkg-config files.
547 dnl -- We can safely rely on that to detect the correct bits.
548 if test x$BUILDCOROSYNC = xyes || \
549 test x$BUILDOPENAIS = xyes; then
550 PKG_CHECK_MODULES(COROSYNC, corosync, [HAVE_COROSYNC=yes], $bailout)
554 dnl -- Look for corosync libraries if required.
555 if test x$BUILDCOROSYNC = xyes; then
556 PKG_CHECK_MODULES(QUORUM, libquorum, [HAVE_QUORUM=yes], $bailout)
561 dnl -- Look for openais libraries if required.
562 if test x$BUILDOPENAIS = xyes; then
563 PKG_CHECK_MODULES(SALCK, libSaLck, [HAVE_SALCK=yes], $bailout)
567 dnl -- Below are checks for libraries common to more than one build.
569 dnl -- Check confdb library.
570 dnl -- mandatory for corosync build.
571 dnl -- optional for openais/cman build.
573 if test x$CHECKCONFDB = xyes; then
574 PKG_CHECK_MODULES(CONFDB, libconfdb,
578 AC_CHECK_HEADERS(corosync/confdb.h,
582 if test x$HAVE_CONFDB != xyes && \
583 test x$HAVE_CONFDB_H = xyes; then
584 check_lib_no_libs confdb confdb_initialize
585 AC_MSG_RESULT([no pkg for confdb, using -lconfdb])
586 CONFDB_LIBS="-lconfdb"
590 if test x$BUILDCOROSYNC = xyes && \
591 test x$HAVE_CONFDB != xyes &&
592 test x$CLVMD != xall; then
593 AC_MSG_ERROR([bailing out... confdb library is required])
597 dnl -- Check cpg library.
598 if test x$CHECKCPG = xyes; then
599 PKG_CHECK_MODULES(CPG, libcpg, [HAVE_CPG=yes], $bailout)
602 dnl -- Check dlm library.
603 if test x$CHECKDLM = xyes; then
604 PKG_CHECK_MODULES(DLM, libdlm, [HAVE_DLM=yes],
606 AC_CHECK_HEADERS(libdlm.h,,$bailout)
607 check_lib_no_libs dlm dlm_lock -lpthread
608 if test $NOTFOUND = 0; then
609 AC_MSG_RESULT([no pkg for libdlm, using -ldlm])
610 DLM_LIBS="-ldlm -lpthread"
615 dnl -- If we are autodetecting, we need to re-create
616 dnl -- the depedencies checks and set a proper CLVMD,
617 dnl -- together with init script Required-Start/Stop entries.
618 if test x$CLVMD = xall; then
621 CLVMD_NEEDS_QDISKD=no
622 if test x$HAVE_CMAN = xyes && \
623 test x$HAVE_DLM = xyes; then
624 AC_MSG_RESULT([Enabling clvmd cman cluster manager])
626 CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman"
627 CLVMD_NEEDS_QDISKD=yes
629 if test x$HAVE_COROSYNC = xyes && \
630 test x$HAVE_QUORUM = xyes && \
631 test x$HAVE_CPG = xyes && \
632 test x$HAVE_DLM = xyes && \
633 test x$HAVE_CONFDB = xyes; then
634 AC_MSG_RESULT([Enabling clvmd corosync cluster manager])
635 CLVMD="$CLVMD,corosync"
636 CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync"
638 if test x$HAVE_COROSYNC = xyes && \
639 test x$HAVE_CPG = xyes && \
640 test x$HAVE_SALCK = xyes; then
641 AC_MSG_RESULT([Enabling clvmd openais cluster manager])
642 CLVMD="$CLVMD,openais"
643 CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais"
645 if test x$CLVMD_NEEDS_QDISKD != xno; then
646 CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd"
648 if test x$CLVMD = xnone; then
649 AC_MSG_RESULT([Disabling clvmd build. No cluster manager detected.])
653 ################################################################################
655 if test "x$CLVMD" != xnone; then
656 AC_ARG_WITH(clvmd-pidfile,
657 AC_HELP_STRING([--with-clvmd-pidfile=PATH],
658 [clvmd pidfile [[/var/run/clvmd.pid]]]),
659 CLVMD_PIDFILE=$withval,
660 CLVMD_PIDFILE="/var/run/clvmd.pid")
661 AC_DEFINE_UNQUOTED(CLVMD_PIDFILE, ["$CLVMD_PIDFILE"],
662 [Path to clvmd pidfile.])
665 ################################################################################
666 dnl -- Build cluster mirror log daemon
667 AC_MSG_CHECKING(whether to build cluster mirror log daemon)
668 AC_ARG_ENABLE(cmirrord,
669 AC_HELP_STRING([--enable-cmirrord],
670 [enable the cluster mirror log daemon]),
671 CMIRRORD=$enableval, CMIRRORD=no)
672 AC_MSG_RESULT($CMIRRORD)
674 BUILD_CMIRRORD=$CMIRRORD
676 ################################################################################
677 dnl -- cmirrord pidfile
678 if test "x$BUILD_CMIRRORD" = xyes; then
679 AC_ARG_WITH(cmirrord-pidfile,
680 AC_HELP_STRING([--with-cmirrord-pidfile=PATH],
681 [cmirrord pidfile [[/var/run/cmirrord.pid]]]),
682 CMIRRORD_PIDFILE=$withval,
683 CMIRRORD_PIDFILE="/var/run/cmirrord.pid")
684 AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE, ["$CMIRRORD_PIDFILE"],
685 [Path to cmirrord pidfile.])
688 ################################################################################
689 dnl -- Look for corosync libraries if required.
690 if [[ "x$BUILD_CMIRRORD" = xyes ]]; then
691 dnl -- init pkgconfig if required
692 if test x$PKGCONFIG_INIT != x1; then
695 PKG_CHECK_MODULES(SACKPT, libSaCkpt)
696 if test x$HAVE_CPG != xyes; then
697 PKG_CHECK_MODULES(CPG, libcpg)
701 ################################################################################
702 dnl -- Enable debugging
703 AC_MSG_CHECKING(whether to enable debugging)
704 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable debugging]),
705 DEBUG=$enableval, DEBUG=no)
706 AC_MSG_RESULT($DEBUG)
708 dnl -- Normally turn off optimisation for debug builds
709 if test x$DEBUG = xyes; then
715 ################################################################################
716 dnl -- Override optimisation
717 AC_MSG_CHECKING(for C optimisation flag)
718 AC_ARG_WITH(optimisation,
719 AC_HELP_STRING([--with-optimisation=OPT],
720 [C optimisation flag [[OPT=-O2]]]),
721 COPTIMISE_FLAG=$withval)
722 AC_MSG_RESULT($COPTIMISE_FLAG)
724 ################################################################################
725 dnl -- Enable profiling
726 AC_MSG_CHECKING(whether to gather gcov profiling data)
727 AC_ARG_ENABLE(profiling,
728 AC_HELP_STRING(--enable-profiling, [gather gcov profiling data]),
729 PROFILING=$enableval, PROFILING=no)
730 AC_MSG_RESULT($PROFILING)
732 if test "x$PROFILING" = xyes; then
733 COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage"
734 AC_PATH_PROG(LCOV, lcov)
735 AC_PATH_PROG(GENHTML, genhtml)
736 if test -z "$LCOV" -o -z "$GENHTML"; then
737 AC_MSG_ERROR([lcov and genhtml are required for profiling])
739 AC_PATH_PROG(GENPNG, genpng)
740 if test -n "$GENPNG"; then
741 AC_MSG_CHECKING([whether $GENPNG has all required modules])
742 if $GENPNG --help > /dev/null 2>&1 ; then
744 GENHTML="$GENHTML --frames"
746 AC_MSG_RESULT(not supported)
747 AC_MSG_WARN([GD.pm perl module is not installed])
753 ################################################################################
754 dnl -- Enable testing
755 AC_MSG_CHECKING(whether to enable unit testing)
756 AC_ARG_ENABLE(testing,
757 AC_HELP_STRING(--enable-testing, [enable testing targets in the makefile]),
758 TESTING=$enableval, TESTING=no)
759 AC_MSG_RESULT($TESTING)
761 if test "$TESTING" = yes; then
762 AC_CHECK_HEADER([CUnit/Basic.h], have_cunit=yes, have_cunit=no)
763 if test "$have_cunit" = "no"; then
764 AC_MSG_ERROR([CUnit is required for unit testing])
768 ################################################################################
769 dnl -- Enable valgrind awareness of memory pools
770 AC_MSG_CHECKING(whether to enable valgrind awareness of pools)
771 AC_ARG_ENABLE(valgrind_pool,
772 AC_HELP_STRING(--enable-valgrind-pool, [enable valgrind awareness of pools]),
773 VALGRIND_POOL=$enableval, VALGRIND_POOL=no)
774 AC_MSG_RESULT($VALGRIND_POOL)
776 if test "$VALGRIND_POOL" = yes; then
777 AC_CHECK_HEADERS([valgrind/memcheck.h], , [AC_MSG_ERROR(bailing out)])
778 AC_DEFINE([VALGRIND_POOL], 1, [Enable a valgrind aware build of pool])
781 ################################################################################
782 dnl -- Disable devmapper
783 AC_MSG_CHECKING(whether to use device-mapper)
784 AC_ARG_ENABLE(devmapper,
785 AC_HELP_STRING([--disable-devmapper],
786 [disable LVM2 device-mapper interaction]),
787 DEVMAPPER=$enableval)
788 AC_MSG_RESULT($DEVMAPPER)
790 if test x$DEVMAPPER = xyes; then
791 AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.])
794 ################################################################################
796 AC_MSG_CHECKING(whether to build LVMetaD)
797 AC_ARG_ENABLE(lvmetad,
798 AC_HELP_STRING([--disable-lvmetad],
799 [disable the LVM Metadata Daemon]),
801 AC_MSG_RESULT($LVMETAD)
803 BUILD_LVMETAD=$LVMETAD
805 ################################################################################
806 dnl -- Enable udev synchronisation
807 AC_MSG_CHECKING(whether to enable synchronisation with udev processing)
808 AC_ARG_ENABLE(udev_sync,
809 AC_HELP_STRING([--enable-udev_sync],
810 [enable synchronisation with udev processing]),
811 UDEV_SYNC=$enableval, UDEV_SYNC=no)
812 AC_MSG_RESULT($UDEV_SYNC)
814 if test x$UDEV_SYNC = xyes; then
815 dnl -- init pkgconfig if required
816 if test x$PKGCONFIG_INIT != x1; then
819 PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
820 AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
823 dnl -- Enable udev rules
824 AC_MSG_CHECKING(whether to enable installation of udev rules required for synchronisation)
825 AC_ARG_ENABLE(udev_rules,
826 AC_HELP_STRING([--enable-udev_rules],
827 [install rule files needed for udev synchronisation]),
828 UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC)
829 AC_MSG_RESULT($UDEV_RULES)
831 ################################################################################
832 dnl -- Compatibility mode
833 AC_ARG_ENABLE(compat,
834 AC_HELP_STRING([--enable-compat],
835 [enable support for old device-mapper versions]),
836 DM_COMPAT=$enableval, DM_COMPAT=no)
838 if test x$DM_COMPAT = xyes; then
840 [--enable-compat is not currently supported.
841 Since device-mapper version 1.02.66, only one version (4) of the device-mapper
842 ioctl protocol is supported.]
846 ################################################################################
847 dnl -- Compatible units suffix mode
848 AC_ARG_ENABLE(units-compat,
849 AC_HELP_STRING([--enable-units-compat],
850 [enable output compatibility with old versions that
851 that do not use KiB-style unit suffixes]),
852 UNITS_COMPAT=$enableval, UNITS_COMPAT=no)
854 if test x$UNITS_COMPAT = xyes; then
855 AC_DEFINE([DEFAULT_SI_UNIT_CONSISTENCY], 0, [Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes.])
858 ################################################################################
861 AC_HELP_STRING([--disable-driver],
862 [disable calls to device-mapper in the kernel]),
863 DM_IOCTLS=$enableval)
865 ################################################################################
866 dnl -- Disable O_DIRECT
867 AC_MSG_CHECKING(whether to enable O_DIRECT)
868 AC_ARG_ENABLE(o_direct,
869 AC_HELP_STRING([--disable-o_direct], [disable O_DIRECT]),
871 AC_MSG_RESULT($ODIRECT)
873 if test x$ODIRECT = xyes; then
874 AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.])
877 ################################################################################
878 dnl -- Enable liblvm2app.so
879 AC_MSG_CHECKING(whether to build liblvm2app.so application library)
880 AC_ARG_ENABLE(applib,
881 AC_HELP_STRING([--enable-applib], [build application library]),
882 APPLIB=$enableval, APPLIB=no)
883 AC_MSG_RESULT($APPLIB)
884 AC_SUBST([LVM2APP_LIB])
885 test x$APPLIB = xyes \
886 && LVM2APP_LIB=-llvm2app \
889 ################################################################################
891 AC_MSG_CHECKING(whether to compile liblvm2cmd.so)
892 AC_ARG_ENABLE(cmdlib,
893 AC_HELP_STRING([--enable-cmdlib], [build shared command library]),
894 CMDLIB=$enableval, CMDLIB=no)
895 AC_MSG_RESULT($CMDLIB)
896 AC_SUBST([LVM2CMD_LIB])
897 test x$CMDLIB = xyes \
898 && LVM2CMD_LIB=-llvm2cmd \
901 ################################################################################
902 dnl -- Enable pkg-config
903 AC_ARG_ENABLE(pkgconfig,
904 AC_HELP_STRING([--enable-pkgconfig], [install pkgconfig support]),
905 PKGCONFIG=$enableval, PKGCONFIG=no)
907 ################################################################################
908 dnl -- Enable installation of writable files by user
909 AC_ARG_ENABLE(write_install,
910 AC_HELP_STRING([--enable-write_install],
911 [install user writable files]),
912 WRITE_INSTALL=$enableval, WRITE_INSTALL=no)
914 ################################################################################
916 AC_MSG_CHECKING(whether to install fsadm)
917 AC_ARG_ENABLE(fsadm, AC_HELP_STRING([--disable-fsadm], [disable fsadm]),
919 AC_MSG_RESULT($FSADM)
921 ################################################################################
922 dnl -- enable dmeventd handling
923 AC_MSG_CHECKING(whether to use dmeventd)
924 AC_ARG_ENABLE(dmeventd, AC_HELP_STRING([--enable-dmeventd],
925 [enable the device-mapper event daemon]),
927 AC_MSG_RESULT($DMEVENTD)
929 BUILD_DMEVENTD=$DMEVENTD
931 dnl -- dmeventd currently requires internal mirror support
932 if test x$DMEVENTD = xyes; then
933 if test x$MIRRORS != xinternal; then
935 --enable-dmeventd currently requires --with-mirrors=internal
938 if test x$CMDLIB = xno; then
940 --enable-dmeventd requires --enable-cmdlib to be used as well
945 if test x$DMEVENTD = xyes; then
946 AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.])
949 ################################################################################
950 dnl -- getline included in recent libc
952 AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1,
953 [Define to 1 if getline is available.]))
955 ################################################################################
956 dnl -- canonicalize_file_name included in recent libc
958 AC_CHECK_LIB(c, canonicalize_file_name,
959 AC_DEFINE([HAVE_CANONICALIZE_FILE_NAME], 1,
960 [Define to 1 if canonicalize_file_name is available.]))
962 ################################################################################
963 dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin
964 if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
968 ################################################################################
969 dnl -- Check for dlopen
970 AC_CHECK_LIB(dl, dlopen, [
971 AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.])
977 ################################################################################
978 dnl -- Check for shared/static conflicts
979 if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \
980 -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \
981 -o "x$RAID" = xshared \
982 \) -a "x$STATIC_LINK" = xyes ]];
984 Features cannot be 'shared' when building statically
988 ################################################################################
989 if [[ "$DMEVENTD" = yes -o "$CLVMD" != none ]] ; then
990 AC_CHECK_LIB([pthread], [pthread_mutex_lock],
991 [PTHREAD_LIBS="-lpthread"], hard_bailout)
994 ################################################################################
995 dnl -- Disable selinux
996 AC_MSG_CHECKING(whether to enable selinux support)
997 AC_ARG_ENABLE(selinux,
998 AC_HELP_STRING([--disable-selinux], [disable selinux support]),
1000 AC_MSG_RESULT($SELINUX)
1002 ################################################################################
1003 dnl -- Check for selinux
1004 if test x$SELINUX = xyes; then
1005 AC_CHECK_LIB([sepol], [sepol_check_context], [
1006 AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
1007 SELINUX_LIBS="-lsepol"])
1009 AC_CHECK_LIB([selinux], [is_selinux_enabled], [
1010 AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
1011 AC_CHECK_HEADERS([selinux/label.h])
1012 AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
1013 SELINUX_LIBS="-lselinux $SELINUX_LIBS"
1014 SELINUX_PC="libselinux"
1015 HAVE_SELINUX=yes ], [
1016 AC_MSG_WARN(Disabling selinux)
1022 ################################################################################
1023 dnl -- Check for realtime clock support
1024 if test x$REALTIME = xyes; then
1025 AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no)
1027 if test x$HAVE_REALTIME = xyes; then
1028 AC_DEFINE([HAVE_REALTIME], 1, [Define to 1 to include support for realtime clock.])
1031 AC_MSG_WARN(Disabling realtime clock)
1035 ################################################################################
1036 dnl -- Check for getopt
1037 AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.]))
1039 ################################################################################
1040 dnl -- Check for readline (Shamelessly copied from parted 1.4.17)
1041 if test x$READLINE != xno; then
1042 lvm_saved_libs=$LIBS
1043 AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib],
1044 READLINE_LIBS=$ac_cv_search_tgetent, [
1045 if test "$READLINE" = yes; then
1047 [termcap could not be found which is required for the
1048 --enable-readline option (which is enabled by default). Either disable readline
1049 support with --disable-readline or download and install termcap from:
1050 ftp.gnu.org/gnu/termcap
1051 Note: if you are using precompiled packages you will also need the development
1052 package as well (which may be called termcap-devel or something similar).
1053 Note: (n)curses also seems to work as a substitute for termcap. This was
1054 not found either - but you could try installing that as well.])
1056 dnl -- Old systems may need extra termcap dependency explicitly in LIBS
1057 AC_CHECK_LIB([readline], [readline], [
1058 AC_DEFINE([READLINE_SUPPORT], 1,
1059 [Define to 1 to include the LVM readline shell.])
1060 dnl -- Try only with -lreadline and check for different symbol
1061 LIBS=$lvm_saved_libs
1062 AC_CHECK_LIB([readline], [rl_line_buffer],
1063 [ READLINE_LIBS="-lreadline" ], [
1064 AC_MSG_RESULT([linking -lreadline with $READLINE_LIBS needed])
1065 READLINE_LIBS="-lreadline $READLINE_LIBS"
1068 if test "$READLINE" = yes; then
1070 [GNU Readline could not be found which is required for the
1071 --enable-readline option (which is enabled by default). Either disable readline
1072 support with --disable-readline or download and install readline from:
1073 ftp.gnu.org/gnu/readline
1074 Note: if you are using precompiled packages you will also need the development
1075 package as well (which may be called readline-devel or something similar).])
1077 LIBS="$READLINE_LIBS $lvm_saved_libs"
1078 AC_CHECK_FUNCS([rl_completion_matches])
1079 LIBS=$lvm_saved_libs
1082 ################################################################################
1083 dnl -- Internationalisation stuff
1084 AC_MSG_CHECKING(whether to enable internationalisation)
1086 AC_HELP_STRING([--enable-nls], [enable Native Language Support]),
1087 INTL=$enableval, INTL=no)
1088 AC_MSG_RESULT($INTL)
1090 if test x$INTL = xyes; then
1091 # FIXME - Move this - can be device-mapper too
1093 AC_PATH_PROG(MSGFMT, msgfmt)
1094 if [[ "x$MSGFMT" == x ]];
1096 msgfmt not found in path $PATH
1100 AC_ARG_WITH(localedir,
1101 AC_HELP_STRING([--with-localedir=DIR],
1102 [translation files in DIR
1103 [[PREFIX/share/locale]]]),
1104 LOCALEDIR=$withval, LOCALEDIR='${prefix}/share/locale')
1107 ################################################################################
1108 AC_ARG_WITH(confdir,
1109 AC_HELP_STRING([--with-confdir=DIR],
1110 [configuration files in DIR [[/etc]]]),
1111 CONFDIR=$withval, CONFDIR="/etc")
1113 AC_ARG_WITH(staticdir,
1114 AC_HELP_STRING([--with-staticdir=DIR],
1115 [static binaries in DIR [[EPREFIX/sbin]]]),
1116 STATICDIR=$withval, STATICDIR='${exec_prefix}/sbin')
1118 AC_ARG_WITH(usrlibdir,
1119 AC_HELP_STRING([--with-usrlibdir=DIR],
1120 [usrlib in DIR [[PREFIX/lib]]]),
1121 usrlibdir=$withval, usrlibdir='${prefix}/lib')
1123 AC_ARG_WITH(usrsbindir,
1124 AC_HELP_STRING([--with-usrsbindir=DIR],
1125 [usrsbin executables in DIR [[PREFIX/sbin]]]),
1126 usrsbindir=$withval, usrsbindir='${prefix}/sbin')
1128 ################################################################################
1129 AC_ARG_WITH(udev_prefix,
1130 AC_HELP_STRING([--with-udev-prefix=UPREFIX],
1131 [install udev rule files in UPREFIX [[EPREFIX]]]),
1132 udev_prefix=$withval, udev_prefix='${exec_prefix}')
1134 AC_ARG_WITH(udevdir,
1135 AC_HELP_STRING([--with-udevdir=DIR],
1136 [udev rules in DIR [[UPREFIX/lib/udev/rules.d]]]),
1137 udevdir=$withval, udevdir='${udev_prefix}/lib/udev/rules.d')
1139 ################################################################################
1140 dnl -- Ensure additional headers required
1141 if test x$READLINE = xyes; then
1142 AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out))
1145 if test x$CLVMD != xnone; then
1146 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))
1147 AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,AC_MSG_ERROR(bailing out))
1149 AC_FUNC_SELECT_ARGTYPES
1152 if test x$CLUSTER != xnone; then
1153 AC_CHECK_HEADERS(sys/socket.h sys/un.h,,AC_MSG_ERROR(bailing out))
1154 AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out))
1157 if test x$DMEVENTD = xyes; then
1158 AC_CHECK_HEADERS(arpa/inet.h,,AC_MSG_ERROR(bailing out))
1161 if test x$HAVE_LIBDL = xyes; then
1162 AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out))
1165 if test x$INTL = xyes; then
1166 AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out))
1169 if test x$UDEV_SYNC = xyes; then
1170 AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,AC_MSG_ERROR(bailing out))
1173 ################################################################################
1174 AC_PATH_PROG(MODPROBE_CMD, modprobe)
1176 if test x$MODPROBE_CMD != x; then
1177 AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.])
1181 lvm_exec_prefix=$exec_prefix
1182 test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$prefix
1183 test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$ac_default_prefix
1184 LVM_PATH="$lvm_exec_prefix/sbin/lvm"
1185 AC_DEFINE_UNQUOTED(LVM_PATH, ["$LVM_PATH"], [Path to lvm binary.])
1187 if test "$CLVMD" != none; then
1188 clvmd_prefix=$ac_default_prefix
1189 CLVMD_PATH="$clvmd_prefix/sbin/clvmd"
1190 test "$prefix" != NONE && clvmd_prefix=$prefix
1191 AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$CLVMD_PATH"], [Path to clvmd binary.])
1194 ################################################################################
1195 dnl -- dmeventd pidfile and executable path
1196 if test "$BUILD_DMEVENTD" = yes; then
1197 AC_ARG_WITH(dmeventd-pidfile,
1198 AC_HELP_STRING([--with-dmeventd-pidfile=PATH],
1199 [dmeventd pidfile [[/var/run/dmeventd.pid]]]),
1200 DMEVENTD_PIDFILE=$withval,
1201 DMEVENTD_PIDFILE="/var/run/dmeventd.pid")
1202 AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE, ["$DMEVENTD_PIDFILE"],
1203 [Path to dmeventd pidfile.])
1206 if test "$BUILD_DMEVENTD" = yes; then
1207 AC_ARG_WITH(dmeventd-path,
1208 AC_HELP_STRING([--with-dmeventd-path=PATH],
1209 [dmeventd path [[EPREFIX/sbin/dmeventd]]]),
1210 DMEVENTD_PATH=$withval,
1211 DMEVENTD_PATH="$lvm_exec_prefix/sbin/dmeventd")
1212 AC_DEFINE_UNQUOTED(DMEVENTD_PATH, ["$DMEVENTD_PATH"],
1213 [Path to dmeventd binary.])
1216 AH_TEMPLATE(DEFAULT_RUN_DIR, [Name of default run directory.])
1217 AC_ARG_WITH(default-run-dir,
1218 [ --with-default-run-dir=DIR Default run directory [[/var/run/lvm]] ],
1219 [ DEFAULT_RUN_DIR="$withval" ],
1220 [ DEFAULT_RUN_DIR="/var/run/lvm" ])
1221 AC_DEFINE_UNQUOTED(DEFAULT_RUN_DIR,["$DEFAULT_RUN_DIR"] )
1223 ################################################################################
1224 dnl -- various defaults
1225 AC_ARG_WITH(default-system-dir,
1226 AC_HELP_STRING([--with-default-system-dir=DIR],
1227 [default LVM system directory [[/etc/lvm]]]),
1228 DEFAULT_SYS_DIR=$withval, DEFAULT_SYS_DIR="/etc/lvm")
1229 AC_DEFINE_UNQUOTED(DEFAULT_SYS_DIR, ["$DEFAULT_SYS_DIR"],
1230 [Path to LVM system directory.])
1232 AC_ARG_WITH(default-archive-subdir,
1233 AC_HELP_STRING([--with-default-archive-subdir=SUBDIR],
1234 [default metadata archive subdir [[archive]]]),
1235 DEFAULT_ARCHIVE_SUBDIR=$withval, DEFAULT_ARCHIVE_SUBDIR=archive)
1236 AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE_SUBDIR, ["$DEFAULT_ARCHIVE_SUBDIR"],
1237 [Name of default metadata archive subdirectory.])
1239 AC_ARG_WITH(default-backup-subdir,
1240 AC_HELP_STRING([--with-default-backup-subdir=SUBDIR],
1241 [default metadata backup subdir [[backup]]]),
1242 DEFAULT_BACKUP_SUBDIR=$withval, DEFAULT_BACKUP_SUBDIR=backup)
1243 AC_DEFINE_UNQUOTED(DEFAULT_BACKUP_SUBDIR, ["$DEFAULT_BACKUP_SUBDIR"],
1244 [Name of default metadata backup subdirectory.])
1246 AC_ARG_WITH(default-cache-subdir,
1247 AC_HELP_STRING([--with-default-cache-subdir=SUBDIR],
1248 [default metadata cache subdir [[cache]]]),
1249 DEFAULT_CACHE_SUBDIR=$withval, DEFAULT_CACHE_SUBDIR=cache)
1250 AC_DEFINE_UNQUOTED(DEFAULT_CACHE_SUBDIR, ["$DEFAULT_CACHE_SUBDIR"],
1251 [Name of default metadata cache subdirectory.])
1253 AC_ARG_WITH(default-locking-dir,
1254 AC_HELP_STRING([--with-default-locking-dir=DIR],
1255 [default locking directory [[/var/lock/lvm]]]),
1256 DEFAULT_LOCK_DIR=$withval, DEFAULT_LOCK_DIR="/var/lock/lvm")
1257 AC_DEFINE_UNQUOTED(DEFAULT_LOCK_DIR, ["$DEFAULT_LOCK_DIR"],
1258 [Name of default locking directory.])
1260 ################################################################################
1261 dnl -- Setup default data alignment
1262 AC_ARG_WITH(default-data-alignment,
1263 AC_HELP_STRING([--with-default-data-alignment=NUM],
1264 [set the default data alignment in MiB [[1]]]),
1265 DEFAULT_DATA_ALIGNMENT=$withval, DEFAULT_DATA_ALIGNMENT=1)
1266 AC_DEFINE_UNQUOTED(DEFAULT_DATA_ALIGNMENT, [$DEFAULT_DATA_ALIGNMENT],
1267 [Default data alignment.])
1269 ################################################################################
1270 dnl -- which kernel interface to use (ioctl only)
1271 AC_MSG_CHECKING(for kernel interface choice)
1272 AC_ARG_WITH(interface,
1273 AC_HELP_STRING([--with-interface=IFACE],
1274 [choose kernel interface (ioctl) [[ioctl]]]),
1275 interface=$withval, interface=ioctl)
1276 if [[ "x$interface" != xioctl ]];
1278 AC_MSG_ERROR(--with-interface=ioctl required. fs no longer supported.)
1280 AC_MSG_RESULT($interface)
1282 ################################################################################
1283 DM_LIB_VERSION="\"`cat "$srcdir"/VERSION_DM 2>/dev/null || echo Unknown`\""
1284 AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version])
1286 DM_LIB_PATCHLEVEL=`cat "$srcdir"/VERSION_DM | $AWK -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'`
1288 LVM_VERSION="\"`cat "$srcdir"/VERSION 2>/dev/null || echo Unknown`\""
1290 VER=`cat "$srcdir"/VERSION`
1291 LVM_RELEASE_DATE="\"`echo $VER | $SED 's/.* (//;s/).*//'`\""
1292 VER=`echo "$VER" | $AWK '{print $1}'`
1293 LVM_RELEASE="\"`echo "$VER" | $AWK -F '-' '{print $2}'`\""
1294 VER=`echo "$VER" | $AWK -F '-' '{print $1}'`
1295 LVM_MAJOR=`echo "$VER" | $AWK -F '.' '{print $1}'`
1296 LVM_MINOR=`echo "$VER" | $AWK -F '.' '{print $2}'`
1297 LVM_PATCHLEVEL=`echo "$VER" | $AWK -F '[[(.]]' '{print $3}'`
1298 LVM_LIBAPI=`echo "$VER" | $AWK -F '[[()]]' '{print $2}'`
1300 ################################################################################
1303 AC_SUBST(BUILD_CMIRRORD)
1304 AC_SUBST(BUILD_DMEVENTD)
1305 AC_SUBST(BUILD_LVMETAD)
1309 AC_SUBST(CLDNOWHOLEARCHIVE)
1310 AC_SUBST(CLDWHOLEARCHIVE)
1313 AC_SUBST(CLVMD_CMANAGERS)
1314 AC_SUBST(CLVMD_PATH)
1315 AC_SUBST(CMAN_CFLAGS)
1318 AC_SUBST(CONFDB_CFLAGS)
1319 AC_SUBST(CONFDB_LIBS)
1321 AC_SUBST(COPTIMISE_FLAG)
1322 AC_SUBST(CPG_CFLAGS)
1324 AC_SUBST(CSCOPE_CMD)
1326 AC_SUBST(DEFAULT_SYS_DIR)
1327 AC_SUBST(DEFAULT_ARCHIVE_SUBDIR)
1328 AC_SUBST(DEFAULT_BACKUP_SUBDIR)
1329 AC_SUBST(DEFAULT_CACHE_SUBDIR)
1330 AC_SUBST(DEFAULT_DATA_ALIGNMENT)
1331 AC_SUBST(DEFAULT_LOCK_DIR)
1332 AC_SUBST(DEFAULT_RUN_DIR)
1334 AC_SUBST(DLM_CFLAGS)
1338 AC_SUBST(DMEVENTD_PATH)
1340 AC_SUBST(DM_DEVICE_GID)
1341 AC_SUBST(DM_DEVICE_MODE)
1342 AC_SUBST(DM_DEVICE_UID)
1344 AC_SUBST(DM_LIB_VERSION)
1345 AC_SUBST(DM_LIB_PATCHLEVEL)
1348 AC_SUBST(HAVE_LIBDL)
1349 AC_SUBST(HAVE_REALTIME)
1351 AC_SUBST(INTL_PACKAGE)
1355 AC_SUBST(LIB_SUFFIX)
1358 AC_SUBST(LVM1_FALLBACK)
1359 AC_SUBST(LVM_VERSION)
1360 AC_SUBST(LVM_LIBAPI)
1363 AC_SUBST(LVM_PATCHLEVEL)
1365 AC_SUBST(LVM_RELEASE)
1366 AC_SUBST(LVM_RELEASE_DATE)
1373 AC_SUBST(PTHREAD_LIBS)
1374 AC_SUBST(QUORUM_CFLAGS)
1375 AC_SUBST(QUORUM_LIBS)
1377 AC_SUBST(READLINE_LIBS)
1378 AC_SUBST(REPLICATORS)
1379 AC_SUBST(SACKPT_CFLAGS)
1380 AC_SUBST(SACKPT_LIBS)
1381 AC_SUBST(SALCK_CFLAGS)
1382 AC_SUBST(SALCK_LIBS)
1383 AC_SUBST(SELINUX_LIBS)
1384 AC_SUBST(SELINUX_PC)
1387 AC_SUBST(STATIC_LINK)
1392 AC_SUBST(UDEV_RULES)
1394 AC_SUBST(WRITE_INSTALL)
1395 AC_SUBST(DMEVENTD_PIDFILE)
1398 AC_SUBST(missingkernel)
1401 AC_SUBST(udev_prefix)
1404 AC_SUBST(usrsbindir)
1406 ################################################################################
1407 dnl -- First and last lines should not contain files to generate in order to
1408 dnl -- keep utility scripts running properly
1413 daemons/clvmd/Makefile
1414 daemons/cmirrord/Makefile
1415 daemons/common/Makefile
1416 daemons/dmeventd/Makefile
1417 daemons/dmeventd/libdevmapper-event.pc
1418 daemons/dmeventd/plugins/Makefile
1419 daemons/dmeventd/plugins/lvm2/Makefile
1420 daemons/dmeventd/plugins/raid/Makefile
1421 daemons/dmeventd/plugins/mirror/Makefile
1422 daemons/dmeventd/plugins/snapshot/Makefile
1423 daemons/lvmetad/Makefile
1429 lib/format1/Makefile
1430 lib/format_pool/Makefile
1431 lib/locking/Makefile
1433 lib/replicator/Makefile
1434 lib/misc/lvm-version.h
1436 lib/snapshot/Makefile
1439 libdm/libdevmapper.pc
1441 liblvm/liblvm2app.pc
1444 scripts/clvmd_init_red_hat
1445 scripts/cmirrord_init_red_hat
1446 scripts/lvm2_monitoring_init_red_hat
1447 scripts/dm_event_systemd_red_hat.service
1448 scripts/lvm2_monitoring_systemd_red_hat.service
1455 unit-tests/datastruct/Makefile
1456 unit-tests/regex/Makefile
1457 unit-tests/mm/Makefile
1461 if test x$ODIRECT != xyes; then
1462 AC_MSG_WARN(Warning: O_DIRECT disabled: low-memory pvmove may lock up)