]> sourceware.org Git - lvm2.git/blobdiff - configure.in
Refer to details of snapshot of raid problem.
[lvm2.git] / configure.in
index cf74d071392249046795f150d87d9d09204c65a5..5e8c6f9826778130579705dc6cc6e905920e1611 100644 (file)
@@ -1,6 +1,6 @@
 ###############################################################################
 ## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved.
-## Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
+## Copyright (C) 2004-2012 Red Hat, Inc. All rights reserved.
 ##
 ## This copyrighted material is made available to anyone wishing to use,
 ## modify, copy, or redistribute it subject to the terms and conditions
@@ -11,7 +11,7 @@
 ## Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 ################################################################################
 
-AC_PREREQ(2.57)
+AC_PREREQ(2.61)
 ################################################################################
 dnl -- Process this file with autoconf to produce a configure script.
 AC_INIT
@@ -31,16 +31,17 @@ case "$host_os" in
                CFLAGS="$CFLAGS"
                COPTIMISE_FLAG="-O2"
                CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
+               ELDFLAGS="-Wl,--export-dynamic"
+               # FIXME Generate list and use --dynamic-list=.dlopen.sym
                CLDWHOLEARCHIVE="-Wl,-whole-archive"
                CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
                LDDEPS="$LDDEPS .export.sym"
-               LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
                LIB_SUFFIX=so
                DEVMAPPER=yes
+               LVMETAD=no
                ODIRECT=yes
                DM_IOCTLS=yes
                SELINUX=yes
-               REALTIME=yes
                CLUSTER=internal
                FSADM=yes
                ;;
@@ -48,6 +49,7 @@ case "$host_os" in
                CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
                COPTIMISE_FLAG="-O2"
                CLDFLAGS="$CLDFLAGS"
+               ELDFLAGS=
                CLDWHOLEARCHIVE="-all_load"
                CLDNOWHOLEARCHIVE=
                LIB_SUFFIX=dylib
@@ -55,12 +57,13 @@ case "$host_os" in
                ODIRECT=no
                DM_IOCTLS=no
                SELINUX=no
-               REALTIME=no
                CLUSTER=none
                FSADM=no
                ;;
 esac
 
+VERITYSETUP=no
+
 ################################################################################
 dnl -- Checks for programs.
 AC_PROG_SED
@@ -80,12 +83,14 @@ AC_PATH_PROG(CSCOPE_CMD, cscope)
 ################################################################################
 dnl -- Check for header files.
 AC_HEADER_DIRENT
+AC_HEADER_MAJOR
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
 AC_HEADER_TIME
 
 AC_CHECK_HEADERS([locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \
-  libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h sys/wait.h time.h], ,
+  langinfo.h libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h \
+  sys/wait.h time.h], ,
   [AC_MSG_ERROR(bailing out)])
 
 case "$host_os" in
@@ -110,21 +115,35 @@ AC_TYPE_PID_T
 AC_TYPE_SIGNAL
 AC_TYPE_SIZE_T
 AC_TYPE_MODE_T
+AC_TYPE_INT8_T
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_SSIZE_T
+AC_TYPE_UID_T
+AC_TYPE_UINT8_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT64_T
 AC_CHECK_MEMBERS([struct stat.st_rdev])
 AC_STRUCT_TM
 
 ################################################################################
 dnl -- Check for functions
-AC_CHECK_FUNCS([gethostname getpagesize memset mkdir rmdir munmap setlocale \
-  strcasecmp strchr strdup strncasecmp strerror strrchr strstr strtol strtoul \
-  uname], , [AC_MSG_ERROR(bailing out)])
+AC_CHECK_FUNCS([ftruncate gethostname getpagesize \
+  gettimeofday memset mkdir mkfifo rmdir munmap nl_langinfo setenv setlocale \
+  strcasecmp strchr strcspn strspn strdup strncasecmp strerror strrchr \
+  strstr strtol strtoul uname], , [AC_MSG_ERROR(bailing out)])
+AC_CHECK_FUNCS(siginterrupt)
 AC_FUNC_ALLOCA
 AC_FUNC_CLOSEDIR_VOID
+AC_FUNC_CHOWN
 AC_FUNC_FORK
 AC_FUNC_LSTAT
 AC_FUNC_MALLOC
 AC_FUNC_MEMCMP
 AC_FUNC_MMAP
+AC_FUNC_REALLOC
 AC_FUNC_STAT
 AC_FUNC_STRTOD
 AC_FUNC_VPRINTF
@@ -133,9 +152,10 @@ AC_FUNC_VPRINTF
 dnl -- Enables statically-linked tools
 AC_MSG_CHECKING(whether to use static linking)
 AC_ARG_ENABLE(static_link,
-  [  --enable-static_link    Use this to link the tools to their libraries
-                          statically.  Default is dynamic linking],
-  STATIC_LINK=$enableval, STATIC_LINK=no)
+             AC_HELP_STRING([--enable-static_link],
+                            [use this to link the tools to their libraries
+                             statically (default is dynamic linking]),
+             STATIC_LINK=$enableval, STATIC_LINK=no)
 AC_MSG_RESULT($STATIC_LINK)
 
 ################################################################################
@@ -145,28 +165,27 @@ AC_PREFIX_DEFAULT(/usr)
 ################################################################################
 dnl -- Setup the ownership of the files
 AC_MSG_CHECKING(file owner)
-OWNER="root"
-
 AC_ARG_WITH(user,
-  [  --with-user=USER        Set the owner of installed files [[USER=root]] ],
-  [ OWNER="$withval" ])
+           AC_HELP_STRING([--with-user=USER],
+                          [set the owner of installed files [[USER=]]]),
+           OWNER=$withval)
 AC_MSG_RESULT($OWNER)
 
 if test x$OWNER != x; then
-       OWNER="-o $OWNER"
+       INSTALL="$INSTALL -o $OWNER"
 fi
 
 ################################################################################
 dnl -- Setup the group ownership of the files
 AC_MSG_CHECKING(group owner)
-GROUP="root"
 AC_ARG_WITH(group,
-  [  --with-group=GROUP      Set the group owner of installed files [[GROUP=root]] ],
-  [ GROUP="$withval" ])
+           AC_HELP_STRING([--with-group=GROUP],
+                          [set the group owner of installed files [[GROUP=]]]),
+           GROUP=$withval)
 AC_MSG_RESULT($GROUP)
 
 if test x$GROUP != x; then
-       GROUP="-g $GROUP"
+       INSTALL="$INSTALL -g $GROUP"
 fi
 
 ################################################################################
@@ -174,8 +193,9 @@ dnl -- Setup device node ownership
 AC_MSG_CHECKING(device node uid)
 
 AC_ARG_WITH(device-uid,
-  [  --with-device-uid=UID   Set the owner used for new device nodes [[UID=0]] ],
-  [ DM_DEVICE_UID="$withval" ], [ DM_DEVICE_UID="0" ] )
+           AC_HELP_STRING([--with-device-uid=UID],
+                          [set the owner used for new device nodes [[UID=0]]]),
+           DM_DEVICE_UID=$withval, DM_DEVICE_UID=0)
 AC_MSG_RESULT($DM_DEVICE_UID)
 
 ################################################################################
@@ -183,8 +203,9 @@ dnl -- Setup device group ownership
 AC_MSG_CHECKING(device node gid)
 
 AC_ARG_WITH(device-gid,
-  [  --with-device-gid=UID   Set the group used for new device nodes [[GID=0]] ],
-  [ DM_DEVICE_GID="$withval" ], [ DM_DEVICE_GID="0" ] )
+           AC_HELP_STRING([--with-device-gid=GID],
+                          [set the group used for new device nodes [[GID=0]]]),
+           DM_DEVICE_GID=$withval, DM_DEVICE_GID=0)
 AC_MSG_RESULT($DM_DEVICE_GID)
 
 ################################################################################
@@ -192,15 +213,46 @@ dnl -- Setup device mode
 AC_MSG_CHECKING(device node mode)
 
 AC_ARG_WITH(device-mode,
-  [  --with-device-mode=MODE Set the mode used for new device nodes [[MODE=0600]] ],
-  [ DM_DEVICE_MODE="$withval" ], [ DM_DEVICE_MODE="0600" ] )
+           AC_HELP_STRING([--with-device-mode=MODE],
+                          [set the mode used for new device nodes [[MODE=0600]]]),
+           DM_DEVICE_MODE=$withval, DM_DEVICE_MODE=0600)
 AC_MSG_RESULT($DM_DEVICE_MODE)
 
+AC_MSG_CHECKING(when to create device nodes)
+AC_ARG_WITH(device-nodes-on,
+           AC_HELP_STRING([--with-device-nodes-on=ON],
+                          [create nodes on resume or create [[ON=resume]]]),
+           ADD_NODE=$withval, ADD_NODE=resume)
+case "$ADD_NODE" in
+ resume) add_on=DM_ADD_NODE_ON_RESUME;;
+ create) add_on=DM_ADD_NODE_ON_CREATE;;
+ *) AC_MSG_ERROR([--with-device-nodes-on parameter invalid]);;
+esac
+AC_MSG_RESULT(on $ADD_NODE)
+AC_DEFINE_UNQUOTED([DEFAULT_DM_ADD_NODE], $add_on, [Define default node creation behavior with dmsetup create])
+
+AC_MSG_CHECKING(default name mangling)
+AC_ARG_WITH(default-name-mangling,
+           AC_HELP_STRING([--with-default-name-mangling=MANGLING],
+                          [default name mangling: auto/none/hex [[MANGLING=auto]]]),
+           MANGLING=$withval, MANGLING=auto)
+case "$MANGLING" in
+ auto) mangling=DM_STRING_MANGLING_AUTO;;
+ disabled) mangling=DM_STRING_MANGLING_NONE;;
+ hex) mangling=DM_STRING_MANGLING_HEX;;
+ *) AC_MSG_ERROR([--with-default-name-mangling parameter invalid]);;
+esac
+AC_MSG_RESULT($MANGLING)
+AC_DEFINE_UNQUOTED([DEFAULT_DM_NAME_MANGLING], $mangling, [Define default name mangling behaviour])
+
 ################################################################################
 dnl -- LVM1 tool fallback option
 AC_MSG_CHECKING(whether to enable lvm1 fallback)
-AC_ARG_ENABLE(lvm1_fallback, [  --enable-lvm1_fallback  Use this to fall back and use LVM1 binaries if
-                          device-mapper is missing from the kernel],  LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no)
+AC_ARG_ENABLE(lvm1_fallback,
+             AC_HELP_STRING([--enable-lvm1_fallback],
+                            [use this to fall back and use LVM1 binaries if
+                             device-mapper is missing from the kernel]),
+             LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no)
 AC_MSG_RESULT($LVM1_FALLBACK)
 
 if test x$LVM1_FALLBACK = xyes; then
@@ -211,10 +263,10 @@ fi
 dnl -- format1 inclusion type
 AC_MSG_CHECKING(whether to include support for lvm1 metadata)
 AC_ARG_WITH(lvm1,
-  [  --with-lvm1=TYPE        LVM1 metadata support: internal/shared/none
-                          [TYPE=internal] ],
-  [ LVM1="$withval" ],
-  [ LVM1="internal" ])
+           AC_HELP_STRING([--with-lvm1=TYPE],
+                          [LVM1 metadata support: internal/shared/none
+                           [[TYPE=internal]]]),
+           LVM1=$withval, LVM1=internal)
 AC_MSG_RESULT($LVM1)
 
 if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]];
@@ -231,10 +283,10 @@ fi
 dnl -- format_pool inclusion type
 AC_MSG_CHECKING(whether to include support for GFS pool metadata)
 AC_ARG_WITH(pool,
-  [  --with-pool=TYPE        GFS pool read-only support: internal/shared/none
-                          [TYPE=internal] ],
-  [ POOL="$withval" ],
-  [ POOL="internal" ])
+           AC_HELP_STRING([--with-pool=TYPE],
+                          [GFS pool read-only support: internal/shared/none
+                           [[TYPE=internal]]]),
+           POOL=$withval, POOL=internal)
 AC_MSG_RESULT($POOL)
 
 if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]];
@@ -251,9 +303,10 @@ fi
 dnl -- cluster_locking inclusion type
 AC_MSG_CHECKING(whether to include support for cluster locking)
 AC_ARG_WITH(cluster,
-  [  --with-cluster=TYPE     Cluster LVM locking support: internal/shared/none
-                          [TYPE=internal] ],
-  [ CLUSTER="$withval" ])
+           AC_HELP_STRING([--with-cluster=TYPE],
+                          [cluster LVM locking support: internal/shared/none
+                           [[TYPE=internal]]]),
+           CLUSTER=$withval)
 AC_MSG_RESULT($CLUSTER)
 
 if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]];
@@ -270,10 +323,10 @@ fi
 dnl -- snapshots inclusion type
 AC_MSG_CHECKING(whether to include snapshots)
 AC_ARG_WITH(snapshots,
-  [  --with-snapshots=TYPE   Snapshot support: internal/shared/none
-                          [TYPE=internal] ],
-  [ SNAPSHOTS="$withval" ],
-  [ SNAPSHOTS="internal" ])
+           AC_HELP_STRING([--with-snapshots=TYPE],
+                          [snapshot support: internal/shared/none
+                           [[TYPE=internal]]]),
+           SNAPSHOTS=$withval, SNAPSHOTS=internal)
 AC_MSG_RESULT($SNAPSHOTS)
 
 if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]];
@@ -290,10 +343,10 @@ fi
 dnl -- mirrors inclusion type
 AC_MSG_CHECKING(whether to include mirrors)
 AC_ARG_WITH(mirrors,
-  [  --with-mirrors=TYPE     Mirror support: internal/shared/none
-                          [TYPE=internal] ],
-  [ MIRRORS="$withval" ],
-  [ MIRRORS="internal" ])
+           AC_HELP_STRING([--with-mirrors=TYPE],
+                          [mirror support: internal/shared/none
+                           [[TYPE=internal]]]),
+           MIRRORS=$withval, MIRRORS=internal)
 AC_MSG_RESULT($MIRRORS)
 
 if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]];
@@ -306,35 +359,131 @@ if test x$MIRRORS = xinternal; then
        AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.])
 fi
 
+################################################################################
+dnl -- raid inclusion type
+AC_MSG_CHECKING(whether to include raid)
+AC_ARG_WITH(raid,
+           AC_HELP_STRING([--with-raid=TYPE],
+                          [mirror support: internal/shared/none
+                           [[TYPE=internal]]]),
+           RAID=$withval, RAID=internal)
+AC_MSG_RESULT($RAID)
+
+if [[ "x$RAID" != xnone -a "x$RAID" != xinternal -a "x$RAID" != xshared ]];
+ then  AC_MSG_ERROR(
+--with-raid parameter invalid
+)
+fi;
+
+if test x$RAID = xinternal; then
+       AC_DEFINE([RAID_INTERNAL], 1, [Define to 1 to include built-in support for raid.])
+fi
+
+################################################################################
+dnl -- asynchronous volume replicator inclusion type
+AC_MSG_CHECKING(whether to include replicators)
+AC_ARG_WITH(replicators,
+           AC_HELP_STRING([--with-replicators=TYPE],
+                          [replicator support: internal/shared/none
+                           [[TYPE=none]]]),
+           REPLICATORS=$withval, REPLICATORS=none)
+AC_MSG_RESULT($REPLICATORS)
+
+case "$REPLICATORS" in
+  none|shared) ;;
+  internal) AC_DEFINE([REPLICATOR_INTERNAL], 1,
+               [Define to 1 to include built-in support for replicators.]) ;;
+  *) AC_MSG_ERROR([--with-replicators parameter invalid ($REPLICATORS)]) ;;
+esac
+
+################################################################################
+dnl -- thin provisioning
+AC_MSG_CHECKING(whether to include thin provisioning)
+AC_ARG_WITH(thin,
+           AC_HELP_STRING([--with-thin=TYPE],
+                          [thin provisioning support: internal/shared/none
+                           [[TYPE=none]]]),
+           THIN=$withval, THIN=none)
+AC_MSG_RESULT($THIN)
+
+case "$THIN" in
+  none|shared) ;;
+  internal) AC_DEFINE([THIN_INTERNAL], 1,
+               [Define to 1 to include built-in support for thin provisioning.]) ;;
+  *) AC_MSG_ERROR([--with-thin parameter invalid ($THIN)]) ;;
+esac
+
+case "$THIN" in
+  internal|shared)
+       AC_ARG_WITH(thin-check,
+               AC_HELP_STRING([--with-thin-check=PATH],
+                              [thin_check tool: [[autodetect]]]),
+                              THIN_CHECK_CMD=$withval, THIN_CHECK_CMD="autodetect")
+       # Empty means a config way to ignore thin checking
+       if test "$THIN_CHECK_CMD" = "autodetect"; then
+               AC_PATH_PROG(THIN_CHECK_CMD, thin_check)
+               test -z "$THIN_CHECK_CMD" && AC_MSG_ERROR(thin_check not found in path $PATH)
+       fi
+       ;;
+esac
+
+AC_DEFINE_UNQUOTED([THIN_CHECK_CMD], ["$THIN_CHECK_CMD"],
+                  [The path to 'thin_check', if available.])
+
+
 ################################################################################
 dnl -- Disable readline
 AC_MSG_CHECKING(whether to enable readline)
 AC_ARG_ENABLE([readline],
-  [  --disable-readline      Disable readline support],
-  [READLINE=$enableval], [READLINE=maybe])
+             AC_HELP_STRING([--disable-readline], [disable readline support]),
+             READLINE=$enableval, READLINE=maybe)
 AC_MSG_RESULT($READLINE)
 
 ################################################################################
 dnl -- Disable realtime clock support
 AC_MSG_CHECKING(whether to enable realtime support)
-AC_ARG_ENABLE(realtime, [  --disable-realtime      Disable realtime clock support],
-REALTIME=$enableval)
+AC_ARG_ENABLE(realtime,
+             AC_HELP_STRING([--enable-realtime], [enable realtime clock support]),
+             REALTIME=$enableval)
 AC_MSG_RESULT($REALTIME)
 
+################################################################################
+dnl -- disable OCF resource agents
+AC_MSG_CHECKING(whether to enable OCF resource agents)
+AC_ARG_ENABLE(ocf,
+             AC_HELP_STRING([--enable-ocf],
+                            [enable Open Cluster Framework (OCF) compliant resource agents]),
+             OCF=$enableval, OCF=no)
+AC_MSG_RESULT($OCF)
+AC_ARG_WITH(ocfdir,
+           AC_HELP_STRING([--with-ocfdir=DIR],
+                          [install OCF files in DIR [[PREFIX/lib/ocf/resource.d/lvm2]]]),
+           OCFDIR=$withval, OCFDIR='${prefix}/lib/ocf/resource.d/lvm2')
+
+################################################################################
+dnl -- Init pkg-config with dummy invokation:
+dnl -- this is required because PKG_CHECK_MODULES macro is expanded
+dnl -- to initialize the pkg-config environment only at the first invokation,
+dnl -- that would be conditional in this configure.in.
+pkg_config_init() {
+       PKG_CHECK_MODULES(PKGCONFIGINIT, pkgconfiginit, [],
+               [AC_MSG_RESULT([pkg-config initialized])])
+       PKGCONFIG_INIT=1
+}
+
 ################################################################################
 dnl -- Build cluster LVM daemon
 AC_MSG_CHECKING(whether to build cluster LVM daemon)
 AC_ARG_WITH(clvmd,
-  [  --with-clvmd=TYPE       Build cluster LVM Daemon.
-                          The following locking combinations are valid:
-                           * cman,gulm             (RHEL4 or equivalent)
+  [  --with-clvmd=TYPE       build cluster LVM Daemon
+                          The following cluster manager combinations are valid:
                            * cman                  (RHEL5 or equivalent)
                            * cman,corosync,openais (or selection of them)
+                           * singlenode            (localhost only)
                            * all                   (autodetect)
                            * none                  (disable build)
-                          [TYPE=none] ],
-  [ CLVMD="$withval" ],
-  [ CLVMD="none" ])
+                          [[TYPE=none]]],
+           CLVMD=$withval, CLVMD=none)
 if test x$CLVMD = xyes; then
        CLVMD=all
 fi
@@ -345,35 +494,36 @@ if  test x$CLVMD != xnone && test x$CLUSTER = xnone; then
        CLUSTER=internal
 fi
 
+dnl -- init pkgconfig if required
+if test x$CLVMD != xnone && test x$PKGCONFIG_INIT != x1; then
+       pkg_config_init
+fi
+
+dnl -- Express clvmd init script Required-Start / Required-Stop
+CLVMD_CMANAGERS=""
+dnl -- On RHEL4/RHEL5, qdiskd is started from a separate init script.
+dnl -- Enable if we are build for cman.
+CLVMD_NEEDS_QDISKD=no
+
 dnl -- define build types
 if [[ `expr x"$CLVMD" : '.*gulm.*'` != 0 ]]; then
-       BUILDGULM=yes
+       AC_MSG_ERROR([Since version 2.02.87 GULM locking is no longer supported.]);
+fi
+if [[ `expr x"$CLVMD" : '.*cman.*'` != 0 ]]; then
+       BUILDCMAN=yes
+       CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman"
+       CLVMD_NEEDS_QDISKD=yes
 fi
 if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
        BUILDCOROSYNC=yes
+       CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync"
 fi
 if [[ `expr x"$CLVMD" : '.*openais.*'` != 0 ]]; then
        BUILDOPENAIS=yes
+       CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais"
 fi
-if [[ `expr x"$CLVMD" : '.*cman.*'` != 0 ]]; then
-       BUILDCMAN=yes
-fi
-
-dnl -- sanity check around user selection
-if test x$BUILDGULM = xyes; then
-       if test x$BUILDCOROSYNC = xyes || \
-          test x$BUILDOPENAIS = xyes; then
-               AC_MSG_ERROR([requested clvmd configuration is not valid])
-       fi
-fi
-
-dnl -- Init pkg-config with dummy invokation:
-dnl -- this is required because PKG_CHECK_MODULES macro is expanded
-dnl -- to initialize the pkg-config environment only at the first invokation,
-dnl -- that would be conditional in this configure.in.
-if  test x$CLVMD != xnone; then
-       PKG_CHECK_MODULES(PKGCONFIGINIT, pkgconfiginit, [],
-               [AC_MSG_RESULT([pkg-config initialized])])
+if test x$CLVMD_NEEDS_QDISKD != xno; then
+       CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd"
 fi
 
 dnl -- define a soft bailout if we are autodetecting
@@ -387,10 +537,9 @@ hard_bailout() {
 
 dnl -- if clvmd=all then set soft_bailout (we don't want to error)
 dnl -- and set all builds to yes. We need to do this here
-dnl -- to skip the gulm + openais|corosync sanity check above.
+dnl -- to skip the openais|corosync sanity check above.
 if test x$CLVMD = xall; then
        bailout=soft_bailout
-       BUILDGULM=yes
        BUILDCMAN=yes
        BUILDCOROSYNC=yes
        BUILDOPENAIS=yes
@@ -412,28 +561,6 @@ check_lib_no_libs() {
        LIBS=$ac_check_lib_save_LIBS
 }
 
-dnl -- Look for gulm libraries if required.
-if test x$BUILDGULM = xyes; then
-       PKG_CHECK_MODULES(CCS, libccs, [HAVE_CCS=yes],
-               [NOTFOUND=0
-               AC_CHECK_HEADERS(ccs.h,,$bailout)
-               check_lib_no_libs ccs ccs_connect
-               if test $NOTFOUND = 0; then
-                       AC_MSG_RESULT([no pkg for libccs, using -lccs])
-                       CCS_LIBS="-lccs"
-                       HAVE_CCS=yes
-               fi])
-       PKG_CHECK_MODULES(GULM, libgulm, [HAVE_GULM=yes],
-               [NOTFOUND=0
-               AC_CHECK_HEADERS(libgulm.h,,$bailout)
-               check_lib_no_libs gulm lg_core_login
-               if test $NOTFOUND = 0; then
-                       AC_MSG_RESULT([no pkg for libgulm, using -lgulm])
-                       GULM_LIBS="-lgulm"
-                       HAVE_GULM=yes
-               fi])
-fi
-
 dnl -- Look for cman libraries if required.
 if test x$BUILDCMAN = xyes; then
        PKG_CHECK_MODULES(CMAN, libcman, [HAVE_CMAN=yes],
@@ -456,6 +583,7 @@ if test x$BUILDCOROSYNC = xyes || \
    test x$BUILDOPENAIS = xyes; then
        PKG_CHECK_MODULES(COROSYNC, corosync, [HAVE_COROSYNC=yes], $bailout)
        CHECKCONFDB=yes
+       CHECKCMAP=yes
 fi
 
 dnl -- Look for corosync libraries if required.
@@ -474,7 +602,7 @@ fi
 dnl -- Below are checks for libraries common to more than one build.
 
 dnl -- Check confdb library.
-dnl -- mandatory for corosync build.
+dnl -- mandatory for corosync < 2.0 build.
 dnl -- optional for openais/cman build.
 
 if test x$CHECKCONFDB = xyes; then
@@ -493,11 +621,34 @@ if test x$CHECKCONFDB = xyes; then
                CONFDB_LIBS="-lconfdb"
                HAVE_CONFDB=yes
        fi
+fi
+
+dnl -- Check cmap library
+dnl -- mandatory for corosync >= 2.0 build.
+
+if test x$CHECKCMAP = xyes; then
+       PKG_CHECK_MODULES(CMAP, libcmap,
+                         [HAVE_CMAP=yes],
+                         [HAVE_CMAP=no])
+
+       AC_CHECK_HEADERS(corosync/cmap.h,
+               [HAVE_CMAP_H=yes],
+               [HAVE_CMAP_H=no])
+
+       if test x$HAVE_CMAP != xyes && \ 
+          test x$HAVE_CMAP_H = xyes; then
+               check_lib_no_libs cmap cmap_initialize
+               AC_MSG_RESULT([no pkg for cmap, using -lcmap])
+               CMAP_LIBS="-lcmap"
+               HAVE_CMAP=yes
+       fi
+fi
 
-       if test x$BUILDCOROSYNC = xyes && \
-          test x$HAVE_CONFDB != xyes &&
+if test x$BUILDCOROSYNC = xyes; then
+       if test x$HAVE_CMAP != xyes && \
+          test x$HAVE_CONFDB != xyes && \
           test x$CLVMD != xall; then
-               AC_MSG_ERROR([bailing out... confdb library is required])
+               AC_MSG_ERROR([bailing out... cmap (corosync >= 2.0) or confdb (corosync < 2.0) library is required])
        fi
 fi
 
@@ -520,71 +671,111 @@ if test x$CHECKDLM = xyes; then
 fi
 
 dnl -- If we are autodetecting, we need to re-create
-dnl -- the depedencies checks and set a proper CLVMD.
+dnl -- the depedencies checks and set a proper CLVMD,
+dnl -- together with init script Required-Start/Stop entries.
 if test x$CLVMD = xall; then
-       if test x$HAVE_CCS = xyes && \
-          test x$HAVE_GULM = xyes; then
-               AC_MSG_RESULT([Enabling clvmd gulm backend])
-               NEWCLVMD="$NEWCLVMD,gulm"
-       fi
+       CLVMD=none
+       CLVMD_CMANAGERS=""
+       CLVMD_NEEDS_QDISKD=no
        if test x$HAVE_CMAN = xyes && \
           test x$HAVE_DLM = xyes; then
-               AC_MSG_RESULT([Enabling clvmd cman backend])
-               NEWCLVMD="$NEWCLVMD,cman"
+               AC_MSG_RESULT([Enabling clvmd cman cluster manager])
+               CLVMD="$CLVMD,cman"
+               CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman"
+               CLVMD_NEEDS_QDISKD=yes
        fi
        if test x$HAVE_COROSYNC = xyes && \
           test x$HAVE_QUORUM = xyes && \
           test x$HAVE_CPG = xyes && \
-          test x$HAVE_DLM = xyes && \
-          test x$HAVE_CONFDB = xyes; then
-               AC_MSG_RESULT([Enabling clvmd corosync backend])
-               NEWCLVMD="$NEWCLVMD,corosync"
+          test x$HAVE_DLM = xyes; then
+          if test x$HAVE_CONFDB = xyes || test x$HAVE_CMAP = xyes; then
+               AC_MSG_RESULT([Enabling clvmd corosync cluster manager])
+               CLVMD="$CLVMD,corosync"
+               CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync"
+          fi
        fi
        if test x$HAVE_COROSYNC = xyes && \
           test x$HAVE_CPG = xyes && \
           test x$HAVE_SALCK = xyes; then
-               AC_MSG_RESULT([Enabling clvmd openais backend])
-               NEWCLVMD="$NEWCLVMD,openais"
+               AC_MSG_RESULT([Enabling clvmd openais cluster manager])
+               CLVMD="$CLVMD,openais"
+               CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais"
+       fi
+       if test x$CLVMD_NEEDS_QDISKD != xno; then
+               CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd"
        fi
-       CLVMD="$NEWCLVMD"
+       if test x$CLVMD = xnone; then
+               AC_MSG_RESULT([Disabling clvmd build. No cluster manager detected.])
+       fi
+fi
+
+dnl -- Fixup CLVMD_CMANAGERS with new corosync
+dnl -- clvmd built with corosync >= 2.0 needs dlm (either init or systemd service)
+dnl -- to be started.
+if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
+   if test x$HAVE_CMAP = xyes; then
+       CLVMD_CMANAGERS="$CLVMD_CMANAGERS dlm"
+   fi
+fi
+
+################################################################################
+dnl -- clvmd pidfile
+if test "x$CLVMD" != xnone; then
+       AC_ARG_WITH(clvmd-pidfile,
+                   AC_HELP_STRING([--with-clvmd-pidfile=PATH],
+                                  [clvmd pidfile [[/var/run/clvmd.pid]]]),
+                   CLVMD_PIDFILE=$withval,
+                   CLVMD_PIDFILE="/var/run/clvmd.pid")
+       AC_DEFINE_UNQUOTED(CLVMD_PIDFILE, ["$CLVMD_PIDFILE"],
+                          [Path to clvmd pidfile.])
 fi
 
 ################################################################################
 dnl -- Build cluster mirror log daemon
 AC_MSG_CHECKING(whether to build cluster mirror log daemon)
-AC_ARG_ENABLE(cmirrord, [  --enable-cmirrord       Enable the cluster mirror log daemon],
-CMIRRORD=$enableval, CMIRRORD=no)
+AC_ARG_ENABLE(cmirrord,
+             AC_HELP_STRING([--enable-cmirrord],
+                            [enable the cluster mirror log daemon]),
+             CMIRRORD=$enableval, CMIRRORD=no)
 AC_MSG_RESULT($CMIRRORD)
 
 BUILD_CMIRRORD=$CMIRRORD
 
 ################################################################################
 dnl -- cmirrord pidfile
-AH_TEMPLATE(CMIRRORD_PIDFILE, [Path to cmirrord pidfile.])
 if test "x$BUILD_CMIRRORD" = xyes; then
        AC_ARG_WITH(cmirrord-pidfile,
-                   [  --with-cmirrord-pidfile=PATH    cmirrord pidfile [[/var/run/cmirrord.pid]] ],
-                   [ AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE,"$withval") ],
-                   [ AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE,"/var/run/cmirrord.pid") ])
+                   AC_HELP_STRING([--with-cmirrord-pidfile=PATH],
+                                  [cmirrord pidfile [[/var/run/cmirrord.pid]]]),
+                   CMIRRORD_PIDFILE=$withval,
+                   CMIRRORD_PIDFILE="/var/run/cmirrord.pid")
+       AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE, ["$CMIRRORD_PIDFILE"],
+                          [Path to cmirrord pidfile.])
 fi
 
 ################################################################################
 dnl -- Look for corosync libraries if required.
 if [[ "x$BUILD_CMIRRORD" = xyes ]]; then
-#
-#       FIXME: ALSO NEED TO CHECK FOR CHECKPOINT MODULE
-#       FIXME: Merge this with the new clvmd logic
-#
-       PKG_CHECK_MODULES(CPG, libcpg, [],
-               [AC_MSG_RESULT([no pkg for libcpg library, using -lcpg]);
-               CPG_LIBS="-lcpg"])
+       dnl -- init pkgconfig if required
+       if  test x$PKGCONFIG_INIT != x1; then
+               pkg_config_init
+       fi
+
+       AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 1, [Define to 1 to include libSaCkpt.])
+       PKG_CHECK_MODULES(SACKPT, libSaCkpt, [HAVE_SACKPT=yes],
+               [AC_MSG_RESULT([no libSaCkpt, compiling without it])
+               AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 0, [Define to 0 to exclude libSaCkpt.])])
+
+       if test x$HAVE_CPG != xyes; then
+               PKG_CHECK_MODULES(CPG, libcpg)
+       fi
 fi
 
 ################################################################################
 dnl -- Enable debugging
 AC_MSG_CHECKING(whether to enable debugging)
-AC_ARG_ENABLE(debug,    [  --enable-debug          Enable debugging],
-  DEBUG=$enableval, DEBUG=no)
+AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable debugging]),
+             DEBUG=$enableval, DEBUG=no)
 AC_MSG_RESULT($DEBUG)
 
 dnl -- Normally turn off optimisation for debug builds
@@ -598,70 +789,170 @@ fi
 dnl -- Override optimisation
 AC_MSG_CHECKING(for C optimisation flag)
 AC_ARG_WITH(optimisation,
-  [  --with-optimisation=OPT C optimisation flag [[OPT=-O2]] ],
-  [ COPTIMISE_FLAG="$withval" ])
+           AC_HELP_STRING([--with-optimisation=OPT],
+                          [C optimisation flag [[OPT=-O2]]]),
+           COPTIMISE_FLAG=$withval)
 AC_MSG_RESULT($COPTIMISE_FLAG)
 
 ################################################################################
 dnl -- Enable profiling
 AC_MSG_CHECKING(whether to gather gcov profiling data)
 AC_ARG_ENABLE(profiling,
-  AC_HELP_STRING(--enable-profiling, [Gather gcov profiling data]),
-  PROFILING=$enableval, PROFILING=no)
+             AC_HELP_STRING(--enable-profiling, [gather gcov profiling data]),
+             PROFILING=$enableval, PROFILING=no)
 AC_MSG_RESULT($PROFILING)
 
 if test "x$PROFILING" = xyes; then
   COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage"
-  AC_PATH_PROG(LCOV, lcov, no)
-  AC_PATH_PROG(GENHTML, genhtml, no)
-  if test "$LCOV" = no -o "$GENHTML" = no ; then
+  AC_PATH_PROG(LCOV, lcov)
+  AC_PATH_PROG(GENHTML, genhtml)
+  if test -z "$LCOV" -o -z "$GENHTML"; then
     AC_MSG_ERROR([lcov and genhtml are required for profiling])
   fi
+  AC_PATH_PROG(GENPNG, genpng)
+  if test -n "$GENPNG"; then
+    AC_MSG_CHECKING([whether $GENPNG has all required modules])
+    if $GENPNG --help > /dev/null 2>&1 ; then
+      AC_MSG_RESULT(ok)
+      GENHTML="$GENHTML --frames"
+    else
+      AC_MSG_RESULT(not supported)
+      AC_MSG_WARN([GD.pm perl module is not installed])
+      GENPNG=
+    fi
+  fi
+fi
+
+################################################################################
+dnl -- Enable testing
+AC_MSG_CHECKING(whether to enable unit testing)
+AC_ARG_ENABLE(testing,
+              AC_HELP_STRING(--enable-testing, [enable testing targets in the makefile]),
+              TESTING=$enableval, TESTING=no)
+AC_MSG_RESULT($TESTING)
+
+if test "$TESTING" = yes; then
+       PKG_CHECK_MODULES(CUNIT, cunit >= 2.0)
+fi
+
+################################################################################
+dnl -- Enable valgrind awareness of memory pools
+AC_MSG_CHECKING(whether to enable valgrind awareness of pools)
+AC_ARG_ENABLE(valgrind_pool,
+              AC_HELP_STRING(--enable-valgrind-pool, [enable valgrind awareness of pools]),
+             VALGRIND_POOL=$enableval, VALGRIND_POOL=no)
+AC_MSG_RESULT($VALGRIND_POOL)
+
+if test "$VALGRIND_POOL" = yes; then
+    AC_CHECK_HEADERS([valgrind/memcheck.h], , [AC_MSG_ERROR(bailing out)])
+    AC_DEFINE([VALGRIND_POOL], 1, [Enable a valgrind aware build of pool])
 fi
 
 ################################################################################
 dnl -- Disable devmapper
 AC_MSG_CHECKING(whether to use device-mapper)
-AC_ARG_ENABLE(devmapper, [  --disable-devmapper     Disable LVM2 device-mapper interaction],
-DEVMAPPER=$enableval)
+AC_ARG_ENABLE(devmapper,
+             AC_HELP_STRING([--disable-devmapper],
+                            [disable LVM2 device-mapper interaction]),
+             DEVMAPPER=$enableval)
 AC_MSG_RESULT($DEVMAPPER)
 
 if test x$DEVMAPPER = xyes; then
        AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.])
 fi
 
+################################################################################
+dnl -- Build lvmetad
+AC_MSG_CHECKING(whether to build LVMetaD)
+AC_ARG_ENABLE(lvmetad,
+             AC_HELP_STRING([--enable-lvmetad],
+                            [enable the LVM Metadata Daemon]),
+             LVMETAD=$enableval)
+AC_MSG_RESULT($LVMETAD)
+
+BUILD_LVMETAD=$LVMETAD
+
+if test x$BUILD_LVMETAD = xyes; then
+       AC_DEFINE([LVMETAD_SUPPORT], 1, [Define to 1 to include code that uses lvmetad.])
+fi
+
 ################################################################################
 dnl -- Enable udev synchronisation
 AC_MSG_CHECKING(whether to enable synchronisation with udev processing)
-AC_ARG_ENABLE(udev_sync, [  --enable-udev_sync      Enable synchronisation with udev processing],
-UDEV_SYNC=$enableval, UDEV_SYNC=no)
+AC_ARG_ENABLE(udev_sync,
+             AC_HELP_STRING([--enable-udev_sync], 
+                            [enable synchronisation with udev processing]),
+             UDEV_SYNC=$enableval, UDEV_SYNC=no)
 AC_MSG_RESULT($UDEV_SYNC)
 
 if test x$UDEV_SYNC = xyes; then
+       dnl -- init pkgconfig if required
+       if  test x$PKGCONFIG_INIT != x1; then
+               pkg_config_init
+       fi
+       PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
        AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
 fi
 
 dnl -- Enable udev rules
 AC_MSG_CHECKING(whether to enable installation of udev rules required for synchronisation)
-AC_ARG_ENABLE(udev_rules, [  --enable-udev_rules     Install rule files needed for udev synchronisation],
-UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC)
+AC_ARG_ENABLE(udev_rules,
+             AC_HELP_STRING([--enable-udev_rules],
+                            [install rule files needed for udev synchronisation]),
+             UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC)
 AC_MSG_RESULT($UDEV_RULES)
 
+if test x$UDEV_RULES = xyes; then
+       AC_MSG_CHECKING(whether udev supports builtin blkid)
+       udev_version=$(udevadm info --version 2>/dev/null)
+       if test -n "$udev_version" && test "$udev_version" -ge 176; then
+               UDEV_HAS_BUILTIN_BLKID=yes
+       else
+               UDEV_HAS_BUILTIN_BLKID=no
+       fi
+       AC_MSG_RESULT($UDEV_HAS_BUILTIN_BLKID)
+fi
+
 ################################################################################
 dnl -- Compatibility mode
-AC_ARG_ENABLE(compat,   [  --enable-compat         Enable support for old device-mapper versions],
-  DM_COMPAT=$enableval, DM_COMPAT=no)
+AC_ARG_ENABLE(compat,
+             AC_HELP_STRING([--enable-compat],
+                            [enable support for old device-mapper versions]),
+             DM_COMPAT=$enableval, DM_COMPAT=no)
+
+if test x$DM_COMPAT = xyes; then
+       AC_MSG_ERROR(
+                 [--enable-compat is not currently supported.
+Since device-mapper version 1.02.66, only one version (4) of the device-mapper 
+ioctl protocol is supported.]
+       )
+fi
+
+################################################################################
+dnl -- Compatible units suffix mode
+AC_ARG_ENABLE(units-compat,
+             AC_HELP_STRING([--enable-units-compat],
+                            [enable output compatibility with old versions that
+                             that do not use KiB-style unit suffixes]),
+             UNITS_COMPAT=$enableval, UNITS_COMPAT=no)
+
+if test x$UNITS_COMPAT = xyes; then
+       AC_DEFINE([DEFAULT_SI_UNIT_CONSISTENCY], 0, [Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes.])
+fi
 
 ################################################################################
 dnl -- Disable ioctl
-AC_ARG_ENABLE(ioctl,   [  --disable-driver        Disable calls to device-mapper in the kernel],
-  DM_IOCTLS=$enableval)
+AC_ARG_ENABLE(ioctl,
+             AC_HELP_STRING([--disable-driver],
+                            [disable calls to device-mapper in the kernel]),
+             DM_IOCTLS=$enableval)
 
 ################################################################################
 dnl -- Disable O_DIRECT
 AC_MSG_CHECKING(whether to enable O_DIRECT)
-AC_ARG_ENABLE(o_direct, [  --disable-o_direct      Disable O_DIRECT],
-ODIRECT=$enableval)
+AC_ARG_ENABLE(o_direct,
+             AC_HELP_STRING([--disable-o_direct], [disable O_DIRECT]),
+             ODIRECT=$enableval)
 AC_MSG_RESULT($ODIRECT)
 
 if test x$ODIRECT = xyes; then
@@ -672,8 +963,8 @@ fi
 dnl -- Enable liblvm2app.so
 AC_MSG_CHECKING(whether to build liblvm2app.so application library)
 AC_ARG_ENABLE(applib,
-  [  --enable-applib         Build application library],
-  APPLIB=$enableval, APPLIB=no)
+             AC_HELP_STRING([--enable-applib], [build application library]),
+             APPLIB=$enableval, APPLIB=no)
 AC_MSG_RESULT($APPLIB)
 AC_SUBST([LVM2APP_LIB])
 test x$APPLIB = xyes \
@@ -683,8 +974,9 @@ test x$APPLIB = xyes \
 ################################################################################
 dnl -- Enable cmdlib
 AC_MSG_CHECKING(whether to compile liblvm2cmd.so)
-AC_ARG_ENABLE(cmdlib, [  --enable-cmdlib         Build shared command library],
-CMDLIB=$enableval, CMDLIB=no)
+AC_ARG_ENABLE(cmdlib,
+             AC_HELP_STRING([--enable-cmdlib], [build shared command library]),
+             CMDLIB=$enableval, CMDLIB=no)
 AC_MSG_RESULT($CMDLIB)
 AC_SUBST([LVM2CMD_LIB])
 test x$CMDLIB = xyes \
@@ -693,21 +985,30 @@ test x$CMDLIB = xyes \
 
 ################################################################################
 dnl -- Enable pkg-config
-AC_ARG_ENABLE(pkgconfig,   [  --enable-pkgconfig      Install pkgconfig support],
-  PKGCONFIG=$enableval, PKGCONFIG=no)
+AC_ARG_ENABLE(pkgconfig,
+             AC_HELP_STRING([--enable-pkgconfig], [install pkgconfig support]),
+             PKGCONFIG=$enableval, PKGCONFIG=no)
+
+################################################################################
+dnl -- Enable installation of writable files by user
+AC_ARG_ENABLE(write_install,
+             AC_HELP_STRING([--enable-write_install],
+                            [install user writable files]),
+             WRITE_INSTALL=$enableval, WRITE_INSTALL=no)
 
 ################################################################################
 dnl -- Enable fsadm
 AC_MSG_CHECKING(whether to install fsadm)
-AC_ARG_ENABLE(fsadm, [  --enable-fsadm          Enable fsadm],
-FSADM=$enableval)
+AC_ARG_ENABLE(fsadm, AC_HELP_STRING([--disable-fsadm], [disable fsadm]),
+             FSADM=$enableval)
 AC_MSG_RESULT($FSADM)
 
 ################################################################################
 dnl -- enable dmeventd handling
 AC_MSG_CHECKING(whether to use dmeventd)
-AC_ARG_ENABLE(dmeventd, [  --enable-dmeventd       Enable the device-mapper event daemon],
-DMEVENTD=$enableval)
+AC_ARG_ENABLE(dmeventd, AC_HELP_STRING([--enable-dmeventd],
+                                      [enable the device-mapper event daemon]),
+             DMEVENTD=$enableval)
 AC_MSG_RESULT($DMEVENTD)
 
 BUILD_DMEVENTD=$DMEVENTD
@@ -730,6 +1031,71 @@ if test x$DMEVENTD = xyes; then
        AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.])
 fi
 
+################################################################################
+dnl -- enable veritysetup
+AC_MSG_CHECKING(whether to install veritysetup)
+AC_ARG_WITH(veritysetup, AC_HELP_STRING([--with-veritysetup=TYPE], [build veritysetup using openssl/nss/gcrypt]),
+             VERITYSETUP=$withval)
+AC_MSG_RESULT($VERITYSETUP)
+
+if test x$VERITYSETUP != xno -a x$VERITYSETUP != x; then
+       if test x$PKGCONFIG_INIT != x1; then
+               pkg_config_init
+       fi
+
+       dnl Test OPENSSL
+       if test -z "$VERITYSETUP_CFLAGS" && test x$VERITYSETUP = xyes -o x$VERITYSETUP = xopenssl; then
+               PKG_CHECK_MODULES(OPENSSL, openssl, [
+                       AC_DEFINE([CRYPT_OPENSSL], 1, [Define to 1 if OpenSSL encryption is to be used.])
+                       VERITYSETUP_CFLAGS="$OPENSSL_CFLAGS"
+                       VERITYSETUP_LIBS="`echo "$OPENSSL_LIBS" | sed 's/-lssl\>//'`"
+               ], [
+                       AC_CHECK_LIB(crypto, EVP_get_digestbyname, [
+                               AC_CHECK_HEADER(openssl/evp.h, [
+                                       AC_DEFINE([CRYPT_OPENSSL], 1, [Define to 1 if OpenSSL encryption is to be used.])
+                                       VERITYSETUP_CFLAGS=
+                                       VERITYSETUP_LIBS="-lcrypto"
+                               ])
+                       ])
+               ])
+       fi
+
+       dnl Test NSS
+       if test -z "$VERITYSETUP_CFLAGS" && test x$VERITYSETUP = xyes -o x$VERITYSETUP = xnss; then
+               PKG_CHECK_MODULES(NSS, nss, [
+                       AC_DEFINE([CRYPT_NSS], 1, [Define to 1 if nss encryption is to be used.])
+                       VERITYSETUP_CFLAGS="$NSS_CFLAGS"
+                       VERITYSETUP_LIBS="`echo "$NSS_LIBS" | sed 's/-lsmime3\>//' | sed 's/-lssl3\>//'`"
+               ], true)
+       fi
+
+       dnl Test GCRYPT
+       if test -z "$VERITYSETUP_CFLAGS" && test x$VERITYSETUP = xyes -o x$VERITYSETUP = xgcrypt; then
+               AC_CHECK_LIB(gcrypt, gcry_md_map_name, [
+                       AC_CHECK_HEADER(gcrypt.h, [
+                               AC_DEFINE([CRYPT_GCRYPT], 1, [Define to 1 if gcrpyt encryption is to be used.])
+                               VERITYSETUP_CFLAGS=
+                               VERITYSETUP_LIBS="-lgcrypt"
+                       ])
+               ])
+       fi
+
+       if test -z "$VERITYSETUP_LIBS"; then
+               AC_MSG_ERROR(No cryptographic library for veritysetup found)
+       fi
+       AC_CHECK_LIB(popt, poptGetContext, true, [
+               AC_MSG_ERROR(popt library was not found)
+       ])
+       AC_CHECK_HEADER(popt.h, true, [
+               AC_MSG_ERROR(popt.h was not found)
+       ])
+       VERITYSETUP_LIBS="$VERITYSETUP_LIBS -lpopt"
+       AC_SUBST(VERITYSETUP_CFLAGS)
+       AC_SUBST(VERITYSETUP_LIBS)
+       VERITYSETUP=yes
+fi
+AC_SUBST(VERITYSETUP)
+
 ################################################################################
 dnl -- getline included in recent libc
 
@@ -749,83 +1115,58 @@ if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
  then  exec_prefix="";
 fi;
 
-################################################################################
-dnl -- Check for termcap (Shamelessly copied from parted 1.4.17)
-if test x$READLINE != xno; then
-       AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib],
-         [tg_found=yes], [tg_found=no])
-       test x$READLINE:$tg_found = xyes:no &&
-         AC_MSG_ERROR(
-termcap could not be found which is required for the
---enable-readline option (which is enabled by default).  Either disable readline
-support with --disable-readline or download and install termcap from:
-       ftp.gnu.org/gnu/termcap
-Note: if you are using precompiled packages you will also need the development
-  package as well (which may be called termcap-devel or something similar).
-Note: (n)curses also seems to work as a substitute for termcap.  This was
-  not found either - but you could try installing that as well.
-)
-fi
-
 ################################################################################
 dnl -- Check for dlopen
-AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no)
-
-if [[ "x$HAVE_LIBDL" = xyes ]]; then
+AC_CHECK_LIB(dl, dlopen, [
        AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.])
-       LIBS="-ldl $LIBS"
-else
-       HAVE_LIBDL=no
-fi
+       DL_LIBS="-ldl"
+       HAVE_LIBDL=yes ], [
+       DL_LIBS=
+       HAVE_LIBDL=no ])
 
 ################################################################################
 dnl -- Check for shared/static conflicts
 if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \
       -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \
+      -o "x$RAID" = xshared \
       \) -a "x$STATIC_LINK" = xyes ]];
  then  AC_MSG_ERROR(
 Features cannot be 'shared' when building statically
 )
 fi
 
+################################################################################
+if [[ "$DMEVENTD" = yes -o "$CLVMD" != none ]] ; then
+       AC_CHECK_LIB([pthread], [pthread_mutex_lock],
+               [PTHREAD_LIBS="-lpthread"], hard_bailout)
+fi
+
 ################################################################################
 dnl -- Disable selinux
 AC_MSG_CHECKING(whether to enable selinux support)
-AC_ARG_ENABLE(selinux, [  --disable-selinux       Disable selinux support],
-  SELINUX=$enableval)
+AC_ARG_ENABLE(selinux,
+             AC_HELP_STRING([--disable-selinux], [disable selinux support]),
+             SELINUX=$enableval)
 AC_MSG_RESULT($SELINUX)
 
 ################################################################################
 dnl -- Check for selinux
 if test x$SELINUX = xyes; then
-       AC_CHECK_LIB(sepol, sepol_check_context, HAVE_SEPOL=yes, HAVE_SEPOL=no)
-
-       if test x$HAVE_SEPOL = xyes; then
-               AC_DEFINE([HAVE_SEPOL], 1,
-                 [Define to 1 if sepol_check_context is available.])
-               LIBS="-lsepol $LIBS"
-       fi
-
-       AC_CHECK_LIB(selinux, is_selinux_enabled, HAVE_SELINUX=yes, HAVE_SELINUX=no)
+       AC_CHECK_LIB([sepol], [sepol_check_context], [
+               AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
+               SELINUX_LIBS="-lsepol"])
 
-       if test x$HAVE_SELINUX = xyes; then
+       AC_CHECK_LIB([selinux], [is_selinux_enabled], [
+               AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
+               AC_CHECK_HEADERS([selinux/label.h])
                AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
-               LIBS="-lselinux $LIBS"
-       else
+               SELINUX_LIBS="-lselinux $SELINUX_LIBS"
+               SELINUX_PC="libselinux"
+               HAVE_SELINUX=yes ], [
                AC_MSG_WARN(Disabling selinux)
-       fi
-
-       # With --enable-static_link and selinux enabled, linking
-       # fails on at least Debian unstable due to unsatisfied references
-       # to pthread_mutex_lock and _unlock.  See if we need -lpthread.
-       if test "$STATIC_LINK-$HAVE_SELINUX" = yes-yes; then
-               lvm_saved_libs=$LIBS
-               LIBS="$LIBS -static"
-               AC_SEARCH_LIBS([pthread_mutex_lock], [pthread],
-                 [test "$ac_cv_search_pthread_mutex_lock" = "none required" ||
-                               LIB_PTHREAD=-lpthread])
-               LIBS=$lvm_saved_libs
-       fi
+               SELINUX_LIBS=
+               SELINUX_PC=
+               HAVE_SELINUX=no ])
 fi
 
 ################################################################################
@@ -848,29 +1189,52 @@ AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getop
 ################################################################################
 dnl -- Check for readline (Shamelessly copied from parted 1.4.17)
 if test x$READLINE != xno; then
-       rl_found=yes
-       AC_CHECK_LIB([readline], [readline], , [rl_found=no])
-       test x$READLINE:$rl_found = xyes:no &&
-         AC_MSG_ERROR(
-GNU Readline could not be found which is required for the
+       lvm_saved_libs=$LIBS
+       AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib],
+               READLINE_LIBS=$ac_cv_search_tgetent, [
+               if test "$READLINE" = yes; then
+                       AC_MSG_ERROR(
+[termcap could not be found which is required for the
+--enable-readline option (which is enabled by default).  Either disable readline
+support with --disable-readline or download and install termcap from:
+       ftp.gnu.org/gnu/termcap
+Note: if you are using precompiled packages you will also need the development
+  package as well (which may be called termcap-devel or something similar).
+Note: (n)curses also seems to work as a substitute for termcap.  This was
+  not found either - but you could try installing that as well.])
+               fi])
+       dnl -- Old systems may need extra termcap dependency explicitly in LIBS
+       AC_CHECK_LIB([readline], [readline], [
+               AC_DEFINE([READLINE_SUPPORT], 1,
+                       [Define to 1 to include the LVM readline shell.])
+               dnl -- Try only with -lreadline and check for different symbol
+               LIBS=$lvm_saved_libs
+               AC_CHECK_LIB([readline], [rl_line_buffer],
+                       [ READLINE_LIBS="-lreadline" ], [
+                         AC_MSG_RESULT([linking -lreadline with $READLINE_LIBS needed])
+                         READLINE_LIBS="-lreadline $READLINE_LIBS"
+                       ]) ], [
+               READLINE_LIBS=
+               if test "$READLINE" = yes; then
+                       AC_MSG_ERROR(
+[GNU Readline could not be found which is required for the
 --enable-readline option (which is enabled by default).  Either disable readline
 support with --disable-readline or download and install readline from:
        ftp.gnu.org/gnu/readline
 Note: if you are using precompiled packages you will also need the development
-package as well (which may be called readline-devel or something similar).
-)
-       if test $rl_found = yes; then
-               AC_CHECK_FUNCS([rl_completion_matches])
-               AC_DEFINE([READLINE_SUPPORT], 1,
-                 [Define to 1 to include the LVM readline shell.])
-       fi
+package as well (which may be called readline-devel or something similar).])
+               fi ])
+       LIBS="$READLINE_LIBS $lvm_saved_libs"
+       AC_CHECK_FUNCS([rl_completion_matches])
+       LIBS=$lvm_saved_libs
 fi
 
 ################################################################################
 dnl -- Internationalisation stuff
 AC_MSG_CHECKING(whether to enable internationalisation)
-AC_ARG_ENABLE(nls, [  --enable-nls            Enable Native Language Support],
-               INTL=$enableval, INTL=no)
+AC_ARG_ENABLE(nls,
+             AC_HELP_STRING([--enable-nls], [enable Native Language Support]),
+             INTL=$enableval, INTL=no)
 AC_MSG_RESULT($INTL)
 
 if test x$INTL = xyes; then
@@ -884,43 +1248,67 @@ if test x$INTL = xyes; then
        fi;
 
        AC_ARG_WITH(localedir,
-                   [  --with-localedir=DIR    Translation files in DIR [[PREFIX/share/locale]] ],
-                   [ LOCALEDIR="$withval" ],
-                   [ LOCALEDIR='${prefix}/share/locale' ])
+                   AC_HELP_STRING([--with-localedir=DIR],
+                                  [translation files in DIR
+                                   [[PREFIX/share/locale]]]),
+                   LOCALEDIR=$withval, LOCALEDIR='${prefix}/share/locale')
 fi
 
 ################################################################################
 AC_ARG_WITH(confdir,
-           [  --with-confdir=DIR      Configuration files in DIR [[/etc]]],
-           [ CONFDIR="$withval" ],
-           [ CONFDIR='/etc' ])
+           AC_HELP_STRING([--with-confdir=DIR],
+                          [configuration files in DIR [[/etc]]]),
+           CONFDIR=$withval, CONFDIR="/etc")
 
 AC_ARG_WITH(staticdir,
-           [  --with-staticdir=DIR    Static binary in DIR [[EPREFIX/sbin]]],
-           [ STATICDIR="$withval" ],
-           [ STATICDIR='${exec_prefix}/sbin' ])
+           AC_HELP_STRING([--with-staticdir=DIR],
+                          [static binaries in DIR [[EPREFIX/sbin]]]),
+           STATICDIR=$withval, STATICDIR='${exec_prefix}/sbin')
 
 AC_ARG_WITH(usrlibdir,
-           [  --with-usrlibdir=DIR],
-           [ usrlibdir="$withval"],
-           [ usrlibdir='${prefix}/lib' ])
+           AC_HELP_STRING([--with-usrlibdir=DIR],
+                          [usrlib in DIR [[PREFIX/lib]]]),
+           usrlibdir=$withval, usrlibdir='${prefix}/lib')
 
 AC_ARG_WITH(usrsbindir,
-           [  --with-usrsbindir=DIR],
-           [ usrsbindir="$withval"],
-           [ usrsbindir='${prefix}/sbin' ])
+           AC_HELP_STRING([--with-usrsbindir=DIR],
+                          [usrsbin executables in DIR [[PREFIX/sbin]]]),
+           usrsbindir=$withval, usrsbindir='${prefix}/sbin')
 
 ################################################################################
 AC_ARG_WITH(udev_prefix,
-           [  --with-udev-prefix=UPREFIX      Install udev rule files in UPREFIX [[EPREFIX]]],
-            [ udev_prefix="$withval"],
-            [ udev_prefix='${exec_prefix}' ])
+           AC_HELP_STRING([--with-udev-prefix=UPREFIX],
+                          [install udev rule files in UPREFIX [[EPREFIX]]]),
+           udev_prefix=$withval, udev_prefix='${exec_prefix}')
 
 AC_ARG_WITH(udevdir,
-           [  --with-udevdir=DIR      udev rules in DIR [[UPREFIX/lib/udev/rules.d]]],
-           [ udevdir="$withval"],
-           [ udevdir='${udev_prefix}/lib/udev/rules.d' ])
+           AC_HELP_STRING([--with-udevdir=DIR],
+                          [udev rules in DIR [[UPREFIX/lib/udev/rules.d]]]),
+           udevdir=$withval, udevdir='${udev_prefix}/lib/udev/rules.d')
+
+################################################################################
+dnl -- Get the systemd system unit dir value from pkg_config automatically if value not given explicitly.
+dnl -- This follows the recommendation for systemd integration best practices mentioned in daemon(7) manpage.
+AC_ARG_WITH(systemdsystemunitdir,
+           AC_HELP_STRING([--with-systemdsystemunitdir=DIR],
+                          [systemd service files in DIR]),
+           systemdsystemunitdir=$withval,
+           dnl -- init pkgconfig if required
+           test x$PKGCONFIG_INIT != x1 && pkg_config_init
+           pkg_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd))
+
+if test -n "$pkg_systemdsystemunitdir"; then
+           systemdsystemunitdir=$pkg_systemdsystemunitdir;
+fi
 
+if test -z "$systemdsystemunitdir"; then
+           systemdsystemunitdir='/lib/systemd/system';
+fi
+################################################################################
+AC_ARG_WITH(tmpfilesdir,
+           AC_HELP_STRING([--with-tmpfilesdir=DIR],
+                          [install configuration files for management of volatile files and directories in DIR [[SYSCONFDIR/tmpfiles.d]]]),
+                          tmpfilesdir=$withval, tmpfilesdir='${sysconfdir}/tmpfiles.d')
 ################################################################################
 dnl -- Ensure additional headers required
 if test x$READLINE = xyes; then
@@ -931,7 +1319,6 @@ if test x$CLVMD != xnone; then
        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))
        AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,AC_MSG_ERROR(bailing out))
        AC_FUNC_GETMNTENT
-#      AC_FUNC_REALLOC
        AC_FUNC_SELECT_ARGTYPES
 fi
 
@@ -940,6 +1327,10 @@ if test x$CLUSTER != xnone; then
        AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out))
 fi
 
+if test x$DMEVENTD = xyes; then
+       AC_CHECK_HEADERS(arpa/inet.h,,AC_MSG_ERROR(bailing out))
+fi
+
 if test x$HAVE_LIBDL = xyes; then
        AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out))
 fi
@@ -948,10 +1339,6 @@ if test x$INTL = xyes; then
        AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out))
 fi
 
-if test x$HAVE_SELINUX = xyes; then
-       AC_CHECK_HEADERS(selinux/selinux.h,,AC_MSG_ERROR(bailing out))
-fi
-
 if test x$UDEV_SYNC = xyes; then
        AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,AC_MSG_ERROR(bailing out))
 fi
@@ -963,38 +1350,102 @@ if test x$MODPROBE_CMD != x; then
        AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.])
 fi
 
+
+lvm_exec_prefix=$exec_prefix
+test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$prefix
+test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$ac_default_prefix
+LVM_PATH="$lvm_exec_prefix/sbin/lvm"
+AC_DEFINE_UNQUOTED(LVM_PATH, ["$LVM_PATH"], [Path to lvm binary.])
+
+if  test "$CLVMD" != none; then
+        clvmd_prefix=$ac_default_prefix
+        CLVMD_PATH="$clvmd_prefix/sbin/clvmd"
+        test "$prefix" != NONE && clvmd_prefix=$prefix
+       AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$CLVMD_PATH"], [Path to clvmd binary.])
+fi
+
 ################################################################################
 dnl -- dmeventd pidfile and executable path
-AH_TEMPLATE(DMEVENTD_PIDFILE, [Path to dmeventd pidfile.])
 if test "$BUILD_DMEVENTD" = yes; then
        AC_ARG_WITH(dmeventd-pidfile,
-                   [  --with-dmeventd-pidfile=PATH    dmeventd pidfile [[/var/run/dmeventd.pid]] ],
-                   [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"$withval") ],
-                   [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"/var/run/dmeventd.pid") ])
+                   AC_HELP_STRING([--with-dmeventd-pidfile=PATH],
+                                  [dmeventd pidfile [[/var/run/dmeventd.pid]]]),
+                   DMEVENTD_PIDFILE=$withval,
+                   DMEVENTD_PIDFILE="/var/run/dmeventd.pid")
+       AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE, ["$DMEVENTD_PIDFILE"],
+                          [Path to dmeventd pidfile.])
 fi
 
-AH_TEMPLATE(DMEVENTD_PATH, [Path to dmeventd binary.])
 if test "$BUILD_DMEVENTD" = yes; then
-        dmeventd_prefix="$exec_prefix"
-        if test "x$dmeventd_prefix" = "xNONE"; then
-                dmeventd_prefix="$prefix"
-        fi
-        if test "x$dmeventd_prefix" = "xNONE"; then
-                dmeventd_prefix=""
-        fi
        AC_ARG_WITH(dmeventd-path,
-                   [  --with-dmeventd-path=PATH       dmeventd path [[EPREFIX/sbin/dmeventd]] ],
-                   [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$withval") ],
-                   [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$dmeventd_prefix/sbin/dmeventd") ])
+                   AC_HELP_STRING([--with-dmeventd-path=PATH],
+                                  [dmeventd path [[EPREFIX/sbin/dmeventd]]]),
+                   DMEVENTD_PATH=$withval,
+                   DMEVENTD_PATH="$lvm_exec_prefix/sbin/dmeventd")
+       AC_DEFINE_UNQUOTED(DMEVENTD_PATH, ["$DMEVENTD_PATH"],
+                          [Path to dmeventd binary.])
 fi
 
+AH_TEMPLATE(DEFAULT_RUN_DIR, [Name of default run directory.])
+AC_ARG_WITH(default-run-dir,
+           [  --with-default-run-dir=DIR       Default run directory [[/var/run/lvm]] ],
+           [ DEFAULT_RUN_DIR="$withval" ],
+           [ DEFAULT_RUN_DIR="/var/run/lvm" ])
+AC_DEFINE_UNQUOTED(DEFAULT_RUN_DIR,["$DEFAULT_RUN_DIR"] )
+
+################################################################################
+dnl -- various defaults
+AC_ARG_WITH(default-system-dir,
+           AC_HELP_STRING([--with-default-system-dir=DIR],
+                          [default LVM system directory [[/etc/lvm]]]),
+           DEFAULT_SYS_DIR=$withval, DEFAULT_SYS_DIR="/etc/lvm")
+AC_DEFINE_UNQUOTED(DEFAULT_SYS_DIR, ["$DEFAULT_SYS_DIR"],
+                  [Path to LVM system directory.])
+
+AC_ARG_WITH(default-archive-subdir,
+           AC_HELP_STRING([--with-default-archive-subdir=SUBDIR],
+                          [default metadata archive subdir [[archive]]]),
+           DEFAULT_ARCHIVE_SUBDIR=$withval, DEFAULT_ARCHIVE_SUBDIR=archive)
+AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE_SUBDIR, ["$DEFAULT_ARCHIVE_SUBDIR"],
+                  [Name of default metadata archive subdirectory.])
+
+AC_ARG_WITH(default-backup-subdir,
+           AC_HELP_STRING([--with-default-backup-subdir=SUBDIR],
+                          [default metadata backup subdir [[backup]]]),
+           DEFAULT_BACKUP_SUBDIR=$withval, DEFAULT_BACKUP_SUBDIR=backup)
+AC_DEFINE_UNQUOTED(DEFAULT_BACKUP_SUBDIR, ["$DEFAULT_BACKUP_SUBDIR"],
+                   [Name of default metadata backup subdirectory.])
+
+AC_ARG_WITH(default-cache-subdir,
+           AC_HELP_STRING([--with-default-cache-subdir=SUBDIR],
+                          [default metadata cache subdir [[cache]]]),
+           DEFAULT_CACHE_SUBDIR=$withval, DEFAULT_CACHE_SUBDIR=cache)
+AC_DEFINE_UNQUOTED(DEFAULT_CACHE_SUBDIR, ["$DEFAULT_CACHE_SUBDIR"],
+                  [Name of default metadata cache subdirectory.])
+
+AC_ARG_WITH(default-locking-dir,
+           AC_HELP_STRING([--with-default-locking-dir=DIR],
+                          [default locking directory [[/var/lock/lvm]]]),
+           DEFAULT_LOCK_DIR=$withval, DEFAULT_LOCK_DIR="/var/lock/lvm")
+AC_DEFINE_UNQUOTED(DEFAULT_LOCK_DIR, ["$DEFAULT_LOCK_DIR"],
+                  [Name of default locking directory.])
+
+################################################################################
+dnl -- Setup default data alignment
+AC_ARG_WITH(default-data-alignment,
+           AC_HELP_STRING([--with-default-data-alignment=NUM],
+                          [set the default data alignment in MiB [[1]]]),
+           DEFAULT_DATA_ALIGNMENT=$withval, DEFAULT_DATA_ALIGNMENT=1)
+AC_DEFINE_UNQUOTED(DEFAULT_DATA_ALIGNMENT, [$DEFAULT_DATA_ALIGNMENT],
+                  [Default data alignment.])
+
 ################################################################################
 dnl -- which kernel interface to use (ioctl only)
 AC_MSG_CHECKING(for kernel interface choice)
 AC_ARG_WITH(interface,
-  [  --with-interface=IFACE  Choose kernel interface (ioctl) [[ioctl]] ],
-  [ interface="$withval" ],
-  [ interface=ioctl ])
+           AC_HELP_STRING([--with-interface=IFACE],
+                          [choose kernel interface (ioctl) [[ioctl]]]),
+           interface=$withval, interface=ioctl)
 if [[ "x$interface" != xioctl ]];
 then
   AC_MSG_ERROR(--with-interface=ioctl required. fs no longer supported.)
@@ -1002,14 +1453,14 @@ fi
 AC_MSG_RESULT($interface)
 
 ################################################################################
-DM_LIB_VERSION="\"`cat VERSION_DM 2>/dev/null || echo Unknown`\""
+DM_LIB_VERSION="\"`cat "$srcdir"/VERSION_DM 2>/dev/null || echo Unknown`\""
 AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version])
 
-DM_LIB_PATCHLEVEL=`cat VERSION_DM | $AWK -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'`
+DM_LIB_PATCHLEVEL=`cat "$srcdir"/VERSION_DM | $AWK -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'`
 
-LVM_VERSION="\"`cat VERSION 2>/dev/null || echo Unknown`\""
+LVM_VERSION="\"`cat "$srcdir"/VERSION 2>/dev/null || echo Unknown`\""
 
-VER=`cat VERSION`
+VER=`cat "$srcdir"/VERSION`
 LVM_RELEASE_DATE="\"`echo $VER | $SED 's/.* (//;s/).*//'`\""
 VER=`echo "$VER" | $AWK '{print $1}'`
 LVM_RELEASE="\"`echo "$VER" | $AWK -F '-' '{print $2}'`\""
@@ -1021,10 +1472,10 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[[()]]' '{print $2}'`
 
 ################################################################################
 AC_SUBST(APPLIB)
+AC_SUBST(AWK)
 AC_SUBST(BUILD_CMIRRORD)
 AC_SUBST(BUILD_DMEVENTD)
-AC_SUBST(CCS_CFLAGS)
-AC_SUBST(CCS_LIBS)
+AC_SUBST(BUILD_LVMETAD)
 AC_SUBST(CFLAGS)
 AC_SUBST(CFLOW_CMD)
 AC_SUBST(CLDFLAGS)
@@ -1032,8 +1483,12 @@ AC_SUBST(CLDNOWHOLEARCHIVE)
 AC_SUBST(CLDWHOLEARCHIVE)
 AC_SUBST(CLUSTER)
 AC_SUBST(CLVMD)
+AC_SUBST(CLVMD_CMANAGERS)
+AC_SUBST(CLVMD_PATH)
 AC_SUBST(CMAN_CFLAGS)
 AC_SUBST(CMAN_LIBS)
+AC_SUBST(CMAP_CFLAGS)
+AC_SUBST(CMAP_LIBS)
 AC_SUBST(CMDLIB)
 AC_SUBST(CONFDB_CFLAGS)
 AC_SUBST(CONFDB_LIBS)
@@ -1043,10 +1498,19 @@ AC_SUBST(CPG_CFLAGS)
 AC_SUBST(CPG_LIBS)
 AC_SUBST(CSCOPE_CMD)
 AC_SUBST(DEBUG)
+AC_SUBST(DEFAULT_SYS_DIR)
+AC_SUBST(DEFAULT_ARCHIVE_SUBDIR)
+AC_SUBST(DEFAULT_BACKUP_SUBDIR)
+AC_SUBST(DEFAULT_CACHE_SUBDIR)
+AC_SUBST(DEFAULT_DATA_ALIGNMENT)
+AC_SUBST(DEFAULT_LOCK_DIR)
+AC_SUBST(DEFAULT_RUN_DIR)
 AC_SUBST(DEVMAPPER)
 AC_SUBST(DLM_CFLAGS)
 AC_SUBST(DLM_LIBS)
+AC_SUBST(DL_LIBS)
 AC_SUBST(DMEVENTD)
+AC_SUBST(DMEVENTD_PATH)
 AC_SUBST(DM_COMPAT)
 AC_SUBST(DM_DEVICE_GID)
 AC_SUBST(DM_DEVICE_MODE)
@@ -1054,13 +1518,10 @@ AC_SUBST(DM_DEVICE_UID)
 AC_SUBST(DM_IOCTLS)
 AC_SUBST(DM_LIB_VERSION)
 AC_SUBST(DM_LIB_PATCHLEVEL)
+AC_SUBST(ELDFLAGS)
 AC_SUBST(FSADM)
-AC_SUBST(GROUP)
-AC_SUBST(GULM_CFLAGS)
-AC_SUBST(GULM_LIBS)
 AC_SUBST(HAVE_LIBDL)
 AC_SUBST(HAVE_REALTIME)
-AC_SUBST(HAVE_SELINUX)
 AC_SUBST(INTL)
 AC_SUBST(INTL_PACKAGE)
 AC_SUBST(JOBS)
@@ -1075,22 +1536,42 @@ AC_SUBST(LVM_LIBAPI)
 AC_SUBST(LVM_MAJOR)
 AC_SUBST(LVM_MINOR)
 AC_SUBST(LVM_PATCHLEVEL)
+AC_SUBST(LVM_PATH)
 AC_SUBST(LVM_RELEASE)
 AC_SUBST(LVM_RELEASE_DATE)
 AC_SUBST(MIRRORS)
 AC_SUBST(MSGFMT)
-AC_SUBST(OWNER)
+AC_SUBST(OCF)
+AC_SUBST(OCFDIR)
 AC_SUBST(PKGCONFIG)
 AC_SUBST(POOL)
+AC_SUBST(PTHREAD_LIBS)
 AC_SUBST(QUORUM_CFLAGS)
 AC_SUBST(QUORUM_LIBS)
+AC_SUBST(RAID)
+AC_SUBST(READLINE_LIBS)
+AC_SUBST(REPLICATORS)
+AC_SUBST(SACKPT_CFLAGS)
+AC_SUBST(SACKPT_LIBS)
 AC_SUBST(SALCK_CFLAGS)
 AC_SUBST(SALCK_LIBS)
+AC_SUBST(SELINUX_LIBS)
+AC_SUBST(SELINUX_PC)
 AC_SUBST(SNAPSHOTS)
 AC_SUBST(STATICDIR)
 AC_SUBST(STATIC_LINK)
+AC_SUBST(TESTING)
+AC_SUBST(THIN)
+AC_SUBST(THIN_CHECK_CMD)
+AC_SUBST(UDEV_LIBS)
+AC_SUBST(UDEV_PC)
 AC_SUBST(UDEV_RULES)
-AC_SUBST([LIB_PTHREAD])
+AC_SUBST(UDEV_SYNC)
+AC_SUBST(UDEV_HAS_BUILTIN_BLKID)
+AC_SUBST(CUNIT_LIBS)
+AC_SUBST(CUNIT_CFLAGS)
+AC_SUBST(WRITE_INSTALL)
+AC_SUBST(DMEVENTD_PIDFILE)
 AC_SUBST(interface)
 AC_SUBST(kerneldir)
 AC_SUBST(missingkernel)
@@ -1098,6 +1579,8 @@ AC_SUBST(kernelvsn)
 AC_SUBST(tmpdir)
 AC_SUBST(udev_prefix)
 AC_SUBST(udevdir)
+AC_SUBST(systemdsystemunitdir)
+AC_SUBST(tmpfilesdir)
 AC_SUBST(usrlibdir)
 AC_SUBST(usrsbindir)
 
@@ -1109,21 +1592,33 @@ Makefile
 make.tmpl
 daemons/Makefile
 daemons/clvmd/Makefile
-daemons/clogd/Makefile
+daemons/cmirrord/Makefile
 daemons/dmeventd/Makefile
 daemons/dmeventd/libdevmapper-event.pc
 daemons/dmeventd/plugins/Makefile
+daemons/dmeventd/plugins/lvm2/Makefile
+daemons/dmeventd/plugins/raid/Makefile
 daemons/dmeventd/plugins/mirror/Makefile
 daemons/dmeventd/plugins/snapshot/Makefile
+daemons/dmeventd/plugins/thin/Makefile
+daemons/lvmetad/Makefile
 doc/Makefile
+doc/example.conf
+include/.symlinks
 include/Makefile
 lib/Makefile
 lib/format1/Makefile
 lib/format_pool/Makefile
 lib/locking/Makefile
 lib/mirror/Makefile
+lib/replicator/Makefile
 lib/misc/lvm-version.h
+lib/raid/Makefile
 lib/snapshot/Makefile
+lib/thin/Makefile
+libdaemon/Makefile
+libdaemon/client/Makefile
+libdaemon/server/Makefile
 libdm/Makefile
 libdm/libdevmapper.pc
 liblvm/Makefile
@@ -1131,11 +1626,24 @@ liblvm/liblvm2app.pc
 man/Makefile
 po/Makefile
 scripts/clvmd_init_red_hat
+scripts/cmirrord_init_red_hat
+scripts/lvm2_lvmetad_init_red_hat
+scripts/lvm2_lvmetad_systemd_red_hat.socket
+scripts/lvm2_lvmetad_systemd_red_hat.service
+scripts/lvm2_monitoring_init_red_hat
+scripts/dm_event_systemd_red_hat.service
+scripts/lvm2_monitoring_systemd_red_hat.service
+scripts/lvm2_tmpfiles_red_hat.conf
 scripts/Makefile
 test/Makefile
 test/api/Makefile
+test/unit/Makefile
 tools/Makefile
 udev/Makefile
+unit-tests/datastruct/Makefile
+unit-tests/regex/Makefile
+unit-tests/mm/Makefile
+verity/Makefile
 ])
 AC_OUTPUT
 
This page took 0.067858 seconds and 5 git commands to generate.